@medplum/app 3.1.4 → 3.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-B4iLXt6s.js +563 -0
- package/dist/assets/index-B4iLXt6s.js.map +1 -0
- package/dist/assets/{index-P85yRkCj.css → index-D8AskT8z.css} +1 -1
- package/dist/index.html +3 -3
- package/package.json +16 -16
- package/dist/assets/index-CBraEhHZ.js +0 -563
- package/dist/assets/index-CBraEhHZ.js.map +0 -1
|
@@ -1,563 +0,0 @@
|
|
|
1
|
-
function MS(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 B0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function fg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $S={exports:{}},rf={},LS={exports:{}},Ke={};/**
|
|
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 bc=Symbol.for("react.element"),IR=Symbol.for("react.portal"),AR=Symbol.for("react.fragment"),NR=Symbol.for("react.strict_mode"),OR=Symbol.for("react.profiler"),MR=Symbol.for("react.provider"),$R=Symbol.for("react.context"),LR=Symbol.for("react.forward_ref"),FR=Symbol.for("react.suspense"),zR=Symbol.for("react.memo"),VR=Symbol.for("react.lazy"),U0=Symbol.iterator;function BR(e){return e===null||typeof e!="object"?null:(e=U0&&e[U0]||e["@@iterator"],typeof e=="function"?e:null)}var FS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},zS=Object.assign,VS={};function $a(e,t,n){this.props=e,this.context=t,this.refs=VS,this.updater=n||FS}$a.prototype.isReactComponent={};$a.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")};$a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function BS(){}BS.prototype=$a.prototype;function hg(e,t,n){this.props=e,this.context=t,this.refs=VS,this.updater=n||FS}var mg=hg.prototype=new BS;mg.constructor=hg;zS(mg,$a.prototype);mg.isPureReactComponent=!0;var H0=Array.isArray,US=Object.prototype.hasOwnProperty,pg={current:null},HS={key:!0,ref:!0,__self:!0,__source:!0};function WS(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)US.call(t,r)&&!HS.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:bc,type:e,key:i,ref:s,props:o,_owner:pg.current}}function UR(e,t){return{$$typeof:bc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function gg(e){return typeof e=="object"&&e!==null&&e.$$typeof===bc}function HR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var W0=/\/+/g;function Ph(e,t){return typeof e=="object"&&e!==null&&e.key!=null?HR(""+e.key):t.toString(36)}function Hu(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 bc:case IR:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+Ph(s,0):r,H0(o)?(n="",e!=null&&(n=e.replace(W0,"$&/")+"/"),Hu(o,t,n,"",function(u){return u})):o!=null&&(gg(o)&&(o=UR(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace(W0,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",H0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Ph(i,l);s+=Hu(i,t,n,c,o)}else if(c=BR(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Ph(i,l++),s+=Hu(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 hu(e,t,n){if(e==null)return e;var r=[],o=0;return Hu(e,r,"","",function(i){return t.call(n,i,o++)}),r}function WR(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 _n={current:null},Wu={transition:null},qR={ReactCurrentDispatcher:_n,ReactCurrentBatchConfig:Wu,ReactCurrentOwner:pg};Ke.Children={map:hu,forEach:function(e,t,n){hu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return hu(e,function(){t++}),t},toArray:function(e){return hu(e,function(t){return t})||[]},only:function(e){if(!gg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ke.Component=$a;Ke.Fragment=AR;Ke.Profiler=OR;Ke.PureComponent=hg;Ke.StrictMode=NR;Ke.Suspense=FR;Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=qR;Ke.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=zS({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=pg.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)US.call(t,c)&&!HS.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:bc,type:e.type,key:o,ref:i,props:r,_owner:s}};Ke.createContext=function(e){return e={$$typeof:$R,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:MR,_context:e},e.Consumer=e};Ke.createElement=WS;Ke.createFactory=function(e){var t=WS.bind(null,e);return t.type=e,t};Ke.createRef=function(){return{current:null}};Ke.forwardRef=function(e){return{$$typeof:LR,render:e}};Ke.isValidElement=gg;Ke.lazy=function(e){return{$$typeof:VR,_payload:{_status:-1,_result:e},_init:WR}};Ke.memo=function(e,t){return{$$typeof:zR,type:e,compare:t===void 0?null:t}};Ke.startTransition=function(e){var t=Wu.transition;Wu.transition={};try{e()}finally{Wu.transition=t}};Ke.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ke.useCallback=function(e,t){return _n.current.useCallback(e,t)};Ke.useContext=function(e){return _n.current.useContext(e)};Ke.useDebugValue=function(){};Ke.useDeferredValue=function(e){return _n.current.useDeferredValue(e)};Ke.useEffect=function(e,t){return _n.current.useEffect(e,t)};Ke.useId=function(){return _n.current.useId()};Ke.useImperativeHandle=function(e,t,n){return _n.current.useImperativeHandle(e,t,n)};Ke.useInsertionEffect=function(e,t){return _n.current.useInsertionEffect(e,t)};Ke.useLayoutEffect=function(e,t){return _n.current.useLayoutEffect(e,t)};Ke.useMemo=function(e,t){return _n.current.useMemo(e,t)};Ke.useReducer=function(e,t,n){return _n.current.useReducer(e,t,n)};Ke.useRef=function(e){return _n.current.useRef(e)};Ke.useState=function(e){return _n.current.useState(e)};Ke.useSyncExternalStore=function(e,t,n){return _n.current.useSyncExternalStore(e,t,n)};Ke.useTransition=function(){return _n.current.useTransition()};Ke.version="18.2.0";LS.exports=Ke;var m=LS.exports;const C=fg(m),qS=MS({__proto__:null,default:C},[m]);/**
|
|
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 GR=m,QR=Symbol.for("react.element"),KR=Symbol.for("react.fragment"),YR=Object.prototype.hasOwnProperty,XR=GR.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,JR={key:!0,ref:!0,__self:!0,__source:!0};function GS(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)&&!JR.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:QR,type:e,key:i,ref:s,props:o,_owner:XR.current}}rf.Fragment=KR;rf.jsx=GS;rf.jsxs=GS;$S.exports=rf;var a=$S.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 QS(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 ZR(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 qu="right-scroll-bar-position",Gu="width-before-scroll-bar",e2="with-scroll-bars-hidden",t2="--removed-body-scroll-bar-size";function Th(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function n2(e,t){var n=m.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 r2=typeof window<"u"?m.useLayoutEffect:m.useEffect,q0=new WeakMap;function o2(e,t){var n=n2(t||null,function(r){return e.forEach(function(o){return Th(o,r)})});return r2(function(){var r=q0.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(l){i.has(l)||Th(l,null)}),i.forEach(function(l){o.has(l)||Th(l,s)})}q0.set(n,e)},[e]),n}function i2(e){return e}function s2(e,t){t===void 0&&(t=i2);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 a2(e){e===void 0&&(e={});var t=s2(null);return t.options=eo({async:!0,ssr:!1},e),t}var KS=function(e){var t=e.sideCar,n=QS(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 m.createElement(r,eo({},n))};KS.isSideCarExport=!0;function l2(e,t){return e.useMedium(t),KS}var YS=a2(),kh=function(){},of=m.forwardRef(function(e,t){var n=m.useRef(null),r=m.useState({onScrollCapture:kh,onWheelCapture:kh,onTouchMoveCapture:kh}),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,p=e.noIsolation,g=e.inert,v=e.allowPinchZoom,S=e.as,y=S===void 0?"div":S,x=e.gapMode,w=QS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,j=o2([n,t]),E=eo(eo({},w),o);return m.createElement(m.Fragment,null,d&&m.createElement(b,{sideCar:YS,removeScrollBar:u,shards:f,noIsolation:p,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:x}),s?m.cloneElement(m.Children.only(l),eo(eo({},E),{ref:j})):m.createElement(y,eo({},E,{className:c,ref:j}),l))});of.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};of.classNames={fullWidth:Gu,zeroRight:qu};var c2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function u2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=c2();return t&&e.setAttribute("nonce",t),e}function d2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function f2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var h2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=u2())&&(d2(t,n),f2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},m2=function(){var e=h2();return function(t,n){m.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},XS=function(){var e=m2(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},p2={left:0,top:0,right:0,gap:0},Rh=function(e){return parseInt(e||"",10)||0},g2=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[Rh(n),Rh(r),Rh(o)]},v2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return p2;var t=g2(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])}},y2=XS(),ca="data-scroll-locked",x2=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(e2,` {
|
|
19
|
-
overflow: hidden `).concat(r,`;
|
|
20
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
body[`).concat(ca,`] {
|
|
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(qu,` {
|
|
36
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(Gu,` {
|
|
40
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(qu," .").concat(qu,` {
|
|
44
|
-
right: 0 `).concat(r,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.`).concat(Gu," .").concat(Gu,` {
|
|
48
|
-
margin-right: 0 `).concat(r,`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
body[`).concat(ca,`] {
|
|
52
|
-
`).concat(t2,": ").concat(l,`px;
|
|
53
|
-
}
|
|
54
|
-
`)},G0=function(){var e=parseInt(document.body.getAttribute(ca)||"0",10);return isFinite(e)?e:0},w2=function(){m.useEffect(function(){return document.body.setAttribute(ca,(G0()+1).toString()),function(){var e=G0()-1;e<=0?document.body.removeAttribute(ca):document.body.setAttribute(ca,e.toString())}},[])},S2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;w2();var i=m.useMemo(function(){return v2(o)},[o]);return m.createElement(y2,{styles:x2(i,!t,o,n?"":"!important")})},Rm=!1;if(typeof window<"u")try{var mu=Object.defineProperty({},"passive",{get:function(){return Rm=!0,!0}});window.addEventListener("test",mu,mu),window.removeEventListener("test",mu,mu)}catch{Rm=!1}var As=Rm?{passive:!1}:!1,b2=function(e){return e.tagName==="TEXTAREA"},JS=function(e,t){var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b2(e)&&n[t]==="visible")},C2=function(e){return JS(e,"overflowY")},E2=function(e){return JS(e,"overflowX")},Q0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=ZS(e,r);if(o){var i=eb(e,r),s=i[1],l=i[2];if(s>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},j2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},P2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},ZS=function(e,t){return e==="v"?C2(t):E2(t)},eb=function(e,t){return e==="v"?j2(t):P2(t)},T2=function(e,t){return e==="h"&&t==="rtl"?-1:1},k2=function(e,t,n,r,o){var i=T2(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 p=eb(e,l),g=p[0],v=p[1],S=p[2],y=v-S-i*g;(g||y)&&ZS(e,l)&&(f+=y,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},pu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},K0=function(e){return[e.deltaX,e.deltaY]},Y0=function(e){return e&&"current"in e?e.current:e},R2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_2=function(e){return`
|
|
55
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
-
`)},D2=0,Ns=[];function I2(e){var t=m.useRef([]),n=m.useRef([0,0]),r=m.useRef(),o=m.useState(D2++)[0],i=m.useState(XS)[0],s=m.useRef(e);m.useEffect(function(){s.current=e},[e]),m.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=ZR([e.lockRef.current],(e.shards||[]).map(Y0),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=m.useCallback(function(v,S){if("touches"in v&&v.touches.length===2)return!s.current.allowPinchZoom;var y=pu(v),x=n.current,w="deltaX"in v?v.deltaX:x[0]-y[0],b="deltaY"in v?v.deltaY:x[1]-y[1],j,E=v.target,T=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var P=Q0(T,E);if(!P)return!0;if(P?j=T:(j=T==="v"?"h":"v",P=Q0(T,E)),!P)return!1;if(!r.current&&"changedTouches"in v&&(w||b)&&(r.current=j),!j)return!0;var _=r.current||j;return k2(_,S,v,_==="h"?w:b,!0)},[]),c=m.useCallback(function(v){var S=v;if(!(!Ns.length||Ns[Ns.length-1]!==i)){var y="deltaY"in S?K0(S):pu(S),x=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&R2(j.delta,y)})[0];if(x&&x.should){S.cancelable&&S.preventDefault();return}if(!x){var w=(s.current.shards||[]).map(Y0).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=m.useCallback(function(v,S,y,x){var w={name:v,delta:S,target:y,should:x,shadowParent:A2(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),d=m.useCallback(function(v){n.current=pu(v),r.current=void 0},[]),f=m.useCallback(function(v){u(v.type,K0(v),v.target,l(v,e.lockRef.current))},[]),h=m.useCallback(function(v){u(v.type,pu(v),v.target,l(v,e.lockRef.current))},[]);m.useEffect(function(){return Ns.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,As),document.addEventListener("touchmove",c,As),document.addEventListener("touchstart",d,As),function(){Ns=Ns.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,As),document.removeEventListener("touchmove",c,As),document.removeEventListener("touchstart",d,As)}},[]);var p=e.removeScrollBar,g=e.inert;return m.createElement(m.Fragment,null,g?m.createElement(i,{styles:_2(o)}):null,p?m.createElement(S2,{gapMode:e.gapMode}):null)}function A2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const N2=l2(YS,I2);var sf=m.forwardRef(function(e,t){return m.createElement(of,eo({},e,{ref:t,sideCar:N2}))});sf.classNames=of.classNames;function St(e){return Object.keys(e)}function _h(e){return e&&typeof e=="object"&&!Array.isArray(e)}function vg(e,t){const n={...e},r=t;return _h(e)&&_h(t)&&Object.keys(t).forEach(o=>{_h(r[o])&&o in e?n[o]=vg(n[o],r[o]):n[o]=r[o]}),n}function O2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function M2(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 _m(e){const t=M2(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 Dh(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function tb(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?Dh(o):o}if(typeof r=="string"){if(r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(i=>n(i)).join(",");if(r.includes(" "))return r.split(" ").map(i=>n(i)).join(" ");if(r.includes(e))return t?Dh(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?Dh(i):i}}return r}return n}const V=tb("rem",{shouldScale:!0}),cd=tb("em");function ms(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function nb(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 Dn(e){const t=m.createContext(null);return[({children:o,value:i})=>C.createElement(t.Provider,{value:i},o),()=>{const o=m.useContext(t);if(o===null)throw new Error(e);return o}]}function Cc(e=null){const t=m.createContext(e);return[({children:o,value:i})=>C.createElement(t.Provider,{value:i},o),()=>m.useContext(t)]}function X0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function ud(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function $2(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 L2(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 F2(e,t,n){return ud(e,n)===ud(t,n)}function rb({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=ud(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(v=>F2(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=L2(u,c,r),f=$2(u,c,r),h=i==="rtl"?f:d,p=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[p].focus(),o&&c[p].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 v=c.length-1;!c[v].disabled&&c[v].focus();break}}}}const z2={app:100,modal:200,popover:300,overlay:400,max:9999};function Ur(e){return z2[e]}const V2=()=>{};function B2(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||V2:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Ne(e,t="size",n=!0){if(e!==void 0)return nb(e)?n?V(e):e:`var(--${t}-${e})`}function ln(e){return Ne(e,"mantine-spacing")}function Ct(e){return e===void 0?"var(--mantine-radius-default)":Ne(e,"mantine-radius")}function nn(e){return Ne(e,"mantine-font-size")}function ob(e){return Ne(e,"mantine-line-height",!1)}function yg(e){if(e)return Ne(e,"mantine-shadow",!1)}function Xn(e,t){return n=>{e==null||e(n),t==null||t(n)}}function xg(e,t){return e in t.breakpoints?_m(t.breakpoints[e]):_m(e)}function Vl(e,t){const n=e.map(r=>({value:r,px:xg(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function oi(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=ud(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function H2(){const[e,t]=m.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function gu(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function wg(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function J0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function zi(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function af(e,t){const n=zi(e),r=m.useRef(0);return m.useEffect(()=>()=>window.clearTimeout(r.current),[]),m.useCallback((...o)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...o),t)},[n,t])}const Z0=["mousedown","touchstart"];function W2(e,t,n){const r=m.useRef();return m.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||Z0).forEach(i=>document.addEventListener(i,o)),()=>{(t||Z0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function ib({timeout:e=2e3}={}){const[t,n]=m.useState(null),[r,o]=m.useState(!1),[i,s]=m.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 q2(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function G2(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function sb(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=m.useState(n?t:G2(e)),i=m.useRef();return m.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),q2(i.current,s=>o(s.matches))},[e]),r}function Q2(e,t){return sb("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const La=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Co(e,t){const n=m.useRef(!1);m.useEffect(()=>()=>{n.current=!1},[]),m.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function ab({opened:e,shouldReturnFocus:t=!0}){const n=m.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 K2(e,t="body > :not(script)"){const n=wg(),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/,lb="a, input, select, textarea, button, object, [tabindex]";function X2(e){return e.style.display==="none"}function J2(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(X2(n))return!1;n=n.parentNode}return!0}function cb(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Dm(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(cb(e));return(Y2.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&J2(e)}function ub(e){const t=cb(e);return(Number.isNaN(t)||t>=0)&&Dm(e)}function Z2(e){return Array.from(e.querySelectorAll(lb)).filter(ub)}function e_(e,t){const n=Z2(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 t_(e=!0){const t=m.useRef(),n=m.useRef(null),r=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const l=Array.from(i.querySelectorAll(lb));s=l.find(ub)||l.find(Dm)||null,!s&&Dm(i)&&(s=i)}s&&s.focus({preventScroll:!0})},o=m.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=K2(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return m.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=s=>{s.key==="Tab"&&t.current&&e_(t.current,s)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const n_=e=>(e+1)%1e6;function r_(){const[,e]=m.useReducer(n_,0);return e}const o_=C.useId||(()=>{});function i_(){const e=o_();return e?`mantine-${e.replace(/:/g,"")}`:""}function In(e){const t=i_(),[n,r]=m.useState(t);return La(()=>{r(wg())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function db(e,t,n){m.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function lf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function s_(...e){return t=>{e.forEach(n=>lf(n,t))}}function Kt(...e){return m.useCallback(s_(...e),e)}function fn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=m.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 Go(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const vu="dots";function a_({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]=fn({value:r,onChange:i,defaultValue:o,finalValue:o}),u=v=>{v<=0?c(1):v>s?c(s):c(v)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),p=()=>u(s);return{range:m.useMemo(()=>{if(t*2+3+n*2>=s)return Go(1,s);const S=Math.max(l-t,n),y=Math.min(l+t,s-n),x=S>n+2,w=y<s-(n+1);if(!x&&w){const b=t*2+n+2;return[...Go(1,b),vu,...Go(s-(n-1),s)]}if(x&&!w){const b=n+1+2*t;return[...Go(1,n),vu,...Go(s-b,s)]}return[...Go(1,n),vu,...Go(S,y),vu,...Go(s-n+1,s)]},[s,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:p}}function Sg(e,t){return sb("(prefers-reduced-motion: reduce)",e,t)}function l_(e=!1,t){const{onOpen:n,onClose:r}=t||{},[o,i]=m.useState(e),s=m.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=m.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=m.useCallback(()=>{o?l():s()},[l,s,o]);return[o,{open:s,close:l,toggle:c}]}function c_(e,t,n={autoInvoke:!1}){const r=m.useRef(null),o=m.useCallback((...s)=>{r.current||(r.current=window.setTimeout(()=>{e(s),r.current=null},t))},[t]),i=m.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return m.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}function u_(e,t,n){const r=m.useRef(),o=m.useRef(null);return m.useEffect(()=>{const i=typeof n=="function"?n():n;return(i||o.current)&&(r.current=new MutationObserver(e),r.current.observe(i||o.current,t)),()=>{var s;(s=r.current)==null||s.disconnect()}},[e,t]),o}function d_(){const[e,t]=m.useState(!1);return m.useEffect(()=>t(!0),[]),e}var f_={};function fb(){return typeof process<"u"&&f_?"production":"development"}function hb(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=hb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function it(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=hb(e))&&(r&&(r+=" "),r+=t);return r}const h_={};function m_(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=it(t[r],o):t[r]=o})}),t}function cf({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||h_);return m_(i)}function dd({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 bg=m.createContext(null);function Fa(){const e=m.useContext(bg);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function p_(){return Fa().cssVariablesResolver}function g_(){return Fa().classNamesPrefix}function Cg(){return Fa().getStyleNonce}function v_(){return Fa().withStaticClasses}function y_(){return Fa().headless}function x_(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function w_(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 S_(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 b_(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,p;return c>=0&&c<1?(f=l,h=u,p=0):c>=1&&c<2?(f=u,h=l,p=0):c>=2&&c<3?(f=0,h=l,p=u):c>=3&&c<4?(f=0,h=u,p=l):c>=4&&c<5?(f=u,h=0,p=l):(f=l,h=0,p=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((p+d)*255),a:s||1}}function Eg(e){return x_(e)?w_(e):e.startsWith("rgb")?S_(e):e.startsWith("hsl")?b_(e):{r:0,g:0,b:0,a:1}}function yu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Eg(e),s=1-t,l=c=>Math.round(c*s);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function Bl(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Ih(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function C_(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function E_(e){if(e.startsWith("oklch("))return(C_(e)||0)/100;const{r:t,g:n,b:r}=Eg(e),o=t/255,i=n/255,s=r/255,l=Ih(o),c=Ih(i),u=Ih(s);return .2126*l+.7152*c+.0722*u}function il(e,t=.179){return e.startsWith("var(")?!1:E_(e)>t}function lo({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:il(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:il(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:il(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][Bl(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:s,isLight:il(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:s,isLight:il(e,t.luminanceThreshold),shade:i,variable:void 0}}function bt(e,t){const n=lo({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Im(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=bt(n.from,t),o=bt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function dr(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}=Eg(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const Os=dr,j_=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=lo({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:`${V(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:`${V(1)} solid transparent`}:{background:e,hover:yu(e,.1),color:l,border:`${V(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:`${V(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:dr(l,.1),hover:dr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${V(1)} solid transparent`}}return{background:dr(e,.1),hover:dr(e,.12),color:e,border:`${V(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:`${V(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:dr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${V(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:dr(e,.05),color:e,border:`${V(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:`${V(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:dr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${V(1)} solid transparent`}}return{background:"transparent",hover:dr(e,.12),color:e,border:`${V(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${V(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${V(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${V(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:yu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${V(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:yu(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${V(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:yu(t.white,.01),color:e,border:`${V(1)} solid transparent`}:n==="gradient"?{background:Im(r,t),hover:Im(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:`${V(1)} solid var(--mantine-color-default-border)`}:{}},P_={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"]},ex="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",jg={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:P_,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:j_,autoContrast:!1,luminanceThreshold:.3,fontFamily:ex,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:ex,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:V(34),lineHeight:"1.3"},h2:{fontSize:V(26),lineHeight:"1.35"},h3:{fontSize:V(22),lineHeight:"1.4"},h4:{fontSize:V(18),lineHeight:"1.45"},h5:{fontSize:V(16),lineHeight:"1.5"},h6:{fontSize:V(14),lineHeight:"1.5"}}},fontSizes:{xs:V(12),sm:V(14),md:V(16),lg:V(18),xl:V(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:V(2),sm:V(4),md:V(8),lg:V(16),xl:V(32)},spacing:{xs:V(10),sm:V(12),md:V(16),lg:V(20),xl:V(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), 0 ${V(1)} ${V(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(10)} ${V(15)} ${V(-5)}, rgba(0, 0, 0, 0.04) 0 ${V(7)} ${V(7)} ${V(-5)}`,md:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(20)} ${V(25)} ${V(-5)}, rgba(0, 0, 0, 0.04) 0 ${V(10)} ${V(10)} ${V(-5)}`,lg:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(28)} ${V(23)} ${V(-7)}, rgba(0, 0, 0, 0.04) 0 ${V(12)} ${V(12)} ${V(-7)}`,xl:`0 ${V(1)} ${V(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${V(36)} ${V(28)} ${V(-7)}, rgba(0, 0, 0, 0.04) 0 ${V(17)} ${V(17)} ${V(-7)}`},other:{},components:{}};function tx(e){return e==="auto"||e==="dark"||e==="light"}function T_({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 tx(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&&tx(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const k_="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",nx="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Ah(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function rx(e){if(!(e.primaryColor in e.colors))throw new Error(k_);if(typeof e.primaryShade=="object"&&(!Ah(e.primaryShade.dark)||!Ah(e.primaryShade.light)))throw new Error(nx);if(typeof e.primaryShade=="number"&&!Ah(e.primaryShade))throw new Error(nx)}function R_(e,t){var r;if(!t)return rx(e),e;const n=vg(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),rx(n),n}const Pg=m.createContext(null),__=()=>m.useContext(Pg)||jg;function Nt(){const e=m.useContext(Pg);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 mb({theme:e,children:t,inherit:n=!0}){const r=__(),o=m.useMemo(()=>R_(n?r:jg,e),[e,r,n]);return C.createElement(Pg.Provider,{value:o},t)}mb.displayName="@mantine/core/MantineThemeProvider";function D_(){const e=Nt(),t=Cg(),n=St(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),s=_m(e.breakpoints[o]),l=i?`${s-.1}px`:cd(s-.1),c=i?`${s}px`:cd(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 Nh(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Oh(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function I_(e,t){const n=Nh(e.variables),r=n?Oh(t,n):"",o=Nh(e.dark),i=o?Oh(`${t}[data-mantine-color-scheme="dark"]`,o):"",s=Nh(e.light),l=s?Oh(`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${i}${l}`}function ps({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&lo({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function ox(e,t){return ps({color:e.colors[e.primaryColor][Bl(e,t)],theme:e,autoContrast:null})}function xu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=Bl(e,"light"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:Os(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:Os(e.colors[t][l],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:Os(e.colors[t][l],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}const i=Bl(e,"dark"),s={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${i===9?8:i+1})`,[`--mantine-color-${r}-light`]:Os(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:Os(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Os(e.colors[t][Math.max(i-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...s}:s}function A_(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Ms(e,t,n){St(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const pb=e=>{const t=Bl(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:V(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--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":n,"--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":ox(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}-${t})`,"--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)","--mantine-color-dimmed":"var(--mantine-color-gray-6)"},dark:{"--mantine-primary-color-contrast":ox(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)","--mantine-color-dimmed":"var(--mantine-color-dark-2)"}};Ms(r.variables,e.breakpoints,"breakpoint"),Ms(r.variables,e.spacing,"spacing"),Ms(r.variables,e.fontSizes,"font-size"),Ms(r.variables,e.lineHeights,"line-height"),Ms(r.variables,e.shadows,"shadow"),Ms(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,s)=>{r.variables[`--mantine-primary-color-${s}`]=`var(--mantine-color-${e.primaryColor}-${s})`}),St(e.colors).forEach(i=>{const s=e.colors[i];if(A_(s)){Object.assign(r.light,xu({theme:e,name:s.name,color:s.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,xu({theme:e,name:s.name,color:s.dark,colorScheme:"dark",withColorValues:!0}));return}s.forEach((l,c)=>{r.variables[`--mantine-color-${i}-${c}`]=l}),Object.assign(r.light,xu({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,xu({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return St(o).forEach(i=>{r.variables[`--mantine-${i}-font-size`]=o[i].fontSize,r.variables[`--mantine-${i}-line-height`]=o[i].lineHeight,r.variables[`--mantine-${i}-font-weight`]=o[i].fontWeight||e.headings.fontWeight}),r};function N_({theme:e,generator:t}){const n=pb(e),r=t==null?void 0:t(e);return r?vg(n,r):n}const Mh=pb(jg);function O_(e){const t={variables:{},light:{},dark:{}};return St(e.variables).forEach(n=>{Mh.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),St(e.light).forEach(n=>{Mh.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),St(e.dark).forEach(n=>{Mh.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function M_(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 gb({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Nt(),r=Cg(),o=p_(),i=N_({theme:n,generator:o}),s=e===":root"&&t,l=s?O_(i):i,c=I_(l,e);return c?C.createElement("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${s?"":M_(e)}`}}):null}gb.displayName="@mantine/CssVariables";function $_(){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 $s(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 L_({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=m.useRef(),[i,s]=m.useState(()=>e.get(t)),l=r||i,c=m.useCallback(d=>{r||($s(d,n),s(d),e.set(d))},[e.set,l,r]),u=m.useCallback(()=>{s(t),$s(t,n),e.clear()},[e.clear,t]);return m.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),La(()=>{$s(e.get(t),n)},[]),m.useEffect(()=>{var f;if(r)return $s(r,n),()=>{};r===void 0&&$s(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&$s(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 F_({respectReducedMotion:e,getRootElement:t}){La(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}$_();function vb({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=T_(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:p}){const{colorScheme:g,setColorScheme:v,clearColorScheme:S}=L_({defaultColorScheme:d,forceColorScheme:p,manager:u,getRootElement:f});return F_({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),C.createElement(bg.Provider,{value:{colorScheme:g,setColorScheme:v,clearColorScheme:S,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r}},C.createElement(mb,{theme:e},s&&C.createElement(gb,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&C.createElement(D_,null),t))}vb.displayName="@mantine/core/MantineProvider";function Ec({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Nt();return{resolvedClassNames:cf({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:dd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const z_={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function V_({theme:e,options:t,unstyled:n}){return it((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||z_[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function B_({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return cf({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function U_({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return cf({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function H_({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function W_({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function q_({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function G_({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var s,l;return(l=cf({theme:t,classNames:(s=t.components[i])==null?void 0:s.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function Q_({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function K_({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:p}){return it(V_({theme:e,options:t,unstyled:l||p}),G_({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),Q_({options:t,classes:s,selector:r,unstyled:l}),U_({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),B_({selector:r,stylesCtx:f,options:t,props:d,theme:e}),H_({rootSelector:u,selector:r,className:c}),W_({selector:r,classes:s,unstyled:l||p}),h&&!p&&q_({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function Y_({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var s;return dd({theme:e,styles:(s=e.components[i])==null?void 0:s.styles,props:n,stylesCtx:r})[o]}).reduce((i,s)=>({...i,...s}),{})}function Am({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Am({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function X_(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...ms(n[r])}}),t),{})}function J_({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:s,headless:l}){var c;return(c=X_([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 Z_({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{...Y_({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...dd({theme:e,styles:l,props:o,stylesCtx:i})[n],...dd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...J_({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...s===n?Am({style:c,theme:e}):null,...Am({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=Nt(),p=g_(),g=v_(),v=y_(),S=(Array.isArray(e)?e:[e]).filter(y=>y);return(y,x)=>({className:K_({theme:h,options:x,themeName:S,selector:y,classNamesPrefix:p,classNames:c,classes:t,unstyled:l,className:o,rootSelector:s,props:n,stylesCtx:r,withStaticClasses:g,headless:v}),style:Z_({theme:h,themeName:S,selector:y,options:x,props:n,stylesCtx:r,rootSelector:s,styles:u,style:i,vars:d,varsResolver:f,headless:v})})}function jc(e,t){return typeof e=="boolean"?e:t.autoContrast}function ix(){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 eD({keepTransitions:e}={}){const t=m.useRef(),n=m.useRef(),r=m.useContext(bg);if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const o=u=>{r.setColorScheme(u),t.current=e?()=>{}:ix(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var d;(d=t.current)==null||d.call(t)},10)},i=()=>{r.clearColorScheme(),t.current=e?()=>{}:ix(),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var u;(u=t.current)==null||u.call(t)},10)},s=Q2("light",{getInitialValueInEffect:!1}),l=r.colorScheme==="auto"?s:r.colorScheme,c=m.useCallback(()=>o(l==="light"?"dark":"light"),[o,l]);return m.useEffect(()=>()=>{var u;(u=t.current)==null||u.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:i,toggleColorScheme:c}}function H(e,t,n){var s;const r=Nt(),o=(s=r.components[e])==null?void 0:s.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...ms(n)}}function sx(e){return St(e).reduce((t,n)=>e[n]!==void 0?`${t}${O2(n)}:${e[n]};`:t,"").trim()}function tD({selector:e,styles:t,media:n}){const r=t?sx(t):"",o=Array.isArray(n)?n.map(i=>`@media${i.query}{${e}{${sx(i.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${o.join("")}`.trim()}function za({selector:e,styles:t,media:n}){const r=Cg();return C.createElement("style",{"data-mantine-styles":"inline",nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:tD({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:p,pb:g,pl:v,pr:S,pe:y,ps:x,bg:w,c:b,opacity:j,ff:E,fz:T,fw:P,lts:_,ta:D,lh:$,fs:I,tt:L,td:F,w:O,miw:A,maw:R,h:k,mih:M,mah:B,bgsz:U,bgp:X,bgr:re,bga:fe,pos:Ce,top:Te,left:Ae,bottom:pe,right:He,inset:ct,display:We,flex:be,hiddenFrom:ze,visibleFrom:$e,lightHidden:Y,darkHidden:oe,...Ee}=e;return{styleProps:ms({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:p,pb:g,pl:v,pr:S,pe:y,ps:x,bg:w,c:b,opacity:j,ff:E,fz:T,fw:P,lts:_,ta:D,lh:$,fs:I,tt:L,td:F,w:O,miw:A,maw:R,h:k,mih:M,mah:B,bgsz:U,bgp:X,bgr:re,bga:fe,pos:Ce,top:Te,left:Ae,bottom:pe,right:He,inset:ct,display:We,flex:be,hiddenFrom:ze,visibleFrom:$e,lightHidden:Y,darkHidden:oe}),rest:Ee}}const nD={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 yb(e,t){const n=lo({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 rD(e,t){const n=lo({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:yb(e,t)}const ax={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function oD(e){return typeof e=="string"&&e in ax?ax[e]:e}const iD=["h1","h2","h3","h4","h5","h6"];function sD(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&iD.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?V(e):e}function aD(e){return e}const lD=["h1","h2","h3","h4","h5","h6"];function cD(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&lD.includes(e)?`var(--mantine-${e}-line-height)`:e}function uD(e){return typeof e=="number"?V(e):e}function dD(e,t){if(typeof e=="number")return V(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return V(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const $h={color:yb,textColor:rD,fontSize:sD,spacing:dD,identity:aD,size:uD,lineHeight:cD,fontFamily:oD};function lx(e){return e.replace("(min-width: ","").replace("em)","")}function fD({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(lx(o))-Number(lx(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function hD(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function mD(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function pD(e){return typeof e=="object"&&e!==null?St(e).filter(t=>t!=="base"):[]}function gD(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function xb({styleProps:e,data:t,theme:n}){return fD(St(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=mD(e[o]);if(!hD(e[o]))return s.forEach(u=>{r.inlineStyles[u]=$h[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=pD(e[o]);return s.forEach(u=>{l&&(r.styles[u]=$h[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:$h[i.type](gD(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Pc(){return`__m__-${m.useId().replace(/:/g,"")}`}function wb(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...wb(r,t)}),{}):typeof e=="function"?e(t):e??{}}function Sb(e){return e.startsWith("data-")?e:`data-${e}`}function vD(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[Sb(n)]=e[n]),t},{})}function bb(e){return e?typeof e=="string"?{[Sb(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...bb(n)}),{}):vD(e):null}function Nm(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Nm(r,t)}),{}):typeof e=="function"?e(t):e??{}}function yD({theme:e,style:t,vars:n,styleProps:r}){const o=Nm(t,e),i=Nm(n,e);return{...o,...i,...r}}const Cb=m.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},p)=>{const g=Nt(),v=e||"div",{styleProps:S,rest:y}=No(h),x=Pc(),w=xb({styleProps:S,theme:g,data:nD}),b={ref:p,style:yD({theme:g,style:t,vars:n,styleProps:w.inlineStyles}),className:it(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":nb(s)?void 0:s||void 0,...bb(i),...y};return C.createElement(C.Fragment,null,w.hasResponsiveStyles&&C.createElement(za,{selector:`.${x}`,styles:w.styles,media:w.media}),typeof f=="function"?f(b):C.createElement(v,{...b}))});Cb.displayName="@mantine/core/Box";const G=Cb;function Eb(e){return e}function K(e){const t=m.forwardRef(e);return t.extend=Eb,t}function Sn(e){const t=m.forwardRef(e);return t.extend=Eb,t}const xD=m.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Va(){return m.useContext(xD)}var jb={exports:{}},ir={},Pb={exports:{}},Tb={};/**
|
|
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,M){var B=k.length;k.push(M);e:for(;0<B;){var U=B-1>>>1,X=k[U];if(0<o(X,M))k[U]=M,k[B]=X,B=U;else break e}}function n(k){return k.length===0?null:k[0]}function r(k){if(k.length===0)return null;var M=k[0],B=k.pop();if(B!==M){k[0]=B;e:for(var U=0,X=k.length,re=X>>>1;U<re;){var fe=2*(U+1)-1,Ce=k[fe],Te=fe+1,Ae=k[Te];if(0>o(Ce,B))Te<X&&0>o(Ae,Ce)?(k[U]=Ae,k[Te]=B,U=Te):(k[U]=Ce,k[fe]=B,U=fe);else if(Te<X&&0>o(Ae,B))k[U]=Ae,k[Te]=B,U=Te;else break e}}return M}function o(k,M){var B=k.sortIndex-M.sortIndex;return B!==0?B:k.id-M.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,p=!1,g=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,y=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 M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=k)r(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(u)}}function b(k){if(v=!1,w(k),!g)if(n(c)!==null)g=!0,A(j);else{var M=n(u);M!==null&&R(b,M.startTime-k)}}function j(k,M){g=!1,v&&(v=!1,y(P),P=-1),p=!0;var B=h;try{for(w(M),f=n(c);f!==null&&(!(f.expirationTime>M)||k&&!$());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var X=U(f.expirationTime<=M);M=e.unstable_now(),typeof X=="function"?f.callback=X:f===n(c)&&r(c),w(M)}else r(c);f=n(c)}if(f!==null)var re=!0;else{var fe=n(u);fe!==null&&R(b,fe.startTime-M),re=!1}return re}finally{f=null,h=B,p=!1}}var E=!1,T=null,P=-1,_=5,D=-1;function $(){return!(e.unstable_now()-D<_)}function I(){if(T!==null){var k=e.unstable_now();D=k;var M=!0;try{M=T(!0,k)}finally{M?L():(E=!1,T=null)}}else E=!1}var L;if(typeof x=="function")L=function(){x(I)};else if(typeof MessageChannel<"u"){var F=new MessageChannel,O=F.port2;F.port1.onmessage=I,L=function(){O.postMessage(null)}}else L=function(){S(I,0)};function A(k){T=k,E||(E=!0,L())}function R(k,M){P=S(function(){k(e.unstable_now())},M)}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||p||(g=!0,A(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"):_=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 M=3;break;default:M=h}var B=h;h=M;try{return k()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(k,M){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var B=h;h=k;try{return M()}finally{h=B}},e.unstable_scheduleCallback=function(k,M,B){var U=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?U+B:U):B=U,k){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=B+X,k={id:d++,callback:M,priorityLevel:k,startTime:B,expirationTime:X,sortIndex:-1},B>U?(k.sortIndex=B,t(u,k),n(c)===null&&k===n(u)&&(v?(y(P),P=-1):v=!0,R(b,B-U))):(k.sortIndex=X,t(c,k),g||p||(g=!0,A(j))),k},e.unstable_shouldYield=$,e.unstable_wrapCallback=function(k){var M=h;return function(){var B=h;h=M;try{return k.apply(this,arguments)}finally{h=B}}}})(Tb);Pb.exports=Tb;var wD=Pb.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 kb=m,tr=wD;function J(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 Rb=new Set,Ul={};function gs(e,t){xa(e,t),xa(e+"Capture",t)}function xa(e,t){for(Ul[e]=t,e=0;e<t.length;e++)Rb.add(t[e])}var Eo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Om=Object.prototype.hasOwnProperty,SD=/^[: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]*$/,cx={},ux={};function bD(e){return Om.call(ux,e)?!0:Om.call(cx,e)?!1:SD.test(e)?ux[e]=!0:(cx[e]=!0,!1)}function CD(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 ED(e,t,n,r){if(t===null||typeof t>"u"||CD(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 An(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 hn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){hn[e]=new An(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];hn[t]=new An(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){hn[e]=new An(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){hn[e]=new An(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){hn[e]=new An(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){hn[e]=new An(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){hn[e]=new An(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){hn[e]=new An(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){hn[e]=new An(e,5,!1,e.toLowerCase(),null,!1,!1)});var Tg=/[\-:]([a-z])/g;function kg(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(Tg,kg);hn[t]=new An(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(Tg,kg);hn[t]=new An(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(Tg,kg);hn[t]=new An(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){hn[e]=new An(e,1,!1,e.toLowerCase(),null,!1,!1)});hn.xlinkHref=new An("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){hn[e]=new An(e,1,!1,e.toLowerCase(),null,!0,!0)});function Rg(e,t,n,r){var o=hn.hasOwnProperty(t)?hn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(ED(t,n,o,r)&&(n=null),r||o===null?bD(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=kb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,wu=Symbol.for("react.element"),qs=Symbol.for("react.portal"),Gs=Symbol.for("react.fragment"),_g=Symbol.for("react.strict_mode"),Mm=Symbol.for("react.profiler"),_b=Symbol.for("react.provider"),Db=Symbol.for("react.context"),Dg=Symbol.for("react.forward_ref"),$m=Symbol.for("react.suspense"),Lm=Symbol.for("react.suspense_list"),Ig=Symbol.for("react.memo"),Yo=Symbol.for("react.lazy"),Ib=Symbol.for("react.offscreen"),dx=Symbol.iterator;function sl(e){return e===null||typeof e!="object"?null:(e=dx&&e[dx]||e["@@iterator"],typeof e=="function"?e:null)}var At=Object.assign,Lh;function El(e){if(Lh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Lh=t&&t[1]||""}return`
|
|
77
|
-
`+Lh+e}var Fh=!1;function zh(e,t){if(!e||Fh)return"";Fh=!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{Fh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?El(e):""}function jD(e){switch(e.tag){case 5:return El(e.type);case 16:return El("Lazy");case 13:return El("Suspense");case 19:return El("SuspenseList");case 0:case 2:case 15:return e=zh(e.type,!1),e;case 11:return e=zh(e.type.render,!1),e;case 1:return e=zh(e.type,!0),e;default:return""}}function Fm(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 Gs:return"Fragment";case qs:return"Portal";case Mm:return"Profiler";case _g:return"StrictMode";case $m:return"Suspense";case Lm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Db:return(e.displayName||"Context")+".Consumer";case _b:return(e._context.displayName||"Context")+".Provider";case Dg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ig:return t=e.displayName||null,t!==null?t:Fm(e.type)||"Memo";case Yo:t=e._payload,e=e._init;try{return Fm(e(t))}catch{}}return null}function PD(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 Fm(t);case 8:return t===_g?"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 yi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ab(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function TD(e){var t=Ab(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 Su(e){e._valueTracker||(e._valueTracker=TD(e))}function Nb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Ab(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function fd(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 zm(e,t){var n=t.checked;return At({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function fx(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=yi(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 Ob(e,t){t=t.checked,t!=null&&Rg(e,"checked",t,!1)}function Vm(e,t){Ob(e,t);var n=yi(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")?Bm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Bm(e,t.type,yi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function hx(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 Bm(e,t,n){(t!=="number"||fd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var jl=Array.isArray;function ua(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=""+yi(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 Um(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return At({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function mx(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(jl(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:yi(n)}}function Mb(e,t){var n=yi(t.value),r=yi(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 px(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $b(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 Hm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$b(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var bu,Lb=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(bu=bu||document.createElement("div"),bu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=bu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _l={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},kD=["Webkit","ms","Moz","O"];Object.keys(_l).forEach(function(e){kD.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_l[t]=_l[e]})});function Fb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_l.hasOwnProperty(e)&&_l[e]?(""+t).trim():t+"px"}function zb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Fb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var RD=At({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 Wm(e,t){if(t){if(RD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function qm(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 Gm=null;function Ag(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qm=null,da=null,fa=null;function gx(e){if(e=Rc(e)){if(typeof Qm!="function")throw Error(J(280));var t=e.stateNode;t&&(t=mf(t),Qm(e.stateNode,e.type,t))}}function Vb(e){da?fa?fa.push(e):fa=[e]:da=e}function Bb(){if(da){var e=da,t=fa;if(fa=da=null,gx(e),t)for(e=0;e<t.length;e++)gx(t[e])}}function Ub(e,t){return e(t)}function Hb(){}var Vh=!1;function Wb(e,t,n){if(Vh)return e(t,n);Vh=!0;try{return Ub(e,t,n)}finally{Vh=!1,(da!==null||fa!==null)&&(Hb(),Bb())}}function Wl(e,t){var n=e.stateNode;if(n===null)return null;var r=mf(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(J(231,t,typeof n));return n}var Km=!1;if(Eo)try{var al={};Object.defineProperty(al,"passive",{get:function(){Km=!0}}),window.addEventListener("test",al,al),window.removeEventListener("test",al,al)}catch{Km=!1}function _D(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 Dl=!1,hd=null,md=!1,Ym=null,DD={onError:function(e){Dl=!0,hd=e}};function ID(e,t,n,r,o,i,s,l,c){Dl=!1,hd=null,_D.apply(DD,arguments)}function AD(e,t,n,r,o,i,s,l,c){if(ID.apply(this,arguments),Dl){if(Dl){var u=hd;Dl=!1,hd=null}else throw Error(J(198));md||(md=!0,Ym=u)}}function vs(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 qb(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 vx(e){if(vs(e)!==e)throw Error(J(188))}function ND(e){var t=e.alternate;if(!t){if(t=vs(e),t===null)throw Error(J(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 vx(o),e;if(i===r)return vx(o),t;i=i.sibling}throw Error(J(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(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function Gb(e){return e=ND(e),e!==null?Qb(e):null}function Qb(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Qb(e);if(t!==null)return t;e=e.sibling}return null}var Kb=tr.unstable_scheduleCallback,yx=tr.unstable_cancelCallback,OD=tr.unstable_shouldYield,MD=tr.unstable_requestPaint,qt=tr.unstable_now,$D=tr.unstable_getCurrentPriorityLevel,Ng=tr.unstable_ImmediatePriority,Yb=tr.unstable_UserBlockingPriority,pd=tr.unstable_NormalPriority,LD=tr.unstable_LowPriority,Xb=tr.unstable_IdlePriority,uf=null,no=null;function FD(e){if(no&&typeof no.onCommitFiberRoot=="function")try{no.onCommitFiberRoot(uf,e,void 0,(e.current.flags&128)===128)}catch{}}var Or=Math.clz32?Math.clz32:BD,zD=Math.log,VD=Math.LN2;function BD(e){return e>>>=0,e===0?32:31-(zD(e)/VD|0)|0}var Cu=64,Eu=4194304;function Pl(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 gd(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=Pl(l):(i&=s,i!==0&&(r=Pl(i)))}else s=n&~o,s!==0?r=Pl(s):i!==0&&(r=Pl(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-Or(t),o=1<<n,r|=e[n],t&=~o;return r}function UD(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 HD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-Or(i),l=1<<s,c=o[s];c===-1?(!(l&n)||l&r)&&(o[s]=UD(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Xm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jb(){var e=Cu;return Cu<<=1,!(Cu&4194240)&&(Cu=64),e}function Bh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Or(t),e[t]=n}function WD(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-Or(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Og(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Or(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var lt=0;function Zb(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var eC,Mg,tC,nC,rC,Jm=!1,ju=[],li=null,ci=null,ui=null,ql=new Map,Gl=new Map,ti=[],qD="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 xx(e,t){switch(e){case"focusin":case"focusout":li=null;break;case"dragenter":case"dragleave":ci=null;break;case"mouseover":case"mouseout":ui=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(t.pointerId)}}function ll(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=Rc(t),t!==null&&Mg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function GD(e,t,n,r,o){switch(t){case"focusin":return li=ll(li,e,t,n,r,o),!0;case"dragenter":return ci=ll(ci,e,t,n,r,o),!0;case"mouseover":return ui=ll(ui,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ql.set(i,ll(ql.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Gl.set(i,ll(Gl.get(i)||null,e,t,n,r,o)),!0}return!1}function oC(e){var t=Ui(e.target);if(t!==null){var n=vs(t);if(n!==null){if(t=n.tag,t===13){if(t=qb(n),t!==null){e.blockedOn=t,rC(e.priority,function(){tC(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 Qu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Zm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Gm=r,n.target.dispatchEvent(r),Gm=null}else return t=Rc(n),t!==null&&Mg(t),e.blockedOn=n,!1;t.shift()}return!0}function wx(e,t,n){Qu(e)&&n.delete(t)}function QD(){Jm=!1,li!==null&&Qu(li)&&(li=null),ci!==null&&Qu(ci)&&(ci=null),ui!==null&&Qu(ui)&&(ui=null),ql.forEach(wx),Gl.forEach(wx)}function cl(e,t){e.blockedOn===t&&(e.blockedOn=null,Jm||(Jm=!0,tr.unstable_scheduleCallback(tr.unstable_NormalPriority,QD)))}function Ql(e){function t(o){return cl(o,e)}if(0<ju.length){cl(ju[0],e);for(var n=1;n<ju.length;n++){var r=ju[n];r.blockedOn===e&&(r.blockedOn=null)}}for(li!==null&&cl(li,e),ci!==null&&cl(ci,e),ui!==null&&cl(ui,e),ql.forEach(t),Gl.forEach(t),n=0;n<ti.length;n++)r=ti[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ti.length&&(n=ti[0],n.blockedOn===null);)oC(n),n.blockedOn===null&&ti.shift()}var ha=Oo.ReactCurrentBatchConfig,vd=!0;function KD(e,t,n,r){var o=lt,i=ha.transition;ha.transition=null;try{lt=1,$g(e,t,n,r)}finally{lt=o,ha.transition=i}}function YD(e,t,n,r){var o=lt,i=ha.transition;ha.transition=null;try{lt=4,$g(e,t,n,r)}finally{lt=o,ha.transition=i}}function $g(e,t,n,r){if(vd){var o=Zm(e,t,n,r);if(o===null)Jh(e,t,r,yd,n),xx(e,r);else if(GD(o,e,t,n,r))r.stopPropagation();else if(xx(e,r),t&4&&-1<qD.indexOf(e)){for(;o!==null;){var i=Rc(o);if(i!==null&&eC(i),i=Zm(e,t,n,r),i===null&&Jh(e,t,r,yd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Jh(e,t,r,null,n)}}var yd=null;function Zm(e,t,n,r){if(yd=null,e=Ag(r),e=Ui(e),e!==null)if(t=vs(e),t===null)e=null;else if(n=t.tag,n===13){if(e=qb(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 yd=e,null}function iC(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($D()){case Ng:return 1;case Yb:return 4;case pd:case LD:return 16;case Xb:return 536870912;default:return 16}default:return 16}}var ii=null,Lg=null,Ku=null;function sC(){if(Ku)return Ku;var e,t=Lg,n=t.length,r,o="value"in ii?ii.value:ii.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 Ku=o.slice(e,1<r?1-r:void 0)}function Yu(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 Sx(){return!1}function sr(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:Sx,this.isPropagationStopped=Sx,this}return At(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 Ba={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Fg=sr(Ba),kc=At({},Ba,{view:0,detail:0}),XD=sr(kc),Uh,Hh,ul,df=At({},kc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zg,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!==ul&&(ul&&e.type==="mousemove"?(Uh=e.screenX-ul.screenX,Hh=e.screenY-ul.screenY):Hh=Uh=0,ul=e),Uh)},movementY:function(e){return"movementY"in e?e.movementY:Hh}}),bx=sr(df),JD=At({},df,{dataTransfer:0}),ZD=sr(JD),eI=At({},kc,{relatedTarget:0}),Wh=sr(eI),tI=At({},Ba,{animationName:0,elapsedTime:0,pseudoElement:0}),nI=sr(tI),rI=At({},Ba,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oI=sr(rI),iI=At({},Ba,{data:0}),Cx=sr(iI),sI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aI={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"},lI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lI[e])?!!t[e]:!1}function zg(){return cI}var uI=At({},kc,{key:function(e){if(e.key){var t=sI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Yu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?aI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zg,charCode:function(e){return e.type==="keypress"?Yu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dI=sr(uI),fI=At({},df,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ex=sr(fI),hI=At({},kc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zg}),mI=sr(hI),pI=At({},Ba,{propertyName:0,elapsedTime:0,pseudoElement:0}),gI=sr(pI),vI=At({},df,{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}),yI=sr(vI),xI=[9,13,27,32],Vg=Eo&&"CompositionEvent"in window,Il=null;Eo&&"documentMode"in document&&(Il=document.documentMode);var wI=Eo&&"TextEvent"in window&&!Il,aC=Eo&&(!Vg||Il&&8<Il&&11>=Il),jx=" ",Px=!1;function lC(e,t){switch(e){case"keyup":return xI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function cC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Qs=!1;function SI(e,t){switch(e){case"compositionend":return cC(t);case"keypress":return t.which!==32?null:(Px=!0,jx);case"textInput":return e=t.data,e===jx&&Px?null:e;default:return null}}function bI(e,t){if(Qs)return e==="compositionend"||!Vg&&lC(e,t)?(e=sC(),Ku=Lg=ii=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 aC&&t.locale!=="ko"?null:t.data;default:return null}}var CI={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 Tx(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!CI[e.type]:t==="textarea"}function uC(e,t,n,r){Vb(r),t=xd(t,"onChange"),0<t.length&&(n=new Fg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Al=null,Kl=null;function EI(e){SC(e,0)}function ff(e){var t=Xs(e);if(Nb(t))return e}function jI(e,t){if(e==="change")return t}var dC=!1;if(Eo){var qh;if(Eo){var Gh="oninput"in document;if(!Gh){var kx=document.createElement("div");kx.setAttribute("oninput","return;"),Gh=typeof kx.oninput=="function"}qh=Gh}else qh=!1;dC=qh&&(!document.documentMode||9<document.documentMode)}function Rx(){Al&&(Al.detachEvent("onpropertychange",fC),Kl=Al=null)}function fC(e){if(e.propertyName==="value"&&ff(Kl)){var t=[];uC(t,Kl,e,Ag(e)),Wb(EI,t)}}function PI(e,t,n){e==="focusin"?(Rx(),Al=t,Kl=n,Al.attachEvent("onpropertychange",fC)):e==="focusout"&&Rx()}function TI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ff(Kl)}function kI(e,t){if(e==="click")return ff(t)}function RI(e,t){if(e==="input"||e==="change")return ff(t)}function _I(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Lr=typeof Object.is=="function"?Object.is:_I;function Yl(e,t){if(Lr(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(!Om.call(t,o)||!Lr(e[o],t[o]))return!1}return!0}function _x(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dx(e,t){var n=_x(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=_x(n)}}function hC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mC(){for(var e=window,t=fd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=fd(e.document)}return t}function Bg(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 DI(e){var t=mC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&hC(n.ownerDocument.documentElement,n)){if(r!==null&&Bg(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=Dx(n,i);var s=Dx(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 II=Eo&&"documentMode"in document&&11>=document.documentMode,Ks=null,ep=null,Nl=null,tp=!1;function Ix(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;tp||Ks==null||Ks!==fd(r)||(r=Ks,"selectionStart"in r&&Bg(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}),Nl&&Yl(Nl,r)||(Nl=r,r=xd(ep,"onSelect"),0<r.length&&(t=new Fg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Ks)))}function Tu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ys={animationend:Tu("Animation","AnimationEnd"),animationiteration:Tu("Animation","AnimationIteration"),animationstart:Tu("Animation","AnimationStart"),transitionend:Tu("Transition","TransitionEnd")},Qh={},pC={};Eo&&(pC=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function hf(e){if(Qh[e])return Qh[e];if(!Ys[e])return e;var t=Ys[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pC)return Qh[e]=t[n];return e}var gC=hf("animationend"),vC=hf("animationiteration"),yC=hf("animationstart"),xC=hf("transitionend"),wC=new Map,Ax="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 Ei(e,t){wC.set(e,t),gs(t,[e])}for(var Kh=0;Kh<Ax.length;Kh++){var Yh=Ax[Kh],AI=Yh.toLowerCase(),NI=Yh[0].toUpperCase()+Yh.slice(1);Ei(AI,"on"+NI)}Ei(gC,"onAnimationEnd");Ei(vC,"onAnimationIteration");Ei(yC,"onAnimationStart");Ei("dblclick","onDoubleClick");Ei("focusin","onFocus");Ei("focusout","onBlur");Ei(xC,"onTransitionEnd");xa("onMouseEnter",["mouseout","mouseover"]);xa("onMouseLeave",["mouseout","mouseover"]);xa("onPointerEnter",["pointerout","pointerover"]);xa("onPointerLeave",["pointerout","pointerover"]);gs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));gs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));gs("onBeforeInput",["compositionend","keypress","textInput","paste"]);gs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));gs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));gs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),OI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Tl));function Nx(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,AD(r,t,void 0,e),e.currentTarget=null}function SC(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;Nx(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;Nx(o,l,u),i=c}}}if(md)throw e=Ym,md=!1,Ym=null,e}function Et(e,t){var n=t[sp];n===void 0&&(n=t[sp]=new Set);var r=e+"__bubble";n.has(r)||(bC(t,e,2,!1),n.add(r))}function Xh(e,t,n){var r=0;t&&(r|=4),bC(n,e,r,t)}var ku="_reactListening"+Math.random().toString(36).slice(2);function Xl(e){if(!e[ku]){e[ku]=!0,Rb.forEach(function(n){n!=="selectionchange"&&(OI.has(n)||Xh(n,!1,e),Xh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ku]||(t[ku]=!0,Xh("selectionchange",!1,t))}}function bC(e,t,n,r){switch(iC(t)){case 1:var o=KD;break;case 4:o=YD;break;default:o=$g}n=o.bind(null,t,n,e),o=void 0,!Km||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 Jh(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=Ui(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=Ag(n),f=[];e:{var h=wC.get(e);if(h!==void 0){var p=Fg,g=e;switch(e){case"keypress":if(Yu(n)===0)break e;case"keydown":case"keyup":p=dI;break;case"focusin":g="focus",p=Wh;break;case"focusout":g="blur",p=Wh;break;case"beforeblur":case"afterblur":p=Wh;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":p=bx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=ZD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=mI;break;case gC:case vC:case yC:p=nI;break;case xC:p=gI;break;case"scroll":p=XD;break;case"wheel":p=yI;break;case"copy":case"cut":case"paste":p=oI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=Ex}var v=(t&4)!==0,S=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var x=u,w;x!==null;){w=x;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,y!==null&&(b=Wl(x,y),b!=null&&v.push(Jl(x,b,w)))),S)break;x=x.return}0<v.length&&(h=new p(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",p=e==="mouseout"||e==="pointerout",h&&n!==Gm&&(g=n.relatedTarget||n.fromElement)&&(Ui(g)||g[jo]))break e;if((p||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,p?(g=n.relatedTarget||n.toElement,p=u,g=g?Ui(g):null,g!==null&&(S=vs(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(p=null,g=u),p!==g)){if(v=bx,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(v=Ex,b="onPointerLeave",y="onPointerEnter",x="pointer"),S=p==null?h:Xs(p),w=g==null?h:Xs(g),h=new v(b,x+"leave",p,n,d),h.target=S,h.relatedTarget=w,b=null,Ui(d)===u&&(v=new v(y,x+"enter",g,n,d),v.target=w,v.relatedTarget=S,b=v),S=b,p&&g)t:{for(v=p,y=g,x=0,w=v;w;w=Ls(w))x++;for(w=0,b=y;b;b=Ls(b))w++;for(;0<x-w;)v=Ls(v),x--;for(;0<w-x;)y=Ls(y),w--;for(;x--;){if(v===y||y!==null&&v===y.alternate)break t;v=Ls(v),y=Ls(y)}v=null}else v=null;p!==null&&Ox(f,h,p,v,!1),g!==null&&S!==null&&Ox(f,S,g,v,!0)}}e:{if(h=u?Xs(u):window,p=h.nodeName&&h.nodeName.toLowerCase(),p==="select"||p==="input"&&h.type==="file")var j=jI;else if(Tx(h))if(dC)j=RI;else{j=TI;var E=PI}else(p=h.nodeName)&&p.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=kI);if(j&&(j=j(e,u))){uC(f,j,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Bm(h,"number",h.value)}switch(E=u?Xs(u):window,e){case"focusin":(Tx(E)||E.contentEditable==="true")&&(Ks=E,ep=u,Nl=null);break;case"focusout":Nl=ep=Ks=null;break;case"mousedown":tp=!0;break;case"contextmenu":case"mouseup":case"dragend":tp=!1,Ix(f,n,d);break;case"selectionchange":if(II)break;case"keydown":case"keyup":Ix(f,n,d)}var T;if(Vg)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Qs?lC(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(aC&&n.locale!=="ko"&&(Qs||P!=="onCompositionStart"?P==="onCompositionEnd"&&Qs&&(T=sC()):(ii=d,Lg="value"in ii?ii.value:ii.textContent,Qs=!0)),E=xd(u,P),0<E.length&&(P=new Cx(P,e,null,n,d),f.push({event:P,listeners:E}),T?P.data=T:(T=cC(n),T!==null&&(P.data=T)))),(T=wI?SI(e,n):bI(e,n))&&(u=xd(u,"onBeforeInput"),0<u.length&&(d=new Cx("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=T))}SC(f,t)})}function Jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function xd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Wl(e,n),i!=null&&r.unshift(Jl(e,i,o)),i=Wl(e,t),i!=null&&r.push(Jl(e,i,o))),e=e.return}return r}function Ls(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Ox(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=Wl(n,i),c!=null&&s.unshift(Jl(n,c,l))):o||(c=Wl(n,i),c!=null&&s.push(Jl(n,c,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var MI=/\r\n?/g,$I=/\u0000|\uFFFD/g;function Mx(e){return(typeof e=="string"?e:""+e).replace(MI,`
|
|
81
|
-
`).replace($I,"")}function Ru(e,t,n){if(t=Mx(t),Mx(e)!==t&&n)throw Error(J(425))}function wd(){}var np=null,rp=null;function op(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 ip=typeof setTimeout=="function"?setTimeout:void 0,LI=typeof clearTimeout=="function"?clearTimeout:void 0,$x=typeof Promise=="function"?Promise:void 0,FI=typeof queueMicrotask=="function"?queueMicrotask:typeof $x<"u"?function(e){return $x.resolve(null).then(e).catch(zI)}:ip;function zI(e){setTimeout(function(){throw e})}function Zh(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),Ql(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ql(t)}function di(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 Lx(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 Ua=Math.random().toString(36).slice(2),to="__reactFiber$"+Ua,Zl="__reactProps$"+Ua,jo="__reactContainer$"+Ua,sp="__reactEvents$"+Ua,VI="__reactListeners$"+Ua,BI="__reactHandles$"+Ua;function Ui(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=Lx(e);e!==null;){if(n=e[to])return n;e=Lx(e)}return t}e=n,n=e.parentNode}return null}function Rc(e){return e=e[to]||e[jo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Xs(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function mf(e){return e[Zl]||null}var ap=[],Js=-1;function ji(e){return{current:e}}function Pt(e){0>Js||(e.current=ap[Js],ap[Js]=null,Js--)}function yt(e,t){Js++,ap[Js]=e.current,e.current=t}var xi={},wn=ji(xi),zn=ji(!1),Zi=xi;function wa(e,t){var n=e.type.contextTypes;if(!n)return xi;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 Vn(e){return e=e.childContextTypes,e!=null}function Sd(){Pt(zn),Pt(wn)}function Fx(e,t,n){if(wn.current!==xi)throw Error(J(168));yt(wn,t),yt(zn,n)}function CC(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(J(108,PD(e)||"Unknown",o));return At({},n,r)}function bd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||xi,Zi=wn.current,yt(wn,e),yt(zn,zn.current),!0}function zx(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=CC(e,t,Zi),r.__reactInternalMemoizedMergedChildContext=e,Pt(zn),Pt(wn),yt(wn,e)):Pt(zn),yt(zn,n)}var vo=null,pf=!1,em=!1;function EC(e){vo===null?vo=[e]:vo.push(e)}function UI(e){pf=!0,EC(e)}function Pi(){if(!em&&vo!==null){em=!0;var e=0,t=lt;try{var n=vo;for(lt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}vo=null,pf=!1}catch(o){throw vo!==null&&(vo=vo.slice(e+1)),Kb(Ng,Pi),o}finally{lt=t,em=!1}}return null}var Zs=[],ea=0,Cd=null,Ed=0,hr=[],mr=0,es=null,yo=1,xo="";function Mi(e,t){Zs[ea++]=Ed,Zs[ea++]=Cd,Cd=e,Ed=t}function jC(e,t,n){hr[mr++]=yo,hr[mr++]=xo,hr[mr++]=es,es=e;var r=yo;e=xo;var o=32-Or(r)-1;r&=~(1<<o),n+=1;var i=32-Or(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,yo=1<<32-Or(t)+o|n<<o|r,xo=i+e}else yo=1<<i|n<<o|r,xo=e}function Ug(e){e.return!==null&&(Mi(e,1),jC(e,1,0))}function Hg(e){for(;e===Cd;)Cd=Zs[--ea],Zs[ea]=null,Ed=Zs[--ea],Zs[ea]=null;for(;e===es;)es=hr[--mr],hr[mr]=null,xo=hr[--mr],hr[mr]=null,yo=hr[--mr],hr[mr]=null}var er=null,Jn=null,kt=!1,Ar=null;function PC(e,t){var n=pr(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 Vx(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,er=e,Jn=di(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,er=e,Jn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=es!==null?{id:yo,overflow:xo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=pr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,er=e,Jn=null,!0):!1;default:return!1}}function lp(e){return(e.mode&1)!==0&&(e.flags&128)===0}function cp(e){if(kt){var t=Jn;if(t){var n=t;if(!Vx(e,t)){if(lp(e))throw Error(J(418));t=di(n.nextSibling);var r=er;t&&Vx(e,t)?PC(r,n):(e.flags=e.flags&-4097|2,kt=!1,er=e)}}else{if(lp(e))throw Error(J(418));e.flags=e.flags&-4097|2,kt=!1,er=e}}}function Bx(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;er=e}function _u(e){if(e!==er)return!1;if(!kt)return Bx(e),kt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!op(e.type,e.memoizedProps)),t&&(t=Jn)){if(lp(e))throw TC(),Error(J(418));for(;t;)PC(e,t),t=di(t.nextSibling)}if(Bx(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Jn=di(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Jn=null}}else Jn=er?di(e.stateNode.nextSibling):null;return!0}function TC(){for(var e=Jn;e;)e=di(e.nextSibling)}function Sa(){Jn=er=null,kt=!1}function Wg(e){Ar===null?Ar=[e]:Ar.push(e)}var HI=Oo.ReactCurrentBatchConfig;function _r(e,t){if(e&&e.defaultProps){t=At({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var jd=ji(null),Pd=null,ta=null,qg=null;function Gg(){qg=ta=Pd=null}function Qg(e){var t=jd.current;Pt(jd),e._currentValue=t}function up(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 ma(e,t){Pd=e,qg=ta=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Fn=!0),e.firstContext=null)}function yr(e){var t=e._currentValue;if(qg!==e)if(e={context:e,memoizedValue:t,next:null},ta===null){if(Pd===null)throw Error(J(308));ta=e,Pd.dependencies={lanes:0,firstContext:e}}else ta=ta.next=e;return t}var Hi=null;function Kg(e){Hi===null?Hi=[e]:Hi.push(e)}function kC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Kg(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 Xo=!1;function Yg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function RC(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 wo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function fi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,tt&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,Kg(r)):(t.next=o.next,o.next=t),r.interleaved=t,Po(e,n)}function Xu(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,Og(e,n)}}function Ux(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 Td(e,t,n,r){var o=e.updateQueue;Xo=!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,p=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,p=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(p,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(p,f,h):g,h==null)break e;f=At({},f,h);break e;case 2:Xo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else p={eventTime:p,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=f):d=d.next=p,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);ns|=s,e.lanes=s,e.memoizedState=f}}function Hx(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(J(191,o));o.call(r)}}}var _C=new kb.Component().refs;function dp(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:At({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var gf={isMounted:function(e){return(e=e._reactInternals)?vs(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Tn(),o=mi(e),i=wo(r,o);i.payload=t,n!=null&&(i.callback=n),t=fi(e,i,o),t!==null&&(Mr(t,e,o,r),Xu(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Tn(),o=mi(e),i=wo(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=fi(e,i,o),t!==null&&(Mr(t,e,o,r),Xu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tn(),r=mi(e),o=wo(n,r);o.tag=2,t!=null&&(o.callback=t),t=fi(e,o,r),t!==null&&(Mr(t,e,r,n),Xu(t,e,r))}};function Wx(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?!Yl(n,r)||!Yl(o,i):!0}function DC(e,t,n){var r=!1,o=xi,i=t.contextType;return typeof i=="object"&&i!==null?i=yr(i):(o=Vn(t)?Zi:wn.current,r=t.contextTypes,i=(r=r!=null)?wa(e,o):xi),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=gf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function qx(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&&gf.enqueueReplaceState(t,t.state,null)}function fp(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=_C,Yg(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=yr(i):(i=Vn(t)?Zi:wn.current,o.context=wa(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(dp(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&&gf.enqueueReplaceState(o,o.state,null),Td(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function dl(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(J(309));var r=n.stateNode}if(!r)throw Error(J(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===_C&&(l=o.refs={}),s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Du(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Gx(e){var t=e._init;return t(e._payload)}function IC(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function n(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function r(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function o(y,x){return y=pi(y,x),y.index=0,y.sibling=null,y}function i(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function s(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,w,b){return x===null||x.tag!==6?(x=am(w,y.mode,b),x.return=y,x):(x=o(x,w),x.return=y,x)}function c(y,x,w,b){var j=w.type;return j===Gs?d(y,x,w.props.children,b,w.key):x!==null&&(x.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Yo&&Gx(j)===x.type)?(b=o(x,w.props),b.ref=dl(y,x,w),b.return=y,b):(b=rd(w.type,w.key,w.props,null,y.mode,b),b.ref=dl(y,x,w),b.return=y,b)}function u(y,x,w,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=lm(w,y.mode,b),x.return=y,x):(x=o(x,w.children||[]),x.return=y,x)}function d(y,x,w,b,j){return x===null||x.tag!==7?(x=Xi(w,y.mode,b,j),x.return=y,x):(x=o(x,w),x.return=y,x)}function f(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=am(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case wu:return w=rd(x.type,x.key,x.props,null,y.mode,w),w.ref=dl(y,null,x),w.return=y,w;case qs:return x=lm(x,y.mode,w),x.return=y,x;case Yo:var b=x._init;return f(y,b(x._payload),w)}if(jl(x)||sl(x))return x=Xi(x,y.mode,w,null),x.return=y,x;Du(y,x)}return null}function h(y,x,w,b){var j=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(y,x,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case wu:return w.key===j?c(y,x,w,b):null;case qs:return w.key===j?u(y,x,w,b):null;case Yo:return j=w._init,h(y,x,j(w._payload),b)}if(jl(w)||sl(w))return j!==null?null:d(y,x,w,b,null);Du(y,w)}return null}function p(y,x,w,b,j){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(w)||null,l(x,y,""+b,j);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case wu:return y=y.get(b.key===null?w:b.key)||null,c(x,y,b,j);case qs:return y=y.get(b.key===null?w:b.key)||null,u(x,y,b,j);case Yo:var E=b._init;return p(y,x,w,E(b._payload),j)}if(jl(b)||sl(b))return y=y.get(w)||null,d(x,y,b,j,null);Du(x,b)}return null}function g(y,x,w,b){for(var j=null,E=null,T=x,P=x=0,_=null;T!==null&&P<w.length;P++){T.index>P?(_=T,T=null):_=T.sibling;var D=h(y,T,w[P],b);if(D===null){T===null&&(T=_);break}e&&T&&D.alternate===null&&t(y,T),x=i(D,x,P),E===null?j=D:E.sibling=D,E=D,T=_}if(P===w.length)return n(y,T),kt&&Mi(y,P),j;if(T===null){for(;P<w.length;P++)T=f(y,w[P],b),T!==null&&(x=i(T,x,P),E===null?j=T:E.sibling=T,E=T);return kt&&Mi(y,P),j}for(T=r(y,T);P<w.length;P++)_=p(T,y,P,w[P],b),_!==null&&(e&&_.alternate!==null&&T.delete(_.key===null?P:_.key),x=i(_,x,P),E===null?j=_:E.sibling=_,E=_);return e&&T.forEach(function($){return t(y,$)}),kt&&Mi(y,P),j}function v(y,x,w,b){var j=sl(w);if(typeof j!="function")throw Error(J(150));if(w=j.call(w),w==null)throw Error(J(151));for(var E=j=null,T=x,P=x=0,_=null,D=w.next();T!==null&&!D.done;P++,D=w.next()){T.index>P?(_=T,T=null):_=T.sibling;var $=h(y,T,D.value,b);if($===null){T===null&&(T=_);break}e&&T&&$.alternate===null&&t(y,T),x=i($,x,P),E===null?j=$:E.sibling=$,E=$,T=_}if(D.done)return n(y,T),kt&&Mi(y,P),j;if(T===null){for(;!D.done;P++,D=w.next())D=f(y,D.value,b),D!==null&&(x=i(D,x,P),E===null?j=D:E.sibling=D,E=D);return kt&&Mi(y,P),j}for(T=r(y,T);!D.done;P++,D=w.next())D=p(T,y,P,D.value,b),D!==null&&(e&&D.alternate!==null&&T.delete(D.key===null?P:D.key),x=i(D,x,P),E===null?j=D:E.sibling=D,E=D);return e&&T.forEach(function(I){return t(y,I)}),kt&&Mi(y,P),j}function S(y,x,w,b){if(typeof w=="object"&&w!==null&&w.type===Gs&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case wu:e:{for(var j=w.key,E=x;E!==null;){if(E.key===j){if(j=w.type,j===Gs){if(E.tag===7){n(y,E.sibling),x=o(E,w.props.children),x.return=y,y=x;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Yo&&Gx(j)===E.type){n(y,E.sibling),x=o(E,w.props),x.ref=dl(y,E,w),x.return=y,y=x;break e}n(y,E);break}else t(y,E);E=E.sibling}w.type===Gs?(x=Xi(w.props.children,y.mode,b,w.key),x.return=y,y=x):(b=rd(w.type,w.key,w.props,null,y.mode,b),b.ref=dl(y,x,w),b.return=y,y=b)}return s(y);case qs: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(y,x.sibling),x=o(x,w.children||[]),x.return=y,y=x;break e}else{n(y,x);break}else t(y,x);x=x.sibling}x=lm(w,y.mode,b),x.return=y,y=x}return s(y);case Yo:return E=w._init,S(y,x,E(w._payload),b)}if(jl(w))return g(y,x,w,b);if(sl(w))return v(y,x,w,b);Du(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(n(y,x.sibling),x=o(x,w),x.return=y,y=x):(n(y,x),x=am(w,y.mode,b),x.return=y,y=x),s(y)):n(y,x)}return S}var ba=IC(!0),AC=IC(!1),_c={},ro=ji(_c),ec=ji(_c),tc=ji(_c);function Wi(e){if(e===_c)throw Error(J(174));return e}function Xg(e,t){switch(yt(tc,t),yt(ec,e),yt(ro,_c),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Hm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Hm(t,e)}Pt(ro),yt(ro,t)}function Ca(){Pt(ro),Pt(ec),Pt(tc)}function NC(e){Wi(tc.current);var t=Wi(ro.current),n=Hm(t,e.type);t!==n&&(yt(ec,e),yt(ro,n))}function Jg(e){ec.current===e&&(Pt(ro),Pt(ec))}var _t=ji(0);function kd(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 tm=[];function Zg(){for(var e=0;e<tm.length;e++)tm[e]._workInProgressVersionPrimary=null;tm.length=0}var Ju=Oo.ReactCurrentDispatcher,nm=Oo.ReactCurrentBatchConfig,ts=0,It=null,Xt=null,tn=null,Rd=!1,Ol=!1,nc=0,WI=0;function mn(){throw Error(J(321))}function ev(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Lr(e[n],t[n]))return!1;return!0}function tv(e,t,n,r,o,i){if(ts=i,It=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ju.current=e===null||e.memoizedState===null?KI:YI,e=n(r,o),Ol){i=0;do{if(Ol=!1,nc=0,25<=i)throw Error(J(301));i+=1,tn=Xt=null,t.updateQueue=null,Ju.current=XI,e=n(r,o)}while(Ol)}if(Ju.current=_d,t=Xt!==null&&Xt.next!==null,ts=0,tn=Xt=It=null,Rd=!1,t)throw Error(J(300));return e}function nv(){var e=nc!==0;return nc=0,e}function Jr(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?It.memoizedState=tn=e:tn=tn.next=e,tn}function xr(){if(Xt===null){var e=It.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var t=tn===null?It.memoizedState:tn.next;if(t!==null)tn=t,Xt=e;else{if(e===null)throw Error(J(310));Xt=e,e={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},tn===null?It.memoizedState=tn=e:tn=tn.next=e}return tn}function rc(e,t){return typeof t=="function"?t(e):t}function rm(e){var t=xr(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=Xt,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((ts&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,It.lanes|=d,ns|=d}u=u.next}while(u!==null&&u!==i);c===null?s=r:c.next=l,Lr(r,t.memoizedState)||(Fn=!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,It.lanes|=i,ns|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function om(e){var t=xr(),n=t.queue;if(n===null)throw Error(J(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);Lr(i,t.memoizedState)||(Fn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function OC(){}function MC(e,t){var n=It,r=xr(),o=t(),i=!Lr(r.memoizedState,o);if(i&&(r.memoizedState=o,Fn=!0),r=r.queue,rv(FC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tn!==null&&tn.memoizedState.tag&1){if(n.flags|=2048,oc(9,LC.bind(null,n,r,o,t),void 0,null),rn===null)throw Error(J(349));ts&30||$C(n,t,o)}return o}function $C(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=It.updateQueue,t===null?(t={lastEffect:null,stores:null},It.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function LC(e,t,n,r){t.value=n,t.getSnapshot=r,zC(t)&&VC(e)}function FC(e,t,n){return n(function(){zC(t)&&VC(e)})}function zC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Lr(e,n)}catch{return!0}}function VC(e){var t=Po(e,1);t!==null&&Mr(t,e,1,-1)}function Qx(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:rc,lastRenderedState:e},t.queue=e,e=e.dispatch=QI.bind(null,It,e),[t.memoizedState,e]}function oc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=It.updateQueue,t===null?(t={lastEffect:null,stores:null},It.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 BC(){return xr().memoizedState}function Zu(e,t,n,r){var o=Jr();It.flags|=e,o.memoizedState=oc(1|t,n,void 0,r===void 0?null:r)}function vf(e,t,n,r){var o=xr();r=r===void 0?null:r;var i=void 0;if(Xt!==null){var s=Xt.memoizedState;if(i=s.destroy,r!==null&&ev(r,s.deps)){o.memoizedState=oc(t,n,i,r);return}}It.flags|=e,o.memoizedState=oc(1|t,n,i,r)}function Kx(e,t){return Zu(8390656,8,e,t)}function rv(e,t){return vf(2048,8,e,t)}function UC(e,t){return vf(4,2,e,t)}function HC(e,t){return vf(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 qC(e,t,n){return n=n!=null?n.concat([e]):null,vf(4,4,WC.bind(null,t,e),n)}function ov(){}function GC(e,t){var n=xr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ev(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function QC(e,t){var n=xr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ev(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function KC(e,t,n){return ts&21?(Lr(n,t)||(n=Jb(),It.lanes|=n,ns|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Fn=!0),e.memoizedState=n)}function qI(e,t){var n=lt;lt=n!==0&&4>n?n:4,e(!0);var r=nm.transition;nm.transition={};try{e(!1),t()}finally{lt=n,nm.transition=r}}function YC(){return xr().memoizedState}function GI(e,t,n){var r=mi(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},XC(e))JC(t,n);else if(n=kC(e,t,n,r),n!==null){var o=Tn();Mr(n,e,r,o),ZC(n,t,r)}}function QI(e,t,n){var r=mi(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(XC(e))JC(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,Lr(l,s)){var c=t.interleaved;c===null?(o.next=o,Kg(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=kC(e,t,o,r),n!==null&&(o=Tn(),Mr(n,e,r,o),ZC(n,t,r))}}function XC(e){var t=e.alternate;return e===It||t!==null&&t===It}function JC(e,t){Ol=Rd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function ZC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Og(e,n)}}var _d={readContext:yr,useCallback:mn,useContext:mn,useEffect:mn,useImperativeHandle:mn,useInsertionEffect:mn,useLayoutEffect:mn,useMemo:mn,useReducer:mn,useRef:mn,useState:mn,useDebugValue:mn,useDeferredValue:mn,useTransition:mn,useMutableSource:mn,useSyncExternalStore:mn,useId:mn,unstable_isNewReconciler:!1},KI={readContext:yr,useCallback:function(e,t){return Jr().memoizedState=[e,t===void 0?null:t],e},useContext:yr,useEffect:Kx,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Zu(4194308,4,WC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Zu(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=GI.bind(null,It,e),[r.memoizedState,e]},useRef:function(e){var t=Jr();return e={current:e},t.memoizedState=e},useState:Qx,useDebugValue:ov,useDeferredValue:function(e){return Jr().memoizedState=e},useTransition:function(){var e=Qx(!1),t=e[0];return e=qI.bind(null,e[1]),Jr().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=It,o=Jr();if(kt){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),rn===null)throw Error(J(349));ts&30||$C(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,Kx(FC.bind(null,r,i,e),[e]),r.flags|=2048,oc(9,LC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Jr(),t=rn.identifierPrefix;if(kt){var n=xo,r=yo;n=(r&~(1<<32-Or(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=WI++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YI={readContext:yr,useCallback:GC,useContext:yr,useEffect:rv,useImperativeHandle:qC,useInsertionEffect:UC,useLayoutEffect:HC,useMemo:QC,useReducer:rm,useRef:BC,useState:function(){return rm(rc)},useDebugValue:ov,useDeferredValue:function(e){var t=xr();return KC(t,Xt.memoizedState,e)},useTransition:function(){var e=rm(rc)[0],t=xr().memoizedState;return[e,t]},useMutableSource:OC,useSyncExternalStore:MC,useId:YC,unstable_isNewReconciler:!1},XI={readContext:yr,useCallback:GC,useContext:yr,useEffect:rv,useImperativeHandle:qC,useInsertionEffect:UC,useLayoutEffect:HC,useMemo:QC,useReducer:om,useRef:BC,useState:function(){return om(rc)},useDebugValue:ov,useDeferredValue:function(e){var t=xr();return Xt===null?t.memoizedState=e:KC(t,Xt.memoizedState,e)},useTransition:function(){var e=om(rc)[0],t=xr().memoizedState;return[e,t]},useMutableSource:OC,useSyncExternalStore:MC,useId:YC,unstable_isNewReconciler:!1};function Ea(e,t){try{var n="",r=t;do n+=jD(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 im(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function hp(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var JI=typeof WeakMap=="function"?WeakMap:Map;function eE(e,t,n){n=wo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Id||(Id=!0,Cp=r),hp(e,t)},n}function tE(e,t,n){n=wo(-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(){hp(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){hp(e,t),typeof r!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Yx(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new JI;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=fA.bind(null,e,t,n),t.then(e,e))}function Xx(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 Jx(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=wo(-1,1),t.tag=2,fi(n,t,1))),n.lanes|=1),e)}var ZI=Oo.ReactCurrentOwner,Fn=!1;function Cn(e,t,n,r){t.child=e===null?AC(t,null,n,r):ba(t,e.child,n,r)}function Zx(e,t,n,r,o){n=n.render;var i=t.ref;return ma(t,o),r=tv(e,t,n,r,i,o),n=nv(),e!==null&&!Fn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,To(e,t,o)):(kt&&n&&Ug(t),t.flags|=1,Cn(e,t,r,o),t.child)}function e1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!fv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,nE(e,t,i,r,o)):(e=rd(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:Yl,n(s,r)&&e.ref===t.ref)return To(e,t,o)}return t.flags|=1,e=pi(i,r),e.ref=t.ref,e.return=t,t.child=e}function nE(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Yl(i,r)&&e.ref===t.ref)if(Fn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Fn=!0);else return t.lanes=e.lanes,To(e,t,o)}return mp(e,t,n,r,o)}function rE(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},yt(ra,Yn),Yn|=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,yt(ra,Yn),Yn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,yt(ra,Yn),Yn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,yt(ra,Yn),Yn|=r;return Cn(e,t,o,n),t.child}function oE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function mp(e,t,n,r,o){var i=Vn(n)?Zi:wn.current;return i=wa(t,i),ma(t,o),n=tv(e,t,n,r,i,o),r=nv(),e!==null&&!Fn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,To(e,t,o)):(kt&&r&&Ug(t),t.flags|=1,Cn(e,t,n,o),t.child)}function t1(e,t,n,r,o){if(Vn(n)){var i=!0;bd(t)}else i=!1;if(ma(t,o),t.stateNode===null)ed(e,t),DC(t,n,r),fp(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=yr(u):(u=Vn(n)?Zi:wn.current,u=wa(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)&&qx(t,s,r,u),Xo=!1;var h=t.memoizedState;s.state=h,Td(t,r,s,o),c=t.memoizedState,l!==r||h!==c||zn.current||Xo?(typeof d=="function"&&(dp(t,n,d,r),c=t.memoizedState),(l=Xo||Wx(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,RC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:_r(t.type,l),s.props=u,f=t.pendingProps,h=s.context,c=n.contextType,typeof c=="object"&&c!==null?c=yr(c):(c=Vn(n)?Zi:wn.current,c=wa(t,c));var p=n.getDerivedStateFromProps;(d=typeof p=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==f||h!==c)&&qx(t,s,r,c),Xo=!1,h=t.memoizedState,s.state=h,Td(t,r,s,o);var g=t.memoizedState;l!==f||h!==g||zn.current||Xo?(typeof p=="function"&&(dp(t,n,p,r),g=t.memoizedState),(u=Xo||Wx(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 pp(e,t,n,r,i,o)}function pp(e,t,n,r,o,i){oE(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&zx(t,n,!1),To(e,t,i);r=t.stateNode,ZI.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=ba(t,e.child,null,i),t.child=ba(t,null,l,i)):Cn(e,t,l,i),t.memoizedState=r.state,o&&zx(t,n,!0),t.child}function iE(e){var t=e.stateNode;t.pendingContext?Fx(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Fx(e,t.context,!1),Xg(e,t.containerInfo)}function n1(e,t,n,r,o){return Sa(),Wg(o),t.flags|=256,Cn(e,t,n,r),t.child}var gp={dehydrated:null,treeContext:null,retryLane:0};function vp(e){return{baseLanes:e,cachePool:null,transitions:null}}function sE(e,t,n){var r=t.pendingProps,o=_t.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),yt(_t,o&1),e===null)return cp(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=wf(s,r,0,null),e=Xi(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=vp(n),t.memoizedState=gp,e):iv(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return eA(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=pi(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=pi(l,i):(i=Xi(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?vp(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=gp,r}return i=e.child,e=i.sibling,r=pi(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 iv(e,t){return t=wf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Iu(e,t,n,r){return r!==null&&Wg(r),ba(t,e.child,null,n),e=iv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function eA(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=im(Error(J(422))),Iu(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=wf({mode:"visible",children:r.children},o,0,null),i=Xi(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&ba(t,e.child,null,s),t.child.memoizedState=vp(s),t.memoizedState=gp,i);if(!(t.mode&1))return Iu(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(J(419)),r=im(i,r,void 0),Iu(e,t,s,r)}if(l=(s&e.childLanes)!==0,Fn||l){if(r=rn,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),Mr(r,e,o,-1))}return dv(),r=im(Error(J(421))),Iu(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=hA.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,Jn=di(o.nextSibling),er=t,kt=!0,Ar=null,e!==null&&(hr[mr++]=yo,hr[mr++]=xo,hr[mr++]=es,yo=e.id,xo=e.overflow,es=t),t=iv(t,r.children),t.flags|=4096,t)}function r1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),up(e.return,t,n)}function sm(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 aE(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Cn(e,t,r.children,n),r=_t.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&&r1(e,n,t);else if(e.tag===19)r1(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(yt(_t,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&&kd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),sm(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&&kd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}sm(t,!0,n,null,i);break;case"together":sm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function ed(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),ns|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=pi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=pi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tA(e,t,n){switch(t.tag){case 3:iE(t),Sa();break;case 5:NC(t);break;case 1:Vn(t.type)&&bd(t);break;case 4:Xg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;yt(jd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(yt(_t,_t.current&1),t.flags|=128,null):n&t.child.childLanes?sE(e,t,n):(yt(_t,_t.current&1),e=To(e,t,n),e!==null?e.sibling:null);yt(_t,_t.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return aE(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),yt(_t,_t.current),r)break;return null;case 22:case 23:return t.lanes=0,rE(e,t,n)}return To(e,t,n)}var lE,yp,cE,uE;lE=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}};yp=function(){};cE=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Wi(ro.current);var i=null;switch(n){case"input":o=zm(e,o),r=zm(e,r),i=[];break;case"select":o=At({},o,{value:void 0}),r=At({},r,{value:void 0}),i=[];break;case"textarea":o=Um(e,o),r=Um(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=wd)}Wm(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"&&(Ul.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"&&(Ul.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&Et("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)}};uE=function(e,t,n,r){n!==r&&(t.flags|=4)};function fl(e,t){if(!kt)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 pn(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 nA(e,t,n){var r=t.pendingProps;switch(Hg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return pn(t),null;case 1:return Vn(t.type)&&Sd(),pn(t),null;case 3:return r=t.stateNode,Ca(),Pt(zn),Pt(wn),Zg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(_u(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ar!==null&&(Pp(Ar),Ar=null))),yp(e,t),pn(t),null;case 5:Jg(t);var o=Wi(tc.current);if(n=t.type,e!==null&&t.stateNode!=null)cE(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return pn(t),null}if(e=Wi(ro.current),_u(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[to]=t,r[Zl]=i,e=(t.mode&1)!==0,n){case"dialog":Et("cancel",r),Et("close",r);break;case"iframe":case"object":case"embed":Et("load",r);break;case"video":case"audio":for(o=0;o<Tl.length;o++)Et(Tl[o],r);break;case"source":Et("error",r);break;case"img":case"image":case"link":Et("error",r),Et("load",r);break;case"details":Et("toggle",r);break;case"input":fx(r,i),Et("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},Et("invalid",r);break;case"textarea":mx(r,i),Et("invalid",r)}Wm(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&&Ru(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Ru(r.textContent,l,e),o=["children",""+l]):Ul.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&Et("scroll",r)}switch(n){case"input":Su(r),hx(r,i,!0);break;case"textarea":Su(r),px(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=wd)}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=$b(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[Zl]=r,lE(e,t,!1,!1),t.stateNode=e;e:{switch(s=qm(n,r),n){case"dialog":Et("cancel",e),Et("close",e),o=r;break;case"iframe":case"object":case"embed":Et("load",e),o=r;break;case"video":case"audio":for(o=0;o<Tl.length;o++)Et(Tl[o],e);o=r;break;case"source":Et("error",e),o=r;break;case"img":case"image":case"link":Et("error",e),Et("load",e),o=r;break;case"details":Et("toggle",e),o=r;break;case"input":fx(e,r),o=zm(e,r),Et("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=At({},r,{value:void 0}),Et("invalid",e);break;case"textarea":mx(e,r),o=Um(e,r),Et("invalid",e);break;default:o=r}Wm(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?zb(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Lb(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Hl(e,c):typeof c=="number"&&Hl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ul.hasOwnProperty(i)?c!=null&&i==="onScroll"&&Et("scroll",e):c!=null&&Rg(e,i,c,s))}switch(n){case"input":Su(e),hx(e,r,!1);break;case"textarea":Su(e),px(e);break;case"option":r.value!=null&&e.setAttribute("value",""+yi(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?ua(e,!!r.multiple,i,!1):r.defaultValue!=null&&ua(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=wd)}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 pn(t),null;case 6:if(e&&t.stateNode!=null)uE(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Wi(tc.current),Wi(ro.current),_u(t)){if(r=t.stateNode,n=t.memoizedProps,r[to]=t,(i=r.nodeValue!==n)&&(e=er,e!==null))switch(e.tag){case 3:Ru(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Ru(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 pn(t),null;case 13:if(Pt(_t),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(kt&&Jn!==null&&t.mode&1&&!(t.flags&128))TC(),Sa(),t.flags|=98560,i=!1;else if(i=_u(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(J(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(J(317));i[to]=t}else Sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;pn(t),i=!1}else Ar!==null&&(Pp(Ar),Ar=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||_t.current&1?Jt===0&&(Jt=3):dv())),t.updateQueue!==null&&(t.flags|=4),pn(t),null);case 4:return Ca(),yp(e,t),e===null&&Xl(t.stateNode.containerInfo),pn(t),null;case 10:return Qg(t.type._context),pn(t),null;case 17:return Vn(t.type)&&Sd(),pn(t),null;case 19:if(Pt(_t),i=t.memoizedState,i===null)return pn(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)fl(i,!1);else{if(Jt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=kd(e),s!==null){for(t.flags|=128,fl(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 yt(_t,_t.current&1|2),t.child}e=e.sibling}i.tail!==null&&qt()>ja&&(t.flags|=128,r=!0,fl(i,!1),t.lanes=4194304)}else{if(!r)if(e=kd(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),fl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!kt)return pn(t),null}else 2*qt()-i.renderingStartTime>ja&&n!==1073741824&&(t.flags|=128,r=!0,fl(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=qt(),t.sibling=null,n=_t.current,yt(_t,r?n&1|2:n&1),t):(pn(t),null);case 22:case 23:return uv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Yn&1073741824&&(pn(t),t.subtreeFlags&6&&(t.flags|=8192)):pn(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function rA(e,t){switch(Hg(t),t.tag){case 1:return Vn(t.type)&&Sd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ca(),Pt(zn),Pt(wn),Zg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Jg(t),null;case 13:if(Pt(_t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Pt(_t),null;case 4:return Ca(),null;case 10:return Qg(t.type._context),null;case 22:case 23:return uv(),null;case 24:return null;default:return null}}var Au=!1,vn=!1,oA=typeof WeakSet=="function"?WeakSet:Set,he=null;function na(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Lt(e,t,r)}else n.current=null}function xp(e,t,n){try{n()}catch(r){Lt(e,t,r)}}var o1=!1;function iA(e,t){if(np=vd,e=mC(),Bg(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 p;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),(p=f.firstChild)!==null;)h=f,f=p;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=s),h===i&&++d===r&&(c=s),(p=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=p}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(rp={focusedElem:e,selectionRange:n},vd=!1,he=t;he!==null;)if(t=he,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,he=e;else for(;he!==null;){t=he;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 v=g.memoizedProps,S=g.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:_r(t.type,v),S);y.__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(J(163))}}catch(b){Lt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,he=e;break}he=t.return}return g=o1,o1=!1,g}function Ml(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&&xp(t,n,i)}o=o.next}while(o!==r)}}function yf(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 wp(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 dE(e){var t=e.alternate;t!==null&&(e.alternate=null,dE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[to],delete t[Zl],delete t[sp],delete t[VI],delete t[BI])),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 fE(e){return e.tag===5||e.tag===3||e.tag===4}function i1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fE(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 Sp(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=wd));else if(r!==4&&(e=e.child,e!==null))for(Sp(e,t,n),e=e.sibling;e!==null;)Sp(e,t,n),e=e.sibling}function bp(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(bp(e,t,n),e=e.sibling;e!==null;)bp(e,t,n),e=e.sibling}var an=null,Dr=!1;function Qo(e,t,n){for(n=n.child;n!==null;)hE(e,t,n),n=n.sibling}function hE(e,t,n){if(no&&typeof no.onCommitFiberUnmount=="function")try{no.onCommitFiberUnmount(uf,n)}catch{}switch(n.tag){case 5:vn||na(n,t);case 6:var r=an,o=Dr;an=null,Qo(e,t,n),an=r,Dr=o,an!==null&&(Dr?(e=an,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):an.removeChild(n.stateNode));break;case 18:an!==null&&(Dr?(e=an,n=n.stateNode,e.nodeType===8?Zh(e.parentNode,n):e.nodeType===1&&Zh(e,n),Ql(e)):Zh(an,n.stateNode));break;case 4:r=an,o=Dr,an=n.stateNode.containerInfo,Dr=!0,Qo(e,t,n),an=r,Dr=o;break;case 0:case 11:case 14:case 15:if(!vn&&(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)&&xp(n,t,s),o=o.next}while(o!==r)}Qo(e,t,n);break;case 1:if(!vn&&(na(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Lt(n,t,l)}Qo(e,t,n);break;case 21:Qo(e,t,n);break;case 22:n.mode&1?(vn=(r=vn)||n.memoizedState!==null,Qo(e,t,n),vn=r):Qo(e,t,n);break;default:Qo(e,t,n)}}function s1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new oA),t.forEach(function(r){var o=mA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Tr(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:an=l.stateNode,Dr=!1;break e;case 3:an=l.stateNode.containerInfo,Dr=!0;break e;case 4:an=l.stateNode.containerInfo,Dr=!0;break e}l=l.return}if(an===null)throw Error(J(160));hE(i,s,o),an=null,Dr=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){Lt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mE(t,e),t=t.sibling}function mE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Tr(t,e),Kr(e),r&4){try{Ml(3,e,e.return),yf(3,e)}catch(v){Lt(e,e.return,v)}try{Ml(5,e,e.return)}catch(v){Lt(e,e.return,v)}}break;case 1:Tr(t,e),Kr(e),r&512&&n!==null&&na(n,n.return);break;case 5:if(Tr(t,e),Kr(e),r&512&&n!==null&&na(n,n.return),e.flags&32){var o=e.stateNode;try{Hl(o,"")}catch(v){Lt(e,e.return,v)}}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&&Ob(o,i),qm(l,s);var u=qm(l,i);for(s=0;s<c.length;s+=2){var d=c[s],f=c[s+1];d==="style"?zb(o,f):d==="dangerouslySetInnerHTML"?Lb(o,f):d==="children"?Hl(o,f):Rg(o,d,f,u)}switch(l){case"input":Vm(o,i);break;case"textarea":Mb(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ua(o,!!i.multiple,p,!1):h!==!!i.multiple&&(i.defaultValue!=null?ua(o,!!i.multiple,i.defaultValue,!0):ua(o,!!i.multiple,i.multiple?[]:"",!1))}o[Zl]=i}catch(v){Lt(e,e.return,v)}}break;case 6:if(Tr(t,e),Kr(e),r&4){if(e.stateNode===null)throw Error(J(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Lt(e,e.return,v)}}break;case 3:if(Tr(t,e),Kr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ql(t.containerInfo)}catch(v){Lt(e,e.return,v)}break;case 4:Tr(t,e),Kr(e);break;case 13:Tr(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||(lv=qt())),r&4&&s1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(vn=(u=vn)||d,Tr(t,e),vn=u):Tr(t,e),Kr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(he=e,d=e.child;d!==null;){for(f=he=d;he!==null;){switch(h=he,p=h.child,h.tag){case 0:case 11:case 14:case 15:Ml(4,h,h.return);break;case 1:na(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(v){Lt(r,n,v)}}break;case 5:na(h,h.return);break;case 22:if(h.memoizedState!==null){l1(f);continue}}p!==null?(p.return=h,he=p):l1(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=Fb("display",s))}catch(v){Lt(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Lt(e,e.return,v)}}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:Tr(t,e),Kr(e),r&4&&s1(e);break;case 21:break;default:Tr(t,e),Kr(e)}}function Kr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(fE(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Hl(o,""),r.flags&=-33);var i=i1(e);bp(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=i1(e);Sp(e,l,s);break;default:throw Error(J(161))}}catch(c){Lt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function sA(e,t,n){he=e,pE(e)}function pE(e,t,n){for(var r=(e.mode&1)!==0;he!==null;){var o=he,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Au;if(!s){var l=o.alternate,c=l!==null&&l.memoizedState!==null||vn;l=Au;var u=vn;if(Au=s,(vn=c)&&!u)for(he=o;he!==null;)s=he,c=s.child,s.tag===22&&s.memoizedState!==null?c1(o):c!==null?(c.return=s,he=c):c1(o);for(;i!==null;)he=i,pE(i),i=i.sibling;he=o,Au=l,vn=u}a1(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,he=i):a1(e)}}function a1(e){for(;he!==null;){var t=he;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:vn||yf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!vn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:_r(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Hx(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}Hx(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&&Ql(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}vn||t.flags&512&&wp(t)}catch(h){Lt(t,t.return,h)}}if(t===e){he=null;break}if(n=t.sibling,n!==null){n.return=t.return,he=n;break}he=t.return}}function l1(e){for(;he!==null;){var t=he;if(t===e){he=null;break}var n=t.sibling;if(n!==null){n.return=t.return,he=n;break}he=t.return}}function c1(e){for(;he!==null;){var t=he;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{yf(4,t)}catch(c){Lt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Lt(t,o,c)}}var i=t.return;try{wp(t)}catch(c){Lt(t,i,c)}break;case 5:var s=t.return;try{wp(t)}catch(c){Lt(t,s,c)}}}catch(c){Lt(t,t.return,c)}if(t===e){he=null;break}var l=t.sibling;if(l!==null){l.return=t.return,he=l;break}he=t.return}}var aA=Math.ceil,Dd=Oo.ReactCurrentDispatcher,sv=Oo.ReactCurrentOwner,gr=Oo.ReactCurrentBatchConfig,tt=0,rn=null,Gt=null,un=0,Yn=0,ra=ji(0),Jt=0,ic=null,ns=0,xf=0,av=0,$l=null,Ln=null,lv=0,ja=1/0,go=null,Id=!1,Cp=null,hi=null,Nu=!1,si=null,Ad=0,Ll=0,Ep=null,td=-1,nd=0;function Tn(){return tt&6?qt():td!==-1?td:td=qt()}function mi(e){return e.mode&1?tt&2&&un!==0?un&-un:HI.transition!==null?(nd===0&&(nd=Jb()),nd):(e=lt,e!==0||(e=window.event,e=e===void 0?16:iC(e.type)),e):1}function Mr(e,t,n,r){if(50<Ll)throw Ll=0,Ep=null,Error(J(185));Tc(e,n,r),(!(tt&2)||e!==rn)&&(e===rn&&(!(tt&2)&&(xf|=n),Jt===4&&ni(e,un)),Bn(e,r),n===1&&tt===0&&!(t.mode&1)&&(ja=qt()+500,pf&&Pi()))}function Bn(e,t){var n=e.callbackNode;HD(e,t);var r=gd(e,e===rn?un:0);if(r===0)n!==null&&yx(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&yx(n),t===1)e.tag===0?UI(u1.bind(null,e)):EC(u1.bind(null,e)),FI(function(){!(tt&6)&&Pi()}),n=null;else{switch(Zb(r)){case 1:n=Ng;break;case 4:n=Yb;break;case 16:n=pd;break;case 536870912:n=Xb;break;default:n=pd}n=CE(n,gE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function gE(e,t){if(td=-1,nd=0,tt&6)throw Error(J(327));var n=e.callbackNode;if(pa()&&e.callbackNode!==n)return null;var r=gd(e,e===rn?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Nd(e,r);else{t=r;var o=tt;tt|=2;var i=yE();(rn!==e||un!==t)&&(go=null,ja=qt()+500,Yi(e,t));do try{uA();break}catch(l){vE(e,l)}while(!0);Gg(),Dd.current=i,tt=o,Gt!==null?t=0:(rn=null,un=0,t=Jt)}if(t!==0){if(t===2&&(o=Xm(e),o!==0&&(r=o,t=jp(e,o))),t===1)throw n=ic,Yi(e,0),ni(e,r),Bn(e,qt()),n;if(t===6)ni(e,r);else{if(o=e.current.alternate,!(r&30)&&!lA(o)&&(t=Nd(e,r),t===2&&(i=Xm(e),i!==0&&(r=i,t=jp(e,i))),t===1))throw n=ic,Yi(e,0),ni(e,r),Bn(e,qt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:$i(e,Ln,go);break;case 3:if(ni(e,r),(r&130023424)===r&&(t=lv+500-qt(),10<t)){if(gd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Tn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=ip($i.bind(null,e,Ln,go),t);break}$i(e,Ln,go);break;case 4:if(ni(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-Or(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=qt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*aA(r/1960))-r,10<r){e.timeoutHandle=ip($i.bind(null,e,Ln,go),r);break}$i(e,Ln,go);break;case 5:$i(e,Ln,go);break;default:throw Error(J(329))}}}return Bn(e,qt()),e.callbackNode===n?gE.bind(null,e):null}function jp(e,t){var n=$l;return e.current.memoizedState.isDehydrated&&(Yi(e,t).flags|=256),e=Nd(e,t),e!==2&&(t=Ln,Ln=n,t!==null&&Pp(t)),e}function Pp(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function lA(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(!Lr(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 ni(e,t){for(t&=~av,t&=~xf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Or(t),r=1<<n;e[n]=-1,t&=~r}}function u1(e){if(tt&6)throw Error(J(327));pa();var t=gd(e,0);if(!(t&1))return Bn(e,qt()),null;var n=Nd(e,t);if(e.tag!==0&&n===2){var r=Xm(e);r!==0&&(t=r,n=jp(e,r))}if(n===1)throw n=ic,Yi(e,0),ni(e,t),Bn(e,qt()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$i(e,Ln,go),Bn(e,qt()),null}function cv(e,t){var n=tt;tt|=1;try{return e(t)}finally{tt=n,tt===0&&(ja=qt()+500,pf&&Pi())}}function rs(e){si!==null&&si.tag===0&&!(tt&6)&&pa();var t=tt;tt|=1;var n=gr.transition,r=lt;try{if(gr.transition=null,lt=1,e)return e()}finally{lt=r,gr.transition=n,tt=t,!(tt&6)&&Pi()}}function uv(){Yn=ra.current,Pt(ra)}function Yi(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,LI(n)),Gt!==null)for(n=Gt.return;n!==null;){var r=n;switch(Hg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Sd();break;case 3:Ca(),Pt(zn),Pt(wn),Zg();break;case 5:Jg(r);break;case 4:Ca();break;case 13:Pt(_t);break;case 19:Pt(_t);break;case 10:Qg(r.type._context);break;case 22:case 23:uv()}n=n.return}if(rn=e,Gt=e=pi(e.current,null),un=Yn=t,Jt=0,ic=null,av=xf=ns=0,Ln=$l=null,Hi!==null){for(t=0;t<Hi.length;t++)if(n=Hi[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}Hi=null}return e}function vE(e,t){do{var n=Gt;try{if(Gg(),Ju.current=_d,Rd){for(var r=It.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Rd=!1}if(ts=0,tn=Xt=It=null,Ol=!1,nc=0,sv.current=null,n===null||n.return===null){Jt=1,ic=t,Gt=null;break}e:{var i=e,s=n.return,l=n,c=t;if(t=un,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 p=Xx(s);if(p!==null){p.flags&=-257,Jx(p,s,l,i,t),p.mode&1&&Yx(i,u,t),t=p,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){Yx(i,u,t),dv();break e}c=Error(J(426))}}else if(kt&&l.mode&1){var S=Xx(s);if(S!==null){!(S.flags&65536)&&(S.flags|=256),Jx(S,s,l,i,t),Wg(Ea(c,l));break e}}i=c=Ea(c,l),Jt!==4&&(Jt=2),$l===null?$l=[i]:$l.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=eE(i,c,t);Ux(i,y);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"&&(hi===null||!hi.has(w)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=tE(i,l,t);Ux(i,b);break e}}i=i.return}while(i!==null)}wE(n)}catch(j){t=j,Gt===n&&n!==null&&(Gt=n=n.return);continue}break}while(!0)}function yE(){var e=Dd.current;return Dd.current=_d,e===null?_d:e}function dv(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),rn===null||!(ns&268435455)&&!(xf&268435455)||ni(rn,un)}function Nd(e,t){var n=tt;tt|=2;var r=yE();(rn!==e||un!==t)&&(go=null,Yi(e,t));do try{cA();break}catch(o){vE(e,o)}while(!0);if(Gg(),tt=n,Dd.current=r,Gt!==null)throw Error(J(261));return rn=null,un=0,Jt}function cA(){for(;Gt!==null;)xE(Gt)}function uA(){for(;Gt!==null&&!OD();)xE(Gt)}function xE(e){var t=bE(e.alternate,e,Yn);e.memoizedProps=e.pendingProps,t===null?wE(e):Gt=t,sv.current=null}function wE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=rA(n,t),n!==null){n.flags&=32767,Gt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Jt=6,Gt=null;return}}else if(n=nA(n,t,Yn),n!==null){Gt=n;return}if(t=t.sibling,t!==null){Gt=t;return}Gt=t=e}while(t!==null);Jt===0&&(Jt=5)}function $i(e,t,n){var r=lt,o=gr.transition;try{gr.transition=null,lt=1,dA(e,t,n,r)}finally{gr.transition=o,lt=r}return null}function dA(e,t,n,r){do pa();while(si!==null);if(tt&6)throw Error(J(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(J(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(WD(e,i),e===rn&&(Gt=rn=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Nu||(Nu=!0,CE(pd,function(){return pa(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=gr.transition,gr.transition=null;var s=lt;lt=1;var l=tt;tt|=4,sv.current=null,iA(e,n),mE(n,e),DI(rp),vd=!!np,rp=np=null,e.current=n,sA(n),MD(),tt=l,lt=s,gr.transition=i}else e.current=n;if(Nu&&(Nu=!1,si=e,Ad=o),i=e.pendingLanes,i===0&&(hi=null),FD(n.stateNode),Bn(e,qt()),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(Id)throw Id=!1,e=Cp,Cp=null,e;return Ad&1&&e.tag!==0&&pa(),i=e.pendingLanes,i&1?e===Ep?Ll++:(Ll=0,Ep=e):Ll=0,Pi(),null}function pa(){if(si!==null){var e=Zb(Ad),t=gr.transition,n=lt;try{if(gr.transition=null,lt=16>e?16:e,si===null)var r=!1;else{if(e=si,si=null,Ad=0,tt&6)throw Error(J(331));var o=tt;for(tt|=4,he=e.current;he!==null;){var i=he,s=i.child;if(he.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(he=u;he!==null;){var d=he;switch(d.tag){case 0:case 11:case 15:Ml(8,d,i)}var f=d.child;if(f!==null)f.return=d,he=f;else for(;he!==null;){d=he;var h=d.sibling,p=d.return;if(dE(d),d===u){he=null;break}if(h!==null){h.return=p,he=h;break}he=p}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}he=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,he=s;else e:for(;he!==null;){if(i=he,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ml(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,he=y;break e}he=i.return}}var x=e.current;for(he=x;he!==null;){s=he;var w=s.child;if(s.subtreeFlags&2064&&w!==null)w.return=s,he=w;else e:for(s=x;he!==null;){if(l=he,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:yf(9,l)}}catch(j){Lt(l,l.return,j)}if(l===s){he=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,he=b;break e}he=l.return}}if(tt=o,Pi(),no&&typeof no.onPostCommitFiberRoot=="function")try{no.onPostCommitFiberRoot(uf,e)}catch{}r=!0}return r}finally{lt=n,gr.transition=t}}return!1}function d1(e,t,n){t=Ea(n,t),t=eE(e,t,1),e=fi(e,t,1),t=Tn(),e!==null&&(Tc(e,1,t),Bn(e,t))}function Lt(e,t,n){if(e.tag===3)d1(e,e,n);else for(;t!==null;){if(t.tag===3){d1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(hi===null||!hi.has(r))){e=Ea(n,e),e=tE(t,e,1),t=fi(t,e,1),e=Tn(),t!==null&&(Tc(t,1,e),Bn(t,e));break}}t=t.return}}function fA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Tn(),e.pingedLanes|=e.suspendedLanes&n,rn===e&&(un&n)===n&&(Jt===4||Jt===3&&(un&130023424)===un&&500>qt()-lv?Yi(e,0):av|=n),Bn(e,t)}function SE(e,t){t===0&&(e.mode&1?(t=Eu,Eu<<=1,!(Eu&130023424)&&(Eu=4194304)):t=1);var n=Tn();e=Po(e,t),e!==null&&(Tc(e,t,n),Bn(e,n))}function hA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),SE(e,n)}function mA(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(J(314))}r!==null&&r.delete(t),SE(e,n)}var bE;bE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||zn.current)Fn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Fn=!1,tA(e,t,n);Fn=!!(e.flags&131072)}else Fn=!1,kt&&t.flags&1048576&&jC(t,Ed,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;ed(e,t),e=t.pendingProps;var o=wa(t,wn.current);ma(t,n),o=tv(null,t,r,e,o,n);var i=nv();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,Vn(r)?(i=!0,bd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Yg(t),o.updater=gf,t.stateNode=o,o._reactInternals=t,fp(t,r,e,n),t=pp(null,t,r,!0,i,n)):(t.tag=0,kt&&i&&Ug(t),Cn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(ed(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=gA(r),e=_r(r,e),o){case 0:t=mp(null,t,r,e,n);break e;case 1:t=t1(null,t,r,e,n);break e;case 11:t=Zx(null,t,r,e,n);break e;case 14:t=e1(null,t,r,_r(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_r(r,o),mp(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_r(r,o),t1(e,t,r,o,n);case 3:e:{if(iE(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,RC(e,t),Td(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=Ea(Error(J(423)),t),t=n1(e,t,r,n,o);break e}else if(r!==o){o=Ea(Error(J(424)),t),t=n1(e,t,r,n,o);break e}else for(Jn=di(t.stateNode.containerInfo.firstChild),er=t,kt=!0,Ar=null,n=AC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Sa(),r===o){t=To(e,t,n);break e}Cn(e,t,r,n)}t=t.child}return t;case 5:return NC(t),e===null&&cp(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,op(r,o)?s=null:i!==null&&op(r,i)&&(t.flags|=32),oE(e,t),Cn(e,t,s,n),t.child;case 6:return e===null&&cp(t),null;case 13:return sE(e,t,n);case 4:return Xg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ba(t,null,r,n):Cn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_r(r,o),Zx(e,t,r,o,n);case 7:return Cn(e,t,t.pendingProps,n),t.child;case 8:return Cn(e,t,t.pendingProps.children,n),t.child;case 12:return Cn(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,yt(jd,r._currentValue),r._currentValue=s,i!==null)if(Lr(i.value,s)){if(i.children===o.children&&!zn.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=wo(-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),up(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(J(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),up(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}Cn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ma(t,n),o=yr(o),r=r(o),t.flags|=1,Cn(e,t,r,n),t.child;case 14:return r=t.type,o=_r(r,t.pendingProps),o=_r(r.type,o),e1(e,t,r,o,n);case 15:return nE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:_r(r,o),ed(e,t),t.tag=1,Vn(r)?(e=!0,bd(t)):e=!1,ma(t,n),DC(t,r,o),fp(t,r,o,n),pp(null,t,r,!0,e,n);case 19:return aE(e,t,n);case 22:return rE(e,t,n)}throw Error(J(156,t.tag))};function CE(e,t){return Kb(e,t)}function pA(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 pr(e,t,n,r){return new pA(e,t,n,r)}function fv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gA(e){if(typeof e=="function")return fv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Dg)return 11;if(e===Ig)return 14}return 2}function pi(e,t){var n=e.alternate;return n===null?(n=pr(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 rd(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")fv(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Gs:return Xi(n.children,o,i,t);case _g:s=8,o|=8;break;case Mm:return e=pr(12,n,t,o|2),e.elementType=Mm,e.lanes=i,e;case $m:return e=pr(13,n,t,o),e.elementType=$m,e.lanes=i,e;case Lm:return e=pr(19,n,t,o),e.elementType=Lm,e.lanes=i,e;case Ib:return wf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case _b:s=10;break e;case Db:s=9;break e;case Dg:s=11;break e;case Ig:s=14;break e;case Yo:s=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=pr(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Xi(e,t,n,r){return e=pr(7,e,r,t),e.lanes=n,e}function wf(e,t,n,r){return e=pr(22,e,r,t),e.elementType=Ib,e.lanes=n,e.stateNode={isHidden:!1},e}function am(e,t,n){return e=pr(6,e,null,t),e.lanes=n,e}function lm(e,t,n){return t=pr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vA(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=Bh(0),this.expirationTimes=Bh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Bh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function hv(e,t,n,r,o,i,s,l,c){return e=new vA(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=pr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Yg(i),e}function yA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:qs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function EE(e){if(!e)return xi;e=e._reactInternals;e:{if(vs(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Vn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Vn(n))return CC(e,n,t)}return t}function jE(e,t,n,r,o,i,s,l,c){return e=hv(n,r,!0,e,o,i,s,l,c),e.context=EE(null),n=e.current,r=Tn(),o=mi(n),i=wo(r,o),i.callback=t??null,fi(n,i,o),e.current.lanes=o,Tc(e,o,r),Bn(e,r),e}function Sf(e,t,n,r){var o=t.current,i=Tn(),s=mi(o);return n=EE(n),t.context===null?t.context=n:t.pendingContext=n,t=wo(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=fi(o,t,s),e!==null&&(Mr(e,o,s,i),Xu(e,o,s)),s}function Od(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 f1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mv(e,t){f1(e,t),(e=e.alternate)&&f1(e,t)}function xA(){return null}var PE=typeof reportError=="function"?reportError:function(e){console.error(e)};function pv(e){this._internalRoot=e}bf.prototype.render=pv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));Sf(e,t,null,null)};bf.prototype.unmount=pv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;rs(function(){Sf(null,e,null,null)}),t[jo]=null}};function bf(e){this._internalRoot=e}bf.prototype.unstable_scheduleHydration=function(e){if(e){var t=nC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ti.length&&t!==0&&t<ti[n].priority;n++);ti.splice(n,0,e),n===0&&oC(e)}};function gv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Cf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function h1(){}function wA(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=Od(s);i.call(u)}}var s=jE(t,r,e,0,null,!1,!1,"",h1);return e._reactRootContainer=s,e[jo]=s.current,Xl(e.nodeType===8?e.parentNode:e),rs(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=Od(c);l.call(u)}}var c=hv(e,0,!1,null,null,!1,!1,"",h1);return e._reactRootContainer=c,e[jo]=c.current,Xl(e.nodeType===8?e.parentNode:e),rs(function(){Sf(t,c,n,r)}),c}function Ef(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=Od(s);l.call(c)}}Sf(t,s,e,o)}else s=wA(n,t,e,o,r);return Od(s)}eC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Pl(t.pendingLanes);n!==0&&(Og(t,n|1),Bn(t,qt()),!(tt&6)&&(ja=qt()+500,Pi()))}break;case 13:rs(function(){var r=Po(e,1);if(r!==null){var o=Tn();Mr(r,e,1,o)}}),mv(e,1)}};Mg=function(e){if(e.tag===13){var t=Po(e,134217728);if(t!==null){var n=Tn();Mr(t,e,134217728,n)}mv(e,134217728)}};tC=function(e){if(e.tag===13){var t=mi(e),n=Po(e,t);if(n!==null){var r=Tn();Mr(n,e,t,r)}mv(e,t)}};nC=function(){return lt};rC=function(e,t){var n=lt;try{return lt=e,t()}finally{lt=n}};Qm=function(e,t,n){switch(t){case"input":if(Vm(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=mf(r);if(!o)throw Error(J(90));Nb(r),Vm(r,o)}}}break;case"textarea":Mb(e,n);break;case"select":t=n.value,t!=null&&ua(e,!!n.multiple,t,!1)}};Ub=cv;Hb=rs;var SA={usingClientEntryPoint:!1,Events:[Rc,Xs,mf,Vb,Bb,cv]},hl={findFiberByHostInstance:Ui,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},bA={bundleType:hl.bundleType,version:hl.version,rendererPackageName:hl.rendererPackageName,rendererConfig:hl.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=Gb(e),e===null?null:e.stateNode},findFiberByHostInstance:hl.findFiberByHostInstance||xA,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 Ou=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ou.isDisabled&&Ou.supportsFiber)try{uf=Ou.inject(bA),no=Ou}catch{}}ir.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SA;ir.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!gv(t))throw Error(J(200));return yA(e,t,null,n)};ir.createRoot=function(e,t){if(!gv(e))throw Error(J(299));var n=!1,r="",o=PE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=hv(e,1,!1,null,null,n,!1,r,o),e[jo]=t.current,Xl(e.nodeType===8?e.parentNode:e),new pv(t)};ir.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(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=Gb(t),e=e===null?null:e.stateNode,e};ir.flushSync=function(e){return rs(e)};ir.hydrate=function(e,t,n){if(!Cf(t))throw Error(J(200));return Ef(null,e,t,!0,n)};ir.hydrateRoot=function(e,t,n){if(!gv(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=PE;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=jE(t,null,e,1,n??null,o,!1,i,s),e[jo]=t.current,Xl(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 bf(t)};ir.render=function(e,t,n){if(!Cf(t))throw Error(J(200));return Ef(null,e,t,!1,n)};ir.unmountComponentAtNode=function(e){if(!Cf(e))throw Error(J(40));return e._reactRootContainer?(rs(function(){Ef(null,null,e,!1,function(){e._reactRootContainer=null,e[jo]=null})}),!0):!1};ir.unstable_batchedUpdates=cv;ir.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Cf(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return Ef(e,t,n,!1,r)};ir.version="18.2.0-next-9e3b772b8-20220608";function TE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(TE)}catch(e){console.error(e)}}TE(),jb.exports=ir;var Dc=jb.exports;const oa=fg(Dc),CA=MS({__proto__:null,default:oa},[Dc]),[EA,Sr]=Dn("ScrollArea.Root component was not found in tree");function Pa(e,t){const n=zi(t);La(()=>{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 jA=C.forwardRef((e,t)=>{const{style:n,...r}=e,o=Sr(),[i,s]=C.useState(0),[l,c]=C.useState(0),u=!!(i&&l);return Pa(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),Pa(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}),PA=C.forwardRef((e,t)=>{const n=Sr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?C.createElement(jA,{...e,ref:t}):null}),TA={scrollHideDelay:1e3,type:"hover"},kE=m.forwardRef((e,t)=>{const n=H("ScrollAreaRoot",TA,e),{type:r,scrollHideDelay:o,scrollbars:i,...s}=n,[l,c]=m.useState(null),[u,d]=m.useState(null),[f,h]=m.useState(null),[p,g]=m.useState(null),[v,S]=m.useState(null),[y,x]=m.useState(0),[w,b]=m.useState(0),[j,E]=m.useState(!1),[T,P]=m.useState(!1),_=Kt(t,D=>c(D));return C.createElement(EA,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:p,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:v,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:P,onCornerWidthChange:x,onCornerHeightChange:b}},C.createElement(G,{...s,ref:_,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${y}px`,"--sa-corner-height":i!=="xy"?"0px":`${w}px`}}))});kE.displayName="@mantine/core/ScrollAreaRoot";function RE(e,t){const n=e/t;return Number.isNaN(n)?0:n}function jf(e){const t=RE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function _E(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 kA(e,[t,n]){return Math.min(n,Math.max(t,e))}function m1(e,t,n="ltr"){const r=jf(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=kA(e,c);return _E([0,s],[0,l])(u)}function RA(e,t,n,r="ltr"){const o=jf(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 _E([c,u],f)(e)}function DE(e,t){return e>0&&e<t}function Md(e){return e?parseInt(e,10):0}function Ji(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[_A,IE]=Dn("ScrollAreaScrollbar was not found in tree"),AE=m.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=Sr(),[p,g]=C.useState(null),v=Kt(t,P=>g(P)),S=C.useRef(null),y=C.useRef(""),{viewport:x}=h,w=n.content-n.viewport,b=zi(u),j=zi(l),E=af(d,10),T=P=>{if(S.current){const _=P.clientX-S.current.left,D=P.clientY-S.current.top;c({x:_,y:D})}};return m.useEffect(()=>{const P=_=>{const D=_.target;(p==null?void 0:p.contains(D))&&b(_,w)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[x,p,w,b]),m.useEffect(j,[n,j]),Pa(p,E),Pa(h.content,E),C.createElement(_A,{value:{scrollbar:p,hasThumb:r,onThumbChange:zi(o),onThumbPointerUp:zi(i),onThumbPositionChange:j,onThumbPointerDown:zi(s)}},C.createElement("div",{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:Ji(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),S.current=p.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T(P))}),onPointerMove:Ji(e.onPointerMove,T),onPointerUp:Ji(e.onPointerUp,P=>{const _=P.target;_.hasPointerCapture(P.pointerId)&&_.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=y.current,S.current=null})}))}),DA=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=Sr(),[l,c]=m.useState(),u=m.useRef(null),d=Kt(t,u,s.onScrollbarXChange);return m.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),C.createElement(AE,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${jf(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),DE(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollWidth,viewport:s.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Md(l.paddingLeft),paddingEnd:Md(l.paddingRight)}})}})}),IA=m.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,s=Sr(),[l,c]=C.useState(),u=m.useRef(null),d=Kt(t,u,s.onScrollbarYChange);return m.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),C.createElement(AE,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${jf(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(s.viewport){const p=s.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),DE(p,h)&&f.preventDefault()}},onResize:()=>{u.current&&s.viewport&&l&&r({content:s.viewport.scrollHeight,viewport:s.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Md(l.paddingTop),paddingEnd:Md(l.paddingBottom)}})}})}),vv=m.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Va(),i=Sr(),s=m.useRef(null),l=m.useRef(0),[c,u]=m.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=RE(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:p=>{s.current=p},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:p=>{l.current=p}},h=(p,g)=>RA(p,l.current,c,g);return n==="horizontal"?C.createElement(DA,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollLeft,g=m1(p,c,o);s.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollLeft=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollLeft=h(p,o))}}):n==="vertical"?C.createElement(IA,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&s.current){const p=i.viewport.scrollTop,g=m1(p,c);s.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:p=>{i.viewport&&(i.viewport.scrollTop=p)},onDragScroll:p=>{i.viewport&&(i.viewport.scrollTop=h(p))}}):null}),NE=m.forwardRef((e,t)=>{const n=Sr(),{forceMount:r,...o}=e,[i,s]=m.useState(!1),l=e.orientation==="horizontal",c=af(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;s(l?u:d)}},10);return Pa(n.viewport,c),Pa(n.content,c),r||i?C.createElement(vv,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),AA=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Sr(),[i,s]=m.useState(!1);return m.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(NE,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),NA=m.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Sr(),i=e.orientation==="horizontal",[s,l]=m.useState("hidden"),c=af(()=>l("idle"),100);return m.useEffect(()=>{if(s==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[s,o.scrollHideDelay]),m.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const p=u[d];f!==p&&(l("scrolling"),c()),f=p};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||s!=="hidden"?C.createElement(vv,{"data-state":s==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ji(e.onPointerEnter,()=>l("interacting")),onPointerLeave:Ji(e.onPointerLeave,()=>l("idle"))}):null}),p1=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Sr(),{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(AA,{...r,ref:t,forceMount:n}):o.type==="scroll"?C.createElement(NA,{...r,ref:t,forceMount:n}):o.type==="auto"?C.createElement(NE,{...r,ref:t,forceMount:n}):o.type==="always"?C.createElement(vv,{...r,ref:t}):null});function OA(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 MA=m.forwardRef((e,t)=>{const{style:n,...r}=e,o=Sr(),i=IE(),{onThumbPositionChange:s}=i,l=Kt(t,d=>i.onThumbChange(d)),c=m.useRef(),u=af(()=>{c.current&&(c.current(),c.current=void 0)},100);return m.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=OA(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:Ji(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),p=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:p,y:g})}),onPointerUp:Ji(e.onPointerUp,i.onThumbPointerUp)})}),g1=C.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=IE();return n||o.hasThumb?C.createElement(MA,{ref:t,...r}):null}),OE=m.forwardRef(({children:e,style:t,...n},r)=>{const o=Sr(),i=Kt(r,o.onViewportChange);return C.createElement(G,{...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))});OE.displayName="@mantine/core/ScrollAreaViewport";var yv={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const ME={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},$A=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":V(t)}}),br=K((e,t)=>{const n=H("ScrollArea",ME,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:p,onScrollPositionChange:g,children:v,offsetScrollbars:S,scrollbars:y,...x}=n,[w,b]=m.useState(!1),j=de({name:"ScrollArea",props:n,classes:yv,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:$A});return C.createElement(kE,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:y,...j("root"),...x},C.createElement(OE,{...h,...j("viewport",{style:h==null?void 0:h.style}),ref:p,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":y||void 0,onScroll:E=>{var T;(T=h==null?void 0:h.onScroll)==null||T.call(h,E),g==null||g({x:E.currentTarget.scrollLeft,y:E.currentTarget.scrollTop})}},v),(y==="xy"||y==="x")&&C.createElement(p1,{...j("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1)},C.createElement(g1,{...j("thumb")})),(y==="xy"||y==="y")&&C.createElement(p1,{...j("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1)},C.createElement(g1,{...j("thumb")})),C.createElement(PA,{...j("corner"),"data-hovered":w||void 0,"data-hidden":d==="never"||void 0}))});br.displayName="@mantine/core/ScrollArea";const Pf=K((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:p,viewportProps:g,scrollbars:v,style:S,vars:y,...x}=H("ScrollAreaAutosize",ME,e);return C.createElement(G,{...x,ref:t,style:[{display:"flex",overflow:"auto"},S]},C.createElement(G,{style:{display:"flex",flexDirection:"column",flex:1}},C.createElement(br,{classNames:r,styles:o,scrollHideDelay:s,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:p,viewportProps:g,vars:y,scrollbars:v},n)))});br.classes=yv;Pf.displayName="@mantine/core/ScrollAreaAutosize";Pf.classes=yv;br.Autosize=Pf;var $E={root:"m_87cf2631"};const LA={__staticSelector:"UnstyledButton"},kn=Sn((e,t)=>{const n=H("UnstyledButton",LA,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:$E,className:r,style:u,classNames:l,styles:c,unstyled:s});return C.createElement(G,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});kn.classes=$E;kn.displayName="@mantine/core/UnstyledButton";var LE={root:"m_515a97f8"};const FA={},xv=K((e,t)=>{const n=H("VisuallyHidden",FA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,...u}=n,d=de({name:"VisuallyHidden",classes:LE,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l});return C.createElement(G,{component:"span",ref:t,...d("root"),...u})});xv.classes=LE;xv.displayName="@mantine/core/VisuallyHidden";var FE={root:"m_1b7284a3"};const zA={},VA=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ct(t),"--paper-shadow":yg(n)}}),Un=Sn((e,t)=>{const n=H("Paper",zA,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:p,...g}=n,v=de({name:"Paper",props:n,classes:FE,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:VA});return C.createElement(G,{ref:t,mod:[{"data-with-border":c},p],...v("root"),variant:h,...g})});Un.classes=FE;Un.displayName="@mantine/core/Paper";function wi(e){return zE(e)?(e.nodeName||"").toLowerCase():"#document"}function Hn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(zE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zE(e){return e instanceof Node||e instanceof Hn(e).Node}function Dt(e){return e instanceof Element||e instanceof Hn(e).Element}function nr(e){return e instanceof HTMLElement||e instanceof Hn(e).HTMLElement}function Tp(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hn(e).ShadowRoot}function Ic(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=rr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function BA(e){return["table","td","th"].includes(wi(e))}function wv(e){const t=Sv(),n=rr(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 UA(e){let t=os(e);for(;nr(t)&&!Ta(t);){if(wv(t))return t;t=os(t)}return null}function Sv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ta(e){return["html","body","#document"].includes(wi(e))}function rr(e){return Hn(e).getComputedStyle(e)}function Tf(e){return Dt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function os(e){if(wi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Tp(e)&&e.host||Mo(e);return Tp(t)?t.host:t}function VE(e){const t=os(e);return Ta(t)?e.ownerDocument?e.ownerDocument.body:e.body:nr(t)&&Ic(t)?t:VE(t)}function So(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=VE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Hn(o);return i?t.concat(s,s.visualViewport||[],Ic(o)?o:[],s.frameElement&&n?So(s.frameElement):[]):t.concat(o,So(o,[],n))}function v1(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 sc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Tp(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function BE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function UE(){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 HA(e){return GA()?!1:!y1()&&e.width===0&&e.height===0||y1()&&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 WA(){return/apple/i.test(navigator.vendor)}function y1(){const e=/android/i;return e.test(BE())||e.test(UE())}function qA(){return BE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function GA(){return UE().includes("jsdom/")}function kp(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function QA(e){return"nativeEvent"in e}function KA(e){return e.matches("html,body")}function qi(e){return(e==null?void 0:e.ownerDocument)||document}function cm(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 Us(e){return"composedPath"in e?e.composedPath()[0]:e.target}const YA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function XA(e){return nr(e)&&e.matches(YA)}const Fr=Math.min,yn=Math.max,$d=Math.round,Mu=Math.floor,Si=e=>({x:e,y:e}),JA={left:"right",right:"left",bottom:"top",top:"bottom"},ZA={start:"end",end:"start"};function Rp(e,t,n){return yn(e,Fr(t,n))}function ko(e,t){return typeof e=="function"?e(t):e}function zr(e){return e.split("-")[0]}function Ha(e){return e.split("-")[1]}function bv(e){return e==="x"?"y":"x"}function Cv(e){return e==="y"?"height":"width"}function ys(e){return["top","bottom"].includes(zr(e))?"y":"x"}function Ev(e){return bv(ys(e))}function eN(e,t,n){n===void 0&&(n=!1);const r=Ha(e),o=Ev(e),i=Cv(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ld(s)),[s,Ld(s)]}function tN(e){const t=Ld(e);return[_p(e),t,_p(t)]}function _p(e){return e.replace(/start|end/g,t=>ZA[t])}function nN(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 rN(e,t,n,r){const o=Ha(e);let i=nN(zr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(_p)))),i}function Ld(e){return e.replace(/left|right|bottom|top/g,t=>JA[t])}function oN(e){return{top:0,right:0,bottom:0,left:0,...e}}function jv(e){return typeof e!="number"?oN(e):{top:e,right:e,bottom:e,left:e}}function ka(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function x1(e,t,n){let{reference:r,floating:o}=e;const i=ys(t),s=Ev(t),l=Cv(s),c=zr(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 p;switch(c){case"top":p={x:d,y:r.y-o.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:f};break;case"left":p={x:r.x-o.width,y:f};break;default:p={x:r.x,y:r.y}}switch(Ha(t)){case"start":p[s]-=h*(n&&u?-1:1);break;case"end":p[s]+=h*(n&&u?-1:1);break}return p}const iN=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}=x1(u,r,c),h=r,p={},g=0;for(let v=0;v<l.length;v++){const{name:S,fn:y}=l[v],{x,y:w,data:b,reset:j}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:p,rects:u,platform:s,elements:{reference:e,floating:t}});d=x??d,f=w??f,p={...p,[S]:{...p[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}=x1(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:p}};async function Pv(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:p=0}=ko(t,e),g=jv(p),S=l[h?f==="floating"?"reference":"floating":f],y=ka(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=ka(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:x,offsetParent:w,strategy:c}):x);return{top:(y.top-j.top+g.top)/b.y,bottom:(j.bottom-y.bottom+g.bottom)/b.y,left:(y.left-j.left+g.left)/b.x,right:(j.right-y.right+g.right)/b.x}}const sN=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=jv(d),h={x:n,y:r},p=Ev(o),g=Cv(p),v=await s.getDimensions(u),S=p==="y",y=S?"top":"left",x=S?"bottom":"right",w=S?"clientHeight":"clientWidth",b=i.reference[g]+i.reference[p]-h[p]-i.floating[g],j=h[p]-i.reference[p],E=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let T=E?E[w]:0;(!T||!await(s.isElement==null?void 0:s.isElement(E)))&&(T=l.floating[w]||i.floating[g]);const P=b/2-j/2,_=T/2-v[g]/2-1,D=Fr(f[y],_),$=Fr(f[x],_),I=D,L=T-v[g]-$,F=T/2-v[g]/2+P,O=Rp(I,F,L),A=!c.arrow&&Ha(o)!=null&&F!==O&&i.reference[g]/2-(F<I?D:$)-v[g]/2<0,R=A?F<I?F-I:F-L:0;return{[p]:h[p]+R,data:{[p]:O,centerOffset:F-O-R,...A&&{alignmentOffset:R}},reset:A}}}),aN=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:p="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...S}=ko(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=zr(o),x=zr(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=h||(x||!v?[Ld(l)]:tN(l));!h&&g!=="none"&&b.push(...rN(l,v,g,w));const j=[l,...b],E=await Pv(t,S),T=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&T.push(E[y]),f){const I=eN(o,s,w);T.push(E[I[0]],E[I[1]])}if(P=[...P,{placement:o,overflows:T}],!T.every(I=>I<=0)){var _,D;const I=(((_=i.flip)==null?void 0:_.index)||0)+1,L=j[I];if(L)return{data:{index:I,overflows:P},reset:{placement:L}};let F=(D=P.filter(O=>O.overflows[0]<=0).sort((O,A)=>O.overflows[1]-A.overflows[1])[0])==null?void 0:D.placement;if(!F)switch(p){case"bestFit":{var $;const O=($=P.map(A=>[A.placement,A.overflows.filter(R=>R>0).reduce((R,k)=>R+k,0)]).sort((A,R)=>A[1]-R[1])[0])==null?void 0:$[0];O&&(F=O);break}case"initialPlacement":F=l;break}if(o!==F)return{reset:{placement:F}}}return{}}}};function HE(e){const t=Fr(...e.map(i=>i.left)),n=Fr(...e.map(i=>i.top)),r=yn(...e.map(i=>i.right)),o=yn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function lN(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=>ka(HE(o)))}const cN=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=lN(d),h=ka(HE(d)),p=jv(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(S=>c>S.left-p.left&&c<S.right+p.right&&u>S.top-p.top&&u<S.bottom+p.bottom)||h;if(f.length>=2){if(ys(n)==="y"){const D=f[0],$=f[f.length-1],I=zr(n)==="top",L=D.top,F=$.bottom,O=I?D.left:$.left,A=I?D.right:$.right,R=A-O,k=F-L;return{top:L,bottom:F,left:O,right:A,width:R,height:k,x:O,y:L}}const S=zr(n)==="left",y=yn(...f.map(D=>D.right)),x=Fr(...f.map(D=>D.left)),w=f.filter(D=>S?D.left===x:D.right===y),b=w[0].top,j=w[w.length-1].bottom,E=x,T=y,P=T-E,_=j-b;return{top:b,bottom:j,left:E,right:T,width:P,height:_,x:E,y:b}}return h}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:s});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function uN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=zr(n),l=Ha(n),c=ys(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&c?-1:1,f=ko(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof g=="number"&&(p=l==="end"?g*-1:g),c?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const WE=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 uN(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}}}}},dN=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:y,y:x}=S;return{x:y,y:x}}},...c}=ko(e,t),u={x:n,y:r},d=await Pv(t,c),f=ys(zr(o)),h=bv(f);let p=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=p+d[S],w=p-d[y];p=Rp(x,p,w)}if(s){const S=f==="y"?"top":"left",y=f==="y"?"bottom":"right",x=g+d[S],w=g-d[y];g=Rp(x,g,w)}const v=l.fn({...t,[h]:p,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},fN=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=ys(o),h=bv(f);let p=d[h],g=d[f];const v=ko(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};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;p<b?p=b:p>j&&(p=j)}if(u){var y,x;const w=h==="y"?"width":"height",b=["top","left"].includes(zr(o)),j=i.reference[f]-i.floating[w]+(b&&((y=s.offset)==null?void 0:y[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]:p,[f]:g}}}},hN=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 Pv(t,l),u=zr(n),d=Ha(n),f=ys(n)==="y",{width:h,height:p}=r.floating;let g,v;u==="top"||u==="bottom"?(g=u,v=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=u,g=d==="end"?"top":"bottom");const S=p-c[g],y=h-c[v],x=!t.middlewareData.shift;let w=S,b=y;if(f){const E=h-c.left-c.right;b=d||x?Fr(y,E):E}else{const E=p-c.top-c.bottom;w=d||x?Fr(S,E):E}if(x&&!d){const E=yn(c.left,0),T=yn(c.right,0),P=yn(c.top,0),_=yn(c.bottom,0);f?b=h-2*(E!==0||T!==0?E+T:yn(c.left,c.right)):w=p-2*(P!==0||_!==0?P+_:yn(c.top,c.bottom))}await s({...t,availableWidth:b,availableHeight:w});const j=await o.getDimensions(i.floating);return h!==j.width||p!==j.height?{reset:{rects:!0}}:{}}}};function qE(e){const t=rr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=nr(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=$d(n)!==i||$d(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function Tv(e){return Dt(e)?e:e.contextElement}function ga(e){const t=Tv(e);if(!nr(t))return Si(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qE(t);let s=(i?$d(n.width):n.width)/r,l=(i?$d(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const mN=Si(0);function GE(e){const t=Hn(e);return!Sv()||!t.visualViewport?mN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hn(e)?!1:t}function is(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Tv(e);let s=Si(1);t&&(r?Dt(r)&&(s=ga(r)):s=ga(e));const l=pN(i,n,r)?GE(i):Si(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=Hn(i),p=r&&Dt(r)?Hn(r):r;let g=h,v=g.frameElement;for(;v&&r&&p!==g;){const S=ga(v),y=v.getBoundingClientRect(),x=rr(v),w=y.left+(v.clientLeft+parseFloat(x.paddingLeft))*S.x,b=y.top+(v.clientTop+parseFloat(x.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=w,u+=b,g=Hn(v),v=g.frameElement}}return ka({width:d,height:f,x:c,y:u})}const gN=[":popover-open",":modal"];function QE(e){return gN.some(t=>{try{return e.matches(t)}catch{return!1}})}function vN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Mo(r),l=t?QE(t.floating):!1;if(r===s||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Si(1);const d=Si(0),f=nr(r);if((f||!f&&!i)&&((wi(r)!=="body"||Ic(s))&&(c=Tf(r)),nr(r))){const h=is(r);u=ga(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 yN(e){return Array.from(e.getClientRects())}function KE(e){return is(Mo(e)).left+Tf(e).scrollLeft}function xN(e){const t=Mo(e),n=Tf(e),r=e.ownerDocument.body,o=yn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=yn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+KE(e);const l=-n.scrollTop;return rr(r).direction==="rtl"&&(s+=yn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function wN(e,t){const n=Hn(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=Sv();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:s,x:l,y:c}}function SN(e,t){const n=is(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=nr(e)?ga(e):Si(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 w1(e,t,n){let r;if(t==="viewport")r=wN(e,n);else if(t==="document")r=xN(Mo(e));else if(Dt(t))r=SN(t,n);else{const o=GE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ka(r)}function YE(e,t){const n=os(e);return n===t||!Dt(n)||Ta(n)?!1:rr(n).position==="fixed"||YE(n,t)}function bN(e,t){const n=t.get(e);if(n)return n;let r=So(e,[],!1).filter(l=>Dt(l)&&wi(l)!=="body"),o=null;const i=rr(e).position==="fixed";let s=i?os(e):e;for(;Dt(s)&&!Ta(s);){const l=rr(s),c=wv(s);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ic(s)&&!c&&YE(e,s))?r=r.filter(d=>d!==s):o=l,s=os(s)}return t.set(e,r),r}function CN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?bN(t,this._c):[].concat(n),r],l=s[0],c=s.reduce((u,d)=>{const f=w1(t,d,o);return u.top=yn(f.top,u.top),u.right=Fr(f.right,u.right),u.bottom=Fr(f.bottom,u.bottom),u.left=yn(f.left,u.left),u},w1(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function EN(e){const{width:t,height:n}=qE(e);return{width:t,height:n}}function jN(e,t,n){const r=nr(t),o=Mo(t),i=n==="fixed",s=is(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Si(0);if(r||!r&&!i)if((wi(t)!=="body"||Ic(o))&&(l=Tf(t)),r){const f=is(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=KE(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 S1(e,t){return!nr(e)||rr(e).position==="fixed"?null:t?t(e):e.offsetParent}function XE(e,t){const n=Hn(e);if(!nr(e)||QE(e))return n;let r=S1(e,t);for(;r&&BA(r)&&rr(r).position==="static";)r=S1(r,t);return r&&(wi(r)==="html"||wi(r)==="body"&&rr(r).position==="static"&&!wv(r))?n:r||UA(e)||n}const PN=async function(e){const t=this.getOffsetParent||XE,n=this.getDimensions;return{reference:jN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function TN(e){return rr(e).direction==="rtl"}const kN={convertOffsetParentRelativeRectToViewportRelativeRect:vN,getDocumentElement:Mo,getClippingRect:CN,getOffsetParent:XE,getElementRects:PN,getClientRects:yN,getDimensions:EN,getScale:ga,isElement:Dt,isRTL:TN};function RN(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 p=Mu(d),g=Mu(o.clientWidth-(u+f)),v=Mu(o.clientHeight-(d+h)),S=Mu(u),x={rootMargin:-p+"px "+-g+"px "+-v+"px "+-S+"px",threshold:yn(0,Fr(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 _N(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=Tv(e),d=o||i?[...u?So(u):[],...So(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&l?RN(u,n):null;let h=-1,p=null;s&&(p=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var w;(w=p)==null||w.observe(t)})),n()}),u&&!c&&p.observe(u),p.observe(t));let g,v=c?is(e):null;c&&S();function S(){const y=is(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,g=requestAnimationFrame(S)}return n(),()=>{var y;d.forEach(x=>{o&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),f==null||f(),(y=p)==null||y.disconnect(),p=null,c&&cancelAnimationFrame(g)}}const kv=dN,Dp=aN,DN=hN,b1=sN,Ip=cN,C1=fN,IN=(e,t,n)=>{const r=new Map,o={platform:kN,...n},i={...o.platform,_c:r};return iN(e,t,{...o,platform:i})},JE=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?b1({element:r.current,padding:o}).fn(n):{}:r?b1({element:r,padding:o}).fn(n):{}}}};var od=typeof document<"u"?m.useLayoutEffect:m.useEffect;function Fd(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(!Fd(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)&&!Fd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function ZE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function E1(e,t){const n=ZE(e);return Math.round(t*n)/n}function j1(e){const t=m.useRef(e);return od(()=>{t.current=e}),t}function AN(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]=m.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,p]=m.useState(r);Fd(h,r)||p(r);const[g,v]=m.useState(null),[S,y]=m.useState(null),x=m.useCallback(R=>{R!==E.current&&(E.current=R,v(R))},[]),w=m.useCallback(R=>{R!==T.current&&(T.current=R,y(R))},[]),b=i||g,j=s||S,E=m.useRef(null),T=m.useRef(null),P=m.useRef(d),_=c!=null,D=j1(c),$=j1(o),I=m.useCallback(()=>{if(!E.current||!T.current)return;const R={placement:t,strategy:n,middleware:h};$.current&&(R.platform=$.current),IN(E.current,T.current,R).then(k=>{const M={...k,isPositioned:!0};L.current&&!Fd(P.current,M)&&(P.current=M,Dc.flushSync(()=>{f(M)}))})},[h,t,n,$]);od(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(R=>({...R,isPositioned:!1})))},[u]);const L=m.useRef(!1);od(()=>(L.current=!0,()=>{L.current=!1}),[]),od(()=>{if(b&&(E.current=b),j&&(T.current=j),b&&j){if(D.current)return D.current(b,j,I);I()}},[b,j,I,D,_]);const F=m.useMemo(()=>({reference:E,floating:T,setReference:x,setFloating:w}),[x,w]),O=m.useMemo(()=>({reference:b,floating:j}),[b,j]),A=m.useMemo(()=>{const R={position:n,left:0,top:0};if(!O.floating)return R;const k=E1(O.floating,d.x),M=E1(O.floating,d.y);return l?{...R,transform:"translate("+k+"px, "+M+"px)",...ZE(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:k,top:M}},[n,l,O.floating,d.x,d.y]);return m.useMemo(()=>({...d,update:I,refs:F,elements:O,floatingStyles:A}),[d,I,F,O,A])}const ej={...qS},NN=ej.useInsertionEffect,ON=NN||(e=>e());function Hs(e){const t=m.useRef(()=>{});return ON(()=>{t.current=e}),m.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 oo=typeof document<"u"?m.useLayoutEffect:m.useEffect;let P1=!1,MN=0;const T1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+MN++;function $N(){const[e,t]=m.useState(()=>P1?T1():void 0);return oo(()=>{e==null&&t(T1())},[]),m.useEffect(()=>{P1=!0},[]),e}const LN=ej.useId,tj=LN||$N;function FN(){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 zN=m.createContext(null),VN=m.createContext(null),Rv=()=>{var e;return((e=m.useContext(zN))==null?void 0:e.id)||null},_v=()=>m.useContext(VN);function Dv(e){return"data-floating-ui-"+e}function k1(e){const t=m.useRef(e);return oo(()=>{t.current=e}),t}const R1=Dv("safe-polygon");function id(e,t,n){return n&&!kp(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function BN(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:p=0,move:g=!0}=t,v=_v(),S=Rv(),y=k1(f),x=k1(d),w=m.useRef(),b=m.useRef(),j=m.useRef(),E=m.useRef(),T=m.useRef(!0),P=m.useRef(!1),_=m.useRef(()=>{}),D=m.useCallback(()=>{var F;const O=(F=o.current.openEvent)==null?void 0:F.type;return(O==null?void 0:O.includes("mouse"))&&O!=="mousedown"},[o]);m.useEffect(()=>{if(!u)return;function F(O){let{open:A}=O;A||(clearTimeout(b.current),clearTimeout(E.current),T.current=!0)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[u,i]),m.useEffect(()=>{if(!u||!y.current||!n)return;function F(A){D()&&r(!1,A,"hover")}const O=qi(l).documentElement;return O.addEventListener("mouseleave",F),()=>{O.removeEventListener("mouseleave",F)}},[l,n,r,u,y,D]);const $=m.useCallback(function(F,O,A){O===void 0&&(O=!0),A===void 0&&(A="hover");const R=id(x.current,"close",w.current);R&&!j.current?(clearTimeout(b.current),b.current=setTimeout(()=>r(!1,F,A),R)):O&&(clearTimeout(b.current),r(!1,F,A))},[x,r]),I=m.useCallback(()=>{_.current(),j.current=void 0},[]),L=m.useCallback(()=>{if(P.current){const F=qi(c.floating.current).body;F.style.pointerEvents="",F.removeAttribute(R1),P.current=!1}},[c]);return m.useEffect(()=>{if(!u)return;function F(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function O(k){if(clearTimeout(b.current),T.current=!1,h&&!kp(w.current)||p>0&&id(x.current,"open")===0)return;const M=id(x.current,"open",w.current);M?b.current=setTimeout(()=>{r(!0,k,"hover")},M):r(!0,k,"hover")}function A(k){if(F())return;_.current();const M=qi(l);if(clearTimeout(E.current),y.current){n||clearTimeout(b.current),j.current=y.current({...e,tree:v,x:k.clientX,y:k.clientY,onClose(){L(),I(),$(k,!0,"safe-polygon")}});const U=j.current;M.addEventListener("mousemove",U),_.current=()=>{M.removeEventListener("mousemove",U)};return}(w.current==="touch"?!sc(l,k.relatedTarget):!0)&&$(k)}function R(k){F()||y.current==null||y.current({...e,tree:v,x:k.clientX,y:k.clientY,onClose(){L(),I(),$(k)}})(k)}if(Dt(s)){const k=s;return n&&k.addEventListener("mouseleave",R),l==null||l.addEventListener("mouseleave",R),g&&k.addEventListener("mousemove",O,{once:!0}),k.addEventListener("mouseenter",O),k.addEventListener("mouseleave",A),()=>{n&&k.removeEventListener("mouseleave",R),l==null||l.removeEventListener("mouseleave",R),g&&k.removeEventListener("mousemove",O),k.removeEventListener("mouseenter",O),k.removeEventListener("mouseleave",A)}}},[s,l,u,e,h,p,g,$,I,L,r,n,v,x,y,o]),oo(()=>{var F;if(u&&n&&(F=y.current)!=null&&F.__options.blockPointerEvents&&D()){const A=qi(l).body;if(A.setAttribute(R1,""),A.style.pointerEvents="none",P.current=!0,Dt(s)&&l){var O;const R=s,k=v==null||(O=v.nodesRef.current.find(M=>M.id===S))==null||(O=O.context)==null?void 0:O.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,v,y,D]),oo(()=>{n||(w.current=void 0,I(),L())},[n,I,L]),m.useEffect(()=>()=>{I(),clearTimeout(b.current),clearTimeout(E.current),L()},[u,s,I,L]),m.useMemo(()=>{if(!u)return{};function F(O){w.current=O.pointerType}return{reference:{onPointerDown:F,onPointerEnter:F,onMouseMove(O){function A(){T.current||r(!0,O.nativeEvent,"hover")}h&&!kp(w.current)||n||p===0||(clearTimeout(E.current),w.current==="touch"?A():E.current=setTimeout(A,p))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(O){$(O.nativeEvent,!1)}}}},[u,h,n,p,r,$])}const Ap=()=>{},nj=m.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ap,setState:Ap,isInstantPhase:!1}),rj=()=>m.useContext(nj),UN=e=>{const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=m.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),s=m.useRef(null),l=m.useCallback(c=>{i({currentId:c})},[]);return oo(()=>{o.currentId?s.current===null?s.current=o.currentId:i({isInstantPhase:!0}):(i({isInstantPhase:!1}),s.current=null)},[o.currentId]),m.createElement(nj.Provider,{value:m.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)};function HN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i}=t,s=i??o,l=rj(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:h}=l;return oo(()=>{c&&(f({delay:{open:1,close:id(d,"close")}}),c!==s&&r(!1))},[s,r,f,c,d]),oo(()=>{function p(){r(!1),f({delay:d,currentId:null})}if(c&&!n&&c===s){if(h){const g=window.setTimeout(p,h);return()=>{clearTimeout(g)}}p()}},[n,f,c,s,r,d,h]),oo(()=>{u===Ap||!n||u(s)},[n,u,s]),l}function um(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 WN={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qN={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},_1=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 GN(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:p=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:y}=t,x=_v(),w=Hs(typeof f=="function"?f:()=>!1),b=typeof f=="function"?w:f,j=m.useRef(!1),E=m.useRef(!1),{escapeKey:T,outsidePress:P}=_1(S),{escapeKey:_,outsidePress:D}=_1(y),$=Hs(O=>{if(!n||!u||!d||O.key!=="Escape")return;const A=x?um(x.nodesRef.current,o):[];if(!T&&(O.stopPropagation(),A.length>0)){let R=!0;if(A.forEach(k=>{var M;if((M=k.context)!=null&&M.open&&!k.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,QA(O)?O.nativeEvent:O,"escape-key")}),I=Hs(O=>{var A;const R=()=>{var k;$(O),(k=Us(O))==null||k.removeEventListener("keydown",R)};(A=Us(O))==null||A.addEventListener("keydown",R)}),L=Hs(O=>{const A=j.current;j.current=!1;const R=E.current;if(E.current=!1,h==="click"&&R||A||typeof b=="function"&&!b(O))return;const k=Us(O),M="["+Dv("inert")+"]",B=qi(l).querySelectorAll(M);let U=Dt(k)?k:null;for(;U&&!Ta(U);){const fe=os(U);if(Ta(fe)||!Dt(fe))break;U=fe}if(B.length&&Dt(k)&&!KA(k)&&!sc(k,l)&&Array.from(B).every(fe=>!sc(U,fe)))return;if(nr(k)&&l){const fe=k.clientWidth>0&&k.scrollWidth>k.clientWidth,Ce=k.clientHeight>0&&k.scrollHeight>k.clientHeight;let Te=Ce&&O.offsetX>k.clientWidth;if(Ce&&rr(k).direction==="rtl"&&(Te=O.offsetX<=k.offsetWidth-k.clientWidth),Te||fe&&O.offsetY>k.clientHeight)return}const X=x&&um(x.nodesRef.current,o).some(fe=>{var Ce;return cm(O,(Ce=fe.context)==null?void 0:Ce.elements.floating)});if(cm(O,l)||cm(O,s)||X)return;const re=x?um(x.nodesRef.current,o):[];if(re.length>0){let fe=!0;if(re.forEach(Ce=>{var Te;if((Te=Ce.context)!=null&&Te.open&&!Ce.context.dataRef.current.__outsidePressBubbles){fe=!1;return}}),!fe)return}r(!1,O,"outside-press")}),F=Hs(O=>{var A;const R=()=>{var k;L(O),(k=Us(O))==null||k.removeEventListener(h,R)};(A=Us(O))==null||A.addEventListener(h,R)});return m.useEffect(()=>{if(!n||!u)return;c.current.__escapeKeyBubbles=T,c.current.__outsidePressBubbles=P;function O(k){r(!1,k,"ancestor-scroll")}const A=qi(l);d&&A.addEventListener("keydown",_?I:$,_),b&&A.addEventListener(h,D?F:L,D);let R=[];return v&&(Dt(s)&&(R=So(s)),Dt(l)&&(R=R.concat(So(l))),!Dt(i)&&i&&i.contextElement&&(R=R.concat(So(i.contextElement)))),R=R.filter(k=>{var M;return k!==((M=A.defaultView)==null?void 0:M.visualViewport)}),R.forEach(k=>{k.addEventListener("scroll",O,{passive:!0})}),()=>{d&&A.removeEventListener("keydown",_?I:$,_),b&&A.removeEventListener(h,D?F:L,D),R.forEach(k=>{k.removeEventListener("scroll",O)})}},[c,l,s,i,d,b,h,n,r,v,u,T,P,$,_,I,L,D,F]),m.useEffect(()=>{j.current=!1},[b,h]),m.useMemo(()=>u?{reference:{onKeyDown:$,[WN[g]]:O=>{p&&r(!1,O.nativeEvent,"reference-press")}},floating:{onKeyDown:$,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[qN[h]]:()=>{j.current=!0}}}:{},[u,p,h,g,r,$])}function Iv(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[i,s]=m.useState(null),[l,c]=m.useState(null),d=((t=e.elements)==null?void 0:t.reference)||i;oo(()=>{d&&(v.current=d)},[d]);const f=AN({...e,elements:{...e.elements,...l&&{reference:l}}}),h=_v(),p=Rv()!=null,g=Hs((P,_,D)=>{S.current.openEvent=P?_:void 0,y.emit("openchange",{open:P,event:_,reason:D,nested:p}),r==null||r(P,_,D)}),v=m.useRef(null),S=m.useRef({}),y=m.useState(()=>FN())[0],x=tj(),w=m.useCallback(P=>{const _=Dt(P)?{getBoundingClientRect:()=>P.getBoundingClientRect(),contextElement:P}:P;c(_),f.refs.setReference(_)},[f.refs]),b=m.useCallback(P=>{(Dt(P)||P===null)&&(v.current=P,s(P)),(Dt(f.refs.reference.current)||f.refs.reference.current===null||P!==null&&!Dt(P))&&f.refs.setReference(P)},[f.refs]),j=m.useMemo(()=>({...f.refs,setReference:b,setPositionReference:w,domReference:v}),[f.refs,b,w]),E=m.useMemo(()=>({...f.elements,domReference:d}),[f.elements,d]),T=m.useMemo(()=>({...f,refs:j,elements:E,dataRef:S,nodeId:o,floatingId:x,events:y,open:n,onOpenChange:g}),[f,o,x,y,n,g,j,E]);return oo(()=>{const P=h==null?void 0:h.nodesRef.current.find(_=>_.id===o);P&&(P.context=T)}),m.useMemo(()=>({...f,context:T,refs:j,elements:E}),[f,j,E,T])}function QN(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=m.useRef(!1),d=m.useRef(),f=m.useRef(!0);return m.useEffect(()=>{if(!l)return;const h=Hn(s);function p(){!n&&nr(s)&&s===v1(qi(s))&&(u.current=!0)}function g(){f.current=!0}return h.addEventListener("blur",p),h.addEventListener("keydown",g,!0),()=>{h.removeEventListener("blur",p),h.removeEventListener("keydown",g,!0)}},[s,n,l]),m.useEffect(()=>{if(!l)return;function h(p){let{reason:g}=p;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,l]),m.useEffect(()=>()=>{clearTimeout(d.current)},[]),m.useMemo(()=>l?{reference:{onPointerDown(h){HA(h.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const p=Us(h.nativeEvent);if(c&&Dt(p))try{if(WA()&&qA())throw Error();if(!p.matches(":focus-visible"))return}catch{if(!f.current&&!XA(p))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const p=h.relatedTarget,g=Dt(p)&&p.hasAttribute(Dv("focus-guard"))&&p.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{const v=v1(s?s.ownerDocument:document);!p&&v===s||sc(i.floating.current,v)||sc(s,v)||g||r(!1,h.nativeEvent,"focus")})}}}:{},[l,c,s,i,r])}const D1="active",I1="selected";function dm(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[D1]:s,[I1]: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&&[D1,I1].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,p=arguments.length,g=new Array(p),v=0;v<p;v++)g[v]=arguments[v];return(h=r.get(u))==null?void 0:h.map(S=>S(...g)).find(S=>S!==void 0)}}}else s[u]=d}),s),{})}}function KN(e){e===void 0&&(e=[]);const t=e,n=m.useCallback(i=>dm(i,e,"reference"),t),r=m.useCallback(i=>dm(i,e,"floating"),t),o=m.useCallback(i=>dm(i,e,"item"),e.map(i=>i==null?void 0:i.item));return m.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const YN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function XN(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:s="dialog"}=t,l=(n=YN.get(s))!=null?n:s,c=tj(),d=Rv()!=null;return m.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:p,selected:g}=h;const v={role:"option",...p&&{id:o+"-option"}};switch(s){case"select":return{...v,"aria-selected":p&&g};case"combobox":return{...v,...p&&{"aria-selected":!0}}}return{}}}},[i,s,l,r,o,c,d])}function oj(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 A1(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function N1(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 JN={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function ZN({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:s,dir:l}){const[c,u="center"]=e.split("-"),d={width:V(t),height:V(t),transform:"rotate(45deg)",position:"absolute",[JN[c]]:V(r)},f=V(-t/2);return c==="left"?{...d,...A1(u,s,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...A1(u,s,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...N1(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...N1(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const Av=m.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:s,arrowY:l,style:c,...u},d)=>{const{dir:f}=Va();return i?C.createElement("div",{...u,ref:d,style:{...c,...ZN({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:s,arrowY:l})}}):null});Av.displayName="@mantine/core/FloatingArrow";const[e4,ij]=Dn("Popover component was not found in the tree");function kf({children:e,active:t=!0,refProp:n="ref"}){const r=t_(t),o=Kt(r,e==null?void 0:e.ref);return Ao(e)?m.cloneElement(e,{[n]:o}):e}function sj(e){return C.createElement(xv,{tabIndex:-1,"data-autofocus":!0,...e})}kf.displayName="@mantine/core/FocusTrap";sj.displayName="@mantine/core/FocusTrapInitialFocus";kf.InitialFocus=sj;function t4(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 n4={},aj=m.forwardRef((e,t)=>{const{children:n,target:r,...o}=H("Portal",n4,e),[i,s]=m.useState(!1),l=m.useRef(null);return La(()=>(s(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:t4(o),lf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:Dc.createPortal(C.createElement(C.Fragment,null,n),l.current)});aj.displayName="@mantine/core/Portal";function xs({withinPortal:e=!0,children:t,...n}){return e?C.createElement(aj,{...n},t):C.createElement(C.Fragment,null,t)}xs.displayName="@mantine/core/OptionalPortal";const ml=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${V(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),$u={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${V(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${V(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${V(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${V(-30)}`},transitionProperty:"opacity, transform"},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(${V(-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(${V(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(${V(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${V(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:{...ml("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...ml("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...ml("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...ml("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...ml("top"),common:{transformOrigin:"top right"}}},O1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function r4({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in $u?{transitionProperty:$u[e].transitionProperty,...o,...$u[e].common,...$u[e][O1[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[O1[t]]}}function o4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:s,onExited:l}){const c=Nt(),u=Sg(),d=c.respectReducedMotion?u:!1,[f,h]=m.useState(d?0:e),[p,g]=m.useState(r?"entered":"exited"),v=m.useRef(-1),S=m.useRef(-1),y=x=>{const w=x?o:i,b=x?s:l;window.clearTimeout(v.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(()=>{oa.flushSync(()=>{g(x?"pre-entering":"pre-exiting")}),S.current=requestAnimationFrame(()=>{typeof w=="function"&&w(),g(x?"entering":"exiting"),v.current=window.setTimeout(()=>{typeof b=="function"&&b(),g(x?"entered":"exited")},j)})})};return Co(()=>{y(r)},[r]),m.useEffect(()=>()=>{window.clearTimeout(v.current),cancelAnimationFrame(S.current)},[]),{transitionDuration:f,transitionStatus:p,transitionTimingFunction:n||"ease"}}function $o({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:p}=o4({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(r4({transition:t,duration:f,state:h,timingFunction:p})))}$o.displayName="@mantine/core/Transition";var lj={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const i4={},Nv=K((e,t)=>{var S,y,x,w;const n=H("PopoverDropdown",i4,e),{className:r,style:o,vars:i,children:s,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=ij(),p=ab({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=Kt(t,h.floating);return h.disabled?null:C.createElement(xs,{...h.portalProps,withinPortal:h.withinPortal},C.createElement($o,{mounted:h.opened,...h.transitionProps,transition:((S=h.transitionProps)==null?void 0:S.transition)||"fade",duration:((y=h.transitionProps)==null?void 0:y.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(kf,{active:h.trapFocus},C.createElement(G,{...g,...f,variant:c,ref:v,onKeyDownCapture:B2(h.onClose,{active:h.closeOnEscape,onTrigger:p,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:V(h.width)},o]})},s,C.createElement(Av,{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})})))))});Nv.classes=lj;Nv.displayName="@mantine/core/PopoverDropdown";const s4={refProp:"ref",popupType:"dialog"},cj=K((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=H("PopoverTarget",s4,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=ij(),c=Kt(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return m.cloneElement(n,{...s,...u,...l.targetProps,className:it(l.targetProps.className,s.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});cj.displayName="@mantine/core/PopoverTarget";function uj({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=m.useState(0);m.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return _N(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 a4(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function l4(e,t){const n=a4(e.middlewares),r=[WE(e.offset)];return n.shift&&r.push(kv(typeof n.shift=="boolean"?{limiter:C1(),padding:5}:{limiter:C1(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Dp():Dp(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Ip():Ip(n.inline)),r.push(JE({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(DN({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:s}){var u;const c=((u=t().refs.floating.current)==null?void 0:u.style)??{};n.size&&Object.assign(c,{maxWidth:`${i}px`,maxHeight:`${s}px`}),e.width==="target"&&Object.assign(c,{width:`${o.reference.width}px`})}})),r}function c4(e){const[t,n]=fn({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=Iv({strategy:e.strategy,placement:e.position,middleware:l4(e,()=>i)});return uj({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 u4={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:Ur("popover"),__staticSelector:"Popover",width:"max-content"},d4=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ct(t),"--popover-shadow":yg(n)}});function Hr(e){var Ee,Qe,Ze,ee,q,ge;const t=H("Popover",u4,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:s,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:p,arrowRadius:g,arrowPosition:v,unstyled:S,classNames:y,styles:x,closeOnClickOutside:w,withinPortal:b,portalProps:j,closeOnEscape:E,clickOutsideEvents:T,trapFocus:P,onClose:_,onOpen:D,onChange:$,zIndex:I,radius:L,shadow:F,id:O,defaultOpened:A,__staticSelector:R,withRoles:k,disabled:M,returnFocus:B,variant:U,keepMounted:X,vars:re,floatingStrategy:fe,...Ce}=t,Te=de({name:R,props:t,classes:lj,classNames:y,styles:x,unstyled:S,rootSelector:"dropdown",vars:re,varsResolver:d4}),Ae=m.useRef(null),[pe,He]=m.useState(null),[ct,We]=m.useState(null),{dir:be}=Va(),ze=In(O),$e=c4({middlewares:d,width:u,position:oj(be,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:Ae,arrowOffset:p,onPositionChange:i,positionDependencies:s,opened:l,defaultOpened:A,onChange:$,onOpen:D,onClose:_,strategy:fe});W2(()=>w&&$e.onClose(),T,[pe,ct]);const Y=m.useCallback(Me=>{He(Me),$e.floating.refs.setReference(Me)},[$e.floating.refs.setReference]),oe=m.useCallback(Me=>{We(Me),$e.floating.refs.setFloating(Me)},[$e.floating.refs.setFloating]);return C.createElement(e4,{value:{returnFocus:B,disabled:M,controlled:$e.controlled,reference:Y,floating:oe,x:$e.floating.x,y:$e.floating.y,arrowX:(Ze=(Qe=(Ee=$e.floating)==null?void 0:Ee.middlewareData)==null?void 0:Qe.arrow)==null?void 0:Ze.x,arrowY:(ge=(q=(ee=$e.floating)==null?void 0:ee.middlewareData)==null?void 0:q.arrow)==null?void 0:ge.y,opened:$e.opened,arrowRef:Ae,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:p,arrowRadius:g,arrowPosition:v,placement:$e.floating.placement,trapFocus:P,withinPortal:b,portalProps:j,zIndex:I,radius:L,shadow:F,closeOnEscape:E,onClose:$e.onClose,onToggle:$e.onToggle,getTargetId:()=>`${ze}-target`,getDropdownId:()=>`${ze}-dropdown`,withRoles:k,targetProps:Ce,__staticSelector:R,classNames:y,styles:x,unstyled:S,variant:U,keepMounted:X,getStyles:Te}},n)}Hr.Target=cj;Hr.Dropdown=Nv;Hr.displayName="@mantine/core/Popover";Hr.extend=e=>e;var Nr={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 f4=m.forwardRef(({className:e,...t},n)=>C.createElement(G,{component:"span",className:it(Nr.barsLoader,e),...t,ref:n},C.createElement("span",{className:Nr.bar}),C.createElement("span",{className:Nr.bar}),C.createElement("span",{className:Nr.bar}))),h4=m.forwardRef(({className:e,...t},n)=>C.createElement(G,{component:"span",className:it(Nr.dotsLoader,e),...t,ref:n},C.createElement("span",{className:Nr.dot}),C.createElement("span",{className:Nr.dot}),C.createElement("span",{className:Nr.dot}))),m4=m.forwardRef(({className:e,...t},n)=>C.createElement(G,{component:"span",className:it(Nr.ovalLoader,e),...t,ref:n})),dj={bars:f4,oval:m4,dots:h4},p4={loaders:dj,type:"oval"},g4=(e,{size:t,color:n})=>({root:{"--loader-size":Ne(t,"loader-size"),"--loader-color":n?bt(n,e):void 0}}),qn=K((e,t)=>{const n=H("Loader",p4,e),{size:r,color:o,type:i,vars:s,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:p,children:g,...v}=n,S=de({name:"Loader",props:n,classes:Nr,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:s,varsResolver:g4});return g?C.createElement(G,{...S("root"),ref:t,...v},g):C.createElement(G,{...S("root"),ref:t,component:h[i],variant:p,size:r,...v})});qn.defaultLoaders=dj;qn.classes=Nr;qn.displayName="@mantine/core/Loader";var Rf={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const M1={orientation:"horizontal"},v4=(e,{borderWidth:t})=>({group:{"--ai-border-width":V(t)}}),Ov=K((e,t)=>{const n=H("ActionIconGroup",M1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...p}=H("ActionIconGroup",M1,e),g=de({name:"ActionIconGroup",props:n,classes:Rf,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:v4,rootSelector:"group"});return C.createElement(G,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...p})});Ov.classes=Rf;Ov.displayName="@mantine/core/ActionIconGroup";const y4={},x4=(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":Ne(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ct(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}}},Zt=Sn((e,t)=>{const n=H("ActionIcon",y4,e),{className:r,unstyled:o,variant:i,classNames:s,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:p,__staticSelector:g,gradient:v,vars:S,children:y,disabled:x,"data-disabled":w,autoContrast:b,mod:j,...E}=n,T=de({name:["ActionIcon",g],props:n,className:r,style:c,classes:Rf,classNames:s,styles:l,unstyled:o,vars:S,varsResolver:x4});return C.createElement(kn,{...T("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($o,{mounted:!!u,transition:"slide-down",duration:150},P=>C.createElement(G,{component:"span",...T("loader",{style:P}),"aria-hidden":!0},C.createElement(qn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d}))),C.createElement(G,{component:"span",mod:{loading:u},...T("icon")},y))});Zt.classes=Rf;Zt.displayName="@mantine/core/ActionIcon";Zt.Group=Ov;const fj=m.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"})));fj.displayName="@mantine/core/CloseIcon";var hj={root:"m_86a44da5","root--subtle":"m_220c80f2"};const w4={variant:"subtle"},S4=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Ne(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ct(n),"--cb-icon-size":V(r)}}),ws=Sn((e,t)=>{const n=H("CloseButton",w4,e),{iconSize:r,children:o,vars:i,radius:s,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:p,variant:g,icon:v,mod:S,...y}=n,x=de({name:"CloseButton",props:n,className:l,style:u,classes:hj,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:S4});return C.createElement(kn,{ref:t,...y,unstyled:f,variant:g,disabled:p,mod:[{disabled:p||h},S],...x("root",{variant:g,active:!p&&!h})},v||C.createElement(fj,null),o)});ws.classes=hj;ws.displayName="@mantine/core/CloseButton";function b4(e){return m.Children.toArray(e).filter(Boolean)}var mj={root:"m_4081bf90"};const C4={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},E4=(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":ln(r),"--group-align":o,"--group-justify":i,"--group-wrap":s}}),Z=K((e,t)=>{const n=H("Group",C4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:p,preventGrowOverflow:g,vars:v,variant:S,__size:y,mod:x,...w}=n,b=b4(c),j=b.length,E=ln(u??"md"),P={childWidth:`calc(${100/j}% - (${E} - ${E} / ${j}))`},_=de({name:"Group",props:n,stylesCtx:P,className:o,style:i,classes:mj,classNames:r,styles:s,unstyled:l,vars:v,varsResolver:E4});return C.createElement(G,{..._("root"),ref:t,variant:S,mod:[{grow:p},x],size:y,...w},b)});Z.classes=mj;Z.displayName="@mantine/core/Group";var pj={root:"m_9814e45f"};const j4={zIndex:Ur("modal")},P4=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:s})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&dr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${V(o)})`:void 0,"--overlay-radius":i===void 0?void 0:Ct(i),"--overlay-z-index":s==null?void 0:s.toString()}}),ac=Sn((e,t)=>{const n=H("Overlay",j4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:p,gradient:g,blur:v,color:S,backgroundOpacity:y,mod:x,...w}=n,b=de({name:"Overlay",props:n,classes:pj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:P4});return C.createElement(G,{ref:t,...b("root"),mod:[{center:d,fixed:u},x],...w},f)});ac.classes=pj;ac.displayName="@mantine/core/Overlay";const[T4,Lo]=Dn("ModalBase component was not found in tree");function k4({opened:e,transitionDuration:t}){const[n,r]=m.useState(e),o=m.useRef(),s=Sg()?0:t;return m.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 R4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:s}){const l=In(e),[c,u]=m.useState(!1),[d,f]=m.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,p=k4({opened:n,transitionDuration:h});return db("keydown",g=>{var v;g.key==="Escape"&&o&&((v=g.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),ab({opened:n,shouldReturnFocus:r&&s}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:p,setTitleMounted:u,setBodyMounted:f}}const _4=m.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:p,shadow:g,padding:v,__vars:S,unstyled:y,removeScrollProps:x,...w},b)=>{const{_id:j,titleMounted:E,bodyMounted:T,shouldLockScroll:P,setTitleMounted:_,setBodyMounted:D}=R4({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:s,onClose:n,returnFocus:l});return C.createElement(xs,{...d,withinPortal:u},C.createElement(T4,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${j}-title`,getBodyId:()=>`${j}-body`,titleMounted:E,bodyMounted:T,setTitleMounted:_,setBodyMounted:D,trapFocus:i,closeOnEscape:s,zIndex:p,unstyled:y}},C.createElement(sf,{enabled:P&&f,...x},C.createElement(G,{ref:b,...w,__vars:{...S,"--mb-z-index":(p||Ur("modal")).toString(),"--mb-shadow":yg(g),"--mb-padding":ln(v)}},h))))});function D4(){const e=Lo();return m.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Ra={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const gj=m.forwardRef(({className:e,...t},n)=>{const r=D4(),o=Lo();return C.createElement(G,{ref:n,...t,id:r,className:it({[Ra.body]:!o.unstyled},e)})});gj.displayName="@mantine/core/ModalBaseBody";const vj=m.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Lo();return C.createElement(ws,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:it({[Ra.close]:!o.unstyled},e),unstyled:o.unstyled})});vj.displayName="@mantine/core/ModalBaseCloseButton";const I4=m.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},s)=>{const l=Lo();return C.createElement($o,{mounted:l.opened,transition:"pop",...l.transitionProps,...e},c=>C.createElement("div",{...n,className:it({[Ra.inner]:!l.unstyled},n.className)},C.createElement(kf,{active:l.opened&&l.trapFocus},C.createElement(Un,{...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:it({[Ra.content]:!l.unstyled},t),unstyled:l.unstyled},i.children))))}),yj=m.forwardRef(({className:e,...t},n)=>{const r=Lo();return C.createElement(G,{component:"header",ref:n,className:it({[Ra.header]:!r.unstyled},e),...t})});yj.displayName="@mantine/core/ModalBaseHeader";const A4={duration:200,timingFunction:"ease",transition:"fade"};function N4(e){const t=Lo();return{...A4,...t.transitionProps,...e}}const xj=m.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Lo(),s=N4(t);return C.createElement($o,{mounted:i.opened,...s,transition:"fade"},l=>C.createElement(ac,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r}))});xj.displayName="@mantine/core/ModalBaseOverlay";function O4(){const e=Lo();return m.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const wj=m.forwardRef(({className:e,...t},n)=>{const r=O4(),o=Lo();return C.createElement(G,{component:"h2",ref:n,className:it({[Ra.title]:!o.unstyled},e),...t,id:r})});wj.displayName="@mantine/core/ModalBaseTitle";function M4({children:e}){return C.createElement(C.Fragment,null,e)}const[$4,Wa]=Cc({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Cr={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 $1={},L4=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`}}),_f=K((e,t)=>{const n=H("InputDescription",$1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...p}=H("InputDescription",$1,n),g=Wa(),v=de({name:["InputWrapper",d],props:n,classes:Cr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"description",vars:c,varsResolver:L4}),S=f&&(g==null?void 0:g.getStyles)||v;return C.createElement(G,{component:"p",ref:t,variant:h,size:u,...S("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...p})});_f.classes=Cr;_f.displayName="@mantine/core/InputDescription";const F4={},z4=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`}}),Df=K((e,t)=>{const n=H("InputError",F4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...p}=n,g=de({name:["InputWrapper",d],props:n,classes:Cr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"error",vars:c,varsResolver:z4}),v=Wa(),S=f&&(v==null?void 0:v.getStyles)||g;return C.createElement(G,{component:"p",ref:t,variant:h,size:u,...S("error",v!=null&&v.getStyles?{className:o,style:i}:void 0),...p})});Df.classes=Cr;Df.displayName="@mantine/core/InputError";const L1={labelElement:"label"},V4=(e,{size:t})=>({label:{"--input-label-size":nn(t),"--input-asterisk-color":void 0}}),If=K((e,t)=>{const n=H("InputLabel",L1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:p,children:g,__staticSelector:v,variant:S,mod:y,...x}=H("InputLabel",L1,n),w=de({name:["InputWrapper",v],props:n,classes:Cr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"label",vars:c,varsResolver:V4}),b=Wa(),j=(b==null?void 0:b.getStyles)||w;return C.createElement(G,{...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},y],onMouseDown:E=>{p==null||p(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...x},g,f&&C.createElement("span",{...j("required"),"aria-hidden":!0}," *"))});If.classes=Cr;If.displayName="@mantine/core/InputLabel";const F1={},Mv=K((e,t)=>{const n=H("InputPlaceholder",F1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...p}=H("InputPlaceholder",F1,n),g=de({name:["InputPlaceholder",u],props:n,classes:Cr,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"placeholder"});return C.createElement(G,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...p})});Mv.classes=Cr;Mv.displayName="@mantine/core/InputPlaceholder";function B4(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 U4={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},H4=(e,{size:t})=>({label:{"--input-label-size":nn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${nn(t)} - ${V(2)})`}}),$v=K((e,t)=>{const n=H("InputWrapper",U4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:p,label:g,error:v,description:S,labelProps:y,descriptionProps:x,errorProps:w,labelElement:b,children:j,withAsterisk:E,id:T,required:P,__stylesApiProps:_,mod:D,...$}=n,I=de({name:["InputWrapper",f],props:_||n,classes:Cr,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:H4}),L={size:u,variant:d,__staticSelector:f},F=In(T),O=typeof E=="boolean"?E:P,A=(w==null?void 0:w.id)||`${F}-error`,R=(x==null?void 0:x.id)||`${F}-description`,k=F,M=!!v&&typeof v!="boolean",B=!!S,U=`${M?A:""} ${B?R:""}`,X=U.trim().length>0?U.trim():void 0,re=(y==null?void 0:y.id)||`${F}-label`,fe=g&&C.createElement(If,{key:"label",labelElement:b,id:re,htmlFor:k,required:O,...L,...y},g),Ce=B&&C.createElement(_f,{key:"description",...x,...L,size:(x==null?void 0:x.size)||L.size,id:(x==null?void 0:x.id)||R},S),Te=C.createElement(C.Fragment,{key:"input"},h(j)),Ae=M&&C.createElement(Df,{...w,...L,size:(w==null?void 0:w.size)||L.size,key:"error",id:(w==null?void 0:w.id)||A},v),pe=p.map(He=>{switch(He){case"label":return fe;case"input":return Te;case"description":return Ce;case"error":return Ae;default:return null}});return C.createElement($4,{value:{getStyles:I,describedBy:X,inputId:k,labelId:re,...B4(p,{hasDescription:B,hasError:M})}},C.createElement(G,{ref:t,variant:d,size:u,mod:[{error:!!v},D],...I("root"),...$},pe))});$v.classes=Cr;$v.displayName="@mantine/core/InputWrapper";const W4={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},q4=(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":Ne(t.size,"input-height"),"--input-fz":nn(t.size),"--input-radius":t.radius===void 0?void 0:Ct(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?V(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?V(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Ne(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Rt=Sn((e,t)=>{const n=H("Input",W4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:p,disabled:g,leftSection:v,leftSectionProps:S,leftSectionWidth:y,rightSection:x,rightSectionProps:w,rightSectionWidth:b,rightSectionPointerEvents:j,leftSectionPointerEvents:E,variant:T,vars:P,pointer:_,multiline:D,radius:$,id:I,withAria:L,withErrorStyles:F,mod:O,...A}=n,{styleProps:R,rest:k}=No(A),M=Wa(),B={offsetBottom:M==null?void 0:M.offsetBottom,offsetTop:M==null?void 0:M.offsetTop},U=de({name:["Input",u],props:d||n,classes:Cr,className:o,style:i,classNames:r,styles:s,unstyled:l,stylesCtx:B,rootSelector:"wrapper",vars:P,varsResolver:q4}),X=L?{required:c,disabled:g,"aria-invalid":!!p,"aria-describedby":M==null?void 0:M.describedBy,id:(M==null?void 0:M.inputId)||I}:{};return C.createElement(G,{...U("wrapper"),...R,...h,mod:[{error:!!p&&F,pointer:_,disabled:g,multiline:D,"data-with-right-section":!!x,"data-with-left-section":!!v},O],variant:T,size:f},v&&C.createElement("div",{...S,"data-position":"left",...U("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style})},v),C.createElement(G,{component:"input",...k,...X,ref:t,required:c,mod:{disabled:g,error:!!p&&F},variant:T,...U("input")}),x&&C.createElement("div",{...w,"data-position":"right",...U("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style})},x))});Rt.classes=Cr;Rt.Wrapper=$v;Rt.Label=If;Rt.Error=Df;Rt.Description=_f;Rt.Placeholder=Mv;Rt.displayName="@mantine/core/Input";function G4(e,t,n){const r=H(e,t,n),{label:o,description:i,error:s,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:p,errorProps:g,labelProps:v,descriptionProps:S,wrapperProps:y,id:x,size:w,style:b,inputContainer:j,inputWrapperOrder:E,withAsterisk:T,variant:P,vars:_,mod:D,...$}=r,{styleProps:I,rest:L}=No($),F={label:o,description:i,error:s,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:p||r,errorProps:g,labelProps:v,descriptionProps:S,unstyled:f,styles:u,size:w,style:b,inputContainer:j,inputWrapperOrder:E,withAsterisk:T,variant:P,id:x,mod:D,...y};return{...L,classNames:c,styles:u,unstyled:f,wrapperProps:{...F,...I},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:w,__staticSelector:h,__stylesApiProps:p||r,error:s,variant:P,id:x}}}const Q4={__staticSelector:"InputBase",withAria:!0},Qn=Sn((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=G4("InputBase",Q4,e);return C.createElement(Rt.Wrapper,{...r},C.createElement(Rt,{...n,...o,ref:t}))});Qn.classes={...Rt.classes,...Rt.Wrapper.classes};Qn.displayName="@mantine/core/InputBase";const K4={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 Sj={root:"m_8bffd616"};const Y4={},ss=Sn((e,t)=>{const n=H("Flex",Y4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:p,wrap:g,direction:v,...S}=n,y=de({name:"Flex",classes:Sj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),x=Nt(),w=Pc(),b=xb({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:p,wrap:g,direction:v},theme:x,data:K4});return C.createElement(C.Fragment,null,b.hasResponsiveStyles&&C.createElement(za,{selector:`.${w}`,styles:b.styles,media:b.media}),C.createElement(G,{ref:t,...y("root",{className:w,style:ms(b.inlineStyles)}),...S}))});ss.classes=Sj;ss.displayName="@mantine/core/Flex";function X4(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function J4({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=m.useRef(),[i,s]=m.useState(!1),[l,c]=m.useState(typeof r=="boolean"?r:!1),u=()=>{if(!e||!t)return;const p=e.getBoundingClientRect(),g=t.getBoundingClientRect(),v={top:p.top-g.top,left:p.left-g.left,width:p.width,height:p.height};n.current&&(n.current.style.transform=`translateY(${v.top}px) translateX(${v.left}px)`,n.current.style.width=`${v.width}px`,n.current.style.height=`${v.height}px`)},d=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),u(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},f=m.useRef(),h=m.useRef();return m.useEffect(()=>{if(u(),e)return f.current=new ResizeObserver(d),f.current.observe(e),h.current=new ResizeObserver(d),h.current.observe(t),()=>{var p,g;(p=f.current)==null||p.disconnect(),(g=h.current)==null||g.disconnect()}},[t,e]),m.useEffect(()=>{if(t){const p=g=>{X4(g.target,t)&&(d(),c(!1))};return document.addEventListener("transitionend",p),()=>{document.removeEventListener("transitionend",p)}}},[t]),c_(()=>{fb()!=="test"&&s(!0)},20,{autoInvoke:!0}),u_(p=>{p.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var bj={root:"m_96b553a6"};const Z4={},e3=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Lv=K((e,t)=>{const n=H("FloatingIndicator",Z4,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,target:u,parent:d,transitionDuration:f,mod:h,displayAfterTransitionEnd:p,...g}=n,v=de({name:"FloatingIndicator",classes:bj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:e3}),S=m.useRef(null),{initialized:y,hidden:x}=J4({target:u,parent:d,ref:S,displayAfterTransitionEnd:p}),w=Kt(t,S);return!u||!d?null:C.createElement(G,{ref:w,mod:[{initialized:y,hidden:x},h],...v("root"),...g})});Lv.displayName="@mantine/core/FloatingIndicator";Lv.classes=bj;var Cj={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 t3={},n3=(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:Ct(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Ss=K((e,t)=>{const n=H("Alert",t3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:p,icon:g,withCloseButton:v,onClose:S,closeButtonLabel:y,variant:x,autoContrast:w,...b}=n,j=de({name:"Alert",classes:Cj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:n3}),E=In(p),T=f&&`${E}-title`||void 0,P=`${E}-body`;return C.createElement(G,{id:E,...j("root",{variant:x}),variant:x,ref:t,...b,role:"alert","aria-describedby":P,"aria-labelledby":T},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":v||void 0},C.createElement("span",{id:T,...j("label")},f)),h&&C.createElement("div",{id:P,...j("message"),"data-variant":x},h)),v&&C.createElement(ws,{...j("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":y,unstyled:l})))});Ss.classes=Cj;Ss.displayName="@mantine/core/Alert";var Ej={root:"m_b6d8b162"};function r3(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const o3={inherit:!1},i3=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":nn(o),"--text-lh":ob(o),"--text-gradient":t==="gradient"?Im(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?bt(i,e):void 0}}),ce=Sn((e,t)=>{const n=H("Text",o3,e),{lineClamp:r,truncate:o,inline:i,inherit:s,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:p,styles:g,unstyled:v,variant:S,mod:y,size:x,...w}=n,b=de({name:["Text",u],props:n,classes:Ej,className:f,style:h,classNames:p,styles:g,unstyled:v,vars:d,varsResolver:i3});return C.createElement(G,{...b("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":r3(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":s},y],size:x,...w})});ce.classes=Ej;ce.displayName="@mantine/core/Text";var jj={root:"m_849cf0da"};const s3={underline:"hover"},Je=Sn((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...s}=H("Anchor",s3,e);return C.createElement(ce,{component:"a",ref:t,className:it({[jj.root]:!o},r),...s,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Je.classes=jj;Je.displayName="@mantine/core/Anchor";const[a3,qa]=Dn("AppShell was not found in tree");var Ti={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const l3={},Fv=K((e,t)=>{const n=H("AppShellAside",l3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=qa();return p.disabled?null:C.createElement(G,{component:"aside",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("aside",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??p.zIndex} + 1)`}})});Fv.classes=Ti;Fv.displayName="@mantine/core/AppShellAside";const c3={},zv=K((e,t)=>{var g;const n=H("AppShellFooter",c3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=qa();return p.disabled?null:C.createElement(G,{component:"footer",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("footer",{className:it({[sf.classNames.zeroRight]:p.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??p.zIndex)==null?void 0:g.toString()}})});zv.classes=Ti;zv.displayName="@mantine/core/AppShellFooter";const u3={},Vv=K((e,t)=>{var g;const n=H("AppShellHeader",u3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=qa();return p.disabled?null:C.createElement(G,{component:"header",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("header",{className:it({[sf.classNames.zeroRight]:p.offsetScrollbars},o),classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??p.zIndex)==null?void 0:g.toString()}})});Vv.classes=Ti;Vv.displayName="@mantine/core/AppShellHeader";const d3={},Bv=K((e,t)=>{const n=H("AppShellMain",d3,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=qa();return C.createElement(G,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:s}),...c})});Bv.classes=Ti;Bv.displayName="@mantine/core/AppShellMain";function Ac(e){return typeof e=="object"?e.base:e}function Nc(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 Oc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function f3({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"),Nc(i)){const f=V(Ac(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Oc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=V(i.base),e["--app-shell-aside-offset"]=V(i.base)),St(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=V(i[f]),t[f]["--app-shell-aside-offset"]=V(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=xg(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 h3({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(Nc(r)){const s=V(Ac(r));e["--app-shell-footer-height"]=s,i&&(e["--app-shell-footer-offset"]=s)}Oc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=V(r.base),i&&(e["--app-shell-footer-offset"]=V(r.base))),St(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-footer-height"]=V(r[s]),i&&(t[s]["--app-shell-footer-offset"]=V(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function m3({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(Nc(r)){const s=V(Ac(r));e["--app-shell-header-height"]=s,i&&(e["--app-shell-header-offset"]=s)}Oc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=V(r.base),i&&(e["--app-shell-header-offset"]=V(r.base))),St(r).forEach(s=>{s!=="base"&&(t[s]=t[s]||{},t[s]["--app-shell-header-height"]=V(r[s]),i&&(t[s]["--app-shell-header-offset"]=V(r[s])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function p3({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"),Nc(i)){const f=V(Ac(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Oc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=V(i.base),e["--app-shell-navbar-offset"]=V(i.base)),St(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=V(i[f]),t[f]["--app-shell-navbar-offset"]=V(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=xg(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 fm(e){return Number(e)===0?"0px":ln(e)}function g3({padding:e,baseStyles:t,minMediaStyles:n}){Nc(e)&&(t["--app-shell-padding"]=fm(Ac(e))),Oc(e)&&(e.base&&(t["--app-shell-padding"]=fm(e.base)),St(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=fm(e[r]))}))}function v3({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const s={},l={},c={};p3({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,navbar:e,theme:i}),f3({baseStyles:c,minMediaStyles:s,maxMediaStyles:l,aside:r,theme:i}),m3({baseStyles:c,minMediaStyles:s,header:t}),h3({baseStyles:c,minMediaStyles:s,footer:n}),g3({baseStyles:c,minMediaStyles:s,padding:o});const u=Vl(St(s),i).map(h=>({query:`(min-width: ${cd(h.px)})`,styles:s[h.value]})),d=Vl(St(l),i).map(h=>({query:`(max-width: ${cd(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function y3({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=Nt(),s=Fa(),{media:l,baseStyles:c}=v3({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return C.createElement(za,{media:l,styles:c,selector:s.cssVariablesSelector})}const x3={},Uv=K((e,t)=>{const n=H("AppShellNavbar",x3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,p=qa();return p.disabled?null:C.createElement(G,{component:"nav",ref:t,mod:[{"with-border":u??p.withBorder},f],...p.getStyles("navbar",{className:o,classNames:r,styles:s,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??p.zIndex} + 1)`}})});Uv.classes=Ti;Uv.displayName="@mantine/core/AppShellNavbar";const w3={},Hv=Sn((e,t)=>{const n=H("AppShellSection",w3,e),{classNames:r,className:o,style:i,styles:s,vars:l,grow:c,mod:u,...d}=n,f=qa();return C.createElement(G,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:s}),...d})});Hv.classes=Ti;Hv.displayName="@mantine/core/AppShellSection";function S3({transitionDuration:e,disabled:t}){const[n,r]=m.useState(!0),o=m.useRef(),i=m.useRef();return db("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),La(()=>{m.startTransition(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)})},[t,e]),n}const b3={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Ur("app")},C3=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Wn=K((e,t)=>{const n=H("AppShell",b3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:p,header:g,zIndex:v,layout:S,disabled:y,aside:x,footer:w,offsetScrollbars:b,mod:j,...E}=n,T=de({name:"AppShell",classes:Ti,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:C3}),P=S3({disabled:y,transitionDuration:h});return C.createElement(a3,{value:{getStyles:T,withBorder:d,zIndex:v,disabled:y,offsetScrollbars:b}},C.createElement(y3,{navbar:u,header:g,aside:x,footer:w,padding:f}),C.createElement(G,{ref:t,...T("root"),mod:[{resizing:P,layout:S,disabled:y},j],...E}))});Wn.classes=Ti;Wn.displayName="@mantine/core/AppShell";Wn.Navbar=Uv;Wn.Header=Vv;Wn.Main=Bv;Wn.Aside=Fv;Wn.Footer=zv;Wn.Section=Hv;function Pj(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=>Pj(t))}:e}function Tj(e){return e?e.map(t=>Pj(t)):[]}function kj(e){return e.reduce((t,n)=>"group"in n?{...t,...kj(n.items)}:(t[n.value]=n,t),{})}var Gn={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 E3={error:null},j3=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Ne(t,"combobox-chevron-size")}}),Af=K((e,t)=>{const n=H("ComboboxChevron",E3,e),{size:r,error:o,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,p=de({name:"ComboboxChevron",classes:Gn,props:n,style:i,className:s,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:j3,rootSelector:"chevron"});return C.createElement(G,{component:"svg",...h,...p("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"}))});Af.classes=Gn;Af.displayName="@mantine/core/ComboboxChevron";const[P3,Er]=Dn("Combobox component was not found in tree"),Rj=m.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>C.createElement(ws,{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)}}));Rj.displayName="@mantine/core/ComboboxClearButton";const T3={},Wv=K((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:s,...l}=H("ComboboxDropdown",T3,e),c=Er();return C.createElement(Hr.Dropdown,{...l,ref:t,role:"presentation","data-hidden":s||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});Wv.classes=Gn;Wv.displayName="@mantine/core/ComboboxDropdown";const k3={refProp:"ref"},_j=K((e,t)=>{const{children:n,refProp:r}=H("ComboboxDropdownTarget",k3,e);if(Er(),!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(Hr.Target,{ref:t,refProp:r},n)});_j.displayName="@mantine/core/ComboboxDropdownTarget";const R3={},qv=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=H("ComboboxEmpty",R3,e),c=Er();return C.createElement(G,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});qv.classes=Gn;qv.displayName="@mantine/core/ComboboxEmpty";function Gv({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const s=Er(),[l,c]=m.useState(null),u=f=>{if(e==null||e(f),!s.readOnly&&t){if(f.nativeEvent.isComposing)return;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"){if(f.nativeEvent.keyCode===229)return;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 _3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Dj=K((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,autoComplete:c,...u}=H("ComboboxEventsTarget",_3,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=Er(),f=Gv({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:c});return m.cloneElement(n,{...f,...u,[r]:Kt(t,d.store.targetRef,n==null?void 0:n.ref)})});Dj.displayName="@mantine/core/ComboboxEventsTarget";const D3={},Qv=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=H("ComboboxFooter",D3,e),c=Er();return C.createElement(G,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l})});Qv.classes=Gn;Qv.displayName="@mantine/core/ComboboxFooter";const I3={},Kv=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,children:l,label:c,...u}=H("ComboboxGroup",I3,e),d=Er();return C.createElement(G,{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)});Kv.classes=Gn;Kv.displayName="@mantine/core/ComboboxGroup";const A3={},Yv=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=H("ComboboxHeader",A3,e),c=Er();return C.createElement(G,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l})});Yv.classes=Gn;Yv.displayName="@mantine/core/ComboboxHeader";function Ij({value:e,valuesDivider:t=",",...n}){return C.createElement("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}Ij.displayName="@mantine/core/ComboboxHiddenInput";const N3={},Xv=K((e,t)=>{const n=H("ComboboxOption",N3,e),{classNames:r,className:o,style:i,styles:s,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:p,selected:g,mod:v,...S}=n,y=Er(),x=m.useId(),w=u||x;return C.createElement(G,{...y.getStyles("option",{className:o,classNames:r,styles:s,style:i}),...S,ref:t,id:w,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":p,"combobox-selected":g},v],role:"option",onClick:b=>{var j;p?b.preventDefault():((j=y.onOptionSubmit)==null||j.call(y,n.value,n),c==null||c(b))},onMouseDown:b=>{b.preventDefault(),f==null||f(b)},onMouseOver:b=>{y.resetSelectionOnOptionHover&&y.store.resetSelectedOption(),h==null||h(b)}})});Xv.classes=Gn;Xv.displayName="@mantine/core/ComboboxOption";const O3={},Jv=K((e,t)=>{const n=H("ComboboxOptions",O3,e),{classNames:r,className:o,style:i,styles:s,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Er(),h=In(l);return m.useEffect(()=>{f.store.setListId(h)},[h]),C.createElement(G,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:s}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:p=>{p.preventDefault(),c==null||c(p)}})});Jv.classes=Gn;Jv.displayName="@mantine/core/ComboboxOptions";const M3={withAriaAttributes:!0,withKeyboardNavigation:!0},Zv=K((e,t)=>{const n=H("ComboboxSearch",M3,e),{classNames:r,styles:o,unstyled:i,vars:s,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Er(),p=h.getStyles("search"),g=Gv({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return C.createElement(Rt,{ref:Kt(t,h.store.searchRef),classNames:[{input:p.className},r],styles:[{input:p.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});Zv.classes=Gn;Zv.displayName="@mantine/core/ComboboxSearch";const $3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Aj=K((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:s,targetType:l,autoComplete:c,...u}=H("ComboboxTarget",$3,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=Er(),f=Gv({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:s,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=m.cloneElement(n,{...f,...u});return C.createElement(Hr.Target,{ref:Kt(t,d.store.targetRef)},h)});Aj.displayName="@mantine/core/ComboboxTarget";function L3(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 F3(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 z3(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Mc({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:s="instant"}={}){const[l,c]=fn({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=m.useRef(null),d=m.useRef(-1),f=m.useRef(null),h=m.useRef(null),p=m.useRef(-1),g=m.useRef(-1),v=m.useRef(-1),S=m.useCallback((A="unknown")=>{l||(c(!0),o==null||o(A))},[c,o,l]),y=m.useCallback((A="unknown")=>{l&&(c(!1),r==null||r(A))},[c,r,l]),x=m.useCallback((A="unknown")=>{l?y(A):S(A)},[y,S,l]),w=m.useCallback(()=>{const A=document.querySelector(`#${u.current} [data-combobox-selected]`);A==null||A.removeAttribute("data-combobox-selected"),A==null||A.removeAttribute("aria-selected")},[]),b=m.useCallback(A=>{const R=document.getElementById(u.current),k=R==null?void 0:R.querySelectorAll("[data-combobox-option]");if(!k)return null;const M=A>=k.length?0:A<0?k.length-1:A;return d.current=M,k!=null&&k[M]&&!k[M].hasAttribute("data-combobox-disabled")?(w(),k[M].setAttribute("data-combobox-selected","true"),k[M].setAttribute("aria-selected","true"),k[M].scrollIntoView({block:"nearest",behavior:s}),k[M].id):null},[s,w]),j=m.useCallback(()=>{const A=document.querySelector(`#${u.current} [data-combobox-active]`);if(A){const R=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=Array.from(R).findIndex(M=>M===A);return b(k)}return b(0)},[b]),E=m.useCallback(()=>b(F3(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),T=m.useCallback(()=>b(L3(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),P=m.useCallback(()=>b(z3(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[b]),_=m.useCallback((A="selected",R)=>{v.current=window.setTimeout(()=>{var B;const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),M=Array.from(k).findIndex(U=>U.hasAttribute(`data-combobox-${A}`));d.current=M,R!=null&&R.scrollIntoView&&((B=k[M])==null||B.scrollIntoView({block:"nearest",behavior:s}))},0)},[]),D=m.useCallback(()=>{d.current=-1,w()},[w]),$=m.useCallback(()=>{const A=document.querySelectorAll(`#${u.current} [data-combobox-option]`),R=A==null?void 0:A[d.current];R==null||R.click()},[]),I=m.useCallback(A=>{u.current=A},[]),L=m.useCallback(()=>{p.current=window.setTimeout(()=>f.current.focus(),0)},[]),F=m.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),O=m.useCallback(()=>d.current,[]);return m.useEffect(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:y,toggleDropdown:x,selectedOptionIndex:d.current,getSelectedOptionIndex:O,selectOption:b,selectFirstOption:P,selectActiveOption:j,selectNextOption:E,selectPreviousOption:T,resetSelectedOption:D,updateSelectedOptionIndex:_,listId:u.current,setListId:I,clickSelectedOption:$,searchRef:f,focusSearchInput:L,targetRef:h,focusTarget:F}}const V3={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},B3=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":nn(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:V(n),"--combobox-option-fz":nn(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")}});function De(e){const t=H("Combobox",V3,e),{classNames:n,styles:r,unstyled:o,children:i,store:s,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:p,readOnly:g,...v}=t,S=Mc(),y=s||S,x=de({name:p||"Combobox",classes:Gn,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:B3}),w=()=>{u==null||u(),y.closeDropdown()};return C.createElement(P3,{value:{getStyles:x,store:y,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g}},C.createElement(Hr,{opened:y.dropdownOpened,...v,onClose:w,withRoles:!1,unstyled:o},i))}const U3=e=>e;De.extend=U3;De.classes=Gn;De.displayName="@mantine/core/Combobox";De.Target=Aj;De.Dropdown=Wv;De.Options=Jv;De.Option=Xv;De.Search=Zv;De.Empty=qv;De.Chevron=Af;De.Footer=Qv;De.Header=Yv;De.EventsTarget=Dj;De.DropdownTarget=_j;De.Group=Kv;De.ClearButton=Rj;De.HiddenInput=Ij;var Nj={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const Oj=Nj,Nf=m.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:p="left",bodyElement:g="div",labelElement:v="label",variant:S,style:y,vars:x,mod:w,...b},j)=>{const E=de({name:e,props:t,className:n,style:y,classes:Nj,classNames:r,styles:o,unstyled:i});return C.createElement(G,{...E("root"),ref:j,__vars:{"--label-fz":nn(h),"--label-lh":Ne(h,"label-lh")},mod:[{"label-position":p},w],variant:S,size:h,...b},C.createElement(G,{component:g,htmlFor:g==="label"?u:void 0,...E("body")},s,C.createElement("div",{...E("labelWrapper"),"data-disabled":d||void 0},l&&C.createElement(G,{component:v,htmlFor:v==="label"?u:void 0,...E("label"),"data-disabled":d||void 0},l),c&&C.createElement(Rt.Description,{size:h,__inheritStyles:!1,...E("description")},c),f&&f!=="boolean"&&C.createElement(Rt.Error,{size:h,__inheritStyles:!1,...E("error")},f))))});Nf.displayName="@mantine/core/InlineInput";const Mj=m.createContext(null),H3=Mj.Provider,W3=()=>m.useContext(Mj);function ey({children:e,role:t}){const n=Wa();return n?C.createElement("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy},e):C.createElement(C.Fragment,null,e)}const q3={},ty=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=H("CheckboxGroup",q3,e),[d,f]=fn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=p=>{const g=p.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return C.createElement(H3,{value:{value:d,onChange:h,size:i}},C.createElement(Rt.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"CheckboxGroup"},C.createElement(ey,{role:"group"},l)))});ty.classes=Rt.Wrapper.classes;ty.displayName="@mantine/core/CheckboxGroup";function Of({size:e,style:t,...n}){const r=e!==void 0?{width:V(e),height:V(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 G3({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(Of,{...t})}var $j={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const Q3={labelPosition:"right",icon:G3},K3=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:s})=>{const l=lo({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":Ne(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ct(t),"--checkbox-color":i==="outline"?c:bt(n,e),"--checkbox-icon-color":o?bt(o,e):jc(s,e)?ps({color:n,theme:e}):void 0}}},wr=K((e,t)=>{const n=H("Checkbox",Q3,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:p,wrapperProps:g,children:v,checked:S,labelPosition:y,description:x,error:w,disabled:b,variant:j,indeterminate:E,icon:T,rootRef:P,iconColor:_,onChange:D,autoContrast:$,mod:I,...L}=n,F=W3(),O=h||(F==null?void 0:F.size),A=T,R=de({name:"Checkbox",props:n,classes:$j,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:K3}),{styleProps:k,rest:M}=No(L),B=In(f),U=F?{checked:F.value.includes(M.value),onChange:X=>{F.onChange(X),D==null||D(X)}}:{};return C.createElement(Nf,{...R("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:B,size:O,labelPosition:y,label:d,description:x,error:w,disabled:b,classNames:r,styles:s,unstyled:l,"data-checked":U.checked||S||void 0,variant:j,ref:P,mod:I,...k,...g},C.createElement(G,{...R("inner"),mod:{"data-label-position":y}},C.createElement(G,{component:"input",id:B,ref:t,checked:S,disabled:b,mod:{error:!!w,indeterminate:E},...R("input",{focusable:!0,variant:j}),onChange:D,...M,...U,type:"checkbox"}),C.createElement(A,{indeterminate:E,...R("icon")})))});wr.classes={...$j,...Oj};wr.displayName="@mantine/core/Checkbox";wr.Group=ty;function _a(e){return"group"in e}function Lj({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;_a(s)&&o.push({group:s.group,items:Lj({options:s.items,search:t,limit:n-o.length})}),_a(s)||s.label.toLowerCase().includes(r)&&o.push(s)}return o}function Y3(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 Fj(e,t=new Set){if(Array.isArray(e))for(const n of e)if(_a(n))Fj(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 X3(e,t){return Array.isArray(e)?e.includes(t):e===t}function zj({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!_a(e)){const l=X3(n,e.value),c=t&&l&&C.createElement(Of,{className:Gn.optionsDropdownCheckIcon}),u=C.createElement(C.Fragment,null,r==="left"&&c,C.createElement("span",null,e.label),r==="right"&&c);return C.createElement(De.Option,{value:e.value,disabled:e.disabled,className:it({[Gn.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(zj,{data:l,value:n,key:l.value,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i}));return C.createElement(De.Group,{label:e.group},s)}function J3({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:p,labelId:g,renderOption:v,scrollAreaProps:S}){Fj(e);const x=typeof o=="string"?(r||Lj)({options:e,search:c?o:"",limit:i??1/0}):e,w=Y3(x),b=x.map(j=>C.createElement(zj,{data:j,key:_a(j)?j.group:j.value,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:p,renderOption:v}));return C.createElement(De.Dropdown,{hidden:t||n&&w},C.createElement(De.Options,{labelledBy:g},l?C.createElement(br.Autosize,{mah:s??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S},b):b,w&&h&&C.createElement(De.Empty,null,h)))}const Vj=m.createContext(null),Z3=Vj.Provider;function e5(){return{withinGroup:!!m.useContext(Vj)}}var Mf={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const t5={},n5=(e,{spacing:t})=>({group:{"--ag-spacing":ln(t)}}),ny=K((e,t)=>{const n=H("AvatarGroup",t5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,spacing:u,...d}=n,f=de({name:"AvatarGroup",classes:Mf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:n5,rootSelector:"group"});return C.createElement(Z3,{value:!0},C.createElement(G,{ref:t,...f("group"),...d}))});ny.classes=Mf;ny.displayName="@mantine/core/AvatarGroup";function r5(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 o5={},i5=(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":Ne(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ct(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}}},as=Sn((e,t)=>{const n=H("Avatar",o5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:p,imageProps:g,children:v,autoContrast:S,mod:y,...x}=n,w=e5(),[b,j]=m.useState(!u),E=de({name:"Avatar",props:n,classes:Mf,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:i5});return m.useEffect(()=>j(!u),[u]),C.createElement(G,{...E("root"),mod:[{"within-group":w.withinGroup},y],ref:t,...x},b?C.createElement("span",{...E("placeholder"),title:d},v||C.createElement(r5,null)):C.createElement("img",{...g,...E("image"),src:u,alt:d,onError:T=>{var P;j(!0),(P=g==null?void 0:g.onError)==null||P.call(g,T)}}))});as.classes=Mf;as.displayName="@mantine/core/Avatar";as.Group=ny;var Bj={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const s5={},a5=(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":Ne(i,"badge-height"),"--badge-padding-x":Ne(i,"badge-padding-x"),"--badge-fz":Ne(i,"badge-fz"),"--badge-radius":t===void 0?void 0:Ct(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"?bt(n,e):void 0}}},$c=Sn((e,t)=>{const n=H("Badge",s5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:p,children:g,variant:v,fullWidth:S,autoContrast:y,circle:x,mod:w,...b}=n,j=de({name:"Badge",props:n,classes:Bj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:a5});return C.createElement(G,{variant:v,mod:[{block:S,circle:x},w],...j("root",{variant:v}),ref:t,...b},h&&C.createElement("span",{...j("section"),"data-position":"left"},h),C.createElement("span",{...j("label")},g),p&&C.createElement("span",{...j("section"),"data-position":"right"},p))});$c.classes=Bj;$c.displayName="@mantine/core/Badge";var Uj={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const l5={iconSize:48},c5=(e,{color:t,iconSize:n,radius:r})=>{const o=lo({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=lo({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":dr(i.value,.07),"--bq-bg-dark":dr(o.value,.06),"--bq-bd":bt(t,e),"--bq-icon-size":V(n),"--bq-radius":Ct(r)}}},ry=K((e,t)=>{const n=H("Blockquote",l5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...p}=n,g=de({name:"Blockquote",classes:Uj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:c5});return C.createElement(G,{component:"blockquote",ref:t,...g("root"),...p},d&&C.createElement("span",{...g("icon")},d),u,h&&C.createElement("cite",{...g("cite")},h))});ry.classes=Uj;ry.displayName="@mantine/core/Blockquote";var $f={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const z1={orientation:"horizontal"},u5=(e,{borderWidth:t})=>({group:{"--button-border-width":V(t)}}),oy=K((e,t)=>{const n=H("ButtonGroup",z1,e),{className:r,style:o,classNames:i,styles:s,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...p}=H("ButtonGroup",z1,e),g=de({name:"ButtonGroup",props:n,classes:$f,className:r,style:o,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:u5,rootSelector:"group"});return C.createElement(G,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...p})});oy.classes=$f;oy.displayName="@mantine/core/ButtonGroup";const d5={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${V(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},f5={},h5=(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":Ne(i,"button-height"),"--button-padding-x":Ne(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?nn(i.replace("compact-","")):nn(i),"--button-radius":t===void 0?void 0:Ct(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}}},ie=Sn((e,t)=>{const n=H("Button",f5,e),{style:r,vars:o,className:i,color:s,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:p,loading:g,loaderProps:v,gradient:S,classNames:y,styles:x,unstyled:w,"data-disabled":b,autoContrast:j,mod:E,...T}=n,P=de({name:"Button",props:n,classes:$f,className:i,style:r,classNames:y,styles:x,unstyled:w,vars:o,varsResolver:h5}),_=!!u,D=!!d;return C.createElement(kn,{ref:t,...P("root",{active:!l&&!g&&!b}),unstyled:w,variant:h,disabled:l||g,mod:[{disabled:l||b,loading:g,block:f,"with-left-section":_,"with-right-section":D},E],...T},C.createElement($o,{mounted:!!g,transition:d5,duration:150},$=>C.createElement(G,{component:"span",...P("loader",{style:$}),"aria-hidden":!0},C.createElement(qn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v}))),C.createElement("span",{...P("inner")},u&&C.createElement(G,{component:"span",...P("section"),mod:{position:"left"}},u),C.createElement(G,{component:"span",mod:{loading:g},...P("label")},c),d&&C.createElement(G,{component:"span",...P("section"),mod:{position:"right"}},d)))});ie.classes=$f;ie.displayName="@mantine/core/Button";ie.Group=oy;var Hj={root:"m_4451eb3a"};const m5={},cn=Sn((e,t)=>{const n=H("Center",m5,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:Hj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c});return C.createElement(G,{ref:t,mod:[{inline:u},d],...h("root"),...f})});cn.classes=Hj;cn.displayName="@mantine/core/Center";const[p5,g5]=Cc(),v5={};function Wj(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=H("ChipGroup",v5,e),[s,l]=fn({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(p5,{value:{isChipSelected:c,onChange:u,multiple:o}},i)}Wj.displayName="@mantine/core/ChipGroup";var qj={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 y5={type:"checkbox"},x5=(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":nn(t),"--chip-size":Ne(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ct(n),"--chip-checked-padding":Ne(t,"chip-checked-padding"),"--chip-padding":Ne(t,"chip-padding"),"--chip-icon-size":Ne(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":Ne(t,"chip-spacing")}}},lc=K((e,t)=>{const n=H("Chip",y5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:p,wrapperProps:g,type:v,disabled:S,children:y,size:x,variant:w,icon:b,rootRef:j,autoContrast:E,mod:T,...P}=n,_=de({name:"Chip",classes:qj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:x5}),D=g5(),$=In(u),{styleProps:I,rest:L}=No(P),[F,O]=fn({value:d,defaultValue:f,finalValue:!1,onChange:h}),A=D?{checked:D.isChipSelected(p),onChange:k=>{D.onChange(k),h==null||h(k.currentTarget.checked)},type:D.multiple?"checkbox":"radio"}:{},R=A.checked||F;return C.createElement(G,{size:x,variant:w,ref:j,mod:T,..._("root"),...I,...g},C.createElement("input",{type:v,..._("input"),checked:R,onChange:k=>O(k.currentTarget.checked),id:$,disabled:S,ref:t,value:p,...A,...L}),C.createElement("label",{htmlFor:$,"data-checked":R||void 0,"data-disabled":S||void 0,..._("label",{variant:w||"filled"})},R&&C.createElement("span",{..._("iconWrapper")},b||C.createElement(Of,{..._("checkIcon")})),C.createElement("span",null,y)))});lc.classes=qj;lc.displayName="@mantine/core/Chip";lc.Group=Wj;var Gj={root:"m_b183c0a2"};const w5={},S5=(e,{color:t})=>({root:{"--code-bg":t?bt(t,e):void 0}}),iy=K((e,t)=>{const n=H("Code",w5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...p}=n,g=de({name:"Code",props:n,classes:Gj,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:S5});return C.createElement(G,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...p,dir:"ltr"})});iy.classes=Gj;iy.displayName="@mantine/core/Code";var Qj={root:"m_7485cace"};const b5={},C5=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Ne(t,"container-size")}}),sy=K((e,t)=>{const n=H("Container",b5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=de({name:"Container",classes:Qj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:C5});return C.createElement(G,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});sy.classes=Qj;sy.displayName="@mantine/core/Container";const E5={timeout:1e3};function Kj(e){const{children:t,timeout:n,value:r,...o}=H("CopyButton",E5,e),i=ib({timeout:n}),s=()=>i.copy(r);return C.createElement(C.Fragment,null,t({copy:s,copied:i.copied,...o}))}Kj.displayName="@mantine/core/CopyButton";var Yj={root:"m_3eebeb36",label:"m_9e365f20"};const j5={orientation:"horizontal"},P5=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?bt(t,e):void 0,"--divider-border-style":n,"--divider-size":Ne(r,"divider-size")}}),gn=K((e,t)=>{const n=H("Divider",j5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:p,...g}=n,v=de({name:"Divider",classes:Yj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:P5});return C.createElement(G,{ref:t,mod:[{orientation:d,"with-label":!!f},p],...v("root"),...g,role:"separator"},f&&C.createElement(G,{component:"span",mod:{position:h},...v("label")},f))});gn.classes=Yj;gn.displayName="@mantine/core/Divider";function T5({open:e,close:t,openDelay:n,closeDelay:r}){const o=m.useRef(-1),i=m.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 m.useEffect(()=>s,[]),{openDropdown:l,closeDropdown:c}}const[k5,Xj]=Dn("Grid component was not found in tree"),Np=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,V1=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Np(e,t),B1=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},U1=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function R5({span:e,order:t,offset:n,selector:r}){var h;const o=Nt(),i=Xj(),l=oi(e)===void 0?12:oi(e),c=ms({"--col-order":(h=oi(t))==null?void 0:h.toString(),"--col-flex-grow":B1(l,i.grow),"--col-flex-basis":Np(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":V1(l,i.columns,i.grow),"--col-offset":U1(oi(n),i.columns)}),u=St(o.breakpoints).reduce((p,g)=>{var v;return p[g]||(p[g]={}),typeof t=="object"&&t[g]!==void 0&&(p[g]["--col-order"]=(v=t[g])==null?void 0:v.toString()),typeof e=="object"&&e[g]!==void 0&&(p[g]["--col-flex-grow"]=B1(e[g],i.grow),p[g]["--col-flex-basis"]=Np(e[g],i.columns),p[g]["--col-width"]=e[g]==="content"?"auto":void 0,p[g]["--col-max-width"]=V1(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(p[g]["--col-offset"]=U1(n[g],i.columns)),p},{}),f=Vl(St(u),o).filter(p=>St(u[p.value]).length>0).map(p=>({query:`(min-width: ${o.breakpoints[p.value]})`,styles:u[p.value]}));return C.createElement(za,{styles:c,media:f,selector:r})}var ay={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const _5={span:12},ly=K((e,t)=>{const n=H("GridCol",_5,e),{classNames:r,className:o,style:i,styles:s,vars:l,span:c,order:u,offset:d,...f}=n,h=Xj(),p=Pc();return C.createElement(C.Fragment,null,C.createElement(R5,{selector:`.${p}`,span:c,order:u,offset:d}),C.createElement(G,{ref:t,...h.getStyles("col",{className:it(o,p),style:i,classNames:r,styles:s}),...f}))});ly.classes=ay;ly.displayName="@mantine/core/GridCol";function D5({gutter:e,selector:t}){const n=Nt(),r=ms({"--grid-gutter":ln(oi(e))}),o=St(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=ln(e[c])),l),{}),s=Vl(St(o),n).filter(l=>St(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return C.createElement(za,{styles:r,media:s,selector:t})}const I5={gutter:"md",grow:!1,columns:12},A5=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),Zn=K((e,t)=>{const n=H("Grid",I5,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:p,children:g,...v}=n,S=de({name:"Grid",classes:ay,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:A5}),y=Pc();return C.createElement(k5,{value:{getStyles:S,grow:u,columns:f}},C.createElement(D5,{selector:`.${y}`,...n}),C.createElement(G,{ref:t,...S("root",{className:y}),...v},C.createElement("div",{...S("inner")},g)))});Zn.classes=ay;Zn.displayName="@mantine/core/Grid";Zn.Col=ly;function zd(){return zd=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},zd.apply(this,arguments)}function cy(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 N5=m.useLayoutEffect,O5=function(t){var n=m.useRef(t);return N5(function(){n.current=t}),n},H1=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},M5=function(t,n){var r=m.useRef();return m.useCallback(function(o){t.current=o,r.current&&H1(r.current,null),r.current=n,n&&H1(n,o)},[n])},W1={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},$5=function(t){Object.keys(W1).forEach(function(n){t.style.setProperty(n,W1[n],"important")})},q1=$5,bn=null,G1=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function L5(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),bn||(bn=document.createElement("textarea"),bn.setAttribute("tabindex","-1"),bn.setAttribute("aria-hidden","true"),q1(bn)),bn.parentNode===null&&document.body.appendChild(bn);var o=e.paddingSize,i=e.borderSize,s=e.sizingStyle,l=s.boxSizing;Object.keys(s).forEach(function(h){var p=h;bn.style[p]=s[p]}),q1(bn),bn.value=t;var c=G1(bn,e);bn.value=t,c=G1(bn,e),bn.value="x";var u=bn.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 Q1=function(){},F5=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},z5=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],V5=!!document.documentElement.currentStyle,B5=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=F5(z5,n),o=r.boxSizing;if(o==="")return null;V5&&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}},U5=B5;function Jj(e,t,n){var r=O5(n);m.useLayoutEffect(function(){var o=function(s){return r.current(s)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var H5=function(t){Jj(window,"resize",t)},W5=function(t){Jj(document.fonts,"loadingdone",t)},q5=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],G5=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,s=t.onChange,l=s===void 0?Q1:s,c=t.onHeightChange,u=c===void 0?Q1:c,d=cy(t,q5),f=d.value!==void 0,h=m.useRef(null),p=M5(h,n),g=m.useRef(0),v=m.useRef(),S=function(){var w=h.current,b=r&&v.current?v.current:U5(w);if(b){v.current=b;var j=L5(b,w.value||w.placeholder||"x",i,o),E=j[0],T=j[1];g.current!==E&&(g.current=E,w.style.setProperty("height",E+"px","important"),u(E,{rowHeight:T}))}},y=function(w){f||S(),l(w)};return m.useLayoutEffect(S),H5(S),W5(S),m.createElement("textarea",zd({},d,{onChange:y,ref:p}))},Q5=m.forwardRef(G5);const K5={},bs=K((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:s,...l}=H("Textarea",K5,e),c=n&&fb()!=="test",u=c?{maxRows:r,minRows:o}:{};return C.createElement(Qn,{component:c?Q5:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":s},...u})});bs.classes=Qn.classes;bs.displayName="@mantine/core/Textarea";function K1(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const Y5={serialize:JSON.stringify,deserialize:JSON.parse},Ga=K((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,...p}=H("JsonInput",Y5,e),[g,v]=fn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,y]=m.useState(K1(g,c)),x=b=>{u==null||u(b),y(!0)},w=b=>{typeof d=="function"&&d(b);const j=K1(b.currentTarget.value,c);i&&!f&&j&&b.currentTarget.value.trim()!==""&&v(l(c(b.currentTarget.value),null,2)),y(j)};return C.createElement(bs,{value:g,onChange:b=>v(b.currentTarget.value),onFocus:x,onBlur:w,ref:t,readOnly:f,...p,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:s||!0,"data-monospace":!0})});Ga.classes=Qn.classes;Ga.displayName="@mantine/core/JsonInput";const[X5,J5]=Dn("List component was not found in tree");var uy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const Z5={},dy=K((e,t)=>{const n=H("ListItem",Z5,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,children:u,mod:d,...f}=n,h=J5(),p=c||h.icon,g={classNames:r,styles:s};return C.createElement(G,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!p,centered:h.center},d],ref:t,...f},C.createElement("div",{...h.getStyles("itemWrapper",g)},p&&C.createElement("span",{...h.getStyles("itemIcon",g)},p),C.createElement("span",{...h.getStyles("itemLabel",g)},u)))});dy.classes=uy;dy.displayName="@mantine/core/ListItem";const e9={type:"unordered"},t9=(e,{size:t,spacing:n})=>({root:{"--list-fz":nn(t),"--list-lh":ob(t),"--list-spacing":ln(n)}}),Pn=K((e,t)=>{const n=H("List",e9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:p,center:g,listStyleType:v,mod:S,...y}=n,x=de({name:"List",classes:uy,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:t9});return C.createElement(X5,{value:{center:g,icon:h,getStyles:x}},C.createElement(G,{...x("root",{style:{listStyleType:v}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},S],ref:t,...y},u))});Pn.classes=uy;Pn.displayName="@mantine/core/List";Pn.Item=dy;var Zj={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const Y1={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Ur("overlay")},n9=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),fy=K((e,t)=>{const n=H("LoadingOverlay",Y1,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:p,...g}=n,v=Nt(),S=de({name:"LoadingOverlay",classes:Zj,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:n9}),y={...Y1.overlayProps,...f};return C.createElement($o,{transition:"fade",...u,mounted:!!h},x=>C.createElement(G,{...S("root",{style:x}),ref:t,...g},C.createElement(qn,{...S("loader"),unstyled:l,...d}),C.createElement(ac,{...y,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),C.createElement(ac,{...y,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})))});fy.classes=Zj;fy.displayName="@mantine/core/LoadingOverlay";const[r9,Lc]=Dn("Menu component was not found in the tree");var Qa={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const o9={},hy=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=H("MenuDivider",o9,e),c=Lc();return C.createElement(G,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});hy.classes=Qa;hy.displayName="@mantine/core/MenuDivider";const i9={},my=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,onMouseEnter:l,onMouseLeave:c,children:u,...d}=H("MenuDropdown",i9,e),f=m.useRef(null),h=Lc(),p=S=>{var y,x;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(x=(y=f.current)==null?void 0:y.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||x.focus())},g=Xn(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),v=Xn(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return C.createElement(Hr.Dropdown,{...d,onMouseEnter:g,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:Kt(t,f),...h.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:p},C.createElement("div",{tabIndex:-1,"data-autofocus":!0,"aria-hidden":!0,style:{outline:0}}),u)});my.classes=Qa;my.displayName="@mantine/core/MenuDropdown";const s9={},py=Sn((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,...p}=H("MenuItem",s9,e),g=Lc(),v=Nt(),{dir:S}=Va(),y=m.useRef(),x=g.getItemIndex(y.current),w=p,b=Xn(w.onMouseLeave,()=>g.setHovered(-1)),j=Xn(w.onMouseEnter,()=>g.setHovered(g.getItemIndex(y.current))),E=Xn(w.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),T=Xn(w.onFocus,()=>g.setHovered(g.getItemIndex(y.current))),P=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,_=l?lo({color:l,theme:v}):null;return C.createElement(kn,{...p,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:T,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:Kt(y,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:rb({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:w.onKeydown}),__vars:{"--menu-item-color":_!=null&&_.isThemeColor&&(_==null?void 0:_.shade)===void 0?`var(--mantine-color-${_.color}-6)`:P==null?void 0:P.color,"--menu-item-hover":P==null?void 0:P.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))});py.classes=Qa;py.displayName="@mantine/core/MenuItem";const a9={},gy=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:s,...l}=H("MenuLabel",a9,e),c=Lc();return C.createElement(G,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});gy.classes=Qa;gy.displayName="@mantine/core/MenuLabel";const l9={refProp:"ref"},eP=m.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=H("MenuTarget",l9,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=Lc(),s=Xn(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=Xn(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=Xn(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return C.createElement(Hr.Target,{refProp:r,popupType:"menu",ref:t,...o},m.cloneElement(n,{onClick:s,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0}))});eP.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 ne(e){const t=H("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:p,closeDelay:g,classNames:v,styles:S,unstyled:y,variant:x,vars:w,menuItemTabIndex:b,keepMounted:j,...E}=t,T=de({name:"Menu",classes:Qa,props:t,classNames:v,styles:S,unstyled:y}),[P,{setHovered:_,resetHovered:D}]=H2(),[$,I]=fn({value:i,defaultValue:s,finalValue:!1,onChange:c}),[L,F]=m.useState(!1),O=()=>{I(!1),F(!1),$&&(o==null||o())},A=()=>{I(!0),!$&&(r==null||r())},R=()=>{$?O():A()},{openDropdown:k,closeDropdown:M}=T5({open:A,close:O,closeDelay:g,openDelay:p}),B=re=>U2("[data-menu-item]","[data-menu-dropdown]",re),{resolvedClassNames:U,resolvedStyles:X}=Ec({classNames:v,styles:S,props:t});return Co(()=>{D()},[$]),C.createElement(r9,{value:{getStyles:T,opened:$,toggleDropdown:R,getItemIndex:B,hovered:P,setHovered:_,openedViaClick:L,setOpenedViaClick:F,closeOnItemClick:u,closeDropdown:h==="click"?O:M,openDropdown:h==="click"?A:k,closeDropdownImmediately:O,loop:d,trigger:h,unstyled:y,menuItemTabIndex:b}},C.createElement(Hr,{...E,opened:$,onChange:R,defaultOpened:s,trapFocus:j?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:U,styles:X,unstyled:y,variant:x,keepMounted:j},n))}ne.extend=e=>e;ne.classes=Qa;ne.displayName="@mantine/core/Menu";ne.Item=py;ne.Label=gy;ne.Dropdown=my;ne.Target=eP;ne.Divider=hy;const[u9,Ka]=Dn("Modal component was not found in tree");var Fo={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const d9={},Lf=K((e,t)=>{const n=H("ModalBody",d9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ka();return C.createElement(gj,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:s,className:o}),...c})});Lf.classes=Fo;Lf.displayName="@mantine/core/ModalBody";const f9={},Ff=K((e,t)=>{const n=H("ModalCloseButton",f9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ka();return C.createElement(vj,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:s,className:o}),...c})});Ff.classes=Fo;Ff.displayName="@mantine/core/ModalCloseButton";const h9={},zf=K((e,t)=>{const n=H("ModalContent",h9,e),{classNames:r,className:o,style:i,styles:s,vars:l,children:c,...u}=n,d=Ka(),f=d.scrollAreaComponent||M4;return C.createElement(I4,{...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,"data-modal-content":!0,ref:t,...u},C.createElement(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${V(d.yOffset)} * 2))`}},c))});zf.classes=Fo;zf.displayName="@mantine/core/ModalContent";const m9={},Vf=K((e,t)=>{const n=H("ModalHeader",m9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ka();return C.createElement(yj,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:s,className:o}),...c})});Vf.classes=Fo;Vf.displayName="@mantine/core/ModalHeader";const p9={},Bf=K((e,t)=>{const n=H("ModalOverlay",p9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ka();return C.createElement(xj,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:s,className:o}),...c})});Bf.classes=Fo;Bf.displayName="@mantine/core/ModalOverlay";const g9={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Ur("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},v9=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Ct(t),"--modal-size":Ne(n,"modal-size"),"--modal-y-offset":V(r),"--modal-x-offset":V(o)}}),Uf=K((e,t)=>{const n=H("ModalRoot",g9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:p,xOffset:g,__staticSelector:v,...S}=n,y=de({name:v,classes:Fo,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:v9});return C.createElement(u9,{value:{yOffset:u,scrollAreaComponent:d,getStyles:y,fullScreen:h}},C.createElement(_4,{ref:t,...y("root"),"data-full-screen":h||void 0,"data-centered":p||void 0,unstyled:l,...S}))});Uf.classes=Fo;Uf.displayName="@mantine/core/ModalRoot";const y9={},Hf=K((e,t)=>{const n=H("ModalTitle",y9,e),{classNames:r,className:o,style:i,styles:s,vars:l,...c}=n,u=Ka();return C.createElement(wj,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:s,className:o}),...c})});Hf.classes=Fo;Hf.displayName="@mantine/core/ModalTitle";const x9={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Ur("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Nn=K((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:s,children:l,radius:c,...u}=H("Modal",x9,e),d=!!n||i;return C.createElement(Uf,{ref:t,radius:c,...u},r&&C.createElement(Bf,{...o}),C.createElement(zf,{radius:c},d&&C.createElement(Vf,null,n&&C.createElement(Hf,null,n),i&&C.createElement(Ff,{...s})),C.createElement(Lf,null,l)))});Nn.classes=Fo;Nn.displayName="@mantine/core/Modal";Nn.Root=Uf;Nn.Overlay=Bf;Nn.Content=zf;Nn.Body=Lf;Nn.Header=Vf;Nn.Title=Hf;Nn.CloseButton=Ff;const[w9,vy]=Cc(),[S9,b9]=Cc();var Wf={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const C9={},E9=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Ne(t):Ne(n,"pg-gap")}}),yy=K((e,t)=>{const n=H("PillGroup",C9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=vy(),p=(h==null?void 0:h.size)||u||void 0,g=de({name:"PillGroup",classes:Wf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:E9,stylesCtx:{size:p},rootSelector:"group"});return C.createElement(S9,{value:{size:p,disabled:d}},C.createElement(G,{ref:t,size:p,...g("group"),...f}))});yy.classes=Wf;yy.displayName="@mantine/core/PillGroup";const j9={variant:"default"},P9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Ne(n,"pill-fz"),"--pill-height":Ne(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ct(t)}}),ls=K((e,t)=>{const n=H("Pill",j9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:p,radius:g,size:v,disabled:S,mod:y,...x}=n,w=b9(),b=vy(),j=v||(w==null?void 0:w.size)||void 0,E=(b==null?void 0:b.variant)==="filled"?"contrast":u||"default",T=de({name:"Pill",classes:Wf,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:P9,stylesCtx:{size:j}});return C.createElement(G,{component:"span",ref:t,variant:E,size:j,...T("root",{variant:E}),mod:[{"with-remove":f&&!S,disabled:S||(w==null?void 0:w.disabled)},y],...x},C.createElement("span",{...T("label")},d),f&&C.createElement(ws,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...p,...T("remove",{className:p==null?void 0:p.className,style:p==null?void 0:p.style}),onMouseDown:P=>{var _;P.preventDefault(),P.stopPropagation(),(_=p==null?void 0:p.onMouseDown)==null||_.call(p,P)},onClick:P=>{var _;P.stopPropagation(),h==null||h(),(_=p==null?void 0:p.onClick)==null||_.call(p,P)}}))});ls.classes=Wf;ls.displayName="@mantine/core/Pill";ls.Group=yy;var tP={field:"m_45c4369d"};const T9={type:"visible"},xy=K((e,t)=>{const n=H("PillsInputField",T9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:p,...g}=n,v=vy(),S=Wa(),y=de({name:"PillsInputField",classes:tP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"field"}),x=d||(v==null?void 0:v.disabled);return C.createElement(G,{component:"input",ref:Kt(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:x,mod:[{disabled:x,pointer:h},p],...y("field"),...g,id:(S==null?void 0:S.inputId)||f,"aria-invalid":v==null?void 0:v.hasError,"aria-describedby":S==null?void 0:S.describedBy,type:"text",onMouseDown:w=>!h&&w.stopPropagation()})});xy.classes=tP;xy.displayName="@mantine/core/PillsInputField";const k9={},Da=K((e,t)=>{const n=H("PillsInput",k9,e),{children:r,onMouseDown:o,onClick:i,size:s,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=m.useRef();return C.createElement(w9,{value:{fieldRef:h,size:s,disabled:l,hasError:!!u,variant:d}},C.createElement(Qn,{size:s,error:u,variant:d,component:"div",ref:t,onMouseDown:p=>{var g;p.preventDefault(),o==null||o(p),(g=h.current)==null||g.focus()},onClick:p=>{var g;p.preventDefault(),i==null||i(p),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1},r))});Da.displayName="@mantine/core/PillsInput";Da.Field=xy;function R9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(_a(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 _9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},qf=K((e,t)=>{const n=H("MultiSelect",_9,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:p,variant:g,data:v,dropdownOpened:S,defaultDropdownOpened:y,onDropdownOpen:x,onDropdownClose:w,selectFirstOptionOnChange:b,onOptionSubmit:j,comboboxProps:E,filter:T,limit:P,withScrollArea:_,maxDropdownHeight:D,searchValue:$,defaultSearchValue:I,onSearchChange:L,readOnly:F,disabled:O,onFocus:A,onBlur:R,onPaste:k,radius:M,rightSection:B,rightSectionWidth:U,rightSectionPointerEvents:X,rightSectionProps:re,leftSection:fe,leftSectionWidth:Ce,leftSectionPointerEvents:Te,leftSectionProps:Ae,inputContainer:pe,inputWrapperOrder:He,withAsterisk:ct,labelProps:We,descriptionProps:be,errorProps:ze,wrapperProps:$e,description:Y,label:oe,error:Ee,maxValues:Qe,searchable:Ze,nothingFoundMessage:ee,withCheckIcon:q,checkIconPosition:ge,hidePickedOptions:Me,withErrorStyles:Ve,name:nt,form:Ot,id:ar,clearable:Ii,clearButtonProps:On,hiddenInputProps:Qr,placeholder:jr,hiddenInputValuesDivider:Wo,required:nl,mod:cu,renderOption:_s,onRemove:lr,onClear:Ai,scrollAreaProps:Ch,...uu}=n,rl=In(ar),Ds=Tj(v),qo=kj(Ds),N=Mc({opened:S,defaultOpened:y,onDropdownOpen:x,onDropdownClose:()=>{w==null||w(),N.resetSelectedOption()}}),{styleProps:z,rest:{type:Q,autoComplete:te,...ye}}=No(uu),[je,Re]=fn({value:d,defaultValue:f,finalValue:[],onChange:h}),[Pe,Se]=fn({value:$,defaultValue:I,finalValue:"",onChange:L}),Be=de({name:"MultiSelect",classes:{},props:n,classNames:r,styles:s,unstyled:l}),{resolvedClassNames:Ut,resolvedStyles:Le}=Ec({props:n,styles:s,classNames:r}),ut=ot=>{p==null||p(ot),ot.key===" "&&!Ze&&(ot.preventDefault(),N.toggleDropdown()),ot.key==="Backspace"&&Pe.length===0&&je.length>0&&(lr==null||lr(je[je.length-1]),Re(je.slice(0,je.length-1)))},Yt=je.map((ot,Ni)=>{var fo,Pr;return C.createElement(ls,{key:`${ot}-${Ni}`,withRemoveButton:!F&&!((fo=qo[ot])!=null&&fo.disabled),onRemove:()=>{Re(je.filter(ho=>ot!==ho)),lr==null||lr(ot)},unstyled:l,disabled:O,...Be("pill")},((Pr=qo[ot])==null?void 0:Pr.label)||ot)});m.useEffect(()=>{b&&N.selectFirstOption()},[b,je]);const sn=Ii&&je.length>0&&!O&&!F&&C.createElement(De.ClearButton,{size:u,...On,onClear:()=>{Ai==null||Ai(),Re([]),Se("")}}),Ht=R9({data:Ds,value:je});return C.createElement(C.Fragment,null,C.createElement(De,{store:N,classNames:Ut,styles:Le,unstyled:l,size:u,readOnly:F,__staticSelector:"MultiSelect",onOptionSubmit:ot=>{j==null||j(ot),Se(""),N.updateSelectedOptionIndex("selected"),je.includes(qo[ot].value)?(Re(je.filter(Ni=>Ni!==qo[ot].value)),lr==null||lr(qo[ot].value)):je.length<Qe&&Re([...je,qo[ot].value])},...E},C.createElement(De.DropdownTarget,null,C.createElement(Da,{...z,__staticSelector:"MultiSelect",classNames:Ut,styles:Le,unstyled:l,size:u,className:o,style:i,variant:g,disabled:O,radius:M,rightSection:B||sn||C.createElement(De.Chevron,{size:u,error:Ee,unstyled:l}),rightSectionPointerEvents:X||(sn?"all":"none"),rightSectionWidth:U,rightSectionProps:re,leftSection:fe,leftSectionWidth:Ce,leftSectionPointerEvents:Te,leftSectionProps:Ae,inputContainer:pe,inputWrapperOrder:He,withAsterisk:ct,labelProps:We,descriptionProps:be,errorProps:ze,wrapperProps:$e,description:Y,label:oe,error:Ee,multiline:!0,withErrorStyles:Ve,__stylesApiProps:{...n,rightSectionPointerEvents:X||(sn?"all":"none"),multiline:!0},pointer:!Ze,onClick:()=>Ze?N.openDropdown():N.toggleDropdown(),"data-expanded":N.dropdownOpened||void 0,id:rl,required:nl,mod:cu},C.createElement(ls.Group,{disabled:O,unstyled:l,...Be("pillsList")},Yt,C.createElement(De.EventsTarget,{autoComplete:te},C.createElement(Da.Field,{...ye,ref:t,id:rl,placeholder:jr,type:!Ze&&!jr?"hidden":"visible",...Be("inputField"),unstyled:l,onFocus:ot=>{A==null||A(ot),Ze&&N.openDropdown()},onBlur:ot=>{R==null||R(ot),N.closeDropdown(),Se("")},onKeyDown:ut,value:Pe,onChange:ot=>{Se(ot.currentTarget.value),Ze&&N.openDropdown(),b&&N.selectFirstOption()},disabled:O,readOnly:F||!Ze,pointer:!Ze}))))),C.createElement(J3,{data:Me?Ht:Ds,hidden:F||O,filter:T,search:Pe,limit:P,hiddenWhenEmpty:!Ze||!ee||Me&&Ht.length===0&&Pe.trim().length===0,withScrollArea:_,maxDropdownHeight:D,filterOptions:Ze,value:je,checkIconPosition:ge,withCheckIcon:q,nothingFoundMessage:ee,unstyled:l,labelId:`${rl}-label`,renderOption:_s,scrollAreaProps:Ch})),C.createElement(De.HiddenInput,{name:nt,valuesDivider:Wo,value:je,form:Ot,disabled:O,...Qr}))});qf.classes={...Qn.classes,...De.classes};qf.displayName="@mantine/core/MultiSelect";function D9(e){return"group"in e}function wy({data:e}){if(D9(e)){const o=e.items.map(i=>C.createElement(wy,{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)}wy.displayName="@mantine/core/NativeSelectOption";const I9={rightSectionPointerEvents:"none"},Tt=K((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:s,unstyled:l,...c}=H("NativeSelect",I9,e),u=Tj(n).map((d,f)=>C.createElement(wy,{key:f,data:d}));return C.createElement(Qn,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:s||C.createElement(Af,{size:o,error:i,unstyled:l})},r||u)});Tt.classes=Qn.classes;Tt.displayName="@mantine/core/NativeSelect";var nP={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const A9={withCloseButton:!0},N9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ct(t),"--notification-color":n?bt(n,e):void 0}}),Sy=K((e,t)=>{const n=H("Notification",A9,e),{className:r,color:o,radius:i,loading:s,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:p,classNames:g,style:v,styles:S,unstyled:y,variant:x,vars:w,mod:b,...j}=n,E=de({name:"Notification",classes:nP,props:n,className:r,style:v,classNames:g,styles:S,unstyled:y,vars:w,varsResolver:N9});return C.createElement(G,{...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(qn,{size:28,color:o,...E("loader")}),C.createElement("div",{...E("body")},u&&C.createElement("div",{...E("title")},u),C.createElement(G,{...E("description"),mod:{"data-with-title":!!u}},f)),l&&C.createElement(ws,{iconSize:16,color:"gray",...p,unstyled:y,onClick:h,...E("closeButton")}))});Sy.classes=nP;Sy.displayName="@mantine/core/Notification";function rP(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}var cc;(function(e){e.event="event",e.props="prop"})(cc||(cc={}));function ri(){}function O9(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t&&r.length===t.length&&r.every(function(i,s){return i===t[s]})||(t=r,n=e.apply(void 0,r)),n}}function uc(e){return!!(e||"").match(/\d/)}function va(e){return e==null}function M9(e){return typeof e=="number"&&isNaN(e)}function oP(e){return va(e)||M9(e)||typeof e=="number"&&!isFinite(e)}function iP(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function $9(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function L9(e,t,n){var r=$9(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function F9(e){var t=m.useRef(e);t.current=e;var n=m.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function by(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),i=o[0],s=o[1]||"";return{beforeDecimal:i,afterDecimal:s,hasNegation:n,addNegation:r}}function z9(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function sP(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function X1(e,t){return Array(t+1).join(e)}function aP(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(i=Number(i),!i)return n+o;o=o.replace(".","");var s=1+i,l=o.length;return s<0?o="0."+X1("0",Math.abs(s))+o:s>=l?o=o+X1("0",s-l):o=(o.substring(0,s)||"0")+"."+o.substring(s),n+o}function J1(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=by(e),i=o.beforeDecimal,s=o.afterDecimal,l=o.hasNegation,c=parseFloat("0."+(s||"0")),u=s.length<=t?"0."+s:c.toFixed(t),d=u.split("."),f=i;i&&Number(d[0])&&(f=i.split("").reverse().reduce(function(v,S,y){return v.length>y?(Number(v[0])+Number(S)).toString()+v.substring(1,v.length):S+v},d[0]));var h=sP(d[1]||"",t,n),p=l?"-":"",g=r?".":"";return""+p+f+g+h}function Vi(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var lP=O9(function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}});function V9(e,t,n){return Math.min(Math.max(e,t),n)}function hm(e){return Math.max(e.selectionStart,e.selectionEnd)}function B9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function U9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function H9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function W9(e,t,n,r,o,i,s){s===void 0&&(s=H9);var l=o.findIndex(function(b){return b}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,d=e.length,f={},h=new Array(u),p=0;p<u;p++){h[p]=-1;for(var g=0,v=d;g<v;g++){var S=s({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:g});if(S&&f[g]!==!0){h[p]=g,f[g]=!0;break}}}for(var y=r;y<u&&(h[y]===-1||!i(n[y]));)y++;var x=y===u||h[y]===-1?d:h[y];for(y=r-1;y>0&&h[y]===-1;)y--;var w=y===-1||h[y]===-1?0:h[y]+1;return w>x?x:r-w<x-r?w:x}function Z1(e,t,n,r){var o=e.length;if(t=V9(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function q9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(uc(e[n])||uc(e[n-1]));return t}function cP(e,t,n,r,o,i){i===void 0&&(i=ri);var s=F9(function(g,v){var S,y;return oP(g)?(y="",S=""):typeof g=="number"||v?(y=typeof g=="number"?aP(g):g,S=r(y)):(y=o(g,void 0),S=r(y)),{formattedValue:S,numAsString:y}}),l=m.useState(function(){return s(va(e)?t:e,n)}),c=l[0],u=l[1],d=function(g,v){g.formattedValue!==c.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),i(g,v)},f=e,h=n;va(e)&&(f=c.numAsString,h=!0);var p=s(f,h);return m.useMemo(function(){u(p)},[p.formattedValue]),[c,d]}function G9(e){return e.replace(/[^0-9]/g,"")}function Q9(e){return e}function K9(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,i=e.getInputRef,s=e.format;s===void 0&&(s=Q9);var l=e.removeFormatting;l===void 0&&(l=G9);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=ri);var p=e.onKeyDown;p===void 0&&(p=ri);var g=e.onMouseUp;g===void 0&&(g=ri);var v=e.onFocus;v===void 0&&(v=ri);var S=e.onBlur;S===void 0&&(S=ri);var y=e.value,x=e.getCaretBoundary;x===void 0&&(x=q9);var w=e.isValidInputCharacter;w===void 0&&(w=uc);var b=e.isCharacterSame,j=rP(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=cP(y,c,!!u,s,l,d),T=E[0],P=T.formattedValue,_=T.numAsString,D=E[1],$=m.useRef({formattedValue:P,numAsString:_}),I=function(Y,oe){$.current={formattedValue:Y.formattedValue,numAsString:Y.value},D(Y,oe)},L=m.useState(!1),F=L[0],O=L[1],A=m.useRef(null),R=m.useRef({setCaretTimeout:null,focusTimeout:null});m.useEffect(function(){return O(!0),function(){clearTimeout(R.current.setCaretTimeout),clearTimeout(R.current.focusTimeout)}},[]);var k=s,M=function(Y,oe){var Ee=parseFloat(oe);return{formattedValue:Y,value:oe,floatValue:isNaN(Ee)?void 0:Ee}},B=function(Y,oe,Ee){Y.selectionStart===0&&Y.selectionEnd===Y.value.length||(Vi(Y,oe),R.current.setCaretTimeout=setTimeout(function(){Y.value===Ee&&Y.selectionStart!==oe&&Vi(Y,oe)},0))},U=function(Y,oe,Ee){return Z1(Y,oe,x(Y),Ee)},X=function(Y,oe,Ee){var Qe=x(oe),Ze=W9(oe,P,Y,Ee,Qe,w,b);return Ze=Z1(oe,Ze,Qe),Ze},re=function(Y){var oe=Y.formattedValue;oe===void 0&&(oe="");var Ee=Y.input,Qe=Y.source,Ze=Y.event,ee=Y.numAsString,q;if(Ee){var ge=Y.inputValue||Ee.value,Me=hm(Ee);Ee.value=oe,q=X(ge,oe,Me),q!==void 0&&B(Ee,q,oe)}oe!==P&&I(M(oe,ee),{event:Ze,source:Qe})};m.useEffect(function(){var Y=$.current,oe=Y.formattedValue,Ee=Y.numAsString;P!==oe&&(P!==_||oe!==Ee)&&I(M(P,_),{event:void 0,source:cc.props})},[P,_]);var fe=A.current?hm(A.current):void 0,Ce=typeof window<"u"?m.useLayoutEffect:m.useEffect;Ce(function(){var Y=A.current;if(P!==$.current.formattedValue&&Y){var oe=X($.current.formattedValue,P,fe);Y.value=P,B(Y,oe,P)}},[P]);var Te=function(Y,oe,Ee){var Qe=lP(P,Y),Ze=Object.assign(Object.assign({},Qe),{lastValue:P}),ee=l(Y,Ze),q=k(ee);if(ee=l(q,void 0),f&&!f(M(q,ee))){var ge=oe.target,Me=hm(ge),Ve=X(Y,P,Me);return ge.value=P,B(ge,Ve,P),!1}return re({formattedValue:q,numAsString:ee,inputValue:Y,event:oe,source:Ee,input:oe.target}),!0},Ae=function(Y){var oe=Y.target,Ee=oe.value,Qe=Te(Ee,Y,cc.event);Qe&&h(Y)},pe=function(Y){var oe=Y.target,Ee=Y.key,Qe=oe.selectionStart,Ze=oe.selectionEnd,ee=oe.value;ee===void 0&&(ee="");var q;if(Ee==="ArrowLeft"||Ee==="Backspace"?q=Math.max(Qe-1,0):Ee==="ArrowRight"?q=Math.min(Qe+1,ee.length):Ee==="Delete"&&(q=Qe),q===void 0||Qe!==Ze){p(Y);return}var ge=q;if(Ee==="ArrowLeft"||Ee==="ArrowRight"){var Me=Ee==="ArrowLeft"?"left":"right";ge=U(ee,q,Me),ge!==q&&Y.preventDefault()}else Ee==="Delete"&&!w(ee[q])?ge=U(ee,q,"right"):Ee==="Backspace"&&!w(ee[q])&&(ge=U(ee,q,"left"));ge!==q&&B(oe,ge,ee),Y.isUnitTestRun&&B(oe,ge,ee),p(Y)},He=function(Y){var oe=Y.target,Ee=function(){var Qe=oe.selectionStart,Ze=oe.selectionEnd,ee=oe.value;if(ee===void 0&&(ee=""),Qe===Ze){var q=U(ee,Qe);q!==Qe&&B(oe,q,ee)}};Ee(),requestAnimationFrame(function(){Ee()}),g(Y)},ct=function(Y){Y.persist&&Y.persist();var oe=Y.target,Ee=Y.currentTarget;A.current=oe,R.current.focusTimeout=setTimeout(function(){var Qe=oe.selectionStart,Ze=oe.selectionEnd,ee=oe.value;ee===void 0&&(ee="");var q=U(ee,Qe);q!==Qe&&!(Qe===0&&Ze===ee.length)&&B(oe,q,ee),v(Object.assign(Object.assign({},Y),{currentTarget:Ee}))},0)},We=function(Y){A.current=null,clearTimeout(R.current.focusTimeout),clearTimeout(R.current.setCaretTimeout),S(Y)},be=F&&B9()?"numeric":void 0,ze=Object.assign({inputMode:be},j,{type:t,value:P,onChange:Ae,onKeyDown:pe,onMouseUp:He,onFocus:ct,onBlur:We});if(n==="text")return o?C.createElement(C.Fragment,null,o(P,j)||null):C.createElement("span",Object.assign({},j,{ref:i}),P);if(r){var $e=r;return C.createElement($e,Object.assign({},ze,{ref:i}))}return C.createElement("input",Object.assign({},ze,{ref:i}))}function ew(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var i=t.suffix;i===void 0&&(i="");var s=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Gf(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=by(e,s),p=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=sP(g,n,!!r)),u&&(p=L9(p,u,l)),o&&(p=o+p),i&&(g=g+i),v&&(p="-"+p),e=p+(f&&d||"")+g,e}function Gf(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function Y9(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}function X9(e,t){return new RegExp("(^-)|[0-9]|"+iP(e),t?"g":void 0)}function J9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function Z9(e,t,n){var r;t===void 0&&(t=U9(e));var o=n.allowNegative,i=n.prefix;i===void 0&&(i="");var s=n.suffix;s===void 0&&(s="");var l=n.decimalScale,c=t.from,u=t.to,d=u.start,f=u.end,h=Gf(n),p=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(uc(e)&&(e===i||e===s)&&t.lastValue==="")return e;if(f-d===1&&p.indexOf(e[d])!==-1){var S=l===0?"":g;e=e.substring(0,d)+S+e.substring(d+1,e.length)}var y=function(R,k,M){var B=!1,U=!1;i.startsWith("-")?B=!1:R.startsWith("--")?(B=!1,U=!0):s.startsWith("-")&&R.length===s.length?B=!1:R[0]==="-"&&(B=!0);var X=B?1:0;return U&&(X=2),X&&(R=R.substring(X),k-=X,M-=X),{value:R,start:k,end:M,hasNegation:B}},x=y(e,d,f),w=x.hasNegation;r=x,e=r.value,d=r.start,f=r.end;var b=y(t.lastValue,c.start,c.end),j=b.start,E=b.end,T=b.value,P=e.substring(d,f);e.length&&T.length&&(j>T.length-s.length||E<i.length)&&!(P&&s.startsWith(P))&&(e=T);var _=0;e.startsWith(i)?_+=i.length:d<i.length&&(_=d),e=e.substring(_),f-=_;var D=e.length,$=e.length-s.length;e.endsWith(s)?D=$:(f>$||f>e.length-s.length)&&(D=f),e=e.substring(0,D),e=Y9(w?"-"+e:e,o),e=(e.match(X9(g,!0))||[]).join("");var I=e.indexOf(g);e=e.replace(new RegExp(iP(g),"g"),function(R,k){return k===I?".":""});var L=by(e,o),F=L.beforeDecimal,O=L.afterDecimal,A=L.addNegation;return u.end-u.start<c.end-c.start&&F===""&&v&&!parseFloat(O)&&(e=A?"-":""),e}function eO(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";o.fill(!1,0,n.length+(i?1:0));var s=e.length;return o.fill(!1,s-r.length+1,s+1),o}function tO(e){var t=Gf(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var i=e.allowNegative;if(i===void 0&&(i=!0),n===r)throw new Error(`
|
|
84
|
-
Decimal separator can't be same as thousand separator.
|
|
85
|
-
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
86
|
-
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
87
|
-
`);return o.startsWith("-")&&i&&(console.error(`
|
|
88
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
89
|
-
prefix: `+o+`
|
|
90
|
-
allowNegative: `+i+`
|
|
91
|
-
`),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function nO(e){e=tO(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=ri);var i=e.onBlur;i===void 0&&(i=ri);var s=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var d=e.defaultValue,f=e.value,h=e.valueIsNumericString,p=e.onValueChange,g=rP(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Gf(e),S=v.decimalSeparator,y=v.allowedDecimalSeparators,x=function(A){return ew(A,e)},w=function(A,R){return Z9(A,R,e)},b=va(f)?d:f,j=h??J9(b,u,t);va(f)?va(d)||(j=j||typeof d=="number"):j=j||typeof f=="number";var E=function(A){return oP(A)?A:(typeof A=="number"&&(A=aP(A)),j&&typeof l=="number"?J1(A,l,!!c):A)},T=cP(E(f),E(d),!!j,x,w,p),P=T[0],_=P.numAsString,D=P.formattedValue,$=T[1],I=function(A){var R=A.target,k=A.key,M=R.selectionStart,B=R.selectionEnd,U=R.value;if(U===void 0&&(U=""),M!==B){o(A);return}k==="Backspace"&&U[0]==="-"&&M===u.length+1&&n&&Vi(R,1),l&&c&&(k==="Backspace"&&U[M-1]===S?(Vi(R,M-1),A.preventDefault()):k==="Delete"&&U[M]===S&&A.preventDefault()),y!=null&&y.includes(k)&&U[M]===S&&Vi(R,M+1);var X=s===!0?",":s;k==="Backspace"&&U[M-1]===X&&Vi(R,M-1),k==="Delete"&&U[M]===X&&Vi(R,M+1),o(A)},L=function(A){var R=_;if(R.match(/\d/g)||(R=""),r||(R=z9(R)),c&&l&&(R=J1(R,l,c)),R!==_){var k=ew(R,e);$({formattedValue:k,value:R,floatValue:parseFloat(R)},{event:A,source:cc.event})}i(A)},F=function(A){return A===S?!0:uc(A)},O=function(A){var R=A.currentValue,k=A.lastValue,M=A.formattedValue,B=A.currentValueIndex,U=A.formattedValueIndex,X=R[B],re=M[U],fe=lP(k,R),Ce=fe.to;return B>=Ce.start&&B<Ce.end&&y&&y.includes(X)&&re===S?!0:X===re};return Object.assign(Object.assign({},g),{value:D,valueIsNumericString:!1,isValidInputCharacter:F,isCharacterSame:O,onValueChange:$,format:x,removeFormatting:w,getCaretBoundary:function(A){return eO(A,e)},onKeyDown:I,onBlur:L})}function rO(e){var t=nO(e);return C.createElement(K9,Object.assign({},t))}function tw({direction:e,style:t,...n}){return C.createElement("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n},C.createElement("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var Op={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const oO=/^-0(\.0*)?$/,iO=/^-?0\d+$/;function sO(e){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)}function nw(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const aO={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,startValue:0},lO=(e,{size:t})=>({controls:{"--ni-chevron-size":Ne(t,"ni-chevron-size")}}),Cy=K((e,t)=>{const n=H("NumberInput",aO,e),{className:r,classNames:o,styles:i,unstyled:s,vars:l,onChange:c,onValueChange:u,value:d,defaultValue:f,max:h,min:p,step:g,hideControls:v,rightSection:S,isAllowed:y,clampBehavior:x,onBlur:w,allowDecimal:b,decimalScale:j,onKeyDown:E,handlersRef:T,startValue:P,disabled:_,rightSectionPointerEvents:D,allowNegative:$,readOnly:I,size:L,rightSectionWidth:F,stepHoldInterval:O,stepHoldDelay:A,allowLeadingZeros:R,withKeyboardEvents:k,...M}=n,B=de({name:"NumberInput",classes:Op,props:n,classNames:o,styles:i,unstyled:s,vars:l,varsResolver:lO}),{resolvedClassNames:U,resolvedStyles:X}=Ec({classNames:o,styles:i,props:n}),[re,fe]=fn({value:d,defaultValue:f,onChange:c}),Ce=A!==void 0&&O!==void 0,Te=m.useRef(null),Ae=m.useRef(null),pe=m.useRef(0),He=(ee,q)=>{q.source==="event"&&fe(sO(ee.floatValue)&&!oO.test(ee.value)&&!(R&&iO.test(ee.value))?ee.floatValue:ee.value),u==null||u(ee,q)},ct=ee=>{const q=String(ee).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return q?Math.max(0,(q[1]?q[1].length:0)-(q[2]?+q[2]:0)):0},We=ee=>{Te.current&&ee&&Te.current.setSelectionRange(ee,ee)},be=m.useRef();be.current=()=>{let ee;const q=ct(re),ge=ct(g),Me=Math.max(q,ge),Ve=10**Me;if(typeof re!="number"||Number.isNaN(re))ee=gu(P,p,h);else if(h!==void 0){const Ot=(Math.round(re*Ve)+Math.round(g*Ve))/Ve;ee=Ot<=h?Ot:h}else ee=(Math.round(re*Ve)+Math.round(g*Ve))/Ve;const nt=ee.toFixed(Me);fe(parseFloat(nt)),u==null||u({floatValue:parseFloat(nt),formattedValue:nt,value:nt},{source:"increment"}),setTimeout(()=>{var Ot;return We((Ot=Te.current)==null?void 0:Ot.value.length)},0)};const ze=m.useRef();ze.current=()=>{let ee;const q=ct(re),ge=ct(g),Me=Math.max(q,ge),Ve=10**Me;if(typeof re!="number"||Number.isNaN(re))ee=gu(P,p,h);else{const Ot=(Math.round(re*Ve)-Math.round(g*Ve))/Ve;ee=p!==void 0&&Ot<p?p:Ot}const nt=ee.toFixed(Me);fe(parseFloat(nt)),u==null||u({floatValue:parseFloat(nt),formattedValue:nt,value:nt},{source:"decrement"}),setTimeout(()=>{var Ot;return We((Ot=Te.current)==null?void 0:Ot.value.length)},0)};const $e=ee=>{E==null||E(ee),!(I||!k)&&(ee.key==="ArrowUp"&&(ee.preventDefault(),be.current()),ee.key==="ArrowDown"&&(ee.preventDefault(),ze.current()))};lf(T,{increment:be.current,decrement:ze.current});const Y=ee=>{ee?be.current():ze.current(),pe.current+=1},oe=ee=>{if(Y(ee),Ce){const q=typeof O=="number"?O:O(pe.current);Ae.current=window.setTimeout(()=>oe(ee),q)}},Ee=(ee,q)=>{var ge;ee.preventDefault(),(ge=Te.current)==null||ge.focus(),Y(q),Ce&&(Ae.current=window.setTimeout(()=>oe(q),A))},Qe=()=>{Ae.current&&window.clearTimeout(Ae.current),Ae.current=null,pe.current=0},Ze=C.createElement("div",{...B("controls")},C.createElement(kn,{...B("control"),tabIndex:-1,"aria-hidden":!0,disabled:_||typeof re=="number"&&h!==void 0&&re>=h,mod:{direction:"up"},onMouseDown:ee=>ee.preventDefault(),onPointerDown:ee=>{Ee(ee,!0)},onPointerUp:Qe,onPointerLeave:Qe},C.createElement(tw,{direction:"up"})),C.createElement(kn,{...B("control"),tabIndex:-1,"aria-hidden":!0,disabled:_||typeof re=="number"&&p!==void 0&&re<=p,mod:{direction:"down"},onMouseDown:ee=>ee.preventDefault(),onPointerDown:ee=>{Ee(ee,!1)},onPointerUp:Qe,onPointerLeave:Qe},C.createElement(tw,{direction:"down"})));return C.createElement(Qn,{component:rO,allowNegative:$,className:it(Op.root,r),size:L,...M,readOnly:I,disabled:_,value:re,getInputRef:Kt(t,Te),onValueChange:He,rightSection:v||I?S:S||Ze,classNames:U,styles:X,unstyled:s,__staticSelector:"NumberInput",decimalScale:b?j:0,onKeyDown:$e,rightSectionPointerEvents:D??(_?"none":void 0),rightSectionWidth:F??`var(--ni-right-section-width-${L||"sm"})`,allowLeadingZeros:R,onBlur:ee=>{w==null||w(ee),x==="blur"&&typeof re=="number"&&gu(re,p,h)!==re&&fe(gu(re,p,h))},isAllowed:ee=>x==="strict"?y?y(ee)&&nw(ee.floatValue,p,h):nw(ee.floatValue,p,h):y?y(ee):!0})});Cy.classes={...Qn.classes,...Op};Cy.displayName="@mantine/core/NumberInput";const[cO,Qf]=Dn("Pagination.Root component was not found in tree");var Fc={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const uO={withPadding:!0},zc=K((e,t)=>{const n=H("PaginationControl",uO,e),{classNames:r,className:o,style:i,styles:s,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,p=Qf(),g=u||p.disabled;return C.createElement(kn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...p.getStyles("control",{className:o,style:i,classNames:r,styles:s,active:!g}),...h})});zc.classes=Fc;zc.displayName="@mantine/core/PaginationControl";function Vc({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 dO=e=>C.createElement(Vc,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),fO=e=>C.createElement(Vc,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),hO=e=>C.createElement(Vc,{...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"}),mO=e=>C.createElement(Vc,{...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"}),pO=e=>C.createElement(Vc,{...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"}),gO={icon:pO},Kf=K((e,t)=>{const n=H("PaginationDots",gO,e),{classNames:r,className:o,style:i,styles:s,vars:l,icon:c,...u}=n,d=Qf(),f=c;return C.createElement(G,{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)"}}))});Kf.classes=Fc;Kf.displayName="@mantine/core/PaginationDots";function Yf({icon:e,name:t,action:n,type:r}){const o={icon:e},i=m.forwardRef((s,l)=>{const{icon:c,...u}=H(t,o,s),d=c,f=Qf(),h=r==="next"?f.active===f.total:f.active===1;return C.createElement(zc,{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 uP=Yf({icon:dO,name:"PaginationNext",action:"onNext",type:"next"}),dP=Yf({icon:fO,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),fP=Yf({icon:hO,name:"PaginationFirst",action:"onFirst",type:"previous"}),hP=Yf({icon:mO,name:"PaginationLast",action:"onLast",type:"next"});function Ey({dotsIcon:e}){const t=Qf(),n=t.range.map((r,o)=>{var i;return r==="dots"?C.createElement(Kf,{icon:e,key:o}):C.createElement(zc,{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)}Ey.displayName="@mantine/core/PaginationItems";const vO={siblings:1,boundaries:1},yO=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ct(n),"--pagination-control-size":Ne(t,"pagination-control-size"),"--pagination-control-fz":nn(t),"--pagination-active-bg":r?bt(r,e):void 0,"--pagination-active-color":jc(o,e)?ps({color:r,theme:e}):void 0}}),Xf=K((e,t)=>{const n=H("PaginationRoot",vO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:p,siblings:g,boundaries:v,color:S,radius:y,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:j,getItemProps:E,autoContrast:T,...P}=n,_=de({name:"Pagination",classes:Fc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:yO}),{range:D,setPage:$,next:I,previous:L,active:F,first:O,last:A}=a_({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),R=Xn(x,I),k=Xn(w,L),M=Xn(b,O),B=Xn(j,A);return C.createElement(cO,{value:{total:u,range:D,active:F,disabled:p,getItemProps:E,onChange:$,onNext:R,onPrevious:k,onFirst:M,onLast:B,getStyles:_}},C.createElement(G,{ref:t,..._("root"),...P}))});Xf.classes=Fc;Xf.displayName="@mantine/core/PaginationRoot";const xO={withControls:!0,siblings:1,boundaries:1,gap:8},Wr=K((e,t)=>{const n=H("Pagination",xO,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:s,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,...p}=n;return f<=0?null:C.createElement(Xf,{ref:t,total:f,...p},C.createElement(Z,{gap:h},r&&C.createElement(fP,{icon:u,...i==null?void 0:i("first")}),o&&C.createElement(dP,{icon:l,...i==null?void 0:i("previous")}),C.createElement(Ey,{dotsIcon:d}),o&&C.createElement(uP,{icon:s,...i==null?void 0:i("next")}),r&&C.createElement(hP,{icon:c,...i==null?void 0:i("last")})))});Wr.classes=Fc;Wr.displayName="@mantine/core/Pagination";Wr.Root=Xf;Wr.Control=zc;Wr.Dots=Kf;Wr.First=fP;Wr.Last=hP;Wr.Next=uP;Wr.Previous=dP;Wr.Items=Ey;const wO=({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 Mp={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const SO={visibilityToggleIcon:wO},bO=(e,{size:t})=>({root:{"--psi-icon-size":Ne(t,"psi-icon-size"),"--psi-button-size":Ne(t,"psi-button-size")}}),$r=K((e,t)=>{const n=H("PasswordInput",SO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:p,variant:g,inputContainer:v,description:S,label:y,size:x,errorProps:w,descriptionProps:b,labelProps:j,withAsterisk:E,inputWrapperOrder:T,wrapperProps:P,radius:_,rightSection:D,rightSectionWidth:$,rightSectionPointerEvents:I,leftSectionWidth:L,visible:F,defaultVisible:O,onVisibilityChange:A,visibilityToggleIcon:R,visibilityToggleButtonProps:k,rightSectionProps:M,leftSectionProps:B,leftSectionPointerEvents:U,mod:X,...re}=n,fe=In(p),[Ce,Te]=fn({value:F,defaultValue:O,finalValue:!1,onChange:A}),Ae=()=>Te(!Ce),pe=de({name:"PasswordInput",classes:Mp,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:bO}),{resolvedClassNames:He,resolvedStyles:ct}=Ec({classNames:r,styles:s,props:n}),{styleProps:We,rest:be}=No(re),ze=R,$e=C.createElement(Zt,{...pe("visibilityToggle"),disabled:h,radius:_,"aria-hidden":!k,tabIndex:-1,...k,variant:"subtle",color:"gray",unstyled:l,onMouseDown:Y=>{var oe;Y.preventDefault(),(oe=k==null?void 0:k.onMouseDown)==null||oe.call(k,Y),Ae()},onKeyDown:Y=>{var oe;(oe=k==null?void 0:k.onKeyDown)==null||oe.call(k,Y),Y.key===" "&&(Y.preventDefault(),Ae())}},C.createElement(ze,{reveal:Ce}));return C.createElement(Rt.Wrapper,{required:u,id:fe,label:y,error:d,description:S,size:x,classNames:He,styles:ct,__staticSelector:"PasswordInput",errorProps:w,descriptionProps:b,unstyled:l,withAsterisk:E,inputWrapperOrder:T,inputContainer:v,variant:g,labelProps:{...j,htmlFor:fe},mod:X,...pe("root"),...We,...P},C.createElement(Rt,{component:"div",error:d,leftSection:f,size:x,classNames:{...He,input:it(Mp.input,He.input)},styles:ct,radius:_,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:$,rightSection:D??$e,variant:g,unstyled:l,leftSectionWidth:L,rightSectionPointerEvents:I||"all",rightSectionProps:M,leftSectionProps:B,leftSectionPointerEvents:U,withAria:!1},C.createElement("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...pe("innerInput"),disabled:h,id:fe,ref:t,...be,autoComplete:be.autoComplete||"off",type:Ce?"text":"password"})))});$r.classes={...Qn.classes,...Mp};$r.displayName="@mantine/core/PasswordInput";const[CO,EO]=Cc(),jO={},jy=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,name:c,readOnly:u,...d}=H("RadioGroup",jO,e),f=In(c),[h,p]=fn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&p(v.currentTarget.value);return C.createElement(CO,{value:{value:h,onChange:g,size:i,name:f}},C.createElement(Rt.Wrapper,{size:i,ref:t,...s,...d,labelElement:"div",__staticSelector:"RadioGroup"},C.createElement(ey,{role:"radiogroup"},l)))});jy.classes=Rt.Wrapper.classes;jy.displayName="@mantine/core/RadioGroup";function PO({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:V(e),height:V(e),...t},"aria-hidden":!0,...n},C.createElement("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"}))}var mP={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const TO={labelPosition:"right"},kO=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:s})=>{const l=lo({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":Ne(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ct(n),"--radio-color":i==="outline"?c:bt(r,e),"--radio-icon-color":o?bt(o,e):jc(s,e)?ps({color:r,theme:e}):void 0,"--radio-icon-size":Ne(t,"radio-icon-size")}}},dc=K((e,t)=>{const n=H("Radio",TO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:p,error:g,radius:v,color:S,variant:y,disabled:x,wrapperProps:w,icon:b=PO,rootRef:j,iconColor:E,onChange:T,mod:P,..._}=n,D=de({name:"Radio",classes:mP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:kO}),$=EO(),I=($==null?void 0:$.size)??d,L=n.size?d:I,{styleProps:F,rest:O}=No(_),A=In(u),R=$?{checked:$.value===O.value,name:O.name??$.name,onChange:k=>{$.onChange(k),T==null||T(k)}}:{};return C.createElement(Nf,{...D("root"),__staticSelector:"Radio",__stylesApiProps:n,id:A,size:L,labelPosition:h,label:f,description:p,error:g,disabled:x,classNames:r,styles:s,unstyled:l,"data-checked":R.checked||void 0,variant:y,ref:j,mod:P,...F,...w},C.createElement(G,{...D("inner"),mod:{"label-position":h}},C.createElement(G,{...D("radio",{focusable:!0,variant:y}),onChange:T,...O,...R,component:"input",mod:{error:!!g},ref:t,id:A,disabled:x,type:"radio"}),C.createElement(b,{...D("icon"),"aria-hidden":!0})))});dc.classes=mP;dc.displayName="@mantine/core/Radio";dc.Group=jy;const RO={duration:100,transition:"fade"};function _O(e,t){return{...RO,...t,...e}}function DO({offset:e,position:t}){const[n,r]=m.useState(!1),o=m.useRef(),{x:i,y:s,elements:l,refs:c,update:u,placement:d}=Iv({placement:t,middleware:[kv({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,p=m.useCallback(({clientX:g,clientY:v})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:g,y:v,left:g+f,top:v+h,right:g,bottom:v}}})},[l.reference]);return m.useEffect(()=>{if(c.floating.current){const g=o.current;g.addEventListener("mousemove",p);const v=So(c.floating.current);return v.forEach(S=>{S.addEventListener("scroll",u)}),()=>{g.removeEventListener("mousemove",p),v.forEach(S=>{S.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,p,n]),{handleMouseMove:p,x:i,y:s,opened:n,setOpened:r,boundaryRef:o,floating:c.setFloating}}var Jf={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const IO={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Ur("popover")},AO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ct(t),"--tooltip-bg":n?bt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Py=K((e,t)=>{const n=H("TooltipFloating",IO,e),{children:r,refProp:o,withinPortal:i,style:s,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:p,offset:g,position:v,multiline:S,zIndex:y,disabled:x,variant:w,vars:b,portalProps:j,...E}=n,T=Nt(),P=de({name:"TooltipFloating",props:n,classes:Jf,className:l,style:s,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:b,varsResolver:AO}),{handleMouseMove:_,x:D,y:$,opened:I,boundaryRef:L,floating:F,setOpened:O}=DO({offset:g,position:v});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 A=Kt(L,r.ref,t),R=M=>{var B,U;(U=(B=r.props).onMouseEnter)==null||U.call(B,M),_(M),O(!0)},k=M=>{var B,U;(U=(B=r.props).onMouseLeave)==null||U.call(B,M),O(!1)};return C.createElement(C.Fragment,null,C.createElement(xs,{...j,withinPortal:i},C.createElement(G,{...E,...P("tooltip",{style:{...wb(s,T),zIndex:y,display:!x&&I?"block":"none",top:($&&Math.round($))??"",left:(D&&Math.round(D))??""}}),variant:w,ref:F,mod:{multiline:S}},p)),m.cloneElement(r,{...r.props,[o]:A,onMouseEnter:R,onMouseLeave:k}))});Py.classes=Jf;Py.displayName="@mantine/core/TooltipFloating";const pP=m.createContext(!1),NO=pP.Provider,OO=()=>m.useContext(pP),MO={openDelay:0,closeDelay:0};function gP(e){const{openDelay:t,closeDelay:n,children:r}=H("TooltipGroup",MO,e);return C.createElement(NO,{value:!0},C.createElement(UN,{delay:{open:t,close:n}},r))}gP.displayName="@mantine/core/TooltipGroup";function $O(e){var E,T,P;const[t,n]=m.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=OO(),s=In(),{delay:l,currentId:c,setCurrentId:u}=rj(),d=m.useCallback(_=>{n(_),_&&u(s)},[u,s]),{x:f,y:h,context:p,refs:g,update:v,placement:S,middlewareData:{arrow:{x:y,y:x}={}}}=Iv({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[WE(e.offset),kv({padding:8}),Dp(),JE({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[Ip()]:[]]}),{getReferenceProps:w,getFloatingProps:b}=KN([BN(p,{enabled:(E=e.events)==null?void 0:E.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((T=e.events)!=null&&T.touch)}),QN(p,{enabled:(P=e.events)==null?void 0:P.focus,visibleOnly:!0}),XN(p,{role:"tooltip"}),GN(p,{enabled:typeof e.opened>"u"}),HN(p,{id:s})]);uj({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Co(()=>{var _;(_=e.onPositionChange)==null||_.call(e,S)},[S]);const j=o&&c&&c!==s;return{x:f,y:h,arrowX:y,arrowY:x,reference:g.setReference,floating:g.setFloating,getFloatingProps:b,getReferenceProps:w,isGroupPhase:j,opened:o,placement:S}}const rw={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:Ur("popover"),positionDependencies:[]},LO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ct(t),"--tooltip-bg":n?bt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Ya=K((e,t)=>{const n=H("Tooltip",rw,e),{children:r,position:o,refProp:i,label:s,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,withinPortal:f,radius:h,color:p,classNames:g,styles:v,unstyled:S,style:y,className:x,withArrow:w,arrowSize:b,arrowOffset:j,arrowRadius:E,arrowPosition:T,offset:P,transitionProps:_,multiline:D,events:$,zIndex:I,disabled:L,positionDependencies:F,onClick:O,onMouseEnter:A,onMouseLeave:R,inline:k,variant:M,keepMounted:B,vars:U,portalProps:X,mod:re,floatingStrategy:fe,...Ce}=H("Tooltip",rw,n),{dir:Te}=Va(),Ae=m.useRef(null),pe=$O({position:oj(Te,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,events:$,arrowRef:Ae,arrowOffset:j,offset:typeof P=="number"?P+(w?b/2:0):P,positionDependencies:[...F,r],inline:k,strategy:fe}),He=de({name:"Tooltip",props:n,classes:Jf,className:x,style:y,classNames:g,styles:v,unstyled:S,rootSelector:"tooltip",vars:U,varsResolver:LO});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 ct=Kt(pe.reference,r.ref,t),We=_O(_,{duration:100,transition:"fade"});return C.createElement(C.Fragment,null,C.createElement(xs,{...X,withinPortal:f},C.createElement($o,{...We,keepMounted:B,mounted:!L&&!!pe.opened,duration:pe.isGroupPhase?10:We.duration},be=>C.createElement(G,{...Ce,variant:M,mod:[{multiline:D},re],...pe.getFloatingProps({ref:pe.floating,className:He("tooltip").className,style:{...He("tooltip").style,...be,zIndex:I,top:pe.y??0,left:pe.x??0}})},s,C.createElement(Av,{ref:Ae,arrowX:pe.arrowX,arrowY:pe.arrowY,visible:w,position:pe.placement,arrowSize:b,arrowOffset:j,arrowRadius:E,arrowPosition:T,...He("arrow")})))),m.cloneElement(r,pe.getReferenceProps({onClick:O,onMouseEnter:A,onMouseLeave:R,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:ct,className:it(x,r.props.className),...r.props})))});Ya.classes=Jf;Ya.displayName="@mantine/core/Tooltip";Ya.Floating=Py;Ya.Group=gP;function FO({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 vP({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=Nt();return C.createElement(Ya.Floating,{disabled:!c,label:c},C.createElement(G,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":s?bt(s,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...FO({sum:r,size:e,thickness:o,value:t,offset:n,root:i})}))}vP.displayName="@mantine/core/Curve";function zO({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 yP={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function VO(e,t){return Math.min(e||12,(t||120)/4)}const BO={size:120,thickness:12},UO=(e,{size:t,thickness:n})=>({root:{"--rp-size":V(t),"--rp-label-offset":V(n*2)}}),Zf=K((e,t)=>{const n=H("RingProgress",BO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:p,rootColor:g,...v}=n,S=de({name:"RingProgress",classes:yP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:UO}),y=VO(h,f),x=zO({size:f,thickness:y,sections:d,renderRoundedLineCaps:p,rootColor:g}).map(({data:w,sum:b,root:j,lineRoundCaps:E,offset:T},P)=>C.createElement(vP,{...w,key:P,size:f,thickness:y,sum:b,offset:T,color:w==null?void 0:w.color,root:j,lineRoundCaps:E,getStyles:S}));return C.createElement(G,{...S("root"),size:f,ref:t,...v},C.createElement("svg",{...S("svg")},x),u&&C.createElement("div",{...S("label")},u))});Zf.classes=yP;Zf.displayName="@mantine/core/RingProgress";var xP={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const HO={withItemsBorders:!0},WO=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:Ct(t),"--sc-color":n?bt(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":Ne(o,"sc-padding"),"--sc-font-size":nn(o)}}),Ty=K((e,t)=>{var Te,Ae;const n=H("SegmentedControl",HO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:p,name:g,disabled:v,readOnly:S,fullWidth:y,orientation:x,radius:w,color:b,transitionDuration:j,transitionTimingFunction:E,variant:T,autoContrast:P,withItemsBorders:_,mod:D,...$}=n,I=de({name:"SegmentedControl",props:n,classes:xP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:WO}),L=Nt(),F=u.map(pe=>typeof pe=="string"?{label:pe,value:pe}:pe),O=d_(),[A,R]=m.useState(null),[k,M]=m.useState({}),B=(pe,He)=>{k[He]=pe,M(k)},[U,X]=fn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((Te=F.find(pe=>!pe.disabled))==null?void 0:Te.value)??((Ae=u[0])==null?void 0:Ae.value)??null:null,onChange:h}),re=In(g),fe=F.map(pe=>C.createElement(G,{...I("control"),mod:{active:U===pe.value,orientation:x},key:pe.value},C.createElement("input",{...I("input"),disabled:v||pe.disabled,type:"radio",name:re,value:pe.value,id:`${re}-${pe.value}`,checked:U===pe.value,onChange:()=>!S&&X(pe.value),"data-focus-ring":L.focusRing}),C.createElement(G,{component:"label",...I("label"),mod:{active:U===pe.value&&!(v||pe.disabled),disabled:v||pe.disabled,"read-only":S},htmlFor:`${re}-${pe.value}`,ref:He=>B(He,pe.value),__vars:{"--sc-label-color":b!==void 0?ps({color:b,theme:L,autoContrast:P}):void 0}},C.createElement("span",{...I("innerLabel")},pe.label)))),Ce=Kt(t,pe=>R(pe));return u.length===0?null:C.createElement(G,{...I("root"),variant:T,size:p,ref:Ce,mod:[{"full-width":y,orientation:x,initialized:O,"with-items-borders":_},D],...$,role:"radiogroup"},typeof U=="string"&&C.createElement(Lv,{target:k[U],parent:A,component:"span",transitionDuration:"var(--sc-transition-duration)",...I("indicator")}),fe)});Ty.classes=xP;Ty.displayName="@mantine/core/SegmentedControl";function qO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=Nt(),i=t===void 0?e:t,s=ms({"--sg-spacing-x":ln(oi(e)),"--sg-spacing-y":ln(oi(i)),"--sg-cols":(d=oi(n))==null?void 0:d.toString()}),l=St(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=ln(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=ln(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=Vl(St(l),o).filter(f=>St(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return C.createElement(za,{styles:s,media:u,selector:r})}var wP={root:"m_2415a157"};const GO={cols:1,spacing:"md"},ky=K((e,t)=>{const n=H("SimpleGrid",GO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,...h}=n,p=de({name:"SimpleGrid",classes:wP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c}),g=Pc();return C.createElement(C.Fragment,null,C.createElement(qO,{...n,selector:`.${g}`}),C.createElement(G,{ref:t,...p("root",{className:g}),...h}))});ky.classes=wP;ky.displayName="@mantine/core/SimpleGrid";const QO={},eh=K((e,t)=>{const{w:n,h:r,miw:o,mih:i,...s}=H("Space",QO,e);return C.createElement(G,{ref:t,...s,w:n,miw:o??n,h:r,mih:i??r})});eh.displayName="@mantine/core/Space";var SP={root:"m_6d731127"};const KO={gap:"md",align:"stretch",justify:"flex-start"},YO=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":ln(t),"--stack-align":n,"--stack-justify":r}}),Ie=K((e,t)=>{const n=H("Stack",KO,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...p}=n,g=de({name:"Stack",props:n,classes:SP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:YO});return C.createElement(G,{ref:t,...g("root"),variant:h,...p})});Ie.classes=SP;Ie.displayName="@mantine/core/Stack";const[XO,JO]=Dn("Stepper component was not found in tree"),Vd=()=>null;Vd.displayName="@mantine/core/StepperCompleted";var Ry={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 Lu=(e,t)=>typeof e=="function"?C.createElement(e,{step:t||0}):e,ZO={withIcon:!0,allowStepClick:!0,iconPosition:"left"},_y=K((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:p,description:g,withIcon:v,iconSize:S,loading:y,allowStepClick:x,allowStepSelect:w,iconPosition:b,orientation:j,mod:E,...T}=H("StepperStep",ZO,e),P=JO(),_=Nt(),D={classNames:n,styles:i},$=c==="stepCompleted"?null:c==="stepProgress"?h:d,I={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return C.createElement(kn,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...D}),mod:[{"icon-position":b||P.iconPosition,"allow-click":x},E],ref:t,...I,...T,__vars:{"--step-color":u?bt(u,_):void 0},tabIndex:x?0:-1},v&&C.createElement("span",{...P.getStyles("stepWrapper",D)},C.createElement("span",{...P.getStyles("stepIcon",D),...I},C.createElement($o,{mounted:c==="stepCompleted",transition:"pop",duration:200},L=>C.createElement("span",{...P.getStyles("stepCompletedIcon",{style:L,...D})},y?C.createElement(qn,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",D)}):Lu(f,l)||C.createElement(Of,{size:"60%"}))),c!=="stepCompleted"?y?C.createElement(qn,{...P.getStyles("stepLoader",D),size:"calc(var(--stepper-icon-size) / 2)",color:u}):Lu($||d,l):null),j==="vertical"&&C.createElement("span",{...P.getStyles("verticalSeparator",D),"data-active":c==="stepCompleted"||void 0})),(p||g)&&C.createElement("span",{...P.getStyles("stepBody",D),"data-orientation":P.orientation,"data-icon-position":b||P.iconPosition},p&&C.createElement("span",{...P.getStyles("stepLabel",D)},Lu(p,l)),g&&C.createElement("span",{...P.getStyles("stepDescription",D)},Lu(g,l))))});_y.classes=Ry;_y.displayName="@mantine/core/StepperStep";const eM={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},tM=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:s})=>({root:{"--stepper-color":t?bt(t,e):void 0,"--stepper-icon-color":jc(s,e)?ps({color:t,theme:e}):void 0,"--stepper-icon-size":n===void 0?Ne(r,"stepper-icon-size"):V(n),"--stepper-content-padding":ln(o),"--stepper-radius":i===void 0?void 0:Ct(i),"--stepper-fz":nn(r),"--stepper-spacing":ln(r)}}),Ia=K((e,t)=>{var R,k,M;const n=H("Stepper",eM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:p,progressIcon:g,color:v,iconSize:S,contentPadding:y,orientation:x,iconPosition:w,size:b,radius:j,allowNextStepsSelect:E,wrap:T,...P}=n,_=de({name:"Stepper",classes:Ry,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:tM}),D=m.Children.toArray(u),$=D.filter(B=>B.type!==Vd),I=D.find(B=>B.type===Vd),L=$.reduce((B,U,X)=>{const re=f===X?"stepProgress":f>X?"stepCompleted":"stepInactive",Ce=typeof d!="function"?!1:typeof U.props.allowStepSelect=="boolean"?U.props.allowStepSelect:re==="stepCompleted"||E;return B.push(m.cloneElement(U,{icon:U.props.icon||h||X+1,key:X,step:X,state:re,onClick:()=>Ce&&(d==null?void 0:d(X)),allowStepClick:Ce,completedIcon:U.props.completedIcon||p,progressIcon:U.props.progressIcon||g,color:U.props.color||v,iconSize:S,radius:j,iconPosition:U.props.iconPosition||w,orientation:x,unstyled:l})),x==="horizontal"&&X!==$.length-1&&B.push(C.createElement("div",{..._("separator"),"data-active":X<f||void 0,"data-orientation":x,key:`separator-${X}`})),B},[]),F=(k=(R=$[f])==null?void 0:R.props)==null?void 0:k.children,O=(M=I==null?void 0:I.props)==null?void 0:M.children,A=f>$.length-1?O:F;return C.createElement(XO,{value:{getStyles:_,orientation:x,iconPosition:w}},C.createElement(G,{..._("root"),ref:t,size:b,...P},C.createElement(G,{..._("steps"),mod:{orientation:x,"icon-position":w,wrap:T&&x!=="vertical"}},L),A&&C.createElement("div",{..._("content")},A)))});Ia.classes=Ry;Ia.displayName="@mantine/core/Stepper";Ia.Completed=Vd;Ia.Step=_y;const bP=m.createContext(null),nM=bP.Provider,rM=()=>m.useContext(bP),oM={},Dy=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:s,children:l,readOnly:c,...u}=H("SwitchGroup",oM,e),[d,f]=fn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=p=>{const g=p.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return C.createElement(nM,{value:{value:d,onChange:h,size:i}},C.createElement(Rt.Wrapper,{size:i,ref:t,...s,...u,labelElement:"div",__staticSelector:"SwitchGroup"},C.createElement(ey,{role:"group"},l)))});Dy.classes=Rt.Wrapper.classes;Dy.displayName="@mantine/core/SwitchGroup";var CP={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const iM={labelPosition:"right"},sM=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ct(t),"--switch-height":Ne(r,"switch-height"),"--switch-width":Ne(r,"switch-width"),"--switch-thumb-size":Ne(r,"switch-thumb-size"),"--switch-label-font-size":Ne(r,"switch-label-font-size"),"--switch-track-label-padding":Ne(r,"switch-track-label-padding"),"--switch-color":n?bt(n,e):void 0}}),Bc=K((e,t)=>{const n=H("Switch",iM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:p,size:g,radius:v,wrapperProps:S,children:y,thumbIcon:x,checked:w,defaultChecked:b,onChange:j,labelPosition:E,description:T,error:P,disabled:_,variant:D,rootRef:$,mod:I,...L}=n,F=rM(),O=g||(F==null?void 0:F.size),A=de({name:"Switch",props:n,classes:CP,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:sM}),{styleProps:R,rest:k}=No(L),M=In(p),B=F?{checked:F.value.includes(k.value),onChange:F.onChange}:{},[U,X]=fn({value:B.checked??w,defaultValue:b,finalValue:!1});return C.createElement(Nf,{...A("root"),__staticSelector:"Switch",__stylesApiProps:n,id:M,size:O,labelPosition:E,label:d,description:T,error:P,disabled:_,bodyElement:"label",labelElement:"span",classNames:r,styles:s,unstyled:l,"data-checked":B.checked||void 0,variant:D,ref:$,mod:I,...R,...S},C.createElement("input",{...k,disabled:_,checked:U,onChange:re=>{var fe;F?(fe=B.onChange)==null||fe.call(B,re):j==null||j(re),X(re.currentTarget.checked)},id:M,ref:t,type:"checkbox",role:"switch",...A("input")}),C.createElement(G,{"aria-hidden":"true",mod:{error:P,"label-position":E},...A("track")},C.createElement(G,{component:"span",mod:"reduce-motion",...A("thumb")},x),C.createElement("span",{...A("trackLabel")},U?h:f)))});Bc.classes={...CP,...Oj};Bc.displayName="@mantine/core/Switch";Bc.Group=Dy;const[aM,lM]=Dn("Table component was not found in the tree");var Uc={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 cM(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 Cs(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=K((o,i)=>{const s=H(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=s,h=lM();return C.createElement(G,{component:e,ref:i,...cM(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:s}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=Uc,r}const $p=Cs("th",{columnBorder:!0}),EP=Cs("td",{columnBorder:!0}),sd=Cs("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),jP=Cs("thead",{stickyHeader:!0}),PP=Cs("tbody"),TP=Cs("tfoot"),kP=Cs("caption",{captionSide:!0});function Iy({data:e}){return C.createElement(C.Fragment,null,e.caption&&C.createElement(kP,null,e.caption),e.head&&C.createElement(jP,null,C.createElement(sd,null,e.head.map((t,n)=>C.createElement($p,{key:n},t)))),e.body&&C.createElement(PP,null,e.body.map((t,n)=>C.createElement(sd,{key:n},t.map((r,o)=>C.createElement(EP,{key:o},r))))),e.foot&&C.createElement(TP,null,C.createElement(sd,null,e.foot.map((t,n)=>C.createElement($p,{key:n},t)))))}Iy.displayName="@mantine/core/TableDataRenderer";const uM={type:"scrollarea"},dM=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":V(t),"--table-overflow":n==="native"?"auto":void 0}}),Ay=K((e,t)=>{const n=H("TableScrollContainer",uM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,p=de({name:"TableScrollContainer",classes:Uc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:dM,rootSelector:"scrollContainer"});return C.createElement(G,{component:f==="scrollarea"?br:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...p("scrollContainer"),...h},C.createElement("div",{...p("scrollContainerInner")},u))});Ay.classes=Uc;Ay.displayName="@mantine/core/TableScrollContainer";const fM={withRowBorders:!0,verticalSpacing:7},hM=(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":ln(r),"--table-vertical-spacing":ln(o),"--table-border-color":i?bt(i,e):void 0,"--table-striped-color":c&&s?bt(s,e):void 0,"--table-highlight-on-hover-color":u&&l?bt(l,e):void 0,"--table-sticky-header-offset":f?V(d):void 0}}),le=K((e,t)=>{const n=H("Table",fM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:p,striped:g,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,withTableBorder:x,borderColor:w,layout:b,variant:j,data:E,children:T,stickyHeader:P,stickyHeaderOffset:_,mod:D,...$}=n,I=de({name:"Table",props:n,className:o,style:i,classes:Uc,classNames:r,styles:s,unstyled:l,rootSelector:"table",vars:c,varsResolver:hM});return C.createElement(aM,{value:{getStyles:I,stickyHeader:P,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,captionSide:f||"bottom"}},C.createElement(G,{component:"table",variant:j,ref:t,mod:[{"data-with-table-border":x},D],...I("table"),...$},T||!!E&&C.createElement(Iy,{data:E})))});le.classes=Uc;le.displayName="@mantine/core/Table";le.Td=EP;le.Th=$p;le.Tr=sd;le.Thead=jP;le.Tbody=PP;le.Tfoot=TP;le.Caption=kP;le.ScrollContainer=Ay;le.DataRenderer=Iy;const[mM,Ny]=Dn("Tabs component was not found in the tree");var Hc={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 pM={},Oy=K((e,t)=>{const n=H("TabsList",pM,e),{children:r,className:o,grow:i,justify:s,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Ny();return C.createElement(G,{...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)});Oy.classes=Hc;Oy.displayName="@mantine/core/TabsList";const gM={},My=K((e,t)=>{const n=H("TabsPanel",gM,e),{children:r,className:o,value:i,classNames:s,styles:l,style:c,mod:u,...d}=n,f=Ny(),h=f.value===i,p=f.keepMounted||n.keepMounted||h?r:null;return C.createElement(G,{...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)},p)});My.classes=Hc;My.displayName="@mantine/core/TabsPanel";const vM={},$y=K((e,t)=>{const n=H("TabsTab",vM,e),{className:r,children:o,rightSection:i,leftSection:s,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:p,styles:g,vars:v,mod:S,...y}=n,x=Nt(),{dir:w}=Va(),b=Ny(),j=l===b.value,E=P=>{b.onChange(b.allowTabDeactivation&&l===b.value?null:l),c==null||c(P)},T={classNames:p,styles:g,props:n};return C.createElement(kn,{...y,...b.getStyles("tab",{className:r,style:h,variant:b.variant,...T}),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?bt(f,x):void 0},onKeyDown:rb({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",T),"data-position":"left"},s),o&&C.createElement("span",{...b.getStyles("tabLabel",T)},o),i&&C.createElement("span",{...b.getStyles("tabSection",T),"data-position":"right"},i))});$y.classes=Hc;$y.displayName="@mantine/core/TabsTab";const ow="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",yM={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},xM=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ct(t),"--tabs-color":bt(n,e),"--tabs-text-color":jc(r,e)?ps({color:n,theme:e}):void 0}}),et=K((e,t)=>{const n=H("Tabs",yM,e),{defaultValue:r,value:o,onChange:i,orientation:s,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:p,radius:g,inverted:v,placement:S,keepMounted:y,classNames:x,styles:w,unstyled:b,className:j,style:E,vars:T,autoContrast:P,mod:_,...D}=n,$=In(u),[I,L]=fn({value:o,defaultValue:r,finalValue:null,onChange:i}),F=de({name:"Tabs",props:n,classes:Hc,className:j,style:E,classNames:x,styles:w,unstyled:b,vars:T,varsResolver:xM});return C.createElement(mM,{value:{placement:S,value:I,orientation:s,id:$,loop:c,activateTabWithKeyboard:d,getTabId:X0(`${$}-tab`,ow),getPanelId:X0(`${$}-panel`,ow),onChange:L,allowTabDeactivation:f,variant:h,color:p,radius:g,inverted:v,keepMounted:y,unstyled:b,getStyles:F}},C.createElement(G,{ref:t,id:$,variant:h,mod:[{orientation:s,inverted:s==="horizontal"&&v,placement:s==="vertical"&&S},_],...F("root"),...D},l))});et.classes=Hc;et.displayName="@mantine/core/Tabs";et.Tab=$y;et.Panel=My;et.List=Oy;const wM={},ue=K((e,t)=>{const n=H("TextInput",wM,e);return C.createElement(Qn,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ue.classes=Qn.classes;ue.displayName="@mantine/core/TextInput";var RP={root:"m_7341320d"};const SM={},bM=(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":Ne(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ct(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}}},Ly=K((e,t)=>{const n=H("ThemeIcon",SM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,autoContrast:u,...d}=n,f=de({name:"ThemeIcon",classes:RP,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:bM});return C.createElement(G,{ref:t,...f("root"),...d})});Ly.classes=RP;Ly.displayName="@mantine/core/ThemeIcon";const CM=["h1","h2","h3","h4","h5","h6"];function EM(e,t){const n=t!==void 0?t:`h${e}`;return CM.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:V(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var _P={root:"m_8a5d1357"};const jM={order:1},PM=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=EM(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}}},me=K((e,t)=>{const n=H("Title",jM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:p,mod:g,...v}=n,S=de({name:"Title",props:n,classes:_P,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:u,varsResolver:PM});return[1,2,3,4,5,6].includes(c)?C.createElement(G,{...S("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...v}):null});me.classes=_P;me.displayName="@mantine/core/Title";function TM(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 kM(e){return m.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const RM=()=>TM({notifications:[],queue:[],limit:5}),Es=RM(),_M=(e=Es)=>kM(e);function Xa(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 ve(e,t=Es){const n=e.id||wg();return Xa(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function DP(e,t=Es){return Xa(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function kl(e,t=Es){return Xa(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function DM(e=Es){Xa(e,()=>[])}function IM(e=Es){Xa(e,t=>t.slice(0,e.getState().limit))}const io={show:ve,hide:DP,update:kl,clean:DM,cleanQueue:IM,updateState:Xa};function Lp(e,t){return Lp=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},Lp(e,t)}function IP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Lp(e,t)}var AP={exports:{}},AM="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",NM=AM,OM=NM;function NP(){}function OP(){}OP.resetWarningCache=NP;var MM=function(){function e(r,o,i,s,l,c){if(c!==OM){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:OP,resetWarningCache:NP};return n.PropTypes=n,n};AP.exports=MM();var $M=AP.exports;const ht=fg($M),iw={disabled:!1},Bd=C.createContext(null);var LM=function(t){return t.scrollTop},Rl="unmounted",Li="exited",Fi="entering",Ws="entered",Fp="exiting",zo=function(e){IP(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=Li,i.appearStatus=Fi):c=Ws:r.unmountOnExit||r.mountOnEnter?c=Rl:c=Li,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var s=o.in;return s&&i.status===Rl?{status:Li}: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!==Fi&&s!==Ws&&(i=Fi):(s===Fi||s===Ws)&&(i=Fp)}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===Fi){if(this.props.unmountOnExit||this.props.mountOnEnter){var s=this.props.nodeRef?this.props.nodeRef.current:oa.findDOMNode(this);s&&LM(s)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Li&&this.setState({status:Rl})},n.performEnter=function(o){var i=this,s=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[oa.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!s||iw.disabled){this.safeSetState({status:Ws},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Fi},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Ws},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:oa.findDOMNode(this);if(!i||iw.disabled){this.safeSetState({status:Li},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Fp},function(){o.props.onExiting(l),o.onTransitionEnd(s.exit,function(){o.safeSetState({status:Li},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:oa.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===Rl)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=cy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return C.createElement(Bd.Provider,{value:null},typeof s=="function"?s(o,l):C.cloneElement(C.Children.only(s),l))},t}(C.Component);zo.contextType=Bd;zo.propTypes={};function Fs(){}zo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Fs,onEntering:Fs,onEntered:Fs,onExit:Fs,onExiting:Fs,onExited:Fs};zo.UNMOUNTED=Rl;zo.EXITED=Li;zo.ENTERING=Fi;zo.ENTERED=Ws;zo.EXITING=Fp;const FM=zo;function zM(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Fy(e,t){var n=function(i){return t&&m.isValidElement(i)?t(i):i},r=Object.create(null);return e&&m.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function VM(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 Gi(e,t,n){return n[t]!=null?n[t]:e.props[t]}function BM(e,t){return Fy(e.children,function(n){return m.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Gi(n,"appear",e),enter:Gi(n,"enter",e),exit:Gi(n,"exit",e)})})}function UM(e,t,n){var r=Fy(e.children),o=VM(t,r);return Object.keys(o).forEach(function(i){var s=o[i];if(m.isValidElement(s)){var l=i in t,c=i in r,u=t[i],d=m.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=m.cloneElement(s,{onExited:n.bind(null,s),in:!0,exit:Gi(s,"exit",e),enter:Gi(s,"enter",e)}):!c&&l&&!d?o[i]=m.cloneElement(s,{in:!1}):c&&l&&m.isValidElement(u)&&(o[i]=m.cloneElement(s,{onExited:n.bind(null,s),in:u.props.in,exit:Gi(s,"exit",e),enter:Gi(s,"enter",e)}))}}),o}var HM=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},WM={component:"div",childFactory:function(t){return t}},zy=function(e){IP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var s=i.handleExited.bind(zM(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?BM(o,l):UM(o,s,l),firstRender:!1}},n.handleExited=function(o,i){var s=Fy(this.props.children);o.key in s||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=zd({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,s=o.childFactory,l=cy(o,["component","childFactory"]),c=this.state.contextValue,u=HM(this.state.children).map(s);return delete l.appear,delete l.enter,delete l.exit,i===null?C.createElement(Bd.Provider,{value:c},u):C.createElement(Bd.Provider,{value:c},C.createElement(i,l,u))},t}(C.Component);zy.propTypes={};zy.defaultProps=WM;const qM=zy,sw={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},GM={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function QM({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:sw[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:GM[s]},u={opacity:0,maxHeight:0,transform:sw[s]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function KM(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const MP=m.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:s,...l}=e,c=KM(n,e.autoClose),u=m.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return m.useEffect(()=>{var p;(p=e.onOpen)==null||p.call(e,e)},[]),m.useEffect(()=>(h(),d),[c]),C.createElement(Sy,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h},s)});MP.displayName="@mantine/notifications/NotificationContainer";var $P={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const YM=FM,XM={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Ur("overlay"),store:Es,withinPortal:!0},JM=(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":V(r)}}},Vo=K((e,t)=>{const n=H("Notifications",XM,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:p,limit:g,zIndex:v,store:S,portalProps:y,withinPortal:x,...w}=n,b=Nt(),j=_M(S),E=r_(),T=Sg(),P=m.useRef({}),_=m.useRef(0),$=(b.respectReducedMotion?T:!1)?1:f,I=de({name:"Notifications",classes:$P,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:JM});m.useEffect(()=>{S==null||S.updateState(F=>({...F,limit:g||5}))},[g]),Co(()=>{j.notifications.length>_.current&&setTimeout(()=>E(),0),_.current=j.notifications.length},[j.notifications]);const L=j.notifications.map(({style:F,...O})=>C.createElement(YM,{key:O.id,timeout:$,onEnter:()=>P.current[O.id].offsetHeight,nodeRef:{current:P.current[O.id]}},A=>C.createElement(MP,{ref:R=>{P.current[O.id]=R},data:O,onHide:R=>DP(R,S),autoClose:d,...I("notification",{style:{...QM({state:A,position:u,transitionDuration:$,maxHeight:p}),...F}})})));return C.createElement(xs,{withinPortal:x,...y},C.createElement(G,{...I("root"),ref:t,...w},C.createElement(qM,null,L)))});Vo.classes=$P;Vo.displayName="@mantine/notifications/Notifications";Vo.show=io.show;Vo.hide=io.hide;Vo.update=io.update;Vo.clean=io.clean;Vo.cleanQueue=io.cleanQueue;Vo.updateState=io.updateState;class ZM{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Wc{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class e${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 t$(t,this.prefixParselets,this.infixParselets)}}class t${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 n$="http://hl7.org",LP="ok",r$="created",o$="gone",i$="not-modified",s$="not-found",a$="forbidden",l$="accepted",c$={resourceType:"OperationOutcome",id:LP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},u$={resourceType:"OperationOutcome",id:s$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},FP={resourceType:"OperationOutcome",id:a$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function gi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function jt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function d$(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function th(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function zP(e){return e.id===LP||e.id===r$||e.id===i$||e.id===l$}function f$(e){return e.id===o$}class qe extends Error{constructor(t,n){super(VP(t)),this.outcome=t,this.cause=n}}function pt(e){return e instanceof qe?e.outcome:th(e)?e:gi(Oe(e))}function Oe(e){return e?typeof e=="string"?e:e instanceof Error?e.message:th(e)?VP(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function VP(e){var n;const t=((n=e.issue)==null?void 0:n.map(BP))??[];return t.length>0?t.join("; "):"Unknown error"}function BP(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 h$(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 m$(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,h$(o,i)])),constraints:[],innerTypes:[]};return t}const p$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},g$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},v$={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"}]}}},y$={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"}]}}},x$={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"}]}}},w$={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"}]}}},S$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},b$={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"}]}}},C$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},E$={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"}]}}},j$={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"}]}}},P$={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"}]}}},T$={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"}]}}},k$={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"}]}}},R$={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"]}]}}},_$={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"}]}}},D$={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"}]}}},I$={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"}]}}},A$={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"}]}}},N$={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"}]}}},O$={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"]}]}}},M$={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"}]}}},$$={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"}]}}},L$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},F$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},z$={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"]}]}}},V$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},B$={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"}]}}},U$={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"}]}}},H$={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"}]}}},W$={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"}]}}},q$={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"]}]}}},G$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},Q$={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"}]}}},K$={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"]}]}}},Y$={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"}]}}},X$={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"}]}}},J$={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"}]}}},Z$={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"}]}}},eL={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"}]}}},tL={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"]}]}}},nL={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"}]}}},rL={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"}]}}},oL={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"}]}}},iL={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"}]}}},sL={Element:p$,BackboneElement:g$,Address:v$,Age:y$,Annotation:x$,Attachment:w$,CodeableConcept:S$,Coding:b$,ContactDetail:C$,ContactPoint:E$,Contributor:j$,Count:P$,DataRequirement:T$,Distance:k$,Dosage:R$,Duration:_$,ElementDefinition:D$,Expression:I$,Extension:A$,HumanName:N$,Identifier:O$,MarketingStatus:M$,Meta:$$,Money:L$,Narrative:F$,ParameterDefinition:z$,Period:V$,Population:B$,ProdCharacteristic:U$,ProductShelfLife:H$,Quantity:W$,Range:q$,Ratio:G$,Reference:Q$,RelatedArtifact:K$,SampledData:Y$,Signature:X$,SubstanceAmount:J$,Timing:Z$,TriggerDefinition:eL,UsageContext:tL,MoneyQuantity:nL,SimpleQuantity:rL,MetadataResource:oL,IdentityProvider:iL};function aL(e){return new lL(e).parse()}const UP=m$(sL),Vy=Object.create(null),aw=Object.create(null);function zp(e){let t;return e?(t=aw[e],t||(t=aw[e]=Object.create(null))):t=UP,t}function lw(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)HP(o,t)}function HP(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=aL(e),r=zp(t);r[e.name]=n,t&&e.url===t&&(Vy[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function WP(e){return!!UP[e]}function nh(e,t){let n=zp(t)[e];return!n&&t&&(n=zp()[e]),n}function qP(e,t){const n=nh(e,t);if(!n)throw new qe(gi("Unknown data type: "+e));return n}function By(e){return!!Vy[e]}function js(e){return Vy[e]}class lL{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:dL(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=mm(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[mm(t,c.path)]=l;break}c=c.parent}if(!c){const u=mm(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&&!zs((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:vw(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:zs((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;uL(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&&!zs(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&&!zs(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0;this.slicingContext&&!zs(this.slicingContext.path,t==null?void 0:t.path)&&((n=this.slicingContext)!=null&&n.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext=void 0)}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,o,i,s;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const l=t.contentReference.slice(t.contentReference.indexOf("#")+1),c=this.elementIndex[l];return c?{...c,id:t.id,path:t.path,min:t.min??c.min,max:t.max??c.max,base:{path:((n=c.base)==null?void 0:n.path)??l,min:((r=t.base)==null?void 0:r.min)??((o=c.base)==null?void 0:o.min)??c.min,max:((i=t.base)==null?void 0:i.max)??((s=c.base)==null?void 0:s.max)??c.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(zs(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=vw(t)),r||(r=(o=qc(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=cw(t.max),r=(i=t.base)!=null&&i.max?cw(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:uw(dn(o,"fixed[x]")),pattern:uw(dn(o,"pattern[x]")),binding:t.binding}}}function cw(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function mm(e,t=""){return cL(e.path,t)}function cL(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function zs(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function uw(e){return Array.isArray(e)&&e.length>0?e[0]:Vt(e)?void 0:e}function uL(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 dL(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 fL(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?hL:dn,[o,...i]=t.split(".");let s=[r(e,o,n)];for(const l of i){const c=[];for(const u of s)if(Array.isArray(u))for(const d of u)c.push(r(d,l,n));else(n!=null&&n.withPath&&u&&u.value!==void 0||!(n!=null&&n.withPath)&&u!==void 0)&&c.push(r(u,l,n));s=c}return s}function hL(e,t,n){const r=e.path;return mL(dn(e,t,n),r,t)}function mL(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,i)=>({...o,path:`${r}${n}[${i}]`})):{...e,path:`${r}${n}`}}const GP={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 pL(e,t){const n=Array.isArray(e)?e.map(r=>({type:r.type,value:r.value})):{type:e.type,value:e.value};return!(t.pattern&&!Hy(n,t.pattern)||t.fixed&&!Gc(n,t.fixed))}function gL(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(pL(e,o))return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(s=>s.code===e.type)}return!1}function ke(e){return[{type:W.boolean,value:e}]}function co(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:W.integer,value:e}:typeof e=="number"?{type:W.decimal,value:e}:typeof e=="boolean"?{type:W.boolean,value:e}:typeof e=="string"?{type:W.string,value:e}:vr(e)?{type:W.Quantity,value:e}:Bo(e)?{type:e.resourceType,value:e}:{type:W.BackboneElement,value:e}}function ai(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 dn(e,t,n){if(!e.value)return;const r=Ts(e.type,t,n==null?void 0:n.profileUrl);return r?QP(e,t,r):vL(e,t)}function QP(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+Qt(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]=mw(i[c],l[c])}else i=mw(i,l);if(!Vt(i))return(s==="Element"||s==="BackboneElement")&&(s=n.type[0].code),Array.isArray(i)?i.map(c=>dw(c,s)):dw(i,s)}function dw(e,t){return t==="Resource"&&Bo(e)&&(t=e.resourceType),{type:t,value:e}}function vL(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 W){const i=t+Qt(o);if(i in n){r=n[i];break}}if(!Vt(r))return Array.isArray(r)?r.map(co):co(r)}function KP(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(ai(JP(n,o))){r=!0;break}r||t.push(n)}return t}function YP(e){return ke(!ai(e))}function XP(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ke(!1):ke(e.every((n,r)=>ai(JP(n,t[r]))))}function JP(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"?ke(Math.abs(n-r)<1e-8):vr(n)&&vr(r)?ke(tT(n,r)):ke(typeof n=="object"&&typeof r=="object"?Uy(e,t):n===r)}function ZP(e,t){return e.length===0&&t.length===0?ke(!0):e.length!==t.length?ke(!1):(e.sort(fw),t.sort(fw),ke(e.every((n,r)=>ai(yL(n,t[r])))))}function yL(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"?ke(Math.abs(s-l)<.01):vr(s)&&vr(l)?ke(tT(s,l)):ke(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"?Uy({...s,id:void 0},{...l,id:void 0}):typeof s=="string"&&typeof l=="string"?s.toLowerCase()===l.toLowerCase():s===l)}function fw(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 eT(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 xL(n);case"DateTime":return Vp(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return wL(n);case"Quantity":return vr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function xL(e){return typeof e=="string"&&!!GP.date.exec(e)}function Vp(e){return typeof e=="string"&&!!GP.dateTime.exec(e)}function wL(e){return!!(e&&typeof e=="object"&&("start"in e&&Vp(e.start)||"end"in e&&Vp(e.end)))}function vr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function tT(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 Uy(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(hw(i)&&hw(s)){if(!Uy(i,s))return!1}else if(i!==s)return!1}return!0}function hw(e){return e!==null&&typeof e=="object"}function mw(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return SL(e??{},t)}return e}function SL(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function xt(e){const t=wt(e),n=_o(e);return n===t?{reference:t}:{reference:t,display:n}}function wt(e){return ks(e)?e.reference:`${e.resourceType}/${e.id}`}function rh(e){if(e)return ks(e)?e.reference.split("/")[1]:e.id}function bL(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function _o(e){if(bL(e)){const t=CL(e);if(t)return t}if(e.resourceType==="Device"){const t=EL(e);if(t)return t}if(e.resourceType==="MedicationRequest"){const t=e.medicationCodeableConcept;if(t)return bi(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]),NL(t))return bi(t);if(OL(t))return t.text}return wt(e)}function CL(e){const t=e.name;if(t&&t.length>0)return Qc(t[0])}function EL(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function jL(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=pw(n);if(r)return r}else return pw(t)}function pw(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function nT(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 PL(e,t){const{years:n,months:r,days:o}=nT(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 qc(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 or(e,t){return JSON.stringify(e,TL,t?2:void 0)}function TL(e,t){return!kL(e)&&Vt(t)?void 0:t}function kL(e){return!!/\d+$/.exec(e)}function Vt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!zt(e):!1}function zt(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 Gc(e,t,n){return e===t||Vt(e)&&Vt(t)?!0:Vt(e)||Vt(t)?!1:Array.isArray(e)&&Array.isArray(t)?RL(e,t):Array.isArray(e)||Array.isArray(t)?!1:xn(e)&&xn(t)?_L(e,t,n):(xn(e)||xn(t),!1)}function RL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Gc(e[n],t[n]))return!1;return!0}function _L(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(!Gc(i,s,o))return!1}return!0}function Hy(e,t){return Vt(e)?!0:Vt(t)?!1:Array.isArray(e)&&Array.isArray(t)?DL(e,t):Array.isArray(e)||Array.isArray(t)?!1:xn(e)&&xn(t)?IL(e,t):xn(e)||xn(t)?!1:e===t}function DL(e,t){return t.every(n=>e.some(r=>Hy(r,n)))}function IL(e,t){return Object.entries(t).every(([n,r])=>n in e&&Hy(e[n],r))}function uo(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function rT(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function xn(e){return e!==null&&typeof e=="object"}function AL(e){return xn(e)&&"code"in e&&typeof e.code=="string"}function NL(e){return xn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(AL)}function OL(e){return xn(e)&&"text"in e&&typeof e.text=="string"}const oT=[];for(let e=0;e<256;e++)oT.push(e.toString(16).padStart(2,"0"));function ML(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=oT[t[r]];return n.join("")}function $L(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 Qt(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Wy(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function fc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function LL(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 FL(e){if(e)return Array.isArray(e)?e:[e]}const gw=e=>new Promise(t=>{setTimeout(t,e)});function zL(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 VL(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function pl(e,t){return e?(e.push(t),e):[t]}function hc(e){return e.sort((t,n)=>t.localeCompare(n))}function iT(e){return e.endsWith("/")?e:e+"/"}function BL(e){return e.startsWith("/")?e.slice(1):e}function po(e,t){return new URL(BL(t),iT(e.toString())).toString()}function UL(e,t){return po(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function HL(e){return typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)&&(e=Object.fromEntries(Object.entries(e).filter(t=>t[1]!==void 0))),new URLSearchParams(e).toString()}function WL(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 Qc(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=pc(e.text);if(r)return r}return n.join(" ").trim()}function oh(e){return e instanceof Date&&!isNaN(e.getTime())}function qL(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return oh(r)?r.toLocaleTimeString(t,n):""}function Rn(e,t,n){if(!e)return"";const r=new Date(e);return oh(r)?r.toLocaleString(t,n):""}function GL(e,t,n){return!e||!e.start&&!e.end?"":Rn(e.start,t,n)+" - "+Rn(e.end,t,n)}const QL={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},KL={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},YL={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function sT(e){if(!e)return"";const t=[];return XL(t,e.repeat),e.event&&t.push(e.event.map(n=>Rn(n)).join(", ")),Qt(t.join(" ").trim())}function XL(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(QL[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+KL[o]):e.push("per "+r+" "+YL[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Qt).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>qL(i)).join(", "))}function mc(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=e7(r.value,t),`> ${Jo(r,t)}`):`>= ${Jo(r,t)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=ZL(o.value,t),`< ${Jo(o,t)}`):`<= ${Jo(o,t)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${Jo(r,t)} - ${Jo(o,t)}`)}function Jo(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 JL(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function bi(e){if(!e)return"";const t=pc(e.text);return t||(e.coding?e.coding.map(n=>Ps(n)).join(", "):"")}function Ps(e){return pc(e==null?void 0:e.display)??pc(e==null?void 0:e.code)??""}function aT(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Jo(e.valueQuantity));else if(e.valueCodeableConcept)t.push(bi(e.valueCodeableConcept));else{const n=pc(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>aT(n)).join(" / ")),t.join(" / ").trim()}function pc(e){return typeof e=="string"?e:void 0}function ZL(e,t,n=1){return(lT(e,t)+n)*Math.pow(10,-t)}function e7(e,t,n=1){return(lT(e,t)-n)*Math.pow(10,-t)}function lT(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}const W={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 t7(e){for(const t of e.base??[]){let n=Do.types[t];n||(n={searchParamsDetails:{}},Do.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 vw(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"?n7((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function n7(e){return e.length===1?e[0]:e.map(Qt).join("")}function qy(e){var t;return(t=Do.types[e])==null?void 0:t.searchParams}function r7(e,t){var n,r;return(r=(n=Do.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function cs(e){const t=e.replaceAll("[x]","").split(".").pop();return cT(t)}function cT(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(i7).join(" ").replace("_"," ").replace(/\s+/g," ")}const o7=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function i7(e){const t=e.toUpperCase();return e===t?e:o7.has(t)?t:t.charAt(0)+e.slice(1)}function Ts(e,t,n){const r=nh(e,n);if(r)return s7(r.elements,t)}function s7(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 Bo(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function ks(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Do={types:{}};function ad(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 gl=()=>[],$n={empty:(e,t)=>ke(t.length===0||t.every(n=>Vt(n.value))),hasValue:(e,t)=>ke(t.length!==0),exists:(e,t,n)=>ke(n?t.filter(r=>ai(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Vt(r.value))),all:(e,t,n)=>ke(t.every(r=>ai(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return ke(!1);return ke(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return ke(!0);return ke(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return ke(!1);return ke(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return ke(!0);return ke(!1)},subsetOf:gl,supersetOf:gl,count:(e,t)=>[{type:W.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)=>ke(t.length===$n.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ai(n.eval({parent:e,variables:{$this:r}},[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:gl,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 KP([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return[...t,...r]},htmlChecks:(e,t,n)=>[co(!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 ai(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:W.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return ke(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return ke(!0);if(["false","f","no","n","0","0.0"].includes(r))return ke(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ke($n.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return typeof n=="number"?[{type:W.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:W.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:W.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ke($n.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:W.date,value:ad(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ke($n.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:W.dateTime,value:ad(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ke($n.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return typeof n=="number"?[{type:W.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:W.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:W.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ke($n.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return vr(n)?[{type:W.Quantity,value:n}]:typeof n=="number"?[{type:W.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:W.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:W.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ke($n.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Zr(t,1);return n==null?[]:vr(n)?[{type:W.string,value:`${n.value} '${n.unit}'`}]:[{type:W.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ke($n.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:W.time,value:ad("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ke($n.toTime(e,t).length===1),indexOf:(e,t,n)=>cr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>cr((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)=>cr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>cr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>cr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>cr(n=>n.toUpperCase(),e,t),lower:(e,t)=>cr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>cr((o,i,s)=>o.replaceAll(i,s),e,t,n,r),matches:(e,t,n)=>cr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>cr((o,i,s)=>o.replaceAll(i,s),e,t,n,r),length:(e,t)=>cr(n=>n.length,e,t),toChars:(e,t)=>cr(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:gl,descendants:gl,trace:(e,t,n)=>t,now:()=>[{type:W.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:W.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:W.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=$n.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const s=$n.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=nT(i[0].value,s[0].value);return[{type:W.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof Gy?r=n.name:n instanceof Ky&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:W.boolean,value:eT(o,r)})):[]},not:(e,t)=>$n.toBoolean(e,t).map(n=>({type:W.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 co(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:W.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:W.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:W.BackboneElement,value:{namespace:"System",name:"Integer"}}:Bo(n)?{type:W.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:W.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:W.boolean,value:((s=i.value)==null?void 0:s.resourceType)===o}})}};function cr(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(co):[co(i)]}function Yr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Zr(n,1),i=vr(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?W.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 a7{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 Vs{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Gy{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 Bo(n)&&n.resourceType===this.name?t:dn(t,this.name)}toString(){return this.name}}class l7{eval(){return[]}toString(){return"{}"}}class c7 extends ZM{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 Qy extends Wc{constructor(t,n){super("as",t,n)}eval(t,n){return $n.ofType(t,this.left.eval(t,n),this.right)}}class Kn extends Wc{}class kr extends Kn{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=vr(i)?i.value:i,c=vr(s)?s.value:s,u=this.impl(l,c);return typeof u=="boolean"?ke(u):vr(i)?[{type:W.Quantity,value:{...i,value:u}}]:[co(u)]}}class u7 extends Wc{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:W.string,value:i.map(s=>s.value).join("")}]:i}}class d7 extends Kn{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ke(r.some(i=>i.value===o[0].value))}}class f7 extends Kn{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?ke(o.some(i=>i.value===r.value)):[]}}class Ky extends Wc{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 uT extends Wc{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return KP([...r,...o])}}class h7 extends Kn{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 m7 extends Kn{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return YP(XP(r,o))}}class p7 extends Kn{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ZP(r,o)}}class g7 extends Kn{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return YP(ZP(r,o))}}class Yy extends Kn{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 ke(eT(r[0],o))}}class v7 extends Kn{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?ke(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?ke(!1):[]}}class y7 extends Kn{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?ke(!1):r!=null&&r.value||o!=null&&o.value?ke(!0):[]}}class x7 extends Kn{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?[]:ke(r.value!==o.value)}}class w7 extends Kn{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?ke(!0):!r||!o?[]:ke(!1)}}class Xy{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=$n[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 Jy{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 S7=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class b7{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()!==`
|
|
92
|
-
`))}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()===" "&&C7(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()===`
|
|
93
|
-
`?(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 C7(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&S7.includes(e.value)))}const E7=["true","false"],j7=["!=","!~","<=",">=","{}","->"];function P7(e){return new b7(e,E7,j7).tokenize()}const at={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},T7={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}},k7={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Jy(t,n)},precedence:at.Indexer},R7={parse(e,t){if(!(t instanceof Gy))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Xy(t.name,n)},precedence:at.FunctionCall};function _7(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 D7(){return new e$().registerPrefix("String",{parse:(e,t)=>new Vs({type:W.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Vs({type:W.dateTime,value:ad(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Vs({type:W.Quantity,value:_7(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Vs({type:t.value.includes(".")?W.decimal:W.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Vs({type:W.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Vs({type:W.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Gy(t.value)}).registerPrefix("{}",{parse:()=>new l7}).registerPrefix("(",T7).registerInfix("[",k7).registerInfix("(",R7).prefix("+",at.UnaryAdd,(e,t)=>new c7("+",t,n=>n)).prefix("-",at.UnarySubtract,(e,t)=>new kr("-",t,t,(n,r)=>-r)).infixLeft(".",at.Dot,(e,t,n)=>new Ky(e,n)).infixLeft("/",at.Divide,(e,t,n)=>new kr("/",e,n,(r,o)=>r/o)).infixLeft("*",at.Multiply,(e,t,n)=>new kr("*",e,n,(r,o)=>r*o)).infixLeft("+",at.Add,(e,t,n)=>new kr("+",e,n,(r,o)=>r+o)).infixLeft("-",at.Subtract,(e,t,n)=>new kr("-",e,n,(r,o)=>r-o)).infixLeft("|",at.Union,(e,t,n)=>new uT(e,n)).infixLeft("=",at.Equals,(e,t,n)=>new h7(e,n)).infixLeft("!=",at.NotEquals,(e,t,n)=>new m7(e,n)).infixLeft("~",at.Equivalent,(e,t,n)=>new p7(e,n)).infixLeft("!~",at.NotEquivalent,(e,t,n)=>new g7(e,n)).infixLeft("<",at.LessThan,(e,t,n)=>new kr("<",e,n,(r,o)=>r<o)).infixLeft("<=",at.LessThanOrEquals,(e,t,n)=>new kr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",at.GreaterThan,(e,t,n)=>new kr(">",e,n,(r,o)=>r>o)).infixLeft(">=",at.GreaterThanOrEquals,(e,t,n)=>new kr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",at.Ampersand,(e,t,n)=>new u7(e,n)).infixLeft("and",at.And,(e,t,n)=>new v7(e,n)).infixLeft("as",at.As,(e,t,n)=>new Qy(e,n)).infixLeft("contains",at.Contains,(e,t,n)=>new d7(e,n)).infixLeft("div",at.Divide,(e,t,n)=>new kr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",at.In,(e,t,n)=>new f7(e,n)).infixLeft("is",at.Is,(e,t,n)=>new Yy(e,n)).infixLeft("mod",at.Modulo,(e,t,n)=>new kr("mod",e,n,(r,o)=>r%o)).infixLeft("or",at.Or,(e,t,n)=>new y7(e,n)).infixLeft("xor",at.Xor,(e,t,n)=>new x7(e,n)).infixLeft("implies",at.Implies,(e,t,n)=>new w7(e,n))}const I7=D7();function dT(e){return new a7(e,I7.construct(P7(e)).consumeAndParse())}function A7(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]=co(n[r]))}return gc(e,n).map(r=>r.value)}function gc(e,t,n){const r=n??{};return dT(e).eval({variables:r},t).map(i=>{var s;return{type:i.type,value:(s=i.value)==null?void 0:s.valueOf()}})}var Zo=(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))(Zo||{});function ih(e,t){var r,o;let n=(o=(r=Do.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=O7(e,t)),n}function N7(e,t,n){let r=Do.types[e];r||(r={},Do.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function O7(e,t){const n=t.code,r=L7(n),o=z7(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Fl(l),u=VL(()=>c.join("."));c.length===1&&c[0]instanceof Kn?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):fT(i,Fl(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const s={columnName:r,type:F7(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return N7(e,n,s),s}function fT(e,t,n,r){const o=t[r];if(o instanceof Qy){e.propertyTypes.add(o.right.toString());return}if(o instanceof Xy){M7(e,o);return}const i=o.toString(),s=Ts(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 Jy&&(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;$7(d)&&(d=s.type[0].code),fT(e,t,d,c)}}function M7(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 Yy){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function $7(e){return e==="Element"||e==="BackboneElement"}function L7(e){return e.split("-").reduce((t,n,r)=>t+(r?Qt(n):n),"")}function F7(e,t){switch(e.type){case"date":return t.size===1&&t.has(W.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(W.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(W.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function z7(e,t){const n=[],r=dT(t);return Bp(e,r.child,n),n}function Bp(e,t,n){t instanceof uT?(Bp(e,t.left,n),Bp(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function Fl(e){if(e instanceof Qy||e instanceof Jy)return[Fl(e.left),e].flat();if(e instanceof Kn)return[e];if(e instanceof Ky)return[Fl(e.left),Fl(e.right)].flat();if(e instanceof Xy){if(e.name==="where"&&!(e.args[0]instanceof Yy))return[];if(e.name==="last")return[]}return[e]}const sh=20;var ae=(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))(ae||{});const hT={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"},Zy={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function V7(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 B7(o,i)}function B7(e,t){const n={resourceType:e};for(const[r,o]of t)U7(n,r,o);return n}function U7(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=pl(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":H7(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=yw(n);o==="iterate"&&(c.modifier="iterate"),e.include=pl(e.include,c);break}case"_revinclude":{const c=yw(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=pl(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=Do.types[e.resourceType])==null?void 0:s.searchParams)==null?void 0:l[r];c?e.filters=pl(e.filters,W7(c,o,n)):e.filters=pl(e.filters,Q7(r,o,n))}}}}function H7(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 W7(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return q7(e,n);case"reference":case"string":case"token":case"uri":return G7(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function q7(e,t){const{operator:n,value:r}=K7(t);return{code:e.code,operator:n,value:r}}function G7(e,t,n){return{code:e.code,operator:Y7(t),value:n}}function Q7(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 Zy&&(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 K7(e){const t=e.substring(0,2),n=Zy[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function Y7(e){return hT[e]??"eq"}function yw(e){const t=e.split(":");if(t.includes("*"))throw new qe(gi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new qe(gi(`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 qe(gi(`Invalid include value '${e}'`))}function ia(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(X7(n))),e.sortRules&&e.sortRules.length>0&&t.push(J7(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(xw("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(xw("_revinclude",n))),t.length===0?"":(hc(t),"?"+t.join("&"))}function X7(e){const t=e.operator in hT?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in Zy?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function J7(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function xw(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Z7(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 e6(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 ww(){const e=new Uint32Array(28);return crypto.getRandomValues(e),ML(e.buffer)}async function t6(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function mT(){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 pT(e){var o,i,s;const t={};e=uo(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]=mT(),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)=>n6(l,c,t),2);return r6(JSON.parse(r))}function n6(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 r6(e){const t=i6(e),{sorted:n,cycles:r}=o6(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 o6(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 gT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(ks(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else gT(r,t)}}function i6(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&&gT(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class vT{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 en={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 yT{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 e0{constructor(){this.emitter=new yT}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 Up={"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"},s6=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],t0=["DiagnosticReport-update"];function a6(e){return t0.includes(e)}function l6(e){if(t0.includes(e))throw new qe(jt(`'context.version' is required for '${e}'.`))}const c6={"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 u6(e){return s6.includes(e)}function xT(e){return!!e.endpoint}function Sw(e){if(!n0(e))throw new qe(jt("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 xT(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function n0(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(!Up[i])return!1;return!(xT(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function bw(e,t,n,r){if(typeof t!="object")throw new qe(jt(`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 qe(jt(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new qe(jt(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!u6(t.resourceType))throw new qe(jt(`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 qe(jt(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function d6(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)bw(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new qe(jt(`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)bw(e,s,n,r)}}function f6(e,t){const n=new Map,r=c6[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new qe(jt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));d6(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new qe(jt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new qe(jt(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function Cw(e,t,n,r){if(!(e&&typeof e=="string"))throw new qe(jt("Must provide a topic."));if(!Up[t])throw new qe(jt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Up).join(", ")}`));if(typeof n!="object")throw new qe(jt("context must be a context object or array of context objects."));if(t0.includes(t)&&!r)throw new qe(jt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return f6(t,o),{timestamp:new Date().toISOString(),id:mT(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class h6 extends e0{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new qe(jt("Subscription request should contain an endpoint."));if(!n0(t))throw new qe(jt("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 m6(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=Z7(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 p6(e){return e.split(".").length===3}function r0(e){const[t,n,r]=e.split(".");return m6(n)}function g6(e){try{return typeof r0(e).login_id=="string"}catch{return!1}}function v6(e){try{const n=r0(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class y6{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 Ew;class Rr{constructor(t){this[Ew]="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)}}Ew=Symbol.toStringTag;class x6{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new w6)}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?or(n):void 0)}}class w6{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 S6 extends e0{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 Hp extends e0{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 b6{constructor(t){this.criteria=t,this.emitter=new Hp(t),this.refCount=1}}class C6{constructor(t,n,r){if(!(t instanceof wT))throw new qe(jt("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new qe(jt("Not a valid URL"))}const i=r!=null&&r.RobustWebSocket?new r.RobustWebSocket(o):new S6(o);this.medplum=t,this.ws=i,this.masterSubEmitter=new Hp,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(rh(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 qe(d$(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 ${wt(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 qe(jt("Failed to get token"));if(!i)throw new qe(jt("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 b6(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 Hp(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const E6="3.1.4-17ee35b26",j6=en.FHIR_JSON+", */*; q=0.1",P6="https://api.medplum.com/",T6=1e3,k6=6e4,R6=0,_6="Binary/",jw={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class wT extends yT{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");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??D6(),this.storage=(t==null?void 0:t.storage)??new x6,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=iT((t==null?void 0:t.baseUrl)??P6),this.fhirBaseUrl=po(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=po(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=po(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=po(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"?R6:k6),this.cacheTime>0?this.requestCache=new vT((t==null?void 0:t.resourceCacheSize)??T6):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.storage.getInitPromise===void 0?(t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve()):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0}).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(),typeof window<"u"&&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=po(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 Rr(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,en.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(po(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=HL(n)),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 Rr((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 Rr(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 Rr(this.search(t,n,r).then(pm));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 pm(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 jw;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 Rr(Promise.reject(new Error("Missing reference")));if(r==="system")return new Rr(Promise.resolve(jw));const[o,i]=r.split("/");return!o||!i?new Rr(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(WP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Rr((async()=>{const i=`{
|
|
94
|
-
StructureDefinitionList(name: "${t}") {
|
|
95
|
-
resourceType,
|
|
96
|
-
name,
|
|
97
|
-
kind,
|
|
98
|
-
description,
|
|
99
|
-
type,
|
|
100
|
-
snapshot {
|
|
101
|
-
element {
|
|
102
|
-
id,
|
|
103
|
-
path,
|
|
104
|
-
definition,
|
|
105
|
-
min,
|
|
106
|
-
max,
|
|
107
|
-
base {
|
|
108
|
-
path,
|
|
109
|
-
min,
|
|
110
|
-
max
|
|
111
|
-
},
|
|
112
|
-
contentReference,
|
|
113
|
-
type {
|
|
114
|
-
code,
|
|
115
|
-
profile,
|
|
116
|
-
targetProfile
|
|
117
|
-
},
|
|
118
|
-
binding {
|
|
119
|
-
strength,
|
|
120
|
-
valueSet
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
126
|
-
base,
|
|
127
|
-
code,
|
|
128
|
-
type,
|
|
129
|
-
expression,
|
|
130
|
-
target
|
|
131
|
-
}
|
|
132
|
-
}`.replace(/\s+/g," "),s=await this.graphql(i);lw(s.data.StructureDefinitionList);for(const l of s.data.SearchParameterList)t7(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&By(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 Rr((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 pm(l).map(c=>(HP(c,c.url),c.url))}else{const s=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});return s?(lw([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 upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let i=await this.put(o,t,void 0,r);return i||(i=t),this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),i}async createAttachment(t,n,r,o,i){const s=kw(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=kw(t,n,r,o),l=i??(typeof n=="object"?n:{}),{data:c,contentType:u,filename:d,securityContext:f,onProgress:h}=s,p=this.fhirUrl("Binary");return d&&p.searchParams.set("_filename",d),f!=null&&f.reference&&this.setRequestHeader(l,"X-Security-Context",f.reference),h?this.uploadwithProgress(p,c,u,h,l):this.post(p,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 p;(p=i==null?void 0:i.signal)==null||p.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 qe(pt(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[p,g]of Object.entries(h))c.setRequestHeader(p,g)}c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=N6(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=xt(t),s=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,s=t.subject),t.resourceType==="Patient"&&(s=xt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[xt(t)],encounter:i,subject:s,sender:o?xt(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,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,en.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},en.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",rh(t),"$push"),{destination:typeof n=="string"?n:wt(n),body:r,contentType:o,waitForResponse:i},en.FHIR_JSON,s)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||wt(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=v6(t),this.medplumServer=g6(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(_6)&&(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=xt(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 y6(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 Rr(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 qe(u$);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await Tw(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await Tw(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new qe(pt(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=po(this.baseUrl,t));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 gw(o)}return i}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of hc(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}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 gw(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,po(this.fhirBaseUrl,s.url),s.options))}catch(l){s.reject(new qe(pt(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,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&&!zP(c.response.outcome)?l.reject(new qe(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",j6,!0),t.body&&this.setRequestHeader(t,"Content-Type",en.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.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){const t=ww();sessionStorage.setItem("pkceState",t);const n=ww();sessionStorage.setItem("codeVerifier",n);const r=await t6(n),o=$L(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??Pw()),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)??Pw()),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=e6(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new qe(jt("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new qe(jt("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",Sw(r),en.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!n0(t))throw new qe(jt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new qe(jt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",Sw(t),en.FORM_URL_ENCODED)}fhircastConnect(t){return new h6(t)}async fhircastPublish(t,n,r,o){return a6(n)?this.post(`/fhircast/STU3/${t}`,Cw(t,n,r,o),en.JSON):(l6(n),this.post(`/fhircast/STU3/${t}`,Cw(t,n,r),en.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":en.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 qe(gi(s.error_description))}catch(s){throw new qe(gi("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(p6(n)){const r=r0(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 C6(this,UL(this.baseUrl,"/ws/subscriptions-r4"))),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 D6(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function Pw(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function Tw(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(th(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function pm(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function I6(e){return xn(e)&&"data"in e&&"contentType"in e}function kw(e,t,n,r){return I6(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function A6(e){return xn(e)&&"docDefinition"in e}function N6(e,t,n,r){return A6(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Aa({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o}){if(t===(e==null?void 0:e.path))return;const i=O6(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 O6(e,t,n,r){const o=Object.create(null);if(n)for(const[s,l]of Object.entries(n.elementsByPath)){const c=fc(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 ST(e){return e.type!==void 0&&e.type.length>0}function M6(e,t,n,r){var i;const o=fL(e,t.path,{profileUrl:r});if(o){const s=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>gL(l,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function bT(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 M6(l,c,s,((u=s.typeSchema)==null?void 0:u.url)??r)}))return s.name}}class $6{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Aa({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(!zt(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=L6(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);zt((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(!ST(l))continue;const c=(s=(i=l.type.find(u=>zt(u.profile)))==null?void 0:i.profile)==null?void 0:s[0];if(zt(c)){const u=js(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;zt(s)&&(i=Aa({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 L6(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 gm="__sliceName";function F6(e,t){const n=new z6(e,e.resourceType,"resource");return new $6(t,n).crawlResource(),n.getDefaultValue()}function Rw(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Ud(e,r,o,t);continue}const i=fc(n,r);i!==void 0&&Ud(e,i,o,t)}return e}class z6{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=uo(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=fc(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){V6(d,s,n,r.elements),Ud(d,s,n,r.elements);const f=qp(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=fc(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=qp(s,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];zt(u)||l.splice(c,1)}Vt(l)&&Wp(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[gm]??bT(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(Wy(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];gm in o&&delete o[gm]}}getDefaultValue(){return this.rootValue}}function V6(e,t,n,r){const o=qp(e,t,n,r);n.min>0&&o===void 0&&Wy(n.type[0].code)&&(n.isArray?Wp(e,[Object.create(null)],t,n):Wp(e,Object.create(null),t,n))}function Wp(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]",Qt(i))}t===void 0?delete e[o]:e[o]=t}function qp(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]",Qt(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(xn(i)){if(i[c]===void 0)return;i=i[c]}else return}return s}function Ud(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>Ud(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]",Qt(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]=CT(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 CT(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:uo(t);if(xn(t)&&(xn(e)&&!Array.isArray(e)||e===void 0)){const n=uo(e)??Object.create(null);for(const r of Object.keys(t))n[r]=CT(n[r],t[r]);return n}return e}var ET=m.createContext(void 0);function ah(){return m.useContext(ET)}function se(){return ah().medplum}function lh(){return ah().navigate}function ch(){return ah().profile}function B6(e){let t=e.medplum,n=e.navigate??U6,[r,o]=m.useState({profile:t.getProfile(),loading:!t.isInitialized});m.useEffect(()=>{t&&(t.isInitialized||(o(s=>({...s,loading:!0})),t.getInitPromise().then(()=>o(s=>({...s,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),m.useEffect(()=>{function s(){o({...r,profile:t.getProfile()})}return t.addEventListener("change",s),()=>t.removeEventListener("change",s)},[t,r]);let i=m.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(ET.Provider,{value:i,children:e.children})}function U6(e){window.location.assign(e)}var _w=new Map,jT=e=>m.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=_w.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 _w.set(t,e),e},[e]);function gt(e,t){let n=se(),[r,o]=m.useState(Dw(n,e)),i=m.useCallback(s=>{Gc(s,r)||o(s)},[r,o]);return m.useEffect(()=>{i(Dw(n,e))},[n,e,i]),m.useEffect(()=>{let s=!0;return ks(e)&&n.readReference(e).then(l=>{s&&i(l)}).catch(l=>{s&&(i(void 0),t&&t(pt(l)))}),()=>s=!1},[n,r,e,i,t]),r}function Dw(e,t){if(t){if(Bo(t))return t;if(ks(t))return e.getCachedReference(t)}}function H6(e,t){return PT("searchOne",e,t)}function Na(e,t){return PT("searchResources",e,t)}function PT(e,t,n){let r=se(),[o,i]=m.useState(),[s,l]=m.useState(!1),[c,u]=m.useState(),[d,f]=m.useState();return m.useEffect(()=>{let h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(p=>{l(!1),u(p),f(c$)}).catch(p=>{l(!1),u(void 0),f(pt(p))}))},[r,e,t,n,o]),[c,s,d]}function W6(e){const t=e.value;return t?a.jsx(a.Fragment,{children:WL(t)}):null}function Iw(e,t){return e.line&&e.line.length>t?e.line[t]:""}function Aw(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function q6(e){const[t,n]=m.useState(e.defaultValue||{}),r=m.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(Aw(r.current||{},0,h))}function c(h){o(Aw(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(Z,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(Tt,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(Tt,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>s(h.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(ue,{placeholder:"Line 1",defaultValue:Iw(t,0),onChange:h=>l(h.currentTarget.value)}),a.jsx(ue,{placeholder:"Line 2",defaultValue:Iw(t,1),onChange:h=>c(h.currentTarget.value)}),a.jsx(ue,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),a.jsx(ue,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),a.jsx(ue,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>f(h.currentTarget.value)})]})}function G6(e){const t=ch(),[n,r]=m.useState(e.defaultValue||{});function o(i){const s=i?{text:i,authorReference:t&&xt(t),time:new Date().toISOString()}:{};r(s),e.onChange&&e.onChange(s)}return a.jsx(ue,{name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
133
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
134
|
-
*
|
|
135
|
-
* This source code is licensed under the MIT license.
|
|
136
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
-
*/var Q6={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"}};/**
|
|
138
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
139
|
-
*
|
|
140
|
-
* This source code is licensed under the MIT license.
|
|
141
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
-
*/const we=(e,t,n,r)=>{const o=m.forwardRef(({color:i="currentColor",size:s=24,stroke:l=2,className:c,children:u,...d},f)=>m.createElement("svg",{ref:f,...Q6[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,p])=>m.createElement(h,p)),...Array.isArray(u)?u:[u]]));return o.displayName=`${n}`,o};/**
|
|
143
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
144
|
-
*
|
|
145
|
-
* This source code is licensed under the MIT license.
|
|
146
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
-
*/var K6=we("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"}]]);/**
|
|
148
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
149
|
-
*
|
|
150
|
-
* This source code is licensed under the MIT license.
|
|
151
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
-
*/var Kc=we("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"}]]);/**
|
|
153
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
154
|
-
*
|
|
155
|
-
* This source code is licensed under the MIT license.
|
|
156
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
-
*/var Y6=we("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"}]]);/**
|
|
158
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
159
|
-
*
|
|
160
|
-
* This source code is licensed under the MIT license.
|
|
161
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
-
*/var X6=we("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"}]]);/**
|
|
163
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
164
|
-
*
|
|
165
|
-
* This source code is licensed under the MIT license.
|
|
166
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
-
*/var J6=we("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"}]]);/**
|
|
168
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
169
|
-
*
|
|
170
|
-
* This source code is licensed under the MIT license.
|
|
171
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
-
*/var Z6=we("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"}]]);/**
|
|
173
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
174
|
-
*
|
|
175
|
-
* This source code is licensed under the MIT license.
|
|
176
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
-
*/var eF=we("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"}]]);/**
|
|
178
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
179
|
-
*
|
|
180
|
-
* This source code is licensed under the MIT license.
|
|
181
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
-
*/var tF=we("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"}]]);/**
|
|
183
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
184
|
-
*
|
|
185
|
-
* This source code is licensed under the MIT license.
|
|
186
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
-
*/var nF=we("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"}]]);/**
|
|
188
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
189
|
-
*
|
|
190
|
-
* This source code is licensed under the MIT license.
|
|
191
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
-
*/var rF=we("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"}]]);/**
|
|
193
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
194
|
-
*
|
|
195
|
-
* This source code is licensed under the MIT license.
|
|
196
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
-
*/var oF=we("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"}]]);/**
|
|
198
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
199
|
-
*
|
|
200
|
-
* This source code is licensed under the MIT license.
|
|
201
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
-
*/var iF=we("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"}]]);/**
|
|
203
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
204
|
-
*
|
|
205
|
-
* This source code is licensed under the MIT license.
|
|
206
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
-
*/var Oi=we("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"}]]);/**
|
|
208
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
209
|
-
*
|
|
210
|
-
* This source code is licensed under the MIT license.
|
|
211
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
-
*/var uh=we("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
213
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
214
|
-
*
|
|
215
|
-
* This source code is licensed under the MIT license.
|
|
216
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
-
*/var sF=we("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"}]]);/**
|
|
218
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
219
|
-
*
|
|
220
|
-
* This source code is licensed under the MIT license.
|
|
221
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
-
*/var TT=we("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
223
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
224
|
-
*
|
|
225
|
-
* This source code is licensed under the MIT license.
|
|
226
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
-
*/var Hd=we("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"}]]);/**
|
|
228
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
229
|
-
*
|
|
230
|
-
* This source code is licensed under the MIT license.
|
|
231
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
-
*/var Wd=we("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"}]]);/**
|
|
233
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
234
|
-
*
|
|
235
|
-
* This source code is licensed under the MIT license.
|
|
236
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
-
*/var o0=we("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"}]]);/**
|
|
238
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
239
|
-
*
|
|
240
|
-
* This source code is licensed under the MIT license.
|
|
241
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
-
*/var aF=we("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"}]]);/**
|
|
243
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
244
|
-
*
|
|
245
|
-
* This source code is licensed under the MIT license.
|
|
246
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
-
*/var kT=we("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"}]]);/**
|
|
248
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
249
|
-
*
|
|
250
|
-
* This source code is licensed under the MIT license.
|
|
251
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
-
*/var lF=we("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"}]]);/**
|
|
253
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
254
|
-
*
|
|
255
|
-
* This source code is licensed under the MIT license.
|
|
256
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
-
*/var cF=we("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"}]]);/**
|
|
258
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
259
|
-
*
|
|
260
|
-
* This source code is licensed under the MIT license.
|
|
261
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
-
*/var uF=we("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"}]]);/**
|
|
263
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
264
|
-
*
|
|
265
|
-
* This source code is licensed under the MIT license.
|
|
266
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
-
*/var dF=we("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"}]]);/**
|
|
268
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
269
|
-
*
|
|
270
|
-
* This source code is licensed under the MIT license.
|
|
271
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
-
*/var Yc=we("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"}]]);/**
|
|
273
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
274
|
-
*
|
|
275
|
-
* This source code is licensed under the MIT license.
|
|
276
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
-
*/var Xc=we("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
278
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
279
|
-
*
|
|
280
|
-
* This source code is licensed under the MIT license.
|
|
281
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
-
*/var Nw=we("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"}]]);/**
|
|
283
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
284
|
-
*
|
|
285
|
-
* This source code is licensed under the MIT license.
|
|
286
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
-
*/var fF=we("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"}]]);/**
|
|
288
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
289
|
-
*
|
|
290
|
-
* This source code is licensed under the MIT license.
|
|
291
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
-
*/var hF=we("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"}]]);/**
|
|
293
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
294
|
-
*
|
|
295
|
-
* This source code is licensed under the MIT license.
|
|
296
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
-
*/var mF=we("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"}]]);/**
|
|
298
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
299
|
-
*
|
|
300
|
-
* This source code is licensed under the MIT license.
|
|
301
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
-
*/var pF=we("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"}]]);/**
|
|
303
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
304
|
-
*
|
|
305
|
-
* This source code is licensed under the MIT license.
|
|
306
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
-
*/var gF=we("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"}]]);/**
|
|
308
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
309
|
-
*
|
|
310
|
-
* This source code is licensed under the MIT license.
|
|
311
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
-
*/var vF=we("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"}]]);/**
|
|
313
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
314
|
-
*
|
|
315
|
-
* This source code is licensed under the MIT license.
|
|
316
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
-
*/var yF=we("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"}]]);/**
|
|
318
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
319
|
-
*
|
|
320
|
-
* This source code is licensed under the MIT license.
|
|
321
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
-
*/var xF=we("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"}]]);/**
|
|
323
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
324
|
-
*
|
|
325
|
-
* This source code is licensed under the MIT license.
|
|
326
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
-
*/var RT=we("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
328
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
329
|
-
*
|
|
330
|
-
* This source code is licensed under the MIT license.
|
|
331
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
-
*/var _T=we("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
333
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
334
|
-
*
|
|
335
|
-
* This source code is licensed under the MIT license.
|
|
336
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
-
*/var wF=we("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"}]]);/**
|
|
338
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
339
|
-
*
|
|
340
|
-
* This source code is licensed under the MIT license.
|
|
341
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
-
*/var SF=we("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"}]]);/**
|
|
343
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
344
|
-
*
|
|
345
|
-
* This source code is licensed under the MIT license.
|
|
346
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
-
*/var bF=we("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"}]]);/**
|
|
348
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
349
|
-
*
|
|
350
|
-
* This source code is licensed under the MIT license.
|
|
351
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
-
*/var CF=we("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"}]]);/**
|
|
353
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the MIT license.
|
|
356
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/var EF=we("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"}]]);/**
|
|
358
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
359
|
-
*
|
|
360
|
-
* This source code is licensed under the MIT license.
|
|
361
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
-
*/var jF=we("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
363
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
364
|
-
*
|
|
365
|
-
* This source code is licensed under the MIT license.
|
|
366
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
-
*/var PF=we("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
368
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
369
|
-
*
|
|
370
|
-
* This source code is licensed under the MIT license.
|
|
371
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
-
*/var TF=we("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"}]]);/**
|
|
373
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
374
|
-
*
|
|
375
|
-
* This source code is licensed under the MIT license.
|
|
376
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
-
*/var kF=we("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"}]]);/**
|
|
378
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
379
|
-
*
|
|
380
|
-
* This source code is licensed under the MIT license.
|
|
381
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
-
*/var RF=we("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"}]]);/**
|
|
383
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
384
|
-
*
|
|
385
|
-
* This source code is licensed under the MIT license.
|
|
386
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
-
*/var _F=we("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"}]]);/**
|
|
388
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
389
|
-
*
|
|
390
|
-
* This source code is licensed under the MIT license.
|
|
391
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
-
*/var DF=we("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"}]]);/**
|
|
393
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
394
|
-
*
|
|
395
|
-
* This source code is licensed under the MIT license.
|
|
396
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
-
*/var Gp=we("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"}]]);/**
|
|
398
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the MIT license.
|
|
401
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
-
*/var i0=we("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"}]]);/**
|
|
403
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
404
|
-
*
|
|
405
|
-
* This source code is licensed under the MIT license.
|
|
406
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
-
*/var s0=we("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"}]]);/**
|
|
408
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
409
|
-
*
|
|
410
|
-
* This source code is licensed under the MIT license.
|
|
411
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
-
*/var IF=we("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"}]]);/**
|
|
413
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
414
|
-
*
|
|
415
|
-
* This source code is licensed under the MIT license.
|
|
416
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
-
*/var AF=we("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"}]]);/**
|
|
418
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
419
|
-
*
|
|
420
|
-
* This source code is licensed under the MIT license.
|
|
421
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
-
*/var NF=we("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"}]]);/**
|
|
423
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
424
|
-
*
|
|
425
|
-
* This source code is licensed under the MIT license.
|
|
426
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
-
*/var OF=we("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"}]]);/**
|
|
428
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
429
|
-
*
|
|
430
|
-
* This source code is licensed under the MIT license.
|
|
431
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
-
*/var DT=we("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"}]]);/**
|
|
433
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
434
|
-
*
|
|
435
|
-
* This source code is licensed under the MIT license.
|
|
436
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
-
*/var Ow=we("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"}]]);/**
|
|
438
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
439
|
-
*
|
|
440
|
-
* This source code is licensed under the MIT license.
|
|
441
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
-
*/var MF=we("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"}]]);/**
|
|
443
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
444
|
-
*
|
|
445
|
-
* This source code is licensed under the MIT license.
|
|
446
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
-
*/var qd=we("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
448
|
-
* @license @tabler/icons-react v3.2.0 - MIT
|
|
449
|
-
*
|
|
450
|
-
* This source code is licensed under the MIT license.
|
|
451
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
-
*/var $F=we("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 IT extends m.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(Ss,{icon:a.jsx(Kc,{size:16}),title:"Something went wrong",color:"red",children:Oe(this.state.error)}):this.props.children}}function Vr(){return a.jsx(cn,{style:{width:"100%",height:"100vh"},children:a.jsx(qn,{})})}const LF="_main_1szoq_1",FF={main:LF};function ft(e){e.preventDefault(),e.stopPropagation()}function AT(e){if(Mw(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&Mw(t[0]))return!0}return!1}function Mw(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function Ge(e){const t=lh(),{to:n,suffix:r,label:o,onClick:i,children:s,...l}=e;let c=zF(n);return r&&(c+="/"+r),a.jsx(Je,{href:c,"aria-label":o,onClick:u=>{ft(u),i?i(u):n&&t(c)},...l,children:s})}function zF(e){if(e){if(typeof e=="string")return VF(e);if(Bo(e))return BF(e);if(ks(e))return UF(e)}return"#"}function VF(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function BF(e){return`/${e.resourceType}/${e.id}`}function UF(e){return`/${e.reference}`}function HF(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 ki(e){const t=gt(e.value),n=t?_o(t):e.alt??"",r=HF(n),o=(t&&jL(t))??e.src,i=jT(o??void 0),s=e.radius??"xl",l={...e,value:void 0,link:void 0};return e.link?a.jsx(Ge,{to:t,children:a.jsx(as,{src:i,alt:n,radius:s,...l,children:r})}):a.jsx(as,{src:i,alt:n,radius:s,...l,children:r})}const WF="_logoButton_189g3_1",qF="_user_189g3_11",GF="_userName_189g3_21",QF="_userActive_189g3_31",Fu={logoButton:WF,user:qF,userName:GF,userActive:QF};function a0(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Qc(t,e.options)}):null}function KF(e){var c,u,d;const t=ah(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:s,setColorScheme:l}=eD();return a.jsxs(a.Fragment,{children:[a.jsxs(Ie,{align:"center",p:"xl",children:[a.jsx(ki,{size:"xl",radius:100,value:t.profile}),a.jsx(a0,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),a.jsx(ce,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&a.jsx(ne.Divider,{}),i.map(f=>f.profile.reference!==wt(t.profile)&&a.jsx(ne.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(Z,{children:[a.jsx(as,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(ce,{size:"sm",fw:500,children:f.profile.display}),a.jsx(ce,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(ne.Divider,{}),a.jsx(Z,{justify:"center",children:a.jsx(Ty,{size:"xs",value:s,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(NF,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(ne.Item,{leftSection:a.jsx(Gp,{size:14,stroke:1.5}),onClick:()=>o(`/${wt(r)}`),children:"Account settings"}),a.jsx(ne.Item,{leftSection:a.jsx(xF,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsx(ce,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}function l0(e){const t=Mc({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:p,required:g,placeholder:v,leftSection:S,maxValues:y,optionsDropdownMaxHeight:x=320,...w}=e,b=YF(s),[j,E]=m.useState(""),[T,P]=m.useState(),[_,D]=m.useState(),[$,I]=m.useState(),[L,F]=m.useState(b.map(l)),[O,A]=m.useState([]),R=u??XF,k=m.useRef();k.current=j;const M=m.useRef(),B=m.useRef(),U=m.useRef();U.current=T;const X=m.useRef();X.current=_;const re=m.useRef();re.current=$;const fe=m.useRef();fe.current=O;const Ce=m.useCallback(()=>{if(P(void 0),k.current===B.current&&c===M.current)return;B.current=k.current,M.current=c;const be=new AbortController;D(be),c(k.current??"",be.signal).then(ze=>{be.signal.aborted||(A(ze.map(l)),D(void 0),re.current?(ze.length>0&&d(ze.slice(0,1)),I(!1)):ze.length>0&&t.openDropdown())}).catch(ze=>{be.signal.aborted||ze.message.includes("aborted")||ve({color:"red",message:Oe(ze)})})},[t,c,d,l]),Te=m.useCallback(be=>{(O&&O.length>0||h)&&t.openDropdown(),t.updateSelectedOptionIndex(),E(be.currentTarget.value),X.current&&(X.current.abort(),D(void 0)),U.current!==void 0&&window.clearTimeout(U.current);const ze=window.setTimeout(()=>Ce(),100);P(ze)},[t,O,h,Ce]),Ae=m.useCallback(be=>{const ze=[],$e=[...L];let Y=O==null?void 0:O.find(Ee=>Ee.value===be),oe=Y==null?void 0:Y.resource;if(!oe&&h!==!1&&f&&(oe=f(be),Y=l(oe)),oe&&ze.push(oe),Y&&$e.push(Y),y!==void 0)for(;$e.length>y;)$e.shift();d(ze),F($e)},[h,O,L,y,d,f,l]),pe=be=>{E(""),A([]),t.closeDropdown(),B.current=void 0,Ae(be==="$create"?j:be)},He=m.useCallback(be=>{const ze=L.filter($e=>$e.value!==be.value);d(ze.map($e=>$e.resource)),F(ze)},[L,d]),ct=m.useCallback(be=>{be.key==="Enter"?!T&&!_?(ft(be),O&&O.length>0&&(A(O.slice(0,1)),Ae(O[0].value))):I(!0):be.key==="Backspace"&&j.length===0&&(ft(be),He(L[L.length-1]))},[j,L,O,T,_,Ae,He]);m.useEffect(()=>()=>{X.current&&X.current.abort()},[]);const We=p&&L.length>0&&a.jsx(De.ClearButton,{title:"Clear all",size:16,onClear:()=>{E(""),F([]),d([]),t.closeDropdown()}});return a.jsxs(De,{store:t,onOptionSubmit:pe,withinPortal:!0,shadow:"xl",...w,children:[a.jsx(De.DropdownTarget,{children:a.jsx(Da,{label:r,description:o,error:i,className:e.className,leftSection:S,rightSection:_?a.jsx(qn,{size:16}):We,required:g,children:a.jsxs(ls.Group,{children:[L.map(be=>a.jsx(ls,{withRemoveButton:!0,onRemove:()=>He(be),children:be.label},be.value)),(y===void 0||y===0||L.length<y)&&a.jsx(De.EventsTarget,{children:a.jsx(Da.Field,{role:"searchbox",name:n,value:j,placeholder:v,onFocus:Te,onBlur:()=>t.closeDropdown(),onKeyDown:ct,onChange:Te})})]})})}),a.jsx(De.Dropdown,{children:a.jsx(De.Options,{children:a.jsxs(Pf,{type:"scroll",mah:x,children:[O.map(be=>a.jsx(De.Option,{value:be.value,active:L.includes(be),children:a.jsx(R,{...be})},be.value)),h&&j.trim().length>0&&a.jsxs(De.Option,{value:"$create",children:["+ Create ",j]}),!h&&j.trim().length>0&&O.length===0&&a.jsx(De.Empty,{children:"Nothing found"})]})})})]})}function YF(e){return e?Array.isArray(e)?e:[e]:[]}function XF(e){return a.jsx(Z,{gap:"sm",children:a.jsx("span",{children:e.label})})}const JF="_searchInput_dick8_1",ZF={searchInput:JF};function e8(e){return{value:e.id,label:_o(e),resource:e}}function t8(e){const t=lh(),n=se(),r=m.useCallback(async(i,s)=>{const l=r8(i),c={signal:s},u=await n.graphql(l,void 0,void 0,c);return o8(u,i)},[n]),o=m.useCallback(i=>{i.length>0&&t(`/${wt(i[0])}`)},[t]);return a.jsx(l0,{size:"sm",radius:"md",className:ZF.searchInput,leftSection:a.jsx(DF,{size:16}),placeholder:"Search",itemComponent:n8,toOption:e8,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const n8=m.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(Z,{wrap:"nowrap",children:[a.jsx(ki,{value:e}),a.jsxs("div",{children:[a.jsx(ce,{children:_o(e)}),a.jsx(ce,{size:"xs",c:"dimmed",children:r})]})]})})});function r8(e){const t=JSON.stringify(e);return rT(e)?`{
|
|
453
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
454
|
-
resourceType
|
|
455
|
-
id
|
|
456
|
-
identifier {
|
|
457
|
-
system
|
|
458
|
-
value
|
|
459
|
-
}
|
|
460
|
-
name {
|
|
461
|
-
given
|
|
462
|
-
family
|
|
463
|
-
}
|
|
464
|
-
birthDate
|
|
465
|
-
}
|
|
466
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
467
|
-
resourceType
|
|
468
|
-
id
|
|
469
|
-
identifier {
|
|
470
|
-
system
|
|
471
|
-
value
|
|
472
|
-
}
|
|
473
|
-
subject {
|
|
474
|
-
display
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
}`.replace(/\s+/g," "):`{
|
|
478
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
479
|
-
resourceType
|
|
480
|
-
id
|
|
481
|
-
identifier {
|
|
482
|
-
system
|
|
483
|
-
value
|
|
484
|
-
}
|
|
485
|
-
name {
|
|
486
|
-
given
|
|
487
|
-
family
|
|
488
|
-
}
|
|
489
|
-
birthDate
|
|
490
|
-
}
|
|
491
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
492
|
-
resourceType
|
|
493
|
-
id
|
|
494
|
-
identifier {
|
|
495
|
-
system
|
|
496
|
-
value
|
|
497
|
-
}
|
|
498
|
-
name {
|
|
499
|
-
given
|
|
500
|
-
family
|
|
501
|
-
}
|
|
502
|
-
birthDate
|
|
503
|
-
}
|
|
504
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
505
|
-
resourceType
|
|
506
|
-
id
|
|
507
|
-
identifier {
|
|
508
|
-
system
|
|
509
|
-
value
|
|
510
|
-
}
|
|
511
|
-
subject {
|
|
512
|
-
display
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
}`.replace(/\s+/g," ")}function o8(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),s8(i8(n),t).slice(0,5)}function i8(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 s8(e,t){return e.sort((n,r)=>$w(r,t)-$w(n,t))}function $w(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,Lw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,Lw(Qc(r),t));return n}function Lw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function a8(e){var o;const t=ch(),[n,r]=m.useState(!1);return a.jsx(Wn.Header,{p:8,style:{zIndex:101},children:a.jsxs(Z,{justify:"space-between",children:[a.jsxs(Z,{gap:"xs",children:[a.jsx(kn,{className:Fu.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(t8,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(Z,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(ne,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(ne.Target,{children:a.jsx(kn,{className:it(Fu.user,{[Fu.userActive]:n}),onClick:()=>r(i=>!i),children:a.jsxs(Z,{gap:7,children:[a.jsx(ki,{value:t,radius:"xl",size:24}),a.jsx(ce,{size:"sm",className:Fu.userName,children:Qc((o=t==null?void 0:t.name)==null?void 0:o[0])}),a.jsx(TT,{size:12,stroke:1.5})]})})}),a.jsx(ne.Dropdown,{children:a.jsx(KF,{version:e.version})})]})]})]})})}function l8(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?c8(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&u8(t,n);return t}function c8(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function u8(e,t){e[t.name]=t.value}function Ye(e){return a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=l8(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function d8(e){const t=se(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:s}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=uo(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"}),ve({color:"green",message:"Success"}),e.onOk()}).catch(h=>{ve({color:"red",message:Oe(h)})})}return a.jsx(Nn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(Ye,{onSubmit:r,children:a.jsxs(Ie,{children:[a.jsx(f8,{config:n}),a.jsx(ue,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(Z,{justify:"flex-end",children:a.jsx(ie,{mt:"sm",type:"submit",children:"OK"})})]})})})}function f8(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(Tt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function NT(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function h8(e){return typeof e.display=="string"?e.display:NT(e)}function m8(e){return{value:NT(e),label:h8(e),resource:e}}function p8(e){return{code:e,display:e}}function c0(e){const t=se(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:s,...l}=e,c=m.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,p=[];for(const v of h)v.code&&!p.some(S=>S.code===v.code)&&p.push(v);return p},[t,i,n]);return a.jsx(l0,{...l,creatable:r??!0,clearable:o??!0,toOption:m8,loadOptions:c,onCreate:p8,itemComponent:s?g8:void 0})}const g8=m.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsx(Z,{wrap:"nowrap",children:a.jsxs("div",{children:[a.jsx(ce,{children:e}),a.jsx(ce,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})})}));function OT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=m.useState(t);function l(c){const u=c[0],d=y8(u);s(d),n&&n(d)}return a.jsx(c0,{defaultValue:v8(i),onChange:l,withHelpText:r??!0,...o})}function v8(e){return e?{code:e}:void 0}function y8(e){return e==null?void 0:e.code}function u0(e){const[t,n]=m.useState(e.defaultValue),r=e.onChange,o=m.useCallback(i=>{n(i),r&&r(i)},[r]);return a.jsx(OT,{"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 x8="_menuTitle_9g6l5_1",w8="_link_9g6l5_9",S8="_linkActive_9g6l5_38",Qp={menuTitle:x8,link:w8,linkActive:S8};function b8(e){var l;const t=lh(),n=j8(e.pathname,e.searchParams,e.menus),[r,o]=m.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(Wn.Navbar,{children:a.jsxs(br,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(Wn.Section,{mb:"sm",children:a.jsx(u0,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>s(c)},window.location.pathname)}),a.jsxs(Wn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return a.jsxs(m.Fragment,{children:[a.jsx(ce,{className:Qp.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>a.jsxs(C8,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[a.jsx(E8,{to:d.href,icon:d.icon}),a.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&a.jsx(ie,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(PF,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(d8,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function C8(e){return a.jsx(Ge,{onClick:e.onClick,to:e.to,className:it(Qp.link,{[Qp.linkActive]:e.active}),children:e.children})}function E8(e){return e.icon?e.icon:a.jsx(eh,{w:30})}function j8(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=P8(e,t,s.href);l>o&&(o=l,r=s)}return r}function P8(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 T8(e){const[t,n]=m.useState(localStorage.navbarOpen==="true"),r=se(),o=ch();m.useEffect(()=>{function c(){ve({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(Vr,{}):a.jsxs(Wn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(a8,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?a.jsx(b8,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:s,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(Wn.Main,{className:FF.main,children:a.jsx(IT,{children:a.jsx(m.Suspense,{fallback:a.jsx(Vr,{}),children:e.children})})})]})}function Jc(e){const{contentType:t,url:n,title:r}=e.value??{},o=jT(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(Je,{href:o,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:k8(r),children:r||"Download"})})]}):null}function k8(e){return e!=null&&e.includes(".")?e:void 0}const R8="_root_17n8t_1",_8="_compact_17n8t_25",Fw={root:R8,compact:_8};function d0(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:it(Fw.root,{[Fw.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 D8(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>a.jsx("div",{children:a.jsx(Jc,{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(!zt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=a.jsx(bo,{term:cs(o),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function f0(e){const t=se(),n=m.useRef(null);function r(s){var l;ft(s),(l=n.current)==null||l.click()}function o(s){ft(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(pt(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 I8(e){const[t,n]=m.useState(e.defaultValue??[]),r=m.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(Jc,{value:i,maxWidth:200})}),a.jsx("td",{children:a.jsx(Zt,{title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{ft(l);const c=t.slice();c.splice(s,1),o(c)},children:a.jsx(Hd,{})})})]},`${s}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(f0,{onUpload:i=>{o([...r.current,i])},children:i=>a.jsx(Zt,{...i,title:"Add",variant:"subtle",size:"sm",color:"green",children:a.jsx(o0,{})})})})]})]})]})}function MT(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Jc,{value:t,maxWidth:200}),a.jsx(ie,{onClick:o=>{ft(o),r(void 0)},children:"Remove"})]}):a.jsx(f0,{securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(ie,{...o,children:"Upload..."})})}const $T=["meta","implicitRules","contained","extension","modifierExtension"],LT=["language","text"];function so(e){return a.jsx(a.Fragment,{children:bi(e.value)})}function A8(e){return a.jsx(a.Fragment,{children:Ps(e.value)})}function FT(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 N8(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(FT,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function O8(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 M8(e){return a.jsx(a.Fragment,{children:JL(e.value)})}function vc(e){return a.jsx(a.Fragment,{children:Jo(e.value)})}function h0(e){return a.jsx(a.Fragment,{children:mc(e.value)})}function $8(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(vc,{value:t.numerator})," / ",a.jsx(vc,{value:t.denominator})]}):null}function Gd(e){if(!e.value)return null;const t=e.value.display||e.value.reference||or(e.value);return e.link!==!1&&e.value.reference?a.jsx(Ge,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}const on=m.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),debugMode:!1});on.displayName="ElementsContext";const m0=["extension","modifierExtension"],L8=["id",...$T].filter(e=>!m0.includes(e));function F8(e){return Object.entries(e).filter(([n,r])=>{var o;return!zt(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||m0.includes(n)&&!zt((o=r.slicing)==null?void 0:o.slices)||L8.includes(n)?!1:!(LT.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function zT(e,t,n,r){if(!zt(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=bT(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 VT({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(!ST(u)){console.debug("Unsupported slice definition",u);continue}let d;zt(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=js(f);d.typeSchema=h}}n(o)}).catch(r)})}function dh(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function z8(e){var s,l;const{slice:t,property:n}=e,r=((s=t.typeSchema)==null?void 0:s.elements)??t.elements,o=m.useContext(on),i=m.useMemo(()=>{var c;if(zt(r))return Aa({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 dh(on.Provider,i,a.jsx(a.Fragment,{children:e.value.map((c,u)=>a.jsx("div",{children:a.jsx(Br,{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 V8(e){var g;const{property:t,propertyType:n}=e,r=se(),o=m.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,s]=m.useState(!0),[l,c]=m.useState([]),[u,d]=m.useState(()=>[o]),f=m.useContext(on);if(m.useEffect(()=>{VT({medplum:r,property:t}).then(v=>{c(v);const S=zT(o,v,t.slicing,f.profileUrl);d(S),s(!1)}).catch(v=>{console.error(v),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 v=u[l.length],S=v.map((y,x)=>a.jsx("div",{children:a.jsx(Br,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:y,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${x}-${v.length}`));if(e.includeDescriptionListEntry){if(!zt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const y=e.path.split(".").pop();h=a.jsx(bo,{term:cs(y),children:S})}else h=a.jsx(a.Fragment,{children:S})}return a.jsxs(a.Fragment,{children:[l.map((v,S)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let y=a.jsx(z8,{path:e.path,slice:v,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(y=a.jsx(bo,{term:cs(v.name),children:y},v.name)),y}),h]})}function Zc(e,t,n){const r=dn(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 B8(e,t,n){const r=QP(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function U8(e){const{elementDefinitionType:t}=e,n=se(),r=m.useContext(on),[o,i]=m.useState(qP("Extension")),s=m.useMemo(()=>{if(zt(t==null?void 0:t.profile))return t.profile[0]},[t]),[l,c]=m.useState(s!==void 0);if(m.useEffect(()=>{s&&(c(!0),n.requestProfileSchema(s).then(()=>{const f=js(s);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,s]),s&&(l||!By(s)))return a.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=Zc({type:"Extension",value:e.value},"value[x]",s??r.profileUrl);return a.jsx(Br,{propertyType:h,value:f})}return a.jsx(Qd,{path:e.path,value:{type:o.name,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:s})}function Br(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(G,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Vt(r)&&a.jsx(Kj,{value:r,timeout:2e3,children:({copied:l,copy:c})=>a.jsx(Ya,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(Zt,{variant:"subtle",color:l?"teal":"gray",onClick:c,children:l?a.jsx(uh,{size:"1rem"}):a.jsx(kT,{size:"1rem"})})})})]});const i=!!e.arrayElement;if(t!=null&&t.max&&t.max>1&&!i)return n===W.Attachment?a.jsx(D8,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(V8,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case W.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case W.SystemString:case W.string:return a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case W.code:case W.date:case W.decimal:case W.id:case W.integer:case W.positiveInt:case W.unsignedInt:case W.uri:case W.url:return a.jsx(a.Fragment,{children:r});case W.canonical:return a.jsx(Gd,{value:{reference:r},link:e.link});case W.dateTime:case W.instant:return a.jsx(a.Fragment,{children:Rn(r)});case W.markdown:return a.jsx("pre",{children:r});case W.Address:return a.jsx(W6,{value:r});case W.Annotation:return a.jsx(a.Fragment,{children:r==null?void 0:r.text});case W.Attachment:return a.jsx(Jc,{value:r,maxWidth:e.maxWidth});case W.CodeableConcept:return a.jsx(so,{value:r});case W.Coding:return a.jsx(A8,{value:r});case W.ContactDetail:return a.jsx(N8,{value:r});case W.ContactPoint:return a.jsx(FT,{value:r});case W.HumanName:return a.jsx(a0,{value:r});case W.Identifier:return a.jsx(O8,{value:r});case W.Money:return a.jsx(M8,{value:r});case W.Period:return a.jsx(a.Fragment,{children:GL(r)});case W.Quantity:case W.Duration:return a.jsx(vc,{value:r});case W.Range:return a.jsx(h0,{value:r});case W.Ratio:return a.jsx($8,{value:r});case W.Reference:return a.jsx(Gd,{value:r,link:e.link});case W.Timing:return a.jsx(a.Fragment,{children:sT(r)});case W.Dosage:case W.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Qd,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case W.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(U8,{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(Qd,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const BT=["extension","modifierExtension"],H8=$T.filter(e=>!BT.includes(e));function Qd(e){const t=e.value,{value:n,type:r}=t,o=m.useContext(on),i=e.profileUrl??(o==null?void 0:o.profileUrl),s=m.useMemo(()=>nh(r,i),[i,r]),l=m.useMemo(()=>{if(s)return Aa({parentContext:o,elements:s.elements,path:e.path,profileUrl:s.url})},[s,e.path,o]);if(Vt(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 dh(on.Provider,l,a.jsx(d0,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(BT.includes(u)&&Vt((v=d.slicing)==null?void 0:v.slices))return null;if(H8.includes(u))return null;if(LT.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=Zc(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&Vt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const p=d.max>1||d.isArray,g=a.jsx(Br,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:p,link:e.link},u);return p?g:a.jsx(bo,{term:cs(u),children:g},u)})}))}function UT(e){const{debugMode:t}=m.useContext(on);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsxs(Z,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(Rt.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,children:null})})]})}function Xe(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 HT((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(`
|
|
516
|
-
`)}function eu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return HT((o=r.expression)==null?void 0:o[0],t)})}const zu=/\[\d+\]/;function HT(e,t){const n=typeof e=="string"&&zu.test(e),r=typeof t=="string"&&zu.test(t);if(n!==r&&(e=e==null?void 0:e.replace(zu,""),t=t==null?void 0:t.replace(zu,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const i=t.indexOf(".");return i>=0&&t.substring(i+1)===e}function mt(e){const{debugMode:t}=m.useContext(on);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,a.jsx(Rt.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,error:Xe(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children})}function WT(e,t,n,r,o){const i=r.type;if(i.length>1)for(const s of i){const l=t.replace("[x]",Qt(s.code));l in e&&delete e[l]}return e[n]=o,e}function W8(e){return!!e&&!Vt(e.url)&&!Vt(e.name)}function q8(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:i,valuePath:s,...l}=e,[c,u]=m.useState(t);function d(f){const h=Q8(f);u(h),n&&n(h)}return a.jsx(c0,{defaultValue:c&&G8(c),onChange:d,withHelpText:r??!0,...l})}function G8(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function Q8(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function qT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,s]=m.useState(t);function l(c){const u=c[0],d=u&&Y8(u);s(d),n&&n(d)}return a.jsx(c0,{defaultValue:i&&K8(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function K8(e){return{system:e.system,code:e.code,display:e.display}}function Y8(e){return{system:e.system,code:e.code,display:e.display}}function GT(e){const{path:t,outcome:n}=e,{elementsByPath:r}=m.useContext(on),[o,i]=m.useState(e.defaultValue),s=m.useRef();s.current=o;const[l,c,u]=m.useMemo(()=>["system","use","value"].map(v=>r[t+"."+v]),[r,t]);function d(v){v&&Object.keys(v).length===0&&(v=void 0),i(v),e.onChange&&e.onChange(v)}function f(v){const S={...s.current,system:v};v||delete S.system,d(S)}function h(v){const S={...s.current,use:v};v||delete S.use,d(S)}function p(v){const S={...s.current,value:v};v||delete S.value,d(S)}const g=e.valuePath??t;return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(Tt,{"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((l==null?void 0:l.min)??0)>0,onChange:v=>f(v.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Xe(n,g+".system")}),a.jsx(Tt,{"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((c==null?void 0:c.min)??0)>0,onChange:v=>h(v.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Xe(n,g+".use")}),a.jsx(ue,{placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((u==null?void 0:u.min)??0)>0,onChange:v=>p(v.currentTarget.value),error:Xe(n,g+".value")})]})}function X8(e){var l;const[t,n]=m.useState(e.defaultValue),r=m.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(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ue,{"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(GT,{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 J8(e){if(!e)return"";const t=new Date(e);return oh(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function QT(e){if(!e)return"";const t=new Date(e);return oh(t)?t.toISOString():""}var Z8={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.1.4-17ee35b26",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function us(e){return a.jsx(ue,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:ez(),defaultValue:J8(e.defaultValue),autoFocus:e.autoFocus,error:Xe(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(QT(n))}}})}function ez(){return Z8.NODE_ENV==="test"?"text":"datetime-local"}function tz(e){const{propertyType:t}=e,n=se(),[r,o]=m.useState(),i=m.useMemo(()=>{if(zt(t.profile))return t.profile[0]},[t]),[s,l]=m.useState(i!==void 0);return m.useEffect(()=>{i&&(l(!0),n.requestProfileSchema(i).then(()=>{const c=js(i);l(!1),o(c)}).catch(c=>{l(!1),console.warn(c)}))},[n,i]),i&&(s||!By(i))?a.jsx("div",{children:"Loading..."}):a.jsx(v0,{profileUrl:i,path:e.path,typeName:(r==null?void 0:r.name)??"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function nz(e){var h,p,g;const{outcome:t,path:n}=e,[r,o]=m.useState(e.defaultValue);function i(v){o(v),e.onChange&&e.onChange(v)}function s(v){i({...r,use:v||void 0})}function l(v){i({...r,prefix:v?v.split(" "):void 0})}function c(v){i({...r,given:v?v.split(" "):void 0})}function u(v){i({...r,family:v||void 0})}function d(v){i({...r,suffix:v?v.split(" "):void 0})}const f=e.valuePath??n;return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tt,{defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:v=>s(v.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Xe(t,f+".use")}),a.jsx(ue,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(h=r==null?void 0:r.prefix)==null?void 0:h.join(" "),onChange:v=>l(v.currentTarget.value),error:Xe(t,f+".prefix")}),a.jsx(ue,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=r==null?void 0:r.given)==null?void 0:p.join(" "),onChange:v=>c(v.currentTarget.value),error:Xe(t,f+".given")}),a.jsx(ue,{name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:v=>u(v.currentTarget.value),error:Xe(t,f+".family")}),a.jsx(ue,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(g=r==null?void 0:r.suffix)==null?void 0:g.join(" "),onChange:v=>d(v.currentTarget.value),error:Xe(t,f+".suffix")})]})}function rz(e){const[t,n]=m.useState(e.defaultValue),{elementsByPath:r}=m.useContext(on),[o,i]=m.useMemo(()=>["system","value"].map(c=>r[e.path+"."+c]),[r,e.path]);function s(c){n(c),e.onChange&&e.onChange(c)}const l=e.valuePath??e.path;return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(ue,{placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:c=>s({...t,system:c.currentTarget.value}),error:Xe(e.outcome,l+".system")}),a.jsx(ue,{placeholder:"Value",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:c=>s({...t,value:c.currentTarget.value}),error:Xe(e.outcome,l+".value")})]})}const oz=["USD","EUR","CAD","GBP","AUD"];function iz(e){var c;const{onChange:t}=e,[n,r]=m.useState(e.defaultValue),o=m.useCallback(u=>{r(u),t&&t(u)},[t]),i=m.useCallback(u=>{o({...n,currency:u.currentTarget.value})},[n,o]),s=m.useCallback(u=>{o({...n,value:u.currentTarget.valueAsNumber})},[n,o]),l=a.jsx(Tt,{defaultValue:n==null?void 0:n.currency,data:oz,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return a.jsx(ue,{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(lF,{size:14}),rightSection:l,rightSectionWidth:92,onChange:s})}function sz(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(us,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>r({...t,start:o})}),a.jsx(us,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>r({...t,end:o})})]})}function ds(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Tt,{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(ue,{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:az(o.currentTarget.value)})}}),a.jsx(ue,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>r({...t,unit:o.currentTarget.value})})]})}function az(e){if(e)return parseFloat(e)}function p0(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ds,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>r({...t,low:o})}),a.jsx(ds,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>r({...t,high:o})})]})}function lz(e){const[t,n]=m.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ds,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>r({...t,numerator:o})}),a.jsx(ds,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>r({...t,denominator:o})})]})}const cz={Device:"device-name",Observation:"code",User:"email:contains"},uz=["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 dz(e){return{value:wt(e),label:_o(e),resource:e}}function Ja(e){const t=se(),{resourceType:n,searchCriteria:r}=e,[o,i]=m.useState(),s=gt(e.defaultValue,i),l=e.onChange,c=m.useCallback(async(d,f)=>{const h=hz(n),p=new URLSearchParams({[h]:d??"",_count:"10",...r});return await t.searchResources(n,p,{signal:f})},[t,n,r]),u=m.useCallback(d=>{l&&l(d[0])},[l]);return zt(e.defaultValue)&&!o&&!s?null:a.jsx(l0,{name:e.name,required:e.required,itemComponent:fz,defaultValue:s,placeholder:e.placeholder,maxValues:1,toOption:dz,loadOptions:c,onChange:u,clearable:!0})}const fz=m.forwardRef(({label:e,resource:t,...n},r)=>a.jsx("div",{ref:r,...n,children:a.jsxs(Z,{wrap:"nowrap",children:[a.jsx(ki,{value:t}),a.jsxs("div",{children:[a.jsx(ce,{children:e}),a.jsx(ce,{size:"xs",c:"dimmed",children:t.birthDate})]})]})}));function hz(e){return cz[e]??(uz.includes(e)?"name":"_id")}function fh(e){const{onChange:t}=e,n=se(),[r,o]=m.useState(e.defaultValue),[i,s]=m.useState(()=>mz(e.targetTypes)),[l,c]=m.useState(()=>pz(e.defaultValue,i)),u=m.useRef(new vT),d=m.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);m.useEffect(()=>{let p=!1;const g=i==null?void 0:i.map(v=>{if(!vz(v))return Promise.resolve(v);p=!0;const S=v.value,y=u.current.get(S);if(y)return y;const x=gz(n,v.value).then(b=>{const j={...v};return b?zt(b.type)?(j.resourceType=b.type,j.name=b.name,j.title=b.title):(console.error(`StructureDefinition.type missing for ${v.value}`),j.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${v.value}`),j.error="StructureDefinition not found"),j}).catch(b=>(console.error(b),{...v,error:b})),w=new Rr(x);return u.current.set(S,w),w});!g||!p||Promise.all(g).then(v=>{if(s(v),!l)return;const S=v.findIndex(y=>y.value===l.value||y.resourceType===l.resourceType);if(S===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(v[S])}).catch(console.error)},[n,l,i]);const f=m.useCallback(p=>{const g=p?xt(p):void 0;o(g),t&&t(g)},[t]),h=m.useMemo(()=>i?i.map(p=>({value:p.value,label:p.type==="profile"?p.title??p.name??p.resourceType??p.value:p.value})):[],[i]);return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&a.jsx(Tt,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:p=>{const g=p.currentTarget.value,v=i.find(S=>S.value===g);c(v)},data:h}),!i&&a.jsx(u0,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:p=>{c(p?{type:"resourceType",value:p,resourceType:p}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Ja,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f})]})}function mz(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 pz(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 gz(e,t){const n=js(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
517
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
518
|
-
type,
|
|
519
|
-
name,
|
|
520
|
-
title,
|
|
521
|
-
}
|
|
522
|
-
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function vz(e){return e.type==="profile"&&!(e!=null&&e.error)&&Vt(e.resourceType)}const yz="_indented_ldk1d_1",KT={indented:yz};function YT({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(ie,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Wd,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(Zt,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Wd,{size:"1.25rem"})})}function XT({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(Zt,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Hd,{size:"1.25rem"})})}function xz(e){var h,p;const{slice:t,property:n}=e,[r,o]=m.useState(e.defaultValue),i=((h=t.typeSchema)==null?void 0:h.elements)??t.elements,s=m.useContext(on),l=m.useMemo(()=>{var g;if(zt(i))return Aa({parentContext:s,elements:i,path:e.path,profileUrl:(g=t.typeSchema)==null?void 0:g.url})},[s,e.path,(p=t.typeSchema)==null?void 0:p.url,i]);function c(g){o(g),e.onChange&&e.onChange(g)}const u=t.min>0,d=Vt(t.elements),f=cT(t.name);return dh(on.Provider,l,a.jsx(mt,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,children:a.jsxs(Ie,{className:d?KT.indented:void 0,children:[r.map((g,v)=>a.jsxs(Z,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${v}`,children:a.jsx(g0,{elementDefinitionType:t.type[0],name:t.name,defaultValue:g,onChange:S=>{const y=[...r];y[v]=S,c(y)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0})}),r.length>t.min&&a.jsx(XT,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${v}`,onClick:S=>{ft(S);const y=[...r];y.splice(v,1),c(y)}})]},`${v}-${r.length}`)),r.length<t.max&&a.jsx(Z,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(YT,{propertyDisplayName:f,onClick:g=>{ft(g);const v=[...r,void 0];c(v)},testId:e.testId&&`${e.testId}-add`})})]})}))}function wz(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function Sz(e){var y;const{property:t}=e,n=se(),[r,o]=m.useState(!0),[i,s]=m.useState([]),[l]=m.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=m.useState(()=>[l]),d=m.useContext(on),f=(y=t.type[0])==null?void 0:y.code;m.useEffect(()=>{VT({medplum:n,property:t}).then(x=>{s(x);const w=zT(l,x,t.slicing,d.profileUrl);bz(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 p=i.length,g=c[p],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=cs(t.path);return a.jsxs(Ie,{className:e.indent?KT.indented:void 0,children:[i.map((x,w)=>a.jsx(xz,{slice:x,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[w],onChange:b=>{h(b,w)},testId:`slice-${x.name}`},x.name)),v&&g.map((x,w)=>a.jsxs(Z,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Za,{arrayElement:!0,property:e.property,name:e.name+"."+w,path:e.path,valuePath:wz(e.path,e.valuePath,w),defaultValue:x,onChange:b=>{const j=[...g];j[w]=b,h(j,p)},defaultPropertyType:void 0,outcome:e.outcome})}),a.jsx(XT,{propertyDisplayName:S,testId:`nonsliced-remove-${w}`,onClick:b=>{ft(b);const j=[...g];j.splice(w,1),h(j,p)}})]},`${w}-${g.length}`)),v&&c.flat().length<t.max&&a.jsx(Z,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(YT,{propertyDisplayName:S,onClick:x=>{ft(x);const w=[...g];w.push(void 0),h(w,p)},testId:"nonsliced-add"})})]})}function bz(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 Cz(e){const[t,n]=m.useState(!1),r=ib(),o=m.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),a.jsxs(ss,{gap:"xs",children:[a.jsx(bs,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(Zt,{title:"Copy secret",onClick:()=>{var s;r.copy((s=o.current)==null?void 0:s.value),ve({color:"green",message:"Copied"})},children:a.jsx(kT,{})})]})}const Ez=["sun","mon","tue","wed","thu","fri","sat"];function jz(e){const[t,n]=m.useState(e.defaultValue),[r,o]=m.useState(!1),i=m.useRef();return i.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:sT(i.current)||"No repeat"}),a.jsx(ie,{onClick:()=>o(!0),children:"Edit"})]}),a.jsx(Pz,{visible:r,defaultValue:i.current,onOk:s=>{e.onChange&&e.onChange(s),n(s),o(!1)},onCancel:()=>o(!1)})]})}const zw={repeat:{period:1,periodUnit:"d"}};function Pz(e){const[t,n]=m.useState(e.defaultValue||zw),r=m.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(Nn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Ie,{children:[a.jsx(mt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(us,{name:"timing-dialog-start",onChange:u=>o(u)})}),a.jsx(Bc,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?zw.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(mt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ue,{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(Tt,{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(mt,{title:"Repeat on",children:a.jsx(lc.Group,{multiple:!0,onChange:c,children:a.jsx(Z,{justify:"space-between",mt:"md",gap:"xs",children:Ez.map(u=>a.jsx(lc,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),a.jsx(Z,{justify:"flex-end",children:a.jsx(ie,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Za(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===W.Attachment)return a.jsx(I8,{name:n,defaultValue:o,onChange:r});const c=((l=s[0])==null?void 0:l.code)!==W.Extension;return a.jsx(Sz,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:c,onChange:r,outcome:e.outcome})}else return s.length>1?a.jsx(Tz,{elementDefinitionTypes:s,...e}):a.jsx(g0,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",Qt(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,valuePath:e.valuePath})}function Tz(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=m.useState(n);return a.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(Tt,{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(g0,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",Qt(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath})]})}function g0(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:s}=e,l=e.min!==void 0&&e.min>0,c=e.elementDefinitionType.code,u=m.useContext(on),d=m.useMemo(()=>{if(!Wy(c)||!Vt(e.defaultValue))return e.defaultValue;const p=Object.create(null);if(u.path===e.path)Rw(p,u.elements);else{const g=fc(u.path,e.path);if(g===void 0)return e.defaultValue;Rw(p,u.elements,g)}return zt(p)?p:e.defaultValue},[c,u.path,u.elements,e.path,e.defaultValue]);if(!c)return a.jsx("div",{children:"Property type not specified "});function f(){return{name:t,defaultValue:d,onChange:n,outcome:r,path:i,valuePath:s}}function h(){const p=Xe(e.outcome,s??i);return{id:t,name:t,"data-testid":t,defaultValue:d,required:l,error:p}}switch(c){case W.SystemString:case W.canonical:case W.string:case W.time:case W.uri:case W.url:return e.path==="Project.secret.value[x]"?a.jsx(Cz,{...h(),onChange:p=>{e.onChange&&e.onChange(p.currentTarget.value)}}):a.jsx(ue,{...h(),onChange:p=>{n&&n(p.currentTarget.value)}});case W.date:return a.jsx(ue,{...h(),type:"date",onChange:p=>{n&&n(p.currentTarget.value)}});case W.dateTime:case W.instant:return a.jsx(us,{name:t,defaultValue:d,onChange:n,outcome:r});case W.decimal:case W.integer:case W.positiveInt:case W.unsignedInt:return a.jsx(ue,{...h(),type:"number",step:c===W.decimal?"any":"1",onChange:p=>{if(n){const g=p.currentTarget.valueAsNumber;n(Number.isNaN(g)?void 0:g)}}});case W.code:return a.jsx(OT,{...h(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case W.boolean:return a.jsx(wr,{...h(),defaultChecked:!!d,onChange:p=>{n&&n(p.currentTarget.checked)}});case W.base64Binary:case W.markdown:return a.jsx(bs,{...h(),spellCheck:c!==W.base64Binary,onChange:p=>{n&&n(p.currentTarget.value)}});case W.Address:return a.jsx(q6,{...f()});case W.Annotation:return a.jsx(G6,{...f()});case W.Attachment:return a.jsx(MT,{...f()});case W.CodeableConcept:return a.jsx(q8,{binding:o==null?void 0:o.valueSet,...f()});case W.Coding:return a.jsx(qT,{binding:o==null?void 0:o.valueSet,...f()});case W.ContactDetail:return a.jsx(X8,{...f()});case W.ContactPoint:return a.jsx(GT,{...f()});case W.Extension:return a.jsx(tz,{...f(),propertyType:e.elementDefinitionType});case W.HumanName:return a.jsx(nz,{...f()});case W.Identifier:return a.jsx(rz,{...f()});case W.Money:return a.jsx(iz,{...f()});case W.Period:return a.jsx(sz,{...f()});case W.Duration:case W.Quantity:return a.jsx(ds,{...f()});case W.Range:return a.jsx(p0,{...f()});case W.Ratio:return a.jsx(lz,{...f()});case W.Reference:return a.jsx(fh,{...f(),targetTypes:Rz(e.elementDefinitionType)});case W.Timing:return a.jsx(jz,{...f()});case W.Dosage:case W.UsageContext:default:return a.jsx(v0,{...f(),typeName:c})}}const kz=[`${n$}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function Rz(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=kz.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function _z(e){const[t,n]=m.useState(e.defaultValue??{}),r=m.useContext(on),o=m.useMemo(()=>F8(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const s={type:e.type,value:t};return a.jsx(Ie,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=B8(s,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,p=a.jsx(Za,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(WT({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||m0.includes(l)?p:c.type.length===1&&c.type[0].code==="boolean"?a.jsx(UT,{title:cs(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,children:p},l):a.jsx(mt,{title:cs(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,children:p},l)})})}function v0(e){const[t]=m.useState(()=>e.defaultValue??{}),n=m.useContext(on),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=m.useMemo(()=>nh(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,s=m.useMemo(()=>{if(o)return Aa({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url})},[o,e.path,n]);return o?dh(on.Provider,s,a.jsx(_z,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[i," not implemented"]})}const Dz="_root_1vii2_1",Iz={root:Dz};function tu(e){const{children:t,...n}=e;return a.jsx(sy,{className:Iz.root,...n,children:t})}const Az="_noteBody_10swh_1",Nz="_noteCite_10swh_5",Oz="_noteRoot_10swh_10",Vw={noteBody:Az,noteCite:Nz,noteRoot:Oz};function JT({value:e}){return e?a.jsx(Ie,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&a.jsx(ry,{classNames:{cite:Vw.noteCite,root:Vw.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function el(e){const{value:t,link:n,...r}=e,[o,i]=m.useState(),s=gt(t,i);let l;if(o&&!zP(o))l=`[${Oe(o)}]`;else if(s)l=_o(s);else return null;return n?a.jsx(Ge,{to:t,...r,children:l}):a.jsx(ce,{component:"span",...r,children:l})}function ya(e){return a.jsxs(Z,{gap:"xs",children:[a.jsx(ki,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(el,{value:e.value,link:e.link})]})}const Mz={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 y0(e){return a.jsx($c,{color:Mz[e.status],children:e.status})}const $z="_table_pe9td_1",Lz="_criticalRow_pe9td_12",Fz="_noteBody_pe9td_23",zz="_noteCite_pe9td_27",Vz="_noteRoot_pe9td_32",ZT={table:$z,criticalRow:Lz,noteBody:Fz,noteCite:zz,noteRoot:Vz};x0.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function x0(e){var s;const t=se(),n=gt(e.value),[r,o]=m.useState();if(m.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(Ie,{children:[a.jsx(me,{children:"Diagnostic Report"}),a.jsx(Bz,{value:n}),r&&!e.hideSpecimenInfo&&Uz(r),n.result&&a.jsx(Hz,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&a.jsx(JT,{value:i})]})}function Bz({value:e}){var t,n;return a.jsxs(Z,{mt:"md",gap:30,children:[e.subject&&a.jsxs("div",{children:[a.jsx(ce,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(ya,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>a.jsxs("div",{children:[a.jsx(ce,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(ya,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>a.jsxs("div",{children:[a.jsx(ce,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(ya,{value:r,link:!0})]},r.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(ce,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(ce,{children:Rn(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(ce,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(ce,{children:Qt(e.status)})]})]})}function Uz(e){return a.jsxs(Ie,{gap:"xs",children:[a.jsx(me,{order:2,size:"h6",children:"Specimens"}),a.jsx(Pn,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return a.jsx(Pn.Item,{ml:"sm",children:a.jsxs(Z,{gap:20,children:[a.jsxs(Z,{gap:5,children:[a.jsx(ce,{fw:500,children:"Collected:"})," ",Rn((n=t.collection)==null?void 0:n.collectedDateTime)]}),a.jsxs(Z,{gap:5,children:[a.jsx(ce,{fw:500,children:"Received:"})," ",Rn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Hz(e){return a.jsxs("table",{className:ZT.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(ek,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function ek(e){var t;return a.jsx(a.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>a.jsx(Wz,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${ks(n)?n.reference:n.id}`))})}function Wz(e){var o,i;const t=gt(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=Qz(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:it({[ZT.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(Ge,{to:t,children:a.jsx(so,{value:t.code})})}),a.jsx("td",{children:a.jsx(qz,{value:t})}),a.jsx("td",{children:a.jsx(Gz,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(so,{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(so,{value:s})},`category-${bi(s)}`))})}),a.jsx("td",{children:(i=t.performer)==null?void 0:i.map(s=>a.jsx(Gd,{value:s},s.reference))}),a.jsx("td",{children:t.status&&a.jsx(y0,{status:t.status})})]}),t.hasMember&&a.jsx(ek,{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(JT,{value:t.note})})})]})}function qz(e){const t=e.value;return a.jsx(a.Fragment,{children:aT(t)})}function Gz(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(h0,{value:t}):null}function Qz(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 Kz="_paper_1igaj_1",Yz="_fill_1igaj_20",Bw={paper:Kz,fill:Yz};function w0(e){const{width:t,fill:n,className:r,children:o,...i}=e,s=t?{maxWidth:t}:void 0;return a.jsx(Un,{className:it(Bw.paper,n&&Bw.fill,r),style:s,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var tk={},nu={};Object.defineProperty(nu,"__esModule",{value:!0});nu.Pointer=void 0;function Xz(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Jz(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var Zz=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(Xz);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(Jz).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}();nu.Pointer=Zz;var $t={},S0={};(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})(S0);var jn={};Object.defineProperty(jn,"__esModule",{value:!0});jn.diffAny=jn.diffObjects=jn.diffArrays=jn.intersection=jn.subtract=jn.isDestructive=void 0;var yc=S0;function eV(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}jn.isDestructive=eV;function Kp(e,t){var n={};for(var r in e)yc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)yc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}jn.subtract=Kp;function nk(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)yc.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)}jn.intersection=nk;function tV(e){return e.op==="add"}function nV(e){return e.op==="remove"}function vm(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function rk(e,t,n,r){r===void 0&&(r=hh);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),p=o[h];if(p===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)p=i(d-1,f-1);else{var g=[];if(d>0){var v=i(d-1,f),S={op:"remove",index:d-1};g.push(vm(v,S))}if(f>0){var y=i(d,f-1),x={op:"add",index:d-1,value:t[f-1]};g.push(vm(y,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(vm(w,b))}var j=g.sort(function(E,T){return E.cost-T.cost})[0];p=j}o[h]=p}return p}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],p=d[1];if(tV(f)){var g=f.index+1+p,v=g<s+p?String(g):"-",S={op:f.op,path:n.add(v).toString(),value:f.value};return[h.concat(S),p+1]}else if(nV(f)){var S={op:f.op,path:n.add(String(f.index+p)).toString()};return[h.concat(S),p-1]}else{var y=n.add(String(f.index+p)),x=r(f.original,f.value,y);return[h.concat.apply(h,x),p]}},[[],0])[0];return u}jn.diffArrays=rk;function ok(e,t,n,r){r===void 0&&(r=hh);var o=[];return Kp(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),Kp(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),nk([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}jn.diffObjects=ok;function hh(e,t,n,r){if(r===void 0&&(r=hh),e===t)return[];var o=(0,yc.objectType)(e),i=(0,yc.objectType)(t);return o=="array"&&i=="array"?rk(e,t,n,r):o=="object"&&i=="object"?ok(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}jn.diffAny=hh;var b0=B0&&B0.__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($t,"__esModule",{value:!0});$t.apply=$t.InvalidOperationError=$t.test=$t.copy=$t.move=$t.replace=$t.remove=$t.add=$t.TestError=$t.MissingError=void 0;var Io=nu,C0=S0,rV=jn,ao=function(e){b0(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);$t.MissingError=ao;var ik=function(e){b0(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);$t.TestError=ik;function E0(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 sk(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function ak(e,t){var n=Io.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new ao(t.path):(E0(n.parent,n.key,(0,C0.clone)(t.value)),null)}$t.add=ak;function lk(e,t){var n=Io.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new ao(t.path):(sk(n.parent,n.key),null)}$t.remove=lk;function ck(e,t){var n=Io.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new ao(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new ao(t.path)}else if(n.value===void 0)return new ao(t.path);return n.parent[n.key]=(0,C0.clone)(t.value),null}$t.replace=ck;function uk(e,t){var n=Io.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new ao(t.from);var r=Io.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new ao(t.path):(sk(n.parent,n.key),E0(r.parent,r.key,n.value),null)}$t.move=uk;function dk(e,t){var n=Io.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new ao(t.from);var r=Io.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new ao(t.path):(E0(r.parent,r.key,(0,C0.clone)(n.value)),null)}$t.copy=dk;function fk(e,t){var n=Io.Pointer.fromJSON(t.path).evaluate(e);return(0,rV.diffAny)(n.value,t.value,new Io.Pointer).length?new ik(n.value,t.value):null}$t.test=fk;var hk=function(e){b0(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);$t.InvalidOperationError=hk;function oV(e,t){switch(t.op){case"add":return ak(e,t);case"remove":return lk(e,t);case"replace":return ck(e,t);case"move":return uk(e,t);case"copy":return dk(e,t);case"test":return fk(e,t)}return new hk(t)}$t.apply=oV;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=nu;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=$t,r=jn;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,p){var g=u(f,h,p);return Array.isArray(g)?g:(0,r.diffAny)(f,h,p,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 p=l(u,h.path);if(p&&f.push(p),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(tk);const iV="_root_w6lfx_1",sV="_removed_w6lfx_16",aV="_added_w6lfx_21",ym={root:iV,removed:sV,added:aV};function lV(e){const t=se(),{original:n,revised:r}=e,[o,i]=m.useState(!1);m.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const s=m.useMemo(()=>{if(!o)return null;const l=[co(n)],c=[co(r)],u=[],d=cV(tk.createPatch(n,r));for(const f of d){const h=f.path,p=uV(h),g=dV(n.resourceType,p),v=f.op==="add"?void 0:gc(p,l),S=f.op==="remove"?void 0:gc(p,c);u.push({key:`op-${f.op}-${f.path}`,name:`${Qt(f.op)} ${p}`,path:(g==null?void 0:g.path)??n.resourceType+"."+p,property:g,originalValue:Uw(g,v),revisedValue:Uw(g,S)})}return u},[o,n,r]);return s?a.jsxs(le,{className:ym.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:ym.removed,children:l.originalValue&&a.jsx(Br,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),a.jsx(le.Td,{className:ym.added,children:l.revisedValue&&a.jsx(Br,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function cV(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 uV(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 dV(e,t){var r;const n=ih(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 Uw(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:fV(t,!!(e!=null&&e.isArray))}}function fV(e,t){const n=FL(e).flatMap(r=>r.value);return t?n:n[0]}function j0(e){const{profileUrl:t}=e,n=se(),r=gt(e.value),[o,i]=m.useState();return m.useEffect(()=>{if(r)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{const s=js(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(Qd,{path:r.resourceType,value:{type:o,value:e.forceUseInput?e.value:r},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues})}function hV(e){return a.jsx(tu,{children:e.children})}function fs(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(w0,{"data-testid":"timeline-item",fill:!0,...i,children:[a.jsxs(Z,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(ki,{value:s,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(ce,{size:"sm",children:a.jsx(el,{c:"dark",fw:500,value:s,link:!0})}),a.jsxs(ce,{size:"xs",children:[a.jsx(Ge,{c:"dimmed",to:e.resource,children:Rn(l)}),a.jsx(ce,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(Ge,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(ne,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(ne.Target,{children:a.jsx(Zt,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${wt(e.resource)}`,children:a.jsx(uF,{})})}),o]})]}),a.jsxs(IT,{children:[r&&a.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!r&&a.jsx(a.Fragment,{children:e.children})]})]})}function mk(e,t){e.sort((n,r)=>{const o=Hw(n,t),i=Hw(r,t);return o>i?1:o<i?-1:Ww(n,t)-Ww(r,t)})}function Hw(e,t){if(!pk(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function Ww(e,t){var r;if(!pk(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 pk(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const mV="_pinnedComment_5uxzi_2",pV={pinnedComment:mV};function mh(e){const t=se(),n=lh(),r=t.getProfile(),o=m.useRef(null),i=gt(e.value),[s,l]=m.useState(),[c,u]=m.useState([]),d=e.loadTimelineResources,f=m.useRef(c);f.current=c;const h=m.useCallback(I=>{mk(I,i),I.reverse(),u(I)},[i]),p=m.useCallback(I=>{const L=[];for(const F of I){if(F.status!=="fulfilled")continue;const O=F.value;if(O.type==="history"&&l(O),O.entry)for(const A of O.entry)L.push(A.resource)}h(L)},[h]),g=m.useCallback(I=>h([...f.current,I]),[h]),v=m.useCallback(()=>{var F;let I,L;"resourceType"in e.value?(I=e.value.resourceType,L=e.value.id):[I,L]=(F=e.value.reference)==null?void 0:F.split("/"),d(t,I,L).then(p).catch(console.error)},[t,e.value,d,p]);m.useEffect(()=>v(),[v]);function S(I){!i||!e.createCommunication||t.createResource(e.createCommunication(i,r,I)).then(L=>g(L)).catch(console.error)}function y(I){!i||!e.createMedia||t.createResource(e.createMedia(i,r,I)).then(L=>g(L)).then(()=>kl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(uh,{size:16}),autoClose:2e3})).catch(L=>kl({id:"upload-notification",color:"red",title:"Upload error",message:Oe(L),icon:a.jsx(Nw,{size:16}),autoClose:2e3}))}function x(I,L){return t.updateResource({...I,priority:L})}function w(I){x(I,"stat").then(v).catch(console.error)}function b(I){x(I,"routine").then(v).catch(console.error)}function j(I){n(`/${I.resourceType}/${I.id}`)}function E(I){n(`/${I.resourceType}/${I.id}/edit`)}function T(I){n(`/${I.resourceType}/${I.id}/delete`)}function P(I){var L;n(`/${I.resourceType}/${I.id}/_history/${(L=I.meta)==null?void 0:L.versionId}`)}function _(){ve({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(I){kl({id:"upload-notification",loading:!0,title:"Uploading...",message:bV(I),autoClose:!1,withCloseButton:!1})}function $(I){kl({id:"upload-notification",color:"red",title:"Upload error",message:Oe(I),icon:a.jsx(Nw,{size:16}),autoClose:2e3})}return i?a.jsxs(hV,{children:[e.createCommunication&&a.jsx(w0,{children:a.jsx(Ye,{testid:"timeline-form",onSubmit:I=>{S(I.text);const L=o.current;L&&(L.value="",L.focus())},children:a.jsxs(Z,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(ki,{value:r}),a.jsx(ue,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(Zt,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(wF,{size:16})}),a.jsx(f0,{securityContext:xt(i),onUpload:y,onUploadStart:_,onUploadProgress:D,onUploadError:$,children:I=>a.jsx(Zt,{...I,radius:"xl",color:"blue",variant:"filled",children:a.jsx(o0,{size:16})})})]})})}),c.map(I=>{var F;if(!I)return null;const L=`${I.resourceType}/${I.id}/${(F=I.meta)==null?void 0:F.versionId}`;if(I.resourceType===i.resourceType&&I.id===i.id)return a.jsx(gV,{history:s,resource:I,onDetails:P},L);switch(I.resourceType){case"AuditEvent":return a.jsx(wV,{resource:I,onDetails:j},L);case"Communication":return a.jsx(yV,{resource:I,onPin:I.priority!=="stat"?w:void 0,onUnpin:I.priority==="stat"?b:void 0,onDetails:j,onEdit:E,onDelete:T},L);case"DiagnosticReport":return a.jsx(SV,{resource:I,onDetails:j,onEdit:E,onDelete:T},L);case"Media":return a.jsx(xV,{resource:I,onDetails:j,onEdit:E,onDelete:T},L);default:return a.jsx(fs,{resource:I,padding:!0,children:a.jsx(j0,{value:I,ignoreMissingValues:!0})},L)}})]}):a.jsx(cn,{style:{width:"100%",height:"100%"},children:a.jsx(qn,{})})}function Oa(e){return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Label,{children:"Resource"}),e.onPin&&a.jsx(ne.Item,{leftSection:a.jsx(CF,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${wt(e.resource)}`,children:"Pin"}),e.onUnpin&&a.jsx(ne.Item,{leftSection:a.jsx(EF,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${wt(e.resource)}`,children:"Unpin"}),e.onDetails&&a.jsx(ne.Item,{leftSection:a.jsx(gF,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${wt(e.resource)}`,children:"Details"}),e.onEdit&&a.jsx(ne.Item,{leftSection:a.jsx(dF,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${wt(e.resource)}`,children:"Edit"}),e.onDelete&&a.jsxs(a.Fragment,{children:[a.jsx(ne.Divider,{}),a.jsx(ne.Label,{children:"Danger zone"}),a.jsx(ne.Item,{color:"red",leftSection:a.jsx(DT,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${wt(e.resource)}`,children:"Delete"})]})]})}function gV(e){const t=vV(e.history,e.resource);return t?a.jsx(fs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Oa,{...e}),children:a.jsx(lV,{original:t,revised:e.resource})}):a.jsxs(fs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Oa,{...e}),children:[a.jsx("h3",{children:"Created"}),a.jsx(j0,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function vV(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 yV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:pV.pinnedComment;return a.jsx(fs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:a.jsx(Oa,{...e}),children:a.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function xV(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(fs,{resource:e.resource,padding:!!n,popupMenuItems:a.jsx(Oa,{...e}),children:a.jsx(Jc,{value:e.resource.content})})}function wV(e){return a.jsx(fs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Oa,{...e}),children:a.jsx(br,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function SV(e){return a.jsx(fs,{resource:e.resource,padding:!0,popupMenuItems:a.jsx(Oa,{...e}),children:a.jsx(x0,{value:e.resource})})}function bV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${xm(e.loaded)} / ${xm(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${xm(e.loaded)}`}function xm(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 CV(e){return a.jsx(mh,{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 _e(e){const{children:t,...n}=e;return a.jsx(tu,{children:a.jsx(w0,{...n,children:t})})}function EV(e){return a.jsx(mh,{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:xt(t),subject:t.subject,sender:xt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",encounter:xt(t),subject:t.subject,operator:xt(n),issued:new Date().toISOString(),content:r})})}function jV(e){let t;try{t=A7(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(Br,{value:t[0]||"",propertyType:e.propertyType})}function PV(e){return a.jsxs(Nn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(G,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(qw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(qw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(ce,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function qw(e){return a.jsx(ie,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const TV={string:[ae.EQUALS,ae.NOT,ae.CONTAINS,ae.EXACT],fulltext:[ae.EQUALS,ae.NOT,ae.CONTAINS,ae.EXACT],token:[ae.EQUALS,ae.NOT],reference:[ae.EQUALS,ae.NOT],numeric:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS],quantity:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS],date:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS,ae.STARTS_AFTER,ae.ENDS_BEFORE,ae.APPROXIMATELY],datetime:[ae.EQUALS,ae.NOT_EQUALS,ae.GREATER_THAN,ae.LESS_THAN,ae.GREATER_THAN_OR_EQUALS,ae.LESS_THAN_OR_EQUALS,ae.STARTS_AFTER,ae.ENDS_BEFORE,ae.APPROXIMATELY]},kV={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 P0(e,t){return{...e,filters:t,offset:0,name:void 0}}function T0(e,t){return P0(e,(e.filters??[]).filter(n=>n.code!==t))}function ph(e,t,n,r,o){o&&(e=T0(e,t));const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),P0(e,i)}function RV(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function _V(e,t){return k0(e,t,-1)}function DV(e,t){return k0(e,t,0)}function IV(e,t){return k0(e,t,1)}function k0(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),_0(e,t,r,o)}function AV(e,t){return R0(e,t,-1)}function NV(e,t){return R0(e,t,0)}function OV(e,t){return R0(e,t,1)}function R0(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),_0(e,t,r,o)}function MV(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),_0(e,t,n,new Date)}function _0(e,t,n,r){return e=T0(e,t),e=Gw(e,t,ae.GREATER_THAN_OR_EQUALS,n),e=Gw(e,t,ae.LESS_THAN_OR_EQUALS,r),e}function Gw(e,t,n,r){return ph(e,t,n,r.toISOString())}function Qw(e,t,n=!0){return ph(e,t,ae.MISSING,n.toString())}function $V(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function LV(e,t){const n=e.count??sh,r=(t-1)*n;return $V(e,r)}function FV(e,t,n){return t===zV(e)&&n!==void 0&&n===VV(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function zV(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function VV(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function BV(e){return TV[e.type]}function D0(e){return kV[e]??""}function Ci(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(Qt).join(" "))}function UV(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"?Rn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?HV(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?WV(e,t.searchParams[0]):null}function HV(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]=Zc({type:e.resourceType,value:e},n);return r?a.jsx(Br,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function WV(e,t){const n=gc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(Br,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function qV(e){const t=m.useRef(!1),[n,r]=m.useState({search:JSON.parse(or(e.search))}),[o,i]=m.useState(!1);m.useEffect(()=>{r({search:e.search})},[e.search]);const s=m.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=qP(c),d=qy(c);return hc(GV(u,d)).map(f=>({value:f,label:Ci(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return a.jsx(Nn,{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(Ie,{children:[a.jsx(qf,{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(Z,{justify:"flex-end",children:a.jsx(ie,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function GV(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(Ci(i));if(t)for(const i of Object.keys(t)){const s=Ci(i);!r.has(i)&&!o.has(s)&&(n.push(i),r.add(i),o.add(s))}return n}function gk(e){var o;const{resourceType:t,filter:n}=e,r=(o=Do.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===ae.EQUALS||n.operator===ae.NOT_EQUALS))return a.jsx(el,{value:{reference:n.value}});const i=ih(t,r);if(n.code==="_lastUpdated"||i.type===Zo.DATETIME)return a.jsx(a.Fragment,{children:Rn(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function vk(e){const t=ih(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case Zo.REFERENCE:return a.jsx(fh,{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 Zo.BOOLEAN:return a.jsx(wr,{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 Zo.DATE:return a.jsx(ue,{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 Zo.DATETIME:return a.jsx(us,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Zo.NUMBER:return a.jsx(ue,{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 Zo.QUANTITY:return a.jsx(ds,{name:n,defaultValue:QV(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(ue,{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 QV(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function KV(e){const[t,n]=m.useState(JSON.parse(or(e.search))),[r,o]=m.useState(-1),i=m.useRef(t);i.current=t,m.useEffect(()=>{n(JSON.parse(or(e.search)))},[e.search]);function s(d){n(ph(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=qy(l)??{},u=t.filters||[];return a.jsxs(Nn,{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(Kw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const p=[...u];p[f]=h,n(P0(i.current,p)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):a.jsx(YV,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(RV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),a.jsx(Kw,{resourceType:l,searchParams:c,okText:"Add",onOk:s})]})]})}),a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function YV(e){const{filter:t}=e;return a.jsxs("tr",{children:[a.jsx("td",{children:Ci(t.code)}),a.jsx("td",{children:D0(t.operator)}),a.jsx("td",{children:a.jsx(gk,{resourceType:e.resourceType,filter:t})}),a.jsxs("td",{children:[a.jsx(ie,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),a.jsx(ie,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function Kw(e){const[t,n]=m.useState(e.defaultValue??{}),r=m.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&&BV(l);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Tt,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Ci(u)}))]})}),a.jsx("td",{children:c&&a.jsx(Tt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:D0(u)}))]})}),a.jsx("td",{children:l&&t.operator&&a.jsx(vk,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:s})}),a.jsxs("td",{children:[t.code&&t.operator&&a.jsx(ie,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&a.jsx(ie,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function XV(e){const[t,n]=m.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Nn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(Ye,{onSubmit:r,children:a.jsxs(Zn,{children:[a.jsx(Zn.Col,{span:10,children:a.jsx(vk,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(Zn.Col,{span:2,children:a.jsx(ie,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function JV(e){if(!e.searchParams)return null;function t(i,s){o(FV(e.search,i.code,s))}function n(i){o(T0(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(ZV,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(ne.Dropdown,{children:e.searchParams.map(i=>a.jsx(ne.Item,{children:Ci(i.code)},i.code))})}function ZV(e){switch(e.searchParam.type){case"date":return a.jsx(eB,{...e});case"number":case"quantity":return a.jsx(tB,{...e});case"reference":return a.jsx(nB,{...e});case"string":return a.jsx(rB,{...e});case"token":case"uri":return a.jsx(oB,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function eB(e){const{searchParam:t}=e,n=t.code;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(i0,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(ne.Item,{leftSection:a.jsx(s0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT_EQUALS),children:"Does not equal..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(_T,{size:14}),onClick:()=>e.onPrompt(t,ae.ENDS_BEFORE),children:"Before..."}),a.jsx(ne.Item,{leftSection:a.jsx(RT,{size:14}),onClick:()=>e.onPrompt(t,ae.STARTS_AFTER),children:"After..."}),a.jsx(ne.Item,{leftSection:a.jsx(tF,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Between..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(IV(e.search,n)),children:"Tomorrow"}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(DV(e.search,n)),children:"Today"}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(_V(e.search,n)),children:"Yesterday"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(OV(e.search,n)),children:"Next Month"}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(NV(e.search,n)),children:"This Month"}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(AV(e.search,n)),children:"Last Month"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Oi,{size:14}),onClick:()=>e.onChange(MV(e.search,n)),children:"Year to date"}),a.jsx(ru,{...e})]})}function tB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(i0,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(ne.Item,{leftSection:a.jsx(s0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT_EQUALS),children:"Does not equal..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(RT,{size:14}),onClick:()=>e.onPrompt(t,ae.GREATER_THAN),children:"Greater than..."}),a.jsx(ne.Item,{leftSection:a.jsx(Gp,{size:14}),onClick:()=>e.onPrompt(t,ae.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(ne.Item,{leftSection:a.jsx(_T,{size:14}),onClick:()=>e.onPrompt(t,ae.LESS_THAN),children:"Less than..."}),a.jsx(ne.Item,{leftSection:a.jsx(Gp,{size:14}),onClick:()=>e.onPrompt(t,ae.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(ru,{...e})]})}function nB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT),children:"Does not equal..."}),a.jsx(ru,{...e})]})}function rB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(i0,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(ne.Item,{leftSection:a.jsx(s0,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT),children:"Does not equal..."}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(oF,{size:14}),onClick:()=>e.onPrompt(t,ae.CONTAINS),children:"Contains..."}),a.jsx(ne.Item,{leftSection:a.jsx(rF,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Does not contain..."}),a.jsx(ru,{...e})]})}function oB(e){const{searchParam:t}=e;return a.jsxs(ne.Dropdown,{children:[a.jsx(ne.Item,{leftSection:a.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ae.EQUALS),children:"Equals..."}),a.jsx(ne.Item,{leftSection:a.jsx(Yc,{size:14}),onClick:()=>e.onPrompt(t,ae.NOT),children:"Does not equal..."}),a.jsx(ru,{...e})]})}function ru(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(Z6,{size:14}),onClick:()=>e.onChange(Qw(e.search,n)),children:"Missing"}),a.jsx(ne.Item,{leftSection:a.jsx(J6,{size:14}),onClick:()=>e.onChange(Qw(e.search,n,!1)),children:"Not missing"}),a.jsx(ne.Divider,{}),a.jsx(ne.Item,{leftSection:a.jsx(qd,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const iB="_root_vlout_1",sB="_table_vlout_8",aB="_tr_vlout_12",lB="_th_vlout_18",cB="_control_vlout_22",uB="_icon_vlout_31",vl={root:iB,table:sB,tr:aB,th:lB,control:cB,icon:uB};function dB(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(fB(t,r));return n}function fB(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=Ts(e,t),r=r7(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=qy(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=ih(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class hB extends Event{constructor(t){super("change"),this.definition=t}}class mB extends Event{constructor(t){super("load"),this.response=t}}class Kd extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function pB(e){var F,O,A;const t=se(),[n,r]=m.useState(),[o,i]=m.useState(),{search:s,onLoad:l}=e,[c,u]=m.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=m.useRef(c);d.current=c;const f=s.total??"accurate",h=m.useCallback(R=>{i(void 0),t.search(s.resourceType,ia({...s,total:f,fields:void 0}),R).then(k=>{u({...d.current,searchResponse:k}),l&&l(new mB(k))}).catch(k=>{u({...d.current,searchResponse:void 0}),i(k)})},[t,s,f,l]),p=m.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);m.useEffect(()=>{h()},[h]);function g(R,k){R.stopPropagation();const B=R.target.checked,U={...d.current.selected};B?U[k]=!0:delete U[k],u({...d.current,selected:U})}function v(R){R.stopPropagation();const M=R.target.checked,B={},U=d.current.searchResponse;M&&(U!=null&&U.entry)&&U.entry.forEach(X=>{var re;(re=X.resource)!=null&&re.id&&(B[X.resource.id]=!0)}),u({...d.current,selected:B})}function S(){var k,M;const R=d.current;if(!((k=R.searchResponse)!=null&&k.entry)||R.searchResponse.entry.length===0)return!1;for(const B of R.searchResponse.entry)if((M=B.resource)!=null&&M.id&&!R.selected[B.resource.id])return!1;return!0}function y(R){e.onChange&&e.onChange(new hB(R))}function x(R,k){if(AT(R.target)||R.button===2)return;ft(R);const M=R.button===1||R.ctrlKey||R.metaKey;!M&&e.onClick&&e.onClick(new Kd(k,R)),M&&e.onAuxClick&&e.onAuxClick(new Kd(k,R))}function w(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(m.useEffect(()=>{r(e.search.resourceType),t.requestSchema(e.search.resourceType).catch(console.error).finally(()=>r(void 0))},[t,e.search.resourceType]),!WP(e.search.resourceType)||n===e.search.resourceType)return a.jsx(cn,{style:{width:"100%",height:"100%"},children:a.jsx(qn,{})});const b=e.checkboxesEnabled,j=dB(s),E=s.resourceType,T=c.searchResponse,P=T==null?void 0:T.entry,_=P==null?void 0:P.map(R=>R.resource),D="subtle",$="gray",I=16,L=window.innerWidth<768;return a.jsxs("div",{className:vl.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(Z,{justify:"space-between",mb:"xl",children:[a.jsxs(Z,{gap:2,children:[a.jsx(ie,{size:"compact-md",variant:D,color:$,leftSection:a.jsx(aF,{size:I}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),a.jsx(ie,{size:"compact-md",variant:D,color:$,leftSection:a.jsx(hF,{size:I}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&a.jsx(ie,{size:"compact-md",variant:D,color:$,leftSection:a.jsx(fF,{size:I}),onClick:e.onNew,children:"New..."}),!L&&w()&&a.jsx(ie,{size:"compact-md",variant:D,color:$,leftSection:a.jsx(OF,{size:I}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!L&&e.onDelete&&a.jsx(ie,{size:"compact-md",variant:D,color:$,leftSection:a.jsx(DT,{size:I}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!L&&e.onBulk&&a.jsx(ie,{size:"compact-md",variant:D,color:$,leftSection:a.jsx(eF,{size:I}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),a.jsxs(Z,{gap:2,children:[T&&a.jsxs(ce,{size:"xs",c:"dimmed","data-testid":"count-display",children:[yk(s,T).toLocaleString(),"-",xB(s,T).toLocaleString(),T.total!==void 0&&` of ${s.total==="estimate"?"~":""}${(F=T.total)==null?void 0:F.toLocaleString()}`]}),a.jsx(Zt,{variant:D,color:$,title:"Refresh",onClick:p,children:a.jsx(kF,{size:I})})]})]}),a.jsxs(le,{className:vl.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=>v(R)})}),j.map(R=>a.jsx(le.Th,{children:a.jsxs(ne,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(ne.Target,{children:a.jsx(kn,{className:vl.control,p:2,children:a.jsxs(Z,{justify:"space-between",wrap:"nowrap",children:[a.jsx(ce,{fw:500,children:Ci(R.name)}),a.jsx(cn,{className:vl.icon,children:a.jsx(K6,{size:14,stroke:1.5})})]})})}),a.jsx(JV,{search:e.search,searchParams:R.searchParams,onPrompt:(k,M)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:k,filterDialogFilter:M})},onChange:k=>{y(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(gB,{resourceType:E,searchParams:R.searchParams,filters:e.search.filters})},R.name))]})]}),a.jsx(le.Tbody,{children:_==null?void 0:_.map(R=>R&&a.jsxs(le.Tr,{className:vl.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:UV(R,k)},k.name))]},R.id))})]}),(_==null?void 0:_.length)===0&&a.jsx(tu,{children:a.jsx(cn,{style:{height:150},children:a.jsx(ce,{size:"xl",c:"dimmed",children:"No results"})})}),T&&a.jsx(cn,{m:"md",p:"md",children:a.jsx(Wr,{value:vB(s),total:yB(s,T),onChange:R=>y(LV(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(qV,{search:e.search,visible:d.current.fieldEditorVisible,onOk:R=>{y(R),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),a.jsx(KV,{search:e.search,visible:d.current.filterEditorVisible,onOk:R=>{y(R),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),a.jsx(PV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),a.jsx(XV,{visible:d.current.filterDialogVisible,title:(O=c.filterDialogSearchParam)!=null&&O.code?Ci(c.filterDialogSearchParam.code):"",resourceType:E,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:R=>{y(ph(e.search,R.code,R.operator,R.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(A=c.filterDialogSearchParam)==null?void 0:A.code)]})}const ou=m.memo(pB);function gB(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:[D0(n.operator)," ",a.jsx(gk,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function vB(e){return Math.floor((e.offset??0)/(e.count??sh))+1}function yB(e,t){const n=e.count??sh,r=xk(e,t);return Math.ceil(r/n)}function yk(e,t){return Math.min(xk(e,t),(e.offset??0)+1)}function xB(e,t){var n;return Math.max(yk(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function xk(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 wB(e){const t=se(),[n,r]=m.useState(!1),[o,i]=m.useState(),{query:s,fields:l}=e,[c,u]=m.useState(),[d,f]=m.useState({}),h=m.useRef();h.current=c;const p=m.useRef({});p.current=d,m.useEffect(()=>{i(void 0),t.graphql(s).then(u).catch(w=>i(pt(w)))},[t,s]);function g(w,b){w.stopPropagation();const E=w.target.checked,T={...p.current};E?T[b]=!0:delete T[b],f(T)}function v(w){var P;w.stopPropagation();const j=w.target.checked,E={},T=(P=h.current)==null?void 0:P.data.ResourceList;j&&T&&T.forEach(_=>{_.id&&(E[_.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&&!p.current[j.id])return!1;return!0}function y(w,b){AT(w.target)||(ft(w),w.button!==1&&e.onClick&&e.onClick(new Kd(b,w)),w.button===1&&e.onAuxClick&&e.onAuxClick(new Kd(b,w)))}if(m.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(qn,{});const x=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:w=>ft(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=>v(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=>y(b,w),onAuxClick:b=>y(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(jV,{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(ie,{onClick:()=>e.onBulk(Object.keys(p.current)),children:"Bulk..."})]})}const SB=m.memo(wB);function qr(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 bB(e){const{group:t}=e;return a.jsx(Un,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(Z,{children:[t.measureScore&&a.jsx(jB,{group:t}),!t.measureScore&&a.jsx(EB,{group:t})]})})}function CB(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(ce,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(ce,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function EB(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>bi(c.code)==="numerator"),o=n==null?void 0:n.find(c=>bi(c.code)==="denominator"),i=r==null?void 0:r.count,s=o==null?void 0:o.count;if(s===0)return a.jsxs(G,{children:[a.jsx(me,{order:3,children:"Not Applicable"}),a.jsx(ce,{children:`Denominator: ${s}`})]});if(i===void 0||s===void 0)return a.jsxs(G,{children:[a.jsx(me,{order:3,children:"Insufficient Data"}),a.jsx(ce,{children:`Numerator: ${i}`}),a.jsx(ce,{children:`Denominator: ${s}`})]});const l=i/s*100;return a.jsx(Zf,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:wk(l)}],label:a.jsx(ss,{justify:"center",children:a.jsxs(ce,{fw:700,fz:18,children:[i," / ",s]})})})}function jB(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(Zf,{size:120,thickness:12,roundCaps:!0,sections:[{value:PB(t),color:wk(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:a.jsx(ss,{justify:"center",children:a.jsx(ce,{fw:700,fz:18,children:a.jsx(vc,{value:t.measureScore})})})}):a.jsx(ss,{h:120,align:"center",children:a.jsx(me,{order:3,children:a.jsx(vc,{value:t.measureScore})})})})}function PB(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 wk(e){return e<=33?"red":e<=67?"yellow":"green"}function TB(e){var r;const t=gt(e.measureReport),[n]=H6("Measure",{url:t==null?void 0:t.measure});return t?a.jsxs(G,{children:[n&&a.jsx(CB,{measure:n}),a.jsx(ky,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>a.jsx(bB,{group:o},o.id??i))})]}):null}function Gr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:a.jsx(Ss,{icon:a.jsx(Kc,{size:16}),color:"red",children:t.map(r=>{var o;return a.jsx("div",{"data-testid":"text-field-error",children:BP(r)},(o=r.details)==null?void 0:o.text)})})}function kB(e){const t=m.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(mh,{value:e.patient,loadTimelineResources:t,createCommunication:(n,r,o)=>({resourceType:"Communication",status:"completed",subject:xt(n),sender:xt(r),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(n,r,o)=>({resourceType:"Media",status:"completed",subject:xt(n),operator:xt(r),issued:new Date().toISOString(),content:o})})}const RB="_section_14dzq_2",_B="_hovering_14dzq_11",DB="_editing_14dzq_15",IB="_bottomActions_14dzq_20",sa={section:RB,hovering:_B,editing:DB,bottomActions:IB};function AB(e){const t=se(),n=gt(e.value),[r,o]=m.useState(!1),[i,s]=m.useState(),[l,c]=m.useState(),[u,d]=m.useState();function f(){c(void 0)}function h(){s(void 0)}const p=m.useRef();if(p.current=u,m.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),m.useEffect(()=>(d(FB(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(v,S){d({...p.current,[v]:S})}return a.jsx("div",{children:a.jsxs(Ye,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[a.jsx(ue,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),a.jsx(Sk,{actions:u.action||[],selectedKey:i,setSelectedKey:s,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),a.jsx(ie,{type:"submit",children:"Save"})]})})}function Sk(e){const t=m.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:sa.section,children:[e.actions.map(i=>a.jsx("div",{children:a.jsx(NB,{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:sa.bottomActions,children:a.jsx(Je,{href:"#",onClick:i=>{ft(i),r({id:Ck()})},children:"Add action"})})]})}function NB(e){const{action:t}=e,n=LB(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){ft(c),e.setHoverKey(e.action.id)}const l=it(sa.section,{[sa.editing]:r,[sa.hovering]:o&&!r});return a.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:s,onFocus:s,children:[r?a.jsx(MB,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):a.jsx(OB,{action:t,actionType:n}),a.jsx("div",{className:sa.bottomActions,children:a.jsx(Je,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Yp={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function OB(e){const{action:t,actionType:n}=e,[r,o]=bk(t);return a.jsxs("div",{children:[a.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&a.jsx("div",{children:a.jsx(Gd,{value:{reference:t.definitionCanonical}})}),r&&a.jsx("div",{children:a.jsx(Br,{property:Yp,propertyType:o,value:r})})]})}function MB(e){const{action:t}=e,[n,r]=m.useState(e.actionType);function o(i,s){e.onChange({...t,[i]:s})}return a.jsxs(Ie,{gap:"xl",children:[a.jsx(ue,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),a.jsx(ue,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),a.jsx(Tt,{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(Sk,{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(Vu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return a.jsx(Vu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return a.jsx(Vu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return a.jsx(Vu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),a.jsx(mt,{title:"Timing",description:"When the action should take place.",children:a.jsx($B,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Vu(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(Ja,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:wt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function $B(e){const t=e.action,n="timing",[r,o]=bk(t);return a.jsx(Za,{property:Yp,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,s)=>{e.onChange(WT(t,n,s??n,Yp,i))},outcome:void 0})}function LB(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 bk(e){return Zc({type:"PlanDefinitionAction",value:e},"timing")}let wm=1;function Ck(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(wm=Math.max(wm,t+1))}return e}return"id-"+wm++}function FB(e){return{...e,action:Ek(e.action)}}function Ek(e){if(e)return e.map(t=>({...t,id:Ck(t.id),action:Ek(t.action)}))}var vt=(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))(vt||{});function zB(e){return e.type==="choice"||e.type==="open-choice"}function VB(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=jk(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:s}=HB(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!s)return!1}return n!=="any"}function BB(e,t,n){return e.map(r=>{var s;const o=(s=n.answerOption)==null?void 0:s.find(l=>Ps(l.valueCoding)===r||l[t]===r),i=dn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function jk(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=jk(n.item,t);if(r)return r}}}function UB(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}]=gc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function HB(e,t,n){const r=t||[],o=dn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,s=!0;for(const l of r){const c=dn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(UB(c,o,u)?i=!0:s=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:s}}function Pk(e){var n,r;const t=qc(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 Sm(e,t){var o;const n=uo(e);let r=qc(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 WB(e,t,n){const r=qc(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]=zL(l,"=",2);i[c]=u}return i}function qB(e){return{resourceType:"QuestionnaireResponse",questionnaire:wt(e),item:Tk(e.item),status:"in-progress"}}function Tk(e){return(e==null?void 0:e.map(kk))??[]}function kk(e){var t;return{id:QB(),linkId:e.linkId,text:e.text,item:Tk(e.item),answer:((t=e.initial)==null?void 0:t.map(KB))??[]}}let GB=1;function QB(){return"id-"+GB++}function KB(e){return{...e}}function YB(e){return e.value.display||e.value.reference||or(e.value)}function XB(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const s=qc(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 Rk=m.createContext({});function Xp(e){const t=m.useContext(Rk),n=e.item,r=e.response;function o(u){var f,h,p,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=(((p=e.response)==null?void 0:p.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((S,y)=>y===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=I0(r,e.index)??dn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case vt.display:return a.jsx("p",{children:e.item.text},e.item.linkId);case vt.boolean:return a.jsx(UT,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(wr,{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 vt.decimal:return a.jsx(ue,{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 vt.integer:return a.jsx(ue,{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 vt.date:return a.jsx(ue,{type:"date",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case vt.dateTime:return a.jsx(us,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case vt.time:return a.jsx(ue,{type:"time",id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case vt.string:case vt.url:return a.jsx(ue,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case vt.text:return a.jsx(bs,{id:s,name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case vt.attachment:return a.jsx(Z,{py:4,children:a.jsx(MT,{name:s,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case vt.reference:return a.jsx(fh,{name:s,required:n.required,targetTypes:Pk(n),searchCriteria:WB(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case vt.quantity:return a.jsx(ds,{name:s,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case vt.choice:case vt.openChoice:return rU(n)&&!n.answerValueSet?a.jsx(JB,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):a.jsx(ZB,{name:s,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function JB(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return a.jsx(_k,{});const i=dn({type:"QuestionnaireItemInitial",value:r},"value"),s=[""];for(const u of n.answerOption){const d=dn({type:"QuestionnaireItemAnswerOption",value:u},"value");s.push(Yw(d))}const l=I0(o)??i;if(n.repeats){const{propertyName:u,data:d}=oU(e.item),f=tU(o);return a.jsx(qf,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[Yw(i)],onChange:h=>{const p=BB(h,u,n);e.onChangeAnswer(p)}})}return a.jsx(Tt,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=dn({type:"QuestionnaireItemAnswerOption",value:f},"value"),p="value"+Qt(h.type);e.onChangeAnswer({[p]:h.value})},defaultValue:Ps(l==null?void 0:l.value)||(l==null?void 0:l.value),data:s})}function ZB(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(_k,{}):n.answerValueSet?a.jsx(qT,{name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===vt.openChoice}):a.jsx(eU,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function eU(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,s=Ts("QuestionnaireItemAnswerOption","value[x]"),l=dn({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const p=n.answerOption[h],g=`${t}-option-${h}`,v=dn({type:"QuestionnaireItemAnswerOption",value:p},"value");v!=null&&v.value&&(l&&or(v)===or(l)&&(u=g),c.push([g,v]))}const d=I0(i),f=nU(c,d);return a.jsx(dc.Group,{name:t,value:f??u,onChange:h=>{const p=c.find(g=>g[0]===h);if(p){const g=p[1],v="value"+Qt(g.type);o({[v]:g.value})}},children:c.map(([h,p])=>a.jsx(dc,{id:h,value:h,py:4,label:a.jsx(Br,{property:s,propertyType:p.type,value:p.value})},h))})}function _k(){return a.jsx(ue,{disabled:!0,placeholder:"No Answers Defined"})}function Dk(e){return dn({type:"QuestionnaireItemAnswer",value:e},"value")}function I0(e,t=0){const n=e.answer;return Dk((n==null?void 0:n[t])??{})}function tU(e){const t=e.answer;return t?t.map(r=>Dk(r)).map(r=>Ps(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function nU(e,t){var n;return(n=e.find(r=>Gc(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function Yw(e){if(e)return e.type==="CodeableConcept"?bi(e.value):e.type==="Coding"?Ps(e.value):e.type==="Reference"?YB(e):e.value.toString()}function rU(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 oU(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=dn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+Qt(n.type),o=(e.answerOption??[]).map(s=>({value:Xw(s,r),label:Xw(s,r)}));return{propertyName:r,data:o}}function Xw(e,t){var n;return Ps(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const iU="_section_cpwxo_1",sU="_hovering_cpwxo_10",aU="_editing_cpwxo_14",lU="_questionBody_cpwxo_19",cU="_topActions_cpwxo_23",uU="_bottomActions_cpwxo_32",dU="_movementActions_cpwxo_43",fU="_movementIcons_cpwxo_55",hU="_columnAlignment_cpwxo_59",mU="_linkIdInput_cpwxo_64",pU="_typeSelect_cpwxo_69",ur={section:iU,hovering:sU,editing:aU,questionBody:lU,topActions:cU,bottomActions:uU,movementActions:dU,movementIcons:fU,columnAlignment:hU,linkIdInput:mU,typeSelect:pU};function gU(e){const t=se(),n=gt(e.questionnaire),[r,o]=m.useState(!1),[i,s]=m.useState(),[l,c]=m.useState(),[u,d]=m.useState();function f(){d(void 0)}function h(){c(void 0)}m.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),m.useEffect(()=>(s(wU(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const p=(g,v)=>{s(g),e.autoSave&&!v&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:a.jsx("div",{children:a.jsxs(Ye,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[a.jsx(Ik,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:p}),a.jsx(ie,{type:"submit",children:"Save"})]})})}function Ik(e){var w;const t=e.item,n=e.item,r=Bo(e.item),o=r||n.type===vt.group,i=n.linkId??"[untitled]",s=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=m.useRef();c.current=e.item;function u(b){ft(b),e.setSelectedKey(e.item.id)}function d(b){ft(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(T=>T.id===b.id?b:T)})}function h(b,j){e.onChange({...e.item,item:[...e.item.item??[],b]},j)}function p(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 v(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 y(b,j){const E=CU(e.item.item,b,j);e.onChange({...e.item,item:E})}const x=it(ur.section,{[ur.editing]:s,[ur.hovering]:l&&!s});return a.jsxs("div",{"data-testid":n.linkId,className:x,onClick:u,onMouseOver:d,onFocus:d,children:[a.jsx("div",{className:ur.questionBody,children:s?a.jsxs(a.Fragment,{children:[r&&a.jsx(ue,{size:"xl",defaultValue:t.title,onBlur:b=>g("title",b.currentTarget.value)}),!r&&a.jsx(bs,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:b=>g("text",b.currentTarget.value)}),n.type==="reference"&&a.jsx(xU,{item:n,onChange:v}),zB(n)&&a.jsx(vU,{item:n,onChange:b=>v(b)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(me,{children:t.title}),n.text&&a.jsx("div",{children:n.text}),!o&&a.jsx(Xp,{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(Ik,{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:()=>p(b),onRepeatable:S,onMoveUp:()=>y(j,-1),onMoveDown:()=>y(j,1)})},b.id)),!o&&a.jsx("div",{className:ur.topActions,children:s?a.jsxs(a.Fragment,{children:[a.jsx(ue,{size:"xs",className:ur.linkIdInput,defaultValue:n.linkId,onBlur:b=>g("linkId",b.currentTarget.value)}),!o&&a.jsx(Tt,{size:"xs",className:ur.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(G,{className:ur.movementActions,children:a.jsxs(G,{className:ur.columnAlignment,children:[!e.isFirst&&a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(X6,{"data-testid":"up-button",size:15,className:ur.movementIcons})}),!e.isLast&&a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(Y6,{"data-testid":"down-button",size:15,className:ur.movementIcons})})]})}),a.jsxs("div",{className:ur.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),h({id:hs(),linkId:eg("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),h({id:hs(),linkId:eg("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),h(bU(),!0)},children:"Add Page"}),s&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function vU(e){const t=Ts("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(ue,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(yU,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(G,{display:"flex",children:[a.jsx(Je,{href:"#",onClick:r=>{ft(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:hs()}]})},children:"Add choice"}),a.jsx(eh,{w:"lg"}),a.jsx(Je,{href:"#",onClick:r=>{ft(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function yU(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=Zc({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(Za,{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(Je,{href:"#",onClick:o=>{ft(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function xU(e){const t=Pk(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(Z,{children:[a.jsx(u0,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Sm(e.item,t.map(i=>i===n?o:i)))}}),a.jsx(Je,{href:"#",onClick:o=>{ft(o),e.onChange(Sm(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Je,{href:"#",onClick:n=>{ft(n),e.onChange(Sm(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Jp=1,Zp=1;function eg(e){return e+Jp++}function hs(){return"id-"+Zp++}function wU(e){return{...e,id:e.id||hs(),item:Ak(e.item)}}function Ak(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Zp=Math.max(Zp,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Jp=Math.max(Jp,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||hs(),item:Ak(t.item),answerOption:SU(t.answerOption)}))}function SU(e){if(e)return e.map(t=>({...t,id:t.id||hs()}))}function bU(){return{id:hs(),linkId:eg("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 CU(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 Nk(e){const{item:t,response:n,onChange:r}=e,[o,i]=m.useState(EU(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===vt.display)return a.jsx("p",{children:t.text},t.linkId);const s=(t==null?void 0:t.repeats)&&t.type!==vt.choice&&t.type!==vt.openChoice;return t.type===vt.boolean?a.jsx(Xp,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):a.jsxs(mt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>a.jsx(Xp,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),s&&a.jsx(Je,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function EU(e,t){if(e.type===vt.choice||e.type===vt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function Ok(e){const[t,n]=m.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=kk(e.item);n([...t,i])}return a.jsxs(a.Fragment,{children:[t.map((i,s)=>a.jsx(Mk,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,s)},i.id)),e.item.repeats&&a.jsx(Je,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function Mk(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(p=>p.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(me,{order:3,mb:"md",children:e.item.text}),a.jsx(Ie,{children:(i=e.item.item)==null?void 0:i.map(s=>{var l,c,u;return s.type===vt.group?s.repeats?a.jsx(Ok,{item:s,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===s.linkId))??[],checkForQuestionEnabled:n,onChange:o},s.linkId):a.jsx(Mk,{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(Nk,{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 jU(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 v;const p=((v=n==null?void 0:n.item)==null?void 0:v.filter(S=>S.linkId===h.linkId))??[],g=h.type===vt.group?a.jsx(Ok,{item:h,response:p,onChange:o,checkForQuestionEnabled:d},h.linkId):a.jsx(Nk,{item:h,response:p==null?void 0:p[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?a.jsx(Ia.Step,{label:h.text,children:g},h.linkId):g});return a.jsxs(a.Fragment,{children:[c&&a.jsx(Ia,{active:r??0,allowNextStepsSelect:!1,p:6,children:f}),!c&&a.jsx(Ie,{children:f}),a.jsx(PU,{activePage:r??0,numberOfPages:l,nextStep:i,prevStep:s,submitButtonText:u})]})}function PU(e){const t=e.activePage>0,n=e.activePage<e.numberOfPages-1,r=e.activePage===e.numberOfPages-1;return a.jsxs(Z,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&a.jsx(ie,{onClick:e.prevStep,children:"Back"}),n&&a.jsx(ie,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),r&&a.jsx(ie,{type:"submit",children:e.submitButtonText??"Submit"})]})}function $k(e){const t=se(),n=t.getProfile(),[r,o]=m.useState(!1),i=gt(e.questionnaire),[s,l]=m.useState(),[c,u]=m.useState(0);m.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),m.useEffect(()=>{l(i?qB(i):void 0)},[i]);function d(v){const S=(s==null?void 0:s.item)??[],x={resourceType:"QuestionnaireResponse",status:"in-progress",item:Lk(S,Array.isArray(v)?v:[v])};l(x)}function f(v){return VB(v,(s==null?void 0:s.item)??[])}if(!r||!i||!s)return null;const h=XB(i),p=()=>u(v=>v+1),g=()=>u(v=>v-1);return a.jsx(Rk.Provider,{value:{subject:e.subject,encounter:e.encounter},children:a.jsxs(Ye,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&s&&e.onSubmit({...s,questionnaire:wt(i),subject:e.subject,source:xt(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&a.jsx(me,{children:i.title}),a.jsx(jU,{items:i.item??[],response:s,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:f,nextStep:p,prevStep:g})]})})}function TU(e,t){const n=Lk(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 Lk(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(TU(o,s)),r.add(s.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const kU="_section_4m5it_1",RU={section:kU},_U=["gender","age","gestationalAge","context","appliesTo","category"],DU={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function IU(e){e=Object.assign(DU,e);const t=e.definition,[n,r]=m.useState([]),[o,i]=m.useState(1),[s,l]=m.useState(1);return m.useEffect(()=>{const g=OU(t,l);r(MU(g.qualifiedInterval||[],i))},[t]),a.jsxs(Ye,{testid:"reference-range-editor",onSubmit:c,children:[a.jsx(Ie,{children:n.map(g=>{var v;return a.jsx(AU,{unit:LU((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:f,onAdd:h,onRemove:p,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),a.jsx(Zt,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{ft(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:a.jsx(Wd,{})}),a.jsx(Z,{justify:"flex-end",children:a.jsx(ie,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!FU(v));e.onSubmit({...t,qualifiedInterval:g})}function u(g){r(v=>[...v,g])}function d(g){r(v=>v.filter(S=>S.id!==g.id))}function f(g,v){r(S=>{S=[...S];const y=S.find(w=>w.id===g),x=y==null?void 0:y.intervals.findIndex(w=>w.id===v.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=v),S})}function h(g,v){v.id===void 0&&(v.id=`id-${s}`,l(S=>S+1)),r(S=>{S=[...S];const y=S.findIndex(x=>x.id===g);if(y!==-1){const x={...S[y]};v={...v,...x.filters},x.intervals=[...x.intervals,v],S[y]=x}return S})}function p(g,v){r(S=>{S=[...S];const y=S.find(x=>x.id===g);return y&&(y.intervals=y.intervals.filter(x=>x.id!==v.id)),S})}}function AU(e){const{intervalGroup:t,unit:n}=e;return a.jsx(tu,{"data-testid":t.id,className:RU.section,children:a.jsxs(Ie,{gap:"lg",children:[a.jsx(Z,{justify:"flex-end",children:a.jsx(Zt,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{ft(r),e.onRemoveGroup(t)},children:a.jsx(Hd,{})},`remove-group-button-${t.id}`)}),a.jsx(NU,{intervalGroup:t,onChange:e.onChange}),a.jsx(gn,{}),t.intervals.map(r=>a.jsxs(Ie,{gap:"xs",children:[a.jsxs(Z,{children:[a.jsx(ue,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{ft(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(Zt,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{ft(o),e.onRemove(t.id,r)},children:a.jsx(Hd,{})},`remove-interval-${r.id}`)]}),a.jsx(p0,{onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(Zt,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{ft(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Wd,{})})]})})}function NU(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(Ie,{style:{maxWidth:"50%"},children:[a.jsx(Z,{children:a.jsx(Tt,{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(Z,{gap:"xs",children:[a.jsx(ce,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(p0,{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(Tt,{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(Tt,{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 OU(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 MU(e,t){let n=1;const r={};for(const o of e){const i=$U(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(_U.map(s=>[s,o[s]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function $U(e){var n,r;return[`gender=${e.gender}`,`age=${mc(e.age)}`,`gestationalAge=${mc(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 LU(e){return e&&(LL(e,"http://unitsofmeasure.org")||e.text)}function FU(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 zU(e){var u;const t=se(),n=gt(e.value),[r,o]=m.useState(!1),[i,s]=m.useState();if(m.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(s).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return a.jsx(Zn,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,S,y,x,w,b;const h=d.resource&&c(d.resource),p=(S=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:S.valueReference,g=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return a.jsxs(m.Fragment,{children:[a.jsx(Zn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?a.jsx(sF,{}):a.jsx(IF,{color:"gray"})}),a.jsxs(Zn.Col,{span:9,p:"xs",children:[a.jsx(ce,{fw:500,children:d.title}),d.description&&a.jsx("div",{children:d.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(el,{value:(w=h==null?void 0:h.meta)==null?void 0:w.author})," on ",Rn((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(y0,{status:(h==null?void 0:h.status)||"unknown"})]})]}),a.jsxs(Zn.Col,{span:2,p:"md",children:[p&&!g&&a.jsx(ie,{onClick:()=>e.onStart(h,p),children:"Start"}),p&&g&&a.jsx(ie,{onClick:()=>e.onEdit(h,p,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const p of d.action)(h=p.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:p.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===wt(f.resource))return f.resource}}function Fk(e,t){const n=VU(e,t);return BU(n,e,t)}function VU(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,p=l[f],g=l[h];let v,S=0;u===-c||u!==c&&g.i<p.i?(S=p.i,v=p):(S=g.i+1,v=g),l[h]=void 0;let y=S-u,x={i:S,j:y,prev:UU(v),snake:!1};for(;S<n&&y<r&&e[S]===t[y];)S++,y++;if(S>x.i&&(x={i:S,j:y,prev:x,snake:!0}),l[d]=x,S>=n&&y>=r)return l[d]}l[s+c-1]=void 0}}function BU(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 UU(e){return e&&!e.snake&&e.prev?e.prev:e}function HU(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:or(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 WU(n,t),qU(n),n}function WU(e,t){for(let n=1;n<t.length;n++){const r=Fk(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 qU(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 GU="_container_1oj0p_1",QU="_root_1oj0p_5",KU="_startRow_1oj0p_20",YU="_normalRow_1oj0p_24",XU="_author_1oj0p_28",JU="_dateTime_1oj0p_32",ZU="_lineNumber_1oj0p_37",eH="_line_1oj0p_37",tH="_pre_1oj0p_52",mo={container:GU,root:QU,startRow:KU,normalRow:YU,author:XU,dateTime:JU,lineNumber:ZU,line:eH,pre:tH};function nH(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function rH(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Bs(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Bs(r,"month");const o=Math.floor(t/86400);if(o>0)return Bs(o,"day");const i=Math.floor(t/3600);if(i>0)return Bs(i,"hour");const s=Math.floor(t/60);return s>0?Bs(s,"minute"):Bs(t,"second")}function Bs(e,t){return`${e} ${e===1?t:t+"s"} ago`}function oH(e){var s,l;const t=se(),[n,r]=m.useState(e.history);if(m.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=HU(n);return a.jsx("div",{className:mo.container,children:a.jsx("table",{className:mo.root,children:a.jsx("tbody",{children:i.map((c,u)=>a.jsxs("tr",{className:c.span>0?mo.startRow:mo.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:mo.author,rowSpan:c.span,children:a.jsx(ya,{value:c.meta.author,link:!0})}),a.jsx("td",{className:mo.dateTime,rowSpan:c.span,children:a.jsx(Ge,{to:nH(o,c.meta.versionId),children:rH(c.meta.lastUpdated)})})]}),a.jsx("td",{className:mo.lineNumber,children:u+1}),a.jsx("td",{className:mo.line,children:a.jsx("pre",{className:mo.pre,children:c.value})})]},"row-"+u))})})})}const iH="_removed_mgz0k_2",sH="_added_mgz0k_7",Jw={removed:iH,added:sH};function aH(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=or(t,!0).match(/[^\r\n]+/g),o=or(n,!0).match(/[^\r\n]+/g),i=Fk(r,o);return a.jsx("pre",{style:{color:"gray"},children:i.map((s,l)=>a.jsx(lH,{delta:s},"delta"+l))})}function lH(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:Jw.removed,children:e.delta.original.lines.join(`
|
|
523
|
-
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:Jw.added,children:e.delta.revised.lines.join(`
|
|
524
|
-
`)}),"...",a.jsx("br",{})]})}function Yd(e){const{outcome:t}=e,n=se(),r=gt(e.defaultValue),[o,i]=m.useState(),[s,l]=m.useState();return m.useEffect(()=>{if(r)if(e.profileUrl){const c=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const u=js(c);if(u){i(u.name);const d=F6(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(Ie,{mb:"xl",children:[a.jsx(mt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(ue,{name:"resourceType",defaultValue:s.resourceType,disabled:!0})}),a.jsx(mt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(ue,{name:"id",defaultValue:s.id,disabled:!0})})]}),a.jsx(v0,{path:s.resourceType,valuePath:s.resourceType,typeName:o,defaultValue:s,outcome:t,onChange:l,profileUrl:e.profileUrl}),a.jsxs(Z,{justify:"flex-end",mt:"xl",children:[a.jsx(ie,{type:"submit",children:"OK"}),e.onDelete&&a.jsx(ie,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(s)},children:"Delete"})]})]})}function cH(e){var o;const t=se(),[n,r]=m.useState(e.history);return m.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(uH,{entry:i},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function uH(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(ya,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),a.jsx(le.Td,{children:Rn((o=n.meta)==null?void 0:o.lastUpdated)}),a.jsx(le.Td,{children:a.jsx(Ge,{to:dH(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):a.jsx(le.Tr,{children:a.jsx(le.Td,{colSpan:3,children:Oe(t==null?void 0:t.outcome)})})}function dH(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function fH(e){return a.jsx(mh,{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:[xt(t)],subject:t.subject,sender:xt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",basedOn:[xt(t)],subject:t.subject,operator:xt(n),issued:new Date().toISOString(),content:r})})}function hH(e){const t=se(),{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=>ve({color:"red",message:Oe(c),autoClose:!1}))}return a.jsx(Je,{onClick:()=>l(),...s,children:i})}function zk(e){const t=se(),[n,r]=m.useState();return a.jsxs(Ye,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(pt(i))}},children:[a.jsxs(cn,{style:{flexDirection:"column"},children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Create project"})]}),a.jsxs(Ie,{gap:"xl",children:[a.jsx(ue,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Xe(n,"firstName")}),a.jsxs(ce,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Je,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Je,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ie,{type:"submit",children:"Create project"})})]})}function Vk(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 Bk(e){const t=se(),{googleClientId:n,handleGoogleCredential:r}=e,o=m.useRef(null),[i,s]=m.useState(typeof google<"u"),[l,c]=m.useState(!1),[u,d]=m.useState(!1);return m.useEffect(()=>{if(typeof google>"u"){Vk("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 mH={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.1.4-17ee35b26",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=mH.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function Hk(e){typeof grecaptcha>"u"&&Vk("https://www.google.com/recaptcha/api.js?render="+e)}function Wk(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function pH(e){const t=Uk(e.googleClientId),n=e.recaptchaSiteKey,r=se(),[o,i]=m.useState(),s=eu(o,void 0);return m.useEffect(()=>{n&&Hk(n)},[n]),a.jsxs(Ye,{onSubmit:async l=>{try{let c="";n&&(c=await Wk(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(pt(c))}},children:[a.jsx(cn,{style:{flexDirection:"column"},children:e.children}),a.jsx(Gr,{issues:s}),t&&a.jsxs(a.Fragment,{children:[a.jsx(Z,{justify:"center",p:"xl",style:{height:70},children:a.jsx(Bk,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,projectId:e.projectId,createUser:!0}))}catch(c){i(pt(c))}}})}),a.jsx(gn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Ie,{gap:"xl",children:[a.jsx(ue,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Xe(o,"firstName")}),a.jsx(ue,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Xe(o,"lastName")}),a.jsx(ue,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Xe(o,"email")}),a.jsx($r,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Xe(o,"password")}),a.jsxs(ce,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Je,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Je,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(ce,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Je,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Je,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(Z,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(wr,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(ie,{type:"submit",children:"Create account"})]})]})}function gH(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:s}=e,l=se(),[c,u]=m.useState(),[d,f]=m.useState();m.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(p=>l.processCode(p.code)).then(()=>s()).catch(p=>f(pt(p)))},[l,t,n,c,s]);function h(p){p.code?l.processCode(p.code).then(()=>s()).catch(console.log):p.login&&u(p.login)}return a.jsxs(_e,{width:450,children:[d&&a.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&a.jsx(pH,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&a.jsx(zk,{login:c,handleAuthResponse:h})]})}function vH(e){const[t,n]=m.useState();return t?a.jsx(xH,{email:t,...e}):a.jsx(yH,{setEmail:n,...e})}function yH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...s}=e,l=se(),c=!e.disableGoogleAuth&&Uk(e.googleClientId),[u,d]=m.useState(),f=eu(u,void 0),h=m.useCallback(async v=>{if(!v.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(s),domain:v.domain}),y=new URL(v.authorizeUrl);return y.searchParams.set("state",S),window.location.assign(y.toString()),!0},[l,s]),p=m.useCallback(async v=>{const S=await l.post("auth/method",{email:v.email});await h(S)||t(v.email)},[l,h,t]),g=m.useCallback(async v=>{try{const S=await l.startGoogleLogin({...s,googleCredential:v.credential});await h(S)||r(S)}catch(S){d(pt(S))}},[l,s,h,r]);return a.jsxs(Ye,{onSubmit:p,children:[a.jsx(cn,{style:{flexDirection:"column"},children:o}),a.jsx(Gr,{issues:f}),c&&a.jsxs(a.Fragment,{children:[a.jsx(Z,{justify:"center",p:"xl",style:{height:70},children:a.jsx(Bk,{googleClientId:c,handleGoogleCredential:g})}),!i&&a.jsx(gn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&a.jsx(ue,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Xe(u,"email")}),a.jsxs(Z,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Je,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&a.jsx(ie,{type:"submit",children:"Next"})]})]})}function xH(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=se(),[s,l]=m.useState(),c=eu(s,void 0),u=m.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(pt(f)))},[i,o,n]);return a.jsxs(Ye,{onSubmit:u,children:[a.jsx(cn,{style:{flexDirection:"column"},children:r}),a.jsx(Gr,{issues:c}),a.jsx(Ie,{gap:"xl",children:a.jsx($r,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Xe(s,"password")})}),a.jsxs(Z,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Je,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(wr,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(ie,{type:"submit",children:"Sign in"})]})]})}function wH(e){const t=se(),n=Mc(),[r,o]=m.useState(""),[i,s]=m.useState();function l(f){var h;return!!((h=f==null?void 0:f.toLowerCase())!=null&&h.includes(r.toLowerCase()))}function c(f){var h,p;return l((h=f.profile)==null?void 0:h.display)||l((p=f.project)==null?void 0:p.display)}function u(f){t.post("auth/profile",{login:e.login,profile:f}).then(e.handleAuthResponse).catch(h=>s(pt(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>a.jsx(De.Option,{value:f.id,children:a.jsx(SH,{...f})},f.id));return a.jsxs(Ie,{children:[a.jsxs(ss,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(qr,{size:32}),a.jsx(me,{order:3,children:"Choose profile"})]}),a.jsx(Gr,{outcome:i}),a.jsxs(De,{store:n,onOptionSubmit:u,children:[a.jsx(De.EventsTarget,{children:a.jsx(ue,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(De.Options,{children:d.length>0?d:a.jsx(De.Empty,{children:"Nothing found..."})})})]})]})}function SH(e){var t,n;return a.jsxs(Z,{children:[a.jsx(as,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(ce,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),a.jsx(ce,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function bH(e){const t=se();return a.jsx(Ye,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Ie,{children:[a.jsxs(cn,{style:{flexDirection:"column"},children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Choose scope"})]}),a.jsx(Ie,{children:(e.scope??"openid").split(" ").map(n=>a.jsx(wr,{id:n,name:n,label:n,defaultChecked:!0},n))}),a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{type:"submit",children:"Set scope"})})]})})}function CH(e){const t=se(),[n,r]=m.useState();return a.jsx(Ye,{onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(Oe(i)))},children:a.jsxs(Ie,{children:[a.jsxs(cn,{style:{flexDirection:"column"},children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Enter MFA code"})]}),n&&a.jsx(Ss,{icon:a.jsx(Kc,{size:16}),title:"Error",color:"red",children:n}),a.jsx(Ie,{children:a.jsx(ue,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{type:"submit",children:"Submit code"})})]})})}function qk(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:s,...l}=e,c=se(),[u,d]=m.useState(),f=m.useRef(!1),[h,p]=m.useState(!1),[g,v]=m.useState(),S=m.useCallback(w=>{s?s(w):c.processCode(w).then(()=>{r&&r()}).catch(b=>ve({color:"red",message:Oe(b)}))},[c,s,r]),y=m.useCallback(w=>{p(!!w.mfaRequired),w.login&&d(w.login),w.memberships&&v(w.memberships),w.code&&(n?v(void 0):S(w.code))},[n,S]),x=m.useCallback(w=>{S(w.code)},[S]);return m.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(y).catch(w=>ve({color:"red",message:Oe(w)})))},[c,t,f,u,y]),a.jsx(_e,{width:450,px:"sm",py:"md",children:u?h?a.jsx(CH,{login:u,handleAuthResponse:y}):g?a.jsx(wH,{login:u,memberships:g,handleAuthResponse:y}):e.projectId==="new"?a.jsx(zk,{login:u,handleAuthResponse:y}):e.chooseScopes?a.jsx(bH,{login:u,scope:e.scope,handleAuthResponse:x}):a.jsx("div",{children:"Success"}):a.jsx(vH,{onForgotPassword:o,onRegister:i,handleAuthResponse:y,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var Gk,Zw=Dc;Gk=Zw.createRoot,Zw.hydrateRoot;/**
|
|
525
|
-
* @remix-run/router v1.15.3
|
|
526
|
-
*
|
|
527
|
-
* Copyright (c) Remix Software Inc.
|
|
528
|
-
*
|
|
529
|
-
* This source code is licensed under the MIT license found in the
|
|
530
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
531
|
-
*
|
|
532
|
-
* @license MIT
|
|
533
|
-
*/function Ft(){return Ft=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},Ft.apply(this,arguments)}var Wt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Wt||(Wt={}));const eS="popstate";function EH(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:s,hash:l}=r.location;return xc("",{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:iu(o)}return PH(t,n,null,e)}function Ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ma(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function jH(){return Math.random().toString(36).substr(2,8)}function tS(e,t){return{usr:e.state,key:e.key,idx:t}}function xc(e,t,n,r){return n===void 0&&(n=null),Ft({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Uo(t):t,{state:n,key:t&&t.key||r||jH()})}function iu(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 Uo(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 PH(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,l=Wt.Pop,c=null,u=d();u==null&&(u=0,s.replaceState(Ft({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function f(){l=Wt.Pop;let S=d(),y=S==null?null:S-u;u=S,c&&c({action:l,location:v.location,delta:y})}function h(S,y){l=Wt.Push;let x=xc(v.location,S,y);n&&n(x,S),u=d()+1;let w=tS(x,u),b=v.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:v.location,delta:1})}function p(S,y){l=Wt.Replace;let x=xc(v.location,S,y);n&&n(x,S),u=d();let w=tS(x,u),b=v.createHref(x);s.replaceState(w,"",b),i&&c&&c({action:l,location:v.location,delta:0})}function g(S){let y=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof S=="string"?S:iu(S);return x=x.replace(/ $/,"%20"),Ue(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let v={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(eS,f),c=S,()=>{o.removeEventListener(eS,f),c=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let y=g(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:p,go(S){return s.go(S)}};return v}var Mt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Mt||(Mt={}));const TH=new Set(["lazy","caseSensitive","path","id","index","children"]);function kH(e){return e.index===!0}function tg(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(Ue(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ue(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),kH(o)){let c=Ft({},o,t(o),{id:l});return r[l]=c,c}else{let c=Ft({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=tg(o.children,t,s,r)),c}})}function aa(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Uo(t):t,o=su(r.pathname||"/",n);if(o==null)return null;let i=Qk(e);_H(i);let s=null;for(let l=0;s==null&&l<i.length;++l){let c=BH(o);s=FH(i[l],c)}return s}function RH(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 Qk(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("/")&&(Ue(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=vi([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Ue(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Qk(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:$H(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 Kk(i.path))o(i,s,c)}),t}function Kk(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=Kk(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 _H(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const DH=/^:[\w-]+$/,IH=3,AH=2,NH=1,OH=10,MH=-2,nS=e=>e==="*";function $H(e,t){let n=e.split("/"),r=n.length;return n.some(nS)&&(r+=MH),t&&(r+=AH),n.filter(o=>!nS(o)).reduce((o,i)=>o+(DH.test(i)?IH:i===""?NH:OH),r)}function LH(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 FH(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=zH({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:vi([o,d.pathname]),pathnameBase:WH(vi([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=vi([o,d.pathnameBase]))}return i}function zH(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=VH(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:p}=d;if(h==="*"){let v=l[f]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[f];return p&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function VH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ma(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 BH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ma(!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 su(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 UH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Uo(e):e;return{pathname:n?n.startsWith("/")?n:HH(n,t):t,search:qH(r),hash:GH(o)}}function HH(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 bm(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 Xk(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 Jk(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Uo(e):(o=Ft({},e),Ue(!o.pathname||!o.pathname.includes("?"),bm("?","pathname","search",o)),Ue(!o.pathname||!o.pathname.includes("#"),bm("#","pathname","hash",o)),Ue(!o.search||!o.search.includes("#"),bm("#","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=UH(o,l),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const vi=e=>e.join("/").replace(/\/\/+/g,"/"),WH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),qH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,GH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class A0{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 Zk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const eR=["post","put","patch","delete"],QH=new Set(eR),KH=["get",...eR],YH=new Set(KH),XH=new Set([301,302,303,307,308]),JH=new Set([307,308]),Cm={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ZH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},yl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},tR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eW=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),nR="remix-router-transitions";function tW(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;Ue(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 N=e.detectErrorBoundary;o=z=>({hasErrorBoundary:N(z)})}else o=eW;let i={},s=tg(e.routes,o,void 0,i),l,c=e.basename||"/",u=Ft({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1},e.future),d=null,f=new Set,h=null,p=null,g=null,v=e.hydrationData!=null,S=aa(s,e.history.location,c),y=null;if(S==null){let N=fr(404,{pathname:e.history.location.pathname}),{matches:z,route:Q}=uS(s);S=z,y={[Q.id]:N}}let x,w=S.some(N=>N.route.lazy),b=S.some(N=>N.route.loader);if(w)x=!1;else if(!b)x=!0;else if(u.v7_partialHydration){let N=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,Q=te=>te.route.loader?te.route.loader.hydrate===!0?!1:N&&N[te.route.id]!==void 0||z&&z[te.route.id]!==void 0:!0;if(z){let te=S.findIndex(ye=>z[ye.route.id]!==void 0);x=S.slice(0,te+1).every(Q)}else x=S.every(Q)}else x=e.hydrationData!=null;let j,E={historyAction:e.history.action,location:e.history.location,matches:S,initialized:x,navigation:Cm,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||y,fetchers:new Map,blockers:new Map},T=Wt.Pop,P=!1,_,D=!1,$=new Map,I=null,L=!1,F=!1,O=[],A=[],R=new Map,k=0,M=-1,B=new Map,U=new Set,X=new Map,re=new Map,fe=new Set,Ce=new Map,Te=new Map,Ae=!1;function pe(){if(d=e.history.listen(N=>{let{action:z,location:Q,delta:te}=N;if(Ae){Ae=!1;return}Ma(Te.size===0||te!=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 ye=lr({currentLocation:E.location,nextLocation:Q,historyAction:z});if(ye&&te!=null){Ae=!0,e.history.go(te*-1),_s(ye,{state:"blocked",location:Q,proceed(){_s(ye,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),e.history.go(te)},reset(){let je=new Map(E.blockers);je.set(ye,yl),We({blockers:je})}});return}return Y(z,Q)}),n){fW(t,$);let N=()=>hW(t,$);t.addEventListener("pagehide",N),I=()=>t.removeEventListener("pagehide",N)}return E.initialized||Y(Wt.Pop,E.location,{initialHydration:!0}),j}function He(){d&&d(),I&&I(),f.clear(),_&&_.abort(),E.fetchers.forEach((N,z)=>ar(z)),E.blockers.forEach((N,z)=>cu(z))}function ct(N){return f.add(N),()=>f.delete(N)}function We(N,z){z===void 0&&(z={}),E=Ft({},E,N);let Q=[],te=[];u.v7_fetcherPersist&&E.fetchers.forEach((ye,je)=>{ye.state==="idle"&&(fe.has(je)?te.push(je):Q.push(je))}),[...f].forEach(ye=>ye(E,{deletedFetchers:te,unstable_viewTransitionOpts:z.viewTransitionOpts,unstable_flushSync:z.flushSync===!0})),u.v7_fetcherPersist&&(Q.forEach(ye=>E.fetchers.delete(ye)),te.forEach(ye=>ar(ye)))}function be(N,z,Q){var te,ye;let{flushSync:je}=Q===void 0?{}:Q,Re=E.actionData!=null&&E.navigation.formMethod!=null&&Ir(E.navigation.formMethod)&&E.navigation.state==="loading"&&((te=N.state)==null?void 0:te._isRedirect)!==!0,Pe;z.actionData?Object.keys(z.actionData).length>0?Pe=z.actionData:Pe=null:Re?Pe=E.actionData:Pe=null;let Se=z.loaderData?cS(E.loaderData,z.loaderData,z.matches||[],z.errors):E.loaderData,Be=E.blockers;Be.size>0&&(Be=new Map(Be),Be.forEach((ut,Yt)=>Be.set(Yt,yl)));let Ut=P===!0||E.navigation.formMethod!=null&&Ir(E.navigation.formMethod)&&((ye=N.state)==null?void 0:ye._isRedirect)!==!0;l&&(s=l,l=void 0),L||T===Wt.Pop||(T===Wt.Push?e.history.push(N,N.state):T===Wt.Replace&&e.history.replace(N,N.state));let Le;if(T===Wt.Pop){let ut=$.get(E.location.pathname);ut&&ut.has(N.pathname)?Le={currentLocation:E.location,nextLocation:N}:$.has(N.pathname)&&(Le={currentLocation:N,nextLocation:E.location})}else if(D){let ut=$.get(E.location.pathname);ut?ut.add(N.pathname):(ut=new Set([N.pathname]),$.set(E.location.pathname,ut)),Le={currentLocation:E.location,nextLocation:N}}We(Ft({},z,{actionData:Pe,loaderData:Se,historyAction:T,location:N,initialized:!0,navigation:Cm,revalidation:"idle",restoreScrollPosition:Ds(N,z.matches||E.matches),preventScrollReset:Ut,blockers:Be}),{viewTransitionOpts:Le,flushSync:je===!0}),T=Wt.Pop,P=!1,D=!1,L=!1,F=!1,O=[],A=[]}async function ze(N,z){if(typeof N=="number"){e.history.go(N);return}let Q=ng(E.location,E.matches,c,u.v7_prependBasename,N,u.v7_relativeSplatPath,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:te,submission:ye,error:je}=rS(u.v7_normalizeFormMethod,!1,Q,z),Re=E.location,Pe=xc(E.location,te,z&&z.state);Pe=Ft({},Pe,e.history.encodeLocation(Pe));let Se=z&&z.replace!=null?z.replace:void 0,Be=Wt.Push;Se===!0?Be=Wt.Replace:Se===!1||ye!=null&&Ir(ye.formMethod)&&ye.formAction===E.location.pathname+E.location.search&&(Be=Wt.Replace);let Ut=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Le=(z&&z.unstable_flushSync)===!0,ut=lr({currentLocation:Re,nextLocation:Pe,historyAction:Be});if(ut){_s(ut,{state:"blocked",location:Pe,proceed(){_s(ut,{state:"proceeding",proceed:void 0,reset:void 0,location:Pe}),ze(N,z)},reset(){let Yt=new Map(E.blockers);Yt.set(ut,yl),We({blockers:Yt})}});return}return await Y(Be,Pe,{submission:ye,pendingError:je,preventScrollReset:Ut,replace:z&&z.replace,enableViewTransition:z&&z.unstable_viewTransition,flushSync:Le})}function $e(){if(Me(),We({revalidation:"loading"}),E.navigation.state!=="submitting"){if(E.navigation.state==="idle"){Y(E.historyAction,E.location,{startUninterruptedRevalidation:!0});return}Y(T||E.historyAction,E.navigation.location,{overrideNavigation:E.navigation})}}async function Y(N,z,Q){_&&_.abort(),_=null,T=N,L=(Q&&Q.startUninterruptedRevalidation)===!0,rl(E.location,E.matches),P=(Q&&Q.preventScrollReset)===!0,D=(Q&&Q.enableViewTransition)===!0;let te=l||s,ye=Q&&Q.overrideNavigation,je=aa(te,z,c),Re=(Q&&Q.flushSync)===!0;if(!je){let Yt=fr(404,{pathname:z.pathname}),{matches:sn,route:Ht}=uS(te);Ai(),be(z,{matches:sn,loaderData:{},errors:{[Ht.id]:Yt}},{flushSync:Re});return}if(E.initialized&&!F&&sW(E.location,z)&&!(Q&&Q.submission&&Ir(Q.submission.formMethod))){be(z,{matches:je},{flushSync:Re});return}_=new AbortController;let Pe=wl(e.history,z,_.signal,Q&&Q.submission),Se,Be;if(Q&&Q.pendingError)Be={[zl(je).route.id]:Q.pendingError};else if(Q&&Q.submission&&Ir(Q.submission.formMethod)){let Yt=await oe(Pe,z,Q.submission,je,{replace:Q.replace,flushSync:Re});if(Yt.shortCircuited)return;Se=Yt.pendingActionData,Be=Yt.pendingActionError,ye=Em(z,Q.submission),Re=!1,Pe=new Request(Pe.url,{signal:Pe.signal})}let{shortCircuited:Ut,loaderData:Le,errors:ut}=await Ee(Pe,z,je,ye,Q&&Q.submission,Q&&Q.fetcherSubmission,Q&&Q.replace,Q&&Q.initialHydration===!0,Re,Se,Be);Ut||(_=null,be(z,Ft({matches:je},Se?{actionData:Se}:{},{loaderData:Le,errors:ut})))}async function oe(N,z,Q,te,ye){ye===void 0&&(ye={}),Me();let je=uW(z,Q);We({navigation:je},{flushSync:ye.flushSync===!0});let Re,Pe=og(te,z);if(!Pe.route.action&&!Pe.route.lazy)Re={type:Mt.error,error:fr(405,{method:N.method,pathname:z.pathname,routeId:Pe.route.id})};else if(Re=await xl("action",N,Pe,te,i,o,c,u.v7_relativeSplatPath),N.signal.aborted)return{shortCircuited:!0};if(Ki(Re)){let Se;return ye&&ye.replace!=null?Se=ye.replace:Se=Re.location===E.location.pathname+E.location.search,await q(E,Re,{submission:Q,replace:Se}),{shortCircuited:!0}}if(la(Re)){let Se=zl(te,Pe.route.id);return(ye&&ye.replace)!==!0&&(T=Wt.Push),{pendingActionData:{},pendingActionError:{[Se.route.id]:Re.error}}}if(Qi(Re))throw fr(400,{type:"defer-action"});return{pendingActionData:{[Pe.route.id]:Re.data}}}async function Ee(N,z,Q,te,ye,je,Re,Pe,Se,Be,Ut){let Le=te||Em(z,ye),ut=ye||je||hS(Le),Yt=l||s,[sn,Ht]=oS(e.history,E,Q,ut,z,u.v7_partialHydration&&Pe===!0,F,O,A,fe,X,U,Yt,c,Be,Ut);if(Ai(rt=>!(Q&&Q.some(dt=>dt.route.id===rt))||sn&&sn.some(dt=>dt.route.id===rt)),M=++k,sn.length===0&&Ht.length===0){let rt=jr();return be(z,Ft({matches:Q,loaderData:{},errors:Ut||null},Be?{actionData:Be}:{},rt?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Se}),{shortCircuited:!0}}if(!L&&(!u.v7_partialHydration||!Pe)){Ht.forEach(dt=>{let Mn=E.fetchers.get(dt.key),fu=Sl(void 0,Mn?Mn.data:void 0);E.fetchers.set(dt.key,fu)});let rt=Be||E.actionData;We(Ft({navigation:Le},rt?Object.keys(rt).length===0?{actionData:null}:{actionData:rt}:{},Ht.length>0?{fetchers:new Map(E.fetchers)}:{}),{flushSync:Se})}Ht.forEach(rt=>{R.has(rt.key)&&On(rt.key),rt.controller&&R.set(rt.key,rt.controller)});let ot=()=>Ht.forEach(rt=>On(rt.key));_&&_.signal.addEventListener("abort",ot);let{results:Ni,loaderResults:fo,fetcherResults:Pr}=await ge(E.matches,Q,sn,Ht,N);if(N.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",ot),Ht.forEach(rt=>R.delete(rt.key));let ho=dS(Ni);if(ho){if(ho.idx>=sn.length){let rt=Ht[ho.idx-sn.length].key;U.add(rt)}return await q(E,ho.result,{replace:Re}),{shortCircuited:!0}}let{loaderData:Eh,errors:ol}=lS(E,Q,sn,fo,Ut,Ht,Pr,Ce);Ce.forEach((rt,dt)=>{rt.subscribe(Mn=>{(Mn||rt.done)&&Ce.delete(dt)})}),u.v7_partialHydration&&Pe&&E.errors&&Object.entries(E.errors).filter(rt=>{let[dt]=rt;return!sn.some(Mn=>Mn.route.id===dt)}).forEach(rt=>{let[dt,Mn]=rt;ol=Object.assign(ol||{},{[dt]:Mn})});let jh=jr(),Is=Wo(M),du=jh||Is||Ht.length>0;return Ft({loaderData:Eh,errors:ol},du?{fetchers:new Map(E.fetchers)}:{})}function Qe(N,z,Q,te){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(N)&&On(N);let ye=(te&&te.unstable_flushSync)===!0,je=l||s,Re=ng(E.location,E.matches,c,u.v7_prependBasename,Q,u.v7_relativeSplatPath,z,te==null?void 0:te.relative),Pe=aa(je,Re,c);if(!Pe){nt(N,z,fr(404,{pathname:Re}),{flushSync:ye});return}let{path:Se,submission:Be,error:Ut}=rS(u.v7_normalizeFormMethod,!0,Re,te);if(Ut){nt(N,z,Ut,{flushSync:ye});return}let Le=og(Pe,Se);if(P=(te&&te.preventScrollReset)===!0,Be&&Ir(Be.formMethod)){Ze(N,z,Se,Le,Pe,ye,Be);return}X.set(N,{routeId:z,path:Se}),ee(N,z,Se,Le,Pe,ye,Be)}async function Ze(N,z,Q,te,ye,je,Re){if(Me(),X.delete(N),!te.route.action&&!te.route.lazy){let dt=fr(405,{method:Re.formMethod,pathname:Q,routeId:z});nt(N,z,dt,{flushSync:je});return}let Pe=E.fetchers.get(N);Ve(N,dW(Re,Pe),{flushSync:je});let Se=new AbortController,Be=wl(e.history,Q,Se.signal,Re);R.set(N,Se);let Ut=k,Le=await xl("action",Be,te,ye,i,o,c,u.v7_relativeSplatPath);if(Be.signal.aborted){R.get(N)===Se&&R.delete(N);return}if(u.v7_fetcherPersist&&fe.has(N)){if(Ki(Le)||la(Le)){Ve(N,Ko(void 0));return}}else{if(Ki(Le))if(R.delete(N),M>Ut){Ve(N,Ko(void 0));return}else return U.add(N),Ve(N,Sl(Re)),q(E,Le,{fetcherSubmission:Re});if(la(Le)){nt(N,z,Le.error);return}}if(Qi(Le))throw fr(400,{type:"defer-action"});let ut=E.navigation.location||E.location,Yt=wl(e.history,ut,Se.signal),sn=l||s,Ht=E.navigation.state!=="idle"?aa(sn,E.navigation.location,c):E.matches;Ue(Ht,"Didn't find any matches after fetcher action");let ot=++k;B.set(N,ot);let Ni=Sl(Re,Le.data);E.fetchers.set(N,Ni);let[fo,Pr]=oS(e.history,E,Ht,Re,ut,!1,F,O,A,fe,X,U,sn,c,{[te.route.id]:Le.data},void 0);Pr.filter(dt=>dt.key!==N).forEach(dt=>{let Mn=dt.key,fu=E.fetchers.get(Mn),DR=Sl(void 0,fu?fu.data:void 0);E.fetchers.set(Mn,DR),R.has(Mn)&&On(Mn),dt.controller&&R.set(Mn,dt.controller)}),We({fetchers:new Map(E.fetchers)});let ho=()=>Pr.forEach(dt=>On(dt.key));Se.signal.addEventListener("abort",ho);let{results:Eh,loaderResults:ol,fetcherResults:jh}=await ge(E.matches,Ht,fo,Pr,Yt);if(Se.signal.aborted)return;Se.signal.removeEventListener("abort",ho),B.delete(N),R.delete(N),Pr.forEach(dt=>R.delete(dt.key));let Is=dS(Eh);if(Is){if(Is.idx>=fo.length){let dt=Pr[Is.idx-fo.length].key;U.add(dt)}return q(E,Is.result)}let{loaderData:du,errors:rt}=lS(E,E.matches,fo,ol,void 0,Pr,jh,Ce);if(E.fetchers.has(N)){let dt=Ko(Le.data);E.fetchers.set(N,dt)}Wo(ot),E.navigation.state==="loading"&&ot>M?(Ue(T,"Expected pending action"),_&&_.abort(),be(E.navigation.location,{matches:Ht,loaderData:du,errors:rt,fetchers:new Map(E.fetchers)})):(We({errors:rt,loaderData:cS(E.loaderData,du,Ht,rt),fetchers:new Map(E.fetchers)}),F=!1)}async function ee(N,z,Q,te,ye,je,Re){let Pe=E.fetchers.get(N);Ve(N,Sl(Re,Pe?Pe.data:void 0),{flushSync:je});let Se=new AbortController,Be=wl(e.history,Q,Se.signal);R.set(N,Se);let Ut=k,Le=await xl("loader",Be,te,ye,i,o,c,u.v7_relativeSplatPath);if(Qi(Le)&&(Le=await iR(Le,Be.signal,!0)||Le),R.get(N)===Se&&R.delete(N),!Be.signal.aborted){if(fe.has(N)){Ve(N,Ko(void 0));return}if(Ki(Le))if(M>Ut){Ve(N,Ko(void 0));return}else{U.add(N),await q(E,Le);return}if(la(Le)){nt(N,z,Le.error);return}Ue(!Qi(Le),"Unhandled fetcher deferred data"),Ve(N,Ko(Le.data))}}async function q(N,z,Q){let{submission:te,fetcherSubmission:ye,replace:je}=Q===void 0?{}:Q;z.revalidate&&(F=!0);let Re=xc(N.location,z.location,{_isRedirect:!0});if(Ue(Re,"Expected a location on the redirect navigation"),n){let ut=!1;if(z.reloadDocument)ut=!0;else if(tR.test(z.location)){const Yt=e.history.createURL(z.location);ut=Yt.origin!==t.location.origin||su(Yt.pathname,c)==null}if(ut){je?t.location.replace(z.location):t.location.assign(z.location);return}}_=null;let Pe=je===!0?Wt.Replace:Wt.Push,{formMethod:Se,formAction:Be,formEncType:Ut}=N.navigation;!te&&!ye&&Se&&Be&&Ut&&(te=hS(N.navigation));let Le=te||ye;if(JH.has(z.status)&&Le&&Ir(Le.formMethod))await Y(Pe,Re,{submission:Ft({},Le,{formAction:z.location}),preventScrollReset:P});else{let ut=Em(Re,te);await Y(Pe,Re,{overrideNavigation:ut,fetcherSubmission:ye,preventScrollReset:P})}}async function ge(N,z,Q,te,ye){let je=await Promise.all([...Q.map(Se=>xl("loader",ye,Se,z,i,o,c,u.v7_relativeSplatPath)),...te.map(Se=>Se.matches&&Se.match&&Se.controller?xl("loader",wl(e.history,Se.path,Se.controller.signal),Se.match,Se.matches,i,o,c,u.v7_relativeSplatPath):{type:Mt.error,error:fr(404,{pathname:Se.path})})]),Re=je.slice(0,Q.length),Pe=je.slice(Q.length);return await Promise.all([fS(N,Q,Re,Re.map(()=>ye.signal),!1,E.loaderData),fS(N,te.map(Se=>Se.match),Pe,te.map(Se=>Se.controller?Se.controller.signal:null),!0)]),{results:je,loaderResults:Re,fetcherResults:Pe}}function Me(){F=!0,O.push(...Ai()),X.forEach((N,z)=>{R.has(z)&&(A.push(z),On(z))})}function Ve(N,z,Q){Q===void 0&&(Q={}),E.fetchers.set(N,z),We({fetchers:new Map(E.fetchers)},{flushSync:(Q&&Q.flushSync)===!0})}function nt(N,z,Q,te){te===void 0&&(te={});let ye=zl(E.matches,z);ar(N),We({errors:{[ye.route.id]:Q},fetchers:new Map(E.fetchers)},{flushSync:(te&&te.flushSync)===!0})}function Ot(N){return u.v7_fetcherPersist&&(re.set(N,(re.get(N)||0)+1),fe.has(N)&&fe.delete(N)),E.fetchers.get(N)||ZH}function ar(N){let z=E.fetchers.get(N);R.has(N)&&!(z&&z.state==="loading"&&B.has(N))&&On(N),X.delete(N),B.delete(N),U.delete(N),fe.delete(N),E.fetchers.delete(N)}function Ii(N){if(u.v7_fetcherPersist){let z=(re.get(N)||0)-1;z<=0?(re.delete(N),fe.add(N)):re.set(N,z)}else ar(N);We({fetchers:new Map(E.fetchers)})}function On(N){let z=R.get(N);Ue(z,"Expected fetch controller: "+N),z.abort(),R.delete(N)}function Qr(N){for(let z of N){let Q=Ot(z),te=Ko(Q.data);E.fetchers.set(z,te)}}function jr(){let N=[],z=!1;for(let Q of U){let te=E.fetchers.get(Q);Ue(te,"Expected fetcher: "+Q),te.state==="loading"&&(U.delete(Q),N.push(Q),z=!0)}return Qr(N),z}function Wo(N){let z=[];for(let[Q,te]of B)if(te<N){let ye=E.fetchers.get(Q);Ue(ye,"Expected fetcher: "+Q),ye.state==="loading"&&(On(Q),B.delete(Q),z.push(Q))}return Qr(z),z.length>0}function nl(N,z){let Q=E.blockers.get(N)||yl;return Te.get(N)!==z&&Te.set(N,z),Q}function cu(N){E.blockers.delete(N),Te.delete(N)}function _s(N,z){let Q=E.blockers.get(N)||yl;Ue(Q.state==="unblocked"&&z.state==="blocked"||Q.state==="blocked"&&z.state==="blocked"||Q.state==="blocked"&&z.state==="proceeding"||Q.state==="blocked"&&z.state==="unblocked"||Q.state==="proceeding"&&z.state==="unblocked","Invalid blocker state transition: "+Q.state+" -> "+z.state);let te=new Map(E.blockers);te.set(N,z),We({blockers:te})}function lr(N){let{currentLocation:z,nextLocation:Q,historyAction:te}=N;if(Te.size===0)return;Te.size>1&&Ma(!1,"A router only supports one blocker at a time");let ye=Array.from(Te.entries()),[je,Re]=ye[ye.length-1],Pe=E.blockers.get(je);if(!(Pe&&Pe.state==="proceeding")&&Re({currentLocation:z,nextLocation:Q,historyAction:te}))return je}function Ai(N){let z=[];return Ce.forEach((Q,te)=>{(!N||N(te))&&(Q.cancel(),z.push(te),Ce.delete(te))}),z}function Ch(N,z,Q){if(h=N,g=z,p=Q||null,!v&&E.navigation===Cm){v=!0;let te=Ds(E.location,E.matches);te!=null&&We({restoreScrollPosition:te})}return()=>{h=null,g=null,p=null}}function uu(N,z){return p&&p(N,z.map(te=>RH(te,E.loaderData)))||N.key}function rl(N,z){if(h&&g){let Q=uu(N,z);h[Q]=g()}}function Ds(N,z){if(h){let Q=uu(N,z),te=h[Q];if(typeof te=="number")return te}return null}function qo(N){i={},l=tg(N,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:pe,subscribe:ct,enableScrollRestoration:Ch,navigate:ze,fetch:Qe,revalidate:$e,createHref:N=>e.history.createHref(N),encodeLocation:N=>e.history.encodeLocation(N),getFetcher:Ot,deleteFetcher:Ii,dispose:He,getBlocker:nl,deleteBlocker:cu,_internalFetchControllers:R,_internalActiveDeferreds:Ce,_internalSetRoutes:qo},j}function nW(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ng(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=Jk(o||".",Xk(c,i),su(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&&!N0(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:vi([n,d.pathname])),iu(d)}function rS(e,t,n,r){if(!r||!nW(r))return{path:n};if(r.formMethod&&!cW(r.formMethod))return{path:n,error:fr(405,{method:r.formMethod})};let o=()=>({path:n,error:fr(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),l=oR(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ir(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((p,g)=>{let[v,S]=g;return""+p+v+"="+S+`
|
|
534
|
-
`},""):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(!Ir(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()}}}Ue(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=rg(r.formData),u=r.formData;else if(r.body instanceof FormData)c=rg(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=aS(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=aS(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(Ir(d.formMethod))return{path:n,submission:d};let f=Uo(n);return t&&f.search&&N0(f.search)&&c.append("index",""),f.search="?"+c,{path:iu(f),submission:d}}function rW(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 oS(e,t,n,r,o,i,s,l,c,u,d,f,h,p,g,v){let S=v?Object.values(v)[0]:g?Object.values(g)[0]:void 0,y=e.createURL(t.location),x=e.createURL(o),w=v?Object.keys(v)[0]:void 0,j=rW(n,w).filter((T,P)=>{let{route:_}=T;if(_.lazy)return!0;if(_.loader==null)return!1;if(i)return _.loader.hydrate?!0:t.loaderData[_.id]===void 0&&(!t.errors||t.errors[_.id]===void 0);if(oW(t.loaderData,t.matches[P],T)||l.some(I=>I===T.route.id))return!0;let D=t.matches[P],$=T;return iS(T,Ft({currentUrl:y,currentParams:D.params,nextUrl:x,nextParams:$.params},r,{actionResult:S,defaultShouldRevalidate:s||y.pathname+y.search===x.pathname+x.search||y.search!==x.search||rR(D,$)}))}),E=[];return d.forEach((T,P)=>{if(i||!n.some(L=>L.route.id===T.routeId)||u.has(P))return;let _=aa(h,T.path,p);if(!_){E.push({key:P,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let D=t.fetchers.get(P),$=og(_,T.path),I=!1;f.has(P)?I=!1:c.includes(P)?I=!0:D&&D.state!=="idle"&&D.data===void 0?I=s:I=iS($,Ft({currentUrl:y,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:P,routeId:T.routeId,path:T.path,matches:_,match:$,controller:new AbortController})}),[j,E]}function oW(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function rR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function iS(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function sS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Ue(o,"No route found in manifest");let i={};for(let s in r){let c=o[s]!==void 0&&s!=="hasErrorBoundary";Ma(!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&&!TH.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,Ft({},t(o),{lazy:void 0}))}async function xl(e,t,n,r,o,i,s,l,c){c===void 0&&(c={});let u,d,f,h=v=>{let S,y=new Promise((x,w)=>S=w);return f=()=>S(),t.signal.addEventListener("abort",f),Promise.race([v({request:t,params:n.params,context:c.requestContext}),y])};try{let v=n.route[e];if(n.route.lazy)if(v){let S,y=await Promise.all([h(v).catch(x=>{S=x}),sS(n.route,i,o)]);if(S)throw S;d=y[0]}else if(await sS(n.route,i,o),v=n.route[e],v)d=await h(v);else if(e==="action"){let S=new URL(t.url),y=S.pathname+S.search;throw fr(405,{method:t.method,pathname:y,routeId:n.route.id})}else return{type:Mt.data,data:void 0};else if(v)d=await h(v);else{let S=new URL(t.url),y=S.pathname+S.search;throw fr(404,{pathname:y})}Ue(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(v){u=Mt.error,d=v}finally{f&&t.signal.removeEventListener("abort",f)}if(lW(d)){let v=d.status;if(XH.has(v)){let y=d.headers.get("Location");if(Ue(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!tR.test(y))y=ng(new URL(t.url),r.slice(0,r.indexOf(n)+1),s,!0,y,l);else if(!c.isStaticRequest){let x=new URL(t.url),w=y.startsWith("//")?new URL(x.protocol+y):new URL(y),b=su(w.pathname,s)!=null;w.origin===x.origin&&b&&(y=w.pathname+w.search+w.hash)}if(c.isStaticRequest)throw d.headers.set("Location",y),d;return{type:Mt.redirect,status:v,location:y,revalidate:d.headers.get("X-Remix-Revalidate")!==null,reloadDocument:d.headers.get("X-Remix-Reload-Document")!==null}}if(c.isRouteRequest)throw{type:u===Mt.error?Mt.error:Mt.data,response:d};let S;try{let y=d.headers.get("Content-Type");y&&/\bapplication\/json\b/.test(y)?d.body==null?S=null:S=await d.json():S=await d.text()}catch(y){return{type:Mt.error,error:y}}return u===Mt.error?{type:u,error:new A0(v,d.statusText,S),headers:d.headers}:{type:Mt.data,data:S,statusCode:d.status,headers:d.headers}}if(u===Mt.error)return{type:u,error:d};if(aW(d)){var p,g;return{type:Mt.deferred,deferredData:d,statusCode:(p=d.init)==null?void 0:p.status,headers:((g=d.init)==null?void 0:g.headers)&&new Headers(d.init.headers)}}return{type:Mt.data,data:d}}function wl(e,t,n,r){let o=e.createURL(oR(t)).toString(),i={signal:n};if(r&&Ir(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=rg(r.formData):i.body=r.formData}return new Request(o,i)}function rg(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function aS(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function iW(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(Ue(!Ki(d),"Cannot handle redirect results in processLoaderData"),la(d)){let p=zl(e,h),g=d.error;r&&(g=Object.values(r)[0],r=void 0),s=s||{},s[p.route.id]==null&&(s[p.route.id]=g),i[h]=void 0,c||(c=!0,l=Zk(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else Qi(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 lS(e,t,n,r,o,i,s,l){let{loaderData:c,errors:u}=iW(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:p}=i[d];Ue(s!==void 0&&s[d]!==void 0,"Did not find corresponding fetcher result");let g=s[d];if(!(p&&p.signal.aborted))if(la(g)){let v=zl(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=Ft({},u,{[v.route.id]:g.error})),e.fetchers.delete(f)}else if(Ki(g))Ue(!1,"Unhandled fetcher revalidation redirect");else if(Qi(g))Ue(!1,"Unhandled fetcher deferred data");else{let v=Ko(g.data);e.fetchers.set(f,v)}}return{loaderData:c,errors:u}}function cS(e,t,n,r){let o=Ft({},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 zl(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 uS(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 fr(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 A0(e||500,s,new Error(l),!0)}function dS(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(Ki(n))return{result:n,idx:t}}}function oR(e){let t=typeof e=="string"?Uo(e):e;return iu(Ft({},t,{hash:""}))}function sW(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Qi(e){return e.type===Mt.deferred}function la(e){return e.type===Mt.error}function Ki(e){return(e&&e.type)===Mt.redirect}function aW(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 lW(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function cW(e){return YH.has(e.toLowerCase())}function Ir(e){return QH.has(e.toLowerCase())}async function fS(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&&!rR(u,c)&&(i&&i[c.route.id])!==void 0;if(Qi(l)&&(o||d)){let f=r[s];Ue(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await iR(l,f,o).then(h=>{h&&(n[s]=h||n[s])})}}}async function iR(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Mt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Mt.error,error:o}}return{type:Mt.data,data:e.deferredData.data}}}function N0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function og(e,t){let n=typeof t=="string"?Uo(t).search:t.search;if(e[e.length-1].route.index&&N0(n||""))return e[e.length-1];let r=Yk(e);return r[r.length-1]}function hS(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 Em(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 uW(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 Sl(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 dW(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 Ko(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 fW(e,t){try{let n=e.sessionStorage.getItem(nR);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 hW(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(nR,JSON.stringify(n))}catch(r){Ma(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
535
|
-
* React Router v6.22.3
|
|
536
|
-
*
|
|
537
|
-
* Copyright (c) Remix Software Inc.
|
|
538
|
-
*
|
|
539
|
-
* This source code is licensed under the MIT license found in the
|
|
540
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
541
|
-
*
|
|
542
|
-
* @license MIT
|
|
543
|
-
*/function wc(){return wc=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},wc.apply(this,arguments)}const gh=m.createContext(null),sR=m.createContext(null),vh=m.createContext(null),yh=m.createContext(null),Ri=m.createContext({outlet:null,matches:[],isDataRoute:!1}),aR=m.createContext(null);function xh(){return m.useContext(yh)!=null}function Ho(){return xh()||Ue(!1),m.useContext(yh).location}function lR(e){m.useContext(vh).static||m.useLayoutEffect(e)}function Bt(){let{isDataRoute:e}=m.useContext(Ri);return e?TW():mW()}function mW(){xh()||Ue(!1);let e=m.useContext(gh),{basename:t,future:n,navigator:r}=m.useContext(vh),{matches:o}=m.useContext(Ri),{pathname:i}=Ho(),s=JSON.stringify(Xk(o,n.v7_relativeSplatPath)),l=m.useRef(!1);return lR(()=>{l.current=!0}),m.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=Jk(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:vi([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,s,i,e])}const pW=m.createContext(null);function gW(e){let t=m.useContext(Ri).outlet;return t&&m.createElement(pW.Provider,{value:e},t)}function st(){let{matches:e}=m.useContext(Ri),t=e[e.length-1];return t?t.params:{}}function vW(e,t){return cR(e,t)}function cR(e,t,n,r){xh()||Ue(!1);let{navigator:o}=m.useContext(vh),{matches:i}=m.useContext(Ri),s=i[i.length-1],l=s?s.params:{};s&&s.pathname;let c=s?s.pathnameBase:"/";s&&s.route;let u=Ho(),d;if(t){var f;let S=typeof t=="string"?Uo(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||Ue(!1),d=S}else d=u;let h=d.pathname||"/",p=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");p="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=aa(e,{pathname:p}),v=bW(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:vi([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:vi([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?m.createElement(yh.Provider,{value:{location:wc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Wt.Pop}},v):v}function yW(){let e=PW(),t=Zk(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 m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),n?m.createElement("pre",{style:o},n):null,null)}const xW=m.createElement(yW,null);class wW extends m.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?m.createElement(Ri.Provider,{value:this.props.routeContext},m.createElement(aR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function SW(e){let{routeContext:t,match:n,children:r}=e,o=m.useContext(gh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),m.createElement(Ri.Provider,{value:t},r)}function bW(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||Ue(!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:p}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!p||p[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 p,g=!1,v=null,S=null;n&&(p=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||xW,c&&(u<0&&h===0?(kW("route-fallback",!1),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let y=t.concat(s.slice(0,h+1)),x=()=>{let w;return p?w=v:g?w=S:f.route.Component?w=m.createElement(f.route.Component,null):f.route.element?w=f.route.element:w=d,m.createElement(SW,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:w})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?m.createElement(wW,{location:n.location,revalidation:n.revalidation,component:v,error:p,children:x(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):x()},null)}var uR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(uR||{}),Xd=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}(Xd||{});function CW(e){let t=m.useContext(gh);return t||Ue(!1),t}function EW(e){let t=m.useContext(sR);return t||Ue(!1),t}function jW(e){let t=m.useContext(Ri);return t||Ue(!1),t}function dR(e){let t=jW(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function PW(){var e;let t=m.useContext(aR),n=EW(Xd.UseRouteError),r=dR(Xd.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function TW(){let{router:e}=CW(uR.UseNavigateStable),t=dR(Xd.UseNavigateStable),n=m.useRef(!1);return lR(()=>{n.current=!0}),m.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,wc({fromRouteId:t},i)))},[e,t])}const mS={};function kW(e,t,n){!t&&!mS[e]&&(mS[e]=!0)}function O0(e){return gW(e.context)}function xe(e){Ue(!1)}function RW(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Wt.Pop,navigator:i,static:s=!1,future:l}=e;xh()&&Ue(!1);let c=t.replace(/^\/*/,"/"),u=m.useMemo(()=>({basename:c,navigator:i,static:s,future:wc({v7_relativeSplatPath:!1},l)}),[c,l,i,s]);typeof r=="string"&&(r=Uo(r));let{pathname:d="/",search:f="",hash:h="",state:p=null,key:g="default"}=r,v=m.useMemo(()=>{let S=su(d,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:p,key:g},navigationType:o}},[c,d,f,h,p,g,o]);return v==null?null:m.createElement(vh.Provider,{value:u},m.createElement(yh.Provider,{children:n,value:v}))}function _W(e){let{children:t,location:n}=e;return vW(ig(t),n)}new Promise(()=>{});function ig(e,t){t===void 0&&(t=[]);let n=[];return m.Children.forEach(e,(r,o)=>{if(!m.isValidElement(r))return;let i=[...t,o];if(r.type===m.Fragment){n.push.apply(n,ig(r.props.children,i));return}r.type!==xe&&Ue(!1),!r.props.index||!r.props.children||Ue(!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=ig(r.props.children,i)),n.push(s)}),n}function DW(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:m.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:m.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:m.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
544
|
-
* React Router DOM v6.22.3
|
|
545
|
-
*
|
|
546
|
-
* Copyright (c) Remix Software Inc.
|
|
547
|
-
*
|
|
548
|
-
* This source code is licensed under the MIT license found in the
|
|
549
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
550
|
-
*
|
|
551
|
-
* @license MIT
|
|
552
|
-
*/function Jd(){return Jd=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},Jd.apply(this,arguments)}function sg(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 IW(e,t){let n=sg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const AW="6";try{window.__reactRouterVersion=AW}catch{}function NW(e,t){return tW({basename:t==null?void 0:t.basename,future:Jd({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:EH({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||OW(),routes:e,mapRouteProperties:DW,window:t==null?void 0:t.window}).initialize()}function OW(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Jd({},t,{errors:MW(t.errors)})),t}function MW(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 A0(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 $W=m.createContext({isTransitioning:!1}),LW=m.createContext(new Map),FW="startTransition",pS=qS[FW],zW="flushSync",gS=CA[zW];function VW(e){pS?pS(e):e()}function bl(e){gS?gS(e):e()}class BW{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 UW(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=m.useState(n.state),[s,l]=m.useState(),[c,u]=m.useState({isTransitioning:!1}),[d,f]=m.useState(),[h,p]=m.useState(),[g,v]=m.useState(),S=m.useRef(new Map),{v7_startTransition:y}=r||{},x=m.useCallback(T=>{y?VW(T):T()},[y]),w=m.useCallback((T,P)=>{let{deletedFetchers:_,unstable_flushSync:D,unstable_viewTransitionOpts:$}=P;_.forEach(L=>S.current.delete(L)),T.fetchers.forEach((L,F)=>{L.data!==void 0&&S.current.set(F,L.data)});let I=n.window==null||typeof n.window.document.startViewTransition!="function";if(!$||I){D?bl(()=>i(T)):x(()=>i(T));return}if(D){bl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:$.currentLocation,nextLocation:$.nextLocation})});let L=n.window.document.startViewTransition(()=>{bl(()=>i(T))});L.finished.finally(()=>{bl(()=>{f(void 0),p(void 0),l(void 0),u({isTransitioning:!1})})}),bl(()=>p(L));return}h?(d&&d.resolve(),h.skipTransition(),v({state:T,currentLocation:$.currentLocation,nextLocation:$.nextLocation})):(l(T),u({isTransitioning:!0,flushSync:!1,currentLocation:$.currentLocation,nextLocation:$.nextLocation}))},[n.window,h,d,S,x]);m.useLayoutEffect(()=>n.subscribe(w),[n,w]),m.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new BW)},[c]),m.useEffect(()=>{if(d&&s&&n.window){let T=s,P=d.promise,_=n.window.document.startViewTransition(async()=>{x(()=>i(T)),await P});_.finished.finally(()=>{f(void 0),p(void 0),l(void 0),u({isTransitioning:!1})}),p(_)}},[x,s,d,n.window]),m.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,h,o.location,s]),m.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[c.isTransitioning,g]),m.useEffect(()=>{},[]);let b=m.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,P,_)=>n.navigate(T,{state:P,preventScrollReset:_==null?void 0:_.preventScrollReset}),replace:(T,P,_)=>n.navigate(T,{replace:!0,state:P,preventScrollReset:_==null?void 0:_.preventScrollReset})}),[n]),j=n.basename||"/",E=m.useMemo(()=>({router:n,navigator:b,static:!1,basename:j}),[n,b,j]);return m.createElement(m.Fragment,null,m.createElement(gh.Provider,{value:E},m.createElement(sR.Provider,{value:o},m.createElement(LW.Provider,{value:S.current},m.createElement($W.Provider,{value:c},m.createElement(RW,{basename:j,location:o.location,navigationType:o.historyAction,navigator:b,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?m.createElement(HW,{routes:n.routes,future:n.future,state:o}):t))))),null)}function HW(e){let{routes:t,future:n,state:r}=e;return cR(t,void 0,r,n)}var vS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vS||(vS={}));var yS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(yS||(yS={}));function M0(e){let t=m.useRef(sg(e)),n=m.useRef(!1),r=Ho(),o=m.useMemo(()=>IW(r.search,n.current?null:t.current),[r.search]),i=Bt(),s=m.useCallback((l,c)=>{const u=sg(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,s]}const WW=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 au(e,t){const n=qW(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 qW(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=WW.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var tl=(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 GW=[".DS_Store","Thumbs.db"];function QW(e){return tl(this,null,function*(){return Zd(e)&&KW(e.dataTransfer)?ZW(e.dataTransfer,e.type):YW(e)?XW(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?JW(e):[]})}function KW(e){return Zd(e)}function YW(e){return Zd(e)&&Zd(e.target)}function Zd(e){return typeof e=="object"&&e!==null}function XW(e){return ag(e.target.files).map(t=>au(t))}function JW(e){return tl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>au(n))})}function ZW(e,t){return tl(this,null,function*(){if(e.items){const n=ag(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(eq));return xS(fR(r))}return xS(ag(e.files).map(n=>au(n)))})}function xS(e){return e.filter(t=>GW.indexOf(t.name)===-1)}function ag(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 eq(e){if(typeof e.webkitGetAsEntry!="function")return wS(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?hR(t):wS(e)}function fR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?fR(n):[n]],[])}function wS(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=au(t);return Promise.resolve(n)}function tq(e){return tl(this,null,function*(){return e.isDirectory?hR(e):nq(e)})}function hR(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(s=>tl(this,null,function*(){if(s.length){const l=Promise.all(s.map(tq));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),s=>{r(s)})}i()})}function nq(e){return tl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=au(r,e.fullPath);t(o)},r=>{n(r)})})})}function rq(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 oq=Object.defineProperty,iq=Object.defineProperties,sq=Object.getOwnPropertyDescriptors,SS=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,lq=Object.prototype.propertyIsEnumerable,bS=(e,t,n)=>t in e?oq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cq=(e,t)=>{for(var n in t||(t={}))aq.call(t,n)&&bS(e,n,t[n]);if(SS)for(var n of SS(t))lq.call(t,n)&&bS(e,n,t[n]);return e},uq=(e,t)=>iq(e,sq(t));const dq="file-invalid-type",fq="file-too-large",hq="file-too-small",mq="too-many-files",pq=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:dq,message:`File type must be ${t}`}},CS=e=>({code:fq,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),ES=e=>({code:hq,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),gq={code:mq,message:"Too many files"};function mR(e,t){const n=e.type==="application/x-moz-file"||rq(e,t);return[n,n?null:pq(t)]}function pR(e,t,n){if(Bi(e.size))if(Bi(t)&&Bi(n)){if(e.size>n)return[!1,CS(n)];if(e.size<t)return[!1,ES(t)]}else{if(Bi(t)&&e.size<t)return[!1,ES(t)];if(Bi(n)&&e.size>n)return[!1,CS(n)]}return[!0,null]}function Bi(e){return e!=null}function vq({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]=mR(l,t),[u]=pR(l,n,r),d=s?s(l):null;return c&&u&&!d})}function ef(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Bu(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 jS(e){e.preventDefault()}function yq(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function xq(e){return e.indexOf("Edge/")!==-1}function wq(e=window.navigator.userAgent){return yq(e)||xq(e)}function Xr(...e){return(t,...n)=>e.some(r=>(!ef(t)&&r&&r(t,...n),ef(t)))}function Sq(){return"showOpenFilePicker"in window}function bq(e){return Bi(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return gR(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(vR))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>uq(cq({},n),{[r]:o}),{})}]:e}function Cq(e){if(Bi(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>gR(t)||vR(t)).join(",")}function Eq(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function jq(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function gR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function vR(e){return/^.*\.[\w]+$/.test(e)}var Pq=Object.defineProperty,Tq=Object.defineProperties,kq=Object.getOwnPropertyDescriptors,tf=Object.getOwnPropertySymbols,yR=Object.prototype.hasOwnProperty,xR=Object.prototype.propertyIsEnumerable,PS=(e,t,n)=>t in e?Pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,En=(e,t)=>{for(var n in t||(t={}))yR.call(t,n)&&PS(e,n,t[n]);if(tf)for(var n of tf(t))xR.call(t,n)&&PS(e,n,t[n]);return e},ei=(e,t)=>Tq(e,kq(t)),nf=(e,t)=>{var n={};for(var r in e)yR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tf)for(var r of tf(e))t.indexOf(r)<0&&xR.call(e,r)&&(n[r]=e[r]);return n};const $0=m.forwardRef((e,t)=>{var n=e,{children:r}=n,o=nf(n,["children"]);const i=SR(o),{open:s}=i,l=nf(i,["open"]);return m.useImperativeHandle(t,()=>({open:s}),[s]),C.createElement(m.Fragment,null,r(ei(En({},l),{open:s})))});$0.displayName="Dropzone";const wR={disabled:!1,getFilesFromEvent:QW,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};$0.defaultProps=wR;$0.propTypes={children:ht.func,accept:ht.objectOf(ht.arrayOf(ht.string)),multiple:ht.bool,preventDropOnDocument:ht.bool,noClick:ht.bool,noKeyboard:ht.bool,noDrag:ht.bool,noDragEventsBubbling:ht.bool,minSize:ht.number,maxSize:ht.number,maxFiles:ht.number,disabled:ht.bool,getFilesFromEvent:ht.func,onFileDialogCancel:ht.func,onFileDialogOpen:ht.func,useFsAccessApi:ht.bool,autoFocus:ht.bool,onDragEnter:ht.func,onDragLeave:ht.func,onDragOver:ht.func,onDrop:ht.func,onDropAccepted:ht.func,onDropRejected:ht.func,onError:ht.func,validator:ht.func};const lg={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function SR(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:p,onFileDialogCancel:g,onFileDialogOpen:v,useFsAccessApi:S,autoFocus:y,preventDropOnDocument:x,noClick:w,noKeyboard:b,noDrag:j,noDragEventsBubbling:E,onError:T,validator:P}=En(En({},wR),e),_=m.useMemo(()=>Cq(t),[t]),D=m.useMemo(()=>bq(t),[t]),$=m.useMemo(()=>typeof v=="function"?v:TS,[v]),I=m.useMemo(()=>typeof g=="function"?g:TS,[g]),L=m.useRef(null),F=m.useRef(null),[O,A]=m.useReducer(Rq,lg),{isFocused:R,isFileDialogActive:k}=O,M=m.useRef(typeof window<"u"&&window.isSecureContext&&S&&Sq()),B=()=>{!M.current&&k&&setTimeout(()=>{if(F.current){const{files:q}=F.current;q.length||(A({type:"closeDialog"}),I())}},300)};m.useEffect(()=>(window.addEventListener("focus",B,!1),()=>{window.removeEventListener("focus",B,!1)}),[F,k,I,M]);const U=m.useRef([]),X=q=>{L.current&&L.current.contains(q.target)||(q.preventDefault(),U.current=[])};m.useEffect(()=>(x&&(document.addEventListener("dragover",jS,!1),document.addEventListener("drop",X,!1)),()=>{x&&(document.removeEventListener("dragover",jS),document.removeEventListener("drop",X))}),[L,x]),m.useEffect(()=>(!n&&y&&L.current&&L.current.focus(),()=>{}),[L,y,n]);const re=m.useCallback(q=>{T?T(q):console.error(q)},[T]),fe=m.useCallback(q=>{q.preventDefault(),q.persist(),Ee(q),U.current=[...U.current,q.target],Bu(q)&&Promise.resolve(r(q)).then(ge=>{if(ef(q)&&!E)return;const Me=ge.length,Ve=Me>0&&vq({files:ge,accept:_,minSize:i,maxSize:o,multiple:s,maxFiles:l,validator:P}),nt=Me>0&&!Ve;A({isDragAccept:Ve,isDragReject:nt,isDragActive:!0,type:"setDraggedFiles"}),c&&c(q)}).catch(ge=>re(ge))},[r,c,re,E,_,i,o,s,l,P]),Ce=m.useCallback(q=>{q.preventDefault(),q.persist(),Ee(q);const ge=Bu(q);if(ge&&q.dataTransfer)try{q.dataTransfer.dropEffect="copy"}catch{}return ge&&d&&d(q),!1},[d,E]),Te=m.useCallback(q=>{q.preventDefault(),q.persist(),Ee(q);const ge=U.current.filter(Ve=>L.current&&L.current.contains(Ve)),Me=ge.indexOf(q.target);Me!==-1&&ge.splice(Me,1),U.current=ge,!(ge.length>0)&&(A({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Bu(q)&&u&&u(q))},[L,u,E]),Ae=m.useCallback((q,ge)=>{const Me=[],Ve=[];q.forEach(nt=>{const[Ot,ar]=mR(nt,_),[Ii,On]=pR(nt,i,o),Qr=P?P(nt):null;if(Ot&&Ii&&!Qr)Me.push(nt);else{let jr=[ar,On];Qr&&(jr=jr.concat(Qr)),Ve.push({file:nt,errors:jr.filter(Wo=>Wo)})}}),(!s&&Me.length>1||s&&l>=1&&Me.length>l)&&(Me.forEach(nt=>{Ve.push({file:nt,errors:[gq]})}),Me.splice(0)),A({acceptedFiles:Me,fileRejections:Ve,type:"setFiles"}),f&&f(Me,Ve,ge),Ve.length>0&&p&&p(Ve,ge),Me.length>0&&h&&h(Me,ge)},[A,s,_,i,o,l,f,h,p,P]),pe=m.useCallback(q=>{q.preventDefault(),q.persist(),Ee(q),U.current=[],Bu(q)&&Promise.resolve(r(q)).then(ge=>{ef(q)&&!E||Ae(ge,q)}).catch(ge=>re(ge)),A({type:"reset"})},[r,Ae,re,E]),He=m.useCallback(()=>{if(M.current){A({type:"openDialog"}),$();const q={multiple:s,types:D};window.showOpenFilePicker(q).then(ge=>r(ge)).then(ge=>{Ae(ge,null),A({type:"closeDialog"})}).catch(ge=>{Eq(ge)?(I(ge),A({type:"closeDialog"})):jq(ge)?(M.current=!1,F.current?(F.current.value=null,F.current.click()):re(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."))):re(ge)});return}F.current&&(A({type:"openDialog"}),$(),F.current.value=null,F.current.click())},[A,$,I,S,Ae,re,D,s]),ct=m.useCallback(q=>{!L.current||!L.current.isEqualNode(q.target)||(q.key===" "||q.key==="Enter"||q.keyCode===32||q.keyCode===13)&&(q.preventDefault(),He())},[L,He]),We=m.useCallback(()=>{A({type:"focus"})},[]),be=m.useCallback(()=>{A({type:"blur"})},[]),ze=m.useCallback(()=>{w||(wq()?setTimeout(He,0):He())},[w,He]),$e=q=>n?null:q,Y=q=>b?null:$e(q),oe=q=>j?null:$e(q),Ee=q=>{E&&q.stopPropagation()},Qe=m.useMemo(()=>(q={})=>{var ge=q,{refKey:Me="ref",role:Ve,onKeyDown:nt,onFocus:Ot,onBlur:ar,onClick:Ii,onDragEnter:On,onDragOver:Qr,onDragLeave:jr,onDrop:Wo}=ge,nl=nf(ge,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return En(En({onKeyDown:Y(Xr(nt,ct)),onFocus:Y(Xr(Ot,We)),onBlur:Y(Xr(ar,be)),onClick:$e(Xr(Ii,ze)),onDragEnter:oe(Xr(On,fe)),onDragOver:oe(Xr(Qr,Ce)),onDragLeave:oe(Xr(jr,Te)),onDrop:oe(Xr(Wo,pe)),role:typeof Ve=="string"&&Ve!==""?Ve:"presentation",[Me]:L},!n&&!b?{tabIndex:0}:{}),nl)},[L,ct,We,be,ze,fe,Ce,Te,pe,b,j,n]),Ze=m.useCallback(q=>{q.stopPropagation()},[]),ee=m.useMemo(()=>(q={})=>{var ge=q,{refKey:Me="ref",onChange:Ve,onClick:nt}=ge,Ot=nf(ge,["refKey","onChange","onClick"]);const ar={accept:_,multiple:s,type:"file",style:{display:"none"},onChange:$e(Xr(Ve,pe)),onClick:$e(Xr(nt,Ze)),tabIndex:-1,[Me]:F};return En(En({},ar),Ot)},[F,t,s,pe,n]);return ei(En({},O),{isFocused:R&&!n,getRootProps:Qe,getInputProps:ee,rootRef:L,inputRef:F,open:$e(He)})}function Rq(e,t){switch(t.type){case"focus":return ei(En({},e),{isFocused:!0});case"blur":return ei(En({},e),{isFocused:!1});case"openDialog":return ei(En({},lg),{isFileDialogActive:!0});case"closeDialog":return ei(En({},e),{isFileDialogActive:!1});case"setDraggedFiles":return ei(En({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ei(En({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return En({},lg);default:return e}}function TS(){}const[_q,Dq]=Dn("Dropzone component was not found in tree");function L0(e){const t=n=>{const{children:r,...o}=H(`Dropzone${J0(e)}`,{},n),i=Dq(),s=Ao(r)?r:C.createElement("span",null,r);return i[e]?m.cloneElement(s,o):null};return t.displayName=`@mantine/dropzone/${J0(e)}`,t}const Iq=L0("accept"),Aq=L0("reject"),Nq=L0("idle");var Sc={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const Oq={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},Mq=(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":Ct(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":s.color,"--dropzone-reject-bg":s.background}}},_i=K((e,t)=>{const n=H("Dropzone",Oq,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:p,accept:g,children:v,onDropAny:S,onDrop:y,onReject:x,openRef:w,name:b,maxFiles:j,autoFocus:E,activateOnClick:T,activateOnDrag:P,dragEventsBubbling:_,activateOnKeyboard:D,onDragEnter:$,onDragLeave:I,onDragOver:L,onFileDialogCancel:F,onFileDialogOpen:O,preventDropOnDocument:A,useFsAccessApi:R,getFilesFromEvent:k,validator:M,rejectColor:B,acceptColor:U,enablePointerEvents:X,loaderProps:re,inputProps:fe,mod:Ce,...Te}=n,Ae=de({name:"Dropzone",classes:Sc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,vars:c,varsResolver:Mq}),{getRootProps:pe,getInputProps:He,isDragAccept:ct,isDragReject:We,open:be}=SR({onDrop:S,onDropAccepted:y,onDropRejected:x,disabled:d||f,accept:Array.isArray(g)?g.reduce(($e,Y)=>({...$e,[Y]:[]}),{}):g,multiple:h,maxSize:p,maxFiles:j,autoFocus:E,noClick:!T,noDrag:!P,noDragEventsBubbling:!_,noKeyboard:!D,onDragEnter:$,onDragLeave:I,onDragOver:L,onFileDialogCancel:F,onFileDialogOpen:O,preventDropOnDocument:A,useFsAccessApi:R,validator:M,...k?{getFilesFromEvent:k}:null});lf(w,be);const ze=!ct&&!We;return C.createElement(_q,{value:{accept:ct,reject:We,idle:ze}},C.createElement(G,{...pe({ref:t}),...Ae("root",{focusable:!0}),...Te,mod:[{accept:ct,reject:We,idle:ze,loading:f,"activate-on-click":T},Ce]},C.createElement(fy,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:re}),C.createElement("input",{...He(fe),name:b}),C.createElement("div",{...Ae("inner"),"data-enable-pointer-events":X||void 0},v)))});_i.classes=Sc;_i.displayName="@mantine/dropzone/Dropzone";_i.Accept=Iq;_i.Idle=Nq;_i.Reject=Aq;const $q={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Ur("max"),withinPortal:!0},F0=K((e,t)=>{const n=H("DropzoneFullScreen",$q,e),{classNames:r,className:o,style:i,styles:s,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:p,portalProps:g,...v}=n,S=de({name:"DropzoneFullScreen",classes:Sc,props:n,className:o,style:i,classNames:r,styles:s,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:y,resolvedStyles:x}=Ec({classNames:r,styles:s,props:n}),[w,b]=m.useState(0),[j,{open:E,close:T}]=l_(!1),P=D=>{var $;($=D.dataTransfer)!=null&&$.types.includes("Files")&&(b(I=>I+1),E())},_=()=>{b(D=>D-1)};return m.useEffect(()=>{w===0&&T()},[w]),m.useEffect(()=>{if(u)return document.addEventListener("dragenter",P,!1),document.addEventListener("dragleave",_,!1),()=>{document.removeEventListener("dragenter",P,!1),document.removeEventListener("dragleave",_,!1)}},[u]),C.createElement(xs,{...g,withinPortal:p},C.createElement(G,{...S("fullScreen",{style:{opacity:j?1:0,pointerEvents:j?"all":"none",zIndex:h}}),ref:t},C.createElement(_i,{...v,classNames:y,styles:x,unstyled:l,className:Sc.dropzone,onDrop:D=>{d==null||d(D),T(),b(0)},onReject:D=>{f==null||f(D),T(),b(0)}})))});F0.classes=Sc;F0.displayName="@mantine/dropzone/DropzoneFullScreen";_i.FullScreen=F0;const Uu=_i,Lq='{"resourceType": "Bundle"}';function jm({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:s="show",loading:l}){io[s]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function Fq(){const e=Nt(),t=se(),[n,r]=m.useState({}),o=m.useCallback(async(l,c)=>{const u="batch-upload";jm({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=pT(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),jm({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(uh,{size:"1rem"}),withCloseButton:!0})}catch(d){jm({id:u,title:"Batch Upload Failed",color:"red",message:Oe(d),method:"update",icon:a.jsx(qd,{size:"1rem"}),withCloseButton:!0})}},[t]),i=m.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=m.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return a.jsxs(_e,{children:[a.jsx(me,{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(et,{defaultValue:"upload",children:[a.jsxs(et.List,{children:[a.jsx(et.Tab,{value:"upload",children:"File Upload"}),a.jsx(et.Tab,{value:"json",children:"JSON"})]}),a.jsx(et.Panel,{value:"upload",pt:"xs",children:a.jsx(Uu,{onDrop:i,accept:["application/json"],children:a.jsxs(Z,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(Uu.Accept,{children:a.jsx(Ow,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(Uu.Reject,{children:a.jsx(qd,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(Uu.Idle,{children:a.jsx(Ow,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(ce,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(ce,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(et.Panel,{value:"json",pt:"xs",children:a.jsxs(Ye,{onSubmit:s,children:[a.jsx(Ga,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:Lq,deserialize:JSON.parse}),a.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ie,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(et,{defaultValue:Object.keys(n)[0],children:[a.jsx(et.List,{children:Object.keys(n).map(l=>a.jsx(et.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>a.jsx(et.Panel,{value:l,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),a.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ie,{onClick:()=>r({}),children:"Start over"})})]})]})}function zq(){const{resourceType:e}=st(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Na("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(_e,{children:[a.jsxs(me,{children:["No apps for ",e]}),a.jsx(Ge,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(_e,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(Ge,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Vr,{})}function Vq(){const e=se(),[t,n]=m.useState(),[r,o]=m.useState(!1);return a.jsx(_e,{width:450,children:a.jsxs(Ye,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(s=>n(pt(s)))},children:[a.jsxs(cn,{style:{flexDirection:"column"},children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Change password"})]}),!r&&a.jsxs(Ie,{gap:"xl",mt:"xl",children:[a.jsx($r,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Xe(t,"oldPassword")}),a.jsx($r,{name:"newPassword",label:"New password",required:!0,error:Xe(t,"newPassword")}),a.jsx($r,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Xe(t,"confirmPassword")}),a.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ie,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const cg=["Form","JSON","Profiles"],Bq=["Profiles"],Pm=cg[0].toLowerCase();function Uq(){const e=Bt(),t=Nt(),{resourceType:n}=st(),[r,o]=m.useState(()=>{const s=window.location.pathname.split("/").pop();return s&&cg.map(l=>l.toLowerCase()).includes(s)?s:Pm});function i(s){s||(s=Pm),o(s),e(`/${n}/new/${s}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{children:[a.jsxs(ce,{p:"md",fw:500,children:["New ",n]}),a.jsx(br,{children:a.jsx(et,{defaultValue:Pm,value:r,onChange:i,children:a.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:cg.map(s=>a.jsx(et.Tab,{value:s.toLowerCase(),px:"md",children:Bq.includes(s)?a.jsxs(Z,{gap:"xs",wrap:"nowrap",children:[s,a.jsx($c,{color:t.primaryColor,size:"sm",children:"Beta"})]}):s},s))})})})]}),a.jsx(O0,{})]})}function Hq(){return a.jsx(_e,{children:a.jsxs(Ie,{children:[a.jsx(me,{order:1,children:"Unexpected Error"}),a.jsx(ce,{children:"We're sorry, something went wrong."}),a.jsxs(ce,{children:["Please contact ",a.jsx(Je,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const Wq="_root_1fbwr_1",qq="_entry_1fbwr_8",Gq="_key_1fbwr_13",Qq="_value_1fbwr_20",wh={root:Wq,entry:qq,key:Gq,value:Qq};function Fe(e){return a.jsx(br,{children:a.jsx("div",{className:wh.root,children:e.children})})}Fe.Entry=function(t){return a.jsx("div",{className:wh.entry,children:t.children})};Fe.Key=function(t){return a.jsx("div",{className:wh.key,children:t.children})};Fe.Value=function(t){return a.jsx("div",{className:wh.value,children:t.children})};function Kq(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function bR(e){var n,r;const t=gt(e.patient);return t?a.jsxs(Fe,{children:[a.jsx(ki,{value:t,size:"lg",color:Kq(t)}),a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Name"}),a.jsx(Fe.Value,{children:a.jsx(Ge,{to:t,fw:500,children:t.name?a.jsx(a0,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"DoB"}),a.jsx(Fe.Value,{children:t.birthDate})]}),a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Age"}),a.jsx(Fe.Value,{children:PL(t.birthDate)})]})]}),t.gender&&a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Gender"}),a.jsx(Fe.Value,{children:t.gender})]}),t.address&&a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"State"}),a.jsx(Fe.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:o==null?void 0:o.system}),a.jsx(Fe.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function CR(e){const t=gt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(Ge,{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=_o(t);s!==wt(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(Fe,{children:n.map(s=>a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:s.key}),a.jsx(Fe.Value,{children:s.value})]},`${s.key}-${s.value}`))})}function z0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function Yq(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 ld(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 Di(e){var t;return rh((t=e.getActiveLogin())==null?void 0:t.project)}function Xq(e,t){const n=new Blob([e],{type:en.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 Jq(){const{id:e}=st(),t=Ho(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=se(),[i,s]=m.useState(!0),[l,c]=m.useState(),[u,d]=m.useState(),[f,h]=m.useState(),[p,g]=m.useState(),[v,S]=m.useState();if(m.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,T,P,_,D,$,I;((T=(E=(j=b.entry)==null?void 0:j[0])==null?void 0:E.response)==null?void 0:T.status)!=="200"?g((D=(_=(P=b.entry)==null?void 0:P[0])==null?void 0:_.response)==null?void 0:D.outcome):(c(($=b.entry[0])==null?void 0:$.resource),h((I=b.entry[1])==null?void 0:I.resource)),s(!1)}).catch(b=>{g(b),s(!1)})},[o,e,r]),p)return a.jsx(_e,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(p,void 0,2)})});if(v)return a.jsxs(_e,{children:[a.jsx(me,{children:l==null?void 0:l.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[v.length===1&&a.jsx("li",{children:a.jsx(Ge,{to:v[0],children:"Review your answers"})}),v.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:v.map(w=>a.jsx("li",{children:a.jsx(Ge,{to:w,children:wt(w)})},w.id))})]}),f&&a.jsx("li",{children:a.jsxs(Ge,{to:f,children:["Back to ",_o(f)]})}),a.jsx("li",{children:a.jsx(Ge,{to:"/",children:"Go back home"})})]})]});if(i||!l)return a.jsx(Vr,{});const y=f&&z0(f);return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{shadow:"xs",radius:0,children:[y&&a.jsx(bR,{patient:y}),f&&f.resourceType!=="Patient"&&a.jsx(CR,{resource:f}),a.jsx(G,{px:"xl",py:"md",children:a.jsxs(ce,{children:[_o(l),u&&u.length>1&&a.jsxs(a.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),a.jsx(_e,{children:a.jsx($k,{questionnaire:l,subject:f&&xt(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 Zq="_paper_unw9o_1",eG={paper:Zq},tG={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function ER(e,t){const n=e.resourceType||nG(t),r=e.fields??rG(n),o=e.filters??(e.resourceType?void 0:oG(n)),i=e.sortRules??iG(n),s=e.offset??0,l=e.count??sh;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:s,count:l}}function nG(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 rG(e){const t=V0(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 oG(e){var t;return(t=V0(e))==null?void 0:t.filters}function iG(e){const t=V0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function V0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function sG(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function aG(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=ER(n,t.getUserConfiguration()),o=await t.search(r.resourceType,ia({...r,total:"accurate",fields:void 0}));return pT(o)}function kS(){const e=se(),t=Bt(),n=Ho(),[r,o]=m.useState();return m.useEffect(()=>{const i=V7(n.pathname+n.search),s=ER(i,e.getUserConfiguration());n.pathname===`/${s.resourceType}`&&n.search===ia(s)?(sG(s),o(s)):t(`/${s.resourceType}${ia(s)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?a.jsx(Vr,{}):a.jsx(Un,{shadow:"xs",m:"md",p:"xs",className:eG.paper,children:a.jsx(ou,{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}${ia(i.definition)}`)},onNew:()=>{t(tG[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+ia(r);e.download(i).then(s=>{window.open(window.URL.createObjectURL(s),"_blank")}).catch(s=>ve({color:"red",message:Oe(s),autoClose:!1}))},onExportTransactionBundle:async()=>{aG(r,e).then(i=>Xq(JSON.stringify(i,void 0,2))).catch(i=>ve({color:"red",message:Oe(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=>ve({color:"red",message:Oe(s),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function lG(){const e=se(),[t,n]=m.useState(),[r,o]=m.useState(void 0);m.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=>ve({color:"red",message:Oe(l),autoClose:!1}))},[e]);const i=m.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),ve({color:"green",message:"Success"})}).catch(c=>ve({color:"red",message:Oe(c),autoClose:!1}))},[e]),s=m.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?a.jsx(_e,{children:a.jsxs(Z,{children:[a.jsx(me,{children:"MFA is enabled"}),a.jsx(ie,{onClick:s,children:"Disable MFA"})]})}):a.jsx(_e,{width:400,children:a.jsxs(Ye,{onSubmit:i,children:[a.jsx(me,{children:"Multi Factor Auth Setup"}),a.jsx(cn,{children:a.jsx("img",{src:t})}),a.jsx(ue,{name:"token",label:"Code"}),a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{type:"submit",children:"Enroll"})})]})})}const ug={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function lu(){return ug}function jR(){try{return ug.registerEnabled!==!1&&ug.registerEnabled!=="false"}catch{return!0}}function cG(){const e=Bt(),[t]=M0(),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(qk,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:lu().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(qr,{size:32}),a.jsx(me,{children:"Sign in to Medplum"})]})}function uG(){const e=se(),t=Bt(),n=lu();return m.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),jR()?a.jsxs(gH,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Create a new account"})]}):a.jsx(_e,{width:450,children:a.jsx(Ss,{icon:a.jsx(Kc,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function dG(){const e=Bt(),t=se(),[n,r]=m.useState(),[o,i]=m.useState(!1),s=lu().recaptchaSiteKey;return m.useEffect(()=>{Hk(s)},[s]),a.jsx(_e,{width:450,children:a.jsxs(Ye,{onSubmit:async l=>{let c="";c=await Wk(s),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(pt(u)))},children:[a.jsxs(Ie,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Medplum Password Reset"})]}),a.jsxs(Ie,{gap:"xl",children:[a.jsx(Gr,{issues:eu(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(ue,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Xe(n,"email")}),a.jsxs(Z,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Je,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),a.jsx(ie,{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 fG(){var i;const e=Bt(),t=se(),[n,r]=m.useState();m.useEffect(()=>{t.get("auth/me").then(r).catch(s=>ve({color:"red",message:Oe(s),autoClose:!1}))},[t]);function o(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>ve({color:"green",message:"Login revoked"})).catch(l=>ve({color:"red",message:Oe(l),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(_e,{children:[a.jsx(me,{children:"Security"}),a.jsxs(d0,{children:[a.jsx(bo,{term:"ID",children:a.jsx(Je,{href:`/${wt(n.profile)}`,children:n.profile.id})}),a.jsx(bo,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(bo,{term:"Name",children:Qc((i=n.profile.name)==null?void 0:i[0])})]})]}),a.jsxs(_e,{children:[a.jsx(me,{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:Rn(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Je,{href:"#",onClick:()=>o(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(_e,{children:[a.jsx(me,{children:"Password"}),a.jsx(ie,{onClick:()=>e("/changepassword"),children:"Change password"})]}),a.jsxs(_e,{children:[a.jsx(me,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(ie,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function hG(){const{id:e,secret:t}=st(),n=se(),[r,o]=m.useState(),[i,s]=m.useState(!1),l=eu(r,void 0);return a.jsxs(_e,{width:450,children:[a.jsx(Gr,{issues:l}),a.jsxs(Ye,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(gi("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(pt(d)))},children:[a.jsxs(cn,{style:{flexDirection:"column"},children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Set password"})]}),!i&&a.jsxs(Ie,{children:[a.jsx($r,{name:"password",label:"New password",required:!0,error:Xe(r,"password")}),a.jsx($r,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Xe(r,"confirmPassword")}),a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{type:"submit",children:"Set password"})})]}),i&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(Ge,{to:"/signin",children:"sign in"}),"."]})]})]})}function mG(){const e=ch(),t=Bt(),[n]=M0(),r=lu(),o=m.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return m.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(qk,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:jR()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(qr,{size:32}),a.jsx(me,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function pG(){const e=Bt(),t=Ho(),[n,r]=m.useState(),[o,i]=m.useState(),[s,l]=m.useState();return m.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(SB,{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 Sh(e){const t=se(),n=Di(t),r=Bt(),[o,i]=m.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ae.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ae.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(ou,{search:o,onClick:s=>r(`/admin/members/${s.resource.id}`),onChange:s=>i(s.definition),hideFilters:!0,hideToolbar:!0})}function gG(){return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Bots"}),a.jsx(Sh,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(Z,{justify:"flex-end",children:a.jsx(Ge,{to:"/admin/bots/new",children:"Create new bot"})})]})}function vG(){return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Clients"}),a.jsx(Sh,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(Z,{justify:"flex-end",children:a.jsx(Ge,{to:"/admin/clients/new",children:"Create new client"})})]})}function bh(e){return a.jsx(Ja,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Bo(t)?e.onChange(xt(t)):e.onChange(void 0)}})}function yG(){const e=se(),t=Di(e),[n,r]=m.useState(""),[o,i]=m.useState(""),[s,l]=m.useState(),[c,u]=m.useState(),[d,f]=m.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Create new Bot"}),a.jsxs(Ye,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:s};e.post("admin/projects/"+t+"/bot",h).then(p=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(p),ve({color:"green",message:"Bot created"})}).catch(p=>{ve({color:"red",message:Oe(p),autoClose:!1}),u(pt(p))})},children:[!d&&a.jsxs(Ie,{children:[a.jsx(mt,{title:"Name",htmlFor:"name",outcome:c,children:a.jsx(ue,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Xe(c,"name")})}),a.jsx(mt,{title:"Description",htmlFor:"description",outcome:c,children:a.jsx(ue,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Xe(c,"description")})}),a.jsx(mt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:a.jsx(bh,{name:"accessPolicy",onChange:l})}),a.jsx(Z,{justify:"flex-end",children:a.jsx(ie,{type:"submit",children:"Create Bot"})})]}),d&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(ce,{children:"Bot created"}),a.jsxs(Pn,{children:[a.jsx(Pn.Item,{children:a.jsx(Ge,{to:d,children:"Go to new bot"})}),a.jsx(Pn.Item,{children:a.jsx(Ge,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function xG(){const e=se(),t=Di(e),[n,r]=m.useState(""),[o,i]=m.useState(""),[s,l]=m.useState(""),[c,u]=m.useState(),[d,f]=m.useState(),[h,p]=m.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Create new Client"}),a.jsxs(Ye,{onSubmit:()=>{const g={name:n,description:o,redirectUri:s,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(v=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),p(v),ve({color:"green",message:"Client created"})}).catch(v=>{ve({color:"red",message:Oe(v),autoClose:!1}),f(pt(v))})},children:[!h&&a.jsxs(Ie,{children:[a.jsx(mt,{title:"Name",htmlFor:"name",outcome:d,children:a.jsx(ue,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Xe(d,"name")})}),a.jsx(mt,{title:"Description",htmlFor:"description",outcome:d,children:a.jsx(ue,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Xe(d,"description")})}),a.jsx(mt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:a.jsx(ue,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Xe(d,"redirectUri")})}),a.jsx(mt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:a.jsx(bh,{name:"accessPolicy",onChange:u})}),a.jsx(Z,{justify:"flex-end",children:a.jsx(ie,{type:"submit",children:"Create Client"})})]}),h&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(ce,{children:"Client created"}),a.jsxs(Pn,{children:[a.jsx(Pn.Item,{children:a.jsx(Ge,{to:h,children:"Go to new client"})}),a.jsx(Pn.Item,{children:a.jsx(Ge,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function wG(e){return a.jsx(Ja,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Bo(t)?e.onChange(xt(t)):e.onChange(void 0)}})}function SG(){const{membershipId:e}=st(),t=se(),n=Di(t),r=Bt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,s]=m.useState(o.accessPolicy),[l,c]=m.useState(o.userConfiguration),[u,d]=m.useState(o.admin),[f,h]=m.useState(),[p,g]=m.useState(!1);function v(){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(pt(S)))}return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(ya,{value:o.profile,link:!0})}),a.jsxs(Ye,{onSubmit:()=>{const S={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,S).then(()=>g(!0)).catch(y=>h(pt(y)))},children:[!p&&a.jsxs(Ie,{children:[a.jsx(mt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(bh,{name:"accessPolicy",defaultValue:i,onChange:s})}),a.jsx(mt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:a.jsx(wG,{name:"userConfiguration",defaultValue:l,onChange:c})}),a.jsx(mt,{title:"Admin",htmlFor:"admin",outcome:f,children:a.jsx(wr,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),a.jsxs(Z,{justify:"flex-end",mt:"xl",children:[a.jsx(ie,{type:"submit",children:"Save"}),a.jsx(ie,{type:"button",color:"red",variant:"outline",onClick:v,children:"Remove user"})]})]}),p&&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(Ge,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function bG(){const e=se(),[t,n]=m.useState(e.getProject()),[r,o]=m.useState(),[i,s]=m.useState(),[l,c]=m.useState(!1),[u,d]=m.useState(void 0),f=m.useCallback(h=>{const p={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,p).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),th(g)?s(g):d(g),c(p.sendEmail??!1),ve({color:"green",message:"Invite success"})}).catch(g=>{ve({color:"red",message:Oe(g),autoClose:!1}),s(pt(g))})},[e,t,r]);return a.jsxs(Ye,{onSubmit:f,children:[!u&&!i&&a.jsxs(Ie,{children:[a.jsx(me,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(mt,{title:"Project",htmlFor:"project",outcome:i,children:a.jsx(Ja,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(Tt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Xe(i,"resourceType")}),a.jsx(ue,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Xe(i,"firstName")}),a.jsx(ue,{name:"lastName",label:"Last Name",required:!0,error:Xe(i,"lastName")}),a.jsx(ue,{name:"email",type:"email",label:"Email",required:!0,error:Xe(i,"email")}),a.jsx(mt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:a.jsx(bh,{name:"accessPolicy",onChange:o})}),a.jsx(wr,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(wr,{name:"isAdmin",label:"Admin"}),a.jsx(Z,{justify:"flex-end",children:a.jsx(ie,{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(Ge,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(ce,{children:"User created"}),l&&a.jsx(ce,{children:"Email sent"}),a.jsxs(Pn,{children:[a.jsx(Pn.Item,{children:a.jsx(Ge,{to:u,children:"Go to new membership"})}),a.jsx(Pn.Item,{children:a.jsx(Ge,{to:u.profile,children:"Go to new profile"})}),a.jsx(Pn.Item,{children:a.jsx(Ge,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function CG(){return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Patients"}),a.jsx(Sh,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(Z,{justify:"flex-end",children:a.jsx(Ge,{to:"/admin/invite",children:"Invite new patient"})})]})}function EG(){const e=se();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Gr,{outcome:FP});function t(n){e.post("admin/projects/setpassword",n).then(()=>ve({color:"green",message:"Done"})).catch(r=>ve({color:"red",message:Oe(r),autoClose:!1}))}return a.jsxs(_e,{width:600,children:[a.jsx(me,{order:1,children:"Project Admin"}),a.jsx(gn,{my:"lg"}),a.jsx(me,{order:2,children:"Force Set Password"}),a.jsx(ce,{children:"Sets the password for the specified user in this project."}),a.jsx(ce,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(Ye,{onSubmit:t,children:a.jsxs(Ie,{children:[a.jsx(ue,{name:"email",label:"Email",required:!0}),a.jsx($r,{name:"password",label:"Password",required:!0}),a.jsx(ie,{type:"submit",children:"Force Set Password"})]})})]})}function RS(){const e=se(),t=Di(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Details"}),a.jsxs(d0,{children:[a.jsx(bo,{term:"ID",children:n.project.id}),a.jsx(bo,{term:"Name",children:n.project.name})]})]})}const _S=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function jG(){const e=Bt(),n=Ho().pathname.replace("/admin/","")||_S[0],r=se(),o=Di(r),i=m.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function s(l){e(`/admin/${l}`)}return a.jsxs(a.Fragment,{children:[a.jsxs(Un,{children:[a.jsx(Fe,{children:a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Project"}),a.jsx(Fe.Value,{children:i.project.name})]})}),a.jsx(br,{children:a.jsx(et,{value:n.toLowerCase(),onChange:s,children:a.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:_S.map(l=>a.jsx(et.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),a.jsx(_e,{children:a.jsx(O0,{})})]})}function PG(){const e=se(),t=Di(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=m.useState(!1),[i,s]=m.useState();return m.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),m.useEffect(()=>{n&&s(uo(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(()=>ve({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(me,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(Za,{property:Ts("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(ie,{type:"submit",children:"Save"})]})}function TG(){const e=se(),t=Di(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=m.useState(!1),[i,s]=m.useState();return m.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),m.useEffect(()=>{n&&s(uo(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(()=>ve({color:"green",message:"Saved"})).catch(c=>{var d,f,h,p;const u=pt(c);ve({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(p=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:p[0]}`,autoClose:!1})})},children:[a.jsx(me,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(Za,{property:Ts("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:s,outcome:void 0}),a.jsx(ie,{type:"submit",children:"Save"})]})}function kG(){const e=se();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Gr,{outcome:FP});function t(){Cl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function n(){Cl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function r(){Cl(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){Cl(e,"Reindexing Resources","admin/super/reindex",u)}function i(u){Cl(e,"Rebuilding Compartments","admin/super/compartments",u)}function s(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>ve({color:"green",message:"Done"})).catch(d=>ve({color:"red",message:Oe(d),autoClose:!1}))}function l(u){e.post("admin/super/purge",{...u,before:QT(u.before)}).then(()=>ve({color:"green",message:"Done"})).catch(d=>ve({color:"red",message:Oe(d),autoClose:!1}))}function c(u){e.post("admin/super/setpassword",u).then(()=>ve({color:"green",message:"Done"})).catch(d=>ve({color:"red",message:Oe(d),autoClose:!1}))}return a.jsxs(_e,{width:600,children:[a.jsx(me,{order:1,children:"Super Admin"}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{children:a.jsx(ie,{onClick:t,children:"Rebuild StructureDefinitions"})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{children:a.jsx(ie,{onClick:n,children:"Rebuild SearchParameters"})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{children:a.jsx(ie,{onClick:r,children:"Rebuild ValueSets"})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{onSubmit:o,children:a.jsxs(Ie,{children:[a.jsx(mt,{title:"Resource Type",children:a.jsx(ue,{name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(ie,{type:"submit",children:"Reindex"})]})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{onSubmit:i,children:a.jsxs(Ie,{children:[a.jsx(mt,{title:"Resource Type",children:a.jsx(ue,{name:"resourceType",placeholder:"Compartments Resource Type"})}),a.jsx(ie,{type:"submit",children:"Rebuild Compartments"})]})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{onSubmit:l,children:a.jsxs(Ie,{children:[a.jsx(mt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(Tt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(mt,{title:"Purge Before",htmlFor:"before",children:a.jsx(us,{name:"before",placeholder:"Before Date"})}),a.jsx(ie,{type:"submit",children:"Purge"})]})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(Ye,{onSubmit:s,children:a.jsxs(Ie,{children:[a.jsx(mt,{title:"Bot ID",children:a.jsx(ue,{name:"botId",placeholder:"Bot Id"})}),a.jsx(ie,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(Ye,{onSubmit:c,children:a.jsxs(Ie,{children:[a.jsx(ue,{name:"email",label:"Email",required:!0}),a.jsx($r,{name:"password",label:"Password",required:!0}),a.jsx(ue,{name:"projectId",label:"Project ID"}),a.jsx(ie,{type:"submit",children:"Force Set Password"})]})})]})}function Cl(e,t,n,r){io.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(()=>{io.update({id:n,color:"green",title:t,message:"Done",icon:a.jsx(uh,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{io.update({id:n,color:"red",title:t,message:Oe(i),icon:a.jsx(qd,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function RG(){return a.jsxs(a.Fragment,{children:[a.jsx(me,{children:"Users"}),a.jsx(Sh,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(Z,{justify:"flex-end",children:a.jsx(Ge,{to:"/admin/invite",children:"Invite new user"})})]})}function _G(){const[e]=Na("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(so,{value:(n=t.category)==null?void 0:n[0]})}),a.jsx("td",{children:a.jsx(so,{value:t.code})}),a.jsx("td",{children:a.jsx(so,{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(dg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):a.jsx(Vr,{})}function dg(e){const{ranges:t}=e;if(!t)return null;const n=DS(t.map(o=>o.gender));if(n.length>1)return hc(n),a.jsx(a.Fragment,{children:n.map(o=>{var i;return a.jsxs(m.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Qt(o)})}),a.jsx(dg,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>s.gender===o)})]},o)})});const r=DS(t.map(o=>o.age&&mc(o.age)));return r.length>1?(hc(r),a.jsx(a.Fragment,{children:r.map(o=>{var i;return a.jsxs(m.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Qt(o)})}),a.jsx(dg,{ranges:(i=e.ranges)==null?void 0:i.filter(s=>mc(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(h0,{value:o.range})})]})})},`range-${o.condition}`))})}function DS(e){return[...new Set(e.filter(t=>!!t))]}function DG(){const[e]=Na("ActivityDefinition","_count=100"),[t]=Na("ObservationDefinition","_count=100");return!e||!t?a.jsx(Vr,{}):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(so,{value:(r=n.category)==null?void 0:r[0]})}),a.jsx("td",{children:a.jsx(so,{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 IG(e){var s;const t=se(),[n,r]=m.useState(),[o,i]=m.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(Ge,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(Ge,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(Ye,{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(Ie,{children:[a.jsxs(me,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(ce,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(ce,{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(so,{value:l.code[0]})]},`action-${c}`)})}),a.jsx(mt,{title:"Subject",children:a.jsx(fh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{type:"submit",children:"Go"})})]})})}function AG(){const{resourceType:e,id:t}=st(),n=gt({reference:e+"/"+t});return n?a.jsx(_e,{children:a.jsx(IG,{planDefinition:n})}):null}function NG(){const{resourceType:e,id:t}=st(),n=gt({reference:e+"/"+t}),[r,o]=Na("Questionnaire","subject-type="+e),[i,s]=Na("ClientApplication",{_count:1e3});if(!n||o||s)return a.jsx(Vr,{});const l=i==null?void 0:i.filter(d=>OG(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return a.jsxs(_e,{children:[a.jsx(me,{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=xt(n):n.resourceType==="Encounter"&&(c=n.subject,u=xt(n)),a.jsxs(_e,{children:[r==null?void 0:r.map(d=>a.jsxs("div",{children:[a.jsx(me,{order:3,children:a.jsx(Ge,{to:`/forms/${d.id}?subject=${wt(n)}`,children:d.title||d.name})}),a.jsx(ce,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>a.jsxs("div",{children:[a.jsx(me,{order:3,children:a.jsx(hH,{client:d,patient:c,encounter:u,children:d.name})}),a.jsx(ce,{children:d.description})]},d.id))]})}function OG(e){return e==="Patient"||e==="Encounter"}function MG(){const{resourceType:e,id:t}=st(),n=Bt(),[r,o]=m.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ae.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(_e,{children:a.jsx(ou,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function $G(){const e=se(),{resourceType:t,id:n}=st(),r=e.readHistory(t,n).read();return a.jsx(_e,{children:a.jsx(oH,{history:r})})}const LG="_hl7Input_k5xm3_1",FG={hl7Input:LG};function zG(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 VG(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=>{ld(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const BG=`{
|
|
553
|
-
"resourceType": "Patient",
|
|
554
|
-
"name": [
|
|
555
|
-
{
|
|
556
|
-
"given": [
|
|
557
|
-
"Alice"
|
|
558
|
-
],
|
|
559
|
-
"family": "Smith"
|
|
560
|
-
}
|
|
561
|
-
]
|
|
562
|
-
}`,UG="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 HG(){const e=se(),{id:t}=st(),[n,r]=m.useState(),[o,i]=m.useState(),[s,l]=m.useState(BG),[c,u]=m.useState(UG),[d,f]=m.useState(en.FHIR_JSON),h=m.useRef(null),p=m.useRef(null),[g,v]=m.useState(!1);m.useEffect(()=>{e.readResource("Bot",t).then(async E=>{r(E),i(await WG(e,E))}).catch(E=>ve({color:"red",message:Oe(E),autoClose:!1}))},[e,t]);const S=m.useCallback(()=>ld(h.current,{command:"getValue"}),[]),y=m.useCallback(()=>ld(h.current,{command:"getOutput"}),[]),x=m.useCallback(async()=>d===en.FHIR_JSON?JSON.parse(s):c,[d,s,c]),w=m.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const T=await S(),P=await e.createAttachment(T,"index.ts","text/typescript"),_=[];n!=null&&n.sourceCode?_.push({op:"replace",path:"/sourceCode",value:P}):_.push({op:"add",path:"/sourceCode",value:P}),await e.patchResource("Bot",t,_),ve({color:"green",message:"Saved"})}catch(T){ve({color:"red",message:Oe(T),autoClose:!1})}finally{v(!1)}},[e,t,n,S]),b=m.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const T=await y();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:T}),ve({color:"green",message:"Deployed"})}catch(T){ve({color:"red",message:Oe(T),autoClose:!1})}finally{v(!1)}},[e,t,y]),j=m.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const T=await x(),P=await e.post(e.fhirUrl("Bot",t,"$execute"),T,d);await ld(p.current,{command:"setValue",value:P}),ve({color:"green",message:"Success"})}catch(T){ve({color:"red",message:Oe(T),autoClose:!1})}finally{v(!1)}},[e,t,x,d]);return!n||o===void 0?null:a.jsxs(Zn,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(Zn.Col,{span:8,children:a.jsxs(Un,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(VG,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),a.jsxs(Z,{justify:"flex-end",gap:"xs",children:[a.jsx(ie,{type:"button",onClick:w,loading:g,leftSection:a.jsx(cF,{size:"1rem"}),children:"Save"}),a.jsx(ie,{type:"button",onClick:b,loading:g,leftSection:a.jsx(o0,{size:"1rem"}),children:"Deploy"}),a.jsx(ie,{type:"button",onClick:j,loading:g,leftSection:a.jsx(jF,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(Zn.Col,{span:4,children:[a.jsxs(Un,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(Tt,{data:[{label:"FHIR",value:en.FHIR_JSON},{label:"HL7",value:en.HL7_V2}],onChange:E=>f(E.currentTarget.value)}),d===en.FHIR_JSON?a.jsx(Ga,{value:s,onChange:E=>l(E),autosize:!0,minRows:15}):a.jsx("textarea",{className:FG.hl7Input,value:c,onChange:E=>u(E.currentTarget.value),rows:15})]}),a.jsx(Un,{m:2,p:"xs",shadow:"md",children:a.jsx(zG,{iframeRef:p,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function WG(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(rT);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Rs(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function PR(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 qG(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 GG(){const e=se(),{resourceType:t,id:n}=st(),r={reference:t+"/"+n},o=m.useCallback(i=>{e.updateResource(Rs(i)).then(()=>{ve({color:"green",message:"Success"})}).catch(s=>{ve({color:"red",message:Oe(s),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(_e,{children:a.jsx(AB,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(_e,{children:a.jsx(gU,{questionnaire:r,onSubmit:o})});default:return null}}function QG(){const{resourceType:e,id:t}=st(),n=gt({reference:e+"/"+t}),r=Bt();return n?a.jsx(_e,{children:a.jsx(zU,{value:n,onStart:(o,i)=>r(`/forms/${rh(i)}`),onEdit:(o,i,s)=>r(`/${s.reference}}`)})}):null}function KG(){const e=se(),{resourceType:t,id:n}=st(),r=Bt();return a.jsxs(_e,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(ie,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>ve({color:"red",message:Oe(o),autoClose:!1}))},children:"Delete"})]})}const YG="_selectProfileBtn_tbaz6_1",XG="_chevron_tbaz6_13",IS={selectProfileBtn:YG,chevron:XG};function JG(){var c,u;const{resourceType:e,id:t}=st(),n=gt({reference:e+"/"+t}),[r,o]=m.useState(),i=Mc({onDropdownClose:()=>i.resetSelectedOption()}),s=m.useMemo(()=>{var d;if(zt((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[a.jsx(De.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(De.Option,{value:f,children:f},f))]},[(c=n==null?void 0:n.meta)==null?void 0:c.profile]);if(m.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 zt(s)&&(l=a.jsx(Z,{justify:"flex-end",children:a.jsxs(Ie,{align:"flex-end",gap:"xs",children:[a.jsxs(De,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[a.jsx(De.Target,{children:a.jsx(kn,{onClick:()=>i.toggleDropdown(),children:a.jsxs(iy,{fw:"bold",fs:"sm",className:IS.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(TT,{stroke:1.5,className:IS.chevron})]})})}),a.jsx(De.Dropdown,{w:"max-content",children:a.jsx(De.Options,{children:s})})]}),a.jsx(G,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(ce,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(ce,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(ce,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(_e,{children:a.jsxs(Ie,{gap:"xl",children:[l,a.jsx(j0,{value:n,profileUrl:r})]})})}function ZG(){const e=se(),{resourceType:t,id:n}=st(),[r,o]=m.useState(),i=Bt(),[s,l]=m.useState();m.useEffect(()=>{e.readResource(t,n).then(d=>o(uo(d))).catch(d=>{l(pt(d)),ve({color:"red",message:Oe(d),autoClose:!1})})},[e,t,n]);const c=m.useCallback(d=>{l(void 0),e.updateResource(Rs(d)).then(()=>{i(`/${t}/${n}/details`),ve({color:"green",message:"Success"})}).catch(f=>{l(pt(f)),ve({color:"red",message:Oe(f),autoClose:!1})})},[e,t,n,i]),u=m.useCallback(()=>i(`/${t}/${n}/delete`),[i,t,n]);return r?a.jsx(_e,{children:a.jsx(Yd,{defaultValue:r,onSubmit:c,onDelete:u,outcome:s})}):null}function TR(e,t){const n=se(),r=Bt();return{defaultValue:{resourceType:e},handleSubmit:s=>{t&&t(void 0),n.createResource(s).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(pt(l)),ve({color:"red",message:Oe(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function kR({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=se(),[i,s]=m.useState();return m.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{s(l.filter(W8))}).catch(console.error)},[o,n,r]),a.jsx(et,{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(et.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(et.Tab,{value:l.url,title:u,rightSection:c&&a.jsx(Ly,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx($F,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function Tm(){const{resourceType:e}=st(),t=Ho(),[n,r]=m.useState(),{defaultValue:o,handleSubmit:i}=TR(e,r),[s,l]=m.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=m.useCallback(d=>{const f=Rs(d);s&&PR(f,s.url),i(f)},[s,i]);return c?a.jsx(_e,{children:a.jsxs(Ie,{children:[a.jsx(kR,{resource:o,currentProfile:s,onChange:l}),s?a.jsx(Yd,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:s.url},s.url):a.jsx(ce,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(_e,{children:a.jsx(Yd,{defaultValue:o,onSubmit:i,outcome:n})})}function eQ(){const e=se(),{resourceType:t,id:n}=st(),r=e.readHistory(t,n).read();return a.jsx(_e,{children:a.jsx(cH,{history:r})})}function tQ(){const{resourceType:e}=st(),[t,n]=m.useState(),{defaultValue:r,handleSubmit:o}=TR(e,n),i=m.useCallback(s=>{o(JSON.parse(s["new-resource"]))},[o]);return a.jsxs(_e,{children:[t&&a.jsx(Gr,{outcome:t}),a.jsxs(Ye,{onSubmit:i,children:[a.jsx(Ga,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:or(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ie,{type:"submit",children:"OK"})})]})]})}function nQ(){const e=se(),{resourceType:t,id:n}=st(),r=gt({reference:t+"/"+n}),o=Bt(),[i,s]=m.useState(),l=m.useCallback(c=>{e.updateResource(Rs(JSON.parse(c.resource))).then(()=>{s(void 0),o(`/${t}/${n}/details`),ve({color:"green",message:"Success"})}).catch(u=>{ve({color:"red",message:Oe(u),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(_e,{children:[i&&a.jsx(Gr,{outcome:i}),a.jsxs(Ye,{onSubmit:l,children:[a.jsx(Ga,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:or(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ie,{type:"submit",children:"OK"})})]})]}):null}function rQ(){const{resourceType:e,id:t}=st();return gt({reference:e+"/"+t})?a.jsxs(_e,{children:[a.jsxs(Ss,{icon:a.jsx(Kc,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Je,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx($k,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function oQ(){const e=se(),{resourceType:t,id:n}=st(),[r,o]=m.useState(),[i,s]=m.useState();return m.useEffect(()=>{e.readResource(t,n).then(l=>o(uo(l))).catch(l=>{ve({color:"red",message:Oe(l)})})},[e,t,n]),r?a.jsxs(_e,{children:[a.jsxs(me,{order:2,children:["Available ",t," profiles"]}),a.jsx(Ie,{children:a.jsxs(a.Fragment,{children:[a.jsx(kR,{resource:r,currentProfile:i,onChange:s}),i?a.jsx(iQ,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):a.jsx(ce,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const iQ=({profile:e,resource:t,onResourceUpdated:n})=>{const r=se(),[o,i]=m.useState(),[s,l]=m.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=m.useCallback(u=>{i(void 0);const d=Rs(u);s?PR(d,e.url):qG(d,e.url),r.updateResource(d).then(f=>{n(f),ve({color:"green",message:"Success"})}).catch(f=>{i(pt(f)),ve({color:"red",message:Oe(f),autoClose:!1})})},[r,e.url,n,s]);return a.jsxs(Ie,{children:[a.jsx(Bc,{size:"md",checked:s,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),s?a.jsx(Yd,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:a.jsx(Z,{justify:"flex-end",mt:"xl",children:a.jsx(ie,{type:"submit",children:"OK"})})})]})};function sQ(){const e=se(),{id:t}=st(),[n,r]=m.useState(),[o,i]=m.useState(0),s=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>aQ(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:wt(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),ve({color:"green",message:"Success"})}).catch(c=>ve({color:"red",message:Oe(c),autoClose:!1}))}return a.jsxs(_e,{children:[a.jsx(me,{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(el,{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(me,{children:"Connect to bot"}),a.jsxs(Z,{children:[a.jsx(Ja,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),a.jsx(ie,{onClick:l,children:"Connect"})]}),a.jsx("div",{style:{display:"none"},children:o})]})}function aQ(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 lQ(){const{id:e}=st(),t=Bt(),[n,r]=m.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ae.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return a.jsx(_e,{children:a.jsx(ou,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function cQ(){const e=se(),{resourceType:t,id:n}=st(),r=gt({reference:t+"/"+n}),o=m.useCallback(i=>{e.updateResource(Rs(i)).then(()=>{ve({color:"green",message:"Success"})}).catch(s=>{ve({color:"red",message:Oe(s),autoClose:!1})})},[e]);return r?a.jsx(_e,{children:a.jsx(IU,{onSubmit:o,definition:r})}):null}function uQ(){const{resourceType:e,id:t}=st(),n=gt({reference:e+"/"+t});return n?a.jsx(_e,{children:e==="MeasureReport"?a.jsx(TB,{measureReport:n}):a.jsx(x0,{value:n})}):null}const dQ="_container_1ue98_1",fQ="_entry_1ue98_14",hQ="_active_1ue98_21",km={container:dQ,entry:fQ,active:hQ};function mQ(e){const t=se(),n=gt(e.value),[r,o]=m.useState();return m.useEffect(()=>{if(!n)return;const i=z0(n);if(!i)return;const s="reference"in i?i.reference:wt(i);t.search("ServiceRequest","subject="+s).then(l=>{const u=l.entry.map(d=>d.resource);mk(u),u.reverse(),o(u)}).catch(l=>ve({color:"red",message:Oe(l),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:km.container,children:r.map(i=>{var s,l,c,u,d,f,h;return a.jsxs("div",{className:it(km.entry,{[km.active]:i.id===(n==null?void 0:n.id)}),children:[a.jsx("p",{children:a.jsx(Ge,{to:i,children:pQ(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:gQ(i)})]},i.id)})}):null}function pQ(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function gQ(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const vQ="_container_1l2dh_1",yQ={container:vQ};function xQ(e){var o,i,s,l;const t=gt(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:yQ.container,children:a.jsx(Tt,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function wQ(e){var n,r;const t=gt(e.specimen);return t?a.jsxs(Fe,{children:[a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Type"}),a.jsx(Fe.Value,{children:"Specimen"})]}),a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Collected"}),a.jsx(Fe.Value,{children:Rn((n=t.collection)==null?void 0:n.collectedDateTime)})]}),a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Specimen Age"}),a.jsx(Fe.Value,{children:SQ(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?a.jsxs(Fe.Entry,{children:[a.jsx(Fe.Key,{children:"Specimen Stability"}),a.jsx(Fe.Value,{children:bQ(t)})]}):a.jsx(a.Fragment,{})]}):null}function SQ(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return RR(_R(n,new Date))}function bQ(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 RR(_R(t,n))}function RR(e){return e.toString().padStart(3,"0")+"D"}function _R(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function CQ(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 EQ=["Profiles"];function jQ(){var w,b,j,E,T,P,_;const e=se(),{resourceType:t,id:n}=st(),r={reference:t+"/"+n},o=Bt(),[i,s]=m.useState(),l=gt(r,s),c=CQ(t),[u,d]=m.useState(()=>{const D=window.location.pathname.split("/").pop();return D&&c.map($=>$.toLowerCase()).includes(D)?D:c[0].toLowerCase()}),f=Nt();async function h(){var I,L;const $=(L=(I=(await e.readHistory(t,n)).entry)==null?void 0:I.find(F=>!!F.resource))==null?void 0:L.resource;$?p($):ve({color:"red",message:"No history to restore",autoClose:!1})}function p(D){e.updateResource(Rs(D)).then(()=>{s(void 0),ve({color:"green",message:"Success"})}).catch($=>{ve({color:"red",message:Oe($),autoClose:!1})})}if(i)return f$(i)?a.jsxs(_e,{children:[a.jsx(me,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(ie,{color:"red",onClick:h,children:"Restore"})]}):a.jsx(Gr,{outcome:i});function g(D){D||(D=c[0].toLowerCase()),d(D),o(`/${t}/${n}/${D}`)}function v(D){const $=l,I=$.orderDetail||[];I.length===0&&I.push({}),I[0].text!==D&&(I[0].text=D,p({...$,orderDetail:I}))}const S=l&&z0(l),y=l&&Yq(l),x=(j=(b=(w=e.getUserConfiguration())==null?void 0:w.option)==null?void 0:b.find(D=>D.id==="statusValueSet"))==null?void 0:j.valueString;return a.jsxs(a.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&x&&a.jsx(xQ,{valueSet:{reference:x},defaultValue:(T=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:T.text,onChange:v},wt(l)+"-"+((_=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:_.text)),l&&a.jsx(mQ,{value:l}),l&&a.jsxs(Un,{children:[S&&a.jsx(bR,{patient:S}),y&&a.jsx(wQ,{specimen:y}),t!=="Patient"&&a.jsx(CR,{resource:r}),a.jsx(br,{children:a.jsx(et,{value:u.toLowerCase(),onChange:g,children:a.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(D=>a.jsx(et.Tab,{value:D.toLowerCase(),children:EQ.includes(D)?a.jsxs(Z,{gap:"xs",wrap:"nowrap",children:[D,a.jsx($c,{color:f.primaryColor,size:"sm",children:"Beta"})]}):D},D))})})})]}),a.jsx(O0,{})]})}function AS(){var y,x,w,b;const e=Bt(),{resourceType:t,id:n,versionId:r,tab:o}=st(),i=se(),[s,l]=m.useState(!0),[c,u]=m.useState(),[d,f]=m.useState();if(m.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(Vr,{});if(!c)return a.jsxs(_e,{children:[a.jsx(me,{children:"Resource not found"}),a.jsx(Ge,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,p=h.findIndex(j=>{var E,T;return((T=(E=j.resource)==null?void 0:E.meta)==null?void 0:T.versionId)===r});if(p===-1)return a.jsxs(_e,{children:[a.jsx(me,{children:"Version not found"}),a.jsx(Ge,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[p].resource,v=p<h.length-1?h[p+1].resource:void 0,S="diff";return a.jsxs(et,{value:o||S,onChange:j=>e(`/${t}/${n}/_history/${r}/${j||S}`),children:[a.jsxs(Un,{children:[a.jsx(tu,{fluid:!0,p:"md",children:a.jsx(ce,{children:`${t} ${n}`})}),a.jsxs(et.List,{children:[a.jsx(et.Tab,{value:"diff",children:"Diff"}),a.jsx(et.Tab,{value:"raw",children:"Raw"})]})]}),a.jsxs(_e,{children:[d&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),a.jsx(et.Panel,{value:"diff",children:v?a.jsxs(a.Fragment,{children:[a.jsxs("ul",{children:[a.jsxs("li",{children:["Current: ",(y=g.meta)==null?void 0:y.versionId]}),a.jsxs("li",{children:["Previous:"," ",a.jsx(Ge,{to:`/${t}/${n}/_history/${(x=v.meta)==null?void 0:x.versionId}`,children:(w=v.meta)==null?void 0:w.versionId})]})]}),a.jsx(aH,{original:v,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(et.Panel,{value:"raw",children:a.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function PQ(){const{resourceType:e,id:t}=st(),n=Bt(),[r,o]=m.useState({resourceType:"Subscription",filters:[{code:"url",operator:ae.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(_e,{children:a.jsx(ou,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function NS(){const{resourceType:e,id:t}=st(),n={reference:e+"/"+t};switch(e){case"Encounter":return a.jsx(EV,{encounter:n});case"Patient":return a.jsx(kB,{patient:n});case"ServiceRequest":return a.jsx(fH,{serviceRequest:n});default:return a.jsx(CV,{resource:n})}}function TQ(){const e=se(),{id:t}=st(),n=m.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=m.useState(!1),[i,s]=m.useState(),[l,c]=m.useState(),[u,d]=m.useState(),[f,h]=m.useState(),[p,g]=m.useState(!1),v=m.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(x=>{var w,b,j,E,T,P;s((b=(w=x.parameter)==null?void 0:w.find(_=>_.name==="status"))==null?void 0:b.valueCode),c((E=(j=x.parameter)==null?void 0:j.find(_=>_.name==="version"))==null?void 0:E.valueString),d((P=(T=x.parameter)==null?void 0:T.find(_=>_.name==="lastUpdated"))==null?void 0:P.valueInstant)}).catch(x=>y(Oe(x))).finally(()=>o(!1))},[e,t]),S=m.useCallback(x=>{const w=x.host,b=x.pingCount||1;w&&(g(!0),e.pushToAgent(n,w,`PING ${b}`,en.PING,!0).then(j=>h(j)).catch(j=>y(Oe(j))).finally(()=>g(!1)))},[e,n]);function y(x){ve({color:"red",title:"Error",message:x,autoClose:!1})}return a.jsxs(_e,{children:[a.jsx(me,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(el,{value:n,link:!0})]}),a.jsx(gn,{my:"lg"}),a.jsx(me,{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(ie,{onClick:v,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(y0,{status:i})})]}),a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:"Version"}),a.jsx(le.Td,{children:l})]}),a.jsxs(le.Tr,{children:[a.jsx(le.Td,{children:"Last Updated"}),a.jsx(le.Td,{children:Rn(u)})]})]})}),a.jsx(gn,{my:"lg"}),a.jsx(me,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),a.jsx(Ye,{onSubmit:S,children:a.jsxs(Z,{children:[a.jsx(ue,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(Zt,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:p,children:a.jsx(_F,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Cy,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!p&&f&&a.jsxs(a.Fragment,{children:[a.jsx(me,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:f})]})]})}function kQ(){return a.jsx(_W,{children:a.jsxs(xe,{errorElement:a.jsx(Hq,{}),children:[a.jsx(xe,{path:"/signin",element:a.jsx(mG,{})}),a.jsx(xe,{path:"/oauth",element:a.jsx(cG,{})}),a.jsx(xe,{path:"/resetpassword",element:a.jsx(dG,{})}),a.jsx(xe,{path:"/setpassword/:id/:secret",element:a.jsx(hG,{})}),a.jsx(xe,{path:"/register",element:a.jsx(uG,{})}),a.jsx(xe,{path:"/changepassword",element:a.jsx(Vq,{})}),a.jsx(xe,{path:"/security",element:a.jsx(fG,{})}),a.jsx(xe,{path:"/mfa",element:a.jsx(lG,{})}),a.jsx(xe,{path:"/batch",element:a.jsx(Fq,{})}),a.jsx(xe,{path:"/bulk/:resourceType",element:a.jsx(zq,{})}),a.jsx(xe,{path:"/smart",element:a.jsx(pG,{})}),a.jsx(xe,{path:"/forms/:id",element:a.jsx(Jq,{})}),a.jsx(xe,{path:"/admin/super",element:a.jsx(kG,{})}),a.jsx(xe,{path:"/admin/config",element:a.jsx(EG,{})}),a.jsxs(xe,{path:"/admin",element:a.jsx(jG,{}),children:[a.jsx(xe,{path:"patients",element:a.jsx(CG,{})}),a.jsx(xe,{path:"bots/new",element:a.jsx(yG,{})}),a.jsx(xe,{path:"bots",element:a.jsx(gG,{})}),a.jsx(xe,{path:"clients/new",element:a.jsx(xG,{})}),a.jsx(xe,{path:"clients",element:a.jsx(vG,{})}),a.jsx(xe,{path:"details",element:a.jsx(RS,{})}),a.jsx(xe,{path:"invite",element:a.jsx(bG,{})}),a.jsx(xe,{path:"users",element:a.jsx(RG,{})}),a.jsx(xe,{path:"project",element:a.jsx(RS,{})}),a.jsx(xe,{path:"secrets",element:a.jsx(PG,{})}),a.jsx(xe,{path:"sites",element:a.jsx(TG,{})}),a.jsx(xe,{path:"members/:membershipId",element:a.jsx(SG,{})})]}),a.jsx(xe,{path:"/lab/assays",element:a.jsx(_G,{})}),a.jsx(xe,{path:"/lab/panels",element:a.jsx(DG,{})}),a.jsx(xe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:a.jsx(AS,{})}),a.jsx(xe,{path:"/:resourceType/:id/_history/:versionId",element:a.jsx(AS,{})}),a.jsxs(xe,{path:"/:resourceType/new",element:a.jsx(Uq,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(Tm,{})}),a.jsx(xe,{path:"form",element:a.jsx(Tm,{})}),a.jsx(xe,{path:"json",element:a.jsx(tQ,{})}),a.jsx(xe,{path:"profiles",element:a.jsx(Tm,{})})]}),a.jsxs(xe,{path:"/:resourceType/:id",element:a.jsx(jQ,{}),children:[a.jsx(xe,{index:!0,element:a.jsx(NS,{})}),a.jsx(xe,{path:"apply",element:a.jsx(AG,{})}),a.jsx(xe,{path:"apps",element:a.jsx(NG,{})}),a.jsx(xe,{path:"event",element:a.jsx(MG,{})}),a.jsx(xe,{path:"blame",element:a.jsx($G,{})}),a.jsx(xe,{path:"bots",element:a.jsx(sQ,{})}),a.jsx(xe,{path:"builder",element:a.jsx(GG,{})}),a.jsx(xe,{path:"checklist",element:a.jsx(QG,{})}),a.jsx(xe,{path:"delete",element:a.jsx(KG,{})}),a.jsx(xe,{path:"details",element:a.jsx(JG,{})}),a.jsx(xe,{path:"edit",element:a.jsx(ZG,{})}),a.jsx(xe,{path:"editor",element:a.jsx(HG,{})}),a.jsx(xe,{path:"history",element:a.jsx(eQ,{})}),a.jsx(xe,{path:"json",element:a.jsx(nQ,{})}),a.jsx(xe,{path:"preview",element:a.jsx(rQ,{})}),a.jsx(xe,{path:"responses",element:a.jsx(lQ,{})}),a.jsx(xe,{path:"report",element:a.jsx(uQ,{})}),a.jsx(xe,{path:"ranges",element:a.jsx(cQ,{})}),a.jsx(xe,{path:"subscriptions",element:a.jsx(PQ,{})}),a.jsx(xe,{path:"timeline",element:a.jsx(NS,{})}),a.jsx(xe,{path:"tools",element:a.jsx(TQ,{})}),a.jsx(xe,{path:"profiles",element:a.jsx(oQ,{})})]}),a.jsx(xe,{path:"/:resourceType",element:a.jsx(kS,{})}),a.jsx(xe,{path:"/",element:a.jsx(kS,{})})]})})}function RQ(){const e=se(),t=e.getUserConfiguration(),n=Ho(),[r]=M0();return e.isLoading()?a.jsx(Vr,{}):a.jsx(T8,{logo:a.jsx(qr,{size:24}),pathname:n.pathname,searchParams:r,version:E6,menus:_Q(t),displayAddBookmark:!!(t!=null&&t.id),children:a.jsx(m.Suspense,{fallback:a.jsx(Vr,{}),children:a.jsx(kQ,{})})})}function _Q(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:DQ(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(yF,{})}]}),t}const OS={Patient:AF,Practitioner:pF,Organization:iF,ServiceRequest:TF,DiagnosticReport:RF,Questionnaire:mF,admin:nF,AccessPolicy:vF,Subscription:MF,batch:bF,Observation:SF};function DQ(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in OS){const n=OS[t];return a.jsx(n,{})}}catch{}return a.jsx(eh,{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 IQ(){const e=lu(),t=new wT({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=NW([{path:"*",element:a.jsx(RQ,{})}]),o=s=>r.navigate(s);Gk(document.getElementById("root")).render(a.jsx(m.StrictMode,{children:a.jsx(B6,{medplum:t,navigate:o,children:a.jsxs(vb,{theme:n,children:[a.jsx(Vo,{position:"bottom-right"}),a.jsx(UW,{router:r})]})})}))}IQ().catch(console.error);
|
|
563
|
-
//# sourceMappingURL=index-CBraEhHZ.js.map
|