@medplum/app 3.1.6 → 3.1.7
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-CsqXRyey.css +1 -0
- package/dist/assets/index-DlEPmX6X.js +563 -0
- package/dist/assets/index-DlEPmX6X.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +13 -13
- package/dist/assets/index-CCxkjo1T.css +0 -1
- package/dist/assets/index-D9zfKRAQ.js +0 -563
- package/dist/assets/index-D9zfKRAQ.js.map +0 -1
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
function rS(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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).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 a0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Sg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var oS={exports:{}},uf={},iS={exports:{}},Qe={};/**
|
|
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 kc=Symbol.for("react.element"),p2=Symbol.for("react.portal"),m2=Symbol.for("react.fragment"),g2=Symbol.for("react.strict_mode"),v2=Symbol.for("react.profiler"),y2=Symbol.for("react.provider"),x2=Symbol.for("react.context"),b2=Symbol.for("react.forward_ref"),w2=Symbol.for("react.suspense"),S2=Symbol.for("react.memo"),j2=Symbol.for("react.lazy"),l0=Symbol.iterator;function C2(e){return e===null||typeof e!="object"?null:(e=l0&&e[l0]||e["@@iterator"],typeof e=="function"?e:null)}var sS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},aS=Object.assign,lS={};function Ga(e,t,n){this.props=e,this.context=t,this.refs=lS,this.updater=n||sS}Ga.prototype.isReactComponent={};Ga.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")};Ga.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function cS(){}cS.prototype=Ga.prototype;function jg(e,t,n){this.props=e,this.context=t,this.refs=lS,this.updater=n||sS}var Cg=jg.prototype=new cS;Cg.constructor=jg;aS(Cg,Ga.prototype);Cg.isPureReactComponent=!0;var c0=Array.isArray,uS=Object.prototype.hasOwnProperty,Eg={current:null},dS={key:!0,ref:!0,__self:!0,__source:!0};function fS(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)uS.call(t,r)&&!dS.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:kc,type:e,key:i,ref:a,props:o,_owner:Eg.current}}function E2(e,t){return{$$typeof:kc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Tg(e){return typeof e=="object"&&e!==null&&e.$$typeof===kc}function T2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var u0=/\/+/g;function Dh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?T2(""+e.key):t.toString(36)}function Ku(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case kc:case p2:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Dh(a,0):r,c0(o)?(n="",e!=null&&(n=e.replace(u0,"$&/")+"/"),Ku(o,t,n,"",function(u){return u})):o!=null&&(Tg(o)&&(o=E2(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(u0,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",c0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Dh(i,l);a+=Ku(i,t,n,c,o)}else if(c=C2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Dh(i,l++),a+=Ku(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 a}function yu(e,t,n){if(e==null)return e;var r=[],o=0;return Ku(e,r,"","",function(i){return t.call(n,i,o++)}),r}function P2(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 Mn={current:null},Yu={transition:null},k2={ReactCurrentDispatcher:Mn,ReactCurrentBatchConfig:Yu,ReactCurrentOwner:Eg};Qe.Children={map:yu,forEach:function(e,t,n){yu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return yu(e,function(){t++}),t},toArray:function(e){return yu(e,function(t){return t})||[]},only:function(e){if(!Tg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Qe.Component=Ga;Qe.Fragment=m2;Qe.Profiler=v2;Qe.PureComponent=jg;Qe.StrictMode=g2;Qe.Suspense=w2;Qe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=k2;Qe.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=aS({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Eg.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)&&!dS.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:kc,type:e.type,key:o,ref:i,props:r,_owner:a}};Qe.createContext=function(e){return e={$$typeof:x2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:y2,_context:e},e.Consumer=e};Qe.createElement=fS;Qe.createFactory=function(e){var t=fS.bind(null,e);return t.type=e,t};Qe.createRef=function(){return{current:null}};Qe.forwardRef=function(e){return{$$typeof:b2,render:e}};Qe.isValidElement=Tg;Qe.lazy=function(e){return{$$typeof:j2,_payload:{_status:-1,_result:e},_init:P2}};Qe.memo=function(e,t){return{$$typeof:S2,type:e,compare:t===void 0?null:t}};Qe.startTransition=function(e){var t=Yu.transition;Yu.transition={};try{e()}finally{Yu.transition=t}};Qe.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Qe.useCallback=function(e,t){return Mn.current.useCallback(e,t)};Qe.useContext=function(e){return Mn.current.useContext(e)};Qe.useDebugValue=function(){};Qe.useDeferredValue=function(e){return Mn.current.useDeferredValue(e)};Qe.useEffect=function(e,t){return Mn.current.useEffect(e,t)};Qe.useId=function(){return Mn.current.useId()};Qe.useImperativeHandle=function(e,t,n){return Mn.current.useImperativeHandle(e,t,n)};Qe.useInsertionEffect=function(e,t){return Mn.current.useInsertionEffect(e,t)};Qe.useLayoutEffect=function(e,t){return Mn.current.useLayoutEffect(e,t)};Qe.useMemo=function(e,t){return Mn.current.useMemo(e,t)};Qe.useReducer=function(e,t,n){return Mn.current.useReducer(e,t,n)};Qe.useRef=function(e){return Mn.current.useRef(e)};Qe.useState=function(e){return Mn.current.useState(e)};Qe.useSyncExternalStore=function(e,t,n){return Mn.current.useSyncExternalStore(e,t,n)};Qe.useTransition=function(){return Mn.current.useTransition()};Qe.version="18.2.0";iS.exports=Qe;var p=iS.exports;const on=Sg(p),hS=rS({__proto__:null,default:on},[p]);/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var R2=p,_2=Symbol.for("react.element"),D2=Symbol.for("react.fragment"),I2=Object.prototype.hasOwnProperty,A2=R2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,N2={key:!0,ref:!0,__self:!0,__source:!0};function pS(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)I2.call(t,r)&&!N2.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:_2,type:e,key:i,ref:a,props:o,_owner:A2.current}}uf.Fragment=D2;uf.jsx=pS;uf.jsxs=pS;oS.exports=uf;var s=oS.exports,oo=function(){return oo=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},oo.apply(this,arguments)};function mS(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 M2(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 Xu="right-scroll-bar-position",Ju="width-before-scroll-bar",O2="with-scroll-bars-hidden",$2="--removed-body-scroll-bar-size";function Ih(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function L2(e,t){var n=p.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var F2=typeof window<"u"?p.useLayoutEffect:p.useEffect,d0=new WeakMap;function z2(e,t){var n=L2(null,function(r){return e.forEach(function(o){return Ih(o,r)})});return F2(function(){var r=d0.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(l){i.has(l)||Ih(l,null)}),i.forEach(function(l){o.has(l)||Ih(l,a)})}d0.set(n,e)},[e]),n}function B2(e){return e}function V2(e,t){t===void 0&&(t=B2);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 a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function U2(e){e===void 0&&(e={});var t=V2(null);return t.options=oo({async:!0,ssr:!1},e),t}var gS=function(e){var t=e.sideCar,n=mS(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return p.createElement(r,oo({},n))};gS.isSideCarExport=!0;function H2(e,t){return e.useMedium(t),gS}var vS=U2(),Ah=function(){},df=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Ah,onWheelCapture:Ah,onTouchMoveCapture:Ah}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,S=e.as,y=S===void 0?"div":S,b=e.gapMode,x=mS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,j=z2([n,t]),E=oo(oo({},x),o);return p.createElement(p.Fragment,null,d&&p.createElement(w,{sideCar:vS,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:b}),a?p.cloneElement(p.Children.only(l),oo(oo({},E),{ref:j})):p.createElement(y,oo({},E,{className:c,ref:j}),l))});df.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};df.classNames={fullWidth:Ju,zeroRight:Xu};var W2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function q2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=W2();return t&&e.setAttribute("nonce",t),e}function G2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Q2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var K2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=q2())&&(G2(t,n),Q2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Y2=function(){var e=K2();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yS=function(){var e=Y2(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},X2={left:0,top:0,right:0,gap:0},Nh=function(e){return parseInt(e||"",10)||0},J2=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[Nh(n),Nh(r),Nh(o)]},Z2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return X2;var t=J2(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])}},e_=yS(),ba="data-scroll-locked",t_=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
+
.`.concat(O2,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(ba,`] {
|
|
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(a,`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(Xu,` {
|
|
36
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(Ju,` {
|
|
40
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(Xu," .").concat(Xu,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(Ju," .").concat(Ju,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(ba,`] {
|
|
52
|
+
`).concat($2,": ").concat(l,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},f0=function(){var e=parseInt(document.body.getAttribute(ba)||"0",10);return isFinite(e)?e:0},n_=function(){p.useEffect(function(){return document.body.setAttribute(ba,(f0()+1).toString()),function(){var e=f0()-1;e<=0?document.body.removeAttribute(ba):document.body.setAttribute(ba,e.toString())}},[])},r_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;n_();var i=p.useMemo(function(){return Z2(o)},[o]);return p.createElement(e_,{styles:t_(i,!t,o,n?"":"!important")})},Lp=!1;if(typeof window<"u")try{var xu=Object.defineProperty({},"passive",{get:function(){return Lp=!0,!0}});window.addEventListener("test",xu,xu),window.removeEventListener("test",xu,xu)}catch{Lp=!1}var Hs=Lp?{passive:!1}:!1,o_=function(e){return e.tagName==="TEXTAREA"},xS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!o_(e)&&n[t]==="visible")},i_=function(e){return xS(e,"overflowY")},s_=function(e){return xS(e,"overflowX")},h0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=bS(e,r);if(o){var i=wS(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},a_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},l_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bS=function(e,t){return e==="v"?i_(t):s_(t)},wS=function(e,t){return e==="v"?a_(t):l_(t)},c_=function(e,t){return e==="h"&&t==="rtl"?-1:1},u_=function(e,t,n,r,o){var i=c_(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),u=!1,d=a>0,f=0,h=0;do{var m=wS(e,l),g=m[0],v=m[1],S=m[2],y=v-S-i*g;(g||y)&&bS(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&&(Math.abs(f)<1||!o)||!d&&(Math.abs(h)<1||!o))&&(u=!0),u},bu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},p0=function(e){return[e.deltaX,e.deltaY]},m0=function(e){return e&&"current"in e?e.current:e},d_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},f_=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},h_=0,Ws=[];function p_(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(h_++)[0],i=p.useState(yS)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=M2([e.lockRef.current],(e.shards||[]).map(m0),!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=p.useCallback(function(v,S){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var y=bu(v),b=n.current,x="deltaX"in v?v.deltaX:b[0]-y[0],w="deltaY"in v?v.deltaY:b[1]-y[1],j,E=v.target,C=Math.abs(x)>Math.abs(w)?"h":"v";if("touches"in v&&C==="h"&&E.type==="range")return!1;var T=h0(C,E);if(!T)return!0;if(T?j=C:(j=C==="v"?"h":"v",T=h0(C,E)),!T)return!1;if(!r.current&&"changedTouches"in v&&(x||w)&&(r.current=j),!j)return!0;var _=r.current||j;return u_(_,S,v,_==="h"?x:w,!0)},[]),c=p.useCallback(function(v){var S=v;if(!(!Ws.length||Ws[Ws.length-1]!==i)){var y="deltaY"in S?p0(S):bu(S),b=t.current.filter(function(j){return j.name===S.type&&(j.target===S.target||S.target===j.shadowParent)&&d_(j.delta,y)})[0];if(b&&b.should){S.cancelable&&S.preventDefault();return}if(!b){var x=(a.current.shards||[]).map(m0).filter(Boolean).filter(function(j){return j.contains(S.target)}),w=x.length>0?l(S,x[0]):!a.current.noIsolation;w&&S.cancelable&&S.preventDefault()}}},[]),u=p.useCallback(function(v,S,y,b){var x={name:v,delta:S,target:y,should:b,shadowParent:m_(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(w){return w!==x})},1)},[]),d=p.useCallback(function(v){n.current=bu(v),r.current=void 0},[]),f=p.useCallback(function(v){u(v.type,p0(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){u(v.type,bu(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return Ws.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Hs),document.addEventListener("touchmove",c,Hs),document.addEventListener("touchstart",d,Hs),function(){Ws=Ws.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Hs),document.removeEventListener("touchmove",c,Hs),document.removeEventListener("touchstart",d,Hs)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:f_(o)}):null,m?p.createElement(r_,{gapMode:e.gapMode}):null)}function m_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const g_=H2(vS,p_);var ff=p.forwardRef(function(e,t){return p.createElement(df,oo({},e,{ref:t,sideCar:g_}))});ff.classNames=df.classNames;function pt(e){return Object.keys(e)}function Mh(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Pg(e,t){const n={...e},r=t;return Mh(e)&&Mh(t)&&Object.keys(t).forEach(o=>{Mh(r[o])&&o in e?n[o]=Pg(n[o],r[o]):n[o]=r[o]}),n}function v_(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function y_(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 Gl(e){const t=y_(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 Oh(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function SS(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?Oh(o):o}if(typeof r=="string"){if(r===""||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?Oh(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?Oh(i):i}}return r}return n}const F=SS("rem",{shouldScale:!0}),pd=SS("em");function Ii(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function jS(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 Fo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==p.Fragment:!1}function On(e){const t=p.createContext(null);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function Ss(e=null){const t=p.createContext(e);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>p.useContext(t)]}function g0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function md(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function x_(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 b_(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 w_(e,t,n){return md(e,n)===md(t,n)}function CS({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var g;n==null||n(l);const c=Array.from(((g=md(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(v=>w_(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=b_(u,c,r),f=x_(u,c,r),h=i==="rtl"?f:d,m=i==="rtl"?d:f;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),o&&c[h].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[m].focus(),o&&c[m].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),o&&c[f].click());break}case"ArrowDown":{a==="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 S_={app:100,modal:200,popover:300,overlay:400,max:9999};function Gr(e){return S_[e]}const j_=()=>{};function C_(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||j_:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function _e(e,t="size",n=!0){if(e!==void 0)return jS(e)?n?F(e):e:`var(--${t}-${e})`}function Wt(e){return _e(e,"mantine-spacing")}function ot(e){return e===void 0?"var(--mantine-radius-default)":_e(e,"mantine-radius")}function sn(e){return _e(e,"mantine-font-size")}function ES(e){return _e(e,"mantine-line-height",!1)}function kg(e){if(e)return _e(e,"mantine-shadow",!1)}function er(e,t){return n=>{e==null||e(n),t==null||t(n)}}function Rg(e,t){return e in t.breakpoints?Gl(t.breakpoints[e]):Gl(e)}function Ql(e,t){const n=e.map(r=>({value:r,px:Rg(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Lr(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function E_(e,t,n){var r;return n?Array.from(((r=md(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function T_(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function wu(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 _g(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function v0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Qi(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function hf(e,t){const n=Qi(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback((...o)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...o),t)},[n,t])}const y0=["mousedown","touchstart"];function P_(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(n)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(a)&&e()};return(t||y0).forEach(i=>document.addEventListener(i,o)),()=>{(t||y0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function TS({timeout:e=2e3}={}){const[t,n]=p.useState(null),[r,o]=p.useState(!1),[i,a]=p.useState(null),l=d=>{window.clearTimeout(i),a(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 k_(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function R_(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function PS(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:R_(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),k_(i.current,a=>o(a.matches))},[e]),r}function __(e,t){return PS("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Qa=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Ro(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function kS({opened:e,shouldReturnFocus:t=!0}){const n=p.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Ro(()=>{let o=-1;const i=a=>{a.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 D_(e,t="body > :not(script)"){const n=_g(),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"),a=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"):!a&&!l&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:a||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 I_=/input|select|textarea|button|object/,RS="a, input, select, textarea, button, object, [tabindex]";function A_(e){return e.style.display==="none"}function N_(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(A_(n))return!1;n=n.parentNode}return!0}function _S(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Fp(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(_S(e));return(I_.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&N_(e)}function DS(e){const t=_S(e);return(Number.isNaN(t)||t>=0)&&Fp(e)}function M_(e){return Array.from(e.querySelectorAll(RS)).filter(DS)}function O_(e,t){const n=M_(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 a=o.activeElement;if(a.tagName==="INPUT"&&a.getAttribute("type")==="radio"&&(i=n.filter(d=>d.getAttribute("type")==="radio"&&d.getAttribute("name")===a.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const c=n[t.shiftKey?n.length-1:0];c&&c.focus()}function $_(e=!0){const t=p.useRef(),n=p.useRef(null),r=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll(RS));a=l.find(DS)||l.find(Fp)||null,!a&&Fp(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=p.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=D_(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return p.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=a=>{a.key==="Tab"&&t.current&&O_(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const L_=e=>(e+1)%1e6;function F_(){const[,e]=p.useReducer(L_,0);return e}const z_=on.useId||(()=>{});function B_(){const e=z_();return e?`mantine-${e.replace(/:/g,"")}`:""}function $n(e){const t=B_(),[n,r]=p.useState(t);return Qa(()=>{r(_g())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function IS(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function pf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function V_(...e){return t=>{e.forEach(n=>pf(n,t))}}function Qt(...e){return p.useCallback(V_(...e),e)}function pn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=p.useState(t!==void 0?t:n),a=(l,...c)=>{i(l),r==null||r(l,...c)};return e!==void 0?[e,r,!0]:[o,a,!1]}function ni(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Su="dots";function U_({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=pn({value:r,onChange:i,defaultValue:o,finalValue:o}),u=v=>{v<=0?c(1):v>a?c(a):c(v)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:p.useMemo(()=>{if(t*2+3+n*2>=a)return ni(1,a);const S=Math.max(l-t,n),y=Math.min(l+t,a-n),b=S>n+2,x=y<a-(n+1);if(!b&&x){const w=t*2+n+2;return[...ni(1,w),Su,...ni(a-(n-1),a)]}if(b&&!x){const w=n+1+2*t;return[...ni(1,n),Su,...ni(a-w,a)]}return[...ni(1,n),Su,...ni(S,y),Su,...ni(a-n+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function Dg(e,t){return PS("(prefers-reduced-motion: reduce)",e,t)}function AS(e=!1,t){const{onOpen:n,onClose:r}={},[o,i]=p.useState(e),a=p.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=p.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=p.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function H_(e,t,n={autoInvoke:!1}){const r=p.useRef(null),o=p.useCallback((...a)=>{r.current||(r.current=window.setTimeout(()=>{e(a),r.current=null},t))},[t]),i=p.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return p.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}function W_(e,t,n){const r=p.useRef(),o=p.useRef(null);return p.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 a;(a=r.current)==null||a.disconnect()}},[e,t]),o}function q_(){const[e,t]=p.useState(!1);return p.useEffect(()=>t(!0),[]),e}var G_={};function NS(){return typeof process<"u"&&G_?"production":"development"}function MS(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=MS(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=MS(e))&&(r&&(r+=" "),r+=t);return r}const Q_={};function K_(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=nt(t[r],o):t[r]=o})}),t}function mf({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(a=>typeof a=="function"?a(e,n,r):a||Q_);return K_(i)}function gd({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,a)=>typeof a=="function"?{...i,...a(e,n,r)}:{...i,...a},{})}const Ig=p.createContext(null);function Ai(){const e=p.useContext(Ig);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function Y_(){return Ai().cssVariablesResolver}function X_(){return Ai().classNamesPrefix}function gf(){return Ai().getStyleNonce}function J_(){return Ai().withStaticClasses}function Z_(){return Ai().headless}function eD(){var e;return(e=Ai().stylesTransform)==null?void 0:e.sx}function tD(){var e;return(e=Ai().stylesTransform)==null?void 0:e.styles}function nD(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function rD(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}if(t.length===8){const a=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}}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 oD(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 iD(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,a=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*i-1))*o,c=r/60,u=l*(1-Math.abs(c%2-1)),d=i-l/2;let f,h,m;return c>=0&&c<1?(f=l,h=u,m=0):c>=1&&c<2?(f=u,h=l,m=0):c>=2&&c<3?(f=0,h=l,m=u):c>=3&&c<4?(f=0,h=u,m=l):c>=4&&c<5?(f=u,h=0,m=l):(f=l,h=0,m=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((m+d)*255),a:a||1}}function Ag(e){return nD(e)?rD(e):e.startsWith("rgb")?oD(e):e.startsWith("hsl")?iD(e):{r:0,g:0,b:0,a:1}}function ju(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Ag(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function Kl(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function $h(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function sD(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function aD(e){if(e.startsWith("oklch("))return(sD(e)||0)/100;const{r:t,g:n,b:r}=Ag(e),o=t/255,i=n/255,a=r/255,l=$h(o),c=$h(i),u=$h(a);return .2126*l+.7152*c+.0722*u}function pl(e,t=.179){return e.startsWith("var(")?!1:aD(e)>t}function Sr({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:pl(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:pl(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:pl(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,a=r in t.colors;if(a){const l=i!==void 0?t.colors[r][i]:t.colors[r][Kl(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:a,isLight:pl(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:pl(e,t.luminanceThreshold),shade:i,variable:void 0}}function rt(e,t){const n=Sr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function zp(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=rt(n.from,t),o=rt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function pr(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}=Ag(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const qs=pr,lD=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=Sr({color:e,theme:t}),a=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const l=a&&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:`${F(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:`${F(1)} solid transparent`}:{background:e,hover:ju(e,.1),color:l,border:`${F(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:`${F(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:pr(l,.1),hover:pr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${F(1)} solid transparent`}}return{background:pr(e,.1),hover:pr(e,.12),color:e,border:`${F(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:`${F(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:pr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${F(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:pr(e,.05),color:e,border:`${F(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:`${F(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:pr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${F(1)} solid transparent`}}return{background:"transparent",hover:pr(e,.12),color:e,border:`${F(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${F(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${F(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${F(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:ju(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${F(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:ju(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${F(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:ju(t.white,.01),color:e,border:`${F(1)} solid transparent`}:n==="gradient"?{background:zp(r,t),hover:zp(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:`${F(1)} solid var(--mantine-color-default-border)`}:{}},cD={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"]},x0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Ng={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:cD,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:lD,autoContrast:!1,luminanceThreshold:.3,fontFamily:x0,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:x0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:F(34),lineHeight:"1.3"},h2:{fontSize:F(26),lineHeight:"1.35"},h3:{fontSize:F(22),lineHeight:"1.4"},h4:{fontSize:F(18),lineHeight:"1.45"},h5:{fontSize:F(16),lineHeight:"1.5"},h6:{fontSize:F(14),lineHeight:"1.5"}}},fontSizes:{xs:F(12),sm:F(14),md:F(16),lg:F(18),xl:F(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:F(2),sm:F(4),md:F(8),lg:F(16),xl:F(32)},spacing:{xs:F(10),sm:F(12),md:F(16),lg:F(20),xl:F(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${F(1)} ${F(3)} rgba(0, 0, 0, 0.05), 0 ${F(1)} ${F(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${F(1)} ${F(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${F(10)} ${F(15)} ${F(-5)}, rgba(0, 0, 0, 0.04) 0 ${F(7)} ${F(7)} ${F(-5)}`,md:`0 ${F(1)} ${F(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${F(20)} ${F(25)} ${F(-5)}, rgba(0, 0, 0, 0.04) 0 ${F(10)} ${F(10)} ${F(-5)}`,lg:`0 ${F(1)} ${F(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${F(28)} ${F(23)} ${F(-7)}, rgba(0, 0, 0, 0.04) 0 ${F(12)} ${F(12)} ${F(-7)}`,xl:`0 ${F(1)} ${F(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${F(36)} ${F(28)} ${F(-7)}, rgba(0, 0, 0, 0.04) 0 ${F(17)} ${F(17)} ${F(-7)}`},other:{},components:{}};function b0(e){return e==="auto"||e==="dark"||e==="light"}function uD({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 b0(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&&b0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const dD="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",w0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Lh(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function S0(e){if(!(e.primaryColor in e.colors))throw new Error(dD);if(typeof e.primaryShade=="object"&&(!Lh(e.primaryShade.dark)||!Lh(e.primaryShade.light)))throw new Error(w0);if(typeof e.primaryShade=="number"&&!Lh(e.primaryShade))throw new Error(w0)}function fD(e,t){var r;if(!t)return S0(e),e;const n=Pg(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),S0(n),n}const Mg=p.createContext(null),hD=()=>p.useContext(Mg)||Ng;function It(){const e=p.useContext(Mg);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 OS({theme:e,children:t,inherit:n=!0}){const r=hD(),o=p.useMemo(()=>fD(n?r:Ng,e),[e,r,n]);return s.jsx(Mg.Provider,{value:o,children:t})}OS.displayName="@mantine/core/MantineThemeProvider";function pD(){const e=It(),t=gf(),n=pt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),a=Gl(e.breakpoints[o]),l=i?`${a-.1}px`:pd(a-.1),c=i?`${a}px`:pd(a);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 s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function Fh(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function zh(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function mD(e,t){const n=Fh(e.variables),r=n?zh(t,n):"",o=Fh(e.dark),i=o?zh(`${t}[data-mantine-color-scheme="dark"]`,o):"",a=Fh(e.light),l=a?zh(`${t}[data-mantine-color-scheme="light"]`,a):"";return`${r}${i}${l}`}function zo({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Sr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function j0(e,t){return zo({color:e.colors[e.primaryColor][Kl(e,t)],theme:e,autoContrast:null})}function Cu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=Kl(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`]:qs(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:qs(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`]:qs(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=Kl(e,"dark"),a={[`--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`]:qs(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:qs(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`]:qs(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],...a}:a}function gD(e){return Array.isArray(e)?e:Array(10).fill(e)}function vD(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Gs(e,t,n){pt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const $S=e=>{const t=Kl(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:F(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":j0(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":j0(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)"}};Gs(r.variables,e.breakpoints,"breakpoint"),Gs(r.variables,e.spacing,"spacing"),Gs(r.variables,e.fontSizes,"font-size"),Gs(r.variables,e.lineHeights,"line-height"),Gs(r.variables,e.shadows,"shadow"),Gs(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),pt(e.colors).forEach(i=>{const a=e.colors[i];if(vD(a)){Object.assign(r.light,Cu({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Cu({theme:e,name:a.name,color:a.dark,colorScheme:"dark",withColorValues:!0}));return}a.forEach((l,c)=>{r.variables[`--mantine-color-${i}-${c}`]=l}),Object.assign(r.light,Cu({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Cu({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return pt(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 yD({theme:e,generator:t}){const n=$S(e),r=t==null?void 0:t(e);return r?Pg(n,r):n}const Bh=$S(Ng);function xD(e){const t={variables:{},light:{},dark:{}};return pt(e.variables).forEach(n=>{Bh.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),pt(e.light).forEach(n=>{Bh.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),pt(e.dark).forEach(n=>{Bh.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function bD(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 LS({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=It(),r=gf(),o=Y_(),i=yD({theme:n,generator:o}),a=e===":root"&&t,l=a?xD(i):i,c=mD(l,e);return c?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${a?"":bD(e)}`}}):null}LS.displayName="@mantine/CssVariables";function wD(){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 Qs(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 SD({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=p.useRef(),[i,a]=p.useState(()=>e.get(t)),l=r||i,c=p.useCallback(d=>{r||(Qs(d,n),a(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{a(t),Qs(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Qa(()=>{Qs(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return Qs(r,n),()=>{};r===void 0&&Qs(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&Qs(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 jD({respectReducedMotion:e,getRootElement:t}){Qa(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}wD();function FS({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:a=!0,cssVariablesSelector:l=":root",classNamesPrefix:c="mantine",colorSchemeManager:u=uD(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:m,stylesTransform:g}){const{colorScheme:v,setColorScheme:S,clearColorScheme:y}=SD({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return jD({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),s.jsx(Ig.Provider,{value:{colorScheme:v,setColorScheme:S,clearColorScheme:y,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r,stylesTransform:g},children:s.jsxs(OS,{theme:e,children:[a&&s.jsx(LS,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&s.jsx(pD,{}),t]})})}FS.displayName="@mantine/core/MantineProvider";function Rc({classNames:e,styles:t,props:n,stylesCtx:r}){const o=It();return{resolvedClassNames:mf({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:gd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const CD={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function ED({theme:e,options:t,unstyled:n}){return nt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||CD[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function TD({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return mf({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function C0({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return mf({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function PD({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function kD({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function RD({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function _D({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var a,l;return(l=mf({theme:t,classNames:(a=t.components[i])==null?void 0:a.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function DD({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function ID({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:a,unstyled:l,className:c,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:h,headless:m,transformedStyles:g}){return nt(ED({theme:e,options:t,unstyled:l||m}),_D({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),DD({options:t,classes:a,selector:r,unstyled:l}),C0({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),C0({selector:r,stylesCtx:f,theme:e,classNames:g,props:d}),TD({selector:r,stylesCtx:f,options:t,props:d,theme:e}),PD({rootSelector:u,selector:r,className:c}),kD({selector:r,classes:a,unstyled:l||m}),h&&!m&&RD({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function AD({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var a;return gd({theme:e,styles:(a=e.components[i])==null?void 0:a.styles,props:n,stylesCtx:r})[o]}).reduce((i,a)=>({...i,...a}),{})}function Bp({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Bp({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function ND(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Ii(n[r])}}),t),{})}function MD({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:l}){var c;return(c=ND([l?{}:t==null?void 0:t(n,r,o),...a.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 OD({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:a,styles:l,style:c,vars:u,varsResolver:d,headless:f,withStylesTransform:h}){return{...!h&&AD({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!h&&gd({theme:e,styles:l,props:o,stylesCtx:i})[n],...!h&&gd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...MD({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...a===n?Bp({style:c,theme:e}):null,...Bp({style:r==null?void 0:r.style,theme:e})}}function $D({props:e,stylesCtx:t,themeName:n}){var a;const r=It(),o=(a=tD())==null?void 0:a();return{getTransformedStyles:l=>o?[...l.map(u=>o(u,{props:e,theme:r,ctx:t})),...n.map(u=>{var d;return o((d=r.components[u])==null?void 0:d.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!o}}function le({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:a="root",unstyled:l,classNames:c,styles:u,vars:d,varsResolver:f}){const h=It(),m=X_(),g=J_(),v=Z_(),S=(Array.isArray(e)?e:[e]).filter(x=>x),{withStylesTransform:y,getTransformedStyles:b}=$D({props:n,stylesCtx:r,themeName:S});return(x,w)=>({className:ID({theme:h,options:w,themeName:S,selector:x,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:g,headless:v,transformedStyles:b([w==null?void 0:w.styles,u])}),style:OD({theme:h,themeName:S,selector:x,options:w,props:n,stylesCtx:r,rootSelector:a,styles:u,style:i,vars:d,varsResolver:f,headless:v,withStylesTransform:y})})}function js(e,t){return typeof e=="boolean"?e:t.autoContrast}function E0(e){const t=document.createElement("style");return t.setAttribute("data-mantine-styles","inline"),t.innerHTML="*, *::before, *::after {transition: none !important;}",t.setAttribute("data-mantine-disable-transition","true"),e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(r=>r.remove())}function LD({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(Ig),o=gf(),i=p.useRef(o==null?void 0:o());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const a=f=>{r.setColorScheme(f),t.current=e?()=>{}:E0(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var h;(h=t.current)==null||h.call(t)},10)},l=()=>{r.clearColorScheme(),t.current=e?()=>{}:E0(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var f;(f=t.current)==null||f.call(t)},10)},c=__("light",{getInitialValueInEffect:!1}),u=r.colorScheme==="auto"?c:r.colorScheme,d=p.useCallback(()=>a(u==="light"?"dark":"light"),[a,u]);return p.useEffect(()=>()=>{var f;(f=t.current)==null||f.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:a,clearColorScheme:l,toggleColorScheme:d}}function V(e,t,n){var a;const r=It(),o=(a=r.components[e])==null?void 0:a.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...Ii(n)}}function Vh(e){return pt(e).reduce((t,n)=>e[n]!==void 0?`${t}${v_(n)}:${e[n]};`:t,"").trim()}function FD({selector:e,styles:t,media:n,container:r}){const o=t?Vh(t):"",i=Array.isArray(n)?n.map(l=>`@media${l.query}{${e}{${Vh(l.styles)}}}`):[],a=Array.isArray(r)?r.map(l=>`@container ${l.query}{${e}{${Vh(l.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${a.join("")}`.trim()}function Cs(e){const t=gf();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:FD(e)}})}function Bo(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:v,pr:S,pe:y,ps:b,bg:x,c:w,opacity:j,ff:E,fz:C,fw:T,lts:_,ta:P,lh:M,fs:D,tt:N,td:A,w:L,miw:I,maw:k,h:R,mih:$,mah:B,bgsz:H,bgp:X,bgr:ye,bga:he,pos:be,top:ke,left:Ce,bottom:se,right:Ve,inset:ut,display:lt,flex:We,hiddenFrom:Ee,visibleFrom:Pe,lightHidden:ee,darkHidden:ne,sx:Se,...qe}=e;return{styleProps:Ii({m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:v,pr:S,pe:y,ps:b,bg:x,c:w,opacity:j,ff:E,fz:C,fw:T,lts:_,ta:P,lh:M,fs:D,tt:N,td:A,w:L,miw:I,maw:k,h:R,mih:$,mah:B,bgsz:H,bgp:X,bgr:ye,bga:he,pos:be,top:ke,left:Ce,bottom:se,right:Ve,inset:ut,display:lt,flex:We,hiddenFrom:Ee,visibleFrom:Pe,lightHidden:ee,darkHidden:ne,sx:Se}),rest:qe}}const zD={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"},bd:{type:"border",property:"border"},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 Og(e,t){const n=Sr({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 BD(e,t){const n=Sr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Og(e,t)}function VD(e,t){if(typeof e=="number")return F(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(a=>a.trim()!=="");let i=`${F(n)}`;return r&&(i+=` ${r}`),gD.length>0&&(i+=` ${Og(o.join(" "),t)}`),i.trim()}return e}const T0={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 UD(e){return typeof e=="string"&&e in T0?T0[e]:e}const HD=["h1","h2","h3","h4","h5","h6"];function WD(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&HD.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?F(e):e}function qD(e){return e}const GD=["h1","h2","h3","h4","h5","h6"];function QD(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&GD.includes(e)?`var(--mantine-${e}-line-height)`:e}function KD(e){return typeof e=="number"?F(e):e}function YD(e,t){if(typeof e=="number")return F(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return F(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Uh={color:Og,textColor:BD,fontSize:WD,spacing:YD,identity:qD,size:KD,lineHeight:QD,fontFamily:UD,border:VD};function P0(e){return e.replace("(min-width: ","").replace("em)","")}function XD({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(P0(o))-Number(P0(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function JD(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function ZD(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function eI(e){return typeof e=="object"&&e!==null?pt(e).filter(t=>t!=="base"):[]}function tI(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function zS({styleProps:e,data:t,theme:n}){return XD(pt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const i=t[o],a=Array.isArray(i.property)?i.property:[i.property],l=ZD(e[o]);if(!JD(e[o]))return a.forEach(u=>{r.inlineStyles[u]=Uh[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=eI(e[o]);return a.forEach(u=>{l&&(r.styles[u]=Uh[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:Uh[i.type](tI(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function _c(){return`__m__-${p.useId().replace(/:/g,"")}`}function BS(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...BS(r,t)}),{}):typeof e=="function"?e(t):e??{}}function VS(e){return e.startsWith("data-")?e:`data-${e}`}function nI(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[VS(n)]=e[n]),t},{})}function US(e){return e?typeof e=="string"?{[VS(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...US(n)}),{}):nI(e):null}function Vp(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Vp(r,t)}),{}):typeof e=="function"?e(t):e??{}}function rI({theme:e,style:t,vars:n,styleProps:r}){const o=Vp(t,e),i=Vp(n,e);return{...o,...i,...r}}const HS=p.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:a,hiddenFrom:l,visibleFrom:c,lightHidden:u,darkHidden:d,renderRoot:f,...h},m)=>{var C;const g=It(),v=e||"div",{styleProps:S,rest:y}=Bo(h),b=eD(),x=(C=b==null?void 0:b())==null?void 0:C(S.sx),w=_c(),j=zS({styleProps:S,theme:g,data:zD}),E={ref:m,style:rI({theme:g,style:t,vars:n,styleProps:j.inlineStyles}),className:nt(r,x,{[w]:j.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":jS(a)?void 0:a||void 0,...US(i),...y};return s.jsxs(s.Fragment,{children:[j.hasResponsiveStyles&&s.jsx(Cs,{selector:`.${w}`,styles:j.styles,media:j.media}),typeof f=="function"?f(E):s.jsx(v,{...E})]})});HS.displayName="@mantine/core/Box";const W=HS;function WS(e){return e}function K(e){const t=p.forwardRef(e);return t.extend=WS,t}function Cn(e){const t=p.forwardRef(e);return t.extend=WS,t}const oI=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Es(){return p.useContext(oI)}var qS={exports:{}},lr={},GS={exports:{}},QS={};/**
|
|
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(R,$){var B=R.length;R.push($);e:for(;0<B;){var H=B-1>>>1,X=R[H];if(0<o(X,$))R[H]=$,R[B]=X,B=H;else break e}}function n(R){return R.length===0?null:R[0]}function r(R){if(R.length===0)return null;var $=R[0],B=R.pop();if(B!==$){R[0]=B;e:for(var H=0,X=R.length,ye=X>>>1;H<ye;){var he=2*(H+1)-1,be=R[he],ke=he+1,Ce=R[ke];if(0>o(be,B))ke<X&&0>o(Ce,be)?(R[H]=Ce,R[ke]=B,H=ke):(R[H]=be,R[he]=B,H=he);else if(ke<X&&0>o(Ce,B))R[H]=Ce,R[ke]=B,H=ke;else break e}}return $}function o(R,$){var B=R.sortIndex-$.sortIndex;return B!==0?B:R.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(R){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=R)r(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(u)}}function w(R){if(v=!1,x(R),!g)if(n(c)!==null)g=!0,I(j);else{var $=n(u);$!==null&&k(w,$.startTime-R)}}function j(R,$){g=!1,v&&(v=!1,y(T),T=-1),m=!0;var B=h;try{for(x($),f=n(c);f!==null&&(!(f.expirationTime>$)||R&&!M());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var X=H(f.expirationTime<=$);$=e.unstable_now(),typeof X=="function"?f.callback=X:f===n(c)&&r(c),x($)}else r(c);f=n(c)}if(f!==null)var ye=!0;else{var he=n(u);he!==null&&k(w,he.startTime-$),ye=!1}return ye}finally{f=null,h=B,m=!1}}var E=!1,C=null,T=-1,_=5,P=-1;function M(){return!(e.unstable_now()-P<_)}function D(){if(C!==null){var R=e.unstable_now();P=R;var $=!0;try{$=C(!0,R)}finally{$?N():(E=!1,C=null)}}else E=!1}var N;if(typeof b=="function")N=function(){b(D)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,L=A.port2;A.port1.onmessage=D,N=function(){L.postMessage(null)}}else N=function(){S(D,0)};function I(R){C=R,E||(E=!0,N())}function k(R,$){T=S(function(){R(e.unstable_now())},$)}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(R){R.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,I(j))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var B=h;h=$;try{return R()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,$){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var B=h;h=R;try{return $()}finally{h=B}},e.unstable_scheduleCallback=function(R,$,B){var H=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?H+B:H):B=H,R){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,R={id:d++,callback:$,priorityLevel:R,startTime:B,expirationTime:X,sortIndex:-1},B>H?(R.sortIndex=B,t(u,R),n(c)===null&&R===n(u)&&(v?(y(T),T=-1):v=!0,k(w,B-H))):(R.sortIndex=X,t(c,R),g||m||(g=!0,I(j))),R},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(R){var $=h;return function(){var B=h;h=$;try{return R.apply(this,arguments)}finally{h=B}}}})(QS);GS.exports=QS;var iI=GS.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 KS=p,ir=iI;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 YS=new Set,Yl={};function Ts(e,t){_a(e,t),_a(e+"Capture",t)}function _a(e,t){for(Yl[e]=t,e=0;e<t.length;e++)YS.add(t[e])}var _o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Up=Object.prototype.hasOwnProperty,sI=/^[: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]*$/,k0={},R0={};function aI(e){return Up.call(R0,e)?!0:Up.call(k0,e)?!1:sI.test(e)?R0[e]=!0:(k0[e]=!0,!1)}function lI(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 cI(e,t,n,r){if(t===null||typeof t>"u"||lI(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 Ln(e,t,n,r,o,i,a){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=a}var mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Ln(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){mn[e]=new Ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var $g=/[\-:]([a-z])/g;function Lg(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($g,Lg);mn[t]=new Ln(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($g,Lg);mn[t]=new Ln(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($g,Lg);mn[t]=new Ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fg(e,t,n,r){var o=mn.hasOwnProperty(t)?mn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(cI(t,n,o,r)&&(n=null),r||o===null?aI(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 Vo=KS.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Eu=Symbol.for("react.element"),oa=Symbol.for("react.portal"),ia=Symbol.for("react.fragment"),zg=Symbol.for("react.strict_mode"),Hp=Symbol.for("react.profiler"),XS=Symbol.for("react.provider"),JS=Symbol.for("react.context"),Bg=Symbol.for("react.forward_ref"),Wp=Symbol.for("react.suspense"),qp=Symbol.for("react.suspense_list"),Vg=Symbol.for("react.memo"),ii=Symbol.for("react.lazy"),ZS=Symbol.for("react.offscreen"),_0=Symbol.iterator;function ml(e){return e===null||typeof e!="object"?null:(e=_0&&e[_0]||e["@@iterator"],typeof e=="function"?e:null)}var $t=Object.assign,Hh;function _l(e){if(Hh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Hh=t&&t[1]||""}return`
|
|
77
|
+
`+Hh+e}var Wh=!1;function qh(e,t){if(!e||Wh)return"";Wh=!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
|
+
`),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
|
|
80
|
+
`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{Wh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?_l(e):""}function uI(e){switch(e.tag){case 5:return _l(e.type);case 16:return _l("Lazy");case 13:return _l("Suspense");case 19:return _l("SuspenseList");case 0:case 2:case 15:return e=qh(e.type,!1),e;case 11:return e=qh(e.type.render,!1),e;case 1:return e=qh(e.type,!0),e;default:return""}}function Gp(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 ia:return"Fragment";case oa:return"Portal";case Hp:return"Profiler";case zg:return"StrictMode";case Wp:return"Suspense";case qp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case JS:return(e.displayName||"Context")+".Consumer";case XS:return(e._context.displayName||"Context")+".Provider";case Bg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Vg:return t=e.displayName||null,t!==null?t:Gp(e.type)||"Memo";case ii:t=e._payload,e=e._init;try{return Gp(e(t))}catch{}}return null}function dI(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 Gp(t);case 8:return t===zg?"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 Ti(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ej(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function fI(e){var t=ej(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(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tu(e){e._valueTracker||(e._valueTracker=fI(e))}function tj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=ej(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vd(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 Qp(e,t){var n=t.checked;return $t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function D0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ti(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 nj(e,t){t=t.checked,t!=null&&Fg(e,"checked",t,!1)}function Kp(e,t){nj(e,t);var n=Ti(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")?Yp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Yp(e,t.type,Ti(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function I0(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 Yp(e,t,n){(t!=="number"||vd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Dl=Array.isArray;function wa(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=""+Ti(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 Xp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return $t({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function A0(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(Dl(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ti(n)}}function rj(e,t){var n=Ti(t.value),r=Ti(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 N0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function oj(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 Jp(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?oj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Pu,ij=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(Pu=Pu||document.createElement("div"),Pu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Pu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Xl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ol={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},hI=["Webkit","ms","Moz","O"];Object.keys(Ol).forEach(function(e){hI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ol[t]=Ol[e]})});function sj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ol.hasOwnProperty(e)&&Ol[e]?(""+t).trim():t+"px"}function aj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=sj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var pI=$t({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 Zp(e,t){if(t){if(pI[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 em(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 tm=null;function Ug(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var nm=null,Sa=null,ja=null;function M0(e){if(e=Ac(e)){if(typeof nm!="function")throw Error(J(280));var t=e.stateNode;t&&(t=wf(t),nm(e.stateNode,e.type,t))}}function lj(e){Sa?ja?ja.push(e):ja=[e]:Sa=e}function cj(){if(Sa){var e=Sa,t=ja;if(ja=Sa=null,M0(e),t)for(e=0;e<t.length;e++)M0(t[e])}}function uj(e,t){return e(t)}function dj(){}var Gh=!1;function fj(e,t,n){if(Gh)return e(t,n);Gh=!0;try{return uj(e,t,n)}finally{Gh=!1,(Sa!==null||ja!==null)&&(dj(),cj())}}function Jl(e,t){var n=e.stateNode;if(n===null)return null;var r=wf(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 rm=!1;if(_o)try{var gl={};Object.defineProperty(gl,"passive",{get:function(){rm=!0}}),window.addEventListener("test",gl,gl),window.removeEventListener("test",gl,gl)}catch{rm=!1}function mI(e,t,n,r,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var $l=!1,yd=null,xd=!1,om=null,gI={onError:function(e){$l=!0,yd=e}};function vI(e,t,n,r,o,i,a,l,c){$l=!1,yd=null,mI.apply(gI,arguments)}function yI(e,t,n,r,o,i,a,l,c){if(vI.apply(this,arguments),$l){if($l){var u=yd;$l=!1,yd=null}else throw Error(J(198));xd||(xd=!0,om=u)}}function Ps(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 hj(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 O0(e){if(Ps(e)!==e)throw Error(J(188))}function xI(e){var t=e.alternate;if(!t){if(t=Ps(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 O0(o),e;if(i===r)return O0(o),t;i=i.sibling}throw Error(J(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a)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 pj(e){return e=xI(e),e!==null?mj(e):null}function mj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=mj(e);if(t!==null)return t;e=e.sibling}return null}var gj=ir.unstable_scheduleCallback,$0=ir.unstable_cancelCallback,bI=ir.unstable_shouldYield,wI=ir.unstable_requestPaint,Ht=ir.unstable_now,SI=ir.unstable_getCurrentPriorityLevel,Hg=ir.unstable_ImmediatePriority,vj=ir.unstable_UserBlockingPriority,bd=ir.unstable_NormalPriority,jI=ir.unstable_LowPriority,yj=ir.unstable_IdlePriority,vf=null,so=null;function CI(e){if(so&&typeof so.onCommitFiberRoot=="function")try{so.onCommitFiberRoot(vf,e,void 0,(e.current.flags&128)===128)}catch{}}var zr=Math.clz32?Math.clz32:PI,EI=Math.log,TI=Math.LN2;function PI(e){return e>>>=0,e===0?32:31-(EI(e)/TI|0)|0}var ku=64,Ru=4194304;function Il(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 wd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=Il(l):(i&=a,i!==0&&(r=Il(i)))}else a=n&~o,a!==0?r=Il(a):i!==0&&(r=Il(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-zr(t),o=1<<n,r|=e[n],t&=~o;return r}function kI(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 RI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-zr(i),l=1<<a,c=o[a];c===-1?(!(l&n)||l&r)&&(o[a]=kI(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function im(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function xj(){var e=ku;return ku<<=1,!(ku&4194240)&&(ku=64),e}function Qh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Dc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zr(t),e[t]=n}function _I(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-zr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Wg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-zr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var at=0;function bj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var wj,qg,Sj,jj,Cj,sm=!1,_u=[],gi=null,vi=null,yi=null,Zl=new Map,ec=new Map,ci=[],DI="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 L0(e,t){switch(e){case"focusin":case"focusout":gi=null;break;case"dragenter":case"dragleave":vi=null;break;case"mouseover":case"mouseout":yi=null;break;case"pointerover":case"pointerout":Zl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ec.delete(t.pointerId)}}function vl(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=Ac(t),t!==null&&qg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function II(e,t,n,r,o){switch(t){case"focusin":return gi=vl(gi,e,t,n,r,o),!0;case"dragenter":return vi=vl(vi,e,t,n,r,o),!0;case"mouseover":return yi=vl(yi,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Zl.set(i,vl(Zl.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,ec.set(i,vl(ec.get(i)||null,e,t,n,r,o)),!0}return!1}function Ej(e){var t=Xi(e.target);if(t!==null){var n=Ps(t);if(n!==null){if(t=n.tag,t===13){if(t=hj(n),t!==null){e.blockedOn=t,Cj(e.priority,function(){Sj(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 Zu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=am(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);tm=r,n.target.dispatchEvent(r),tm=null}else return t=Ac(n),t!==null&&qg(t),e.blockedOn=n,!1;t.shift()}return!0}function F0(e,t,n){Zu(e)&&n.delete(t)}function AI(){sm=!1,gi!==null&&Zu(gi)&&(gi=null),vi!==null&&Zu(vi)&&(vi=null),yi!==null&&Zu(yi)&&(yi=null),Zl.forEach(F0),ec.forEach(F0)}function yl(e,t){e.blockedOn===t&&(e.blockedOn=null,sm||(sm=!0,ir.unstable_scheduleCallback(ir.unstable_NormalPriority,AI)))}function tc(e){function t(o){return yl(o,e)}if(0<_u.length){yl(_u[0],e);for(var n=1;n<_u.length;n++){var r=_u[n];r.blockedOn===e&&(r.blockedOn=null)}}for(gi!==null&&yl(gi,e),vi!==null&&yl(vi,e),yi!==null&&yl(yi,e),Zl.forEach(t),ec.forEach(t),n=0;n<ci.length;n++)r=ci[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ci.length&&(n=ci[0],n.blockedOn===null);)Ej(n),n.blockedOn===null&&ci.shift()}var Ca=Vo.ReactCurrentBatchConfig,Sd=!0;function NI(e,t,n,r){var o=at,i=Ca.transition;Ca.transition=null;try{at=1,Gg(e,t,n,r)}finally{at=o,Ca.transition=i}}function MI(e,t,n,r){var o=at,i=Ca.transition;Ca.transition=null;try{at=4,Gg(e,t,n,r)}finally{at=o,Ca.transition=i}}function Gg(e,t,n,r){if(Sd){var o=am(e,t,n,r);if(o===null)op(e,t,r,jd,n),L0(e,r);else if(II(o,e,t,n,r))r.stopPropagation();else if(L0(e,r),t&4&&-1<DI.indexOf(e)){for(;o!==null;){var i=Ac(o);if(i!==null&&wj(i),i=am(e,t,n,r),i===null&&op(e,t,r,jd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else op(e,t,r,null,n)}}var jd=null;function am(e,t,n,r){if(jd=null,e=Ug(r),e=Xi(e),e!==null)if(t=Ps(e),t===null)e=null;else if(n=t.tag,n===13){if(e=hj(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 jd=e,null}function Tj(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(SI()){case Hg:return 1;case vj:return 4;case bd:case jI:return 16;case yj:return 536870912;default:return 16}default:return 16}}var hi=null,Qg=null,ed=null;function Pj(){if(ed)return ed;var e,t=Qg,n=t.length,r,o="value"in hi?hi.value:hi.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return ed=o.slice(e,1<r?1-r:void 0)}function td(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 Du(){return!0}function z0(){return!1}function cr(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,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)?Du:z0,this.isPropagationStopped=z0,this}return $t(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=Du)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Du)},persist:function(){},isPersistent:Du}),t}var Ka={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kg=cr(Ka),Ic=$t({},Ka,{view:0,detail:0}),OI=cr(Ic),Kh,Yh,xl,yf=$t({},Ic,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Yg,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!==xl&&(xl&&e.type==="mousemove"?(Kh=e.screenX-xl.screenX,Yh=e.screenY-xl.screenY):Yh=Kh=0,xl=e),Kh)},movementY:function(e){return"movementY"in e?e.movementY:Yh}}),B0=cr(yf),$I=$t({},yf,{dataTransfer:0}),LI=cr($I),FI=$t({},Ic,{relatedTarget:0}),Xh=cr(FI),zI=$t({},Ka,{animationName:0,elapsedTime:0,pseudoElement:0}),BI=cr(zI),VI=$t({},Ka,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),UI=cr(VI),HI=$t({},Ka,{data:0}),V0=cr(HI),WI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qI={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"},GI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function QI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=GI[e])?!!t[e]:!1}function Yg(){return QI}var KI=$t({},Ic,{key:function(e){if(e.key){var t=WI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=td(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Yg,charCode:function(e){return e.type==="keypress"?td(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?td(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),YI=cr(KI),XI=$t({},yf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),U0=cr(XI),JI=$t({},Ic,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Yg}),ZI=cr(JI),eA=$t({},Ka,{propertyName:0,elapsedTime:0,pseudoElement:0}),tA=cr(eA),nA=$t({},yf,{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}),rA=cr(nA),oA=[9,13,27,32],Xg=_o&&"CompositionEvent"in window,Ll=null;_o&&"documentMode"in document&&(Ll=document.documentMode);var iA=_o&&"TextEvent"in window&&!Ll,kj=_o&&(!Xg||Ll&&8<Ll&&11>=Ll),H0=" ",W0=!1;function Rj(e,t){switch(e){case"keyup":return oA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _j(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var sa=!1;function sA(e,t){switch(e){case"compositionend":return _j(t);case"keypress":return t.which!==32?null:(W0=!0,H0);case"textInput":return e=t.data,e===H0&&W0?null:e;default:return null}}function aA(e,t){if(sa)return e==="compositionend"||!Xg&&Rj(e,t)?(e=Pj(),ed=Qg=hi=null,sa=!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 kj&&t.locale!=="ko"?null:t.data;default:return null}}var lA={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 q0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!lA[e.type]:t==="textarea"}function Dj(e,t,n,r){lj(r),t=Cd(t,"onChange"),0<t.length&&(n=new Kg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Fl=null,nc=null;function cA(e){Vj(e,0)}function xf(e){var t=ca(e);if(tj(t))return e}function uA(e,t){if(e==="change")return t}var Ij=!1;if(_o){var Jh;if(_o){var Zh="oninput"in document;if(!Zh){var G0=document.createElement("div");G0.setAttribute("oninput","return;"),Zh=typeof G0.oninput=="function"}Jh=Zh}else Jh=!1;Ij=Jh&&(!document.documentMode||9<document.documentMode)}function Q0(){Fl&&(Fl.detachEvent("onpropertychange",Aj),nc=Fl=null)}function Aj(e){if(e.propertyName==="value"&&xf(nc)){var t=[];Dj(t,nc,e,Ug(e)),fj(cA,t)}}function dA(e,t,n){e==="focusin"?(Q0(),Fl=t,nc=n,Fl.attachEvent("onpropertychange",Aj)):e==="focusout"&&Q0()}function fA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return xf(nc)}function hA(e,t){if(e==="click")return xf(t)}function pA(e,t){if(e==="input"||e==="change")return xf(t)}function mA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ur=typeof Object.is=="function"?Object.is:mA;function rc(e,t){if(Ur(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(!Up.call(t,o)||!Ur(e[o],t[o]))return!1}return!0}function K0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Y0(e,t){var n=K0(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=K0(n)}}function Nj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mj(){for(var e=window,t=vd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vd(e.document)}return t}function Jg(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 gA(e){var t=Mj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Nj(n.ownerDocument.documentElement,n)){if(r!==null&&Jg(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=Y0(n,i);var a=Y0(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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 vA=_o&&"documentMode"in document&&11>=document.documentMode,aa=null,lm=null,zl=null,cm=!1;function X0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;cm||aa==null||aa!==vd(r)||(r=aa,"selectionStart"in r&&Jg(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}),zl&&rc(zl,r)||(zl=r,r=Cd(lm,"onSelect"),0<r.length&&(t=new Kg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=aa)))}function Iu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var la={animationend:Iu("Animation","AnimationEnd"),animationiteration:Iu("Animation","AnimationIteration"),animationstart:Iu("Animation","AnimationStart"),transitionend:Iu("Transition","TransitionEnd")},ep={},Oj={};_o&&(Oj=document.createElement("div").style,"AnimationEvent"in window||(delete la.animationend.animation,delete la.animationiteration.animation,delete la.animationstart.animation),"TransitionEvent"in window||delete la.transitionend.transition);function bf(e){if(ep[e])return ep[e];if(!la[e])return e;var t=la[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Oj)return ep[e]=t[n];return e}var $j=bf("animationend"),Lj=bf("animationiteration"),Fj=bf("animationstart"),zj=bf("transitionend"),Bj=new Map,J0="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 Ni(e,t){Bj.set(e,t),Ts(t,[e])}for(var tp=0;tp<J0.length;tp++){var np=J0[tp],yA=np.toLowerCase(),xA=np[0].toUpperCase()+np.slice(1);Ni(yA,"on"+xA)}Ni($j,"onAnimationEnd");Ni(Lj,"onAnimationIteration");Ni(Fj,"onAnimationStart");Ni("dblclick","onDoubleClick");Ni("focusin","onFocus");Ni("focusout","onBlur");Ni(zj,"onTransitionEnd");_a("onMouseEnter",["mouseout","mouseover"]);_a("onMouseLeave",["mouseout","mouseover"]);_a("onPointerEnter",["pointerout","pointerover"]);_a("onPointerLeave",["pointerout","pointerover"]);Ts("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ts("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ts("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ts("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ts("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ts("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Al="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(" "),bA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Al));function Z0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,yI(r,t,void 0,e),e.currentTarget=null}function Vj(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 a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;Z0(o,l,u),i=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;Z0(o,l,u),i=c}}}if(xd)throw e=om,xd=!1,om=null,e}function jt(e,t){var n=t[pm];n===void 0&&(n=t[pm]=new Set);var r=e+"__bubble";n.has(r)||(Uj(t,e,2,!1),n.add(r))}function rp(e,t,n){var r=0;t&&(r|=4),Uj(n,e,r,t)}var Au="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Au]){e[Au]=!0,YS.forEach(function(n){n!=="selectionchange"&&(bA.has(n)||rp(n,!1,e),rp(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Au]||(t[Au]=!0,rp("selectionchange",!1,t))}}function Uj(e,t,n,r){switch(Tj(t)){case 1:var o=NI;break;case 4:o=MI;break;default:o=Gg}n=o.bind(null,t,n,e),o=void 0,!rm||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 op(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=Xi(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}fj(function(){var u=i,d=Ug(n),f=[];e:{var h=Bj.get(e);if(h!==void 0){var m=Kg,g=e;switch(e){case"keypress":if(td(n)===0)break e;case"keydown":case"keyup":m=YI;break;case"focusin":g="focus",m=Xh;break;case"focusout":g="blur",m=Xh;break;case"beforeblur":case"afterblur":m=Xh;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=B0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=LI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=ZI;break;case $j:case Lj:case Fj:m=BI;break;case zj:m=tA;break;case"scroll":m=OI;break;case"wheel":m=rA;break;case"copy":case"cut":case"paste":m=UI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=U0}var v=(t&4)!==0,S=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var b=u,x;b!==null;){x=b;var w=x.stateNode;if(x.tag===5&&w!==null&&(x=w,y!==null&&(w=Jl(b,y),w!=null&&v.push(ic(b,w,x)))),S)break;b=b.return}0<v.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==tm&&(g=n.relatedTarget||n.fromElement)&&(Xi(g)||g[Do]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?Xi(g):null,g!==null&&(S=Ps(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=B0,w="onMouseLeave",y="onMouseEnter",b="mouse",(e==="pointerout"||e==="pointerover")&&(v=U0,w="onPointerLeave",y="onPointerEnter",b="pointer"),S=m==null?h:ca(m),x=g==null?h:ca(g),h=new v(w,b+"leave",m,n,d),h.target=S,h.relatedTarget=x,w=null,Xi(d)===u&&(v=new v(y,b+"enter",g,n,d),v.target=x,v.relatedTarget=S,w=v),S=w,m&&g)t:{for(v=m,y=g,b=0,x=v;x;x=Ks(x))b++;for(x=0,w=y;w;w=Ks(w))x++;for(;0<b-x;)v=Ks(v),b--;for(;0<x-b;)y=Ks(y),x--;for(;b--;){if(v===y||y!==null&&v===y.alternate)break t;v=Ks(v),y=Ks(y)}v=null}else v=null;m!==null&&e1(f,h,m,v,!1),g!==null&&S!==null&&e1(f,S,g,v,!0)}}e:{if(h=u?ca(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var j=uA;else if(q0(h))if(Ij)j=pA;else{j=fA;var E=dA}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(j=hA);if(j&&(j=j(e,u))){Dj(f,j,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Yp(h,"number",h.value)}switch(E=u?ca(u):window,e){case"focusin":(q0(E)||E.contentEditable==="true")&&(aa=E,lm=u,zl=null);break;case"focusout":zl=lm=aa=null;break;case"mousedown":cm=!0;break;case"contextmenu":case"mouseup":case"dragend":cm=!1,X0(f,n,d);break;case"selectionchange":if(vA)break;case"keydown":case"keyup":X0(f,n,d)}var C;if(Xg)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else sa?Rj(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(kj&&n.locale!=="ko"&&(sa||T!=="onCompositionStart"?T==="onCompositionEnd"&&sa&&(C=Pj()):(hi=d,Qg="value"in hi?hi.value:hi.textContent,sa=!0)),E=Cd(u,T),0<E.length&&(T=new V0(T,e,null,n,d),f.push({event:T,listeners:E}),C?T.data=C:(C=_j(n),C!==null&&(T.data=C)))),(C=iA?sA(e,n):aA(e,n))&&(u=Cd(u,"onBeforeInput"),0<u.length&&(d=new V0("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=C))}Vj(f,t)})}function ic(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Cd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Jl(e,n),i!=null&&r.unshift(ic(e,i,o)),i=Jl(e,t),i!=null&&r.push(ic(e,i,o))),e=e.return}return r}function Ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function e1(e,t,n,r,o){for(var i=t._reactName,a=[];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=Jl(n,i),c!=null&&a.unshift(ic(n,c,l))):o||(c=Jl(n,i),c!=null&&a.push(ic(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var wA=/\r\n?/g,SA=/\u0000|\uFFFD/g;function t1(e){return(typeof e=="string"?e:""+e).replace(wA,`
|
|
81
|
+
`).replace(SA,"")}function Nu(e,t,n){if(t=t1(t),t1(e)!==t&&n)throw Error(J(425))}function Ed(){}var um=null,dm=null;function fm(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 hm=typeof setTimeout=="function"?setTimeout:void 0,jA=typeof clearTimeout=="function"?clearTimeout:void 0,n1=typeof Promise=="function"?Promise:void 0,CA=typeof queueMicrotask=="function"?queueMicrotask:typeof n1<"u"?function(e){return n1.resolve(null).then(e).catch(EA)}:hm;function EA(e){setTimeout(function(){throw e})}function ip(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),tc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);tc(t)}function xi(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 r1(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 Ya=Math.random().toString(36).slice(2),io="__reactFiber$"+Ya,sc="__reactProps$"+Ya,Do="__reactContainer$"+Ya,pm="__reactEvents$"+Ya,TA="__reactListeners$"+Ya,PA="__reactHandles$"+Ya;function Xi(e){var t=e[io];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Do]||n[io]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=r1(e);e!==null;){if(n=e[io])return n;e=r1(e)}return t}e=n,n=e.parentNode}return null}function Ac(e){return e=e[io]||e[Do],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function ca(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function wf(e){return e[sc]||null}var mm=[],ua=-1;function Mi(e){return{current:e}}function Et(e){0>ua||(e.current=mm[ua],mm[ua]=null,ua--)}function bt(e,t){ua++,mm[ua]=e.current,e.current=t}var Pi={},jn=Mi(Pi),Vn=Mi(!1),as=Pi;function Da(e,t){var n=e.type.contextTypes;if(!n)return Pi;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 Un(e){return e=e.childContextTypes,e!=null}function Td(){Et(Vn),Et(jn)}function o1(e,t,n){if(jn.current!==Pi)throw Error(J(168));bt(jn,t),bt(Vn,n)}function Hj(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,dI(e)||"Unknown",o));return $t({},n,r)}function Pd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pi,as=jn.current,bt(jn,e),bt(Vn,Vn.current),!0}function i1(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=Hj(e,t,as),r.__reactInternalMemoizedMergedChildContext=e,Et(Vn),Et(jn),bt(jn,e)):Et(Vn),bt(Vn,n)}var So=null,Sf=!1,sp=!1;function Wj(e){So===null?So=[e]:So.push(e)}function kA(e){Sf=!0,Wj(e)}function Oi(){if(!sp&&So!==null){sp=!0;var e=0,t=at;try{var n=So;for(at=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}So=null,Sf=!1}catch(o){throw So!==null&&(So=So.slice(e+1)),gj(Hg,Oi),o}finally{at=t,sp=!1}}return null}var da=[],fa=0,kd=null,Rd=0,gr=[],vr=0,ls=null,Co=1,Eo="";function Hi(e,t){da[fa++]=Rd,da[fa++]=kd,kd=e,Rd=t}function qj(e,t,n){gr[vr++]=Co,gr[vr++]=Eo,gr[vr++]=ls,ls=e;var r=Co;e=Eo;var o=32-zr(r)-1;r&=~(1<<o),n+=1;var i=32-zr(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Co=1<<32-zr(t)+o|n<<o|r,Eo=i+e}else Co=1<<i|n<<o|r,Eo=e}function Zg(e){e.return!==null&&(Hi(e,1),qj(e,1,0))}function ev(e){for(;e===kd;)kd=da[--fa],da[fa]=null,Rd=da[--fa],da[fa]=null;for(;e===ls;)ls=gr[--vr],gr[vr]=null,Eo=gr[--vr],gr[vr]=null,Co=gr[--vr],gr[vr]=null}var or=null,tr=null,Rt=!1,$r=null;function Gj(e,t){var n=xr(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 s1(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,or=e,tr=xi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,or=e,tr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ls!==null?{id:Co,overflow:Eo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=xr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,or=e,tr=null,!0):!1;default:return!1}}function gm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function vm(e){if(Rt){var t=tr;if(t){var n=t;if(!s1(e,t)){if(gm(e))throw Error(J(418));t=xi(n.nextSibling);var r=or;t&&s1(e,t)?Gj(r,n):(e.flags=e.flags&-4097|2,Rt=!1,or=e)}}else{if(gm(e))throw Error(J(418));e.flags=e.flags&-4097|2,Rt=!1,or=e}}}function a1(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;or=e}function Mu(e){if(e!==or)return!1;if(!Rt)return a1(e),Rt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!fm(e.type,e.memoizedProps)),t&&(t=tr)){if(gm(e))throw Qj(),Error(J(418));for(;t;)Gj(e,t),t=xi(t.nextSibling)}if(a1(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){tr=xi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}tr=null}}else tr=or?xi(e.stateNode.nextSibling):null;return!0}function Qj(){for(var e=tr;e;)e=xi(e.nextSibling)}function Ia(){tr=or=null,Rt=!1}function tv(e){$r===null?$r=[e]:$r.push(e)}var RA=Vo.ReactCurrentBatchConfig;function Nr(e,t){if(e&&e.defaultProps){t=$t({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var _d=Mi(null),Dd=null,ha=null,nv=null;function rv(){nv=ha=Dd=null}function ov(e){var t=_d.current;Et(_d),e._currentValue=t}function ym(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 Ea(e,t){Dd=e,nv=ha=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Bn=!0),e.firstContext=null)}function jr(e){var t=e._currentValue;if(nv!==e)if(e={context:e,memoizedValue:t,next:null},ha===null){if(Dd===null)throw Error(J(308));ha=e,Dd.dependencies={lanes:0,firstContext:e}}else ha=ha.next=e;return t}var Ji=null;function iv(e){Ji===null?Ji=[e]:Ji.push(e)}function Kj(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,iv(t)):(n.next=o.next,o.next=n),t.interleaved=n,Io(e,r)}function Io(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 si=!1;function sv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Yj(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 To(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function bi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,et&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Io(e,n)}return o=r.interleaved,o===null?(t.next=t,iv(r)):(t.next=o.next,o.next=t),r.interleaved=t,Io(e,n)}function nd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wg(e,n)}}function l1(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 a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,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 Id(e,t,n,r){var o=e.updateQueue;si=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=$t({},f,h);break e;case 2:si=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=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 a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);us|=a,e.lanes=a,e.memoizedState=f}}function c1(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 Xj=new KS.Component().refs;function xm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:$t({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var jf={isMounted:function(e){return(e=e._reactInternals)?Ps(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=An(),o=Si(e),i=To(r,o);i.payload=t,n!=null&&(i.callback=n),t=bi(e,i,o),t!==null&&(Br(t,e,o,r),nd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=An(),o=Si(e),i=To(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=bi(e,i,o),t!==null&&(Br(t,e,o,r),nd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=An(),r=Si(e),o=To(n,r);o.tag=2,t!=null&&(o.callback=t),t=bi(e,o,r),t!==null&&(Br(t,e,r,n),nd(t,e,r))}};function u1(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!rc(n,r)||!rc(o,i):!0}function Jj(e,t,n){var r=!1,o=Pi,i=t.contextType;return typeof i=="object"&&i!==null?i=jr(i):(o=Un(t)?as:jn.current,r=t.contextTypes,i=(r=r!=null)?Da(e,o):Pi),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=jf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function d1(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&&jf.enqueueReplaceState(t,t.state,null)}function bm(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Xj,sv(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=jr(i):(i=Un(t)?as:jn.current,o.context=Da(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(xm(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&&jf.enqueueReplaceState(o,o.state,null),Id(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function bl(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(a){var l=o.refs;l===Xj&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Ou(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function f1(e){var t=e._init;return t(e._payload)}function Zj(e){function t(y,b){if(e){var x=y.deletions;x===null?(y.deletions=[b],y.flags|=16):x.push(b)}}function n(y,b){if(!e)return null;for(;b!==null;)t(y,b),b=b.sibling;return null}function r(y,b){for(y=new Map;b!==null;)b.key!==null?y.set(b.key,b):y.set(b.index,b),b=b.sibling;return y}function o(y,b){return y=ji(y,b),y.index=0,y.sibling=null,y}function i(y,b,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<b?(y.flags|=2,b):x):(y.flags|=2,b)):(y.flags|=1048576,b)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,b,x,w){return b===null||b.tag!==6?(b=hp(x,y.mode,w),b.return=y,b):(b=o(b,x),b.return=y,b)}function c(y,b,x,w){var j=x.type;return j===ia?d(y,b,x.props.children,w,x.key):b!==null&&(b.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ii&&f1(j)===b.type)?(w=o(b,x.props),w.ref=bl(y,b,x),w.return=y,w):(w=ld(x.type,x.key,x.props,null,y.mode,w),w.ref=bl(y,b,x),w.return=y,w)}function u(y,b,x,w){return b===null||b.tag!==4||b.stateNode.containerInfo!==x.containerInfo||b.stateNode.implementation!==x.implementation?(b=pp(x,y.mode,w),b.return=y,b):(b=o(b,x.children||[]),b.return=y,b)}function d(y,b,x,w,j){return b===null||b.tag!==7?(b=is(x,y.mode,w,j),b.return=y,b):(b=o(b,x),b.return=y,b)}function f(y,b,x){if(typeof b=="string"&&b!==""||typeof b=="number")return b=hp(""+b,y.mode,x),b.return=y,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Eu:return x=ld(b.type,b.key,b.props,null,y.mode,x),x.ref=bl(y,null,b),x.return=y,x;case oa:return b=pp(b,y.mode,x),b.return=y,b;case ii:var w=b._init;return f(y,w(b._payload),x)}if(Dl(b)||ml(b))return b=is(b,y.mode,x,null),b.return=y,b;Ou(y,b)}return null}function h(y,b,x,w){var j=b!==null?b.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return j!==null?null:l(y,b,""+x,w);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Eu:return x.key===j?c(y,b,x,w):null;case oa:return x.key===j?u(y,b,x,w):null;case ii:return j=x._init,h(y,b,j(x._payload),w)}if(Dl(x)||ml(x))return j!==null?null:d(y,b,x,w,null);Ou(y,x)}return null}function m(y,b,x,w,j){if(typeof w=="string"&&w!==""||typeof w=="number")return y=y.get(x)||null,l(b,y,""+w,j);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Eu:return y=y.get(w.key===null?x:w.key)||null,c(b,y,w,j);case oa:return y=y.get(w.key===null?x:w.key)||null,u(b,y,w,j);case ii:var E=w._init;return m(y,b,x,E(w._payload),j)}if(Dl(w)||ml(w))return y=y.get(x)||null,d(b,y,w,j,null);Ou(b,w)}return null}function g(y,b,x,w){for(var j=null,E=null,C=b,T=b=0,_=null;C!==null&&T<x.length;T++){C.index>T?(_=C,C=null):_=C.sibling;var P=h(y,C,x[T],w);if(P===null){C===null&&(C=_);break}e&&C&&P.alternate===null&&t(y,C),b=i(P,b,T),E===null?j=P:E.sibling=P,E=P,C=_}if(T===x.length)return n(y,C),Rt&&Hi(y,T),j;if(C===null){for(;T<x.length;T++)C=f(y,x[T],w),C!==null&&(b=i(C,b,T),E===null?j=C:E.sibling=C,E=C);return Rt&&Hi(y,T),j}for(C=r(y,C);T<x.length;T++)_=m(C,y,T,x[T],w),_!==null&&(e&&_.alternate!==null&&C.delete(_.key===null?T:_.key),b=i(_,b,T),E===null?j=_:E.sibling=_,E=_);return e&&C.forEach(function(M){return t(y,M)}),Rt&&Hi(y,T),j}function v(y,b,x,w){var j=ml(x);if(typeof j!="function")throw Error(J(150));if(x=j.call(x),x==null)throw Error(J(151));for(var E=j=null,C=b,T=b=0,_=null,P=x.next();C!==null&&!P.done;T++,P=x.next()){C.index>T?(_=C,C=null):_=C.sibling;var M=h(y,C,P.value,w);if(M===null){C===null&&(C=_);break}e&&C&&M.alternate===null&&t(y,C),b=i(M,b,T),E===null?j=M:E.sibling=M,E=M,C=_}if(P.done)return n(y,C),Rt&&Hi(y,T),j;if(C===null){for(;!P.done;T++,P=x.next())P=f(y,P.value,w),P!==null&&(b=i(P,b,T),E===null?j=P:E.sibling=P,E=P);return Rt&&Hi(y,T),j}for(C=r(y,C);!P.done;T++,P=x.next())P=m(C,y,T,P.value,w),P!==null&&(e&&P.alternate!==null&&C.delete(P.key===null?T:P.key),b=i(P,b,T),E===null?j=P:E.sibling=P,E=P);return e&&C.forEach(function(D){return t(y,D)}),Rt&&Hi(y,T),j}function S(y,b,x,w){if(typeof x=="object"&&x!==null&&x.type===ia&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case Eu:e:{for(var j=x.key,E=b;E!==null;){if(E.key===j){if(j=x.type,j===ia){if(E.tag===7){n(y,E.sibling),b=o(E,x.props.children),b.return=y,y=b;break e}}else if(E.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ii&&f1(j)===E.type){n(y,E.sibling),b=o(E,x.props),b.ref=bl(y,E,x),b.return=y,y=b;break e}n(y,E);break}else t(y,E);E=E.sibling}x.type===ia?(b=is(x.props.children,y.mode,w,x.key),b.return=y,y=b):(w=ld(x.type,x.key,x.props,null,y.mode,w),w.ref=bl(y,b,x),w.return=y,y=w)}return a(y);case oa:e:{for(E=x.key;b!==null;){if(b.key===E)if(b.tag===4&&b.stateNode.containerInfo===x.containerInfo&&b.stateNode.implementation===x.implementation){n(y,b.sibling),b=o(b,x.children||[]),b.return=y,y=b;break e}else{n(y,b);break}else t(y,b);b=b.sibling}b=pp(x,y.mode,w),b.return=y,y=b}return a(y);case ii:return E=x._init,S(y,b,E(x._payload),w)}if(Dl(x))return g(y,b,x,w);if(ml(x))return v(y,b,x,w);Ou(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,b!==null&&b.tag===6?(n(y,b.sibling),b=o(b,x),b.return=y,y=b):(n(y,b),b=hp(x,y.mode,w),b.return=y,y=b),a(y)):n(y,b)}return S}var Aa=Zj(!0),eC=Zj(!1),Nc={},ao=Mi(Nc),ac=Mi(Nc),lc=Mi(Nc);function Zi(e){if(e===Nc)throw Error(J(174));return e}function av(e,t){switch(bt(lc,t),bt(ac,e),bt(ao,Nc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jp(t,e)}Et(ao),bt(ao,t)}function Na(){Et(ao),Et(ac),Et(lc)}function tC(e){Zi(lc.current);var t=Zi(ao.current),n=Jp(t,e.type);t!==n&&(bt(ac,e),bt(ao,n))}function lv(e){ac.current===e&&(Et(ao),Et(ac))}var Nt=Mi(0);function Ad(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 ap=[];function cv(){for(var e=0;e<ap.length;e++)ap[e]._workInProgressVersionPrimary=null;ap.length=0}var rd=Vo.ReactCurrentDispatcher,lp=Vo.ReactCurrentBatchConfig,cs=0,Ot=null,Zt=null,rn=null,Nd=!1,Bl=!1,cc=0,_A=0;function yn(){throw Error(J(321))}function uv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ur(e[n],t[n]))return!1;return!0}function dv(e,t,n,r,o,i){if(cs=i,Ot=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,rd.current=e===null||e.memoizedState===null?NA:MA,e=n(r,o),Bl){i=0;do{if(Bl=!1,cc=0,25<=i)throw Error(J(301));i+=1,rn=Zt=null,t.updateQueue=null,rd.current=OA,e=n(r,o)}while(Bl)}if(rd.current=Md,t=Zt!==null&&Zt.next!==null,cs=0,rn=Zt=Ot=null,Nd=!1,t)throw Error(J(300));return e}function fv(){var e=cc!==0;return cc=0,e}function no(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rn===null?Ot.memoizedState=rn=e:rn=rn.next=e,rn}function Cr(){if(Zt===null){var e=Ot.alternate;e=e!==null?e.memoizedState:null}else e=Zt.next;var t=rn===null?Ot.memoizedState:rn.next;if(t!==null)rn=t,Zt=e;else{if(e===null)throw Error(J(310));Zt=e,e={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},rn===null?Ot.memoizedState=rn=e:rn=rn.next=e}return rn}function uc(e,t){return typeof t=="function"?t(e):t}function cp(e){var t=Cr(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=Zt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((cs&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,a=r):c=c.next=f,Ot.lanes|=d,us|=d}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=l,Ur(r,t.memoizedState)||(Bn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ot.lanes|=i,us|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function up(e){var t=Cr(),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 a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);Ur(i,t.memoizedState)||(Bn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function nC(){}function rC(e,t){var n=Ot,r=Cr(),o=t(),i=!Ur(r.memoizedState,o);if(i&&(r.memoizedState=o,Bn=!0),r=r.queue,hv(sC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||rn!==null&&rn.memoizedState.tag&1){if(n.flags|=2048,dc(9,iC.bind(null,n,r,o,t),void 0,null),an===null)throw Error(J(349));cs&30||oC(n,t,o)}return o}function oC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ot.updateQueue,t===null?(t={lastEffect:null,stores:null},Ot.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function iC(e,t,n,r){t.value=n,t.getSnapshot=r,aC(t)&&lC(e)}function sC(e,t,n){return n(function(){aC(t)&&lC(e)})}function aC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Ur(e,n)}catch{return!0}}function lC(e){var t=Io(e,1);t!==null&&Br(t,e,1,-1)}function h1(e){var t=no();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:uc,lastRenderedState:e},t.queue=e,e=e.dispatch=AA.bind(null,Ot,e),[t.memoizedState,e]}function dc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ot.updateQueue,t===null?(t={lastEffect:null,stores:null},Ot.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 cC(){return Cr().memoizedState}function od(e,t,n,r){var o=no();Ot.flags|=e,o.memoizedState=dc(1|t,n,void 0,r===void 0?null:r)}function Cf(e,t,n,r){var o=Cr();r=r===void 0?null:r;var i=void 0;if(Zt!==null){var a=Zt.memoizedState;if(i=a.destroy,r!==null&&uv(r,a.deps)){o.memoizedState=dc(t,n,i,r);return}}Ot.flags|=e,o.memoizedState=dc(1|t,n,i,r)}function p1(e,t){return od(8390656,8,e,t)}function hv(e,t){return Cf(2048,8,e,t)}function uC(e,t){return Cf(4,2,e,t)}function dC(e,t){return Cf(4,4,e,t)}function fC(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 hC(e,t,n){return n=n!=null?n.concat([e]):null,Cf(4,4,fC.bind(null,t,e),n)}function pv(){}function pC(e,t){var n=Cr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&uv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function mC(e,t){var n=Cr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&uv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function gC(e,t,n){return cs&21?(Ur(n,t)||(n=xj(),Ot.lanes|=n,us|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Bn=!0),e.memoizedState=n)}function DA(e,t){var n=at;at=n!==0&&4>n?n:4,e(!0);var r=lp.transition;lp.transition={};try{e(!1),t()}finally{at=n,lp.transition=r}}function vC(){return Cr().memoizedState}function IA(e,t,n){var r=Si(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},yC(e))xC(t,n);else if(n=Kj(e,t,n,r),n!==null){var o=An();Br(n,e,r,o),bC(n,t,r)}}function AA(e,t,n){var r=Si(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(yC(e))xC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,Ur(l,a)){var c=t.interleaved;c===null?(o.next=o,iv(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Kj(e,t,o,r),n!==null&&(o=An(),Br(n,e,r,o),bC(n,t,r))}}function yC(e){var t=e.alternate;return e===Ot||t!==null&&t===Ot}function xC(e,t){Bl=Nd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Wg(e,n)}}var Md={readContext:jr,useCallback:yn,useContext:yn,useEffect:yn,useImperativeHandle:yn,useInsertionEffect:yn,useLayoutEffect:yn,useMemo:yn,useReducer:yn,useRef:yn,useState:yn,useDebugValue:yn,useDeferredValue:yn,useTransition:yn,useMutableSource:yn,useSyncExternalStore:yn,useId:yn,unstable_isNewReconciler:!1},NA={readContext:jr,useCallback:function(e,t){return no().memoizedState=[e,t===void 0?null:t],e},useContext:jr,useEffect:p1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,od(4194308,4,fC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return od(4194308,4,e,t)},useInsertionEffect:function(e,t){return od(4,2,e,t)},useMemo:function(e,t){var n=no();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=no();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=IA.bind(null,Ot,e),[r.memoizedState,e]},useRef:function(e){var t=no();return e={current:e},t.memoizedState=e},useState:h1,useDebugValue:pv,useDeferredValue:function(e){return no().memoizedState=e},useTransition:function(){var e=h1(!1),t=e[0];return e=DA.bind(null,e[1]),no().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ot,o=no();if(Rt){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),an===null)throw Error(J(349));cs&30||oC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,p1(sC.bind(null,r,i,e),[e]),r.flags|=2048,dc(9,iC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=no(),t=an.identifierPrefix;if(Rt){var n=Eo,r=Co;n=(r&~(1<<32-zr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=cc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=_A++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},MA={readContext:jr,useCallback:pC,useContext:jr,useEffect:hv,useImperativeHandle:hC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:mC,useReducer:cp,useRef:cC,useState:function(){return cp(uc)},useDebugValue:pv,useDeferredValue:function(e){var t=Cr();return gC(t,Zt.memoizedState,e)},useTransition:function(){var e=cp(uc)[0],t=Cr().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:vC,unstable_isNewReconciler:!1},OA={readContext:jr,useCallback:pC,useContext:jr,useEffect:hv,useImperativeHandle:hC,useInsertionEffect:uC,useLayoutEffect:dC,useMemo:mC,useReducer:up,useRef:cC,useState:function(){return up(uc)},useDebugValue:pv,useDeferredValue:function(e){var t=Cr();return Zt===null?t.memoizedState=e:gC(t,Zt.memoizedState,e)},useTransition:function(){var e=up(uc)[0],t=Cr().memoizedState;return[e,t]},useMutableSource:nC,useSyncExternalStore:rC,useId:vC,unstable_isNewReconciler:!1};function Ma(e,t){try{var n="",r=t;do n+=uI(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 dp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function wm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var $A=typeof WeakMap=="function"?WeakMap:Map;function wC(e,t,n){n=To(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){$d||($d=!0,Dm=r),wm(e,t)},n}function SC(e,t,n){n=To(-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(){wm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){wm(e,t),typeof r!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function m1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new $A;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=XA.bind(null,e,t,n),t.then(e,e))}function g1(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 v1(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=To(-1,1),t.tag=2,bi(n,t,1))),n.lanes|=1),e)}var LA=Vo.ReactCurrentOwner,Bn=!1;function Rn(e,t,n,r){t.child=e===null?eC(t,null,n,r):Aa(t,e.child,n,r)}function y1(e,t,n,r,o){n=n.render;var i=t.ref;return Ea(t,o),r=dv(e,t,n,r,i,o),n=fv(),e!==null&&!Bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ao(e,t,o)):(Rt&&n&&Zg(t),t.flags|=1,Rn(e,t,r,o),t.child)}function x1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Sv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,jC(e,t,i,r,o)):(e=ld(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 a=i.memoizedProps;if(n=n.compare,n=n!==null?n:rc,n(a,r)&&e.ref===t.ref)return Ao(e,t,o)}return t.flags|=1,e=ji(i,r),e.ref=t.ref,e.return=t,t.child=e}function jC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(rc(i,r)&&e.ref===t.ref)if(Bn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Bn=!0);else return t.lanes=e.lanes,Ao(e,t,o)}return Sm(e,t,n,r,o)}function CC(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},bt(ma,Zn),Zn|=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,bt(ma,Zn),Zn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,bt(ma,Zn),Zn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,bt(ma,Zn),Zn|=r;return Rn(e,t,o,n),t.child}function EC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Sm(e,t,n,r,o){var i=Un(n)?as:jn.current;return i=Da(t,i),Ea(t,o),n=dv(e,t,n,r,i,o),r=fv(),e!==null&&!Bn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Ao(e,t,o)):(Rt&&r&&Zg(t),t.flags|=1,Rn(e,t,n,o),t.child)}function b1(e,t,n,r,o){if(Un(n)){var i=!0;Pd(t)}else i=!1;if(Ea(t,o),t.stateNode===null)id(e,t),Jj(t,n,r),bm(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=jr(u):(u=Un(n)?as:jn.current,u=Da(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==u)&&d1(t,a,r,u),si=!1;var h=t.memoizedState;a.state=h,Id(t,r,a,o),c=t.memoizedState,l!==r||h!==c||Vn.current||si?(typeof d=="function"&&(xm(t,n,d,r),c=t.memoizedState),(l=si||u1(t,n,l,r,h,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Yj(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Nr(t.type,l),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=jr(c):(c=Un(n)?as:jn.current,c=Da(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||h!==c)&&d1(t,a,r,c),si=!1,h=t.memoizedState,a.state=h,Id(t,r,a,o);var g=t.memoizedState;l!==f||h!==g||Vn.current||si?(typeof m=="function"&&(xm(t,n,m,r),g=t.memoizedState),(u=si||u1(t,n,u,r,h,g,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return jm(e,t,n,r,i,o)}function jm(e,t,n,r,o,i){EC(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&i1(t,n,!1),Ao(e,t,i);r=t.stateNode,LA.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Aa(t,e.child,null,i),t.child=Aa(t,null,l,i)):Rn(e,t,l,i),t.memoizedState=r.state,o&&i1(t,n,!0),t.child}function TC(e){var t=e.stateNode;t.pendingContext?o1(e,t.pendingContext,t.pendingContext!==t.context):t.context&&o1(e,t.context,!1),av(e,t.containerInfo)}function w1(e,t,n,r,o){return Ia(),tv(o),t.flags|=256,Rn(e,t,n,r),t.child}var Cm={dehydrated:null,treeContext:null,retryLane:0};function Em(e){return{baseLanes:e,cachePool:null,transitions:null}}function PC(e,t,n){var r=t.pendingProps,o=Nt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),bt(Nt,o&1),e===null)return vm(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):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=Pf(a,r,0,null),e=is(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Em(n),t.memoizedState=Cm,e):mv(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return FA(e,t,a,r,l,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=ji(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=ji(l,i):(i=is(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?Em(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Cm,r}return i=e.child,e=i.sibling,r=ji(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 mv(e,t){return t=Pf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function $u(e,t,n,r){return r!==null&&tv(r),Aa(t,e.child,null,n),e=mv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function FA(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=dp(Error(J(422))),$u(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Pf({mode:"visible",children:r.children},o,0,null),i=is(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Aa(t,e.child,null,a),t.child.memoizedState=Em(a),t.memoizedState=Cm,i);if(!(t.mode&1))return $u(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(J(419)),r=dp(i,r,void 0),$u(e,t,a,r)}if(l=(a&e.childLanes)!==0,Bn||l){if(r=an,r!==null){switch(a&-a){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|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,Io(e,o),Br(r,e,o,-1))}return wv(),r=dp(Error(J(421))),$u(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=JA.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,tr=xi(o.nextSibling),or=t,Rt=!0,$r=null,e!==null&&(gr[vr++]=Co,gr[vr++]=Eo,gr[vr++]=ls,Co=e.id,Eo=e.overflow,ls=t),t=mv(t,r.children),t.flags|=4096,t)}function S1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ym(e.return,t,n)}function fp(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 kC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Rn(e,t,r.children,n),r=Nt.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&&S1(e,n,t);else if(e.tag===19)S1(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(bt(Nt,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&&Ad(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),fp(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&&Ad(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}fp(t,!0,n,null,i);break;case"together":fp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function id(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ao(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),us|=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=ji(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ji(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function zA(e,t,n){switch(t.tag){case 3:TC(t),Ia();break;case 5:tC(t);break;case 1:Un(t.type)&&Pd(t);break;case 4:av(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;bt(_d,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(bt(Nt,Nt.current&1),t.flags|=128,null):n&t.child.childLanes?PC(e,t,n):(bt(Nt,Nt.current&1),e=Ao(e,t,n),e!==null?e.sibling:null);bt(Nt,Nt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return kC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),bt(Nt,Nt.current),r)break;return null;case 22:case 23:return t.lanes=0,CC(e,t,n)}return Ao(e,t,n)}var RC,Tm,_C,DC;RC=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}};Tm=function(){};_C=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Zi(ao.current);var i=null;switch(n){case"input":o=Qp(e,o),r=Qp(e,r),i=[];break;case"select":o=$t({},o,{value:void 0}),r=$t({},r,{value:void 0}),i=[];break;case"textarea":o=Xp(e,o),r=Xp(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Ed)}Zp(n,r);var a;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Yl.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(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}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"&&(Yl.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&jt("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)}};DC=function(e,t,n,r){n!==r&&(t.flags|=4)};function wl(e,t){if(!Rt)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 xn(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 BA(e,t,n){var r=t.pendingProps;switch(ev(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xn(t),null;case 1:return Un(t.type)&&Td(),xn(t),null;case 3:return r=t.stateNode,Na(),Et(Vn),Et(jn),cv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Mu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,$r!==null&&(Nm($r),$r=null))),Tm(e,t),xn(t),null;case 5:lv(t);var o=Zi(lc.current);if(n=t.type,e!==null&&t.stateNode!=null)_C(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return xn(t),null}if(e=Zi(ao.current),Mu(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[io]=t,r[sc]=i,e=(t.mode&1)!==0,n){case"dialog":jt("cancel",r),jt("close",r);break;case"iframe":case"object":case"embed":jt("load",r);break;case"video":case"audio":for(o=0;o<Al.length;o++)jt(Al[o],r);break;case"source":jt("error",r);break;case"img":case"image":case"link":jt("error",r),jt("load",r);break;case"details":jt("toggle",r);break;case"input":D0(r,i),jt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},jt("invalid",r);break;case"textarea":A0(r,i),jt("invalid",r)}Zp(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Nu(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Nu(r.textContent,l,e),o=["children",""+l]):Yl.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&jt("scroll",r)}switch(n){case"input":Tu(r),I0(r,i,!0);break;case"textarea":Tu(r),N0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Ed)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=oj(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[io]=t,e[sc]=r,RC(e,t,!1,!1),t.stateNode=e;e:{switch(a=em(n,r),n){case"dialog":jt("cancel",e),jt("close",e),o=r;break;case"iframe":case"object":case"embed":jt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Al.length;o++)jt(Al[o],e);o=r;break;case"source":jt("error",e),o=r;break;case"img":case"image":case"link":jt("error",e),jt("load",e),o=r;break;case"details":jt("toggle",e),o=r;break;case"input":D0(e,r),o=Qp(e,r),jt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=$t({},r,{value:void 0}),jt("invalid",e);break;case"textarea":A0(e,r),o=Xp(e,r),jt("invalid",e);break;default:o=r}Zp(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?aj(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&ij(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Xl(e,c):typeof c=="number"&&Xl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Yl.hasOwnProperty(i)?c!=null&&i==="onScroll"&&jt("scroll",e):c!=null&&Fg(e,i,c,a))}switch(n){case"input":Tu(e),I0(e,r,!1);break;case"textarea":Tu(e),N0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ti(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?wa(e,!!r.multiple,i,!1):r.defaultValue!=null&&wa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Ed)}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 xn(t),null;case 6:if(e&&t.stateNode!=null)DC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Zi(lc.current),Zi(ao.current),Mu(t)){if(r=t.stateNode,n=t.memoizedProps,r[io]=t,(i=r.nodeValue!==n)&&(e=or,e!==null))switch(e.tag){case 3:Nu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Nu(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[io]=t,t.stateNode=r}return xn(t),null;case 13:if(Et(Nt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Rt&&tr!==null&&t.mode&1&&!(t.flags&128))Qj(),Ia(),t.flags|=98560,i=!1;else if(i=Mu(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[io]=t}else Ia(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;xn(t),i=!1}else $r!==null&&(Nm($r),$r=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||Nt.current&1?en===0&&(en=3):wv())),t.updateQueue!==null&&(t.flags|=4),xn(t),null);case 4:return Na(),Tm(e,t),e===null&&oc(t.stateNode.containerInfo),xn(t),null;case 10:return ov(t.type._context),xn(t),null;case 17:return Un(t.type)&&Td(),xn(t),null;case 19:if(Et(Nt),i=t.memoizedState,i===null)return xn(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)wl(i,!1);else{if(en!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=Ad(e),a!==null){for(t.flags|=128,wl(i,!1),r=a.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,a=i.alternate,a===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=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return bt(Nt,Nt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ht()>Oa&&(t.flags|=128,r=!0,wl(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ad(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Rt)return xn(t),null}else 2*Ht()-i.renderingStartTime>Oa&&n!==1073741824&&(t.flags|=128,r=!0,wl(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Ht(),t.sibling=null,n=Nt.current,bt(Nt,r?n&1|2:n&1),t):(xn(t),null);case 22:case 23:return bv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Zn&1073741824&&(xn(t),t.subtreeFlags&6&&(t.flags|=8192)):xn(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function VA(e,t){switch(ev(t),t.tag){case 1:return Un(t.type)&&Td(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Na(),Et(Vn),Et(jn),cv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return lv(t),null;case 13:if(Et(Nt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Ia()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Et(Nt),null;case 4:return Na(),null;case 10:return ov(t.type._context),null;case 22:case 23:return bv(),null;case 24:return null;default:return null}}var Lu=!1,bn=!1,UA=typeof WeakSet=="function"?WeakSet:Set,ge=null;function pa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zt(e,t,r)}else n.current=null}function Pm(e,t,n){try{n()}catch(r){zt(e,t,r)}}var j1=!1;function HA(e,t){if(um=Sd,e=Mj(),Jg(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 a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||o!==0&&f.nodeType!==3||(l=a+o),f!==i||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=a),h===i&&++d===r&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(dm={focusedElem:e,selectionRange:n},Sd=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;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,b=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Nr(t.type,v),S);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(w){zt(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return g=j1,j1=!1,g}function Vl(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&&Pm(t,n,i)}o=o.next}while(o!==r)}}function Ef(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 km(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 IC(e){var t=e.alternate;t!==null&&(e.alternate=null,IC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[io],delete t[sc],delete t[pm],delete t[TA],delete t[PA])),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 AC(e){return e.tag===5||e.tag===3||e.tag===4}function C1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||AC(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 Rm(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=Ed));else if(r!==4&&(e=e.child,e!==null))for(Rm(e,t,n),e=e.sibling;e!==null;)Rm(e,t,n),e=e.sibling}function _m(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(_m(e,t,n),e=e.sibling;e!==null;)_m(e,t,n),e=e.sibling}var un=null,Mr=!1;function ri(e,t,n){for(n=n.child;n!==null;)NC(e,t,n),n=n.sibling}function NC(e,t,n){if(so&&typeof so.onCommitFiberUnmount=="function")try{so.onCommitFiberUnmount(vf,n)}catch{}switch(n.tag){case 5:bn||pa(n,t);case 6:var r=un,o=Mr;un=null,ri(e,t,n),un=r,Mr=o,un!==null&&(Mr?(e=un,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):un.removeChild(n.stateNode));break;case 18:un!==null&&(Mr?(e=un,n=n.stateNode,e.nodeType===8?ip(e.parentNode,n):e.nodeType===1&&ip(e,n),tc(e)):ip(un,n.stateNode));break;case 4:r=un,o=Mr,un=n.stateNode.containerInfo,Mr=!0,ri(e,t,n),un=r,Mr=o;break;case 0:case 11:case 14:case 15:if(!bn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Pm(n,t,a),o=o.next}while(o!==r)}ri(e,t,n);break;case 1:if(!bn&&(pa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){zt(n,t,l)}ri(e,t,n);break;case 21:ri(e,t,n);break;case 22:n.mode&1?(bn=(r=bn)||n.memoizedState!==null,ri(e,t,n),bn=r):ri(e,t,n);break;default:ri(e,t,n)}}function E1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new UA),t.forEach(function(r){var o=ZA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Dr(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,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:un=l.stateNode,Mr=!1;break e;case 3:un=l.stateNode.containerInfo,Mr=!0;break e;case 4:un=l.stateNode.containerInfo,Mr=!0;break e}l=l.return}if(un===null)throw Error(J(160));NC(i,a,o),un=null,Mr=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){zt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)MC(t,e),t=t.sibling}function MC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Dr(t,e),Zr(e),r&4){try{Vl(3,e,e.return),Ef(3,e)}catch(v){zt(e,e.return,v)}try{Vl(5,e,e.return)}catch(v){zt(e,e.return,v)}}break;case 1:Dr(t,e),Zr(e),r&512&&n!==null&&pa(n,n.return);break;case 5:if(Dr(t,e),Zr(e),r&512&&n!==null&&pa(n,n.return),e.flags&32){var o=e.stateNode;try{Xl(o,"")}catch(v){zt(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=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&&nj(o,i),em(l,a);var u=em(l,i);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?aj(o,f):d==="dangerouslySetInnerHTML"?ij(o,f):d==="children"?Xl(o,f):Fg(o,d,f,u)}switch(l){case"input":Kp(o,i);break;case"textarea":rj(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?wa(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?wa(o,!!i.multiple,i.defaultValue,!0):wa(o,!!i.multiple,i.multiple?[]:"",!1))}o[sc]=i}catch(v){zt(e,e.return,v)}}break;case 6:if(Dr(t,e),Zr(e),r&4){if(e.stateNode===null)throw Error(J(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){zt(e,e.return,v)}}break;case 3:if(Dr(t,e),Zr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{tc(t.containerInfo)}catch(v){zt(e,e.return,v)}break;case 4:Dr(t,e),Zr(e);break;case 13:Dr(t,e),Zr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(yv=Ht())),r&4&&E1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(bn=(u=bn)||d,Dr(t,e),bn=u):Dr(t,e),Zr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ge=e,d=e.child;d!==null;){for(f=ge=d;ge!==null;){switch(h=ge,m=h.child,h.tag){case 0:case 11:case 14:case 15:Vl(4,h,h.return);break;case 1:pa(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){zt(r,n,v)}}break;case 5:pa(h,h.return);break;case 22:if(h.memoizedState!==null){P1(f);continue}}m!==null?(m.return=h,ge=m):P1(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,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=sj("display",a))}catch(v){zt(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){zt(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:Dr(t,e),Zr(e),r&4&&E1(e);break;case 21:break;default:Dr(t,e),Zr(e)}}function Zr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(AC(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&&(Xl(o,""),r.flags&=-33);var i=C1(e);_m(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=C1(e);Rm(e,l,a);break;default:throw Error(J(161))}}catch(c){zt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function WA(e,t,n){ge=e,OC(e)}function OC(e,t,n){for(var r=(e.mode&1)!==0;ge!==null;){var o=ge,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Lu;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||bn;l=Lu;var u=bn;if(Lu=a,(bn=c)&&!u)for(ge=o;ge!==null;)a=ge,c=a.child,a.tag===22&&a.memoizedState!==null?k1(o):c!==null?(c.return=a,ge=c):k1(o);for(;i!==null;)ge=i,OC(i),i=i.sibling;ge=o,Lu=l,bn=u}T1(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ge=i):T1(e)}}function T1(e){for(;ge!==null;){var t=ge;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:bn||Ef(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!bn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Nr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&c1(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}c1(t,a,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&&tc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}bn||t.flags&512&&km(t)}catch(h){zt(t,t.return,h)}}if(t===e){ge=null;break}if(n=t.sibling,n!==null){n.return=t.return,ge=n;break}ge=t.return}}function P1(e){for(;ge!==null;){var t=ge;if(t===e){ge=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ge=n;break}ge=t.return}}function k1(e){for(;ge!==null;){var t=ge;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ef(4,t)}catch(c){zt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){zt(t,o,c)}}var i=t.return;try{km(t)}catch(c){zt(t,i,c)}break;case 5:var a=t.return;try{km(t)}catch(c){zt(t,a,c)}}}catch(c){zt(t,t.return,c)}if(t===e){ge=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ge=l;break}ge=t.return}}var qA=Math.ceil,Od=Vo.ReactCurrentDispatcher,gv=Vo.ReactCurrentOwner,br=Vo.ReactCurrentBatchConfig,et=0,an=null,qt=null,fn=0,Zn=0,ma=Mi(0),en=0,fc=null,us=0,Tf=0,vv=0,Ul=null,zn=null,yv=0,Oa=1/0,wo=null,$d=!1,Dm=null,wi=null,Fu=!1,pi=null,Ld=0,Hl=0,Im=null,sd=-1,ad=0;function An(){return et&6?Ht():sd!==-1?sd:sd=Ht()}function Si(e){return e.mode&1?et&2&&fn!==0?fn&-fn:RA.transition!==null?(ad===0&&(ad=xj()),ad):(e=at,e!==0||(e=window.event,e=e===void 0?16:Tj(e.type)),e):1}function Br(e,t,n,r){if(50<Hl)throw Hl=0,Im=null,Error(J(185));Dc(e,n,r),(!(et&2)||e!==an)&&(e===an&&(!(et&2)&&(Tf|=n),en===4&&ui(e,fn)),Hn(e,r),n===1&&et===0&&!(t.mode&1)&&(Oa=Ht()+500,Sf&&Oi()))}function Hn(e,t){var n=e.callbackNode;RI(e,t);var r=wd(e,e===an?fn:0);if(r===0)n!==null&&$0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&$0(n),t===1)e.tag===0?kA(R1.bind(null,e)):Wj(R1.bind(null,e)),CA(function(){!(et&6)&&Oi()}),n=null;else{switch(bj(r)){case 1:n=Hg;break;case 4:n=vj;break;case 16:n=bd;break;case 536870912:n=yj;break;default:n=bd}n=HC(n,$C.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function $C(e,t){if(sd=-1,ad=0,et&6)throw Error(J(327));var n=e.callbackNode;if(Ta()&&e.callbackNode!==n)return null;var r=wd(e,e===an?fn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Fd(e,r);else{t=r;var o=et;et|=2;var i=FC();(an!==e||fn!==t)&&(wo=null,Oa=Ht()+500,os(e,t));do try{KA();break}catch(l){LC(e,l)}while(!0);rv(),Od.current=i,et=o,qt!==null?t=0:(an=null,fn=0,t=en)}if(t!==0){if(t===2&&(o=im(e),o!==0&&(r=o,t=Am(e,o))),t===1)throw n=fc,os(e,0),ui(e,r),Hn(e,Ht()),n;if(t===6)ui(e,r);else{if(o=e.current.alternate,!(r&30)&&!GA(o)&&(t=Fd(e,r),t===2&&(i=im(e),i!==0&&(r=i,t=Am(e,i))),t===1))throw n=fc,os(e,0),ui(e,r),Hn(e,Ht()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:Wi(e,zn,wo);break;case 3:if(ui(e,r),(r&130023424)===r&&(t=yv+500-Ht(),10<t)){if(wd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){An(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=hm(Wi.bind(null,e,zn,wo),t);break}Wi(e,zn,wo);break;case 4:if(ui(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-zr(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*qA(r/1960))-r,10<r){e.timeoutHandle=hm(Wi.bind(null,e,zn,wo),r);break}Wi(e,zn,wo);break;case 5:Wi(e,zn,wo);break;default:throw Error(J(329))}}}return Hn(e,Ht()),e.callbackNode===n?$C.bind(null,e):null}function Am(e,t){var n=Ul;return e.current.memoizedState.isDehydrated&&(os(e,t).flags|=256),e=Fd(e,t),e!==2&&(t=zn,zn=n,t!==null&&Nm(t)),e}function Nm(e){zn===null?zn=e:zn.push.apply(zn,e)}function GA(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(!Ur(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 ui(e,t){for(t&=~vv,t&=~Tf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zr(t),r=1<<n;e[n]=-1,t&=~r}}function R1(e){if(et&6)throw Error(J(327));Ta();var t=wd(e,0);if(!(t&1))return Hn(e,Ht()),null;var n=Fd(e,t);if(e.tag!==0&&n===2){var r=im(e);r!==0&&(t=r,n=Am(e,r))}if(n===1)throw n=fc,os(e,0),ui(e,t),Hn(e,Ht()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Wi(e,zn,wo),Hn(e,Ht()),null}function xv(e,t){var n=et;et|=1;try{return e(t)}finally{et=n,et===0&&(Oa=Ht()+500,Sf&&Oi())}}function ds(e){pi!==null&&pi.tag===0&&!(et&6)&&Ta();var t=et;et|=1;var n=br.transition,r=at;try{if(br.transition=null,at=1,e)return e()}finally{at=r,br.transition=n,et=t,!(et&6)&&Oi()}}function bv(){Zn=ma.current,Et(ma)}function os(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,jA(n)),qt!==null)for(n=qt.return;n!==null;){var r=n;switch(ev(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Td();break;case 3:Na(),Et(Vn),Et(jn),cv();break;case 5:lv(r);break;case 4:Na();break;case 13:Et(Nt);break;case 19:Et(Nt);break;case 10:ov(r.type._context);break;case 22:case 23:bv()}n=n.return}if(an=e,qt=e=ji(e.current,null),fn=Zn=t,en=0,fc=null,vv=Tf=us=0,zn=Ul=null,Ji!==null){for(t=0;t<Ji.length;t++)if(n=Ji[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}Ji=null}return e}function LC(e,t){do{var n=qt;try{if(rv(),rd.current=Md,Nd){for(var r=Ot.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Nd=!1}if(cs=0,rn=Zt=Ot=null,Bl=!1,cc=0,gv.current=null,n===null||n.return===null){en=1,fc=t,qt=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=fn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=g1(a);if(m!==null){m.flags&=-257,v1(m,a,l,i,t),m.mode&1&&m1(i,u,t),t=m,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)){m1(i,u,t),wv();break e}c=Error(J(426))}}else if(Rt&&l.mode&1){var S=g1(a);if(S!==null){!(S.flags&65536)&&(S.flags|=256),v1(S,a,l,i,t),tv(Ma(c,l));break e}}i=c=Ma(c,l),en!==4&&(en=2),Ul===null?Ul=[i]:Ul.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=wC(i,c,t);l1(i,y);break e;case 1:l=c;var b=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(wi===null||!wi.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=SC(i,l,t);l1(i,w);break e}}i=i.return}while(i!==null)}BC(n)}catch(j){t=j,qt===n&&n!==null&&(qt=n=n.return);continue}break}while(!0)}function FC(){var e=Od.current;return Od.current=Md,e===null?Md:e}function wv(){(en===0||en===3||en===2)&&(en=4),an===null||!(us&268435455)&&!(Tf&268435455)||ui(an,fn)}function Fd(e,t){var n=et;et|=2;var r=FC();(an!==e||fn!==t)&&(wo=null,os(e,t));do try{QA();break}catch(o){LC(e,o)}while(!0);if(rv(),et=n,Od.current=r,qt!==null)throw Error(J(261));return an=null,fn=0,en}function QA(){for(;qt!==null;)zC(qt)}function KA(){for(;qt!==null&&!bI();)zC(qt)}function zC(e){var t=UC(e.alternate,e,Zn);e.memoizedProps=e.pendingProps,t===null?BC(e):qt=t,gv.current=null}function BC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=VA(n,t),n!==null){n.flags&=32767,qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{en=6,qt=null;return}}else if(n=BA(n,t,Zn),n!==null){qt=n;return}if(t=t.sibling,t!==null){qt=t;return}qt=t=e}while(t!==null);en===0&&(en=5)}function Wi(e,t,n){var r=at,o=br.transition;try{br.transition=null,at=1,YA(e,t,n,r)}finally{br.transition=o,at=r}return null}function YA(e,t,n,r){do Ta();while(pi!==null);if(et&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(_I(e,i),e===an&&(qt=an=null,fn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Fu||(Fu=!0,HC(bd,function(){return Ta(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=br.transition,br.transition=null;var a=at;at=1;var l=et;et|=4,gv.current=null,HA(e,n),MC(n,e),gA(dm),Sd=!!um,dm=um=null,e.current=n,WA(n),wI(),et=l,at=a,br.transition=i}else e.current=n;if(Fu&&(Fu=!1,pi=e,Ld=o),i=e.pendingLanes,i===0&&(wi=null),CI(n.stateNode),Hn(e,Ht()),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($d)throw $d=!1,e=Dm,Dm=null,e;return Ld&1&&e.tag!==0&&Ta(),i=e.pendingLanes,i&1?e===Im?Hl++:(Hl=0,Im=e):Hl=0,Oi(),null}function Ta(){if(pi!==null){var e=bj(Ld),t=br.transition,n=at;try{if(br.transition=null,at=16>e?16:e,pi===null)var r=!1;else{if(e=pi,pi=null,Ld=0,et&6)throw Error(J(331));var o=et;for(et|=4,ge=e.current;ge!==null;){var i=ge,a=i.child;if(ge.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ge=u;ge!==null;){var d=ge;switch(d.tag){case 0:case 11:case 15:Vl(8,d,i)}var f=d.child;if(f!==null)f.return=d,ge=f;else for(;ge!==null;){d=ge;var h=d.sibling,m=d.return;if(IC(d),d===u){ge=null;break}if(h!==null){h.return=m,ge=h;break}ge=m}}}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)}}ge=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ge=a;else e:for(;ge!==null;){if(i=ge,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Vl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ge=y;break e}ge=i.return}}var b=e.current;for(ge=b;ge!==null;){a=ge;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,ge=x;else e:for(a=b;ge!==null;){if(l=ge,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ef(9,l)}}catch(j){zt(l,l.return,j)}if(l===a){ge=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,ge=w;break e}ge=l.return}}if(et=o,Oi(),so&&typeof so.onPostCommitFiberRoot=="function")try{so.onPostCommitFiberRoot(vf,e)}catch{}r=!0}return r}finally{at=n,br.transition=t}}return!1}function _1(e,t,n){t=Ma(n,t),t=wC(e,t,1),e=bi(e,t,1),t=An(),e!==null&&(Dc(e,1,t),Hn(e,t))}function zt(e,t,n){if(e.tag===3)_1(e,e,n);else for(;t!==null;){if(t.tag===3){_1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(wi===null||!wi.has(r))){e=Ma(n,e),e=SC(t,e,1),t=bi(t,e,1),e=An(),t!==null&&(Dc(t,1,e),Hn(t,e));break}}t=t.return}}function XA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=An(),e.pingedLanes|=e.suspendedLanes&n,an===e&&(fn&n)===n&&(en===4||en===3&&(fn&130023424)===fn&&500>Ht()-yv?os(e,0):vv|=n),Hn(e,t)}function VC(e,t){t===0&&(e.mode&1?(t=Ru,Ru<<=1,!(Ru&130023424)&&(Ru=4194304)):t=1);var n=An();e=Io(e,t),e!==null&&(Dc(e,t,n),Hn(e,n))}function JA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),VC(e,n)}function ZA(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),VC(e,n)}var UC;UC=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Vn.current)Bn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Bn=!1,zA(e,t,n);Bn=!!(e.flags&131072)}else Bn=!1,Rt&&t.flags&1048576&&qj(t,Rd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;id(e,t),e=t.pendingProps;var o=Da(t,jn.current);Ea(t,n),o=dv(null,t,r,e,o,n);var i=fv();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,Un(r)?(i=!0,Pd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,sv(t),o.updater=jf,t.stateNode=o,o._reactInternals=t,bm(t,r,e,n),t=jm(null,t,r,!0,i,n)):(t.tag=0,Rt&&i&&Zg(t),Rn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(id(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=tN(r),e=Nr(r,e),o){case 0:t=Sm(null,t,r,e,n);break e;case 1:t=b1(null,t,r,e,n);break e;case 11:t=y1(null,t,r,e,n);break e;case 14:t=x1(null,t,r,Nr(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:Nr(r,o),Sm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nr(r,o),b1(e,t,r,o,n);case 3:e:{if(TC(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Yj(e,t),Id(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Ma(Error(J(423)),t),t=w1(e,t,r,n,o);break e}else if(r!==o){o=Ma(Error(J(424)),t),t=w1(e,t,r,n,o);break e}else for(tr=xi(t.stateNode.containerInfo.firstChild),or=t,Rt=!0,$r=null,n=eC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ia(),r===o){t=Ao(e,t,n);break e}Rn(e,t,r,n)}t=t.child}return t;case 5:return tC(t),e===null&&vm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,fm(r,o)?a=null:i!==null&&fm(r,i)&&(t.flags|=32),EC(e,t),Rn(e,t,a,n),t.child;case 6:return e===null&&vm(t),null;case 13:return PC(e,t,n);case 4:return av(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Aa(t,null,r,n):Rn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nr(r,o),y1(e,t,r,o,n);case 7:return Rn(e,t,t.pendingProps,n),t.child;case 8:return Rn(e,t,t.pendingProps.children,n),t.child;case 12:return Rn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,bt(_d,r._currentValue),r._currentValue=a,i!==null)if(Ur(i.value,a)){if(i.children===o.children&&!Vn.current){t=Ao(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=To(-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),ym(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(J(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),ym(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Rn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ea(t,n),o=jr(o),r=r(o),t.flags|=1,Rn(e,t,r,n),t.child;case 14:return r=t.type,o=Nr(r,t.pendingProps),o=Nr(r.type,o),x1(e,t,r,o,n);case 15:return jC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Nr(r,o),id(e,t),t.tag=1,Un(r)?(e=!0,Pd(t)):e=!1,Ea(t,n),Jj(t,r,o),bm(t,r,o,n),jm(null,t,r,!0,e,n);case 19:return kC(e,t,n);case 22:return CC(e,t,n)}throw Error(J(156,t.tag))};function HC(e,t){return gj(e,t)}function eN(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 xr(e,t,n,r){return new eN(e,t,n,r)}function Sv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function tN(e){if(typeof e=="function")return Sv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Bg)return 11;if(e===Vg)return 14}return 2}function ji(e,t){var n=e.alternate;return n===null?(n=xr(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 ld(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Sv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ia:return is(n.children,o,i,t);case zg:a=8,o|=8;break;case Hp:return e=xr(12,n,t,o|2),e.elementType=Hp,e.lanes=i,e;case Wp:return e=xr(13,n,t,o),e.elementType=Wp,e.lanes=i,e;case qp:return e=xr(19,n,t,o),e.elementType=qp,e.lanes=i,e;case ZS:return Pf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case XS:a=10;break e;case JS:a=9;break e;case Bg:a=11;break e;case Vg:a=14;break e;case ii:a=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=xr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function is(e,t,n,r){return e=xr(7,e,r,t),e.lanes=n,e}function Pf(e,t,n,r){return e=xr(22,e,r,t),e.elementType=ZS,e.lanes=n,e.stateNode={isHidden:!1},e}function hp(e,t,n){return e=xr(6,e,null,t),e.lanes=n,e}function pp(e,t,n){return t=xr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function nN(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=Qh(0),this.expirationTimes=Qh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Qh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function jv(e,t,n,r,o,i,a,l,c){return e=new nN(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},sv(i),e}function rN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:oa,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function WC(e){if(!e)return Pi;e=e._reactInternals;e:{if(Ps(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(Un(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(Un(n))return Hj(e,n,t)}return t}function qC(e,t,n,r,o,i,a,l,c){return e=jv(n,r,!0,e,o,i,a,l,c),e.context=WC(null),n=e.current,r=An(),o=Si(n),i=To(r,o),i.callback=t??null,bi(n,i,o),e.current.lanes=o,Dc(e,o,r),Hn(e,r),e}function kf(e,t,n,r){var o=t.current,i=An(),a=Si(o);return n=WC(n),t.context===null?t.context=n:t.pendingContext=n,t=To(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=bi(o,t,a),e!==null&&(Br(e,o,a,i),nd(e,o,a)),a}function zd(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 D1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Cv(e,t){D1(e,t),(e=e.alternate)&&D1(e,t)}function oN(){return null}var GC=typeof reportError=="function"?reportError:function(e){console.error(e)};function Ev(e){this._internalRoot=e}Rf.prototype.render=Ev.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));kf(e,t,null,null)};Rf.prototype.unmount=Ev.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ds(function(){kf(null,e,null,null)}),t[Do]=null}};function Rf(e){this._internalRoot=e}Rf.prototype.unstable_scheduleHydration=function(e){if(e){var t=jj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ci.length&&t!==0&&t<ci[n].priority;n++);ci.splice(n,0,e),n===0&&Ej(e)}};function Tv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function _f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function I1(){}function iN(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=zd(a);i.call(u)}}var a=qC(t,r,e,0,null,!1,!1,"",I1);return e._reactRootContainer=a,e[Do]=a.current,oc(e.nodeType===8?e.parentNode:e),ds(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=zd(c);l.call(u)}}var c=jv(e,0,!1,null,null,!1,!1,"",I1);return e._reactRootContainer=c,e[Do]=c.current,oc(e.nodeType===8?e.parentNode:e),ds(function(){kf(t,c,n,r)}),c}function Df(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=zd(a);l.call(c)}}kf(t,a,e,o)}else a=iN(n,t,e,o,r);return zd(a)}wj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Il(t.pendingLanes);n!==0&&(Wg(t,n|1),Hn(t,Ht()),!(et&6)&&(Oa=Ht()+500,Oi()))}break;case 13:ds(function(){var r=Io(e,1);if(r!==null){var o=An();Br(r,e,1,o)}}),Cv(e,1)}};qg=function(e){if(e.tag===13){var t=Io(e,134217728);if(t!==null){var n=An();Br(t,e,134217728,n)}Cv(e,134217728)}};Sj=function(e){if(e.tag===13){var t=Si(e),n=Io(e,t);if(n!==null){var r=An();Br(n,e,t,r)}Cv(e,t)}};jj=function(){return at};Cj=function(e,t){var n=at;try{return at=e,t()}finally{at=n}};nm=function(e,t,n){switch(t){case"input":if(Kp(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=wf(r);if(!o)throw Error(J(90));tj(r),Kp(r,o)}}}break;case"textarea":rj(e,n);break;case"select":t=n.value,t!=null&&wa(e,!!n.multiple,t,!1)}};uj=xv;dj=ds;var sN={usingClientEntryPoint:!1,Events:[Ac,ca,wf,lj,cj,xv]},Sl={findFiberByHostInstance:Xi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},aN={bundleType:Sl.bundleType,version:Sl.version,rendererPackageName:Sl.rendererPackageName,rendererConfig:Sl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=pj(e),e===null?null:e.stateNode},findFiberByHostInstance:Sl.findFiberByHostInstance||oN,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 zu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zu.isDisabled&&zu.supportsFiber)try{vf=zu.inject(aN),so=zu}catch{}}lr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=sN;lr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Tv(t))throw Error(J(200));return rN(e,t,null,n)};lr.createRoot=function(e,t){if(!Tv(e))throw Error(J(299));var n=!1,r="",o=GC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=jv(e,1,!1,null,null,n,!1,r,o),e[Do]=t.current,oc(e.nodeType===8?e.parentNode:e),new Ev(t)};lr.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=pj(t),e=e===null?null:e.stateNode,e};lr.flushSync=function(e){return ds(e)};lr.hydrate=function(e,t,n){if(!_f(t))throw Error(J(200));return Df(null,e,t,!0,n)};lr.hydrateRoot=function(e,t,n){if(!Tv(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=GC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=qC(t,null,e,1,n??null,o,!1,i,a),e[Do]=t.current,oc(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 Rf(t)};lr.render=function(e,t,n){if(!_f(t))throw Error(J(200));return Df(null,e,t,!1,n)};lr.unmountComponentAtNode=function(e){if(!_f(e))throw Error(J(40));return e._reactRootContainer?(ds(function(){Df(null,null,e,!1,function(){e._reactRootContainer=null,e[Do]=null})}),!0):!1};lr.unstable_batchedUpdates=xv;lr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!_f(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return Df(e,t,n,!1,r)};lr.version="18.2.0-next-9e3b772b8-20220608";function QC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(QC)}catch(e){console.error(e)}}QC(),qS.exports=lr;var Mc=qS.exports;const ga=Sg(Mc),lN=rS({__proto__:null,default:ga},[Mc]),[cN,Tr]=On("ScrollArea.Root component was not found in tree");function $a(e,t){const n=Qi(t);Qa(()=>{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 uN=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Tr(),[i,a]=p.useState(0),[l,c]=p.useState(0),u=!!(i&&l);return $a(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),$a(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),u?s.jsx("div",{...r,ref:t,style:{...n,width:i,height:l}}):null}),dN=p.forwardRef((e,t)=>{const n=Tr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(uN,{...e,ref:t}):null}),fN={scrollHideDelay:1e3,type:"hover"},KC=p.forwardRef((e,t)=>{const n=V("ScrollAreaRoot",fN,e),{type:r,scrollHideDelay:o,scrollbars:i,...a}=n,[l,c]=p.useState(null),[u,d]=p.useState(null),[f,h]=p.useState(null),[m,g]=p.useState(null),[v,S]=p.useState(null),[y,b]=p.useState(0),[x,w]=p.useState(0),[j,E]=p.useState(!1),[C,T]=p.useState(!1),_=Qt(t,P=>c(P));return s.jsx(cN,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:j,onScrollbarXEnabledChange:E,scrollbarY:v,onScrollbarYChange:S,scrollbarYEnabled:C,onScrollbarYEnabledChange:T,onCornerWidthChange:b,onCornerHeightChange:w},children:s.jsx(W,{...a,ref:_,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${y}px`,"--sa-corner-height":i!=="xy"?"0px":`${x}px`}})})});KC.displayName="@mantine/core/ScrollAreaRoot";function YC(e,t){const n=e/t;return Number.isNaN(n)?0:n}function If(e){const t=YC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function XC(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 hN(e,[t,n]){return Math.min(n,Math.max(t,e))}function A1(e,t,n="ltr"){const r=If(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=hN(e,c);return XC([0,a],[0,l])(u)}function pN(e,t,n,r="ltr"){const o=If(n),i=o/2,a=t||i,l=o-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return XC([c,u],f)(e)}function JC(e,t){return e>0&&e<t}function Bd(e){return e?parseInt(e,10):0}function ss(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[mN,ZC]=On("ScrollAreaScrollbar was not found in tree"),eE=p.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=Tr(),[m,g]=p.useState(null),v=Qt(t,T=>g(T)),S=p.useRef(null),y=p.useRef(""),{viewport:b}=h,x=n.content-n.viewport,w=Qi(u),j=Qi(l),E=hf(d,10),C=T=>{if(S.current){const _=T.clientX-S.current.left,P=T.clientY-S.current.top;c({x:_,y:P})}};return p.useEffect(()=>{const T=_=>{const P=_.target;(m==null?void 0:m.contains(P))&&w(_,x)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[b,m,x,w]),p.useEffect(j,[n,j]),$a(m,E),$a(h.content,E),s.jsx(mN,{value:{scrollbar:m,hasThumb:r,onThumbChange:Qi(o),onThumbPointerUp:Qi(i),onThumbPositionChange:j,onThumbPointerDown:Qi(a)},children:s.jsx("div",{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:ss(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),S.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C(T))}),onPointerMove:ss(e.onPointerMove,C),onPointerUp:ss(e.onPointerUp,T=>{const _=T.target;_.hasPointerCapture(T.pointerId)&&_.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=y.current,S.current=null})})})}),gN=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Tr(),[l,c]=p.useState(),u=p.useRef(null),d=Qt(t,u,a.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx(eE,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${If(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(a.viewport){const m=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),JC(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&a.viewport&&l&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:Bd(l.paddingLeft),paddingEnd:Bd(l.paddingRight)}})}})}),vN=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Tr(),[l,c]=p.useState(),u=p.useRef(null),d=Qt(t,u,a.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx(eE,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${If(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(a.viewport){const m=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),JC(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&a.viewport&&l&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:Bd(l.paddingTop),paddingEnd:Bd(l.paddingBottom)}})}})}),Pv=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Es(),i=Tr(),a=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=YC(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>{a.current=m},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:m=>{l.current=m}},h=(m,g)=>pN(m,l.current,c,g);return n==="horizontal"?s.jsx(gN,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollLeft,g=A1(m,c,o);a.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,o))}}):n==="vertical"?s.jsx(vN,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollTop,g=A1(m,c);a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),tE=p.forwardRef((e,t)=>{const n=Tr(),{forceMount:r,...o}=e,[i,a]=p.useState(!1),l=e.orientation==="horizontal",c=hf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?u:d)}},10);return $a(n.viewport,c),$a(n.content,c),r||i?s.jsx(Pv,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),yN=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Tr(),[i,a]=p.useState(!1);return p.useEffect(()=>{const{scrollArea:l}=o;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!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?s.jsx(tE,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),xN=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Tr(),i=e.orientation==="horizontal",[a,l]=p.useState("hidden"),c=hf(()=>l("idle"),100);return p.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay]),p.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(l("scrolling"),c()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||a!=="hidden"?s.jsx(Pv,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ss(e.onPointerEnter,()=>l("interacting")),onPointerLeave:ss(e.onPointerLeave,()=>l("idle"))}):null}),N1=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Tr(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return p.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?s.jsx(yN,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(xN,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(tE,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(Pv,{...r,ref:t}):null});function bN(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const wN=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Tr(),i=ZC(),{onThumbPositionChange:a}=i,l=Qt(t,d=>i.onThumbChange(d)),c=p.useRef(),u=hf(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=bN(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,u,a]),s.jsx("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:ss(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:m,y:g})}),onPointerUp:ss(e.onPointerUp,i.onThumbPointerUp)})}),M1=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=ZC();return n||o.hasThumb?s.jsx(wN,{ref:t,...r}):null}),nE=p.forwardRef(({children:e,style:t,...n},r)=>{const o=Tr(),i=Qt(r,o.onViewportChange);return s.jsx(W,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});nE.displayName="@mantine/core/ScrollAreaViewport";var kv={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const rE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},SN=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":F(t)}}),Pr=K((e,t)=>{const n=V("ScrollArea",rE,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:m,onScrollPositionChange:g,children:v,offsetScrollbars:S,scrollbars:y,...b}=n,[x,w]=p.useState(!1),j=le({name:"ScrollArea",props:n,classes:kv,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:SN});return s.jsxs(KC,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:y,...j("root"),...b,children:[s.jsx(nE,{...h,...j("viewport",{style:h==null?void 0:h.style}),ref:m,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":y||void 0,onScroll:E=>{var C;(C=h==null?void 0:h.onScroll)==null||C.call(h,E),g==null||g({x:E.currentTarget.scrollLeft,y:E.currentTarget.scrollTop})},children:v}),(y==="xy"||y==="x")&&s.jsx(N1,{...j("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:s.jsx(M1,{...j("thumb")})}),(y==="xy"||y==="y")&&s.jsx(N1,{...j("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1),children:s.jsx(M1,{...j("thumb")})}),s.jsx(dN,{...j("corner"),"data-hovered":x||void 0,"data-hidden":d==="never"||void 0})]})});Pr.displayName="@mantine/core/ScrollArea";const Af=K((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:a,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,scrollbars:v,style:S,vars:y,...b}=V("ScrollAreaAutosize",rE,e);return s.jsx(W,{...b,ref:t,style:[{display:"flex",overflow:"auto"},S],children:s.jsx(W,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Pr,{classNames:r,styles:o,scrollHideDelay:a,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,vars:y,scrollbars:v,children:n})})})});Pr.classes=kv;Af.displayName="@mantine/core/ScrollAreaAutosize";Af.classes=kv;Pr.Autosize=Af;var oE={root:"m_87cf2631"};const jN={__staticSelector:"UnstyledButton"},gn=Cn((e,t)=>{const n=V("UnstyledButton",jN,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:l,styles:c,style:u,...d}=n,f=le({name:i,props:n,classes:oE,className:r,style:u,classNames:l,styles:c,unstyled:a});return s.jsx(W,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});gn.classes=oE;gn.displayName="@mantine/core/UnstyledButton";var iE={root:"m_515a97f8"};const CN={},Rv=K((e,t)=>{const n=V("VisuallyHidden",CN,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,...u}=n,d=le({name:"VisuallyHidden",classes:iE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l});return s.jsx(W,{component:"span",ref:t,...d("root"),...u})});Rv.classes=iE;Rv.displayName="@mantine/core/VisuallyHidden";var sE={root:"m_1b7284a3"};const EN={},TN=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:ot(t),"--paper-shadow":kg(n)}}),Wn=Cn((e,t)=>{const n=V("Paper",EN,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:m,...g}=n,v=le({name:"Paper",props:n,classes:sE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:TN});return s.jsx(W,{ref:t,mod:[{"data-with-border":c},m],...v("root"),variant:h,...g})});Wn.classes=sE;Wn.displayName="@mantine/core/Paper";function Xa(e){return aE(e)?(e.nodeName||"").toLowerCase():"#document"}function qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Uo(e){var t;return(t=(aE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function aE(e){return e instanceof Node||e instanceof qn(e).Node}function _t(e){return e instanceof Element||e instanceof qn(e).Element}function sr(e){return e instanceof HTMLElement||e instanceof qn(e).HTMLElement}function Mm(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qn(e).ShadowRoot}function Oc(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Er(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function PN(e){return["table","td","th"].includes(Xa(e))}function _v(e){const t=Dv(),n=Er(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function kN(e){let t=No(e);for(;sr(t)&&!ki(t);){if(_v(t))return t;t=No(t)}return null}function Dv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ki(e){return["html","body","#document"].includes(Xa(e))}function Er(e){return qn(e).getComputedStyle(e)}function Nf(e){return _t(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function No(e){if(Xa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Mm(e)&&e.host||Uo(e);return Mm(t)?t.host:t}function lE(e){const t=No(e);return ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:sr(t)&&Oc(t)?t:lE(t)}function Po(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=lE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=qn(o);return i?t.concat(a,a.visualViewport||[],Oc(o)?o:[],a.frameElement&&n?Po(a.frameElement):[]):t.concat(o,Po(o,[],n))}function O1(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 hc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Mm(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function cE(){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 RN(e){return IN()?!1:!$1()&&e.width===0&&e.height===0||$1()&&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 _N(){return/apple/i.test(navigator.vendor)}function $1(){const e=/android/i;return e.test(cE())||e.test(uE())}function DN(){return cE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function IN(){return uE().includes("jsdom/")}function Om(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function AN(e){return"nativeEvent"in e}function NN(e){return e.matches("html,body")}function es(e){return(e==null?void 0:e.ownerDocument)||document}function mp(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 na(e){return"composedPath"in e?e.composedPath()[0]:e.target}const MN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ON(e){return sr(e)&&e.matches(MN)}const nr=Math.min,wn=Math.max,Vd=Math.round,Bu=Math.floor,Ri=e=>({x:e,y:e}),$N={left:"right",right:"left",bottom:"top",top:"bottom"},LN={start:"end",end:"start"};function $m(e,t,n){return wn(e,nr(t,n))}function Mo(e,t){return typeof e=="function"?e(t):e}function Hr(e){return e.split("-")[0]}function Ja(e){return e.split("-")[1]}function Iv(e){return e==="x"?"y":"x"}function Av(e){return e==="y"?"height":"width"}function ks(e){return["top","bottom"].includes(Hr(e))?"y":"x"}function Nv(e){return Iv(ks(e))}function FN(e,t,n){n===void 0&&(n=!1);const r=Ja(e),o=Nv(e),i=Av(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Ud(a)),[a,Ud(a)]}function zN(e){const t=Ud(e);return[Lm(e),t,Lm(t)]}function Lm(e){return e.replace(/start|end/g,t=>LN[t])}function BN(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function VN(e,t,n,r){const o=Ja(e);let i=BN(Hr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Lm)))),i}function Ud(e){return e.replace(/left|right|bottom|top/g,t=>$N[t])}function UN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Mv(e){return typeof e!="number"?UN(e):{top:e,right:e,bottom:e,left:e}}function La(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function L1(e,t,n){let{reference:r,floating:o}=e;const i=ks(t),a=Nv(t),l=Av(a),c=Hr(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(Ja(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const HN=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=L1(u,r,c),h=r,m={},g=0;for(let v=0;v<l.length;v++){const{name:S,fn:y}=l[v],{x:b,y:x,data:w,reset:j}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});d=b??d,f=x??f,m={...m,[S]:{...m[S],...w}},j&&g<=50&&(g++,typeof j=="object"&&(j.placement&&(h=j.placement),j.rects&&(u=j.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):j.rects),{x:d,y:f}=L1(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function Ov(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Mo(t,e),g=Mv(m),S=l[h?f==="floating"?"reference":"floating":f],y=La(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})),b=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),w=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},j=La(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:b,offsetParent:x,strategy:c}):b);return{top:(y.top-j.top+g.top)/w.y,bottom:(j.bottom-y.bottom+g.bottom)/w.y,left:(y.left-j.left+g.left)/w.x,right:(j.right-y.right+g.right)/w.x}}const WN=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Mo(e,t)||{};if(u==null)return{};const f=Mv(d),h={x:n,y:r},m=Nv(o),g=Av(m),v=await a.getDimensions(u),S=m==="y",y=S?"top":"left",b=S?"bottom":"right",x=S?"clientHeight":"clientWidth",w=i.reference[g]+i.reference[m]-h[m]-i.floating[g],j=h[m]-i.reference[m],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let C=E?E[x]:0;(!C||!await(a.isElement==null?void 0:a.isElement(E)))&&(C=l.floating[x]||i.floating[g]);const T=w/2-j/2,_=C/2-v[g]/2-1,P=nr(f[y],_),M=nr(f[b],_),D=P,N=C-v[g]-M,A=C/2-v[g]/2+T,L=$m(D,A,N),I=!c.arrow&&Ja(o)!=null&&A!==L&&i.reference[g]/2-(A<D?P:M)-v[g]/2<0,k=I?A<D?A-D:A-N:0;return{[m]:h[m]+k,data:{[m]:L,centerOffset:A-L-k,...I&&{alignmentOffset:k}},reset:I}}}),qN=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...S}=Mo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Hr(o),b=Hr(l)===l,x=await(c.isRTL==null?void 0:c.isRTL(u.floating)),w=h||(b||!v?[Ud(l)]:zN(l));!h&&g!=="none"&&w.push(...VN(l,v,g,x));const j=[l,...w],E=await Ov(t,S),C=[];let T=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&C.push(E[y]),f){const D=FN(o,a,x);C.push(E[D[0]],E[D[1]])}if(T=[...T,{placement:o,overflows:C}],!C.every(D=>D<=0)){var _,P;const D=(((_=i.flip)==null?void 0:_.index)||0)+1,N=j[D];if(N)return{data:{index:D,overflows:T},reset:{placement:N}};let A=(P=T.filter(L=>L.overflows[0]<=0).sort((L,I)=>L.overflows[1]-I.overflows[1])[0])==null?void 0:P.placement;if(!A)switch(m){case"bestFit":{var M;const L=(M=T.map(I=>[I.placement,I.overflows.filter(k=>k>0).reduce((k,R)=>k+R,0)]).sort((I,k)=>I[1]-k[1])[0])==null?void 0:M[0];L&&(A=L);break}case"initialPlacement":A=l;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function dE(e){const t=nr(...e.map(i=>i.left)),n=nr(...e.map(i=>i.top)),r=wn(...e.map(i=>i.right)),o=wn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function GN(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=>La(dE(o)))}const QN=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=Mo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=GN(d),h=La(dE(d)),m=Mv(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(S=>c>S.left-m.left&&c<S.right+m.right&&u>S.top-m.top&&u<S.bottom+m.bottom)||h;if(f.length>=2){if(ks(n)==="y"){const P=f[0],M=f[f.length-1],D=Hr(n)==="top",N=P.top,A=M.bottom,L=D?P.left:M.left,I=D?P.right:M.right,k=I-L,R=A-N;return{top:N,bottom:A,left:L,right:I,width:k,height:R,x:L,y:N}}const S=Hr(n)==="left",y=wn(...f.map(P=>P.right)),b=nr(...f.map(P=>P.left)),x=f.filter(P=>S?P.left===b:P.right===y),w=x[0].top,j=x[x.length-1].bottom,E=b,C=y,T=C-E,_=j-w;return{top:w,bottom:j,left:E,right:C,width:T,height:_,x:E,y:w}}return h}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:a});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 KN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Hr(n),l=Ja(n),c=ks(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,f=Mo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const YN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,c=await KN(t,e);return a===((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:a}}}}},XN=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:a=!1,limiter:l={fn:S=>{let{x:y,y:b}=S;return{x:y,y:b}}},...c}=Mo(e,t),u={x:n,y:r},d=await Ov(t,c),f=ks(Hr(o)),h=Iv(f);let m=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",y=h==="y"?"bottom":"right",b=m+d[S],x=m-d[y];m=$m(b,m,x)}if(a){const S=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=g+d[S],x=g-d[y];g=$m(b,g,x)}const v=l.fn({...t,[h]:m,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},JN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Mo(e,t),d={x:n,y:r},f=ks(o),h=Iv(f);let m=d[h],g=d[f];const v=Mo(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=h==="y"?"height":"width",w=i.reference[h]-i.floating[x]+S.mainAxis,j=i.reference[h]+i.reference[x]-S.mainAxis;m<w?m=w:m>j&&(m=j)}if(u){var y,b;const x=h==="y"?"width":"height",w=["top","left"].includes(Hr(o)),j=i.reference[f]-i.floating[x]+(w&&((y=a.offset)==null?void 0:y[f])||0)+(w?0:S.crossAxis),E=i.reference[f]+i.reference[x]+(w?0:((b=a.offset)==null?void 0:b[f])||0)-(w?S.crossAxis:0);g<j?g=j:g>E&&(g=E)}return{[h]:m,[f]:g}}}},ZN=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:a=()=>{},...l}=Mo(e,t),c=await Ov(t,l),u=Hr(n),d=Ja(n),f=ks(n)==="y",{width:h,height:m}=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=m-c.top-c.bottom,y=h-c.left-c.right,b=nr(m-c[g],S),x=nr(h-c[v],y),w=!t.middlewareData.shift;let j=b,E=x;if(f?E=d||w?nr(x,y):y:j=d||w?nr(b,S):S,w&&!d){const T=wn(c.left,0),_=wn(c.right,0),P=wn(c.top,0),M=wn(c.bottom,0);f?E=h-2*(T!==0||_!==0?T+_:wn(c.left,c.right)):j=m-2*(P!==0||M!==0?P+M:wn(c.top,c.bottom))}await a({...t,availableWidth:E,availableHeight:j});const C=await o.getDimensions(i.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}};function fE(e){const t=Er(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=sr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=Vd(n)!==i||Vd(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function $v(e){return _t(e)?e:e.contextElement}function Pa(e){const t=$v(e);if(!sr(t))return Ri(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fE(t);let a=(i?Vd(n.width):n.width)/r,l=(i?Vd(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const e4=Ri(0);function hE(e){const t=qn(e);return!Dv()||!t.visualViewport?e4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function t4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qn(e)?!1:t}function fs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=$v(e);let a=Ri(1);t&&(r?_t(r)&&(a=Pa(r)):a=Pa(e));const l=t4(i,n,r)?hE(i):Ri(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const h=qn(i),m=r&&_t(r)?qn(r):r;let g=h,v=g.frameElement;for(;v&&r&&m!==g;){const S=Pa(v),y=v.getBoundingClientRect(),b=Er(v),x=y.left+(v.clientLeft+parseFloat(b.paddingLeft))*S.x,w=y.top+(v.clientTop+parseFloat(b.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=x,u+=w,g=qn(v),v=g.frameElement}}return La({width:d,height:f,x:c,y:u})}const n4=[":popover-open",":modal"];function Lv(e){return n4.some(t=>{try{return e.matches(t)}catch{return!1}})}function r4(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Uo(r),l=t?Lv(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ri(1);const d=Ri(0),f=sr(r);if((f||!f&&!i)&&((Xa(r)!=="body"||Oc(a))&&(c=Nf(r)),sr(r))){const h=fs(r);u=Pa(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function o4(e){return Array.from(e.getClientRects())}function pE(e){return fs(Uo(e)).left+Nf(e).scrollLeft}function i4(e){const t=Uo(e),n=Nf(e),r=e.ownerDocument.body,o=wn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=wn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+pE(e);const l=-n.scrollTop;return Er(r).direction==="rtl"&&(a+=wn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function s4(e,t){const n=qn(e),r=Uo(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=Dv();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function a4(e,t){const n=fs(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=sr(e)?Pa(e):Ri(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:a,height:l,x:c,y:u}}function F1(e,t,n){let r;if(t==="viewport")r=s4(e,n);else if(t==="document")r=i4(Uo(e));else if(_t(t))r=a4(t,n);else{const o=hE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return La(r)}function mE(e,t){const n=No(e);return n===t||!_t(n)||ki(n)?!1:Er(n).position==="fixed"||mE(n,t)}function l4(e,t){const n=t.get(e);if(n)return n;let r=Po(e,[],!1).filter(l=>_t(l)&&Xa(l)!=="body"),o=null;const i=Er(e).position==="fixed";let a=i?No(e):e;for(;_t(a)&&!ki(a);){const l=Er(a),c=_v(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Oc(a)&&!c&&mE(e,a))?r=r.filter(d=>d!==a):o=l,a=No(a)}return t.set(e,r),r}function c4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Lv(t)?[]:l4(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((u,d)=>{const f=F1(t,d,o);return u.top=wn(f.top,u.top),u.right=nr(f.right,u.right),u.bottom=nr(f.bottom,u.bottom),u.left=wn(f.left,u.left),u},F1(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function u4(e){const{width:t,height:n}=fE(e);return{width:t,height:n}}function d4(e,t,n){const r=sr(t),o=Uo(t),i=n==="fixed",a=fs(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ri(0);if(r||!r&&!i)if((Xa(t)!=="body"||Oc(o))&&(l=Nf(t)),r){const f=fs(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=pE(o));const u=a.left+l.scrollLeft-c.x,d=a.top+l.scrollTop-c.y;return{x:u,y:d,width:a.width,height:a.height}}function gp(e){return Er(e).position==="static"}function z1(e,t){return!sr(e)||Er(e).position==="fixed"?null:t?t(e):e.offsetParent}function gE(e,t){const n=qn(e);if(Lv(e))return n;if(!sr(e)){let o=No(e);for(;o&&!ki(o);){if(_t(o)&&!gp(o))return o;o=No(o)}return n}let r=z1(e,t);for(;r&&PN(r)&&gp(r);)r=z1(r,t);return r&&ki(r)&&gp(r)&&!_v(r)?n:r||kN(e)||n}const f4=async function(e){const t=this.getOffsetParent||gE,n=this.getDimensions,r=await n(e.floating);return{reference:d4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function h4(e){return Er(e).direction==="rtl"}const p4={convertOffsetParentRelativeRectToViewportRelativeRect:r4,getDocumentElement:Uo,getClippingRect:c4,getOffsetParent:gE,getElementRects:f4,getClientRects:o4,getDimensions:u4,getScale:Pa,isElement:_t,isRTL:h4};function m4(e,t){let n=null,r;const o=Uo(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const m=Bu(d),g=Bu(o.clientWidth-(u+f)),v=Bu(o.clientHeight-(d+h)),S=Bu(u),b={rootMargin:-m+"px "+-g+"px "+-v+"px "+-S+"px",threshold:wn(0,nr(1,c))||1};let x=!0;function w(j){const E=j[0].intersectionRatio;if(E!==c){if(!x)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(w,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(w,b)}n.observe(e)}return a(!0),i}function g4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=$v(e),d=o||i?[...u?Po(u):[],...Po(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&l?m4(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,v=c?fs(e):null;c&&S();function S(){const y=fs(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(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const v4=YN,y4=XN,x4=qN,b4=ZN,B1=WN,w4=QN,S4=JN,j4=(e,t,n)=>{const r=new Map,o={platform:p4,...n},i={...o.platform,_c:r};return HN(e,t,{...o,platform:i})};var cd=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Hd(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(!Hd(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)&&!Hd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function vE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function V1(e,t){const n=vE(e);return Math.round(t*n)/n}function U1(e){const t=p.useRef(e);return cd(()=>{t.current=e}),t}function C4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);Hd(h,r)||m(r);const[g,v]=p.useState(null),[S,y]=p.useState(null),b=p.useCallback(k=>{k!==E.current&&(E.current=k,v(k))},[]),x=p.useCallback(k=>{k!==C.current&&(C.current=k,y(k))},[]),w=i||g,j=a||S,E=p.useRef(null),C=p.useRef(null),T=p.useRef(d),_=c!=null,P=U1(c),M=U1(o),D=p.useCallback(()=>{if(!E.current||!C.current)return;const k={placement:t,strategy:n,middleware:h};M.current&&(k.platform=M.current),j4(E.current,C.current,k).then(R=>{const $={...R,isPositioned:!0};N.current&&!Hd(T.current,$)&&(T.current=$,Mc.flushSync(()=>{f($)}))})},[h,t,n,M]);cd(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const N=p.useRef(!1);cd(()=>(N.current=!0,()=>{N.current=!1}),[]),cd(()=>{if(w&&(E.current=w),j&&(C.current=j),w&&j){if(P.current)return P.current(w,j,D);D()}},[w,j,D,P,_]);const A=p.useMemo(()=>({reference:E,floating:C,setReference:b,setFloating:x}),[b,x]),L=p.useMemo(()=>({reference:w,floating:j}),[w,j]),I=p.useMemo(()=>{const k={position:n,left:0,top:0};if(!L.floating)return k;const R=V1(L.floating,d.x),$=V1(L.floating,d.y);return l?{...k,transform:"translate("+R+"px, "+$+"px)",...vE(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:R,top:$}},[n,l,L.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:D,refs:A,elements:L,floatingStyles:I}),[d,D,A,L,I])}const E4=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):{}}}},yE=(e,t)=>({...v4(e),options:[e,t]}),Fv=(e,t)=>({...y4(e),options:[e,t]}),H1=(e,t)=>({...S4(e),options:[e,t]}),Fm=(e,t)=>({...x4(e),options:[e,t]}),T4=(e,t)=>({...b4(e),options:[e,t]}),zm=(e,t)=>({...w4(e),options:[e,t]}),xE=(e,t)=>({...E4(e),options:[e,t]}),bE={...hS},P4=bE.useInsertionEffect,k4=P4||(e=>e());function di(e){const t=p.useRef(()=>{});return k4(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var lo=typeof document<"u"?p.useLayoutEffect:p.useEffect;let W1=!1,R4=0;const q1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+R4++;function _4(){const[e,t]=p.useState(()=>W1?q1():void 0);return lo(()=>{e==null&&t(q1())},[]),p.useEffect(()=>{W1=!0},[]),e}const D4=bE.useId,wE=D4||_4;function I4(){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 A4=p.createContext(null),N4=p.createContext(null),zv=()=>{var e;return((e=p.useContext(A4))==null?void 0:e.id)||null},Bv=()=>p.useContext(N4);function Vv(e){return"data-floating-ui-"+e}function G1(e){const t=p.useRef(e);return lo(()=>{t.current=e}),t}const Q1=Vv("safe-polygon");function ud(e,t,n){return n&&!Om(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function M4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:a,floating:l}}=e,{enabled:c=!0,delay:u=0,handleClose:d=null,mouseOnly:f=!1,restMs:h=0,move:m=!0}=t,g=Bv(),v=zv(),S=G1(d),y=G1(u),b=p.useRef(),x=p.useRef(-1),w=p.useRef(),j=p.useRef(-1),E=p.useRef(!0),C=p.useRef(!1),T=p.useRef(()=>{}),_=p.useCallback(()=>{var N;const A=(N=o.current.openEvent)==null?void 0:N.type;return(A==null?void 0:A.includes("mouse"))&&A!=="mousedown"},[o]);p.useEffect(()=>{if(!c)return;function N(A){let{open:L}=A;L||(clearTimeout(x.current),clearTimeout(j.current),E.current=!0)}return i.on("openchange",N),()=>{i.off("openchange",N)}},[c,i]),p.useEffect(()=>{if(!c||!S.current||!n)return;function N(L){_()&&r(!1,L,"hover")}const A=es(l).documentElement;return A.addEventListener("mouseleave",N),()=>{A.removeEventListener("mouseleave",N)}},[l,n,r,c,S,_]);const P=p.useCallback(function(N,A,L){A===void 0&&(A=!0),L===void 0&&(L="hover");const I=ud(y.current,"close",b.current);I&&!w.current?(clearTimeout(x.current),x.current=window.setTimeout(()=>r(!1,N,L),I)):A&&(clearTimeout(x.current),r(!1,N,L))},[y,r]),M=di(()=>{T.current(),w.current=void 0}),D=di(()=>{if(C.current){const N=es(l).body;N.style.pointerEvents="",N.removeAttribute(Q1),C.current=!1}});return p.useEffect(()=>{if(!c)return;function N(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function A(k){if(clearTimeout(x.current),E.current=!1,f&&!Om(b.current)||h>0&&!ud(y.current,"open"))return;const R=ud(y.current,"open",b.current);R?x.current=window.setTimeout(()=>{r(!0,k,"hover")},R):r(!0,k,"hover")}function L(k){if(N())return;T.current();const R=es(l);if(clearTimeout(j.current),S.current&&o.current.floatingContext){n||clearTimeout(x.current),w.current=S.current({...o.current.floatingContext,tree:g,x:k.clientX,y:k.clientY,onClose(){D(),M(),P(k,!0,"safe-polygon")}});const B=w.current;R.addEventListener("mousemove",B),T.current=()=>{R.removeEventListener("mousemove",B)};return}(b.current==="touch"?!hc(l,k.relatedTarget):!0)&&P(k)}function I(k){N()||o.current.floatingContext&&(S.current==null||S.current({...o.current.floatingContext,tree:g,x:k.clientX,y:k.clientY,onClose(){D(),M(),P(k)}})(k))}if(_t(a)){const k=a;return n&&k.addEventListener("mouseleave",I),l==null||l.addEventListener("mouseleave",I),m&&k.addEventListener("mousemove",A,{once:!0}),k.addEventListener("mouseenter",A),k.addEventListener("mouseleave",L),()=>{n&&k.removeEventListener("mouseleave",I),l==null||l.removeEventListener("mouseleave",I),m&&k.removeEventListener("mousemove",A),k.removeEventListener("mouseenter",A),k.removeEventListener("mouseleave",L)}}},[a,l,c,e,f,h,m,P,M,D,r,n,g,y,S,o]),lo(()=>{var N;if(c&&n&&(N=S.current)!=null&&N.__options.blockPointerEvents&&_()){const L=es(l).body;if(L.setAttribute(Q1,""),L.style.pointerEvents="none",C.current=!0,_t(a)&&l){var A;const I=a,k=g==null||(A=g.nodesRef.current.find(R=>R.id===v))==null||(A=A.context)==null?void 0:A.elements.floating;return k&&(k.style.pointerEvents=""),I.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{I.style.pointerEvents="",l.style.pointerEvents=""}}}},[c,n,v,l,a,g,S,_]),lo(()=>{n||(b.current=void 0,M(),D())},[n,M,D]),p.useEffect(()=>()=>{M(),clearTimeout(x.current),clearTimeout(j.current),D()},[c,a,M,D]),p.useMemo(()=>{if(!c)return{};function N(A){b.current=A.pointerType}return{reference:{onPointerDown:N,onPointerEnter:N,onMouseMove(A){function L(){E.current||r(!0,A.nativeEvent,"hover")}f&&!Om(b.current)||n||h===0||(clearTimeout(j.current),b.current==="touch"?L():j.current=window.setTimeout(L,h))}},floating:{onMouseEnter(){clearTimeout(x.current)},onMouseLeave(A){P(A.nativeEvent,!1)}}}},[c,f,n,h,r,P])}const Bm=()=>{},SE=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Bm,setState:Bm,isInstantPhase:!1}),jE=()=>p.useContext(SE);function O4(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=p.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),a=p.useRef(null),l=p.useCallback(c=>{i({currentId:c})},[]);return lo(()=>{o.currentId?a.current===null?a.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),a.current=null)},[o.currentId,o.isInstantPhase]),p.createElement(SE.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)}function $4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i}=t,a=i??o,l=jE(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:h}=l;return lo(()=>{c&&(f({delay:{open:1,close:ud(d,"close")}}),c!==a&&r(!1))},[a,r,f,c,d]),lo(()=>{function m(){r(!1),f({delay:d,currentId:null})}if(c&&!n&&c===a){if(h){const g=window.setTimeout(m,h);return()=>{clearTimeout(g)}}m()}},[n,f,c,a,r,d,h]),lo(()=>{u===Bm||!n||u(a)},[n,u,a]),l}function vp(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(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}const L4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},F4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},K1=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 z4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:{reference:o,domReference:i,floating:a},dataRef:l}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f="pointerdown",referencePress:h=!1,referencePressEvent:m="pointerdown",ancestorScroll:g=!1,bubbles:v,capture:S}=t,y=Bv(),b=di(typeof d=="function"?d:()=>!1),x=typeof d=="function"?b:d,w=p.useRef(!1),j=p.useRef(!1),{escapeKey:E,outsidePress:C}=K1(v),{escapeKey:T,outsidePress:_}=K1(S),P=di(A=>{var L;if(!n||!c||!u||A.key!=="Escape")return;const I=(L=l.current.floatingContext)==null?void 0:L.nodeId,k=y?vp(y.nodesRef.current,I):[];if(!E&&(A.stopPropagation(),k.length>0)){let R=!0;if(k.forEach($=>{var B;if((B=$.context)!=null&&B.open&&!$.context.dataRef.current.__escapeKeyBubbles){R=!1;return}}),!R)return}r(!1,AN(A)?A.nativeEvent:A,"escape-key")}),M=di(A=>{var L;const I=()=>{var k;P(A),(k=na(A))==null||k.removeEventListener("keydown",I)};(L=na(A))==null||L.addEventListener("keydown",I)}),D=di(A=>{var L;const I=w.current;w.current=!1;const k=j.current;if(j.current=!1,f==="click"&&k||I||typeof x=="function"&&!x(A))return;const R=na(A),$="["+Vv("inert")+"]",B=es(a).querySelectorAll($);let H=_t(R)?R:null;for(;H&&!ki(H);){const be=No(H);if(ki(be)||!_t(be))break;H=be}if(B.length&&_t(R)&&!NN(R)&&!hc(R,a)&&Array.from(B).every(be=>!hc(H,be)))return;if(sr(R)&&a){const be=R.clientWidth>0&&R.scrollWidth>R.clientWidth,ke=R.clientHeight>0&&R.scrollHeight>R.clientHeight;let Ce=ke&&A.offsetX>R.clientWidth;if(ke&&Er(R).direction==="rtl"&&(Ce=A.offsetX<=R.offsetWidth-R.clientWidth),Ce||be&&A.offsetY>R.clientHeight)return}const X=(L=l.current.floatingContext)==null?void 0:L.nodeId,ye=y&&vp(y.nodesRef.current,X).some(be=>{var ke;return mp(A,(ke=be.context)==null?void 0:ke.elements.floating)});if(mp(A,a)||mp(A,i)||ye)return;const he=y?vp(y.nodesRef.current,X):[];if(he.length>0){let be=!0;if(he.forEach(ke=>{var Ce;if((Ce=ke.context)!=null&&Ce.open&&!ke.context.dataRef.current.__outsidePressBubbles){be=!1;return}}),!be)return}r(!1,A,"outside-press")}),N=di(A=>{var L;const I=()=>{var k;D(A),(k=na(A))==null||k.removeEventListener(f,I)};(L=na(A))==null||L.addEventListener(f,I)});return p.useEffect(()=>{if(!n||!c)return;l.current.__escapeKeyBubbles=E,l.current.__outsidePressBubbles=C;function A(k){r(!1,k,"ancestor-scroll")}const L=es(a);u&&L.addEventListener("keydown",T?M:P,T),x&&L.addEventListener(f,_?N:D,_);let I=[];return g&&(_t(i)&&(I=Po(i)),_t(a)&&(I=I.concat(Po(a))),!_t(o)&&o&&o.contextElement&&(I=I.concat(Po(o.contextElement)))),I=I.filter(k=>{var R;return k!==((R=L.defaultView)==null?void 0:R.visualViewport)}),I.forEach(k=>{k.addEventListener("scroll",A,{passive:!0})}),()=>{u&&L.removeEventListener("keydown",T?M:P,T),x&&L.removeEventListener(f,_?N:D,_),I.forEach(k=>{k.removeEventListener("scroll",A)})}},[l,a,i,o,u,x,f,n,r,g,c,E,C,P,T,M,D,_,N]),p.useEffect(()=>{w.current=!1},[x,f]),p.useMemo(()=>c?{reference:{onKeyDown:P,[L4[m]]:A=>{h&&r(!1,A.nativeEvent,"reference-press")}},floating:{onKeyDown:P,onMouseDown(){j.current=!0},onMouseUp(){j.current=!0},[F4[f]]:()=>{w.current=!0}}}:{},[c,h,f,m,r,P])}function B4(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=wE(),i=p.useRef({}),[a]=p.useState(()=>I4()),l=zv()!=null,[c,u]=p.useState(r.reference),d=di((m,g,v)=>{i.current.openEvent=m?g:void 0,a.emit("openchange",{open:m,event:g,reason:v,nested:l}),n==null||n(m,g,v)}),f=p.useMemo(()=>({setPositionReference:u}),[]),h=p.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return p.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:a,floatingId:o,refs:f}),[t,d,h,a,o,f])}function Uv(e){e===void 0&&(e={});const{nodeId:t}=e,n=B4({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=p.useState(null),[l,c]=p.useState(null),d=(o==null?void 0:o.reference)||i,f=p.useRef(null),h=Bv();lo(()=>{d&&(f.current=d)},[d]);const m=C4({...e,elements:{...o,...l&&{reference:l}}}),g=p.useCallback(x=>{const w=_t(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(w),m.refs.setReference(w)},[m.refs]),v=p.useCallback(x=>{(_t(x)||x===null)&&(f.current=x,a(x)),(_t(m.refs.reference.current)||m.refs.reference.current===null||x!==null&&!_t(x))&&m.refs.setReference(x)},[m.refs]),S=p.useMemo(()=>({...m.refs,setReference:v,setPositionReference:g,domReference:f}),[m.refs,v,g]),y=p.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),b=p.useMemo(()=>({...m,...r,refs:S,elements:y,nodeId:t}),[m,S,y,t,r]);return lo(()=>{r.dataRef.current.floatingContext=b;const x=h==null?void 0:h.nodesRef.current.find(w=>w.id===t);x&&(x.context=b)}),p.useMemo(()=>({...m,context:b,refs:S,elements:y}),[m,S,y,b])}function V4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:{domReference:a}}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=p.useRef(!1),d=p.useRef(),f=p.useRef(!0);return p.useEffect(()=>{if(!l)return;const h=qn(a);function m(){!n&&sr(a)&&a===O1(es(a))&&(u.current=!0)}function g(){f.current=!0}return h.addEventListener("blur",m),h.addEventListener("keydown",g,!0),()=>{h.removeEventListener("blur",m),h.removeEventListener("keydown",g,!0)}},[a,n,l]),p.useEffect(()=>{if(!l)return;function h(m){let{reason:g}=m;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,l]),p.useEffect(()=>()=>{clearTimeout(d.current)},[]),p.useMemo(()=>l?{reference:{onPointerDown(h){RN(h.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const m=na(h.nativeEvent);if(c&&_t(m))try{if(_N()&&DN())throw Error();if(!m.matches(":focus-visible"))return}catch{if(!f.current&&!ON(m))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const m=h.relatedTarget,g=_t(m)&&m.hasAttribute(Vv("focus-guard"))&&m.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var v;const S=O1(a?a.ownerDocument:document);!m&&S===a||hc((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,S)||hc(a,S)||g||r(!1,h.nativeEvent,"focus")})}}}:{},[l,c,i,a,r])}const Y1="active",X1="selected";function yp(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Y1]:a,[X1]:l,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(o&&[Y1,X1].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),a[u]=function(){for(var h,m=arguments.length,g=new Array(m),v=0;v<m;v++)g[v]=arguments[v];return(h=r.get(u))==null?void 0:h.map(S=>S(...g)).find(S=>S!==void 0)}}}else a[u]=d}),a),{})}}function U4(e){e===void 0&&(e=[]);const t=e,n=p.useCallback(i=>yp(i,e,"reference"),t),r=p.useCallback(i=>yp(i,e,"floating"),t),o=p.useCallback(i=>yp(i,e,"item"),e.map(i=>i==null?void 0:i.item));return p.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const H4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function W4(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=(n=H4.get(a))!=null?n:a,c=wE(),d=zv()!=null;return p.useMemo(()=>{if(!i)return{};const f={id:o,...l&&{role:l}};return l==="tooltip"||a==="label"?{reference:{["aria-"+(a==="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"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},floating:{...f,...l==="menu"&&{"aria-labelledby":c}},item(h){let{active:m,selected:g}=h;const v={role:"option",...m&&{id:o+"-option"}};switch(a){case"select":return{...v,"aria-selected":m&&g};case"combobox":return{...v,...m&&{"aria-selected":!0}}}return{}}}},[i,a,l,r,o,c,d])}function CE(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 J1(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function Z1(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 q4={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function G4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:F(t),height:F(t),transform:"rotate(45deg)",position:"absolute",[q4[c]]:F(r)},f=F(-t/2);return c==="left"?{...d,...J1(u,a,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...J1(u,a,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...Z1(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...Z1(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const Hv=p.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:a,arrowY:l,style:c,...u},d)=>{const{dir:f}=Es();return i?s.jsx("div",{...u,ref:d,style:{...c,...G4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:a,arrowY:l})}}):null});Hv.displayName="@mantine/core/FloatingArrow";const[Q4,EE]=On("Popover component was not found in the tree");function Mf({children:e,active:t=!0,refProp:n="ref"}){const r=$_(t),o=Qt(r,e==null?void 0:e.ref);return Fo(e)?p.cloneElement(e,{[n]:o}):e}function TE(e){return s.jsx(Rv,{tabIndex:-1,"data-autofocus":!0,...e})}Mf.displayName="@mantine/core/FocusTrap";TE.displayName="@mantine/core/FocusTrapInitialFocus";Mf.InitialFocus=TE;function K4(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 Y4={},PE=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=V("Portal",Y4,e),[i,a]=p.useState(!1),l=p.useRef(null);return Qa(()=>(a(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:K4(o),pf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:Mc.createPortal(s.jsx(s.Fragment,{children:n}),l.current)});PE.displayName="@mantine/core/Portal";function Rs({withinPortal:e=!0,children:t,...n}){return e?s.jsx(PE,{...n,children:t}):s.jsx(s.Fragment,{children:t})}Rs.displayName="@mantine/core/OptionalPortal";const jl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${F(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),Vu={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${F(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${F(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${F(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${F(-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(${F(-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(${F(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(${F(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${F(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:{...jl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...jl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...jl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...jl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...jl("top"),common:{transformOrigin:"top right"}}},eb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function X4({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Vu?{transitionProperty:Vu[e].transitionProperty,...o,...Vu[e].common,...Vu[e][eb[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[eb[t]]}}function J4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:l}){const c=It(),u=Dg(),d=c.respectReducedMotion?u:!1,[f,h]=p.useState(d?0:e),[m,g]=p.useState(r?"entered":"exited"),v=p.useRef(-1),S=p.useRef(-1),y=b=>{const x=b?o:i,w=b?a:l;window.clearTimeout(v.current);const j=d?0:b?e:t;h(j),j===0?(typeof x=="function"&&x(),typeof w=="function"&&w(),g(b?"entered":"exited")):S.current=requestAnimationFrame(()=>{ga.flushSync(()=>{g(b?"pre-entering":"pre-exiting")}),S.current=requestAnimationFrame(()=>{typeof x=="function"&&x(),g(b?"entering":"exiting"),v.current=window.setTimeout(()=>{typeof w=="function"&&w(),g(b?"entered":"exited")},j)})})};return Ro(()=>{y(r)},[r]),p.useEffect(()=>()=>{window.clearTimeout(v.current),cancelAnimationFrame(S.current)},[]),{transitionDuration:f,transitionStatus:m,transitionTimingFunction:n||"ease"}}function Ho({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:a="ease",onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:f,transitionStatus:h,transitionTimingFunction:m}=J4({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d});return f===0?o?s.jsx(s.Fragment,{children:i({})}):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:s.jsx(s.Fragment,{children:i(X4({transition:t,duration:f,state:h,timingFunction:m}))})}Ho.displayName="@mantine/core/Transition";var kE={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const Z4={},Wv=K((e,t)=>{var S,y,b,x;const n=V("PopoverDropdown",Z4,e),{className:r,style:o,vars:i,children:a,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=EE(),m=kS({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=Qt(t,h.floating);return h.disabled?null:s.jsx(Rs,{...h.portalProps,withinPortal:h.withinPortal,children:s.jsx(Ho,{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((b=h.transitionProps)==null?void 0:b.exitDuration)=="number"?h.transitionProps.exitDuration:(x=h.transitionProps)==null?void 0:x.duration,children:w=>s.jsx(Mf,{active:h.trapFocus,children:s.jsxs(W,{...g,...f,variant:c,ref:v,onKeyDownCapture:C_(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...w,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:F(h.width)},o]}),children:[a,s.jsx(Hv,{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})})]})})})})});Wv.classes=kE;Wv.displayName="@mantine/core/PopoverDropdown";const e3={refProp:"ref",popupType:"dialog"},RE=K((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=V("PopoverTarget",e3,e);if(!Fo(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 a=i,l=EE(),c=Qt(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return p.cloneElement(n,{...a,...u,...l.targetProps,className:nt(l.targetProps.className,a.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});RE.displayName="@mantine/core/PopoverTarget";function _E({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return g4(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Ro(()=>{t.update()},r),Ro(()=>{i(a=>a+1)},[e])}function t3(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 n3(e,t){const n=t3(e.middlewares),r=[yE(e.offset)];return n.shift&&r.push(Fv(typeof n.shift=="boolean"?{limiter:H1(),padding:5}:{limiter:H1(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Fm():Fm(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?zm():zm(n.inline)),r.push(xE({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(T4({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:a}){var u;const c=((u=t().refs.floating.current)==null?void 0:u.style)??{};n.size&&Object.assign(c,{maxWidth:`${i}px`,maxHeight:`${a}px`}),e.width==="target"&&Object.assign(c,{width:`${o.reference.width}px`})}})),r}function r3(e){const[t,n]=pn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var a;t&&((a=e.onClose)==null||a.call(e),n(!1))},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},i=Uv({strategy:e.strategy,placement:e.position,middleware:n3(e,()=>i)});return _E({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Ro(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),Ro(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const o3={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:Gr("popover"),__staticSelector:"Popover",width:"max-content"},i3=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:ot(t),"--popover-shadow":kg(n)}});function Qr(e){var Se,qe,Ke,Le,Y,G;const t=V("Popover",o3,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:a,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,unstyled:S,classNames:y,styles:b,closeOnClickOutside:x,withinPortal:w,portalProps:j,closeOnEscape:E,clickOutsideEvents:C,trapFocus:T,onClose:_,onOpen:P,onChange:M,zIndex:D,radius:N,shadow:A,id:L,defaultOpened:I,__staticSelector:k,withRoles:R,disabled:$,returnFocus:B,variant:H,keepMounted:X,vars:ye,floatingStrategy:he,...be}=t,ke=le({name:k,props:t,classes:kE,classNames:y,styles:b,unstyled:S,rootSelector:"dropdown",vars:ye,varsResolver:i3}),Ce=p.useRef(null),[se,Ve]=p.useState(null),[ut,lt]=p.useState(null),{dir:We}=Es(),Ee=$n(L),Pe=r3({middlewares:d,width:u,position:CE(We,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:Ce,arrowOffset:m,onPositionChange:i,positionDependencies:a,opened:l,defaultOpened:I,onChange:M,onOpen:P,onClose:_,strategy:he});P_(()=>x&&Pe.onClose(),C,[se,ut]);const ee=p.useCallback(pe=>{Ve(pe),Pe.floating.refs.setReference(pe)},[Pe.floating.refs.setReference]),ne=p.useCallback(pe=>{lt(pe),Pe.floating.refs.setFloating(pe)},[Pe.floating.refs.setFloating]);return s.jsx(Q4,{value:{returnFocus:B,disabled:$,controlled:Pe.controlled,reference:ee,floating:ne,x:Pe.floating.x,y:Pe.floating.y,arrowX:(Ke=(qe=(Se=Pe.floating)==null?void 0:Se.middlewareData)==null?void 0:qe.arrow)==null?void 0:Ke.x,arrowY:(G=(Y=(Le=Pe.floating)==null?void 0:Le.middlewareData)==null?void 0:Y.arrow)==null?void 0:G.y,opened:Pe.opened,arrowRef:Ce,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,placement:Pe.floating.placement,trapFocus:T,withinPortal:w,portalProps:j,zIndex:D,radius:N,shadow:A,closeOnEscape:E,onClose:Pe.onClose,onToggle:Pe.onToggle,getTargetId:()=>`${Ee}-target`,getDropdownId:()=>`${Ee}-dropdown`,withRoles:R,targetProps:be,__staticSelector:k,classNames:y,styles:b,unstyled:S,variant:H,keepMounted:X,getStyles:ke},children:n})}Qr.Target=RE;Qr.Dropdown=Wv;Qr.displayName="@mantine/core/Popover";Qr.extend=e=>e;var Fr={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 s3=p.forwardRef(({className:e,...t},n)=>s.jsxs(W,{component:"span",className:nt(Fr.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Fr.bar}),s.jsx("span",{className:Fr.bar}),s.jsx("span",{className:Fr.bar})]})),a3=p.forwardRef(({className:e,...t},n)=>s.jsxs(W,{component:"span",className:nt(Fr.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Fr.dot}),s.jsx("span",{className:Fr.dot}),s.jsx("span",{className:Fr.dot})]})),l3=p.forwardRef(({className:e,...t},n)=>s.jsx(W,{component:"span",className:nt(Fr.ovalLoader,e),...t,ref:n})),DE={bars:s3,oval:l3,dots:a3},c3={loaders:DE,type:"oval"},u3=(e,{size:t,color:n})=>({root:{"--loader-size":_e(t,"loader-size"),"--loader-color":n?rt(n,e):void 0}}),Qn=K((e,t)=>{const n=V("Loader",c3,e),{size:r,color:o,type:i,vars:a,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:m,children:g,...v}=n,S=le({name:"Loader",props:n,classes:Fr,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:a,varsResolver:u3});return g?s.jsx(W,{...S("root"),ref:t,...v,children:g}):s.jsx(W,{...S("root"),ref:t,component:h[i],variant:m,size:r,...v})});Qn.defaultLoaders=DE;Qn.classes=Fr;Qn.displayName="@mantine/core/Loader";var Of={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const tb={orientation:"horizontal"},d3=(e,{borderWidth:t})=>({group:{"--ai-border-width":F(t)}}),qv=K((e,t)=>{const n=V("ActionIconGroup",tb,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=V("ActionIconGroup",tb,e),g=le({name:"ActionIconGroup",props:n,classes:Of,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:d3,rootSelector:"group"});return s.jsx(W,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});qv.classes=Of;qv.displayName="@mantine/core/ActionIconGroup";const f3={},h3=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:a});return{root:{"--ai-size":_e(t,"ai-size"),"--ai-radius":n===void 0?void 0:ot(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}}},tn=Cn((e,t)=>{const n=V("ActionIcon",f3,e),{className:r,unstyled:o,variant:i,classNames:a,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:m,__staticSelector:g,gradient:v,vars:S,children:y,disabled:b,"data-disabled":x,autoContrast:w,mod:j,...E}=n,C=le({name:["ActionIcon",g],props:n,className:r,style:c,classes:Of,classNames:a,styles:l,unstyled:o,vars:S,varsResolver:h3});return s.jsxs(gn,{...C("root",{active:!b&&!u&&!x}),...E,unstyled:o,variant:i,size:f,disabled:b||u,ref:t,mod:[{loading:u,disabled:b||x},j],children:[s.jsx(Ho,{mounted:!!u,transition:"slide-down",duration:150,children:T=>s.jsx(W,{component:"span",...C("loader",{style:T}),"aria-hidden":!0,children:s.jsx(Qn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})})}),s.jsx(W,{component:"span",mod:{loading:u},...C("icon"),children:y})]})});tn.classes=Of;tn.displayName="@mantine/core/ActionIcon";tn.Group=qv;const IE=p.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:s.jsx("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"})}));IE.displayName="@mantine/core/CloseIcon";var AE={root:"m_86a44da5","root--subtle":"m_220c80f2"};const p3={variant:"subtle"},m3=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":_e(t,"cb-size"),"--cb-radius":n===void 0?void 0:ot(n),"--cb-icon-size":F(r)}}),_s=Cn((e,t)=>{const n=V("CloseButton",p3,e),{iconSize:r,children:o,vars:i,radius:a,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:m,variant:g,icon:v,mod:S,...y}=n,b=le({name:"CloseButton",props:n,className:l,style:u,classes:AE,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:m3});return s.jsxs(gn,{ref:t,...y,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},S],...b("root",{variant:g,active:!m&&!h}),children:[v||s.jsx(IE,{}),o]})});_s.classes=AE;_s.displayName="@mantine/core/CloseButton";function g3(e){return p.Children.toArray(e).filter(Boolean)}var NE={root:"m_4081bf90"};const v3={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},y3=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:a},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":Wt(r),"--group-align":o,"--group-justify":i,"--group-wrap":a}}),Z=K((e,t)=>{const n=V("Group",v3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:m,preventGrowOverflow:g,vars:v,variant:S,__size:y,mod:b,...x}=n,w=g3(c),j=w.length,E=Wt(u??"md"),T={childWidth:`calc(${100/j}% - (${E} - ${E} / ${j}))`},_=le({name:"Group",props:n,stylesCtx:T,className:o,style:i,classes:NE,classNames:r,styles:a,unstyled:l,vars:v,varsResolver:y3});return s.jsx(W,{..._("root"),ref:t,variant:S,mod:[{grow:m},b],size:y,...x,children:w})});Z.classes=NE;Z.displayName="@mantine/core/Group";var ME={root:"m_9814e45f"};const x3={zIndex:Gr("modal")},b3=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:a})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&pr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${F(o)})`:void 0,"--overlay-radius":i===void 0?void 0:ot(i),"--overlay-z-index":a==null?void 0:a.toString()}}),pc=Cn((e,t)=>{const n=V("Overlay",x3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:m,gradient:g,blur:v,color:S,backgroundOpacity:y,mod:b,...x}=n,w=le({name:"Overlay",props:n,classes:ME,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:b3});return s.jsx(W,{ref:t,...w("root"),mod:[{center:d,fixed:u},b],...x,children:f})});pc.classes=ME;pc.displayName="@mantine/core/Overlay";const[w3,Wo]=On("ModalBase component was not found in tree");function S3({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),a=Dg()?0:t;return p.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):a===0?r(!1):o.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(o.current)),[e,a]),n}function j3({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:a}){const l=$n(e),[c,u]=p.useState(!1),[d,f]=p.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,m=S3({opened:n,transitionDuration:h});return IS("keydown",g=>{var v;g.key==="Escape"&&o&&n&&((v=g.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),kS({opened:n,shouldReturnFocus:r&&a}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const C3=p.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,trapFocus:i,closeOnEscape:a,returnFocus:l,closeOnClickOutside:c,withinPortal:u,portalProps:d,lockScroll:f,children:h,zIndex:m,shadow:g,padding:v,__vars:S,unstyled:y,removeScrollProps:b,...x},w)=>{const{_id:j,titleMounted:E,bodyMounted:C,shouldLockScroll:T,setTitleMounted:_,setBodyMounted:P}=j3({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:a,onClose:n,returnFocus:l});return s.jsx(Rs,{...d,withinPortal:u,children:s.jsx(w3,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${j}-title`,getBodyId:()=>`${j}-body`,titleMounted:E,bodyMounted:C,setTitleMounted:_,setBodyMounted:P,trapFocus:i,closeOnEscape:a,zIndex:m,unstyled:y},children:s.jsx(ff,{enabled:T&&f,...b,children:s.jsx(W,{ref:w,...x,__vars:{...S,"--mb-z-index":(m||Gr("modal")).toString(),"--mb-shadow":kg(g),"--mb-padding":Wt(v)},children:h})})})})});function E3(){const e=Wo();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Fa={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const OE=p.forwardRef(({className:e,...t},n)=>{const r=E3(),o=Wo();return s.jsx(W,{ref:n,...t,id:r,className:nt({[Fa.body]:!o.unstyled},e)})});OE.displayName="@mantine/core/ModalBaseBody";const $E=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Wo();return s.jsx(_s,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:nt({[Fa.close]:!o.unstyled},e),unstyled:o.unstyled})});$E.displayName="@mantine/core/ModalBaseCloseButton";const T3=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},a)=>{const l=Wo();return s.jsx(Ho,{mounted:l.opened,transition:"pop",...l.transitionProps,...e,children:c=>s.jsx("div",{...n,className:nt({[Fa.inner]:!l.unstyled},n.className),children:s.jsx(Mf,{active:l.opened&&l.trapFocus,children:s.jsx(Wn,{...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:a,style:[o,c],className:nt({[Fa.content]:!l.unstyled},t),unstyled:l.unstyled,children:i.children})})})})}),LE=p.forwardRef(({className:e,...t},n)=>{const r=Wo();return s.jsx(W,{component:"header",ref:n,className:nt({[Fa.header]:!r.unstyled},e),...t})});LE.displayName="@mantine/core/ModalBaseHeader";const P3={duration:200,timingFunction:"ease",transition:"fade"};function k3(e){const t=Wo();return{...P3,...t.transitionProps,...e}}const FE=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Wo(),a=k3(t);return s.jsx(Ho,{mounted:i.opened,...a,transition:"fade",children:l=>s.jsx(pc,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r})})});FE.displayName="@mantine/core/ModalBaseOverlay";function R3(){const e=Wo();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const zE=p.forwardRef(({className:e,...t},n)=>{const r=R3(),o=Wo();return s.jsx(W,{component:"h2",ref:n,className:nt({[Fa.title]:!o.unstyled},e),...t,id:r})});zE.displayName="@mantine/core/ModalBaseTitle";function _3({children:e}){return s.jsx(s.Fragment,{children:e})}const[D3,Za]=Ss({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var kr={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 nb={},I3=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${sn(t)} - ${F(2)})`}}),$f=K((e,t)=>{const n=V("InputDescription",nb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=V("InputDescription",nb,n),g=Za(),v=le({name:["InputWrapper",d],props:n,classes:kr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"description",vars:c,varsResolver:I3}),S=f&&(g==null?void 0:g.getStyles)||v;return s.jsx(W,{component:"p",ref:t,variant:h,size:u,...S("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...m})});$f.classes=kr;$f.displayName="@mantine/core/InputDescription";const A3={},N3=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${sn(t)} - ${F(2)})`}}),Lf=K((e,t)=>{const n=V("InputError",A3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=n,g=le({name:["InputWrapper",d],props:n,classes:kr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"error",vars:c,varsResolver:N3}),v=Za(),S=f&&(v==null?void 0:v.getStyles)||g;return s.jsx(W,{component:"p",ref:t,variant:h,size:u,...S("error",v!=null&&v.getStyles?{className:o,style:i}:void 0),...m})});Lf.classes=kr;Lf.displayName="@mantine/core/InputError";const rb={labelElement:"label"},M3=(e,{size:t})=>({label:{"--input-label-size":sn(t),"--input-asterisk-color":void 0}}),Ff=K((e,t)=>{const n=V("InputLabel",rb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:m,children:g,__staticSelector:v,variant:S,mod:y,...b}=V("InputLabel",rb,n),x=le({name:["InputWrapper",v],props:n,classes:kr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"label",vars:c,varsResolver:M3}),w=Za(),j=(w==null?void 0:w.getStyles)||x;return s.jsxs(W,{...j("label",w!=null&&w.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=>{m==null||m(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...b,children:[g,f&&s.jsx("span",{...j("required"),"aria-hidden":!0,children:" *"})]})});Ff.classes=kr;Ff.displayName="@mantine/core/InputLabel";const ob={},Gv=K((e,t)=>{const n=V("InputPlaceholder",ob,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=V("InputPlaceholder",ob,n),g=le({name:["InputPlaceholder",u],props:n,classes:kr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"placeholder"});return s.jsx(W,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...m})});Gv.classes=kr;Gv.displayName="@mantine/core/InputPlaceholder";function O3(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e.slice(0,r),i=e.slice(r+1),a=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:a}}const $3={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},L3=(e,{size:t})=>({label:{"--input-label-size":sn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${sn(t)} - ${F(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${sn(t)} - ${F(2)})`}}),Qv=K((e,t)=>{const n=V("InputWrapper",$3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:m,label:g,error:v,description:S,labelProps:y,descriptionProps:b,errorProps:x,labelElement:w,children:j,withAsterisk:E,id:C,required:T,__stylesApiProps:_,mod:P,...M}=n,D=le({name:["InputWrapper",f],props:_||n,classes:kr,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:L3}),N={size:u,variant:d,__staticSelector:f},A=$n(C),L=typeof E=="boolean"?E:T,I=(x==null?void 0:x.id)||`${A}-error`,k=(b==null?void 0:b.id)||`${A}-description`,R=A,$=!!v&&typeof v!="boolean",B=!!S,H=`${$?I:""} ${B?k:""}`,X=H.trim().length>0?H.trim():void 0,ye=(y==null?void 0:y.id)||`${A}-label`,he=g&&s.jsx(Ff,{labelElement:w,id:ye,htmlFor:R,required:L,...N,...y,children:g},"label"),be=B&&s.jsx($f,{...b,...N,size:(b==null?void 0:b.size)||N.size,id:(b==null?void 0:b.id)||k,children:S},"description"),ke=s.jsx(p.Fragment,{children:h(j)},"input"),Ce=$&&p.createElement(Lf,{...x,...N,size:(x==null?void 0:x.size)||N.size,key:"error",id:(x==null?void 0:x.id)||I},v),se=m.map(Ve=>{switch(Ve){case"label":return he;case"input":return ke;case"description":return be;case"error":return Ce;default:return null}});return s.jsx(D3,{value:{getStyles:D,describedBy:X,inputId:R,labelId:ye,...O3(m,{hasDescription:B,hasError:$})},children:s.jsx(W,{ref:t,variant:d,size:u,mod:[{error:!!v},P],...D("root"),...M,children:se})})});Qv.classes=kr;Qv.displayName="@mantine/core/InputWrapper";const F3={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},z3=(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":_e(t.size,"input-height"),"--input-fz":sn(t.size),"--input-radius":t.radius===void 0?void 0:ot(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?F(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?F(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?_e(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Dt=Cn((e,t)=>{const n=V("Input",F3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:m,disabled:g,leftSection:v,leftSectionProps:S,leftSectionWidth:y,rightSection:b,rightSectionProps:x,rightSectionWidth:w,rightSectionPointerEvents:j,leftSectionPointerEvents:E,variant:C,vars:T,pointer:_,multiline:P,radius:M,id:D,withAria:N,withErrorStyles:A,mod:L,...I}=n,{styleProps:k,rest:R}=Bo(I),$=Za(),B={offsetBottom:$==null?void 0:$.offsetBottom,offsetTop:$==null?void 0:$.offsetTop},H=le({name:["Input",u],props:d||n,classes:kr,className:o,style:i,classNames:r,styles:a,unstyled:l,stylesCtx:B,rootSelector:"wrapper",vars:T,varsResolver:z3}),X=N?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":$==null?void 0:$.describedBy,id:($==null?void 0:$.inputId)||D}:{};return s.jsxs(W,{...H("wrapper"),...k,...h,mod:[{error:!!m&&A,pointer:_,disabled:g,multiline:P,"data-with-right-section":!!b,"data-with-left-section":!!v},L],variant:C,size:f,children:[v&&s.jsx("div",{...S,"data-position":"left",...H("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),children:v}),s.jsx(W,{component:"input",...R,...X,ref:t,required:c,mod:{disabled:g,error:!!m&&A},variant:C,...H("input")}),b&&s.jsx("div",{...x,"data-position":"right",...H("section",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),children:b})]})});Dt.classes=kr;Dt.Wrapper=Qv;Dt.Label=Ff;Dt.Error=Lf;Dt.Description=$f;Dt.Placeholder=Gv;Dt.displayName="@mantine/core/Input";function B3(e,t,n){const r=V(e,t,n),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:m,errorProps:g,labelProps:v,descriptionProps:S,wrapperProps:y,id:b,size:x,style:w,inputContainer:j,inputWrapperOrder:E,withAsterisk:C,variant:T,vars:_,mod:P,...M}=r,{styleProps:D,rest:N}=Bo(M),A={label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:m||r,errorProps:g,labelProps:v,descriptionProps:S,unstyled:f,styles:u,size:x,style:w,inputContainer:j,inputWrapperOrder:E,withAsterisk:C,variant:T,id:b,mod:P,...y};return{...N,classNames:c,styles:u,unstyled:f,wrapperProps:{...A,...D},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:x,__staticSelector:h,__stylesApiProps:m||r,error:a,variant:T,id:b}}}const V3={__staticSelector:"InputBase",withAria:!0},Xn=Cn((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=B3("InputBase",V3,e);return s.jsx(Dt.Wrapper,{...r,children:s.jsx(Dt,{...n,...o,ref:t})})});Xn.classes={...Dt.classes,...Dt.Wrapper.classes};Xn.displayName="@mantine/core/InputBase";const U3={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 BE={root:"m_8bffd616"};const H3={},hs=Cn((e,t)=>{const n=V("Flex",H3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v,...S}=n,y=le({name:"Flex",classes:BE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),b=It(),x=_c(),w=zS({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v},theme:b,data:U3});return s.jsxs(s.Fragment,{children:[w.hasResponsiveStyles&&s.jsx(Cs,{selector:`.${x}`,styles:w.styles,media:w.media}),s.jsx(W,{ref:t,...y("root",{className:x,style:Ii(w.inlineStyles)}),...S})]})});hs.classes=BE;hs.displayName="@mantine/core/Flex";function W3(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 q3({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=p.useRef(),[i,a]=p.useState(!1),[l,c]=p.useState(typeof r=="boolean"?r:!1),u=()=>{if(!e||!t)return;const m=e.getBoundingClientRect(),g=t.getBoundingClientRect(),v={top:m.top-g.top,left:m.left-g.left,width:m.width,height:m.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=p.useRef(),h=p.useRef();return p.useEffect(()=>{if(u(),e)return f.current=new ResizeObserver(d),f.current.observe(e),t&&(h.current=new ResizeObserver(d),h.current.observe(t)),()=>{var m,g;(m=f.current)==null||m.disconnect(),(g=h.current)==null||g.disconnect()}},[t,e]),p.useEffect(()=>{if(t){const m=g=>{W3(g.target,t)&&(d(),c(!1))};return document.addEventListener("transitionend",m),()=>{document.removeEventListener("transitionend",m)}}},[t]),H_(()=>{NS()!=="test"&&a(!0)},20,{autoInvoke:!0}),W_(m=>{m.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var VE={root:"m_96b553a6"};const G3={},Q3=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Kv=K((e,t)=>{const n=V("FloatingIndicator",G3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,target:u,parent:d,transitionDuration:f,mod:h,displayAfterTransitionEnd:m,...g}=n,v=le({name:"FloatingIndicator",classes:VE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Q3}),S=p.useRef(null),{initialized:y,hidden:b}=q3({target:u,parent:d,ref:S,displayAfterTransitionEnd:m}),x=Qt(t,S);return!u||!d?null:s.jsx(W,{ref:x,mod:[{initialized:y,hidden:b},h],...v("root"),...g})});Kv.displayName="@mantine/core/FloatingIndicator";Kv.classes=VE;var UE={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 K3={},Y3=(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:ot(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},$i=K((e,t)=>{const n=V("Alert",K3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:m,icon:g,withCloseButton:v,onClose:S,closeButtonLabel:y,variant:b,autoContrast:x,...w}=n,j=le({name:"Alert",classes:UE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Y3}),E=$n(m),C=f&&`${E}-title`||void 0,T=`${E}-body`;return s.jsx(W,{id:E,...j("root",{variant:b}),variant:b,ref:t,...w,role:"alert","aria-describedby":T,"aria-labelledby":C,children:s.jsxs("div",{...j("wrapper"),children:[g&&s.jsx("div",{...j("icon"),children:g}),s.jsxs("div",{...j("body"),children:[f&&s.jsx("div",{...j("title"),"data-with-close-button":v||void 0,children:s.jsx("span",{id:C,...j("label"),children:f})}),h&&s.jsx("div",{id:T,...j("message"),"data-variant":b,children:h})]}),v&&s.jsx(_s,{...j("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":y,unstyled:l})]})})});$i.classes=UE;$i.displayName="@mantine/core/Alert";var HE={root:"m_b6d8b162"};function X3(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const J3={inherit:!1},Z3=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":sn(o),"--text-lh":ES(o),"--text-gradient":t==="gradient"?zp(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?rt(i,e):void 0}}),ue=Cn((e,t)=>{const n=V("Text",J3,e),{lineClamp:r,truncate:o,inline:i,inherit:a,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:m,styles:g,unstyled:v,variant:S,mod:y,size:b,...x}=n,w=le({name:["Text",u],props:n,classes:HE,className:f,style:h,classNames:m,styles:g,unstyled:v,vars:d,varsResolver:Z3});return s.jsx(W,{...w("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":X3(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":a},y],size:b,...x})});ue.classes=HE;ue.displayName="@mantine/core/Text";var WE={root:"m_849cf0da"};const e5={underline:"hover"},Je=Cn((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...a}=V("Anchor",e5,e);return s.jsx(ue,{component:"a",ref:t,className:nt({[WE.root]:!o},r),...a,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Je.classes=WE;Je.displayName="@mantine/core/Anchor";const[t5,el]=On("AppShell was not found in tree");var Li={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const n5={},Yv=K((e,t)=>{const n=V("AppShellAside",n5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=el();return m.disabled?null:s.jsx(W,{component:"aside",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("aside",{className:o,classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??m.zIndex} + 1)`}})});Yv.classes=Li;Yv.displayName="@mantine/core/AppShellAside";const r5={},Xv=K((e,t)=>{var g;const n=V("AppShellFooter",r5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=el();return m.disabled?null:s.jsx(W,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:nt({[ff.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});Xv.classes=Li;Xv.displayName="@mantine/core/AppShellFooter";const o5={},Jv=K((e,t)=>{var g;const n=V("AppShellHeader",o5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=el();return m.disabled?null:s.jsx(W,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:nt({[ff.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});Jv.classes=Li;Jv.displayName="@mantine/core/AppShellHeader";const i5={},Zv=K((e,t)=>{const n=V("AppShellMain",i5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=el();return s.jsx(W,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:a}),...c})});Zv.classes=Li;Zv.displayName="@mantine/core/AppShellMain";function $c(e){return typeof e=="object"?e.base:e}function Lc(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 Fc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function s5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,a="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"),Lc(i)){const f=F($c(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Fc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=F(i.base),e["--app-shell-aside-offset"]=F(i.base)),pt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=F(i[f]),t[f]["--app-shell-aside-offset"]=F(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"]=a,t[f]["--app-shell-aside-transform-rtl"]=l,t[f]["--app-shell-aside-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=Rg(r.breakpoint,o)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=a,n[f]["--app-shell-aside-transform-rtl"]=l}}function a5({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(Lc(r)){const a=F($c(r));e["--app-shell-footer-height"]=a,i&&(e["--app-shell-footer-offset"]=a)}Fc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=F(r.base),i&&(e["--app-shell-footer-offset"]=F(r.base))),pt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-footer-height"]=F(r[a]),i&&(t[a]["--app-shell-footer-offset"]=F(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function l5({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(Lc(r)){const a=F($c(r));e["--app-shell-header-height"]=a,i&&(e["--app-shell-header-offset"]=a)}Fc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=F(r.base),i&&(e["--app-shell-header-offset"]=F(r.base))),pt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-header-height"]=F(r[a]),i&&(t[a]["--app-shell-header-offset"]=F(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function c5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,a="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"),Lc(i)){const f=F($c(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Fc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=F(i.base),e["--app-shell-navbar-offset"]=F(i.base)),pt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=F(i[f]),t[f]["--app-shell-navbar-offset"]=F(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"]=a,t[f]["--app-shell-navbar-transform-rtl"]=l,t[f]["--app-shell-navbar-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=Rg(r.breakpoint,o)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=a,n[f]["--app-shell-navbar-transform-rtl"]=l}}function xp(e){return Number(e)===0?"0px":Wt(e)}function u5({padding:e,baseStyles:t,minMediaStyles:n}){Lc(e)&&(t["--app-shell-padding"]=xp($c(e))),Fc(e)&&(e.base&&(t["--app-shell-padding"]=xp(e.base)),pt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=xp(e[r]))}))}function d5({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const a={},l={},c={};c5({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,navbar:e,theme:i}),s5({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,aside:r,theme:i}),l5({baseStyles:c,minMediaStyles:a,header:t}),a5({baseStyles:c,minMediaStyles:a,footer:n}),u5({baseStyles:c,minMediaStyles:a,padding:o});const u=Ql(pt(a),i).map(h=>({query:`(min-width: ${pd(h.px)})`,styles:a[h.value]})),d=Ql(pt(l),i).map(h=>({query:`(max-width: ${pd(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function f5({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=It(),a=Ai(),{media:l,baseStyles:c}=d5({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return s.jsx(Cs,{media:l,styles:c,selector:a.cssVariablesSelector})}const h5={},ey=K((e,t)=>{const n=V("AppShellNavbar",h5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=el();return m.disabled?null:s.jsx(W,{component:"nav",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("navbar",{className:o,classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??m.zIndex} + 1)`}})});ey.classes=Li;ey.displayName="@mantine/core/AppShellNavbar";const p5={},ty=Cn((e,t)=>{const n=V("AppShellSection",p5,e),{classNames:r,className:o,style:i,styles:a,vars:l,grow:c,mod:u,...d}=n,f=el();return s.jsx(W,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:a}),...d})});ty.classes=Li;ty.displayName="@mantine/core/AppShellSection";function m5({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!0),o=p.useRef(),i=p.useRef();return IS("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),Qa(()=>{p.startTransition(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)})},[t,e]),n}const g5={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Gr("app")},v5=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Gn=K((e,t)=>{const n=V("AppShell",g5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:m,header:g,zIndex:v,layout:S,disabled:y,aside:b,footer:x,offsetScrollbars:w,mod:j,...E}=n,C=le({name:"AppShell",classes:Li,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:v5}),T=m5({disabled:y,transitionDuration:h});return s.jsxs(t5,{value:{getStyles:C,withBorder:d,zIndex:v,disabled:y,offsetScrollbars:w},children:[s.jsx(f5,{navbar:u,header:g,aside:b,footer:x,padding:f}),s.jsx(W,{ref:t,...C("root"),mod:[{resizing:T,layout:S,disabled:y},j],...E})]})});Gn.classes=Li;Gn.displayName="@mantine/core/AppShell";Gn.Navbar=ey;Gn.Header=Jv;Gn.Main=Zv;Gn.Aside=Yv;Gn.Footer=Xv;Gn.Section=ty;function qE(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=>qE(t))}:e}function GE(e){return e?e.map(t=>qE(t)):[]}function QE(e){return e.reduce((t,n)=>"group"in n?{...t,...QE(n.items)}:(t[n.value]=n,t),{})}var Kn={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 y5={error:null},x5=(e,{size:t})=>({chevron:{"--combobox-chevron-size":_e(t,"combobox-chevron-size")}}),zf=K((e,t)=>{const n=V("ComboboxChevron",y5,e),{size:r,error:o,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=le({name:"ComboboxChevron",classes:Kn,props:n,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:x5,rootSelector:"chevron"});return s.jsx(W,{component:"svg",...h,...m("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},f],ref:t,children:s.jsx("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"})})});zf.classes=Kn;zf.displayName="@mantine/core/ComboboxChevron";const[b5,Rr]=On("Combobox component was not found in tree"),KE=p.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>s.jsx(_s,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:a=>{a.preventDefault(),t==null||t(a)},onClick:a=>{r(),n==null||n(a)}}));KE.displayName="@mantine/core/ComboboxClearButton";const w5={},ny=K((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...l}=V("ComboboxDropdown",w5,e),c=Rr();return s.jsx(Qr.Dropdown,{...l,ref:t,role:"presentation","data-hidden":a||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});ny.classes=Kn;ny.displayName="@mantine/core/ComboboxDropdown";const S5={refProp:"ref"},YE=K((e,t)=>{const{children:n,refProp:r}=V("ComboboxDropdownTarget",S5,e);if(Rr(),!Fo(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 s.jsx(Qr.Target,{ref:t,refProp:r,children:n})});YE.displayName="@mantine/core/ComboboxDropdownTarget";const j5={},ry=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxEmpty",j5,e),c=Rr();return s.jsx(W,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});ry.classes=Kn;ry.displayName="@mantine/core/ComboboxEmpty";function oy({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=Rr(),[l,c]=p.useState(null),u=f=>{if(e==null||e(f),!a.readOnly&&t){if(f.nativeEvent.isComposing)return;if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),a.store.dropdownOpened?c(a.store.selectNextOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),a.store.dropdownOpened?c(a.store.selectPreviousOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){if(f.nativeEvent.keyCode===229)return;const h=a.store.getSelectedOptionIndex();a.store.dropdownOpened&&h!==-1?(f.preventDefault(),a.store.clickSelectedOption()):o==="button"&&(f.preventDefault(),a.store.openDropdown("keyboard"))}f.nativeEvent.code==="Escape"&&a.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&o==="button"&&(f.preventDefault(),a.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(a.store.listId&&a.store.dropdownOpened)||void 0,"aria-controls":a.store.listId,"aria-activedescendant":a.store.dropdownOpened&&l||void 0,autoComplete:i,"data-expanded":a.store.dropdownOpened||void 0,"data-mantine-stop-propagation":a.store.dropdownOpened||void 0}:{},onKeyDown:u}}const C5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},XE=K((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=V("ComboboxEventsTarget",C5,e);if(!Fo(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=Rr(),f=oy({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c});return p.cloneElement(n,{...f,...u,[r]:Qt(t,d.store.targetRef,n==null?void 0:n.ref)})});XE.displayName="@mantine/core/ComboboxEventsTarget";const E5={},iy=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxFooter",E5,e),c=Rr();return s.jsx(W,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l})});iy.classes=Kn;iy.displayName="@mantine/core/ComboboxFooter";const T5={},sy=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:l,label:c,...u}=V("ComboboxGroup",T5,e),d=Rr();return s.jsxs(W,{ref:t,...d.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...u,children:[c&&s.jsx("div",{...d.getStyles("groupLabel",{classNames:n,styles:i}),children:c}),l]})});sy.classes=Kn;sy.displayName="@mantine/core/ComboboxGroup";const P5={},ay=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxHeader",P5,e),c=Rr();return s.jsx(W,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l})});ay.classes=Kn;ay.displayName="@mantine/core/ComboboxHeader";function JE({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}JE.displayName="@mantine/core/ComboboxHiddenInput";const k5={},ly=K((e,t)=>{const n=V("ComboboxOption",k5,e),{classNames:r,className:o,style:i,styles:a,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:m,selected:g,mod:v,...S}=n,y=Rr(),b=p.useId(),x=u||b;return s.jsx(W,{...y.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...S,ref:t,id:x,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},v],role:"option",onClick:w=>{var j;m?w.preventDefault():((j=y.onOptionSubmit)==null||j.call(y,n.value,n),c==null||c(w))},onMouseDown:w=>{w.preventDefault(),f==null||f(w)},onMouseOver:w=>{y.resetSelectionOnOptionHover&&y.store.resetSelectedOption(),h==null||h(w)}})});ly.classes=Kn;ly.displayName="@mantine/core/ComboboxOption";const R5={},cy=K((e,t)=>{const n=V("ComboboxOptions",R5,e),{classNames:r,className:o,style:i,styles:a,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Rr(),h=$n(l);return p.useEffect(()=>{f.store.setListId(h)},[h]),s.jsx(W,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:a}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:m=>{m.preventDefault(),c==null||c(m)}})});cy.classes=Kn;cy.displayName="@mantine/core/ComboboxOptions";const _5={withAriaAttributes:!0,withKeyboardNavigation:!0},uy=K((e,t)=>{const n=V("ComboboxSearch",_5,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Rr(),m=h.getStyles("search"),g=oy({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return s.jsx(Dt,{ref:Qt(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});uy.classes=Kn;uy.displayName="@mantine/core/ComboboxSearch";const D5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ZE=K((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=V("ComboboxTarget",D5,e);if(!Fo(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=Rr(),f=oy({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=p.cloneElement(n,{...f,...u});return s.jsx(Qr.Target,{ref:Qt(t,d.store.targetRef),children:h})});ZE.displayName="@mantine/core/ComboboxTarget";function I5(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 A5(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 N5(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function zc({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[l,c]=pn({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=p.useRef(null),d=p.useRef(-1),f=p.useRef(null),h=p.useRef(null),m=p.useRef(-1),g=p.useRef(-1),v=p.useRef(-1),S=p.useCallback((I="unknown")=>{l||(c(!0),o==null||o(I))},[c,o,l]),y=p.useCallback((I="unknown")=>{l&&(c(!1),r==null||r(I))},[c,r,l]),b=p.useCallback((I="unknown")=>{l?y(I):S(I)},[y,S,l]),x=p.useCallback(()=>{const I=document.querySelector(`#${u.current} [data-combobox-selected]`);I==null||I.removeAttribute("data-combobox-selected"),I==null||I.removeAttribute("aria-selected")},[]),w=p.useCallback(I=>{const k=document.getElementById(u.current),R=k==null?void 0:k.querySelectorAll("[data-combobox-option]");if(!R)return null;const $=I>=R.length?0:I<0?R.length-1:I;return d.current=$,R!=null&&R[$]&&!R[$].hasAttribute("data-combobox-disabled")?(x(),R[$].setAttribute("data-combobox-selected","true"),R[$].setAttribute("aria-selected","true"),R[$].scrollIntoView({block:"nearest",behavior:a}),R[$].id):null},[a,x]),j=p.useCallback(()=>{const I=document.querySelector(`#${u.current} [data-combobox-active]`);if(I){const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),R=Array.from(k).findIndex($=>$===I);return w(R)}return w(0)},[w]),E=p.useCallback(()=>w(A5(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[w,i]),C=p.useCallback(()=>w(I5(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[w,i]),T=p.useCallback(()=>w(N5(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[w]),_=p.useCallback((I="selected",k)=>{v.current=window.setTimeout(()=>{var B;const R=document.querySelectorAll(`#${u.current} [data-combobox-option]`),$=Array.from(R).findIndex(H=>H.hasAttribute(`data-combobox-${I}`));d.current=$,k!=null&&k.scrollIntoView&&((B=R[$])==null||B.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),P=p.useCallback(()=>{d.current=-1,x()},[x]),M=p.useCallback(()=>{const I=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=I==null?void 0:I[d.current];k==null||k.click()},[]),D=p.useCallback(I=>{u.current=I},[]),N=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),A=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),L=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:y,toggleDropdown:b,selectedOptionIndex:d.current,getSelectedOptionIndex:L,selectOption:w,selectFirstOption:T,selectActiveOption:j,selectNextOption:E,selectPreviousOption:C,resetSelectedOption:P,updateSelectedOptionIndex:_,listId:u.current,setListId:D,clickSelectedOption:M,searchRef:f,focusSearchInput:N,targetRef:h,focusTarget:A}}const M5={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},O5=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":sn(t),"--combobox-option-padding":_e(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:F(n),"--combobox-option-fz":sn(t),"--combobox-option-padding":_e(t,"combobox-option-padding")}});function Ie(e){const t=V("Combobox",M5,e),{classNames:n,styles:r,unstyled:o,children:i,store:a,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:m,readOnly:g,...v}=t,S=zc(),y=a||S,b=le({name:m||"Combobox",classes:Kn,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:O5}),x=()=>{u==null||u(),y.closeDropdown()};return s.jsx(b5,{value:{getStyles:b,store:y,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g},children:s.jsx(Qr,{opened:y.dropdownOpened,...v,onClose:x,withRoles:!1,unstyled:o,children:i})})}const $5=e=>e;Ie.extend=$5;Ie.classes=Kn;Ie.displayName="@mantine/core/Combobox";Ie.Target=ZE;Ie.Dropdown=ny;Ie.Options=cy;Ie.Option=ly;Ie.Search=uy;Ie.Empty=ry;Ie.Chevron=zf;Ie.Footer=iy;Ie.Header=ay;Ie.EventsTarget=XE;Ie.DropdownTarget=YE;Ie.Group=sy;Ie.ClearButton=KE;Ie.HiddenInput=JE;var eT={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const tT=eT,Bf=p.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:a,label:l,description:c,id:u,disabled:d,error:f,size:h,labelPosition:m="left",bodyElement:g="div",labelElement:v="label",variant:S,style:y,vars:b,mod:x,...w},j)=>{const E=le({name:e,props:t,className:n,style:y,classes:eT,classNames:r,styles:o,unstyled:i});return s.jsx(W,{...E("root"),ref:j,__vars:{"--label-fz":sn(h),"--label-lh":_e(h,"label-lh")},mod:[{"label-position":m},x],variant:S,size:h,...w,children:s.jsxs(W,{component:g,htmlFor:g==="label"?u:void 0,...E("body"),children:[a,s.jsxs("div",{...E("labelWrapper"),"data-disabled":d||void 0,children:[l&&s.jsx(W,{component:v,htmlFor:v==="label"?u:void 0,...E("label"),"data-disabled":d||void 0,children:l}),c&&s.jsx(Dt.Description,{size:h,__inheritStyles:!1,...E("description"),children:c}),f&&typeof f!="boolean"&&s.jsx(Dt.Error,{size:h,__inheritStyles:!1,...E("error"),children:f})]})]})})});Bf.displayName="@mantine/core/InlineInput";const nT=p.createContext(null),L5=nT.Provider,rT=()=>p.useContext(nT),[F5,z5]=Ss();var oT={card:"m_26775b0a"};const B5={withBorder:!0},V5=(e,{radius:t})=>({card:{"--card-radius":ot(t)}}),dy=K((e,t)=>{const n=V("CheckboxCard",B5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,checked:u,mod:d,withBorder:f,value:h,onClick:m,...g}=n,v=le({name:"CheckboxCard",classes:oT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:V5,rootSelector:"card"}),S=rT(),y=typeof u=="boolean"?u:(S==null?void 0:S.value.includes(h||""))||!1;return s.jsx(F5,{value:{checked:y},children:s.jsx(gn,{ref:t,mod:[{"with-border":f,checked:y},d],...v("card"),...g,role:"checkbox","aria-checked":y,onClick:b=>{m==null||m(b),S==null||S.onChange(h||"")}})})});dy.displayName="@mantine/core/CheckboxCard";dy.classes=oT;function fy({children:e,role:t}){const n=Za();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const U5={},hy=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=V("CheckboxGroup",U5,e),[d,f]=pn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=typeof m=="string"?m:m.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return s.jsx(L5,{value:{value:d,onChange:h,size:i},children:s.jsx(Dt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(fy,{role:"group",children:l})})})});hy.classes=Dt.Wrapper.classes;hy.displayName="@mantine/core/CheckboxGroup";function Vf({size:e,style:t,...n}){const r=e!==void 0?{width:F(e),height:F(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.jsx("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 iT({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(Vf,{...t})}var sT={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const H5={icon:iT},W5=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Sr({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":_e(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:ot(t),"--checkbox-color":i==="outline"?c:rt(n,e),"--checkbox-icon-color":o?rt(o,e):js(a,e)?zo({color:n,theme:e,autoContrast:a}):void 0}}},py=K((e,t)=>{const n=V("CheckboxIndicator",H5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,icon:u,indeterminate:d,radius:f,color:h,iconColor:m,autoContrast:g,checked:v,mod:S,variant:y,disabled:b,...x}=n,w=u,j=le({name:"CheckboxIndicator",classes:sT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:W5,rootSelector:"indicator"}),E=z5(),C=typeof v=="boolean"||typeof d=="boolean"?v||d:(E==null?void 0:E.checked)||!1;return s.jsx(W,{ref:t,...j("indicator",{variant:y}),variant:y,mod:[{checked:C,disabled:b},S],...x,children:s.jsx(w,{indeterminate:d,...j("icon")})})});py.displayName="@mantine/core/CheckboxIndicator";py.classes=sT;var aT={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const q5={labelPosition:"right",icon:iT},G5=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Sr({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":_e(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:ot(t),"--checkbox-color":i==="outline"?c:rt(n,e),"--checkbox-icon-color":o?rt(o,e):js(a,e)?zo({color:n,theme:e,autoContrast:a}):void 0}}},Yn=K((e,t)=>{const n=V("Checkbox",q5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:m,wrapperProps:g,children:v,checked:S,labelPosition:y,description:b,error:x,disabled:w,variant:j,indeterminate:E,icon:C,rootRef:T,iconColor:_,onChange:P,autoContrast:M,mod:D,...N}=n,A=rT(),L=h||(A==null?void 0:A.size),I=C,k=le({name:"Checkbox",props:n,classes:aT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:G5}),{styleProps:R,rest:$}=Bo(N),B=$n(f),H=A?{checked:A.value.includes($.value),onChange:X=>{A.onChange(X),P==null||P(X)}}:{};return s.jsx(Bf,{...k("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:B,size:L,labelPosition:y,label:d,description:b,error:x,disabled:w,classNames:r,styles:a,unstyled:l,"data-checked":H.checked||S||void 0,variant:j,ref:T,mod:D,...R,...g,children:s.jsxs(W,{...k("inner"),mod:{"data-label-position":y},children:[s.jsx(W,{component:"input",id:B,ref:t,checked:S,disabled:w,mod:{error:!!x,indeterminate:E},...k("input",{focusable:!0,variant:j}),onChange:P,...$,...H,type:"checkbox"}),s.jsx(I,{indeterminate:E,...k("icon")})]})})});Yn.classes={...aT,...tT};Yn.displayName="@mantine/core/Checkbox";Yn.Group=hy;Yn.Indicator=py;Yn.Card=dy;function za(e){return"group"in e}function lT({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const a=e[i];if(o.length===n)return o;za(a)&&o.push({group:a.group,items:lT({options:a.items,search:t,limit:n-o.length})}),za(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function Q5(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 cT(e,t=new Set){if(Array.isArray(e))for(const n of e)if(za(n))cT(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 K5(e,t){return Array.isArray(e)?e.includes(t):e===t}function uT({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!za(e)){const l=K5(n,e.value),c=t&&l&&s.jsx(Vf,{className:Kn.optionsDropdownCheckIcon}),u=s.jsxs(s.Fragment,{children:[r==="left"&&c,s.jsx("span",{children:e.label}),r==="right"&&c]});return s.jsx(Ie.Option,{value:e.value,disabled:e.disabled,className:nt({[Kn.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":l||void 0,"aria-selected":l,active:l,children:typeof i=="function"?i({option:e,checked:l}):u})}const a=e.items.map(l=>s.jsx(uT,{data:l,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},l.value));return s.jsx(Ie.Group,{label:e.group,children:a})}function Y5({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:a,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:h,unstyled:m,labelId:g,renderOption:v,scrollAreaProps:S,"aria-label":y}){cT(e);const x=typeof o=="string"?(r||lT)({options:e,search:c?o:"",limit:i??1/0}):e,w=Q5(x),j=x.map(E=>s.jsx(uT,{data:E,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m,renderOption:v},za(E)?E.group:E.value));return s.jsx(Ie.Dropdown,{hidden:t||n&&w,children:s.jsxs(Ie.Options,{labelledBy:g,"aria-label":y,children:[l?s.jsx(Pr.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:j}):j,w&&h&&s.jsx(Ie.Empty,{children:h})]})})}const dT=p.createContext(null),X5=dT.Provider;function J5(){return{withinGroup:!!p.useContext(dT)}}var Uf={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const Z5={},e9=(e,{spacing:t})=>({group:{"--ag-spacing":Wt(t)}}),my=K((e,t)=>{const n=V("AvatarGroup",Z5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,spacing:u,...d}=n,f=le({name:"AvatarGroup",classes:Uf,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:e9,rootSelector:"group"});return s.jsx(X5,{value:!0,children:s.jsx(W,{ref:t,...f("group"),...d})})});my.classes=Uf;my.displayName="@mantine/core/AvatarGroup";function t9(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.jsx("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 n9={},r9=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:a});return{root:{"--avatar-size":_e(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:ot(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}}},ps=Cn((e,t)=>{const n=V("Avatar",n9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:m,imageProps:g,children:v,autoContrast:S,mod:y,...b}=n,x=J5(),[w,j]=p.useState(!u),E=le({name:"Avatar",props:n,classes:Uf,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:r9});return p.useEffect(()=>j(!u),[u]),s.jsx(W,{...E("root"),mod:[{"within-group":x.withinGroup},y],ref:t,...b,children:w?s.jsx("span",{...E("placeholder"),title:d,children:v||s.jsx(t9,{})}):s.jsx("img",{...g,...E("image"),src:u,alt:d,onError:C=>{var T;j(!0),(T=g==null?void 0:g.onError)==null||T.call(g,C)}})})});ps.classes=Uf;ps.displayName="@mantine/core/Avatar";ps.Group=my;var fT={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const o9={},i9=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:a})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:a});return{root:{"--badge-height":_e(i,"badge-height"),"--badge-padding-x":_e(i,"badge-padding-x"),"--badge-fz":_e(i,"badge-fz"),"--badge-radius":t===void 0?void 0:ot(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"?rt(n,e):void 0}}},Bc=Cn((e,t)=>{const n=V("Badge",o9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:m,children:g,variant:v,fullWidth:S,autoContrast:y,circle:b,mod:x,...w}=n,j=le({name:"Badge",props:n,classes:fT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:i9});return s.jsxs(W,{variant:v,mod:[{block:S,circle:b},x],...j("root",{variant:v}),ref:t,...w,children:[h&&s.jsx("span",{...j("section"),"data-position":"left",children:h}),s.jsx("span",{...j("label"),children:g}),m&&s.jsx("span",{...j("section"),"data-position":"right",children:m})]})});Bc.classes=fT;Bc.displayName="@mantine/core/Badge";var hT={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const s9={iconSize:48},a9=(e,{color:t,iconSize:n,radius:r})=>{const o=Sr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=Sr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":pr(i.value,.07),"--bq-bg-dark":pr(o.value,.06),"--bq-bd":rt(t,e),"--bq-icon-size":F(n),"--bq-radius":ot(r)}}},gy=K((e,t)=>{const n=V("Blockquote",s9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=le({name:"Blockquote",classes:hT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:a9});return s.jsxs(W,{component:"blockquote",ref:t,...g("root"),...m,children:[d&&s.jsx("span",{...g("icon"),children:d}),u,h&&s.jsx("cite",{...g("cite"),children:h})]})});gy.classes=hT;gy.displayName="@mantine/core/Blockquote";var Hf={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const ib={orientation:"horizontal"},l9=(e,{borderWidth:t})=>({group:{"--button-border-width":F(t)}}),vy=K((e,t)=>{const n=V("ButtonGroup",ib,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=V("ButtonGroup",ib,e),g=le({name:"ButtonGroup",props:n,classes:Hf,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:l9,rootSelector:"group"});return s.jsx(W,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});vy.classes=Hf;vy.displayName="@mantine/core/ButtonGroup";const c9={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${F(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},u9={},d9=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:a,autoContrast:l})=>{const c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--button-justify":a,"--button-height":_e(i,"button-height"),"--button-padding-x":_e(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?sn(i.replace("compact-","")):sn(i),"--button-radius":t===void 0?void 0:ot(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}}},oe=Cn((e,t)=>{const n=V("Button",u9,e),{style:r,vars:o,className:i,color:a,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:m,loading:g,loaderProps:v,gradient:S,classNames:y,styles:b,unstyled:x,"data-disabled":w,autoContrast:j,mod:E,...C}=n,T=le({name:"Button",props:n,classes:Hf,className:i,style:r,classNames:y,styles:b,unstyled:x,vars:o,varsResolver:d9}),_=!!u,P=!!d;return s.jsxs(gn,{ref:t,...T("root",{active:!l&&!g&&!w}),unstyled:x,variant:h,disabled:l||g,mod:[{disabled:l||w,loading:g,block:f,"with-left-section":_,"with-right-section":P},E],...C,children:[s.jsx(Ho,{mounted:!!g,transition:c9,duration:150,children:M=>s.jsx(W,{component:"span",...T("loader",{style:M}),"aria-hidden":!0,children:s.jsx(Qn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v})})}),s.jsxs("span",{...T("inner"),children:[u&&s.jsx(W,{component:"span",...T("section"),mod:{position:"left"},children:u}),s.jsx(W,{component:"span",mod:{loading:g},...T("label"),children:c}),d&&s.jsx(W,{component:"span",...T("section"),mod:{position:"right"},children:d})]})]})});oe.classes=Hf;oe.displayName="@mantine/core/Button";oe.Group=vy;var pT={root:"m_4451eb3a"};const f9={},dn=Cn((e,t)=>{const n=V("Center",f9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=le({name:"Center",props:n,classes:pT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c});return s.jsx(W,{ref:t,mod:[{inline:u},d],...h("root"),...f})});dn.classes=pT;dn.displayName="@mantine/core/Center";const[h9,p9]=Ss(),m9={};function mT(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=V("ChipGroup",m9,e),[a,l]=pn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const f=d.currentTarget.value;Array.isArray(a)?l(a.includes(f)?a.filter(h=>h!==f):[...a,f]):l(f)};return s.jsx(h9,{value:{isChipSelected:c,onChange:u,multiple:o},children:i})}mT.displayName="@mantine/core/ChipGroup";var gT={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 g9={type:"checkbox"},v9=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const a=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":sn(t),"--chip-size":_e(t,"chip-size"),"--chip-radius":n===void 0?void 0:ot(n),"--chip-checked-padding":_e(t,"chip-checked-padding"),"--chip-padding":_e(t,"chip-padding"),"--chip-icon-size":_e(t,"chip-icon-size"),"--chip-bg":o||r?a.background:void 0,"--chip-hover":o||r?a.hover:void 0,"--chip-color":o||r?a.color:void 0,"--chip-bd":o||r?a.border:void 0,"--chip-spacing":_e(t,"chip-spacing")}}},mc=K((e,t)=>{const n=V("Chip",g9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:m,wrapperProps:g,type:v,disabled:S,children:y,size:b,variant:x,icon:w,rootRef:j,autoContrast:E,mod:C,...T}=n,_=le({name:"Chip",classes:gT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:v9}),P=p9(),M=$n(u),{styleProps:D,rest:N}=Bo(T),[A,L]=pn({value:d,defaultValue:f,finalValue:!1,onChange:h}),I=P?{checked:P.isChipSelected(m),onChange:R=>{P.onChange(R),h==null||h(R.currentTarget.checked)},type:P.multiple?"checkbox":"radio"}:{},k=I.checked||A;return s.jsxs(W,{size:b,variant:x,ref:j,mod:C,..._("root"),...D,...g,children:[s.jsx("input",{type:v,..._("input"),checked:k,onChange:R=>L(R.currentTarget.checked),id:M,disabled:S,ref:t,value:m,...I,...N}),s.jsxs("label",{htmlFor:M,"data-checked":k||void 0,"data-disabled":S||void 0,..._("label",{variant:x||"filled"}),children:[k&&s.jsx("span",{..._("iconWrapper"),children:w||s.jsx(Vf,{..._("checkIcon")})}),s.jsx("span",{children:y})]})]})});mc.classes=gT;mc.displayName="@mantine/core/Chip";mc.Group=mT;var vT={root:"m_b183c0a2"};const y9={},x9=(e,{color:t})=>({root:{"--code-bg":t?rt(t,e):void 0}}),yy=K((e,t)=>{const n=V("Code",y9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...m}=n,g=le({name:"Code",props:n,classes:vT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:x9});return s.jsx(W,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...m,dir:"ltr"})});yy.classes=vT;yy.displayName="@mantine/core/Code";var yT={root:"m_7485cace"};const b9={},w9=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:_e(t,"container-size")}}),xy=K((e,t)=>{const n=V("Container",b9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=le({name:"Container",classes:yT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:w9});return s.jsx(W,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});xy.classes=yT;xy.displayName="@mantine/core/Container";const S9={timeout:1e3};function xT(e){const{children:t,timeout:n,value:r,...o}=V("CopyButton",S9,e),i=TS({timeout:n}),a=()=>i.copy(r);return s.jsx(s.Fragment,{children:t({copy:a,copied:i.copied,...o})})}xT.displayName="@mantine/core/CopyButton";var bT={root:"m_3eebeb36",label:"m_9e365f20"};const j9={orientation:"horizontal"},C9=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?rt(t,e):void 0,"--divider-border-style":n,"--divider-size":_e(r,"divider-size")}}),nn=K((e,t)=>{const n=V("Divider",j9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:m,...g}=n,v=le({name:"Divider",classes:bT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:C9});return s.jsx(W,{ref:t,mod:[{orientation:d,"with-label":!!f},m],...v("root"),...g,role:"separator",children:f&&s.jsx(W,{component:"span",mod:{position:h},...v("label"),children:f})})});nn.classes=bT;nn.displayName="@mantine/core/Divider";function E9({open:e,close:t,openDelay:n,closeDelay:r}){const o=p.useRef(-1),i=p.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},c=()=>{a(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return p.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}const[T9,wT]=On("Grid component was not found in tree"),Vm=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,sb=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Vm(e,t),ab=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},lb=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function P9({span:e,order:t,offset:n,selector:r}){var h;const o=It(),i=wT(),l=Lr(e)===void 0?12:Lr(e),c=Ii({"--col-order":(h=Lr(t))==null?void 0:h.toString(),"--col-flex-grow":ab(l,i.grow),"--col-flex-basis":Vm(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":sb(l,i.columns,i.grow),"--col-offset":lb(Lr(n),i.columns)}),u=pt(o.breakpoints).reduce((m,g)=>{var v;return m[g]||(m[g]={}),typeof t=="object"&&t[g]!==void 0&&(m[g]["--col-order"]=(v=t[g])==null?void 0:v.toString()),typeof e=="object"&&e[g]!==void 0&&(m[g]["--col-flex-grow"]=ab(e[g],i.grow),m[g]["--col-flex-basis"]=Vm(e[g],i.columns),m[g]["--col-width"]=e[g]==="content"?"auto":void 0,m[g]["--col-max-width"]=sb(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(m[g]["--col-offset"]=lb(n[g],i.columns)),m},{}),f=Ql(pt(u),o).filter(m=>pt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return s.jsx(Cs,{styles:c,media:f,selector:r})}var by={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const k9={span:12},wy=K((e,t)=>{const n=V("GridCol",k9,e),{classNames:r,className:o,style:i,styles:a,vars:l,span:c,order:u,offset:d,...f}=n,h=wT(),m=_c();return s.jsxs(s.Fragment,{children:[s.jsx(P9,{selector:`.${m}`,span:c,order:u,offset:d}),s.jsx(W,{ref:t,...h.getStyles("col",{className:nt(o,m),style:i,classNames:r,styles:a}),...f})]})});wy.classes=by;wy.displayName="@mantine/core/GridCol";function R9({gutter:e,selector:t}){const n=It(),r=Ii({"--grid-gutter":Wt(Lr(e))}),o=pt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=Wt(e[c])),l),{}),a=Ql(pt(o),n).filter(l=>pt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return s.jsx(Cs,{styles:r,media:a,selector:t})}const _9={gutter:"md",grow:!1,columns:12},D9=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),rr=K((e,t)=>{const n=V("Grid",_9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:m,children:g,...v}=n,S=le({name:"Grid",classes:by,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:D9}),y=_c();return s.jsxs(T9,{value:{getStyles:S,grow:u,columns:f},children:[s.jsx(R9,{selector:`.${y}`,...n}),s.jsx(W,{ref:t,...S("root",{className:y}),...v,children:s.jsx("div",{...S("inner"),children:g})})]})});rr.classes=by;rr.displayName="@mantine/core/Grid";rr.Col=wy;function Wd(){return Wd=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wd.apply(null,arguments)}function Sy(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var I9=p.useLayoutEffect,A9=function(t){var n=p.useRef(t);return I9(function(){n.current=t}),n},cb=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},N9=function(t,n){var r=p.useRef();return p.useCallback(function(o){t.current=o,r.current&&cb(r.current,null),r.current=n,n&&cb(n,o)},[n])},ub={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},M9=function(t){Object.keys(ub).forEach(function(n){t.style.setProperty(n,ub[n],"important")})},db=M9,kn=null,fb=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function O9(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),kn||(kn=document.createElement("textarea"),kn.setAttribute("tabindex","-1"),kn.setAttribute("aria-hidden","true"),db(kn)),kn.parentNode===null&&document.body.appendChild(kn);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;kn.style[m]=a[m]}),db(kn),kn.value=t;var c=fb(kn,e);kn.value=t,c=fb(kn,e),kn.value="x";var u=kn.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 hb=function(){},$9=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},L9=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],F9=!!document.documentElement.currentStyle,z9=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=$9(L9,n),o=r.boxSizing;if(o==="")return null;F9&&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),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:a}},B9=z9;function ST(e,t,n){var r=A9(n);p.useLayoutEffect(function(){var o=function(a){return r.current(a)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var V9=function(t){ST(window,"resize",t)},U9=function(t){ST(document.fonts,"loadingdone",t)},H9=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],W9=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?hb:a,c=t.onHeightChange,u=c===void 0?hb:c,d=Sy(t,H9),f=d.value!==void 0,h=p.useRef(null),m=N9(h,n),g=p.useRef(0),v=p.useRef(),S=function(){var x=h.current,w=r&&v.current?v.current:B9(x);if(w){v.current=w;var j=O9(w,x.value||x.placeholder||"x",i,o),E=j[0],C=j[1];g.current!==E&&(g.current=E,x.style.setProperty("height",E+"px","important"),u(E,{rowHeight:C}))}},y=function(x){f||S(),l(x)};return p.useLayoutEffect(S),V9(S),U9(S),p.createElement("textarea",Wd({},d,{onChange:y,ref:m}))},q9=p.forwardRef(W9);const G9={},Ds=K((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...l}=V("Textarea",G9,e),c=n&&NS()!=="test",u=c?{maxRows:r,minRows:o}:{};return s.jsx(Xn,{component:c?q9:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":a},...u})});Ds.classes=Xn.classes;Ds.displayName="@mantine/core/Textarea";function pb(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const Q9={serialize:JSON.stringify,deserialize:JSON.parse},tl=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:a,serialize:l,deserialize:c,onFocus:u,onBlur:d,readOnly:f,error:h,...m}=V("JsonInput",Q9,e),[g,v]=pn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,y]=p.useState(pb(g,c)),b=w=>{u==null||u(w),y(!0)},x=w=>{typeof d=="function"&&d(w);const j=pb(w.currentTarget.value,c);i&&!f&&j&&w.currentTarget.value.trim()!==""&&v(l(c(w.currentTarget.value),null,2)),y(j)};return s.jsx(Ds,{value:g,onChange:w=>v(w.currentTarget.value),onFocus:b,onBlur:x,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:a||!0,"data-monospace":!0})});tl.classes=Xn.classes;tl.displayName="@mantine/core/JsonInput";const[K9,Y9]=On("List component was not found in tree");var jy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const X9={},Cy=K((e,t)=>{const n=V("ListItem",X9,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,children:u,mod:d,...f}=n,h=Y9(),m=c||h.icon,g={classNames:r,styles:a};return s.jsx(W,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!m,centered:h.center},d],ref:t,...f,children:s.jsxs("div",{...h.getStyles("itemWrapper",g),children:[m&&s.jsx("span",{...h.getStyles("itemIcon",g),children:m}),s.jsx("span",{...h.getStyles("itemLabel",g),children:u})]})})});Cy.classes=jy;Cy.displayName="@mantine/core/ListItem";const J9={type:"unordered"},Z9=(e,{size:t,spacing:n})=>({root:{"--list-fz":sn(t),"--list-lh":ES(t),"--list-spacing":Wt(n)}}),In=K((e,t)=>{const n=V("List",J9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:m,center:g,listStyleType:v,mod:S,...y}=n,b=le({name:"List",classes:jy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Z9});return s.jsx(K9,{value:{center:g,icon:h,getStyles:b},children:s.jsx(W,{...b("root",{style:{listStyleType:v}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},S],ref:t,...y,children:u})})});In.classes=jy;In.displayName="@mantine/core/List";In.Item=Cy;var jT={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const mb={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Gr("overlay")},eM=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Ey=K((e,t)=>{const n=V("LoadingOverlay",mb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:m,...g}=n,v=It(),S=le({name:"LoadingOverlay",classes:jT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:eM}),y={...mb.overlayProps,...f};return s.jsx(Ho,{transition:"fade",...u,mounted:!!h,children:b=>s.jsxs(W,{...S("root",{style:b}),ref:t,...g,children:[s.jsx(Qn,{...S("loader"),unstyled:l,...d}),s.jsx(pc,{...y,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),s.jsx(pc,{...y,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})]})})});Ey.classes=jT;Ey.displayName="@mantine/core/LoadingOverlay";const[tM,Vc]=On("Menu component was not found in the tree");var nl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const nM={},Ty=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("MenuDivider",nM,e),c=Vc();return s.jsx(W,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});Ty.classes=nl;Ty.displayName="@mantine/core/MenuDivider";const rM={},Py=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:l,onMouseLeave:c,children:u,...d}=V("MenuDropdown",rM,e),f=p.useRef(null),h=Vc(),m=S=>{var y,b;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(b=(y=f.current)==null?void 0:y.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||b.focus())},g=er(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),v=er(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return s.jsxs(Qr.Dropdown,{...d,onMouseEnter:g,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:Qt(t,f),...h.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"aria-hidden":!0,style:{outline:0}}),u]})});Py.classes=nl;Py.displayName="@mantine/core/MenuDropdown";const oM={},ky=Cn((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,color:l,closeMenuOnClick:c,leftSection:u,rightSection:d,children:f,disabled:h,...m}=V("MenuItem",oM,e),g=Vc(),v=It(),{dir:S}=Es(),y=p.useRef(),b=g.getItemIndex(y.current),x=m,w=er(x.onMouseLeave,()=>g.setHovered(-1)),j=er(x.onMouseEnter,()=>g.setHovered(g.getItemIndex(y.current))),E=er(x.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),C=er(x.onFocus,()=>g.setHovered(g.getItemIndex(y.current))),T=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,_=l?Sr({color:l,theme:v}):null;return s.jsxs(gn,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:C,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:Qt(y,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===b?!0:void 0,onMouseEnter:j,onMouseLeave:w,onClick:E,onKeyDown:CS({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:x.onKeydown}),__vars:{"--menu-item-color":_!=null&&_.isThemeColor&&(_==null?void 0:_.shade)===void 0?`var(--mantine-color-${_.color}-6)`:T==null?void 0:T.color,"--menu-item-hover":T==null?void 0:T.hover},children:[u&&s.jsx("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:u}),f&&s.jsx("div",{...g.getStyles("itemLabel",{styles:i,classNames:n}),children:f}),d&&s.jsx("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:d})]})});ky.classes=nl;ky.displayName="@mantine/core/MenuItem";const iM={},Ry=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("MenuLabel",iM,e),c=Vc();return s.jsx(W,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});Ry.classes=nl;Ry.displayName="@mantine/core/MenuLabel";const sM={refProp:"ref"},CT=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=V("MenuTarget",sM,e);if(!Fo(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=Vc(),a=er(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=er(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=er(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return s.jsx(Qr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:p.cloneElement(n,{onClick:a,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0})})});CT.displayName="@mantine/core/MenuTarget";const aM={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function re(e){const t=V("Menu",aM,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:a,trapFocus:l,onChange:c,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:g,classNames:v,styles:S,unstyled:y,variant:b,vars:x,menuItemTabIndex:w,keepMounted:j,...E}=t,C=le({name:"Menu",classes:nl,props:t,classNames:v,styles:S,unstyled:y}),[T,{setHovered:_,resetHovered:P}]=T_(),[M,D]=pn({value:i,defaultValue:a,finalValue:!1,onChange:c}),[N,A]=p.useState(!1),L=()=>{D(!1),A(!1),M&&(o==null||o())},I=()=>{D(!0),!M&&(r==null||r())},k=()=>{M?L():I()},{openDropdown:R,closeDropdown:$}=E9({open:I,close:L,closeDelay:g,openDelay:m}),B=ye=>E_("[data-menu-item]","[data-menu-dropdown]",ye),{resolvedClassNames:H,resolvedStyles:X}=Rc({classNames:v,styles:S,props:t});return Ro(()=>{P()},[M]),s.jsx(tM,{value:{getStyles:C,opened:M,toggleDropdown:k,getItemIndex:B,hovered:T,setHovered:_,openedViaClick:N,setOpenedViaClick:A,closeOnItemClick:u,closeDropdown:h==="click"?L:$,openDropdown:h==="click"?I:R,closeDropdownImmediately:L,loop:d,trigger:h,unstyled:y,menuItemTabIndex:w},children:s.jsx(Qr,{...E,opened:M,onChange:k,defaultOpened:a,trapFocus:j?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:H,styles:X,unstyled:y,variant:b,keepMounted:j,children:n})})}re.extend=e=>e;re.classes=nl;re.displayName="@mantine/core/Menu";re.Item=ky;re.Label=Ry;re.Dropdown=Py;re.Target=CT;re.Divider=Ty;const[lM,rl]=On("Modal component was not found in tree");var qo={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const cM={},Wf=K((e,t)=>{const n=V("ModalBody",cM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=rl();return s.jsx(OE,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:a,className:o}),...c})});Wf.classes=qo;Wf.displayName="@mantine/core/ModalBody";const uM={},qf=K((e,t)=>{const n=V("ModalCloseButton",uM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=rl();return s.jsx($E,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:a,className:o}),...c})});qf.classes=qo;qf.displayName="@mantine/core/ModalCloseButton";const dM={},Gf=K((e,t)=>{const n=V("ModalContent",dM,e),{classNames:r,className:o,style:i,styles:a,vars:l,children:c,...u}=n,d=rl(),f=d.scrollAreaComponent||_3;return s.jsx(T3,{...d.getStyles("content",{className:o,style:i,styles:a,classNames:r}),innerProps:d.getStyles("inner",{className:o,style:i,styles:a,classNames:r}),"data-full-screen":d.fullScreen||void 0,"data-modal-content":!0,ref:t,...u,children:s.jsx(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${F(d.yOffset)} * 2))`},children:c})})});Gf.classes=qo;Gf.displayName="@mantine/core/ModalContent";const fM={},Qf=K((e,t)=>{const n=V("ModalHeader",fM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=rl();return s.jsx(LE,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:a,className:o}),...c})});Qf.classes=qo;Qf.displayName="@mantine/core/ModalHeader";const hM={},Kf=K((e,t)=>{const n=V("ModalOverlay",hM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=rl();return s.jsx(FE,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:a,className:o}),...c})});Kf.classes=qo;Kf.displayName="@mantine/core/ModalOverlay";const pM={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Gr("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},mM=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:ot(t),"--modal-size":_e(n,"modal-size"),"--modal-y-offset":F(r),"--modal-x-offset":F(o)}}),Yf=K((e,t)=>{const n=V("ModalRoot",pM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:m,xOffset:g,__staticSelector:v,...S}=n,y=le({name:v,classes:qo,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:mM});return s.jsx(lM,{value:{yOffset:u,scrollAreaComponent:d,getStyles:y,fullScreen:h},children:s.jsx(C3,{ref:t,...y("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...S})})});Yf.classes=qo;Yf.displayName="@mantine/core/ModalRoot";const gM={},Xf=K((e,t)=>{const n=V("ModalTitle",gM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=rl();return s.jsx(zE,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:a,className:o}),...c})});Xf.classes=qo;Xf.displayName="@mantine/core/ModalTitle";const vM={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Gr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},En=K((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l,radius:c,...u}=V("Modal",vM,e),d=!!n||i;return s.jsxs(Yf,{ref:t,radius:c,...u,children:[r&&s.jsx(Kf,{...o}),s.jsxs(Gf,{radius:c,children:[d&&s.jsxs(Qf,{children:[n&&s.jsx(Xf,{children:n}),i&&s.jsx(qf,{...a})]}),s.jsx(Wf,{children:l})]})]})});En.classes=qo;En.displayName="@mantine/core/Modal";En.Root=Yf;En.Overlay=Kf;En.Content=Gf;En.Body=Wf;En.Header=Qf;En.Title=Xf;En.CloseButton=qf;const[yM,_y]=Ss(),[xM,bM]=Ss();var Jf={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const wM={},SM=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?_e(t):_e(n,"pg-gap")}}),Dy=K((e,t)=>{const n=V("PillGroup",wM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=_y(),m=(h==null?void 0:h.size)||u||void 0,g=le({name:"PillGroup",classes:Jf,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:SM,stylesCtx:{size:m},rootSelector:"group"});return s.jsx(xM,{value:{size:m,disabled:d},children:s.jsx(W,{ref:t,size:m,...g("group"),...f})})});Dy.classes=Jf;Dy.displayName="@mantine/core/PillGroup";const jM={variant:"default"},CM=(e,{radius:t},{size:n})=>({root:{"--pill-fz":_e(n,"pill-fz"),"--pill-height":_e(n,"pill-height"),"--pill-radius":t===void 0?void 0:ot(t)}}),ms=K((e,t)=>{const n=V("Pill",jM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:m,radius:g,size:v,disabled:S,mod:y,...b}=n,x=bM(),w=_y(),j=v||(x==null?void 0:x.size)||void 0,E=(w==null?void 0:w.variant)==="filled"?"contrast":u||"default",C=le({name:"Pill",classes:Jf,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:CM,stylesCtx:{size:j}});return s.jsxs(W,{component:"span",ref:t,variant:E,size:j,...C("root",{variant:E}),mod:[{"with-remove":f&&!S,disabled:S||(x==null?void 0:x.disabled)},y],...b,children:[s.jsx("span",{...C("label"),children:d}),f&&s.jsx(_s,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...C("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:T=>{var _;T.preventDefault(),T.stopPropagation(),(_=m==null?void 0:m.onMouseDown)==null||_.call(m,T)},onClick:T=>{var _;T.stopPropagation(),h==null||h(),(_=m==null?void 0:m.onClick)==null||_.call(m,T)}})]})});ms.classes=Jf;ms.displayName="@mantine/core/Pill";ms.Group=Dy;var ET={field:"m_45c4369d"};const EM={type:"visible"},Iy=K((e,t)=>{const n=V("PillsInputField",EM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:m,...g}=n,v=_y(),S=Za(),y=le({name:"PillsInputField",classes:ET,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"field"}),b=d||(v==null?void 0:v.disabled);return s.jsx(W,{component:"input",ref:Qt(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:b,mod:[{disabled:b,pointer:h},m],...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:x=>!h&&x.stopPropagation()})});Iy.classes=ET;Iy.displayName="@mantine/core/PillsInputField";const TM={},Ba=K((e,t)=>{const n=V("PillsInput",TM,e),{children:r,onMouseDown:o,onClick:i,size:a,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=p.useRef();return s.jsx(yM,{value:{fieldRef:h,size:a,disabled:l,hasError:!!u,variant:d},children:s.jsx(Xn,{size:a,error:u,variant:d,component:"div",ref:t,onMouseDown:m=>{var g;m.preventDefault(),o==null||o(m),(g=h.current)==null||g.focus()},onClick:m=>{var g;m.preventDefault(),i==null||i(m),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1,children:r})})});Ba.displayName="@mantine/core/PillsInput";Ba.Field=Iy;function PM({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(za(i)?o.push({group:i.group,items:i.items.filter(a=>n.indexOf(a.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const kM={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Zf=K((e,t)=>{const n=V("MultiSelect",kM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:m,variant:g,data:v,dropdownOpened:S,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:w,onOptionSubmit:j,comboboxProps:E,filter:C,limit:T,withScrollArea:_,maxDropdownHeight:P,searchValue:M,defaultSearchValue:D,onSearchChange:N,readOnly:A,disabled:L,onFocus:I,onBlur:k,onPaste:R,radius:$,rightSection:B,rightSectionWidth:H,rightSectionPointerEvents:X,rightSectionProps:ye,leftSection:he,leftSectionWidth:be,leftSectionPointerEvents:ke,leftSectionProps:Ce,inputContainer:se,inputWrapperOrder:Ve,withAsterisk:ut,labelProps:lt,descriptionProps:We,errorProps:Ee,wrapperProps:Pe,description:ee,label:ne,error:Se,maxValues:qe,searchable:Ke,nothingFoundMessage:Le,withCheckIcon:Y,checkIconPosition:G,hidePickedOptions:pe,withErrorStyles:tt,name:Pt,form:yt,id:Lt,clearable:Kt,clearButtonProps:vn,hiddenInputProps:go,placeholder:ln,hiddenInputValuesDivider:Jo,required:zs,mod:hu,renderOption:Rh,onRemove:ur,onClear:Zo,scrollAreaProps:pu,...Bs}=n,fl=$n(Lt),Vs=GE(v),ei=QE(Vs),Tn=zc({opened:S,defaultOpened:y,onDropdownOpen:b,onDropdownClose:()=>{x==null||x(),Tn.resetSelectedOption()}}),{styleProps:_h,rest:{type:O,autoComplete:z,...q}}=Bo(Bs),[Q,ae]=pn({value:d,defaultValue:f,finalValue:[],onChange:h}),[Me,Te]=pn({value:M,defaultValue:D,finalValue:"",onChange:N}),me=le({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:l}),{resolvedClassNames:$e,resolvedStyles:Oe}=Rc({props:n,styles:a,classNames:r}),Yt=ze=>{m==null||m(ze),ze.key===" "&&!Ke&&(ze.preventDefault(),Tn.toggleDropdown()),ze.key==="Backspace"&&Me.length===0&&Q.length>0&&(ur==null||ur(Q[Q.length-1]),ae(Q.slice(0,Q.length-1)))},Xt=Q.map((ze,vo)=>{var _r,yo;return s.jsx(ms,{withRemoveButton:!A&&!((_r=ei[ze])!=null&&_r.disabled),onRemove:()=>{ae(Q.filter(ti=>ze!==ti)),ur==null||ur(ze)},unstyled:l,disabled:L,...me("pill"),children:((yo=ei[ze])==null?void 0:yo.label)||ze},`${ze}-${vo}`)});p.useEffect(()=>{w&&Tn.selectFirstOption()},[w,Q]);const Re=Kt&&Q.length>0&&!L&&!A&&s.jsx(Ie.ClearButton,{size:u,...vn,onClear:()=>{Zo==null||Zo(),ae([]),Te("")}}),dt=PM({data:Vs,value:Q});return s.jsxs(s.Fragment,{children:[s.jsxs(Ie,{store:Tn,classNames:$e,styles:Oe,unstyled:l,size:u,readOnly:A,__staticSelector:"MultiSelect",onOptionSubmit:ze=>{j==null||j(ze),Te(""),Tn.updateSelectedOptionIndex("selected"),Q.includes(ei[ze].value)?(ae(Q.filter(vo=>vo!==ei[ze].value)),ur==null||ur(ei[ze].value)):Q.length<qe&&ae([...Q,ei[ze].value])},...E,children:[s.jsx(Ie.DropdownTarget,{children:s.jsx(Ba,{..._h,__staticSelector:"MultiSelect",classNames:$e,styles:Oe,unstyled:l,size:u,className:o,style:i,variant:g,disabled:L,radius:$,rightSection:B||Re||s.jsx(Ie.Chevron,{size:u,error:Se,unstyled:l}),rightSectionPointerEvents:X||(Re?"all":"none"),rightSectionWidth:H,rightSectionProps:ye,leftSection:he,leftSectionWidth:be,leftSectionPointerEvents:ke,leftSectionProps:Ce,inputContainer:se,inputWrapperOrder:Ve,withAsterisk:ut,labelProps:lt,descriptionProps:We,errorProps:Ee,wrapperProps:Pe,description:ee,label:ne,error:Se,multiline:!0,withErrorStyles:tt,__stylesApiProps:{...n,rightSectionPointerEvents:X||(Re?"all":"none"),multiline:!0},pointer:!Ke,onClick:()=>Ke?Tn.openDropdown():Tn.toggleDropdown(),"data-expanded":Tn.dropdownOpened||void 0,id:fl,required:zs,mod:hu,children:s.jsxs(ms.Group,{disabled:L,unstyled:l,...me("pillsList"),children:[Xt,s.jsx(Ie.EventsTarget,{autoComplete:z,children:s.jsx(Ba.Field,{...q,ref:t,id:fl,placeholder:ln,type:!Ke&&!ln?"hidden":"visible",...me("inputField"),unstyled:l,onFocus:ze=>{I==null||I(ze),Ke&&Tn.openDropdown()},onBlur:ze=>{k==null||k(ze),Tn.closeDropdown(),Te("")},onKeyDown:Yt,value:Me,onChange:ze=>{Te(ze.currentTarget.value),Ke&&Tn.openDropdown(),w&&Tn.selectFirstOption()},disabled:L,readOnly:A||!Ke,pointer:!Ke})})]})})}),s.jsx(Y5,{data:pe?dt:Vs,hidden:A||L,filter:C,search:Me,limit:T,hiddenWhenEmpty:!Ke||!Le||pe&&dt.length===0&&Me.trim().length===0,withScrollArea:_,maxDropdownHeight:P,filterOptions:Ke,value:Q,checkIconPosition:G,withCheckIcon:Y,nothingFoundMessage:Le,unstyled:l,labelId:ne?`${fl}-label`:void 0,"aria-label":ne?void 0:Bs["aria-label"],renderOption:Rh,scrollAreaProps:pu})]}),s.jsx(Ie.HiddenInput,{name:Pt,valuesDivider:Jo,value:Q,form:yt,disabled:L,...go})]})});Zf.classes={...Xn.classes,...Ie.classes};Zf.displayName="@mantine/core/MultiSelect";function RM(e){return"group"in e}function Ay({data:e}){if(RM(e)){const o=e.items.map(i=>s.jsx(Ay,{data:i},i.value));return s.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}Ay.displayName="@mantine/core/NativeSelectOption";const _M={rightSectionPointerEvents:"none"},Tt=K((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:a,unstyled:l,...c}=V("NativeSelect",_M,e),u=GE(n).map((d,f)=>s.jsx(Ay,{data:d},f));return s.jsx(Xn,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:a||s.jsx(zf,{size:o,error:i,unstyled:l}),children:r||u})});Tt.classes=Xn.classes;Tt.displayName="@mantine/core/NativeSelect";var TT={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const DM={withCloseButton:!0},IM=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:ot(t),"--notification-color":n?rt(n,e):void 0}}),Ny=K((e,t)=>{const n=V("Notification",DM,e),{className:r,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:m,classNames:g,style:v,styles:S,unstyled:y,variant:b,vars:x,mod:w,...j}=n,E=le({name:"Notification",classes:TT,props:n,className:r,style:v,classNames:g,styles:S,unstyled:y,vars:x,varsResolver:IM});return s.jsxs(W,{...E("root"),mod:[{"data-with-icon":!!d||a,"data-with-border":c},w],ref:t,variant:b,...j,role:"alert",children:[d&&!a&&s.jsx("div",{...E("icon"),children:d}),a&&s.jsx(Qn,{size:28,color:o,...E("loader")}),s.jsxs("div",{...E("body"),children:[u&&s.jsx("div",{...E("title"),children:u}),s.jsx(W,{...E("description"),mod:{"data-with-title":!!u},children:f})]}),l&&s.jsx(_s,{iconSize:16,color:"gray",...m,unstyled:y,onClick:h,...E("closeButton")})]})});Ny.classes=TT;Ny.displayName="@mantine/core/Notification";function PT(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 gc;(function(e){e.event="event",e.props="prop"})(gc||(gc={}));function fi(){}function AM(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,a){return i===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function vc(e){return!!(e||"").match(/\d/)}function ka(e){return e==null}function NM(e){return typeof e=="number"&&isNaN(e)}function kT(e){return ka(e)||NM(e)||typeof e=="number"&&!isFinite(e)}function RT(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function MM(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 OM(e,t,n){var r=MM(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 $M(e){var t=p.useRef(e);t.current=e;var n=p.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function My(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),i=o[0],a=o[1]||"";return{beforeDecimal:i,afterDecimal:a,hasNegation:n,addNegation:r}}function LM(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 _T(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function gb(e,t){return Array(t+1).join(e)}function DT(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 a=1+i,l=o.length;return a<0?o="0."+gb("0",Math.abs(a))+o:a>=l?o=o+gb("0",a-l):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function vb(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=My(e),i=o.beforeDecimal,a=o.afterDecimal,l=o.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a: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=_T(d[1]||"",t,n),m=l?"-":"",g=r?".":"";return""+m+f+g+h}function Ki(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 IT=AM(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 FM(e,t,n){return Math.min(Math.max(e,t),n)}function bp(e){return Math.max(e.selectionStart,e.selectionEnd)}function zM(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function BM(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function VM(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function UM(e,t,n,r,o,i,a){a===void 0&&(a=VM);var l=o.findIndex(function(w){return w}),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),m=0;m<u;m++){h[m]=-1;for(var g=0,v=d;g<v;g++){var S=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:m,formattedValueIndex:g});if(S&&f[g]!==!0){h[m]=g,f[g]=!0;break}}}for(var y=r;y<u&&(h[y]===-1||!i(n[y]));)y++;var b=y===u||h[y]===-1?d:h[y];for(y=r-1;y>0&&h[y]===-1;)y--;var x=y===-1||h[y]===-1?0:h[y]+1;return x>b?b:r-x<b-r?x:b}function yb(e,t,n,r){var o=e.length;if(t=FM(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 HM(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(vc(e[n])||vc(e[n-1]));return t}function AT(e,t,n,r,o,i){i===void 0&&(i=fi);var a=$M(function(g,v){var S,y;return kT(g)?(y="",S=""):typeof g=="number"||v?(y=typeof g=="number"?DT(g):g,S=r(y)):(y=o(g,void 0),S=r(y)),{formattedValue:S,numAsString:y}}),l=p.useState(function(){return a(ka(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;ka(e)&&(f=c.numAsString,h=!0);var m=a(f,h);return p.useMemo(function(){u(m)},[m.formattedValue]),[c,d]}function WM(e){return e.replace(/[^0-9]/g,"")}function qM(e){return e}function GM(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,a=e.format;a===void 0&&(a=qM);var l=e.removeFormatting;l===void 0&&(l=WM);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=fi);var m=e.onKeyDown;m===void 0&&(m=fi);var g=e.onMouseUp;g===void 0&&(g=fi);var v=e.onFocus;v===void 0&&(v=fi);var S=e.onBlur;S===void 0&&(S=fi);var y=e.value,b=e.getCaretBoundary;b===void 0&&(b=HM);var x=e.isValidInputCharacter;x===void 0&&(x=vc);var w=e.isCharacterSame,j=PT(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=AT(y,c,!!u,a,l,d),C=E[0],T=C.formattedValue,_=C.numAsString,P=E[1],M=p.useRef({formattedValue:T,numAsString:_}),D=function(ee,ne){M.current={formattedValue:ee.formattedValue,numAsString:ee.value},P(ee,ne)},N=p.useState(!1),A=N[0],L=N[1],I=p.useRef(null),k=p.useRef({setCaretTimeout:null,focusTimeout:null});p.useEffect(function(){return L(!0),function(){clearTimeout(k.current.setCaretTimeout),clearTimeout(k.current.focusTimeout)}},[]);var R=a,$=function(ee,ne){var Se=parseFloat(ne);return{formattedValue:ee,value:ne,floatValue:isNaN(Se)?void 0:Se}},B=function(ee,ne,Se){ee.selectionStart===0&&ee.selectionEnd===ee.value.length||(Ki(ee,ne),k.current.setCaretTimeout=setTimeout(function(){ee.value===Se&&ee.selectionStart!==ne&&Ki(ee,ne)},0))},H=function(ee,ne,Se){return yb(ee,ne,b(ee),Se)},X=function(ee,ne,Se){var qe=b(ne),Ke=UM(ne,T,ee,Se,qe,x,w);return Ke=yb(ne,Ke,qe),Ke},ye=function(ee){var ne=ee.formattedValue;ne===void 0&&(ne="");var Se=ee.input,qe=ee.source,Ke=ee.event,Le=ee.numAsString,Y;if(Se){var G=ee.inputValue||Se.value,pe=bp(Se);Se.value=ne,Y=X(G,ne,pe),Y!==void 0&&B(Se,Y,ne)}ne!==T&&D($(ne,Le),{event:Ke,source:qe})};p.useEffect(function(){var ee=M.current,ne=ee.formattedValue,Se=ee.numAsString;T!==ne&&(T!==_||ne!==Se)&&D($(T,_),{event:void 0,source:gc.props})},[T,_]);var he=I.current?bp(I.current):void 0,be=typeof window<"u"?p.useLayoutEffect:p.useEffect;be(function(){var ee=I.current;if(T!==M.current.formattedValue&&ee){var ne=X(M.current.formattedValue,T,he);ee.value=T,B(ee,ne,T)}},[T]);var ke=function(ee,ne,Se){var qe=IT(T,ee),Ke=Object.assign(Object.assign({},qe),{lastValue:T}),Le=l(ee,Ke),Y=R(Le);if(Le=l(Y,void 0),f&&!f($(Y,Le))){var G=ne.target,pe=bp(G),tt=X(ee,T,pe);return G.value=T,B(G,tt,T),!1}return ye({formattedValue:Y,numAsString:Le,inputValue:ee,event:ne,source:Se,input:ne.target}),!0},Ce=function(ee){var ne=ee.target,Se=ne.value,qe=ke(Se,ee,gc.event);qe&&h(ee)},se=function(ee){var ne=ee.target,Se=ee.key,qe=ne.selectionStart,Ke=ne.selectionEnd,Le=ne.value;Le===void 0&&(Le="");var Y;if(Se==="ArrowLeft"||Se==="Backspace"?Y=Math.max(qe-1,0):Se==="ArrowRight"?Y=Math.min(qe+1,Le.length):Se==="Delete"&&(Y=qe),Y===void 0||qe!==Ke){m(ee);return}var G=Y;if(Se==="ArrowLeft"||Se==="ArrowRight"){var pe=Se==="ArrowLeft"?"left":"right";G=H(Le,Y,pe),G!==Y&&ee.preventDefault()}else Se==="Delete"&&!x(Le[Y])?G=H(Le,Y,"right"):Se==="Backspace"&&!x(Le[Y])&&(G=H(Le,Y,"left"));G!==Y&&B(ne,G,Le),ee.isUnitTestRun&&B(ne,G,Le),m(ee)},Ve=function(ee){var ne=ee.target,Se=function(){var qe=ne.selectionStart,Ke=ne.selectionEnd,Le=ne.value;if(Le===void 0&&(Le=""),qe===Ke){var Y=H(Le,qe);Y!==qe&&B(ne,Y,Le)}};Se(),requestAnimationFrame(function(){Se()}),g(ee)},ut=function(ee){ee.persist&&ee.persist();var ne=ee.target,Se=ee.currentTarget;I.current=ne,k.current.focusTimeout=setTimeout(function(){var qe=ne.selectionStart,Ke=ne.selectionEnd,Le=ne.value;Le===void 0&&(Le="");var Y=H(Le,qe);Y!==qe&&!(qe===0&&Ke===Le.length)&&B(ne,Y,Le),v(Object.assign(Object.assign({},ee),{currentTarget:Se}))},0)},lt=function(ee){I.current=null,clearTimeout(k.current.focusTimeout),clearTimeout(k.current.setCaretTimeout),S(ee)},We=A&&zM()?"numeric":void 0,Ee=Object.assign({inputMode:We},j,{type:t,value:T,onChange:Ce,onKeyDown:se,onMouseUp:Ve,onFocus:ut,onBlur:lt});if(n==="text")return o?on.createElement(on.Fragment,null,o(T,j)||null):on.createElement("span",Object.assign({},j,{ref:i}),T);if(r){var Pe=r;return on.createElement(Pe,Object.assign({},Ee,{ref:i}))}return on.createElement("input",Object.assign({},Ee,{ref:i}))}function xb(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 a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=eh(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=My(e,a),m=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=_T(g,n,!!r)),u&&(m=OM(m,u,l)),o&&(m=o+m),i&&(g=g+i),v&&(m="-"+m),e=m+(f&&d||"")+g,e}function eh(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 QM(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 KM(e,t){return new RegExp("(^-)|[0-9]|"+RT(e),"g")}function YM(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function XM(e,t,n){var r;t===void 0&&(t=BM(e));var o=n.allowNegative,i=n.prefix;i===void 0&&(i="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,d=u.start,f=u.end,h=eh(n),m=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(vc(e)&&(e===i||e===a)&&t.lastValue==="")return e;if(f-d===1&&m.indexOf(e[d])!==-1){var S=l===0?"":g;e=e.substring(0,d)+S+e.substring(d+1,e.length)}var y=function(k,R,$){var B=!1,H=!1;i.startsWith("-")?B=!1:k.startsWith("--")?(B=!1,H=!0):a.startsWith("-")&&k.length===a.length?B=!1:k[0]==="-"&&(B=!0);var X=B?1:0;return H&&(X=2),X&&(k=k.substring(X),R-=X,$-=X),{value:k,start:R,end:$,hasNegation:B}},b=y(e,d,f),x=b.hasNegation;r=b,e=r.value,d=r.start,f=r.end;var w=y(t.lastValue,c.start,c.end),j=w.start,E=w.end,C=w.value,T=e.substring(d,f);e.length&&C.length&&(j>C.length-a.length||E<i.length)&&!(T&&a.startsWith(T))&&(e=C);var _=0;e.startsWith(i)?_+=i.length:d<i.length&&(_=d),e=e.substring(_),f-=_;var P=e.length,M=e.length-a.length;e.endsWith(a)?P=M:(f>M||f>e.length-a.length)&&(P=f),e=e.substring(0,P),e=QM(x?"-"+e:e,o),e=(e.match(KM(g))||[]).join("");var D=e.indexOf(g);e=e.replace(new RegExp(RT(g),"g"),function(k,R){return R===D?".":""});var N=My(e,o),A=N.beforeDecimal,L=N.afterDecimal,I=N.addNegation;return u.end-u.start<c.end-c.start&&A===""&&v&&!parseFloat(L)&&(e=I?"-":""),e}function JM(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 a=e.length;return o.fill(!1,a-r.length+1,a+1),o}function ZM(e){var t=eh(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 eO(e){e=ZM(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=fi);var i=e.onBlur;i===void 0&&(i=fi);var a=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,m=e.onValueChange,g=PT(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=eh(e),S=v.decimalSeparator,y=v.allowedDecimalSeparators,b=function(I){return xb(I,e)},x=function(I,k){return XM(I,k,e)},w=ka(f)?d:f,j=h??YM(w,u,t);ka(f)?ka(d)||(j=j||typeof d=="number"):j=j||typeof f=="number";var E=function(I){return kT(I)?I:(typeof I=="number"&&(I=DT(I)),j&&typeof l=="number"?vb(I,l,!!c):I)},C=AT(E(f),E(d),!!j,b,x,m),T=C[0],_=T.numAsString,P=T.formattedValue,M=C[1],D=function(I){var k=I.target,R=I.key,$=k.selectionStart,B=k.selectionEnd,H=k.value;if(H===void 0&&(H=""),$!==B){o(I);return}R==="Backspace"&&H[0]==="-"&&$===u.length+1&&n&&Ki(k,1),l&&c&&(R==="Backspace"&&H[$-1]===S?(Ki(k,$-1),I.preventDefault()):R==="Delete"&&H[$]===S&&I.preventDefault()),y!=null&&y.includes(R)&&H[$]===S&&Ki(k,$+1);var X=a===!0?",":a;R==="Backspace"&&H[$-1]===X&&Ki(k,$-1),R==="Delete"&&H[$]===X&&Ki(k,$+1),o(I)},N=function(I){var k=_;if(k.match(/\d/g)||(k=""),r||(k=LM(k)),c&&l&&(k=vb(k,l,c)),k!==_){var R=xb(k,e);M({formattedValue:R,value:k,floatValue:parseFloat(k)},{event:I,source:gc.event})}i(I)},A=function(I){return I===S?!0:vc(I)},L=function(I){var k=I.currentValue,R=I.lastValue,$=I.formattedValue,B=I.currentValueIndex,H=I.formattedValueIndex,X=k[B],ye=$[H],he=IT(R,k),be=he.to;return B>=be.start&&B<be.end&&y&&y.includes(X)&&ye===S?!0:X===ye};return Object.assign(Object.assign({},g),{value:P,valueIsNumericString:!1,isValidInputCharacter:A,isCharacterSame:L,onValueChange:M,format:b,removeFormatting:x,getCaretBoundary:function(I){return JM(I,e)},onKeyDown:D,onBlur:N})}function tO(e){var t=eO(e);return on.createElement(GM,Object.assign({},t))}function bb({direction:e,style:t,...n}){return s.jsx("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,children:s.jsx("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 Um={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const nO=/^-0(\.0*)?$/,rO=/^-?0\d+$/;function oO(e){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)}function wb(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 iO={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,startValue:0},sO=(e,{size:t})=>({controls:{"--ni-chevron-size":_e(t,"ni-chevron-size")}}),Oy=K((e,t)=>{const n=V("NumberInput",iO,e),{className:r,classNames:o,styles:i,unstyled:a,vars:l,onChange:c,onValueChange:u,value:d,defaultValue:f,max:h,min:m,step:g,hideControls:v,rightSection:S,isAllowed:y,clampBehavior:b,onBlur:x,allowDecimal:w,decimalScale:j,onKeyDown:E,onKeyDownCapture:C,handlersRef:T,startValue:_,disabled:P,rightSectionPointerEvents:M,allowNegative:D,readOnly:N,size:A,rightSectionWidth:L,stepHoldInterval:I,stepHoldDelay:k,allowLeadingZeros:R,withKeyboardEvents:$,...B}=n,H=le({name:"NumberInput",classes:Um,props:n,classNames:o,styles:i,unstyled:a,vars:l,varsResolver:sO}),{resolvedClassNames:X,resolvedStyles:ye}=Rc({classNames:o,styles:i,props:n}),[he,be]=pn({value:d,defaultValue:f,onChange:c}),ke=k!==void 0&&I!==void 0,Ce=p.useRef(null),se=p.useRef(null),Ve=p.useRef(0),ut=(G,pe)=>{pe.source==="event"&&be(oO(G.floatValue)&&!nO.test(G.value)&&!(R&&rO.test(G.value))?G.floatValue:G.value),u==null||u(G,pe)},lt=G=>{const pe=String(G).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return pe?Math.max(0,(pe[1]?pe[1].length:0)-(pe[2]?+pe[2]:0)):0},We=G=>{Ce.current&&typeof G<"u"&&Ce.current.setSelectionRange(G,G)},Ee=p.useRef();Ee.current=()=>{let G;const pe=lt(he),tt=lt(g),Pt=Math.max(pe,tt),yt=10**Pt;if(typeof he!="number"||Number.isNaN(he))G=wu(_,m,h);else if(h!==void 0){const Kt=(Math.round(he*yt)+Math.round(g*yt))/yt;G=Kt<=h?Kt:h}else G=(Math.round(he*yt)+Math.round(g*yt))/yt;const Lt=G.toFixed(Pt);be(parseFloat(Lt)),u==null||u({floatValue:parseFloat(Lt),formattedValue:Lt,value:Lt},{source:"increment"}),setTimeout(()=>{var Kt;return We((Kt=Ce.current)==null?void 0:Kt.value.length)},0)};const Pe=p.useRef();Pe.current=()=>{let G;const pe=m!==void 0?m:D?Number.MIN_SAFE_INTEGER:0,tt=lt(he),Pt=lt(g),yt=Math.max(tt,Pt),Lt=10**yt;if(typeof he!="number"||Number.isNaN(he))G=wu(_,pe,h);else{const vn=(Math.round(he*Lt)-Math.round(g*Lt))/Lt;G=pe!==void 0&&vn<pe?pe:vn}const Kt=G.toFixed(yt);be(parseFloat(Kt)),u==null||u({floatValue:parseFloat(Kt),formattedValue:Kt,value:Kt},{source:"decrement"}),setTimeout(()=>{var vn;return We((vn=Ce.current)==null?void 0:vn.value.length)},0)};const ee=G=>{E==null||E(G),!(N||!$)&&(G.key==="ArrowUp"&&(G.preventDefault(),Ee.current()),G.key==="ArrowDown"&&(G.preventDefault(),Pe.current()))},ne=G=>{if(C==null||C(G),G.key==="Backspace"){const pe=Ce.current;pe.selectionStart===0&&pe.selectionStart===pe.selectionEnd&&(G.preventDefault(),window.setTimeout(()=>We(0),0))}};pf(T,{increment:Ee.current,decrement:Pe.current});const Se=G=>{G?Ee.current():Pe.current(),Ve.current+=1},qe=G=>{if(Se(G),ke){const pe=typeof I=="number"?I:I(Ve.current);se.current=window.setTimeout(()=>qe(G),pe)}},Ke=(G,pe)=>{var tt;G.preventDefault(),(tt=Ce.current)==null||tt.focus(),Se(pe),ke&&(se.current=window.setTimeout(()=>qe(pe),k))},Le=()=>{se.current&&window.clearTimeout(se.current),se.current=null,Ve.current=0},Y=s.jsxs("div",{...H("controls"),children:[s.jsx(gn,{...H("control"),tabIndex:-1,"aria-hidden":!0,disabled:P||typeof he=="number"&&h!==void 0&&he>=h,mod:{direction:"up"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{Ke(G,!0)},onPointerUp:Le,onPointerLeave:Le,children:s.jsx(bb,{direction:"up"})}),s.jsx(gn,{...H("control"),tabIndex:-1,"aria-hidden":!0,disabled:P||typeof he=="number"&&m!==void 0&&he<=m,mod:{direction:"down"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{Ke(G,!1)},onPointerUp:Le,onPointerLeave:Le,children:s.jsx(bb,{direction:"down"})})]});return s.jsx(Xn,{component:tO,allowNegative:D,className:nt(Um.root,r),size:A,...B,readOnly:N,disabled:P,value:he,getInputRef:Qt(t,Ce),onValueChange:ut,rightSection:v||N?S:S||Y,classNames:X,styles:ye,unstyled:a,__staticSelector:"NumberInput",decimalScale:w?j:0,onKeyDown:ee,onKeyDownCapture:ne,rightSectionPointerEvents:M??(P?"none":void 0),rightSectionWidth:L??`var(--ni-right-section-width-${A||"sm"})`,allowLeadingZeros:R,onBlur:G=>{x==null||x(G),b==="blur"&&typeof he=="number"&&wu(he,m,h)!==he&&be(wu(he,m,h))},isAllowed:G=>b==="strict"?y?y(G)&&wb(G.floatValue,m,h):wb(G.floatValue,m,h):y?y(G):!0})});Oy.classes={...Xn.classes,...Um};Oy.displayName="@mantine/core/NumberInput";const[aO,th]=On("Pagination.Root component was not found in tree");var Uc={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const lO={withPadding:!0},Hc=K((e,t)=>{const n=V("PaginationControl",lO,e),{classNames:r,className:o,style:i,styles:a,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=th(),g=u||m.disabled;return s.jsx(gn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...m.getStyles("control",{className:o,style:i,classNames:r,styles:a,active:!g}),...h})});Hc.classes=Uc;Hc.displayName="@mantine/core/PaginationControl";function Wc({style:e,children:t,path:n,...r}){return s.jsx("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,children:s.jsx("path",{d:n,fill:"currentColor"})})}const cO=e=>s.jsx(Wc,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),uO=e=>s.jsx(Wc,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),dO=e=>s.jsx(Wc,{...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"}),fO=e=>s.jsx(Wc,{...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"}),hO=e=>s.jsx(Wc,{...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"}),pO={icon:hO},nh=K((e,t)=>{const n=V("PaginationDots",pO,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,...u}=n,d=th(),f=c;return s.jsx(W,{ref:t,...d.getStyles("dots",{className:o,style:i,styles:a,classNames:r}),...u,children:s.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});nh.classes=Uc;nh.displayName="@mantine/core/PaginationDots";function rh({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((a,l)=>{const{icon:c,...u}=V(t,o,a),d=c,f=th(),h=r==="next"?f.active===f.total:f.active===1;return s.jsx(Hc,{disabled:f.disabled||h,ref:l,onClick:f[n],withPadding:!1,...u,children:s.jsx(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 NT=rh({icon:cO,name:"PaginationNext",action:"onNext",type:"next"}),MT=rh({icon:uO,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),OT=rh({icon:dO,name:"PaginationFirst",action:"onFirst",type:"previous"}),$T=rh({icon:fO,name:"PaginationLast",action:"onLast",type:"next"});function $y({dotsIcon:e}){const t=th(),n=t.range.map((r,o)=>{var i;return r==="dots"?s.jsx(nh,{icon:e},o):s.jsx(Hc,{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),children:r},o)});return s.jsx(s.Fragment,{children:n})}$y.displayName="@mantine/core/PaginationItems";const mO={siblings:1,boundaries:1},gO=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:ot(n),"--pagination-control-size":_e(t,"pagination-control-size"),"--pagination-control-fz":sn(t),"--pagination-active-bg":r?rt(r,e):void 0,"--pagination-active-color":js(o,e)?zo({color:r,theme:e,autoContrast:o}):void 0}}),oh=K((e,t)=>{const n=V("PaginationRoot",mO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:m,siblings:g,boundaries:v,color:S,radius:y,onNextPage:b,onPreviousPage:x,onFirstPage:w,onLastPage:j,getItemProps:E,autoContrast:C,...T}=n,_=le({name:"Pagination",classes:Uc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:gO}),{range:P,setPage:M,next:D,previous:N,active:A,first:L,last:I}=U_({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),k=er(b,D),R=er(x,N),$=er(w,L),B=er(j,I);return s.jsx(aO,{value:{total:u,range:P,active:A,disabled:m,getItemProps:E,onChange:M,onNext:k,onPrevious:R,onFirst:$,onLast:B,getStyles:_},children:s.jsx(W,{ref:t,..._("root"),...T})})});oh.classes=Uc;oh.displayName="@mantine/core/PaginationRoot";const vO={withControls:!0,siblings:1,boundaries:1,gap:8},Kr=K((e,t)=>{const n=V("Pagination",vO,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:a,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,...m}=n;return f<=0?null:s.jsx(oh,{ref:t,total:f,...m,children:s.jsxs(Z,{gap:h,children:[r&&s.jsx(OT,{icon:u,...i==null?void 0:i("first")}),o&&s.jsx(MT,{icon:l,...i==null?void 0:i("previous")}),s.jsx($y,{dotsIcon:d}),o&&s.jsx(NT,{icon:a,...i==null?void 0:i("next")}),r&&s.jsx($T,{icon:c,...i==null?void 0:i("last")})]})})});Kr.classes=Uc;Kr.displayName="@mantine/core/Pagination";Kr.Root=oh;Kr.Control=Hc;Kr.Dots=nh;Kr.First=OT;Kr.Last=$T;Kr.Next=NT;Kr.Previous=MT;Kr.Items=$y;const yO=({reveal:e})=>s.jsx("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)"},children:s.jsx("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 Hm={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const xO={visibilityToggleIcon:yO},bO=(e,{size:t})=>({root:{"--psi-icon-size":_e(t,"psi-icon-size"),"--psi-button-size":_e(t,"psi-button-size")}}),Vr=K((e,t)=>{const n=V("PasswordInput",xO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:m,variant:g,inputContainer:v,description:S,label:y,size:b,errorProps:x,descriptionProps:w,labelProps:j,withAsterisk:E,inputWrapperOrder:C,wrapperProps:T,radius:_,rightSection:P,rightSectionWidth:M,rightSectionPointerEvents:D,leftSectionWidth:N,visible:A,defaultVisible:L,onVisibilityChange:I,visibilityToggleIcon:k,visibilityToggleButtonProps:R,rightSectionProps:$,leftSectionProps:B,leftSectionPointerEvents:H,mod:X,...ye}=n,he=$n(m),[be,ke]=pn({value:A,defaultValue:L,finalValue:!1,onChange:I}),Ce=()=>ke(!be),se=le({name:"PasswordInput",classes:Hm,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:bO}),{resolvedClassNames:Ve,resolvedStyles:ut}=Rc({classNames:r,styles:a,props:n}),{styleProps:lt,rest:We}=Bo(ye),Ee=k,Pe=s.jsx(tn,{...se("visibilityToggle"),disabled:h,radius:_,"aria-hidden":!R,tabIndex:-1,...R,variant:"subtle",color:"gray",unstyled:l,onMouseDown:ee=>{var ne;ee.preventDefault(),(ne=R==null?void 0:R.onMouseDown)==null||ne.call(R,ee),Ce()},onKeyDown:ee=>{var ne;(ne=R==null?void 0:R.onKeyDown)==null||ne.call(R,ee),ee.key===" "&&(ee.preventDefault(),Ce())},children:s.jsx(Ee,{reveal:be})});return s.jsx(Dt.Wrapper,{required:u,id:he,label:y,error:d,description:S,size:b,classNames:Ve,styles:ut,__staticSelector:"PasswordInput",errorProps:x,descriptionProps:w,unstyled:l,withAsterisk:E,inputWrapperOrder:C,inputContainer:v,variant:g,labelProps:{...j,htmlFor:he},mod:X,...se("root"),...lt,...T,children:s.jsx(Dt,{component:"div",error:d,leftSection:f,size:b,classNames:{...Ve,input:nt(Hm.input,Ve.input)},styles:ut,radius:_,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:M,rightSection:P??Pe,variant:g,unstyled:l,leftSectionWidth:N,rightSectionPointerEvents:D||"all",rightSectionProps:$,leftSectionProps:B,leftSectionPointerEvents:H,withAria:!1,children:s.jsx("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...se("innerInput"),disabled:h,id:he,ref:t,...We,autoComplete:We.autoComplete||"off",type:be?"text":"password"})})})});Vr.classes={...Xn.classes,...Hm};Vr.displayName="@mantine/core/PasswordInput";const[wO,LT]=Ss(),[SO,jO]=Ss();var FT={card:"m_9dc8ae12"};const CO={withBorder:!0},EO=(e,{radius:t})=>({card:{"--card-radius":ot(t)}}),Ly=K((e,t)=>{const n=V("RadioCard",CO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,checked:u,mod:d,withBorder:f,value:h,onClick:m,name:g,onKeyDown:v,...S}=n,y=le({name:"RadioCard",classes:FT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:EO,rootSelector:"card"}),{dir:b}=Es(),x=LT(),w=typeof u=="boolean"?u:(x==null?void 0:x.value)===h||!1,j=g||(x==null?void 0:x.name),E=C=>{if(v==null||v(C),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(C.nativeEvent.code)){C.preventDefault();const T=Array.from(document.querySelectorAll(`[role="radio"][name="${j||"__mantine"}"]`)),_=T.findIndex(D=>D===C.target),P=_+1>=T.length?0:_+1,M=_-1<0?T.length-1:_-1;C.nativeEvent.code==="ArrowDown"&&(T[P].focus(),T[P].click()),C.nativeEvent.code==="ArrowUp"&&(T[M].focus(),T[M].click()),C.nativeEvent.code==="ArrowLeft"&&(T[b==="ltr"?M:P].focus(),T[b==="ltr"?M:P].click()),C.nativeEvent.code==="ArrowRight"&&(T[b==="ltr"?P:M].focus(),T[b==="ltr"?P:M].click())}};return s.jsx(SO,{value:{checked:w},children:s.jsx(gn,{ref:t,mod:[{"with-border":f,checked:w},d],...y("card"),...S,role:"radio","aria-checked":w,name:j,onClick:C=>{m==null||m(C),x==null||x.onChange(h||"")},onKeyDown:E})})});Ly.displayName="@mantine/core/RadioCard";Ly.classes=FT;const TO={},Fy=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,name:c,readOnly:u,...d}=V("RadioGroup",TO,e),f=$n(c),[h,m]=pn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&m(typeof v=="string"?v:v.currentTarget.value);return s.jsx(wO,{value:{value:h,onChange:g,size:i,name:f},children:s.jsx(Dt.Wrapper,{size:i,ref:t,...a,...d,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(fy,{role:"radiogroup",children:l})})})});Fy.classes=Dt.Wrapper.classes;Fy.displayName="@mantine/core/RadioGroup";function zT({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:F(e),height:F(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var BT={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const PO={icon:zT},kO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Sr({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--radio-size":_e(r,"radio-size"),"--radio-radius":t===void 0?void 0:ot(t),"--radio-color":i==="outline"?c:rt(n,e),"--radio-icon-size":_e(r,"radio-icon-size"),"--radio-icon-color":o?rt(o,e):js(a,e)?zo({color:n,theme:e,autoContrast:a}):void 0}}},zy=K((e,t)=>{const n=V("RadioIndicator",PO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,icon:u,radius:d,color:f,iconColor:h,autoContrast:m,checked:g,mod:v,variant:S,disabled:y,...b}=n,x=u,w=le({name:"RadioIndicator",classes:BT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:kO,rootSelector:"indicator"}),j=jO(),E=typeof g=="boolean"?g:(j==null?void 0:j.checked)||!1;return s.jsx(W,{ref:t,...w("indicator",{variant:S}),variant:S,mod:[{checked:E,disabled:y},v],...b,children:s.jsx(x,{...w("icon")})})});zy.displayName="@mantine/core/RadioIndicator";zy.classes=BT;var VT={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const RO={labelPosition:"right"},_O=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Sr({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":_e(t,"radio-size"),"--radio-radius":n===void 0?void 0:ot(n),"--radio-color":i==="outline"?c:rt(r,e),"--radio-icon-color":o?rt(o,e):js(a,e)?zo({color:r,theme:e,autoContrast:a}):void 0,"--radio-icon-size":_e(t,"radio-icon-size")}}},gs=K((e,t)=>{const n=V("Radio",RO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:m,error:g,radius:v,color:S,variant:y,disabled:b,wrapperProps:x,icon:w=zT,rootRef:j,iconColor:E,onChange:C,mod:T,..._}=n,P=le({name:"Radio",classes:VT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:_O}),M=LT(),D=(M==null?void 0:M.size)??d,N=n.size?d:D,{styleProps:A,rest:L}=Bo(_),I=$n(u),k=M?{checked:M.value===L.value,name:L.name??M.name,onChange:R=>{M.onChange(R),C==null||C(R)}}:{};return s.jsx(Bf,{...P("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:N,labelPosition:h,label:f,description:m,error:g,disabled:b,classNames:r,styles:a,unstyled:l,"data-checked":k.checked||void 0,variant:y,ref:j,mod:T,...A,...x,children:s.jsxs(W,{...P("inner"),mod:{"label-position":h},children:[s.jsx(W,{...P("radio",{focusable:!0,variant:y}),onChange:C,...L,...k,component:"input",mod:{error:!!g},ref:t,id:I,disabled:b,type:"radio"}),s.jsx(w,{...P("icon"),"aria-hidden":!0})]})})});gs.classes=VT;gs.displayName="@mantine/core/Radio";gs.Group=Fy;gs.Card=Ly;gs.Indicator=zy;const DO={duration:100,transition:"fade"};function IO(e,t){return{...DO,...t,...e}}function AO({offset:e,position:t}){const[n,r]=p.useState(!1),o=p.useRef(),{x:i,y:a,elements:l,refs:c,update:u,placement:d}=Uv({placement:t,middleware:[Fv({crossAxis:!0,padding:5,rootBoundary:"document"})]}),f=d.includes("right")?e:t.includes("left")?e*-1:0,h=d.includes("bottom")?e:t.includes("top")?e*-1:0,m=p.useCallback(({clientX:g,clientY: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 p.useEffect(()=>{if(c.floating.current){const g=o.current;g.addEventListener("mousemove",m);const v=Po(c.floating.current);return v.forEach(S=>{S.addEventListener("scroll",u)}),()=>{g.removeEventListener("mousemove",m),v.forEach(S=>{S.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,m,n]),{handleMouseMove:m,x:i,y:a,opened:n,setOpened:r,boundaryRef:o,floating:c.setFloating}}var ih={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const NO={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Gr("popover")},MO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ot(t),"--tooltip-bg":n?rt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),By=K((e,t)=>{const n=V("TooltipFloating",NO,e),{children:r,refProp:o,withinPortal:i,style:a,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:m,offset:g,position:v,multiline:S,zIndex:y,disabled:b,variant:x,vars:w,portalProps:j,...E}=n,C=It(),T=le({name:"TooltipFloating",props:n,classes:ih,className:l,style:a,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:w,varsResolver:MO}),{handleMouseMove:_,x:P,y:M,opened:D,boundaryRef:N,floating:A,setOpened:L}=AO({offset:g,position:v});if(!Fo(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 I=Qt(N,r.ref,t),k=$=>{var B,H;(H=(B=r.props).onMouseEnter)==null||H.call(B,$),_($),L(!0)},R=$=>{var B,H;(H=(B=r.props).onMouseLeave)==null||H.call(B,$),L(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Rs,{...j,withinPortal:i,children:s.jsx(W,{...E,...T("tooltip",{style:{...BS(a,C),zIndex:y,display:!b&&D?"block":"none",top:(M&&Math.round(M))??"",left:(P&&Math.round(P))??""}}),variant:x,ref:A,mod:{multiline:S},children:m})}),p.cloneElement(r,{...r.props,[o]:I,onMouseEnter:k,onMouseLeave:R})]})});By.classes=ih;By.displayName="@mantine/core/TooltipFloating";const UT=p.createContext(!1),OO=UT.Provider,$O=()=>p.useContext(UT),LO={openDelay:0,closeDelay:0};function HT(e){const{openDelay:t,closeDelay:n,children:r}=V("TooltipGroup",LO,e);return s.jsx(OO,{value:!0,children:s.jsx(O4,{delay:{open:t,close:n},children:r})})}HT.displayName="@mantine/core/TooltipGroup";function FO(e){var E,C,T;const[t,n]=p.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=$O(),a=$n(),{delay:l,currentId:c,setCurrentId:u}=jE(),d=p.useCallback(_=>{n(_),_&&u(a)},[u,a]),{x:f,y:h,context:m,refs:g,update:v,placement:S,middlewareData:{arrow:{x:y,y:b}={}}}=Uv({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[yE(e.offset),Fv({padding:8}),Fm(),xE({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[zm()]:[]]}),{getReferenceProps:x,getFloatingProps:w}=U4([M4(m,{enabled:(E=e.events)==null?void 0:E.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((C=e.events)!=null&&C.touch)}),V4(m,{enabled:(T=e.events)==null?void 0:T.focus,visibleOnly:!0}),W4(m,{role:"tooltip"}),z4(m,{enabled:typeof e.opened>"u"}),$4(m,{id:a})]);_E({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Ro(()=>{var _;(_=e.onPositionChange)==null||_.call(e,S)},[S]);const j=o&&c&&c!==a;return{x:f,y:h,arrowX:y,arrowY:b,reference:g.setReference,floating:g.setFloating,getFloatingProps:w,getReferenceProps:x,isGroupPhase:j,opened:o,placement:S}}const Sb={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:Gr("popover"),positionDependencies:[]},zO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ot(t),"--tooltip-bg":n?rt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Is=K((e,t)=>{const n=V("Tooltip",Sb,e),{children:r,position:o,refProp:i,label:a,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,withinPortal:f,radius:h,color:m,classNames:g,styles:v,unstyled:S,style:y,className:b,withArrow:x,arrowSize:w,arrowOffset:j,arrowRadius:E,arrowPosition:C,offset:T,transitionProps:_,multiline:P,events:M,zIndex:D,disabled:N,positionDependencies:A,onClick:L,onMouseEnter:I,onMouseLeave:k,inline:R,variant:$,keepMounted:B,vars:H,portalProps:X,mod:ye,floatingStrategy:he,...be}=V("Tooltip",Sb,n),{dir:ke}=Es(),Ce=p.useRef(null),se=FO({position:CE(ke,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,events:M,arrowRef:Ce,arrowOffset:j,offset:typeof T=="number"?T+(x?w/2:0):T,positionDependencies:[...A,r],inline:R,strategy:he}),Ve=le({name:"Tooltip",props:n,classes:ih,className:b,style:y,classNames:g,styles:v,unstyled:S,rootSelector:"tooltip",vars:H,varsResolver:zO});if(!Fo(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 ut=Qt(se.reference,r.ref,t),lt=IO(_,{duration:100,transition:"fade"});return s.jsxs(s.Fragment,{children:[s.jsx(Rs,{...X,withinPortal:f,children:s.jsx(Ho,{...lt,keepMounted:B,mounted:!N&&!!se.opened,duration:se.isGroupPhase?10:lt.duration,children:We=>s.jsxs(W,{...be,variant:$,mod:[{multiline:P},ye],...se.getFloatingProps({ref:se.floating,className:Ve("tooltip").className,style:{...Ve("tooltip").style,...We,zIndex:D,top:se.y??0,left:se.x??0}}),children:[a,s.jsx(Hv,{ref:Ce,arrowX:se.arrowX,arrowY:se.arrowY,visible:x,position:se.placement,arrowSize:w,arrowOffset:j,arrowRadius:E,arrowPosition:C,...Ve("arrow")})]})})}),p.cloneElement(r,se.getReferenceProps({onClick:L,onMouseEnter:I,onMouseLeave:k,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:ut,className:nt(b,r.props.className),...r.props}))]})});Is.classes=ih;Is.displayName="@mantine/core/Tooltip";Is.Floating=By;Is.Group=HT;function BO({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*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:a||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:o?0:i||0}}function WT({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:a,lineRoundCaps:l,tooltip:c,getStyles:u,display:d,...f}){const h=It();return s.jsx(Is.Floating,{disabled:!c,label:c,children:s.jsx(W,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":a?rt(a,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...BO({sum:r,size:e,thickness:o,value:t,offset:n,root:i})})})}WT.displayName="@mantine/core/Curve";function VO({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((d,f)=>d+f.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;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*a;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 qT={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function UO(e,t){return Math.min(e||12,(t||120)/4)}const HO={size:120,thickness:12},WO=(e,{size:t,thickness:n})=>({root:{"--rp-size":F(t),"--rp-label-offset":F(n*2)}}),sh=K((e,t)=>{const n=V("RingProgress",HO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:m,rootColor:g,...v}=n,S=le({name:"RingProgress",classes:qT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:WO}),y=UO(h,f),b=VO({size:f,thickness:y,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:x,sum:w,root:j,lineRoundCaps:E,offset:C},T)=>p.createElement(WT,{...x,key:T,size:f,thickness:y,sum:w,offset:C,color:x==null?void 0:x.color,root:j,lineRoundCaps:E,getStyles:S}));return s.jsxs(W,{...S("root"),size:f,ref:t,...v,children:[s.jsx("svg",{...S("svg"),children:b}),u&&s.jsx("div",{...S("label"),children:u})]})});sh.classes=qT;sh.displayName="@mantine/core/RingProgress";var GT={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const qO={withItemsBorders:!0},GO=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:ot(t),"--sc-color":n?rt(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":_e(o,"sc-padding"),"--sc-font-size":sn(o)}}),Vy=K((e,t)=>{var ke,Ce;const n=V("SegmentedControl",qO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:m,name:g,disabled:v,readOnly:S,fullWidth:y,orientation:b,radius:x,color:w,transitionDuration:j,transitionTimingFunction:E,variant:C,autoContrast:T,withItemsBorders:_,mod:P,...M}=n,D=le({name:"SegmentedControl",props:n,classes:GT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:GO}),N=It(),A=u.map(se=>typeof se=="string"?{label:se,value:se}:se),L=q_(),[I,k]=p.useState(null),[R,$]=p.useState({}),B=(se,Ve)=>{R[Ve]=se,$(R)},[H,X]=pn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((ke=A.find(se=>!se.disabled))==null?void 0:ke.value)??((Ce=u[0])==null?void 0:Ce.value)??null:null,onChange:h}),ye=$n(g),he=A.map(se=>p.createElement(W,{...D("control"),mod:{active:H===se.value,orientation:b},key:se.value},s.jsx("input",{...D("input"),disabled:v||se.disabled,type:"radio",name:ye,value:se.value,id:`${ye}-${se.value}`,checked:H===se.value,onChange:()=>!S&&X(se.value),"data-focus-ring":N.focusRing}),s.jsx(W,{component:"label",...D("label"),mod:{active:H===se.value&&!(v||se.disabled),disabled:v||se.disabled,"read-only":S},htmlFor:`${ye}-${se.value}`,ref:Ve=>B(Ve,se.value),__vars:{"--sc-label-color":w!==void 0?zo({color:w,theme:N,autoContrast:T}):void 0},children:s.jsx("span",{...D("innerLabel"),children:se.label})}))),be=Qt(t,se=>k(se));return u.length===0?null:s.jsxs(W,{...D("root"),variant:C,size:m,ref:be,mod:[{"full-width":y,orientation:b,initialized:L,"with-items-borders":_},P],...M,role:"radiogroup",children:[typeof H=="string"&&s.jsx(Kv,{target:R[H],parent:I,component:"span",transitionDuration:"var(--sc-transition-duration)",...D("indicator")}),he]})});Vy.classes=GT;Vy.displayName="@mantine/core/SegmentedControl";function QO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=It(),i=t===void 0?e:t,a=Ii({"--sg-spacing-x":Wt(Lr(e)),"--sg-spacing-y":Wt(Lr(i)),"--sg-cols":(d=Lr(n))==null?void 0:d.toString()}),l=pt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=Wt(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=Wt(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=Ql(pt(l),o).filter(f=>pt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return s.jsx(Cs,{styles:a,media:u,selector:r})}function wp(e){return typeof e=="object"&&e!==null?pt(e):[]}function KO(e){return e.sort((t,n)=>Gl(t)-Gl(n))}function YO({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...wp(e),...wp(t),...wp(n)]));return KO(r)}function XO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var u;const o=t===void 0?e:t,i=Ii({"--sg-spacing-x":Wt(Lr(e)),"--sg-spacing-y":Wt(Lr(o)),"--sg-cols":(u=Lr(n))==null?void 0:u.toString()}),a=YO({spacing:e,verticalSpacing:t,cols:n}),l=a.reduce((d,f)=>(d[f]||(d[f]={}),typeof e=="object"&&e[f]!==void 0&&(d[f]["--sg-spacing-x"]=Wt(e[f])),typeof o=="object"&&o[f]!==void 0&&(d[f]["--sg-spacing-y"]=Wt(o[f])),typeof n=="object"&&n[f]!==void 0&&(d[f]["--sg-cols"]=n[f]),d),{}),c=a.map(d=>({query:`simple-grid (min-width: ${d})`,styles:l[d]}));return s.jsx(Cs,{styles:i,container:c,selector:r})}var QT={container:"m_925c2d2c",root:"m_2415a157"};const JO={cols:1,spacing:"md",type:"media"},Uy=K((e,t)=>{const n=V("SimpleGrid",JO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,type:h,...m}=n,g=le({name:"SimpleGrid",classes:QT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),v=_c();return h==="container"?s.jsxs(s.Fragment,{children:[s.jsx(XO,{...n,selector:`.${v}`}),s.jsx("div",{...g("container"),children:s.jsx(W,{ref:t,...g("root",{className:v}),...m})})]}):s.jsxs(s.Fragment,{children:[s.jsx(QO,{...n,selector:`.${v}`}),s.jsx(W,{ref:t,...g("root",{className:v}),...m})]})});Uy.classes=QT;Uy.displayName="@mantine/core/SimpleGrid";const ZO={},ah=K((e,t)=>{const{w:n,h:r,miw:o,mih:i,...a}=V("Space",ZO,e);return s.jsx(W,{ref:t,...a,w:n,miw:o??n,h:r,mih:i??r})});ah.displayName="@mantine/core/Space";var KT={root:"m_6d731127"};const e$={gap:"md",align:"stretch",justify:"flex-start"},t$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Wt(t),"--stack-align":n,"--stack-justify":r}}),Ae=K((e,t)=>{const n=V("Stack",e$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=le({name:"Stack",props:n,classes:KT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:t$});return s.jsx(W,{ref:t,...g("root"),variant:h,...m})});Ae.classes=KT;Ae.displayName="@mantine/core/Stack";const[n$,r$]=On("Stepper component was not found in tree"),qd=()=>null;qd.displayName="@mantine/core/StepperCompleted";var Hy={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 Uu=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,o$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Wy=K((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,step:l,state:c,color:u,icon:d,completedIcon:f,progressIcon:h,label:m,description:g,withIcon:v,iconSize:S,loading:y,allowStepClick:b,allowStepSelect:x,iconPosition:w,orientation:j,mod:E,...C}=V("StepperStep",o$,e),T=r$(),_=It(),P={classNames:n,styles:i},M=c==="stepCompleted"?null:c==="stepProgress"?h:d,D={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return s.jsxs(gn,{...T.getStyles("step",{className:r,style:o,variant:T.orientation,...P}),mod:[{"icon-position":w||T.iconPosition,"allow-click":b},E],ref:t,...D,...C,__vars:{"--step-color":u?rt(u,_):void 0},tabIndex:b?0:-1,children:[v&&s.jsxs("span",{...T.getStyles("stepWrapper",P),children:[s.jsxs("span",{...T.getStyles("stepIcon",P),...D,children:[s.jsx(Ho,{mounted:c==="stepCompleted",transition:"pop",duration:200,children:N=>s.jsx("span",{...T.getStyles("stepCompletedIcon",{style:N,...P}),children:y?s.jsx(Qn,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...T.getStyles("stepLoader",P)}):Uu(f,l)||s.jsx(Vf,{size:"60%"})})}),c!=="stepCompleted"?y?s.jsx(Qn,{...T.getStyles("stepLoader",P),size:"calc(var(--stepper-icon-size) / 2)",color:u}):Uu(M||d,l):null]}),j==="vertical"&&s.jsx("span",{...T.getStyles("verticalSeparator",P),"data-active":c==="stepCompleted"||void 0})]}),(m||g)&&s.jsxs("span",{...T.getStyles("stepBody",P),"data-orientation":T.orientation,"data-icon-position":w||T.iconPosition,children:[m&&s.jsx("span",{...T.getStyles("stepLabel",P),children:Uu(m,l)}),g&&s.jsx("span",{...T.getStyles("stepDescription",P),children:Uu(g,l)})]})]})});Wy.classes=Hy;Wy.displayName="@mantine/core/StepperStep";const i$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},s$=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:a})=>({root:{"--stepper-color":t?rt(t,e):void 0,"--stepper-icon-color":js(a,e)?zo({color:t,theme:e,autoContrast:a}):void 0,"--stepper-icon-size":n===void 0?_e(r,"stepper-icon-size"):F(n),"--stepper-content-padding":Wt(o),"--stepper-radius":i===void 0?void 0:ot(i),"--stepper-fz":sn(r),"--stepper-spacing":Wt(r)}}),Va=K((e,t)=>{var k,R,$;const n=V("Stepper",i$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:m,progressIcon:g,color:v,iconSize:S,contentPadding:y,orientation:b,iconPosition:x,size:w,radius:j,allowNextStepsSelect:E,wrap:C,...T}=n,_=le({name:"Stepper",classes:Hy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:s$}),P=p.Children.toArray(u),M=P.filter(B=>B.type!==qd),D=P.find(B=>B.type===qd),N=M.reduce((B,H,X)=>{const ye=f===X?"stepProgress":f>X?"stepCompleted":"stepInactive",be=typeof d!="function"?!1:typeof H.props.allowStepSelect=="boolean"?H.props.allowStepSelect:ye==="stepCompleted"||E;return B.push(p.cloneElement(H,{icon:H.props.icon||h||X+1,key:X,step:X,state:ye,onClick:()=>be&&(d==null?void 0:d(X)),allowStepClick:be,completedIcon:H.props.completedIcon||m,progressIcon:H.props.progressIcon||g,color:H.props.color||v,iconSize:S,radius:j,iconPosition:H.props.iconPosition||x,orientation:b,unstyled:l})),b==="horizontal"&&X!==M.length-1&&B.push(p.createElement("div",{..._("separator"),"data-active":X<f||void 0,"data-orientation":b,key:`separator-${X}`})),B},[]),A=(R=(k=M[f])==null?void 0:k.props)==null?void 0:R.children,L=($=D==null?void 0:D.props)==null?void 0:$.children,I=f>M.length-1?L:A;return s.jsx(n$,{value:{getStyles:_,orientation:b,iconPosition:x},children:s.jsxs(W,{..._("root"),ref:t,size:w,...T,children:[s.jsx(W,{..._("steps"),mod:{orientation:b,"icon-position":x,wrap:C&&b!=="vertical"},children:N}),I&&s.jsx("div",{..._("content"),children:I})]})})});Va.classes=Hy;Va.displayName="@mantine/core/Stepper";Va.Completed=qd;Va.Step=Wy;const YT=p.createContext(null),a$=YT.Provider,l$=()=>p.useContext(YT),c$={},qy=K((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=V("SwitchGroup",c$,e),[d,f]=pn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return s.jsx(a$,{value:{value:d,onChange:h,size:i},children:s.jsx(Dt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(fy,{role:"group",children:l})})})});qy.classes=Dt.Wrapper.classes;qy.displayName="@mantine/core/SwitchGroup";var XT={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const u$={labelPosition:"right"},d$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:ot(t),"--switch-height":_e(r,"switch-height"),"--switch-width":_e(r,"switch-width"),"--switch-thumb-size":_e(r,"switch-thumb-size"),"--switch-label-font-size":_e(r,"switch-label-font-size"),"--switch-track-label-padding":_e(r,"switch-track-label-padding"),"--switch-color":n?rt(n,e):void 0}}),qc=K((e,t)=>{const n=V("Switch",u$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:m,size:g,radius:v,wrapperProps:S,children:y,thumbIcon:b,checked:x,defaultChecked:w,onChange:j,labelPosition:E,description:C,error:T,disabled:_,variant:P,rootRef:M,mod:D,...N}=n,A=l$(),L=g||(A==null?void 0:A.size),I=le({name:"Switch",props:n,classes:XT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:d$}),{styleProps:k,rest:R}=Bo(N),$=$n(m),B=A?{checked:A.value.includes(R.value),onChange:A.onChange}:{},[H,X]=pn({value:B.checked??x,defaultValue:w,finalValue:!1});return s.jsxs(Bf,{...I("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:L,labelPosition:E,label:d,description:C,error:T,disabled:_,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:l,"data-checked":B.checked||void 0,variant:P,ref:M,mod:D,...k,...S,children:[s.jsx("input",{...R,disabled:_,checked:H,onChange:ye=>{var he;A?(he=B.onChange)==null||he.call(B,ye):j==null||j(ye),X(ye.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...I("input")}),s.jsxs(W,{"aria-hidden":"true",mod:{error:T,"label-position":E},...I("track"),children:[s.jsx(W,{component:"span",mod:"reduce-motion",...I("thumb"),children:b}),s.jsx("span",{...I("trackLabel"),children:H?h:f})]})]})});qc.classes={...XT,...tT};qc.displayName="@mantine/core/Switch";qc.Group=qy;const[f$,h$]=On("Table component was not found in the tree");var Gc={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 p$(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 As(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=K((o,i)=>{const a=V(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=a,h=h$();return s.jsx(W,{component:e,ref:i,...p$(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:a}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=Gc,r}const Wm=As("th",{columnBorder:!0}),JT=As("td",{columnBorder:!0}),dd=As("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),ZT=As("thead",{stickyHeader:!0}),eP=As("tbody"),tP=As("tfoot"),nP=As("caption",{captionSide:!0});function Gy({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(nP,{children:e.caption}),e.head&&s.jsx(ZT,{children:s.jsx(dd,{children:e.head.map((t,n)=>s.jsx(Wm,{children:t},n))})}),e.body&&s.jsx(eP,{children:e.body.map((t,n)=>s.jsx(dd,{children:t.map((r,o)=>s.jsx(JT,{children:r},o))},n))}),e.foot&&s.jsx(tP,{children:s.jsx(dd,{children:e.foot.map((t,n)=>s.jsx(Wm,{children:t},n))})})]})}Gy.displayName="@mantine/core/TableDataRenderer";const m$={type:"scrollarea"},g$=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":F(t),"--table-overflow":n==="native"?"auto":void 0}}),Qy=K((e,t)=>{const n=V("TableScrollContainer",m$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=le({name:"TableScrollContainer",classes:Gc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:g$,rootSelector:"scrollContainer"});return s.jsx(W,{component:f==="scrollarea"?Pr:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h,children:s.jsx("div",{...m("scrollContainerInner"),children:u})})});Qy.classes=Gc;Qy.displayName="@mantine/core/TableScrollContainer";const v$={withRowBorders:!0,verticalSpacing:7},y$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:a,highlightOnHoverColor:l,striped:c,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Wt(r),"--table-vertical-spacing":Wt(o),"--table-border-color":i?rt(i,e):void 0,"--table-striped-color":c&&a?rt(a,e):void 0,"--table-highlight-on-hover-color":u&&l?rt(l,e):void 0,"--table-sticky-header-offset":f?F(d):void 0}}),ce=K((e,t)=>{const n=V("Table",v$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:m,striped:g,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,withTableBorder:b,borderColor:x,layout:w,variant:j,data:E,children:C,stickyHeader:T,stickyHeaderOffset:_,mod:P,...M}=n,D=le({name:"Table",props:n,className:o,style:i,classes:Gc,classNames:r,styles:a,unstyled:l,rootSelector:"table",vars:c,varsResolver:y$});return s.jsx(f$,{value:{getStyles:D,stickyHeader:T,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,captionSide:f||"bottom"},children:s.jsx(W,{component:"table",variant:j,ref:t,mod:[{"data-with-table-border":b},P],...D("table"),...M,children:C||!!E&&s.jsx(Gy,{data:E})})})});ce.classes=Gc;ce.displayName="@mantine/core/Table";ce.Td=JT;ce.Th=Wm;ce.Tr=dd;ce.Thead=ZT;ce.Tbody=eP;ce.Tfoot=tP;ce.Caption=nP;ce.ScrollContainer=Qy;ce.DataRenderer=Gy;const[x$,Ky]=On("Tabs component was not found in the tree");var Qc={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 b$={},Yy=K((e,t)=>{const n=V("TabsList",b$,e),{children:r,className:o,grow:i,justify:a,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Ky();return s.jsx(W,{...f,...h.getStyles("list",{className:o,style:u,classNames:l,styles:c,props:n,variant:h.variant}),ref:t,role:"tablist",variant:h.variant,mod:[{grow:i,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},d],"aria-orientation":h.orientation,__vars:{"--tabs-justify":a},children:r})});Yy.classes=Qc;Yy.displayName="@mantine/core/TabsList";const w$={},Xy=K((e,t)=>{const n=V("TabsPanel",w$,e),{children:r,className:o,value:i,classNames:a,styles:l,style:c,mod:u,...d}=n,f=Ky(),h=f.value===i,m=f.keepMounted||n.keepMounted||h?r:null;return s.jsx(W,{...d,...f.getStyles("panel",{className:o,classNames:a,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),children:m})});Xy.classes=Qc;Xy.displayName="@mantine/core/TabsPanel";const S$={},Jy=K((e,t)=>{const n=V("TabsTab",S$,e),{className:r,children:o,rightSection:i,leftSection:a,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:m,styles:g,vars:v,mod:S,...y}=n,b=It(),{dir:x}=Es(),w=Ky(),j=l===w.value,E=T=>{w.onChange(w.allowTabDeactivation&&l===w.value?null:l),c==null||c(T)},C={classNames:m,styles:g,props:n};return s.jsxs(gn,{...y,...w.getStyles("tab",{className:r,style:h,variant:w.variant,...C}),disabled:d,unstyled:w.unstyled,variant:w.variant,mod:[{active:j,disabled:d,orientation:w.orientation,inverted:w.inverted,placement:w.orientation==="vertical"&&w.placement},S],ref:t,role:"tab",id:w.getTabId(l),"aria-selected":j,tabIndex:j||w.value===null?0:-1,"aria-controls":w.getPanelId(l),onClick:E,__vars:{"--tabs-color":f?rt(f,b):void 0},onKeyDown:CS({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:w.activateTabWithKeyboard,loop:w.loop,orientation:w.orientation||"horizontal",dir:x,onKeyDown:u}),children:[a&&s.jsx("span",{...w.getStyles("tabSection",C),"data-position":"left",children:a}),o&&s.jsx("span",{...w.getStyles("tabLabel",C),children:o}),i&&s.jsx("span",{...w.getStyles("tabSection",C),"data-position":"right",children:i})]})});Jy.classes=Qc;Jy.displayName="@mantine/core/TabsTab";const jb="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",j$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},C$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":ot(t),"--tabs-color":rt(n,e),"--tabs-text-color":js(r,e)?zo({color:n,theme:e,autoContrast:r}):void 0}}),Ze=K((e,t)=>{const n=V("Tabs",j$,e),{defaultValue:r,value:o,onChange:i,orientation:a,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,placement:S,keepMounted:y,classNames:b,styles:x,unstyled:w,className:j,style:E,vars:C,autoContrast:T,mod:_,...P}=n,M=$n(u),[D,N]=pn({value:o,defaultValue:r,finalValue:null,onChange:i}),A=le({name:"Tabs",props:n,classes:Qc,className:j,style:E,classNames:b,styles:x,unstyled:w,vars:C,varsResolver:C$});return s.jsx(x$,{value:{placement:S,value:D,orientation:a,id:M,loop:c,activateTabWithKeyboard:d,getTabId:g0(`${M}-tab`,jb),getPanelId:g0(`${M}-panel`,jb),onChange:N,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,keepMounted:y,unstyled:w,getStyles:A},children:s.jsx(W,{ref:t,id:M,variant:h,mod:[{orientation:a,inverted:a==="horizontal"&&v,placement:a==="vertical"&&S},_],...A("root"),...P,children:l})})});Ze.classes=Qc;Ze.displayName="@mantine/core/Tabs";Ze.Tab=Jy;Ze.Panel=Xy;Ze.List=Yy;const E$={},fe=K((e,t)=>{const n=V("TextInput",E$,e);return s.jsx(Xn,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});fe.classes=Xn.classes;fe.displayName="@mantine/core/TextInput";var rP={root:"m_7341320d"};const T$={},P$=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:a});return{root:{"--ti-size":_e(t,"ti-size"),"--ti-radius":n===void 0?void 0:ot(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}}},Zy=K((e,t)=>{const n=V("ThemeIcon",T$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,autoContrast:u,...d}=n,f=le({name:"ThemeIcon",classes:rP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:P$});return s.jsx(W,{ref:t,...f("root"),...d})});Zy.classes=rP;Zy.displayName="@mantine/core/ThemeIcon";const k$=["h1","h2","h3","h4","h5","h6"];function R$(e,t){const n=t!==void 0?t:`h${e}`;return k$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:F(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var oP={root:"m_8a5d1357"};const _$={order:1},D$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=R$(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}}},de=K((e,t)=>{const n=V("Title",_$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:m,mod:g,...v}=n,S=le({name:"Title",props:n,classes:oP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:D$});return[1,2,3,4,5,6].includes(c)?s.jsx(W,{...S("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...v}):null});de.classes=oP;de.displayName="@mantine/core/Title";function I$(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 A$(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const N$=()=>I$({notifications:[],queue:[],limit:5}),Ns=N$(),M$=(e=Ns)=>A$(e);function ol(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=Ns){const n=e.id||_g();return ol(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function iP(e,t=Ns){return ol(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function Nl(e,t=Ns){return ol(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function O$(e=Ns){ol(e,()=>[])}function $$(e=Ns){ol(e,t=>t.slice(0,e.getState().limit))}const co={show:ve,hide:iP,update:Nl,clean:O$,cleanQueue:$$,updateState:ol};function qm(e,t){return qm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},qm(e,t)}function sP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,qm(e,t)}var aP={exports:{}},L$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",F$=L$,z$=F$;function lP(){}function cP(){}cP.resetWarningCache=lP;var B$=function(){function e(r,o,i,a,l,c){if(c!==z$){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:cP,resetWarningCache:lP};return n.PropTypes=n,n};aP.exports=B$();var V$=aP.exports;const ft=Sg(V$),Cb={disabled:!1},Gd=on.createContext(null);var U$=function(t){return t.scrollTop},Ml="unmounted",qi="exited",Gi="entering",ra="entered",Gm="exiting",Go=function(e){sP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,l=a&&!a.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=qi,i.appearStatus=Gi):c=ra:r.unmountOnExit||r.mountOnEnter?c=Ml:c=qi,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Ml?{status:qi}: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 a=this.state.status;this.props.in?a!==Gi&&a!==ra&&(i=Gi):(a===Gi||a===ra)&&(i=Gm)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Gi){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:ga.findDOMNode(this);a&&U$(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===qi&&this.setState({status:Ml})},n.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[ga.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!a||Cb.disabled){this.safeSetState({status:ra},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Gi},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:ra},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:ga.findDOMNode(this);if(!i||Cb.disabled){this.safeSetState({status:qi},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Gm},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:qi},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,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:ga.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,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===Ml)return null;var i=this.props,a=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=Sy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return on.createElement(Gd.Provider,{value:null},typeof a=="function"?a(o,l):on.cloneElement(on.Children.only(a),l))},t}(on.Component);Go.contextType=Gd;Go.propTypes={};function Ys(){}Go.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Ys,onEntering:Ys,onEntered:Ys,onExit:Ys,onExiting:Ys,onExited:Ys};Go.UNMOUNTED=Ml;Go.EXITED=qi;Go.ENTERING=Gi;Go.ENTERED=ra;Go.EXITING=Gm;function H$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function ex(e,t){var n=function(i){return t&&p.isValidElement(i)?t(i):i},r=Object.create(null);return e&&p.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function W$(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 a,l={};for(var c in t){if(r[c])for(a=0;a<r[c].length;a++){var u=r[c][a];l[r[c][a]]=n(u)}l[c]=n(c)}for(a=0;a<o.length;a++)l[o[a]]=n(o[a]);return l}function ts(e,t,n){return n[t]!=null?n[t]:e.props[t]}function q$(e,t){return ex(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ts(n,"appear",e),enter:ts(n,"enter",e),exit:ts(n,"exit",e)})})}function G$(e,t,n){var r=ex(e.children),o=W$(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if(p.isValidElement(a)){var l=i in t,c=i in r,u=t[i],d=p.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=p.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:ts(a,"exit",e),enter:ts(a,"enter",e)}):!c&&l&&!d?o[i]=p.cloneElement(a,{in:!1}):c&&l&&p.isValidElement(u)&&(o[i]=p.cloneElement(a,{onExited:n.bind(null,a),in:u.props.in,exit:ts(a,"exit",e),enter:ts(a,"enter",e)}))}}),o}var Q$=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},K$={component:"div",childFactory:function(t){return t}},tx=function(e){sP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(H$(i));return i.state={contextValue:{isMounting:!0},handleExited:a,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 a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?q$(o,l):G$(o,a,l),firstRender:!1}},n.handleExited=function(o,i){var a=ex(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=Wd({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=Sy(o,["component","childFactory"]),c=this.state.contextValue,u=Q$(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?on.createElement(Gd.Provider,{value:c},u):on.createElement(Gd.Provider,{value:c},on.createElement(i,l,u))},t}(on.Component);tx.propTypes={};tx.defaultProps=K$;const Eb={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Y$={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function X$({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:Eb[a],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:Y$[a]},u={opacity:0,maxHeight:0,transform:Eb[a]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function J$(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const uP=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:a,...l}=e,c=J$(n,e.autoClose),u=p.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return p.useEffect(()=>{var m;(m=e.onOpen)==null||m.call(e,e)},[]),p.useEffect(()=>(h(),d),[c]),s.jsx(Ny,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h,children:a})});uP.displayName="@mantine/notifications/NotificationContainer";var dP={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Z$=Go,eL={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Gr("overlay"),store:Ns,withinPortal:!0},tL=(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":F(r)}}},Qo=K((e,t)=>{const n=V("Notifications",eL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:m,limit:g,zIndex:v,store:S,portalProps:y,withinPortal:b,...x}=n,w=It(),j=M$(S),E=F_(),C=Dg(),T=p.useRef({}),_=p.useRef(0),M=(w.respectReducedMotion?C:!1)?1:f,D=le({name:"Notifications",classes:dP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:tL});p.useEffect(()=>{S==null||S.updateState(A=>({...A,limit:g||5}))},[g]),Ro(()=>{j.notifications.length>_.current&&setTimeout(()=>E(),0),_.current=j.notifications.length},[j.notifications]);const N=j.notifications.map(({style:A,...L})=>s.jsx(Z$,{timeout:M,onEnter:()=>T.current[L.id].offsetHeight,nodeRef:{current:T.current[L.id]},children:I=>s.jsx(uP,{ref:k=>{T.current[L.id]=k},data:L,onHide:k=>iP(k,S),autoClose:d,...D("notification",{style:{...X$({state:I,position:u,transitionDuration:M,maxHeight:m}),...A}})})},L.id));return s.jsx(Rs,{withinPortal:b,...y,children:s.jsx(W,{...D("root"),ref:t,...x,children:s.jsx(tx,{children:N})})})});Qo.classes=dP;Qo.displayName="@mantine/notifications/Notifications";Qo.show=co.show;Qo.hide=co.hide;Qo.update=co.update;Qo.clean=co.clean;Qo.cleanQueue=co.cleanQueue;Qo.updateState=co.updateState;class nL{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Kc{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class rL{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 a=o.consumeAndParse(n);return r(i,a)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(n);return r(i,a,l)},precedence:n})}construct(t){return new oL(t,this.prefixParselets,this.infixParselets)}}class oL{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 iL="http://hl7.org",fP="ok",sL="created",aL="gone",lL="not-modified",cL="not-found",uL="forbidden",dL="accepted",fL={resourceType:"OperationOutcome",id:fP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},hL={resourceType:"OperationOutcome",id:cL,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},hP={resourceType:"OperationOutcome",id:uL,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Ci(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function Ct(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function pL(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function lh(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function pP(e){return e.id===fP||e.id===sL||e.id===lL||e.id===dL}function mL(e){return e.id===aL}class Ue extends Error{constructor(t,n){super(mP(t)),this.outcome=t,this.cause=n}}function mt(e){return e instanceof Ue?e.outcome:lh(e)?e:Ci(Ne(e))}function Ne(e){return e?typeof e=="string"?e:e instanceof Error?e.message:lh(e)?mP(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function mP(e){var n;const t=((n=e.issue)==null?void 0:n.map(gP))??[];return t.length>0?t.join("; "):"Unknown error"}function gP(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 gL(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 vL(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,gL(o,i)])),constraints:[],innerTypes:[]};return t}const yL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},xL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},bL={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"}]}}},wL={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"}]}}},SL={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"}]}}},jL={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"}]}}},CL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},EL={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"}]}}},TL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},PL={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"}]}}},kL={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"}]}}},RL={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"}]}}},_L={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"}]}}},DL={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"}]}}},IL={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"]}]}}},AL={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"}]}}},NL={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"}]}}},ML={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"}]}}},OL={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"}]}}},$L={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"}]}}},LL={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"]}]}}},FL={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"}]}}},zL={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"}]}}},BL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},VL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},UL={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"]}]}}},HL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},WL={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"}]}}},qL={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"}]}}},GL={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"}]}}},QL={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"}]}}},KL={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"]}]}}},YL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},XL={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"}]}}},JL={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"]}]}}},ZL={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"}]}}},e7={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"}]}}},t7={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"}]}}},n7={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"}]}}},r7={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"}]}}},o7={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"]}]}}},i7={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"}]}}},s7={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"}]}}},a7={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"}]}}},l7={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"}]}}},c7={Element:yL,BackboneElement:xL,Address:bL,Age:wL,Annotation:SL,Attachment:jL,CodeableConcept:CL,Coding:EL,ContactDetail:TL,ContactPoint:PL,Contributor:kL,Count:RL,DataRequirement:_L,Distance:DL,Dosage:IL,Duration:AL,ElementDefinition:NL,Expression:ML,Extension:OL,HumanName:$L,Identifier:LL,MarketingStatus:FL,Meta:zL,Money:BL,Narrative:VL,ParameterDefinition:UL,Period:HL,Population:WL,ProdCharacteristic:qL,ProductShelfLife:GL,Quantity:QL,Range:KL,Ratio:YL,Reference:XL,RelatedArtifact:JL,SampledData:ZL,Signature:e7,SubstanceAmount:t7,Timing:n7,TriggerDefinition:r7,UsageContext:o7,MoneyQuantity:i7,SimpleQuantity:s7,MetadataResource:a7,IdentityProvider:l7};function u7(e){return new d7(e).parse()}const vP=vL(c7),nx=Object.create(null),Tb=Object.create(null);function Qm(e){let t;return e?(t=Tb[e],t||(t=Tb[e]=Object.create(null))):t=vP,t}function Pb(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)yP(o,t)}function yP(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=u7(e),r=Qm(t);r[e.name]=n,t&&e.url===t&&(nx[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function xP(e){return!!vP[e]}function ch(e,t){let n=Qm(t)[e];return!n&&t&&(n=Qm()[e]),n}function bP(e,t){const n=ch(e,t);if(!n)throw new Ue(Ci("Unknown data type: "+e));return n}function rx(e){return!!nx[e]}function Ms(e){return nx[e]}class d7{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:p7(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,a;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=Sp(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[Sp(t,c.path)]=l;break}c=c.parent}if(!c){const u=Sp(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.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&&!Xs((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:Ob(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Xs((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,a;h7(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:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){var n;if(this.backboneContext&&!Xs(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&&!Xs(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0;this.slicingContext&&!Xs(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,a;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)??((a=c.base)==null?void 0:a.max)??c.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Xs(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={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}}}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=Ob(t)),r||(r=(o=Yc(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,a;const n=kb(t.max),r=(i=t.base)!=null&&i.max?kb(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.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:Rb(hn(o,"fixed[x]")),pattern:Rb(hn(o,"pattern[x]")),binding:t.binding}}}function kb(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Sp(e,t=""){return f7(e.path,t)}function f7(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Xs(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function Rb(e){return Array.isArray(e)&&e.length>0?e[0]:Bt(e)?void 0:e}function h7(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 p7(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 m7(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?g7:hn,[o,...i]=t.split(".");let a=[r(e,o,n)];for(const l of i){const c=[];for(const u of a)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));a=c}return a}function g7(e,t,n){const r=e.path;return v7(hn(e,t,n),r,t)}function v7(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 wP={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 y7(e,t,n,r){var a;if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return ix(e,o.pattern);if(o.fixed)return Xc(e,o.fixed);if(((a=o.binding)==null?void 0:a.strength)==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(l=>l.code===e.type)}return!1}function je(e){return[{type:U.boolean,value:e}]}function ho(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:U.integer,value:e}:typeof e=="number"?{type:U.decimal,value:e}:typeof e=="boolean"?{type:U.boolean,value:e}:typeof e=="string"?{type:U.string,value:e}:wr(e)?{type:U.Quantity,value:e}:Ko(e)?{type:e.resourceType,value:e}:{type:U.BackboneElement,value:e}}function mi(e){return e.length===0?!1:!!e[0].value}function Oo(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 hn(e,t,n){if(!e.value)return;const r=$s(e.type,t,n==null?void 0:n.profileUrl);return r?SP(e,t,r):x7(e,t)}function SP(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,a="undefined",l;if(n.path.endsWith("[x]")){const c=n.path.split(".").pop().replace("[x]","");for(const u of o){const d=c+Gt(u.code);if(i=r[d],l=r["_"+d],i!==void 0||l!==void 0){a=u.code;break}}}else console.assert(o.length===1,"Expected single type",n.path),i=r[t],a=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]=Ab(i[c],l[c])}else i=Ab(i,l);if(!Bt(i))return(a==="Element"||a==="BackboneElement")&&(a=n.type[0].code),Array.isArray(i)?i.map(c=>_b(c,a)):_b(i,a)}function _b(e,t){return t==="Resource"&&Ko(e)&&(t=e.resourceType),{type:t,value:e}}function x7(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 U){const i=t+Gt(o);if(i in n){r=n[i];break}}if(!Bt(r))return Array.isArray(r)?r.map(ho):ho(r)}function jP(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(mi(TP(n,o))){r=!0;break}r||t.push(n)}return t}function CP(e){return je(!mi(e))}function EP(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?je(!1):je(e.every((n,r)=>mi(TP(n,t[r]))))}function TP(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"?je(Math.abs(n-r)<1e-8):wr(n)&&wr(r)?je(RP(n,r)):je(typeof n=="object"&&typeof r=="object"?ox(e,t):n===r)}function PP(e,t){return e.length===0&&t.length===0?je(!0):e.length!==t.length?je(!1):(e.sort(Db),t.sort(Db),je(e.every((n,r)=>mi(b7(n,t[r])))))}function b7(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,a=r==null?void 0:r.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?je(Math.abs(a-l)<.01):wr(a)&&wr(l)?je(RP(a,l)):je(n==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?ox({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function Db(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 kP(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 w7(n);case"DateTime":return Km(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return S7(n);case"Quantity":return wr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function w7(e){return typeof e=="string"&&!!wP.date.exec(e)}function Km(e){return typeof e=="string"&&!!wP.dateTime.exec(e)}function S7(e){return!!(e&&typeof e=="object"&&("start"in e&&Km(e.start)||"end"in e&&Km(e.end)))}function wr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function RP(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 ox(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],a=t[o];if(Ib(i)&&Ib(a)){if(!ox(i,a))return!1}else if(i!==a)return!1}return!0}function Ib(e){return e!==null&&typeof e=="object"}function Ab(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return j7(e??{},t)}return e}function j7(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function wt(e){const t=St(e),n=$o(e);return n===t?{reference:t}:{reference:t,display:n}}function St(e){return Ls(e)?e.reference:`${e.resourceType}/${e.id}`}function uh(e){if(e)return Ls(e)?e.reference.split("/")[1]:e.id}function C7(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function $o(e){if(C7(e)){const t=E7(e);if(t)return t}if(e.resourceType==="Device"){const t=T7(e);if(t)return t}if(e.resourceType==="MedicationRequest"){const t=e.medicationCodeableConcept;if(t)return _i(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]),O7(t))return _i(t);if($7(t))return t.text}return St(e)}function E7(e){const t=e.name;if(t&&t.length>0)return Jc(t[0])}function T7(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function P7(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=Nb(n);if(r)return r}else return Nb(t)}function Nb(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function _P(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(),a=n.getUTCDate(),l=r.getUTCFullYear(),c=r.getUTCMonth(),u=r.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let f=l*12+c-(o*12+i);u<a&&f--;const h=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:d,months:f,days:h}}function k7(e,t){const{years:n,months:r,days:o}=_P(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 Yc(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 ar(e,t){return JSON.stringify(e,R7,t?2:void 0)}function R7(e,t){return!_7(e)&&Bt(t)?void 0:t}function _7(e){return!!/\d+$/.exec(e)}function Bt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Mt(e):!1}function Mt(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 Xc(e,t,n){return e===t||Bt(e)&&Bt(t)?!0:Bt(e)||Bt(t)?!1:Array.isArray(e)&&Array.isArray(t)?D7(e,t):Array.isArray(e)||Array.isArray(t)?!1:Sn(e)&&Sn(t)?I7(e,t,n):(Sn(e)||Sn(t),!1)}function D7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Xc(e[n],t[n]))return!1;return!0}function I7(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],a=t[o];if(!Xc(i,a,o))return!1}return!0}function ix(e,t){return Bt(e)?!0:Bt(t)?!1:Array.isArray(e)&&Array.isArray(t)?A7(e,t):Array.isArray(e)||Array.isArray(t)?!1:Sn(e)&&Sn(t)?N7(e,t):Sn(e)||Sn(t)?!1:e===t}function A7(e,t){return t.every(n=>e.some(r=>ix(r,n)))}function N7(e,t){return Object.entries(t).every(([n,r])=>n in e&&ix(e[n],r))}function po(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function DP(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Sn(e){return e!==null&&typeof e=="object"}function M7(e){return Sn(e)&&"code"in e&&typeof e.code=="string"}function O7(e){return Sn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(M7)}function $7(e){return Sn(e)&&"text"in e&&typeof e.text=="string"}const IP=[];for(let e=0;e<256;e++)IP.push(e.toString(16).padStart(2,"0"));function L7(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=IP[t[r]];return n.join("")}function F7(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 Gt(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function sx(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function yc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function z7(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 B7(e){if(e)return Array.isArray(e)?e:[e]}const Mb=e=>new Promise(t=>{setTimeout(t,e)});function Ym(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 V7(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Cl(e,t){return e?(e.push(t),e):[t]}function xc(e){return e.sort((t,n)=>t.localeCompare(n))}function AP(e){return e.endsWith("/")?e:e+"/"}function U7(e){return e.startsWith("/")?e.slice(1):e}function bo(e,t){return new URL(U7(t),AP(e.toString())).toString()}function H7(e,t){return bo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function W7(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 NP(e,t){var n,r;return(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)),e}function q7(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)}return e}function G7(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.use)&&n.push("["+e.use+"]"),n.join(", ").trim()}function Jc(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=wc(e.text);if(r)return r}return n.join(" ").trim()}function dh(e){return e instanceof Date&&!isNaN(e.getTime())}function Q7(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return dh(r)?r.toLocaleTimeString(t,n):""}function Nn(e,t,n){if(!e)return"";const r=new Date(e);return dh(r)?r.toLocaleString(t,n):""}function K7(e,t,n){return!e||!e.start&&!e.end?"":Nn(e.start,t,n)+" - "+Nn(e.end,t,n)}const Y7={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},X7={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},J7={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function MP(e){if(!e)return"";const t=[];return Z7(t,e.repeat),e.event&&t.push(e.event.map(n=>Nn(n)).join(", ")),Gt(t.join(" ").trim())}function Z7(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(Y7[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+X7[o]):e.push("per "+r+" "+J7[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Gt).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>Q7(i)).join(", "))}function bc(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=n6(r.value,t),`> ${ai(r)}`):`>= ${ai(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=t6(o.value,t),`< ${ai(o)}`):`<= ${ai(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${ai(r)} - ${ai(o)}`)}function ai(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&n.push(e.value),e.unit&&(e.unit!=="%"&&n[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function e6(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function _i(e){if(!e)return"";const t=wc(e.text);return t||(e.coding?e.coding.map(n=>Os(n)).join(", "):"")}function Os(e){return wc(e==null?void 0:e.display)??wc(e==null?void 0:e.code)??""}function OP(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(ai(e.valueQuantity));else if(e.valueCodeableConcept)t.push(_i(e.valueCodeableConcept));else{const n=wc(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>OP(n)).join(" / ")),t.join(" / ").trim()}function wc(e){return typeof e=="string"?e:void 0}function t6(e,t,n=1){return($P(e)+n)*Math.pow(10,-t)}function n6(e,t,n=1){return($P(e)-n)*Math.pow(10,-t)}function $P(e,t){return e}const U={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 r6(e){for(const t of e.base??[]){let n=mo.types[t];n||(n={searchParamsDetails:{}},mo.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 Ob(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"?o6((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function o6(e){return e.length===1?e[0]:e.map(Gt).join("")}function ax(e){var t;return(t=mo.types[e])==null?void 0:t.searchParams}function i6(e,t){var n,r;return(r=(n=mo.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function vs(e){const t=e.replaceAll("[x]","").split(".").pop();return LP(t)}function LP(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(a6).join(" ").replace("_"," ").replace(/\s+/g," ")}const s6=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function a6(e){const t=e.toUpperCase();return e===t?e:s6.has(t)?t:t.charAt(0)+e.slice(1)}function $s(e,t,n){const r=ch(e,n);if(r)return l6(r.elements,t)}function l6(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]",a=e[i];if(a)return a}}}function Ko(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Ls(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const mo={types:{}};function fd(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 jp=()=>[],Fn={empty:(e,t)=>je(t.length===0||t.every(n=>Bt(n.value))),hasValue:(e,t)=>je(t.length!==0),exists:(e,t,n)=>je(n?t.filter(r=>mi(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Bt(r.value))),all:(e,t,n)=>je(t.every(r=>mi(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return je(!1);return je(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return je(!0);return je(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return je(!1);return je(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return je(!0);return je(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return je(!0);const r=n.eval(e,Js(e));return r.length===0?je(!1):je(t.every(o=>r.some(i=>i.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Js(e));return r.length===0?je(!0):t.length===0?je(!1):je(r.every(o=>t.some(i=>i.value===o.value)))},count:(e,t)=>[{type:U.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)=>je(t.length===Fn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>mi(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:jp,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,Js(e)),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&r.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Js(e)),o=[];for(const i of t)r.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Js(e));return jP([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Js(e));return[...t,...r]},htmlChecks:(e,t,n)=>[ho(!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 mi(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);if(typeof n=="boolean")return[{type:U.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return je(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return je(!0);if(["false","f","no","n","0","0.0"].includes(r))return je(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:je(Fn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);return typeof n=="number"?[{type:U.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:U.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:U.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:je(Fn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:U.date,value:fd(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:je(Fn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:U.dateTime,value:fd(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:je(Fn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);return typeof n=="number"?[{type:U.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:U.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:U.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:je(Fn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);return wr(n)?[{type:U.Quantity,value:n}]:typeof n=="number"?[{type:U.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:U.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:U.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:je(Fn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);return n==null?[]:wr(n)?[{type:U.string,value:`${n.value} '${n.unit}'`}]:[{type:U.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:je(Fn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ro(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:U.time,value:fd("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:je(Fn.toTime(e,t).length===1),indexOf:(e,t,n)=>fr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>fr((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,n,r),startsWith:(e,t,n)=>fr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>fr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>fr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>fr(n=>n.toUpperCase(),e,t),lower:(e,t)=>fr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>fr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),matches:(e,t,n)=>fr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>fr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),length:(e,t)=>fr(n=>n.length,e,t),toChars:(e,t)=>fr(n=>n?n.split(""):void 0,e,t),abs:(e,t)=>eo(Math.abs,e,t),ceiling:(e,t)=>eo(Math.ceil,e,t),exp:(e,t)=>eo(Math.exp,e,t),floor:(e,t)=>eo(Math.floor,e,t),ln:(e,t)=>eo(Math.log,e,t),log:(e,t,n)=>eo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>eo(Math.pow,e,t,n),round:(e,t)=>eo(Math.round,e,t),sqrt:(e,t)=>eo(Math.sqrt,e,t),truncate:(e,t)=>eo(n=>n|0,e,t),children:jp,descendants:jp,trace:(e,t,n)=>t,now:()=>[{type:U.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:U.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:U.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=Fn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=Fn.toDateTime(e,r.eval(e,t));if(a.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=_P(i[0].value,a[0].value);return[{type:U.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof lx?r=n.name:n instanceof ux&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:U.boolean,value:kP(o,r)})):[]},not:(e,t)=>Fn.toBoolean(e,t).map(n=>({type:U.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 ho(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,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:U.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:U.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:U.BackboneElement,value:{namespace:"System",name:"Integer"}}:Ko(n)?{type:U.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:U.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 a;return{type:U.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})}};function fr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=ro(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(a=>{var l;return(l=a==null?void 0:a.eval(t,n)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(ho):[ho(i)]}function eo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=ro(n,1),i=wr(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...r.map(d=>{var f;return(f=d.eval(t,n)[0])==null?void 0:f.value})),c=i?U.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function ro(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}function Js(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class c6{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 Zs{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class lx{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return 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 Ko(n)&&n.resourceType===this.name?t:hn(t,this.name)}toString(){return this.name}}class u6{eval(){return[]}toString(){return"{}"}}class d6 extends nL{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 cx extends Kc{constructor(t,n){super("as",t,n)}eval(t,n){return Fn.ofType(t,this.left.eval(t,n),this.right)}}class Jn extends Kc{}class Ir extends Jn{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,a=o[0].value,l=wr(i)?i.value:i,c=wr(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?je(u):wr(i)?[{type:U.Quantity,value:{...i,value:u}}]:[ho(u)]}}class f6 extends Kc{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(a=>typeof a.value=="string")?[{type:U.string,value:i.map(a=>a.value).join("")}]:i}}class h6 extends Jn{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return je(r.some(i=>i.value===o[0].value))}}class p6 extends Jn{constructor(t,n){super("in",t,n)}eval(t,n){const r=Oo(this.left.eval(t,n)),o=this.right.eval(t,n);return r?je(o.some(i=>i.value===r.value)):[]}}class ux extends Kc{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 FP extends Kc{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return jP([...r,...o])}}class m6 extends Jn{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return EP(r,o)}}class g6 extends Jn{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return CP(EP(r,o))}}class v6 extends Jn{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return PP(r,o)}}class y6 extends Jn{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return CP(PP(r,o))}}class dx extends Jn{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 je(kP(r[0],o))}}class x6 extends Jn{constructor(t,n){super("and",t,n)}eval(t,n){const r=Oo(this.left.eval(t,n),"boolean"),o=Oo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?je(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?je(!1):[]}}class b6 extends Jn{constructor(t,n){super("or",t,n)}eval(t,n){const r=Oo(this.left.eval(t,n),"boolean"),o=Oo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?je(!1):r!=null&&r.value||o!=null&&o.value?je(!0):[]}}class w6 extends Jn{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Oo(this.left.eval(t,n),"boolean"),o=Oo(this.right.eval(t,n),"boolean");return!r||!o?[]:je(r.value!==o.value)}}class S6 extends Jn{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Oo(this.left.eval(t,n),"boolean"),o=Oo(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?je(!0):!r||!o?[]:je(!1)}}class fx{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Fn[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 hx{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 j6=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class C6{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()===" "&&E6(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 E6(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&j6.includes(e.value)))}const T6=["true","false"],P6=["!=","!~","<=",">=","{}","->"];function k6(e){return new C6(e,T6,P6).tokenize()}const st={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},R6={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}},_6={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new hx(t,n)},precedence:st.Indexer},D6={parse(e,t){if(!(t instanceof lx))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new fx(t.name,n)},precedence:st.FunctionCall};function I6(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 A6(){return new rL().registerPrefix("String",{parse:(e,t)=>new Zs({type:U.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Zs({type:U.dateTime,value:fd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Zs({type:U.Quantity,value:I6(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Zs({type:t.value.includes(".")?U.decimal:U.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Zs({type:U.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Zs({type:U.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new lx(t.value)}).registerPrefix("{}",{parse:()=>new u6}).registerPrefix("(",R6).registerInfix("[",_6).registerInfix("(",D6).prefix("+",st.UnaryAdd,(e,t)=>new d6("+",t,n=>n)).prefix("-",st.UnarySubtract,(e,t)=>new Ir("-",t,t,(n,r)=>-r)).infixLeft(".",st.Dot,(e,t,n)=>new ux(e,n)).infixLeft("/",st.Divide,(e,t,n)=>new Ir("/",e,n,(r,o)=>r/o)).infixLeft("*",st.Multiply,(e,t,n)=>new Ir("*",e,n,(r,o)=>r*o)).infixLeft("+",st.Add,(e,t,n)=>new Ir("+",e,n,(r,o)=>r+o)).infixLeft("-",st.Subtract,(e,t,n)=>new Ir("-",e,n,(r,o)=>r-o)).infixLeft("|",st.Union,(e,t,n)=>new FP(e,n)).infixLeft("=",st.Equals,(e,t,n)=>new m6(e,n)).infixLeft("!=",st.NotEquals,(e,t,n)=>new g6(e,n)).infixLeft("~",st.Equivalent,(e,t,n)=>new v6(e,n)).infixLeft("!~",st.NotEquivalent,(e,t,n)=>new y6(e,n)).infixLeft("<",st.LessThan,(e,t,n)=>new Ir("<",e,n,(r,o)=>r<o)).infixLeft("<=",st.LessThanOrEquals,(e,t,n)=>new Ir("<=",e,n,(r,o)=>r<=o)).infixLeft(">",st.GreaterThan,(e,t,n)=>new Ir(">",e,n,(r,o)=>r>o)).infixLeft(">=",st.GreaterThanOrEquals,(e,t,n)=>new Ir(">=",e,n,(r,o)=>r>=o)).infixLeft("&",st.Ampersand,(e,t,n)=>new f6(e,n)).infixLeft("and",st.And,(e,t,n)=>new x6(e,n)).infixLeft("as",st.As,(e,t,n)=>new cx(e,n)).infixLeft("contains",st.Contains,(e,t,n)=>new h6(e,n)).infixLeft("div",st.Divide,(e,t,n)=>new Ir("div",e,n,(r,o)=>r/o|0)).infixLeft("in",st.In,(e,t,n)=>new p6(e,n)).infixLeft("is",st.Is,(e,t,n)=>new dx(e,n)).infixLeft("mod",st.Modulo,(e,t,n)=>new Ir("mod",e,n,(r,o)=>r%o)).infixLeft("or",st.Or,(e,t,n)=>new b6(e,n)).infixLeft("xor",st.Xor,(e,t,n)=>new w6(e,n)).infixLeft("implies",st.Implies,(e,t,n)=>new S6(e,n))}const N6=A6();function zP(e){return new c6(e,N6.construct(k6(e)).consumeAndParse())}function il(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]=ho(n[r]))}return Sc(e,n).map(r=>r.value)}function Sc(e,t,n){const r=n??{};return zP(e).eval({variables:r},t).map(i=>{var a;return{type:i.type,value:(a=i.value)==null?void 0:a.valueOf()}})}var jo=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(jo||{});function sl(e,t){var r,o;let n=(o=(r=mo.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=O6(e,t)),n}function M6(e,t,n){let r=mo.types[e];r||(r={},mo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function O6(e,t){const n=t.code,r=F6(n),o=B6(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Wl(l),u=V7(()=>c.join("."));c.length===1&&c[0]instanceof Jn?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):BP(i,Wl(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const a={columnName:r,type:z6(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return M6(e,n,a),a}function BP(e,t,n,r){const o=t[r];if(o instanceof cx){e.propertyTypes.add(o.right.toString());return}if(o instanceof fx){$6(e,o);return}const i=o.toString(),a=$s(n,i);if(!a)throw new Error(`Element definition not found for ${n} ${i}`);let l=!1,c=r+1;if(c<t.length&&t[c]instanceof hx&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;L6(d)&&(d=a.type[0].code),BP(e,t,d,c)}}function $6(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 dx){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function L6(e){return e==="Element"||e==="BackboneElement"}function F6(e){return e.split("-").reduce((t,n,r)=>t+(r?Gt(n):n),"")}function z6(e,t){switch(e.type){case"date":return t.size===1&&t.has(U.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(U.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(U.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function B6(e,t){const n=[],r=zP(t);return Xm(e,r.child,n),n}function Xm(e,t,n){t instanceof FP?(Xm(e,t.left,n),Xm(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function Wl(e){if(e instanceof cx||e instanceof hx)return[Wl(e.left),e].flat();if(e instanceof Jn)return[e];if(e instanceof ux)return[Wl(e.left),Wl(e.right)].flat();if(e instanceof fx){if(e.name==="where"&&!(e.args[0]instanceof dx))return[];if(e.name==="last")return[]}return[e]}const fh=20;var te=(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.PRESENT="present",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(te||{});const VP={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"},px={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function UP(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[a,l]=e.split("?");n=a,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=[];return r&&i.push(...r.entries()),V6(o,i)}function V6(e,t){const n={resourceType:e};for(const[r,o]of t)U6(n,r,o);return n}function U6(e,t,n){var a,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=Cl(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":H6(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=$b(n);o==="iterate"&&(c.modifier="iterate"),e.include=Cl(e.include,c);break}case"_revinclude":{const c=$b(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=Cl(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=(a=mo.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[r];c?e.filters=Cl(e.filters,W6(c,o,n)):e.filters=Cl(e.filters,Q6(r,o,n))}}}}function H6(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 W6(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return q6(e,n);case"reference":case"string":case"token":case"uri":return G6(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function q6(e,t){const{operator:n,value:r}=K6(t);return{code:e.code,operator:n,value:r}}function G6(e,t,n){return{code:e.code,operator:Y6(t),value:n}}function Q6(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 px&&(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 K6(e){const t=e.substring(0,2),n=px[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function Y6(e){return VP[e]??"eq"}function $b(e){const t=e.split(":");if(t.includes("*"))throw new Ue(Ci("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Ue(Ci(`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 Ue(Ci(`Invalid include value '${e}'`))}function va(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(X6(n))),e.sortRules&&e.sortRules.length>0&&t.push(J6(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(Lb("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(Lb("_revinclude",n))),t.length===0?"":(xc(t),"?"+t.join("&"))}function X6(e){const t=e.operator in VP?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in px?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function J6(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function Lb(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function mx(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function Z6(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!eF(e,t,n))return!1}return!0}function eF(e,t,n){var o,i;const r=(i=(o=mo.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:i[n.code];if(!r)return!1;if(n.operator===te.MISSING||n.operator===te.PRESENT)return tF(e,n,r);switch(r.type){case"reference":return nF(e,n,r);case"string":case"uri":return HP(e,n,r);case"token":return rF(e,n,r);case"date":return aF(e,n,r);default:return!1}}function tF(e,t,n){const o=il(n.expression,e).length>0;return(t.operator===te.MISSING&&t.value==="false"||t.operator===te.PRESENT&&t.value==="true")===o}function nF(e,t,n){const r=il(n.expression,e),o=hh(t.operator);if(t.value===""&&r.length===0)return t.operator===te.EQUALS;const i=r.map(a=>typeof a=="string"?a:a.reference);for(const a of mx(t.value)){let l=i.includes(a);if(!l&&t.code==="_compartment"&&(l=i.some(c=>c==null?void 0:c.endsWith("/"+a))),l)return!o}return o}function rF(e,t,n){return sl(e.resourceType,n).type===jo.BOOLEAN?oF(e,t,n):HP(e,t,n,!0)}function oF(e,t,n){const r=il(n.expression,e),o=t.value==="true",i=r.includes(o);return hh(t.operator)?!i:i}function HP(e,t,n,r){var u,d;const i=(d=(u=sl(e.resourceType,n).elementDefinitions)==null?void 0:u[0].type)==null?void 0:d[0].code,a=il(n.expression,e),l=mx(t.value),c=hh(t.operator);for(const f of a)for(const h of l){let m;if(i===U.Identifier?m=iF(f,t.operator,h):i===U.CodeableConcept?m=sF(f,t.operator,h):m=Jm(f,t.operator,h,r),m)return!c}return c}function Jm(e,t,n,r){if(r&&n.includes("|")){const[i,a]=n.split("|");return Jm(e,t,i,!1)&&(!a||Jm(e,t,a,!1))}let o="";return e&&(typeof e=="string"?o=e:typeof e=="object"&&(o=JSON.stringify(e))),o.toLowerCase().includes(n.toLowerCase())}function iF(e,t,n){var r,o,i;if(n.includes("|")){const[a,l]=n.split("|");return((r=e.system)==null?void 0:r.toLowerCase())===a.toLowerCase()&&((o=e.value)==null?void 0:o.toLowerCase())===l.toLowerCase()}return((i=e.value)==null?void 0:i.toLowerCase())===n.toLowerCase()}function sF(e,t,n){var r,o,i;if(n.includes("|")){const[a,l]=n.split("|");return((r=e.coding)==null?void 0:r.some(c=>{var u,d;return((u=c.system)==null?void 0:u.toLowerCase())===a.toLowerCase()&&((d=c.code)==null?void 0:d.toLowerCase())===l.toLowerCase()}))??!1}return((o=e.text)==null?void 0:o.toLowerCase())===n.toLowerCase()||(((i=e.coding)==null?void 0:i.some(a=>{var l;return((l=a.code)==null?void 0:l.toLowerCase())===n.toLowerCase()}))??!1)}function aF(e,t,n){const r=il(n.expression,e),o=mx(t.value),i=hh(t.operator);for(const a of r)for(const l of o)if(lF(a,t.operator,l))return!i;return i}function lF(e,t,n){switch(t){case te.STARTS_AFTER:case te.GREATER_THAN:return e>n;case te.GREATER_THAN_OR_EQUALS:return e>=n;case te.ENDS_BEFORE:case te.LESS_THAN:return e<n;case te.LESS_THAN_OR_EQUALS:return e<=n;case te.EQUALS:case te.NOT_EQUALS:return e===n;default:return!1}}function hh(e){return e===te.NOT_EQUALS||e===te.NOT}const cF={resourceType:"*"},uF=["DomainConfiguration","JsonWebKey","Login"],dF=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"];var gx=(e=>(e.READ="read",e.VREAD="vread",e.UPDATE="update",e.PATCH="patch",e.DELETE="delete",e.HISTORY="history",e.HISTORY_INSTANCE="history-instance",e.HISTORY_TYPE="history-type",e.HISTORY_SYSTEM="history-system",e.CREATE="create",e.SEARCH="search",e.SEARCH_TYPE="search-type",e.SEARCH_SYSTEM="search-system",e.SEARCH_COMPARTMENT="search-compartment",e.CAPABILITIES="capabilities",e.TRANSACTION="transaction",e.BATCH="batch",e.OPERATION="operation",e))(gx||{});const fF=["read","vread","history","history-instance"];function hF(e,t){if(uF.includes(t))return!1;if(e.resource){for(const n of e.resource)if(qP(n.resourceType,t)&&!n.readonly)return!0}return!1}function WP(e,t,n){if(!n)return cF;if(n.resource){for(const r of n.resource)if(pF(e,t,r))return r}}function pF(e,t,n){var o,i;const r=e.resourceType;return!(!qP(n.resourceType,r)||n.readonly&&!fF.includes(t)||n.compartment&&!((i=(o=e.meta)==null?void 0:o.compartment)!=null&&i.find(a=>{var l;return a.reference===((l=n.compartment)==null?void 0:l.reference)}))||n.criteria&&!Z6(e,UP(n.criteria)))}function qP(e,t){return e===t||e==="*"&&!dF.includes(t)}function mF(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 gF(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 Fb(){const e=new Uint32Array(28);return crypto.getRandomValues(e),L7(e.buffer)}async function vF(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function GP(){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 QP(e){var o,i,a;const t={};e=po(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]=GP(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.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)=>yF(l,c,t),2);return xF(JSON.parse(r))}function yF(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 xF(e){const t=wF(e),{sorted:n,cycles:r}=bF(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=n.map(a=>o[a]);for(const a of r)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function bF(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=0;function o(i,a){if(n[i]===2)return!0;if(n[i]===1){const c=a.lastIndexOf(i);return c!==-1&&r.push(a.slice(c)),!0}n[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return n[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)n[i]===0&&o(i,[]);return{sorted:t,cycles:r}}function KP(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Ls(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else KP(r,t)}}function wF(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&&KP(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class YP{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 Jt={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 XP{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 vx{constructor(){this.emitter=new XP}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 Zm={"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"},SF=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],yx=["DiagnosticReport-update"];function jF(e){return yx.includes(e)}function CF(e){if(yx.includes(e))throw new Ue(Ct(`'context.version' is required for '${e}'.`))}const EF={"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 TF(e){return SF.includes(e)}function JP(e){return!!e.endpoint}function zb(e){if(!xx(e))throw new Ue(Ct("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 JP(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function xx(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(!Zm[i])return!1;return!(JP(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function Bb(e,t,n,r){if(typeof t!="object")throw new Ue(Ct(`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 Ue(Ct(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Ue(Ct(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!TF(t.resourceType))throw new Ue(Ct(`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 Ue(Ct(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function PF(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)Bb(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new Ue(Ct(`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 a of i)Bb(e,a,n,r)}}function kF(e,t){const n=new Map,r=EF[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new Ue(Ct(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));PF(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new Ue(Ct(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new Ue(Ct(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function Vb(e,t,n,r){if(!(e&&typeof e=="string"))throw new Ue(Ct("Must provide a topic."));if(!Zm[t])throw new Ue(Ct(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Zm).join(", ")}`));if(typeof n!="object")throw new Ue(Ct("context must be a context object or array of context objects."));if(yx.includes(t)&&!r)throw new Ue(Ct(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return kF(t,o),{timestamp:new Date().toISOString(),id:GP(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class RF extends vx{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Ue(Ct("Subscription request should contain an endpoint."));if(!xx(t))throw new Ue(Ct("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 _F(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=mF(t),r=Array.from(n).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function DF(e){return e.split(".").length===3}function bx(e){const[t,n,r]=e.split(".");return _F(n)}function IF(e){try{return typeof bx(e).login_id=="string"}catch{return!1}}function AF(e){try{const n=bx(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class NF{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,Jt.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var ZP;ZP=Symbol.toStringTag;class Ar{constructor(t){this[ZP]="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)}}class MF{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new OF)}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?ar(n):void 0)}}class OF{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 $F extends vx{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 eg extends vx{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 LF{constructor(t){this.criteria=t,this.emitter=new eg(t),this.refCount=1}}class FF{constructor(t,n,r){if(!(t instanceof ek))throw new Ue(Ct("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new Ue(Ct("Not a valid URL"))}const i=r!=null&&r.RobustWebSocket?new r.RobustWebSocket(o):new $F(o);this.medplum=t,this.ws=i,this.masterSubEmitter=new eg,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,a,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}(a=this.masterSubEmitter)==null||a.dispatchEvent({type:"message",payload:c});const d=this.criteriaEntriesBySubscriptionId.get(uh(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 Ue(pL(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,a;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),(a=(i=this.criteriaEntries.get(t))==null?void 0:i.emitter)==null||a.dispatchEvent(r)}async getTokenForCriteria(t){var a,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${St(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=(a=r==null?void 0:r.find(c=>c.name==="token"))==null?void 0:a.valueString,i=(l=r==null?void 0:r.find(c=>c.name==="websocket-url"))==null?void 0:l.valueUrl;if(!o)throw new Ue(Ct("Failed to get token"));if(!i)throw new Ue(Ct("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 LF(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,a,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=(a=this.criteriaEntries.get(t))==null?void 0:a.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 eg(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const zF="3.1.7-5fa90717f",BF=Jt.FHIR_JSON+", */*; q=0.1",VF="https://api.medplum.com/",UF=1e3,HF=6e4,WF=0,qF="Binary/",Ub={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class ek extends XP{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)??GF(),this.storage=(t==null?void 0:t.storage)??new MF,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=AP((t==null?void 0:t.baseUrl)??VF),this.fhirBaseUrl=bo(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=bo(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=bo(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=bo(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"?WF:HF),this.cacheTime>0?this.requestCache=new YP((t==null?void 0:t.resourceCacheSize)??UF):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=bo(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((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new Ar(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,Jt.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 a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,a,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 a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",n),a.searchParams.set("redirect_uri",r),a.searchParams.set("scope",o.scope??"openid profile email"),a.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`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(bo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=W7(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Ar((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(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Ar(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(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Ar(this.search(t,n,r).then(Cp));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,n,r){var i,a;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(!((a=c.entry)!=null&&a.length)&&!u)break;yield Cp(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 Ub;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 Ar(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ar(Promise.resolve(Ub));const[o,i]=r.split("/");return!o||!i?new Ar(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(xP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Ar((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," "),a=await this.graphql(i);Pb(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)r6(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&rx(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 Ar((async()=>{if(n!=null&&n.expandProfile){const a=this.fhirUrl("StructureDefinition","$expand-profile");a.search=new URLSearchParams({url:t}).toString();const l=await this.post(a.toString(),{});return Cp(l).map(c=>(yP(c,c.url),c.url))}else{const a=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});return a?(Pb([a],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 a=qb(t,n,r,o),l=i??(typeof n=="object"?n:{}),c=await this.createBinary(a,l);return{contentType:a.contentType,url:c.url,title:a.filename}}createBinary(t,n,r,o,i){const a=qb(t,n,r,o),l=i??(typeof n=="object"?n:{}),{data:c,contentType:u,filename:d,securityContext:f,onProgress:h}=a,m=this.fhirUrl("Binary");return d&&m.searchParams.set("_filename",d),f!=null&&f.reference&&this.setRequestHeader(l,"X-Security-Context",f.reference),h?this.uploadwithProgress(m,c,u,h,l):this.post(m,c,u,l)}uploadwithProgress(t,n,r,o,i){return new Promise((a,l)=>{var f;const c=new XMLHttpRequest,u=()=>c.abort();(f=i==null?void 0:i.signal)==null||f.addEventListener("abort",u);const d=h=>{var m;(m=i==null?void 0:i.signal)==null||m.removeEventListener("abort",u),h instanceof Error?l(h):a(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 Ue(mt(c.response||c.statusText)))},c.open("POST",t),c.withCredentials=!0,c.setRequestHeader("Authorization","Bearer "+this.accessToken),c.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),c.setRequestHeader("Content-Type",r),c.setRequestHeader("X-Medplum","extended"),i!=null&&i.headers){const h=i.headers;for(const[m,g]of Object.entries(h))c.setRequestHeader(m,g)}c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=YF(t,n,r,o),a=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,a)}createComment(t,n,r){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=wt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=wt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[wt(t)],encounter:i,subject:a,sender:o?wt(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 a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute"),i.searchParams.set("identifier",a.system+"|"+a.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,Jt.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},Jt.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,a){return this.post(this.fhirUrl("Agent",uh(t),"$push"),{destination:typeof n=="string"?n:St(n),body:r,contentType:o,waitForResponse:i},Jt.FHIR_JSON,a)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||St(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=AF(t),this.medplumServer=IF(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,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.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(qF)&&(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=wt(i));const a=await this.createAttachment(o,n);return this.updateResource({...i,status:"completed",content:a})}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}/`,a=this.fhirUrl(`${i}$export`);return n&&a.searchParams.set("_type",n),r&&a.searchParams.set("_since",r),this.startAsyncRequest(a.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 NF(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 Ar(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 a=i.headers.get("content-type"),l=a==null?void 0:a.includes("json");if(i.status===404&&!l)throw new Ue(hL);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await Wb(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await Wb(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new Ue(mt(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=bo(this.baseUrl,t));const r=3,o=200;let i;for(let a=0;a<r;a++){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(a,r,l)}await Mb(o)}return i}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of xc(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 Mb(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 a=t[0];try{a.resolve(await this.request(a.method,bo(this.fhirBaseUrl,a.url),a.options))}catch(l){a.reject(new Ue(mt(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let a=0;a<t.length;a++){const l=t[a],c=(o=r.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!pP(c.response.outcome)?l.reject(new Ue(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",BF,!0),t.body&&this.setRequestHeader(t,"Content-Type",Jt.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=Fb();sessionStorage.setItem("pkceState",t);const n=Fb();sessionStorage.setItem("codeVerifier",n);const r=await vF(n),o=F7(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??Hb()),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)??Hb()),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=gF(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new Ue(Ct("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new Ue(Ct("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",zb(r),Jt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!xx(t))throw new Ue(Ct("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Ue(Ct("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",zb(t),Jt.FORM_URL_ENCODED)}fhircastConnect(t){return new RF(t)}async fhircastPublish(t,n,r,o){return jF(n)?this.post(`/fhircast/STU3/${t}`,Vb(t,n,r,o),Jt.JSON):(CF(n),this.post(`/fhircast/STU3/${t}`,Vb(t,n,r),Jt.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":Jt.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(a){throw this.refreshPromise=void 0,a}if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Ue(Ci(a.error_description))}catch(a){throw new Ue(Ci("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(DF(n)){const r=bx(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 FF(this,H7(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 GF(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function Hb(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function Wb(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(lh(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function Cp(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function QF(e){return Sn(e)&&"data"in e&&"contentType"in e}function qb(e,t,n,r){return QF(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function KF(e){return Sn(e)&&"docDefinition"in e}function YF(e,t,n,r){return KF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Ua({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:i}){if(t===(e==null?void 0:e.path))return;o??(o=(e==null?void 0:e.debugMode)??!1),i??(i=e==null?void 0:e.accessPolicyResource);let a=XF(t,n,e,!!o);const l=Ym(t,".",2)[1];a=JF(a,i,l),a=ZF(a,i,l);const c=Object.create(null);for(const[d,f]of Object.entries(a))c[t+"."+d]=f;let u;if(e&&!e.isDefaultContext)u=e.getExtendedProps;else{const d=Object.create(null);u=f=>{const h=Ym(f,".",2)[1];if(h){if(!d[h]){const m=Qd(h,i==null?void 0:i.hiddenFields);d[h]={hidden:m,readonly:m||Qd(h,i==null?void 0:i.readonlyFields)}}return d[h]}}}return{path:t,elements:a,elementsByPath:c,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o,getExtendedProps:u,accessPolicyResource:i}}function XF(e,t,n,r){const o=Object.create(null);if(n)for(const[a,l]of Object.entries(n.elementsByPath)){const c=yc(e,a);c!==void 0&&(o[c]=l)}let i=!1;if(t)for(const[a,l]of Object.entries(t))a in o||(o[a]=l,i=!0);return r&&console.assert(i,"Unnecessary ElementsContext; not using any newly provided elements"),o}function JF(e,t,n){var o;if(!((o=t==null?void 0:t.hiddenFields)!=null&&o.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([i])=>!Qd(r+i,t.hiddenFields)))}function ZF(e,t,n){var i;if(!((i=t==null?void 0:t.readonlyFields)!=null&&i.length))return e;const r=Object.create(null),o=n?n+".":"";for(const[a,l]of Object.entries(e))Qd(o+a,t.readonlyFields)?r[a]={...l,readonly:!0}:r[a]=l;return r}function Qd(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function tk(e){return e.type!==void 0&&e.type.length>0}function e8(e,t,n,r){var i;const o=m7(e,t.path,{profileUrl:r});if(o){const a=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>y7(l,t,n,a))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function nk(e,t,n,r){var o,i;if(e)for(const a of t){const l={value:e,type:((o=a.typeSchema)==null?void 0:o.name)??((i=a.type)==null?void 0:i[0].code)};if(n.every(c=>{var u;return e8(l,c,a,((u=a.typeSchema)==null?void 0:u.url)??r)}))return a.name}}class t8{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Ua({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(!Mt(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=n8(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 a of t.children)this.crawlElementNode(a,n);Mt((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,a;const r=[];for(const l of t){if(!tk(l))continue;const c=(a=(i=l.type.find(u=>Mt(u.profile)))==null?void 0:i.profile)==null?void 0:a[0];if(Mt(c)){const u=Ms(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 a=(o==null?void 0:o.elements)??t.elements;Mt(a)&&(i=Ua({path:n,parentContext:this.elementsContext,elements:a})),i&&this.elementsContextStack.push(i),this.crawlElementsImpl(a,n),i&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function n8(e){const t=[];function n(i,a){return a.startsWith(i+".")}function r(i,a){for(const l of i.children)if(n(l.key,a.key)){r(l,a);return}i.children.push(a)}const o=Object.entries(e);o.sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o){const l={key:i,element:a,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 Ep="__sliceName";function r8(e,t){const n=new o8(e,e.resourceType,"resource");return new t8(t,n).crawlResource(),n.getDefaultValue()}function Gb(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Kd(e,r,o,t);continue}const i=yc(n,r);i!==void 0&&Kd(e,i,o,t)}return e}class o8{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=po(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,a=yc(i,t);if(a===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){i8(d,a,n,r.elements),Kd(d,a,n,r.elements);const f=ng(d,a,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=yc(this.value.path,t);if(i===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const a of this.value.values){const l=ng(a,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];Mt(u)||l.splice(c,1)}Bt(l)&&tg(a,void 0,i,n)}}onEnterSlice(t,n,r){const o=this.value.values,i=[];for(const a of o){if(a===void 0)continue;if(!Array.isArray(a))throw new Error("Expected array value for sliced element");const l=this.getMatchingSliceValues(a,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[Ep]??nk(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(sx(n.type[0].code)){const a=Object.create(null);o.push(a),t.push(a)}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];Ep in o&&delete o[Ep]}}getDefaultValue(){return this.rootValue}}function i8(e,t,n,r){const o=ng(e,t,n,r);n.min>0&&o===void 0&&sx(n.type[0].code)&&(n.isArray?tg(e,[Object.create(null)],t,n):tg(e,Object.create(null),t,n))}function tg(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]",Gt(i))}t===void 0?delete e[o]:e[o]=t}function ng(e,t,n,r){const o=t.split(".");let i=e,a;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]",Gt(d))}if(l===o.length-1){Array.isArray(i)?a=i.map(u=>u[c]):a=i[c];continue}if(Array.isArray(i))i=i.map(u=>u[c]);else if(Sn(i)){if(i[c]===void 0)return;i=i[c]}else return}return a}function Kd(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>Kd(l,t,n,r));e==null&&(e=Object.create(null));const o=e,i=t.split(".");let a=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]",Gt(d))}if(l===i.length-1){const u=Array.isArray(a)?a:[a];for(const d of u)n.fixed?d[c]??(d[c]=n.fixed.value):n.pattern&&(d[c]=rk(d[c],n.pattern.value))}else{if(!(c in a)){const u=i.slice(0,l+1).join(".");a[c]=r[u].isArray?[Object.create(null)]:Object.create(null)}a=a[c]}}return o}function rk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:po(t);if(Sn(t)&&(Sn(e)&&!Array.isArray(e)||e===void 0)){const n=po(e)??Object.create(null);for(const r of Object.keys(t))n[r]=rk(n[r],t[r]);return n}return e}var ok=p.createContext(void 0);function ph(){return p.useContext(ok)}function ie(){return ph().medplum}function mh(){return ph().navigate}function gh(){return ph().profile}function s8(e){let t=e.medplum,n=e.navigate??a8,[r,o]=p.useState({profile:t.getProfile(),loading:!t.isInitialized});p.useEffect(()=>{t&&(t.isInitialized||(o(a=>({...a,loading:!0})),t.getInitPromise().then(()=>o(a=>({...a,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),p.useEffect(()=>{function a(){o({...r,profile:t.getProfile()})}return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[t,r]);let i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(ok.Provider,{value:i,children:e.children})}function a8(e){window.location.assign(e)}var Qb=new Map,ik=e=>p.useMemo(()=>{if(!e)return;let t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;let r=n.get("Expires");if(!r||r.length>13)return e;let o=Qb.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 Qb.set(t,e),e},[e]);function vt(e,t){let n=ie(),[r,o]=p.useState(Kb(n,e)),i=p.useCallback(a=>{Xc(a,r)||o(a)},[r,o]);return p.useEffect(()=>{i(Kb(n,e))},[n,e,i]),p.useEffect(()=>{let a=!0;return Ls(e)&&n.readReference(e).then(l=>{a&&i(l)}).catch(l=>{a&&(i(void 0),t&&t(mt(l)))}),()=>a=!1},[n,r,e,i,t]),r}function Kb(e,t){if(t){if(Ko(t))return t;if(Ls(t))return e.getCachedReference(t)}}function l8(e,t){return sk("searchOne",e,t)}function Ha(e,t){return sk("searchResources",e,t)}function sk(e,t,n){let r=ie(),[o,i]=p.useState(),[a,l]=p.useState(!1),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{let h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(m=>{l(!1),u(m),f(fL)}).catch(m=>{l(!1),u(void 0),f(mt(m))}))},[r,e,t,n,o]),[c,a,d]}function c8(e){const t=e.value;return t?s.jsx(s.Fragment,{children:G7(t)}):null}const ak=["meta","implicitRules","contained","extension","modifierExtension"],lk=["language","text"],gt=p.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});gt.displayName="ElementsContext";const wx=["extension","modifierExtension"],u8=["id",...ak].filter(e=>!wx.includes(e));function d8(e){return Object.entries(e).filter(([n,r])=>{var o;return!Mt(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||wx.includes(n)&&!Mt((o=r.slicing)==null?void 0:o.slices)||u8.includes(n)?!1:!(lk.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function Yb(e,t){return e.line&&e.line.length>t?e.line[t]:""}function Xb(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function f8(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(gt),[i,a,l,c,u,d,f]=p.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(w=>o(e.path+"."+w)),[o,e.path]);function h(w){n(w),e.onChange&&e.onChange(w)}function m(w){h({...r.current,use:w})}function g(w){h({...r.current,type:w})}function v(w){h(Xb(r.current||{},0,w))}function S(w){h(Xb(r.current||{},1,w))}function y(w){h({...r.current,city:w})}function b(w){h({...r.current,state:w})}function x(w){h({...r.current,postalCode:w})}return s.jsxs(Z,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(Tt,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:w=>m(w.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(Tt,{disabled:e.disabled||(a==null?void 0:a.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:w=>g(w.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(fe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Line 1",defaultValue:Yb(t,0),onChange:w=>v(w.currentTarget.value)}),s.jsx(fe,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Line 2",defaultValue:Yb(t,1),onChange:w=>S(w.currentTarget.value)}),s.jsx(fe,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"City",defaultValue:t.city,onChange:w=>y(w.currentTarget.value)}),s.jsx(fe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"State",defaultValue:t.state,onChange:w=>b(w.currentTarget.value)}),s.jsx(fe,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:w=>x(w.currentTarget.value)})]})}function h8(e){const t=gh(),[n,r]=p.useState(e.defaultValue||{});function o(i){const a=i?{text:i,authorReference:t&&wt(t),time:new Date().toISOString()}:{};r(a),e.onChange&&e.onChange(a)}return s.jsx(fe,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
133
|
+
* @license @tabler/icons-react v3.5.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 p8={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.5.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=p.forwardRef(({color:i="currentColor",size:a=24,stroke:l=2,className:c,children:u,...d},f)=>p.createElement("svg",{ref:f,...p8[e],width:a,height:a,className:["tabler-icon",`tabler-icon-${t}`,c].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...d},[...r.map(([h,m])=>p.createElement(h,m)),...Array.isArray(u)?u:[u]]));return o.displayName=`${n}`,o};/**
|
|
143
|
+
* @license @tabler/icons-react v3.5.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 m8=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.5.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 al=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.5.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 g8=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.5.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 v8=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.5.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 y8=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.5.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 x8=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.5.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 b8=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.5.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 w8=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.5.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 S8=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.5.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 j8=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.5.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 C8=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.5.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 E8=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.5.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 Ui=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.5.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 Zc=we("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
213
|
+
* @license @tabler/icons-react v3.5.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 T8=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.5.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 ck=we("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
223
|
+
* @license @tabler/icons-react v3.5.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 Yd=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.5.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 Xd=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.5.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 Sx=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.5.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 P8=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.5.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 uk=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.5.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 k8=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.5.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 R8=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.5.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 _8=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.5.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 D8=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.5.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 eu=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.5.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 tu=we("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
278
|
+
* @license @tabler/icons-react v3.5.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 Jb=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.5.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 I8=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.5.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 A8=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.5.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 N8=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.5.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 M8=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.5.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 O8=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.5.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 $8=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.5.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 L8=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.5.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 F8=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.5.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 dk=we("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
328
|
+
* @license @tabler/icons-react v3.5.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 fk=we("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
333
|
+
* @license @tabler/icons-react v3.5.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 z8=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.5.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 B8=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.5.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 V8=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.5.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 U8=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.5.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 H8=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.5.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 W8=we("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
363
|
+
* @license @tabler/icons-react v3.5.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 q8=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.5.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 G8=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.5.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 Q8=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.5.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 K8=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.5.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 Y8=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.5.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 X8=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.5.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 rg=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.5.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 jx=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.5.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 Cx=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.5.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 J8=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.5.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 Z8=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.5.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 ez=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.5.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 tz=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.5.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 hk=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.5.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 Zb=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.5.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 nz=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.5.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 Jd=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.5.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 rz=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 pk extends p.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?s.jsx($i,{icon:s.jsx(al,{size:16}),title:"Something went wrong",color:"red",children:Ne(this.state.error)}):this.props.children}}function Wr(){return s.jsx(dn,{style:{width:"100%",height:"100vh"},children:s.jsx(Qn,{})})}const oz="_main_g2hyx_1",iz={main:oz};function ct(e){e.preventDefault(),e.stopPropagation()}function mk(e){if(ew(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&ew(t[0]))return!0}return!1}function ew(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function He(e){const t=mh(),{to:n,suffix:r,label:o,onClick:i,children:a,...l}=e;let c=sz(n);return r&&(c+="/"+r),s.jsx(Je,{href:c,"aria-label":o,onClick:u=>{ct(u),i?i(u):n&&t(c)},...l,children:a})}function sz(e){if(e){if(typeof e=="string")return az(e);if(Ko(e))return lz(e);if(Ls(e))return cz(e)}return"#"}function az(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function lz(e){return`/${e.resourceType}/${e.id}`}function cz(e){return`/${e.reference}`}function uz(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 Fi(e){const t=vt(e.value),n=t?$o(t):e.alt??"",r=uz(n),o=(t&&P7(t))??e.src,i=ik(o??void 0),a=e.radius??"xl",l={...e,value:void 0,link:void 0};return e.link?s.jsx(He,{to:t,children:s.jsx(ps,{src:i,alt:n,radius:a,...l,children:r})}):s.jsx(ps,{src:i,alt:n,radius:a,...l,children:r})}const dz="_logoButton_189g3_1",fz="_user_189g3_11",hz="_userName_189g3_21",pz="_userActive_189g3_31",Hu={logoButton:dz,user:fz,userName:hz,userActive:pz};function Ex(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Jc(t,e.options)}):null}function mz(e){var c,u,d;const t=ph(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:a,setColorScheme:l}=LD();return s.jsxs(s.Fragment,{children:[s.jsxs(Ae,{align:"center",p:"xl",children:[s.jsx(Fi,{size:"xl",radius:100,value:t.profile}),s.jsx(Ex,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),s.jsx(ue,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&s.jsx(re.Divider,{}),i.map(f=>f.profile.reference!==St(t.profile)&&s.jsx(re.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(Z,{children:[s.jsx(ps,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(ue,{size:"sm",fw:500,children:f.profile.display}),s.jsx(ue,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),s.jsx(re.Divider,{}),s.jsx(Z,{justify:"center",children:s.jsx(Vy,{size:"xs",value:a,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(ez,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(re.Item,{leftSection:s.jsx(rg,{size:14,stroke:1.5}),onClick:()=>o(`/${St(r)}`),children:"Account settings"}),s.jsx(re.Item,{leftSection:s.jsx(F8,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),s.jsx(ue,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}function Tx(e){const t=zc({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:a,toOption:l,loadOptions:c,itemComponent:u,onChange:d,onCreate:f,creatable:h,clearable:m,required:g,placeholder:v,leftSection:S,maxValues:y,optionsDropdownMaxHeight:b=320,...x}=e,w=x.disabled,j=gz(a),[E,C]=p.useState(""),[T,_]=p.useState(),[P,M]=p.useState(),[D,N]=p.useState(),[A,L]=p.useState(j.map(l)),[I,k]=p.useState([]),R=u??vz,$=p.useRef();$.current=E;const B=p.useRef(),H=p.useRef(),X=p.useRef();X.current=T;const ye=p.useRef();ye.current=P;const he=p.useRef();he.current=D;const be=p.useRef();be.current=I;const ke=p.useCallback(()=>{if(_(void 0),$.current===H.current&&c===B.current)return;H.current=$.current,B.current=c;const Ee=new AbortController;M(Ee),c($.current??"",Ee.signal).then(Pe=>{Ee.signal.aborted||(k(Pe.map(l)),M(void 0),he.current?(Pe.length>0&&d(Pe.slice(0,1)),N(!1)):Pe.length>0&&t.openDropdown())}).catch(Pe=>{Ee.signal.aborted||Pe.message.includes("aborted")||ve({color:"red",message:Ne(Pe)})})},[t,c,d,l]),Ce=p.useCallback(Ee=>{(I&&I.length>0||h)&&t.openDropdown(),t.updateSelectedOptionIndex(),C(Ee.currentTarget.value),ye.current&&(ye.current.abort(),M(void 0)),X.current!==void 0&&window.clearTimeout(X.current);const Pe=window.setTimeout(()=>ke(),100);_(Pe)},[t,I,h,ke]),se=p.useCallback(Ee=>{const Pe=[],ee=[...A];let ne=I==null?void 0:I.find(qe=>qe.value===Ee),Se=ne==null?void 0:ne.resource;if(!Se&&h!==!1&&f&&(Se=f(Ee),ne=l(Se)),Se&&Pe.push(Se),ne&&ee.push(ne),y!==void 0)for(;ee.length>y;)ee.shift();d(Pe),L(ee)},[h,I,A,y,d,f,l]),Ve=p.useMemo(()=>{if(!w)return Ee=>{w||(C(""),k([]),t.closeDropdown(),H.current=void 0,se(Ee==="$create"?E:Ee))}},[se,t,w,E]),ut=p.useCallback(Ee=>{const Pe=A.filter(ee=>ee.value!==Ee.value);d(Pe.map(ee=>ee.resource)),L(Pe)},[A,d]),lt=p.useCallback(Ee=>{Ee.key==="Enter"?!T&&!P?(ct(Ee),I&&I.length>0&&(k(I.slice(0,1)),se(I[0].value))):N(!0):Ee.key==="Backspace"&&E.length===0&&(ct(Ee),ut(A[A.length-1]))},[E,A,I,T,P,se,ut]);p.useEffect(()=>()=>{ye.current&&ye.current.abort()},[]);const We=!w&&m&&A.length>0&&s.jsx(Ie.ClearButton,{title:"Clear all",size:16,onClear:()=>{C(""),L([]),d([]),t.closeDropdown()}});return s.jsxs(Ie,{store:t,onOptionSubmit:Ve,withinPortal:!0,shadow:"xl",...x,children:[s.jsx(Ie.DropdownTarget,{children:s.jsx(Ba,{label:r,description:o,error:i,className:e.className,leftSection:S,rightSection:P?s.jsx(Qn,{size:16}):We,required:g,disabled:w,children:s.jsxs(ms.Group,{children:[A.map(Ee=>s.jsx(ms,{withRemoveButton:!w,onRemove:()=>ut(Ee),children:Ee.label},Ee.value)),!w&&(y===void 0||y===0||A.length<y)&&s.jsx(Ie.EventsTarget,{children:s.jsx(Ba.Field,{role:"searchbox",name:n,value:E,placeholder:v,onFocus:Ce,onBlur:()=>t.closeDropdown(),onKeyDown:lt,onChange:Ce})})]})})}),s.jsx(Ie.Dropdown,{children:s.jsx(Ie.Options,{children:s.jsxs(Af,{type:"scroll",mah:b,children:[I.map(Ee=>s.jsx(Ie.Option,{value:Ee.value,active:A.includes(Ee),children:s.jsx(R,{...Ee})},Ee.value)),h&&E.trim().length>0&&s.jsxs(Ie.Option,{value:"$create",children:["+ Create ",E]}),!h&&E.trim().length>0&&I.length===0&&s.jsx(Ie.Empty,{children:"Nothing found"})]})})})]})}function gz(e){return e?Array.isArray(e)?e:[e]:[]}function vz(e){return s.jsx(Z,{gap:"sm",children:s.jsx("span",{children:e.label})})}const yz="_searchInput_dick8_1",xz={searchInput:yz};function bz(e){return{value:e.id,label:$o(e),resource:e}}function wz(e){const t=mh(),n=ie(),r=p.useCallback(async(i,a)=>{const l=jz(i),c={signal:a},u=await n.graphql(l,void 0,void 0,c);return Cz(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${St(i[0])}`)},[t]);return s.jsx(Tx,{size:"sm",radius:"md",className:xz.searchInput,leftSection:s.jsx(X8,{size:16}),placeholder:"Search",itemComponent:Sz,toOption:bz,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const Sz=p.forwardRef(({resource:e,...t},n)=>{var o;let r;return e.resourceType==="Patient"?r=e.birthDate:e.resourceType==="ServiceRequest"&&(r=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:n,...t,children:s.jsxs(Z,{wrap:"nowrap",children:[s.jsx(Fi,{value:e}),s.jsxs("div",{children:[s.jsx(ue,{children:$o(e)}),s.jsx(ue,{size:"xs",c:"dimmed",children:r})]})]})})});function jz(e){const t=JSON.stringify(e);return DP(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 Cz(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),Tz(Ez(n),t).slice(0,5)}function Ez(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 Tz(e,t){return e.sort((n,r)=>tw(r,t)-tw(n,t))}function tw(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,nw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,nw(Jc(r),t));return n}function nw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function Pz(e){var o;const t=gh(),[n,r]=p.useState(!1);return s.jsx(Gn.Header,{p:8,style:{zIndex:101},children:s.jsxs(Z,{justify:"space-between",children:[s.jsxs(Z,{gap:"xs",children:[s.jsx(gn,{className:Hu.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(wz,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(Z,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(re,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(re.Target,{children:s.jsx(gn,{className:nt(Hu.user,{[Hu.userActive]:n}),onClick:()=>r(i=>!i),children:s.jsxs(Z,{gap:7,children:[s.jsx(Fi,{value:t,radius:"xl",size:24}),s.jsx(ue,{size:"sm",className:Hu.userName,children:Jc((o=t==null?void 0:t.name)==null?void 0:o[0])}),s.jsx(ck,{size:12,stroke:1.5})]})})}),s.jsx(re.Dropdown,{children:s.jsx(mz,{version:e.version})})]})]})]})})}function kz(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?Rz(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&_z(t,n);return t}function Rz(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function _z(e,t){e[t.name]=t.value}function Ge(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=kz(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function Dz(e){const t=ie(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=po(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:a,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:Ne(h)})})}return s.jsx(En,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(Ge,{onSubmit:r,children:s.jsxs(Ae,{children:[s.jsx(Iz,{config:n}),s.jsx(fe,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{mt:"sm",type:"submit",children:"OK"})})]})})})}function Iz(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 s.jsx(Tt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function gk(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function Az(e){return typeof e.display=="string"?e.display:gk(e)}function Nz(e){return{value:gk(e),label:Az(e),resource:e}}function Mz(e){return{code:e,display:e}}function Px(e){const t=ie(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:a,...l}=e,c=p.useCallback(async(u,d)=>{var g;if(!n)return[];const h=(g=(await t.valueSetExpand({...i,url:n,filter:u},{signal:d})).expansion)==null?void 0:g.contains,m=[];for(const v of h)v.code&&!m.some(S=>S.code===v.code)&&m.push(v);return m},[t,i,n]);return s.jsx(Tx,{...l,creatable:r??!0,clearable:o??!0,toOption:Nz,loadOptions:c,onCreate:Mz,itemComponent:a?Oz:void 0})}const Oz=p.forwardRef(({label:e,resource:t,...n},r)=>s.jsx("div",{ref:r,...n,children:s.jsx(Z,{wrap:"nowrap",children:s.jsxs("div",{children:[s.jsx(ue,{children:e}),s.jsx(ue,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})})}));function vk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=Lz(u);a(d),n&&n(d)}return s.jsx(Px,{defaultValue:$z(i),onChange:l,withHelpText:r??!0,...o})}function $z(e){return e?{code:e}:void 0}function Lz(e){return e==null?void 0:e.code}function kx(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return s.jsx(vk,{disabled:e.disabled,"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 Fz="_menuTitle_9g6l5_1",zz="_link_9g6l5_9",Bz="_linkActive_9g6l5_38",og={menuTitle:Fz,link:zz,linkActive:Bz};function Vz(e){var l;const t=mh(),n=Wz(e.pathname,e.searchParams,e.menus),[r,o]=p.useState(!1);function i(c,u){c.stopPropagation(),c.preventDefault(),t(u),window.innerWidth<768&&e.closeNavbar()}function a(c){c&&t(`/${c}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Gn.Navbar,{children:s.jsxs(Pr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Gn.Section,{mb:"sm",children:s.jsx(kx,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>a(c)},window.location.pathname)}),s.jsxs(Gn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return s.jsxs(p.Fragment,{children:[s.jsx(ue,{className:og.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>s.jsxs(Uz,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[s.jsx(Hz,{to:d.href,icon:d.icon}),s.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&s.jsx(oe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(q8,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(Dz,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function Uz(e){return s.jsx(He,{onClick:e.onClick,to:e.to,className:nt(og.link,{[og.linkActive]:e.active}),children:e.children})}function Hz(e){return e.icon?e.icon:s.jsx(ah,{w:30})}function Wz(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const a of i.links){const l=qz(e,t,a.href);l>o&&(o=l,r=a)}return r}function qz(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of r.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||r.searchParams.get(a)===l&&i++;return i}function Gz(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=ie(),o=gh();p.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 a(){i(!1)}function l(){i(!t)}return r.isLoading()?s.jsx(Wr,{}):s.jsxs(Gn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&s.jsx(Pz,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?s.jsx(Vz,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:a,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Gn.Main,{className:iz.main,children:s.jsx(pk,{children:s.jsx(p.Suspense,{fallback:s.jsx(Wr,{}),children:e.children})})})]})}function nu(e){const{contentType:t,url:n,title:r}=e.value??{},o=ik(n);return o?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:o})}),t==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Je,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:Qz(r),children:r||"Download"})})]}):null}function Qz(e){return e!=null&&e.includes(".")?e:void 0}const Kz="_root_17n8t_1",Yz="_compact_17n8t_25",rw={root:Kz,compact:Yz};function Rx(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:nt(rw.root,{[rw.compact]:n}),children:t})}function ko(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function Xz(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>s.jsx("div",{children:s.jsx(nu,{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(!Mt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=s.jsx(ko,{term:vs(o),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function _x(e){const t=ie(),n=p.useRef(null);function r(a){var l;ct(a),(l=n.current)==null||l.click()}function o(a){ct(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){!a||!a.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:a,contentType:a.type||"application/octet-stream",filename:a.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(c=>e.onUpload(c)).catch(c=>{e.onUploadError&&e.onUploadError(mt(c))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:a=>o(a)}),e.children({onClick:r,disabled:e.disabled})]})}function Jz(e){const[t,n]=p.useState(e.defaultValue??[]),r=p.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(nu,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(tn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{ct(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(Yd,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(_x,{disabled:e.disabled,onUpload:i=>{o([...r.current,i])},children:i=>s.jsx(tn,{...i,title:"Add",variant:"subtle",size:"sm",color:i.disabled?"gray":"green",children:s.jsx(Sx,{})})})})]})]})]})}function yk(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(nu,{value:t,maxWidth:200}),s.jsx(oe,{disabled:e.disabled,onClick:o=>{ct(o),r(void 0)},children:"Remove"})]}):s.jsx(_x,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>s.jsx(oe,{...o,children:"Upload..."})})}function uo(e){return s.jsx(s.Fragment,{children:_i(e.value)})}function Zz(e){return s.jsx(s.Fragment,{children:Os(e.value)})}function xk(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("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function eB(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(xk,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function tB(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function nB(e){return s.jsx(s.Fragment,{children:e6(e.value)})}function jc(e){return s.jsx(s.Fragment,{children:ai(e.value)})}function Dx(e){return s.jsx(s.Fragment,{children:bc(e.value)})}function rB(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(jc,{value:t.numerator})," / ",s.jsx(jc,{value:t.denominator})]}):null}function Zd(e){if(!e.value)return null;const t=e.value.display||e.value.reference||ar(e.value);return e.link!==!1&&e.value.reference?s.jsx(He,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function bk(e,t,n,r){if(!Mt(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 a=nk(i,t,n.discriminator,r);let l=a?t.findIndex(c=>c.name===a):-1;l===-1&&(l=t.length),o[l].push(i)}return o}async function wk({medplum:e,property:t}){return new Promise((n,r)=>{var l,c;if(!t.slicing){n([]);return}const o=[],i=[],a=[];for(const u of t.slicing.slices){if(!tk(u)){console.debug("Unsupported slice definition",u);continue}let d;Mt(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?a.push(e.requestProfileSchema(d)):a.push(Promise.resolve([]))}Promise.all(a).then(()=>{for(let u=0;u<o.length;u++){const d=o[u],f=i[u];if(f){const h=Ms(f);d.typeSchema=h}}n(o)}).catch(r)})}function vh(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function oB(e){var a,l;const{slice:t,property:n}=e,r=((a=t.typeSchema)==null?void 0:a.elements)??t.elements,o=p.useContext(gt),i=p.useMemo(()=>{var c;if(Mt(r))return Ua({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 vh(gt.Provider,i,s.jsx(s.Fragment,{children:e.value.map((c,u)=>s.jsx("div",{children:s.jsx(qr,{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 iB(e){var g;const{property:t,propertyType:n}=e,r=ie(),o=p.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,a]=p.useState(!0),[l,c]=p.useState([]),[u,d]=p.useState(()=>[o]),f=p.useContext(gt);if(p.useEffect(()=>{wk({medplum:r,property:t}).then(v=>{c(v);const S=bk(o,v,t.slicing,f.profileUrl);d(S),a(!1)}).catch(v=>{console.error(v),a(!1)})},[r,t,f.profileUrl,d,o]),i)return s.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,b)=>s.jsx("div",{children:s.jsx(qr,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:y,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${b}-${v.length}`));if(e.includeDescriptionListEntry){if(!Mt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const y=e.path.split(".").pop();h=s.jsx(ko,{term:vs(y),children:S})}else h=s.jsx(s.Fragment,{children:S})}return s.jsxs(s.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=s.jsx(oB,{path:e.path,slice:v,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(y=s.jsx(ko,{term:vs(v.name),children:y},v.name)),y}),h]})}function ru(e,t,n){const r=hn(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 sB(e,t,n){const r=SP(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function aB(e){const{elementDefinitionType:t}=e,n=ie(),r=p.useContext(gt),[o,i]=p.useState(bP("Extension")),a=p.useMemo(()=>{if(Mt(t==null?void 0:t.profile))return t.profile[0]},[t]),[l,c]=p.useState(a!==void 0);if(p.useEffect(()=>{a&&(c(!0),n.requestProfileSchema(a).then(()=>{const f=Ms(a);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,a]),a&&(l||!rx(a)))return s.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=ru({type:"Extension",value:e.value},"value[x]",a??r.profileUrl);return s.jsx(qr,{propertyType:h,value:f})}return s.jsx(ef,{path:e.path,value:{type:o.name,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:a})}function qr(e){var i;const{property:t,propertyType:n,value:r}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(W,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Bt(r)&&s.jsx(xT,{value:r,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(Is,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(tn,{variant:"subtle",color:a?"teal":"gray",onClick:l,children:a?s.jsx(Zc,{size:"1rem"}):s.jsx(uk,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===U.Attachment?s.jsx(Xz,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(iB,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case U.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case U.SystemString:case U.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case U.code:case U.date:case U.decimal:case U.id:case U.integer:case U.positiveInt:case U.unsignedInt:case U.uri:case U.url:return s.jsx(s.Fragment,{children:r});case U.canonical:return s.jsx(Zd,{value:{reference:r},link:e.link});case U.dateTime:case U.instant:return s.jsx(s.Fragment,{children:Nn(r)});case U.markdown:return s.jsx("pre",{children:r});case U.Address:return s.jsx(c8,{value:r});case U.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case U.Attachment:return s.jsx(nu,{value:r,maxWidth:e.maxWidth});case U.CodeableConcept:return s.jsx(uo,{value:r});case U.Coding:return s.jsx(Zz,{value:r});case U.ContactDetail:return s.jsx(eB,{value:r});case U.ContactPoint:return s.jsx(xk,{value:r});case U.HumanName:return s.jsx(Ex,{value:r});case U.Identifier:return s.jsx(tB,{value:r});case U.Money:return s.jsx(nB,{value:r});case U.Period:return s.jsx(s.Fragment,{children:K7(r)});case U.Quantity:case U.Duration:return s.jsx(jc,{value:r});case U.Range:return s.jsx(Dx,{value:r});case U.Ratio:return s.jsx(rB,{value:r});case U.Reference:return s.jsx(Zd,{value:r,link:e.link});case U.Timing:return s.jsx(s.Fragment,{children:MP(r)});case U.Dosage:case U.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(ef,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case U.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(aB,{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 s.jsx(ef,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const Sk=["extension","modifierExtension"],lB=ak.filter(e=>!Sk.includes(e));function ef(e){const t=e.value,{value:n,type:r}=t,o=p.useContext(gt),i=e.profileUrl??(o==null?void 0:o.profileUrl),a=p.useMemo(()=>ch(r,i),[i,r]),l=p.useMemo(()=>{if(a)return Ua({parentContext:o,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,o,e.path,e.accessPolicyResource]);if(Bt(n))return null;if(!a)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const c=l??o;return vh(gt.Provider,l,s.jsx(Rx,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(Sk.includes(u)&&Bt((v=d.slicing)==null?void 0:v.slices))return null;if(lB.includes(u))return null;if(lk.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=ru(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&Bt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const m=d.max>1||d.isArray,g=s.jsx(qr,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:m,link:e.link},u);return m?g:s.jsx(ko,{term:vs(u),children:g},u)})}))}const jk="Read Only";function Ck(e,t){return e?s.jsx(Is.Floating,{label:e,children:t}):t}const cB="_dimmed_1pxw4_1",Ek={dimmed:cB};function Tk(e){const{debugMode:t}=p.useContext(gt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Ck(e!=null&&e.readonly?jk:void 0,s.jsxs(Z,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Dt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Ek.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Ye(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var a;return Pk((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:r.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
|
|
516
|
+
`)}function ou(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return Pk((o=r.expression)==null?void 0:o[0],t)})}const Wu=/\[\d+\]/;function Pk(e,t){const n=typeof e=="string"&&Wu.test(e),r=typeof t=="string"&&Wu.test(t);if(n!==r&&(e=e==null?void 0:e.replace(Wu,""),t=t==null?void 0:t.replace(Wu,"")),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 ht(e){const{debugMode:t}=p.useContext(gt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Ck(e!=null&&e.readonly?jk:void 0,s.jsx(Dt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Ek.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,error:Ye(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function kk(e,t,n,r,o){const i=r.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",Gt(a.code));l in e&&delete e[l]}return e[n]=o,e}function uB(e){return!!e&&!Bt(e.url)&&!Bt(e.name)}function dB(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:i,valuePath:a,...l}=e,[c,u]=p.useState(t);function d(f){const h=hB(f);u(h),n&&n(h)}return s.jsx(Px,{defaultValue:c&&fB(c),onChange:d,withHelpText:r??!0,...l})}function fB(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function hB(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function Rk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=u&&mB(u);a(d),n&&n(d)}return s.jsx(Px,{defaultValue:i&&pB(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function pB(e){return{system:e.system,code:e.code,display:e.display}}function mB(e){return{system:e.system,code:e.code,display:e.display}}function _k(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=p.useContext(gt),[i,a]=p.useState(e.defaultValue),l=p.useRef();l.current=i;const[c,u,d]=p.useMemo(()=>["system","use","value"].map(x=>r[t+"."+x]),[r,t]),[f,h,m]=p.useMemo(()=>["system","use","value"].map(x=>o(t+"."+x)),[o,t]);function g(x){x&&Object.keys(x).length===0&&(x=void 0),a(x),e.onChange&&e.onChange(x)}function v(x){const w={...l.current,system:x};x||delete w.system,g(w)}function S(x){const w={...l.current,use:x};x||delete w.use,g(w)}function y(x){const w={...l.current,value:x};x||delete w.value,g(w)}const b=e.valuePath??t;return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Tt,{disabled:e.disabled||(f==null?void 0:f.readonly),"data-testid":"system",defaultValue:i==null?void 0:i.system,required:((c==null?void 0:c.min)??0)>0,onChange:x=>v(x.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ye(n,b+".system")}),s.jsx(Tt,{disabled:e.disabled||(h==null?void 0:h.readonly),"data-testid":"use",defaultValue:i==null?void 0:i.use,required:((u==null?void 0:u.min)??0)>0,onChange:x=>S(x.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ye(n,b+".use")}),s.jsx(fe,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Value",defaultValue:i==null?void 0:i.value,required:((d==null?void 0:d.min)??0)>0,onChange:x=>y(x.currentTarget.value),error:Ye(n,b+".value")})]})}function gB(e){var d;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(gt),[i,a]=p.useMemo(()=>["name","telecom"].map(f=>o(e.path+"."+f)),[o,e.path]);function l(f){n(f),e.onChange&&e.onChange(f)}function c(f){const h={...r.current,name:f};f||delete h.name,l(h)}function u(f){const h={...r.current,telecom:f&&[f]};f||delete h.telecom,l(h)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(fe,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:f=>c(f.currentTarget.value)}),s.jsx(_k,{disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(d=t==null?void 0:t.telecom)==null?void 0:d[0],onChange:u,outcome:e.outcome})]})}function vB(e){if(!e)return"";const t=new Date(e);return dh(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Dk(e){if(!e)return"";const t=new Date(e);return dh(t)?t.toISOString():""}var yB={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.7-5fa90717f",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function ys(e){return s.jsx(fe,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:xB(),defaultValue:vB(e.defaultValue),autoFocus:e.autoFocus,error:Ye(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Dk(n))}}})}function xB(){return yB.NODE_ENV==="test"?"text":"datetime-local"}function bB(e){const{propertyType:t}=e,n=ie(),[r,o]=p.useState(),i=p.useMemo(()=>{if(Mt(t.profile))return t.profile[0]},[t]),[a,l]=p.useState(i!==void 0);return p.useEffect(()=>{i&&(l(!0),n.requestProfileSchema(i).then(()=>{const c=Ms(i);l(!1),o(c)}).catch(c=>{l(!1),console.warn(c)}))},[n,i]),i&&(a||!rx(i))?s.jsx("div",{children:"Loading..."}):s.jsx(Nx,{profileUrl:i,path:e.path,typeName:(r==null?void 0:r.name)??"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function wB(e){var b,x,w;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue),{getExtendedProps:i}=p.useContext(gt),[a,l,c,u,d]=p.useMemo(()=>["use","prefix","given","family","suffix"].map(j=>i(e.path+"."+j)),[i,e.path]);function f(j){o(j),e.onChange&&e.onChange(j)}function h(j){f({...r,use:j||void 0})}function m(j){f({...r,prefix:j?j.split(" "):void 0})}function g(j){f({...r,given:j?j.split(" "):void 0})}function v(j){f({...r,family:j||void 0})}function S(j){f({...r,suffix:j?j.split(" "):void 0})}const y=e.valuePath??n;return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Tt,{disabled:e.disabled||(a==null?void 0:a.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:j=>h(j.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ye(t,y+".use")}),s.jsx(fe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(b=r==null?void 0:r.prefix)==null?void 0:b.join(" "),onChange:j=>m(j.currentTarget.value),error:Ye(t,y+".prefix")}),s.jsx(fe,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(x=r==null?void 0:r.given)==null?void 0:x.join(" "),onChange:j=>g(j.currentTarget.value),error:Ye(t,y+".given")}),s.jsx(fe,{disabled:e.disabled||(u==null?void 0:u.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:j=>v(j.currentTarget.value),error:Ye(t,y+".family")}),s.jsx(fe,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(w=r==null?void 0:r.suffix)==null?void 0:w.join(" "),onChange:j=>S(j.currentTarget.value),error:Ye(t,y+".suffix")})]})}function SB(e){const[t,n]=p.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=p.useContext(gt),[i,a]=p.useMemo(()=>["system","value"].map(f=>r[e.path+"."+f]),[r,e.path]),[l,c]=p.useMemo(()=>["system","value"].map(f=>o(e.path+"."+f)),[o,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}const d=e.valuePath??e.path;return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(fe,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"System",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:f=>u({...t,system:f.currentTarget.value}),error:Ye(e.outcome,d+".system")}),s.jsx(fe,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Value",required:((a==null?void 0:a.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:f=>u({...t,value:f.currentTarget.value}),error:Ye(e.outcome,d+".value")})]})}const jB=["USD","EUR","CAD","GBP","AUD"];function CB(e){var f;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),{getExtendedProps:o}=p.useContext(gt),[i,a]=p.useMemo(()=>["currency","value"].map(h=>o(e.path+"."+h)),[o,e.path]),l=p.useCallback(h=>{r(h),t&&t(h)},[t]),c=p.useCallback(h=>{l({...n,currency:h.currentTarget.value})},[n,l]),u=p.useCallback(h=>{l({...n,value:h.currentTarget.valueAsNumber})},[n,l]),d=s.jsx(Tt,{disabled:e.disabled||(i==null?void 0:i.readonly),defaultValue:n==null?void 0:n.currency,data:jB,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:c});return s.jsx(fe,{disabled:e.disabled||(a==null?void 0:a.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((f=n==null?void 0:n.value)==null?void 0:f.toString())??"USD",leftSection:s.jsx(k8,{size:14}),rightSection:d,rightSectionWidth:92,onChange:u})}function EB(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(gt),[o,i]=p.useMemo(()=>["start","end"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ys,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:l=>a({...t,start:l})}),s.jsx(ys,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:l=>a({...t,end:l})})]})}function xs(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(gt),[o,i,a]=p.useMemo(()=>["comparator","value","unit"].map(c=>r(e.path+"."+c)),[r,e.path]);function l(c){n(c),e.onChange&&e.onChange(c)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Tt,{disabled:e.disabled||(o==null?void 0:o.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:c=>l({...t,comparator:c.currentTarget.value})}),s.jsx(fe,{disabled:e.disabled||(i==null?void 0:i.readonly),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:c=>{e.disableWheel&&c.currentTarget.blur()},onChange:c=>{l({...t,value:TB(c.currentTarget.value)})}}),s.jsx(fe,{disabled:e.disabled||(a==null?void 0:a.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:c=>l({...t,unit:c.currentTarget.value})})]})}function TB(e){if(e)return parseFloat(e)}function Ix(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(gt),[o,i]=p.useMemo(()=>["low","high"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(xs,{path:e.path+".low",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:l=>a({...t,low:l})}),s.jsx(xs,{path:e.path+".high",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:l=>a({...t,high:l})})]})}function PB(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(gt),[o,i]=p.useMemo(()=>["numerator","denominator"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(xs,{path:e.path+".numerator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:l=>a({...t,numerator:l})}),s.jsx(xs,{path:e.path+".denominator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:l=>a({...t,denominator:l})})]})}const kB={Device:"device-name",Observation:"code",User:"email:contains"},RB=["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 _B(e){return{value:St(e),label:$o(e),resource:e}}function ll(e){const t=ie(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),a=vt(e.defaultValue,i),l=e.onChange,c=p.useCallback(async(d,f)=>{const h=IB(n),m=new URLSearchParams({[h]:d??"",_count:"10",...r});return await t.searchResources(n,m,{signal:f})},[t,n,r]),u=p.useCallback(d=>{l&&l(d[0])},[l]);return Mt(e.defaultValue)&&!o&&!a?null:s.jsx(Tx,{disabled:e.disabled,name:e.name,required:e.required,itemComponent:DB,defaultValue:a,placeholder:e.placeholder,maxValues:1,toOption:_B,loadOptions:c,onChange:u,clearable:!0})}const DB=p.forwardRef(({label:e,resource:t,...n},r)=>s.jsx("div",{ref:r,...n,children:s.jsxs(Z,{wrap:"nowrap",children:[s.jsx(Fi,{value:t}),s.jsxs("div",{children:[s.jsx(ue,{children:e}),s.jsx(ue,{size:"xs",c:"dimmed",children:t.birthDate})]})]})}));function IB(e){return kB[e]??(RB.includes(e)?"name":"_id")}function yh(e){const{onChange:t}=e,n=ie(),[r,o]=p.useState(e.defaultValue),[i,a]=p.useState(()=>AB(e.targetTypes)),[l,c]=p.useState(()=>NB(e.defaultValue,i)),u=p.useRef(new YP),d=p.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);p.useEffect(()=>{let m=!1;const g=i==null?void 0:i.map(v=>{if(!OB(v))return Promise.resolve(v);m=!0;const S=v.value,y=u.current.get(S);if(y)return y;const b=MB(n,v.value).then(w=>{const j={...v};return w?Mt(w.type)?(j.resourceType=w.type,j.name=w.name,j.title=w.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(w=>(console.error(w),{...v,error:w})),x=new Ar(b);return u.current.set(S,x),x});!g||!m||Promise.all(g).then(v=>{if(a(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=p.useCallback(m=>{const g=m?wt(m):void 0;o(g),t&&t(g)},[t]),h=p.useMemo(()=>i?i.map(m=>({value:m.value,label:m.type==="profile"?m.title??m.name??m.resourceType??m.value:m.value})):[],[i]);return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&s.jsx(Tt,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:m=>{const g=m.currentTarget.value,v=i.find(S=>S.value===g);c(v)},data:h}),!i&&s.jsx(kx,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:m=>{c(m?{type:"resourceType",value:m,resourceType:m}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(ll,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f,disabled:e.disabled})]})}function AB(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 NB(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 MB(e,t){const n=Ms(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 OB(e){return e.type==="profile"&&!(e!=null&&e.error)&&Bt(e.resourceType)}const $B="_indented_ldk1d_1",Ik={indented:$B};function Ak({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(oe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Xd,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(tn,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Xd,{size:"1.25rem"})})}function Nk({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(tn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(Yd,{size:"1.25rem"})})}function LB(e){var m,g;const{slice:t,property:n}=e,[r,o]=p.useState(e.defaultValue),i=((m=t.typeSchema)==null?void 0:m.elements)??t.elements,a=p.useContext(gt),l=p.useMemo(()=>{var v;if(Mt(i))return Ua({parentContext:a,elements:i,path:e.path,profileUrl:(v=t.typeSchema)==null?void 0:v.url})},[a,e.path,(g=t.typeSchema)==null?void 0:g.url,i]);function c(v){o(v),e.onChange&&e.onChange(v)}const u=t.min>0,d=Bt(t.elements),f=LP(t.name),h=e.property.readonly&&r.length===0;return vh(gt.Provider,l,s.jsx(ht,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:h?s.jsx(ue,{c:"dimmed",children:"(empty)"}):s.jsxs(Ae,{className:d?Ik.indented:void 0,children:[r.map((v,S)=>s.jsxs(Z,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:s.jsx(Ax,{elementDefinitionType:t.type[0],name:t.name,defaultValue:v,onChange:y=>{const b=[...r];b[S]=y,c(b)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&s.jsx(Nk,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:y=>{ct(y);const b=[...r];b.splice(S,1),c(b)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(Z,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Ak,{propertyDisplayName:f,onClick:v=>{ct(v);const S=[...r,void 0];c(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function FB(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function zB(e){var b;const{property:t}=e,n=ie(),[r,o]=p.useState(!0),[i,a]=p.useState([]),[l]=p.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=p.useState(()=>[l]),d=p.useContext(gt),f=(b=t.type[0])==null?void 0:b.code;p.useEffect(()=>{wk({medplum:n,property:t}).then(x=>{a(x);const w=bk(l,x,t.slicing,d.profileUrl);BB(w,x),u(w),o(!1)}).catch(x=>{console.error(x),o(!1)})},[n,t,l,d.profileUrl,u]);function h(x,w){const j=[...c];if(j[w]=x,u(j),e.onChange){const E=j.flat().filter(C=>C!==void 0);e.onChange(E)}}if(r)return s.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=vs(t.path),y=e.property.readonly&&i.length===0&&l.length===0;return s.jsxs(Ae,{className:e.indent?Ik.indented:void 0,children:[y&&s.jsx(ue,{c:"dimmed",children:"(empty)"}),i.map((x,w)=>s.jsx(LB,{slice:x,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[w],onChange:j=>{h(j,w)},testId:`slice-${x.name}`},x.name)),v&&g.map((x,w)=>s.jsxs(Z,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(cl,{arrayElement:!0,property:e.property,name:e.name+"."+w,path:e.path,valuePath:FB(e.path,e.valuePath,w),defaultValue:x,onChange:j=>{const E=[...g];E[w]=j,h(E,m)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(Nk,{propertyDisplayName:S,testId:`nonsliced-remove-${w}`,onClick:j=>{ct(j);const E=[...g];E.splice(w,1),h(E,m)}})]},`${w}-${g.length}`)),!e.property.readonly&&v&&c.flat().length<t.max&&s.jsx(Z,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Ak,{propertyDisplayName:S,onClick:x=>{ct(x);const w=[...g];w.push(void 0),h(w,m)},testId:"nonsliced-add"})})]})}function BB(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 VB(e){const[t,n]=p.useState(!1),r=TS(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),s.jsxs(hs,{gap:"xs",children:[s.jsx(Ds,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(tn,{title:"Copy secret",onClick:()=>{var a;r.copy((a=o.current)==null?void 0:a.value),ve({color:"green",message:"Copied"})},children:s.jsx(uk,{})})]})}const UB=["sun","mon","tue","wed","thu","fri","sat"];function HB(e){const[t,n]=p.useState(e.defaultValue),[r,o]=p.useState(!e.disabled&&(e.defaultModalOpen??!1)),i=p.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:MP(i.current)||"No repeat"}),s.jsx(oe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&s.jsx(WB,{path:e.path,visible:r,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),n(a),o(!1)},onCancel:()=>o(!1)})]})}const ow={repeat:{period:1,periodUnit:"d"}};function WB(e){const[t,n]=p.useState(e.defaultValue||ow),{getExtendedProps:r}=p.useContext(gt),[o,i,a,l,c]=p.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(v=>r(e.path+"."+v)),[r,e.path]),u=p.useRef();u.current=t;function d(v){n({...u.current,event:[v]})}function f(v){n({...u.current,repeat:v})}function h(v){var S;f({...(S=u.current)==null?void 0:S.repeat,period:v})}function m(v){var S;f({...(S=u.current)==null?void 0:S.repeat,periodUnit:v})}function g(v){var S;f({...(S=u.current)==null?void 0:S.repeat,dayOfWeek:v})}return s.jsx(En,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(Ae,{children:[s.jsx(ht,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(ys,{disabled:o==null?void 0:o.readonly,name:"timing-dialog-start",onChange:v=>d(v)})}),s.jsx(qc,{disabled:i==null?void 0:i.readonly,label:"Repeat",checked:!!t.repeat,onChange:v=>f(v.currentTarget.checked?ow.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(ht,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(fe,{disabled:a==null?void 0:a.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:v=>h(parseInt(v.currentTarget.value,10)||1)}),s.jsx(Tt,{disabled:l==null?void 0:l.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:v=>m(v.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"&&s.jsx(ht,{title:"Repeat on",children:s.jsx(mc.Group,{multiple:!0,onChange:g,children:s.jsx(Z,{justify:"space-between",mt:"md",gap:"xs",children:UB.map(v=>s.jsx(mc,{value:v,size:"xs",radius:"xl",disabled:c==null?void 0:c.readonly,children:v.charAt(0).toUpperCase()},v))})})})]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function cl(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,a=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===U.Attachment)return s.jsx(Jz,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const c=((l=a[0])==null?void 0:l.code)!==U.Extension;return s.jsx(zB,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:c,onChange:r,outcome:e.outcome})}else return a.length>1?s.jsx(qB,{elementDefinitionTypes:a,...e}):s.jsx(Ax,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",Gt(a[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:a[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function qB(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=p.useState(n);return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Tt,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(Ax,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",Gt(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function Ax(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:a,readOnly:l}=e,c=e.min!==void 0&&e.min>0,u=e.elementDefinitionType.code,d=p.useContext(gt),f=p.useMemo(()=>{if(!sx(u)||!Bt(e.defaultValue))return e.defaultValue;const g=Object.create(null);if(d.path===e.path)Gb(g,d.elements);else{const v=yc(d.path,e.path);if(v===void 0)return e.defaultValue;Gb(g,d.elements,v)}return Mt(g)?g:e.defaultValue},[u,d.path,d.elements,e.path,e.defaultValue]);if(!u)return s.jsx("div",{children:"Property type not specified "});function h(){return{name:t,defaultValue:f,onChange:n,outcome:r,path:i,valuePath:a,disabled:l}}function m(){const g=Ye(e.outcome,a??i);return{id:t,name:t,"data-testid":t,defaultValue:f,required:c,error:g,disabled:l}}switch(u){case U.SystemString:case U.canonical:case U.string:case U.time:case U.uri:case U.url:return e.path==="Project.secret.value[x]"?s.jsx(VB,{...m(),onChange:g=>{e.onChange&&e.onChange(g.currentTarget.value)}}):s.jsx(fe,{...m(),onChange:g=>{n&&n(g.currentTarget.value)}});case U.date:return s.jsx(fe,{...m(),type:"date",onChange:g=>{n&&n(g.currentTarget.value)}});case U.dateTime:case U.instant:return s.jsx(ys,{...m(),onChange:n,outcome:r});case U.decimal:case U.integer:case U.positiveInt:case U.unsignedInt:return s.jsx(fe,{...m(),type:"number",step:u===U.decimal?"any":"1",onChange:g=>{if(n){const v=g.currentTarget.valueAsNumber;n(Number.isNaN(v)?void 0:v)}}});case U.code:return s.jsx(vk,{...m(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case U.boolean:return s.jsx(Yn,{...m(),defaultChecked:!!f,onChange:g=>{n&&n(g.currentTarget.checked)}});case U.base64Binary:case U.markdown:return s.jsx(Ds,{...m(),spellCheck:u!==U.base64Binary,onChange:g=>{n&&n(g.currentTarget.value)}});case U.Address:return s.jsx(f8,{...h()});case U.Annotation:return s.jsx(h8,{...h()});case U.Attachment:return s.jsx(yk,{...h()});case U.CodeableConcept:return s.jsx(dB,{binding:o==null?void 0:o.valueSet,...h()});case U.Coding:return s.jsx(Rk,{binding:o==null?void 0:o.valueSet,...h()});case U.ContactDetail:return s.jsx(gB,{...h()});case U.ContactPoint:return s.jsx(_k,{...h()});case U.Extension:return s.jsx(bB,{...h(),propertyType:e.elementDefinitionType});case U.HumanName:return s.jsx(wB,{...h()});case U.Identifier:return s.jsx(SB,{...h()});case U.Money:return s.jsx(CB,{...h()});case U.Period:return s.jsx(EB,{...h()});case U.Duration:case U.Quantity:return s.jsx(xs,{...h()});case U.Range:return s.jsx(Ix,{...h()});case U.Ratio:return s.jsx(PB,{...h()});case U.Reference:return s.jsx(yh,{...h(),targetTypes:QB(e.elementDefinitionType)});case U.Timing:return s.jsx(HB,{...h()});case U.Dosage:case U.UsageContext:default:return s.jsx(Nx,{...h(),typeName:u})}}const GB=[`${iL}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function QB(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=GB.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function KB(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useContext(gt),o=p.useMemo(()=>d8(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const a={type:e.type,value:t};return s.jsx(Ae,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=sB(a,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,m=s.jsx(cl,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(kk({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||wx.includes(l)?m:c.type.length===1&&c.type[0].code==="boolean"?s.jsx(Tk,{title:vs(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,readonly:c.readonly,children:m},l):s.jsx(ht,{title:vs(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,readonly:c.readonly,children:m},l)})})}function Nx(e){const[t]=p.useState(()=>e.defaultValue??{}),n=p.useContext(gt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=p.useMemo(()=>ch(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,a=p.useMemo(()=>{if(o)return Ua({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?vh(gt.Provider,a,s.jsx(KB,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[i," not implemented"]})}const YB="_root_1vii2_1",XB={root:YB};function iu(e){const{children:t,...n}=e;return s.jsx(xy,{className:XB.root,...n,children:t})}const JB="_noteBody_10swh_1",ZB="_noteCite_10swh_5",eV="_noteRoot_10swh_10",iw={noteBody:JB,noteCite:ZB,noteRoot:eV};function Mk({value:e}){return e?s.jsx(Ae,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(gy,{classNames:{cite:iw.noteCite,root:iw.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function ul(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),a=vt(t,i);let l;if(o&&!pP(o))l=`[${Ne(o)}]`;else if(a)l=$o(a);else return null;return n?s.jsx(He,{to:t,...r,children:l}):s.jsx(ue,{component:"span",...r,children:l})}function Ra(e){return s.jsxs(Z,{gap:"xs",children:[s.jsx(Fi,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(ul,{value:e.value,link:e.link})]})}const tV={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 Mx(e){return s.jsx(Bc,{color:tV[e.status],children:e.status})}const nV="_table_pe9td_1",rV="_criticalRow_pe9td_12",oV="_noteBody_pe9td_23",iV="_noteCite_pe9td_27",sV="_noteRoot_pe9td_32",Ok={table:nV,criticalRow:rV,noteBody:oV,noteCite:iV,noteRoot:sV};Ox.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Ox(e){var a;const t=ie(),n=vt(e.value),[r,o]=p.useState();if(p.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,n]),!n)return null;const i=(r==null?void 0:r.flatMap(l=>l.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const l=n.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs(Ae,{children:[s.jsx(de,{children:"Diagnostic Report"}),s.jsx(aV,{value:n}),r&&!e.hideSpecimenInfo&&lV(r),n.result&&s.jsx(cV,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&s.jsx(Mk,{value:i})]})}function aV({value:e}){var t,n;return s.jsxs(Z,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(Ra,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(Ra,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(Ra,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(ue,{children:Nn(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(ue,{children:Gt(e.status)})]})]})}function lV(e){return s.jsxs(Ae,{gap:"xs",children:[s.jsx(de,{order:2,size:"h6",children:"Specimens"}),s.jsx(In,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(In.Item,{ml:"sm",children:s.jsxs(Z,{gap:20,children:[s.jsxs(Z,{gap:5,children:[s.jsx(ue,{fw:500,children:"Collected:"})," ",Nn((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(Z,{gap:5,children:[s.jsx(ue,{fw:500,children:"Received:"})," ",Nn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function cV(e){return s.jsxs("table",{className:Ok.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx($k,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function $k(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(uV,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Ls(n)?n.reference:n.id}`))})}function uV(e){var o,i;const t=vt(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=hV(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:nt({[Ok.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(He,{to:t,children:s.jsx(uo,{value:t.code})})}),s.jsx("td",{children:s.jsx(dV,{value:t})}),s.jsx("td",{children:s.jsx(fV,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(uo,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(a=>s.jsx("div",{children:s.jsx(uo,{value:a})},`category-${_i(a)}`))})}),s.jsx("td",{children:(i=t.performer)==null?void 0:i.map(a=>s.jsx(Zd,{value:a},a.reference))}),s.jsx("td",{children:t.status&&s.jsx(Mx,{status:t.status})})]}),t.hasMember&&s.jsx($k,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(Mk,{value:t.note})})})]})}function dV(e){const t=e.value;return s.jsx(s.Fragment,{children:OP(t)})}function fV(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(Dx,{value:t}):null}function hV(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 pV="_paper_1igaj_1",mV="_fill_1igaj_20",sw={paper:pV,fill:mV};function $x(e){const{width:t,fill:n,className:r,children:o,...i}=e,a=t?{maxWidth:t}:void 0;return s.jsx(Wn,{className:nt(sw.paper,n&&sw.fill,r),style:a,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var Lk={},su={};Object.defineProperty(su,"__esModule",{value:!0});su.Pointer=void 0;function gV(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function vV(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var yV=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(gV);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(vV).join("/")},e.prototype.evaluate=function(t){for(var n=null,r="",o=t,i=1,a=this.tokens.length;i<a;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}();su.Pointer=yV;var Ft={},Lx={};(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,a=new Array(i),l=0;l<i;l++)a[l]=r(o[l]);return a}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})(Lx);var Dn={};Object.defineProperty(Dn,"__esModule",{value:!0});Dn.diffAny=Dn.diffObjects=Dn.diffArrays=Dn.intersection=Dn.subtract=Dn.isDestructive=void 0;var Cc=Lx;function xV(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}Dn.isDestructive=xV;function ig(e,t){var n={};for(var r in e)Cc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)Cc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}Dn.subtract=ig;function Fk(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)Cc.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)}Dn.intersection=Fk;function bV(e){return e.op==="add"}function wV(e){return e.op==="remove"}function Tp(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function zk(e,t,n,r){r===void 0&&(r=xh);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),m=o[h];if(m===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)m=i(d-1,f-1);else{var g=[];if(d>0){var v=i(d-1,f),S={op:"remove",index:d-1};g.push(Tp(v,S))}if(f>0){var y=i(d,f-1),b={op:"add",index:d-1,value:t[f-1]};g.push(Tp(y,b))}if(d>0&&f>0){var x=i(d-1,f-1),w={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(Tp(x,w))}var j=g.sort(function(E,C){return E.cost-C.cost})[0];m=j}o[h]=m}return m}var a=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(a,l).operations,u=c.reduce(function(d,f){var h=d[0],m=d[1];if(bV(f)){var g=f.index+1+m,v=g<a+m?String(g):"-",S={op:f.op,path:n.add(v).toString(),value:f.value};return[h.concat(S),m+1]}else if(wV(f)){var S={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(S),m-1]}else{var y=n.add(String(f.index+m)),b=r(f.original,f.value,y);return[h.concat.apply(h,b),m]}},[[],0])[0];return u}Dn.diffArrays=zk;function Bk(e,t,n,r){r===void 0&&(r=xh);var o=[];return ig(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),ig(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),Fk([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}Dn.diffObjects=Bk;function xh(e,t,n,r){if(r===void 0&&(r=xh),e===t)return[];var o=(0,Cc.objectType)(e),i=(0,Cc.objectType)(t);return o=="array"&&i=="array"?zk(e,t,n,r):o=="object"&&i=="object"?Bk(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}Dn.diffAny=xh;var Fx=a0&&a0.__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(Ft,"__esModule",{value:!0});Ft.apply=Ft.InvalidOperationError=Ft.test=Ft.copy=Ft.move=Ft.replace=Ft.remove=Ft.add=Ft.TestError=Ft.MissingError=void 0;var Lo=su,zx=Lx,SV=Dn,fo=function(e){Fx(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);Ft.MissingError=fo;var Vk=function(e){Fx(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);Ft.TestError=Vk;function Bx(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 Uk(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function Hk(e,t){var n=Lo.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new fo(t.path):(Bx(n.parent,n.key,(0,zx.clone)(t.value)),null)}Ft.add=Hk;function Wk(e,t){var n=Lo.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new fo(t.path):(Uk(n.parent,n.key),null)}Ft.remove=Wk;function qk(e,t){var n=Lo.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new fo(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new fo(t.path)}else if(n.value===void 0)return new fo(t.path);return n.parent[n.key]=(0,zx.clone)(t.value),null}Ft.replace=qk;function Gk(e,t){var n=Lo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new fo(t.from);var r=Lo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new fo(t.path):(Uk(n.parent,n.key),Bx(r.parent,r.key,n.value),null)}Ft.move=Gk;function Qk(e,t){var n=Lo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new fo(t.from);var r=Lo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new fo(t.path):(Bx(r.parent,r.key,(0,zx.clone)(n.value)),null)}Ft.copy=Qk;function Kk(e,t){var n=Lo.Pointer.fromJSON(t.path).evaluate(e);return(0,SV.diffAny)(n.value,t.value,new Lo.Pointer).length?new Vk(n.value,t.value):null}Ft.test=Kk;var Yk=function(e){Fx(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);Ft.InvalidOperationError=Yk;function jV(e,t){switch(t.op){case"add":return Hk(e,t);case"remove":return Wk(e,t);case"replace":return qk(e,t);case"move":return Gk(e,t);case"copy":return Qk(e,t);case"test":return Kk(e,t)}return new Yk(t)}Ft.apply=jV;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=su;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Ft,r=Dn;function o(u,d){return d.map(function(f){return(0,n.apply)(u,f)})}e.applyPatch=o;function i(u){function d(f,h,m){var g=u(f,h,m);return Array.isArray(g)?g:(0,r.diffAny)(f,h,m,d)}return d}function a(u,d,f){var h=new t.Pointer;return(f?i(f):r.diffAny)(u,d,h)}e.createPatch=a;function l(u,d){var f=t.Pointer.fromJSON(d).evaluate(u);if(f!==void 0)return{op:"test",path:d,value:f.value}}function c(u,d){var f=new Array;return d.filter(r.isDestructive).forEach(function(h){var m=l(u,h.path);if(m&&f.push(m),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(Lk);const CV="_root_w6lfx_1",EV="_removed_w6lfx_16",TV="_added_w6lfx_21",Pp={root:CV,removed:EV,added:TV};function PV(e){const t=ie(),{original:n,revised:r}=e,[o,i]=p.useState(!1);p.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const a=p.useMemo(()=>{if(!o)return null;const l=[ho(n)],c=[ho(r)],u=[],d=kV(Lk.createPatch(n,r));for(const f of d){const h=f.path,m=RV(h),g=_V(n.resourceType,m),v=f.op==="add"?void 0:Sc(m,l),S=f.op==="remove"?void 0:Sc(m,c);u.push({key:`op-${f.op}-${f.path}`,name:`${Gt(f.op)} ${m}`,path:(g==null?void 0:g.path)??n.resourceType+"."+m,property:g,originalValue:aw(g,v),revisedValue:aw(g,S)})}return u},[o,n,r]);return a?s.jsxs(ce,{className:Pp.root,children:[s.jsx(ce.Thead,{children:s.jsxs(ce.Tr,{children:[s.jsx(ce.Th,{}),s.jsx(ce.Th,{children:"Before"}),s.jsx(ce.Th,{children:"After"})]})}),s.jsx(ce.Tbody,{children:a.map(l=>s.jsxs(ce.Tr,{children:[s.jsx(ce.Td,{children:l.name}),s.jsx(ce.Td,{className:Pp.removed,children:l.originalValue&&s.jsx(qr,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),s.jsx(ce.Td,{className:Pp.added,children:l.revisedValue&&s.jsx(qr,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function kV(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,a={op:r,path:o};i>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(a.op="replace",a.path=o.replace(/\/[^/]+$/,"")),t.some(l=>l.op===a.op&&l.path===a.path)||t.push(a)}return t}function RV(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 _V(e,t){var r;const n=sl(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 aw(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:DV(t,!!(e!=null&&e.isArray))}}function DV(e,t){const n=B7(e).flatMap(r=>r.value);return t?n:n[0]}function Vx(e){const{profileUrl:t}=e,n=ie(),r=n.getAccessPolicy(),o=vt(e.value),[i,a]=p.useState();p.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{const c=Ms(t);c?a(c.name):console.error(`Schema not found for ${t}`)}).catch(c=>{console.error("Error in requestProfileSchema",c)});else{const c=o.resourceType;n.requestSchema(c).then(()=>{a(c)}).catch(console.error)}},[n,t,o]);const l=p.useMemo(()=>o&&WP(o,gx.READ,r),[r,o]);return!i||!o?null:s.jsx(ef,{path:o.resourceType,value:{type:i,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:l})}const IV="_item_5q6yx_1",AV="_itemPadding_5q6yx_5",lw={item:IV,itemPadding:AV};function NV(e){return s.jsx(iu,{children:e.children})}function bs(e){var c,u;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,a=n??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs($x,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(Z,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Fi,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(ue,{size:"sm",children:s.jsx(ul,{c:"dark",fw:500,value:a,link:!0})}),s.jsxs(ue,{size:"xs",children:[s.jsx(He,{c:"dimmed",to:e.resource,children:Nn(l)}),s.jsx(ue,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(He,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(re,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(re.Target,{children:s.jsx(tn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${St(e.resource)}`,children:s.jsx(_8,{})})}),o]})]}),s.jsx(pk,{children:s.jsx("div",{className:nt(lw.item,{[lw.itemPadding]:r}),children:e.children})})]})}function Xk(e,t){e.sort((n,r)=>{const o=cw(n,t),i=cw(r,t);return o>i?1:o<i?-1:uw(n,t)-uw(r,t)})}function cw(e,t){if(!Jk(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function uw(e,t){var r;if(!Jk(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 Jk(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const MV="_pinnedComment_5uxzi_2",OV={pinnedComment:MV};function bh(e){const t=ie(),n=mh(),r=t.getProfile(),o=p.useRef(null),i=vt(e.value),[a,l]=p.useState(),[c,u]=p.useState([]),d=e.loadTimelineResources,f=p.useRef(c);f.current=c;const h=p.useCallback(D=>{Xk(D,i),D.reverse(),u(D)},[i]),m=p.useCallback(D=>{const N=[];for(const A of D){if(A.status!=="fulfilled")continue;const L=A.value;if(L.type==="history"&&l(L),L.entry)for(const I of L.entry)N.push(I.resource)}h(N)},[h]),g=p.useCallback(D=>h([...f.current,D]),[h]),v=p.useCallback(()=>{var A;let D,N;"resourceType"in e.value?(D=e.value.resourceType,N=e.value.id):[D,N]=(A=e.value.reference)==null?void 0:A.split("/"),d(t,D,N).then(m).catch(console.error)},[t,e.value,d,m]);p.useEffect(()=>v(),[v]);function S(D){!i||!e.createCommunication||t.createResource(e.createCommunication(i,r,D)).then(N=>g(N)).catch(console.error)}function y(D){!i||!e.createMedia||t.createResource(e.createMedia(i,r,D)).then(N=>g(N)).then(()=>Nl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(Zc,{size:16}),autoClose:2e3})).catch(N=>Nl({id:"upload-notification",color:"red",title:"Upload error",message:Ne(N),icon:s.jsx(Jb,{size:16}),autoClose:2e3}))}function b(D,N){return t.updateResource({...D,priority:N})}function x(D){b(D,"stat").then(v).catch(console.error)}function w(D){b(D,"routine").then(v).catch(console.error)}function j(D){n(`/${D.resourceType}/${D.id}`)}function E(D){n(`/${D.resourceType}/${D.id}/edit`)}function C(D){n(`/${D.resourceType}/${D.id}/delete`)}function T(D){var N;n(`/${D.resourceType}/${D.id}/_history/${(N=D.meta)==null?void 0:N.versionId}`)}function _(){ve({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function P(D){Nl({id:"upload-notification",loading:!0,title:"Uploading...",message:UV(D),autoClose:!1,withCloseButton:!1})}function M(D){Nl({id:"upload-notification",color:"red",title:"Upload error",message:Ne(D),icon:s.jsx(Jb,{size:16}),autoClose:2e3})}return i?s.jsxs(NV,{children:[e.createCommunication&&s.jsx($x,{children:s.jsx(Ge,{testid:"timeline-form",onSubmit:D=>{S(D.text);const N=o.current;N&&(N.value="",N.focus())},children:s.jsxs(Z,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Fi,{value:r}),s.jsx(fe,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(tn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(z8,{size:16})}),s.jsx(_x,{securityContext:wt(i),onUpload:y,onUploadStart:_,onUploadProgress:P,onUploadError:M,children:D=>s.jsx(tn,{...D,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Sx,{size:16})})})]})})}),c.map(D=>{var A;if(!D)return null;const N=`${D.resourceType}/${D.id}/${(A=D.meta)==null?void 0:A.versionId}`;if(D.resourceType===i.resourceType&&D.id===i.id)return s.jsx($V,{history:a,resource:D,onDetails:T},N);switch(D.resourceType){case"AuditEvent":return s.jsx(BV,{resource:D,onDetails:j},N);case"Communication":return s.jsx(FV,{resource:D,onPin:D.priority!=="stat"?x:void 0,onUnpin:D.priority==="stat"?w:void 0,onDetails:j,onEdit:E,onDelete:C},N);case"DiagnosticReport":return s.jsx(VV,{resource:D,onDetails:j,onEdit:E,onDelete:C},N);case"Media":return s.jsx(zV,{resource:D,onDetails:j,onEdit:E,onDelete:C},N);default:return s.jsx(bs,{resource:D,padding:!0,children:s.jsx(Vx,{value:D,ignoreMissingValues:!0})},N)}})]}):s.jsx(dn,{style:{width:"100%",height:"100%"},children:s.jsx(Qn,{})})}function Wa(e){return s.jsxs(re.Dropdown,{children:[s.jsx(re.Label,{children:"Resource"}),e.onPin&&s.jsx(re.Item,{leftSection:s.jsx(U8,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${St(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(re.Item,{leftSection:s.jsx(H8,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${St(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(re.Item,{leftSection:s.jsx(O8,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${St(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(re.Item,{leftSection:s.jsx(D8,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${St(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(re.Divider,{}),s.jsx(re.Label,{children:"Danger zone"}),s.jsx(re.Item,{color:"red",leftSection:s.jsx(hk,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${St(e.resource)}`,children:"Delete"})]})]})}function $V(e){const t=LV(e.history,e.resource);return t?s.jsx(bs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Wa,{...e}),children:s.jsx(PV,{original:t,revised:e.resource})}):s.jsxs(bs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Wa,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(Vx,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function LV(e,t){const n=e.entry,r=n.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function FV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:OV.pinnedComment;return s.jsx(bs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(Wa,{...e}),children:s.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function zV(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 s.jsx(bs,{resource:e.resource,padding:!!n,popupMenuItems:s.jsx(Wa,{...e}),children:s.jsx(nu,{value:e.resource.content})})}function BV(e){return s.jsx(bs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Wa,{...e}),children:s.jsx(Pr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function VV(e){return s.jsx(bs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(Wa,{...e}),children:s.jsx(Ox,{value:e.resource})})}function UV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${kp(e.loaded)} / ${kp(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${kp(e.loaded)}`}function kp(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 HV(e){return s.jsx(bh,{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 De(e){const{children:t,...n}=e;return s.jsx(iu,{children:s.jsx($x,{...n,children:t})})}function WV(e){return s.jsx(bh,{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:wt(t),subject:t.subject,sender:wt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",encounter:wt(t),subject:t.subject,operator:wt(n),issued:new Date().toISOString(),content:r})})}function qV(e){let t;try{t=il(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 s.jsx(qr,{value:t[0]||"",propertyType:e.propertyType})}function GV(e){return s.jsxs(En,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(W,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(dw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(dw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(ue,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function dw(e){return s.jsx(oe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const QV={string:[te.EQUALS,te.NOT,te.CONTAINS,te.EXACT],fulltext:[te.EQUALS,te.NOT,te.CONTAINS,te.EXACT],token:[te.EQUALS,te.NOT],reference:[te.EQUALS,te.NOT],numeric:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS],quantity:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS],date:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS,te.STARTS_AFTER,te.ENDS_BEFORE,te.APPROXIMATELY],datetime:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS,te.STARTS_AFTER,te.ENDS_BEFORE,te.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",present:"present",identifier:"identifier",iterate:"iterate"};function Ux(e,t){return{...e,filters:t,offset:0,name:void 0}}function Zk(e,t){return Ux(e,(e.filters??[]).filter(n=>n.code!==t))}function wh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),Ux(e,i)}function YV(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function XV(e,t){return Hx(e,t,-1)}function JV(e,t){return Hx(e,t,0)}function ZV(e,t){return Hx(e,t,1)}function Hx(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),qx(e,t,r,o)}function eU(e,t){return Wx(e,t,-1)}function tU(e,t){return Wx(e,t,0)}function nU(e,t){return Wx(e,t,1)}function Wx(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),qx(e,t,r,o)}function rU(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),qx(e,t,n,new Date)}function qx(e,t,n,r){return e=Zk(e,t),e=fw(e,t,te.GREATER_THAN_OR_EQUALS,n),e=fw(e,t,te.LESS_THAN_OR_EQUALS,r),e}function fw(e,t,n,r){return wh(e,t,n,r.toISOString())}function hw(e,t,n=!0){return wh(e,t,te.MISSING,n.toString())}function oU(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function iU(e,t){const n=e.count??fh,r=(t-1)*n;return oU(e,r)}function sU(e,t,n){return t===aU(e)&&n!==void 0&&n===lU(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function aU(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function lU(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function cU(e){return QV[e.type]}function Gx(e){return KV[e]??""}function Di(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(Gt).join(" "))}function uU(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"?Nn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?dU(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?fU(e,t.searchParams[0]):null}function dU(e,t){var i,a,l;const n=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[r,o]=ru({type:e.resourceType,value:e},n);return r?s.jsx(qr,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function fU(e,t){const n=Sc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,o)=>s.jsx(qr,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function hU(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(ar(e.search))}),[o,i]=p.useState(!1);p.useEffect(()=>{r({search:e.search})},[e.search]);const a=p.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=bP(c),d=ax(c);return xc(pU(u,d)).map(f=>({value:f,label:Di(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return s.jsx(En,{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:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(Ae,{children:[s.jsx(Zf,{style:{width:550},placeholder:"Select fields to display",data:a,value:n.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function pU(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(Di(i));if(t)for(const i of Object.keys(t)){const a=Di(i);!r.has(i)&&!o.has(a)&&(n.push(i),r.add(i),o.add(a))}return n}function eR(e){var o;const{resourceType:t,filter:n}=e,r=(o=mo.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===te.EQUALS||n.operator===te.NOT_EQUALS))return s.jsx(ul,{value:{reference:n.value}});const i=sl(t,r);if(n.code==="_lastUpdated"||i.type===jo.DATETIME)return s.jsx(s.Fragment,{children:Nn(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function tR(e){const t=sl(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case jo.REFERENCE:return s.jsx(yh,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case jo.BOOLEAN:return s.jsx(Yn,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case jo.DATE:return s.jsx(fe,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case jo.DATETIME:return s.jsx(ys,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case jo.NUMBER:return s.jsx(fe,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case jo.QUANTITY:return s.jsx(xs,{name:n,path:"",defaultValue:mU(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(fe,{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 mU(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function gU(e){const[t,n]=p.useState(JSON.parse(ar(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(ar(e.search)))},[e.search]);function a(d){n(wh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=ax(l)??{},u=t.filters||[];return s.jsxs(En,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,f)=>f===r?s.jsx(pw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(Ux(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(vU,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(YV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(pw,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function vU(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:Di(t.code)}),s.jsx("td",{children:Gx(t.operator)}),s.jsx("td",{children:s.jsx(eR,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(oe,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(oe,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function pw(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useRef(t);r.current=t;function o(u){n({...r.current,code:u})}function i(u){n({...r.current,operator:u})}function a(u){n({...r.current,value:u})}const l=e.searchParams[t.code],c=l&&cU(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.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:Di(u)}))]})}),s.jsx("td",{children:c&&s.jsx(Tt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:Gx(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(tR,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(oe,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&s.jsx(oe,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function yU(e){const[t,n]=p.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(En,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(Ge,{onSubmit:r,children:s.jsxs(rr,{children:[s.jsx(rr.Col,{span:10,children:s.jsx(tR,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(rr.Col,{span:2,children:s.jsx(oe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function xU(e){if(!e.searchParams)return null;function t(i,a){o(sU(e.search,i.code,a))}function n(i){o(Zk(e.search,i.code))}function r(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(bU,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):s.jsx(re.Dropdown,{children:e.searchParams.map(i=>s.jsx(re.Item,{children:Di(i.code)},i.code))})}function bU(e){switch(e.searchParam.type){case"date":return s.jsx(wU,{...e});case"number":case"quantity":return s.jsx(SU,{...e});case"reference":return s.jsx(jU,{...e});case"string":return s.jsx(CU,{...e});case"token":case"uri":return s.jsx(EU,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function wU(e){const{searchParam:t}=e,n=t.code;return s.jsxs(re.Dropdown,{children:[s.jsx(re.Item,{leftSection:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(re.Item,{leftSection:s.jsx(Cx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(tu,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(re.Item,{leftSection:s.jsx(eu,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(fk,{size:14}),onClick:()=>e.onPrompt(t,te.ENDS_BEFORE),children:"Before..."}),s.jsx(re.Item,{leftSection:s.jsx(dk,{size:14}),onClick:()=>e.onPrompt(t,te.STARTS_AFTER),children:"After..."}),s.jsx(re.Item,{leftSection:s.jsx(w8,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Between..."}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(ZV(e.search,n)),children:"Tomorrow"}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(JV(e.search,n)),children:"Today"}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(XV(e.search,n)),children:"Yesterday"}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(nU(e.search,n)),children:"Next Month"}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(tU(e.search,n)),children:"This Month"}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(eU(e.search,n)),children:"Last Month"}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(Ui,{size:14}),onClick:()=>e.onChange(rU(e.search,n)),children:"Year to date"}),s.jsx(au,{...e})]})}function SU(e){const{searchParam:t}=e;return s.jsxs(re.Dropdown,{children:[s.jsx(re.Item,{leftSection:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(re.Item,{leftSection:s.jsx(Cx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(tu,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(re.Item,{leftSection:s.jsx(eu,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS),children:"Does not equal..."}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(dk,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN),children:"Greater than..."}),s.jsx(re.Item,{leftSection:s.jsx(rg,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(re.Item,{leftSection:s.jsx(fk,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN),children:"Less than..."}),s.jsx(re.Item,{leftSection:s.jsx(rg,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(au,{...e})]})}function jU(e){const{searchParam:t}=e;return s.jsxs(re.Dropdown,{children:[s.jsx(re.Item,{leftSection:s.jsx(tu,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(re.Item,{leftSection:s.jsx(eu,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(au,{...e})]})}function CU(e){const{searchParam:t}=e;return s.jsxs(re.Dropdown,{children:[s.jsx(re.Item,{leftSection:s.jsx(jx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(re.Item,{leftSection:s.jsx(Cx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(tu,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(re.Item,{leftSection:s.jsx(eu,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(C8,{size:14}),onClick:()=>e.onPrompt(t,te.CONTAINS),children:"Contains..."}),s.jsx(re.Item,{leftSection:s.jsx(j8,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Does not contain..."}),s.jsx(au,{...e})]})}function EU(e){const{searchParam:t}=e;return s.jsxs(re.Dropdown,{children:[s.jsx(re.Item,{leftSection:s.jsx(tu,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS),children:"Equals..."}),s.jsx(re.Item,{leftSection:s.jsx(eu,{size:14}),onClick:()=>e.onPrompt(t,te.NOT),children:"Does not equal..."}),s.jsx(au,{...e})]})}function au(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(x8,{size:14}),onClick:()=>e.onChange(hw(e.search,n)),children:"Missing"}),s.jsx(re.Item,{leftSection:s.jsx(y8,{size:14}),onClick:()=>e.onChange(hw(e.search,n,!1)),children:"Not missing"}),s.jsx(re.Divider,{}),s.jsx(re.Item,{leftSection:s.jsx(Jd,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const TU="_root_vlout_1",PU="_table_vlout_8",kU="_tr_vlout_12",RU="_th_vlout_18",_U="_control_vlout_22",DU="_icon_vlout_31",El={root:TU,table:PU,tr:kU,th:RU,control:_U,icon:DU};function IU(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(AU(t,r));return n}function AU(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=$s(e,t),r=i6(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=ax(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:n,searchParams:a}}if(r){const i=sl(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class NU extends Event{constructor(t){super("change"),this.definition=t}}class MU extends Event{constructor(t){super("load"),this.response=t}}class tf extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function OU(e){var A,L,I;const t=ie(),[n,r]=p.useState(),[o,i]=p.useState(),{search:a,onLoad:l}=e,[c,u]=p.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=p.useRef(c);d.current=c;const f=a.total??"accurate",h=p.useCallback(k=>{i(void 0),t.search(a.resourceType,va({...a,total:f,fields:void 0}),k).then(R=>{u({...d.current,searchResponse:R}),l&&l(new MU(R))}).catch(R=>{u({...d.current,searchResponse:void 0}),i(R)})},[t,a,f,l]),m=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);p.useEffect(()=>{h()},[h]);function g(k,R){k.stopPropagation();const B=k.target.checked,H={...d.current.selected};B?H[R]=!0:delete H[R],u({...d.current,selected:H})}function v(k){k.stopPropagation();const $=k.target.checked,B={},H=d.current.searchResponse;$&&(H!=null&&H.entry)&&H.entry.forEach(X=>{var ye;(ye=X.resource)!=null&&ye.id&&(B[X.resource.id]=!0)}),u({...d.current,selected:B})}function S(){var R,$;const k=d.current;if(!((R=k.searchResponse)!=null&&R.entry)||k.searchResponse.entry.length===0)return!1;for(const B of k.searchResponse.entry)if(($=B.resource)!=null&&$.id&&!k.selected[B.resource.id])return!1;return!0}function y(k){e.onChange&&e.onChange(new NU(k))}function b(k,R){if(mk(k.target)||k.button===2)return;ct(k);const $=k.button===1||k.ctrlKey||k.metaKey;!$&&e.onClick&&e.onClick(new tf(R,k)),$&&e.onAuxClick&&e.onAuxClick(new tf(R,k))}function x(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(p.useEffect(()=>{r(e.search.resourceType),t.requestSchema(e.search.resourceType).catch(console.error).finally(()=>r(void 0))},[t,e.search.resourceType]),!xP(e.search.resourceType)||n===e.search.resourceType)return s.jsx(dn,{style:{width:"100%",height:"100%"},children:s.jsx(Qn,{})});const w=e.checkboxesEnabled,j=IU(a),E=a.resourceType,C=c.searchResponse,T=C==null?void 0:C.entry,_=T==null?void 0:T.map(k=>k.resource),P="subtle",M="gray",D=16,N=window.innerWidth<768;return s.jsxs("div",{className:El.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(Z,{justify:"space-between",mb:"xl",children:[s.jsxs(Z,{gap:2,children:[s.jsx(oe,{size:"compact-md",variant:P,color:M,leftSection:s.jsx(P8,{size:D}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(oe,{size:"compact-md",variant:P,color:M,leftSection:s.jsx(A8,{size:D}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(oe,{size:"compact-md",variant:P,color:M,leftSection:s.jsx(I8,{size:D}),onClick:e.onNew,children:"New..."}),!N&&x()&&s.jsx(oe,{size:"compact-md",variant:P,color:M,leftSection:s.jsx(tz,{size:D}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!N&&e.onDelete&&s.jsx(oe,{size:"compact-md",variant:P,color:M,leftSection:s.jsx(hk,{size:D}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!N&&e.onBulk&&s.jsx(oe,{size:"compact-md",variant:P,color:M,leftSection:s.jsx(b8,{size:D}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),s.jsxs(Z,{gap:2,children:[C&&s.jsxs(ue,{size:"xs",c:"dimmed","data-testid":"count-display",children:[nR(a,C).toLocaleString(),"-",zU(a,C).toLocaleString(),C.total!==void 0&&` of ${a.total==="estimate"?"~":""}${(A=C.total)==null?void 0:A.toLocaleString()}`]}),s.jsx(tn,{variant:P,color:M,title:"Refresh",onClick:m,children:s.jsx(Q8,{size:D})})]})]}),s.jsxs(ce,{className:El.table,children:[s.jsxs(ce.Thead,{children:[s.jsxs(ce.Tr,{children:[w&&s.jsx(ce.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:k=>v(k)})}),j.map(k=>s.jsx(ce.Th,{children:s.jsxs(re,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(re.Target,{children:s.jsx(gn,{className:El.control,p:2,children:s.jsxs(Z,{justify:"space-between",wrap:"nowrap",children:[s.jsx(ue,{fw:500,children:Di(k.name)}),s.jsx(dn,{className:El.icon,children:s.jsx(m8,{size:14,stroke:1.5})})]})})}),s.jsx(xU,{search:e.search,searchParams:k.searchParams,onPrompt:(R,$)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:R,filterDialogFilter:$})},onChange:R=>{y(R)}})]})},k.name))]}),!e.hideFilters&&s.jsxs(ce.Tr,{children:[w&&s.jsx(ce.Th,{}),j.map(k=>s.jsx(ce.Th,{children:k.searchParams&&s.jsx($U,{resourceType:E,searchParams:k.searchParams,filters:e.search.filters})},k.name))]})]}),s.jsx(ce.Tbody,{children:_==null?void 0:_.map(k=>k&&s.jsxs(ce.Tr,{className:El.tr,"data-testid":"search-control-row",onClick:R=>b(R,k),onAuxClick:R=>b(R,k),children:[w&&s.jsx(ce.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${k.id}`,checked:!!c.selected[k.id],onChange:R=>g(R,k.id)})}),j.map(R=>s.jsx(ce.Td,{children:uU(k,R)},R.name))]},k.id))})]}),(_==null?void 0:_.length)===0&&s.jsx(iu,{children:s.jsx(dn,{style:{height:150},children:s.jsx(ue,{size:"xl",c:"dimmed",children:"No results"})})}),C&&s.jsx(dn,{m:"md",p:"md",children:s.jsx(Kr,{value:LU(a),total:FU(a,C),onChange:k=>y(iU(a,k)),getControlProps:k=>{switch(k){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),s.jsx(hU,{search:e.search,visible:d.current.fieldEditorVisible,onOk:k=>{y(k),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),s.jsx(gU,{search:e.search,visible:d.current.filterEditorVisible,onOk:k=>{y(k),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),s.jsx(GV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),s.jsx(yU,{visible:d.current.filterDialogVisible,title:(L=c.filterDialogSearchParam)!=null&&L.code?Di(c.filterDialogSearchParam.code):"",resourceType:E,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:k=>{y(wh(e.search,k.code,k.operator,k.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(I=c.filterDialogSearchParam)==null?void 0:I.code)]})}const lu=p.memo(OU);function $U(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[Gx(n.operator)," ",s.jsx(eR,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function LU(e){return Math.floor((e.offset??0)/(e.count??fh))+1}function FU(e,t){const n=e.count??fh,r=rR(e,t);return Math.ceil(r/n)}function nR(e,t){return Math.min(rR(e,t),(e.offset??0)+1)}function zU(e,t){var n;return Math.max(nR(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function rR(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 BU(e){const t=ie(),[n,r]=p.useState(!1),[o,i]=p.useState(),{query:a,fields:l}=e,[c,u]=p.useState(),[d,f]=p.useState({}),h=p.useRef();h.current=c;const m=p.useRef({});m.current=d,p.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(x=>i(mt(x)))},[t,a]);function g(x,w){x.stopPropagation();const E=x.target.checked,C={...m.current};E?C[w]=!0:delete C[w],f(C)}function v(x){var T;x.stopPropagation();const j=x.target.checked,E={},C=(T=h.current)==null?void 0:T.data.ResourceList;j&&C&&C.forEach(_=>{_.id&&(E[_.id]=!0)}),f(E)}function S(){var w;const x=(w=h.current)==null?void 0:w.data.ResourceList;if(!x||x.length===0)return!1;for(const j of x)if(j.id&&!m.current[j.id])return!1;return!0}function y(x,w){mk(x.target)||(ct(x),x.button!==1&&e.onClick&&e.onClick(new tf(w,x)),x.button===1&&e.onAuxClick&&e.onAuxClick(new tf(w,x)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(Qn,{});const b=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:x=>ct(x),"data-testid":"search-control",children:[s.jsxs(ce,{children:[s.jsx(ce.Thead,{children:s.jsxs(ce.Tr,{children:[b&&s.jsx(ce.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:x=>v(x)})}),l.map(x=>s.jsx(ce.Th,{children:x.name},x.name))]})}),s.jsx(ce.Tbody,{children:c==null?void 0:c.data.ResourceList.map(x=>x&&s.jsxs(ce.Tr,{"data-testid":"search-control-row",onClick:w=>y(w,x),onAuxClick:w=>y(w,x),children:[b&&s.jsx(ce.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${x.id}`,checked:!!d[x.id],onChange:w=>g(w,x.id)})}),l.map(w=>s.jsx(ce.Td,{children:s.jsx(qV,{propertyType:w.propertyType,path:w.fhirPath,resource:x})},w.name))]},x.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(oe,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const VU=p.memo(BU);function Yr(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.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"}),s.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"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function UU(e){const{group:t}=e;return s.jsx(Wn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(Z,{children:[t.measureScore&&s.jsx(qU,{group:t}),!t.measureScore&&s.jsx(WU,{group:t})]})})}function HU(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(ue,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(ue,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function WU(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>_i(c.code)==="numerator"),o=n==null?void 0:n.find(c=>_i(c.code)==="denominator"),i=r==null?void 0:r.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(W,{children:[s.jsx(de,{order:3,children:"Not Applicable"}),s.jsx(ue,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(W,{children:[s.jsx(de,{order:3,children:"Insufficient Data"}),s.jsx(ue,{children:`Numerator: ${i}`}),s.jsx(ue,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(sh,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:oR(l)}],label:s.jsx(hs,{justify:"center",children:s.jsxs(ue,{fw:700,fz:18,children:[i," / ",a]})})})}function qU(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 s.jsx(s.Fragment,{children:n==="%"?s.jsx(sh,{size:120,thickness:12,roundCaps:!0,sections:[{value:GU(t),color:oR(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(hs,{justify:"center",children:s.jsx(ue,{fw:700,fz:18,children:s.jsx(jc,{value:t.measureScore})})})}):s.jsx(hs,{h:120,align:"center",children:s.jsx(de,{order:3,children:s.jsx(jc,{value:t.measureScore})})})})}function GU(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 oR(e){return e<=33?"red":e<=67?"yellow":"green"}function QU(e){var r;const t=vt(e.measureReport),[n]=l8("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(W,{children:[n&&s.jsx(HU,{measure:n}),s.jsx(Uy,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>s.jsx(UU,{group:o},o.id??i))})]}):null}function Xr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx($i,{icon:s.jsx(al,{size:16}),color:"red",children:t.map(r=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:gP(r)},(o=r.details)==null?void 0:o.text)})})}function KU(e){const t=p.useCallback((n,r,o)=>{const i=`${r}/${o}`,a=100;return Promise.allSettled([n.readHistory("Patient",o),n.search("Communication",{subject:i,_count:a}),n.search("Device",{patient:i,_count:a}),n.search("DeviceRequest",{patient:i,_count:a}),n.search("DiagnosticReport",{subject:i,_count:a}),n.search("Media",{subject:i,_count:a}),n.search("ServiceRequest",{subject:i,_count:a}),n.search("Task",{subject:i,_count:a})])},[]);return s.jsx(bh,{value:e.patient,loadTimelineResources:t,createCommunication:(n,r,o)=>({resourceType:"Communication",status:"completed",subject:wt(n),sender:wt(r),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(n,r,o)=>({resourceType:"Media",status:"completed",subject:wt(n),operator:wt(r),issued:new Date().toISOString(),content:o})})}const YU="_section_14dzq_2",XU="_hovering_14dzq_11",JU="_editing_14dzq_15",ZU="_bottomActions_14dzq_20",ya={section:YU,hovering:XU,editing:JU,bottomActions:ZU};function eH(e){const t=ie(),n=vt(e.value),[r,o]=p.useState(!1),[i,a]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){c(void 0)}function h(){a(void 0)}const m=p.useRef();if(m.current=u,p.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(d(sH(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({...m.current,[v]:S})}return s.jsx("div",{children:s.jsxs(Ge,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(fe,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),s.jsx(iR,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),s.jsx(oe,{type:"submit",children:"Save"})]})})}function iR(e){const t=p.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(a=>a.id===i.id?i:a))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(a=>a!==i))}return s.jsxs("div",{className:ya.section,children:[e.actions.map(i=>s.jsx("div",{children:s.jsx(tH,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)})},i.id)),s.jsx("div",{className:ya.bottomActions,children:s.jsx(Je,{href:"#",onClick:i=>{ct(i),r({id:aR()})},children:"Add action"})})]})}function tH(e){const{action:t}=e,n=iH(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function i(c){c.stopPropagation(),e.setSelectedKey(e.action.id)}function a(c){ct(c),e.setHoverKey(e.action.id)}const l=nt(ya.section,{[ya.editing]:r,[ya.hovering]:o&&!r});return s.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:a,onFocus:a,children:[r?s.jsx(rH,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(nH,{action:t,actionType:n}),s.jsx("div",{className:ya.bottomActions,children:s.jsx(Je,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const sg={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function nH(e){const{action:t,actionType:n}=e,[r,o]=sR(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(Zd,{value:{reference:t.definitionCanonical}})}),r&&s.jsx("div",{children:s.jsx(qr,{property:sg,propertyType:o,value:r})})]})}function rH(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(Ae,{gap:"xl",children:[s.jsx(fe,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(fe,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.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&&s.jsx(iR,{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 s.jsx(qu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(qu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(qu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(qu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(ht,{title:"Timing",description:"When the action should take place.",children:s.jsx(oH,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function qu(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(ll,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:St(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function oH(e){const t=e.action,n="timing",[r,o]=sR(t);return s.jsx(cl,{property:sg,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(kk(t,n,a??n,sg,i))},outcome:void 0})}function iH(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 sR(e){return ru({type:"PlanDefinitionAction",value:e},"timing")}let Rp=1;function aR(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Rp=Math.max(Rp,t+1))}return e}return"id-"+Rp++}function sH(e){return{...e,action:lR(e.action)}}function lR(e){if(e)return e.map(t=>({...t,id:aR(t.id),action:lR(t.action)}))}var xt=(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))(xt||{});function aH(e){return e.type==="choice"||e.type==="open-choice"}function lH(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=cR(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:a}=dH(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!a)return!1}return n!=="any"}function cH(e,t,n){return e.map(r=>{var a;const o=(a=n.answerOption)==null?void 0:a.find(l=>Os(l.valueCoding)===r||l[t]===r),i=hn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function cR(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=cR(n.item,t);if(r)return r}}}function uH(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}]=Sc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function dH(e,t,n){const r=t||[],o=hn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of r){const c=hn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(uH(c,o,u)?i=!0:a=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:a}}function uR(e){var n,r;const t=Yc(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 _p(e,t){var o;const n=po(e);let r=Yc(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 fH(e,t,n){const r=Yc(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={},a=o.split("&");for(const l of a){const[c,u]=Ym(l,"=",2);i[c]=u}return i}function hH(e){return{resourceType:"QuestionnaireResponse",questionnaire:St(e),item:dR(e.item),status:"in-progress"}}function dR(e){return(e==null?void 0:e.map(fR))??[]}function fR(e){var t;return{id:mH(),linkId:e.linkId,text:e.text,item:dR(e.item),answer:((t=e.initial)==null?void 0:t.map(gH))??[]}}let pH=1;function mH(){return"id-"+pH++}function gH(e){return{...e}}function vH(e){return e.value.display||e.value.reference||ar(e.value)}function yH(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const a=Yc(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=a==null?void 0:a.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const hR=p.createContext({});function ag(e){const t=p.useContext(hR),n=e.item,r=e.response;function o(u){var f,h,m,g;let d;Array.isArray(u)?d=u:e.index>=(((h=(f=e.response)==null?void 0:f.answer)==null?void 0:h.length)??0)?d=(((m=e.response)==null?void 0:m.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((S,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 a=n.linkId;if(!a)return null;const l=n.initial&&n.initial.length>0?n.initial[0]:void 0,c=Qx(r,e.index)??hn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case xt.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case xt.boolean:return s.jsx(Tk,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Yn,{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 xt.decimal:return s.jsx(fe,{type:"number",step:"any",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case xt.integer:return s.jsx(fe,{type:"number",step:1,id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case xt.date:return s.jsx(fe,{type:"date",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case xt.dateTime:return s.jsx(ys,{name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case xt.time:return s.jsx(fe,{type:"time",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case xt.string:case xt.url:return s.jsx(fe,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case xt.text:return s.jsx(Ds,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case xt.attachment:return s.jsx(Z,{py:4,children:s.jsx(yk,{path:"",name:a,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case xt.reference:return s.jsx(yh,{name:a,required:n.required,targetTypes:uR(n),searchCriteria:fH(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case xt.quantity:return s.jsx(xs,{path:"",name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case xt.choice:case xt.openChoice:return CH(n)&&!n.answerValueSet?s.jsx(xH,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):s.jsx(bH,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function xH(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return s.jsx(pR,{});const i=hn({type:"QuestionnaireItemInitial",value:r},"value"),a=[""];for(const u of n.answerOption){const d=hn({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(mw(d))}const l=Qx(o)??i;if(n.repeats){const{propertyName:u,data:d}=EH(e.item),f=SH(o);return s.jsx(Zf,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[mw(i)],onChange:h=>{const m=cH(h,u,n);e.onChangeAnswer(m)}})}return s.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=hn({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+Gt(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:Os(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function bH(e){var a;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((a=n.answerOption)!=null&&a.length)&&!n.answerValueSet?s.jsx(pR,{}):n.answerValueSet?s.jsx(Rk,{path:"",name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===xt.openChoice}):s.jsx(wH,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function wH(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,a=$s("QuestionnaireItemAnswerOption","value[x]"),l=hn({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const m=n.answerOption[h],g=`${t}-option-${h}`,v=hn({type:"QuestionnaireItemAnswerOption",value:m},"value");v!=null&&v.value&&(l&&ar(v)===ar(l)&&(u=g),c.push([g,v]))}const d=Qx(i),f=jH(c,d);return s.jsx(gs.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],v="value"+Gt(g.type);o({[v]:g.value})}},children:c.map(([h,m])=>s.jsx(gs,{id:h,value:h,py:4,label:s.jsx(qr,{property:a,propertyType:m.type,value:m.value})},h))})}function pR(){return s.jsx(fe,{disabled:!0,placeholder:"No Answers Defined"})}function mR(e){return hn({type:"QuestionnaireItemAnswer",value:e},"value")}function Qx(e,t=0){const n=e.answer;return mR((n==null?void 0:n[t])??{})}function SH(e){const t=e.answer;return t?t.map(r=>mR(r)).map(r=>Os(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function jH(e,t){var n;return(n=e.find(r=>Xc(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function mw(e){if(e)return e.type==="CodeableConcept"?_i(e.value):e.type==="Coding"?Os(e.value):e.type==="Reference"?vH(e):e.value.toString()}function CH(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 EH(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=hn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+Gt(n.type),o=(e.answerOption??[]).map(a=>({value:gw(a,r),label:gw(a,r)}));return{propertyName:r,data:o}}function gw(e,t){var n;return Os(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const TH="_section_cpwxo_1",PH="_hovering_cpwxo_10",kH="_editing_cpwxo_14",RH="_questionBody_cpwxo_19",_H="_topActions_cpwxo_23",DH="_bottomActions_cpwxo_32",IH="_movementActions_cpwxo_43",AH="_movementIcons_cpwxo_55",NH="_columnAlignment_cpwxo_59",MH="_linkIdInput_cpwxo_64",OH="_typeSelect_cpwxo_69",hr={section:TH,hovering:PH,editing:kH,questionBody:RH,topActions:_H,bottomActions:DH,movementActions:IH,movementIcons:AH,columnAlignment:NH,linkIdInput:MH,typeSelect:OH};function $H(e){const t=ie(),n=vt(e.questionnaire),[r,o]=p.useState(!1),[i,a]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){d(void 0)}function h(){c(void 0)}p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(a(BH(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const m=(g,v)=>{a(g),e.autoSave&&!v&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:s.jsx("div",{children:s.jsxs(Ge,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(gR,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),s.jsx(oe,{type:"submit",children:"Save"})]})})}function gR(e){var x;const t=e.item,n=e.item,r=Ko(e.item),o=r||n.type===xt.group,i=n.linkId??"[untitled]",a=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=p.useRef();c.current=e.item;function u(w){ct(w),e.setSelectedKey(e.item.id)}function d(w){ct(w),e.setHoverKey(e.item.id)}function f(w){var E;const j=c.current;e.onChange({...j,item:(E=j.item)==null?void 0:E.map(C=>C.id===w.id?w:C)})}function h(w,j){e.onChange({...e.item,item:[...e.item.item??[],w]},j)}function m(w){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.filter(E=>E!==w)})}function g(w,j){e.onChange({...c.current,[w]:j})}function v(w){e.onChange({...e.item,...w})}function S(w){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.map(E=>E===w?{...E,repeats:!E.repeats}:E)})}function y(w,j){const E=HH(e.item.item,w,j);e.onChange({...e.item,item:E})}const b=nt(hr.section,{[hr.editing]:a,[hr.hovering]:l&&!a});return s.jsxs("div",{"data-testid":n.linkId,className:b,onClick:u,onMouseOver:d,onFocus:d,children:[s.jsx("div",{className:hr.questionBody,children:a?s.jsxs(s.Fragment,{children:[r&&s.jsx(fe,{size:"xl",defaultValue:t.title,onBlur:w=>g("title",w.currentTarget.value)}),!r&&s.jsx(Ds,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:w=>g("text",w.currentTarget.value)}),n.type==="reference"&&s.jsx(zH,{item:n,onChange:v}),aH(n)&&s.jsx(LH,{item:n,onChange:w=>v(w)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(de,{children:t.title}),n.text&&s.jsx("div",{children:n.text}),!o&&s.jsx(ag,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(x=n.item)==null?void 0:x.map((w,j)=>s.jsx("div",{children:s.jsx(gR,{item:w,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:j===0,isLast:j===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>m(w),onRepeatable:S,onMoveUp:()=>y(j,-1),onMoveDown:()=>y(j,1)})},w.id)),!o&&s.jsx("div",{className:hr.topActions,children:a?s.jsxs(s.Fragment,{children:[s.jsx(fe,{size:"xs",className:hr.linkIdInput,defaultValue:n.linkId,onBlur:w=>g("linkId",w.currentTarget.value)}),!o&&s.jsx(Tt,{size:"xs",className:hr.typeSelect,defaultValue:n.type,onChange:w=>g("type",w.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"}]})]}):s.jsx("div",{children:i})}),!r&&s.jsx(W,{className:hr.movementActions,children:s.jsxs(W,{className:hr.columnAlignment,children:[!e.isFirst&&s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(v8,{"data-testid":"up-button",size:15,className:hr.movementIcons})}),!e.isLast&&s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(g8,{"data-testid":"down-button",size:15,className:hr.movementIcons})})]})}),s.jsxs("div",{className:hr.bottomActions,children:[o&&s.jsxs(s.Fragment,{children:[s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),h({id:ws(),linkId:ug("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),h({id:ws(),linkId:ug("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),h(UH(),!0)},children:"Add Page"}),a&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Je,{href:"#",onClick:w=>{w.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function LH(e){const t=$s("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(fe,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(FH,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(W,{display:"flex",children:[s.jsx(Je,{href:"#",onClick:r=>{ct(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:ws()}]})},children:"Add choice"}),s.jsx(ah,{w:"lg"}),s.jsx(Je,{href:"#",onClick:r=>{ct(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function FH(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=ru({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(cl,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Je,{href:"#",onClick:o=>{ct(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function zH(e){const t=uR(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(Z,{children:[s.jsx(kx,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(_p(e.item,t.map(i=>i===n?o:i)))}}),s.jsx(Je,{href:"#",onClick:o=>{ct(o),e.onChange(_p(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Je,{href:"#",onClick:n=>{ct(n),e.onChange(_p(e.item,[...t,""]))},children:"Add Resource Type"})]})}let lg=1,cg=1;function ug(e){return e+lg++}function ws(){return"id-"+cg++}function BH(e){return{...e,id:e.id||ws(),item:vR(e.item)}}function vR(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(cg=Math.max(cg,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(lg=Math.max(lg,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ws(),item:vR(t.item),answerOption:VH(t.answerOption)}))}function VH(e){if(e)return e.map(t=>({...t,id:t.id||ws()}))}function UH(){return{id:ws(),linkId:ug("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 HH(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 yR(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(WH(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===xt.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==xt.choice&&t.type!==xt.openChoice;return t.type===xt.boolean?s.jsx(ag,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):s.jsxs(ht,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(ag,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Je,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function WH(e,t){if(e.type===xt.choice||e.type===xt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function xR(e){const[t,n]=p.useState(e.response);if(t.length===0)return null;function r(i,a){const l=t.map((c,u)=>u===a?i[0]:c);n(l),e.onChange(l)}function o(){const i=fR(e.item);n([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(bR,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,a)},i.id)),e.item.repeats&&s.jsx(Je,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function bR(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(f=>a.find(m=>m.id===f.id)??f),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};r([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(de,{order:3,mb:"md",children:e.item.text}),s.jsx(Ae,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===xt.group?a.repeats?s.jsx(xR,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:n,onChange:o},a.linkId):s.jsx(bR,{item:a,checkForQuestionEnabled:n,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{linkId:a.linkId},onChange:o},a.linkId):s.jsx(yR,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:n},a.linkId)})})]},e.item.linkId):null}function qH(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,f=t.map(h=>{var v;const m=((v=n==null?void 0:n.item)==null?void 0:v.filter(S=>S.linkId===h.linkId))??[],g=h.type===xt.group?s.jsx(xR,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(yR,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(Va.Step,{label:h.text,children:g},h.linkId):g});return s.jsxs(s.Fragment,{children:[c&&s.jsx(Va,{active:r??0,allowNextStepsSelect:!1,p:6,children:f}),!c&&s.jsx(Ae,{children:f}),s.jsx(GH,{activePage:r??0,numberOfPages:l,nextStep:i,prevStep:a,submitButtonText:u})]})}function GH(e){const t=e.activePage>0,n=e.activePage<e.numberOfPages-1,r=e.activePage===e.numberOfPages-1;return s.jsxs(Z,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(oe,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(oe,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(oe,{type:"submit",children:e.submitButtonText??"Submit"})]})}function wR(e){const t=ie(),n=t.getProfile(),[r,o]=p.useState(!1),i=vt(e.questionnaire),[a,l]=p.useState(),[c,u]=p.useState(0);p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>{l(i?hH(i):void 0)},[i]);function d(v){const S=(a==null?void 0:a.item)??[],b={resourceType:"QuestionnaireResponse",status:"in-progress",item:SR(S,Array.isArray(v)?v:[v])};l(b)}function f(v){return lH(v,(a==null?void 0:a.item)??[])}if(!r||!i||!a)return null;const h=yH(i),m=()=>u(v=>v+1),g=()=>u(v=>v-1);return s.jsx(hR.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(Ge,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:St(i),subject:e.subject,source:wt(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(de,{children:i.title}),s.jsx(qH,{items:i.item??[],response:a,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:f,nextStep:m,prevStep:g})]})})}function QH(e,t){const n=SR(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 SR(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(n.push(QH(o,a)),r.add(a.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const KH="_section_4m5it_1",YH={section:KH},XH=["gender","age","gestationalAge","context","appliesTo","category"],JH={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function ZH(e){e=Object.assign(JH,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[a,l]=p.useState(1);return p.useEffect(()=>{const g=nW(t,l);r(rW(g.qualifiedInterval||[],i))},[t]),s.jsxs(Ge,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(Ae,{children:n.map(g=>{var v;return s.jsx(eW,{unit:iW((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:f,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),s.jsx(tn,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{ct(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:s.jsx(Xd,{})}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!sW(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(x=>x.id===g),b=y==null?void 0:y.intervals.findIndex(x=>x.id===v.id);return b!==void 0&&(y!=null&&y.intervals[b])&&(y.intervals[b]=v),S})}function h(g,v){v.id===void 0&&(v.id=`id-${a}`,l(S=>S+1)),r(S=>{S=[...S];const y=S.findIndex(b=>b.id===g);if(y!==-1){const b={...S[y]};v={...v,...b.filters},b.intervals=[...b.intervals,v],S[y]=b}return S})}function m(g,v){r(S=>{S=[...S];const y=S.find(b=>b.id===g);return y&&(y.intervals=y.intervals.filter(b=>b.id!==v.id)),S})}}function eW(e){const{intervalGroup:t,unit:n}=e;return s.jsx(iu,{"data-testid":t.id,className:YH.section,children:s.jsxs(Ae,{gap:"lg",children:[s.jsx(Z,{justify:"flex-end",children:s.jsx(tn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{ct(r),e.onRemoveGroup(t)},children:s.jsx(Yd,{})},`remove-group-button-${t.id}`)}),s.jsx(tW,{intervalGroup:t,onChange:e.onChange}),s.jsx(nn,{}),t.intervals.map(r=>s.jsxs(Ae,{gap:"xs",children:[s.jsxs(Z,{children:[s.jsx(fe,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{ct(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(tn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{ct(o),e.onRemove(t.id,r)},children:s.jsx(Yd,{})},`remove-interval-${r.id}`)]}),s.jsx(Ix,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(tn,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{ct(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Xd,{})})]})})}function tW(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 s.jsxs(Ae,{style:{maxWidth:"50%"},children:[s.jsx(Z,{children:s.jsx(Tt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),n(t.id,{...a,gender:l})}}})}),s.jsxs(Z,{gap:"xs",children:[s.jsx(ue,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Ix,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)n(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.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 a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,n(t.id,{...a,context:void 0})):n(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(Tt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?n(t.id,{...a,category:void 0}):n(t.id,{...a,category:l})}}})]})}function nW(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.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 rW(e,t){let n=1;const r={};for(const o of e){const i=oW(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(XH.map(a=>[a,o[a]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function oW(e){var n,r;return[`gender=${e.gender}`,`age=${bc(e.age)}`,`gestationalAge=${bc(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 iW(e){return e&&(z7(e,"http://unitsofmeasure.org")||e.text)}function sW(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 aW(e){var u;const t=ie(),n=vt(e.value),[r,o]=p.useState(!1),[i,a]=p.useState();if(p.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(a).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return s.jsx(rr,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,S,y,b,x,w;const h=d.resource&&c(d.resource),m=(S=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:S.valueReference,g=(b=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:b.valueReference;return s.jsxs(p.Fragment,{children:[s.jsx(rr.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(T8,{}):s.jsx(J8,{color:"gray"})}),s.jsxs(rr.Col,{span:9,p:"xs",children:[s.jsx(ue,{fw:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(ul,{value:(x=h==null?void 0:h.meta)==null?void 0:x.author})," on ",Nn((w=h==null?void 0:h.meta)==null?void 0:w.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(Mx,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(rr.Col,{span:2,p:"md",children:[m&&!g&&s.jsx(oe,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&s.jsx(oe,{onClick:()=>e.onEdit(h,m,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:f}}function c(d){for(const f of i==null?void 0:i.entry)if(f.resource&&d.reference===St(f.resource))return f.resource}}function jR(e,t){const n=lW(e,t);return cW(n,e,t)}function lW(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+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=a+u,f=d+1,h=d-1,m=l[f],g=l[h];let v,S=0;u===-c||u!==c&&g.i<m.i?(S=m.i,v=m):(S=g.i+1,v=g),l[h]=void 0;let y=S-u,b={i:S,j:y,prev:uW(v),snake:!1};for(;S<n&&y<r&&e[S]===t[y];)S++,y++;if(S>b.i&&(b={i:S,j:y,prev:b,snake:!0}),l[d]=b,S>=n&&y>=r)return l[d]}l[a+c-1]=void 0}}function cW(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,a=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,a)};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 uW(e){return e&&!e.snake&&e.prev?e.prev:e}function dW(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:ar(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 fW(n,t),hW(n),n}function fW(e,t){for(let n=1;n<t.length;n++){const r=jR(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.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 hW(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 pW="_container_1oj0p_1",mW="_root_1oj0p_5",gW="_startRow_1oj0p_20",vW="_normalRow_1oj0p_24",yW="_author_1oj0p_28",xW="_dateTime_1oj0p_32",bW="_lineNumber_1oj0p_37",wW="_line_1oj0p_37",SW="_pre_1oj0p_52",xo={container:pW,root:mW,startRow:gW,normalRow:vW,author:yW,dateTime:xW,lineNumber:bW,line:wW,pre:SW};function jW(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function CW(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return ea(n,"year");const r=Math.floor(t/2592e3);if(r>0)return ea(r,"month");const o=Math.floor(t/86400);if(o>0)return ea(o,"day");const i=Math.floor(t/3600);if(i>0)return ea(i,"hour");const a=Math.floor(t/60);return a>0?ea(a,"minute"):ea(t,"second")}function ea(e,t){return`${e} ${e===1?t:t+"s"} ago`}function EW(e){var a,l;const t=ie(),[n,r]=p.useState(e.history);if(p.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const o=(l=(a=n.entry)==null?void 0:a[0])==null?void 0:l.resource;if(!o)return null;const i=dW(n);return s.jsx("div",{className:xo.container,children:s.jsx("table",{className:xo.root,children:s.jsx("tbody",{children:i.map((c,u)=>s.jsxs("tr",{className:c.span>0?xo.startRow:xo.normalRow,children:[c.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:xo.author,rowSpan:c.span,children:s.jsx(Ra,{value:c.meta.author,link:!0})}),s.jsx("td",{className:xo.dateTime,rowSpan:c.span,children:s.jsx(He,{to:jW(o,c.meta.versionId),children:CW(c.meta.lastUpdated)})})]}),s.jsx("td",{className:xo.lineNumber,children:u+1}),s.jsx("td",{className:xo.line,children:s.jsx("pre",{className:xo.pre,children:c.value})})]},"row-"+u))})})})}const TW="_removed_mgz0k_2",PW="_added_mgz0k_7",vw={removed:TW,added:PW};function kW(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=ar(t,!0).match(/[^\r\n]+/g),o=ar(n,!0).match(/[^\r\n]+/g),i=jR(r,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(RW,{delta:a},"delta"+l))})}function RW(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:vw.removed,children:e.delta.original.lines.join(`
|
|
523
|
+
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:vw.added,children:e.delta.revised.lines.join(`
|
|
524
|
+
`)}),"...",s.jsx("br",{})]})}function nf(e){const{outcome:t}=e,n=ie(),r=vt(e.defaultValue),[o,i]=p.useState(),[a,l]=p.useState(),c=n.getAccessPolicy();p.useEffect(()=>{if(r)if(e.profileUrl){const f=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const h=Ms(f);if(h){i(h.name);const m=r8(r,h);l(m)}else console.error(`Schema not found for ${f}`)}).catch(h=>{console.error("Error in requestProfileSchema",h)})}else{const f=e.schemaName??(r==null?void 0:r.resourceType);n.requestSchema(f).then(()=>{l(r),i(f)}).catch(console.log)}},[n,r,e.schemaName,e.profileUrl]);const u=p.useMemo(()=>r&&WP(r,gx.READ,c),[c,r]),d=p.useMemo(()=>n.isSuperAdmin()||!c||!Mt(a==null?void 0:a.resourceType)?!0:hF(c,a==null?void 0:a.resourceType),[n,c,a==null?void 0:a.resourceType]);return!o||!a?s.jsx("div",{children:"Loading..."}):d?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:f=>{f.preventDefault(),e.onSubmit&&e.onSubmit(a)},children:[s.jsxs(Ae,{mb:"xl",children:[s.jsx(ht,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(fe,{name:"resourceType",defaultValue:a.resourceType,disabled:!0})}),s.jsx(ht,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(fe,{name:"id",defaultValue:a.id,disabled:!0})})]}),s.jsx(Nx,{path:a.resourceType,valuePath:a.resourceType,typeName:o,defaultValue:a,outcome:t,onChange:l,profileUrl:e.profileUrl,accessPolicyResource:u}),s.jsxs(Z,{justify:"flex-end",mt:"xl",children:[s.jsx(oe,{type:"submit",children:"OK"}),e.onDelete&&s.jsx(oe,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(a)},children:"Delete"})]})]}):s.jsxs($i,{color:"red",title:"Permission denied",icon:s.jsx(al,{}),children:["Your access level prevents you from editing and creating ",a.resourceType," resources."]})}function _W(e){var o;const t=ie(),[n,r]=p.useState(e.history);return p.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?s.jsxs(ce,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(ce.Thead,{children:s.jsxs(ce.Tr,{children:[s.jsx(ce.Th,{children:"Author"}),s.jsx(ce.Th,{children:"Date"}),s.jsx(ce.Th,{children:"Version"})]})}),s.jsx(ce.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,a)=>s.jsx(DW,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function DW(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?s.jsxs(ce.Tr,{children:[s.jsx(ce.Td,{children:s.jsx(Ra,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(ce.Td,{children:Nn((o=n.meta)==null?void 0:o.lastUpdated)}),s.jsx(ce.Td,{children:s.jsx(He,{to:IW(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):s.jsx(ce.Tr,{children:s.jsx(ce.Td,{colSpan:3,children:Ne(t==null?void 0:t.outcome)})})}function IW(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function AW(e){return s.jsx(bh,{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:[wt(t)],subject:t.subject,sender:wt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",basedOn:[wt(t)],subject:t.subject,operator:wt(n),issued:new Date().toISOString(),content:r})})}function NW(e){const t=ie(),{client:n,patient:r,encounter:o,children:i,...a}=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:Ne(c),autoClose:!1}))}return s.jsx(Je,{onClick:()=>l(),...a,children:i})}function CR(e){const t=ie(),[n,r]=p.useState();return s.jsxs(Ge,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(mt(i))}},children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Create project"})]}),s.jsxs(Ae,{gap:"xl",children:[s.jsx(fe,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ye(n,"firstName")}),s.jsxs(ue,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Je,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Je,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"Create project"})})]})}function ER(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 TR(e){const t=ie(),{googleClientId:n,handleGoogleCredential:r}=e,o=p.useRef(null),[i,a]=p.useState(typeof google<"u"),[l,c]=p.useState(!1),[u,d]=p.useState(!1);return p.useEffect(()=>{if(typeof google>"u"){ER("https://accounts.google.com/gsi/client",()=>a(!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?s.jsx("div",{ref:o}):null}var MW={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.7-5fa90717f",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function PR(e){var t;if(e)return e;if(typeof window<"u"){const n=window.location.protocol+"//"+window.location.host;if((((t=MW.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function kR(e){typeof grecaptcha>"u"&&ER("https://www.google.com/recaptcha/api.js?render="+e)}function RR(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function OW(e){const t=PR(e.googleClientId),n=e.recaptchaSiteKey,r=ie(),[o,i]=p.useState(),a=ou(o,void 0);return p.useEffect(()=>{n&&kR(n)},[n]),s.jsxs(Ge,{onSubmit:async l=>{try{let c="";n&&(c=await RR(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(mt(c))}},children:[s.jsx(dn,{style:{flexDirection:"column"},children:e.children}),s.jsx(Xr,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{justify:"center",p:"xl",style:{height:70},children:s.jsx(TR,{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(mt(c))}}})}),s.jsx(nn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(Ae,{gap:"xl",children:[s.jsx(fe,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ye(o,"firstName")}),s.jsx(fe,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ye(o,"lastName")}),s.jsx(fe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ye(o,"email")}),s.jsx(Vr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ye(o,"password")}),s.jsxs(ue,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Je,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Je,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(ue,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Je,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Je,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(Z,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Yn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(oe,{type:"submit",children:"Create account"})]})]})}function $W(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=ie(),[c,u]=p.useState(),[d,f]=p.useState();p.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(m=>l.processCode(m.code)).then(()=>a()).catch(m=>f(mt(m)))},[l,t,n,c,a]);function h(m){m.code?l.processCode(m.code).then(()=>a()).catch(console.log):m.login&&u(m.login)}return s.jsxs(De,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(OW,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(CR,{login:c,handleAuthResponse:h})]})}function LW(e){const[t,n]=p.useState();return t?s.jsx(zW,{email:t,...e}):s.jsx(FW,{setEmail:n,...e})}function FW(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...a}=e,l=ie(),c=!e.disableGoogleAuth&&PR(e.googleClientId),[u,d]=p.useState(),f=ou(u,void 0),h=p.useCallback(async v=>{if(!v.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(a),domain:v.domain}),y=new URL(v.authorizeUrl);return y.searchParams.set("state",S),window.location.assign(y.toString()),!0},[l,a]),m=p.useCallback(async v=>{const S=await l.post("auth/method",{email:v.email});await h(S)||t(v.email)},[l,h,t]),g=p.useCallback(async v=>{try{const S=await l.startGoogleLogin({...a,googleCredential:v.credential});await h(S)||r(S)}catch(S){d(mt(S))}},[l,a,h,r]);return s.jsxs(Ge,{onSubmit:m,children:[s.jsx(dn,{style:{flexDirection:"column"},children:o}),s.jsx(Xr,{issues:f}),c&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{justify:"center",p:"xl",style:{height:70},children:s.jsx(TR,{googleClientId:c,handleGoogleCredential:g})}),!i&&s.jsx(nn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(fe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ye(u,"email")}),s.jsxs(Z,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Je,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&s.jsx(oe,{type:"submit",children:"Next"})]})]})}function zW(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=ie(),[a,l]=p.useState(),c=ou(a,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(mt(f)))},[i,o,n]);return s.jsxs(Ge,{onSubmit:u,children:[s.jsx(dn,{style:{flexDirection:"column"},children:r}),s.jsx(Xr,{issues:c}),s.jsx(Ae,{gap:"xl",children:s.jsx(Vr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ye(a,"password")})}),s.jsxs(Z,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Je,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Yn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(oe,{type:"submit",children:"Sign in"})]})]})}function BW(e){const t=ie(),n=zc(),[r,o]=p.useState(""),[i,a]=p.useState();function l(f){var h;return!!((h=f==null?void 0:f.toLowerCase())!=null&&h.includes(r.toLowerCase()))}function c(f){var h,m;return l((h=f.profile)==null?void 0:h.display)||l((m=f.project)==null?void 0:m.display)}function u(f){t.post("auth/profile",{login:e.login,profile:f}).then(e.handleAuthResponse).catch(h=>a(mt(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>s.jsx(Ie.Option,{value:f.id,children:s.jsx(VW,{...f})},f.id));return s.jsxs(Ae,{children:[s.jsxs(hs,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(Yr,{size:32}),s.jsx(de,{order:3,children:"Choose profile"})]}),s.jsx(Xr,{outcome:i}),s.jsxs(Ie,{store:n,onOptionSubmit:u,children:[s.jsx(Ie.EventsTarget,{children:s.jsx(fe,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(Ie.Options,{children:d.length>0?d:s.jsx(Ie.Empty,{children:"Nothing found..."})})})]})]})}function VW(e){var t,n;return s.jsxs(Z,{children:[s.jsx(ps,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(ue,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(ue,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function UW(e){const t=ie();return s.jsx(Ge,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(Ae,{children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Choose scope"})]}),s.jsx(Ae,{children:(e.scope??"openid").split(" ").map(n=>s.jsx(Yn,{id:n,name:n,label:n,defaultChecked:!0},n))}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Set scope"})})]})})}function HW(e){const t=ie(),[n,r]=p.useState();return s.jsx(Ge,{onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(Ne(i)))},children:s.jsxs(Ae,{children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Enter MFA code"})]}),n&&s.jsx($i,{icon:s.jsx(al,{size:16}),title:"Error",color:"red",children:n}),s.jsx(Ae,{children:s.jsx(fe,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Submit code"})})]})})}function _R(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=ie(),[u,d]=p.useState(),f=p.useRef(!1),[h,m]=p.useState(!1),[g,v]=p.useState(),S=p.useCallback(x=>{a?a(x):c.processCode(x).then(()=>{r&&r()}).catch(w=>ve({color:"red",message:Ne(w)}))},[c,a,r]),y=p.useCallback(x=>{m(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&v(x.memberships),x.code&&(n?v(void 0):S(x.code))},[n,S]),b=p.useCallback(x=>{S(x.code)},[S]);return p.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(y).catch(x=>ve({color:"red",message:Ne(x)})))},[c,t,f,u,y]),s.jsx(De,{width:450,px:"sm",py:"md",children:u?h?s.jsx(HW,{login:u,handleAuthResponse:y}):g?s.jsx(BW,{login:u,memberships:g,handleAuthResponse:y}):e.projectId==="new"?s.jsx(CR,{login:u,handleAuthResponse:y}):e.chooseScopes?s.jsx(UW,{login:u,scope:e.scope,handleAuthResponse:b}):s.jsx("div",{children:"Success"}):s.jsx(LW,{onForgotPassword:o,onRegister:i,handleAuthResponse:y,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var DR,yw=Mc;DR=yw.createRoot,yw.hydrateRoot;/**
|
|
525
|
+
* @remix-run/router v1.16.1
|
|
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 At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}var Ut;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Ut||(Ut={}));const xw="popstate";function WW(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return Ec("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:cu(o)}return GW(t,n,null,e)}function Be(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function qa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function qW(){return Math.random().toString(36).substr(2,8)}function bw(e,t){return{usr:e.state,key:e.key,idx:t}}function Ec(e,t,n,r){return n===void 0&&(n=null),At({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Yo(t):t,{state:n,key:t&&t.key||r||qW()})}function cu(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 Yo(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 GW(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Ut.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(At({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=Ut.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=Ut.Push;let b=Ec(v.location,S,y);u=d()+1;let x=bw(b,u),w=v.createHref(b);try{a.pushState(x,"",w)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;o.location.assign(w)}i&&c&&c({action:l,location:v.location,delta:1})}function m(S,y){l=Ut.Replace;let b=Ec(v.location,S,y);u=d();let x=bw(b,u),w=v.createHref(b);a.replaceState(x,"",w),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,b=typeof S=="string"?S:cu(S);return b=b.replace(/ $/,"%20"),Be(y,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,y)}let v={get action(){return l},get location(){return e(o,a)},listen(S){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(xw,f),c=S,()=>{o.removeEventListener(xw,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:m,go(S){return a.go(S)}};return v}var kt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(kt||(kt={}));const QW=new Set(["lazy","caseSensitive","path","id","index","children"]);function KW(e){return e.index===!0}function dg(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,i],l=typeof o.id=="string"?o.id:a.join("-");if(Be(o.index!==!0||!o.children,"Cannot specify children on an index route"),Be(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),KW(o)){let c=At({},o,t(o),{id:l});return r[l]=c,c}else{let c=At({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=dg(o.children,t,a,r)),c}})}function xa(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Yo(t):t,o=uu(r.pathname||"/",n);if(o==null)return null;let i=IR(e);XW(i);let a=null;for(let l=0;a==null&&l<i.length;++l){let c=cq(o);a=sq(i[l],c)}return a}function YW(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 IR(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(Be(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=Ei([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Be(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),IR(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:oq(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of AR(i.path))o(i,a,c)}),t}function AR(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 a=AR(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function XW(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:iq(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const JW=/^:[\w-]+$/,ZW=3,eq=2,tq=1,nq=10,rq=-2,ww=e=>e==="*";function oq(e,t){let n=e.split("/"),r=n.length;return n.some(ww)&&(r+=rq),t&&(r+=eq),n.filter(o=>!ww(o)).reduce((o,i)=>o+(JW.test(i)?ZW:i===""?tq:nq),r)}function iq(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 sq(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a<n.length;++a){let l=n[a],c=a===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=aq({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:Ei([o,d.pathname]),pathnameBase:fq(Ei([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=Ei([o,d.pathnameBase]))}return i}function aq(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=lq(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let v=l[f]||"";a=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[f];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function lq(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),qa(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,(a,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 cq(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return qa(!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 uu(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 uq(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Yo(e):e;return{pathname:n?n.startsWith("/")?n:dq(n,t):t,search:hq(r),hash:pq(o)}}function dq(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 Dp(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 NR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function MR(e,t){let n=NR(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function OR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Yo(e):(o=At({},e),Be(!o.pathname||!o.pathname.includes("?"),Dp("?","pathname","search",o)),Be(!o.pathname||!o.pathname.includes("#"),Dp("#","pathname","hash",o)),Be(!o.search||!o.search.includes("#"),Dp("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=uq(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ei=e=>e.join("/").replace(/\/\/+/g,"/"),fq=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),hq=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,pq=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Kx{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 Yx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const $R=["post","put","patch","delete"],mq=new Set($R),gq=["get",...$R],vq=new Set(gq),yq=new Set([301,302,303,307,308]),xq=new Set([307,308]),Ip={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},bq={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Tl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Xx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,wq=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),LR="remix-router-transitions";function Sq(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;Be(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 O=e.detectErrorBoundary;o=z=>({hasErrorBoundary:O(z)})}else o=wq;let i={},a=dg(e.routes,o,void 0,i),l,c=e.basename||"/",u=e.unstable_dataStrategy||Tq,d=At({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),f=null,h=new Set,m=null,g=null,v=null,S=e.hydrationData!=null,y=xa(a,e.history.location,c),b=null;if(y==null){let O=mr(404,{pathname:e.history.location.pathname}),{matches:z,route:q}=Dw(a);y=z,b={[q.id]:O}}let x,w=y.some(O=>O.route.lazy),j=y.some(O=>O.route.loader);if(w)x=!1;else if(!j)x=!0;else if(d.v7_partialHydration){let O=e.hydrationData?e.hydrationData.loaderData:null,z=e.hydrationData?e.hydrationData.errors:null,q=Q=>Q.route.loader?typeof Q.route.loader=="function"&&Q.route.loader.hydrate===!0?!1:O&&O[Q.route.id]!==void 0||z&&z[Q.route.id]!==void 0:!0;if(z){let Q=y.findIndex(ae=>z[ae.route.id]!==void 0);x=y.slice(0,Q+1).every(q)}else x=y.every(q)}else x=e.hydrationData!=null;let E,C={historyAction:e.history.action,location:e.history.location,matches:y,initialized:x,navigation:Ip,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||b,fetchers:new Map,blockers:new Map},T=Ut.Pop,_=!1,P,M=!1,D=new Map,N=null,A=!1,L=!1,I=[],k=[],R=new Map,$=0,B=-1,H=new Map,X=new Set,ye=new Map,he=new Map,be=new Set,ke=new Map,Ce=new Map,se=!1;function Ve(){if(f=e.history.listen(O=>{let{action:z,location:q,delta:Q}=O;if(se){se=!1;return}qa(Ce.size===0||Q!=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 ae=pu({currentLocation:C.location,nextLocation:q,historyAction:z});if(ae&&Q!=null){se=!0,e.history.go(Q*-1),Zo(ae,{state:"blocked",location:q,proceed(){Zo(ae,{state:"proceeding",proceed:void 0,reset:void 0,location:q}),e.history.go(Q)},reset(){let Me=new Map(C.blockers);Me.set(ae,Tl),We({blockers:Me})}});return}return ne(z,q)}),n){Lq(t,D);let O=()=>Fq(t,D);t.addEventListener("pagehide",O),N=()=>t.removeEventListener("pagehide",O)}return C.initialized||ne(Ut.Pop,C.location,{initialHydration:!0}),E}function ut(){f&&f(),N&&N(),h.clear(),P&&P.abort(),C.fetchers.forEach((O,z)=>vn(z)),C.blockers.forEach((O,z)=>ur(z))}function lt(O){return h.add(O),()=>h.delete(O)}function We(O,z){z===void 0&&(z={}),C=At({},C,O);let q=[],Q=[];d.v7_fetcherPersist&&C.fetchers.forEach((ae,Me)=>{ae.state==="idle"&&(be.has(Me)?Q.push(Me):q.push(Me))}),[...h].forEach(ae=>ae(C,{deletedFetchers:Q,unstable_viewTransitionOpts:z.viewTransitionOpts,unstable_flushSync:z.flushSync===!0})),d.v7_fetcherPersist&&(q.forEach(ae=>C.fetchers.delete(ae)),Q.forEach(ae=>vn(ae)))}function Ee(O,z,q){var Q,ae;let{flushSync:Me}=q===void 0?{}:q,Te=C.actionData!=null&&C.navigation.formMethod!=null&&Or(C.navigation.formMethod)&&C.navigation.state==="loading"&&((Q=O.state)==null?void 0:Q._isRedirect)!==!0,me;z.actionData?Object.keys(z.actionData).length>0?me=z.actionData:me=null:Te?me=C.actionData:me=null;let $e=z.loaderData?Rw(C.loaderData,z.loaderData,z.matches||[],z.errors):C.loaderData,Oe=C.blockers;Oe.size>0&&(Oe=new Map(Oe),Oe.forEach((Re,dt)=>Oe.set(dt,Tl)));let Yt=_===!0||C.navigation.formMethod!=null&&Or(C.navigation.formMethod)&&((ae=O.state)==null?void 0:ae._isRedirect)!==!0;l&&(a=l,l=void 0),A||T===Ut.Pop||(T===Ut.Push?e.history.push(O,O.state):T===Ut.Replace&&e.history.replace(O,O.state));let Xt;if(T===Ut.Pop){let Re=D.get(C.location.pathname);Re&&Re.has(O.pathname)?Xt={currentLocation:C.location,nextLocation:O}:D.has(O.pathname)&&(Xt={currentLocation:O,nextLocation:C.location})}else if(M){let Re=D.get(C.location.pathname);Re?Re.add(O.pathname):(Re=new Set([O.pathname]),D.set(C.location.pathname,Re)),Xt={currentLocation:C.location,nextLocation:O}}We(At({},z,{actionData:me,loaderData:$e,historyAction:T,location:O,initialized:!0,navigation:Ip,revalidation:"idle",restoreScrollPosition:Tn(O,z.matches||C.matches),preventScrollReset:Yt,blockers:Oe}),{viewTransitionOpts:Xt,flushSync:Me===!0}),T=Ut.Pop,_=!1,M=!1,A=!1,L=!1,I=[],k=[]}async function Pe(O,z){if(typeof O=="number"){e.history.go(O);return}let q=fg(C.location,C.matches,c,d.v7_prependBasename,O,d.v7_relativeSplatPath,z==null?void 0:z.fromRouteId,z==null?void 0:z.relative),{path:Q,submission:ae,error:Me}=Sw(d.v7_normalizeFormMethod,!1,q,z),Te=C.location,me=Ec(C.location,Q,z&&z.state);me=At({},me,e.history.encodeLocation(me));let $e=z&&z.replace!=null?z.replace:void 0,Oe=Ut.Push;$e===!0?Oe=Ut.Replace:$e===!1||ae!=null&&Or(ae.formMethod)&&ae.formAction===C.location.pathname+C.location.search&&(Oe=Ut.Replace);let Yt=z&&"preventScrollReset"in z?z.preventScrollReset===!0:void 0,Xt=(z&&z.unstable_flushSync)===!0,Re=pu({currentLocation:Te,nextLocation:me,historyAction:Oe});if(Re){Zo(Re,{state:"blocked",location:me,proceed(){Zo(Re,{state:"proceeding",proceed:void 0,reset:void 0,location:me}),Pe(O,z)},reset(){let dt=new Map(C.blockers);dt.set(Re,Tl),We({blockers:dt})}});return}return await ne(Oe,me,{submission:ae,pendingError:Me,preventScrollReset:Yt,replace:z&&z.replace,enableViewTransition:z&&z.unstable_viewTransition,flushSync:Xt})}function ee(){if(Pt(),We({revalidation:"loading"}),C.navigation.state!=="submitting"){if(C.navigation.state==="idle"){ne(C.historyAction,C.location,{startUninterruptedRevalidation:!0});return}ne(T||C.historyAction,C.navigation.location,{overrideNavigation:C.navigation})}}async function ne(O,z,q){P&&P.abort(),P=null,T=O,A=(q&&q.startUninterruptedRevalidation)===!0,ei(C.location,C.matches),_=(q&&q.preventScrollReset)===!0,M=(q&&q.enableViewTransition)===!0;let Q=l||a,ae=q&&q.overrideNavigation,Me=xa(Q,z,c),Te=(q&&q.flushSync)===!0;if(!Me){let Re=mr(404,{pathname:z.pathname}),{matches:dt,route:ze}=Dw(Q);Bs(),Ee(z,{matches:dt,loaderData:{},errors:{[ze.id]:Re}},{flushSync:Te});return}if(C.initialized&&!L&&Iq(C.location,z)&&!(q&&q.submission&&Or(q.submission.formMethod))){Ee(z,{matches:Me},{flushSync:Te});return}P=new AbortController;let me=ta(e.history,z,P.signal,q&&q.submission),$e;if(q&&q.pendingError)$e=[ql(Me).route.id,{type:kt.error,error:q.pendingError}];else if(q&&q.submission&&Or(q.submission.formMethod)){let Re=await Se(me,z,q.submission,Me,{replace:q.replace,flushSync:Te});if(Re.shortCircuited)return;$e=Re.pendingActionResult,ae=Ap(z,q.submission),Te=!1,me=ta(e.history,me.url,me.signal)}let{shortCircuited:Oe,loaderData:Yt,errors:Xt}=await qe(me,z,Me,ae,q&&q.submission,q&&q.fetcherSubmission,q&&q.replace,q&&q.initialHydration===!0,Te,$e);Oe||(P=null,Ee(z,At({matches:Me},_w($e),{loaderData:Yt,errors:Xt})))}async function Se(O,z,q,Q,ae){ae===void 0&&(ae={}),Pt();let Me=Oq(z,q);We({navigation:Me},{flushSync:ae.flushSync===!0});let Te,me=pg(Q,z);if(!me.route.action&&!me.route.lazy)Te={type:kt.error,error:mr(405,{method:O.method,pathname:z.pathname,routeId:me.route.id})};else if(Te=(await pe("action",O,[me],Q))[0],O.signal.aborted)return{shortCircuited:!0};if(rs(Te)){let $e;return ae&&ae.replace!=null?$e=ae.replace:$e=Tw(Te.response.headers.get("Location"),new URL(O.url),c)===C.location.pathname+C.location.search,await G(O,Te,{submission:q,replace:$e}),{shortCircuited:!0}}if(ns(Te))throw mr(400,{type:"defer-action"});if(yr(Te)){let $e=ql(Q,me.route.id);return(ae&&ae.replace)!==!0&&(T=Ut.Push),{pendingActionResult:[$e.route.id,Te]}}return{pendingActionResult:[me.route.id,Te]}}async function qe(O,z,q,Q,ae,Me,Te,me,$e,Oe){let Yt=Q||Ap(z,ae),Xt=ae||Me||Nw(Yt),Re=l||a,[dt,ze]=jw(e.history,C,q,Xt,z,d.v7_partialHydration&&me===!0,d.unstable_skipActionErrorRevalidation,L,I,k,be,ye,X,Re,c,Oe);if(Bs(Xe=>!(q&&q.some(Pn=>Pn.route.id===Xe))||dt&&dt.some(Pn=>Pn.route.id===Xe)),B=++$,dt.length===0&&ze.length===0){let Xe=zs();return Ee(z,At({matches:q,loaderData:{},errors:Oe&&yr(Oe[1])?{[Oe[0]]:Oe[1].error}:null},_w(Oe),Xe?{fetchers:new Map(C.fetchers)}:{}),{flushSync:$e}),{shortCircuited:!0}}if(!A&&(!d.v7_partialHydration||!me)){ze.forEach(Pn=>{let dr=C.fetchers.get(Pn.key),cn=Pl(void 0,dr?dr.data:void 0);C.fetchers.set(Pn.key,cn)});let Xe;Oe&&!yr(Oe[1])?Xe={[Oe[0]]:Oe[1].data}:C.actionData&&(Object.keys(C.actionData).length===0?Xe=null:Xe=C.actionData),We(At({navigation:Yt},Xe!==void 0?{actionData:Xe}:{},ze.length>0?{fetchers:new Map(C.fetchers)}:{}),{flushSync:$e})}ze.forEach(Xe=>{R.has(Xe.key)&&ln(Xe.key),Xe.controller&&R.set(Xe.key,Xe.controller)});let vo=()=>ze.forEach(Xe=>ln(Xe.key));P&&P.signal.addEventListener("abort",vo);let{loaderResults:_r,fetcherResults:yo}=await tt(C.matches,q,dt,ze,O);if(O.signal.aborted)return{shortCircuited:!0};P&&P.signal.removeEventListener("abort",vo),ze.forEach(Xe=>R.delete(Xe.key));let ti=Iw([..._r,...yo]);if(ti){if(ti.idx>=dt.length){let Xe=ze[ti.idx-dt.length].key;X.add(Xe)}return await G(O,ti.result,{replace:Te}),{shortCircuited:!0}}let{loaderData:Us,errors:Jr}=kw(C,q,dt,_r,Oe,ze,yo,ke);ke.forEach((Xe,Pn)=>{Xe.subscribe(dr=>{(dr||Xe.done)&&ke.delete(Pn)})}),d.v7_partialHydration&&me&&C.errors&&Object.entries(C.errors).filter(Xe=>{let[Pn]=Xe;return!dt.some(dr=>dr.route.id===Pn)}).forEach(Xe=>{let[Pn,dr]=Xe;Jr=Object.assign(Jr||{},{[Pn]:dr})});let mu=zs(),gu=hu(B),vu=mu||gu||ze.length>0;return At({loaderData:Us,errors:Jr},vu?{fetchers:new Map(C.fetchers)}:{})}function Ke(O,z,q,Q){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(O)&&ln(O);let ae=(Q&&Q.unstable_flushSync)===!0,Me=l||a,Te=fg(C.location,C.matches,c,d.v7_prependBasename,q,d.v7_relativeSplatPath,z,Q==null?void 0:Q.relative),me=xa(Me,Te,c);if(!me){Lt(O,z,mr(404,{pathname:Te}),{flushSync:ae});return}let{path:$e,submission:Oe,error:Yt}=Sw(d.v7_normalizeFormMethod,!0,Te,Q);if(Yt){Lt(O,z,Yt,{flushSync:ae});return}let Xt=pg(me,$e);if(_=(Q&&Q.preventScrollReset)===!0,Oe&&Or(Oe.formMethod)){Le(O,z,$e,Xt,me,ae,Oe);return}ye.set(O,{routeId:z,path:$e}),Y(O,z,$e,Xt,me,ae,Oe)}async function Le(O,z,q,Q,ae,Me,Te){if(Pt(),ye.delete(O),!Q.route.action&&!Q.route.lazy){let cn=mr(405,{method:Te.formMethod,pathname:q,routeId:z});Lt(O,z,cn,{flushSync:Me});return}let me=C.fetchers.get(O);yt(O,$q(Te,me),{flushSync:Me});let $e=new AbortController,Oe=ta(e.history,q,$e.signal,Te);R.set(O,$e);let Yt=$,Re=(await pe("action",Oe,[Q],ae))[0];if(Oe.signal.aborted){R.get(O)===$e&&R.delete(O);return}if(d.v7_fetcherPersist&&be.has(O)){if(rs(Re)||yr(Re)){yt(O,oi(void 0));return}}else{if(rs(Re))if(R.delete(O),B>Yt){yt(O,oi(void 0));return}else return X.add(O),yt(O,Pl(Te)),G(Oe,Re,{fetcherSubmission:Te});if(yr(Re)){Lt(O,z,Re.error);return}}if(ns(Re))throw mr(400,{type:"defer-action"});let dt=C.navigation.location||C.location,ze=ta(e.history,dt,$e.signal),vo=l||a,_r=C.navigation.state!=="idle"?xa(vo,C.navigation.location,c):C.matches;Be(_r,"Didn't find any matches after fetcher action");let yo=++$;H.set(O,yo);let ti=Pl(Te,Re.data);C.fetchers.set(O,ti);let[Us,Jr]=jw(e.history,C,_r,Te,dt,!1,d.unstable_skipActionErrorRevalidation,L,I,k,be,ye,X,vo,c,[Q.route.id,Re]);Jr.filter(cn=>cn.key!==O).forEach(cn=>{let hl=cn.key,s0=C.fetchers.get(hl),h2=Pl(void 0,s0?s0.data:void 0);C.fetchers.set(hl,h2),R.has(hl)&&ln(hl),cn.controller&&R.set(hl,cn.controller)}),We({fetchers:new Map(C.fetchers)});let mu=()=>Jr.forEach(cn=>ln(cn.key));$e.signal.addEventListener("abort",mu);let{loaderResults:gu,fetcherResults:vu}=await tt(C.matches,_r,Us,Jr,ze);if($e.signal.aborted)return;$e.signal.removeEventListener("abort",mu),H.delete(O),R.delete(O),Jr.forEach(cn=>R.delete(cn.key));let Xe=Iw([...gu,...vu]);if(Xe){if(Xe.idx>=Us.length){let cn=Jr[Xe.idx-Us.length].key;X.add(cn)}return G(ze,Xe.result)}let{loaderData:Pn,errors:dr}=kw(C,C.matches,Us,gu,void 0,Jr,vu,ke);if(C.fetchers.has(O)){let cn=oi(Re.data);C.fetchers.set(O,cn)}hu(yo),C.navigation.state==="loading"&&yo>B?(Be(T,"Expected pending action"),P&&P.abort(),Ee(C.navigation.location,{matches:_r,loaderData:Pn,errors:dr,fetchers:new Map(C.fetchers)})):(We({errors:dr,loaderData:Rw(C.loaderData,Pn,_r,dr),fetchers:new Map(C.fetchers)}),L=!1)}async function Y(O,z,q,Q,ae,Me,Te){let me=C.fetchers.get(O);yt(O,Pl(Te,me?me.data:void 0),{flushSync:Me});let $e=new AbortController,Oe=ta(e.history,q,$e.signal);R.set(O,$e);let Yt=$,Re=(await pe("loader",Oe,[Q],ae))[0];if(ns(Re)&&(Re=await VR(Re,Oe.signal,!0)||Re),R.get(O)===$e&&R.delete(O),!Oe.signal.aborted){if(be.has(O)){yt(O,oi(void 0));return}if(rs(Re))if(B>Yt){yt(O,oi(void 0));return}else{X.add(O),await G(Oe,Re);return}if(yr(Re)){Lt(O,z,Re.error);return}Be(!ns(Re),"Unhandled fetcher deferred data"),yt(O,oi(Re.data))}}async function G(O,z,q){let{submission:Q,fetcherSubmission:ae,replace:Me}=q===void 0?{}:q;z.response.headers.has("X-Remix-Revalidate")&&(L=!0);let Te=z.response.headers.get("Location");Be(Te,"Expected a Location header on the redirect Response"),Te=Tw(Te,new URL(O.url),c);let me=Ec(C.location,Te,{_isRedirect:!0});if(n){let dt=!1;if(z.response.headers.has("X-Remix-Reload-Document"))dt=!0;else if(Xx.test(Te)){const ze=e.history.createURL(Te);dt=ze.origin!==t.location.origin||uu(ze.pathname,c)==null}if(dt){Me?t.location.replace(Te):t.location.assign(Te);return}}P=null;let $e=Me===!0?Ut.Replace:Ut.Push,{formMethod:Oe,formAction:Yt,formEncType:Xt}=C.navigation;!Q&&!ae&&Oe&&Yt&&Xt&&(Q=Nw(C.navigation));let Re=Q||ae;if(xq.has(z.response.status)&&Re&&Or(Re.formMethod))await ne($e,me,{submission:At({},Re,{formAction:Te}),preventScrollReset:_});else{let dt=Ap(me,Q);await ne($e,me,{overrideNavigation:dt,fetcherSubmission:ae,preventScrollReset:_})}}async function pe(O,z,q,Q){try{let ae=await Pq(u,O,z,q,Q,i,o);return await Promise.all(ae.map((Me,Te)=>{if(Aq(Me)){let me=Me.result;return{type:kt.redirect,response:_q(me,z,q[Te].route.id,Q,c,d.v7_relativeSplatPath)}}return Rq(Me)}))}catch(ae){return q.map(()=>({type:kt.error,error:ae}))}}async function tt(O,z,q,Q,ae){let[Me,...Te]=await Promise.all([q.length?pe("loader",ae,q,z):[],...Q.map(me=>{if(me.matches&&me.match&&me.controller){let $e=ta(e.history,me.path,me.controller.signal);return pe("loader",$e,[me.match],me.matches).then(Oe=>Oe[0])}else return Promise.resolve({type:kt.error,error:mr(404,{pathname:me.path})})})]);return await Promise.all([Aw(O,q,Me,Me.map(()=>ae.signal),!1,C.loaderData),Aw(O,Q.map(me=>me.match),Te,Q.map(me=>me.controller?me.controller.signal:null),!0)]),{loaderResults:Me,fetcherResults:Te}}function Pt(){L=!0,I.push(...Bs()),ye.forEach((O,z)=>{R.has(z)&&(k.push(z),ln(z))})}function yt(O,z,q){q===void 0&&(q={}),C.fetchers.set(O,z),We({fetchers:new Map(C.fetchers)},{flushSync:(q&&q.flushSync)===!0})}function Lt(O,z,q,Q){Q===void 0&&(Q={});let ae=ql(C.matches,z);vn(O),We({errors:{[ae.route.id]:q},fetchers:new Map(C.fetchers)},{flushSync:(Q&&Q.flushSync)===!0})}function Kt(O){return d.v7_fetcherPersist&&(he.set(O,(he.get(O)||0)+1),be.has(O)&&be.delete(O)),C.fetchers.get(O)||bq}function vn(O){let z=C.fetchers.get(O);R.has(O)&&!(z&&z.state==="loading"&&H.has(O))&&ln(O),ye.delete(O),H.delete(O),X.delete(O),be.delete(O),C.fetchers.delete(O)}function go(O){if(d.v7_fetcherPersist){let z=(he.get(O)||0)-1;z<=0?(he.delete(O),be.add(O)):he.set(O,z)}else vn(O);We({fetchers:new Map(C.fetchers)})}function ln(O){let z=R.get(O);Be(z,"Expected fetch controller: "+O),z.abort(),R.delete(O)}function Jo(O){for(let z of O){let q=Kt(z),Q=oi(q.data);C.fetchers.set(z,Q)}}function zs(){let O=[],z=!1;for(let q of X){let Q=C.fetchers.get(q);Be(Q,"Expected fetcher: "+q),Q.state==="loading"&&(X.delete(q),O.push(q),z=!0)}return Jo(O),z}function hu(O){let z=[];for(let[q,Q]of H)if(Q<O){let ae=C.fetchers.get(q);Be(ae,"Expected fetcher: "+q),ae.state==="loading"&&(ln(q),H.delete(q),z.push(q))}return Jo(z),z.length>0}function Rh(O,z){let q=C.blockers.get(O)||Tl;return Ce.get(O)!==z&&Ce.set(O,z),q}function ur(O){C.blockers.delete(O),Ce.delete(O)}function Zo(O,z){let q=C.blockers.get(O)||Tl;Be(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 Q=new Map(C.blockers);Q.set(O,z),We({blockers:Q})}function pu(O){let{currentLocation:z,nextLocation:q,historyAction:Q}=O;if(Ce.size===0)return;Ce.size>1&&qa(!1,"A router only supports one blocker at a time");let ae=Array.from(Ce.entries()),[Me,Te]=ae[ae.length-1],me=C.blockers.get(Me);if(!(me&&me.state==="proceeding")&&Te({currentLocation:z,nextLocation:q,historyAction:Q}))return Me}function Bs(O){let z=[];return ke.forEach((q,Q)=>{(!O||O(Q))&&(q.cancel(),z.push(Q),ke.delete(Q))}),z}function fl(O,z,q){if(m=O,v=z,g=q||null,!S&&C.navigation===Ip){S=!0;let Q=Tn(C.location,C.matches);Q!=null&&We({restoreScrollPosition:Q})}return()=>{m=null,v=null,g=null}}function Vs(O,z){return g&&g(O,z.map(Q=>YW(Q,C.loaderData)))||O.key}function ei(O,z){if(m&&v){let q=Vs(O,z);m[q]=v()}}function Tn(O,z){if(m){let q=Vs(O,z),Q=m[q];if(typeof Q=="number")return Q}return null}function _h(O){i={},l=dg(O,o,void 0,i)}return E={get basename(){return c},get future(){return d},get state(){return C},get routes(){return a},get window(){return t},initialize:Ve,subscribe:lt,enableScrollRestoration:fl,navigate:Pe,fetch:Ke,revalidate:ee,createHref:O=>e.history.createHref(O),encodeLocation:O=>e.history.encodeLocation(O),getFetcher:Kt,deleteFetcher:go,dispose:ut,getBlocker:Rh,deleteBlocker:ur,_internalFetchControllers:R,_internalActiveDeferreds:ke,_internalSetRoutes:_h},E}function jq(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function fg(e,t,n,r,o,i,a,l){let c,u;if(a){c=[];for(let f of t)if(c.push(f),f.route.id===a){u=f;break}}else c=t,u=t[t.length-1];let d=OR(o||".",MR(c,i),uu(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&&!Jx(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Ei([n,d.pathname])),cu(d)}function Sw(e,t,n,r){if(!r||!jq(r))return{path:n};if(r.formMethod&&!Mq(r.formMethod))return{path:n,error:mr(405,{method:r.formMethod})};let o=()=>({path:n,error:mr(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=zR(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Or(a))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[v,S]=g;return""+m+v+"="+S+`
|
|
534
|
+
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Or(a))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}Be(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=hg(r.formData),u=r.formData;else if(r.body instanceof FormData)c=hg(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=Pw(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=Pw(c)}catch{return o()}let d={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Or(d.formMethod))return{path:n,submission:d};let f=Yo(n);return t&&f.search&&Jx(f.search)&&c.append("index",""),f.search="?"+c,{path:cu(f),submission:d}}function Cq(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 jw(e,t,n,r,o,i,a,l,c,u,d,f,h,m,g,v){let S=v?yr(v[1])?v[1].error:v[1].data:void 0,y=e.createURL(t.location),b=e.createURL(o),x=v&&yr(v[1])?v[0]:void 0,w=x?Cq(n,x):n,j=v?v[1].statusCode:void 0,E=a&&j&&j>=400,C=w.filter((_,P)=>{let{route:M}=_;if(M.lazy)return!0;if(M.loader==null)return!1;if(i)return typeof M.loader!="function"||M.loader.hydrate?!0:t.loaderData[M.id]===void 0&&(!t.errors||t.errors[M.id]===void 0);if(Eq(t.loaderData,t.matches[P],_)||c.some(A=>A===_.route.id))return!0;let D=t.matches[P],N=_;return Cw(_,At({currentUrl:y,currentParams:D.params,nextUrl:b,nextParams:N.params},r,{actionResult:S,unstable_actionStatus:j,defaultShouldRevalidate:E?!1:l||y.pathname+y.search===b.pathname+b.search||y.search!==b.search||FR(D,N)}))}),T=[];return f.forEach((_,P)=>{if(i||!n.some(L=>L.route.id===_.routeId)||d.has(P))return;let M=xa(m,_.path,g);if(!M){T.push({key:P,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let D=t.fetchers.get(P),N=pg(M,_.path),A=!1;h.has(P)?A=!1:u.includes(P)?A=!0:D&&D.state!=="idle"&&D.data===void 0?A=l:A=Cw(N,At({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:b,nextParams:n[n.length-1].params},r,{actionResult:S,unstable_actionStatus:j,defaultShouldRevalidate:E?!1:l})),A&&T.push({key:P,routeId:_.routeId,path:_.path,matches:M,match:N,controller:new AbortController})}),[C,T]}function Eq(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function FR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Cw(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Ew(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Be(o,"No route found in manifest");let i={};for(let a in r){let c=o[a]!==void 0&&a!=="hasErrorBoundary";qa(!c,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!QW.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,At({},t(o),{lazy:void 0}))}function Tq(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function Pq(e,t,n,r,o,i,a,l){let c=r.reduce((f,h)=>f.add(h.route.id),new Set),u=new Set,d=await e({matches:o.map(f=>{let h=c.has(f.route.id);return At({},f,{shouldLoad:h,resolve:g=>(u.add(f.route.id),h?kq(t,n,f,i,a,g,l):Promise.resolve({type:kt.data,result:void 0}))})}),request:n,params:o[0].params,context:l});return o.forEach(f=>Be(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,h)=>c.has(o[h].route.id))}async function kq(e,t,n,r,o,i,a){let l,c,u=d=>{let f,h=new Promise((v,S)=>f=S);c=()=>f(),t.signal.addEventListener("abort",c);let m=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:a},...v!==void 0?[v]:[]),g;return i?g=i(v=>m(v)):g=(async()=>{try{return{type:"data",result:await m()}}catch(v){return{type:"error",result:v}}})(),Promise.race([g,h])};try{let d=n.route[e];if(n.route.lazy)if(d){let f,[h]=await Promise.all([u(d).catch(m=>{f=m}),Ew(n.route,o,r)]);if(f!==void 0)throw f;l=h}else if(await Ew(n.route,o,r),d=n.route[e],d)l=await u(d);else if(e==="action"){let f=new URL(t.url),h=f.pathname+f.search;throw mr(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:kt.data,result:void 0};else if(d)l=await u(d);else{let f=new URL(t.url),h=f.pathname+f.search;throw mr(404,{pathname:h})}Be(l.result!==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(d){return{type:kt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return l}async function Rq(e){let{result:t,type:n,status:r}=e;if(BR(t)){let a;try{let l=t.headers.get("Content-Type");l&&/\bapplication\/json\b/.test(l)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(l){return{type:kt.error,error:l}}return n===kt.error?{type:kt.error,error:new Kx(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:kt.data,data:a,statusCode:t.status,headers:t.headers}}if(n===kt.error)return{type:kt.error,error:t,statusCode:Yx(t)?t.status:r};if(Nq(t)){var o,i;return{type:kt.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}return{type:kt.data,data:t,statusCode:r}}function _q(e,t,n,r,o,i){let a=e.headers.get("Location");if(Be(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Xx.test(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=fg(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function Tw(e,t,n){if(Xx.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=uu(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function ta(e,t,n,r){let o=e.createURL(zR(t)).toString(),i={signal:n};if(r&&Or(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.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=hg(r.formData):i.body=r.formData}return new Request(o,i)}function hg(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Pw(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function Dq(e,t,n,r,o,i){let a={},l=null,c,u=!1,d={},f=r&&yr(r[1])?r[1].error:void 0;return n.forEach((h,m)=>{let g=t[m].route.id;if(Be(!rs(h),"Cannot handle redirect results in processLoaderData"),yr(h)){let v=h.error;f!==void 0&&(v=f,f=void 0),l=l||{};{let S=ql(e,g);l[S.route.id]==null&&(l[S.route.id]=v)}a[g]=void 0,u||(u=!0,c=Yx(h.error)?h.error.status:500),h.headers&&(d[g]=h.headers)}else ns(h)?(o.set(g,h.deferredData),a[g]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[g]=h.headers)):(a[g]=h.data,h.statusCode&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[g]=h.headers))}),f!==void 0&&r&&(l={[r[0]]:f},a[r[0]]=void 0),{loaderData:a,errors:l,statusCode:c||200,loaderHeaders:d}}function kw(e,t,n,r,o,i,a,l){let{loaderData:c,errors:u}=Dq(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:m}=i[d];Be(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let g=a[d];if(!(m&&m.signal.aborted))if(yr(g)){let v=ql(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=At({},u,{[v.route.id]:g.error})),e.fetchers.delete(f)}else if(rs(g))Be(!1,"Unhandled fetcher revalidation redirect");else if(ns(g))Be(!1,"Unhandled fetcher deferred data");else{let v=oi(g.data);e.fetchers.set(f,v)}}return{loaderData:c,errors:u}}function Rw(e,t,n,r){let o=At({},t);for(let i of n){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),r&&r.hasOwnProperty(a))break}return o}function _w(e){return e?yr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ql(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 Dw(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 mr(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="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?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="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 Kx(e||500,a,new Error(l),!0)}function Iw(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(rs(n))return{result:n,idx:t}}}function zR(e){let t=typeof e=="string"?Yo(e):e;return cu(At({},t,{hash:""}))}function Iq(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function Aq(e){return BR(e.result)&&yq.has(e.result.status)}function ns(e){return e.type===kt.deferred}function yr(e){return e.type===kt.error}function rs(e){return(e&&e.type)===kt.redirect}function Nq(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 BR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Mq(e){return vq.has(e.toLowerCase())}function Or(e){return mq.has(e.toLowerCase())}async function Aw(e,t,n,r,o,i){for(let a=0;a<n.length;a++){let l=n[a],c=t[a];if(!c)continue;let u=e.find(f=>f.route.id===c.route.id),d=u!=null&&!FR(u,c)&&(i&&i[c.route.id])!==void 0;if(ns(l)&&(o||d)){let f=r[a];Be(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await VR(l,f,o).then(h=>{h&&(n[a]=h||n[a])})}}}async function VR(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:kt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:kt.error,error:o}}return{type:kt.data,data:e.deferredData.data}}}function Jx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function pg(e,t){let n=typeof t=="string"?Yo(t).search:t.search;if(e[e.length-1].route.index&&Jx(n||""))return e[e.length-1];let r=NR(e);return r[r.length-1]}function Nw(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=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(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function Ap(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 Oq(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 Pl(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 $q(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 oi(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 Lq(e,t){try{let n=e.sessionStorage.getItem(LR);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 Fq(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(LR,JSON.stringify(n))}catch(r){qa(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
535
|
+
* React Router v6.23.1
|
|
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 Tc(){return Tc=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},Tc.apply(this,arguments)}const Sh=p.createContext(null),UR=p.createContext(null),jh=p.createContext(null),Ch=p.createContext(null),zi=p.createContext({outlet:null,matches:[],isDataRoute:!1}),HR=p.createContext(null);function Eh(){return p.useContext(Ch)!=null}function Xo(){return Eh()||Be(!1),p.useContext(Ch).location}function WR(e){p.useContext(jh).static||p.useLayoutEffect(e)}function Vt(){let{isDataRoute:e}=p.useContext(zi);return e?Zq():zq()}function zq(){Eh()||Be(!1);let e=p.useContext(Sh),{basename:t,future:n,navigator:r}=p.useContext(jh),{matches:o}=p.useContext(zi),{pathname:i}=Xo(),a=JSON.stringify(MR(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return WR(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=OR(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ei([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const Bq=p.createContext(null);function Vq(e){let t=p.useContext(zi).outlet;return t&&p.createElement(Bq.Provider,{value:e},t)}function it(){let{matches:e}=p.useContext(zi),t=e[e.length-1];return t?t.params:{}}function Uq(e,t){return qR(e,t)}function qR(e,t,n,r){Eh()||Be(!1);let{navigator:o}=p.useContext(jh),{matches:i}=p.useContext(zi),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=Xo(),d;if(t){var f;let S=typeof t=="string"?Yo(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||Be(!1),d=S}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=xa(e,{pathname:m}),v=Qq(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Ei([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:Ei([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?p.createElement(Ch.Provider,{value:{location:Tc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Ut.Pop}},v):v}function Hq(){let e=Jq(),t=Yx(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const Wq=p.createElement(Hq,null);class qq extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(zi.Provider,{value:this.props.routeContext},p.createElement(HR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Gq(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(Sh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(zi.Provider,{value:t},r)}function Qq(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 a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Be(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,h)=>{let m,g=!1,v=null,S=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||Wq,c&&(u<0&&h===0?(eG("route-fallback"),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,h+1)),b=()=>{let x;return m?x=v:g?x=S:f.route.Component?x=p.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,p.createElement(Gq,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(qq,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:b(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):b()},null)}var GR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(GR||{}),rf=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}(rf||{});function Kq(e){let t=p.useContext(Sh);return t||Be(!1),t}function Yq(e){let t=p.useContext(UR);return t||Be(!1),t}function Xq(e){let t=p.useContext(zi);return t||Be(!1),t}function QR(e){let t=Xq(),n=t.matches[t.matches.length-1];return n.route.id||Be(!1),n.route.id}function Jq(){var e;let t=p.useContext(HR),n=Yq(rf.UseRouteError),r=QR(rf.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Zq(){let{router:e}=Kq(GR.UseNavigateStable),t=QR(rf.UseNavigateStable),n=p.useRef(!1);return WR(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Tc({fromRouteId:t},i)))},[e,t])}const Mw={};function eG(e,t,n){Mw[e]||(Mw[e]=!0)}function Zx(e){return Vq(e.context)}function xe(e){Be(!1)}function tG(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Ut.Pop,navigator:i,static:a=!1,future:l}=e;Eh()&&Be(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:a,future:Tc({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=Yo(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,v=p.useMemo(()=>{let S=uu(d,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:m,key:g},navigationType:o}},[c,d,f,h,m,g,o]);return v==null?null:p.createElement(jh.Provider,{value:u},p.createElement(Ch.Provider,{children:n,value:v}))}function nG(e){let{children:t,location:n}=e;return Uq(mg(t),n)}new Promise(()=>{});function mg(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,o)=>{if(!p.isValidElement(r))return;let i=[...t,o];if(r.type===p.Fragment){n.push.apply(n,mg(r.props.children,i));return}r.type!==xe&&Be(!1),!r.props.index||!r.props.children||Be(!1);let a={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&&(a.children=mg(r.props.children,i)),n.push(a)}),n}function rG(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
544
|
+
* React Router DOM v6.23.1
|
|
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 of(){return of=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},of.apply(this,arguments)}function gg(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 oG(e,t){let n=gg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const iG="6";try{window.__reactRouterVersion=iG}catch{}function sG(e,t){return Sq({basename:void 0,future:of({},void 0,{v7_prependBasename:!0}),history:WW({window:void 0}),hydrationData:aG(),routes:e,mapRouteProperties:rG,unstable_dataStrategy:void 0,window:void 0}).initialize()}function aG(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=of({},t,{errors:lG(t.errors)})),t}function lG(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 Kx(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 a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const cG=p.createContext({isTransitioning:!1}),uG=p.createContext(new Map),dG="startTransition",Ow=hS[dG],fG="flushSync",$w=lN[fG];function hG(e){Ow?Ow(e):e()}function kl(e){$w?$w(e):e()}class pG{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 mG(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[a,l]=p.useState(),[c,u]=p.useState({isTransitioning:!1}),[d,f]=p.useState(),[h,m]=p.useState(),[g,v]=p.useState(),S=p.useRef(new Map),{v7_startTransition:y}=r||{},b=p.useCallback(C=>{y?hG(C):C()},[y]),x=p.useCallback((C,T)=>{let{deletedFetchers:_,unstable_flushSync:P,unstable_viewTransitionOpts:M}=T;_.forEach(N=>S.current.delete(N)),C.fetchers.forEach((N,A)=>{N.data!==void 0&&S.current.set(A,N.data)});let D=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!M||D){P?kl(()=>i(C)):b(()=>i(C));return}if(P){kl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let N=n.window.document.startViewTransition(()=>{kl(()=>i(C))});N.finished.finally(()=>{kl(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),kl(()=>m(N));return}h?(d&&d.resolve(),h.skipTransition(),v({state:C,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(l(C),u({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[n.window,h,d,S,b]);p.useLayoutEffect(()=>n.subscribe(x),[n,x]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new pG)},[c]),p.useEffect(()=>{if(d&&a&&n.window){let C=a,T=d.promise,_=n.window.document.startViewTransition(async()=>{b(()=>i(C)),await T});_.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(_)}},[b,a,d,n.window]),p.useEffect(()=>{d&&a&&o.location.key===a.location.key&&d.resolve()},[d,h,o.location,a]),p.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[c.isTransitioning,g]),p.useEffect(()=>{},[]);let w=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:C=>n.navigate(C),push:(C,T,_)=>n.navigate(C,{state:T,preventScrollReset:_==null?void 0:_.preventScrollReset}),replace:(C,T,_)=>n.navigate(C,{replace:!0,state:T,preventScrollReset:_==null?void 0:_.preventScrollReset})}),[n]),j=n.basename||"/",E=p.useMemo(()=>({router:n,navigator:w,static:!1,basename:j}),[n,w,j]);return p.createElement(p.Fragment,null,p.createElement(Sh.Provider,{value:E},p.createElement(UR.Provider,{value:o},p.createElement(uG.Provider,{value:S.current},p.createElement(cG.Provider,{value:c},p.createElement(tG,{basename:j,location:o.location,navigationType:o.historyAction,navigator:w,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?p.createElement(gG,{routes:n.routes,future:n.future,state:o}):t))))),null)}function gG(e){let{routes:t,future:n,state:r}=e;return qR(t,void 0,r,n)}var Lw;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Lw||(Lw={}));var Fw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Fw||(Fw={}));function e0(e){let t=p.useRef(gg(e)),n=p.useRef(!1),r=Xo(),o=p.useMemo(()=>oG(r.search,n.current?null:t.current),[r.search]),i=Vt(),a=p.useCallback((l,c)=>{const u=gg(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,a]}const vG=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 du(e,t){const n=yG(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 yG(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=vG.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var dl=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(u){o(u)}},a=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const xG=[".DS_Store","Thumbs.db"];function bG(e){return dl(this,null,function*(){return sf(e)&&wG(e.dataTransfer)?EG(e.dataTransfer,e.type):SG(e)?jG(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?CG(e):[]})}function wG(e){return sf(e)}function SG(e){return sf(e)&&sf(e.target)}function sf(e){return typeof e=="object"&&e!==null}function jG(e){return vg(e.target.files).map(t=>du(t))}function CG(e){return dl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>du(n))})}function EG(e,t){return dl(this,null,function*(){if(e.items){const n=vg(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(TG));return zw(KR(r))}return zw(vg(e.files).map(n=>du(n)))})}function zw(e){return e.filter(t=>xG.indexOf(t.name)===-1)}function vg(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 TG(e){if(typeof e.webkitGetAsEntry!="function")return Bw(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?YR(t):Bw(e)}function KR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?KR(n):[n]],[])}function Bw(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=du(t);return Promise.resolve(n)}function PG(e){return dl(this,null,function*(){return e.isDirectory?YR(e):kG(e)})}function YR(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>dl(this,null,function*(){if(a.length){const l=Promise.all(a.map(PG));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),a=>{r(a)})}i()})}function kG(e){return dl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=du(r,e.fullPath);t(o)},r=>{n(r)})})})}function RG(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(a=>{const l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}var _G=Object.defineProperty,DG=Object.defineProperties,IG=Object.getOwnPropertyDescriptors,Vw=Object.getOwnPropertySymbols,AG=Object.prototype.hasOwnProperty,NG=Object.prototype.propertyIsEnumerable,Uw=(e,t,n)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MG=(e,t)=>{for(var n in t||(t={}))AG.call(t,n)&&Uw(e,n,t[n]);if(Vw)for(var n of Vw(t))NG.call(t,n)&&Uw(e,n,t[n]);return e},OG=(e,t)=>DG(e,IG(t));const $G="file-invalid-type",LG="file-too-large",FG="file-too-small",zG="too-many-files",BG=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:$G,message:`File type must be ${t}`}},Hw=e=>({code:LG,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),Ww=e=>({code:FG,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),VG={code:zG,message:"Too many files"};function XR(e,t){const n=e.type==="application/x-moz-file"||RG(e,t);return[n,n?null:BG(t)]}function JR(e,t,n){if(Yi(e.size))if(Yi(t)&&Yi(n)){if(e.size>n)return[!1,Hw(n)];if(e.size<t)return[!1,Ww(t)]}else{if(Yi(t)&&e.size<t)return[!1,Ww(t)];if(Yi(n)&&e.size>n)return[!1,Hw(n)]}return[!0,null]}function Yi(e){return e!=null}function UG({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:a}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(l=>{const[c]=XR(l,t),[u]=JR(l,n,r),d=a?a(l):null;return c&&u&&!d})}function af(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Gu(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 qw(e){e.preventDefault()}function HG(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function WG(e){return e.indexOf("Edge/")!==-1}function qG(e=window.navigator.userAgent){return HG(e)||WG(e)}function to(...e){return(t,...n)=>e.some(r=>(!af(t)&&r&&r(t,...n),af(t)))}function GG(){return"showOpenFilePicker"in window}function QG(e){return Yi(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return ZR(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(e2))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>OG(MG({},n),{[r]:o}),{})}]:e}function KG(e){if(Yi(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>ZR(t)||e2(t)).join(",")}function YG(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function XG(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ZR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function e2(e){return/^.*\.[\w]+$/.test(e)}var JG=Object.defineProperty,ZG=Object.defineProperties,eQ=Object.getOwnPropertyDescriptors,lf=Object.getOwnPropertySymbols,t2=Object.prototype.hasOwnProperty,n2=Object.prototype.propertyIsEnumerable,Gw=(e,t,n)=>t in e?JG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,_n=(e,t)=>{for(var n in t||(t={}))t2.call(t,n)&&Gw(e,n,t[n]);if(lf)for(var n of lf(t))n2.call(t,n)&&Gw(e,n,t[n]);return e},li=(e,t)=>ZG(e,eQ(t)),cf=(e,t)=>{var n={};for(var r in e)t2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lf)for(var r of lf(e))t.indexOf(r)<0&&n2.call(e,r)&&(n[r]=e[r]);return n};const t0=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=cf(n,["children"]);const i=o2(o),{open:a}=i,l=cf(i,["open"]);return p.useImperativeHandle(t,()=>({open:a}),[a]),on.createElement(p.Fragment,null,r(li(_n({},l),{open:a})))});t0.displayName="Dropzone";const r2={disabled:!1,getFilesFromEvent:bG,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};t0.defaultProps=r2;t0.propTypes={children:ft.func,accept:ft.objectOf(ft.arrayOf(ft.string)),multiple:ft.bool,preventDropOnDocument:ft.bool,noClick:ft.bool,noKeyboard:ft.bool,noDrag:ft.bool,noDragEventsBubbling:ft.bool,minSize:ft.number,maxSize:ft.number,maxFiles:ft.number,disabled:ft.bool,getFilesFromEvent:ft.func,onFileDialogCancel:ft.func,onFileDialogOpen:ft.func,useFsAccessApi:ft.bool,autoFocus:ft.bool,onDragEnter:ft.func,onDragLeave:ft.func,onDragOver:ft.func,onDrop:ft.func,onDropAccepted:ft.func,onDropRejected:ft.func,onError:ft.func,validator:ft.func};const yg={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function o2(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:a,maxFiles:l,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:f,onDropAccepted:h,onDropRejected:m,onFileDialogCancel:g,onFileDialogOpen:v,useFsAccessApi:S,autoFocus:y,preventDropOnDocument:b,noClick:x,noKeyboard:w,noDrag:j,noDragEventsBubbling:E,onError:C,validator:T}=_n(_n({},r2),e),_=p.useMemo(()=>KG(t),[t]),P=p.useMemo(()=>QG(t),[t]),M=p.useMemo(()=>typeof v=="function"?v:Qw,[v]),D=p.useMemo(()=>typeof g=="function"?g:Qw,[g]),N=p.useRef(null),A=p.useRef(null),[L,I]=p.useReducer(tQ,yg),{isFocused:k,isFileDialogActive:R}=L,$=p.useRef(typeof window<"u"&&window.isSecureContext&&S&&GG()),B=()=>{!$.current&&R&&setTimeout(()=>{if(A.current){const{files:Y}=A.current;Y.length||(I({type:"closeDialog"}),D())}},300)};p.useEffect(()=>(window.addEventListener("focus",B,!1),()=>{window.removeEventListener("focus",B,!1)}),[A,R,D,$]);const H=p.useRef([]),X=Y=>{N.current&&N.current.contains(Y.target)||(Y.preventDefault(),H.current=[])};p.useEffect(()=>(b&&(document.addEventListener("dragover",qw,!1),document.addEventListener("drop",X,!1)),()=>{b&&(document.removeEventListener("dragover",qw),document.removeEventListener("drop",X))}),[N,b]),p.useEffect(()=>(!n&&y&&N.current&&N.current.focus(),()=>{}),[N,y,n]);const ye=p.useCallback(Y=>{C?C(Y):console.error(Y)},[C]),he=p.useCallback(Y=>{Y.preventDefault(),Y.persist(),Se(Y),H.current=[...H.current,Y.target],Gu(Y)&&Promise.resolve(r(Y)).then(G=>{if(af(Y)&&!E)return;const pe=G.length,tt=pe>0&&UG({files:G,accept:_,minSize:i,maxSize:o,multiple:a,maxFiles:l,validator:T}),Pt=pe>0&&!tt;I({isDragAccept:tt,isDragReject:Pt,isDragActive:!0,type:"setDraggedFiles"}),c&&c(Y)}).catch(G=>ye(G))},[r,c,ye,E,_,i,o,a,l,T]),be=p.useCallback(Y=>{Y.preventDefault(),Y.persist(),Se(Y);const G=Gu(Y);if(G&&Y.dataTransfer)try{Y.dataTransfer.dropEffect="copy"}catch{}return G&&d&&d(Y),!1},[d,E]),ke=p.useCallback(Y=>{Y.preventDefault(),Y.persist(),Se(Y);const G=H.current.filter(tt=>N.current&&N.current.contains(tt)),pe=G.indexOf(Y.target);pe!==-1&&G.splice(pe,1),H.current=G,!(G.length>0)&&(I({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Gu(Y)&&u&&u(Y))},[N,u,E]),Ce=p.useCallback((Y,G)=>{const pe=[],tt=[];Y.forEach(Pt=>{const[yt,Lt]=XR(Pt,_),[Kt,vn]=JR(Pt,i,o),go=T?T(Pt):null;if(yt&&Kt&&!go)pe.push(Pt);else{let ln=[Lt,vn];go&&(ln=ln.concat(go)),tt.push({file:Pt,errors:ln.filter(Jo=>Jo)})}}),(!a&&pe.length>1||a&&l>=1&&pe.length>l)&&(pe.forEach(Pt=>{tt.push({file:Pt,errors:[VG]})}),pe.splice(0)),I({acceptedFiles:pe,fileRejections:tt,type:"setFiles"}),f&&f(pe,tt,G),tt.length>0&&m&&m(tt,G),pe.length>0&&h&&h(pe,G)},[I,a,_,i,o,l,f,h,m,T]),se=p.useCallback(Y=>{Y.preventDefault(),Y.persist(),Se(Y),H.current=[],Gu(Y)&&Promise.resolve(r(Y)).then(G=>{af(Y)&&!E||Ce(G,Y)}).catch(G=>ye(G)),I({type:"reset"})},[r,Ce,ye,E]),Ve=p.useCallback(()=>{if($.current){I({type:"openDialog"}),M();const Y={multiple:a,types:P};window.showOpenFilePicker(Y).then(G=>r(G)).then(G=>{Ce(G,null),I({type:"closeDialog"})}).catch(G=>{YG(G)?(D(G),I({type:"closeDialog"})):XG(G)?($.current=!1,A.current?(A.current.value=null,A.current.click()):ye(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."))):ye(G)});return}A.current&&(I({type:"openDialog"}),M(),A.current.value=null,A.current.click())},[I,M,D,S,Ce,ye,P,a]),ut=p.useCallback(Y=>{!N.current||!N.current.isEqualNode(Y.target)||(Y.key===" "||Y.key==="Enter"||Y.keyCode===32||Y.keyCode===13)&&(Y.preventDefault(),Ve())},[N,Ve]),lt=p.useCallback(()=>{I({type:"focus"})},[]),We=p.useCallback(()=>{I({type:"blur"})},[]),Ee=p.useCallback(()=>{x||(qG()?setTimeout(Ve,0):Ve())},[x,Ve]),Pe=Y=>n?null:Y,ee=Y=>w?null:Pe(Y),ne=Y=>j?null:Pe(Y),Se=Y=>{E&&Y.stopPropagation()},qe=p.useMemo(()=>(Y={})=>{var G=Y,{refKey:pe="ref",role:tt,onKeyDown:Pt,onFocus:yt,onBlur:Lt,onClick:Kt,onDragEnter:vn,onDragOver:go,onDragLeave:ln,onDrop:Jo}=G,zs=cf(G,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return _n(_n({onKeyDown:ee(to(Pt,ut)),onFocus:ee(to(yt,lt)),onBlur:ee(to(Lt,We)),onClick:Pe(to(Kt,Ee)),onDragEnter:ne(to(vn,he)),onDragOver:ne(to(go,be)),onDragLeave:ne(to(ln,ke)),onDrop:ne(to(Jo,se)),role:typeof tt=="string"&&tt!==""?tt:"presentation",[pe]:N},!n&&!w?{tabIndex:0}:{}),zs)},[N,ut,lt,We,Ee,he,be,ke,se,w,j,n]),Ke=p.useCallback(Y=>{Y.stopPropagation()},[]),Le=p.useMemo(()=>(Y={})=>{var G=Y,{refKey:pe="ref",onChange:tt,onClick:Pt}=G,yt=cf(G,["refKey","onChange","onClick"]);const Lt={accept:_,multiple:a,type:"file",style:{display:"none"},onChange:Pe(to(tt,se)),onClick:Pe(to(Pt,Ke)),tabIndex:-1,[pe]:A};return _n(_n({},Lt),yt)},[A,t,a,se,n]);return li(_n({},L),{isFocused:k&&!n,getRootProps:qe,getInputProps:Le,rootRef:N,inputRef:A,open:Pe(Ve)})}function tQ(e,t){switch(t.type){case"focus":return li(_n({},e),{isFocused:!0});case"blur":return li(_n({},e),{isFocused:!1});case"openDialog":return li(_n({},yg),{isFileDialogActive:!0});case"closeDialog":return li(_n({},e),{isFileDialogActive:!1});case"setDraggedFiles":return li(_n({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return li(_n({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return _n({},yg);default:return e}}function Qw(){}const[nQ,rQ]=On("Dropzone component was not found in tree");function n0(e){const t=n=>{const{children:r,...o}=V(`Dropzone${v0(e)}`,{},n),i=rQ(),a=Fo(r)?r:s.jsx("span",{children:r});return i[e]?p.cloneElement(a,o):null};return t.displayName=`@mantine/dropzone/${v0(e)}`,t}const oQ=n0("accept"),iQ=n0("reject"),sQ=n0("idle");var Pc={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const aQ={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},lQ=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),a=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":ot(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":a.color,"--dropzone-reject-bg":a.background}}},Bi=K((e,t)=>{const n=V("Dropzone",aQ,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:m,accept:g,children:v,onDropAny:S,onDrop:y,onReject:b,openRef:x,name:w,maxFiles:j,autoFocus:E,activateOnClick:C,activateOnDrag:T,dragEventsBubbling:_,activateOnKeyboard:P,onDragEnter:M,onDragLeave:D,onDragOver:N,onFileDialogCancel:A,onFileDialogOpen:L,preventDropOnDocument:I,useFsAccessApi:k,getFilesFromEvent:R,validator:$,rejectColor:B,acceptColor:H,enablePointerEvents:X,loaderProps:ye,inputProps:he,mod:be,...ke}=n,Ce=le({name:"Dropzone",classes:Pc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:lQ}),{getRootProps:se,getInputProps:Ve,isDragAccept:ut,isDragReject:lt,open:We}=o2({onDrop:S,onDropAccepted:y,onDropRejected:b,disabled:d||f,accept:Array.isArray(g)?g.reduce((Pe,ee)=>({...Pe,[ee]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:j,autoFocus:E,noClick:!C,noDrag:!T,noDragEventsBubbling:!_,noKeyboard:!P,onDragEnter:M,onDragLeave:D,onDragOver:N,onFileDialogCancel:A,onFileDialogOpen:L,preventDropOnDocument:I,useFsAccessApi:k,validator:$,...R?{getFilesFromEvent:R}:null});pf(x,We);const Ee=!ut&&!lt;return s.jsx(nQ,{value:{accept:ut,reject:lt,idle:Ee},children:s.jsxs(W,{...se(),...Ce("root",{focusable:!0}),...ke,mod:[{accept:ut,reject:lt,idle:Ee,loading:f,"activate-on-click":C},be],children:[s.jsx(Ey,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:ye}),s.jsx("input",{...Ve(he),name:w}),s.jsx("div",{...Ce("inner"),ref:t,"data-enable-pointer-events":X||void 0,children:v})]})})});Bi.classes=Pc;Bi.displayName="@mantine/dropzone/Dropzone";Bi.Accept=oQ;Bi.Idle=sQ;Bi.Reject=iQ;const cQ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Gr("max"),withinPortal:!0},r0=K((e,t)=>{const n=V("DropzoneFullScreen",cQ,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:m,portalProps:g,...v}=n,S=le({name:"DropzoneFullScreen",classes:Pc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:y,resolvedStyles:b}=Rc({classNames:r,styles:a,props:n}),[x,w]=p.useState(0),[j,{open:E,close:C}]=AS(!1),T=P=>{var M;(M=P.dataTransfer)!=null&&M.types.includes("Files")&&(w(D=>D+1),E())},_=()=>{w(P=>P-1)};return p.useEffect(()=>{x===0&&C()},[x]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",T,!1),document.addEventListener("dragleave",_,!1),()=>{document.removeEventListener("dragenter",T,!1),document.removeEventListener("dragleave",_,!1)}},[u]),s.jsx(Rs,{...g,withinPortal:m,children:s.jsx(W,{...S("fullScreen",{style:{opacity:j?1:0,pointerEvents:j?"all":"none",zIndex:h}}),ref:t,children:s.jsx(Bi,{...v,classNames:y,styles:b,unstyled:l,className:Pc.dropzone,onDrop:P=>{d==null||d(P),C(),w(0)},onReject:P=>{f==null||f(P),C(),w(0)}})})})});r0.classes=Pc;r0.displayName="@mantine/dropzone/DropzoneFullScreen";Bi.FullScreen=r0;const Qu=Bi,uQ='{"resourceType": "Bundle"}';function Np({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:a="show",loading:l}){co[a]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function dQ(){const e=It(),t=ie(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";Np({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=QP(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),Np({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(Zc,{size:"1rem"}),withCloseButton:!0})}catch(d){Np({id:u,title:"Batch Upload Failed",color:"red",message:Ne(d),method:"update",icon:s.jsx(Jd,{size:"1rem"}),withCloseButton:!0})}},[t]),i=p.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var f;return o((f=d.target)==null?void 0:f.result,c.name)},u.readAsText(c)}},[o]),a=p.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return s.jsxs(De,{children:[s.jsx(de,{children:"Batch Create"}),s.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",s.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(Ze,{defaultValue:"upload",children:[s.jsxs(Ze.List,{children:[s.jsx(Ze.Tab,{value:"upload",children:"File Upload"}),s.jsx(Ze.Tab,{value:"json",children:"JSON"})]}),s.jsx(Ze.Panel,{value:"upload",pt:"xs",children:s.jsx(Qu,{onDrop:i,accept:["application/json"],children:s.jsxs(Z,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(Qu.Accept,{children:s.jsx(Zb,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(Qu.Reject,{children:s.jsx(Jd,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(Qu.Idle,{children:s.jsx(Zb,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(ue,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(ue,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Ze.Panel,{value:"json",pt:"xs",children:s.jsxs(Ge,{onSubmit:a,children:[s.jsx(tl,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:uQ,deserialize:JSON.parse}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Ze,{defaultValue:Object.keys(n)[0],children:[s.jsx(Ze.List,{children:Object.keys(n).map(l=>s.jsx(Ze.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>s.jsx(Ze.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{onClick:()=>r({}),children:"Start over"})})]})]})}function fQ(){const{resourceType:e}=it(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Ha("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(De,{children:[s.jsxs(de,{children:["No apps for ",e]}),s.jsx(He,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(De,{children:s.jsx("div",{children:r.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(He,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(Wr,{})}function hQ(){const e=ie(),[t,n]=p.useState(),[r,o]=p.useState(!1);return s.jsx(De,{width:450,children:s.jsxs(Ge,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>n(mt(a)))},children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Change password"})]}),!r&&s.jsxs(Ae,{gap:"xl",mt:"xl",children:[s.jsx(Vr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ye(t,"oldPassword")}),s.jsx(Vr,{name:"newPassword",label:"New password",required:!0,error:Ye(t,"newPassword")}),s.jsx(Vr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ye(t,"confirmPassword")}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const xg=["Form","JSON","Profiles"],pQ=["Profiles"],Mp=xg[0].toLowerCase();function mQ(){const e=Vt(),t=It(),{resourceType:n}=it(),[r,o]=p.useState(()=>{const a=window.location.pathname.split("/").pop();return a&&xg.map(l=>l.toLowerCase()).includes(a)?a:Mp});function i(a){a||(a=Mp),o(a),e(`/${n}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Wn,{children:[s.jsxs(ue,{p:"md",fw:500,children:["New ",n]}),s.jsx(Pr,{children:s.jsx(Ze,{defaultValue:Mp,value:r,onChange:i,children:s.jsx(Ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:xg.map(a=>s.jsx(Ze.Tab,{value:a.toLowerCase(),px:"md",children:pQ.includes(a)?s.jsxs(Z,{gap:"xs",wrap:"nowrap",children:[a,s.jsx(Bc,{color:t.primaryColor,size:"sm",children:"Beta"})]}):a},a))})})})]}),s.jsx(Zx,{})]})}function gQ(){return s.jsx(De,{children:s.jsxs(Ae,{children:[s.jsx(de,{order:1,children:"Unexpected Error"}),s.jsx(ue,{children:"We're sorry, something went wrong."}),s.jsxs(ue,{children:["Please contact ",s.jsx(Je,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const vQ="_root_1fbwr_1",yQ="_entry_1fbwr_8",xQ="_key_1fbwr_13",bQ="_value_1fbwr_20",Th={root:vQ,entry:yQ,key:xQ,value:bQ};function Fe(e){return s.jsx(Pr,{children:s.jsx("div",{className:Th.root,children:e.children})})}Fe.Entry=function(t){return s.jsx("div",{className:Th.entry,children:t.children})};Fe.Key=function(t){return s.jsx("div",{className:Th.key,children:t.children})};Fe.Value=function(t){return s.jsx("div",{className:Th.value,children:t.children})};function wQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function i2(e){var n,r;const t=vt(e.patient);return t?s.jsxs(Fe,{children:[s.jsx(Fi,{value:t,size:"lg",color:wQ(t)}),s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Name"}),s.jsx(Fe.Value,{children:s.jsx(He,{to:t,fw:500,children:t.name?s.jsx(Ex,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"DoB"}),s.jsx(Fe.Value,{children:t.birthDate})]}),s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Age"}),s.jsx(Fe.Value,{children:k7(t.birthDate)})]})]}),t.gender&&s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Gender"}),s.jsx(Fe.Value,{children:t.gender})]}),t.address&&s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"State"}),s.jsx(Fe.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:o==null?void 0:o.system}),s.jsx(Fe.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function s2(e){const t=vt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(He,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(a,l){a&&l&&n.push({key:a,value:l})}function o(a){a&&r(a.system,a.value)}function i(a,l){Array.isArray(l)?l.forEach(c=>i(a,c)):typeof l=="string"?r(a,l):l&&(Array.isArray(l.coding)?r(a,l.coding.map(c=>c.display||c.code).join(", ")):r(a,l.text))}if("name"in t){const a=$o(t);a!==St(t)&&r("Name",a)}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}),s.jsx(Fe,{children:n.map(a=>s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:a.key}),s.jsx(Fe.Value,{children:a.value})]},`${a.key}-${a.value}`))})}function o0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function SQ(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 hd(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:a})=>{o.port1.close(),a.error?r(a.error):n(a.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function Vi(e){var t;return uh((t=e.getActiveLogin())==null?void 0:t.project)}function jQ(e,t){const n=new Blob([e],{type:Jt.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const i=new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function CQ(){const{id:e}=it(),t=Xo(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=ie(),[i,a]=p.useState(!0),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState();if(p.useEffect(()=>{const x={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const w=r.split(",").filter(j=>!!j);w.length===1&&x.entry.push({request:{method:"GET",url:w[0]}}),d(w)}o.executeBatch(x).then(w=>{var j,E,C,T,_,P,M,D;((C=(E=(j=w.entry)==null?void 0:j[0])==null?void 0:E.response)==null?void 0:C.status)!=="200"?g((P=(_=(T=w.entry)==null?void 0:T[0])==null?void 0:_.response)==null?void 0:P.outcome):(c((M=w.entry[0])==null?void 0:M.resource),h((D=w.entry[1])==null?void 0:D.resource)),a(!1)}).catch(w=>{g(w),a(!1)})},[o,e,r]),m)return s.jsx(De,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(v)return s.jsxs(De,{children:[s.jsx(de,{children:l==null?void 0:l.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[v.length===1&&s.jsx("li",{children:s.jsx(He,{to:v[0],children:"Review your answers"})}),v.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:v.map(x=>s.jsx("li",{children:s.jsx(He,{to:x,children:St(x)})},x.id))})]}),f&&s.jsx("li",{children:s.jsxs(He,{to:f,children:["Back to ",$o(f)]})}),s.jsx("li",{children:s.jsx(He,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(Wr,{});const y=f&&o0(f);return s.jsxs(s.Fragment,{children:[s.jsxs(Wn,{shadow:"xs",radius:0,children:[y&&s.jsx(i2,{patient:y}),f&&f.resourceType!=="Patient"&&s.jsx(s2,{resource:f}),s.jsx(W,{px:"xl",py:"md",children:s.jsxs(ue,{children:[$o(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),s.jsx(De,{children:s.jsx(wR,{questionnaire:l,subject:f&&wt(f),onSubmit:b})})]});async function b(x){const w=[];if(!u||u.length===0)w.push(await o.createResource(x));else for(const j of u)w.push(await o.createResource({...x,subject:{reference:j}}));S(w)}}const EQ="_paper_unw9o_1",TQ={paper:EQ},PQ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function a2(e,t){const n=e.resourceType||kQ(t),r=e.fields??RQ(n),o=e.filters??(e.resourceType?void 0:_Q(n)),i=e.sortRules??DQ(n),a=e.offset??0,l=e.count??fh;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:a,count:l}}function kQ(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 RQ(e){const t=i0(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 _Q(e){var t;return(t=i0(e))==null?void 0:t.filters}function DQ(e){const t=i0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function i0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function IQ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function AQ(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=a2(n,t.getUserConfiguration()),o=await t.search(r.resourceType,va({...r,total:"accurate",fields:void 0}));return QP(o)}function Kw(){const e=ie(),t=Vt(),n=Xo(),[r,o]=p.useState();return p.useEffect(()=>{const i=UP(n.pathname+n.search),a=a2(i,e.getUserConfiguration());n.pathname===`/${a.resourceType}`&&n.search===va(a)?(IQ(a),o(a)):t(`/${a.resourceType}${va(a)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(Wr,{}):s.jsx(Wn,{shadow:"xs",m:"md",p:"xs",className:TQ.paper,children:s.jsx(lu,{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}${va(i.definition)}`)},onNew:()=>{t(PQ[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+va(r);e.download(i).then(a=>{window.open(window.URL.createObjectURL(a),"_blank")}).catch(a=>ve({color:"red",message:Ne(a),autoClose:!1}))},onExportTransactionBundle:async()=>{AQ(r,e).then(i=>jQ(JSON.stringify(i,void 0,2))).catch(i=>ve({color:"red",message:Ne(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(a=>({request:{method:"DELETE",url:`${r.resourceType}/${a}`}}))}).then(()=>o({...r})).catch(a=>ve({color:"red",message:Ne(a),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function NQ(){const e=ie(),[t,n]=p.useState(),[r,o]=p.useState(void 0);p.useEffect(()=>{e.get("auth/mfa/status").then(l=>{n(l.enrollQrCode),o(l.enrolled)}).catch(l=>ve({color:"red",message:Ne(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),ve({color:"green",message:"Success"})}).catch(c=>ve({color:"red",message:Ne(c),autoClose:!1}))},[e]),a=p.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?s.jsx(De,{children:s.jsxs(Z,{children:[s.jsx(de,{children:"MFA is enabled"}),s.jsx(oe,{onClick:a,children:"Disable MFA"})]})}):s.jsx(De,{width:400,children:s.jsxs(Ge,{onSubmit:i,children:[s.jsx(de,{children:"Multi Factor Auth Setup"}),s.jsx(dn,{children:s.jsx("img",{src:t})}),s.jsx(fe,{name:"token",label:"Code"}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Enroll"})})]})})}const bg={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function fu(){return bg}function l2(){try{return bg.registerEnabled!==!1&&bg.registerEnabled!=="false"}catch{return!0}}function MQ(){const e=Vt(),[t]=e0(),n=t.get("client_id");if(!n)return null;const r=t.get("scope")||"openid";function o(i){const a=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&a.searchParams.set(l,t.get(l));a.searchParams.set("code",i),window.location.assign(a.toString())}return s.jsxs(_R,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:fu().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:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Sign in to Medplum"})]})}function OQ(){const e=ie(),t=Vt(),n=fu();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),l2()?s.jsxs($W,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Create a new account"})]}):s.jsx(De,{width:450,children:s.jsx($i,{icon:s.jsx(al,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function $Q(){const e=Vt(),t=ie(),[n,r]=p.useState(),[o,i]=p.useState(!1),a=fu().recaptchaSiteKey;return p.useEffect(()=>{kR(a)},[a]),s.jsx(De,{width:450,children:s.jsxs(Ge,{onSubmit:async l=>{let c="";c=await RR(a),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(mt(u)))},children:[s.jsxs(Ae,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Medplum Password Reset"})]}),s.jsxs(Ae,{gap:"xl",children:[s.jsx(Xr,{issues:ou(n,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(fe,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ye(n,"email")}),s.jsxs(Z,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Je,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(oe,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function LQ(){var i;const e=Vt(),t=ie(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me").then(r).catch(a=>ve({color:"red",message:Ne(a),autoClose:!1}))},[t]);function o(a){t.post("auth/revoke",{loginId:a}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>ve({color:"green",message:"Login revoked"})).catch(l=>ve({color:"red",message:Ne(l),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(De,{children:[s.jsx(de,{children:"Security"}),s.jsxs(Rx,{children:[s.jsx(ko,{term:"ID",children:s.jsx(Je,{href:`/${St(n.profile)}`,children:n.profile.id})}),s.jsx(ko,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(ko,{term:"Name",children:Jc((i=n.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(De,{children:[s.jsx(de,{children:"Sessions"}),s.jsxs(ce,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(a=>s.jsxs("tr",{children:[s.jsx("td",{children:a.os}),s.jsx("td",{children:a.browser}),s.jsx("td",{children:a.remoteAddress}),s.jsx("td",{children:a.authMethod}),s.jsx("td",{children:Nn(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Je,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(De,{children:[s.jsx(de,{children:"Password"}),s.jsx(oe,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(De,{children:[s.jsx(de,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(oe,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function FQ(){const{id:e,secret:t}=it(),n=ie(),[r,o]=p.useState(),[i,a]=p.useState(!1),l=ou(r,void 0);return s.jsxs(De,{width:450,children:[s.jsx(Xr,{issues:l}),s.jsxs(Ge,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(Ci("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>a(!0)).catch(d=>o(mt(d)))},children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Set password"})]}),!i&&s.jsxs(Ae,{children:[s.jsx(Vr,{name:"password",label:"New password",required:!0,error:Ye(r,"password")}),s.jsx(Vr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ye(r,"confirmPassword")}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Set password"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(He,{to:"/signin",children:"sign in"}),"."]})]})]})}function zQ(){const e=gh(),t=Vt(),[n]=e0(),r=fu(),o=p.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return p.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),s.jsxs(_R,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:l2()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(Yr,{size:32}),s.jsx(de,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function BQ(){const e=Vt(),t=Xo(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState();return p.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());r(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!n||!o||!a?null:s.jsx(VU,{resourceType:n,checkboxesEnabled:!0,query:o,fields:a,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 Ph(e){const t=ie(),n=Vi(t),r=Vt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:te.EQUALS,value:"Project/"+n},{code:"profile-type",operator:te.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(lu,{search:o,onClick:a=>r(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function VQ(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Bots"}),s.jsx(Ph,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(He,{to:"/admin/bots/new",children:"Create new bot"})})]})}function UQ(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Clients"}),s.jsx(Ph,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(He,{to:"/admin/clients/new",children:"Create new client"})})]})}function kh(e){return s.jsx(ll,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Ko(t)?e.onChange(wt(t)):e.onChange(void 0)}})}function HQ(){const e=ie(),t=Vi(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[a,l]=p.useState(),[c,u]=p.useState(),[d,f]=p.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Create new Bot"}),s.jsxs(Ge,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:a};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(m),ve({color:"green",message:"Bot created"})}).catch(m=>{ve({color:"red",message:Ne(m),autoClose:!1}),u(mt(m))})},children:[!d&&s.jsxs(Ae,{children:[s.jsx(ht,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(fe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Ye(c,"name")})}),s.jsx(ht,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(fe,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Ye(c,"description")})}),s.jsx(ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(kh,{name:"accessPolicy",onChange:l})}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(ue,{children:"Bot created"}),s.jsxs(In,{children:[s.jsx(In.Item,{children:s.jsx(He,{to:d,children:"Go to new bot"})}),s.jsx(In.Item,{children:s.jsx(He,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function WQ(){const e=ie(),t=Vi(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(),[d,f]=p.useState(),[h,m]=p.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Create new Client"}),s.jsxs(Ge,{onSubmit:()=>{const g={name:n,description:o,redirectUri:a,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(v=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(v),ve({color:"green",message:"Client created"})}).catch(v=>{ve({color:"red",message:Ne(v),autoClose:!1}),f(mt(v))})},children:[!h&&s.jsxs(Ae,{children:[s.jsx(ht,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(fe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Ye(d,"name")})}),s.jsx(ht,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(fe,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Ye(d,"description")})}),s.jsx(ht,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(fe,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Ye(d,"redirectUri")})}),s.jsx(ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(kh,{name:"accessPolicy",onChange:u})}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(ue,{children:"Client created"}),s.jsxs(In,{children:[s.jsx(In.Item,{children:s.jsx(He,{to:h,children:"Go to new client"})}),s.jsx(In.Item,{children:s.jsx(He,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function qQ(e){return s.jsx(ll,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Ko(t)?e.onChange(wt(t)):e.onChange(void 0)}})}function GQ(){const{membershipId:e}=it(),t=ie(),n=Vi(t),r=Vt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,a]=p.useState(o.accessPolicy),[l,c]=p.useState(o.userConfiguration),[u,d]=p.useState(o.admin),[f,h]=p.useState(),[m,g]=p.useState(!1);function 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(mt(S)))}return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(Ra,{value:o.profile,link:!0})}),s.jsxs(Ge,{onSubmit:()=>{const S={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,S).then(()=>g(!0)).catch(y=>h(mt(y)))},children:[!m&&s.jsxs(Ae,{children:[s.jsx(ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(kh,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(ht,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:s.jsx(qQ,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(ht,{title:"Admin",htmlFor:"admin",outcome:f,children:s.jsx(Yn,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),s.jsxs(Z,{justify:"flex-end",mt:"xl",children:[s.jsx(oe,{type:"submit",children:"Save"}),s.jsx(oe,{type:"button",color:"red",variant:"outline",onClick:v,children:"Remove user"})]})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(f,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(He,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function QQ(){const e=ie(),[t,n]=p.useState(e.getProject()),[r,o]=p.useState(),[i,a]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(void 0),f=p.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:r,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),lh(g)?a(g):d(g),c(m.sendEmail??!1),ve({color:"green",message:"Invite success"})}).catch(g=>{ve({color:"red",message:Ne(g),autoClose:!1}),a(mt(g))})},[e,t,r]);return s.jsxs(Ge,{onSubmit:f,children:[!u&&!i&&s.jsxs(Ae,{children:[s.jsx(de,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(ht,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(ll,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(Tt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ye(i,"resourceType")}),s.jsx(fe,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ye(i,"firstName")}),s.jsx(fe,{name:"lastName",label:"Last Name",required:!0,error:Ye(i,"lastName")}),s.jsx(fe,{name:"email",type:"email",label:"Email",required:!0,error:Ye(i,"email")}),s.jsx(ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(kh,{name:"accessPolicy",onChange:o})}),s.jsx(Yn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Yn,{name:"isAdmin",label:"Admin"}),s.jsx(Z,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Invite"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(He,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(ue,{children:"User created"}),l&&s.jsx(ue,{children:"Email sent"}),s.jsxs(In,{children:[s.jsx(In.Item,{children:s.jsx(He,{to:u,children:"Go to new membership"})}),s.jsx(In.Item,{children:s.jsx(He,{to:u.profile,children:"Go to new profile"})}),s.jsx(In.Item,{children:s.jsx(He,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function KQ(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Patients"}),s.jsx(Ph,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(He,{to:"/admin/invite",children:"Invite new patient"})})]})}function YQ(){const e=ie();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Xr,{outcome:hP});function t(n){e.post("admin/projects/setpassword",n).then(()=>ve({color:"green",message:"Done"})).catch(r=>ve({color:"red",message:Ne(r),autoClose:!1}))}return s.jsxs(De,{width:600,children:[s.jsx(de,{order:1,children:"Project Admin"}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Force Set Password"}),s.jsx(ue,{children:"Sets the password for the specified user in this project."}),s.jsx(ue,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(Ge,{onSubmit:t,children:s.jsxs(Ae,{children:[s.jsx(fe,{name:"email",label:"Email",required:!0}),s.jsx(Vr,{name:"password",label:"Password",required:!0}),s.jsx(oe,{type:"submit",children:"Force Set Password"})]})})]})}function Yw(){const e=ie(),t=Vi(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Details"}),s.jsxs(Rx,{children:[s.jsx(ko,{term:"ID",children:n.project.id}),s.jsx(ko,{term:"Name",children:n.project.name})]})]})}const Xw=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function XQ(){const e=Vt(),n=Xo().pathname.replace("/admin/","")||Xw[0],r=ie(),o=Vi(r),i=p.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function a(l){e(`/admin/${l}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Wn,{children:[s.jsx(Fe,{children:s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Project"}),s.jsx(Fe.Value,{children:i.project.name})]})}),s.jsx(Pr,{children:s.jsx(Ze,{value:n.toLowerCase(),onChange:a,children:s.jsx(Ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Xw.map(l=>s.jsx(Ze.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(De,{children:s.jsx(Zx,{})})]})}function JQ(){const e=ie(),t=Vi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,a]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&a(po(n.project.secret||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.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:[s.jsx(de,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(cl,{property:$s("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(oe,{type:"submit",children:"Save"})]})}function ZQ(){const e=ie(),t=Vi(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,a]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&a(po(n.project.site||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.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,m;const u=mt(c);ve({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[s.jsx(de,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(cl,{property:$s("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(oe,{type:"submit",children:"Save"})]})}function eK(){const e=ie(),[t,{open:n,close:r}]=AS(!1),[o,i]=p.useState(""),[a,l]=p.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Xr,{outcome:hP});function c(){Rl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function u(){Rl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function d(){Rl(e,"Rebuilding Value Sets","admin/super/valuesets")}function f(y){Rl(e,"Reindexing Resources","admin/super/reindex",y)}function h(y){Rl(e,"Rebuilding Compartments","admin/super/compartments",y)}function m(y){e.post("admin/super/removebotidjobsfromqueue",y).then(()=>ve({color:"green",message:"Done"})).catch(b=>ve({color:"red",message:Ne(b),autoClose:!1}))}function g(y){e.post("admin/super/purge",{...y,before:Dk(y.before)}).then(()=>ve({color:"green",message:"Done"})).catch(b=>ve({color:"red",message:Ne(b),autoClose:!1}))}function v(y){e.post("admin/super/setpassword",y).then(()=>ve({color:"green",message:"Done"})).catch(b=>ve({color:"red",message:Ne(b),autoClose:!1}))}function S(){e.post("fhir/R4/$db-stats",{}).then(y=>{var b,x;i("Database Stats"),l(s.jsx("pre",{children:(x=(b=y.parameter)==null?void 0:b.find(w=>w.name==="tableString"))==null?void 0:x.valueString})),n()}).catch(y=>ve({color:"red",message:Ne(y),autoClose:!1}))}return s.jsxs(De,{width:600,children:[s.jsx(de,{order:1,children:"Super Admin"}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Structure Definitions"}),s.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."}),s.jsx(Ge,{children:s.jsx(oe,{onClick:c,children:"Rebuild StructureDefinitions"})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Search Parameters"}),s.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."}),s.jsx(Ge,{children:s.jsx(oe,{onClick:u,children:"Rebuild SearchParameters"})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Value Sets"}),s.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."}),s.jsx(Ge,{children:s.jsx(oe,{onClick:d,children:"Rebuild ValueSets"})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(Ge,{onSubmit:f,children:s.jsxs(Ae,{children:[s.jsx(ht,{title:"Resource Type",children:s.jsx(fe,{name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(oe,{type:"submit",children:"Reindex"})]})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Rebuild Compartments"}),s.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),s.jsx(Ge,{onSubmit:h,children:s.jsxs(Ae,{children:[s.jsx(ht,{title:"Resource Type",children:s.jsx(fe,{name:"resourceType",placeholder:"Compartments Resource Type"})}),s.jsx(oe,{type:"submit",children:"Rebuild Compartments"})]})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(Ge,{onSubmit:g,children:s.jsxs(Ae,{children:[s.jsx(ht,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(Tt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(ht,{title:"Purge Before",htmlFor:"before",children:s.jsx(ys,{name:"before",placeholder:"Before Date"})}),s.jsx(oe,{type:"submit",children:"Purge"})]})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(Ge,{onSubmit:m,children:s.jsxs(Ae,{children:[s.jsx(ht,{title:"Bot ID",children:s.jsx(fe,{name:"botId",placeholder:"Bot Id"})}),s.jsx(oe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Force Set Password"}),s.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.'}),s.jsx(Ge,{onSubmit:v,children:s.jsxs(Ae,{children:[s.jsx(fe,{name:"email",label:"Email",required:!0}),s.jsx(Vr,{name:"password",label:"Password",required:!0}),s.jsx(fe,{name:"projectId",label:"Project ID"}),s.jsx(oe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(Ge,{onSubmit:S,children:s.jsx(oe,{type:"submit",children:"Get Database Stats"})}),s.jsx(En,{opened:t,onClose:r,title:o,centered:!0,children:a})]})}function Rl(e,t,n,r){co.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(()=>{co.update({id:n,color:"green",title:t,message:"Done",icon:s.jsx(Zc,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{co.update({id:n,color:"red",title:t,message:Ne(i),icon:s.jsx(Jd,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function tK(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Users"}),s.jsx(Ph,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(He,{to:"/admin/invite",children:"Invite new user"})})]})}function nK(){const[e]=Ha("ObservationDefinition","_count=100");return e?s.jsxs(ce,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(uo,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(uo,{value:t.code})}),s.jsx("td",{children:s.jsx(uo,{value:t.method})}),s.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),s.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),s.jsx("td",{children:s.jsx(wg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(Wr,{})}function wg(e){const{ranges:t}=e;if(!t)return null;const n=Jw(t.map(o=>o.gender));if(n.length>1)return xc(n),s.jsx(s.Fragment,{children:n.map(o=>{var i;return s.jsxs(p.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Gt(o)})}),s.jsx(wg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const r=Jw(t.map(o=>o.age&&bc(o.age)));return r.length>1?(xc(r),s.jsx(s.Fragment,{children:r.map(o=>{var i;return s.jsxs(p.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Gt(o)})}),s.jsx(wg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>bc(a.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(Dx,{value:o.range})})]})})},`range-${o.condition}`))})}function Jw(e){return[...new Set(e.filter(t=>!!t))]}function rK(){const[e]=Ha("ActivityDefinition","_count=100"),[t]=Ha("ObservationDefinition","_count=100");return!e||!t?s.jsx(Wr,{}):s.jsxs(ce,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(uo,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(uo,{value:n.code})}),e.map(o=>{var i;return s.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(a=>{var l;return(l=a.reference)==null?void 0:l.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function oK(e){var a;const t=ie(),[n,r]=p.useState(),[o,i]=p.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(He,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(He,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(Ge,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:n}]}).then(i).catch(console.log)},children:s.jsxs(Ae,{children:[s.jsxs(de,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(ue,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(ue,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(a=e.planDefinition.action)==null?void 0:a.map((l,c)=>{var u;return s.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&s.jsx(s.Fragment,{children:l.title}),l.code&&s.jsx(uo,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(ht,{title:"Subject",children:s.jsx(yh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Go"})})]})})}function iK(){const{resourceType:e,id:t}=it(),n=vt({reference:e+"/"+t});return n?s.jsx(De,{children:s.jsx(oK,{planDefinition:n})}):null}function sK(){const{resourceType:e,id:t}=it(),n=vt({reference:e+"/"+t}),[r,o]=Ha("Questionnaire","subject-type="+e),[i,a]=Ha("ClientApplication",{_count:1e3});if(!n||o||a)return s.jsx(Wr,{});const l=i==null?void 0:i.filter(d=>aK(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return s.jsxs(De,{children:[s.jsx(de,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let c,u;return n.resourceType==="Patient"?c=wt(n):n.resourceType==="Encounter"&&(c=n.subject,u=wt(n)),s.jsxs(De,{children:[r==null?void 0:r.map(d=>s.jsxs("div",{children:[s.jsx(de,{order:3,children:s.jsx(He,{to:`/forms/${d.id}?subject=${St(n)}`,children:d.title||d.name})}),s.jsx(ue,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>s.jsxs("div",{children:[s.jsx(de,{order:3,children:s.jsx(NW,{client:d,patient:c,encounter:u,children:d.name})}),s.jsx(ue,{children:d.description})]},d.id))]})}function aK(e){return e==="Patient"||e==="Encounter"}function lK(){const{resourceType:e,id:t}=it(),n=Vt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(De,{children:s.jsx(lu,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function cK(){const e=ie(),{resourceType:t,id:n}=it(),r=e.readHistory(t,n).read();return s.jsx(De,{children:s.jsx(EW,{history:r})})}const uK="_hl7Input_k5xm3_1",dK={hl7Input:uK};function fK(e){return s.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 hK(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),s.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{hd(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const pK=`{
|
|
553
|
+
"resourceType": "Patient",
|
|
554
|
+
"name": [
|
|
555
|
+
{
|
|
556
|
+
"given": [
|
|
557
|
+
"Alice"
|
|
558
|
+
],
|
|
559
|
+
"family": "Smith"
|
|
560
|
+
}
|
|
561
|
+
]
|
|
562
|
+
}`,mK="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 gK(){const e=ie(),{id:t}=it(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState(pK),[c,u]=p.useState(mK),[d,f]=p.useState(Jt.FHIR_JSON),h=p.useRef(null),m=p.useRef(null),[g,v]=p.useState(!1);p.useEffect(()=>{e.readResource("Bot",t).then(async E=>{r(E),i(await vK(e,E))}).catch(E=>ve({color:"red",message:Ne(E),autoClose:!1}))},[e,t]);const S=p.useCallback(()=>hd(h.current,{command:"getValue"}),[]),y=p.useCallback(()=>hd(h.current,{command:"getOutput"}),[]),b=p.useCallback(async()=>d===Jt.FHIR_JSON?JSON.parse(a):c,[d,a,c]),x=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const C=await S(),T=await e.createAttachment(C,"index.ts","text/typescript"),_=[];n!=null&&n.sourceCode?_.push({op:"replace",path:"/sourceCode",value:T}):_.push({op:"add",path:"/sourceCode",value:T}),await e.patchResource("Bot",t,_),ve({color:"green",message:"Saved"})}catch(C){ve({color:"red",message:Ne(C),autoClose:!1})}finally{v(!1)}},[e,t,n,S]),w=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const C=await y();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:C}),ve({color:"green",message:"Deployed"})}catch(C){ve({color:"red",message:Ne(C),autoClose:!1})}finally{v(!1)}},[e,t,y]),j=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const C=await b(),T=await e.post(e.fhirUrl("Bot",t,"$execute"),C,d);await hd(m.current,{command:"setValue",value:T}),ve({color:"green",message:"Success"})}catch(C){ve({color:"red",message:Ne(C),autoClose:!1})}finally{v(!1)}},[e,t,b,d]);return!n||o===void 0?null:s.jsxs(rr,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(rr.Col,{span:8,children:s.jsxs(Wn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(hK,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(Z,{justify:"flex-end",gap:"xs",children:[s.jsx(oe,{type:"button",onClick:x,loading:g,leftSection:s.jsx(R8,{size:"1rem"}),children:"Save"}),s.jsx(oe,{type:"button",onClick:w,loading:g,leftSection:s.jsx(Sx,{size:"1rem"}),children:"Deploy"}),s.jsx(oe,{type:"button",onClick:j,loading:g,leftSection:s.jsx(W8,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(rr.Col,{span:4,children:[s.jsxs(Wn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(Tt,{data:[{label:"FHIR",value:Jt.FHIR_JSON},{label:"HL7",value:Jt.HL7_V2}],onChange:E=>f(E.currentTarget.value)}),d===Jt.FHIR_JSON?s.jsx(tl,{value:a,onChange:E=>l(E),autosize:!0,minRows:15}):s.jsx("textarea",{className:dK.hl7Input,value:c,onChange:E=>u(E.currentTarget.value),rows:15})]}),s.jsx(Wn,{m:2,p:"xs",shadow:"md",children:s.jsx(fK,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function vK(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(DP);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Fs(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function yK(){const e=ie(),{resourceType:t,id:n}=it(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(Fs(i)).then(()=>{ve({color:"green",message:"Success"})}).catch(a=>{ve({color:"red",message:Ne(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(De,{children:s.jsx(eH,{value:r,onSubmit:o})});case"Questionnaire":return s.jsx(De,{children:s.jsx($H,{questionnaire:r,onSubmit:o})});default:return null}}function xK(){const{resourceType:e,id:t}=it(),n=vt({reference:e+"/"+t}),r=Vt();return n?s.jsx(De,{children:s.jsx(aW,{value:n,onStart:(o,i)=>r(`/forms/${uh(i)}`),onEdit:(o,i,a)=>r(`/${a.reference}}`)})}):null}function bK(){const e=ie(),{resourceType:t,id:n}=it(),r=Vt();return s.jsxs(De,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(oe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>ve({color:"red",message:Ne(o),autoClose:!1}))},children:"Delete"})]})}const wK="_selectProfileBtn_tbaz6_1",SK="_chevron_tbaz6_13",Zw={selectProfileBtn:wK,chevron:SK};function jK(){var c,u;const{resourceType:e,id:t}=it(),n=vt({reference:e+"/"+t}),[r,o]=p.useState(),i=zc({onDropdownClose:()=>i.resetSelectedOption()}),a=p.useMemo(()=>{var d;if(Mt((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[s.jsx(Ie.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>s.jsx(Ie.Option,{value:f,children:f},f))]},[(c=n==null?void 0:n.meta)==null?void 0:c.profile]);if(p.useEffect(()=>{var d,f;((f=(d=n==null?void 0:n.meta)==null?void 0:d.profile)==null?void 0:f.length)===1&&o(n.meta.profile[0])},[(u=n==null?void 0:n.meta)==null?void 0:u.profile]),!n)return null;let l;return Mt(a)&&(l=s.jsx(Z,{justify:"flex-end",children:s.jsxs(Ae,{align:"flex-end",gap:"xs",children:[s.jsxs(Ie,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[s.jsx(Ie.Target,{children:s.jsx(gn,{onClick:()=>i.toggleDropdown(),children:s.jsxs(yy,{fw:"bold",fs:"sm",className:Zw.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(ck,{stroke:1.5,className:Zw.chevron})]})})}),s.jsx(Ie.Dropdown,{w:"max-content",children:s.jsx(Ie.Options,{children:a})})]}),s.jsx(W,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(ue,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(ue,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(ue,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(De,{children:s.jsxs(Ae,{gap:"xl",children:[l,s.jsx(Vx,{value:n,profileUrl:r})]})})}function CK(){const e=ie(),{resourceType:t,id:n}=it(),[r,o]=p.useState(),i=Vt(),[a,l]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(d=>o(po(d))).catch(d=>{l(mt(d)),ve({color:"red",message:Ne(d),autoClose:!1})})},[e,t,n]);const c=p.useCallback(d=>{l(void 0),e.updateResource(Fs(d)).then(()=>{i(`/${t}/${n}/details`),ve({color:"green",message:"Success"})}).catch(f=>{l(mt(f)),ve({color:"red",message:Ne(f),autoClose:!1})})},[e,t,n,i]),u=p.useCallback(()=>i(`/${t}/${n}/delete`),[i,t,n]);return r?s.jsx(De,{children:s.jsx(nf,{defaultValue:r,onSubmit:c,onDelete:u,outcome:a})}):null}function c2({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=ie(),[i,a]=p.useState();return p.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{a(l.filter(uB))}).catch(console.error)},[o,n,r]),s.jsx(Ze,{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:s.jsx(Ze.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 s.jsx(Ze.Tab,{value:l.url,title:u,rightSection:c&&s.jsx(Zy,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(rz,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function u2(e,t){const n=ie(),r=Vt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),n.createResource(a).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(mt(l)),ve({color:"red",message:Ne(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Op(){const{resourceType:e}=it(),t=Xo(),[n,r]=p.useState(),{defaultValue:o,handleSubmit:i}=u2(e,r),[a,l]=p.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=p.useCallback(d=>{const f=Fs(d);a&&NP(f,a.url),i(f)},[a,i]);return c?s.jsx(De,{children:s.jsxs(Ae,{children:[s.jsx(c2,{resource:o,currentProfile:a,onChange:l}),a?s.jsx(nf,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:a.url},a.url):s.jsx(ue,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(De,{children:s.jsx(nf,{defaultValue:o,onSubmit:i,outcome:n})})}function EK(){const e=ie(),{resourceType:t,id:n}=it(),r=e.readHistory(t,n).read();return s.jsx(De,{children:s.jsx(_W,{history:r})})}function TK(){const{resourceType:e}=it(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=u2(e,n),i=p.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(De,{children:[t&&s.jsx(Xr,{outcome:t}),s.jsxs(Ge,{onSubmit:i,children:[s.jsx(tl,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:ar(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"OK"})})]})]})}function PK(){const e=ie(),{resourceType:t,id:n}=it(),r=vt({reference:t+"/"+n}),o=Vt(),[i,a]=p.useState(),l=p.useCallback(c=>{e.updateResource(Fs(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${n}/details`),ve({color:"green",message:"Success"})}).catch(u=>{ve({color:"red",message:Ne(u),autoClose:!1})})},[e,t,n,o]);return r?s.jsxs(De,{children:[i&&s.jsx(Xr,{outcome:i}),s.jsxs(Ge,{onSubmit:l,children:[s.jsx(tl,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:ar(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"OK"})})]})]}):null}function kK(){const{resourceType:e,id:t}=it();return vt({reference:e+"/"+t})?s.jsxs(De,{children:[s.jsxs($i,{icon:s.jsx(al,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Je,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(wR,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function RK(){const e=ie(),{resourceType:t,id:n}=it(),[r,o]=p.useState(),[i,a]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(l=>o(po(l))).catch(l=>{ve({color:"red",message:Ne(l)})})},[e,t,n]),r?s.jsxs(De,{children:[s.jsxs(de,{order:2,children:["Available ",t," profiles"]}),s.jsx(Ae,{children:s.jsxs(s.Fragment,{children:[s.jsx(c2,{resource:r,currentProfile:i,onChange:a}),i?s.jsx(_K,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):s.jsx(ue,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const _K=({profile:e,resource:t,onResourceUpdated:n})=>{const r=ie(),[o,i]=p.useState(),[a,l]=p.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=p.useCallback(u=>{i(void 0);const d=Fs(u);a?NP(d,e.url):q7(d,e.url),r.updateResource(d).then(f=>{n(f),ve({color:"green",message:"Success"})}).catch(f=>{i(mt(f)),ve({color:"red",message:Ne(f),autoClose:!1})})},[r,e.url,n,a]);return s.jsxs(Ae,{children:[s.jsx(qc,{size:"md",checked:a,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),a?s.jsx(nf,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"OK"})})})]})};function DK(){const e=ie(),{id:t}=it(),[n,r]=p.useState(),[o,i]=p.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>IK(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:St(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),ve({color:"green",message:"Success"})}).catch(c=>ve({color:"red",message:Ne(c),autoClose:!1}))}return s.jsxs(De,{children:[s.jsx(de,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(ul,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(de,{children:"Connect to bot"}),s.jsxs(Z,{children:[s.jsx(ll,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),s.jsx(oe,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function IK(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 AK(){const{id:e}=it(),t=Vt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:te.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(De,{children:s.jsx(lu,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function NK(){const e=ie(),{resourceType:t,id:n}=it(),r=vt({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(Fs(i)).then(()=>{ve({color:"green",message:"Success"})}).catch(a=>{ve({color:"red",message:Ne(a),autoClose:!1})})},[e]);return r?s.jsx(De,{children:s.jsx(ZH,{onSubmit:o,definition:r})}):null}function MK(){const{resourceType:e,id:t}=it(),n=vt({reference:e+"/"+t});return n?s.jsx(De,{children:e==="MeasureReport"?s.jsx(QU,{measureReport:n}):s.jsx(Ox,{value:n})}):null}const OK="_container_1ue98_1",$K="_entry_1ue98_14",LK="_active_1ue98_21",$p={container:OK,entry:$K,active:LK};function FK(e){const t=ie(),n=vt(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=o0(n);if(!i)return;const a="reference"in i?i.reference:St(i);t.search("ServiceRequest","subject="+a).then(l=>{const u=l.entry.map(d=>d.resource);Xk(u),u.reverse(),o(u)}).catch(l=>ve({color:"red",message:Ne(l),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:$p.container,children:r.map(i=>{var a,l,c,u,d,f,h;return s.jsxs("div",{className:nt($p.entry,{[$p.active]:i.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(He,{to:i,children:zK(i)})}),((l=(a=i.category)==null?void 0:a[0])==null?void 0:l.text)&&s.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)&&s.jsx("p",{children:(h=i.code.coding[0])==null?void 0:h.code}),s.jsx("p",{children:BK(i)})]},i.id)})}):null}function zK(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function BK(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const VK="_container_1l2dh_1",UK={container:VK};function HK(e){var o,i,a,l;const t=vt(e.valueSet);if(!t)return null;const n=[""],r=(l=(a=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:a.concept)==null?void 0:l.map(c=>c.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:UK.container,children:s.jsx(Tt,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function WK(e){var n,r;const t=vt(e.specimen);return t?s.jsxs(Fe,{children:[s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Type"}),s.jsx(Fe.Value,{children:"Specimen"})]}),s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Collected"}),s.jsx(Fe.Value,{children:Nn((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Specimen Age"}),s.jsx(Fe.Value,{children:qK(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(Fe.Entry,{children:[s.jsx(Fe.Key,{children:"Specimen Stability"}),s.jsx(Fe.Value,{children:GK(t)})]}):s.jsx(s.Fragment,{})]}):null}function qK(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return d2(f2(n,new Date))}function GK(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 d2(f2(t,n))}function d2(e){return e.toString().padStart(3,"0")+"D"}function f2(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function QK(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 KK=["Profiles"];function YK(){var x,w,j,E,C,T,_;const e=ie(),{resourceType:t,id:n}=it(),r={reference:t+"/"+n},o=Vt(),[i,a]=p.useState(),l=vt(r,a),c=QK(t),[u,d]=p.useState(()=>{const P=window.location.pathname.split("/").pop();return P&&c.map(M=>M.toLowerCase()).includes(P)?P:c[0].toLowerCase()}),f=It();async function h(){var D,N;const M=(N=(D=(await e.readHistory(t,n)).entry)==null?void 0:D.find(A=>!!A.resource))==null?void 0:N.resource;M?m(M):ve({color:"red",message:"No history to restore",autoClose:!1})}function m(P){e.updateResource(Fs(P)).then(()=>{a(void 0),ve({color:"green",message:"Success"})}).catch(M=>{ve({color:"red",message:Ne(M),autoClose:!1})})}if(i)return mL(i)?s.jsxs(De,{children:[s.jsx(de,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(oe,{color:"red",onClick:h,children:"Restore"})]}):s.jsx(Xr,{outcome:i});function g(P){P||(P=c[0].toLowerCase()),d(P),o(`/${t}/${n}/${P}`)}function v(P){const M=l,D=M.orderDetail||[];D.length===0&&D.push({}),D[0].text!==P&&(D[0].text=P,m({...M,orderDetail:D}))}const S=l&&o0(l),y=l&&SQ(l),b=(j=(w=(x=e.getUserConfiguration())==null?void 0:x.option)==null?void 0:w.find(P=>P.id==="statusValueSet"))==null?void 0:j.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&b&&s.jsx(HK,{valueSet:{reference:b},defaultValue:(C=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:C.text,onChange:v},St(l)+"-"+((_=(T=l.orderDetail)==null?void 0:T[0])==null?void 0:_.text)),l&&s.jsx(FK,{value:l}),l&&s.jsxs(Wn,{children:[S&&s.jsx(i2,{patient:S}),y&&s.jsx(WK,{specimen:y}),t!=="Patient"&&s.jsx(s2,{resource:r}),s.jsx(Pr,{children:s.jsx(Ze,{value:u.toLowerCase(),onChange:g,children:s.jsx(Ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(P=>s.jsx(Ze.Tab,{value:P.toLowerCase(),children:KK.includes(P)?s.jsxs(Z,{gap:"xs",wrap:"nowrap",children:[P,s.jsx(Bc,{color:f.primaryColor,size:"sm",children:"Beta"})]}):P},P))})})})]}),s.jsx(Zx,{})]})}function eS(){var y,b,x,w;const e=Vt(),{resourceType:t,id:n,versionId:r,tab:o}=it(),i=ie(),[a,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();if(p.useEffect(()=>{f(void 0),l(!0),i.readHistory(t,n).then(j=>u(j)).then(()=>l(!1)).catch(j=>{f(j),l(!1)})},[i,t,n]),a)return s.jsx(Wr,{});if(!c)return s.jsxs(De,{children:[s.jsx(de,{children:"Resource not found"}),s.jsx(He,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(j=>{var E,C;return((C=(E=j.resource)==null?void 0:E.meta)==null?void 0:C.versionId)===r});if(m===-1)return s.jsxs(De,{children:[s.jsx(de,{children:"Version not found"}),s.jsx(He,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[m].resource,v=m<h.length-1?h[m+1].resource:void 0,S="diff";return s.jsxs(Ze,{value:o||S,onChange:j=>e(`/${t}/${n}/_history/${r}/${j||S}`),children:[s.jsxs(Wn,{children:[s.jsx(iu,{fluid:!0,p:"md",children:s.jsx(ue,{children:`${t} ${n}`})}),s.jsxs(Ze.List,{children:[s.jsx(Ze.Tab,{value:"diff",children:"Diff"}),s.jsx(Ze.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(De,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(Ze.Panel,{value:"diff",children:v?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=g.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(He,{to:`/${t}/${n}/_history/${(b=v.meta)==null?void 0:b.versionId}`,children:(x=v.meta)==null?void 0:x.versionId})]})]}),s.jsx(kW,{original:v,revised:g})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(w=g.meta)==null?void 0:w.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),s.jsx(Ze.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function XK(){const{resourceType:e,id:t}=it(),n=Vt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(De,{children:s.jsx(lu,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function tS(){const{resourceType:e,id:t}=it(),n={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(WV,{encounter:n});case"Patient":return s.jsx(KU,{patient:n});case"ServiceRequest":return s.jsx(AW,{serviceRequest:n});default:return s.jsx(HV,{resource:n})}}function JK(){const e=ie(),{id:t}=it(),n=p.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=p.useState(!1),[i,a]=p.useState(!1),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState(!1),y=p.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(E=>{var C,T,_,P,M,D;c((T=(C=E.parameter)==null?void 0:C.find(N=>N.name==="status"))==null?void 0:T.valueCode),d((P=(_=E.parameter)==null?void 0:_.find(N=>N.name==="version"))==null?void 0:P.valueString),h((D=(M=E.parameter)==null?void 0:M.find(N=>N.name==="lastUpdated"))==null?void 0:D.valueInstant)}).catch(E=>j(Ne(E))).finally(()=>o(!1))},[e,t]),b=p.useCallback(E=>{const C=E.host,T=E.pingCount||1;C&&(S(!0),e.pushToAgent(n,C,`PING ${T}`,Jt.PING,!0).then(_=>g(_)).catch(_=>j(Ne(_))).finally(()=>S(!1)))},[e,n]),x=p.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(E=>{w("Agent config reloaded successfully.")}).catch(E=>j(Ne(E))).finally(()=>a(!1))},[e,t]);function w(E){ve({color:"green",title:"Success",icon:s.jsx(Zc,{size:"1rem"}),message:E})}function j(E){ve({color:"red",title:"Error",message:E,autoClose:!1})}return s.jsxs(De,{children:[s.jsx(de,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(ul,{value:n,link:!0})]}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Agent Status"}),s.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."}),s.jsx(oe,{onClick:y,loading:r,children:"Get Status"}),!r&&l&&s.jsx(ce,{children:s.jsxs(ce.Tbody,{children:[s.jsxs(ce.Tr,{children:[s.jsx(ce.Td,{children:"Status"}),s.jsx(ce.Td,{children:s.jsx(Mx,{status:l})})]}),s.jsxs(ce.Tr,{children:[s.jsx(ce.Td,{children:"Version"}),s.jsx(ce.Td,{children:u})]}),s.jsxs(ce.Tr,{children:[s.jsx(ce.Td,{children:"Last Updated"}),s.jsx(ce.Td,{children:Nn(f,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(oe,{onClick:x,loading:i,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(nn,{my:"lg"}),s.jsx(de,{order:2,children:"Ping from Agent"}),s.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."}),s.jsx(Ge,{onSubmit:b,children:s.jsxs(Z,{children:[s.jsx(fe,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(tn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:v,children:s.jsx(Y8,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Oy,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!v&&m&&s.jsxs(s.Fragment,{children:[s.jsx(de,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:m})]})]})}function ZK(){return s.jsx(nG,{children:s.jsxs(xe,{errorElement:s.jsx(gQ,{}),children:[s.jsx(xe,{path:"/signin",element:s.jsx(zQ,{})}),s.jsx(xe,{path:"/oauth",element:s.jsx(MQ,{})}),s.jsx(xe,{path:"/resetpassword",element:s.jsx($Q,{})}),s.jsx(xe,{path:"/setpassword/:id/:secret",element:s.jsx(FQ,{})}),s.jsx(xe,{path:"/register",element:s.jsx(OQ,{})}),s.jsx(xe,{path:"/changepassword",element:s.jsx(hQ,{})}),s.jsx(xe,{path:"/security",element:s.jsx(LQ,{})}),s.jsx(xe,{path:"/mfa",element:s.jsx(NQ,{})}),s.jsx(xe,{path:"/batch",element:s.jsx(dQ,{})}),s.jsx(xe,{path:"/bulk/:resourceType",element:s.jsx(fQ,{})}),s.jsx(xe,{path:"/smart",element:s.jsx(BQ,{})}),s.jsx(xe,{path:"/forms/:id",element:s.jsx(CQ,{})}),s.jsx(xe,{path:"/admin/super",element:s.jsx(eK,{})}),s.jsx(xe,{path:"/admin/config",element:s.jsx(YQ,{})}),s.jsxs(xe,{path:"/admin",element:s.jsx(XQ,{}),children:[s.jsx(xe,{path:"patients",element:s.jsx(KQ,{})}),s.jsx(xe,{path:"bots/new",element:s.jsx(HQ,{})}),s.jsx(xe,{path:"bots",element:s.jsx(VQ,{})}),s.jsx(xe,{path:"clients/new",element:s.jsx(WQ,{})}),s.jsx(xe,{path:"clients",element:s.jsx(UQ,{})}),s.jsx(xe,{path:"details",element:s.jsx(Yw,{})}),s.jsx(xe,{path:"invite",element:s.jsx(QQ,{})}),s.jsx(xe,{path:"users",element:s.jsx(tK,{})}),s.jsx(xe,{path:"project",element:s.jsx(Yw,{})}),s.jsx(xe,{path:"secrets",element:s.jsx(JQ,{})}),s.jsx(xe,{path:"sites",element:s.jsx(ZQ,{})}),s.jsx(xe,{path:"members/:membershipId",element:s.jsx(GQ,{})})]}),s.jsx(xe,{path:"/lab/assays",element:s.jsx(nK,{})}),s.jsx(xe,{path:"/lab/panels",element:s.jsx(rK,{})}),s.jsx(xe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(eS,{})}),s.jsx(xe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(eS,{})}),s.jsxs(xe,{path:"/:resourceType/new",element:s.jsx(mQ,{}),children:[s.jsx(xe,{index:!0,element:s.jsx(Op,{})}),s.jsx(xe,{path:"form",element:s.jsx(Op,{})}),s.jsx(xe,{path:"json",element:s.jsx(TK,{})}),s.jsx(xe,{path:"profiles",element:s.jsx(Op,{})})]}),s.jsxs(xe,{path:"/:resourceType/:id",element:s.jsx(YK,{}),children:[s.jsx(xe,{index:!0,element:s.jsx(tS,{})}),s.jsx(xe,{path:"apply",element:s.jsx(iK,{})}),s.jsx(xe,{path:"apps",element:s.jsx(sK,{})}),s.jsx(xe,{path:"event",element:s.jsx(lK,{})}),s.jsx(xe,{path:"blame",element:s.jsx(cK,{})}),s.jsx(xe,{path:"bots",element:s.jsx(DK,{})}),s.jsx(xe,{path:"builder",element:s.jsx(yK,{})}),s.jsx(xe,{path:"checklist",element:s.jsx(xK,{})}),s.jsx(xe,{path:"delete",element:s.jsx(bK,{})}),s.jsx(xe,{path:"details",element:s.jsx(jK,{})}),s.jsx(xe,{path:"edit",element:s.jsx(CK,{})}),s.jsx(xe,{path:"editor",element:s.jsx(gK,{})}),s.jsx(xe,{path:"history",element:s.jsx(EK,{})}),s.jsx(xe,{path:"json",element:s.jsx(PK,{})}),s.jsx(xe,{path:"preview",element:s.jsx(kK,{})}),s.jsx(xe,{path:"responses",element:s.jsx(AK,{})}),s.jsx(xe,{path:"report",element:s.jsx(MK,{})}),s.jsx(xe,{path:"ranges",element:s.jsx(NK,{})}),s.jsx(xe,{path:"subscriptions",element:s.jsx(XK,{})}),s.jsx(xe,{path:"timeline",element:s.jsx(tS,{})}),s.jsx(xe,{path:"tools",element:s.jsx(JK,{})}),s.jsx(xe,{path:"profiles",element:s.jsx(RK,{})})]}),s.jsx(xe,{path:"/:resourceType",element:s.jsx(Kw,{})}),s.jsx(xe,{path:"/",element:s.jsx(Kw,{})})]})})}function eY(){const e=ie(),t=e.getUserConfiguration(),n=Xo(),[r]=e0();return e.isLoading()?s.jsx(Wr,{}):s.jsx(Gz,{logo:s.jsx(Yr,{size:24}),pathname:n.pathname,searchParams:r,version:zF,menus:tY(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(p.Suspense,{fallback:s.jsx(Wr,{}),children:s.jsx(ZK,{})})})}function tY(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:nY(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(L8,{})}]}),t}const nS={Patient:Z8,Practitioner:M8,Organization:E8,ServiceRequest:G8,DiagnosticReport:K8,Questionnaire:N8,admin:S8,AccessPolicy:$8,Subscription:nz,batch:V8,Observation:B8};function nY(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in nS){const n=nS[t];return s.jsx(n,{})}}catch{}return s.jsx(ah,{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 rY(){const e=fu(),t=new ek({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=sG([{path:"*",element:s.jsx(eY,{})}]),o=a=>r.navigate(a);DR(document.getElementById("root")).render(s.jsx(p.StrictMode,{children:s.jsx(s8,{medplum:t,navigate:o,children:s.jsxs(FS,{theme:n,children:[s.jsx(Qo,{position:"bottom-right"}),s.jsx(mG,{router:r})]})})}))}rY().catch(console.error);
|
|
563
|
+
//# sourceMappingURL=index-DlEPmX6X.js.map
|