@medplum/app 3.2.3 → 3.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
function jw(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 j0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function $g(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Cw={exports:{}},Ef={},Ew={exports:{}},Ye={};/**
|
|
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 Fc=Symbol.for("react.element"),_2=Symbol.for("react.portal"),D2=Symbol.for("react.fragment"),I2=Symbol.for("react.strict_mode"),A2=Symbol.for("react.profiler"),N2=Symbol.for("react.provider"),M2=Symbol.for("react.context"),O2=Symbol.for("react.forward_ref"),L2=Symbol.for("react.suspense"),$2=Symbol.for("react.memo"),F2=Symbol.for("react.lazy"),C0=Symbol.iterator;function z2(e){return e===null||typeof e!="object"?null:(e=C0&&e[C0]||e["@@iterator"],typeof e=="function"?e:null)}var Tw={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Pw=Object.assign,kw={};function nl(e,t,n){this.props=e,this.context=t,this.refs=kw,this.updater=n||Tw}nl.prototype.isReactComponent={};nl.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")};nl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Rw(){}Rw.prototype=nl.prototype;function Fg(e,t,n){this.props=e,this.context=t,this.refs=kw,this.updater=n||Tw}var zg=Fg.prototype=new Rw;zg.constructor=Fg;Pw(zg,nl.prototype);zg.isPureReactComponent=!0;var E0=Array.isArray,_w=Object.prototype.hasOwnProperty,Bg={current:null},Dw={key:!0,ref:!0,__self:!0,__source:!0};function Iw(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)_w.call(t,r)&&!Dw.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:Fc,type:e,key:i,ref:a,props:o,_owner:Bg.current}}function B2(e,t){return{$$typeof:Fc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ug(e){return typeof e=="object"&&e!==null&&e.$$typeof===Fc}function U2(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var T0=/\/+/g;function Kh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?U2(""+e.key):t.toString(36)}function ad(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 Fc:case _2:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Kh(a,0):r,E0(o)?(n="",e!=null&&(n=e.replace(T0,"$&/")+"/"),ad(o,t,n,"",function(u){return u})):o!=null&&(Ug(o)&&(o=B2(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(T0,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",E0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Kh(i,l);a+=ad(i,t,n,c,o)}else if(c=z2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Kh(i,l++),a+=ad(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 Ru(e,t,n){if(e==null)return e;var r=[],o=0;return ad(e,r,"","",function(i){return t.call(n,i,o++)}),r}function V2(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 zn={current:null},ld={transition:null},H2={ReactCurrentDispatcher:zn,ReactCurrentBatchConfig:ld,ReactCurrentOwner:Bg};Ye.Children={map:Ru,forEach:function(e,t,n){Ru(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ru(e,function(){t++}),t},toArray:function(e){return Ru(e,function(t){return t})||[]},only:function(e){if(!Ug(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ye.Component=nl;Ye.Fragment=D2;Ye.Profiler=A2;Ye.PureComponent=Fg;Ye.StrictMode=I2;Ye.Suspense=L2;Ye.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=H2;Ye.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=Pw({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Bg.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)_w.call(t,c)&&!Dw.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:Fc,type:e.type,key:o,ref:i,props:r,_owner:a}};Ye.createContext=function(e){return e={$$typeof:M2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:N2,_context:e},e.Consumer=e};Ye.createElement=Iw;Ye.createFactory=function(e){var t=Iw.bind(null,e);return t.type=e,t};Ye.createRef=function(){return{current:null}};Ye.forwardRef=function(e){return{$$typeof:O2,render:e}};Ye.isValidElement=Ug;Ye.lazy=function(e){return{$$typeof:F2,_payload:{_status:-1,_result:e},_init:V2}};Ye.memo=function(e,t){return{$$typeof:$2,type:e,compare:t===void 0?null:t}};Ye.startTransition=function(e){var t=ld.transition;ld.transition={};try{e()}finally{ld.transition=t}};Ye.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ye.useCallback=function(e,t){return zn.current.useCallback(e,t)};Ye.useContext=function(e){return zn.current.useContext(e)};Ye.useDebugValue=function(){};Ye.useDeferredValue=function(e){return zn.current.useDeferredValue(e)};Ye.useEffect=function(e,t){return zn.current.useEffect(e,t)};Ye.useId=function(){return zn.current.useId()};Ye.useImperativeHandle=function(e,t,n){return zn.current.useImperativeHandle(e,t,n)};Ye.useInsertionEffect=function(e,t){return zn.current.useInsertionEffect(e,t)};Ye.useLayoutEffect=function(e,t){return zn.current.useLayoutEffect(e,t)};Ye.useMemo=function(e,t){return zn.current.useMemo(e,t)};Ye.useReducer=function(e,t,n){return zn.current.useReducer(e,t,n)};Ye.useRef=function(e){return zn.current.useRef(e)};Ye.useState=function(e){return zn.current.useState(e)};Ye.useSyncExternalStore=function(e,t,n){return zn.current.useSyncExternalStore(e,t,n)};Ye.useTransition=function(){return zn.current.useTransition()};Ye.version="18.2.0";Ew.exports=Ye;var p=Ew.exports;const un=$g(p),Aw=jw({__proto__:null,default:un},[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 W2=p,q2=Symbol.for("react.element"),G2=Symbol.for("react.fragment"),Q2=Object.prototype.hasOwnProperty,K2=W2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Y2={key:!0,ref:!0,__self:!0,__source:!0};function Nw(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)Q2.call(t,r)&&!Y2.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:q2,type:e,key:i,ref:a,props:o,_owner:K2.current}}Ef.Fragment=G2;Ef.jsx=Nw;Ef.jsxs=Nw;Cw.exports=Ef;var s=Cw.exports,fo=function(){return fo=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},fo.apply(this,arguments)};function Mw(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 X2(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 cd="right-scroll-bar-position",ud="width-before-scroll-bar",J2="with-scroll-bars-hidden",Z2="--removed-body-scroll-bar-size";function Yh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function e_(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 t_=typeof window<"u"?p.useLayoutEffect:p.useEffect,P0=new WeakMap;function n_(e,t){var n=e_(null,function(r){return e.forEach(function(o){return Yh(o,r)})});return t_(function(){var r=P0.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(l){i.has(l)||Yh(l,null)}),i.forEach(function(l){o.has(l)||Yh(l,a)})}P0.set(n,e)},[e]),n}function r_(e){return e}function o_(e,t){t===void 0&&(t=r_);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 i_(e){e===void 0&&(e={});var t=o_(null);return t.options=fo({async:!0,ssr:!1},e),t}var Ow=function(e){var t=e.sideCar,n=Mw(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,fo({},n))};Ow.isSideCarExport=!0;function s_(e,t){return e.useMedium(t),Ow}var Lw=i_(),Xh=function(){},Tf=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Xh,onWheelCapture:Xh,onTouchMoveCapture:Xh}),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,w=e.as,y=w===void 0?"div":w,S=e.gapMode,b=Mw(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=h,C=n_([n,t]),j=fo(fo({},b),o);return p.createElement(p.Fragment,null,d&&p.createElement(x,{sideCar:Lw,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:S}),a?p.cloneElement(p.Children.only(l),fo(fo({},j),{ref:C})):p.createElement(y,fo({},j,{className:c,ref:C}),l))});Tf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Tf.classNames={fullWidth:ud,zeroRight:cd};var a_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function l_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=a_();return t&&e.setAttribute("nonce",t),e}function c_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function u_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var d_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=l_())&&(c_(t,n),u_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},f_=function(){var e=d_();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},$w=function(){var e=f_(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},h_={left:0,top:0,right:0,gap:0},Jh=function(e){return parseInt(e||"",10)||0},p_=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[Jh(n),Jh(r),Jh(o)]},m_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return h_;var t=p_(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])}},g_=$w(),_a="data-scroll-locked",v_=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(J2,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(_a,`] {
|
|
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(cd,` {
|
|
36
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(ud,` {
|
|
40
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(cd," .").concat(cd,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(ud," .").concat(ud,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(_a,`] {
|
|
52
|
+
`).concat(Z2,": ").concat(l,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},k0=function(){var e=parseInt(document.body.getAttribute(_a)||"0",10);return isFinite(e)?e:0},y_=function(){p.useEffect(function(){return document.body.setAttribute(_a,(k0()+1).toString()),function(){var e=k0()-1;e<=0?document.body.removeAttribute(_a):document.body.setAttribute(_a,e.toString())}},[])},x_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;y_();var i=p.useMemo(function(){return m_(o)},[o]);return p.createElement(g_,{styles:v_(i,!t,o,n?"":"!important")})},nm=!1;if(typeof window<"u")try{var _u=Object.defineProperty({},"passive",{get:function(){return nm=!0,!0}});window.addEventListener("test",_u,_u),window.removeEventListener("test",_u,_u)}catch{nm=!1}var ta=nm?{passive:!1}:!1,b_=function(e){return e.tagName==="TEXTAREA"},Fw=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!b_(e)&&n[t]==="visible")},S_=function(e){return Fw(e,"overflowY")},w_=function(e){return Fw(e,"overflowX")},R0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=zw(e,r);if(o){var i=Bw(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},j_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},C_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},zw=function(e,t){return e==="v"?S_(t):w_(t)},Bw=function(e,t){return e==="v"?j_(t):C_(t)},E_=function(e,t){return e==="h"&&t==="rtl"?-1:1},T_=function(e,t,n,r,o){var i=E_(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=Bw(e,l),g=m[0],v=m[1],w=m[2],y=v-w-i*g;(g||y)&&zw(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},Du=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},_0=function(e){return[e.deltaX,e.deltaY]},D0=function(e){return e&&"current"in e?e.current:e},P_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},k_=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},R_=0,na=[];function __(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(R_++)[0],i=p.useState($w)[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=X2([e.lockRef.current],(e.shards||[]).map(D0),!0).filter(Boolean);return v.forEach(function(w){return w.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(v,w){if("touches"in v&&v.touches.length===2)return!a.current.allowPinchZoom;var y=Du(v),S=n.current,b="deltaX"in v?v.deltaX:S[0]-y[0],x="deltaY"in v?v.deltaY:S[1]-y[1],C,j=v.target,T=Math.abs(b)>Math.abs(x)?"h":"v";if("touches"in v&&T==="h"&&j.type==="range")return!1;var E=R0(T,j);if(!E)return!0;if(E?C=T:(C=T==="v"?"h":"v",E=R0(T,j)),!E)return!1;if(!r.current&&"changedTouches"in v&&(b||x)&&(r.current=C),!C)return!0;var _=r.current||C;return T_(_,w,v,_==="h"?b:x,!0)},[]),c=p.useCallback(function(v){var w=v;if(!(!na.length||na[na.length-1]!==i)){var y="deltaY"in w?_0(w):Du(w),S=t.current.filter(function(C){return C.name===w.type&&(C.target===w.target||w.target===C.shadowParent)&&P_(C.delta,y)})[0];if(S&&S.should){w.cancelable&&w.preventDefault();return}if(!S){var b=(a.current.shards||[]).map(D0).filter(Boolean).filter(function(C){return C.contains(w.target)}),x=b.length>0?l(w,b[0]):!a.current.noIsolation;x&&w.cancelable&&w.preventDefault()}}},[]),u=p.useCallback(function(v,w,y,S){var b={name:v,delta:w,target:y,should:S,shadowParent:D_(y)};t.current.push(b),setTimeout(function(){t.current=t.current.filter(function(x){return x!==b})},1)},[]),d=p.useCallback(function(v){n.current=Du(v),r.current=void 0},[]),f=p.useCallback(function(v){u(v.type,_0(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){u(v.type,Du(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return na.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ta),document.addEventListener("touchmove",c,ta),document.addEventListener("touchstart",d,ta),function(){na=na.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,ta),document.removeEventListener("touchmove",c,ta),document.removeEventListener("touchstart",d,ta)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:k_(o)}):null,m?p.createElement(x_,{gapMode:e.gapMode}):null)}function D_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const I_=s_(Lw,__);var Pf=p.forwardRef(function(e,t){return p.createElement(Tf,fo({},e,{ref:t,sideCar:I_}))});Pf.classNames=Tf.classNames;function xt(e){return Object.keys(e)}function Zh(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Vg(e,t){const n={...e},r=t;return Zh(e)&&Zh(t)&&Object.keys(t).forEach(o=>{Zh(r[o])&&o in e?n[o]=Vg(n[o],r[o]):n[o]=r[o]}),n}function A_(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function N_(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 rc(e){const t=N_(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 ep(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function Uw(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?ep(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?ep(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?ep(i):i}}return r}return n}const B=Uw("rem",{shouldScale:!0}),Pd=Uw("em");function Oi(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function Vw(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 qo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==p.Fragment:!1}function Bn(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 Ds(e=null){const t=p.createContext(e);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>p.useContext(t)]}function I0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function kd(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function M_(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 O_(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 L_(e,t,n){return kd(e,n)===kd(t,n)}function Hw({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=kd(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(v=>L_(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=O_(u,c,r),f=M_(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 $_={app:100,modal:200,popover:300,overlay:400,max:9999};function eo(e){return $_[e]}const F_=()=>{};function z_(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||F_:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Ae(e,t="size",n=!0){if(e!==void 0)return Vw(e)?n?B(e):e:`var(--${t}-${e})`}function Jt(e){return Ae(e,"mantine-spacing")}function lt(e){return e===void 0?"var(--mantine-radius-default)":Ae(e,"mantine-radius")}function dn(e){return Ae(e,"mantine-font-size")}function Ww(e){return Ae(e,"mantine-line-height",!1)}function Hg(e){if(e)return Ae(e,"mantine-shadow",!1)}function ar(e,t){return n=>{e==null||e(n),t==null||t(n)}}function Wg(e,t){return e in t.breakpoints?rc(t.breakpoints[e]):rc(e)}function oc(e,t){const n=e.map(r=>({value:r,px:Wg(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Hr(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function B_(e,t,n){var r;return n?Array.from(((r=kd(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function U_(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Iu(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 qg(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function A0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function ns(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 kf(e,t){const n=ns(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 N0=["mousedown","touchstart"];function V_(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||N0).forEach(i=>document.addEventListener(i,o)),()=>{(t||N0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function qw({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 H_(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function W_(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function Gw(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:W_(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),H_(i.current,a=>o(a.matches))},[e]),r}function q_(e,t){return Gw("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const rl=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Mo(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function Qw({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 Mo(()=>{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 G_(e,t="body > :not(script)"){const n=qg(),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 Q_=/input|select|textarea|button|object/,Kw="a, input, select, textarea, button, object, [tabindex]";function K_(e){return e.style.display==="none"}function Y_(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(K_(n))return!1;n=n.parentNode}return!0}function Yw(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function rm(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(Yw(e));return(Q_.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&Y_(e)}function Xw(e){const t=Yw(e);return(Number.isNaN(t)||t>=0)&&rm(e)}function X_(e){return Array.from(e.querySelectorAll(Kw)).filter(Xw)}function J_(e,t){const n=X_(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 Z_(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(Kw));a=l.find(Xw)||l.find(rm)||null,!a&&rm(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=G_(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&&J_(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const eD=e=>(e+1)%1e6;function tD(){const[,e]=p.useReducer(eD,0);return e}const nD=un.useId||(()=>{});function rD(){const e=nD();return e?`mantine-${e.replace(/:/g,"")}`:""}function Un(e){const t=rD(),[n,r]=p.useState(t);return rl(()=>{r(qg())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function Jw(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Rf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function oD(...e){return t=>{e.forEach(n=>Rf(n,t))}}function rn(...e){return p.useCallback(oD(...e),e)}function yn({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 si(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Au="dots";function iD({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]=yn({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 si(1,a);const w=Math.max(l-t,n),y=Math.min(l+t,a-n),S=w>n+2,b=y<a-(n+1);if(!S&&b){const x=t*2+n+2;return[...si(1,x),Au,...si(a-(n-1),a)]}if(S&&!b){const x=n+1+2*t;return[...si(1,n),Au,...si(a-x,a)]}return[...si(1,n),Au,...si(w,y),Au,...si(a-n+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function Gg(e,t){return Gw("(prefers-reduced-motion: reduce)",e,t)}function Qg(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 sD(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 aD(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 lD(){const[e,t]=p.useState(!1);return p.useEffect(()=>t(!0),[]),e}var cD={};function Zw(){return typeof process<"u"&&cD?"production":"development"}function ej(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=ej(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function rt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=ej(e))&&(r&&(r+=" "),r+=t);return r}const uD={};function dD(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=rt(t[r],o):t[r]=o})}),t}function _f({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||uD);return dD(i)}function Rd({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 Kg=p.createContext(null);function Li(){const e=p.useContext(Kg);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function fD(){return Li().cssVariablesResolver}function hD(){return Li().classNamesPrefix}function Df(){return Li().getStyleNonce}function pD(){return Li().withStaticClasses}function mD(){return Li().headless}function gD(){var e;return(e=Li().stylesTransform)==null?void 0:e.sx}function vD(){var e;return(e=Li().stylesTransform)==null?void 0:e.styles}function yD(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function xD(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 bD(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 SD(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 Yg(e){return yD(e)?xD(e):e.startsWith("rgb")?bD(e):e.startsWith("hsl")?SD(e):{r:0,g:0,b:0,a:1}}function Nu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Yg(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function ic(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function tp(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function wD(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function jD(e){if(e.startsWith("oklch("))return(wD(e)||0)/100;const{r:t,g:n,b:r}=Yg(e),o=t/255,i=n/255,a=r/255,l=tp(o),c=tp(i),u=tp(a);return .2126*l+.7152*c+.0722*u}function Cl(e,t=.179){return e.startsWith("var(")?!1:jD(e)>t}function Pr({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:Cl(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:Cl(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:Cl(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][ic(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:a,isLight:Cl(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:Cl(e,t.luminanceThreshold),shade:i,variable:void 0}}function at(e,t){const n=Pr({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function om(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=at(n.from,t),o=at(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function Sr(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}=Yg(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const ra=Sr,CD=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=Pr({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:`${B(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${i.shade===9?8:i.shade+1})`,color:l,border:`${B(1)} solid transparent`}:{background:e,hover:Nu(e,.1),color:l,border:`${B(1)} solid transparent`}}if(n==="light"){if(i.isThemeColor){if(i.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:Sr(l,.1),hover:Sr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}}return{background:Sr(e,.1),hover:Sr(e,.12),color:e,border:`${B(1)} solid transparent`}}if(n==="outline")return i.isThemeColor?i.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${B(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Sr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${B(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:Sr(e,.05),color:e,border:`${B(1)} solid ${e}`};if(n==="subtle"){if(i.isThemeColor){if(i.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:Sr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}}return{background:"transparent",hover:Sr(e,.12),color:e,border:`${B(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${B(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${B(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${B(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:Nu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${B(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Nu(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${B(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Nu(t.white,.01),color:e,border:`${B(1)} solid transparent`}:n==="gradient"?{background:om(r,t),hover:om(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${B(1)} solid var(--mantine-color-default-border)`}:{}},ED={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"]},M0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Xg={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:ED,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:CD,autoContrast:!1,luminanceThreshold:.3,fontFamily:M0,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:M0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:B(34),lineHeight:"1.3"},h2:{fontSize:B(26),lineHeight:"1.35"},h3:{fontSize:B(22),lineHeight:"1.4"},h4:{fontSize:B(18),lineHeight:"1.45"},h5:{fontSize:B(16),lineHeight:"1.5"},h6:{fontSize:B(14),lineHeight:"1.5"}}},fontSizes:{xs:B(12),sm:B(14),md:B(16),lg:B(18),xl:B(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:B(2),sm:B(4),md:B(8),lg:B(16),xl:B(32)},spacing:{xs:B(10),sm:B(12),md:B(16),lg:B(20),xl:B(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), 0 ${B(1)} ${B(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(10)} ${B(15)} ${B(-5)}, rgba(0, 0, 0, 0.04) 0 ${B(7)} ${B(7)} ${B(-5)}`,md:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(20)} ${B(25)} ${B(-5)}, rgba(0, 0, 0, 0.04) 0 ${B(10)} ${B(10)} ${B(-5)}`,lg:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(28)} ${B(23)} ${B(-7)}, rgba(0, 0, 0, 0.04) 0 ${B(12)} ${B(12)} ${B(-7)}`,xl:`0 ${B(1)} ${B(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${B(36)} ${B(28)} ${B(-7)}, rgba(0, 0, 0, 0.04) 0 ${B(17)} ${B(17)} ${B(-7)}`},other:{},components:{}};function O0(e){return e==="auto"||e==="dark"||e==="light"}function TD({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 O0(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&&O0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const PD="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",L0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function np(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function $0(e){if(!(e.primaryColor in e.colors))throw new Error(PD);if(typeof e.primaryShade=="object"&&(!np(e.primaryShade.dark)||!np(e.primaryShade.light)))throw new Error(L0);if(typeof e.primaryShade=="number"&&!np(e.primaryShade))throw new Error(L0)}function kD(e,t){var r;if(!t)return $0(e),e;const n=Vg(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),$0(n),n}const Jg=p.createContext(null),RD=()=>p.useContext(Jg)||Xg;function At(){const e=p.useContext(Jg);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 tj({theme:e,children:t,inherit:n=!0}){const r=RD(),o=p.useMemo(()=>kD(n?r:Xg,e),[e,r,n]);return s.jsx(Jg.Provider,{value:o,children:t})}tj.displayName="@mantine/core/MantineThemeProvider";function _D(){const e=At(),t=Df(),n=xt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),a=rc(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 rp(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function El(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function DD(e,t){const n=rp(e.variables),r=n?El(t,n):"",o=rp(e.dark),i=rp(e.light),a=o?El(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",l=i?El(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,i):"";return`${r}${a}${l}`}function Go({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Pr({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function F0(e,t){return Go({color:e.colors[e.primaryColor][ic(e,t)],theme:e,autoContrast:null})}function Mu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=ic(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`]:ra(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:ra(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`]:ra(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=ic(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`]:ra(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:ra(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`]:ra(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 ID(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function oa(e,t,n){xt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const nj=e=>{const t=ic(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:B(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":F0(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":F0(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)"}};oa(r.variables,e.breakpoints,"breakpoint"),oa(r.variables,e.spacing,"spacing"),oa(r.variables,e.fontSizes,"font-size"),oa(r.variables,e.lineHeights,"line-height"),oa(r.variables,e.shadows,"shadow"),oa(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),xt(e.colors).forEach(i=>{const a=e.colors[i];if(ID(a)){Object.assign(r.light,Mu({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Mu({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,Mu({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Mu({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return xt(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 AD({theme:e,generator:t}){const n=nj(e),r=t==null?void 0:t(e);return r?Vg(n,r):n}const op=nj(Xg);function ND(e){const t={variables:{},light:{},dark:{}};return xt(e.variables).forEach(n=>{op.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),xt(e.light).forEach(n=>{op.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),xt(e.dark).forEach(n=>{op.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function MD(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 rj({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=At(),r=Df(),o=fD(),i=AD({theme:n,generator:o}),a=e===":root"&&t,l=a?ND(i):i,c=DD(l,e);return c?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${a?"":MD(e)}`}}):null}rj.displayName="@mantine/CssVariables";function OD(){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 ia(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 LD({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||(ia(d,n),a(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{a(t),ia(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),rl(()=>{ia(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return ia(r,n),()=>{};r===void 0&&ia(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&ia(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 $D({respectReducedMotion:e,getRootElement:t}){rl(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}OD();function oj({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=TD(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:m,stylesTransform:g}){const{colorScheme:v,setColorScheme:w,clearColorScheme:y}=LD({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return $D({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),s.jsx(Kg.Provider,{value:{colorScheme:v,setColorScheme:w,clearColorScheme:y,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r,stylesTransform:g},children:s.jsxs(tj,{theme:e,children:[a&&s.jsx(rj,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&s.jsx(_D,{}),t]})})}oj.displayName="@mantine/core/MantineProvider";function zc({classNames:e,styles:t,props:n,stylesCtx:r}){const o=At();return{resolvedClassNames:_f({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Rd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const FD={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function zD({theme:e,options:t,unstyled:n}){return rt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||FD[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function BD({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return _f({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function z0({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return _f({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function UD({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function VD({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function HD({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function WD({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var a,l;return(l=_f({theme:t,classNames:(a=t.components[i])==null?void 0:a.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function qD({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function GD({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 rt(zD({theme:e,options:t,unstyled:l||m}),WD({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),qD({options:t,classes:a,selector:r,unstyled:l}),z0({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),z0({selector:r,stylesCtx:f,theme:e,classNames:g,props:d}),BD({selector:r,stylesCtx:f,options:t,props:d,theme:e}),UD({rootSelector:u,selector:r,className:c}),VD({selector:r,classes:a,unstyled:l||m}),h&&!m&&HD({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function QD({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var a;return Rd({theme:e,styles:(a=e.components[i])==null?void 0:a.styles,props:n,stylesCtx:r})[o]}).reduce((i,a)=>({...i,...a}),{})}function im({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...im({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function KD(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Oi(n[r])}}),t),{})}function YD({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:l}){var c;return(c=KD([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 XD({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&&QD({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!h&&Rd({theme:e,styles:l,props:o,stylesCtx:i})[n],...!h&&Rd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...YD({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...a===n?im({style:c,theme:e}):null,...im({style:r==null?void 0:r.style,theme:e})}}function JD({props:e,stylesCtx:t,themeName:n}){var a;const r=At(),o=(a=vD())==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 ce({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=At(),m=hD(),g=pD(),v=mD(),w=(Array.isArray(e)?e:[e]).filter(b=>b),{withStylesTransform:y,getTransformedStyles:S}=JD({props:n,stylesCtx:r,themeName:w});return(b,x)=>({className:GD({theme:h,options:x,themeName:w,selector:b,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:g,headless:v,transformedStyles:S([x==null?void 0:x.styles,u])}),style:XD({theme:h,themeName:w,selector:b,options:x,props:n,stylesCtx:r,rootSelector:a,styles:u,style:i,vars:d,varsResolver:f,headless:v,withStylesTransform:y})})}function Is(e,t){return typeof e=="boolean"?e:t.autoContrast}function B0(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 ZD({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(Kg),o=Df(),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?()=>{}:B0(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?()=>{}:B0(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var f;(f=t.current)==null||f.call(t)},10)},c=q_("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 H(e,t,n){var a;const r=At(),o=(a=r.components[e])==null?void 0:a.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...Oi(n)}}function ip(e){return xt(e).reduce((t,n)=>e[n]!==void 0?`${t}${A_(n)}:${e[n]};`:t,"").trim()}function eI({selector:e,styles:t,media:n,container:r}){const o=t?ip(t):"",i=Array.isArray(n)?n.map(l=>`@media${l.query}{${e}{${ip(l.styles)}}}`):[],a=Array.isArray(r)?r.map(l=>`@container ${l.query}{${e}{${ip(l.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${a.join("")}`.trim()}function As(e){const t=Df();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:eI(e)}})}function Qo(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:w,pe:y,ps:S,bd:b,bg:x,c:C,opacity:j,ff:T,fz:E,fw:_,lts:R,ta:A,lh:L,fs:U,tt:N,td:F,w:D,miw:k,maw:P,h:$,mih:O,mah:V,bgsz:K,bgp:ie,bgr:Re,bga:ae,pos:Ee,top:Fe,left:me,bottom:Le,right:nt,inset:Tt,display:Ve,flex:Te,hiddenFrom:Pe,visibleFrom:Xe,lightHidden:Qe,darkHidden:Z,sx:ue,...we}=e;return{styleProps:Oi({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:w,pe:y,ps:S,bd:b,bg:x,c:C,opacity:j,ff:T,fz:E,fw:_,lts:R,ta:A,lh:L,fs:U,tt:N,td:F,w:D,miw:k,maw:P,h:$,mih:O,mah:V,bgsz:K,bgp:ie,bgr:Re,bga:ae,pos:Ee,top:Fe,left:me,bottom:Le,right:nt,inset:Tt,display:Ve,flex:Te,hiddenFrom:Pe,visibleFrom:Xe,lightHidden:Qe,darkHidden:Z,sx:ue}),rest:we}}const tI={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 Zg(e,t){const n=Pr({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 nI(e,t){const n=Pr({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Zg(e,t)}function rI(e,t){if(typeof e=="number")return B(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(a=>a.trim()!=="");let i=`${B(n)}`;return r&&(i+=` ${r}`),o.length>0&&(i+=` ${Zg(o.join(" "),t)}`),i.trim()}return e}const U0={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 oI(e){return typeof e=="string"&&e in U0?U0[e]:e}const iI=["h1","h2","h3","h4","h5","h6"];function sI(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&iI.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?B(e):e}function aI(e){return e}const lI=["h1","h2","h3","h4","h5","h6"];function cI(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&lI.includes(e)?`var(--mantine-${e}-line-height)`:e}function uI(e){return typeof e=="number"?B(e):e}function dI(e,t){if(typeof e=="number")return B(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return B(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const sp={color:Zg,textColor:nI,fontSize:sI,spacing:dI,identity:aI,size:uI,lineHeight:cI,fontFamily:oI,border:rI};function V0(e){return e.replace("(min-width: ","").replace("em)","")}function fI({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(V0(o))-Number(V0(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function hI(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function pI(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function mI(e){return typeof e=="object"&&e!==null?xt(e).filter(t=>t!=="base"):[]}function gI(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function ij({styleProps:e,data:t,theme:n}){return fI(xt(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=pI(e[o]);if(!hI(e[o]))return a.forEach(u=>{r.inlineStyles[u]=sp[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=mI(e[o]);return a.forEach(u=>{l&&(r.styles[u]=sp[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:sp[i.type](gI(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Bc(){return`__m__-${p.useId().replace(/:/g,"")}`}function sj(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...sj(r,t)}),{}):typeof e=="function"?e(t):e??{}}function aj(e){return e.startsWith("data-")?e:`data-${e}`}function vI(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[aj(n)]=e[n]),t},{})}function lj(e){return e?typeof e=="string"?{[aj(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...lj(n)}),{}):vI(e):null}function sm(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...sm(r,t)}),{}):typeof e=="function"?e(t):e??{}}function yI({theme:e,style:t,vars:n,styleProps:r}){const o=sm(t,e),i=sm(n,e);return{...o,...i,...r}}const cj=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,__size:h,...m},g)=>{var E;const v=At(),w=e||"div",{styleProps:y,rest:S}=Qo(m),b=gD(),x=(E=b==null?void 0:b())==null?void 0:E(y.sx),C=Bc(),j=ij({styleProps:y,theme:v,data:tI}),T={ref:g,style:yI({theme:v,style:t,vars:n,styleProps:j.inlineStyles}),className:rt(r,x,{[C]: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":Vw(a)?void 0:a||void 0,size:h,...lj(i),...S};return s.jsxs(s.Fragment,{children:[j.hasResponsiveStyles&&s.jsx(As,{selector:`.${C}`,styles:j.styles,media:j.media}),typeof f=="function"?f(T):s.jsx(w,{...T})]})});cj.displayName="@mantine/core/Box";const q=cj;function uj(e){return e}function X(e){const t=p.forwardRef(e);return t.extend=uj,t.withProps=n=>{const r=p.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function Dn(e){const t=p.forwardRef(e);return t.withProps=n=>{const r=p.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=uj,t}const xI=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ns(){return p.useContext(xI)}var dj={exports:{}},mr={},fj={exports:{}},hj={};/**
|
|
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(P,$){var O=P.length;P.push($);e:for(;0<O;){var V=O-1>>>1,K=P[V];if(0<o(K,$))P[V]=$,P[O]=K,O=V;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var $=P[0],O=P.pop();if(O!==$){P[0]=O;e:for(var V=0,K=P.length,ie=K>>>1;V<ie;){var Re=2*(V+1)-1,ae=P[Re],Ee=Re+1,Fe=P[Ee];if(0>o(ae,O))Ee<K&&0>o(Fe,ae)?(P[V]=Fe,P[Ee]=O,V=Ee):(P[V]=ae,P[Re]=O,V=Re);else if(Ee<K&&0>o(Fe,O))P[V]=Fe,P[Ee]=O,V=Ee;else break e}}return $}function o(P,$){var O=P.sortIndex-$.sortIndex;return O!==0?O:P.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,w=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function b(P){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=P)r(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(u)}}function x(P){if(v=!1,b(P),!g)if(n(c)!==null)g=!0,D(C);else{var $=n(u);$!==null&&k(x,$.startTime-P)}}function C(P,$){g=!1,v&&(v=!1,y(E),E=-1),m=!0;var O=h;try{for(b($),f=n(c);f!==null&&(!(f.expirationTime>$)||P&&!A());){var V=f.callback;if(typeof V=="function"){f.callback=null,h=f.priorityLevel;var K=V(f.expirationTime<=$);$=e.unstable_now(),typeof K=="function"?f.callback=K:f===n(c)&&r(c),b($)}else r(c);f=n(c)}if(f!==null)var ie=!0;else{var Re=n(u);Re!==null&&k(x,Re.startTime-$),ie=!1}return ie}finally{f=null,h=O,m=!1}}var j=!1,T=null,E=-1,_=5,R=-1;function A(){return!(e.unstable_now()-R<_)}function L(){if(T!==null){var P=e.unstable_now();R=P;var $=!0;try{$=T(!0,P)}finally{$?U():(j=!1,T=null)}}else j=!1}var U;if(typeof S=="function")U=function(){S(L)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,F=N.port2;N.port1.onmessage=L,U=function(){F.postMessage(null)}}else U=function(){w(L,0)};function D(P){T=P,j||(j=!0,U())}function k(P,$){E=w(function(){P(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(P){P.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,D(C))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var O=h;h=$;try{return P()}finally{h=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,$){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var O=h;h=P;try{return $()}finally{h=O}},e.unstable_scheduleCallback=function(P,$,O){var V=e.unstable_now();switch(typeof O=="object"&&O!==null?(O=O.delay,O=typeof O=="number"&&0<O?V+O:V):O=V,P){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=O+K,P={id:d++,callback:$,priorityLevel:P,startTime:O,expirationTime:K,sortIndex:-1},O>V?(P.sortIndex=O,t(u,P),n(c)===null&&P===n(u)&&(v?(y(E),E=-1):v=!0,k(x,O-V))):(P.sortIndex=K,t(c,P),g||m||(g=!0,D(C))),P},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(P){var $=h;return function(){var O=h;h=$;try{return P.apply(this,arguments)}finally{h=O}}}})(hj);fj.exports=hj;var bI=fj.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 pj=p,fr=bI;function ee(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 mj=new Set,sc={};function Ms(e,t){za(e,t),za(e+"Capture",t)}function za(e,t){for(sc[e]=t,e=0;e<t.length;e++)mj.add(t[e])}var Oo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),am=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]*$/,H0={},W0={};function wI(e){return am.call(W0,e)?!0:am.call(H0,e)?!1:SI.test(e)?W0[e]=!0:(H0[e]=!0,!1)}function jI(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"||jI(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 Vn(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 xn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){xn[e]=new Vn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];xn[t]=new Vn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){xn[e]=new Vn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){xn[e]=new Vn(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){xn[e]=new Vn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){xn[e]=new Vn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){xn[e]=new Vn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){xn[e]=new Vn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){xn[e]=new Vn(e,5,!1,e.toLowerCase(),null,!1,!1)});var ev=/[\-:]([a-z])/g;function tv(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(ev,tv);xn[t]=new Vn(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(ev,tv);xn[t]=new Vn(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(ev,tv);xn[t]=new Vn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){xn[e]=new Vn(e,1,!1,e.toLowerCase(),null,!1,!1)});xn.xlinkHref=new Vn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){xn[e]=new Vn(e,1,!1,e.toLowerCase(),null,!0,!0)});function nv(e,t,n,r){var o=xn.hasOwnProperty(t)?xn[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?wI(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 Ko=pj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Ou=Symbol.for("react.element"),pa=Symbol.for("react.portal"),ma=Symbol.for("react.fragment"),rv=Symbol.for("react.strict_mode"),lm=Symbol.for("react.profiler"),gj=Symbol.for("react.provider"),vj=Symbol.for("react.context"),ov=Symbol.for("react.forward_ref"),cm=Symbol.for("react.suspense"),um=Symbol.for("react.suspense_list"),iv=Symbol.for("react.memo"),ci=Symbol.for("react.lazy"),yj=Symbol.for("react.offscreen"),q0=Symbol.iterator;function Tl(e){return e===null||typeof e!="object"?null:(e=q0&&e[q0]||e["@@iterator"],typeof e=="function"?e:null)}var Vt=Object.assign,ap;function zl(e){if(ap===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);ap=t&&t[1]||""}return`
|
|
77
|
+
`+ap+e}var lp=!1;function cp(e,t){if(!e||lp)return"";lp=!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{lp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?zl(e):""}function EI(e){switch(e.tag){case 5:return zl(e.type);case 16:return zl("Lazy");case 13:return zl("Suspense");case 19:return zl("SuspenseList");case 0:case 2:case 15:return e=cp(e.type,!1),e;case 11:return e=cp(e.type.render,!1),e;case 1:return e=cp(e.type,!0),e;default:return""}}function dm(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 ma:return"Fragment";case pa:return"Portal";case lm:return"Profiler";case rv:return"StrictMode";case cm:return"Suspense";case um:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case vj:return(e.displayName||"Context")+".Consumer";case gj:return(e._context.displayName||"Context")+".Provider";case ov:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case iv:return t=e.displayName||null,t!==null?t:dm(e.type)||"Memo";case ci:t=e._payload,e=e._init;try{return dm(e(t))}catch{}}return null}function TI(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 dm(t);case 8:return t===rv?"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 Ri(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function xj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function PI(e){var t=xj(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 Lu(e){e._valueTracker||(e._valueTracker=PI(e))}function bj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function _d(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 fm(e,t){var n=t.checked;return Vt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function G0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ri(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 Sj(e,t){t=t.checked,t!=null&&nv(e,"checked",t,!1)}function hm(e,t){Sj(e,t);var n=Ri(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")?pm(e,t.type,n):t.hasOwnProperty("defaultValue")&&pm(e,t.type,Ri(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Q0(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 pm(e,t,n){(t!=="number"||_d(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Bl=Array.isArray;function Da(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=""+Ri(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 mm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return Vt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function K0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(Bl(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ri(n)}}function wj(e,t){var n=Ri(t.value),r=Ri(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 Y0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function jj(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 gm(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?jj(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var $u,Cj=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($u=$u||document.createElement("div"),$u.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=$u.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ac(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Gl={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},kI=["Webkit","ms","Moz","O"];Object.keys(Gl).forEach(function(e){kI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Gl[t]=Gl[e]})});function Ej(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Gl.hasOwnProperty(e)&&Gl[e]?(""+t).trim():t+"px"}function Tj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Ej(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var RI=Vt({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 vm(e,t){if(t){if(RI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function ym(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 xm=null;function sv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bm=null,Ia=null,Aa=null;function X0(e){if(e=Hc(e)){if(typeof bm!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Of(t),bm(e.stateNode,e.type,t))}}function Pj(e){Ia?Aa?Aa.push(e):Aa=[e]:Ia=e}function kj(){if(Ia){var e=Ia,t=Aa;if(Aa=Ia=null,X0(e),t)for(e=0;e<t.length;e++)X0(t[e])}}function Rj(e,t){return e(t)}function _j(){}var up=!1;function Dj(e,t,n){if(up)return e(t,n);up=!0;try{return Rj(e,t,n)}finally{up=!1,(Ia!==null||Aa!==null)&&(_j(),kj())}}function lc(e,t){var n=e.stateNode;if(n===null)return null;var r=Of(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(ee(231,t,typeof n));return n}var Sm=!1;if(Oo)try{var Pl={};Object.defineProperty(Pl,"passive",{get:function(){Sm=!0}}),window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Sm=!1}function _I(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 Ql=!1,Dd=null,Id=!1,wm=null,DI={onError:function(e){Ql=!0,Dd=e}};function II(e,t,n,r,o,i,a,l,c){Ql=!1,Dd=null,_I.apply(DI,arguments)}function AI(e,t,n,r,o,i,a,l,c){if(II.apply(this,arguments),Ql){if(Ql){var u=Dd;Ql=!1,Dd=null}else throw Error(ee(198));Id||(Id=!0,wm=u)}}function Os(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 Ij(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 J0(e){if(Os(e)!==e)throw Error(ee(188))}function NI(e){var t=e.alternate;if(!t){if(t=Os(e),t===null)throw Error(ee(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 J0(o),e;if(i===r)return J0(o),t;i=i.sibling}throw Error(ee(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(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function Aj(e){return e=NI(e),e!==null?Nj(e):null}function Nj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Nj(e);if(t!==null)return t;e=e.sibling}return null}var Mj=fr.unstable_scheduleCallback,Z0=fr.unstable_cancelCallback,MI=fr.unstable_shouldYield,OI=fr.unstable_requestPaint,Xt=fr.unstable_now,LI=fr.unstable_getCurrentPriorityLevel,av=fr.unstable_ImmediatePriority,Oj=fr.unstable_UserBlockingPriority,Ad=fr.unstable_NormalPriority,$I=fr.unstable_LowPriority,Lj=fr.unstable_IdlePriority,If=null,po=null;function FI(e){if(po&&typeof po.onCommitFiberRoot=="function")try{po.onCommitFiberRoot(If,e,void 0,(e.current.flags&128)===128)}catch{}}var qr=Math.clz32?Math.clz32:UI,zI=Math.log,BI=Math.LN2;function UI(e){return e>>>=0,e===0?32:31-(zI(e)/BI|0)|0}var Fu=64,zu=4194304;function Ul(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 Nd(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=Ul(l):(i&=a,i!==0&&(r=Ul(i)))}else a=n&~o,a!==0?r=Ul(a):i!==0&&(r=Ul(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-qr(t),o=1<<n,r|=e[n],t&=~o;return r}function VI(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 HI(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-qr(i),l=1<<a,c=o[a];c===-1?(!(l&n)||l&r)&&(o[a]=VI(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function jm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function $j(){var e=Fu;return Fu<<=1,!(Fu&4194240)&&(Fu=64),e}function dp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Uc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-qr(t),e[t]=n}function WI(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-qr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function lv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-qr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ft=0;function Fj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var zj,cv,Bj,Uj,Vj,Cm=!1,Bu=[],xi=null,bi=null,Si=null,cc=new Map,uc=new Map,hi=[],qI="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 e1(e,t){switch(e){case"focusin":case"focusout":xi=null;break;case"dragenter":case"dragleave":bi=null;break;case"mouseover":case"mouseout":Si=null;break;case"pointerover":case"pointerout":cc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":uc.delete(t.pointerId)}}function kl(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=Hc(t),t!==null&&cv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function GI(e,t,n,r,o){switch(t){case"focusin":return xi=kl(xi,e,t,n,r,o),!0;case"dragenter":return bi=kl(bi,e,t,n,r,o),!0;case"mouseover":return Si=kl(Si,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return cc.set(i,kl(cc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,uc.set(i,kl(uc.get(i)||null,e,t,n,r,o)),!0}return!1}function Hj(e){var t=ss(e.target);if(t!==null){var n=Os(t);if(n!==null){if(t=n.tag,t===13){if(t=Ij(n),t!==null){e.blockedOn=t,Vj(e.priority,function(){Bj(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 dd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Em(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);xm=r,n.target.dispatchEvent(r),xm=null}else return t=Hc(n),t!==null&&cv(t),e.blockedOn=n,!1;t.shift()}return!0}function t1(e,t,n){dd(e)&&n.delete(t)}function QI(){Cm=!1,xi!==null&&dd(xi)&&(xi=null),bi!==null&&dd(bi)&&(bi=null),Si!==null&&dd(Si)&&(Si=null),cc.forEach(t1),uc.forEach(t1)}function Rl(e,t){e.blockedOn===t&&(e.blockedOn=null,Cm||(Cm=!0,fr.unstable_scheduleCallback(fr.unstable_NormalPriority,QI)))}function dc(e){function t(o){return Rl(o,e)}if(0<Bu.length){Rl(Bu[0],e);for(var n=1;n<Bu.length;n++){var r=Bu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(xi!==null&&Rl(xi,e),bi!==null&&Rl(bi,e),Si!==null&&Rl(Si,e),cc.forEach(t),uc.forEach(t),n=0;n<hi.length;n++)r=hi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<hi.length&&(n=hi[0],n.blockedOn===null);)Hj(n),n.blockedOn===null&&hi.shift()}var Na=Ko.ReactCurrentBatchConfig,Md=!0;function KI(e,t,n,r){var o=ft,i=Na.transition;Na.transition=null;try{ft=1,uv(e,t,n,r)}finally{ft=o,Na.transition=i}}function YI(e,t,n,r){var o=ft,i=Na.transition;Na.transition=null;try{ft=4,uv(e,t,n,r)}finally{ft=o,Na.transition=i}}function uv(e,t,n,r){if(Md){var o=Em(e,t,n,r);if(o===null)Sp(e,t,r,Od,n),e1(e,r);else if(GI(o,e,t,n,r))r.stopPropagation();else if(e1(e,r),t&4&&-1<qI.indexOf(e)){for(;o!==null;){var i=Hc(o);if(i!==null&&zj(i),i=Em(e,t,n,r),i===null&&Sp(e,t,r,Od,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Sp(e,t,r,null,n)}}var Od=null;function Em(e,t,n,r){if(Od=null,e=sv(r),e=ss(e),e!==null)if(t=Os(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Ij(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 Od=e,null}function Wj(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(LI()){case av:return 1;case Oj:return 4;case Ad:case $I:return 16;case Lj:return 536870912;default:return 16}default:return 16}}var vi=null,dv=null,fd=null;function qj(){if(fd)return fd;var e,t=dv,n=t.length,r,o="value"in vi?vi.value:vi.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 fd=o.slice(e,1<r?1-r:void 0)}function hd(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 Uu(){return!0}function n1(){return!1}function gr(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)?Uu:n1,this.isPropagationStopped=n1,this}return Vt(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=Uu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Uu)},persist:function(){},isPersistent:Uu}),t}var ol={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},fv=gr(ol),Vc=Vt({},ol,{view:0,detail:0}),XI=gr(Vc),fp,hp,_l,Af=Vt({},Vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hv,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!==_l&&(_l&&e.type==="mousemove"?(fp=e.screenX-_l.screenX,hp=e.screenY-_l.screenY):hp=fp=0,_l=e),fp)},movementY:function(e){return"movementY"in e?e.movementY:hp}}),r1=gr(Af),JI=Vt({},Af,{dataTransfer:0}),ZI=gr(JI),eA=Vt({},Vc,{relatedTarget:0}),pp=gr(eA),tA=Vt({},ol,{animationName:0,elapsedTime:0,pseudoElement:0}),nA=gr(tA),rA=Vt({},ol,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),oA=gr(rA),iA=Vt({},ol,{data:0}),o1=gr(iA),sA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},aA={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"},lA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cA(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lA[e])?!!t[e]:!1}function hv(){return cA}var uA=Vt({},Vc,{key:function(e){if(e.key){var t=sA[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=hd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?aA[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hv,charCode:function(e){return e.type==="keypress"?hd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?hd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),dA=gr(uA),fA=Vt({},Af,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),i1=gr(fA),hA=Vt({},Vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hv}),pA=gr(hA),mA=Vt({},ol,{propertyName:0,elapsedTime:0,pseudoElement:0}),gA=gr(mA),vA=Vt({},Af,{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}),yA=gr(vA),xA=[9,13,27,32],pv=Oo&&"CompositionEvent"in window,Kl=null;Oo&&"documentMode"in document&&(Kl=document.documentMode);var bA=Oo&&"TextEvent"in window&&!Kl,Gj=Oo&&(!pv||Kl&&8<Kl&&11>=Kl),s1=" ",a1=!1;function Qj(e,t){switch(e){case"keyup":return xA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ga=!1;function SA(e,t){switch(e){case"compositionend":return Kj(t);case"keypress":return t.which!==32?null:(a1=!0,s1);case"textInput":return e=t.data,e===s1&&a1?null:e;default:return null}}function wA(e,t){if(ga)return e==="compositionend"||!pv&&Qj(e,t)?(e=qj(),fd=dv=vi=null,ga=!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 Gj&&t.locale!=="ko"?null:t.data;default:return null}}var jA={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 l1(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!jA[e.type]:t==="textarea"}function Yj(e,t,n,r){Pj(r),t=Ld(t,"onChange"),0<t.length&&(n=new fv("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Yl=null,fc=null;function CA(e){aC(e,0)}function Nf(e){var t=xa(e);if(bj(t))return e}function EA(e,t){if(e==="change")return t}var Xj=!1;if(Oo){var mp;if(Oo){var gp="oninput"in document;if(!gp){var c1=document.createElement("div");c1.setAttribute("oninput","return;"),gp=typeof c1.oninput=="function"}mp=gp}else mp=!1;Xj=mp&&(!document.documentMode||9<document.documentMode)}function u1(){Yl&&(Yl.detachEvent("onpropertychange",Jj),fc=Yl=null)}function Jj(e){if(e.propertyName==="value"&&Nf(fc)){var t=[];Yj(t,fc,e,sv(e)),Dj(CA,t)}}function TA(e,t,n){e==="focusin"?(u1(),Yl=t,fc=n,Yl.attachEvent("onpropertychange",Jj)):e==="focusout"&&u1()}function PA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Nf(fc)}function kA(e,t){if(e==="click")return Nf(t)}function RA(e,t){if(e==="input"||e==="change")return Nf(t)}function _A(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Kr=typeof Object.is=="function"?Object.is:_A;function hc(e,t){if(Kr(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(!am.call(t,o)||!Kr(e[o],t[o]))return!1}return!0}function d1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function f1(e,t){var n=d1(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=d1(n)}}function Zj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function eC(){for(var e=window,t=_d();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_d(e.document)}return t}function mv(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 DA(e){var t=eC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Zj(n.ownerDocument.documentElement,n)){if(r!==null&&mv(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=f1(n,i);var a=f1(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 IA=Oo&&"documentMode"in document&&11>=document.documentMode,va=null,Tm=null,Xl=null,Pm=!1;function h1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pm||va==null||va!==_d(r)||(r=va,"selectionStart"in r&&mv(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}),Xl&&hc(Xl,r)||(Xl=r,r=Ld(Tm,"onSelect"),0<r.length&&(t=new fv("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=va)))}function Vu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ya={animationend:Vu("Animation","AnimationEnd"),animationiteration:Vu("Animation","AnimationIteration"),animationstart:Vu("Animation","AnimationStart"),transitionend:Vu("Transition","TransitionEnd")},vp={},tC={};Oo&&(tC=document.createElement("div").style,"AnimationEvent"in window||(delete ya.animationend.animation,delete ya.animationiteration.animation,delete ya.animationstart.animation),"TransitionEvent"in window||delete ya.transitionend.transition);function Mf(e){if(vp[e])return vp[e];if(!ya[e])return e;var t=ya[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in tC)return vp[e]=t[n];return e}var nC=Mf("animationend"),rC=Mf("animationiteration"),oC=Mf("animationstart"),iC=Mf("transitionend"),sC=new Map,p1="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 $i(e,t){sC.set(e,t),Ms(t,[e])}for(var yp=0;yp<p1.length;yp++){var xp=p1[yp],AA=xp.toLowerCase(),NA=xp[0].toUpperCase()+xp.slice(1);$i(AA,"on"+NA)}$i(nC,"onAnimationEnd");$i(rC,"onAnimationIteration");$i(oC,"onAnimationStart");$i("dblclick","onDoubleClick");$i("focusin","onFocus");$i("focusout","onBlur");$i(iC,"onTransitionEnd");za("onMouseEnter",["mouseout","mouseover"]);za("onMouseLeave",["mouseout","mouseover"]);za("onPointerEnter",["pointerout","pointerover"]);za("onPointerLeave",["pointerout","pointerover"]);Ms("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Ms("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Ms("onBeforeInput",["compositionend","keypress","textInput","paste"]);Ms("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Ms("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Ms("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Vl="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(" "),MA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Vl));function m1(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,AI(r,t,void 0,e),e.currentTarget=null}function aC(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;m1(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;m1(o,l,u),i=c}}}if(Id)throw e=wm,Id=!1,wm=null,e}function kt(e,t){var n=t[Im];n===void 0&&(n=t[Im]=new Set);var r=e+"__bubble";n.has(r)||(lC(t,e,2,!1),n.add(r))}function bp(e,t,n){var r=0;t&&(r|=4),lC(n,e,r,t)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function pc(e){if(!e[Hu]){e[Hu]=!0,mj.forEach(function(n){n!=="selectionchange"&&(MA.has(n)||bp(n,!1,e),bp(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hu]||(t[Hu]=!0,bp("selectionchange",!1,t))}}function lC(e,t,n,r){switch(Wj(t)){case 1:var o=KI;break;case 4:o=YI;break;default:o=uv}n=o.bind(null,t,n,e),o=void 0,!Sm||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 Sp(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=ss(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}Dj(function(){var u=i,d=sv(n),f=[];e:{var h=sC.get(e);if(h!==void 0){var m=fv,g=e;switch(e){case"keypress":if(hd(n)===0)break e;case"keydown":case"keyup":m=dA;break;case"focusin":g="focus",m=pp;break;case"focusout":g="blur",m=pp;break;case"beforeblur":case"afterblur":m=pp;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=r1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=ZI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=pA;break;case nC:case rC:case oC:m=nA;break;case iC:m=gA;break;case"scroll":m=XI;break;case"wheel":m=yA;break;case"copy":case"cut":case"paste":m=oA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=i1}var v=(t&4)!==0,w=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var S=u,b;S!==null;){b=S;var x=b.stateNode;if(b.tag===5&&x!==null&&(b=x,y!==null&&(x=lc(S,y),x!=null&&v.push(mc(S,x,b)))),w)break;S=S.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!==xm&&(g=n.relatedTarget||n.fromElement)&&(ss(g)||g[Lo]))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?ss(g):null,g!==null&&(w=Os(g),g!==w||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=r1,x="onMouseLeave",y="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(v=i1,x="onPointerLeave",y="onPointerEnter",S="pointer"),w=m==null?h:xa(m),b=g==null?h:xa(g),h=new v(x,S+"leave",m,n,d),h.target=w,h.relatedTarget=b,x=null,ss(d)===u&&(v=new v(y,S+"enter",g,n,d),v.target=b,v.relatedTarget=w,x=v),w=x,m&&g)t:{for(v=m,y=g,S=0,b=v;b;b=sa(b))S++;for(b=0,x=y;x;x=sa(x))b++;for(;0<S-b;)v=sa(v),S--;for(;0<b-S;)y=sa(y),b--;for(;S--;){if(v===y||y!==null&&v===y.alternate)break t;v=sa(v),y=sa(y)}v=null}else v=null;m!==null&&g1(f,h,m,v,!1),g!==null&&w!==null&&g1(f,w,g,v,!0)}}e:{if(h=u?xa(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var C=EA;else if(l1(h))if(Xj)C=RA;else{C=PA;var j=TA}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=kA);if(C&&(C=C(e,u))){Yj(f,C,n,d);break e}j&&j(e,h,u),e==="focusout"&&(j=h._wrapperState)&&j.controlled&&h.type==="number"&&pm(h,"number",h.value)}switch(j=u?xa(u):window,e){case"focusin":(l1(j)||j.contentEditable==="true")&&(va=j,Tm=u,Xl=null);break;case"focusout":Xl=Tm=va=null;break;case"mousedown":Pm=!0;break;case"contextmenu":case"mouseup":case"dragend":Pm=!1,h1(f,n,d);break;case"selectionchange":if(IA)break;case"keydown":case"keyup":h1(f,n,d)}var T;if(pv)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else ga?Qj(e,n)&&(E="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(E="onCompositionStart");E&&(Gj&&n.locale!=="ko"&&(ga||E!=="onCompositionStart"?E==="onCompositionEnd"&&ga&&(T=qj()):(vi=d,dv="value"in vi?vi.value:vi.textContent,ga=!0)),j=Ld(u,E),0<j.length&&(E=new o1(E,e,null,n,d),f.push({event:E,listeners:j}),T?E.data=T:(T=Kj(n),T!==null&&(E.data=T)))),(T=bA?SA(e,n):wA(e,n))&&(u=Ld(u,"onBeforeInput"),0<u.length&&(d=new o1("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=T))}aC(f,t)})}function mc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ld(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=lc(e,n),i!=null&&r.unshift(mc(e,i,o)),i=lc(e,t),i!=null&&r.push(mc(e,i,o))),e=e.return}return r}function sa(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function g1(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=lc(n,i),c!=null&&a.unshift(mc(n,c,l))):o||(c=lc(n,i),c!=null&&a.push(mc(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var OA=/\r\n?/g,LA=/\u0000|\uFFFD/g;function v1(e){return(typeof e=="string"?e:""+e).replace(OA,`
|
|
81
|
+
`).replace(LA,"")}function Wu(e,t,n){if(t=v1(t),v1(e)!==t&&n)throw Error(ee(425))}function $d(){}var km=null,Rm=null;function _m(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 Dm=typeof setTimeout=="function"?setTimeout:void 0,$A=typeof clearTimeout=="function"?clearTimeout:void 0,y1=typeof Promise=="function"?Promise:void 0,FA=typeof queueMicrotask=="function"?queueMicrotask:typeof y1<"u"?function(e){return y1.resolve(null).then(e).catch(zA)}:Dm;function zA(e){setTimeout(function(){throw e})}function wp(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),dc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);dc(t)}function wi(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 x1(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 il=Math.random().toString(36).slice(2),ho="__reactFiber$"+il,gc="__reactProps$"+il,Lo="__reactContainer$"+il,Im="__reactEvents$"+il,BA="__reactListeners$"+il,UA="__reactHandles$"+il;function ss(e){var t=e[ho];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Lo]||n[ho]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=x1(e);e!==null;){if(n=e[ho])return n;e=x1(e)}return t}e=n,n=e.parentNode}return null}function Hc(e){return e=e[ho]||e[Lo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function xa(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function Of(e){return e[gc]||null}var Am=[],ba=-1;function Fi(e){return{current:e}}function Dt(e){0>ba||(e.current=Am[ba],Am[ba]=null,ba--)}function Ct(e,t){ba++,Am[ba]=e.current,e.current=t}var _i={},Rn=Fi(_i),Gn=Fi(!1),gs=_i;function Ba(e,t){var n=e.type.contextTypes;if(!n)return _i;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 Qn(e){return e=e.childContextTypes,e!=null}function Fd(){Dt(Gn),Dt(Rn)}function b1(e,t,n){if(Rn.current!==_i)throw Error(ee(168));Ct(Rn,t),Ct(Gn,n)}function cC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ee(108,TI(e)||"Unknown",o));return Vt({},n,r)}function zd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||_i,gs=Rn.current,Ct(Rn,e),Ct(Gn,Gn.current),!0}function S1(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=cC(e,t,gs),r.__reactInternalMemoizedMergedChildContext=e,Dt(Gn),Dt(Rn),Ct(Rn,e)):Dt(Gn),Ct(Gn,n)}var Po=null,Lf=!1,jp=!1;function uC(e){Po===null?Po=[e]:Po.push(e)}function VA(e){Lf=!0,uC(e)}function zi(){if(!jp&&Po!==null){jp=!0;var e=0,t=ft;try{var n=Po;for(ft=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Po=null,Lf=!1}catch(o){throw Po!==null&&(Po=Po.slice(e+1)),Mj(av,zi),o}finally{ft=t,jp=!1}}return null}var Sa=[],wa=0,Bd=null,Ud=0,wr=[],jr=0,vs=null,Ro=1,_o="";function Ji(e,t){Sa[wa++]=Ud,Sa[wa++]=Bd,Bd=e,Ud=t}function dC(e,t,n){wr[jr++]=Ro,wr[jr++]=_o,wr[jr++]=vs,vs=e;var r=Ro;e=_o;var o=32-qr(r)-1;r&=~(1<<o),n+=1;var i=32-qr(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Ro=1<<32-qr(t)+o|n<<o|r,_o=i+e}else Ro=1<<i|n<<o|r,_o=e}function gv(e){e.return!==null&&(Ji(e,1),dC(e,1,0))}function vv(e){for(;e===Bd;)Bd=Sa[--wa],Sa[wa]=null,Ud=Sa[--wa],Sa[wa]=null;for(;e===vs;)vs=wr[--jr],wr[jr]=null,_o=wr[--jr],wr[jr]=null,Ro=wr[--jr],wr[jr]=null}var dr=null,lr=null,Ot=!1,Vr=null;function fC(e,t){var n=Cr(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 w1(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,dr=e,lr=wi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,dr=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=vs!==null?{id:Ro,overflow:_o}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Cr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,dr=e,lr=null,!0):!1;default:return!1}}function Nm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Mm(e){if(Ot){var t=lr;if(t){var n=t;if(!w1(e,t)){if(Nm(e))throw Error(ee(418));t=wi(n.nextSibling);var r=dr;t&&w1(e,t)?fC(r,n):(e.flags=e.flags&-4097|2,Ot=!1,dr=e)}}else{if(Nm(e))throw Error(ee(418));e.flags=e.flags&-4097|2,Ot=!1,dr=e}}}function j1(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;dr=e}function qu(e){if(e!==dr)return!1;if(!Ot)return j1(e),Ot=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!_m(e.type,e.memoizedProps)),t&&(t=lr)){if(Nm(e))throw hC(),Error(ee(418));for(;t;)fC(e,t),t=wi(t.nextSibling)}if(j1(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){lr=wi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}lr=null}}else lr=dr?wi(e.stateNode.nextSibling):null;return!0}function hC(){for(var e=lr;e;)e=wi(e.nextSibling)}function Ua(){lr=dr=null,Ot=!1}function yv(e){Vr===null?Vr=[e]:Vr.push(e)}var HA=Ko.ReactCurrentBatchConfig;function zr(e,t){if(e&&e.defaultProps){t=Vt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Vd=Fi(null),Hd=null,ja=null,xv=null;function bv(){xv=ja=Hd=null}function Sv(e){var t=Vd.current;Dt(Vd),e._currentValue=t}function Om(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ma(e,t){Hd=e,xv=ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(qn=!0),e.firstContext=null)}function kr(e){var t=e._currentValue;if(xv!==e)if(e={context:e,memoizedValue:t,next:null},ja===null){if(Hd===null)throw Error(ee(308));ja=e,Hd.dependencies={lanes:0,firstContext:e}}else ja=ja.next=e;return t}var as=null;function wv(e){as===null?as=[e]:as.push(e)}function pC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,wv(t)):(n.next=o.next,o.next=n),t.interleaved=n,$o(e,r)}function $o(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 ui=!1;function jv(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function mC(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 Io(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ji(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,tt&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,$o(e,n)}return o=r.interleaved,o===null?(t.next=t,wv(r)):(t.next=o.next,o.next=t),r.interleaved=t,$o(e,n)}function pd(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,lv(e,n)}}function C1(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 Wd(e,t,n,r){var o=e.updateQueue;ui=!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=Vt({},f,h);break e;case 2:ui=!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);xs|=a,e.lanes=a,e.memoizedState=f}}function E1(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(ee(191,o));o.call(r)}}}var gC=new pj.Component().refs;function Lm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Vt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var $f={isMounted:function(e){return(e=e._reactInternals)?Os(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=$n(),o=Ei(e),i=Io(r,o);i.payload=t,n!=null&&(i.callback=n),t=ji(e,i,o),t!==null&&(Gr(t,e,o,r),pd(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=$n(),o=Ei(e),i=Io(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ji(e,i,o),t!==null&&(Gr(t,e,o,r),pd(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=$n(),r=Ei(e),o=Io(n,r);o.tag=2,t!=null&&(o.callback=t),t=ji(e,o,r),t!==null&&(Gr(t,e,r,n),pd(t,e,r))}};function T1(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?!hc(n,r)||!hc(o,i):!0}function vC(e,t,n){var r=!1,o=_i,i=t.contextType;return typeof i=="object"&&i!==null?i=kr(i):(o=Qn(t)?gs:Rn.current,r=t.contextTypes,i=(r=r!=null)?Ba(e,o):_i),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=$f,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function P1(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&&$f.enqueueReplaceState(t,t.state,null)}function $m(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=gC,jv(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=kr(i):(i=Qn(t)?gs:Rn.current,o.context=Ba(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Lm(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&&$f.enqueueReplaceState(o,o.state,null),Wd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Dl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(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===gC&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function Gu(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function k1(e){var t=e._init;return t(e._payload)}function yC(e){function t(y,S){if(e){var b=y.deletions;b===null?(y.deletions=[S],y.flags|=16):b.push(S)}}function n(y,S){if(!e)return null;for(;S!==null;)t(y,S),S=S.sibling;return null}function r(y,S){for(y=new Map;S!==null;)S.key!==null?y.set(S.key,S):y.set(S.index,S),S=S.sibling;return y}function o(y,S){return y=Ti(y,S),y.index=0,y.sibling=null,y}function i(y,S,b){return y.index=b,e?(b=y.alternate,b!==null?(b=b.index,b<S?(y.flags|=2,S):b):(y.flags|=2,S)):(y.flags|=1048576,S)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,S,b,x){return S===null||S.tag!==6?(S=_p(b,y.mode,x),S.return=y,S):(S=o(S,b),S.return=y,S)}function c(y,S,b,x){var C=b.type;return C===ma?d(y,S,b.props.children,x,b.key):S!==null&&(S.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ci&&k1(C)===S.type)?(x=o(S,b.props),x.ref=Dl(y,S,b),x.return=y,x):(x=bd(b.type,b.key,b.props,null,y.mode,x),x.ref=Dl(y,S,b),x.return=y,x)}function u(y,S,b,x){return S===null||S.tag!==4||S.stateNode.containerInfo!==b.containerInfo||S.stateNode.implementation!==b.implementation?(S=Dp(b,y.mode,x),S.return=y,S):(S=o(S,b.children||[]),S.return=y,S)}function d(y,S,b,x,C){return S===null||S.tag!==7?(S=ps(b,y.mode,x,C),S.return=y,S):(S=o(S,b),S.return=y,S)}function f(y,S,b){if(typeof S=="string"&&S!==""||typeof S=="number")return S=_p(""+S,y.mode,b),S.return=y,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case Ou:return b=bd(S.type,S.key,S.props,null,y.mode,b),b.ref=Dl(y,null,S),b.return=y,b;case pa:return S=Dp(S,y.mode,b),S.return=y,S;case ci:var x=S._init;return f(y,x(S._payload),b)}if(Bl(S)||Tl(S))return S=ps(S,y.mode,b,null),S.return=y,S;Gu(y,S)}return null}function h(y,S,b,x){var C=S!==null?S.key:null;if(typeof b=="string"&&b!==""||typeof b=="number")return C!==null?null:l(y,S,""+b,x);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Ou:return b.key===C?c(y,S,b,x):null;case pa:return b.key===C?u(y,S,b,x):null;case ci:return C=b._init,h(y,S,C(b._payload),x)}if(Bl(b)||Tl(b))return C!==null?null:d(y,S,b,x,null);Gu(y,b)}return null}function m(y,S,b,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return y=y.get(b)||null,l(S,y,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Ou:return y=y.get(x.key===null?b:x.key)||null,c(S,y,x,C);case pa:return y=y.get(x.key===null?b:x.key)||null,u(S,y,x,C);case ci:var j=x._init;return m(y,S,b,j(x._payload),C)}if(Bl(x)||Tl(x))return y=y.get(b)||null,d(S,y,x,C,null);Gu(S,x)}return null}function g(y,S,b,x){for(var C=null,j=null,T=S,E=S=0,_=null;T!==null&&E<b.length;E++){T.index>E?(_=T,T=null):_=T.sibling;var R=h(y,T,b[E],x);if(R===null){T===null&&(T=_);break}e&&T&&R.alternate===null&&t(y,T),S=i(R,S,E),j===null?C=R:j.sibling=R,j=R,T=_}if(E===b.length)return n(y,T),Ot&&Ji(y,E),C;if(T===null){for(;E<b.length;E++)T=f(y,b[E],x),T!==null&&(S=i(T,S,E),j===null?C=T:j.sibling=T,j=T);return Ot&&Ji(y,E),C}for(T=r(y,T);E<b.length;E++)_=m(T,y,E,b[E],x),_!==null&&(e&&_.alternate!==null&&T.delete(_.key===null?E:_.key),S=i(_,S,E),j===null?C=_:j.sibling=_,j=_);return e&&T.forEach(function(A){return t(y,A)}),Ot&&Ji(y,E),C}function v(y,S,b,x){var C=Tl(b);if(typeof C!="function")throw Error(ee(150));if(b=C.call(b),b==null)throw Error(ee(151));for(var j=C=null,T=S,E=S=0,_=null,R=b.next();T!==null&&!R.done;E++,R=b.next()){T.index>E?(_=T,T=null):_=T.sibling;var A=h(y,T,R.value,x);if(A===null){T===null&&(T=_);break}e&&T&&A.alternate===null&&t(y,T),S=i(A,S,E),j===null?C=A:j.sibling=A,j=A,T=_}if(R.done)return n(y,T),Ot&&Ji(y,E),C;if(T===null){for(;!R.done;E++,R=b.next())R=f(y,R.value,x),R!==null&&(S=i(R,S,E),j===null?C=R:j.sibling=R,j=R);return Ot&&Ji(y,E),C}for(T=r(y,T);!R.done;E++,R=b.next())R=m(T,y,E,R.value,x),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?E:R.key),S=i(R,S,E),j===null?C=R:j.sibling=R,j=R);return e&&T.forEach(function(L){return t(y,L)}),Ot&&Ji(y,E),C}function w(y,S,b,x){if(typeof b=="object"&&b!==null&&b.type===ma&&b.key===null&&(b=b.props.children),typeof b=="object"&&b!==null){switch(b.$$typeof){case Ou:e:{for(var C=b.key,j=S;j!==null;){if(j.key===C){if(C=b.type,C===ma){if(j.tag===7){n(y,j.sibling),S=o(j,b.props.children),S.return=y,y=S;break e}}else if(j.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ci&&k1(C)===j.type){n(y,j.sibling),S=o(j,b.props),S.ref=Dl(y,j,b),S.return=y,y=S;break e}n(y,j);break}else t(y,j);j=j.sibling}b.type===ma?(S=ps(b.props.children,y.mode,x,b.key),S.return=y,y=S):(x=bd(b.type,b.key,b.props,null,y.mode,x),x.ref=Dl(y,S,b),x.return=y,y=x)}return a(y);case pa:e:{for(j=b.key;S!==null;){if(S.key===j)if(S.tag===4&&S.stateNode.containerInfo===b.containerInfo&&S.stateNode.implementation===b.implementation){n(y,S.sibling),S=o(S,b.children||[]),S.return=y,y=S;break e}else{n(y,S);break}else t(y,S);S=S.sibling}S=Dp(b,y.mode,x),S.return=y,y=S}return a(y);case ci:return j=b._init,w(y,S,j(b._payload),x)}if(Bl(b))return g(y,S,b,x);if(Tl(b))return v(y,S,b,x);Gu(y,b)}return typeof b=="string"&&b!==""||typeof b=="number"?(b=""+b,S!==null&&S.tag===6?(n(y,S.sibling),S=o(S,b),S.return=y,y=S):(n(y,S),S=_p(b,y.mode,x),S.return=y,y=S),a(y)):n(y,S)}return w}var Va=yC(!0),xC=yC(!1),Wc={},mo=Fi(Wc),vc=Fi(Wc),yc=Fi(Wc);function ls(e){if(e===Wc)throw Error(ee(174));return e}function Cv(e,t){switch(Ct(yc,t),Ct(vc,e),Ct(mo,Wc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gm(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gm(t,e)}Dt(mo),Ct(mo,t)}function Ha(){Dt(mo),Dt(vc),Dt(yc)}function bC(e){ls(yc.current);var t=ls(mo.current),n=gm(t,e.type);t!==n&&(Ct(vc,e),Ct(mo,n))}function Ev(e){vc.current===e&&(Dt(mo),Dt(vc))}var zt=Fi(0);function qd(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 Cp=[];function Tv(){for(var e=0;e<Cp.length;e++)Cp[e]._workInProgressVersionPrimary=null;Cp.length=0}var md=Ko.ReactCurrentDispatcher,Ep=Ko.ReactCurrentBatchConfig,ys=0,Ut=null,sn=null,ln=null,Gd=!1,Jl=!1,xc=0,WA=0;function Cn(){throw Error(ee(321))}function Pv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Kr(e[n],t[n]))return!1;return!0}function kv(e,t,n,r,o,i){if(ys=i,Ut=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,md.current=e===null||e.memoizedState===null?KA:YA,e=n(r,o),Jl){i=0;do{if(Jl=!1,xc=0,25<=i)throw Error(ee(301));i+=1,ln=sn=null,t.updateQueue=null,md.current=XA,e=n(r,o)}while(Jl)}if(md.current=Qd,t=sn!==null&&sn.next!==null,ys=0,ln=sn=Ut=null,Gd=!1,t)throw Error(ee(300));return e}function Rv(){var e=xc!==0;return xc=0,e}function co(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?Ut.memoizedState=ln=e:ln=ln.next=e,ln}function Rr(){if(sn===null){var e=Ut.alternate;e=e!==null?e.memoizedState:null}else e=sn.next;var t=ln===null?Ut.memoizedState:ln.next;if(t!==null)ln=t,sn=e;else{if(e===null)throw Error(ee(310));sn=e,e={memoizedState:sn.memoizedState,baseState:sn.baseState,baseQueue:sn.baseQueue,queue:sn.queue,next:null},ln===null?Ut.memoizedState=ln=e:ln=ln.next=e}return ln}function bc(e,t){return typeof t=="function"?t(e):t}function Tp(e){var t=Rr(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=sn,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((ys&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,Ut.lanes|=d,xs|=d}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=l,Kr(r,t.memoizedState)||(qn=!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,Ut.lanes|=i,xs|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Pp(e){var t=Rr(),n=t.queue;if(n===null)throw Error(ee(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);Kr(i,t.memoizedState)||(qn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function SC(){}function wC(e,t){var n=Ut,r=Rr(),o=t(),i=!Kr(r.memoizedState,o);if(i&&(r.memoizedState=o,qn=!0),r=r.queue,_v(EC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||ln!==null&&ln.memoizedState.tag&1){if(n.flags|=2048,Sc(9,CC.bind(null,n,r,o,t),void 0,null),fn===null)throw Error(ee(349));ys&30||jC(n,t,o)}return o}function jC(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ut.updateQueue,t===null?(t={lastEffect:null,stores:null},Ut.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function CC(e,t,n,r){t.value=n,t.getSnapshot=r,TC(t)&&PC(e)}function EC(e,t,n){return n(function(){TC(t)&&PC(e)})}function TC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Kr(e,n)}catch{return!0}}function PC(e){var t=$o(e,1);t!==null&&Gr(t,e,1,-1)}function R1(e){var t=co();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bc,lastRenderedState:e},t.queue=e,e=e.dispatch=QA.bind(null,Ut,e),[t.memoizedState,e]}function Sc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ut.updateQueue,t===null?(t={lastEffect:null,stores:null},Ut.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 kC(){return Rr().memoizedState}function gd(e,t,n,r){var o=co();Ut.flags|=e,o.memoizedState=Sc(1|t,n,void 0,r===void 0?null:r)}function Ff(e,t,n,r){var o=Rr();r=r===void 0?null:r;var i=void 0;if(sn!==null){var a=sn.memoizedState;if(i=a.destroy,r!==null&&Pv(r,a.deps)){o.memoizedState=Sc(t,n,i,r);return}}Ut.flags|=e,o.memoizedState=Sc(1|t,n,i,r)}function _1(e,t){return gd(8390656,8,e,t)}function _v(e,t){return Ff(2048,8,e,t)}function RC(e,t){return Ff(4,2,e,t)}function _C(e,t){return Ff(4,4,e,t)}function DC(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 IC(e,t,n){return n=n!=null?n.concat([e]):null,Ff(4,4,DC.bind(null,t,e),n)}function Dv(){}function AC(e,t){var n=Rr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function NC(e,t){var n=Rr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Pv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function MC(e,t,n){return ys&21?(Kr(n,t)||(n=$j(),Ut.lanes|=n,xs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,qn=!0),e.memoizedState=n)}function qA(e,t){var n=ft;ft=n!==0&&4>n?n:4,e(!0);var r=Ep.transition;Ep.transition={};try{e(!1),t()}finally{ft=n,Ep.transition=r}}function OC(){return Rr().memoizedState}function GA(e,t,n){var r=Ei(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},LC(e))$C(t,n);else if(n=pC(e,t,n,r),n!==null){var o=$n();Gr(n,e,r,o),FC(n,t,r)}}function QA(e,t,n){var r=Ei(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(LC(e))$C(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,Kr(l,a)){var c=t.interleaved;c===null?(o.next=o,wv(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=pC(e,t,o,r),n!==null&&(o=$n(),Gr(n,e,r,o),FC(n,t,r))}}function LC(e){var t=e.alternate;return e===Ut||t!==null&&t===Ut}function $C(e,t){Jl=Gd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function FC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,lv(e,n)}}var Qd={readContext:kr,useCallback:Cn,useContext:Cn,useEffect:Cn,useImperativeHandle:Cn,useInsertionEffect:Cn,useLayoutEffect:Cn,useMemo:Cn,useReducer:Cn,useRef:Cn,useState:Cn,useDebugValue:Cn,useDeferredValue:Cn,useTransition:Cn,useMutableSource:Cn,useSyncExternalStore:Cn,useId:Cn,unstable_isNewReconciler:!1},KA={readContext:kr,useCallback:function(e,t){return co().memoizedState=[e,t===void 0?null:t],e},useContext:kr,useEffect:_1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,gd(4194308,4,DC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return gd(4194308,4,e,t)},useInsertionEffect:function(e,t){return gd(4,2,e,t)},useMemo:function(e,t){var n=co();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=co();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=GA.bind(null,Ut,e),[r.memoizedState,e]},useRef:function(e){var t=co();return e={current:e},t.memoizedState=e},useState:R1,useDebugValue:Dv,useDeferredValue:function(e){return co().memoizedState=e},useTransition:function(){var e=R1(!1),t=e[0];return e=qA.bind(null,e[1]),co().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ut,o=co();if(Ot){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),fn===null)throw Error(ee(349));ys&30||jC(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,_1(EC.bind(null,r,i,e),[e]),r.flags|=2048,Sc(9,CC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=co(),t=fn.identifierPrefix;if(Ot){var n=_o,r=Ro;n=(r&~(1<<32-qr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=xc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=WA++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},YA={readContext:kr,useCallback:AC,useContext:kr,useEffect:_v,useImperativeHandle:IC,useInsertionEffect:RC,useLayoutEffect:_C,useMemo:NC,useReducer:Tp,useRef:kC,useState:function(){return Tp(bc)},useDebugValue:Dv,useDeferredValue:function(e){var t=Rr();return MC(t,sn.memoizedState,e)},useTransition:function(){var e=Tp(bc)[0],t=Rr().memoizedState;return[e,t]},useMutableSource:SC,useSyncExternalStore:wC,useId:OC,unstable_isNewReconciler:!1},XA={readContext:kr,useCallback:AC,useContext:kr,useEffect:_v,useImperativeHandle:IC,useInsertionEffect:RC,useLayoutEffect:_C,useMemo:NC,useReducer:Pp,useRef:kC,useState:function(){return Pp(bc)},useDebugValue:Dv,useDeferredValue:function(e){var t=Rr();return sn===null?t.memoizedState=e:MC(t,sn.memoizedState,e)},useTransition:function(){var e=Pp(bc)[0],t=Rr().memoizedState;return[e,t]},useMutableSource:SC,useSyncExternalStore:wC,useId:OC,unstable_isNewReconciler:!1};function Wa(e,t){try{var n="",r=t;do n+=EI(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 kp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Fm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var JA=typeof WeakMap=="function"?WeakMap:Map;function zC(e,t,n){n=Io(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Yd||(Yd=!0,Km=r),Fm(e,t)},n}function BC(e,t,n){n=Io(-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(){Fm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Fm(e,t),typeof r!="function"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function D1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new JA;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=fN.bind(null,e,t,n),t.then(e,e))}function I1(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 A1(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=Io(-1,1),t.tag=2,ji(n,t,1))),n.lanes|=1),e)}var ZA=Ko.ReactCurrentOwner,qn=!1;function Nn(e,t,n,r){t.child=e===null?xC(t,null,n,r):Va(t,e.child,n,r)}function N1(e,t,n,r,o){n=n.render;var i=t.ref;return Ma(t,o),r=kv(e,t,n,r,i,o),n=Rv(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Fo(e,t,o)):(Ot&&n&&gv(t),t.flags|=1,Nn(e,t,r,o),t.child)}function M1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Fv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,UC(e,t,i,r,o)):(e=bd(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:hc,n(a,r)&&e.ref===t.ref)return Fo(e,t,o)}return t.flags|=1,e=Ti(i,r),e.ref=t.ref,e.return=t,t.child=e}function UC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(hc(i,r)&&e.ref===t.ref)if(qn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(qn=!0);else return t.lanes=e.lanes,Fo(e,t,o)}return zm(e,t,n,r,o)}function VC(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},Ct(Ea,ir),ir|=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,Ct(Ea,ir),ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Ct(Ea,ir),ir|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Ct(Ea,ir),ir|=r;return Nn(e,t,o,n),t.child}function HC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zm(e,t,n,r,o){var i=Qn(n)?gs:Rn.current;return i=Ba(t,i),Ma(t,o),n=kv(e,t,n,r,i,o),r=Rv(),e!==null&&!qn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Fo(e,t,o)):(Ot&&r&&gv(t),t.flags|=1,Nn(e,t,n,o),t.child)}function O1(e,t,n,r,o){if(Qn(n)){var i=!0;zd(t)}else i=!1;if(Ma(t,o),t.stateNode===null)vd(e,t),vC(t,n,r),$m(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=kr(u):(u=Qn(n)?gs:Rn.current,u=Ba(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)&&P1(t,a,r,u),ui=!1;var h=t.memoizedState;a.state=h,Wd(t,r,a,o),c=t.memoizedState,l!==r||h!==c||Gn.current||ui?(typeof d=="function"&&(Lm(t,n,d,r),c=t.memoizedState),(l=ui||T1(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,mC(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:zr(t.type,l),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=kr(c):(c=Qn(n)?gs:Rn.current,c=Ba(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)&&P1(t,a,r,c),ui=!1,h=t.memoizedState,a.state=h,Wd(t,r,a,o);var g=t.memoizedState;l!==f||h!==g||Gn.current||ui?(typeof m=="function"&&(Lm(t,n,m,r),g=t.memoizedState),(u=ui||T1(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 Bm(e,t,n,r,i,o)}function Bm(e,t,n,r,o,i){HC(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&S1(t,n,!1),Fo(e,t,i);r=t.stateNode,ZA.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Va(t,e.child,null,i),t.child=Va(t,null,l,i)):Nn(e,t,l,i),t.memoizedState=r.state,o&&S1(t,n,!0),t.child}function WC(e){var t=e.stateNode;t.pendingContext?b1(e,t.pendingContext,t.pendingContext!==t.context):t.context&&b1(e,t.context,!1),Cv(e,t.containerInfo)}function L1(e,t,n,r,o){return Ua(),yv(o),t.flags|=256,Nn(e,t,n,r),t.child}var Um={dehydrated:null,treeContext:null,retryLane:0};function Vm(e){return{baseLanes:e,cachePool:null,transitions:null}}function qC(e,t,n){var r=t.pendingProps,o=zt.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),Ct(zt,o&1),e===null)return Mm(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=Uf(a,r,0,null),e=ps(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Vm(n),t.memoizedState=Um,e):Iv(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return eN(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=Ti(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Ti(l,i):(i=ps(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?Vm(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Um,r}return i=e.child,e=i.sibling,r=Ti(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Iv(e,t){return t=Uf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Qu(e,t,n,r){return r!==null&&yv(r),Va(t,e.child,null,n),e=Iv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function eN(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=kp(Error(ee(422))),Qu(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Uf({mode:"visible",children:r.children},o,0,null),i=ps(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Va(t,e.child,null,a),t.child.memoizedState=Vm(a),t.memoizedState=Um,i);if(!(t.mode&1))return Qu(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(ee(419)),r=kp(i,r,void 0),Qu(e,t,a,r)}if(l=(a&e.childLanes)!==0,qn||l){if(r=fn,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,$o(e,o),Gr(r,e,o,-1))}return $v(),r=kp(Error(ee(421))),Qu(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=hN.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,lr=wi(o.nextSibling),dr=t,Ot=!0,Vr=null,e!==null&&(wr[jr++]=Ro,wr[jr++]=_o,wr[jr++]=vs,Ro=e.id,_o=e.overflow,vs=t),t=Iv(t,r.children),t.flags|=4096,t)}function $1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Om(e.return,t,n)}function Rp(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 GC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Nn(e,t,r.children,n),r=zt.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&&$1(e,n,t);else if(e.tag===19)$1(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(Ct(zt,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&&qd(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Rp(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&&qd(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Rp(t,!0,n,null,i);break;case"together":Rp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function vd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Fo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),xs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=Ti(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ti(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function tN(e,t,n){switch(t.tag){case 3:WC(t),Ua();break;case 5:bC(t);break;case 1:Qn(t.type)&&zd(t);break;case 4:Cv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Ct(Vd,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Ct(zt,zt.current&1),t.flags|=128,null):n&t.child.childLanes?qC(e,t,n):(Ct(zt,zt.current&1),e=Fo(e,t,n),e!==null?e.sibling:null);Ct(zt,zt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return GC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ct(zt,zt.current),r)break;return null;case 22:case 23:return t.lanes=0,VC(e,t,n)}return Fo(e,t,n)}var QC,Hm,KC,YC;QC=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}};Hm=function(){};KC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ls(mo.current);var i=null;switch(n){case"input":o=fm(e,o),r=fm(e,r),i=[];break;case"select":o=Vt({},o,{value:void 0}),r=Vt({},r,{value:void 0}),i=[];break;case"textarea":o=mm(e,o),r=mm(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=$d)}vm(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"&&(sc.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"&&(sc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&kt("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)}};YC=function(e,t,n,r){n!==r&&(t.flags|=4)};function Il(e,t){if(!Ot)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 En(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 nN(e,t,n){var r=t.pendingProps;switch(vv(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return En(t),null;case 1:return Qn(t.type)&&Fd(),En(t),null;case 3:return r=t.stateNode,Ha(),Dt(Gn),Dt(Rn),Tv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(qu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vr!==null&&(Jm(Vr),Vr=null))),Hm(e,t),En(t),null;case 5:Ev(t);var o=ls(yc.current);if(n=t.type,e!==null&&t.stateNode!=null)KC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return En(t),null}if(e=ls(mo.current),qu(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ho]=t,r[gc]=i,e=(t.mode&1)!==0,n){case"dialog":kt("cancel",r),kt("close",r);break;case"iframe":case"object":case"embed":kt("load",r);break;case"video":case"audio":for(o=0;o<Vl.length;o++)kt(Vl[o],r);break;case"source":kt("error",r);break;case"img":case"image":case"link":kt("error",r),kt("load",r);break;case"details":kt("toggle",r);break;case"input":G0(r,i),kt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},kt("invalid",r);break;case"textarea":K0(r,i),kt("invalid",r)}vm(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&&Wu(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Wu(r.textContent,l,e),o=["children",""+l]):sc.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&kt("scroll",r)}switch(n){case"input":Lu(r),Q0(r,i,!0);break;case"textarea":Lu(r),Y0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=$d)}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=jj(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[ho]=t,e[gc]=r,QC(e,t,!1,!1),t.stateNode=e;e:{switch(a=ym(n,r),n){case"dialog":kt("cancel",e),kt("close",e),o=r;break;case"iframe":case"object":case"embed":kt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Vl.length;o++)kt(Vl[o],e);o=r;break;case"source":kt("error",e),o=r;break;case"img":case"image":case"link":kt("error",e),kt("load",e),o=r;break;case"details":kt("toggle",e),o=r;break;case"input":G0(e,r),o=fm(e,r),kt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Vt({},r,{value:void 0}),kt("invalid",e);break;case"textarea":K0(e,r),o=mm(e,r),kt("invalid",e);break;default:o=r}vm(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Tj(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Cj(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&ac(e,c):typeof c=="number"&&ac(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(sc.hasOwnProperty(i)?c!=null&&i==="onScroll"&&kt("scroll",e):c!=null&&nv(e,i,c,a))}switch(n){case"input":Lu(e),Q0(e,r,!1);break;case"textarea":Lu(e),Y0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ri(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Da(e,!!r.multiple,i,!1):r.defaultValue!=null&&Da(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=$d)}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 En(t),null;case 6:if(e&&t.stateNode!=null)YC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=ls(yc.current),ls(mo.current),qu(t)){if(r=t.stateNode,n=t.memoizedProps,r[ho]=t,(i=r.nodeValue!==n)&&(e=dr,e!==null))switch(e.tag){case 3:Wu(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Wu(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ho]=t,t.stateNode=r}return En(t),null;case 13:if(Dt(zt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ot&&lr!==null&&t.mode&1&&!(t.flags&128))hC(),Ua(),t.flags|=98560,i=!1;else if(i=qu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(ee(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ee(317));i[ho]=t}else Ua(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;En(t),i=!1}else Vr!==null&&(Jm(Vr),Vr=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||zt.current&1?an===0&&(an=3):$v())),t.updateQueue!==null&&(t.flags|=4),En(t),null);case 4:return Ha(),Hm(e,t),e===null&&pc(t.stateNode.containerInfo),En(t),null;case 10:return Sv(t.type._context),En(t),null;case 17:return Qn(t.type)&&Fd(),En(t),null;case 19:if(Dt(zt),i=t.memoizedState,i===null)return En(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)Il(i,!1);else{if(an!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=qd(e),a!==null){for(t.flags|=128,Il(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 Ct(zt,zt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Xt()>qa&&(t.flags|=128,r=!0,Il(i,!1),t.lanes=4194304)}else{if(!r)if(e=qd(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Il(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Ot)return En(t),null}else 2*Xt()-i.renderingStartTime>qa&&n!==1073741824&&(t.flags|=128,r=!0,Il(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=Xt(),t.sibling=null,n=zt.current,Ct(zt,r?n&1|2:n&1),t):(En(t),null);case 22:case 23:return Lv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ir&1073741824&&(En(t),t.subtreeFlags&6&&(t.flags|=8192)):En(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function rN(e,t){switch(vv(t),t.tag){case 1:return Qn(t.type)&&Fd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ha(),Dt(Gn),Dt(Rn),Tv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ev(t),null;case 13:if(Dt(zt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dt(zt),null;case 4:return Ha(),null;case 10:return Sv(t.type._context),null;case 22:case 23:return Lv(),null;case 24:return null;default:return null}}var Ku=!1,Tn=!1,oN=typeof WeakSet=="function"?WeakSet:Set,ye=null;function Ca(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){qt(e,t,r)}else n.current=null}function Wm(e,t,n){try{n()}catch(r){qt(e,t,r)}}var F1=!1;function iN(e,t){if(km=Md,e=eC(),mv(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(Rm={focusedElem:e,selectionRange:n},Md=!1,ye=t;ye!==null;)if(t=ye,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ye=e;else for(;ye!==null;){t=ye;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,w=g.memoizedState,y=t.stateNode,S=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:zr(t.type,v),w);y.__reactInternalSnapshotBeforeUpdate=S}break;case 3:var b=t.stateNode.containerInfo;b.nodeType===1?b.textContent="":b.nodeType===9&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(x){qt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,ye=e;break}ye=t.return}return g=F1,F1=!1,g}function Zl(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&&Wm(t,n,i)}o=o.next}while(o!==r)}}function zf(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 qm(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 XC(e){var t=e.alternate;t!==null&&(e.alternate=null,XC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ho],delete t[gc],delete t[Im],delete t[BA],delete t[UA])),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 JC(e){return e.tag===5||e.tag===3||e.tag===4}function z1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||JC(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 Gm(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=$d));else if(r!==4&&(e=e.child,e!==null))for(Gm(e,t,n),e=e.sibling;e!==null;)Gm(e,t,n),e=e.sibling}function Qm(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(Qm(e,t,n),e=e.sibling;e!==null;)Qm(e,t,n),e=e.sibling}var pn=null,Br=!1;function ai(e,t,n){for(n=n.child;n!==null;)ZC(e,t,n),n=n.sibling}function ZC(e,t,n){if(po&&typeof po.onCommitFiberUnmount=="function")try{po.onCommitFiberUnmount(If,n)}catch{}switch(n.tag){case 5:Tn||Ca(n,t);case 6:var r=pn,o=Br;pn=null,ai(e,t,n),pn=r,Br=o,pn!==null&&(Br?(e=pn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pn.removeChild(n.stateNode));break;case 18:pn!==null&&(Br?(e=pn,n=n.stateNode,e.nodeType===8?wp(e.parentNode,n):e.nodeType===1&&wp(e,n),dc(e)):wp(pn,n.stateNode));break;case 4:r=pn,o=Br,pn=n.stateNode.containerInfo,Br=!0,ai(e,t,n),pn=r,Br=o;break;case 0:case 11:case 14:case 15:if(!Tn&&(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)&&Wm(n,t,a),o=o.next}while(o!==r)}ai(e,t,n);break;case 1:if(!Tn&&(Ca(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){qt(n,t,l)}ai(e,t,n);break;case 21:ai(e,t,n);break;case 22:n.mode&1?(Tn=(r=Tn)||n.memoizedState!==null,ai(e,t,n),Tn=r):ai(e,t,n);break;default:ai(e,t,n)}}function B1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new oN),t.forEach(function(r){var o=pN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Lr(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:pn=l.stateNode,Br=!1;break e;case 3:pn=l.stateNode.containerInfo,Br=!0;break e;case 4:pn=l.stateNode.containerInfo,Br=!0;break e}l=l.return}if(pn===null)throw Error(ee(160));ZC(i,a,o),pn=null,Br=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){qt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)eE(t,e),t=t.sibling}function eE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Lr(t,e),so(e),r&4){try{Zl(3,e,e.return),zf(3,e)}catch(v){qt(e,e.return,v)}try{Zl(5,e,e.return)}catch(v){qt(e,e.return,v)}}break;case 1:Lr(t,e),so(e),r&512&&n!==null&&Ca(n,n.return);break;case 5:if(Lr(t,e),so(e),r&512&&n!==null&&Ca(n,n.return),e.flags&32){var o=e.stateNode;try{ac(o,"")}catch(v){qt(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&&Sj(o,i),ym(l,a);var u=ym(l,i);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?Tj(o,f):d==="dangerouslySetInnerHTML"?Cj(o,f):d==="children"?ac(o,f):nv(o,d,f,u)}switch(l){case"input":hm(o,i);break;case"textarea":wj(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Da(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Da(o,!!i.multiple,i.defaultValue,!0):Da(o,!!i.multiple,i.multiple?[]:"",!1))}o[gc]=i}catch(v){qt(e,e.return,v)}}break;case 6:if(Lr(t,e),so(e),r&4){if(e.stateNode===null)throw Error(ee(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){qt(e,e.return,v)}}break;case 3:if(Lr(t,e),so(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{dc(t.containerInfo)}catch(v){qt(e,e.return,v)}break;case 4:Lr(t,e),so(e);break;case 13:Lr(t,e),so(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Mv=Xt())),r&4&&B1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Tn=(u=Tn)||d,Lr(t,e),Tn=u):Lr(t,e),so(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ye=e,d=e.child;d!==null;){for(f=ye=d;ye!==null;){switch(h=ye,m=h.child,h.tag){case 0:case 11:case 14:case 15:Zl(4,h,h.return);break;case 1:Ca(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){qt(r,n,v)}}break;case 5:Ca(h,h.return);break;case 22:if(h.memoizedState!==null){V1(f);continue}}m!==null?(m.return=h,ye=m):V1(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=Ej("display",a))}catch(v){qt(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){qt(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:Lr(t,e),so(e),r&4&&B1(e);break;case 21:break;default:Lr(t,e),so(e)}}function so(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(JC(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(ac(o,""),r.flags&=-33);var i=z1(e);Qm(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=z1(e);Gm(e,l,a);break;default:throw Error(ee(161))}}catch(c){qt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function sN(e,t,n){ye=e,tE(e)}function tE(e,t,n){for(var r=(e.mode&1)!==0;ye!==null;){var o=ye,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Ku;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||Tn;l=Ku;var u=Tn;if(Ku=a,(Tn=c)&&!u)for(ye=o;ye!==null;)a=ye,c=a.child,a.tag===22&&a.memoizedState!==null?H1(o):c!==null?(c.return=a,ye=c):H1(o);for(;i!==null;)ye=i,tE(i),i=i.sibling;ye=o,Ku=l,Tn=u}U1(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ye=i):U1(e)}}function U1(e){for(;ye!==null;){var t=ye;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Tn||zf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Tn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:zr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&E1(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}E1(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&&dc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}Tn||t.flags&512&&qm(t)}catch(h){qt(t,t.return,h)}}if(t===e){ye=null;break}if(n=t.sibling,n!==null){n.return=t.return,ye=n;break}ye=t.return}}function V1(e){for(;ye!==null;){var t=ye;if(t===e){ye=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ye=n;break}ye=t.return}}function H1(e){for(;ye!==null;){var t=ye;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{zf(4,t)}catch(c){qt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){qt(t,o,c)}}var i=t.return;try{qm(t)}catch(c){qt(t,i,c)}break;case 5:var a=t.return;try{qm(t)}catch(c){qt(t,a,c)}}}catch(c){qt(t,t.return,c)}if(t===e){ye=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ye=l;break}ye=t.return}}var aN=Math.ceil,Kd=Ko.ReactCurrentDispatcher,Av=Ko.ReactCurrentOwner,Er=Ko.ReactCurrentBatchConfig,tt=0,fn=null,en=null,gn=0,ir=0,Ea=Fi(0),an=0,wc=null,xs=0,Bf=0,Nv=0,ec=null,Wn=null,Mv=0,qa=1/0,To=null,Yd=!1,Km=null,Ci=null,Yu=!1,yi=null,Xd=0,tc=0,Ym=null,yd=-1,xd=0;function $n(){return tt&6?Xt():yd!==-1?yd:yd=Xt()}function Ei(e){return e.mode&1?tt&2&&gn!==0?gn&-gn:HA.transition!==null?(xd===0&&(xd=$j()),xd):(e=ft,e!==0||(e=window.event,e=e===void 0?16:Wj(e.type)),e):1}function Gr(e,t,n,r){if(50<tc)throw tc=0,Ym=null,Error(ee(185));Uc(e,n,r),(!(tt&2)||e!==fn)&&(e===fn&&(!(tt&2)&&(Bf|=n),an===4&&pi(e,gn)),Kn(e,r),n===1&&tt===0&&!(t.mode&1)&&(qa=Xt()+500,Lf&&zi()))}function Kn(e,t){var n=e.callbackNode;HI(e,t);var r=Nd(e,e===fn?gn:0);if(r===0)n!==null&&Z0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Z0(n),t===1)e.tag===0?VA(W1.bind(null,e)):uC(W1.bind(null,e)),FA(function(){!(tt&6)&&zi()}),n=null;else{switch(Fj(r)){case 1:n=av;break;case 4:n=Oj;break;case 16:n=Ad;break;case 536870912:n=Lj;break;default:n=Ad}n=cE(n,nE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function nE(e,t){if(yd=-1,xd=0,tt&6)throw Error(ee(327));var n=e.callbackNode;if(Oa()&&e.callbackNode!==n)return null;var r=Nd(e,e===fn?gn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Jd(e,r);else{t=r;var o=tt;tt|=2;var i=oE();(fn!==e||gn!==t)&&(To=null,qa=Xt()+500,hs(e,t));do try{uN();break}catch(l){rE(e,l)}while(!0);bv(),Kd.current=i,tt=o,en!==null?t=0:(fn=null,gn=0,t=an)}if(t!==0){if(t===2&&(o=jm(e),o!==0&&(r=o,t=Xm(e,o))),t===1)throw n=wc,hs(e,0),pi(e,r),Kn(e,Xt()),n;if(t===6)pi(e,r);else{if(o=e.current.alternate,!(r&30)&&!lN(o)&&(t=Jd(e,r),t===2&&(i=jm(e),i!==0&&(r=i,t=Xm(e,i))),t===1))throw n=wc,hs(e,0),pi(e,r),Kn(e,Xt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:Zi(e,Wn,To);break;case 3:if(pi(e,r),(r&130023424)===r&&(t=Mv+500-Xt(),10<t)){if(Nd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){$n(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Dm(Zi.bind(null,e,Wn,To),t);break}Zi(e,Wn,To);break;case 4:if(pi(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-qr(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Xt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*aN(r/1960))-r,10<r){e.timeoutHandle=Dm(Zi.bind(null,e,Wn,To),r);break}Zi(e,Wn,To);break;case 5:Zi(e,Wn,To);break;default:throw Error(ee(329))}}}return Kn(e,Xt()),e.callbackNode===n?nE.bind(null,e):null}function Xm(e,t){var n=ec;return e.current.memoizedState.isDehydrated&&(hs(e,t).flags|=256),e=Jd(e,t),e!==2&&(t=Wn,Wn=n,t!==null&&Jm(t)),e}function Jm(e){Wn===null?Wn=e:Wn.push.apply(Wn,e)}function lN(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(!Kr(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 pi(e,t){for(t&=~Nv,t&=~Bf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-qr(t),r=1<<n;e[n]=-1,t&=~r}}function W1(e){if(tt&6)throw Error(ee(327));Oa();var t=Nd(e,0);if(!(t&1))return Kn(e,Xt()),null;var n=Jd(e,t);if(e.tag!==0&&n===2){var r=jm(e);r!==0&&(t=r,n=Xm(e,r))}if(n===1)throw n=wc,hs(e,0),pi(e,t),Kn(e,Xt()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Zi(e,Wn,To),Kn(e,Xt()),null}function Ov(e,t){var n=tt;tt|=1;try{return e(t)}finally{tt=n,tt===0&&(qa=Xt()+500,Lf&&zi())}}function bs(e){yi!==null&&yi.tag===0&&!(tt&6)&&Oa();var t=tt;tt|=1;var n=Er.transition,r=ft;try{if(Er.transition=null,ft=1,e)return e()}finally{ft=r,Er.transition=n,tt=t,!(tt&6)&&zi()}}function Lv(){ir=Ea.current,Dt(Ea)}function hs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,$A(n)),en!==null)for(n=en.return;n!==null;){var r=n;switch(vv(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Fd();break;case 3:Ha(),Dt(Gn),Dt(Rn),Tv();break;case 5:Ev(r);break;case 4:Ha();break;case 13:Dt(zt);break;case 19:Dt(zt);break;case 10:Sv(r.type._context);break;case 22:case 23:Lv()}n=n.return}if(fn=e,en=e=Ti(e.current,null),gn=ir=t,an=0,wc=null,Nv=Bf=xs=0,Wn=ec=null,as!==null){for(t=0;t<as.length;t++)if(n=as[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}as=null}return e}function rE(e,t){do{var n=en;try{if(bv(),md.current=Qd,Gd){for(var r=Ut.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Gd=!1}if(ys=0,ln=sn=Ut=null,Jl=!1,xc=0,Av.current=null,n===null||n.return===null){an=1,wc=t,en=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=gn,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=I1(a);if(m!==null){m.flags&=-257,A1(m,a,l,i,t),m.mode&1&&D1(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)){D1(i,u,t),$v();break e}c=Error(ee(426))}}else if(Ot&&l.mode&1){var w=I1(a);if(w!==null){!(w.flags&65536)&&(w.flags|=256),A1(w,a,l,i,t),yv(Wa(c,l));break e}}i=c=Wa(c,l),an!==4&&(an=2),ec===null?ec=[i]:ec.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=zC(i,c,t);C1(i,y);break e;case 1:l=c;var S=i.type,b=i.stateNode;if(!(i.flags&128)&&(typeof S.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Ci===null||!Ci.has(b)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=BC(i,l,t);C1(i,x);break e}}i=i.return}while(i!==null)}sE(n)}catch(C){t=C,en===n&&n!==null&&(en=n=n.return);continue}break}while(!0)}function oE(){var e=Kd.current;return Kd.current=Qd,e===null?Qd:e}function $v(){(an===0||an===3||an===2)&&(an=4),fn===null||!(xs&268435455)&&!(Bf&268435455)||pi(fn,gn)}function Jd(e,t){var n=tt;tt|=2;var r=oE();(fn!==e||gn!==t)&&(To=null,hs(e,t));do try{cN();break}catch(o){rE(e,o)}while(!0);if(bv(),tt=n,Kd.current=r,en!==null)throw Error(ee(261));return fn=null,gn=0,an}function cN(){for(;en!==null;)iE(en)}function uN(){for(;en!==null&&!MI();)iE(en)}function iE(e){var t=lE(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?sE(e):en=t,Av.current=null}function sE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=rN(n,t),n!==null){n.flags&=32767,en=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{an=6,en=null;return}}else if(n=nN(n,t,ir),n!==null){en=n;return}if(t=t.sibling,t!==null){en=t;return}en=t=e}while(t!==null);an===0&&(an=5)}function Zi(e,t,n){var r=ft,o=Er.transition;try{Er.transition=null,ft=1,dN(e,t,n,r)}finally{Er.transition=o,ft=r}return null}function dN(e,t,n,r){do Oa();while(yi!==null);if(tt&6)throw Error(ee(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(ee(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(WI(e,i),e===fn&&(en=fn=null,gn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Yu||(Yu=!0,cE(Ad,function(){return Oa(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=Er.transition,Er.transition=null;var a=ft;ft=1;var l=tt;tt|=4,Av.current=null,iN(e,n),eE(n,e),DA(Rm),Md=!!km,Rm=km=null,e.current=n,sN(n),OI(),tt=l,ft=a,Er.transition=i}else e.current=n;if(Yu&&(Yu=!1,yi=e,Xd=o),i=e.pendingLanes,i===0&&(Ci=null),FI(n.stateNode),Kn(e,Xt()),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(Yd)throw Yd=!1,e=Km,Km=null,e;return Xd&1&&e.tag!==0&&Oa(),i=e.pendingLanes,i&1?e===Ym?tc++:(tc=0,Ym=e):tc=0,zi(),null}function Oa(){if(yi!==null){var e=Fj(Xd),t=Er.transition,n=ft;try{if(Er.transition=null,ft=16>e?16:e,yi===null)var r=!1;else{if(e=yi,yi=null,Xd=0,tt&6)throw Error(ee(331));var o=tt;for(tt|=4,ye=e.current;ye!==null;){var i=ye,a=i.child;if(ye.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ye=u;ye!==null;){var d=ye;switch(d.tag){case 0:case 11:case 15:Zl(8,d,i)}var f=d.child;if(f!==null)f.return=d,ye=f;else for(;ye!==null;){d=ye;var h=d.sibling,m=d.return;if(XC(d),d===u){ye=null;break}if(h!==null){h.return=m,ye=h;break}ye=m}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var w=v.sibling;v.sibling=null,v=w}while(v!==null)}}ye=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ye=a;else e:for(;ye!==null;){if(i=ye,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Zl(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ye=y;break e}ye=i.return}}var S=e.current;for(ye=S;ye!==null;){a=ye;var b=a.child;if(a.subtreeFlags&2064&&b!==null)b.return=a,ye=b;else e:for(a=S;ye!==null;){if(l=ye,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:zf(9,l)}}catch(C){qt(l,l.return,C)}if(l===a){ye=null;break e}var x=l.sibling;if(x!==null){x.return=l.return,ye=x;break e}ye=l.return}}if(tt=o,zi(),po&&typeof po.onPostCommitFiberRoot=="function")try{po.onPostCommitFiberRoot(If,e)}catch{}r=!0}return r}finally{ft=n,Er.transition=t}}return!1}function q1(e,t,n){t=Wa(n,t),t=zC(e,t,1),e=ji(e,t,1),t=$n(),e!==null&&(Uc(e,1,t),Kn(e,t))}function qt(e,t,n){if(e.tag===3)q1(e,e,n);else for(;t!==null;){if(t.tag===3){q1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ci===null||!Ci.has(r))){e=Wa(n,e),e=BC(t,e,1),t=ji(t,e,1),e=$n(),t!==null&&(Uc(t,1,e),Kn(t,e));break}}t=t.return}}function fN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=$n(),e.pingedLanes|=e.suspendedLanes&n,fn===e&&(gn&n)===n&&(an===4||an===3&&(gn&130023424)===gn&&500>Xt()-Mv?hs(e,0):Nv|=n),Kn(e,t)}function aE(e,t){t===0&&(e.mode&1?(t=zu,zu<<=1,!(zu&130023424)&&(zu=4194304)):t=1);var n=$n();e=$o(e,t),e!==null&&(Uc(e,t,n),Kn(e,n))}function hN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),aE(e,n)}function pN(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(ee(314))}r!==null&&r.delete(t),aE(e,n)}var lE;lE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Gn.current)qn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return qn=!1,tN(e,t,n);qn=!!(e.flags&131072)}else qn=!1,Ot&&t.flags&1048576&&dC(t,Ud,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;vd(e,t),e=t.pendingProps;var o=Ba(t,Rn.current);Ma(t,n),o=kv(null,t,r,e,o,n);var i=Rv();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,Qn(r)?(i=!0,zd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jv(t),o.updater=$f,t.stateNode=o,o._reactInternals=t,$m(t,r,e,n),t=Bm(null,t,r,!0,i,n)):(t.tag=0,Ot&&i&&gv(t),Nn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(vd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=gN(r),e=zr(r,e),o){case 0:t=zm(null,t,r,e,n);break e;case 1:t=O1(null,t,r,e,n);break e;case 11:t=N1(null,t,r,e,n);break e;case 14:t=M1(null,t,r,zr(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zr(r,o),zm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zr(r,o),O1(e,t,r,o,n);case 3:e:{if(WC(t),e===null)throw Error(ee(387));r=t.pendingProps,i=t.memoizedState,o=i.element,mC(e,t),Wd(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=Wa(Error(ee(423)),t),t=L1(e,t,r,n,o);break e}else if(r!==o){o=Wa(Error(ee(424)),t),t=L1(e,t,r,n,o);break e}else for(lr=wi(t.stateNode.containerInfo.firstChild),dr=t,Ot=!0,Vr=null,n=xC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ua(),r===o){t=Fo(e,t,n);break e}Nn(e,t,r,n)}t=t.child}return t;case 5:return bC(t),e===null&&Mm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,_m(r,o)?a=null:i!==null&&_m(r,i)&&(t.flags|=32),HC(e,t),Nn(e,t,a,n),t.child;case 6:return e===null&&Mm(t),null;case 13:return qC(e,t,n);case 4:return Cv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Va(t,null,r,n):Nn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zr(r,o),N1(e,t,r,o,n);case 7:return Nn(e,t,t.pendingProps,n),t.child;case 8:return Nn(e,t,t.pendingProps.children,n),t.child;case 12:return Nn(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,Ct(Vd,r._currentValue),r._currentValue=a,i!==null)if(Kr(i.value,a)){if(i.children===o.children&&!Gn.current){t=Fo(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=Io(-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),Om(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(ee(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Om(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}Nn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ma(t,n),o=kr(o),r=r(o),t.flags|=1,Nn(e,t,r,n),t.child;case 14:return r=t.type,o=zr(r,t.pendingProps),o=zr(r.type,o),M1(e,t,r,o,n);case 15:return UC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:zr(r,o),vd(e,t),t.tag=1,Qn(r)?(e=!0,zd(t)):e=!1,Ma(t,n),vC(t,r,o),$m(t,r,o,n),Bm(null,t,r,!0,e,n);case 19:return GC(e,t,n);case 22:return VC(e,t,n)}throw Error(ee(156,t.tag))};function cE(e,t){return Mj(e,t)}function mN(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 Cr(e,t,n,r){return new mN(e,t,n,r)}function Fv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function gN(e){if(typeof e=="function")return Fv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ov)return 11;if(e===iv)return 14}return 2}function Ti(e,t){var n=e.alternate;return n===null?(n=Cr(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 bd(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Fv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ma:return ps(n.children,o,i,t);case rv:a=8,o|=8;break;case lm:return e=Cr(12,n,t,o|2),e.elementType=lm,e.lanes=i,e;case cm:return e=Cr(13,n,t,o),e.elementType=cm,e.lanes=i,e;case um:return e=Cr(19,n,t,o),e.elementType=um,e.lanes=i,e;case yj:return Uf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case gj:a=10;break e;case vj:a=9;break e;case ov:a=11;break e;case iv:a=14;break e;case ci:a=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Cr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ps(e,t,n,r){return e=Cr(7,e,r,t),e.lanes=n,e}function Uf(e,t,n,r){return e=Cr(22,e,r,t),e.elementType=yj,e.lanes=n,e.stateNode={isHidden:!1},e}function _p(e,t,n){return e=Cr(6,e,null,t),e.lanes=n,e}function Dp(e,t,n){return t=Cr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function vN(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=dp(0),this.expirationTimes=dp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=dp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function zv(e,t,n,r,o,i,a,l,c){return e=new vN(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Cr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jv(i),e}function yN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:pa,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function uE(e){if(!e)return _i;e=e._reactInternals;e:{if(Os(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Qn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Qn(n))return cC(e,n,t)}return t}function dE(e,t,n,r,o,i,a,l,c){return e=zv(n,r,!0,e,o,i,a,l,c),e.context=uE(null),n=e.current,r=$n(),o=Ei(n),i=Io(r,o),i.callback=t??null,ji(n,i,o),e.current.lanes=o,Uc(e,o,r),Kn(e,r),e}function Vf(e,t,n,r){var o=t.current,i=$n(),a=Ei(o);return n=uE(n),t.context===null?t.context=n:t.pendingContext=n,t=Io(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ji(o,t,a),e!==null&&(Gr(e,o,a,i),pd(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 G1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Bv(e,t){G1(e,t),(e=e.alternate)&&G1(e,t)}function xN(){return null}var fE=typeof reportError=="function"?reportError:function(e){console.error(e)};function Uv(e){this._internalRoot=e}Hf.prototype.render=Uv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));Vf(e,t,null,null)};Hf.prototype.unmount=Uv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;bs(function(){Vf(null,e,null,null)}),t[Lo]=null}};function Hf(e){this._internalRoot=e}Hf.prototype.unstable_scheduleHydration=function(e){if(e){var t=Uj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<hi.length&&t!==0&&t<hi[n].priority;n++);hi.splice(n,0,e),n===0&&Hj(e)}};function Vv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Wf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Q1(){}function bN(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=dE(t,r,e,0,null,!1,!1,"",Q1);return e._reactRootContainer=a,e[Lo]=a.current,pc(e.nodeType===8?e.parentNode:e),bs(),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=zv(e,0,!1,null,null,!1,!1,"",Q1);return e._reactRootContainer=c,e[Lo]=c.current,pc(e.nodeType===8?e.parentNode:e),bs(function(){Vf(t,c,n,r)}),c}function qf(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)}}Vf(t,a,e,o)}else a=bN(n,t,e,o,r);return Zd(a)}zj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ul(t.pendingLanes);n!==0&&(lv(t,n|1),Kn(t,Xt()),!(tt&6)&&(qa=Xt()+500,zi()))}break;case 13:bs(function(){var r=$o(e,1);if(r!==null){var o=$n();Gr(r,e,1,o)}}),Bv(e,1)}};cv=function(e){if(e.tag===13){var t=$o(e,134217728);if(t!==null){var n=$n();Gr(t,e,134217728,n)}Bv(e,134217728)}};Bj=function(e){if(e.tag===13){var t=Ei(e),n=$o(e,t);if(n!==null){var r=$n();Gr(n,e,t,r)}Bv(e,t)}};Uj=function(){return ft};Vj=function(e,t){var n=ft;try{return ft=e,t()}finally{ft=n}};bm=function(e,t,n){switch(t){case"input":if(hm(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=Of(r);if(!o)throw Error(ee(90));bj(r),hm(r,o)}}}break;case"textarea":wj(e,n);break;case"select":t=n.value,t!=null&&Da(e,!!n.multiple,t,!1)}};Rj=Ov;_j=bs;var SN={usingClientEntryPoint:!1,Events:[Hc,xa,Of,Pj,kj,Ov]},Al={findFiberByHostInstance:ss,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},wN={bundleType:Al.bundleType,version:Al.version,rendererPackageName:Al.rendererPackageName,rendererConfig:Al.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ko.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Aj(e),e===null?null:e.stateNode},findFiberByHostInstance:Al.findFiberByHostInstance||xN,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 Xu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xu.isDisabled&&Xu.supportsFiber)try{If=Xu.inject(wN),po=Xu}catch{}}mr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=SN;mr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Vv(t))throw Error(ee(200));return yN(e,t,null,n)};mr.createRoot=function(e,t){if(!Vv(e))throw Error(ee(299));var n=!1,r="",o=fE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=zv(e,1,!1,null,null,n,!1,r,o),e[Lo]=t.current,pc(e.nodeType===8?e.parentNode:e),new Uv(t)};mr.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(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=Aj(t),e=e===null?null:e.stateNode,e};mr.flushSync=function(e){return bs(e)};mr.hydrate=function(e,t,n){if(!Wf(t))throw Error(ee(200));return qf(null,e,t,!0,n)};mr.hydrateRoot=function(e,t,n){if(!Vv(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=fE;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=dE(t,null,e,1,n??null,o,!1,i,a),e[Lo]=t.current,pc(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 Hf(t)};mr.render=function(e,t,n){if(!Wf(t))throw Error(ee(200));return qf(null,e,t,!1,n)};mr.unmountComponentAtNode=function(e){if(!Wf(e))throw Error(ee(40));return e._reactRootContainer?(bs(function(){qf(null,null,e,!1,function(){e._reactRootContainer=null,e[Lo]=null})}),!0):!1};mr.unstable_batchedUpdates=Ov;mr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Wf(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return qf(e,t,n,!1,r)};mr.version="18.2.0-next-9e3b772b8-20220608";function hE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(hE)}catch(e){console.error(e)}}hE(),dj.exports=mr;var qc=dj.exports;const Ta=$g(qc),jN=jw({__proto__:null,default:Ta},[qc]),[CN,Dr]=Bn("ScrollArea.Root component was not found in tree");function Ga(e,t){const n=ns(t);rl(()=>{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 EN=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Dr(),[i,a]=p.useState(0),[l,c]=p.useState(0),u=!!(i&&l);return Ga(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),Ga(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}),TN=p.forwardRef((e,t)=>{const n=Dr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(EN,{...e,ref:t}):null}),PN={scrollHideDelay:1e3,type:"hover"},pE=p.forwardRef((e,t)=>{const n=H("ScrollAreaRoot",PN,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,w]=p.useState(null),[y,S]=p.useState(0),[b,x]=p.useState(0),[C,j]=p.useState(!1),[T,E]=p.useState(!1),_=rn(t,R=>c(R));return s.jsx(CN,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:j,scrollbarY:v,onScrollbarYChange:w,scrollbarYEnabled:T,onScrollbarYEnabledChange:E,onCornerWidthChange:S,onCornerHeightChange:x},children:s.jsx(q,{...a,ref:_,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${y}px`,"--sa-corner-height":i!=="xy"?"0px":`${b}px`}})})});pE.displayName="@mantine/core/ScrollAreaRoot";function mE(e,t){const n=e/t;return Number.isNaN(n)?0:n}function Gf(e){const t=mE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function gE(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 kN(e,[t,n]){return Math.min(n,Math.max(t,e))}function K1(e,t,n="ltr"){const r=Gf(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=kN(e,c);return gE([0,a],[0,l])(u)}function RN(e,t,n,r="ltr"){const o=Gf(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 gE([c,u],f)(e)}function vE(e,t){return e>0&&e<t}function ef(e){return e?parseInt(e,10):0}function ms(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[_N,yE]=Bn("ScrollAreaScrollbar was not found in tree"),xE=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=Dr(),[m,g]=p.useState(null),v=rn(t,E=>g(E)),w=p.useRef(null),y=p.useRef(""),{viewport:S}=h,b=n.content-n.viewport,x=ns(u),C=ns(l),j=kf(d,10),T=E=>{if(w.current){const _=E.clientX-w.current.left,R=E.clientY-w.current.top;c({x:_,y:R})}};return p.useEffect(()=>{const E=_=>{const R=_.target;(m==null?void 0:m.contains(R))&&x(_,b)};return document.addEventListener("wheel",E,{passive:!1}),()=>document.removeEventListener("wheel",E,{passive:!1})},[S,m,b,x]),p.useEffect(C,[n,C]),Ga(m,j),Ga(h.content,j),s.jsx(_N,{value:{scrollbar:m,hasThumb:r,onThumbChange:ns(o),onThumbPointerUp:ns(i),onThumbPositionChange:C,onThumbPointerDown:ns(a)},children:s.jsx("div",{...f,ref:v,"data-mantine-scrollbar":!0,style:{position:"absolute",...f.style},onPointerDown:ms(e.onPointerDown,E=>{E.preventDefault(),E.button===0&&(E.target.setPointerCapture(E.pointerId),w.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",document.body.style.pointerEvents="none",T(E))}),onPointerMove:ms(e.onPointerMove,T),onPointerUp:ms(e.onPointerUp,E=>{E.preventDefault();const _=E.target;_.hasPointerCapture(E.pointerId)&&_.releasePointerCapture(E.pointerId),document.body.style.webkitUserSelect=y.current,document.body.style.pointerEvents="auto",w.current=null})})})}),DN=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Dr(),[l,c]=p.useState(),u=p.useRef(null),d=rn(t,u,a.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx(xE,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${Gf(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),vE(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:ef(l.paddingLeft),paddingEnd:ef(l.paddingRight)}})}})}),IN=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Dr(),[l,c]=p.useState(),u=p.useRef(null),d=rn(t,u,a.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(window.getComputedStyle(u.current))},[]),s.jsx(xE,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${Gf(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),vE(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:ef(l.paddingTop),paddingEnd:ef(l.paddingBottom)}})}})}),Hv=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Ns(),i=Dr(),a=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=mE(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)=>RN(m,l.current,c,g);return n==="horizontal"?s.jsx(DN,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollLeft,g=K1(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(IN,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollTop,g=K1(m,c);c.scrollbar.size===0?a.current.style.opacity="0":a.current.style.opacity="1",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}),bE=p.forwardRef((e,t)=>{const n=Dr(),{forceMount:r,...o}=e,[i,a]=p.useState(!1),l=e.orientation==="horizontal",c=kf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?u:d)}},10);return Ga(n.viewport,c),Ga(n.content,c),r||i?s.jsx(Hv,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),AN=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Dr(),[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(bE,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),NN=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Dr(),i=e.orientation==="horizontal",[a,l]=p.useState("hidden"),c=kf(()=>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(Hv,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ms(e.onPointerEnter,()=>l("interacting")),onPointerLeave:ms(e.onPointerLeave,()=>l("idle"))}):null}),Y1=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Dr(),{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(AN,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(NN,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(bE,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(Hv,{...r,ref:t}):null});function MN(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 ON=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Dr(),i=yE(),{onThumbPositionChange:a}=i,l=rn(t,d=>i.onThumbChange(d)),c=p.useRef(),u=kf(()=>{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=MN(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:ms(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:ms(e.onPointerUp,i.onThumbPointerUp)})}),X1=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=yE();return n||o.hasThumb?s.jsx(ON,{ref:t,...r}):null}),SE=p.forwardRef(({children:e,style:t,...n},r)=>{const o=Dr(),i=rn(r,o.onViewportChange);return s.jsx(q,{...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})})});SE.displayName="@mantine/core/ScrollAreaViewport";var Wv={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const wE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},LN=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":B(t)}}),Ir=X((e,t)=>{const n=H("ScrollArea",wE,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:w,scrollbars:y,...S}=n,[b,x]=p.useState(!1),C=ce({name:"ScrollArea",props:n,classes:Wv,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:LN});return s.jsxs(pE,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:y,...C("root"),...S,children:[s.jsx(SE,{...h,...C("viewport",{style:h==null?void 0:h.style}),ref:m,"data-offset-scrollbars":w===!0?"xy":w||void 0,"data-scrollbars":y||void 0,onScroll:j=>{var T;(T=h==null?void 0:h.onScroll)==null||T.call(h,j),g==null||g({x:j.currentTarget.scrollLeft,y:j.currentTarget.scrollTop})},children:v}),(y==="xy"||y==="x")&&s.jsx(Y1,{...C("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:s.jsx(X1,{...C("thumb")})}),(y==="xy"||y==="y")&&s.jsx(Y1,{...C("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:s.jsx(X1,{...C("thumb")})}),s.jsx(TN,{...C("corner"),"data-hovered":b||void 0,"data-hidden":d==="never"||void 0})]})});Ir.displayName="@mantine/core/ScrollArea";const Qf=X((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:w,vars:y,...S}=H("ScrollAreaAutosize",wE,e);return s.jsx(q,{...S,ref:t,style:[{display:"flex",overflow:"auto"},w],children:s.jsx(q,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Ir,{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})})})});Ir.classes=Wv;Qf.displayName="@mantine/core/ScrollAreaAutosize";Qf.classes=Wv;Ir.Autosize=Qf;var jE={root:"m_87cf2631"};const $N={__staticSelector:"UnstyledButton"},bn=Dn((e,t)=>{const n=H("UnstyledButton",$N,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:l,styles:c,style:u,...d}=n,f=ce({name:i,props:n,classes:jE,className:r,style:u,classNames:l,styles:c,unstyled:a});return s.jsx(q,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});bn.classes=jE;bn.displayName="@mantine/core/UnstyledButton";var CE={root:"m_515a97f8"};const FN={},qv=X((e,t)=>{const n=H("VisuallyHidden",FN,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,...u}=n,d=ce({name:"VisuallyHidden",classes:CE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l});return s.jsx(q,{component:"span",ref:t,...d("root"),...u})});qv.classes=CE;qv.displayName="@mantine/core/VisuallyHidden";var EE={root:"m_1b7284a3"};const zN={},BN=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:lt(t),"--paper-shadow":Hg(n)}}),Yn=Dn((e,t)=>{const n=H("Paper",zN,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=ce({name:"Paper",props:n,classes:EE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:BN});return s.jsx(q,{ref:t,mod:[{"data-with-border":c},m],...v("root"),variant:h,...g})});Yn.classes=EE;Yn.displayName="@mantine/core/Paper";function sl(e){return TE(e)?(e.nodeName||"").toLowerCase():"#document"}function Xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yo(e){var t;return(t=(TE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function TE(e){return e instanceof Node||e instanceof Xn(e).Node}function Rt(e){return e instanceof Element||e instanceof Xn(e).Element}function hr(e){return e instanceof HTMLElement||e instanceof Xn(e).HTMLElement}function Zm(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xn(e).ShadowRoot}function Gc(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_r(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function UN(e){return["table","td","th"].includes(sl(e))}function Kf(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Gv(e){const t=Qv(),n=Rt(e)?_r(e):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 VN(e){let t=zo(e);for(;hr(t)&&!Di(t);){if(Gv(t))return t;if(Kf(t))return null;t=zo(t)}return null}function Qv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Di(e){return["html","body","#document"].includes(sl(e))}function _r(e){return Xn(e).getComputedStyle(e)}function Yf(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function zo(e){if(sl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Zm(e)&&e.host||Yo(e);return Zm(t)?t.host:t}function PE(e){const t=zo(e);return Di(t)?e.ownerDocument?e.ownerDocument.body:e.body:hr(t)&&Gc(t)?t:PE(t)}function Ao(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=PE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Xn(o);return i?t.concat(a,a.visualViewport||[],Gc(o)?o:[],a.frameElement&&n?Ao(a.frameElement):[]):t.concat(o,Ao(o,[],n))}function J1(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 jc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Zm(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function kE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function RE(){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 HN(e){return GN()?!1:!Z1()&&e.width===0&&e.height===0||Z1()&&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 WN(){return/apple/i.test(navigator.vendor)}function Z1(){const e=/android/i;return e.test(kE())||e.test(RE())}function qN(){return kE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function GN(){return RE().includes("jsdom/")}function eg(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function QN(e){return"nativeEvent"in e}function KN(e){return e.matches("html,body")}function cs(e){return(e==null?void 0:e.ownerDocument)||document}function Ip(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 fa(e){return"composedPath"in e?e.composedPath()[0]:e.target}const YN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function XN(e){return hr(e)&&e.matches(YN)}const cr=Math.min,Pn=Math.max,tf=Math.round,Ju=Math.floor,Ii=e=>({x:e,y:e}),JN={left:"right",right:"left",bottom:"top",top:"bottom"},ZN={start:"end",end:"start"};function tg(e,t,n){return Pn(e,cr(t,n))}function Bo(e,t){return typeof e=="function"?e(t):e}function Yr(e){return e.split("-")[0]}function al(e){return e.split("-")[1]}function Kv(e){return e==="x"?"y":"x"}function Yv(e){return e==="y"?"height":"width"}function Uo(e){return["top","bottom"].includes(Yr(e))?"y":"x"}function Xv(e){return Kv(Uo(e))}function e4(e,t,n){n===void 0&&(n=!1);const r=al(e),o=Xv(e),i=Yv(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=nf(a)),[a,nf(a)]}function t4(e){const t=nf(e);return[ng(e),t,ng(t)]}function ng(e){return e.replace(/start|end/g,t=>ZN[t])}function n4(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 r4(e,t,n,r){const o=al(e);let i=n4(Yr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(ng)))),i}function nf(e){return e.replace(/left|right|bottom|top/g,t=>JN[t])}function o4(e){return{top:0,right:0,bottom:0,left:0,...e}}function Jv(e){return typeof e!="number"?o4(e):{top:e,right:e,bottom:e,left:e}}function Qa(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 eb(e,t,n){let{reference:r,floating:o}=e;const i=Uo(t),a=Xv(t),l=Yv(a),c=Yr(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(al(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const i4=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}=eb(u,r,c),h=r,m={},g=0;for(let v=0;v<l.length;v++){const{name:w,fn:y}=l[v],{x:S,y:b,data:x,reset:C}=await y({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});d=S??d,f=b??f,m={...m,[w]:{...m[w],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:f}=eb(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function Zv(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}=Bo(t,e),g=Jv(m),w=l[h?f==="floating"?"reference":"floating":f],y=Qa(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(w)))==null||n?w:w.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),S=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,b=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),x=await(i.isElement==null?void 0:i.isElement(b))?await(i.getScale==null?void 0:i.getScale(b))||{x:1,y:1}:{x:1,y:1},C=Qa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:S,offsetParent:b,strategy:c}):S);return{top:(y.top-C.top+g.top)/x.y,bottom:(C.bottom-y.bottom+g.bottom)/x.y,left:(y.left-C.left+g.left)/x.x,right:(C.right-y.right+g.right)/x.x}}const s4=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}=Bo(e,t)||{};if(u==null)return{};const f=Jv(d),h={x:n,y:r},m=Xv(o),g=Yv(m),v=await a.getDimensions(u),w=m==="y",y=w?"top":"left",S=w?"bottom":"right",b=w?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[m]-h[m]-i.floating[g],C=h[m]-i.reference[m],j=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let T=j?j[b]:0;(!T||!await(a.isElement==null?void 0:a.isElement(j)))&&(T=l.floating[b]||i.floating[g]);const E=x/2-C/2,_=T/2-v[g]/2-1,R=cr(f[y],_),A=cr(f[S],_),L=R,U=T-v[g]-A,N=T/2-v[g]/2+E,F=tg(L,N,U),D=!c.arrow&&al(o)!=null&&N!==F&&i.reference[g]/2-(N<L?R:A)-v[g]/2<0,k=D?N<L?N-L:N-U:0;return{[m]:h[m]+k,data:{[m]:F,centerOffset:N-F-k,...D&&{alignmentOffset:k}},reset:D}}}),a4=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,...w}=Bo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Yr(o),S=Uo(l),b=Yr(l)===l,x=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=h||(b||!v?[nf(l)]:t4(l)),j=g!=="none";!h&&j&&C.push(...r4(l,v,g,x));const T=[l,...C],E=await Zv(t,w),_=[];let R=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&_.push(E[y]),f){const N=e4(o,a,x);_.push(E[N[0]],E[N[1]])}if(R=[...R,{placement:o,overflows:_}],!_.every(N=>N<=0)){var A,L;const N=(((A=i.flip)==null?void 0:A.index)||0)+1,F=T[N];if(F)return{data:{index:N,overflows:R},reset:{placement:F}};let D=(L=R.filter(k=>k.overflows[0]<=0).sort((k,P)=>k.overflows[1]-P.overflows[1])[0])==null?void 0:L.placement;if(!D)switch(m){case"bestFit":{var U;const k=(U=R.filter(P=>{if(j){const $=Uo(P.placement);return $===S||$==="y"}return!0}).map(P=>[P.placement,P.overflows.filter($=>$>0).reduce(($,O)=>$+O,0)]).sort((P,$)=>P[1]-$[1])[0])==null?void 0:U[0];k&&(D=k);break}case"initialPlacement":D=l;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function _E(e){const t=cr(...e.map(i=>i.left)),n=cr(...e.map(i=>i.top)),r=Pn(...e.map(i=>i.right)),o=Pn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function l4(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=>Qa(_E(o)))}const c4=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}=Bo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=l4(d),h=Qa(_E(d)),m=Jv(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(w=>c>w.left-m.left&&c<w.right+m.right&&u>w.top-m.top&&u<w.bottom+m.bottom)||h;if(f.length>=2){if(Uo(n)==="y"){const R=f[0],A=f[f.length-1],L=Yr(n)==="top",U=R.top,N=A.bottom,F=L?R.left:A.left,D=L?R.right:A.right,k=D-F,P=N-U;return{top:U,bottom:N,left:F,right:D,width:k,height:P,x:F,y:U}}const w=Yr(n)==="left",y=Pn(...f.map(R=>R.right)),S=cr(...f.map(R=>R.left)),b=f.filter(R=>w?R.left===S:R.right===y),x=b[0].top,C=b[b.length-1].bottom,j=S,T=y,E=T-j,_=C-x;return{top:x,bottom:C,left:j,right:T,width:E,height:_,x:j,y:x}}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 u4(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Yr(n),l=al(n),c=Uo(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,f=Bo(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 d4=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 u4(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}}}}},f4=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:w=>{let{x:y,y:S}=w;return{x:y,y:S}}},...c}=Bo(e,t),u={x:n,y:r},d=await Zv(t,c),f=Uo(Yr(o)),h=Kv(f);let m=u[h],g=u[f];if(i){const w=h==="y"?"top":"left",y=h==="y"?"bottom":"right",S=m+d[w],b=m-d[y];m=tg(S,m,b)}if(a){const w=f==="y"?"top":"left",y=f==="y"?"bottom":"right",S=g+d[w],b=g-d[y];g=tg(S,g,b)}const v=l.fn({...t,[h]:m,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},h4=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}=Bo(e,t),d={x:n,y:r},f=Uo(o),h=Kv(f);let m=d[h],g=d[f];const v=Bo(l,t),w=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const b=h==="y"?"height":"width",x=i.reference[h]-i.floating[b]+w.mainAxis,C=i.reference[h]+i.reference[b]-w.mainAxis;m<x?m=x:m>C&&(m=C)}if(u){var y,S;const b=h==="y"?"width":"height",x=["top","left"].includes(Yr(o)),C=i.reference[f]-i.floating[b]+(x&&((y=a.offset)==null?void 0:y[f])||0)+(x?0:w.crossAxis),j=i.reference[f]+i.reference[b]+(x?0:((S=a.offset)==null?void 0:S[f])||0)-(x?w.crossAxis:0);g<C?g=C:g>j&&(g=j)}return{[h]:m,[f]:g}}}},p4=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}=Bo(e,t),c=await Zv(t,l),u=Yr(n),d=al(n),f=Uo(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 w=m-c.top-c.bottom,y=h-c.left-c.right,S=cr(m-c[g],w),b=cr(h-c[v],y),x=!t.middlewareData.shift;let C=S,j=b;if(f?j=d||x?cr(b,y):y:C=d||x?cr(S,w):w,x&&!d){const E=Pn(c.left,0),_=Pn(c.right,0),R=Pn(c.top,0),A=Pn(c.bottom,0);f?j=h-2*(E!==0||_!==0?E+_:Pn(c.left,c.right)):C=m-2*(R!==0||A!==0?R+A:Pn(c.top,c.bottom))}await a({...t,availableWidth:j,availableHeight:C});const T=await o.getDimensions(i.floating);return h!==T.width||m!==T.height?{reset:{rects:!0}}:{}}}};function DE(e){const t=_r(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=hr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=tf(n)!==i||tf(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function ey(e){return Rt(e)?e:e.contextElement}function La(e){const t=ey(e);if(!hr(t))return Ii(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=DE(t);let a=(i?tf(n.width):n.width)/r,l=(i?tf(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const m4=Ii(0);function IE(e){const t=Xn(e);return!Qv()||!t.visualViewport?m4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function g4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xn(e)?!1:t}function Ss(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=ey(e);let a=Ii(1);t&&(r?Rt(r)&&(a=La(r)):a=La(e));const l=g4(i,n,r)?IE(i):Ii(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=Xn(i),m=r&&Rt(r)?Xn(r):r;let g=h,v=g.frameElement;for(;v&&r&&m!==g;){const w=La(v),y=v.getBoundingClientRect(),S=_r(v),b=y.left+(v.clientLeft+parseFloat(S.paddingLeft))*w.x,x=y.top+(v.clientTop+parseFloat(S.paddingTop))*w.y;c*=w.x,u*=w.y,d*=w.x,f*=w.y,c+=b,u+=x,g=Xn(v),v=g.frameElement}}return Qa({width:d,height:f,x:c,y:u})}function v4(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=Yo(r),l=t?Kf(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Ii(1);const d=Ii(0),f=hr(r);if((f||!f&&!i)&&((sl(r)!=="body"||Gc(a))&&(c=Yf(r)),hr(r))){const h=Ss(r);u=La(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 y4(e){return Array.from(e.getClientRects())}function AE(e){return Ss(Yo(e)).left+Yf(e).scrollLeft}function x4(e){const t=Yo(e),n=Yf(e),r=e.ownerDocument.body,o=Pn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Pn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+AE(e);const l=-n.scrollTop;return _r(r).direction==="rtl"&&(a+=Pn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function b4(e,t){const n=Xn(e),r=Yo(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=Qv();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function S4(e,t){const n=Ss(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=hr(e)?La(e):Ii(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 tb(e,t,n){let r;if(t==="viewport")r=b4(e,n);else if(t==="document")r=x4(Yo(e));else if(Rt(t))r=S4(t,n);else{const o=IE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Qa(r)}function NE(e,t){const n=zo(e);return n===t||!Rt(n)||Di(n)?!1:_r(n).position==="fixed"||NE(n,t)}function w4(e,t){const n=t.get(e);if(n)return n;let r=Ao(e,[],!1).filter(l=>Rt(l)&&sl(l)!=="body"),o=null;const i=_r(e).position==="fixed";let a=i?zo(e):e;for(;Rt(a)&&!Di(a);){const l=_r(a),c=Gv(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Gc(a)&&!c&&NE(e,a))?r=r.filter(d=>d!==a):o=l,a=zo(a)}return t.set(e,r),r}function j4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Kf(t)?[]:w4(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((u,d)=>{const f=tb(t,d,o);return u.top=Pn(f.top,u.top),u.right=cr(f.right,u.right),u.bottom=cr(f.bottom,u.bottom),u.left=Pn(f.left,u.left),u},tb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function C4(e){const{width:t,height:n}=DE(e);return{width:t,height:n}}function E4(e,t,n){const r=hr(t),o=Yo(t),i=n==="fixed",a=Ss(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Ii(0);if(r||!r&&!i)if((sl(t)!=="body"||Gc(o))&&(l=Yf(t)),r){const f=Ss(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=AE(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 Ap(e){return _r(e).position==="static"}function nb(e,t){return!hr(e)||_r(e).position==="fixed"?null:t?t(e):e.offsetParent}function ME(e,t){const n=Xn(e);if(Kf(e))return n;if(!hr(e)){let o=zo(e);for(;o&&!Di(o);){if(Rt(o)&&!Ap(o))return o;o=zo(o)}return n}let r=nb(e,t);for(;r&&UN(r)&&Ap(r);)r=nb(r,t);return r&&Di(r)&&Ap(r)&&!Gv(r)?n:r||VN(e)||n}const T4=async function(e){const t=this.getOffsetParent||ME,n=this.getDimensions,r=await n(e.floating);return{reference:E4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function P4(e){return _r(e).direction==="rtl"}const k4={convertOffsetParentRelativeRectToViewportRelativeRect:v4,getDocumentElement:Yo,getClippingRect:j4,getOffsetParent:ME,getElementRects:T4,getClientRects:y4,getDimensions:C4,getScale:La,isElement:Rt,isRTL:P4};function R4(e,t){let n=null,r;const o=Yo(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=Ju(d),g=Ju(o.clientWidth-(u+f)),v=Ju(o.clientHeight-(d+h)),w=Ju(u),S={rootMargin:-m+"px "+-g+"px "+-v+"px "+-w+"px",threshold:Pn(0,cr(1,c))||1};let b=!0;function x(C){const j=C[0].intersectionRatio;if(j!==c){if(!b)return a();j?a(!1,j):r=setTimeout(()=>{a(!1,1e-7)},1e3)}b=!1}try{n=new IntersectionObserver(x,{...S,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,S)}n.observe(e)}return a(!0),i}function _4(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=ey(e),d=o||i?[...u?Ao(u):[],...Ao(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&l?R4(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[S]=y;S&&S.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var b;(b=m)==null||b.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,v=c?Ss(e):null;c&&w();function w(){const y=Ss(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,g=requestAnimationFrame(w)}return n(),()=>{var y;d.forEach(S=>{o&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const D4=d4,I4=f4,A4=a4,N4=p4,rb=s4,M4=c4,O4=h4,L4=(e,t,n)=>{const r=new Map,o={platform:k4,...n},i={...o.platform,_c:r};return i4(e,t,{...o,platform:i})};var Sd=typeof document<"u"?p.useLayoutEffect:p.useEffect;function rf(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(!rf(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)&&!rf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function OE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ob(e,t){const n=OE(e);return Math.round(t*n)/n}function ib(e){const t=p.useRef(e);return Sd(()=>{t.current=e}),t}function $4(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);rf(h,r)||m(r);const[g,v]=p.useState(null),[w,y]=p.useState(null),S=p.useCallback(k=>{k!==j.current&&(j.current=k,v(k))},[]),b=p.useCallback(k=>{k!==T.current&&(T.current=k,y(k))},[]),x=i||g,C=a||w,j=p.useRef(null),T=p.useRef(null),E=p.useRef(d),_=c!=null,R=ib(c),A=ib(o),L=p.useCallback(()=>{if(!j.current||!T.current)return;const k={placement:t,strategy:n,middleware:h};A.current&&(k.platform=A.current),L4(j.current,T.current,k).then(P=>{const $={...P,isPositioned:!0};U.current&&!rf(E.current,$)&&(E.current=$,qc.flushSync(()=>{f($)}))})},[h,t,n,A]);Sd(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const U=p.useRef(!1);Sd(()=>(U.current=!0,()=>{U.current=!1}),[]),Sd(()=>{if(x&&(j.current=x),C&&(T.current=C),x&&C){if(R.current)return R.current(x,C,L);L()}},[x,C,L,R,_]);const N=p.useMemo(()=>({reference:j,floating:T,setReference:S,setFloating:b}),[S,b]),F=p.useMemo(()=>({reference:x,floating:C}),[x,C]),D=p.useMemo(()=>{const k={position:n,left:0,top:0};if(!F.floating)return k;const P=ob(F.floating,d.x),$=ob(F.floating,d.y);return l?{...k,transform:"translate("+P+"px, "+$+"px)",...OE(F.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:P,top:$}},[n,l,F.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:L,refs:N,elements:F,floatingStyles:D}),[d,L,N,F,D])}const F4=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?rb({element:r.current,padding:o}).fn(n):{}:r?rb({element:r,padding:o}).fn(n):{}}}},LE=(e,t)=>({...D4(e),options:[e,t]}),ty=(e,t)=>({...I4(e),options:[e,t]}),sb=(e,t)=>({...O4(e),options:[e,t]}),rg=(e,t)=>({...A4(e),options:[e,t]}),z4=(e,t)=>({...N4(e),options:[e,t]}),og=(e,t)=>({...M4(e),options:[e,t]}),$E=(e,t)=>({...F4(e),options:[e,t]}),FE={...Aw},B4=FE.useInsertionEffect,U4=B4||(e=>e());function mi(e){const t=p.useRef(()=>{});return U4(()=>{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 go=typeof document<"u"?p.useLayoutEffect:p.useEffect;let ab=!1,V4=0;const lb=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+V4++;function H4(){const[e,t]=p.useState(()=>ab?lb():void 0);return go(()=>{e==null&&t(lb())},[]),p.useEffect(()=>{ab=!0},[]),e}const W4=FE.useId,zE=W4||H4;function q4(){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 G4=p.createContext(null),Q4=p.createContext(null),ny=()=>{var e;return((e=p.useContext(G4))==null?void 0:e.id)||null},ry=()=>p.useContext(Q4);function oy(e){return"data-floating-ui-"+e}function Np(e){const t=p.useRef(e);return go(()=>{t.current=e}),t}const cb=oy("safe-polygon");function wd(e,t,n){return n&&!eg(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function K4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:a}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,m=ry(),g=ny(),v=Np(u),w=Np(c),y=Np(n),S=p.useRef(),b=p.useRef(-1),x=p.useRef(),C=p.useRef(-1),j=p.useRef(!0),T=p.useRef(!1),E=p.useRef(()=>{}),_=p.useCallback(()=>{var F;const D=(F=o.current.openEvent)==null?void 0:F.type;return(D==null?void 0:D.includes("mouse"))&&D!=="mousedown"},[o]);p.useEffect(()=>{if(!l)return;function F(D){let{open:k}=D;k||(clearTimeout(b.current),clearTimeout(C.current),j.current=!0)}return i.on("openchange",F),()=>{i.off("openchange",F)}},[l,i]),p.useEffect(()=>{if(!l||!v.current||!n)return;function F(k){_()&&r(!1,k,"hover")}const D=cs(a.floating).documentElement;return D.addEventListener("mouseleave",F),()=>{D.removeEventListener("mouseleave",F)}},[a.floating,n,r,l,v,_]);const R=p.useCallback(function(F,D,k){D===void 0&&(D=!0),k===void 0&&(k="hover");const P=wd(w.current,"close",S.current);P&&!x.current?(clearTimeout(b.current),b.current=window.setTimeout(()=>r(!1,F,k),P)):D&&(clearTimeout(b.current),r(!1,F,k))},[w,r]),A=mi(()=>{E.current(),x.current=void 0}),L=mi(()=>{if(T.current){const F=cs(a.floating).body;F.style.pointerEvents="",F.removeAttribute(cb),T.current=!1}});p.useEffect(()=>{if(!l)return;function F(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function D(O){if(clearTimeout(b.current),j.current=!1,d&&!eg(S.current)||f>0&&!wd(w.current,"open"))return;const V=wd(w.current,"open",S.current);V?b.current=window.setTimeout(()=>{y.current||r(!0,O,"hover")},V):r(!0,O,"hover")}function k(O){if(F())return;E.current();const V=cs(a.floating);if(clearTimeout(C.current),v.current&&o.current.floatingContext){n||clearTimeout(b.current),x.current=v.current({...o.current.floatingContext,tree:m,x:O.clientX,y:O.clientY,onClose(){L(),A(),R(O,!0,"safe-polygon")}});const ie=x.current;V.addEventListener("mousemove",ie),E.current=()=>{V.removeEventListener("mousemove",ie)};return}(S.current==="touch"?!jc(a.floating,O.relatedTarget):!0)&&R(O)}function P(O){F()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:m,x:O.clientX,y:O.clientY,onClose(){L(),A(),R(O)}})(O))}if(Rt(a.domReference)){var $;const O=a.domReference;return n&&O.addEventListener("mouseleave",P),($=a.floating)==null||$.addEventListener("mouseleave",P),h&&O.addEventListener("mousemove",D,{once:!0}),O.addEventListener("mouseenter",D),O.addEventListener("mouseleave",k),()=>{var V;n&&O.removeEventListener("mouseleave",P),(V=a.floating)==null||V.removeEventListener("mouseleave",P),h&&O.removeEventListener("mousemove",D),O.removeEventListener("mouseenter",D),O.removeEventListener("mouseleave",k)}}},[a,l,e,d,f,h,R,A,L,r,n,y,m,w,v,o]),go(()=>{var F;if(l&&n&&(F=v.current)!=null&&F.__options.blockPointerEvents&&_()){const k=cs(a.floating).body;k.setAttribute(cb,""),k.style.pointerEvents="none",T.current=!0;const P=a.floating;if(Rt(a.domReference)&&P){var D;const $=a.domReference,O=m==null||(D=m.nodesRef.current.find(V=>V.id===g))==null||(D=D.context)==null?void 0:D.elements.floating;return O&&(O.style.pointerEvents=""),$.style.pointerEvents="auto",P.style.pointerEvents="auto",()=>{$.style.pointerEvents="",P.style.pointerEvents=""}}}},[l,n,g,a,m,v,_]),go(()=>{n||(S.current=void 0,A(),L())},[n,A,L]),p.useEffect(()=>()=>{A(),clearTimeout(b.current),clearTimeout(C.current),L()},[l,a.domReference,A,L]);const U=p.useMemo(()=>{function F(D){S.current=D.pointerType}return{onPointerDown:F,onPointerEnter:F,onMouseMove(D){const{nativeEvent:k}=D;function P(){!j.current&&!y.current&&r(!0,k,"hover")}d&&!eg(S.current)||n||f===0||(clearTimeout(C.current),S.current==="touch"?P():C.current=window.setTimeout(P,f))}}},[d,r,n,y,f]),N=p.useMemo(()=>({onMouseEnter(){clearTimeout(b.current)},onMouseLeave(F){R(F.nativeEvent,!1)}}),[R]);return p.useMemo(()=>l?{reference:U,floating:N}:{},[l,U,N])}const ig=()=>{},BE=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:ig,setState:ig,isInstantPhase:!1}),UE=()=>p.useContext(BE);function Y4(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 go(()=>{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(BE.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)}function X4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i}=t,a=i??o,l=UE(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:h}=l;return go(()=>{c&&(f({delay:{open:1,close:wd(d,"close")}}),c!==a&&r(!1))},[a,r,f,c,d]),go(()=>{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]),go(()=>{u===ig||!n||u(a)},[n,u,a]),l}function Mp(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 J4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Z4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},ub=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 e3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:g}=t,v=ry(),w=mi(typeof c=="function"?c:()=>!1),y=typeof c=="function"?w:c,S=p.useRef(!1),b=p.useRef(!1),{escapeKey:x,outsidePress:C}=ub(m),{escapeKey:j,outsidePress:T}=ub(g),E=mi(N=>{var F;if(!n||!a||!l||N.key!=="Escape")return;const D=(F=i.current.floatingContext)==null?void 0:F.nodeId,k=v?Mp(v.nodesRef.current,D):[];if(!x&&(N.stopPropagation(),k.length>0)){let P=!0;if(k.forEach($=>{var O;if((O=$.context)!=null&&O.open&&!$.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,QN(N)?N.nativeEvent:N,"escape-key")}),_=mi(N=>{var F;const D=()=>{var k;E(N),(k=fa(N))==null||k.removeEventListener("keydown",D)};(F=fa(N))==null||F.addEventListener("keydown",D)}),R=mi(N=>{var F;const D=S.current;S.current=!1;const k=b.current;if(b.current=!1,u==="click"&&k||D||typeof y=="function"&&!y(N))return;const P=fa(N),$="["+oy("inert")+"]",O=cs(o.floating).querySelectorAll($);let V=Rt(P)?P:null;for(;V&&!Di(V);){const ae=zo(V);if(Di(ae)||!Rt(ae))break;V=ae}if(O.length&&Rt(P)&&!KN(P)&&!jc(P,o.floating)&&Array.from(O).every(ae=>!jc(V,ae)))return;if(hr(P)&&U){const ae=P.clientWidth>0&&P.scrollWidth>P.clientWidth,Ee=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let Fe=Ee&&N.offsetX>P.clientWidth;if(Ee&&_r(P).direction==="rtl"&&(Fe=N.offsetX<=P.offsetWidth-P.clientWidth),Fe||ae&&N.offsetY>P.clientHeight)return}const K=(F=i.current.floatingContext)==null?void 0:F.nodeId,ie=v&&Mp(v.nodesRef.current,K).some(ae=>{var Ee;return Ip(N,(Ee=ae.context)==null?void 0:Ee.elements.floating)});if(Ip(N,o.floating)||Ip(N,o.domReference)||ie)return;const Re=v?Mp(v.nodesRef.current,K):[];if(Re.length>0){let ae=!0;if(Re.forEach(Ee=>{var Fe;if((Fe=Ee.context)!=null&&Fe.open&&!Ee.context.dataRef.current.__outsidePressBubbles){ae=!1;return}}),!ae)return}r(!1,N,"outside-press")}),A=mi(N=>{var F;const D=()=>{var k;R(N),(k=fa(N))==null||k.removeEventListener(u,D)};(F=fa(N))==null||F.addEventListener(u,D)});p.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=C;function N(k){r(!1,k,"ancestor-scroll")}const F=cs(o.floating);l&&F.addEventListener("keydown",j?_:E,j),y&&F.addEventListener(u,T?A:R,T);let D=[];return h&&(Rt(o.domReference)&&(D=Ao(o.domReference)),Rt(o.floating)&&(D=D.concat(Ao(o.floating))),!Rt(o.reference)&&o.reference&&o.reference.contextElement&&(D=D.concat(Ao(o.reference.contextElement)))),D=D.filter(k=>{var P;return k!==((P=F.defaultView)==null?void 0:P.visualViewport)}),D.forEach(k=>{k.addEventListener("scroll",N,{passive:!0})}),()=>{l&&F.removeEventListener("keydown",j?_:E,j),y&&F.removeEventListener(u,T?A:R,T),D.forEach(k=>{k.removeEventListener("scroll",N)})}},[i,o,l,y,u,n,r,h,a,x,C,E,j,_,R,T,A]),p.useEffect(()=>{S.current=!1},[y,u]);const L=p.useMemo(()=>({onKeyDown:E,[J4[f]]:N=>{d&&r(!1,N.nativeEvent,"reference-press")}}),[E,r,d,f]),U=p.useMemo(()=>({onKeyDown:E,onMouseDown(){b.current=!0},onMouseUp(){b.current=!0},[Z4[u]]:()=>{S.current=!0}}),[E,u]);return p.useMemo(()=>a?{reference:L,floating:U}:{},[a,L,U])}function t3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=zE(),i=p.useRef({}),[a]=p.useState(()=>q4()),l=ny()!=null,[c,u]=p.useState(r.reference),d=mi((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 iy(e){e===void 0&&(e={});const{nodeId:t}=e,n=t3({...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=ry();go(()=>{d&&(f.current=d)},[d]);const m=$4({...e,elements:{...o,...l&&{reference:l}}}),g=p.useCallback(b=>{const x=Rt(b)?{getBoundingClientRect:()=>b.getBoundingClientRect(),contextElement:b}:b;c(x),m.refs.setReference(x)},[m.refs]),v=p.useCallback(b=>{(Rt(b)||b===null)&&(f.current=b,a(b)),(Rt(m.refs.reference.current)||m.refs.reference.current===null||b!==null&&!Rt(b))&&m.refs.setReference(b)},[m.refs]),w=p.useMemo(()=>({...m.refs,setReference:v,setPositionReference:g,domReference:f}),[m.refs,v,g]),y=p.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),S=p.useMemo(()=>({...m,...r,refs:w,elements:y,nodeId:t}),[m,w,y,t,r]);return go(()=>{r.dataRef.current.floatingContext=S;const b=h==null?void 0:h.nodesRef.current.find(x=>x.id===t);b&&(b.context=S)}),p.useMemo(()=>({...m,context:S,refs:w,elements:y}),[m,w,y,S])}function n3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=p.useRef(!1),d=p.useRef(),f=p.useRef(!0);p.useEffect(()=>{if(!l)return;const m=Xn(a.domReference);function g(){!n&&hr(a.domReference)&&a.domReference===J1(cs(a.domReference))&&(u.current=!0)}function v(){f.current=!0}return m.addEventListener("blur",g),m.addEventListener("keydown",v,!0),()=>{m.removeEventListener("blur",g),m.removeEventListener("keydown",v,!0)}},[a.domReference,n,l]),p.useEffect(()=>{if(!l)return;function m(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(u.current=!0)}return o.on("openchange",m),()=>{o.off("openchange",m)}},[o,l]),p.useEffect(()=>()=>{clearTimeout(d.current)},[]);const h=p.useMemo(()=>({onPointerDown(m){HN(m.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(m){if(u.current)return;const g=fa(m.nativeEvent);if(c&&Rt(g))try{if(WN()&&qN())throw Error();if(!g.matches(":focus-visible"))return}catch{if(!f.current&&!XN(g))return}r(!0,m.nativeEvent,"focus")},onBlur(m){u.current=!1;const g=m.relatedTarget,v=m.nativeEvent,w=Rt(g)&&g.hasAttribute(oy("focus-guard"))&&g.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var y;const S=J1(a.domReference?a.domReference.ownerDocument:document);!g&&S===a.domReference||jc((y=i.current.floatingContext)==null?void 0:y.refs.floating.current,S)||jc(a.domReference,S)||w||r(!1,v,"focus")})}}),[i,a.domReference,r,c]);return p.useMemo(()=>l?{reference:h}:{},[l,h])}const db="active",fb="selected";function Op(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[db]:a,[fb]: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&&[db,fb].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(w=>w(...g)).find(w=>w!==void 0)}}}else a[u]=d}),a),{})}}function r3(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=p.useCallback(l=>Op(l,e,"reference"),t),i=p.useCallback(l=>Op(l,e,"floating"),n),a=p.useCallback(l=>Op(l,e,"item"),r);return p.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a}),[o,i,a])}const o3=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function i3(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=(n=o3.get(a))!=null?n:a,c=zE(),d=ny()!=null,f=p.useMemo(()=>l==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:r?o:void 0}:{"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"}},[l,o,d,r,c,a]),h=p.useMemo(()=>{const g={id:o,...l&&{role:l}};return l==="tooltip"||a==="label"?g:{...g,...l==="menu"&&{"aria-labelledby":c}}},[l,o,c,a]),m=p.useCallback(g=>{let{active:v,selected:w}=g;const y={role:"option",...v&&{id:o+"-option"}};switch(a){case"select":return{...y,"aria-selected":v&&w};case"combobox":return{...y,...v&&{"aria-selected":!0}}}return{}},[o,a]);return p.useMemo(()=>i?{reference:f,floating:h,item:m}:{},[i,f,h,m])}function VE(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 hb(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function pb(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 s3={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function a3({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[s3[c]]:r},f=-t/2;return c==="left"?{...d,...hb(u,a,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...hb(u,a,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...pb(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...pb(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const sy=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}=Ns();return i?s.jsx("div",{...u,ref:d,style:{...c,...a3({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:a,arrowY:l})}}):null});sy.displayName="@mantine/core/FloatingArrow";const[l3,HE]=Bn("Popover component was not found in the tree");function Xf({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=Z_(t),i=rn(o,r);return qo(e)?p.cloneElement(e,{[n]:i}):e}function WE(e){return s.jsx(qv,{tabIndex:-1,"data-autofocus":!0,...e})}Xf.displayName="@mantine/core/FocusTrap";WE.displayName="@mantine/core/FocusTrapInitialFocus";Xf.InitialFocus=WE;function c3(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 u3={},qE=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=H("Portal",u3,e),[i,a]=p.useState(!1),l=p.useRef(null);return rl(()=>(a(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:c3(o),Rf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:qc.createPortal(s.jsx(s.Fragment,{children:n}),l.current)});qE.displayName="@mantine/core/Portal";function Ls({withinPortal:e=!0,children:t,...n}){return e?s.jsx(qE,{...n,children:t}):s.jsx(s.Fragment,{children:t})}Ls.displayName="@mantine/core/OptionalPortal";const Nl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${B(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),Zu={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${B(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${B(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${B(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${B(-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(${B(-20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${B(20)}) rotate(5deg)`},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Nl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Nl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Nl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Nl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Nl("top"),common:{transformOrigin:"top right"}}},mb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function d3({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Zu?{transitionProperty:Zu[e].transitionProperty,...o,...Zu[e].common,...Zu[e][mb[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[mb[t]]}}function f3({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:l,enterDelay:c,exitDelay:u}){const d=At(),f=Gg(),h=d.respectReducedMotion?f:!1,[m,g]=p.useState(h?0:e),[v,w]=p.useState(r?"entered":"exited"),y=p.useRef(-1),S=p.useRef(-1),b=p.useRef(-1),x=j=>{const T=j?o:i,E=j?a:l;window.clearTimeout(y.current);const _=h?0:j?e:t;g(_),_===0?(typeof T=="function"&&T(),typeof E=="function"&&E(),w(j?"entered":"exited")):b.current=requestAnimationFrame(()=>{Ta.flushSync(()=>{w(j?"pre-entering":"pre-exiting")}),b.current=requestAnimationFrame(()=>{typeof T=="function"&&T(),w(j?"entering":"exiting"),y.current=window.setTimeout(()=>{typeof E=="function"&&E(),w(j?"entered":"exited")},_)})})},C=j=>{if(window.clearTimeout(S.current),typeof(j?c:u)!="number"){x(j);return}S.current=window.setTimeout(()=>{x(j)},j?c:u)};return Mo(()=>{C(r)},[r]),p.useEffect(()=>()=>{window.clearTimeout(y.current),cancelAnimationFrame(b.current)},[]),{transitionDuration:m,transitionStatus:v,transitionTimingFunction:n||"ease"}}function Xo({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,enterDelay:f,exitDelay:h}){const{transitionDuration:m,transitionStatus:g,transitionTimingFunction:v}=f3({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d,enterDelay:f,exitDelay:h});return m===0?o?s.jsx(s.Fragment,{children:i({})}):e?i({display:"none"}):null:g==="exited"?e?i({display:"none"}):null:s.jsx(s.Fragment,{children:i(d3({transition:t,duration:m,state:g,timingFunction:v}))})}Xo.displayName="@mantine/core/Transition";var GE={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const h3={},ay=X((e,t)=>{var w,y,S,b;const n=H("PopoverDropdown",h3,e),{className:r,style:o,vars:i,children:a,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=HE(),m=Qw({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=rn(t,h.floating);return h.disabled?null:s.jsx(Ls,{...h.portalProps,withinPortal:h.withinPortal,children:s.jsx(Xo,{mounted:h.opened,...h.transitionProps,transition:((w=h.transitionProps)==null?void 0:w.transition)||"fade",duration:((y=h.transitionProps)==null?void 0:y.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((S=h.transitionProps)==null?void 0:S.exitDuration)=="number"?h.transitionProps.exitDuration:(b=h.transitionProps)==null?void 0:b.duration,children:x=>s.jsx(Xf,{active:h.trapFocus,innerRef:v,children:s.jsxs(q,{...g,...f,variant:c,onKeyDownCapture:z_(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,"data-fixed":h.floatingStrategy==="fixed"||void 0,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...x,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:B(h.width)},o]}),children:[a,s.jsx(sy,{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})})]})})})})});ay.classes=GE;ay.displayName="@mantine/core/PopoverDropdown";const p3={refProp:"ref",popupType:"dialog"},QE=X((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=H("PopoverTarget",p3,e);if(!qo(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=HE(),c=rn(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:rt(l.targetProps.className,a.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});QE.displayName="@mantine/core/PopoverTarget";function KE({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 _4(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Mo(()=>{t.update()},r),Mo(()=>{i(a=>a+1)},[e])}function m3(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 g3(e,t){const n=m3(e.middlewares),r=[LE(e.offset)];return n.shift&&r.push(ty(typeof n.shift=="boolean"?{limiter:sb(),padding:5}:{limiter:sb(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?rg():rg(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?og():og(n.inline)),r.push($E({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(z4({...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 v3(e){const[t,n]=yn({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=iy({strategy:e.strategy,placement:e.position,middleware:g3(e,()=>i)});return KE({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Mo(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),Mo(()=>{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 y3={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:eo("popover"),__staticSelector:"Popover",width:"max-content"},x3=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:lt(t),"--popover-shadow":Hg(n)}});function to(e){var Z,ue,we,We,ne,pe;const t=H("Popover",y3,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:w,classNames:y,styles:S,closeOnClickOutside:b,withinPortal:x,portalProps:C,closeOnEscape:j,clickOutsideEvents:T,trapFocus:E,onClose:_,onOpen:R,onChange:A,zIndex:L,radius:U,shadow:N,id:F,defaultOpened:D,__staticSelector:k,withRoles:P,disabled:$,returnFocus:O,variant:V,keepMounted:K,vars:ie,floatingStrategy:Re,...ae}=t,Ee=ce({name:k,props:t,classes:GE,classNames:y,styles:S,unstyled:w,rootSelector:"dropdown",vars:ie,varsResolver:x3}),Fe=p.useRef(null),[me,Le]=p.useState(null),[nt,Tt]=p.useState(null),{dir:Ve}=Ns(),Te=Un(F),Pe=v3({middlewares:d,width:u,position:VE(Ve,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:Fe,arrowOffset:m,onPositionChange:i,positionDependencies:a,opened:l,defaultOpened:D,onChange:A,onOpen:R,onClose:_,strategy:Re});V_(()=>b&&Pe.onClose(),T,[me,nt]);const Xe=p.useCallback(Q=>{Le(Q),Pe.floating.refs.setReference(Q)},[Pe.floating.refs.setReference]),Qe=p.useCallback(Q=>{Tt(Q),Pe.floating.refs.setFloating(Q)},[Pe.floating.refs.setFloating]);return s.jsx(l3,{value:{returnFocus:O,disabled:$,controlled:Pe.controlled,reference:Xe,floating:Qe,x:Pe.floating.x,y:Pe.floating.y,arrowX:(we=(ue=(Z=Pe.floating)==null?void 0:Z.middlewareData)==null?void 0:ue.arrow)==null?void 0:we.x,arrowY:(pe=(ne=(We=Pe.floating)==null?void 0:We.middlewareData)==null?void 0:ne.arrow)==null?void 0:pe.y,opened:Pe.opened,arrowRef:Fe,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,placement:Pe.floating.placement,trapFocus:E,withinPortal:x,portalProps:C,zIndex:L,radius:U,shadow:N,closeOnEscape:j,onClose:Pe.onClose,onToggle:Pe.onToggle,getTargetId:()=>`${Te}-target`,getDropdownId:()=>`${Te}-dropdown`,withRoles:P,targetProps:ae,__staticSelector:k,classNames:y,styles:S,unstyled:w,variant:V,keepMounted:K,getStyles:Ee,floatingStrategy:Re},children:n})}to.Target=QE;to.Dropdown=ay;to.displayName="@mantine/core/Popover";to.extend=e=>e;var Wr={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 b3=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:rt(Wr.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Wr.bar}),s.jsx("span",{className:Wr.bar}),s.jsx("span",{className:Wr.bar})]})),S3=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:rt(Wr.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Wr.dot}),s.jsx("span",{className:Wr.dot}),s.jsx("span",{className:Wr.dot})]})),w3=p.forwardRef(({className:e,...t},n)=>s.jsx(q,{component:"span",className:rt(Wr.ovalLoader,e),...t,ref:n})),YE={bars:b3,oval:w3,dots:S3},j3={loaders:YE,type:"oval"},C3=(e,{size:t,color:n})=>({root:{"--loader-size":Ae(t,"loader-size"),"--loader-color":n?at(n,e):void 0}}),Zn=X((e,t)=>{const n=H("Loader",j3,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,w=ce({name:"Loader",props:n,classes:Wr,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:a,varsResolver:C3});return g?s.jsx(q,{...w("root"),ref:t,...v,children:g}):s.jsx(q,{...w("root"),ref:t,component:h[i],variant:m,size:r,...v})});Zn.defaultLoaders=YE;Zn.classes=Wr;Zn.displayName="@mantine/core/Loader";var Jf={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const gb={orientation:"horizontal"},E3=(e,{borderWidth:t})=>({group:{"--ai-border-width":B(t)}}),ly=X((e,t)=>{const n=H("ActionIconGroup",gb,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=H("ActionIconGroup",gb,e),g=ce({name:"ActionIconGroup",props:n,classes:Jf,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:E3,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});ly.classes=Jf;ly.displayName="@mantine/core/ActionIconGroup";const T3={},P3=(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":Ae(t,"ai-size"),"--ai-radius":n===void 0?void 0:lt(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=Dn((e,t)=>{const n=H("ActionIcon",T3,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:w,children:y,disabled:S,"data-disabled":b,autoContrast:x,mod:C,...j}=n,T=ce({name:["ActionIcon",g],props:n,className:r,style:c,classes:Jf,classNames:a,styles:l,unstyled:o,vars:w,varsResolver:P3});return s.jsxs(bn,{...T("root",{active:!S&&!u&&!b}),...j,unstyled:o,variant:i,size:f,disabled:S||u,ref:t,mod:[{loading:u,disabled:S||b},C],children:[s.jsx(Xo,{mounted:!!u,transition:"slide-down",duration:150,children:E=>s.jsx(q,{component:"span",...T("loader",{style:E}),"aria-hidden":!0,children:s.jsx(Zn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})})}),s.jsx(q,{component:"span",mod:{loading:u},...T("icon"),children:y})]})});tn.classes=Jf;tn.displayName="@mantine/core/ActionIcon";tn.Group=ly;const XE=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"})}));XE.displayName="@mantine/core/CloseIcon";var JE={root:"m_86a44da5","root--subtle":"m_220c80f2"};const k3={variant:"subtle"},R3=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Ae(t,"cb-size"),"--cb-radius":n===void 0?void 0:lt(n),"--cb-icon-size":B(r)}}),$s=Dn((e,t)=>{const n=H("CloseButton",k3,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:w,...y}=n,S=ce({name:"CloseButton",props:n,className:l,style:u,classes:JE,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:R3});return s.jsxs(bn,{ref:t,...y,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},w],...S("root",{variant:g,active:!m&&!h}),children:[v||s.jsx(XE,{}),o]})});$s.classes=JE;$s.displayName="@mantine/core/CloseButton";function _3(e){return p.Children.toArray(e).filter(Boolean)}var ZE={root:"m_4081bf90"};const D3={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},I3=(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":Jt(r),"--group-align":o,"--group-justify":i,"--group-wrap":a}}),te=X((e,t)=>{const n=H("Group",D3,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:w,__size:y,mod:S,...b}=n,x=_3(c),C=x.length,j=Jt(u??"md"),E={childWidth:`calc(${100/C}% - (${j} - ${j} / ${C}))`},_=ce({name:"Group",props:n,stylesCtx:E,className:o,style:i,classes:ZE,classNames:r,styles:a,unstyled:l,vars:v,varsResolver:I3});return s.jsx(q,{..._("root"),ref:t,variant:w,mod:[{grow:m},S],size:y,...b,children:x})});te.classes=ZE;te.displayName="@mantine/core/Group";var eT={root:"m_9814e45f"};const A3={zIndex:eo("modal")},N3=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:a})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Sr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${B(o)})`:void 0,"--overlay-radius":i===void 0?void 0:lt(i),"--overlay-z-index":a==null?void 0:a.toString()}}),Cc=Dn((e,t)=>{const n=H("Overlay",A3,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:w,backgroundOpacity:y,mod:S,...b}=n,x=ce({name:"Overlay",props:n,classes:eT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:N3});return s.jsx(q,{ref:t,...x("root"),mod:[{center:d,fixed:u},S],...b,children:f})});Cc.classes=eT;Cc.displayName="@mantine/core/Overlay";const[M3,Jo]=Bn("ModalBase component was not found in tree");function O3({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),a=Gg()?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 L3({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:a}){const l=Un(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=O3({opened:n,transitionDuration:h});return Jw("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}),Qw({opened:n,shouldReturnFocus:r&&a}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const $3=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:w,unstyled:y,removeScrollProps:S,...b},x)=>{const{_id:C,titleMounted:j,bodyMounted:T,shouldLockScroll:E,setTitleMounted:_,setBodyMounted:R}=L3({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:a,onClose:n,returnFocus:l}),{key:A,...L}=S||{};return s.jsx(Ls,{...d,withinPortal:u,children:s.jsx(M3,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:j,bodyMounted:T,setTitleMounted:_,setBodyMounted:R,trapFocus:i,closeOnEscape:a,zIndex:m,unstyled:y},children:s.jsx(Pf,{enabled:E&&f,...L,children:s.jsx(q,{ref:x,...b,__vars:{...w,"--mb-z-index":(m||eo("modal")).toString(),"--mb-shadow":Hg(g),"--mb-padding":Jt(v)},children:h})},A)})})});function F3(){const e=Jo();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Ka={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const tT=p.forwardRef(({className:e,...t},n)=>{const r=F3(),o=Jo();return s.jsx(q,{ref:n,...t,id:r,className:rt({[Ka.body]:!o.unstyled},e)})});tT.displayName="@mantine/core/ModalBaseBody";const nT=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Jo();return s.jsx($s,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:rt({[Ka.close]:!o.unstyled},e),unstyled:o.unstyled})});nT.displayName="@mantine/core/ModalBaseCloseButton";const z3=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},a)=>{const l=Jo();return s.jsx(Xo,{mounted:l.opened,transition:"pop",...l.transitionProps,...e,children:c=>s.jsx("div",{...n,className:rt({[Ka.inner]:!l.unstyled},n.className),children:s.jsx(Xf,{active:l.opened&&l.trapFocus,innerRef:a,children:s.jsx(Yn,{...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,style:[o,c],className:rt({[Ka.content]:!l.unstyled},t),unstyled:l.unstyled,children:i.children})})})})}),rT=p.forwardRef(({className:e,...t},n)=>{const r=Jo();return s.jsx(q,{component:"header",ref:n,className:rt({[Ka.header]:!r.unstyled},e),...t})});rT.displayName="@mantine/core/ModalBaseHeader";const B3={duration:200,timingFunction:"ease",transition:"fade"};function U3(e){const t=Jo();return{...B3,...t.transitionProps,...e}}const oT=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Jo(),a=U3(t);return s.jsx(Xo,{mounted:i.opened,...a,transition:"fade",children:l=>s.jsx(Cc,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r})})});oT.displayName="@mantine/core/ModalBaseOverlay";function V3(){const e=Jo();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const iT=p.forwardRef(({className:e,...t},n)=>{const r=V3(),o=Jo();return s.jsx(q,{component:"h2",ref:n,className:rt({[Ka.title]:!o.unstyled},e),...t,id:r})});iT.displayName="@mantine/core/ModalBaseTitle";function H3({children:e}){return s.jsx(s.Fragment,{children:e})}const[W3,ll]=Ds({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Ar={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 vb={},q3=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${dn(t)} - ${B(2)})`}}),Zf=X((e,t)=>{const n=H("InputDescription",vb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=H("InputDescription",vb,n),g=ll(),v=ce({name:["InputWrapper",d],props:n,classes:Ar,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"description",vars:c,varsResolver:q3}),w=f&&(g==null?void 0:g.getStyles)||v;return s.jsx(q,{component:"p",ref:t,variant:h,size:u,...w("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...m})});Zf.classes=Ar;Zf.displayName="@mantine/core/InputDescription";const G3={},Q3=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${dn(t)} - ${B(2)})`}}),eh=X((e,t)=>{const n=H("InputError",G3,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=ce({name:["InputWrapper",d],props:n,classes:Ar,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"error",vars:c,varsResolver:Q3}),v=ll(),w=f&&(v==null?void 0:v.getStyles)||g;return s.jsx(q,{component:"p",ref:t,variant:h,size:u,...w("error",v!=null&&v.getStyles?{className:o,style:i}:void 0),...m})});eh.classes=Ar;eh.displayName="@mantine/core/InputError";const yb={labelElement:"label"},K3=(e,{size:t})=>({label:{"--input-label-size":dn(t),"--input-asterisk-color":void 0}}),th=X((e,t)=>{const n=H("InputLabel",yb,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:w,mod:y,...S}=H("InputLabel",yb,n),b=ce({name:["InputWrapper",v],props:n,classes:Ar,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"label",vars:c,varsResolver:K3}),x=ll(),C=(x==null?void 0:x.getStyles)||b;return s.jsxs(q,{...C("label",x!=null&&x.getStyles?{className:o,style:i}:void 0),component:u,variant:w,size:d,ref:t,htmlFor:u==="label"?h:void 0,mod:[{required:f},y],onMouseDown:j=>{m==null||m(j),!j.defaultPrevented&&j.detail>1&&j.preventDefault()},...S,children:[g,f&&s.jsx("span",{...C("required"),"aria-hidden":!0,children:" *"})]})});th.classes=Ar;th.displayName="@mantine/core/InputLabel";const xb={},cy=X((e,t)=>{const n=H("InputPlaceholder",xb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=H("InputPlaceholder",xb,n),g=ce({name:["InputPlaceholder",u],props:n,classes:Ar,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"placeholder"});return s.jsx(q,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...m})});cy.classes=Ar;cy.displayName="@mantine/core/InputPlaceholder";function Y3(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 X3={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},J3=(e,{size:t})=>({label:{"--input-label-size":dn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${dn(t)} - ${B(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${dn(t)} - ${B(2)})`}}),uy=X((e,t)=>{const n=H("InputWrapper",X3,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:w,labelProps:y,descriptionProps:S,errorProps:b,labelElement:x,children:C,withAsterisk:j,id:T,required:E,__stylesApiProps:_,mod:R,...A}=n,L=ce({name:["InputWrapper",f],props:_||n,classes:Ar,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:J3}),U={size:u,variant:d,__staticSelector:f},N=Un(T),F=typeof j=="boolean"?j:E,D=(b==null?void 0:b.id)||`${N}-error`,k=(S==null?void 0:S.id)||`${N}-description`,P=N,$=!!v&&typeof v!="boolean",O=!!w,V=`${$?D:""} ${O?k:""}`,K=V.trim().length>0?V.trim():void 0,ie=(y==null?void 0:y.id)||`${N}-label`,Re=g&&s.jsx(th,{labelElement:x,id:ie,htmlFor:P,required:F,...U,...y,children:g},"label"),ae=O&&s.jsx(Zf,{...S,...U,size:(S==null?void 0:S.size)||U.size,id:(S==null?void 0:S.id)||k,children:w},"description"),Ee=s.jsx(p.Fragment,{children:h(C)},"input"),Fe=$&&p.createElement(eh,{...b,...U,size:(b==null?void 0:b.size)||U.size,key:"error",id:(b==null?void 0:b.id)||D},v),me=m.map(Le=>{switch(Le){case"label":return Re;case"input":return Ee;case"description":return ae;case"error":return Fe;default:return null}});return s.jsx(W3,{value:{getStyles:L,describedBy:K,inputId:P,labelId:ie,...Y3(m,{hasDescription:O,hasError:$})},children:s.jsx(q,{ref:t,variant:d,size:u,mod:[{error:!!v},R],...L("root"),...A,children:me})})});uy.classes=Ar;uy.displayName="@mantine/core/InputWrapper";const Z3={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},eM=(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":Ae(t.size,"input-height"),"--input-fz":dn(t.size),"--input-radius":t.radius===void 0?void 0:lt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?B(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?B(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Ae(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Lt=Dn((e,t)=>{const n=H("Input",Z3,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:w,leftSectionWidth:y,rightSection:S,rightSectionProps:b,rightSectionWidth:x,rightSectionPointerEvents:C,leftSectionPointerEvents:j,variant:T,vars:E,pointer:_,multiline:R,radius:A,id:L,withAria:U,withErrorStyles:N,mod:F,inputSize:D,...k}=n,{styleProps:P,rest:$}=Qo(k),O=ll(),V={offsetBottom:O==null?void 0:O.offsetBottom,offsetTop:O==null?void 0:O.offsetTop},K=ce({name:["Input",u],props:d||n,classes:Ar,className:o,style:i,classNames:r,styles:a,unstyled:l,stylesCtx:V,rootSelector:"wrapper",vars:E,varsResolver:eM}),ie=U?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":O==null?void 0:O.describedBy,id:(O==null?void 0:O.inputId)||L}:{};return s.jsxs(q,{...K("wrapper"),...P,...h,mod:[{error:!!m&&N,pointer:_,disabled:g,multiline:R,"data-with-right-section":!!S,"data-with-left-section":!!v},F],variant:T,size:f,children:[v&&s.jsx("div",{...w,"data-position":"left",...K("section",{className:w==null?void 0:w.className,style:w==null?void 0:w.style}),children:v}),s.jsx(q,{component:"input",...$,...ie,ref:t,required:c,mod:{disabled:g,error:!!m&&N},variant:T,__size:D,...K("input")}),S&&s.jsx("div",{...b,"data-position":"right",...K("section",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),children:S})]})});Lt.classes=Ar;Lt.Wrapper=uy;Lt.Label=th;Lt.Error=eh;Lt.Description=Zf;Lt.Placeholder=cy;Lt.displayName="@mantine/core/Input";function tM(e,t,n){const r=H(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:w,wrapperProps:y,id:S,size:b,style:x,inputContainer:C,inputWrapperOrder:j,withAsterisk:T,variant:E,vars:_,mod:R,...A}=r,{styleProps:L,rest:U}=Qo(A),N={label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:m||r,errorProps:g,labelProps:v,descriptionProps:w,unstyled:f,styles:u,size:b,style:x,inputContainer:C,inputWrapperOrder:j,withAsterisk:T,variant:E,id:S,mod:R,...y};return{...U,classNames:c,styles:u,unstyled:f,wrapperProps:{...N,...L},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:b,__staticSelector:h,__stylesApiProps:m||r,error:a,variant:E,id:S}}}const nM={__staticSelector:"InputBase",withAria:!0},tr=Dn((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=tM("InputBase",nM,e);return s.jsx(Lt.Wrapper,{...r,children:s.jsx(Lt,{...n,...o,ref:t})})});tr.classes={...Lt.classes,...Lt.Wrapper.classes};tr.displayName="@mantine/core/InputBase";const rM={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 sT={root:"m_8bffd616"};const oM={},ws=Dn((e,t)=>{const n=H("Flex",oM,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,...w}=n,y=ce({name:"Flex",classes:sT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),S=At(),b=Bc(),x=ij({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v},theme:S,data:rM});return s.jsxs(s.Fragment,{children:[x.hasResponsiveStyles&&s.jsx(As,{selector:`.${b}`,styles:x.styles,media:x.media}),s.jsx(q,{ref:t,...y("root",{className:b,style:Oi(x.inlineStyles)}),...w})]})});ws.classes=sT;ws.displayName="@mantine/core/Flex";function iM(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 sM({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=>{iM(g.target,t)&&(d(),c(!1))};return document.addEventListener("transitionend",m),()=>{document.removeEventListener("transitionend",m)}}},[t]),sD(()=>{Zw()!=="test"&&a(!0)},20,{autoInvoke:!0}),aD(m=>{m.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var aT={root:"m_96b553a6"};const aM={},lM=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),dy=X((e,t)=>{const n=H("FloatingIndicator",aM,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=ce({name:"FloatingIndicator",classes:aT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:lM}),w=p.useRef(null),{initialized:y,hidden:S}=sM({target:u,parent:d,ref:w,displayAfterTransitionEnd:m}),b=rn(t,w);return!u||!d?null:s.jsx(q,{ref:b,mod:[{initialized:y,hidden:S},h],...v("root"),...g})});dy.displayName="@mantine/core/FloatingIndicator";dy.classes=aT;var lT={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 cM={},uM=(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:lt(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Bi=X((e,t)=>{const n=H("Alert",cM,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:w,closeButtonLabel:y,variant:S,autoContrast:b,...x}=n,C=ce({name:"Alert",classes:lT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:uM}),j=Un(m),T=f&&`${j}-title`||void 0,E=`${j}-body`;return s.jsx(q,{id:j,...C("root",{variant:S}),variant:S,ref:t,...x,role:"alert","aria-describedby":E,"aria-labelledby":T,children:s.jsxs("div",{...C("wrapper"),children:[g&&s.jsx("div",{...C("icon"),children:g}),s.jsxs("div",{...C("body"),children:[f&&s.jsx("div",{...C("title"),"data-with-close-button":v||void 0,children:s.jsx("span",{id:T,...C("label"),children:f})}),h&&s.jsx("div",{id:E,...C("message"),"data-variant":S,children:h})]}),v&&s.jsx($s,{...C("closeButton"),onClick:w,variant:"transparent",size:16,iconSize:16,"aria-label":y,unstyled:l})]})})});Bi.classes=lT;Bi.displayName="@mantine/core/Alert";var cT={root:"m_b6d8b162"};function dM(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const fM={inherit:!1},hM=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":dn(o),"--text-lh":Ww(o),"--text-gradient":t==="gradient"?om(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?at(i,e):void 0}}),fe=Dn((e,t)=>{const n=H("Text",fM,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:w,mod:y,size:S,...b}=n,x=ce({name:["Text",u],props:n,classes:cT,className:f,style:h,classNames:m,styles:g,unstyled:v,vars:d,varsResolver:hM});return s.jsx(q,{...x("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:w,mod:[{"data-truncate":dM(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":a},y],size:S,...b})});fe.classes=cT;fe.displayName="@mantine/core/Text";var uT={root:"m_849cf0da"};const pM={underline:"hover"},Ze=Dn((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...a}=H("Anchor",pM,e);return s.jsx(fe,{component:"a",ref:t,className:rt({[uT.root]:!o},r),...a,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Ze.classes=uT;Ze.displayName="@mantine/core/Anchor";const[mM,cl]=Bn("AppShell was not found in tree");var Ui={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const gM={},fy=X((e,t)=>{const n=H("AppShellAside",gM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=cl();return m.disabled?null:s.jsx(q,{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)`}})});fy.classes=Ui;fy.displayName="@mantine/core/AppShellAside";const vM={},hy=X((e,t)=>{var g;const n=H("AppShellFooter",vM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=cl();return m.disabled?null:s.jsx(q,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:rt({[Pf.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()}})});hy.classes=Ui;hy.displayName="@mantine/core/AppShellFooter";const yM={},py=X((e,t)=>{var g;const n=H("AppShellHeader",yM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=cl();return m.disabled?null:s.jsx(q,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:rt({[Pf.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()}})});py.classes=Ui;py.displayName="@mantine/core/AppShellHeader";const xM={},my=X((e,t)=>{const n=H("AppShellMain",xM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=cl();return s.jsx(q,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:a}),...c})});my.classes=Ui;my.displayName="@mantine/core/AppShellMain";function Qc(e){return typeof e=="object"?e.base:e}function Kc(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 Yc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function bM({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"),Kc(i)){const f=B(Qc(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Yc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=B(i.base),e["--app-shell-aside-offset"]=B(i.base)),xt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=B(i[f]),t[f]["--app-shell-aside-offset"]=B(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=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=Wg(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 SM({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(Kc(r)){const a=B(Qc(r));e["--app-shell-footer-height"]=a,i&&(e["--app-shell-footer-offset"]=a)}Yc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=B(r.base),i&&(e["--app-shell-footer-offset"]=B(r.base))),xt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-footer-height"]=B(r[a]),i&&(t[a]["--app-shell-footer-offset"]=B(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function wM({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(Kc(r)){const a=B(Qc(r));e["--app-shell-header-height"]=a,i&&(e["--app-shell-header-offset"]=a)}Yc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=B(r.base),i&&(e["--app-shell-header-offset"]=B(r.base))),xt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-header-height"]=B(r[a]),i&&(t[a]["--app-shell-header-offset"]=B(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function jM({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"),Kc(i)){const f=B(Qc(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Yc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=B(i.base),e["--app-shell-navbar-offset"]=B(i.base)),xt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=B(i[f]),t[f]["--app-shell-navbar-offset"]=B(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=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=Wg(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 Lp(e){return Number(e)===0?"0px":Jt(e)}function CM({padding:e,baseStyles:t,minMediaStyles:n}){Kc(e)&&(t["--app-shell-padding"]=Lp(Qc(e))),Yc(e)&&(e.base&&(t["--app-shell-padding"]=Lp(e.base)),xt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Lp(e[r]))}))}function EM({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const a={},l={},c={};jM({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,navbar:e,theme:i}),bM({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,aside:r,theme:i}),wM({baseStyles:c,minMediaStyles:a,header:t}),SM({baseStyles:c,minMediaStyles:a,footer:n}),CM({baseStyles:c,minMediaStyles:a,padding:o});const u=oc(xt(a),i).map(h=>({query:`(min-width: ${Pd(h.px)})`,styles:a[h.value]})),d=oc(xt(l),i).map(h=>({query:`(max-width: ${Pd(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function TM({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=At(),a=Li(),{media:l,baseStyles:c}=EM({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return s.jsx(As,{media:l,styles:c,selector:a.cssVariablesSelector})}const PM={},gy=X((e,t)=>{const n=H("AppShellNavbar",PM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=cl();return m.disabled?null:s.jsx(q,{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)`}})});gy.classes=Ui;gy.displayName="@mantine/core/AppShellNavbar";const kM={},vy=Dn((e,t)=>{const n=H("AppShellSection",kM,e),{classNames:r,className:o,style:i,styles:a,vars:l,grow:c,mod:u,...d}=n,f=cl();return s.jsx(q,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:a}),...d})});vy.classes=Ui;vy.displayName="@mantine/core/AppShellSection";function RM({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!0),o=p.useRef(),i=p.useRef();return Jw("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),rl(()=>{p.startTransition(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)})},[t,e]),n}const _M={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:eo("app")},DM=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Jn=X((e,t)=>{const n=H("AppShell",_M,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:w,disabled:y,aside:S,footer:b,offsetScrollbars:x,mod:C,...j}=n,T=ce({name:"AppShell",classes:Ui,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:DM}),E=RM({disabled:y,transitionDuration:h});return s.jsxs(mM,{value:{getStyles:T,withBorder:d,zIndex:v,disabled:y,offsetScrollbars:x},children:[s.jsx(TM,{navbar:u,header:g,aside:S,footer:b,padding:f}),s.jsx(q,{ref:t,...T("root"),mod:[{resizing:E,layout:w,disabled:y},C],...j})]})});Jn.classes=Ui;Jn.displayName="@mantine/core/AppShell";Jn.Navbar=gy;Jn.Header=py;Jn.Main=my;Jn.Aside=fy;Jn.Footer=hy;Jn.Section=vy;function dT(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=>dT(t))}:e}function fT(e){return e?e.map(t=>dT(t)):[]}function hT(e){return e.reduce((t,n)=>"group"in n?{...t,...hT(n.items)}:(t[n.value]=n,t),{})}var er={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 IM={error:null},AM=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Ae(t,"combobox-chevron-size")}}),nh=X((e,t)=>{const n=H("ComboboxChevron",IM,e),{size:r,error:o,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=ce({name:"ComboboxChevron",classes:er,props:n,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:AM,rootSelector:"chevron"});return s.jsx(q,{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"})})});nh.classes=er;nh.displayName="@mantine/core/ComboboxChevron";const[NM,Nr]=Bn("Combobox component was not found in tree"),pT=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)}}));pT.displayName="@mantine/core/ComboboxClearButton";const MM={},yy=X((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...l}=H("ComboboxDropdown",MM,e),c=Nr();return s.jsx(to.Dropdown,{...l,ref:t,role:"presentation","data-hidden":a||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});yy.classes=er;yy.displayName="@mantine/core/ComboboxDropdown";const OM={refProp:"ref"},mT=X((e,t)=>{const{children:n,refProp:r}=H("ComboboxDropdownTarget",OM,e);if(Nr(),!qo(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(to.Target,{ref:t,refProp:r,children:n})});mT.displayName="@mantine/core/ComboboxDropdownTarget";const LM={},xy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=H("ComboboxEmpty",LM,e),c=Nr();return s.jsx(q,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});xy.classes=er;xy.displayName="@mantine/core/ComboboxEmpty";function by({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=Nr(),[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 $M={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},gT=X((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=H("ComboboxEventsTarget",$M,e);if(!qo(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=Nr(),f=by({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c});return p.cloneElement(n,{...f,...u,[r]:rn(t,d.store.targetRef,n==null?void 0:n.ref)})});gT.displayName="@mantine/core/ComboboxEventsTarget";const FM={},Sy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=H("ComboboxFooter",FM,e),c=Nr();return s.jsx(q,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l,onMouseDown:u=>{u.preventDefault()}})});Sy.classes=er;Sy.displayName="@mantine/core/ComboboxFooter";const zM={},wy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:l,label:c,...u}=H("ComboboxGroup",zM,e),d=Nr();return s.jsxs(q,{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]})});wy.classes=er;wy.displayName="@mantine/core/ComboboxGroup";const BM={},jy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=H("ComboboxHeader",BM,e),c=Nr();return s.jsx(q,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l,onMouseDown:u=>{u.preventDefault()}})});jy.classes=er;jy.displayName="@mantine/core/ComboboxHeader";function vT({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}vT.displayName="@mantine/core/ComboboxHiddenInput";const UM={},Cy=X((e,t)=>{const n=H("ComboboxOption",UM,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,...w}=n,y=Nr(),S=p.useId(),b=u||S;return s.jsx(q,{...y.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...w,ref:t,id:b,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},v],role:"option",onClick:x=>{var C;m?x.preventDefault():((C=y.onOptionSubmit)==null||C.call(y,n.value,n),c==null||c(x))},onMouseDown:x=>{x.preventDefault(),f==null||f(x)},onMouseOver:x=>{y.resetSelectionOnOptionHover&&y.store.resetSelectedOption(),h==null||h(x)}})});Cy.classes=er;Cy.displayName="@mantine/core/ComboboxOption";const VM={},Ey=X((e,t)=>{const n=H("ComboboxOptions",VM,e),{classNames:r,className:o,style:i,styles:a,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Nr(),h=Un(l);return p.useEffect(()=>{f.store.setListId(h)},[h]),s.jsx(q,{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)}})});Ey.classes=er;Ey.displayName="@mantine/core/ComboboxOptions";const HM={withAriaAttributes:!0,withKeyboardNavigation:!0},Ty=X((e,t)=>{const n=H("ComboboxSearch",HM,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Nr(),m=h.getStyles("search"),g=by({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return s.jsx(Lt,{ref:rn(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});Ty.classes=er;Ty.displayName="@mantine/core/ComboboxSearch";const WM={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},yT=X((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=H("ComboboxTarget",WM,e);if(!qo(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=Nr(),f=by({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=p.cloneElement(n,{...f,...u});return s.jsx(to.Target,{ref:rn(t,d.store.targetRef),children:h})});yT.displayName="@mantine/core/ComboboxTarget";function qM(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 GM(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 QM(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Xc({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[l,c]=yn({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),w=p.useCallback((D="unknown")=>{l||(c(!0),o==null||o(D))},[c,o,l]),y=p.useCallback((D="unknown")=>{l&&(c(!1),r==null||r(D))},[c,r,l]),S=p.useCallback((D="unknown")=>{l?y(D):w(D)},[y,w,l]),b=p.useCallback(()=>{const D=document.querySelector(`#${u.current} [data-combobox-selected]`);D==null||D.removeAttribute("data-combobox-selected"),D==null||D.removeAttribute("aria-selected")},[]),x=p.useCallback(D=>{const k=document.getElementById(u.current),P=k==null?void 0:k.querySelectorAll("[data-combobox-option]");if(!P)return null;const $=D>=P.length?0:D<0?P.length-1:D;return d.current=$,P!=null&&P[$]&&!P[$].hasAttribute("data-combobox-disabled")?(b(),P[$].setAttribute("data-combobox-selected","true"),P[$].setAttribute("aria-selected","true"),P[$].scrollIntoView({block:"nearest",behavior:a}),P[$].id):null},[a,b]),C=p.useCallback(()=>{const D=document.querySelector(`#${u.current} [data-combobox-active]`);if(D){const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),P=Array.from(k).findIndex($=>$===D);return x(P)}return x(0)},[x]),j=p.useCallback(()=>x(GM(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[x,i]),T=p.useCallback(()=>x(qM(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[x,i]),E=p.useCallback(()=>x(QM(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[x]),_=p.useCallback((D="selected",k)=>{v.current=window.setTimeout(()=>{var O;const P=document.querySelectorAll(`#${u.current} [data-combobox-option]`),$=Array.from(P).findIndex(V=>V.hasAttribute(`data-combobox-${D}`));d.current=$,k!=null&&k.scrollIntoView&&((O=P[$])==null||O.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),R=p.useCallback(()=>{d.current=-1,b()},[b]),A=p.useCallback(()=>{const D=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=D==null?void 0:D[d.current];k==null||k.click()},[]),L=p.useCallback(D=>{u.current=D},[]),U=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),N=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),F=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:w,closeDropdown:y,toggleDropdown:S,selectedOptionIndex:d.current,getSelectedOptionIndex:F,selectOption:x,selectFirstOption:E,selectActiveOption:C,selectNextOption:j,selectPreviousOption:T,resetSelectedOption:R,updateSelectedOptionIndex:_,listId:u.current,setListId:L,clickSelectedOption:A,searchRef:f,focusSearchInput:U,targetRef:h,focusTarget:N}}const KM={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},YM=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":dn(t),"--combobox-option-padding":Ae(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:B(n),"--combobox-option-fz":dn(t),"--combobox-option-padding":Ae(t,"combobox-option-padding")}});function Me(e){const t=H("Combobox",KM,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,w=Xc(),y=a||w,S=ce({name:m||"Combobox",classes:er,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:YM}),b=()=>{u==null||u(),y.closeDropdown()};return s.jsx(NM,{value:{getStyles:S,store:y,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g},children:s.jsx(to,{opened:y.dropdownOpened,...v,onClose:b,withRoles:!1,unstyled:o,children:i})})}const XM=e=>e;Me.extend=XM;Me.classes=er;Me.displayName="@mantine/core/Combobox";Me.Target=yT;Me.Dropdown=yy;Me.Options=Ey;Me.Option=Cy;Me.Search=Ty;Me.Empty=xy;Me.Chevron=nh;Me.Footer=Sy;Me.Header=jy;Me.EventsTarget=gT;Me.DropdownTarget=mT;Me.Group=wy;Me.ClearButton=pT;Me.HiddenInput=vT;var xT={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const bT=xT,rh=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:w,style:y,vars:S,mod:b,...x},C)=>{const j=ce({name:e,props:t,className:n,style:y,classes:xT,classNames:r,styles:o,unstyled:i});return s.jsx(q,{...j("root"),ref:C,__vars:{"--label-fz":dn(h),"--label-lh":Ae(h,"label-lh")},mod:[{"label-position":m},b],variant:w,size:h,...x,children:s.jsxs(q,{component:g,htmlFor:g==="label"?u:void 0,...j("body"),children:[a,s.jsxs("div",{...j("labelWrapper"),"data-disabled":d||void 0,children:[l&&s.jsx(q,{component:v,htmlFor:v==="label"?u:void 0,...j("label"),"data-disabled":d||void 0,children:l}),c&&s.jsx(Lt.Description,{size:h,__inheritStyles:!1,...j("description"),children:c}),f&&typeof f!="boolean"&&s.jsx(Lt.Error,{size:h,__inheritStyles:!1,...j("error"),children:f})]})]})})});rh.displayName="@mantine/core/InlineInput";const ST=p.createContext(null),JM=ST.Provider,wT=()=>p.useContext(ST),[ZM,e5]=Ds();var jT={card:"m_26775b0a"};const t5={withBorder:!0},n5=(e,{radius:t})=>({card:{"--card-radius":lt(t)}}),Py=X((e,t)=>{const n=H("CheckboxCard",t5,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=ce({name:"CheckboxCard",classes:jT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:n5,rootSelector:"card"}),w=wT(),y=typeof u=="boolean"?u:(w==null?void 0:w.value.includes(h||""))||!1;return s.jsx(ZM,{value:{checked:y},children:s.jsx(bn,{ref:t,mod:[{"with-border":f,checked:y},d],...v("card"),...g,role:"checkbox","aria-checked":y,onClick:S=>{m==null||m(S),w==null||w.onChange(h||"")}})})});Py.displayName="@mantine/core/CheckboxCard";Py.classes=jT;function ky({children:e,role:t}){const n=ll();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const r5={},Ry=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=H("CheckboxGroup",r5,e),[d,f]=yn({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(JM,{value:{value:d,onChange:h,size:i},children:s.jsx(Lt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(ky,{role:"group",children:l})})})});Ry.classes=Lt.Wrapper.classes;Ry.displayName="@mantine/core/CheckboxGroup";function oh({size:e,style:t,...n}){const r=e!==void 0?{width:B(e),height:B(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 CT({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(oh,{...t})}var ET={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const o5={icon:CT},i5=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Pr({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":Ae(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:lt(t),"--checkbox-color":i==="outline"?c:at(n,e),"--checkbox-icon-color":o?at(o,e):Is(a,e)?Go({color:n,theme:e,autoContrast:a}):void 0}}},_y=X((e,t)=>{const n=H("CheckboxIndicator",o5,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:w,variant:y,disabled:S,...b}=n,x=u,C=ce({name:"CheckboxIndicator",classes:ET,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:i5,rootSelector:"indicator"}),j=e5(),T=typeof v=="boolean"||typeof d=="boolean"?v||d:(j==null?void 0:j.checked)||!1;return s.jsx(q,{ref:t,...C("indicator",{variant:y}),variant:y,mod:[{checked:T,disabled:S},w],...b,children:s.jsx(x,{indeterminate:d,...C("icon")})})});_y.displayName="@mantine/core/CheckboxIndicator";_y.classes=ET;var TT={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const s5={labelPosition:"right",icon:CT},a5=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Pr({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":Ae(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:lt(t),"--checkbox-color":i==="outline"?c:at(n,e),"--checkbox-icon-color":o?at(o,e):Is(a,e)?Go({color:n,theme:e,autoContrast:a}):void 0}}},_n=X((e,t)=>{const n=H("Checkbox",s5,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:w,labelPosition:y,description:S,error:b,disabled:x,variant:C,indeterminate:j,icon:T,rootRef:E,iconColor:_,onChange:R,autoContrast:A,mod:L,...U}=n,N=wT(),F=h||(N==null?void 0:N.size),D=T,k=ce({name:"Checkbox",props:n,classes:TT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:a5}),{styleProps:P,rest:$}=Qo(U),O=Un(f),V=N?{checked:N.value.includes($.value),onChange:K=>{N.onChange(K),R==null||R(K)}}:{};return s.jsx(rh,{...k("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:O,size:F,labelPosition:y,label:d,description:S,error:b,disabled:x,classNames:r,styles:a,unstyled:l,"data-checked":V.checked||w||void 0,variant:C,ref:E,mod:L,...P,...g,children:s.jsxs(q,{...k("inner"),mod:{"data-label-position":y},children:[s.jsx(q,{component:"input",id:O,ref:t,checked:w,disabled:x,mod:{error:!!b,indeterminate:j},...k("input",{focusable:!0,variant:C}),onChange:R,...$,...V,type:"checkbox"}),s.jsx(D,{indeterminate:j,...k("icon")})]})})});_n.classes={...TT,...bT};_n.displayName="@mantine/core/Checkbox";_n.Group=Ry;_n.Indicator=_y;_n.Card=Py;function Ya(e){return"group"in e}function PT({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;Ya(a)&&o.push({group:a.group,items:PT({options:a.items,search:t,limit:n-o.length})}),Ya(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function l5(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 kT(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Ya(n))kT(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 c5(e,t){return Array.isArray(e)?e.includes(t):e===t}function RT({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!Ya(e)){const l=c5(n,e.value),c=t&&l&&s.jsx(oh,{className:er.optionsDropdownCheckIcon}),u=s.jsxs(s.Fragment,{children:[r==="left"&&c,s.jsx("span",{children:e.label}),r==="right"&&c]});return s.jsx(Me.Option,{value:e.value,disabled:e.disabled,className:rt({[er.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(RT,{data:l,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},l.value));return s.jsx(Me.Group,{label:e.group,children:a})}function u5({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:w,"aria-label":y}){kT(e);const b=typeof o=="string"?(r||PT)({options:e,search:c?o:"",limit:i??1/0}):e,x=l5(b),C=b.map(j=>s.jsx(RT,{data:j,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m,renderOption:v},Ya(j)?j.group:j.value));return s.jsx(Me.Dropdown,{hidden:t||n&&x,children:s.jsxs(Me.Options,{labelledBy:g,"aria-label":y,children:[l?s.jsx(Ir.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...w,children:C}):C,x&&h&&s.jsx(Me.Empty,{children:h})]})})}const _T=p.createContext(null),d5=_T.Provider;function f5(){return{withinGroup:!!p.useContext(_T)}}var ih={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const h5={},p5=(e,{spacing:t})=>({group:{"--ag-spacing":Jt(t)}}),Dy=X((e,t)=>{const n=H("AvatarGroup",h5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,spacing:u,...d}=n,f=ce({name:"AvatarGroup",classes:ih,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:p5,rootSelector:"group"});return s.jsx(d5,{value:!0,children:s.jsx(q,{ref:t,...f("group"),...d})})});Dy.classes=ih;Dy.displayName="@mantine/core/AvatarGroup";function m5(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"})})}function DT(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}function g5(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}const v5=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function y5(e,t=v5){const n=g5(DT(e)),r=Math.abs(n)%t.length;return t[r]}const x5={},b5=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a,name:l,allowedInitialsColors:c})=>{const u=i==="initials"&&typeof l=="string"?y5(l,c):i,d=e.variantColorResolver({color:u||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:a});return{root:{"--avatar-size":Ae(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:lt(n),"--avatar-bg":u||r?d.background:void 0,"--avatar-color":u||r?d.color:void 0,"--avatar-bd":u||r?d.border:void 0}}},js=Dn((e,t)=>{const n=H("Avatar",x5,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:w,mod:y,name:S,allowedInitialsColors:b,...x}=n,C=f5(),[j,T]=p.useState(!u),E=ce({name:"Avatar",props:n,classes:ih,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:b5});return p.useEffect(()=>T(!u),[u]),s.jsx(q,{...E("root"),mod:[{"within-group":C.withinGroup},y],ref:t,...x,children:j?s.jsx("span",{...E("placeholder"),title:d,children:v||typeof S=="string"&&DT(S)||s.jsx(m5,{})}):s.jsx("img",{...g,...E("image"),src:u,alt:d,onError:_=>{var R;T(!0),(R=g==null?void 0:g.onError)==null||R.call(g,_)}})})});js.classes=ih;js.displayName="@mantine/core/Avatar";js.Group=Dy;var IT={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const S5={},w5=(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":Ae(i,"badge-height"),"--badge-padding-x":Ae(i,"badge-padding-x"),"--badge-fz":Ae(i,"badge-fz"),"--badge-radius":t===void 0?void 0:lt(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"?at(n,e):void 0}}},Jc=Dn((e,t)=>{const n=H("Badge",S5,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:w,autoContrast:y,circle:S,mod:b,...x}=n,C=ce({name:"Badge",props:n,classes:IT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:w5});return s.jsxs(q,{variant:v,mod:[{block:w,circle:S},b],...C("root",{variant:v}),ref:t,...x,children:[h&&s.jsx("span",{...C("section"),"data-position":"left",children:h}),s.jsx("span",{...C("label"),children:g}),m&&s.jsx("span",{...C("section"),"data-position":"right",children:m})]})});Jc.classes=IT;Jc.displayName="@mantine/core/Badge";var AT={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const j5={iconSize:48},C5=(e,{color:t,iconSize:n,radius:r})=>{const o=Pr({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=Pr({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Sr(i.value,.07),"--bq-bg-dark":Sr(o.value,.06),"--bq-bd":at(t,e),"--bq-icon-size":B(n),"--bq-radius":lt(r)}}},Iy=X((e,t)=>{const n=H("Blockquote",j5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=ce({name:"Blockquote",classes:AT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:C5});return s.jsxs(q,{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})]})});Iy.classes=AT;Iy.displayName="@mantine/core/Blockquote";var sh={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const bb={orientation:"horizontal"},E5=(e,{borderWidth:t})=>({group:{"--button-border-width":B(t)}}),Ay=X((e,t)=>{const n=H("ButtonGroup",bb,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=H("ButtonGroup",bb,e),g=ce({name:"ButtonGroup",props:n,classes:sh,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:E5,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});Ay.classes=sh;Ay.displayName="@mantine/core/ButtonGroup";const T5={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${B(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},P5={},k5=(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":Ae(i,"button-height"),"--button-padding-x":Ae(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?dn(i.replace("compact-","")):dn(i),"--button-radius":t===void 0?void 0:lt(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=Dn((e,t)=>{const n=H("Button",P5,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:w,classNames:y,styles:S,unstyled:b,"data-disabled":x,autoContrast:C,mod:j,...T}=n,E=ce({name:"Button",props:n,classes:sh,className:i,style:r,classNames:y,styles:S,unstyled:b,vars:o,varsResolver:k5}),_=!!u,R=!!d;return s.jsxs(bn,{ref:t,...E("root",{active:!l&&!g&&!x}),unstyled:b,variant:h,disabled:l||g,mod:[{disabled:l||x,loading:g,block:f,"with-left-section":_,"with-right-section":R},j],...T,children:[s.jsx(Xo,{mounted:!!g,transition:T5,duration:150,children:A=>s.jsx(q,{component:"span",...E("loader",{style:A}),"aria-hidden":!0,children:s.jsx(Zn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v})})}),s.jsxs("span",{...E("inner"),children:[u&&s.jsx(q,{component:"span",...E("section"),mod:{position:"left"},children:u}),s.jsx(q,{component:"span",mod:{loading:g},...E("label"),children:c}),d&&s.jsx(q,{component:"span",...E("section"),mod:{position:"right"},children:d})]})]})});oe.classes=sh;oe.displayName="@mantine/core/Button";oe.Group=Ay;var NT={root:"m_4451eb3a"};const R5={},mn=Dn((e,t)=>{const n=H("Center",R5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=ce({name:"Center",props:n,classes:NT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c});return s.jsx(q,{ref:t,mod:[{inline:u},d],...h("root"),...f})});mn.classes=NT;mn.displayName="@mantine/core/Center";const[_5,D5]=Ds(),I5={};function MT(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=H("ChipGroup",I5,e),[a,l]=yn({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(_5,{value:{isChipSelected:c,onChange:u,multiple:o},children:i})}MT.displayName="@mantine/core/ChipGroup";var OT={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 A5={type:"checkbox"},N5=(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":dn(t),"--chip-size":Ae(t,"chip-size"),"--chip-radius":n===void 0?void 0:lt(n),"--chip-checked-padding":Ae(t,"chip-checked-padding"),"--chip-padding":Ae(t,"chip-padding"),"--chip-icon-size":Ae(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":Ae(t,"chip-spacing")}}},Ec=X((e,t)=>{const n=H("Chip",A5,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:w,children:y,size:S,variant:b,icon:x,rootRef:C,autoContrast:j,mod:T,...E}=n,_=ce({name:"Chip",classes:OT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:N5}),R=D5(),A=Un(u),{styleProps:L,rest:U}=Qo(E),[N,F]=yn({value:d,defaultValue:f,finalValue:!1,onChange:h}),D=R?{checked:R.isChipSelected(m),onChange:P=>{R.onChange(P),h==null||h(P.currentTarget.checked)},type:R.multiple?"checkbox":"radio"}:{},k=D.checked||N;return s.jsxs(q,{size:S,variant:b,ref:C,mod:T,..._("root"),...L,...g,children:[s.jsx("input",{type:v,..._("input"),checked:k,onChange:P=>F(P.currentTarget.checked),id:A,disabled:w,ref:t,value:m,...D,...U}),s.jsxs("label",{htmlFor:A,"data-checked":k||void 0,"data-disabled":w||void 0,..._("label",{variant:b||"filled"}),children:[k&&s.jsx("span",{..._("iconWrapper"),children:x||s.jsx(oh,{..._("checkIcon")})}),s.jsx("span",{children:y})]})]})});Ec.classes=OT;Ec.displayName="@mantine/core/Chip";Ec.Group=MT;var LT={root:"m_b183c0a2"};const M5={},O5=(e,{color:t})=>({root:{"--code-bg":t?at(t,e):void 0}}),Ny=X((e,t)=>{const n=H("Code",M5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...m}=n,g=ce({name:"Code",props:n,classes:LT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:O5});return s.jsx(q,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...m,dir:"ltr"})});Ny.classes=LT;Ny.displayName="@mantine/core/Code";var $T={root:"m_7485cace"};const L5={},$5=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Ae(t,"container-size")}}),My=X((e,t)=>{const n=H("Container",L5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=ce({name:"Container",classes:$T,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:$5});return s.jsx(q,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});My.classes=$T;My.displayName="@mantine/core/Container";const F5={timeout:1e3};function FT(e){const{children:t,timeout:n,value:r,...o}=H("CopyButton",F5,e),i=qw({timeout:n}),a=()=>i.copy(r);return s.jsx(s.Fragment,{children:t({copy:a,copied:i.copied,...o})})}FT.displayName="@mantine/core/CopyButton";var zT={root:"m_3eebeb36",label:"m_9e365f20"};const z5={orientation:"horizontal"},B5=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?at(t,e):void 0,"--divider-border-style":n,"--divider-size":Ae(r,"divider-size")}}),cn=X((e,t)=>{const n=H("Divider",z5,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=ce({name:"Divider",classes:zT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:B5});return s.jsx(q,{ref:t,mod:[{orientation:d,"with-label":!!f},m],...v("root"),...g,role:"separator",children:f&&s.jsx(q,{component:"span",mod:{position:h},...v("label"),children:f})})});cn.classes=zT;cn.displayName="@mantine/core/Divider";function U5({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[V5,BT]=Bn("Grid component was not found in tree"),sg=(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":sg(e,t),wb=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},jb=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function H5({span:e,order:t,offset:n,selector:r}){var h;const o=At(),i=BT(),l=Hr(e)===void 0?12:Hr(e),c=Oi({"--col-order":(h=Hr(t))==null?void 0:h.toString(),"--col-flex-grow":wb(l,i.grow),"--col-flex-basis":sg(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":Sb(l,i.columns,i.grow),"--col-offset":jb(Hr(n),i.columns)}),u=xt(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"]=wb(e[g],i.grow),m[g]["--col-flex-basis"]=sg(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"]=jb(n[g],i.columns)),m},{}),f=oc(xt(u),o).filter(m=>xt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return s.jsx(As,{styles:c,media:f,selector:r})}var Oy={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const W5={span:12},Ly=X((e,t)=>{const n=H("GridCol",W5,e),{classNames:r,className:o,style:i,styles:a,vars:l,span:c,order:u,offset:d,...f}=n,h=BT(),m=Bc();return s.jsxs(s.Fragment,{children:[s.jsx(H5,{selector:`.${m}`,span:c,order:u,offset:d}),s.jsx(q,{ref:t,...h.getStyles("col",{className:rt(o,m),style:i,classNames:r,styles:a}),...f})]})});Ly.classes=Oy;Ly.displayName="@mantine/core/GridCol";function q5({gutter:e,selector:t}){const n=At(),r=Oi({"--grid-gutter":Jt(Hr(e))}),o=xt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=Jt(e[c])),l),{}),a=oc(xt(o),n).filter(l=>xt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return s.jsx(As,{styles:r,media:a,selector:t})}const G5={gutter:"md",grow:!1,columns:12},Q5=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),ur=X((e,t)=>{const n=H("Grid",G5,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,w=ce({name:"Grid",classes:Oy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Q5}),y=Bc();return s.jsxs(V5,{value:{getStyles:w,grow:u,columns:f},children:[s.jsx(q5,{selector:`.${y}`,...n}),s.jsx(q,{ref:t,...w("root",{className:y}),...v,children:s.jsx("div",{...w("inner"),children:g})})]})});ur.classes=Oy;ur.displayName="@mantine/core/Grid";ur.Col=Ly;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)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},of.apply(null,arguments)}function $y(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var K5=p.useLayoutEffect,Y5=function(t){var n=p.useRef(t);return K5(function(){n.current=t}),n},Cb=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},X5=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])},Eb={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},J5=function(t){Object.keys(Eb).forEach(function(n){t.style.setProperty(n,Eb[n],"important")})},Tb=J5,In=null,Pb=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function Z5(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),In||(In=document.createElement("textarea"),In.setAttribute("tabindex","-1"),In.setAttribute("aria-hidden","true"),Tb(In)),In.parentNode===null&&document.body.appendChild(In);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;In.style[m]=a[m]}),Tb(In),In.value=t;var c=Pb(In,e);In.value=t,c=Pb(In,e),In.value="x";var u=In.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 kb=function(){},eO=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},tO=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],nO=!!document.documentElement.currentStyle,rO=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=eO(tO,n),o=r.boxSizing;if(o==="")return null;nO&&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}},oO=rO;function UT(e,t,n){var r=Y5(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 iO=function(t){UT(window,"resize",t)},sO=function(t){UT(document.fonts,"loadingdone",t)},aO=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],lO=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?kb:a,c=t.onHeightChange,u=c===void 0?kb:c,d=$y(t,aO),f=d.value!==void 0,h=p.useRef(null),m=X5(h,n),g=p.useRef(0),v=p.useRef(),w=function(){var b=h.current,x=r&&v.current?v.current:oO(b);if(x){v.current=x;var C=Z5(x,b.value||b.placeholder||"x",i,o),j=C[0],T=C[1];g.current!==j&&(g.current=j,b.style.setProperty("height",j+"px","important"),u(j,{rowHeight:T}))}},y=function(b){f||w(),l(b)};return p.useLayoutEffect(w),iO(w),sO(w),p.createElement("textarea",of({},d,{onChange:y,ref:m}))},cO=p.forwardRef(lO);const uO={},Fs=X((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...l}=H("Textarea",uO,e),c=n&&Zw()!=="test",u=c?{maxRows:r,minRows:o}:{};return s.jsx(tr,{component:c?cO:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":a},...u})});Fs.classes=tr.classes;Fs.displayName="@mantine/core/Textarea";function Rb(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const dO={serialize:JSON.stringify,deserialize:JSON.parse},ul=X((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}=H("JsonInput",dO,e),[g,v]=yn({value:n,defaultValue:r,finalValue:"",onChange:o}),[w,y]=p.useState(Rb(g,c)),S=x=>{u==null||u(x),y(!0)},b=x=>{typeof d=="function"&&d(x);const C=Rb(x.currentTarget.value,c);i&&!f&&C&&x.currentTarget.value.trim()!==""&&v(l(c(x.currentTarget.value),null,2)),y(C)};return s.jsx(Fs,{value:g,onChange:x=>v(x.currentTarget.value),onFocus:S,onBlur:b,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:w?h:a||!0,"data-monospace":!0})});ul.classes=tr.classes;ul.displayName="@mantine/core/JsonInput";const[fO,hO]=Bn("List component was not found in tree");var Fy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const pO={},zy=X((e,t)=>{const n=H("ListItem",pO,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,children:u,mod:d,...f}=n,h=hO(),m=c||h.icon,g={classNames:r,styles:a};return s.jsx(q,{...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})]})})});zy.classes=Fy;zy.displayName="@mantine/core/ListItem";const mO={type:"unordered"},gO=(e,{size:t,spacing:n})=>({root:{"--list-fz":dn(t),"--list-lh":Ww(t),"--list-spacing":Jt(n)}}),Ln=X((e,t)=>{const n=H("List",mO,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:w,...y}=n,S=ce({name:"List",classes:Fy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:gO});return s.jsx(fO,{value:{center:g,icon:h,getStyles:S},children:s.jsx(q,{...S("root",{style:{listStyleType:v}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},w],ref:t,...y,children:u})})});Ln.classes=Fy;Ln.displayName="@mantine/core/List";Ln.Item=zy;var VT={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const _b={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:eo("overlay")},vO=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),By=X((e,t)=>{const n=H("LoadingOverlay",_b,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=At(),w=ce({name:"LoadingOverlay",classes:VT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:vO}),y={..._b.overlayProps,...f};return s.jsx(Xo,{transition:"fade",...u,mounted:!!h,children:S=>s.jsxs(q,{...w("root",{style:S}),ref:t,...g,children:[s.jsx(Zn,{...w("loader"),unstyled:l,...d}),s.jsx(Cc,{...y,...w("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),s.jsx(Cc,{...y,...w("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})]})})});By.classes=VT;By.displayName="@mantine/core/LoadingOverlay";const[yO,Zc]=Bn("Menu component was not found in the tree");var dl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const xO={},Uy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=H("MenuDivider",xO,e),c=Zc();return s.jsx(q,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});Uy.classes=dl;Uy.displayName="@mantine/core/MenuDivider";const bO={},Vy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:l,onMouseLeave:c,children:u,...d}=H("MenuDropdown",bO,e),f=p.useRef(null),h=Zc(),m=w=>{var y,S;(w.key==="ArrowUp"||w.key==="ArrowDown")&&(w.preventDefault(),(S=(y=f.current)==null?void 0:y.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||S.focus())},g=ar(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),v=ar(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return s.jsxs(to.Dropdown,{...d,onMouseEnter:g,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:rn(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]})});Vy.classes=dl;Vy.displayName="@mantine/core/MenuDropdown";const SO={},Hy=Dn((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}=H("MenuItem",SO,e),g=Zc(),v=At(),{dir:w}=Ns(),y=p.useRef(),S=g.getItemIndex(y.current),b=m,x=ar(b.onMouseLeave,()=>g.setHovered(-1)),C=ar(b.onMouseEnter,()=>g.setHovered(g.getItemIndex(y.current))),j=ar(b.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),T=ar(b.onFocus,()=>g.setHovered(g.getItemIndex(y.current))),E=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,_=l?Pr({color:l,theme:v}):null;return s.jsxs(bn,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:T,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:rn(y,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===S?!0:void 0,onMouseEnter:C,onMouseLeave:x,onClick:j,onKeyDown:Hw({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:w,orientation:"vertical",onKeyDown:b.onKeydown}),__vars:{"--menu-item-color":_!=null&&_.isThemeColor&&(_==null?void 0:_.shade)===void 0?`var(--mantine-color-${_.color}-6)`:E==null?void 0:E.color,"--menu-item-hover":E==null?void 0:E.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})]})});Hy.classes=dl;Hy.displayName="@mantine/core/MenuItem";const wO={},Wy=X((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=H("MenuLabel",wO,e),c=Zc();return s.jsx(q,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});Wy.classes=dl;Wy.displayName="@mantine/core/MenuLabel";const jO={refProp:"ref"},HT=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=H("MenuTarget",jO,e);if(!qo(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=Zc(),a=ar(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=ar(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=ar(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return s.jsx(to.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})})});HT.displayName="@mantine/core/MenuTarget";const CO={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function J(e){const t=H("Menu",CO,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:w,unstyled:y,variant:S,vars:b,menuItemTabIndex:x,keepMounted:C,...j}=t,T=ce({name:"Menu",classes:dl,props:t,classNames:v,styles:w,unstyled:y}),[E,{setHovered:_,resetHovered:R}]=U_(),[A,L]=yn({value:i,defaultValue:a,finalValue:!1,onChange:c}),[U,N]=p.useState(!1),F=()=>{L(!1),N(!1),A&&(o==null||o())},D=()=>{L(!0),!A&&(r==null||r())},k=()=>{A?F():D()},{openDropdown:P,closeDropdown:$}=U5({open:D,close:F,closeDelay:g,openDelay:m}),O=ie=>B_("[data-menu-item]","[data-menu-dropdown]",ie),{resolvedClassNames:V,resolvedStyles:K}=zc({classNames:v,styles:w,props:t});return Mo(()=>{R()},[A]),s.jsx(yO,{value:{getStyles:T,opened:A,toggleDropdown:k,getItemIndex:O,hovered:E,setHovered:_,openedViaClick:U,setOpenedViaClick:N,closeOnItemClick:u,closeDropdown:h==="click"?F:$,openDropdown:h==="click"?D:P,closeDropdownImmediately:F,loop:d,trigger:h,unstyled:y,menuItemTabIndex:x},children:s.jsx(to,{...j,opened:A,onChange:k,defaultOpened:a,trapFocus:C?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:V,styles:K,unstyled:y,variant:S,keepMounted:C,children:n})})}J.extend=e=>e;J.classes=dl;J.displayName="@mantine/core/Menu";J.Item=Hy;J.Label=Wy;J.Dropdown=Vy;J.Target=HT;J.Divider=Uy;const[EO,fl]=Bn("Modal component was not found in tree");var Zo={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const TO={},ah=X((e,t)=>{const n=H("ModalBody",TO,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=fl();return s.jsx(tT,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:a,className:o}),...c})});ah.classes=Zo;ah.displayName="@mantine/core/ModalBody";const PO={},lh=X((e,t)=>{const n=H("ModalCloseButton",PO,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=fl();return s.jsx(nT,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:a,className:o}),...c})});lh.classes=Zo;lh.displayName="@mantine/core/ModalCloseButton";const kO={},ch=X((e,t)=>{const n=H("ModalContent",kO,e),{classNames:r,className:o,style:i,styles:a,vars:l,children:c,...u}=n,d=fl(),f=d.scrollAreaComponent||H3;return s.jsx(z3,{...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 - (${B(d.yOffset)} * 2))`},children:c})})});ch.classes=Zo;ch.displayName="@mantine/core/ModalContent";const RO={},uh=X((e,t)=>{const n=H("ModalHeader",RO,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=fl();return s.jsx(rT,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:a,className:o}),...c})});uh.classes=Zo;uh.displayName="@mantine/core/ModalHeader";const _O={},dh=X((e,t)=>{const n=H("ModalOverlay",_O,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=fl();return s.jsx(oT,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:a,className:o}),...c})});dh.classes=Zo;dh.displayName="@mantine/core/ModalOverlay";const DO={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:eo("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},IO=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:lt(t),"--modal-size":Ae(n,"modal-size"),"--modal-y-offset":B(r),"--modal-x-offset":B(o)}}),fh=X((e,t)=>{const n=H("ModalRoot",DO,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,...w}=n,y=ce({name:v,classes:Zo,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:IO});return s.jsx(EO,{value:{yOffset:u,scrollAreaComponent:d,getStyles:y,fullScreen:h},children:s.jsx($3,{ref:t,...y("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...w})})});fh.classes=Zo;fh.displayName="@mantine/core/ModalRoot";const AO={},hh=X((e,t)=>{const n=H("ModalTitle",AO,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=fl();return s.jsx(iT,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:a,className:o}),...c})});hh.classes=Zo;hh.displayName="@mantine/core/ModalTitle";const NO={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:eo("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Sn=X((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l,radius:c,...u}=H("Modal",NO,e),d=!!n||i;return s.jsxs(fh,{ref:t,radius:c,...u,children:[r&&s.jsx(dh,{...o}),s.jsxs(ch,{radius:c,children:[d&&s.jsxs(uh,{children:[n&&s.jsx(hh,{children:n}),i&&s.jsx(lh,{...a})]}),s.jsx(ah,{children:l})]})]})});Sn.classes=Zo;Sn.displayName="@mantine/core/Modal";Sn.Root=fh;Sn.Overlay=dh;Sn.Content=ch;Sn.Body=ah;Sn.Header=uh;Sn.Title=hh;Sn.CloseButton=lh;const[MO,qy]=Ds(),[OO,LO]=Ds();var ph={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const $O={},FO=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Ae(t):Ae(n,"pg-gap")}}),Gy=X((e,t)=>{const n=H("PillGroup",$O,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=qy(),m=(h==null?void 0:h.size)||u||void 0,g=ce({name:"PillGroup",classes:ph,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:FO,stylesCtx:{size:m},rootSelector:"group"});return s.jsx(OO,{value:{size:m,disabled:d},children:s.jsx(q,{ref:t,size:m,...g("group"),...f})})});Gy.classes=ph;Gy.displayName="@mantine/core/PillGroup";const zO={variant:"default"},BO=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Ae(n,"pill-fz"),"--pill-height":Ae(n,"pill-height"),"--pill-radius":t===void 0?void 0:lt(t)}}),Cs=X((e,t)=>{const n=H("Pill",zO,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:w,mod:y,...S}=n,b=LO(),x=qy(),C=v||(b==null?void 0:b.size)||void 0,j=(x==null?void 0:x.variant)==="filled"?"contrast":u||"default",T=ce({name:"Pill",classes:ph,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:BO,stylesCtx:{size:C}});return s.jsxs(q,{component:"span",ref:t,variant:j,size:C,...T("root",{variant:j}),mod:[{"with-remove":f&&!w,disabled:w||(b==null?void 0:b.disabled)},y],...S,children:[s.jsx("span",{...T("label"),children:d}),f&&s.jsx($s,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...T("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:E=>{var _;E.preventDefault(),E.stopPropagation(),(_=m==null?void 0:m.onMouseDown)==null||_.call(m,E)},onClick:E=>{var _;E.stopPropagation(),h==null||h(),(_=m==null?void 0:m.onClick)==null||_.call(m,E)}})]})});Cs.classes=ph;Cs.displayName="@mantine/core/Pill";Cs.Group=Gy;var WT={field:"m_45c4369d"};const UO={type:"visible"},Qy=X((e,t)=>{const n=H("PillsInputField",UO,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=qy(),w=ll(),y=ce({name:"PillsInputField",classes:WT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"field"}),S=d||(v==null?void 0:v.disabled);return s.jsx(q,{component:"input",ref:rn(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:S,mod:[{disabled:S,pointer:h},m],...y("field"),...g,id:(w==null?void 0:w.inputId)||f,"aria-invalid":v==null?void 0:v.hasError,"aria-describedby":w==null?void 0:w.describedBy,type:"text",onMouseDown:b=>!h&&b.stopPropagation()})});Qy.classes=WT;Qy.displayName="@mantine/core/PillsInputField";const VO={},Xa=X((e,t)=>{const n=H("PillsInput",VO,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(MO,{value:{fieldRef:h,size:a,disabled:l,hasError:!!u,variant:d},children:s.jsx(tr,{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})})});Xa.displayName="@mantine/core/PillsInput";Xa.Field=Qy;function HO({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Ya(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 WO={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},mh=X((e,t)=>{const n=H("MultiSelect",WO,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:w,defaultDropdownOpened:y,onDropdownOpen:S,onDropdownClose:b,selectFirstOptionOnChange:x,onOptionSubmit:C,comboboxProps:j,filter:T,limit:E,withScrollArea:_,maxDropdownHeight:R,searchValue:A,defaultSearchValue:L,onSearchChange:U,readOnly:N,disabled:F,onFocus:D,onBlur:k,onPaste:P,radius:$,rightSection:O,rightSectionWidth:V,rightSectionPointerEvents:K,rightSectionProps:ie,leftSection:Re,leftSectionWidth:ae,leftSectionPointerEvents:Ee,leftSectionProps:Fe,inputContainer:me,inputWrapperOrder:Le,withAsterisk:nt,labelProps:Tt,descriptionProps:Ve,errorProps:Te,wrapperProps:Pe,description:Xe,label:Qe,error:Z,maxValues:ue,searchable:we,nothingFoundMessage:We,withCheckIcon:ne,checkIconPosition:pe,hidePickedOptions:Q,withErrorStyles:xe,name:Be,form:Nt,id:Pt,clearable:$t,clearButtonProps:wt,hiddenInputProps:wn,placeholder:rr,hiddenInputValuesDivider:Gi,required:vr,mod:wu,renderOption:ju,onRemove:yr,onClear:Sl,scrollAreaProps:Cu,...Qi}=n,Ys=Un(Pt),Ki=fT(v),Or=hT(Ki),jn=Xc({opened:w,defaultOpened:y,onDropdownOpen:S,onDropdownClose:()=>{b==null||b(),jn.resetSelectedOption()}}),{styleProps:qh,rest:{type:Gh,autoComplete:Qh,...Eu}}=Qo(Qi),[Kt,oo]=yn({value:d,defaultValue:f,finalValue:[],onChange:h}),[wl,Xs]=yn({value:A,defaultValue:L,finalValue:"",onChange:U}),I=ce({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:l}),{resolvedClassNames:M,resolvedStyles:z}=zc({props:n,styles:a,classNames:r}),G=Y=>{m==null||m(Y),Y.key===" "&&!we&&(Y.preventDefault(),jn.toggleDropdown()),Y.key==="Backspace"&&wl.length===0&&Kt.length>0&&(yr==null||yr(Kt[Kt.length-1]),oo(Kt.slice(0,Kt.length-1)))},le=Kt.map((Y,$e)=>{var ke,_e;return s.jsx(Cs,{withRemoveButton:!N&&!((ke=Or[Y])!=null&&ke.disabled),onRemove:()=>{oo(Kt.filter(ot=>Y!==ot)),yr==null||yr(Y)},unstyled:l,disabled:F,...I("pill"),children:((_e=Or[Y])==null?void 0:_e.label)||Y},`${Y}-${$e}`)});p.useEffect(()=>{x&&jn.selectFirstOption()},[x,Kt]);const je=$t&&Kt.length>0&&!F&&!N&&s.jsx(Me.ClearButton,{size:u,...wt,onClear:()=>{Sl==null||Sl(),oo([]),Xs("")}}),Ie=HO({data:Ki,value:Kt});return s.jsxs(s.Fragment,{children:[s.jsxs(Me,{store:jn,classNames:M,styles:z,unstyled:l,size:u,readOnly:N,__staticSelector:"MultiSelect",onOptionSubmit:Y=>{C==null||C(Y),Xs(""),jn.updateSelectedOptionIndex("selected"),Kt.includes(Or[Y].value)?(oo(Kt.filter($e=>$e!==Or[Y].value)),yr==null||yr(Or[Y].value)):Kt.length<ue&&oo([...Kt,Or[Y].value])},...j,children:[s.jsx(Me.DropdownTarget,{children:s.jsx(Xa,{...qh,__staticSelector:"MultiSelect",classNames:M,styles:z,unstyled:l,size:u,className:o,style:i,variant:g,disabled:F,radius:$,rightSection:O||je||s.jsx(Me.Chevron,{size:u,error:Z,unstyled:l}),rightSectionPointerEvents:K||(je?"all":"none"),rightSectionWidth:V,rightSectionProps:ie,leftSection:Re,leftSectionWidth:ae,leftSectionPointerEvents:Ee,leftSectionProps:Fe,inputContainer:me,inputWrapperOrder:Le,withAsterisk:nt,labelProps:Tt,descriptionProps:Ve,errorProps:Te,wrapperProps:Pe,description:Xe,label:Qe,error:Z,multiline:!0,withErrorStyles:xe,__stylesApiProps:{...n,rightSectionPointerEvents:K||(je?"all":"none"),multiline:!0},pointer:!we,onClick:()=>we?jn.openDropdown():jn.toggleDropdown(),"data-expanded":jn.dropdownOpened||void 0,id:Ys,required:vr,mod:wu,children:s.jsxs(Cs.Group,{disabled:F,unstyled:l,...I("pillsList"),children:[le,s.jsx(Me.EventsTarget,{autoComplete:Qh,children:s.jsx(Xa.Field,{...Eu,ref:t,id:Ys,placeholder:rr,type:!we&&!rr?"hidden":"visible",...I("inputField"),unstyled:l,onFocus:Y=>{D==null||D(Y),we&&jn.openDropdown()},onBlur:Y=>{k==null||k(Y),jn.closeDropdown(),Xs("")},onKeyDown:G,value:wl,onChange:Y=>{Xs(Y.currentTarget.value),we&&jn.openDropdown(),x&&jn.selectFirstOption()},disabled:F,readOnly:N||!we,pointer:!we})})]})})}),s.jsx(u5,{data:Q?Ie:Ki,hidden:N||F,filter:T,search:wl,limit:E,hiddenWhenEmpty:!We,withScrollArea:_,maxDropdownHeight:R,filterOptions:we,value:Kt,checkIconPosition:pe,withCheckIcon:ne,nothingFoundMessage:We,unstyled:l,labelId:Qe?`${Ys}-label`:void 0,"aria-label":Qe?void 0:Qi["aria-label"],renderOption:ju,scrollAreaProps:Cu})]}),s.jsx(Me.HiddenInput,{name:Be,valuesDivider:Gi,value:Kt,form:Nt,disabled:F,...wn})]})});mh.classes={...tr.classes,...Me.classes};mh.displayName="@mantine/core/MultiSelect";function qO(e){return"group"in e}function Ky({data:e}){if(qO(e)){const o=e.items.map(i=>s.jsx(Ky,{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)}Ky.displayName="@mantine/core/NativeSelectOption";const GO={rightSectionPointerEvents:"none"},It=X((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:a,unstyled:l,...c}=H("NativeSelect",GO,e),u=fT(n).map((d,f)=>s.jsx(Ky,{data:d},f));return s.jsx(tr,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:a||s.jsx(nh,{size:o,error:i,unstyled:l}),children:r||u})});It.classes=tr.classes;It.displayName="@mantine/core/NativeSelect";var qT={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const QO={withCloseButton:!0},KO=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:lt(t),"--notification-color":n?at(n,e):void 0}}),Yy=X((e,t)=>{const n=H("Notification",QO,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:w,unstyled:y,variant:S,vars:b,mod:x,...C}=n,j=ce({name:"Notification",classes:qT,props:n,className:r,style:v,classNames:g,styles:w,unstyled:y,vars:b,varsResolver:KO});return s.jsxs(q,{...j("root"),mod:[{"data-with-icon":!!d||a,"data-with-border":c},x],ref:t,variant:S,...C,role:"alert",children:[d&&!a&&s.jsx("div",{...j("icon"),children:d}),a&&s.jsx(Zn,{size:28,color:o,...j("loader")}),s.jsxs("div",{...j("body"),children:[u&&s.jsx("div",{...j("title"),children:u}),s.jsx(q,{...j("description"),mod:{"data-with-title":!!u},children:f})]}),l&&s.jsx($s,{iconSize:16,color:"gray",...m,unstyled:y,onClick:h,...j("closeButton")})]})});Yy.classes=qT;Yy.displayName="@mantine/core/Notification";function GT(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 Tc;(function(e){e.event="event",e.props="prop"})(Tc||(Tc={}));function gi(){}function YO(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 Pc(e){return!!(e||"").match(/\d/)}function $a(e){return e==null}function XO(e){return typeof e=="number"&&isNaN(e)}function QT(e){return $a(e)||XO(e)||typeof e=="number"&&!isFinite(e)}function KT(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function JO(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 ZO(e,t,n){var r=JO(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 e9(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 Xy(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 t9(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 YT(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function Db(e,t){return Array(t+1).join(e)}function XT(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."+Db("0",Math.abs(a))+o:a>=l?o=o+Db("0",a-l):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function Ib(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=Xy(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,w,y){return v.length>y?(Number(v[0])+Number(w)).toString()+v.substring(1,v.length):w+v},d[0]));var h=YT(d[1]||"",t,n),m=l?"-":"",g=r?".":"";return""+m+f+g+h}function rs(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 JT=YO(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}}}),n9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function r9(e,t,n){return Math.min(Math.max(e,t),n)}function $p(e){return Math.max(e.selectionStart,e.selectionEnd)}function o9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function i9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function s9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function a9(e,t,n,r,o,i,a){a===void 0&&(a=s9);var l=o.findIndex(function(x){return x}),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 w=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:m,formattedValueIndex:g});if(w&&f[g]!==!0){h[m]=g,f[g]=!0;break}}}for(var y=r;y<u&&(h[y]===-1||!i(n[y]));)y++;var S=y===u||h[y]===-1?d:h[y];for(y=r-1;y>0&&h[y]===-1;)y--;var b=y===-1||h[y]===-1?0:h[y]+1;return b>S?S:r-b<S-r?b:S}function Ab(e,t,n,r){var o=e.length;if(t=r9(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 l9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Pc(e[n])||Pc(e[n-1]));return t}function ZT(e,t,n,r,o,i){i===void 0&&(i=gi);var a=e9(function(g,v){var w,y;return QT(g)?(y="",w=""):typeof g=="number"||v?(y=typeof g=="number"?XT(g):g,w=r(y)):(y=o(g,void 0),w=r(y)),{formattedValue:w,numAsString:y}}),l=p.useState(function(){return a($a(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;$a(e)&&(f=c.numAsString,h=!0);var m=a(f,h);return p.useMemo(function(){u(m)},[m.formattedValue]),[c,d]}function c9(e){return e.replace(/[^0-9]/g,"")}function u9(e){return e}function d9(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=u9);var l=e.removeFormatting;l===void 0&&(l=c9);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=gi);var m=e.onKeyDown;m===void 0&&(m=gi);var g=e.onMouseUp;g===void 0&&(g=gi);var v=e.onFocus;v===void 0&&(v=gi);var w=e.onBlur;w===void 0&&(w=gi);var y=e.value,S=e.getCaretBoundary;S===void 0&&(S=l9);var b=e.isValidInputCharacter;b===void 0&&(b=Pc);var x=e.isCharacterSame,C=GT(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),j=ZT(y,c,!!u,a,l,d),T=j[0],E=T.formattedValue,_=T.numAsString,R=j[1],A=p.useRef(),L=p.useRef({formattedValue:E,numAsString:_}),U=function(Z,ue){L.current={formattedValue:Z.formattedValue,numAsString:Z.value},R(Z,ue)},N=p.useState(!1),F=N[0],D=N[1],k=p.useRef(null),P=p.useRef({setCaretTimeout:null,focusTimeout:null});p.useEffect(function(){return D(!0),function(){clearTimeout(P.current.setCaretTimeout),clearTimeout(P.current.focusTimeout)}},[]);var $=a,O=function(Z,ue){var we=parseFloat(ue);return{formattedValue:Z,value:ue,floatValue:isNaN(we)?void 0:we}},V=function(Z,ue,we){Z.selectionStart===0&&Z.selectionEnd===Z.value.length||(rs(Z,ue),P.current.setCaretTimeout=setTimeout(function(){Z.value===we&&Z.selectionStart!==ue&&rs(Z,ue)},0))},K=function(Z,ue,we){return Ab(Z,ue,S(Z),we)},ie=function(Z,ue,we){var We=S(ue),ne=a9(ue,E,Z,we,We,b,x);return ne=Ab(ue,ne,We),ne},Re=function(Z){var ue=Z.formattedValue;ue===void 0&&(ue="");var we=Z.input,We=Z.source,ne=Z.event,pe=Z.numAsString,Q;if(we){var xe=Z.inputValue||we.value,Be=$p(we);we.value=ue,Q=ie(xe,ue,Be),Q!==void 0&&V(we,Q,ue)}ue!==E&&U(O(ue,pe),{event:ne,source:We})};p.useEffect(function(){var Z=L.current,ue=Z.formattedValue,we=Z.numAsString;(E!==ue||_!==we)&&U(O(E,_),{event:void 0,source:Tc.props})},[E,_]);var ae=k.current?$p(k.current):void 0,Ee=typeof window<"u"?p.useLayoutEffect:p.useEffect;Ee(function(){var Z=k.current;if(E!==L.current.formattedValue&&Z){var ue=ie(L.current.formattedValue,E,ae);Z.value=E,V(Z,ue,E)}},[E]);var Fe=function(Z,ue,we){var We=ue.target,ne=A.current?n9(A.current,We.selectionEnd):JT(E,Z),pe=Object.assign(Object.assign({},ne),{lastValue:E}),Q=l(Z,pe),xe=$(Q);if(Q=l(xe,void 0),f&&!f(O(xe,Q))){var Be=ue.target,Nt=$p(Be),Pt=ie(Z,E,Nt);return Be.value=E,V(Be,Pt,E),!1}return Re({formattedValue:xe,numAsString:Q,inputValue:Z,event:ue,source:we,input:ue.target}),!0},me=function(Z,ue){ue===void 0&&(ue=0);var we=Z.selectionStart,We=Z.selectionEnd;A.current={selectionStart:we,selectionEnd:We+ue}},Le=function(Z){var ue=Z.target,we=ue.value,We=Fe(we,Z,Tc.event);We&&h(Z),A.current=void 0},nt=function(Z){var ue=Z.target,we=Z.key,We=ue.selectionStart,ne=ue.selectionEnd,pe=ue.value;pe===void 0&&(pe="");var Q;we==="ArrowLeft"||we==="Backspace"?Q=Math.max(We-1,0):we==="ArrowRight"?Q=Math.min(We+1,pe.length):we==="Delete"&&(Q=We);var xe=0;we==="Delete"&&We===ne&&(xe=1);var Be=we==="ArrowLeft"||we==="ArrowRight";if(Q===void 0||We!==ne&&!Be){m(Z),me(ue,xe);return}var Nt=Q;if(Be){var Pt=we==="ArrowLeft"?"left":"right";Nt=K(pe,Q,Pt),Nt!==Q&&Z.preventDefault()}else we==="Delete"&&!b(pe[Q])?Nt=K(pe,Q,"right"):we==="Backspace"&&!b(pe[Q])&&(Nt=K(pe,Q,"left"));Nt!==Q&&V(ue,Nt,pe),m(Z),me(ue,xe)},Tt=function(Z){var ue=Z.target,we=function(){var We=ue.selectionStart,ne=ue.selectionEnd,pe=ue.value;if(pe===void 0&&(pe=""),We===ne){var Q=K(pe,We);Q!==We&&V(ue,Q,pe)}};we(),requestAnimationFrame(function(){we()}),g(Z),me(ue)},Ve=function(Z){Z.persist&&Z.persist();var ue=Z.target,we=Z.currentTarget;k.current=ue,P.current.focusTimeout=setTimeout(function(){var We=ue.selectionStart,ne=ue.selectionEnd,pe=ue.value;pe===void 0&&(pe="");var Q=K(pe,We);Q!==We&&!(We===0&&ne===pe.length)&&V(ue,Q,pe),v(Object.assign(Object.assign({},Z),{currentTarget:we}))},0)},Te=function(Z){k.current=null,clearTimeout(P.current.focusTimeout),clearTimeout(P.current.setCaretTimeout),w(Z)},Pe=F&&o9()?"numeric":void 0,Xe=Object.assign({inputMode:Pe},C,{type:t,value:E,onChange:Le,onKeyDown:nt,onMouseUp:Tt,onFocus:Ve,onBlur:Te});if(n==="text")return o?un.createElement(un.Fragment,null,o(E,C)||null):un.createElement("span",Object.assign({},C,{ref:i}),E);if(r){var Qe=r;return un.createElement(Qe,Object.assign({},Xe,{ref:i}))}return un.createElement("input",Object.assign({},Xe,{ref:i}))}function Nb(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=gh(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=Xy(e,a),m=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=YT(g,n,!!r)),u&&(m=ZO(m,u,l)),o&&(m=o+m),i&&(g=g+i),v&&(m="-"+m),e=m+(f&&d||"")+g,e}function gh(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 f9(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 h9(e,t){return new RegExp("(^-)|[0-9]|"+KT(e),"g")}function p9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function m9(e,t,n){var r;t===void 0&&(t=i9(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=gh(n),m=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(Pc(e)&&(e===i||e===a)&&t.lastValue==="")return e;if(f-d===1&&m.indexOf(e[d])!==-1){var w=l===0?"":g;e=e.substring(0,d)+w+e.substring(d+1,e.length)}var y=function(k,P,$){var O=!1,V=!1;i.startsWith("-")?O=!1:k.startsWith("--")?(O=!1,V=!0):a.startsWith("-")&&k.length===a.length?O=!1:k[0]==="-"&&(O=!0);var K=O?1:0;return V&&(K=2),K&&(k=k.substring(K),P-=K,$-=K),{value:k,start:P,end:$,hasNegation:O}},S=y(e,d,f),b=S.hasNegation;r=S,e=r.value,d=r.start,f=r.end;var x=y(t.lastValue,c.start,c.end),C=x.start,j=x.end,T=x.value,E=e.substring(d,f);e.length&&T.length&&(C>T.length-a.length||j<i.length)&&!(E&&a.startsWith(E))&&(e=T);var _=0;e.startsWith(i)?_+=i.length:d<i.length&&(_=d),e=e.substring(_),f-=_;var R=e.length,A=e.length-a.length;e.endsWith(a)?R=A:(f>A||f>e.length-a.length)&&(R=f),e=e.substring(0,R),e=f9(b?"-"+e:e,o),e=(e.match(h9(g))||[]).join("");var L=e.indexOf(g);e=e.replace(new RegExp(KT(g),"g"),function(k,P){return P===L?".":""});var U=Xy(e,o),N=U.beforeDecimal,F=U.afterDecimal,D=U.addNegation;return u.end-u.start<c.end-c.start&&N===""&&v&&!parseFloat(F)&&(e=D?"-":""),e}function g9(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 v9(e){var t=gh(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 y9(e){e=v9(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=gi);var i=e.onBlur;i===void 0&&(i=gi);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=GT(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=gh(e),w=v.decimalSeparator,y=v.allowedDecimalSeparators,S=function(D){return Nb(D,e)},b=function(D,k){return m9(D,k,e)},x=$a(f)?d:f,C=h??p9(x,u,t);$a(f)?$a(d)||(C=C||typeof d=="number"):C=C||typeof f=="number";var j=function(D){return QT(D)?D:(typeof D=="number"&&(D=XT(D)),C&&typeof l=="number"?Ib(D,l,!!c):D)},T=ZT(j(f),j(d),!!C,S,b,m),E=T[0],_=E.numAsString,R=E.formattedValue,A=T[1],L=function(D){var k=D.target,P=D.key,$=k.selectionStart,O=k.selectionEnd,V=k.value;if(V===void 0&&(V=""),(P==="Backspace"||P==="Delete")&&O<u.length){D.preventDefault();return}if($!==O){o(D);return}P==="Backspace"&&V[0]==="-"&&$===u.length+1&&n&&rs(k,1),l&&c&&(P==="Backspace"&&V[$-1]===w?(rs(k,$-1),D.preventDefault()):P==="Delete"&&V[$]===w&&D.preventDefault()),y!=null&&y.includes(P)&&V[$]===w&&rs(k,$+1);var K=a===!0?",":a;P==="Backspace"&&V[$-1]===K&&rs(k,$-1),P==="Delete"&&V[$]===K&&rs(k,$+1),o(D)},U=function(D){var k=_;if(k.match(/\d/g)||(k=""),r||(k=t9(k)),c&&l&&(k=Ib(k,l,c)),k!==_){var P=Nb(k,e);A({formattedValue:P,value:k,floatValue:parseFloat(k)},{event:D,source:Tc.event})}i(D)},N=function(D){return D===w?!0:Pc(D)},F=function(D){var k=D.currentValue,P=D.lastValue,$=D.formattedValue,O=D.currentValueIndex,V=D.formattedValueIndex,K=k[O],ie=$[V],Re=JT(P,k),ae=Re.to;return O>=ae.start&&O<ae.end&&y&&y.includes(K)&&ie===w?!0:K===ie};return Object.assign(Object.assign({},g),{value:R,valueIsNumericString:!1,isValidInputCharacter:N,isCharacterSame:F,onValueChange:A,format:S,removeFormatting:b,getCaretBoundary:function(D){return g9(D,e)},onKeyDown:L,onBlur:U})}function x9(e){var t=y9(e);return un.createElement(d9,Object.assign({},t))}function Mb({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 ag={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const b9=/^(0\.0*|-0(\.0*)?)$/,S9=/^-?0\d+(\.\d+)?\.?$/;function w9(e){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)}function Ob(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 j9={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},C9=(e,{size:t})=>({controls:{"--ni-chevron-size":Ae(t,"ni-chevron-size")}}),Jy=X((e,t)=>{const n=H("NumberInput",j9,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:w,isAllowed:y,clampBehavior:S,onBlur:b,allowDecimal:x,decimalScale:C,onKeyDown:j,onKeyDownCapture:T,handlersRef:E,startValue:_,disabled:R,rightSectionPointerEvents:A,allowNegative:L,readOnly:U,size:N,rightSectionWidth:F,stepHoldInterval:D,stepHoldDelay:k,allowLeadingZeros:P,withKeyboardEvents:$,trimLeadingZeroesOnBlur:O,...V}=n,K=ce({name:"NumberInput",classes:ag,props:n,classNames:o,styles:i,unstyled:a,vars:l,varsResolver:C9}),{resolvedClassNames:ie,resolvedStyles:Re}=zc({classNames:o,styles:i,props:n}),[ae,Ee]=yn({value:d,defaultValue:f,onChange:c}),Fe=k!==void 0&&D!==void 0,me=p.useRef(null),Le=p.useRef(null),nt=p.useRef(0),Tt=(Q,xe)=>{xe.source==="event"&&Ee(w9(Q.floatValue)&&!b9.test(Q.value)&&!(P&&S9.test(Q.value))?Q.floatValue:Q.value),u==null||u(Q,xe)},Ve=Q=>{const xe=String(Q).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return xe?Math.max(0,(xe[1]?xe[1].length:0)-(xe[2]?+xe[2]:0)):0},Te=Q=>{me.current&&typeof Q<"u"&&me.current.setSelectionRange(Q,Q)},Pe=p.useRef();Pe.current=()=>{let Q;const xe=Ve(ae),Be=Ve(g),Nt=Math.max(xe,Be),Pt=10**Nt;if(typeof ae!="number"||Number.isNaN(ae))Q=Iu(_,m,h);else if(h!==void 0){const wt=(Math.round(ae*Pt)+Math.round(g*Pt))/Pt;Q=wt<=h?wt:h}else Q=(Math.round(ae*Pt)+Math.round(g*Pt))/Pt;const $t=Q.toFixed(Nt);Ee(parseFloat($t)),u==null||u({floatValue:parseFloat($t),formattedValue:$t,value:$t},{source:"increment"}),setTimeout(()=>{var wt;return Te((wt=me.current)==null?void 0:wt.value.length)},0)};const Xe=p.useRef();Xe.current=()=>{let Q;const xe=m!==void 0?m:L?Number.MIN_SAFE_INTEGER:0,Be=Ve(ae),Nt=Ve(g),Pt=Math.max(Be,Nt),$t=10**Pt;if(typeof ae!="number"||Number.isNaN(ae))Q=Iu(_,xe,h);else{const wn=(Math.round(ae*$t)-Math.round(g*$t))/$t;Q=xe!==void 0&&wn<xe?xe:wn}const wt=Q.toFixed(Pt);Ee(parseFloat(wt)),u==null||u({floatValue:parseFloat(wt),formattedValue:wt,value:wt},{source:"decrement"}),setTimeout(()=>{var wn;return Te((wn=me.current)==null?void 0:wn.value.length)},0)};const Qe=Q=>{j==null||j(Q),!(U||!$)&&(Q.key==="ArrowUp"&&(Q.preventDefault(),Pe.current()),Q.key==="ArrowDown"&&(Q.preventDefault(),Xe.current()))},Z=Q=>{if(T==null||T(Q),Q.key==="Backspace"){const xe=me.current;xe.selectionStart===0&&xe.selectionStart===xe.selectionEnd&&(Q.preventDefault(),window.setTimeout(()=>Te(0),0))}};Rf(E,{increment:Pe.current,decrement:Xe.current});const ue=Q=>{Q?Pe.current():Xe.current(),nt.current+=1},we=Q=>{if(ue(Q),Fe){const xe=typeof D=="number"?D:D(nt.current);Le.current=window.setTimeout(()=>we(Q),xe)}},We=(Q,xe)=>{var Be;Q.preventDefault(),(Be=me.current)==null||Be.focus(),ue(xe),Fe&&(Le.current=window.setTimeout(()=>we(xe),k))},ne=()=>{Le.current&&window.clearTimeout(Le.current),Le.current=null,nt.current=0},pe=s.jsxs("div",{...K("controls"),children:[s.jsx(bn,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof ae=="number"&&h!==void 0&&ae>=h,mod:{direction:"up"},onMouseDown:Q=>Q.preventDefault(),onPointerDown:Q=>{We(Q,!0)},onPointerUp:ne,onPointerLeave:ne,children:s.jsx(Mb,{direction:"up"})}),s.jsx(bn,{...K("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof ae=="number"&&m!==void 0&&ae<=m,mod:{direction:"down"},onMouseDown:Q=>Q.preventDefault(),onPointerDown:Q=>{We(Q,!1)},onPointerUp:ne,onPointerLeave:ne,children:s.jsx(Mb,{direction:"down"})})]});return s.jsx(tr,{component:x9,allowNegative:L,className:rt(ag.root,r),size:N,...V,readOnly:U,disabled:R,value:ae,getInputRef:rn(t,me),onValueChange:Tt,rightSection:v||U?w:w||pe,classNames:ie,styles:Re,unstyled:a,__staticSelector:"NumberInput",decimalScale:x?C:0,onKeyDown:Qe,onKeyDownCapture:Z,rightSectionPointerEvents:A??(R?"none":void 0),rightSectionWidth:F??`var(--ni-right-section-width-${N||"sm"})`,allowLeadingZeros:P,onBlur:Q=>{if(b==null||b(Q),S==="blur"&&typeof ae=="number"&&Iu(ae,m,h)!==ae&&Ee(Iu(ae,m,h)),O&&typeof ae=="string"){const xe=ae.replace(/^0+/,""),Be=parseFloat(xe);Ee(Number.isNaN(Be)||Be>Number.MAX_SAFE_INTEGER?xe:Be)}},isAllowed:Q=>S==="strict"?y?y(Q)&&Ob(Q.floatValue,m,h):Ob(Q.floatValue,m,h):y?y(Q):!0})});Jy.classes={...tr.classes,...ag};Jy.displayName="@mantine/core/NumberInput";const[E9,vh]=Bn("Pagination.Root component was not found in tree");var eu={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const T9={withPadding:!0},tu=X((e,t)=>{const n=H("PaginationControl",T9,e),{classNames:r,className:o,style:i,styles:a,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=vh(),g=u||m.disabled;return s.jsx(bn,{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})});tu.classes=eu;tu.displayName="@mantine/core/PaginationControl";function nu({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 P9=e=>s.jsx(nu,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),k9=e=>s.jsx(nu,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),R9=e=>s.jsx(nu,{...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"}),_9=e=>s.jsx(nu,{...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"}),D9=e=>s.jsx(nu,{...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"}),I9={icon:D9},yh=X((e,t)=>{const n=H("PaginationDots",I9,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,...u}=n,d=vh(),f=c;return s.jsx(q,{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)"}})})});yh.classes=eu;yh.displayName="@mantine/core/PaginationDots";function xh({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((a,l)=>{const{icon:c,...u}=H(t,o,a),d=c,f=vh(),h=r==="next"?f.active===f.total:f.active===1;return s.jsx(tu,{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 eP=xh({icon:P9,name:"PaginationNext",action:"onNext",type:"next"}),tP=xh({icon:k9,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),nP=xh({icon:R9,name:"PaginationFirst",action:"onFirst",type:"previous"}),rP=xh({icon:_9,name:"PaginationLast",action:"onLast",type:"next"});function Zy({dotsIcon:e}){const t=vh(),n=t.range.map((r,o)=>{var i;return r==="dots"?s.jsx(yh,{icon:e},o):s.jsx(tu,{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})}Zy.displayName="@mantine/core/PaginationItems";const A9={siblings:1,boundaries:1},N9=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:lt(n),"--pagination-control-size":Ae(t,"pagination-control-size"),"--pagination-control-fz":dn(t),"--pagination-active-bg":r?at(r,e):void 0,"--pagination-active-color":Is(o,e)?Go({color:r,theme:e,autoContrast:o}):void 0}}),bh=X((e,t)=>{const n=H("PaginationRoot",A9,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:w,radius:y,onNextPage:S,onPreviousPage:b,onFirstPage:x,onLastPage:C,getItemProps:j,autoContrast:T,...E}=n,_=ce({name:"Pagination",classes:eu,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:N9}),{range:R,setPage:A,next:L,previous:U,active:N,first:F,last:D}=iD({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),k=ar(S,L),P=ar(b,U),$=ar(x,F),O=ar(C,D);return s.jsx(E9,{value:{total:u,range:R,active:N,disabled:m,getItemProps:j,onChange:A,onNext:k,onPrevious:P,onFirst:$,onLast:O,getStyles:_},children:s.jsx(q,{ref:t,..._("root"),...E})})});bh.classes=eu;bh.displayName="@mantine/core/PaginationRoot";const M9={withControls:!0,siblings:1,boundaries:1,gap:8},no=X((e,t)=>{const n=H("Pagination",M9,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:a,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,hideWithOnePage:m,...g}=n;return f<=0||m&&f===1?null:s.jsx(bh,{ref:t,total:f,...g,children:s.jsxs(te,{gap:h,children:[r&&s.jsx(nP,{icon:u,...i==null?void 0:i("first")}),o&&s.jsx(tP,{icon:l,...i==null?void 0:i("previous")}),s.jsx(Zy,{dotsIcon:d}),o&&s.jsx(eP,{icon:a,...i==null?void 0:i("next")}),r&&s.jsx(rP,{icon:c,...i==null?void 0:i("last")})]})})});no.classes=eu;no.displayName="@mantine/core/Pagination";no.Root=bh;no.Control=tu;no.Dots=yh;no.First=nP;no.Last=rP;no.Next=eP;no.Previous=tP;no.Items=Zy;const O9=({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 lg={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const L9={visibilityToggleIcon:O9},$9=(e,{size:t})=>({root:{"--psi-icon-size":Ae(t,"psi-icon-size"),"--psi-button-size":Ae(t,"psi-button-size")}}),Qr=X((e,t)=>{const n=H("PasswordInput",L9,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:w,label:y,size:S,errorProps:b,descriptionProps:x,labelProps:C,withAsterisk:j,inputWrapperOrder:T,wrapperProps:E,radius:_,rightSection:R,rightSectionWidth:A,rightSectionPointerEvents:L,leftSectionWidth:U,visible:N,defaultVisible:F,onVisibilityChange:D,visibilityToggleIcon:k,visibilityToggleButtonProps:P,rightSectionProps:$,leftSectionProps:O,leftSectionPointerEvents:V,withErrorStyles:K,mod:ie,...Re}=n,ae=Un(m),[Ee,Fe]=yn({value:N,defaultValue:F,finalValue:!1,onChange:D}),me=()=>Fe(!Ee),Le=ce({name:"PasswordInput",classes:lg,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:$9}),{resolvedClassNames:nt,resolvedStyles:Tt}=zc({classNames:r,styles:a,props:n}),{styleProps:Ve,rest:Te}=Qo(Re),Pe=k,Xe=s.jsx(tn,{...Le("visibilityToggle"),disabled:h,radius:_,"aria-hidden":!P,tabIndex:-1,...P,variant:"subtle",color:"gray",unstyled:l,onMouseDown:Qe=>{var Z;Qe.preventDefault(),(Z=P==null?void 0:P.onMouseDown)==null||Z.call(P,Qe),me()},onKeyDown:Qe=>{var Z;(Z=P==null?void 0:P.onKeyDown)==null||Z.call(P,Qe),Qe.key===" "&&(Qe.preventDefault(),me())},children:s.jsx(Pe,{reveal:Ee})});return s.jsx(Lt.Wrapper,{required:u,id:ae,label:y,error:d,description:w,size:S,classNames:nt,styles:Tt,__staticSelector:"PasswordInput",errorProps:b,descriptionProps:x,unstyled:l,withAsterisk:j,inputWrapperOrder:T,inputContainer:v,variant:g,labelProps:{...C,htmlFor:ae},mod:ie,...Le("root"),...Ve,...E,children:s.jsx(Lt,{component:"div",error:d,leftSection:f,size:S,classNames:{...nt,input:rt(lg.input,nt.input)},styles:Tt,radius:_,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:A,rightSection:R??Xe,variant:g,unstyled:l,leftSectionWidth:U,rightSectionPointerEvents:L||"all",rightSectionProps:$,leftSectionProps:O,leftSectionPointerEvents:V,withAria:!1,withErrorStyles:K,children:s.jsx("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...Le("innerInput"),disabled:h,id:ae,ref:t,...Te,autoComplete:Te.autoComplete||"off",type:Ee?"text":"password"})})})});Qr.classes={...tr.classes,...lg};Qr.displayName="@mantine/core/PasswordInput";const[F9,oP]=Ds(),[z9,B9]=Ds();var iP={card:"m_9dc8ae12"};const U9={withBorder:!0},V9=(e,{radius:t})=>({card:{"--card-radius":lt(t)}}),ex=X((e,t)=>{const n=H("RadioCard",U9,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,...w}=n,y=ce({name:"RadioCard",classes:iP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:V9,rootSelector:"card"}),{dir:S}=Ns(),b=oP(),x=typeof u=="boolean"?u:(b==null?void 0:b.value)===h||!1,C=g||(b==null?void 0:b.name),j=T=>{if(v==null||v(T),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(T.nativeEvent.code)){T.preventDefault();const E=Array.from(document.querySelectorAll(`[role="radio"][name="${C||"__mantine"}"]`)),_=E.findIndex(L=>L===T.target),R=_+1>=E.length?0:_+1,A=_-1<0?E.length-1:_-1;T.nativeEvent.code==="ArrowDown"&&(E[R].focus(),E[R].click()),T.nativeEvent.code==="ArrowUp"&&(E[A].focus(),E[A].click()),T.nativeEvent.code==="ArrowLeft"&&(E[S==="ltr"?A:R].focus(),E[S==="ltr"?A:R].click()),T.nativeEvent.code==="ArrowRight"&&(E[S==="ltr"?R:A].focus(),E[S==="ltr"?R:A].click())}};return s.jsx(z9,{value:{checked:x},children:s.jsx(bn,{ref:t,mod:[{"with-border":f,checked:x},d],...y("card"),...w,role:"radio","aria-checked":x,name:C,onClick:T=>{m==null||m(T),b==null||b.onChange(h||"")},onKeyDown:j})})});ex.displayName="@mantine/core/RadioCard";ex.classes=iP;const H9={},tx=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,name:c,readOnly:u,...d}=H("RadioGroup",H9,e),f=Un(c),[h,m]=yn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&m(typeof v=="string"?v:v.currentTarget.value);return s.jsx(F9,{value:{value:h,onChange:g,size:i,name:f},children:s.jsx(Lt.Wrapper,{size:i,ref:t,...a,...d,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(ky,{role:"radiogroup",children:l})})})});tx.classes=Lt.Wrapper.classes;tx.displayName="@mantine/core/RadioGroup";function sP({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:B(e),height:B(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var aP={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const W9={icon:sP},q9=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Pr({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":Ae(r,"radio-size"),"--radio-radius":t===void 0?void 0:lt(t),"--radio-color":i==="outline"?c:at(n,e),"--radio-icon-size":Ae(r,"radio-icon-size"),"--radio-icon-color":o?at(o,e):Is(a,e)?Go({color:n,theme:e,autoContrast:a}):void 0}}},nx=X((e,t)=>{const n=H("RadioIndicator",W9,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:w,disabled:y,...S}=n,b=u,x=ce({name:"RadioIndicator",classes:aP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:q9,rootSelector:"indicator"}),C=B9(),j=typeof g=="boolean"?g:(C==null?void 0:C.checked)||!1;return s.jsx(q,{ref:t,...x("indicator",{variant:w}),variant:w,mod:[{checked:j,disabled:y},v],...S,children:s.jsx(b,{...x("icon")})})});nx.displayName="@mantine/core/RadioIndicator";nx.classes=aP;var lP={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const G9={labelPosition:"right"},Q9=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Pr({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":Ae(t,"radio-size"),"--radio-radius":n===void 0?void 0:lt(n),"--radio-color":i==="outline"?c:at(r,e),"--radio-icon-color":o?at(o,e):Is(a,e)?Go({color:r,theme:e,autoContrast:a}):void 0,"--radio-icon-size":Ae(t,"radio-icon-size")}}},Es=X((e,t)=>{const n=H("Radio",G9,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:w,variant:y,disabled:S,wrapperProps:b,icon:x=sP,rootRef:C,iconColor:j,onChange:T,mod:E,..._}=n,R=ce({name:"Radio",classes:lP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Q9}),A=oP(),L=(A==null?void 0:A.size)??d,U=n.size?d:L,{styleProps:N,rest:F}=Qo(_),D=Un(u),k=A?{checked:A.value===F.value,name:F.name??A.name,onChange:P=>{A.onChange(P),T==null||T(P)}}:{};return s.jsx(rh,{...R("root"),__staticSelector:"Radio",__stylesApiProps:n,id:D,size:U,labelPosition:h,label:f,description:m,error:g,disabled:S,classNames:r,styles:a,unstyled:l,"data-checked":k.checked||void 0,variant:y,ref:C,mod:E,...N,...b,children:s.jsxs(q,{...R("inner"),mod:{"label-position":h},children:[s.jsx(q,{...R("radio",{focusable:!0,variant:y}),onChange:T,...F,...k,component:"input",mod:{error:!!g},ref:t,id:D,disabled:S,type:"radio"}),s.jsx(x,{...R("icon"),"aria-hidden":!0})]})})});Es.classes=lP;Es.displayName="@mantine/core/Radio";Es.Group=tx;Es.Card=ex;Es.Indicator=nx;const K9={duration:100,transition:"fade"};function Y9(e,t){return{...K9,...t,...e}}function X9({offset:e,position:t,defaultOpened:n}){const[r,o]=p.useState(n),i=p.useRef(),{x:a,y:l,elements:c,refs:u,update:d,placement:f}=iy({placement:t,middleware:[ty({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=f.includes("right")?e:t.includes("left")?e*-1:0,m=f.includes("bottom")?e:t.includes("top")?e*-1:0,g=p.useCallback(({clientX:v,clientY:w})=>{u.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:v,y:w,left:v+h,top:w+m,right:v,bottom:w}}})},[c.reference]);return p.useEffect(()=>{if(u.floating.current){const v=i.current;v.addEventListener("mousemove",g);const w=Ao(u.floating.current);return w.forEach(y=>{y.addEventListener("scroll",d)}),()=>{v.removeEventListener("mousemove",g),w.forEach(y=>{y.removeEventListener("scroll",d)})}}},[c.reference,u.floating.current,d,g,r]),{handleMouseMove:g,x:a,y:l,opened:r,setOpened:o,boundaryRef:i,floating:u.setFloating}}var Sh={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const J9={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:eo("popover")},Z9=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:lt(t),"--tooltip-bg":n?at(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),rx=X((e,t)=>{const n=H("TooltipFloating",J9,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:w,zIndex:y,disabled:S,defaultOpened:b,variant:x,vars:C,portalProps:j,...T}=n,E=At(),_=ce({name:"TooltipFloating",props:n,classes:Sh,className:l,style:a,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:C,varsResolver:Z9}),{handleMouseMove:R,x:A,y:L,opened:U,boundaryRef:N,floating:F,setOpened:D}=X9({offset:g,position:v,defaultOpened:b});if(!qo(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 k=rn(N,r.ref,t),P=O=>{var V,K;(K=(V=r.props).onMouseEnter)==null||K.call(V,O),R(O),D(!0)},$=O=>{var V,K;(K=(V=r.props).onMouseLeave)==null||K.call(V,O),D(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Ls,{...j,withinPortal:i,children:s.jsx(q,{...T,..._("tooltip",{style:{...sj(a,E),zIndex:y,display:!S&&U?"block":"none",top:(L&&Math.round(L))??"",left:(A&&Math.round(A))??""}}),variant:x,ref:F,mod:{multiline:w},children:m})}),p.cloneElement(r,{...r.props,[o]:k,onMouseEnter:P,onMouseLeave:$})]})});rx.classes=Sh;rx.displayName="@mantine/core/TooltipFloating";const cP=p.createContext(!1),eL=cP.Provider,tL=()=>p.useContext(cP),nL={openDelay:0,closeDelay:0};function uP(e){const{openDelay:t,closeDelay:n,children:r}=H("TooltipGroup",nL,e);return s.jsx(eL,{value:!0,children:s.jsx(Y4,{delay:{open:t,close:n},children:r})})}uP.displayName="@mantine/core/TooltipGroup";function rL(e){var j,T,E;const[t,n]=p.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,i=tL(),a=Un(),{delay:l,currentId:c,setCurrentId:u}=UE(),d=p.useCallback(_=>{n(_),_&&u(a)},[u,a]),{x:f,y:h,context:m,refs:g,update:v,placement:w,middlewareData:{arrow:{x:y,y:S}={}}}=iy({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[LE(e.offset),ty({padding:8}),rg(),$E({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[og()]:[]]}),{getReferenceProps:b,getFloatingProps:x}=r3([K4(m,{enabled:(j=e.events)==null?void 0:j.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((T=e.events)!=null&&T.touch)}),n3(m,{enabled:(E=e.events)==null?void 0:E.focus,visibleOnly:!0}),i3(m,{role:"tooltip"}),e3(m,{enabled:typeof e.opened>"u"}),X4(m,{id:a})]);KE({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Mo(()=>{var _;(_=e.onPositionChange)==null||_.call(e,w)},[w]);const C=o&&c&&c!==a;return{x:f,y:h,arrowX:y,arrowY:S,reference:g.setReference,floating:g.setFloating,getFloatingProps:x,getReferenceProps:b,isGroupPhase:C,opened:o,placement:w}}const Lb={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:eo("popover"),positionDependencies:[]},oL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:lt(t),"--tooltip-bg":n?at(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),zs=X((e,t)=>{const n=H("Tooltip",Lb,e),{children:r,position:o,refProp:i,label:a,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,defaultOpened:f,withinPortal:h,radius:m,color:g,classNames:v,styles:w,unstyled:y,style:S,className:b,withArrow:x,arrowSize:C,arrowOffset:j,arrowRadius:T,arrowPosition:E,offset:_,transitionProps:R,multiline:A,events:L,zIndex:U,disabled:N,positionDependencies:F,onClick:D,onMouseEnter:k,onMouseLeave:P,inline:$,variant:O,keepMounted:V,vars:K,portalProps:ie,mod:Re,floatingStrategy:ae,...Ee}=H("Tooltip",Lb,n),{dir:Fe}=Ns(),me=p.useRef(null),Le=rL({position:VE(Fe,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,defaultOpened:f,events:L,arrowRef:me,arrowOffset:j,offset:typeof _=="number"?_+(x?C/2:0):_,positionDependencies:[...F,r],inline:$,strategy:ae}),nt=ce({name:"Tooltip",props:n,classes:Sh,className:b,style:S,classNames:v,styles:w,unstyled:y,rootSelector:"tooltip",vars:K,varsResolver:oL});if(!qo(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 Tt=rn(Le.reference,r.ref,t),Ve=Y9(R,{duration:100,transition:"fade"});return s.jsxs(s.Fragment,{children:[s.jsx(Ls,{...ie,withinPortal:h,children:s.jsx(Xo,{...Ve,keepMounted:V,mounted:!N&&!!Le.opened,duration:Le.isGroupPhase?10:Ve.duration,children:Te=>s.jsxs(q,{...Ee,"data-fixed":ae==="fixed"||void 0,variant:O,mod:[{multiline:A},Re],...Le.getFloatingProps({ref:Le.floating,className:nt("tooltip").className,style:{...nt("tooltip").style,...Te,zIndex:U,top:Le.y??0,left:Le.x??0}}),children:[a,s.jsx(sy,{ref:me,arrowX:Le.arrowX,arrowY:Le.arrowY,visible:x,position:Le.placement,arrowSize:C,arrowOffset:j,arrowRadius:T,arrowPosition:E,...nt("arrow")})]})})}),p.cloneElement(r,Le.getReferenceProps({onClick:D,onMouseEnter:k,onMouseLeave:P,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:Tt,className:rt(b,r.props.className),...r.props}))]})});zs.classes=Sh;zs.displayName="@mantine/core/Tooltip";zs.Floating=rx;zs.Group=uP;function iL({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 dP({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=At();return s.jsx(zs.Floating,{disabled:!c,label:c,children:s.jsx(q,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":a?at(a,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...iL({sum:r,size:e,thickness:o,value:t,offset:n,root:i})})})}dP.displayName="@mantine/core/Curve";function sL({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 fP={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function aL(e,t){return Math.min(e||12,(t||120)/4)}const lL={size:120,thickness:12},cL=(e,{size:t,thickness:n})=>({root:{"--rp-size":B(t),"--rp-label-offset":B(n*2)}}),wh=X((e,t)=>{const n=H("RingProgress",lL,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,w=ce({name:"RingProgress",classes:fP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:cL}),y=aL(h,f),S=sL({size:f,thickness:y,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:b,sum:x,root:C,lineRoundCaps:j,offset:T},E)=>p.createElement(dP,{...b,key:E,size:f,thickness:y,sum:x,offset:T,color:b==null?void 0:b.color,root:C,lineRoundCaps:j,getStyles:w}));return s.jsxs(q,{...w("root"),size:f,ref:t,...v,children:[s.jsx("svg",{...w("svg"),children:S}),u&&s.jsx("div",{...w("label"),children:u})]})});wh.classes=fP;wh.displayName="@mantine/core/RingProgress";var hP={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const uL={withItemsBorders:!0},dL=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:lt(t),"--sc-color":n?at(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":Ae(o,"sc-padding"),"--sc-font-size":dn(o)}}),ox=X((e,t)=>{var Ee,Fe;const n=H("SegmentedControl",uL,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:w,fullWidth:y,orientation:S,radius:b,color:x,transitionDuration:C,transitionTimingFunction:j,variant:T,autoContrast:E,withItemsBorders:_,mod:R,...A}=n,L=ce({name:"SegmentedControl",props:n,classes:hP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:dL}),U=At(),N=u.map(me=>typeof me=="string"?{label:me,value:me}:me),F=lD(),[D,k]=p.useState(null),[P,$]=p.useState({}),O=(me,Le)=>{P[Le]=me,$(P)},[V,K]=yn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((Ee=N.find(me=>!me.disabled))==null?void 0:Ee.value)??((Fe=u[0])==null?void 0:Fe.value)??null:null,onChange:h}),ie=Un(g),Re=N.map(me=>p.createElement(q,{...L("control"),mod:{active:V===me.value,orientation:S},key:me.value},p.createElement("input",{...L("input"),disabled:v||me.disabled,type:"radio",name:ie,value:me.value,id:`${ie}-${me.value}`,checked:V===me.value,onChange:()=>!w&&K(me.value),"data-focus-ring":U.focusRing,key:`${me.value}-input`}),p.createElement(q,{component:"label",...L("label"),mod:{active:V===me.value&&!(v||me.disabled),disabled:v||me.disabled,"read-only":w},htmlFor:`${ie}-${me.value}`,ref:Le=>O(Le,me.value),__vars:{"--sc-label-color":x!==void 0?Go({color:x,theme:U,autoContrast:E}):void 0},key:`${me.value}-label`},s.jsx("span",{...L("innerLabel"),children:me.label})))),ae=rn(t,me=>k(me));return u.length===0?null:s.jsxs(q,{...L("root"),variant:T,size:m,ref:ae,mod:[{"full-width":y,orientation:S,initialized:F,"with-items-borders":_},R],...A,role:"radiogroup",children:[typeof V=="string"&&s.jsx(dy,{target:P[V],parent:D,component:"span",transitionDuration:"var(--sc-transition-duration)",...L("indicator")}),Re]})});ox.classes=hP;ox.displayName="@mantine/core/SegmentedControl";function fL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=At(),i=t===void 0?e:t,a=Oi({"--sg-spacing-x":Jt(Hr(e)),"--sg-spacing-y":Jt(Hr(i)),"--sg-cols":(d=Hr(n))==null?void 0:d.toString()}),l=xt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=Jt(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=Jt(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=oc(xt(l),o).filter(f=>xt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return s.jsx(As,{styles:a,media:u,selector:r})}function Fp(e){return typeof e=="object"&&e!==null?xt(e):[]}function hL(e){return e.sort((t,n)=>rc(t)-rc(n))}function pL({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Fp(e),...Fp(t),...Fp(n)]));return hL(r)}function mL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var u;const o=t===void 0?e:t,i=Oi({"--sg-spacing-x":Jt(Hr(e)),"--sg-spacing-y":Jt(Hr(o)),"--sg-cols":(u=Hr(n))==null?void 0:u.toString()}),a=pL({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"]=Jt(e[f])),typeof o=="object"&&o[f]!==void 0&&(d[f]["--sg-spacing-y"]=Jt(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(As,{styles:i,container:c,selector:r})}var pP={container:"m_925c2d2c",root:"m_2415a157"};const gL={cols:1,spacing:"md",type:"media"},ix=X((e,t)=>{const n=H("SimpleGrid",gL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,type:h,...m}=n,g=ce({name:"SimpleGrid",classes:pP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),v=Bc();return h==="container"?s.jsxs(s.Fragment,{children:[s.jsx(mL,{...n,selector:`.${v}`}),s.jsx("div",{...g("container"),children:s.jsx(q,{ref:t,...g("root",{className:v}),...m})})]}):s.jsxs(s.Fragment,{children:[s.jsx(fL,{...n,selector:`.${v}`}),s.jsx(q,{ref:t,...g("root",{className:v}),...m})]})});ix.classes=pP;ix.displayName="@mantine/core/SimpleGrid";const vL={},jh=X((e,t)=>{const{w:n,h:r,miw:o,mih:i,...a}=H("Space",vL,e);return s.jsx(q,{ref:t,...a,w:n,miw:o??n,h:r,mih:i??r})});jh.displayName="@mantine/core/Space";var mP={root:"m_6d731127"};const yL={gap:"md",align:"stretch",justify:"flex-start"},xL=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Jt(t),"--stack-align":n,"--stack-justify":r}}),Oe=X((e,t)=>{const n=H("Stack",yL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=ce({name:"Stack",props:n,classes:mP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:xL});return s.jsx(q,{ref:t,...g("root"),variant:h,...m})});Oe.classes=mP;Oe.displayName="@mantine/core/Stack";const[bL,SL]=Bn("Stepper component was not found in tree"),sf=()=>null;sf.displayName="@mantine/core/StepperCompleted";var sx={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 ed=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,wL={withIcon:!0,allowStepClick:!0,iconPosition:"left"},ax=X((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:w,loading:y,allowStepClick:S,allowStepSelect:b,iconPosition:x,orientation:C,mod:j,...T}=H("StepperStep",wL,e),E=SL(),_=At(),R={classNames:n,styles:i},A=c==="stepCompleted"?null:c==="stepProgress"?h:d,L={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return s.jsxs(bn,{...E.getStyles("step",{className:r,style:o,variant:E.orientation,...R}),mod:[{"icon-position":x||E.iconPosition,"allow-click":S},j],ref:t,...L,...T,__vars:{"--step-color":u?at(u,_):void 0},tabIndex:S?0:-1,children:[v&&s.jsxs("span",{...E.getStyles("stepWrapper",R),children:[s.jsxs("span",{...E.getStyles("stepIcon",R),...L,children:[s.jsx(Xo,{mounted:c==="stepCompleted",transition:"pop",duration:200,children:U=>s.jsx("span",{...E.getStyles("stepCompletedIcon",{style:U,...R}),children:y?s.jsx(Zn,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...E.getStyles("stepLoader",R)}):ed(f,l)||s.jsx(oh,{size:"60%"})})}),c!=="stepCompleted"?y?s.jsx(Zn,{...E.getStyles("stepLoader",R),size:"calc(var(--stepper-icon-size) / 2)",color:u}):ed(A||d,l):null]}),C==="vertical"&&s.jsx("span",{...E.getStyles("verticalSeparator",R),"data-active":c==="stepCompleted"||void 0})]}),(m||g)&&s.jsxs("span",{...E.getStyles("stepBody",R),"data-orientation":E.orientation,"data-icon-position":x||E.iconPosition,children:[m&&s.jsx("span",{...E.getStyles("stepLabel",R),children:ed(m,l)}),g&&s.jsx("span",{...E.getStyles("stepDescription",R),children:ed(g,l)})]})]})});ax.classes=sx;ax.displayName="@mantine/core/StepperStep";const jL={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},CL=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:a})=>({root:{"--stepper-color":t?at(t,e):void 0,"--stepper-icon-color":Is(a,e)?Go({color:t,theme:e,autoContrast:a}):void 0,"--stepper-icon-size":n===void 0?Ae(r,"stepper-icon-size"):B(n),"--stepper-content-padding":Jt(o),"--stepper-radius":i===void 0?void 0:lt(i),"--stepper-fz":dn(r),"--stepper-spacing":Jt(r)}}),Ja=X((e,t)=>{var P,$,O;const n=H("Stepper",jL,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:w,contentPadding:y,orientation:S,iconPosition:b,size:x,radius:C,allowNextStepsSelect:j,wrap:T,autoContrast:E,..._}=n,R=ce({name:"Stepper",classes:sx,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:CL}),A=p.Children.toArray(u),L=A.filter(V=>V.type!==sf),U=A.find(V=>V.type===sf),N=L.reduce((V,K,ie)=>{const Re=f===ie?"stepProgress":f>ie?"stepCompleted":"stepInactive",Ee=typeof d!="function"?!1:typeof K.props.allowStepSelect=="boolean"?K.props.allowStepSelect:Re==="stepCompleted"||j;return V.push(p.cloneElement(K,{icon:K.props.icon||h||ie+1,key:ie,step:ie,state:Re,onClick:()=>Ee&&(d==null?void 0:d(ie)),allowStepClick:Ee,completedIcon:K.props.completedIcon||m,progressIcon:K.props.progressIcon||g,color:K.props.color||v,iconSize:w,radius:C,iconPosition:K.props.iconPosition||b,orientation:S,unstyled:l})),S==="horizontal"&&ie!==L.length-1&&V.push(p.createElement("div",{...R("separator"),"data-active":ie<f||void 0,"data-orientation":S,key:`separator-${ie}`})),V},[]),F=($=(P=L[f])==null?void 0:P.props)==null?void 0:$.children,D=(O=U==null?void 0:U.props)==null?void 0:O.children,k=f>L.length-1?D:F;return s.jsx(bL,{value:{getStyles:R,orientation:S,iconPosition:b},children:s.jsxs(q,{...R("root"),ref:t,size:x,..._,children:[s.jsx(q,{...R("steps"),mod:{orientation:S,"icon-position":b,wrap:T&&S!=="vertical"},children:N}),k&&s.jsx("div",{...R("content"),children:k})]})})});Ja.classes=sx;Ja.displayName="@mantine/core/Stepper";Ja.Completed=sf;Ja.Step=ax;const gP=p.createContext(null),EL=gP.Provider,TL=()=>p.useContext(gP),PL={},lx=X((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=H("SwitchGroup",PL,e),[d,f]=yn({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(EL,{value:{value:d,onChange:h,size:i},children:s.jsx(Lt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(ky,{role:"group",children:l})})})});lx.classes=Lt.Wrapper.classes;lx.displayName="@mantine/core/SwitchGroup";var vP={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const kL={labelPosition:"right"},RL=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:lt(t),"--switch-height":Ae(r,"switch-height"),"--switch-width":Ae(r,"switch-width"),"--switch-thumb-size":Ae(r,"switch-thumb-size"),"--switch-label-font-size":Ae(r,"switch-label-font-size"),"--switch-track-label-padding":Ae(r,"switch-track-label-padding"),"--switch-color":n?at(n,e):void 0}}),ru=X((e,t)=>{const n=H("Switch",kL,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:w,children:y,thumbIcon:S,checked:b,defaultChecked:x,onChange:C,labelPosition:j,description:T,error:E,disabled:_,variant:R,rootRef:A,mod:L,...U}=n,N=TL(),F=g||(N==null?void 0:N.size),D=ce({name:"Switch",props:n,classes:vP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:RL}),{styleProps:k,rest:P}=Qo(U),$=Un(m),O=N?{checked:N.value.includes(P.value),onChange:N.onChange}:{},[V,K]=yn({value:O.checked??b,defaultValue:x,finalValue:!1});return s.jsxs(rh,{...D("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:F,labelPosition:j,label:d,description:T,error:E,disabled:_,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:l,"data-checked":O.checked||void 0,variant:R,ref:A,mod:L,...k,...w,children:[s.jsx("input",{...P,disabled:_,checked:V,onChange:ie=>{var Re;N?(Re=O.onChange)==null||Re.call(O,ie):C==null||C(ie),K(ie.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...D("input")}),s.jsxs(q,{"aria-hidden":"true",mod:{error:E,"label-position":j},...D("track"),children:[s.jsx(q,{component:"span",mod:"reduce-motion",...D("thumb"),children:S}),s.jsx("span",{...D("trackLabel"),children:V?h:f})]})]})});ru.classes={...vP,...bT};ru.displayName="@mantine/core/Switch";ru.Group=lx;const[_L,DL]=Bn("Table component was not found in the tree");var ou={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 IL(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 Bs(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=X((o,i)=>{const a=H(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=a,h=DL();return s.jsx(q,{component:e,ref:i,...IL(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:a}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=ou,r}const cg=Bs("th",{columnBorder:!0}),yP=Bs("td",{columnBorder:!0}),jd=Bs("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),xP=Bs("thead",{stickyHeader:!0}),bP=Bs("tbody"),SP=Bs("tfoot"),wP=Bs("caption",{captionSide:!0});function cx({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(wP,{children:e.caption}),e.head&&s.jsx(xP,{children:s.jsx(jd,{children:e.head.map((t,n)=>s.jsx(cg,{children:t},n))})}),e.body&&s.jsx(bP,{children:e.body.map((t,n)=>s.jsx(jd,{children:t.map((r,o)=>s.jsx(yP,{children:r},o))},n))}),e.foot&&s.jsx(SP,{children:s.jsx(jd,{children:e.foot.map((t,n)=>s.jsx(cg,{children:t},n))})})]})}cx.displayName="@mantine/core/TableDataRenderer";const AL={type:"scrollarea"},NL=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":B(t),"--table-overflow":n==="native"?"auto":void 0}}),ux=X((e,t)=>{const n=H("TableScrollContainer",AL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=ce({name:"TableScrollContainer",classes:ou,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:NL,rootSelector:"scrollContainer"});return s.jsx(q,{component:f==="scrollarea"?Ir:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h,children:s.jsx("div",{...m("scrollContainerInner"),children:u})})});ux.classes=ou;ux.displayName="@mantine/core/TableScrollContainer";const ML={withRowBorders:!0,verticalSpacing:7},OL=(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":Jt(r),"--table-vertical-spacing":Jt(o),"--table-border-color":i?at(i,e):void 0,"--table-striped-color":c&&a?at(a,e):void 0,"--table-highlight-on-hover-color":u&&l?at(l,e):void 0,"--table-sticky-header-offset":f?B(d):void 0}}),de=X((e,t)=>{const n=H("Table",ML,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:w,withRowBorders:y,withTableBorder:S,borderColor:b,layout:x,variant:C,data:j,children:T,stickyHeader:E,stickyHeaderOffset:_,mod:R,...A}=n,L=ce({name:"Table",props:n,className:o,style:i,classes:ou,classNames:r,styles:a,unstyled:l,rootSelector:"table",vars:c,varsResolver:OL});return s.jsx(_L,{value:{getStyles:L,stickyHeader:E,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:w,withRowBorders:y,captionSide:f||"bottom"},children:s.jsx(q,{component:"table",variant:C,ref:t,mod:[{"data-with-table-border":S},R],...L("table"),...A,children:T||!!j&&s.jsx(cx,{data:j})})})});de.classes=ou;de.displayName="@mantine/core/Table";de.Td=yP;de.Th=cg;de.Tr=jd;de.Thead=xP;de.Tbody=bP;de.Tfoot=SP;de.Caption=wP;de.ScrollContainer=ux;de.DataRenderer=cx;const[LL,dx]=Bn("Tabs component was not found in the tree");var iu={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 $L={},fx=X((e,t)=>{const n=H("TabsList",$L,e),{children:r,className:o,grow:i,justify:a,classNames:l,styles:c,style:u,mod:d,...f}=n,h=dx();return s.jsx(q,{...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})});fx.classes=iu;fx.displayName="@mantine/core/TabsList";const FL={},hx=X((e,t)=>{const n=H("TabsPanel",FL,e),{children:r,className:o,value:i,classNames:a,styles:l,style:c,mod:u,...d}=n,f=dx(),h=f.value===i,m=f.keepMounted||n.keepMounted||h?r:null;return s.jsx(q,{...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})});hx.classes=iu;hx.displayName="@mantine/core/TabsPanel";const zL={},px=X((e,t)=>{const n=H("TabsTab",zL,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:w,...y}=n,S=At(),{dir:b}=Ns(),x=dx(),C=l===x.value,j=E=>{x.onChange(x.allowTabDeactivation&&l===x.value?null:l),c==null||c(E)},T={classNames:m,styles:g,props:n};return s.jsxs(bn,{...y,...x.getStyles("tab",{className:r,style:h,variant:x.variant,...T}),disabled:d,unstyled:x.unstyled,variant:x.variant,mod:[{active:C,disabled:d,orientation:x.orientation,inverted:x.inverted,placement:x.orientation==="vertical"&&x.placement},w],ref:t,role:"tab",id:x.getTabId(l),"aria-selected":C,tabIndex:C||x.value===null?0:-1,"aria-controls":x.getPanelId(l),onClick:j,__vars:{"--tabs-color":f?at(f,S):void 0},onKeyDown:Hw({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||"horizontal",dir:b,onKeyDown:u}),children:[a&&s.jsx("span",{...x.getStyles("tabSection",T),"data-position":"left",children:a}),o&&s.jsx("span",{...x.getStyles("tabLabel",T),children:o}),i&&s.jsx("span",{...x.getStyles("tabSection",T),"data-position":"right",children:i})]})});px.classes=iu;px.displayName="@mantine/core/TabsTab";const $b="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",BL={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},UL=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":lt(t),"--tabs-color":at(n,e),"--tabs-text-color":Is(r,e)?Go({color:n,theme:e,autoContrast:r}):void 0}}),et=X((e,t)=>{const n=H("Tabs",BL,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:w,keepMounted:y,classNames:S,styles:b,unstyled:x,className:C,style:j,vars:T,autoContrast:E,mod:_,...R}=n,A=Un(u),[L,U]=yn({value:o,defaultValue:r,finalValue:null,onChange:i}),N=ce({name:"Tabs",props:n,classes:iu,className:C,style:j,classNames:S,styles:b,unstyled:x,vars:T,varsResolver:UL});return s.jsx(LL,{value:{placement:w,value:L,orientation:a,id:A,loop:c,activateTabWithKeyboard:d,getTabId:I0(`${A}-tab`,$b),getPanelId:I0(`${A}-panel`,$b),onChange:U,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,keepMounted:y,unstyled:x,getStyles:N},children:s.jsx(q,{ref:t,id:A,variant:h,mod:[{orientation:a,inverted:a==="horizontal"&&v,placement:a==="vertical"&&w},_],...N("root"),...R,children:l})})});et.classes=iu;et.displayName="@mantine/core/Tabs";et.Tab=px;et.Panel=hx;et.List=fx;const VL={},ve=X((e,t)=>{const n=H("TextInput",VL,e);return s.jsx(tr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ve.classes=tr.classes;ve.displayName="@mantine/core/TextInput";var jP={root:"m_7341320d"};const HL={},WL=(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":Ae(t,"ti-size"),"--ti-radius":n===void 0?void 0:lt(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}}},mx=X((e,t)=>{const n=H("ThemeIcon",HL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,autoContrast:u,...d}=n,f=ce({name:"ThemeIcon",classes:jP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:WL});return s.jsx(q,{ref:t,...f("root"),...d})});mx.classes=jP;mx.displayName="@mantine/core/ThemeIcon";const qL=["h1","h2","h3","h4","h5","h6"];function GL(e,t){const n=t!==void 0?t:`h${e}`;return qL.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:B(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var CP={root:"m_8a5d1357"};const QL={order:1},KL=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=GL(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}}},ge=X((e,t)=>{const n=H("Title",QL,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,w=ce({name:"Title",props:n,classes:CP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:KL});return[1,2,3,4,5,6].includes(c)?s.jsx(q,{...w("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...v}):null});ge.classes=CP;ge.displayName="@mantine/core/Title";function YL(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 XL(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const JL=()=>YL({notifications:[],queue:[],limit:5}),Us=JL(),ZL=(e=Us)=>XL(e);function hl(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 he(e,t=Us){const n=e.id||qg();return hl(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function EP(e,t=Us){return hl(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function Hl(e,t=Us){return hl(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function e$(e=Us){hl(e,()=>[])}function t$(e=Us){hl(e,t=>t.slice(0,e.getState().limit))}const vo={show:he,hide:EP,update:Hl,clean:e$,cleanQueue:t$,updateState:hl};function ug(e,t){return ug=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ug(e,t)}function TP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ug(e,t)}var PP={exports:{}},n$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",r$=n$,o$=r$;function kP(){}function RP(){}RP.resetWarningCache=kP;var i$=function(){function e(r,o,i,a,l,c){if(c!==o$){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:RP,resetWarningCache:kP};return n.PropTypes=n,n};PP.exports=i$();var s$=PP.exports;const gt=$g(s$),Fb={disabled:!1},af=un.createContext(null);var a$=function(t){return t.scrollTop},Wl="unmounted",es="exited",ts="entering",ha="entered",dg="exiting",ei=function(e){TP(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=es,i.appearStatus=ts):c=ha:r.unmountOnExit||r.mountOnEnter?c=Wl:c=es,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Wl?{status:es}: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!==ts&&a!==ha&&(i=ts):(a===ts||a===ha)&&(i=dg)}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===ts){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Ta.findDOMNode(this);a&&a$(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===es&&this.setState({status:Wl})},n.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[Ta.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!a||Fb.disabled){this.safeSetState({status:ha},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ts},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:ha},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:Ta.findDOMNode(this);if(!i||Fb.disabled){this.safeSetState({status:es},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:dg},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:es},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:Ta.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===Wl)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=$y(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return un.createElement(af.Provider,{value:null},typeof a=="function"?a(o,l):un.cloneElement(un.Children.only(a),l))},t}(un.Component);ei.contextType=af;ei.propTypes={};function aa(){}ei.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:aa,onEntering:aa,onEntered:aa,onExit:aa,onExiting:aa,onExited:aa};ei.UNMOUNTED=Wl;ei.EXITED=es;ei.ENTERING=ts;ei.ENTERED=ha;ei.EXITING=dg;function l$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function gx(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 c$(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 us(e,t,n){return n[t]!=null?n[t]:e.props[t]}function u$(e,t){return gx(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:us(n,"appear",e),enter:us(n,"enter",e),exit:us(n,"exit",e)})})}function d$(e,t,n){var r=gx(e.children),o=c$(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:us(a,"exit",e),enter:us(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:us(a,"exit",e),enter:us(a,"enter",e)}))}}),o}var f$=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},h$={component:"div",childFactory:function(t){return t}},vx=function(e){TP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(l$(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?u$(o,l):d$(o,a,l),firstRender:!1}},n.handleExited=function(o,i){var a=gx(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=of({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=$y(o,["component","childFactory"]),c=this.state.contextValue,u=f$(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?un.createElement(af.Provider,{value:c},u):un.createElement(af.Provider,{value:c},un.createElement(i,l,u))},t}(un.Component);vx.propTypes={};vx.defaultProps=h$;const zb={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},p$={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function m$({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:zb[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:p$[a]},u={opacity:0,maxHeight:0,transform:zb[a]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function g$(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const _P=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:a,...l}=e,c=g$(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(Yy,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h,children:a})});_P.displayName="@mantine/notifications/NotificationContainer";var DP={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const v$=ei,y$={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:eo("overlay"),store:Us,withinPortal:!0},x$=(e,{zIndex:t,position:n,containerWidth:r})=>{const[o,i]=n.split("-");return{root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-top":o==="top"?"var(--mantine-spacing-md)":void 0,"--notifications-bottom":o==="bottom"?"var(--mantine-spacing-md)":void 0,"--notifications-left":i==="left"?"var(--mantine-spacing-md)":i==="center"?"50%":void 0,"--notifications-right":i==="right"?"var(--mantine-spacing-md)":void 0,"--notifications-transform":i==="center"?"translateX(-50%)":void 0,"--notifications-container-width":B(r)}}},ti=X((e,t)=>{const n=H("Notifications",y$,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:w,portalProps:y,withinPortal:S,...b}=n,x=At(),C=ZL(w),j=tD(),T=Gg(),E=p.useRef({}),_=p.useRef(0),A=(x.respectReducedMotion?T:!1)?1:f,L=ce({name:"Notifications",classes:DP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:x$});p.useEffect(()=>{w==null||w.updateState(N=>({...N,limit:g||5}))},[g]),Mo(()=>{C.notifications.length>_.current&&setTimeout(()=>j(),0),_.current=C.notifications.length},[C.notifications]);const U=C.notifications.map(({style:N,...F})=>s.jsx(v$,{timeout:A,onEnter:()=>E.current[F.id].offsetHeight,nodeRef:{current:E.current[F.id]},children:D=>s.jsx(_P,{ref:k=>{E.current[F.id]=k},data:F,onHide:k=>EP(k,w),autoClose:d,...L("notification",{style:{...m$({state:D,position:u,transitionDuration:A,maxHeight:m}),...N}})})},F.id));return s.jsx(Ls,{withinPortal:S,...y,children:s.jsx(q,{...L("root"),ref:t,...b,children:s.jsx(vx,{children:U})})})});ti.classes=DP;ti.displayName="@mantine/notifications/Notifications";ti.show=vo.show;ti.hide=vo.hide;ti.update=vo.update;ti.clean=vo.clean;ti.cleanQueue=vo.cleanQueue;ti.updateState=vo.updateState;class b${constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class su{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class S${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 w$(t,this.prefixParselets,this.infixParselets)}}class w${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 j$="http://hl7.org",IP="ok",C$="created",E$="gone",T$="not-modified",P$="not-found",k$="forbidden",R$="accepted",_$={resourceType:"OperationOutcome",id:IP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},D$={resourceType:"OperationOutcome",id:P$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},AP={resourceType:"OperationOutcome",id:k$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Pi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function _t(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function I$(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Ch(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function NP(e){return e.id===IP||e.id===C$||e.id===T$||e.id===R$}function A$(e){return e.id===E$}class qe extends Error{constructor(t,n){super(MP(t)),this.outcome=t,this.cause=n}}function ht(e){return e instanceof qe?e.outcome:Ch(e)?e:Pi(De(e))}function De(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Ch(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(OP))??[];return t.length>0?t.join("; "):"Unknown error"}function OP(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 N$(e,t){const n=t.max&&t.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:t.max;return{path:e,description:"",type:t.type??[],min:t.min??0,max:n??1,isArray:!!n&&n>1,constraints:[]}}function M$(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,i])=>[o,N$(o,i)])),constraints:[],innerTypes:[]};return t}const O$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},L$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},$$={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"}]}}},F$={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"}]}}},z$={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"}]}}},B$={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"}]}}},U$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},V$={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"}]}}},H$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},W$={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"}]}}},q$={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"}]}}},G$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Q$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},K$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Y$={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"]}]}}},X$={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"}]}}},J$={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"}]}}},Z$={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"}]}}},e7={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"}]}}},t7={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"}]}}},n7={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"]}]}}},r7={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"}]}}},o7={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"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},i7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},s7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},a7={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"]}]}}},l7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},c7={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"}]}}},u7={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"}]}}},d7={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"}]}}},f7={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"}]}}},h7={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"]}]}}},p7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},m7={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"}]}}},g7={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"]}]}}},v7={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"}]}}},y7={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"}]}}},x7={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"}]}}},b7={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"}]}}},S7={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"}]}}},w7={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"]}]}}},j7={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"}]}}},C7={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"}]}}},E7={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"}]}}},T7={Element:O$,BackboneElement:L$,Address:$$,Age:F$,Annotation:z$,Attachment:B$,CodeableConcept:U$,Coding:V$,ContactDetail:H$,ContactPoint:W$,Contributor:q$,Count:G$,DataRequirement:Q$,Distance:K$,Dosage:Y$,Duration:X$,ElementDefinition:J$,Expression:Z$,Extension:e7,HumanName:t7,Identifier:n7,MarketingStatus:r7,Meta:o7,Money:i7,Narrative:s7,ParameterDefinition:a7,Period:l7,Population:c7,ProdCharacteristic:u7,ProductShelfLife:d7,Quantity:f7,Range:h7,Ratio:p7,Reference:m7,RelatedArtifact:g7,SampledData:v7,Signature:y7,SubstanceAmount:x7,Timing:b7,TriggerDefinition:S7,UsageContext:w7,MoneyQuantity:j7,SimpleQuantity:C7,IdentityProvider:E7};function P7(e){return new k7(e).parse()}const LP=M$(T7),yx=Object.create(null),Bb=Object.create(null);function fg(e){let t;return e?(t=Bb[e],t||(t=Bb[e]=Object.create(null))):t=LP,t}function Ub(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)$P(o,t)}function $P(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=P7(e),r=fg(t);r[e.name]=n,t&&e.url===t&&(yx[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function FP(e){return!!LP[e]}function Eh(e,t){let n=fg(t)[e];return!n&&t&&(n=fg()[e]),n}function zP(e,t){const n=Eh(e,t);if(!n)throw new qe(Pi("Unknown data type: "+e));return n}function xx(e){return!!yx[e]}function Vs(e){return yx[e]}class k7{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:D7(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=zp(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[zp(t,c.path)]=l;break}c=c.parent}if(!c){const u=zp(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&&!la((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:Xb(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:la((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;_7(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&&!la(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&&!la(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0;this.slicingContext&&!la(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!!(la(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=Xb(t)),r||(r=(o=pl(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=Vb(t.max),r=(i=t.base)!=null&&i.max?Vb(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:Hb(vn(o,"fixed[x]")),pattern:Hb(vn(o,"pattern[x]")),binding:t.binding}}}function Vb(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function zp(e,t=""){return R7(e.path,t)}function R7(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function la(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function Hb(e){return Array.isArray(e)&&e.length>0?e[0]:Gt(e)?void 0:e}function _7(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 D7(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 I7(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?A7:vn,[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 A7(e,t,n){const r=e.path;return N7(vn(e,t,n),r,t)}function N7(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 BP={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 M7(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 wx(e,o.pattern);if(o.fixed)return Ai(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 Ce(e){return[{type:W.boolean,value:e}]}function bo(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:W.integer,value:e}:typeof e=="number"?{type:W.decimal,value:e}:typeof e=="boolean"?{type:W.boolean,value:e}:typeof e=="string"?{type:W.string,value:e}:Tr(e)?{type:W.Quantity,value:e}:ni(e)?{type:e.resourceType,value:e}:{type:W.BackboneElement,value:e}}function Do(e){return e.length===0?!1:!!e[0].value}function Vo(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 vn(e,t,n){if(!e.value)return;const r=Ws(e.type,t,n==null?void 0:n.profileUrl);return r?UP(e,t,r):O7(e,t)}function UP(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+nn(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]=Qb(i[c],l[c])}else i=Qb(i,l);if(!Gt(i))return(a==="Element"||a==="BackboneElement")&&(a=n.type[0].code),Array.isArray(i)?i.map(c=>Wb(c,a)):Wb(i,a)}function Wb(e,t){return t==="Resource"&&ni(e)&&(t=e.resourceType),{type:t,value:e}}function O7(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n)r=n[t];else for(const o in W){const i=t+nn(o);if(i in n){r=n[i];break}}if(!Gt(r))return Array.isArray(r)?r.map(bo):bo(r)}function VP(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Do(bx(n,o))){r=!0;break}r||t.push(n)}return t}function L7(e){return Ce(!Do(e))}function $7(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ce(!1):Ce(e.every((n,r)=>Do(bx(n,t[r]))))}function F7(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ce(!0):Ce(e.some((n,r)=>!Do(bx(n,t[r]))))}function bx(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"?Ce(Math.abs(n-r)<1e-8):Tr(n)&&Tr(r)?Ce(qP(n,r)):Ce(typeof n=="object"&&typeof r=="object"?Sx(e,t):n===r)}function HP(e,t){return e.length===0&&t.length===0?Ce(!0):e.length!==t.length?Ce(!1):(e.sort(qb),t.sort(qb),Ce(e.every((n,r)=>Do(z7(n,t[r])))))}function z7(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"?Ce(Math.abs(a-l)<.01):Tr(a)&&Tr(l)?Ce(qP(a,l)):Ce(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"?Sx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function qb(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 WP(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 B7(n);case"DateTime":return hg(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return U7(n);case"Quantity":return Tr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function B7(e){return typeof e=="string"&&!!BP.date.exec(e)}function hg(e){return typeof e=="string"&&!!BP.dateTime.exec(e)}function U7(e){return!!(e&&typeof e=="object"&&("start"in e&&hg(e.start)||"end"in e&&hg(e.end)))}function Tr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function qP(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 Sx(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(Gb(i)&&Gb(a)){if(!Sx(i,a))return!1}else if(i!==a)return!1}return!0}function Gb(e){return e!==null&&typeof e=="object"}function Qb(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return V7(e??{},t)}return e}function V7(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Et(e){const t=st(e),n=Ho(e);return n===t?{reference:t}:{reference:t,display:n}}function st(e){return qs(e)?e.reference:`${e.resourceType}/${e.id}`}function au(e){if(e)return qs(e)?e.reference.split("/")[1]:e.id}function H7(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Ho(e){if(H7(e)){const t=W7(e);if(t)return t}if(e.resourceType==="Device"){const t=q7(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Ni(e.medicationCodeableConcept);if(e.resourceType==="Subscription"&&e.criteria)return e.criteria;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]),n6(t))return Ni(t);if(r6(t))return t.text}return st(e)}function W7(e){const t=e.name;if(t&&t.length>0)return lu(t[0])}function q7(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function G7(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=Kb(n);if(r)return r}else return Kb(t)}function Kb(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function GP(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 Q7(e,t){const{years:n,months:r,days:o}=GP(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 pl(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 pr(e,t){return JSON.stringify(e,K7,t?2:void 0)}function K7(e,t){return!Y7(e)&&Gt(t)?void 0:t}function Y7(e){return!!/\d+$/.exec(e)}function Gt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Bt(e):!1}function Bt(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 Ai(e,t,n){return e===t||Gt(e)&&Gt(t)?!0:Gt(e)||Gt(t)?!1:Array.isArray(e)&&Array.isArray(t)?X7(e,t):Array.isArray(e)||Array.isArray(t)?!1:kn(e)&&kn(t)?J7(e,t,n):(kn(e)||kn(t),!1)}function X7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ai(e[n],t[n]))return!1;return!0}function J7(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(!Ai(i,a,o))return!1}return!0}function wx(e,t){return Gt(e)?!0:Gt(t)?!1:Array.isArray(e)&&Array.isArray(t)?Z7(e,t):Array.isArray(e)||Array.isArray(t)?!1:kn(e)&&kn(t)?e6(e,t):kn(e)||kn(t)?!1:e===t}function Z7(e,t){return t.every(n=>e.some(r=>wx(r,n)))}function e6(e,t){return Object.entries(t).every(([n,r])=>n in e&&wx(e[n],r))}function Xr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function QP(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function kn(e){return e!==null&&typeof e=="object"}function t6(e){return kn(e)&&"code"in e&&typeof e.code=="string"}function n6(e){return kn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(t6)}function r6(e){return kn(e)&&"text"in e&&typeof e.text=="string"}const KP=[];for(let e=0;e<256;e++)KP.push(e.toString(16).padStart(2,"0"));function o6(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=KP[t[r]];return n.join("")}function i6(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 nn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function jx(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function kc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function s6(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 a6(e){if(e)return Array.isArray(e)?e:[e]}const Yb=e=>new Promise(t=>{setTimeout(t,e)});function pg(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 l6(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Ml(e,t){return e?(e.push(t),e):[t]}function Rc(e){return e.sort((t,n)=>t.localeCompare(n))}function YP(e){return e.endsWith("/")?e:e+"/"}function c6(e){return e.startsWith("/")?e.slice(1):e}function Eo(e,t){return new URL(c6(t),YP(e.toString())).toString()}function u6(e,t){return Eo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function d6(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 XP(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 f6(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 h6(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 lu(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=Dc(e.text);if(r)return r}return n.join(" ").trim()}function Th(e){return e instanceof Date&&!isNaN(e.getTime())}function p6(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Th(r)?r.toLocaleTimeString(t,n):""}function Fn(e,t,n){if(!e)return"";const r=new Date(e);return Th(r)?r.toLocaleString(t,n):""}function m6(e,t,n){return!e||!e.start&&!e.end?"":Fn(e.start,t,n)+" - "+Fn(e.end,t,n)}const g6={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},v6={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},y6={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function JP(e){if(!e)return"";const t=[];return x6(t,e.repeat),e.event&&t.push(e.event.map(n=>Fn(n)).join(", ")),nn(t.join(" ").trim())}function x6(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(g6[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+v6[o]):e.push("per "+r+" "+y6[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(nn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>p6(i)).join(", "))}function _c(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=w6(r.value,t),`> ${di(r)}`):`>= ${di(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=S6(o.value,t),`< ${di(o)}`):`<= ${di(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${di(r)} - ${di(o)}`)}function di(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 b6(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Ni(e){if(!e)return"";const t=Dc(e.text);return t||(e.coding?e.coding.map(n=>Hs(n)).join(", "):"")}function Hs(e){return Dc(e==null?void 0:e.display)??Dc(e==null?void 0:e.code)??""}function ZP(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(di(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Ni(e.valueCodeableConcept));else{const n=Dc(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>ZP(n)).join(" / ")),t.join(" / ").trim()}function Dc(e){return typeof e=="string"?e:void 0}function S6(e,t,n=1){return(ek(e)+n)*Math.pow(10,-t)}function w6(e,t,n=1){return(ek(e)-n)*Math.pow(10,-t)}function ek(e,t){return e}const W={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function j6(e){for(const t of e.base??[]){let n=So.types[t];n||(n={searchParamsDetails:{}},So.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 Xb(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"?C6((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function C6(e){return e.length===1?e[0]:e.map(nn).join("")}function Cx(e){var t;return(t=So.types[e])==null?void 0:t.searchParams}function E6(e,t){var n,r;return(r=(n=So.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Ts(e){const t=e.replaceAll("[x]","").split(".").pop();return tk(t)}function tk(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(P6).join(" ").replace("_"," ").replace(/\s+/g," ")}const T6=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function P6(e){const t=e.toUpperCase();return e===t?e:T6.has(t)?t:t.charAt(0)+e.slice(1)}function Ws(e,t,n){const r=Eh(e,n);if(r)return k6(r.elements,t)}function k6(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 ni(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function qs(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const So={types:{}};function Cd(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 jo=()=>[],Hn={empty:(e,t)=>Ce(t.length===0||t.every(n=>Gt(n.value))),hasValue:(e,t)=>Ce(t.length!==0),exists:(e,t,n)=>Ce(n?t.filter(r=>Do(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Gt(r.value))),all:(e,t,n)=>Ce(t.every(r=>Do(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ce(!1);return Ce(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ce(!0);return Ce(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ce(!1);return Ce(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ce(!0);return Ce(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ce(!0);const r=n.eval(e,Yi(e));return r.length===0?Ce(!1):Ce(t.every(o=>r.some(i=>i.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Yi(e));return r.length===0?Ce(!0):t.length===0?Ce(!1):Ce(r.every(o=>t.some(i=>i.value===o.value)))},count:(e,t)=>[{type:W.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Ce(t.length===Hn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Do(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:jo,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,Yi(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,Yi(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,Yi(e));return VP([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Yi(e));return[...t,...r]},htmlChecks:(e,t,n)=>[bo(!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 Do(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);if(typeof n=="boolean")return[{type:W.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ce(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ce(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ce(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ce(Hn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);return typeof n=="number"?[{type:W.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:W.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:W.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Ce(Hn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.date,value:Cd(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ce(Hn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.dateTime,value:Cd(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ce(Hn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);return typeof n=="number"?[{type:W.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:W.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:W.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Ce(Hn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);return Tr(n)?[{type:W.Quantity,value:n}]:typeof n=="number"?[{type:W.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:W.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:W.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Ce(Hn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);return n==null?[]:Tr(n)?[{type:W.string,value:`${n.value} '${n.unit}'`}]:[{type:W.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ce(Hn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=uo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:W.time,value:Cd("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ce(Hn.toTime(e,t).length===1),indexOf:(e,t,n)=>xr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>xr((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)=>xr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>xr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>xr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>xr(n=>n.toUpperCase(),e,t),lower:(e,t)=>xr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>xr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),matches:(e,t,n)=>xr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>xr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),length:(e,t)=>xr(n=>n.length,e,t),toChars:(e,t)=>xr(n=>n?n.split(""):void 0,e,t),encode:jo,decode:jo,escape:jo,unescape:jo,trim:jo,split:jo,join:(e,t,n)=>{var o;const r=((o=n==null?void 0:n.eval(e,Yi(e))[0])==null?void 0:o.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:W.string,value:t.map(i=>{var a;return((a=i.value)==null?void 0:a.toString())??""}).join(r)}]},abs:(e,t)=>ao(Math.abs,e,t),ceiling:(e,t)=>ao(Math.ceil,e,t),exp:(e,t)=>ao(Math.exp,e,t),floor:(e,t)=>ao(Math.floor,e,t),ln:(e,t)=>ao(Math.log,e,t),log:(e,t,n)=>ao((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>ao(Math.pow,e,t,n),round:(e,t)=>ao(Math.round,e,t),sqrt:(e,t)=>ao(Math.sqrt,e,t),truncate:(e,t)=>ao(n=>n|0,e,t),children:jo,descendants:jo,trace:(e,t,n)=>t,now:()=>[{type:W.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:W.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:W.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=Hn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=Hn.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=GP(i[0].value,a[0].value);return[{type:W.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof lf?r=n.name:n instanceof Tx&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:W.boolean,value:WP(o,r)})):[]},not:(e,t)=>Hn.toBoolean(e,t).map(n=>({type:W.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const i=r;if(i.resource)return bo(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:W.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:W.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:W.BackboneElement,value:{namespace:"System",name:"Integer"}}:ni(n)?{type:W.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:W.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var a;return{type:W.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:W.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let o="";return n instanceof lf&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:W.id,value:au(r)}]},extension:(e,t,n)=>{var i;const r=n.eval(e,t)[0].value,o=(i=t==null?void 0:t[0])==null?void 0:i.value;if(o){const a=pl(o,r);if(a)return[{type:W.Extension,value:a}]}return[]}};function xr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=uo(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(bo):[bo(i)]}function ao(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=uo(n,1),i=Tr(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?W.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function uo(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 Yi(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class R6{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}`,{cause:r})}}toString(){return this.child.toString()}}class ca{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class lf{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 ni(n)&&n.resourceType===this.name?t:vn(t,this.name)}toString(){return this.name}}class _6{eval(){return[]}toString(){return"{}"}}class D6 extends b${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 Ex extends su{constructor(t,n){super("as",t,n)}eval(t,n){return Hn.ofType(t,this.left.eval(t,n),this.right)}}class nr extends su{}class $r extends nr{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=Tr(i)?i.value:i,c=Tr(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?Ce(u):Tr(i)?[{type:W.Quantity,value:{...i,value:u}}]:[bo(u)]}}class I6 extends su{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:W.string,value:i.map(a=>a.value).join("")}]:i}}class A6 extends nr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Ce(r.some(i=>i.value===o[0].value))}}class N6 extends nr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ce(o.some(i=>i.value===r.value)):[]}}class Tx extends su{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 nk extends su{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return VP([...r,...o])}}class M6 extends nr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return $7(r,o)}}class O6 extends nr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return F7(r,o)}}class L6 extends nr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return HP(r,o)}}class $6 extends nr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return L7(HP(r,o))}}class Px extends nr{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 Ce(WP(r[0],o))}}class F6 extends nr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?Ce(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?Ce(!1):[]}}class z6 extends nr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?Ce(!1):r!=null&&r.value||o!=null&&o.value?Ce(!0):[]}}class B6 extends nr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return!r||!o?[]:Ce(r.value!==o.value)}}class U6 extends nr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Vo(this.left.eval(t,n),"boolean"),o=Vo(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?Ce(!0):!r||!o?[]:Ce(!1)}}class kx{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Hn[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 Rx{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 V6=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class H6{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;if(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())))),this.pos.index===t)throw new Error("Invalid DateTime literal");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()===" "&&W6(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 W6(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&V6.includes(e.value)))}const q6=["true","false"],G6=["!=","!~","<=",">=","{}","->"];function Q6(e){return new H6(e,q6,G6).tokenize()}const dt={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},K6={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}},Y6={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Rx(t,n)},precedence:dt.Indexer},X6={parse(e,t){if(!(t instanceof lf))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new kx(t.name,n)},precedence:dt.FunctionCall};function J6(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 Z6(){return new S$().registerPrefix("String",{parse:(e,t)=>new ca({type:W.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new ca({type:W.dateTime,value:Cd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new ca({type:W.Quantity,value:J6(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new ca({type:t.value.includes(".")?W.decimal:W.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new ca({type:W.boolean,value:!0})}).registerPrefix("false",{parse:()=>new ca({type:W.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new lf(t.value)}).registerPrefix("{}",{parse:()=>new _6}).registerPrefix("(",K6).registerInfix("[",Y6).registerInfix("(",X6).prefix("+",dt.UnaryAdd,(e,t)=>new D6("+",t,n=>n)).prefix("-",dt.UnarySubtract,(e,t)=>new $r("-",t,t,(n,r)=>-r)).infixLeft(".",dt.Dot,(e,t,n)=>new Tx(e,n)).infixLeft("/",dt.Divide,(e,t,n)=>new $r("/",e,n,(r,o)=>r/o)).infixLeft("*",dt.Multiply,(e,t,n)=>new $r("*",e,n,(r,o)=>r*o)).infixLeft("+",dt.Add,(e,t,n)=>new $r("+",e,n,(r,o)=>r+o)).infixLeft("-",dt.Subtract,(e,t,n)=>new $r("-",e,n,(r,o)=>r-o)).infixLeft("|",dt.Union,(e,t,n)=>new nk(e,n)).infixLeft("=",dt.Equals,(e,t,n)=>new M6(e,n)).infixLeft("!=",dt.NotEquals,(e,t,n)=>new O6(e,n)).infixLeft("~",dt.Equivalent,(e,t,n)=>new L6(e,n)).infixLeft("!~",dt.NotEquivalent,(e,t,n)=>new $6(e,n)).infixLeft("<",dt.LessThan,(e,t,n)=>new $r("<",e,n,(r,o)=>r<o)).infixLeft("<=",dt.LessThanOrEquals,(e,t,n)=>new $r("<=",e,n,(r,o)=>r<=o)).infixLeft(">",dt.GreaterThan,(e,t,n)=>new $r(">",e,n,(r,o)=>r>o)).infixLeft(">=",dt.GreaterThanOrEquals,(e,t,n)=>new $r(">=",e,n,(r,o)=>r>=o)).infixLeft("&",dt.Ampersand,(e,t,n)=>new I6(e,n)).infixLeft("and",dt.And,(e,t,n)=>new F6(e,n)).infixLeft("as",dt.As,(e,t,n)=>new Ex(e,n)).infixLeft("contains",dt.Contains,(e,t,n)=>new A6(e,n)).infixLeft("div",dt.Divide,(e,t,n)=>new $r("div",e,n,(r,o)=>r/o|0)).infixLeft("in",dt.In,(e,t,n)=>new N6(e,n)).infixLeft("is",dt.Is,(e,t,n)=>new Px(e,n)).infixLeft("mod",dt.Modulo,(e,t,n)=>new $r("mod",e,n,(r,o)=>r%o)).infixLeft("or",dt.Or,(e,t,n)=>new z6(e,n)).infixLeft("xor",dt.Xor,(e,t,n)=>new B6(e,n)).infixLeft("implies",dt.Implies,(e,t,n)=>new U6(e,n))}const eF=Z6();function rk(e){return new R6(e,eF.construct(Q6(e)).consumeAndParse())}function ml(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]=bo(n[r]))}return Ic(e,n).map(r=>r.value)}function Ic(e,t,n={}){return rk(e).eval({variables:n},t).map(o=>{var i;return{type:o.type,value:(i=o.value)==null?void 0:i.valueOf()}})}var ko=(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))(ko||{});function gl(e,t){var r,o;let n=(o=(r=So.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=nF(e,t)),n}function tF(e,t,n){let r=So.types[e];r||(r={},So.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function nF(e,t){const n=t.code,r=iF(n),o=aF(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=nc(l),u=l6(()=>c.join("."));c.length===1&&c[0]instanceof nr?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):ok(i,nc(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const a={columnName:r,type:sF(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return tF(e,n,a),a}function ok(e,t,n,r){const o=t[r];if(o instanceof Ex){e.propertyTypes.add(o.right.toString());return}if(o instanceof kx){rF(e,o);return}const i=o.toString(),a=Ws(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 Rx&&(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;oF(d)&&(d=a.type[0].code),ok(e,t,d,c)}}function rF(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 Px){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function oF(e){return e==="Element"||e==="BackboneElement"}function iF(e){return e.split("-").reduce((t,n,r)=>t+(r?nn(n):n),"")}function sF(e,t){switch(e.type){case"date":return t.size===1&&t.has(W.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(W.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(W.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function aF(e,t){const n=[],r=rk(t);return mg(e,r.child,n),n}function mg(e,t,n){t instanceof nk?(mg(e,t.left,n),mg(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function nc(e){if(e instanceof Ex||e instanceof Rx)return[nc(e.left),e].flat();if(e instanceof nr)return[e];if(e instanceof Tx)return[nc(e.left),nc(e.right)].flat();if(e instanceof kx){if(e.name==="where"&&!(e.args[0]instanceof Px))return[];if(e.name==="last")return[]}return[e]}const Ph=20;var re=(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))(re||{});const ik={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"},_x={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function sk(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()),lF(o,i)}function lF(e,t){const n={resourceType:e};for(const[r,o]of t)cF(n,r,o);return n}function cF(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=Ml(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":uF(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=Jb(n);o==="iterate"&&(c.modifier="iterate"),e.include=Ml(e.include,c);break}case"_revinclude":{const c=Jb(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=Ml(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=So.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[r];c?e.filters=Ml(e.filters,dF(c,o,n)):e.filters=Ml(e.filters,pF(r,o,n))}}}}function uF(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 dF(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return fF(e,n);case"reference":case"string":case"token":case"uri":return hF(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function fF(e,t){const{operator:n,value:r}=mF(t);return{code:e.code,operator:n,value:r}}function hF(e,t,n){return{code:e.code,operator:gF(t),value:n}}function pF(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 _x&&(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 mF(e){const t=e.substring(0,2),n=_x[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function gF(e){return ik[e]??"eq"}function Jb(e){const t=e.split(":");if(t.includes("*"))throw new qe(Pi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new qe(Pi(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new qe(Pi(`Invalid include value '${e}'`))}function Pa(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(vF(n))),e.sortRules&&e.sortRules.length>0&&t.push(yF(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(Zb("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(Zb("_revinclude",n))),t.length===0?"":(Rc(t),"?"+t.join("&"))}function vF(e){const t=e.operator in ik?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in _x?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function yF(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function Zb(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Dx(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 xF(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!bF(e,t,n))return!1}return!0}function bF(e,t,n){var o,i;const r=(i=(o=So.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:i[n.code];if(!r)return!1;if(n.operator===re.MISSING||n.operator===re.PRESENT)return SF(e,n,r);switch(r.type){case"reference":return wF(e,n,r);case"string":case"uri":return ak(e,n,r);case"token":return jF(e,n,r);case"date":return PF(e,n,r);default:return!1}}function SF(e,t,n){const o=ml(n.expression,e).length>0;return(t.operator===re.MISSING&&t.value==="false"||t.operator===re.PRESENT&&t.value==="true")===o}function wF(e,t,n){const r=ml(n.expression,e),o=kh(t.operator);if(t.value===""&&r.length===0)return t.operator===re.EQUALS;const i=r.map(a=>typeof a=="string"?a:a.reference);for(const a of Dx(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 jF(e,t,n){return gl(e.resourceType,n).type===ko.BOOLEAN?CF(e,t,n):ak(e,t,n,!0)}function CF(e,t,n){const r=ml(n.expression,e),o=t.value==="true",i=r.includes(o);return kh(t.operator)?!i:i}function ak(e,t,n,r){var u,d,f,h;const i=(h=(f=(d=(u=gl(e.resourceType,n).elementDefinitions)==null?void 0:u[0])==null?void 0:d.type)==null?void 0:f[0])==null?void 0:h.code,a=ml(n.expression,e),l=Dx(t.value),c=kh(t.operator);for(const m of a)for(const g of l){let v;if(i===W.Identifier?v=EF(m,t.operator,g):i===W.CodeableConcept?v=TF(m,t.operator,g):v=gg(m,t.operator,g,r),v)return!c}return c}function gg(e,t,n,r){if(r&&n.includes("|")){const[i,a]=n.split("|");return gg(e,t,i,!1)&&(!a||gg(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 EF(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 TF(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 PF(e,t,n){const r=ml(n.expression,e),o=Dx(t.value),i=kh(t.operator);for(const a of r)for(const l of o)if(kF(a,t.operator,l))return!i;return i}function kF(e,t,n){switch(t){case re.STARTS_AFTER:case re.GREATER_THAN:return e>n;case re.GREATER_THAN_OR_EQUALS:return e>=n;case re.ENDS_BEFORE:case re.LESS_THAN:return e<n;case re.LESS_THAN_OR_EQUALS:return e<=n;case re.EQUALS:case re.NOT_EQUALS:return e===n;default:return!1}}function kh(e){return e===re.NOT_EQUALS||e===re.NOT}const RF={resourceType:"*"},_F=["DomainConfiguration","JsonWebKey","Login"],DF=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"];var Ix=(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))(Ix||{});const IF=["read","vread","history","history-instance"];function AF(e,t){if(_F.includes(t))return!1;if(e.resource){for(const n of e.resource)if(ck(n.resourceType,t)&&!n.readonly)return!0}return!1}function lk(e,t,n){if(!n)return RF;if(n.resource){for(const r of n.resource)if(NF(e,t,r))return r}}function NF(e,t,n){var o,i;const r=e.resourceType;return!(!ck(n.resourceType,r)||n.readonly&&!IF.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&&!xF(e,sk(n.criteria)))}function ck(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 OF(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 eS(){const e=new Uint32Array(28);return crypto.getRandomValues(e),o6(e.buffer)}async function LF(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function uk(){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 dk(e){var o,i,a;const t={};e=Xr(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]=uk(),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)=>$F(l,c,t),2);return FF(JSON.parse(r))}function $F(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 FF(e){const t=BF(e),{sorted:n,cycles:r}=zF(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 zF(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 fk(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(qs(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else fk(r,t)}}function BF(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&&fk(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class hk{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 on={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 UF{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 Rh{constructor(){this.emitter=new UF}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 vg={"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"},VF=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],Ax=["DiagnosticReport-update"];function HF(e){return Ax.includes(e)}function WF(e){if(Ax.includes(e))throw new qe(_t(`'context.version' is required for '${e}'.`))}const qF={"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 GF(e){return VF.includes(e)}function pk(e){return!!e.endpoint}function tS(e){if(!Nx(e))throw new qe(_t("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 pk(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function Nx(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(!vg[i])return!1;return!(pk(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function nS(e,t,n,r){if(typeof t!="object")throw new qe(_t(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new qe(_t(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new qe(_t(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!GF(t.resourceType))throw new qe(_t(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new qe(_t(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function QF(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)nS(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new qe(_t(`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)nS(e,a,n,r)}}function KF(e,t){const n=new Map,r=qF[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new qe(_t(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));QF(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new qe(_t(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new qe(_t(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function rS(e,t,n,r){if(!(e&&typeof e=="string"))throw new qe(_t("Must provide a topic."));if(!vg[t])throw new qe(_t(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(vg).join(", ")}`));if(typeof n!="object")throw new qe(_t("context must be a context object or array of context objects."));if(Ax.includes(t)&&!r)throw new qe(_t(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return KF(t,o),{timestamp:new Date().toISOString(),id:uk(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class YF extends Rh{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new qe(_t("Subscription request should contain an endpoint."));if(!Nx(t))throw new qe(_t("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 XF(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 JF(e){return e.split(".").length===3}function Mx(e){const[t,n,r]=e.split(".");return XF(n)}function ZF(e){try{return typeof Mx(e).login_id=="string"}catch{return!1}}function e8(e){try{const n=Mx(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class t8{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,on.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var mk;mk=Symbol.toStringTag;class Fr{constructor(t){this[mk]="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 n8{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new r8)}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?pr(n):void 0)}}class r8{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 o8 extends Rh{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 yg extends Rh{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 i8{constructor(t,n){this.criteria=t,this.emitter=new yg(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}}class s8{constructor(t,n,r){if(!(t instanceof gk))throw new qe(_t("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new qe(_t("Not a valid URL"))}const i=r!=null&&r.RobustWebSocket?new r.RobustWebSocket(o):new o8(o);this.medplum=t,this.ws=i,this.masterSubEmitter=new yg,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(au(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 d of this.getAllCriteriaEmitters())d.dispatchEvent(u)}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new qe(I$(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent(n)}),t.addEventListener("close",()=>{var r;const n={type:"close"};this.wsClosed&&((r=this.masterSubEmitter)==null||r.dispatchEvent(n));for(const o of this.getAllCriteriaEmitters())o.dispatchEvent(n)})}emitConnect(t){var r;const n={type:"connect",payload:{subscriptionId:t.subscriptionId}};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent(n)}emitError(t,n){var o;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),t.emitter.dispatchEvent(r)}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const o={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(o),t.emitter.dispatchEvent(o)}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var a,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${st(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).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 qe(_t("Failed to get token"));if(!i)throw new qe(_t("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(Ai(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){var l;const{criteria:n,subscriptionProps:r,subscriptionId:o,token:i}=t;if(!this.criteriaEntries.has(n))return;const a=this.criteriaEntries.get(n);r?a.criteriaWithProps=a.criteriaWithProps.filter(c=>{const u=c.subscriptionProps;return!Ai(r,u)}):a.bareCriteria=void 0,!a.bareCriteria&&a.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(l=this.masterSubEmitter)==null||l._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),i&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:i}}))}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const o=new i8(t,n);return this.addCriteriaEntry(o),this.getTokenForCriteria(o).then(([i,a])=>{o.subscriptionId=i,o.token=a,this.criteriaEntriesBySubscriptionId.set(i,o),this.emitConnect(o),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:a}}))}).catch(i=>{console.error(i.message),this.emitError(o,i),this.removeCriteriaEntry(o)}),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new yg(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const a8="3.2.5-30739a930",l8=on.FHIR_JSON+", */*; q=0.1",c8="https://api.medplum.com/",u8=1e3,d8=6e4,f8=0,h8="Binary/",oS={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class gk extends Rh{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)??p8(),this.storage=(t==null?void 0:t.storage)??new n8,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=YP((t==null?void 0:t.baseUrl)??c8),this.fhirBaseUrl=Eo(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Eo(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Eo(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Eo(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"?f8:d8),this.cacheTime>0?this.requestCache=new hk((t==null?void 0:t.resourceCacheSize)??u8):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.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),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=Eo(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 Fr(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,on.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(Eo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=d6(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 Fr((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 Fr(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 Fr(this.search(t,n,r).then(Bp));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 Bp(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 oS;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 Fr(Promise.reject(new Error("Missing reference")));if(r==="system")return new Fr(Promise.resolve(oS));const[o,i]=r.split("/");return!o||!i?new Fr(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(FP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Fr((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);Ub(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)j6(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&xx(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 Fr((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 Bp(l).map(c=>($P(c,c.url),c.url))}else{const a=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});return a?(Ub([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=aS(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=aS(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 qe(ht(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=v8(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=Et(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=Et(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Et(t)],encounter:i,subject:a,sender:o?Et(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}async patchResource(t,n,r,o){const i=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),i}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,on.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},on.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",au(t),"$push"),{destination:typeof n=="string"?n:st(n),body:r,contentType:o,waitForResponse:i},on.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=e8(t),this.medplumServer=ZF(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.dispatchEvent({type:"profileRefreshing"}),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"}),this.dispatchEvent({type:"profileRefreshed"}),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(h8)&&(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=Et(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 t8(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 Fr(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 qe(D$);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await sS(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await sS(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new qe(ht(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=Eo(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,o=200;for(let i=0;i<=r;i++){try{this.options.verbose&&this.logRequest(t,n);const a=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(a),a.status<500||i===r)return a}catch(a){if(a.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),a.name==="AbortError"||i===r)throw a}await Yb(o)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of Rc(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 Yb(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,Eo(this.fhirBaseUrl,a.url),a.options))}catch(l){a.reject(new qe(ht(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&&!NP(c.response.outcome)?l.reject(new qe(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",l8,!0),t.body&&this.setRequestHeader(t,"Content-Type",on.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=eS();sessionStorage.setItem("pkceState",t);const n=eS();sessionStorage.setItem("codeVerifier",n);const r=await LF(n),o=i6(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??iS()),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)??iS()),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=OF(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new qe(_t("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new qe(_t("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",tS(r),on.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!Nx(t))throw new qe(_t("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new qe(_t("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",tS(t),on.FORM_URL_ENCODED)}fhircastConnect(t){return new YF(t)}async fhircastPublish(t,n,r,o){return HF(n)?this.post(`/fhircast/STU3/${t}`,rS(t,n,r,o),on.JSON):(WF(n),this.post(`/fhircast/STU3/${t}`,rS(t,n,r),on.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":on.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 qe(Pi(a.error_description))}catch(a){throw new qe(Pi("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(JF(n)){const r=Mx(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{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new s8(this,u6(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t,n){return this.getSubscriptionManager().addCriteria(t,n)}unsubscribeFromCriteria(t,n){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t,n),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function p8(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function iS(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function sS(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(Ch(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function Bp(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function m8(e){return kn(e)&&"data"in e&&"contentType"in e}function aS(e,t,n,r){return m8(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function g8(e){return kn(e)&&"docDefinition"in e}function v8(e,t,n,r){return g8(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Za({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=y8(t,n,e,!!o);const l=pg(t,".",2)[1];a=x8(a,i,l),a=b8(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=pg(f,".",2)[1];if(h){if(!d[h]){const m=cf(h,i==null?void 0:i.hiddenFields);d[h]={hidden:m,readonly:m||cf(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 y8(e,t,n,r){const o=Object.create(null);if(n)for(const[a,l]of Object.entries(n.elementsByPath)){const c=kc(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 x8(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])=>!cf(r+i,t.hiddenFields)))}function b8(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))cf(o+a,t.readonlyFields)?r[a]={...l,readonly:!0}:r[a]=l;return r}function cf(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 vk(e){return e.type!==void 0&&e.type.length>0}function S8(e,t,n,r){var i;const o=I7(e,t.path,{profileUrl:r});if(o){const a=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>M7(l,t,n,a))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function yk(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 S8(l,c,a,((u=a.typeSchema)==null?void 0:u.url)??r)}))return a.name}}class w8{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Za({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(!Bt(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=j8(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);Bt((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(!vk(l))continue;const c=(a=(i=l.type.find(u=>Bt(u.profile)))==null?void 0:i.profile)==null?void 0:a[0];if(Bt(c)){const u=Vs(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;Bt(a)&&(i=Za({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 j8(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 Up="__sliceName";function C8(e,t){const n=new E8(e,e.resourceType,"resource");return new w8(t,n).crawlResource(),n.getDefaultValue()}function lS(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){uf(e,r,o,t);continue}const i=kc(n,r);i!==void 0&&uf(e,i,o,t)}return e}class E8{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Xr(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=kc(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){T8(d,a,n,r.elements),uf(d,a,n,r.elements);const f=bg(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=kc(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=bg(a,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];Bt(u)||l.splice(c,1)}Gt(l)&&xg(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[Up]??yk(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(jx(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];Up in o&&delete o[Up]}}getDefaultValue(){return this.rootValue}}function T8(e,t,n,r){const o=bg(e,t,n,r);n.min>0&&o===void 0&&jx(n.type[0].code)&&(n.isArray?xg(e,[Object.create(null)],t,n):xg(e,Object.create(null),t,n))}function xg(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]",nn(i))}t===void 0?delete e[o]:e[o]=t}function bg(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]",nn(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(kn(i)){if(i[c]===void 0)return;i=i[c]}else return}return a}function uf(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>uf(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]",nn(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]=xk(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 xk(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Xr(t);if(kn(t)&&(kn(e)&&!Array.isArray(e)||e===void 0)){const n=Xr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=xk(n[r],t[r]);return n}return e}const bk=p.createContext(void 0);function _h(){return p.useContext(bk)}function se(){return _h().medplum}function Dh(){return _h().navigate}function Ih(){return _h().profile}const cS=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function P8(e){const t=e.medplum,n=e.navigate??k8,[r,o]=p.useState({profile:t.getProfile(),loading:t.isLoading()});p.useEffect(()=>{function a(){o(l=>({...l,profile:t.getProfile(),loading:t.isLoading()}))}for(const l of cS)t.addEventListener(l,a);return()=>{for(const l of cS)t.removeEventListener(l,a)}},[t]);const i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(bk.Provider,{value:i,children:e.children})}function k8(e){window.location.assign(e)}const uS=new Map,Sk=e=>p.useMemo(()=>{if(!e)return;const 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;const r=n.get("Expires");if(!r||r.length>13)return e;const o=uS.get(t);if(o){const a=new URLSearchParams(new URL(o).search).get("Expires");if(a&&parseInt(a,10)*1e3-5e3>Date.now())return o}return uS.set(t,e),e},[e]);function St(e,t){const n=se(),[r,o]=p.useState(()=>dS(n,e)),i=p.useCallback(a=>{Ai(a,r)||o(a)},[r]);return p.useEffect(()=>{let a=!0;const l=dS(n,e);return!l&&qs(e)?n.readReference(e).then(c=>{a&&i(c)}).catch(c=>{a&&(i(void 0),t&&t(ht(c)))}):i(l),()=>a=!1},[n,e,i,t]),r}function dS(e,t){if(t){if(ni(t))return t;if(qs(t))return e.getCachedReference(t)}}function R8(e,t){return wk("searchOne",e,t)}function el(e,t){return wk("searchResources",e,t)}function wk(e,t,n){const r=se(),[o,i]=p.useState(),[a,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{const h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(m=>{l(!1),u(m),f(_$)}).catch(m=>{l(!1),u(void 0),f(ht(m))}))},[r,e,t,n,o]),[c,a,d]}function _8(e){const t=e.value;return t?s.jsx(s.Fragment,{children:h6(t)}):null}const jk=["meta","implicitRules","contained","extension","modifierExtension"],Ck=["language","text"],bt=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});bt.displayName="ElementsContext";const Ox=["extension","modifierExtension"],D8=["id",...jk].filter(e=>!Ox.includes(e));function I8(e){return Object.entries(e).filter(([n,r])=>{var o;return!Bt(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Ox.includes(n)&&!Bt((o=r.slicing)==null?void 0:o.slices)||D8.includes(n)?!1:!(Ck.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function fS(e,t){return e.line&&e.line.length>t?e.line[t]:""}function hS(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function A8(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(bt),[i,a,l,c,u,d,f]=p.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(x=>o(e.path+"."+x)),[o,e.path]);function h(x){n(x),e.onChange&&e.onChange(x)}function m(x){h({...r.current,use:x})}function g(x){h({...r.current,type:x})}function v(x){h(hS(r.current||{},0,x))}function w(x){h(hS(r.current||{},1,x))}function y(x){h({...r.current,city:x})}function S(x){h({...r.current,state:x})}function b(x){h({...r.current,postalCode:x})}return s.jsxs(te,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(It,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:x=>m(x.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(It,{disabled:e.disabled||(a==null?void 0:a.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:x=>g(x.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(ve,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Line 1",defaultValue:fS(t,0),onChange:x=>v(x.currentTarget.value)}),s.jsx(ve,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Line 2",defaultValue:fS(t,1),onChange:x=>w(x.currentTarget.value)}),s.jsx(ve,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"City",defaultValue:t.city,onChange:x=>y(x.currentTarget.value)}),s.jsx(ve,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"State",defaultValue:t.state,onChange:x=>S(x.currentTarget.value)}),s.jsx(ve,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:x=>b(x.currentTarget.value)})]})}function N8(e){const t=Ih(),[n,r]=p.useState(e.defaultValue||{});function o(i){const a=i?{text:i,authorReference:t&&Et(t),time:new Date().toISOString()}:{};r(a),e.onChange&&e.onChange(a)}return s.jsx(ve,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
133
|
+
* @license @tabler/icons-react v3.11.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 M8={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.11.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 be=(e,t,n,r)=>{const o=p.forwardRef(({color:i="currentColor",size:a=24,stroke:l=2,title:c,className:u,children:d,...f},h)=>p.createElement("svg",{ref:h,...M8[e],width:a,height:a,className:["tabler-icon",`tabler-icon-${t}`,u].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...f},[c&&p.createElement("title",{key:"svg-title"},c),...r.map(([m,g])=>p.createElement(m,g)),...Array.isArray(d)?d:[d]]));return o.displayName=`${n}`,o};/**
|
|
143
|
+
* @license @tabler/icons-react v3.11.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 O8=be("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.11.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 vl=be("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.11.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 L8=be("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.11.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 $8=be("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.11.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 F8=be("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.11.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 z8=be("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.11.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=be("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.11.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 U8=be("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.11.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 V8=be("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.11.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 H8=be("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.11.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 W8=be("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.11.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 q8=be("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.11.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 Xi=be("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.11.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 Gs=be("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
213
|
+
* @license @tabler/icons-react v3.11.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 G8=be("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.11.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 Lx=be("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
223
|
+
* @license @tabler/icons-react v3.11.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 df=be("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.11.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 ff=be("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.11.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 $x=be("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.11.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 Q8=be("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.11.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 Ek=be("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.11.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=be("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.11.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 Y8=be("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.11.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 X8=be("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.11.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 Tk=be("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.11.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 cu=be("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.11.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 uu=be("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
278
|
+
* @license @tabler/icons-react v3.11.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 pS=be("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.11.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 J8=be("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.11.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 Z8=be("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.11.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 ez=be("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.11.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 tz=be("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.11.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 mS=be("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.11.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 nz=be("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.11.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 rz=be("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.11.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 oz=be("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.11.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 Pk=be("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
328
|
+
* @license @tabler/icons-react v3.11.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 kk=be("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
333
|
+
* @license @tabler/icons-react v3.11.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 iz=be("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.11.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 sz=be("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.11.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 az=be("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.11.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 lz=be("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.11.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 cz=be("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.11.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 uz=be("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
363
|
+
* @license @tabler/icons-react v3.11.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 dz=be("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.11.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 fz=be("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.11.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 hz=be("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.11.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 pz=be("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
|
|
383
|
+
* @license @tabler/icons-react v3.11.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 mz=be("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"}]]);/**
|
|
388
|
+
* @license @tabler/icons-react v3.11.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 gz=be("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"}]]);/**
|
|
393
|
+
* @license @tabler/icons-react v3.11.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 vz=be("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"}]]);/**
|
|
398
|
+
* @license @tabler/icons-react v3.11.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 Sg=be("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"}]]);/**
|
|
403
|
+
* @license @tabler/icons-react v3.11.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 Fx=be("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"}]]);/**
|
|
408
|
+
* @license @tabler/icons-react v3.11.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 zx=be("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"}]]);/**
|
|
413
|
+
* @license @tabler/icons-react v3.11.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 yz=be("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"}]]);/**
|
|
418
|
+
* @license @tabler/icons-react v3.11.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 xz=be("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"}]]);/**
|
|
423
|
+
* @license @tabler/icons-react v3.11.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 bz=be("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"}]]);/**
|
|
428
|
+
* @license @tabler/icons-react v3.11.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 Sz=be("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"}]]);/**
|
|
433
|
+
* @license @tabler/icons-react v3.11.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 wz=be("outline","text-recognition","IconTextRecognition",[["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:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
|
|
438
|
+
* @license @tabler/icons-react v3.11.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 Bx=be("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"}]]);/**
|
|
443
|
+
* @license @tabler/icons-react v3.11.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 gS=be("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"}]]);/**
|
|
448
|
+
* @license @tabler/icons-react v3.11.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 jz=be("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"}]]);/**
|
|
453
|
+
* @license @tabler/icons-react v3.11.0 - MIT
|
|
454
|
+
*
|
|
455
|
+
* This source code is licensed under the MIT license.
|
|
456
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
457
|
+
*/var hf=be("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
458
|
+
* @license @tabler/icons-react v3.11.0 - MIT
|
|
459
|
+
*
|
|
460
|
+
* This source code is licensed under the MIT license.
|
|
461
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
462
|
+
*/var Cz=be("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 Rk 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(Bi,{icon:s.jsx(vl,{size:16}),title:"Something went wrong",color:"red",children:De(this.state.error)}):this.props.children}}function Jr(){return s.jsx(mn,{style:{width:"100%",height:"100vh"},children:s.jsx(Zn,{})})}const Ez="_main_g2hyx_1",Tz={main:Ez};function yt(e){e.preventDefault(),e.stopPropagation()}function _k(e){if(vS(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&vS(t[0]))return!0}return!1}function vS(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function Ge(e){const t=Dh(),{to:n,suffix:r,label:o,onClick:i,children:a,...l}=e;let c=Pz(n);return r&&(c+="/"+r),s.jsx(Ze,{href:c,"aria-label":o,onClick:u=>{yt(u),i?i(u):n&&t(c)},...l,children:a})}function Pz(e){if(e){if(typeof e=="string")return kz(e);if(ni(e))return Rz(e);if(qs(e))return _z(e)}return"#"}function kz(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Rz(e){return`/${e.resourceType}/${e.id}`}function _z(e){return`/${e.reference}`}function Dz(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 Vi(e){const t=St(e.value),n=t?Ho(t):e.alt??"",r=Dz(n),o=(t&&G7(t))??e.src,i=Sk(o??void 0),a=e.radius??"xl",l={...e,value:void 0,link:void 0};return e.link?s.jsx(Ge,{to:t,children:s.jsx(js,{src:i,alt:n,radius:a,...l,children:r})}):s.jsx(js,{src:i,alt:n,radius:a,...l,children:r})}const Iz="_logoButton_189g3_1",Az="_user_189g3_11",Nz="_userName_189g3_21",Mz="_userActive_189g3_31",td={logoButton:Iz,user:Az,userName:Nz,userActive:Mz};function Ux(e){const t=e.value;return t?s.jsx(s.Fragment,{children:lu(t,e.options)}):null}function Oz(e){var c,u,d;const t=_h(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:a,setColorScheme:l}=ZD();return s.jsxs(s.Fragment,{children:[s.jsxs(Oe,{align:"center",p:"xl",children:[s.jsx(Vi,{size:"xl",radius:100,value:t.profile}),s.jsx(Ux,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),s.jsx(fe,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&s.jsx(J.Divider,{}),i.map(f=>f.profile.reference!==st(t.profile)&&s.jsx(J.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(te,{children:[s.jsx(js,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(fe,{size:"sm",fw:500,children:f.profile.display}),s.jsx(fe,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),s.jsx(J.Divider,{}),s.jsx(te,{justify:"center",children:s.jsx(ox,{size:"xs",value:a,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(bz,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(J.Item,{leftSection:s.jsx(Sg,{size:14,stroke:1.5}),onClick:()=>o(`/${st(r)}`),children:"Account settings"}),s.jsx(J.Item,{leftSection:s.jsx(oz,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),s.jsx(fe,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const Lz={selectedItems:"selected-items"};function Vx(e){const t=Xc({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:w,maxValues:y,optionsDropdownMaxHeight:S=320,...b}=e,x=b.disabled,C=$z(a),[j,T]=p.useState(""),[E,_]=p.useState(),[R,A]=p.useState(),[L,U]=p.useState(),[N,F]=p.useState(C.map(l)),[D,k]=p.useState([]),P=u??Fz,$=p.useRef();$.current=j;const O=p.useRef(),V=p.useRef(),K=p.useRef();K.current=E;const ie=p.useRef();ie.current=R;const Re=p.useRef();Re.current=L;const ae=p.useRef();ae.current=D;const Ee=p.useCallback(()=>{if(_(void 0),$.current===V.current&&c===O.current)return;V.current=$.current,O.current=c;const Te=new AbortController;A(Te),c($.current??"",Te.signal).then(Pe=>{Te.signal.aborted||(k(Pe.map(l)),A(void 0),Re.current?(Pe.length>0&&d(Pe.slice(0,1)),U(!1)):Pe.length>0&&t.openDropdown())}).catch(Pe=>{Te.signal.aborted||Pe.message.includes("aborted")||he({color:"red",message:De(Pe)})})},[t,c,d,l]),Fe=p.useCallback(Te=>{(D&&D.length>0||h)&&t.openDropdown(),t.updateSelectedOptionIndex(),T(Te.currentTarget.value),ie.current&&(ie.current.abort(),A(void 0)),K.current!==void 0&&window.clearTimeout(K.current);const Pe=window.setTimeout(()=>Ee(),100);_(Pe)},[t,D,h,Ee]),me=p.useCallback(Te=>{const Pe=N.some(Z=>Z.value===Te),Xe=Pe?N.filter(Z=>Z.value!==Te):[...N];let Qe=D==null?void 0:D.find(Z=>Z.value===Te);if(!Qe&&h!==!1&&f){const Z=f(Te);Qe=l(Z)}if(Qe){if(y===0){d([Qe.resource]),N.length>0&&F([]);return}Pe||Xe.push(Qe)}if(y!==void 0)for(;Xe.length>y;)Xe.shift();d(Xe.map(Z=>Z.resource)),F(Xe)},[h,D,N,y,d,f,l]),Le=p.useMemo(()=>{if(!x)return Te=>{x||(y===1&&(T(""),k([]),t.closeDropdown()),V.current=void 0,me(Te==="$create"?j:Te))}},[me,t,x,y,j]),nt=p.useCallback(Te=>{const Pe=N.filter(Xe=>Xe.value!==Te.value);d(Pe.map(Xe=>Xe.resource)),F(Pe)},[N,d]),Tt=p.useCallback(Te=>{Te.key==="Enter"?(E||R)&&U(!0):Te.key==="Backspace"&&j.length===0&&(yt(Te),nt(N[N.length-1]))},[R,nt,j.length,N,E]);p.useEffect(()=>()=>{ie.current&&ie.current.abort()},[]);const Ve=!x&&m&&N.length>0&&s.jsx(Me.ClearButton,{title:"Clear all",size:16,onClear:()=>{T(""),F([]),d([]),t.closeDropdown()}});return s.jsxs(Me,{store:t,onOptionSubmit:Le,withinPortal:!0,shadow:"xl",...b,children:[s.jsx(Me.DropdownTarget,{children:s.jsx(Xa,{label:r,description:o,error:i,className:e.className,leftSection:w,rightSection:R?s.jsx(Zn,{size:16}):Ve,required:g,disabled:x,children:s.jsxs(Cs.Group,{"data-testid":Lz.selectedItems,children:[N.map(Te=>s.jsx(Cs,{withRemoveButton:!x,onRemove:()=>nt(Te),children:Te.label},Te.value)),!x&&(y===void 0||y===0||N.length<y)&&s.jsx(Me.EventsTarget,{children:s.jsx(Xa.Field,{role:"searchbox",name:n,value:j,placeholder:v,onFocus:Fe,onBlur:()=>{t.closeDropdown(),T("")},onKeyDown:Tt,onChange:Fe})})]})})}),s.jsx(Me.Dropdown,{children:s.jsx(Me.Options,{children:s.jsxs(Qf,{type:"scroll",mah:S,children:[D.map(Te=>{const Pe=N.some(Xe=>Xe.value===Te.value);return s.jsx(Me.Option,{value:Te.value,active:Pe,children:s.jsx(P,{...Te,active:Pe})},Te.value)}),h&&j.trim().length>0&&s.jsxs(Me.Option,{value:"$create",children:["+ Create ",j]}),!h&&j.trim().length>0&&D.length===0&&s.jsx(Me.Empty,{children:"Nothing found"})]})})})]})}function $z(e){return e?Array.isArray(e)?e:[e]:[]}function Fz(e){return s.jsxs(te,{gap:"xs",children:[e.active&&s.jsx(Gs,{size:12}),s.jsx("span",{children:e.label})]})}const zz="_searchInput_dick8_1",Bz={searchInput:zz};function Uz(e){return{value:e.id,label:Ho(e),resource:e}}function Vz(e){const t=Dh(),n=se(),r=p.useCallback(async(i,a)=>{const l=Wz(i),c={signal:a},u=await n.graphql(l,void 0,void 0,c);return qz(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${st(i[0])}`)},[t]);return s.jsx(Vx,{size:"sm",radius:"md",className:Bz.searchInput,leftSection:s.jsx(vz,{size:16}),placeholder:"Search",itemComponent:Hz,toOption:Uz,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const Hz=p.forwardRef(({resource:e,active:t,...n},r)=>{var i;let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=(i=e.subject)==null?void 0:i.display),s.jsx("div",{ref:r,...n,children:s.jsxs(te,{wrap:"nowrap",children:[s.jsx(Vi,{value:e}),s.jsxs("div",{children:[s.jsx(fe,{children:Ho(e)}),s.jsx(fe,{size:"xs",c:"dimmed",children:o})]})]})})});function Wz(e){const t=JSON.stringify(e);return QP(e)?`{
|
|
463
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
464
|
+
resourceType
|
|
465
|
+
id
|
|
466
|
+
identifier {
|
|
467
|
+
system
|
|
468
|
+
value
|
|
469
|
+
}
|
|
470
|
+
name {
|
|
471
|
+
given
|
|
472
|
+
family
|
|
473
|
+
}
|
|
474
|
+
birthDate
|
|
475
|
+
}
|
|
476
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
477
|
+
resourceType
|
|
478
|
+
id
|
|
479
|
+
identifier {
|
|
480
|
+
system
|
|
481
|
+
value
|
|
482
|
+
}
|
|
483
|
+
subject {
|
|
484
|
+
display
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}`.replace(/\s+/g," "):`{
|
|
488
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
489
|
+
resourceType
|
|
490
|
+
id
|
|
491
|
+
identifier {
|
|
492
|
+
system
|
|
493
|
+
value
|
|
494
|
+
}
|
|
495
|
+
name {
|
|
496
|
+
given
|
|
497
|
+
family
|
|
498
|
+
}
|
|
499
|
+
birthDate
|
|
500
|
+
}
|
|
501
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
502
|
+
resourceType
|
|
503
|
+
id
|
|
504
|
+
identifier {
|
|
505
|
+
system
|
|
506
|
+
value
|
|
507
|
+
}
|
|
508
|
+
name {
|
|
509
|
+
given
|
|
510
|
+
family
|
|
511
|
+
}
|
|
512
|
+
birthDate
|
|
513
|
+
}
|
|
514
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
515
|
+
resourceType
|
|
516
|
+
id
|
|
517
|
+
identifier {
|
|
518
|
+
system
|
|
519
|
+
value
|
|
520
|
+
}
|
|
521
|
+
subject {
|
|
522
|
+
display
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}`.replace(/\s+/g," ")}function qz(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),Qz(Gz(n),t).slice(0,5)}function Gz(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 Qz(e,t){return e.sort((n,r)=>yS(r,t)-yS(n,t))}function yS(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,xS(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,xS(lu(r),t));return n}function xS(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function Kz(e){var o;const t=Ih(),[n,r]=p.useState(!1);return s.jsx(Jn.Header,{p:8,style:{zIndex:101},children:s.jsxs(te,{justify:"space-between",children:[s.jsxs(te,{gap:"xs",children:[s.jsx(bn,{className:td.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(Vz,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(te,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(J,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(J.Target,{children:s.jsx(bn,{className:rt(td.user,{[td.userActive]:n}),onClick:()=>r(i=>!i),children:s.jsxs(te,{gap:7,children:[s.jsx(Vi,{value:t,radius:"xl",size:24}),s.jsx(fe,{size:"sm",className:td.userName,children:lu((o=t==null?void 0:t.name)==null?void 0:o[0])}),s.jsx(Lx,{size:12,stroke:1.5})]})})}),s.jsx(J.Dropdown,{children:s.jsx(Oz,{version:e.version})})]})]})]})})}function Yz(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?Xz(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&Jz(t,n);return t}function Xz(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function Jz(e,t){e[t.name]=t.value}function Ke(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=Yz(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function Zz(e){const t=se(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=Xr(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"}),he({color:"green",message:"Success"}),e.onOk()}).catch(h=>{he({color:"red",message:De(h)})})}return s.jsx(Sn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(Ke,{onSubmit:r,children:s.jsxs(Oe,{children:[s.jsx(eB,{config:n}),s.jsx(ve,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(te,{justify:"flex-end",children:s.jsx(oe,{mt:"sm",type:"submit",children:"OK"})})]})})})}function eB(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(It,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function Dk(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function tB(e){return typeof e.display=="string"?e.display:Dk(e)}function nB(e){return{value:Dk(e),label:tB(e),resource:e}}function rB(e){return{code:e,display:e}}function Hx(e){const t=se(),{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(w=>w.code===v.code)&&m.push(v);return m},[t,i,n]);return s.jsx(Vx,{...l,creatable:r??!0,clearable:o??!0,toOption:nB,loadOptions:c,onCreate:rB,itemComponent:a?oB:void 0})}const oB=p.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(te,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(Gs,{size:12}),s.jsxs("div",{children:[s.jsx(fe,{children:e}),s.jsx(fe,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function Ik(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=sB(u);a(d),n&&n(d)}return s.jsx(Hx,{defaultValue:iB(i),onChange:l,withHelpText:r??!0,...o})}function iB(e){return e?{code:e}:void 0}function sB(e){return e==null?void 0:e.code}function Wx(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return s.jsx(Ik,{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 aB="_menuTitle_9g6l5_1",lB="_link_9g6l5_9",cB="_linkActive_9g6l5_38",wg={menuTitle:aB,link:lB,linkActive:cB};function uB(e){var l;const t=Dh(),n=hB(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(Jn.Navbar,{children:s.jsxs(Ir,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Jn.Section,{mb:"sm",children:s.jsx(Wx,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>a(c)},window.location.pathname)}),s.jsxs(Jn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return s.jsxs(p.Fragment,{children:[s.jsx(fe,{className:wg.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>s.jsxs(dB,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[s.jsx(fB,{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(dz,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(Zz,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function dB(e){return s.jsx(Ge,{onClick:e.onClick,to:e.to,className:rt(wg.link,{[wg.linkActive]:e.active}),children:e.children})}function fB(e){return e.icon?e.icon:s.jsx(jh,{w:30})}function hB(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=pB(e,t,a.href);l>o&&(o=l,r=a)}return r}function pB(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 mB(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=se(),o=Ih();p.useEffect(()=>{function c(){he({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(Jr,{}):s.jsxs(Jn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&s.jsx(Kz,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?s.jsx(uB,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:a,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Jn.Main,{className:Tz.main,children:s.jsx(Rk,{children:s.jsx(p.Suspense,{fallback:s.jsx(Jr,{}),children:e.children})})})]})}function du(e){const{contentType:t,url:n,title:r}=e.value??{},o=Sk(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==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",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(Ze,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:gB(r),children:r||"Download"})})]}):null}function gB(e){return e!=null&&e.includes(".")?e:void 0}const vB="_root_17n8t_1",yB="_compact_17n8t_25",bS={root:vB,compact:yB};function qx(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:rt(bS.root,{[bS.compact]:n}),children:t})}function No(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function xB(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>s.jsx("div",{children:s.jsx(du,{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(!Bt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=s.jsx(No,{term:Ts(o),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function Gx(e){const t=se(),n=p.useRef(null);function r(a){var l;yt(a),(l=n.current)==null||l.click()}function o(a){yt(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(ht(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 bB(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(du,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(tn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{yt(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(df,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Gx,{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($x,{})})})})]})]})]})}function Ak(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(du,{value:t,maxWidth:200}),s.jsx(oe,{disabled:e.disabled,onClick:o=>{yt(o),r(void 0)},children:"Remove"})]}):s.jsx(Gx,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>s.jsx(oe,{...o,children:"Upload..."})})}function yo(e){return s.jsx(s.Fragment,{children:Ni(e.value)})}function SB(e){return s.jsx(s.Fragment,{children:Hs(e.value)})}function Nk(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 wB(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(Nk,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function jB(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 CB(e){return s.jsx(s.Fragment,{children:b6(e.value)})}function Ac(e){return s.jsx(s.Fragment,{children:di(e.value)})}function Qx(e){return s.jsx(s.Fragment,{children:_c(e.value)})}function EB(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(Ac,{value:t.numerator})," / ",s.jsx(Ac,{value:t.denominator})]}):null}function pf(e){if(!e.value)return null;const t=e.value.display||e.value.reference||pr(e.value);return e.link!==!1&&e.value.reference?s.jsx(Ge,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function Mk(e,t,n,r){if(!Bt(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=yk(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 Ok({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(!vk(u)){console.debug("Unsupported slice definition",u);continue}let d;Bt(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=Vs(f);d.typeSchema=h}}n(o)}).catch(r)})}function Ah(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function TB(e){var a,l;const{slice:t,property:n}=e,r=((a=t.typeSchema)==null?void 0:a.elements)??t.elements,o=p.useContext(bt),i=p.useMemo(()=>{var c;if(Bt(r))return Za({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 Ah(bt.Provider,i,s.jsx(s.Fragment,{children:e.value.map((c,u)=>s.jsx("div",{children:s.jsx(Zr,{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 PB(e){var g;const{property:t,propertyType:n}=e,r=se(),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(bt);if(p.useEffect(()=>{Ok({medplum:r,property:t}).then(v=>{c(v);const w=Mk(o,v,t.slicing,f.profileUrl);d(w),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],w=v.map((y,S)=>s.jsx("div",{children:s.jsx(Zr,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:y,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${S}-${v.length}`));if(e.includeDescriptionListEntry){if(!Bt(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const y=e.path.split(".").pop();h=s.jsx(No,{term:Ts(y),children:w})}else h=s.jsx(s.Fragment,{children:w})}return s.jsxs(s.Fragment,{children:[l.map((v,w)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let y=s.jsx(TB,{path:e.path,slice:v,property:t,value:u[w],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(y=s.jsx(No,{term:Ts(v.name),children:y},v.name)),y}),h]})}function fu(e,t,n){const r=vn(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 kB(e,t,n){const r=UP(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function RB(e){const{elementDefinitionType:t}=e,n=se(),r=p.useContext(bt),[o,i]=p.useState(zP("Extension")),a=p.useMemo(()=>{if(Bt(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=Vs(a);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,a]),a&&(l||!xx(a)))return s.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=fu({type:"Extension",value:e.value},"value[x]",a??r.profileUrl);return s.jsx(Zr,{propertyType:h,value:f})}return s.jsx(mf,{path:e.path,value:{type:o.name,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:a})}function Zr(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(q,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Gt(r)&&s.jsx(FT,{value:r,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(zs,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(tn,{variant:"subtle",color:a?"teal":"gray",onClick:l,children:a?s.jsx(Gs,{size:"1rem"}):s.jsx(Ek,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===W.Attachment?s.jsx(xB,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(PB,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case W.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case W.SystemString:case W.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case W.code:case W.date:case W.decimal:case W.id:case W.integer:case W.positiveInt:case W.unsignedInt:case W.uri:case W.url:return s.jsx(s.Fragment,{children:r});case W.canonical:return s.jsx(pf,{value:{reference:r},link:e.link});case W.dateTime:case W.instant:return s.jsx(s.Fragment,{children:Fn(r)});case W.markdown:return s.jsx("pre",{children:r});case W.Address:return s.jsx(_8,{value:r});case W.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case W.Attachment:return s.jsx(du,{value:r,maxWidth:e.maxWidth});case W.CodeableConcept:return s.jsx(yo,{value:r});case W.Coding:return s.jsx(SB,{value:r});case W.ContactDetail:return s.jsx(wB,{value:r});case W.ContactPoint:return s.jsx(Nk,{value:r});case W.HumanName:return s.jsx(Ux,{value:r});case W.Identifier:return s.jsx(jB,{value:r});case W.Money:return s.jsx(CB,{value:r});case W.Period:return s.jsx(s.Fragment,{children:m6(r)});case W.Quantity:case W.Duration:return s.jsx(Ac,{value:r});case W.Range:return s.jsx(Qx,{value:r});case W.Ratio:return s.jsx(EB,{value:r});case W.Reference:return s.jsx(pf,{value:r,link:e.link});case W.Timing:return s.jsx(s.Fragment,{children:JP(r)});case W.Dosage:case W.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(mf,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case W.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(RB,{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(mf,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const Lk=["extension","modifierExtension"],_B=jk.filter(e=>!Lk.includes(e));function mf(e){const t=e.value,{value:n,type:r}=t,o=p.useContext(bt),i=e.profileUrl??(o==null?void 0:o.profileUrl),a=p.useMemo(()=>Eh(r,i),[i,r]),l=p.useMemo(()=>{if(a)return Za({parentContext:o,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,o,e.path,e.accessPolicyResource]);if(Gt(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 Ah(bt.Provider,l,s.jsx(qx,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(Lk.includes(u)&&Gt((v=d.slicing)==null?void 0:v.slices))return null;if(_B.includes(u))return null;if(Ck.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=fu(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&Gt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const m=d.max>1||d.isArray,g=s.jsx(Zr,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:m,link:e.link},u);return m?g:s.jsx(No,{term:Ts(u),children:g},u)})}))}const $k="Read Only";function Fk(e,t){return e?s.jsx(zs.Floating,{label:e,children:t}):t}const DB="_dimmed_1pxw4_1",zk={dimmed:DB};function Bk(e){const{debugMode:t}=p.useContext(bt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Fk(e!=null&&e.readonly?$k:void 0,s.jsxs(te,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Lt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?zk.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Je(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 Uk((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(`
|
|
526
|
+
`)}function hu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return Uk((o=r.expression)==null?void 0:o[0],t)})}const nd=/\[\d+\]/;function Uk(e,t){const n=typeof e=="string"&&nd.test(e),r=typeof t=="string"&&nd.test(t);if(n!==r&&(e=e==null?void 0:e.replace(nd,""),t=t==null?void 0:t.replace(nd,"")),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 vt(e){const{debugMode:t}=p.useContext(bt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Fk(e!=null&&e.readonly?$k:void 0,s.jsx(Lt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?zk.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,error:Je(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function Vk(e,t,n,r,o){const i=r.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",nn(a.code));l in e&&delete e[l]}return e[n]=o,e}function IB(e){return!!e&&!Gt(e.url)&&!Gt(e.name)}function AB(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=MB(f);u(h),n&&n(h)}return s.jsx(Hx,{defaultValue:c&&NB(c),onChange:d,withHelpText:r??!0,...l})}function NB(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function MB(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function Hk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=u&&LB(u);a(d),n&&n(d)}return s.jsx(Hx,{defaultValue:i&&OB(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function OB(e){return{system:e.system,code:e.code,display:e.display}}function LB(e){return{system:e.system,code:e.code,display:e.display}}function Wk(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=p.useContext(bt),[i,a]=p.useState(e.defaultValue),l=p.useRef();l.current=i;const[c,u,d]=p.useMemo(()=>["system","use","value"].map(b=>r[t+"."+b]),[r,t]),[f,h,m]=p.useMemo(()=>["system","use","value"].map(b=>o(t+"."+b)),[o,t]);function g(b){b&&Object.keys(b).length===0&&(b=void 0),a(b),e.onChange&&e.onChange(b)}function v(b){const x={...l.current,system:b};b||delete x.system,g(x)}function w(b){const x={...l.current,use:b};b||delete x.use,g(x)}function y(b){const x={...l.current,value:b};b||delete x.value,g(x)}const S=e.valuePath??t;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(It,{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:b=>v(b.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Je(n,S+".system")}),s.jsx(It,{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:b=>w(b.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Je(n,S+".use")}),s.jsx(ve,{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:b=>y(b.currentTarget.value),error:Je(n,S+".value")})]})}function $B(e){var d;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(bt),[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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ve,{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(Wk,{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 FB(e){if(!e)return"";const t=new Date(e);return Th(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function qk(e){if(!e)return"";const t=new Date(e);return Th(t)?t.toISOString():""}var zB={BASE_URL:"/",DEV:!1,GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.2.5-30739a930",MODE:"production",PROD:!0,RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",SSR:!1};function Ps(e){return s.jsx(ve,{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:BB(),defaultValue:FB(e.defaultValue),autoFocus:e.autoFocus,error:Je(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(qk(n))}}})}function BB(){return zB.NODE_ENV==="test"?"text":"datetime-local"}function UB(e){const{propertyType:t}=e,n=se(),[r,o]=p.useState(),i=p.useMemo(()=>{if(Bt(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=Vs(i);l(!1),o(c)}).catch(c=>{l(!1),console.warn(c)}))},[n,i]),i&&(a||!xx(i))?s.jsx("div",{children:"Loading..."}):s.jsx(Xx,{profileUrl:i,path:e.path,typeName:(r==null?void 0:r.name)??"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function VB(e){var S,b,x;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue),{getExtendedProps:i}=p.useContext(bt),[a,l,c,u,d]=p.useMemo(()=>["use","prefix","given","family","suffix"].map(C=>i(e.path+"."+C)),[i,e.path]);function f(C){o(C),e.onChange&&e.onChange(C)}function h(C){f({...r,use:C||void 0})}function m(C){f({...r,prefix:C?C.split(" "):void 0})}function g(C){f({...r,given:C?C.split(" "):void 0})}function v(C){f({...r,family:C||void 0})}function w(C){f({...r,suffix:C?C.split(" "):void 0})}const y=e.valuePath??n;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(It,{disabled:e.disabled||(a==null?void 0:a.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:C=>h(C.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Je(t,y+".use")}),s.jsx(ve,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(S=r==null?void 0:r.prefix)==null?void 0:S.join(" "),onChange:C=>m(C.currentTarget.value),error:Je(t,y+".prefix")}),s.jsx(ve,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(b=r==null?void 0:r.given)==null?void 0:b.join(" "),onChange:C=>g(C.currentTarget.value),error:Je(t,y+".given")}),s.jsx(ve,{disabled:e.disabled||(u==null?void 0:u.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:C=>v(C.currentTarget.value),error:Je(t,y+".family")}),s.jsx(ve,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(x=r==null?void 0:r.suffix)==null?void 0:x.join(" "),onChange:C=>w(C.currentTarget.value),error:Je(t,y+".suffix")})]})}function HB(e){const[t,n]=p.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=p.useContext(bt),[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(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ve,{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:Je(e.outcome,d+".system")}),s.jsx(ve,{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:Je(e.outcome,d+".value")})]})}const WB=["USD","EUR","CAD","GBP","AUD"];function qB(e){var f;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),{getExtendedProps:o}=p.useContext(bt),[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(It,{disabled:e.disabled||(i==null?void 0:i.readonly),defaultValue:n==null?void 0:n.currency,data:WB,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:c});return s.jsx(ve,{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 GB(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(bt),[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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ps,{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(Ps,{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 ks(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(bt),[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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(It,{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(ve,{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:QB(c.currentTarget.value)})}}),s.jsx(ve,{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 QB(e){if(e)return parseFloat(e)}function Kx(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(bt),[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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ks,{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(ks,{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 KB(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(bt),[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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ks,{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(ks,{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 YB={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},XB=["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 JB(e){return{value:st(e),label:Ho(e),resource:e}}function Qs(e){const t=se(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),a=St(e.defaultValue,i),l=e.itemComponent??ZB,c=e.onChange,u=p.useCallback(async(f,h)=>{const m=eU(n),g=new URLSearchParams({[m]:f??"",_count:"10",...r});return await t.searchResources(n,g,{signal:h})},[t,n,r]),d=p.useCallback(f=>{c&&c(f[0])},[c]);return Bt(e.defaultValue)&&!o&&!a?null:s.jsx(Vx,{disabled:e.disabled,name:e.name,required:e.required,itemComponent:l,defaultValue:a,placeholder:e.placeholder,maxValues:1,toOption:JB,loadOptions:u,onChange:d,clearable:!0})}const ZB=p.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(te,{wrap:"nowrap",children:[s.jsx(Vi,{value:t}),s.jsxs("div",{children:[s.jsx(fe,{children:e}),s.jsx(fe,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function eU(e){return YB[e]??(XB.includes(e)?"name":"_id")}function Nh(e){const{onChange:t}=e,n=se(),[r,o]=p.useState(e.defaultValue),[i,a]=p.useState(()=>tU(e.targetTypes)),[l,c]=p.useState(()=>nU(e.defaultValue,i)),u=p.useRef(new hk),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(!oU(v))return Promise.resolve(v);m=!0;const w=v.value,y=u.current.get(w);if(y)return y;const S=rU(n,v.value).then(x=>{const C={...v};return x?Bt(x.type)?(C.resourceType=x.type,C.name=x.name,C.title=x.title):(console.error(`StructureDefinition.type missing for ${v.value}`),C.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${v.value}`),C.error="StructureDefinition not found"),C}).catch(x=>(console.error(x),{...v,error:x})),b=new Fr(S);return u.current.set(w,b),b});!g||!m||Promise.all(g).then(v=>{if(a(v),!l)return;const w=v.findIndex(y=>y.value===l.value||y.resourceType===l.resourceType);if(w===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(v[w])}).catch(console.error)},[n,l,i]);const f=p.useCallback(m=>{const g=m?Et(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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&s.jsx(It,{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(w=>w.value===g);c(v)},data:h}),!i&&s.jsx(Wx,{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(Qs,{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 tU(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 nU(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 rU(e,t){const n=Vs(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
527
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
528
|
+
type,
|
|
529
|
+
name,
|
|
530
|
+
title,
|
|
531
|
+
}
|
|
532
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function oU(e){return e.type==="profile"&&!(e!=null&&e.error)&&Gt(e.resourceType)}const iU="_indented_ldk1d_1",Gk={indented:iU};function Qk({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(ff,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(tn,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(ff,{size:"1.25rem"})})}function Kk({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(df,{size:"1.25rem"})})}function sU(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(bt),l=p.useMemo(()=>{var v;if(Bt(i))return Za({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=Gt(t.elements),f=tk(t.name),h=e.property.readonly&&r.length===0;return Ah(bt.Provider,l,s.jsx(vt,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:h?s.jsx(fe,{c:"dimmed",children:"(empty)"}):s.jsxs(Oe,{className:d?Gk.indented:void 0,children:[r.map((v,w)=>s.jsxs(te,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${w}`,children:s.jsx(Yx,{elementDefinitionType:t.type[0],name:t.name,defaultValue:v,onChange:y=>{const S=[...r];S[w]=y,c(S)},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(Kk,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${w}`,onClick:y=>{yt(y);const S=[...r];S.splice(w,1),c(S)}})]},`${w}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(te,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Qk,{propertyDisplayName:f,onClick:v=>{yt(v);const w=[...r,void 0];c(w)},testId:e.testId&&`${e.testId}-add`})})]})}))}function aU(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function lU(e){var S;const{property:t}=e,n=se(),[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(bt),f=(S=t.type[0])==null?void 0:S.code;p.useEffect(()=>{Ok({medplum:n,property:t}).then(b=>{a(b);const x=Mk(l,b,t.slicing,d.profileUrl);cU(x,b),u(x),o(!1)}).catch(b=>{console.error(b),o(!1)})},[n,t,l,d.profileUrl,u]);function h(b,x){const C=[...c];if(C[x]=b,u(C),e.onChange){const j=C.flat().filter(T=>T!==void 0);e.onChange(j)}}if(r)return s.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),w=Ts(t.path),y=e.property.readonly&&i.length===0&&l.length===0;return s.jsxs(Oe,{className:e.indent?Gk.indented:void 0,children:[y&&s.jsx(fe,{c:"dimmed",children:"(empty)"}),i.map((b,x)=>s.jsx(sU,{slice:b,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[x],onChange:C=>{h(C,x)},testId:`slice-${b.name}`},b.name)),v&&g.map((b,x)=>s.jsxs(te,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(yl,{arrayElement:!0,property:e.property,name:e.name+"."+x,path:e.path,valuePath:aU(e.path,e.valuePath,x),defaultValue:b,onChange:C=>{const j=[...g];j[x]=C,h(j,m)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(Kk,{propertyDisplayName:w,testId:`nonsliced-remove-${x}`,onClick:C=>{yt(C);const j=[...g];j.splice(x,1),h(j,m)}})]},`${x}-${g.length}`)),!e.property.readonly&&v&&c.flat().length<t.max&&s.jsx(te,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Qk,{propertyDisplayName:w,onClick:b=>{yt(b);const x=[...g];x.push(void 0),h(x,m)},testId:"nonsliced-add"})})]})}function cU(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 uU(e){const[t,n]=p.useState(!1),r=qw(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),s.jsxs(ws,{gap:"xs",children:[s.jsx(Fs,{...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),he({color:"green",message:"Copied"})},children:s.jsx(Ek,{})})]})}const dU=["sun","mon","tue","wed","thu","fri","sat"];function fU(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(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:JP(i.current)||"No repeat"}),s.jsx(oe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&s.jsx(hU,{path:e.path,visible:r,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),n(a),o(!1)},onCancel:()=>o(!1)})]})}const SS={repeat:{period:1,periodUnit:"d"}};function hU(e){const[t,n]=p.useState(e.defaultValue||SS),{getExtendedProps:r}=p.useContext(bt),[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 w;f({...(w=u.current)==null?void 0:w.repeat,period:v})}function m(v){var w;f({...(w=u.current)==null?void 0:w.repeat,periodUnit:v})}function g(v){var w;f({...(w=u.current)==null?void 0:w.repeat,dayOfWeek:v})}return s.jsx(Sn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(Oe,{children:[s.jsx(vt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(Ps,{disabled:o==null?void 0:o.readonly,name:"timing-dialog-start",onChange:v=>d(v)})}),s.jsx(ru,{disabled:i==null?void 0:i.readonly,label:"Repeat",checked:!!t.repeat,onChange:v=>f(v.currentTarget.checked?SS.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(vt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ve,{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(It,{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(vt,{title:"Repeat on",children:s.jsx(Ec.Group,{multiple:!0,onChange:g,children:s.jsx(te,{justify:"space-between",mt:"md",gap:"xs",children:dU.map(v=>s.jsx(Ec,{value:v,size:"xs",radius:"xl",disabled:c==null?void 0:c.readonly,children:v.charAt(0).toUpperCase()},v))})})})]}),s.jsx(te,{justify:"flex-end",children:s.jsx(oe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function yl(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===W.Attachment)return s.jsx(bB,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const c=((l=a[0])==null?void 0:l.code)!==W.Extension;return s.jsx(lU,{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(pU,{elementDefinitionTypes:a,...e}):s.jsx(Yx,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",nn(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 pU(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(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(It,{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(Yx,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",nn(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 Yx(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(bt),f=p.useMemo(()=>{if(!jx(u)||!Gt(e.defaultValue))return e.defaultValue;const g=Object.create(null);if(d.path===e.path)lS(g,d.elements);else{const v=kc(d.path,e.path);if(v===void 0)return e.defaultValue;lS(g,d.elements,v)}return Bt(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=Je(e.outcome,a??i);return{id:t,name:t,"data-testid":t,defaultValue:f,required:c,error:g,disabled:l}}switch(u){case W.SystemString:case W.canonical:case W.string:case W.time:case W.uri:case W.url:return e.path==="Project.secret.value[x]"?s.jsx(uU,{...m(),onChange:g=>{e.onChange&&e.onChange(g.currentTarget.value)}}):s.jsx(ve,{...m(),onChange:g=>{n&&n(g.currentTarget.value)}});case W.date:return s.jsx(ve,{...m(),type:"date",onChange:g=>{n&&n(g.currentTarget.value)}});case W.dateTime:case W.instant:return s.jsx(Ps,{...m(),onChange:n,outcome:r});case W.decimal:case W.integer:case W.positiveInt:case W.unsignedInt:return s.jsx(ve,{...m(),type:"number",step:u===W.decimal?"any":"1",onChange:g=>{if(n){const v=g.currentTarget.valueAsNumber;n(Number.isNaN(v)?void 0:v)}}});case W.code:return s.jsx(Ik,{...m(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case W.boolean:return s.jsx(_n,{...m(),defaultChecked:!!f,onChange:g=>{n&&n(g.currentTarget.checked)}});case W.base64Binary:case W.markdown:return s.jsx(Fs,{...m(),spellCheck:u!==W.base64Binary,onChange:g=>{n&&n(g.currentTarget.value)}});case W.Address:return s.jsx(A8,{...h()});case W.Annotation:return s.jsx(N8,{...h()});case W.Attachment:return s.jsx(Ak,{...h()});case W.CodeableConcept:return s.jsx(AB,{binding:o==null?void 0:o.valueSet,...h()});case W.Coding:return s.jsx(Hk,{binding:o==null?void 0:o.valueSet,...h()});case W.ContactDetail:return s.jsx($B,{...h()});case W.ContactPoint:return s.jsx(Wk,{...h()});case W.Extension:return s.jsx(UB,{...h(),propertyType:e.elementDefinitionType});case W.HumanName:return s.jsx(VB,{...h()});case W.Identifier:return s.jsx(HB,{...h()});case W.Money:return s.jsx(qB,{...h()});case W.Period:return s.jsx(GB,{...h()});case W.Duration:case W.Quantity:return s.jsx(ks,{...h()});case W.Range:return s.jsx(Kx,{...h()});case W.Ratio:return s.jsx(KB,{...h()});case W.Reference:return s.jsx(Nh,{...h(),targetTypes:gU(e.elementDefinitionType)});case W.Timing:return s.jsx(fU,{...h()});case W.Dosage:case W.UsageContext:default:return s.jsx(Xx,{...h(),typeName:u})}}const mU=[`${j$}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function gU(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=mU.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function vU(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useContext(bt),o=p.useMemo(()=>I8(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const a={type:e.type,value:t};return s.jsx(Oe,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=kB(a,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,m=s.jsx(yl,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(Vk({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||Ox.includes(l)?m:c.type.length===1&&c.type[0].code==="boolean"?s.jsx(Bk,{title:Ts(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,readonly:c.readonly,children:m},l):s.jsx(vt,{title:Ts(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,readonly:c.readonly,children:m},l)})})}function Xx(e){const[t]=p.useState(()=>e.defaultValue??{}),n=p.useContext(bt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=p.useMemo(()=>Eh(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,a=p.useMemo(()=>{if(o)return Za({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?Ah(bt.Provider,a,s.jsx(vU,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[i," not implemented"]})}const yU="_root_1vii2_1",xU={root:yU};function pu(e){const{children:t,...n}=e;return s.jsx(My,{className:xU.root,...n,children:t})}const bU="_noteBody_10swh_1",SU="_noteCite_10swh_5",wU="_noteRoot_10swh_10",wS={noteBody:bU,noteCite:SU,noteRoot:wU};function Yk({value:e}){return e?s.jsx(Oe,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(Iy,{classNames:{cite:wS.noteCite,root:wS.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function xl(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),a=St(t,i);let l;if(o&&!NP(o))l=`[${De(o)}]`;else if(a)l=Ho(a);else return null;return n?s.jsx(Ge,{to:t,...r,children:l}):s.jsx(fe,{component:"span",...r,children:l})}function Fa(e){return s.jsxs(te,{gap:"xs",children:[s.jsx(Vi,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(xl,{value:e.value,link:e.link})]})}const jU={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 Jx(e){return s.jsx(Jc,{color:jU[e.status],children:e.status})}const CU="_table_pe9td_1",EU="_criticalRow_pe9td_12",TU="_noteBody_pe9td_23",PU="_noteCite_pe9td_27",kU="_noteRoot_pe9td_32",Xk={table:CU,criticalRow:EU,noteBody:TU,noteCite:PU,noteRoot:kU};Zx.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Zx(e){var a;const t=se(),n=St(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(Oe,{children:[s.jsx(ge,{children:"Diagnostic Report"}),s.jsx(RU,{value:n}),r&&!e.hideSpecimenInfo&&_U(r),n.result&&s.jsx(DU,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&s.jsx(Yk,{value:i})]})}function RU({value:e}){var t,n;return s.jsxs(te,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(fe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(Fa,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(fe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(Fa,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(fe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(Fa,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(fe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(fe,{children:Fn(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(fe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(fe,{children:nn(e.status)})]})]})}function _U(e){return s.jsxs(Oe,{gap:"xs",children:[s.jsx(ge,{order:2,size:"h6",children:"Specimens"}),s.jsx(Ln,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(Ln.Item,{ml:"sm",children:s.jsxs(te,{gap:20,children:[s.jsxs(te,{gap:5,children:[s.jsx(fe,{fw:500,children:"Collected:"})," ",Fn((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(te,{gap:5,children:[s.jsx(fe,{fw:500,children:"Received:"})," ",Fn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function DU(e){return s.jsxs("table",{className:Xk.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(Jk,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function Jk(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(IU,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${qs(n)?n.reference:n.id}`))})}function IU(e){var o,i;const t=St(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=MU(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:rt({[Xk.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(Ge,{to:t,children:s.jsx(yo,{value:t.code})})}),s.jsx("td",{children:s.jsx(AU,{value:t})}),s.jsx("td",{children:s.jsx(NU,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(yo,{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(yo,{value:a})},`category-${Ni(a)}`))})}),s.jsx("td",{children:(i=t.performer)==null?void 0:i.map(a=>s.jsx(pf,{value:a},a.reference))}),s.jsx("td",{children:t.status&&s.jsx(Jx,{status:t.status})})]}),t.hasMember&&s.jsx(Jk,{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(Yk,{value:t.note})})})]})}function AU(e){const t=e.value;return s.jsx(s.Fragment,{children:ZP(t)})}function NU(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(Qx,{value:t}):null}function MU(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 OU="_paper_1igaj_1",LU="_fill_1igaj_20",jS={paper:OU,fill:LU};function e0(e){const{width:t,fill:n,className:r,children:o,...i}=e,a=t?{maxWidth:t}:void 0;return s.jsx(Yn,{className:rt(jS.paper,n&&jS.fill,r),style:a,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var t0={},mu={};Object.defineProperty(mu,"__esModule",{value:!0});mu.Pointer=void 0;function $U(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function FU(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var zU=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map($U);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(FU).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}();mu.Pointer=zU;var Wt={},n0={};(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})(n0);var On={};Object.defineProperty(On,"__esModule",{value:!0});On.diffAny=On.diffObjects=On.diffArrays=On.intersection=On.subtract=On.isDestructive=void 0;var Nc=n0;function BU(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}On.isDestructive=BU;function jg(e,t){var n={};for(var r in e)Nc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)Nc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}On.subtract=jg;function Zk(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)Nc.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)}On.intersection=Zk;function UU(e){return e.op==="add"}function VU(e){return e.op==="remove"}function Vp(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function eR(e,t,n,r){r===void 0&&(r=Mh);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),w={op:"remove",index:d-1};g.push(Vp(v,w))}if(f>0){var y=i(d,f-1),S={op:"add",index:d-1,value:t[f-1]};g.push(Vp(y,S))}if(d>0&&f>0){var b=i(d-1,f-1),x={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(Vp(b,x))}var C=g.sort(function(j,T){return j.cost-T.cost})[0];m=C}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(UU(f)){var g=f.index+1+m,v=g<a+m?String(g):"-",w={op:f.op,path:n.add(v).toString(),value:f.value};return[h.concat(w),m+1]}else if(VU(f)){var w={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(w),m-1]}else{var y=n.add(String(f.index+m)),S=r(f.original,f.value,y);return[h.concat.apply(h,S),m]}},[[],0])[0];return u}On.diffArrays=eR;function tR(e,t,n,r){r===void 0&&(r=Mh);var o=[];return jg(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),jg(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),Zk([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}On.diffObjects=tR;function Mh(e,t,n,r){if(r===void 0&&(r=Mh),e===t)return[];var o=(0,Nc.objectType)(e),i=(0,Nc.objectType)(t);return o=="array"&&i=="array"?eR(e,t,n,r):o=="object"&&i=="object"?tR(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}On.diffAny=Mh;var r0=j0&&j0.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.apply=Wt.InvalidOperationError=Wt.test=Wt.copy=Wt.move=Wt.replace=Wt.remove=Wt.add=Wt.TestError=Wt.MissingError=void 0;var Wo=mu,o0=n0,HU=On,xo=function(e){r0(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);Wt.MissingError=xo;var nR=function(e){r0(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);Wt.TestError=nR;function i0(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 rR(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function oR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new xo(t.path):(i0(n.parent,n.key,(0,o0.clone)(t.value)),null)}Wt.add=oR;function iR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new xo(t.path):(rR(n.parent,n.key),null)}Wt.remove=iR;function sR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new xo(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new xo(t.path)}else if(n.value===void 0)return new xo(t.path);return n.parent[n.key]=(0,o0.clone)(t.value),null}Wt.replace=sR;function aR(e,t){var n=Wo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new xo(t.from);var r=Wo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new xo(t.path):(rR(n.parent,n.key),i0(r.parent,r.key,n.value),null)}Wt.move=aR;function lR(e,t){var n=Wo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new xo(t.from);var r=Wo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new xo(t.path):(i0(r.parent,r.key,(0,o0.clone)(n.value)),null)}Wt.copy=lR;function cR(e,t){var n=Wo.Pointer.fromJSON(t.path).evaluate(e);return(0,HU.diffAny)(n.value,t.value,new Wo.Pointer).length?new nR(n.value,t.value):null}Wt.test=cR;var uR=function(e){r0(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);Wt.InvalidOperationError=uR;function WU(e,t){switch(t.op){case"add":return oR(e,t);case"remove":return iR(e,t);case"replace":return sR(e,t);case"move":return aR(e,t);case"copy":return lR(e,t);case"test":return cR(e,t)}return new uR(t)}Wt.apply=WU;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=mu;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Wt,r=On;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})(t0);const qU="_root_w6lfx_1",GU="_removed_w6lfx_16",QU="_added_w6lfx_21",Hp={root:qU,removed:GU,added:QU};function KU(e){const t=se(),{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=[bo(n)],c=[bo(r)],u=[],d=YU(t0.createPatch(n,r));for(const f of d){const h=f.path,m=XU(h),g=JU(n.resourceType,m),v=f.op==="add"?void 0:Ic(m,l),w=f.op==="remove"?void 0:Ic(m,c);u.push({key:`op-${f.op}-${f.path}`,name:`${nn(f.op)} ${m}`,path:(g==null?void 0:g.path)??n.resourceType+"."+m,property:g,originalValue:CS(g,v),revisedValue:CS(g,w)})}return u},[o,n,r]);return a?s.jsxs(de,{className:Hp.root,children:[s.jsx(de.Thead,{children:s.jsxs(de.Tr,{children:[s.jsx(de.Th,{}),s.jsx(de.Th,{children:"Before"}),s.jsx(de.Th,{children:"After"})]})}),s.jsx(de.Tbody,{children:a.map(l=>s.jsxs(de.Tr,{children:[s.jsx(de.Td,{children:l.name}),s.jsx(de.Td,{className:Hp.removed,children:l.originalValue&&s.jsx(Zr,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),s.jsx(de.Td,{className:Hp.added,children:l.revisedValue&&s.jsx(Zr,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function YU(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 XU(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 JU(e,t){var r;const n=gl(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 CS(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:ZU(t,!!(e!=null&&e.isArray))}}function ZU(e,t){const n=a6(e).flatMap(r=>r.value);return t?n:n[0]}function s0(e){const{profileUrl:t}=e,n=se(),r=n.getAccessPolicy(),o=St(e.value),[i,a]=p.useState();p.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{const c=Vs(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&&lk(o,Ix.READ,r),[r,o]);return!i||!o?null:s.jsx(mf,{path:o.resourceType,value:{type:i,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:l})}const eV="_item_5q6yx_1",tV="_itemPadding_5q6yx_5",ES={item:eV,itemPadding:tV};function nV(e){return s.jsx(pu,{children:e.children})}function Rs(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(e0,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(te,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Vi,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(fe,{size:"sm",children:s.jsx(xl,{c:"dark",fw:500,value:a,link:!0})}),s.jsxs(fe,{size:"xs",children:[s.jsx(Ge,{c:"dimmed",to:e.resource,children:Fn(l)}),s.jsx(fe,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(Ge,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(J,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(J.Target,{children:s.jsx(tn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${st(e.resource)}`,children:s.jsx(X8,{})})}),o]})]}),s.jsx(Rk,{children:s.jsx("div",{className:rt(ES.item,{[ES.itemPadding]:r}),children:e.children})})]})}function dR(e,t){e.sort((n,r)=>{const o=TS(n,t),i=TS(r,t);return o>i?1:o<i?-1:PS(n,t)-PS(r,t)})}function TS(e,t){if(!fR(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function PS(e,t){var r;if(!fR(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 fR(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const rV="_pinnedComment_5uxzi_2",oV={pinnedComment:rV};function Oh(e){const t=se(),n=t.getProfile(),r=p.useRef(null),o=St(e.value),[i,a]=p.useState(),[l,c]=p.useState([]),u=e.loadTimelineResources,d=p.useRef(l);d.current=l;const f=p.useCallback(x=>{dR(x,o),x.reverse(),c(x)},[o]),h=p.useCallback(x=>{const C=[];for(const j of x){if(j.status!=="fulfilled")continue;const T=j.value;if(T.type==="history"&&a(T),T.entry)for(const E of T.entry)C.push(E.resource)}f(C)},[f]),m=p.useCallback(x=>f([...d.current,x]),[f]),g=p.useCallback(()=>{var j;let x,C;"resourceType"in e.value?(x=e.value.resourceType,C=e.value.id):[x,C]=(j=e.value.reference)==null?void 0:j.split("/"),u(t,x,C).then(h).catch(console.error)},[t,e.value,u,h]);p.useEffect(()=>g(),[g]);function v(x){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,x)).then(C=>m(C)).catch(console.error)}function w(x){!o||!e.createMedia||t.createResource(e.createMedia(o,n,x)).then(C=>m(C)).then(()=>Hl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(Gs,{size:16}),autoClose:2e3})).catch(C=>Hl({id:"upload-notification",color:"red",title:"Upload error",message:De(C),icon:s.jsx(pS,{size:16}),autoClose:2e3}))}function y(){he({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function S(x){Hl({id:"upload-notification",loading:!0,title:"Uploading...",message:dV(x),autoClose:!1,withCloseButton:!1})}function b(x){Hl({id:"upload-notification",color:"red",title:"Upload error",message:De(x),icon:s.jsx(pS,{size:16}),autoClose:2e3})}return o?s.jsxs(nV,{children:[e.createCommunication&&s.jsx(e0,{children:s.jsx(Ke,{testid:"timeline-form",onSubmit:x=>{v(x.text);const C=r.current;C&&(C.value="",C.focus())},children:s.jsxs(te,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Vi,{value:n}),s.jsx(ve,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(tn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(iz,{size:16})}),s.jsx(Gx,{securityContext:Et(o),onUpload:w,onUploadStart:y,onUploadProgress:S,onUploadError:b,children:x=>s.jsx(tn,{...x,radius:"xl",color:"blue",variant:"filled",children:s.jsx($x,{size:16})})})]})})}),l.map(x=>{var T;if(!x)return null;const C=`${x.resourceType}/${x.id}/${(T=x.meta)==null?void 0:T.versionId}`,j=e.getMenu?e.getMenu({primaryResource:o,currentResource:x,reloadTimeline:g}):void 0;if(x.resourceType===o.resourceType&&x.id===o.id)return s.jsx(iV,{history:i,resource:x,popupMenuItems:j},C);switch(x.resourceType){case"AuditEvent":return s.jsx(cV,{resource:x,popupMenuItems:j},C);case"Communication":return s.jsx(aV,{resource:x,popupMenuItems:j},C);case"DiagnosticReport":return s.jsx(uV,{resource:x,popupMenuItems:j},C);case"Media":return s.jsx(lV,{resource:x,popupMenuItems:j},C);default:return s.jsx(Rs,{resource:x,padding:!0,children:s.jsx(s0,{value:x,ignoreMissingValues:!0})},C)}})]}):s.jsx(mn,{style:{width:"100%",height:"100%"},children:s.jsx(Zn,{})})}function iV(e){const{history:t,resource:n,...r}=e,o=sV(t,n);return o?s.jsx(Rs,{resource:n,padding:!0,...r,children:s.jsx(KU,{original:o,revised:e.resource})}):s.jsxs(Rs,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(s0,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function sV(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 aV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:oV.pinnedComment;return s.jsx(Rs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function lV(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(Rs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(du,{value:e.resource.content})})}function cV(e){return s.jsx(Rs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Ir,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function uV(e){return s.jsx(Rs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Zx,{value:e.resource})})}function dV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Wp(e.loaded)} / ${Wp(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Wp(e.loaded)}`}function Wp(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 fV(e){const{resource:t,...n}=e;return s.jsx(Oh,{value:t,loadTimelineResources:async(r,o,i)=>{const a=`${o}/${i}`;return Promise.allSettled([r.readHistory(o,i),r.search("Task",{_filter:`based-on eq ${a} or focus eq ${a} or subject eq ${a}`,_count:100})])},...n})}function Ne(e){const{children:t,...n}=e;return s.jsx(pu,{children:s.jsx(e0,{...n,children:t})})}function hV(e){const{encounter:t,...n}=e;return s.jsx(Oh,{value:t,loadTimelineResources:async(r,o,i)=>Promise.allSettled([r.readHistory("Encounter",i),r.search("Communication","encounter=Encounter/"+i),r.search("Media","encounter=Encounter/"+i)]),createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",encounter:Et(r),subject:r.subject,sender:Et(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",encounter:Et(r),subject:r.subject,operator:Et(o),issued:new Date().toISOString(),content:i}),...n})}function pV(e){let t;try{t=ml(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(Zr,{value:t[0]||"",propertyType:e.propertyType})}function Mr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Bi,{icon:s.jsx(vl,{size:16}),color:"red",children:t.map(r=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:OP(r)},(o=r.details)==null?void 0:o.text)})})}function mV(e){return s.jsxs(Sn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(q,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(kS,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(kS,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(fe,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function kS(e){return s.jsx(oe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const gV={string:[re.EQUALS,re.NOT,re.CONTAINS,re.EXACT],fulltext:[re.EQUALS,re.NOT,re.CONTAINS,re.EXACT],token:[re.EQUALS,re.NOT],reference:[re.EQUALS,re.NOT],numeric:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS],quantity:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS],date:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS,re.STARTS_AFTER,re.ENDS_BEFORE,re.APPROXIMATELY],datetime:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS,re.STARTS_AFTER,re.ENDS_BEFORE,re.APPROXIMATELY]},vV={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 a0(e,t){return{...e,filters:t,offset:0,name:void 0}}function hR(e,t){return a0(e,(e.filters??[]).filter(n=>n.code!==t))}function Lh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),a0(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 l0(e,t,-1)}function bV(e,t){return l0(e,t,0)}function SV(e,t){return l0(e,t,1)}function l0(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),u0(e,t,r,o)}function wV(e,t){return c0(e,t,-1)}function jV(e,t){return c0(e,t,0)}function CV(e,t){return c0(e,t,1)}function c0(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),u0(e,t,r,o)}function EV(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),u0(e,t,n,new Date)}function u0(e,t,n,r){return e=hR(e,t),e=RS(e,t,re.GREATER_THAN_OR_EQUALS,n),e=RS(e,t,re.LESS_THAN_OR_EQUALS,r),e}function RS(e,t,n,r){return Lh(e,t,n,r.toISOString())}function _S(e,t,n=!0){return Lh(e,t,re.MISSING,n.toString())}function TV(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function PV(e,t){const n=e.count??Ph,r=(t-1)*n;return TV(e,r)}function kV(e,t,n){return t===RV(e)&&n!==void 0&&n===_V(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function RV(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function _V(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function DV(e){return gV[e.type]}function d0(e){return vV[e]??""}function Mi(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(nn).join(" "))}function IV(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"?Fn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?AV(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?NV(e,t.searchParams[0]):null}function AV(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]=fu({type:e.resourceType,value:e},n);return r?s.jsx(Zr,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function NV(e,t){const n=Ic(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,o)=>s.jsx(Zr,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function MV(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(pr(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=zP(c),d=Cx(c);return Rc(OV(u,d)).map(f=>({value:f,label:Mi(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return s.jsx(Sn,{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(Oe,{children:[s.jsx(mh,{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(te,{justify:"flex-end",children:s.jsx(oe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function OV(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(Mi(i));if(t)for(const i of Object.keys(t)){const a=Mi(i);!r.has(i)&&!o.has(a)&&(n.push(i),r.add(i),o.add(a))}return n}function pR(e){var o;const{resourceType:t,filter:n}=e,r=(o=So.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===re.EQUALS||n.operator===re.NOT_EQUALS))return s.jsx(xl,{value:{reference:n.value}});const i=gl(t,r);if(n.code==="_lastUpdated"||i.type===ko.DATETIME)return s.jsx(s.Fragment,{children:Fn(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function mR(e){const t=gl(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case ko.REFERENCE:return s.jsx(Nh,{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 ko.BOOLEAN:return s.jsx(_n,{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 ko.DATE:return s.jsx(ve,{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 ko.DATETIME:return s.jsx(Ps,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ko.NUMBER:return s.jsx(ve,{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 ko.QUANTITY:return s.jsx(ks,{name:n,path:"",defaultValue:LV(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(ve,{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 LV(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function $V(e){const[t,n]=p.useState(JSON.parse(pr(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(pr(e.search)))},[e.search]);function a(d){n(Lh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=Cx(l)??{},u=t.filters||[];return s.jsxs(Sn,{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(DS,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(a0(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(FV,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(yV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(DS,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function FV(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:Mi(t.code)}),s.jsx("td",{children:d0(t.operator)}),s.jsx("td",{children:s.jsx(pR,{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 DS(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&&DV(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(It,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Mi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(It,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:d0(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(mR,{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 zV(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(Sn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(Ke,{onSubmit:r,children:s.jsxs(ur,{children:[s.jsx(ur.Col,{span:10,children:s.jsx(mR,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(ur.Col,{span:2,children:s.jsx(oe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function BV(e){if(!e.searchParams)return null;function t(i,a){o(kV(e.search,i.code,a))}function n(i){o(hR(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(UV,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):s.jsx(J.Dropdown,{children:e.searchParams.map(i=>s.jsx(J.Item,{children:Mi(i.code)},i.code))})}function UV(e){switch(e.searchParam.type){case"date":return s.jsx(VV,{...e});case"number":case"quantity":return s.jsx(HV,{...e});case"reference":return s.jsx(WV,{...e});case"string":return s.jsx(qV,{...e});case"token":case"uri":return s.jsx(GV,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function VV(e){const{searchParam:t}=e,n=t.code;return s.jsxs(J.Dropdown,{children:[s.jsx(J.Item,{leftSection:s.jsx(Fx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(J.Item,{leftSection:s.jsx(zx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(uu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(J.Item,{leftSection:s.jsx(cu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT_EQUALS),children:"Does not equal..."}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(kk,{size:14}),onClick:()=>e.onPrompt(t,re.ENDS_BEFORE),children:"Before..."}),s.jsx(J.Item,{leftSection:s.jsx(Pk,{size:14}),onClick:()=>e.onPrompt(t,re.STARTS_AFTER),children:"After..."}),s.jsx(J.Item,{leftSection:s.jsx(U8,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Between..."}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(SV(e.search,n)),children:"Tomorrow"}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(bV(e.search,n)),children:"Today"}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(xV(e.search,n)),children:"Yesterday"}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(CV(e.search,n)),children:"Next Month"}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(jV(e.search,n)),children:"This Month"}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(wV(e.search,n)),children:"Last Month"}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(Xi,{size:14}),onClick:()=>e.onChange(EV(e.search,n)),children:"Year to date"}),s.jsx(gu,{...e})]})}function HV(e){const{searchParam:t}=e;return s.jsxs(J.Dropdown,{children:[s.jsx(J.Item,{leftSection:s.jsx(Fx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(J.Item,{leftSection:s.jsx(zx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(uu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(J.Item,{leftSection:s.jsx(cu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT_EQUALS),children:"Does not equal..."}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(Pk,{size:14}),onClick:()=>e.onPrompt(t,re.GREATER_THAN),children:"Greater than..."}),s.jsx(J.Item,{leftSection:s.jsx(Sg,{size:14}),onClick:()=>e.onPrompt(t,re.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(J.Item,{leftSection:s.jsx(kk,{size:14}),onClick:()=>e.onPrompt(t,re.LESS_THAN),children:"Less than..."}),s.jsx(J.Item,{leftSection:s.jsx(Sg,{size:14}),onClick:()=>e.onPrompt(t,re.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(gu,{...e})]})}function WV(e){const{searchParam:t}=e;return s.jsxs(J.Dropdown,{children:[s.jsx(J.Item,{leftSection:s.jsx(uu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(J.Item,{leftSection:s.jsx(cu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT),children:"Does not equal..."}),s.jsx(gu,{...e})]})}function qV(e){const{searchParam:t}=e;return s.jsxs(J.Dropdown,{children:[s.jsx(J.Item,{leftSection:s.jsx(Fx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(J.Item,{leftSection:s.jsx(zx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(uu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(J.Item,{leftSection:s.jsx(cu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT),children:"Does not equal..."}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(W8,{size:14}),onClick:()=>e.onPrompt(t,re.CONTAINS),children:"Contains..."}),s.jsx(J.Item,{leftSection:s.jsx(H8,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Does not contain..."}),s.jsx(gu,{...e})]})}function GV(e){const{searchParam:t}=e;return s.jsxs(J.Dropdown,{children:[s.jsx(J.Item,{leftSection:s.jsx(uu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(J.Item,{leftSection:s.jsx(cu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT),children:"Does not equal..."}),s.jsx(gu,{...e})]})}function gu(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(z8,{size:14}),onClick:()=>e.onChange(_S(e.search,n)),children:"Missing"}),s.jsx(J.Item,{leftSection:s.jsx(F8,{size:14}),onClick:()=>e.onChange(_S(e.search,n,!1)),children:"Not missing"}),s.jsx(J.Divider,{}),s.jsx(J.Item,{leftSection:s.jsx(hf,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const QV="_root_vlout_1",KV="_table_vlout_8",YV="_tr_vlout_12",XV="_th_vlout_18",JV="_control_vlout_22",ZV="_icon_vlout_31",Ol={root:QV,table:KV,tr:YV,th:XV,control:JV,icon:ZV};function eH(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(tH(t,r));return n}function tH(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=Ws(e,t),r=E6(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=Cx(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=gl(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class nH extends Event{constructor(t){super("change"),this.definition=t}}class rH extends Event{constructor(t){super("load"),this.response=t}}class gf extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function vu(e){var N,F,D;const t=se(),[n,r]=p.useState(),{search:o,onLoad:i}=e,[a,l]=p.useState(o);Ai(o,a)||l(o);const[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=>{r(void 0),t.requestSchema(a.resourceType).then(()=>t.search(a.resourceType,Pa({...a,total:f,fields:void 0}),k)).then(P=>{u({...d.current,searchResponse:P}),i&&i(new rH(P))}).catch(P=>{u({...d.current,searchResponse:void 0}),r(ht(P))})},[t,a,f,i]),m=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);p.useEffect(()=>{h()},[h]);function g(k,P){k.stopPropagation();const O=k.target.checked,V={...d.current.selected};O?V[P]=!0:delete V[P],u({...d.current,selected:V})}function v(k){k.stopPropagation();const $=k.target.checked,O={},V=d.current.searchResponse;$&&(V!=null&&V.entry)&&V.entry.forEach(K=>{var ie;(ie=K.resource)!=null&&ie.id&&(O[K.resource.id]=!0)}),u({...d.current,selected:O})}function w(){var P,$;const k=d.current;if(!((P=k.searchResponse)!=null&&P.entry)||k.searchResponse.entry.length===0)return!1;for(const O of k.searchResponse.entry)if(($=O.resource)!=null&&$.id&&!k.selected[O.resource.id])return!1;return!0}function y(k){e.onChange&&e.onChange(new nH(k))}function S(k,P){if(_k(k.target)||k.button===2)return;yt(k);const $=k.button===1||k.ctrlKey||k.metaKey;!$&&e.onClick&&e.onClick(new gf(P,k)),$&&e.onAuxClick&&e.onAuxClick(new gf(P,k))}function b(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(Mr,{outcome:n});if(!FP(a.resourceType))return s.jsx(mn,{style:{width:"100%",height:"100%"},children:s.jsx(Zn,{})});const x=e.checkboxesEnabled,C=eH(a),j=a.resourceType,T=c.searchResponse,E=T==null?void 0:T.entry,_=E==null?void 0:E.map(k=>k.resource),R="subtle",A="gray",L=16,U=window.innerWidth<768;return s.jsxs("div",{className:Ol.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(te,{justify:"space-between",mb:"xl",children:[s.jsxs(te,{gap:2,children:[s.jsx(oe,{size:"compact-md",variant:R,color:A,leftSection:s.jsx(Q8,{size:L}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(oe,{size:"compact-md",variant:R,color:A,leftSection:s.jsx(Z8,{size:L}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(oe,{size:"compact-md",variant:R,color:A,leftSection:s.jsx(J8,{size:L}),onClick:e.onNew,children:"New..."}),!U&&b()&&s.jsx(oe,{size:"compact-md",variant:R,color:A,leftSection:s.jsx(Sz,{size:L}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!U&&e.onDelete&&s.jsx(oe,{size:"compact-md",variant:R,color:A,leftSection:s.jsx(Bx,{size:L}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!U&&e.onBulk&&s.jsx(oe,{size:"compact-md",variant:R,color:A,leftSection:s.jsx(B8,{size:L}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),s.jsxs(te,{gap:2,children:[T&&s.jsxs(fe,{size:"xs",c:"dimmed","data-testid":"count-display",children:[gR(a,T).toLocaleString(),"-",lH(a,T).toLocaleString(),T.total!==void 0&&` of ${a.total==="estimate"?"~":""}${(N=T.total)==null?void 0:N.toLocaleString()}`]}),s.jsx(tn,{variant:R,color:A,title:"Refresh",onClick:m,children:s.jsx(hz,{size:L})})]})]}),s.jsxs(de,{className:Ol.table,children:[s.jsxs(de.Thead,{children:[s.jsxs(de.Tr,{children:[x&&s.jsx(de.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:w(),onChange:k=>v(k)})}),C.map(k=>s.jsx(de.Th,{children:s.jsxs(J,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(J.Target,{children:s.jsx(bn,{className:Ol.control,p:2,children:s.jsxs(te,{justify:"space-between",wrap:"nowrap",children:[s.jsx(fe,{fw:500,children:Mi(k.name)}),s.jsx(mn,{className:Ol.icon,children:s.jsx(O8,{size:14,stroke:1.5})})]})})}),s.jsx(BV,{search:a,searchParams:k.searchParams,onPrompt:(P,$)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:P,filterDialogFilter:$})},onChange:P=>{y(P)}})]})},k.name))]}),!e.hideFilters&&s.jsxs(de.Tr,{children:[x&&s.jsx(de.Th,{}),C.map(k=>s.jsx(de.Th,{children:k.searchParams&&s.jsx(iH,{resourceType:j,searchParams:k.searchParams,filters:a.filters})},k.name))]})]}),s.jsx(de.Tbody,{children:_==null?void 0:_.map(k=>k&&s.jsxs(de.Tr,{className:Ol.tr,"data-testid":"search-control-row",onClick:P=>S(P,k),onAuxClick:P=>S(P,k),children:[x&&s.jsx(de.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:P=>g(P,k.id)})}),C.map(P=>s.jsx(de.Td,{children:IV(k,P)},P.name))]},k.id))})]}),(_==null?void 0:_.length)===0&&s.jsx(pu,{children:s.jsx(mn,{style:{height:150},children:s.jsx(fe,{size:"xl",c:"dimmed",children:"No results"})})}),T&&s.jsx(mn,{m:"md",p:"md",children:s.jsx(no,{value:sH(a),total:aH(a,T),onChange:k=>y(PV(a,k)),getControlProps:k=>{switch(k){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(MV,{search:a,visible:d.current.fieldEditorVisible,onOk:k=>{y(k),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),s.jsx($V,{search:a,visible:d.current.filterEditorVisible,onOk:k=>{y(k),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),s.jsx(mV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),s.jsx(zV,{visible:d.current.filterDialogVisible,title:(F=c.filterDialogSearchParam)!=null&&F.code?Mi(c.filterDialogSearchParam.code):"",resourceType:j,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:k=>{y(Lh(a,k.code,k.operator,k.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(D=c.filterDialogSearchParam)==null?void 0:D.code)]})}const oH=vu;function iH(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:[d0(n.operator)," ",s.jsx(pR,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function sH(e){return Math.floor((e.offset??0)/(e.count??Ph))+1}function aH(e,t){const n=e.count??Ph,r=vR(e,t);return Math.ceil(r/n)}function gR(e,t){return Math.min(vR(e,t),(e.offset??0)+1)}function lH(e,t){var n;return Math.max(gR(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function vR(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 cH(e){const t=se(),[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(b=>i(ht(b)))},[t,a]);function g(b,x){b.stopPropagation();const j=b.target.checked,T={...m.current};j?T[x]=!0:delete T[x],f(T)}function v(b){var E;b.stopPropagation();const C=b.target.checked,j={},T=(E=h.current)==null?void 0:E.data.ResourceList;C&&T&&T.forEach(_=>{_.id&&(j[_.id]=!0)}),f(j)}function w(){var x;const b=(x=h.current)==null?void 0:x.data.ResourceList;if(!b||b.length===0)return!1;for(const C of b)if(C.id&&!m.current[C.id])return!1;return!0}function y(b,x){_k(b.target)||(yt(b),b.button!==1&&e.onClick&&e.onClick(new gf(x,b)),b.button===1&&e.onAuxClick&&e.onAuxClick(new gf(x,b)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(Zn,{});const S=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:b=>yt(b),"data-testid":"search-control",children:[s.jsxs(de,{children:[s.jsx(de.Thead,{children:s.jsxs(de.Tr,{children:[S&&s.jsx(de.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:w(),onChange:b=>v(b)})}),l.map(b=>s.jsx(de.Th,{children:b.name},b.name))]})}),s.jsx(de.Tbody,{children:c==null?void 0:c.data.ResourceList.map(b=>b&&s.jsxs(de.Tr,{"data-testid":"search-control-row",onClick:x=>y(x,b),onAuxClick:x=>y(x,b),children:[S&&s.jsx(de.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${b.id}`,checked:!!d[b.id],onChange:x=>g(x,b.id)})}),l.map(x=>s.jsx(de.Td,{children:s.jsx(pV,{propertyType:x.propertyType,path:x.fhirPath,resource:b})},x.name))]},b.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 uH=p.memo(cH);function ro(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 dH(e){const{group:t}=e;return s.jsx(Yn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(te,{children:[t.measureScore&&s.jsx(pH,{group:t}),!t.measureScore&&s.jsx(hH,{group:t})]})})}function fH(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(fe,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(fe,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function hH(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>Ni(c.code)==="numerator"),o=n==null?void 0:n.find(c=>Ni(c.code)==="denominator"),i=r==null?void 0:r.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(q,{children:[s.jsx(ge,{order:3,children:"Not Applicable"}),s.jsx(fe,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(q,{children:[s.jsx(ge,{order:3,children:"Insufficient Data"}),s.jsx(fe,{children:`Numerator: ${i}`}),s.jsx(fe,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(wh,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:yR(l)}],label:s.jsx(ws,{justify:"center",children:s.jsxs(fe,{fw:700,fz:18,children:[i," / ",a]})})})}function pH(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(wh,{size:120,thickness:12,roundCaps:!0,sections:[{value:mH(t),color:yR(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(ws,{justify:"center",children:s.jsx(fe,{fw:700,fz:18,children:s.jsx(Ac,{value:t.measureScore})})})}):s.jsx(ws,{h:120,align:"center",children:s.jsx(ge,{order:3,children:s.jsx(Ac,{value:t.measureScore})})})})}function mH(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 yR(e){return e<=33?"red":e<=67?"yellow":"green"}function gH(e){var r;const t=St(e.measureReport),[n]=R8("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(q,{children:[n&&s.jsx(fH,{measure:n}),s.jsx(ix,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>s.jsx(dH,{group:o},o.id??i))})]}):null}function vH(e){const{patient:t,...n}=e,r=p.useCallback((o,i,a)=>{const l=`${i}/${a}`,c=100;return Promise.allSettled([o.readHistory("Patient",a),o.search("Communication",{subject:l,_count:c}),o.search("Device",{patient:l,_count:c}),o.search("DeviceRequest",{patient:l,_count:c}),o.search("DiagnosticReport",{subject:l,_count:c}),o.search("Media",{subject:l,_count:c}),o.search("ServiceRequest",{subject:l,_count:c}),o.search("Task",{subject:l,_count:c})])},[]);return s.jsx(Oh,{value:t,loadTimelineResources:r,createCommunication:(o,i,a)=>({resourceType:"Communication",status:"completed",subject:Et(o),sender:Et(i),sent:new Date().toISOString(),payload:[{contentString:a}]}),createMedia:(o,i,a)=>({resourceType:"Media",status:"completed",subject:Et(o),operator:Et(i),issued:new Date().toISOString(),content:a}),...n})}const yH="_section_14dzq_2",xH="_hovering_14dzq_11",bH="_editing_14dzq_15",SH="_bottomActions_14dzq_20",ka={section:yH,hovering:xH,editing:bH,bottomActions:SH};function wH(e){const t=se(),n=St(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(kH(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,w){d({...m.current,[v]:w})}return s.jsx("div",{children:s.jsxs(Ke,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(ve,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),s.jsx(xR,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),s.jsx(oe,{type:"submit",children:"Save"})]})})}function xR(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:ka.section,children:[e.actions.map(i=>s.jsx("div",{children:s.jsx(jH,{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:ka.bottomActions,children:s.jsx(Ze,{href:"#",onClick:i=>{yt(i),r({id:SR()})},children:"Add action"})})]})}function jH(e){const{action:t}=e,n=PH(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){yt(c),e.setHoverKey(e.action.id)}const l=rt(ka.section,{[ka.editing]:r,[ka.hovering]:o&&!r});return s.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:a,onFocus:a,children:[r?s.jsx(EH,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(CH,{action:t,actionType:n}),s.jsx("div",{className:ka.bottomActions,children:s.jsx(Ze,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Cg={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function CH(e){const{action:t,actionType:n}=e,[r,o]=bR(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(pf,{value:{reference:t.definitionCanonical}})}),r&&s.jsx("div",{children:s.jsx(Zr,{property:Cg,propertyType:o,value:r})})]})}function EH(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(Oe,{gap:"xl",children:[s.jsx(ve,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(ve,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(It,{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(xR,{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(rd,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(rd,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(rd,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(rd,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(vt,{title:"Timing",description:"When the action should take place.",children:s.jsx(TH,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function rd(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(Qs,{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 TH(e){const t=e.action,n="timing",[r,o]=bR(t);return s.jsx(yl,{property:Cg,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(Vk(t,n,a??n,Cg,i))},outcome:void 0})}function PH(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 bR(e){return fu({type:"PlanDefinitionAction",value:e},"timing")}let qp=1;function SR(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(qp=Math.max(qp,t+1))}return e}return"id-"+qp++}function kH(e){return{...e,action:wR(e.action)}}function wR(e){if(e)return e.map(t=>({...t,id:SR(t.id),action:wR(t.action)}))}var jt=(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))(jt||{});function RH(e){return e.type==="choice"||e.type==="open-choice"}function _H(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=jR(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:a}=AH(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!a)return!1}return n!=="any"}function DH(e,t,n){return e.map(r=>{var a;const o=(a=n.answerOption)==null?void 0:a.find(l=>Hs(l.valueCoding)===r||l[t]===r),i=vn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function jR(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=jR(n.item,t);if(r)return r}}}function IH(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}]=Ic(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function AH(e,t,n){const r=t||[],o=vn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of r){const c=vn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(IH(c,o,u)?i=!0:a=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:a}}function CR(e){var n,r;const t=pl(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 Gp(e,t){var o;const n=Xr(e);let r=pl(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 NH(e,t,n){const r=pl(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]=pg(l,"=",2);i[c]=u}return i}function MH(e){return{resourceType:"QuestionnaireResponse",questionnaire:st(e),item:ER(e.item),status:"in-progress"}}function ER(e){return(e==null?void 0:e.map(TR))??[]}function TR(e){var t;return{id:LH(),linkId:e.linkId,text:e.text,item:ER(e.item),answer:((t=e.initial)==null?void 0:t.map($H))??[]}}let OH=1;function LH(){return"id-"+OH++}function $H(e){return{...e}}function FH(e){return e.value.display||e.value.reference||pr(e.value)}function zH(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const a=pl(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 PR=p.createContext({});function Eg(e){const t=p.useContext(PR),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((w,y)=>y===e.index?u:w)??[],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=f0(r,e.index)??vn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case jt.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case jt.boolean:return s.jsx(Bk,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(_n,{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 jt.decimal:return s.jsx(ve,{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 jt.integer:return s.jsx(ve,{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 jt.date:return s.jsx(ve,{type:"date",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case jt.dateTime:return s.jsx(Ps,{name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case jt.time:return s.jsx(ve,{type:"time",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case jt.string:case jt.url:return s.jsx(ve,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case jt.text:return s.jsx(Fs,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case jt.attachment:return s.jsx(te,{py:4,children:s.jsx(Ak,{path:"",name:a,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case jt.reference:return s.jsx(Nh,{name:a,required:n.required,targetTypes:CR(n),searchCriteria:NH(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case jt.quantity:return s.jsx(ks,{path:"",name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case jt.choice:case jt.openChoice:return qH(n)&&!n.answerValueSet?s.jsx(BH,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):s.jsx(UH,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function BH(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return s.jsx(kR,{});const i=vn({type:"QuestionnaireItemInitial",value:r},"value"),a=[""];for(const u of n.answerOption){const d=vn({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(IS(d))}const l=f0(o)??i;if(n.repeats){const{propertyName:u,data:d}=GH(e.item),f=HH(o);return s.jsx(mh,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[IS(i)],onChange:h=>{const m=DH(h,u,n);e.onChangeAnswer(m)}})}return s.jsx(It,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=vn({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+nn(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:Hs(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function UH(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(kR,{}):n.answerValueSet?s.jsx(Hk,{path:"",name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===jt.openChoice}):s.jsx(VH,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function VH(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,a=Ws("QuestionnaireItemAnswerOption","value[x]"),l=vn({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=vn({type:"QuestionnaireItemAnswerOption",value:m},"value");v!=null&&v.value&&(l&&pr(v)===pr(l)&&(u=g),c.push([g,v]))}const d=f0(i),f=WH(c,d);return s.jsx(Es.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],v="value"+nn(g.type);o({[v]:g.value})}},children:c.map(([h,m])=>s.jsx(Es,{id:h,value:h,py:4,label:s.jsx(Zr,{property:a,propertyType:m.type,value:m.value})},h))})}function kR(){return s.jsx(ve,{disabled:!0,placeholder:"No Answers Defined"})}function RR(e){return vn({type:"QuestionnaireItemAnswer",value:e},"value")}function f0(e,t=0){const n=e.answer;return RR((n==null?void 0:n[t])??{})}function HH(e){const t=e.answer;return t?t.map(r=>RR(r)).map(r=>Hs(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function WH(e,t){var n;return(n=e.find(r=>Ai(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function IS(e){if(e)return e.type==="CodeableConcept"?Ni(e.value):e.type==="Coding"?Hs(e.value):e.type==="Reference"?FH(e):e.value.toString()}function qH(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 GH(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=vn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+nn(n.type),o=(e.answerOption??[]).map(a=>({value:AS(a,r),label:AS(a,r)}));return{propertyName:r,data:o}}function AS(e,t){var n;return Hs(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const QH="_section_cpwxo_1",KH="_hovering_cpwxo_10",YH="_editing_cpwxo_14",XH="_questionBody_cpwxo_19",JH="_topActions_cpwxo_23",ZH="_bottomActions_cpwxo_32",eW="_movementActions_cpwxo_43",tW="_movementIcons_cpwxo_55",nW="_columnAlignment_cpwxo_59",rW="_linkIdInput_cpwxo_64",oW="_typeSelect_cpwxo_69",br={section:QH,hovering:KH,editing:YH,questionBody:XH,topActions:JH,bottomActions:ZH,movementActions:eW,movementIcons:tW,columnAlignment:nW,linkIdInput:rW,typeSelect:oW};function iW(e){const t=se(),n=St(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(cW(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(Ke,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(_R,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),s.jsx(oe,{type:"submit",children:"Save"})]})})}function _R(e){var b;const t=e.item,n=e.item,r=ni(e.item),o=r||n.type===jt.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(x){yt(x),e.setSelectedKey(e.item.id)}function d(x){yt(x),e.setHoverKey(e.item.id)}function f(x){var j;const C=c.current;e.onChange({...C,item:(j=C.item)==null?void 0:j.map(T=>T.id===x.id?x:T)})}function h(x,C){e.onChange({...e.item,item:[...e.item.item??[],x]},C)}function m(x){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.filter(j=>j!==x)})}function g(x,C){e.onChange({...c.current,[x]:C})}function v(x){e.onChange({...e.item,...x})}function w(x){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.map(j=>j===x?{...j,repeats:!j.repeats}:j)})}function y(x,C){const j=fW(e.item.item,x,C);e.onChange({...e.item,item:j})}const S=rt(br.section,{[br.editing]:a,[br.hovering]:l&&!a});return s.jsxs("div",{"data-testid":n.linkId,className:S,onClick:u,onMouseOver:d,onFocus:d,children:[s.jsx("div",{className:br.questionBody,children:a?s.jsxs(s.Fragment,{children:[r&&s.jsx(ve,{size:"xl",defaultValue:t.title,onBlur:x=>g("title",x.currentTarget.value)}),!r&&s.jsx(Fs,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:x=>g("text",x.currentTarget.value)}),n.type==="reference"&&s.jsx(lW,{item:n,onChange:v}),RH(n)&&s.jsx(sW,{item:n,onChange:x=>v(x)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(ge,{children:t.title}),n.text&&s.jsx("div",{children:n.text}),!o&&s.jsx(Eg,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(b=n.item)==null?void 0:b.map((x,C)=>s.jsx("div",{children:s.jsx(_R,{item:x,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:C===0,isLast:C===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>m(x),onRepeatable:w,onMoveUp:()=>y(C,-1),onMoveDown:()=>y(C,1)})},x.id)),!o&&s.jsx("div",{className:br.topActions,children:a?s.jsxs(s.Fragment,{children:[s.jsx(ve,{size:"xs",className:br.linkIdInput,defaultValue:n.linkId,onBlur:x=>g("linkId",x.currentTarget.value)}),!o&&s.jsx(It,{size:"xs",className:br.typeSelect,defaultValue:n.type,onChange:x=>g("type",x.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(q,{className:br.movementActions,children:s.jsxs(q,{className:br.columnAlignment,children:[!e.isFirst&&s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx($8,{"data-testid":"up-button",size:15,className:br.movementIcons})}),!e.isLast&&s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(L8,{"data-testid":"down-button",size:15,className:br.movementIcons})})]})}),s.jsxs("div",{className:br.bottomActions,children:[o&&s.jsxs(s.Fragment,{children:[s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),h({id:_s(),linkId:kg("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),h({id:_s(),linkId:kg("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),h(dW(),!0)},children:"Add Page"}),a&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Ze,{href:"#",onClick:x=>{x.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function sW(e){const t=Ws("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(ve,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(aW,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(q,{display:"flex",children:[s.jsx(Ze,{href:"#",onClick:r=>{yt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:_s()}]})},children:"Add choice"}),s.jsx(jh,{w:"lg"}),s.jsx(Ze,{href:"#",onClick:r=>{yt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function aW(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=fu({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(yl,{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(Ze,{href:"#",onClick:o=>{yt(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function lW(e){const t=CR(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(te,{children:[s.jsx(Wx,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Gp(e.item,t.map(i=>i===n?o:i)))}}),s.jsx(Ze,{href:"#",onClick:o=>{yt(o),e.onChange(Gp(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Ze,{href:"#",onClick:n=>{yt(n),e.onChange(Gp(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Tg=1,Pg=1;function kg(e){return e+Tg++}function _s(){return"id-"+Pg++}function cW(e){return{...e,id:e.id||_s(),item:DR(e.item)}}function DR(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Pg=Math.max(Pg,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Tg=Math.max(Tg,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||_s(),item:DR(t.item),answerOption:uW(t.answerOption)}))}function uW(e){if(e)return e.map(t=>({...t,id:t.id||_s()}))}function dW(){return{id:_s(),linkId:kg("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 fW(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 IR(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(hW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===jt.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==jt.choice&&t.type!==jt.openChoice;return t.type===jt.boolean?s.jsx(Eg,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):s.jsxs(vt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(Eg,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Ze,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function hW(e,t){if(e.type===jt.choice||e.type===jt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function AR(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=TR(e.item);n([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(NR,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,a)},i.id)),e.item.repeats&&s.jsx(Ze,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function NR(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(ge,{order:3,mb:"md",children:e.item.text}),s.jsx(Oe,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===jt.group?a.repeats?s.jsx(AR,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:n,onChange:o},a.linkId):s.jsx(NR,{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(IR,{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 pW(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,excludeButtons:d,checkForQuestionEnabled:f}=e,h=t.map(m=>{var w;const g=((w=n==null?void 0:n.item)==null?void 0:w.filter(y=>y.linkId===m.linkId))??[],v=m.type===jt.group?s.jsx(AR,{item:m,response:g,onChange:o,checkForQuestionEnabled:f},m.linkId):s.jsx(IR,{item:m,response:g==null?void 0:g[0],onChange:o,checkForQuestionEnabled:f},m.linkId);return c?s.jsx(Ja.Step,{label:m.text,children:v},m.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(Ja,{active:r??0,allowNextStepsSelect:!1,p:6,children:h}),!c&&s.jsx(Oe,{children:h}),!d&&s.jsx(mW,{activePage:r??0,numberOfPages:l,nextStep:c?i:void 0,prevStep:c?a:void 0,renderPages:c,submitButtonText:u})]})}function mW(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return s.jsxs(te,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(oe,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(oe,{onClick:o=>{const i=o.currentTarget.closest("form");e.nextStep&&i.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(oe,{type:"submit",children:e.submitButtonText??"Submit"})]})}function MR(e){const t=se(),n=t.getProfile(),[r,o]=p.useState(!1),i=St(e.questionnaire),[a,l]=p.useState(),[c,u]=p.useState(0),{onChange:d}=e;p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>{l(i?MH(i):void 0)},[i]);const f=p.useCallback(w=>{l(y=>{const S=(y==null?void 0:y.item)??[],x={resourceType:"QuestionnaireResponse",status:"in-progress",item:OR(S,Array.isArray(w)?w:[w])};if(d)try{d(x)}catch(C){console.error("Error invoking QuestionnaireForm.onChange callback",C)}return x})},[d]);function h(w){return _H(w,(a==null?void 0:a.item)??[])}if(!r||!i||!a)return null;const m=zH(i),g=()=>u(w=>w+1),v=()=>u(w=>w-1);return s.jsx(PR.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(Ke,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:st(i),subject:e.subject,source:Et(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(ge,{children:i.title}),s.jsx(pW,{items:i.item??[],response:a,onChange:f,renderPages:!e.disablePagination&&m>1,activePage:c,numberOfPages:m,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:h,nextStep:g,prevStep:v})]})})}function gW(e,t){const n=OR(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 OR(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(gW(o,a)),r.add(a.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const vW="_section_4m5it_1",yW={section:vW},xW=["gender","age","gestationalAge","context","appliesTo","category"],bW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function SW(e){e=Object.assign(bW,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[a,l]=p.useState(1);return p.useEffect(()=>{const g=CW(t,l);r(EW(g.qualifiedInterval||[],i))},[t]),s.jsxs(Ke,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(Oe,{children:n.map(g=>{var v;return s.jsx(wW,{unit:PW((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=>{yt(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:s.jsx(ff,{})}),s.jsx(te,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!kW(v));e.onSubmit({...t,qualifiedInterval:g})}function u(g){r(v=>[...v,g])}function d(g){r(v=>v.filter(w=>w.id!==g.id))}function f(g,v){r(w=>{w=[...w];const y=w.find(b=>b.id===g),S=y==null?void 0:y.intervals.findIndex(b=>b.id===v.id);return S!==void 0&&(y!=null&&y.intervals[S])&&(y.intervals[S]=v),w})}function h(g,v){v.id===void 0&&(v.id=`id-${a}`,l(w=>w+1)),r(w=>{w=[...w];const y=w.findIndex(S=>S.id===g);if(y!==-1){const S={...w[y]};v={...v,...S.filters},S.intervals=[...S.intervals,v],w[y]=S}return w})}function m(g,v){r(w=>{w=[...w];const y=w.find(S=>S.id===g);return y&&(y.intervals=y.intervals.filter(S=>S.id!==v.id)),w})}}function wW(e){const{intervalGroup:t,unit:n}=e;return s.jsx(pu,{"data-testid":t.id,className:yW.section,children:s.jsxs(Oe,{gap:"lg",children:[s.jsx(te,{justify:"flex-end",children:s.jsx(tn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{yt(r),e.onRemoveGroup(t)},children:s.jsx(df,{})},`remove-group-button-${t.id}`)}),s.jsx(jW,{intervalGroup:t,onChange:e.onChange}),s.jsx(cn,{}),t.intervals.map(r=>s.jsxs(Oe,{gap:"xs",children:[s.jsxs(te,{children:[s.jsx(ve,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{yt(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=>{yt(o),e.onRemove(t.id,r)},children:s.jsx(df,{})},`remove-interval-${r.id}`)]}),s.jsx(Kx,{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=>{yt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(ff,{})})]})})}function jW(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(Oe,{style:{maxWidth:"50%"},children:[s.jsx(te,{children:s.jsx(It,{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(te,{gap:"xs",children:[s.jsx(fe,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Kx,{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(It,{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(It,{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 CW(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 EW(e,t){let n=1;const r={};for(const o of e){const i=TW(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(xW.map(a=>[a,o[a]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function TW(e){var n,r;return[`gender=${e.gender}`,`age=${_c(e.age)}`,`gestationalAge=${_c(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 PW(e){return e&&(s6(e,"http://unitsofmeasure.org")||e.text)}function kW(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 RW(e){var u;const t=se(),n=St(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(ur,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,w,y,S,b,x;const h=d.resource&&c(d.resource),m=(w=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:w.valueReference,g=(S=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:S.valueReference;return s.jsxs(p.Fragment,{children:[s.jsx(ur.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(G8,{}):s.jsx(yz,{color:"gray"})}),s.jsxs(ur.Col,{span:9,p:"xs",children:[s.jsx(fe,{fw:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(xl,{value:(b=h==null?void 0:h.meta)==null?void 0:b.author})," on ",Fn((x=h==null?void 0:h.meta)==null?void 0:x.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(Jx,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(ur.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 LR(e,t){const n=_W(e,t);return DW(n,e,t)}function _W(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,w=0;u===-c||u!==c&&g.i<m.i?(w=m.i,v=m):(w=g.i+1,v=g),l[h]=void 0;let y=w-u,S={i:w,j:y,prev:IW(v),snake:!1};for(;w<n&&y<r&&e[w]===t[y];)w++,y++;if(w>S.i&&(S={i:w,j:y,prev:S,snake:!0}),l[d]=S,w>=n&&y>=r)return l[d]}l[a+c-1]=void 0}}function DW(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 IW(e){return e&&!e.snake&&e.prev?e.prev:e}function AW(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:pr(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 NW(n,t),MW(n),n}function NW(e,t){for(let n=1;n<t.length;n++){const r=LR(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 MW(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 OW="_container_1oj0p_1",LW="_root_1oj0p_5",$W="_startRow_1oj0p_20",FW="_normalRow_1oj0p_24",zW="_author_1oj0p_28",BW="_dateTime_1oj0p_32",UW="_lineNumber_1oj0p_37",VW="_line_1oj0p_37",HW="_pre_1oj0p_52",Co={container:OW,root:LW,startRow:$W,normalRow:FW,author:zW,dateTime:BW,lineNumber:UW,line:VW,pre:HW};function WW(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function qW(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return ua(n,"year");const r=Math.floor(t/2592e3);if(r>0)return ua(r,"month");const o=Math.floor(t/86400);if(o>0)return ua(o,"day");const i=Math.floor(t/3600);if(i>0)return ua(i,"hour");const a=Math.floor(t/60);return a>0?ua(a,"minute"):ua(t,"second")}function ua(e,t){return`${e} ${e===1?t:t+"s"} ago`}function GW(e){var a,l;const t=se(),[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=AW(n);return s.jsx("div",{className:Co.container,children:s.jsx("table",{className:Co.root,children:s.jsx("tbody",{children:i.map((c,u)=>s.jsxs("tr",{className:c.span>0?Co.startRow:Co.normalRow,children:[c.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Co.author,rowSpan:c.span,children:s.jsx(Fa,{value:c.meta.author,link:!0})}),s.jsx("td",{className:Co.dateTime,rowSpan:c.span,children:s.jsx(Ge,{to:WW(o,c.meta.versionId),children:qW(c.meta.lastUpdated)})})]}),s.jsx("td",{className:Co.lineNumber,children:u+1}),s.jsx("td",{className:Co.line,children:s.jsx("pre",{className:Co.pre,children:c.value})})]},"row-"+u))})})})}const QW="_removed_mgz0k_2",KW="_added_mgz0k_7",NS={removed:QW,added:KW};function YW(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=pr(t,!0).match(/[^\r\n]+/g),o=pr(n,!0).match(/[^\r\n]+/g),i=LR(r,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(XW,{delta:a},"delta"+l))})}function XW(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:NS.removed,children:e.delta.original.lines.join(`
|
|
533
|
+
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:NS.added,children:e.delta.revised.lines.join(`
|
|
534
|
+
`)}),"...",s.jsx("br",{})]})}const JW="_splitButton_1i0gi_1",ZW="_menuControl_1i0gi_6",MS={splitButton:JW,menuControl:ZW};function vf(e){const{outcome:t}=e,n=se(),r=St(e.defaultValue),[o,i]=p.useState(),[a,l]=p.useState(),c=n.getAccessPolicy(),u=At();p.useEffect(()=>{if(r)if(e.profileUrl){const h=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const m=Vs(h);if(m){i(m.name);const g=C8(r,m);l(g)}else console.error(`Schema not found for ${h}`)}).catch(m=>{console.error("Error in requestProfileSchema",m)})}else{const h=e.schemaName??(r==null?void 0:r.resourceType);n.requestSchema(h).then(()=>{l(r),i(h)}).catch(console.log)}},[n,r,e.schemaName,e.profileUrl]);const d=p.useMemo(()=>r&&lk(r,Ix.READ,c),[c,r]),f=p.useMemo(()=>n.isSuperAdmin()||!c||!Bt(a==null?void 0:a.resourceType)?!0:AF(c,a==null?void 0:a.resourceType),[n,c,a==null?void 0:a.resourceType]);return!o||!a?s.jsx("div",{children:"Loading..."}):f?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:h=>{h.preventDefault(),e.onSubmit&&e.onSubmit(a)},children:[s.jsxs(Oe,{mb:"xl",children:[s.jsx(vt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(ve,{name:"resourceType",defaultValue:a.resourceType,disabled:!0})}),s.jsx(vt,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(ve,{name:"id",defaultValue:a.id,disabled:!0})})]}),s.jsx(Xx,{path:a.resourceType,valuePath:a.resourceType,typeName:o,defaultValue:a,outcome:t,onChange:l,profileUrl:e.profileUrl,accessPolicyResource:d}),s.jsxs(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(oe,{type:"submit",className:rt((e.onPatch||e.onDelete)&&MS.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(J,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(J.Target,{children:s.jsx(tn,{variant:"filled",color:u.primaryColor,size:36,className:MS.menuControl,"aria-label":"More actions",children:s.jsx(Lx,{size:14,stroke:1.5})})}),s.jsxs(J.Dropdown,{children:[e.onPatch&&s.jsx(J.Item,{leftSection:s.jsx(Tk,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(a)},children:"Patch"}),e.onDelete&&s.jsx(J.Item,{color:"red",leftSection:s.jsx(Bx,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(a)},children:"Delete"})]})]})]})]}):s.jsxs(Bi,{color:"red",title:"Permission denied",icon:s.jsx(vl,{}),children:["Your access level prevents you from editing and creating ",a.resourceType," resources."]})}function eq(e){var o;const t=se(),[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(de,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(de.Thead,{children:s.jsxs(de.Tr,{children:[s.jsx(de.Th,{children:"Author"}),s.jsx(de.Th,{children:"Date"}),s.jsx(de.Th,{children:"Version"})]})}),s.jsx(de.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,a)=>s.jsx(tq,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function tq(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?s.jsxs(de.Tr,{children:[s.jsx(de.Td,{children:s.jsx(Fa,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(de.Td,{children:Fn((o=n.meta)==null?void 0:o.lastUpdated)}),s.jsx(de.Td,{children:s.jsx(Ge,{to:nq(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):s.jsx(de.Tr,{children:s.jsx(de.Td,{colSpan:3,children:De(t==null?void 0:t.outcome)})})}function nq(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function rq(e){const{serviceRequest:t,...n}=e;return s.jsx(Oh,{value:t,loadTimelineResources:async(r,o,i)=>{const a=`${o}/${i}`,l=100;return Promise.allSettled([r.readHistory("ServiceRequest",i),r.search("Communication",{"based-on":a,_count:l}),r.search("DiagnosticReport",{"based-on":a,_count:l}),r.search("Media",{"based-on":a,_count:l}),r.search("DocumentReference",{related:a,_count:l}),r.search("Task",{_filter:`based-on eq ${a} or focus eq ${a} or subject eq ${a}`,_count:l})])},createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",basedOn:[Et(r)],subject:r.subject,sender:Et(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",basedOn:[Et(r)],subject:r.subject,operator:Et(o),issued:new Date().toISOString(),content:i}),...n})}function oq(e){const t=se(),{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=>he({color:"red",message:De(c),autoClose:!1}))}return s.jsx(Ze,{onClick:()=>l(),...a,children:i})}function $R(e){const t=se(),[n,r]=p.useState();return s.jsxs(Ke,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(ht(i))}},children:[s.jsxs(mn,{style:{flexDirection:"column"},children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Create project"})]}),s.jsxs(Oe,{gap:"xl",children:[s.jsx(ve,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Je(n,"projectName")}),s.jsxs(fe,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Ze,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Ze,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"Create project"})})]})}function FR(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 zR(e){const t=se(),{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"){FR("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 iq={BASE_URL:"/",DEV:!1,GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.2.5-30739a930",MODE:"production",PROD:!0,RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",SSR:!1};function BR(e){var t;if(e)return e;if(typeof window<"u"){const n=window.location.protocol+"//"+window.location.host;if((((t=iq.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function UR(e){typeof grecaptcha>"u"&&FR("https://www.google.com/recaptcha/api.js?render="+e)}function VR(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function sq(e){const t=BR(e.googleClientId),n=e.recaptchaSiteKey,r=se(),[o,i]=p.useState(),a=hu(o,void 0);return p.useEffect(()=>{n&&UR(n)},[n]),s.jsxs(Ke,{onSubmit:async l=>{try{let c="";n&&(c=await VR(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(ht(c))}},children:[s.jsx(mn,{style:{flexDirection:"column"},children:e.children}),s.jsx(Mr,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(te,{justify:"center",p:"xl",style:{height:70},children:s.jsx(zR,{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(ht(c))}}})}),s.jsx(cn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(Oe,{gap:"xl",children:[s.jsx(ve,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Je(o,"firstName")}),s.jsx(ve,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Je(o,"lastName")}),s.jsx(ve,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Je(o,"email")}),s.jsx(Qr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Je(o,"password")}),s.jsxs(fe,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Ze,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Ze,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(fe,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Ze,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Ze,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(te,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(_n,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(oe,{type:"submit",children:"Create account"})]})]})}function aq(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=se(),[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(ht(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(Ne,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(sq,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx($R,{login:c,handleAuthResponse:h})]})}function lq(e){const[t,n]=p.useState();return t?s.jsx(uq,{email:t,...e}):s.jsx(cq,{setEmail:n,...e})}function cq(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...a}=e,l=se(),c=!e.disableGoogleAuth&&BR(e.googleClientId),[u,d]=p.useState(),f=hu(u,void 0),h=p.useCallback(async v=>{if(!v.authorizeUrl)return!1;const w=JSON.stringify({...await l.ensureCodeChallenge(a),domain:v.domain}),y=new URL(v.authorizeUrl);return y.searchParams.set("state",w),window.location.assign(y.toString()),!0},[l,a]),m=p.useCallback(async v=>{const w=await l.post("auth/method",{email:v.email});await h(w)||t(v.email)},[l,h,t]),g=p.useCallback(async v=>{try{const w=await l.startGoogleLogin({...a,googleCredential:v.credential});await h(w)||r(w)}catch(w){d(ht(w))}},[l,a,h,r]);return s.jsxs(Ke,{onSubmit:m,children:[s.jsx(mn,{style:{flexDirection:"column"},children:o}),s.jsx(Mr,{issues:f}),c&&s.jsxs(s.Fragment,{children:[s.jsx(te,{justify:"center",p:"xl",style:{height:70},children:s.jsx(zR,{googleClientId:c,handleGoogleCredential:g})}),!i&&s.jsx(cn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(ve,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Je(u,"email")}),s.jsxs(te,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Ze,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&s.jsx(oe,{type:"submit",children:"Next"})]})]})}function uq(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=se(),[a,l]=p.useState(),c=hu(a,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(ht(f)))},[i,o,n]);return s.jsxs(Ke,{onSubmit:u,children:[s.jsx(mn,{style:{flexDirection:"column"},children:r}),s.jsx(Mr,{issues:c}),s.jsx(Oe,{gap:"xl",children:s.jsx(Qr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Je(a,"password")})}),s.jsxs(te,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Ze,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(_n,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(oe,{type:"submit",children:"Sign in"})]})]})}function dq(e){const t=se(),n=Xc(),[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(ht(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>s.jsx(Me.Option,{value:f.id,children:s.jsx(fq,{...f})},f.id));return s.jsxs(Oe,{children:[s.jsxs(ws,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(ro,{size:32}),s.jsx(ge,{order:3,children:"Choose profile"})]}),s.jsx(Mr,{outcome:i}),s.jsxs(Me,{store:n,onOptionSubmit:u,children:[s.jsx(Me.EventsTarget,{children:s.jsx(ve,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(Me.Options,{children:d.length>0?d:s.jsx(Me.Empty,{children:"Nothing found..."})})})]})]})}function fq(e){var t,n;return s.jsxs(te,{children:[s.jsx(js,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(fe,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(fe,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function hq(e){const t=se();return s.jsx(Ke,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(Oe,{children:[s.jsxs(mn,{style:{flexDirection:"column"},children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Choose scope"})]}),s.jsx(Oe,{children:(e.scope??"openid").split(" ").map(n=>s.jsx(_n,{id:n,name:n,label:n,defaultChecked:!0},n))}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Set scope"})})]})})}function pq(e){const t=se(),[n,r]=p.useState();return s.jsx(Ke,{onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(De(i)))},children:s.jsxs(Oe,{children:[s.jsxs(mn,{style:{flexDirection:"column"},children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Enter MFA code"})]}),n&&s.jsx(Bi,{icon:s.jsx(vl,{size:16}),title:"Error",color:"red",children:n}),s.jsx(Oe,{children:s.jsx(ve,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Submit code"})})]})})}function HR(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=se(),[u,d]=p.useState(),f=p.useRef(!1),[h,m]=p.useState(!1),[g,v]=p.useState(),w=p.useCallback(b=>{a?a(b):c.processCode(b).then(()=>{r&&r()}).catch(x=>he({color:"red",message:De(x)}))},[c,a,r]),y=p.useCallback(b=>{m(!!b.mfaRequired),b.login&&d(b.login),b.memberships&&v(b.memberships),b.code&&(n?v(void 0):w(b.code))},[n,w]),S=p.useCallback(b=>{w(b.code)},[w]);return p.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(y).catch(b=>he({color:"red",message:De(b)})))},[c,t,f,u,y]),s.jsx(Ne,{width:450,px:"sm",py:"md",children:u?h?s.jsx(pq,{login:u,handleAuthResponse:y}):g?s.jsx(dq,{login:u,memberships:g,handleAuthResponse:y}):e.projectId==="new"?s.jsx($R,{login:u,handleAuthResponse:y}):e.chooseScopes?s.jsx(hq,{login:u,scope:e.scope,handleAuthResponse:S}):s.jsx("div",{children:"Success"}):s.jsx(lq,{onForgotPassword:o,onRegister:i,handleAuthResponse:y,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var WR,OS=qc;WR=OS.createRoot,OS.hydrateRoot;/**
|
|
535
|
+
* @remix-run/router v1.19.0
|
|
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 Ft(){return Ft=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ft.apply(this,arguments)}var Yt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Yt||(Yt={}));const LS="popstate";function mq(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return Mc("",{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:yu(o)}return vq(t,n,null,e)}function Ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function tl(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function gq(){return Math.random().toString(36).substr(2,8)}function $S(e,t){return{usr:e.state,key:e.key,idx:t}}function Mc(e,t,n,r){return n===void 0&&(n=null),Ft({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?ri(t):t,{state:n,key:t&&t.key||r||gq()})}function yu(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 ri(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 vq(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Yt.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Ft({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=Yt.Pop;let w=d(),y=w==null?null:w-u;u=w,c&&c({action:l,location:v.location,delta:y})}function h(w,y){l=Yt.Push;let S=Mc(v.location,w,y);u=d()+1;let b=$S(S,u),x=v.createHref(S);try{a.pushState(b,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(x)}i&&c&&c({action:l,location:v.location,delta:1})}function m(w,y){l=Yt.Replace;let S=Mc(v.location,w,y);u=d();let b=$S(S,u),x=v.createHref(S);a.replaceState(b,"",x),i&&c&&c({action:l,location:v.location,delta:0})}function g(w){let y=o.location.origin!=="null"?o.location.origin:o.location.href,S=typeof w=="string"?w:yu(w);return S=S.replace(/ $/,"%20"),Ue(y,"No window.location.(origin|href) available to create URL for href: "+S),new URL(S,y)}let v={get action(){return l},get location(){return e(o,a)},listen(w){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(LS,f),c=w,()=>{o.removeEventListener(LS,f),c=null}},createHref(w){return t(o,w)},createURL:g,encodeLocation(w){let y=g(w);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(w){return a.go(w)}};return v}var pt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pt||(pt={}));const yq=new Set(["lazy","caseSensitive","path","id","index","children"]);function xq(e){return e.index===!0}function Oc(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(Ue(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ue(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),xq(o)){let c=Ft({},o,t(o),{id:l});return r[l]=c,c}else{let c=Ft({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=Oc(o.children,t,a,r)),c}})}function os(e,t,n){return n===void 0&&(n="/"),Ed(e,t,n,!1)}function Ed(e,t,n,r){let o=typeof t=="string"?ri(t):t,i=xu(o.pathname||"/",n);if(i==null)return null;let a=qR(e);Sq(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=Iq(i);l=_q(a[c],u,r)}return l}function bq(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 qR(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("/")&&(Ue(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=ki([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Ue(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),qR(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:kq(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 GR(i.path))o(i,a,c)}),t}function GR(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=GR(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 Sq(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Rq(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const wq=/^:[\w-]+$/,jq=3,Cq=2,Eq=1,Tq=10,Pq=-2,FS=e=>e==="*";function kq(e,t){let n=e.split("/"),r=n.length;return n.some(FS)&&(r+=Pq),t&&(r+=Cq),n.filter(o=>!FS(o)).reduce((o,i)=>o+(wq.test(i)?jq:i===""?Eq:Tq),r)}function Rq(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 _q(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=zS({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=zS({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:ki([i,f.pathname]),pathnameBase:Mq(ki([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=ki([i,f.pathnameBase]))}return a}function zS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dq(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 Dq(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),tl(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 Iq(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return tl(!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 xu(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 Aq(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ri(e):e;return{pathname:n?n.startsWith("/")?n:Nq(n,t):t,search:Oq(r),hash:Lq(o)}}function Nq(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 Qp(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 QR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function KR(e,t){let n=QR(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function YR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=ri(e):(o=Ft({},e),Ue(!o.pathname||!o.pathname.includes("?"),Qp("?","pathname","search",o)),Ue(!o.pathname||!o.pathname.includes("#"),Qp("#","pathname","hash",o)),Ue(!o.search||!o.search.includes("#"),Qp("#","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=Aq(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const ki=e=>e.join("/").replace(/\/\/+/g,"/"),Mq=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Oq=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Lq=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class yf{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 $h(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const XR=["post","put","patch","delete"],$q=new Set(XR),Fq=["get",...XR],zq=new Set(Fq),Bq=new Set([301,302,303,307,308]),Uq=new Set([307,308]),Kp={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vq={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ll={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},h0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hq=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),JR="remix-router-transitions";function Wq(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ue(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let I=e.detectErrorBoundary;o=M=>({hasErrorBoundary:I(M)})}else o=Hq;let i={},a=Oc(e.routes,o,void 0,i),l,c=e.basename||"/",u=e.unstable_dataStrategy||Yq,d=e.unstable_patchRoutesOnMiss,f=Ft({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,m=new Set,g=null,v=null,w=null,y=e.hydrationData!=null,S=os(a,e.history.location,c),b=null;if(S==null&&!d){let I=An(404,{pathname:e.history.location.pathname}),{matches:M,route:z}=YS(a);S=M,b={[z.id]:I}}S&&!e.hydrationData&&Kt(S,a,e.history.location.pathname).active&&(S=null);let x;if(S)if(S.some(I=>I.route.lazy))x=!1;else if(!S.some(I=>I.route.loader))x=!0;else if(f.v7_partialHydration){let I=e.hydrationData?e.hydrationData.loaderData:null,M=e.hydrationData?e.hydrationData.errors:null,z=G=>G.route.loader?typeof G.route.loader=="function"&&G.route.loader.hydrate===!0?!1:I&&I[G.route.id]!==void 0||M&&M[G.route.id]!==void 0:!0;if(M){let G=S.findIndex(le=>M[le.route.id]!==void 0);x=S.slice(0,G+1).every(z)}else x=S.every(z)}else x=e.hydrationData!=null;else if(x=!1,S=[],f.v7_partialHydration){let I=Kt(null,a,e.history.location.pathname);I.active&&I.matches&&(S=I.matches)}let C,j={historyAction:e.history.action,location:e.history.location,matches:S,initialized:x,navigation:Kp,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=Yt.Pop,E=!1,_,R=!1,A=new Map,L=null,U=!1,N=!1,F=[],D=new Set,k=new Map,P=0,$=-1,O=new Map,V=new Set,K=new Map,ie=new Map,Re=new Set,ae=new Map,Ee=new Map,Fe=new Map,me=!1;function Le(){if(h=e.history.listen(I=>{let{action:M,location:z,delta:G}=I;if(me){me=!1;return}tl(Ee.size===0||G!=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 le=Ys({currentLocation:j.location,nextLocation:z,historyAction:M});if(le&&G!=null){me=!0,e.history.go(G*-1),Qi(le,{state:"blocked",location:z,proceed(){Qi(le,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),e.history.go(G)},reset(){let je=new Map(j.blockers);je.set(le,Ll),Ve({blockers:je})}});return}return Qe(M,z)}),n){cG(t,A);let I=()=>uG(t,A);t.addEventListener("pagehide",I),L=()=>t.removeEventListener("pagehide",I)}return j.initialized||Qe(Yt.Pop,j.location,{initialHydration:!0}),C}function nt(){h&&h(),L&&L(),m.clear(),_&&_.abort(),j.fetchers.forEach((I,M)=>rr(M)),j.blockers.forEach((I,M)=>Cu(M))}function Tt(I){return m.add(I),()=>m.delete(I)}function Ve(I,M){M===void 0&&(M={}),j=Ft({},j,I);let z=[],G=[];f.v7_fetcherPersist&&j.fetchers.forEach((le,je)=>{le.state==="idle"&&(Re.has(je)?G.push(je):z.push(je))}),[...m].forEach(le=>le(j,{deletedFetchers:G,unstable_viewTransitionOpts:M.viewTransitionOpts,unstable_flushSync:M.flushSync===!0})),f.v7_fetcherPersist&&(z.forEach(le=>j.fetchers.delete(le)),G.forEach(le=>rr(le)))}function Te(I,M,z){var G,le;let{flushSync:je}=z===void 0?{}:z,Ie=j.actionData!=null&&j.navigation.formMethod!=null&&Ur(j.navigation.formMethod)&&j.navigation.state==="loading"&&((G=I.state)==null?void 0:G._isRedirect)!==!0,Y;M.actionData?Object.keys(M.actionData).length>0?Y=M.actionData:Y=null:Ie?Y=j.actionData:Y=null;let $e=M.loaderData?QS(j.loaderData,M.loaderData,M.matches||[],M.errors):j.loaderData,ke=j.blockers;ke.size>0&&(ke=new Map(ke),ke.forEach((ut,mt)=>ke.set(mt,Ll)));let _e=E===!0||j.navigation.formMethod!=null&&Ur(j.navigation.formMethod)&&((le=I.state)==null?void 0:le._isRedirect)!==!0;l&&(a=l,l=void 0),U||T===Yt.Pop||(T===Yt.Push?e.history.push(I,I.state):T===Yt.Replace&&e.history.replace(I,I.state));let ot;if(T===Yt.Pop){let ut=A.get(j.location.pathname);ut&&ut.has(I.pathname)?ot={currentLocation:j.location,nextLocation:I}:A.has(I.pathname)&&(ot={currentLocation:I,nextLocation:j.location})}else if(R){let ut=A.get(j.location.pathname);ut?ut.add(I.pathname):(ut=new Set([I.pathname]),A.set(j.location.pathname,ut)),ot={currentLocation:j.location,nextLocation:I}}Ve(Ft({},M,{actionData:Y,loaderData:$e,historyAction:T,location:I,initialized:!0,navigation:Kp,revalidation:"idle",restoreScrollPosition:Eu(I,M.matches||j.matches),preventScrollReset:_e,blockers:ke}),{viewTransitionOpts:ot,flushSync:je===!0}),T=Yt.Pop,E=!1,R=!1,U=!1,N=!1,F=[]}async function Pe(I,M){if(typeof I=="number"){e.history.go(I);return}let z=Rg(j.location,j.matches,c,f.v7_prependBasename,I,f.v7_relativeSplatPath,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:G,submission:le,error:je}=BS(f.v7_normalizeFormMethod,!1,z,M),Ie=j.location,Y=Mc(j.location,G,M&&M.state);Y=Ft({},Y,e.history.encodeLocation(Y));let $e=M&&M.replace!=null?M.replace:void 0,ke=Yt.Push;$e===!0?ke=Yt.Replace:$e===!1||le!=null&&Ur(le.formMethod)&&le.formAction===j.location.pathname+j.location.search&&(ke=Yt.Replace);let _e=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,ot=(M&&M.unstable_flushSync)===!0,ut=Ys({currentLocation:Ie,nextLocation:Y,historyAction:ke});if(ut){Qi(ut,{state:"blocked",location:Y,proceed(){Qi(ut,{state:"proceeding",proceed:void 0,reset:void 0,location:Y}),Pe(I,M)},reset(){let mt=new Map(j.blockers);mt.set(ut,Ll),Ve({blockers:mt})}});return}return await Qe(ke,Y,{submission:le,pendingError:je,preventScrollReset:_e,replace:M&&M.replace,enableViewTransition:M&&M.unstable_viewTransition,flushSync:ot})}function Xe(){if(Pt(),Ve({revalidation:"loading"}),j.navigation.state!=="submitting"){if(j.navigation.state==="idle"){Qe(j.historyAction,j.location,{startUninterruptedRevalidation:!0});return}Qe(T||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation})}}async function Qe(I,M,z){_&&_.abort(),_=null,T=I,U=(z&&z.startUninterruptedRevalidation)===!0,Qh(j.location,j.matches),E=(z&&z.preventScrollReset)===!0,R=(z&&z.enableViewTransition)===!0;let G=l||a,le=z&&z.overrideNavigation,je=os(G,M,c),Ie=(z&&z.flushSync)===!0,Y=Kt(je,G,M.pathname);if(Y.active&&Y.matches&&(je=Y.matches),!je){let{error:it,notFoundMatches:hn,route:Zt}=Ki(M.pathname);Te(M,{matches:hn,loaderData:{},errors:{[Zt.id]:it}},{flushSync:Ie});return}if(j.initialized&&!N&&nG(j.location,M)&&!(z&&z.submission&&Ur(z.submission.formMethod))){Te(M,{matches:je},{flushSync:Ie});return}_=new AbortController;let $e=da(e.history,M,_.signal,z&&z.submission),ke;if(z&&z.pendingError)ke=[Ra(je).route.id,{type:pt.error,error:z.pendingError}];else if(z&&z.submission&&Ur(z.submission.formMethod)){let it=await Z($e,M,z.submission,je,Y.active,{replace:z.replace,flushSync:Ie});if(it.shortCircuited)return;if(it.pendingActionResult){let[hn,Zt]=it.pendingActionResult;if(sr(Zt)&&$h(Zt.error)&&Zt.error.status===404){_=null,Te(M,{matches:it.matches,loaderData:{},errors:{[hn]:Zt.error}});return}}je=it.matches||je,ke=it.pendingActionResult,le=Yp(M,z.submission),Ie=!1,Y.active=!1,$e=da(e.history,$e.url,$e.signal)}let{shortCircuited:_e,matches:ot,loaderData:ut,errors:mt}=await ue($e,M,je,Y.active,le,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,z&&z.initialHydration===!0,Ie,ke);_e||(_=null,Te(M,Ft({matches:ot||je},KS(ke),{loaderData:ut,errors:mt})))}async function Z(I,M,z,G,le,je){je===void 0&&(je={}),Pt();let Ie=aG(M,z);if(Ve({navigation:Ie},{flushSync:je.flushSync===!0}),le){let ke=await oo(G,M.pathname,I.signal);if(ke.type==="aborted")return{shortCircuited:!0};if(ke.type==="error"){let{boundaryId:_e,error:ot}=Or(M.pathname,ke);return{matches:ke.partialMatches,pendingActionResult:[_e,{type:pt.error,error:ot}]}}else if(ke.matches)G=ke.matches;else{let{notFoundMatches:_e,error:ot,route:ut}=Ki(M.pathname);return{matches:_e,pendingActionResult:[ut.id,{type:pt.error,error:ot}]}}}let Y,$e=ql(G,M);if(!$e.route.action&&!$e.route.lazy)Y={type:pt.error,error:An(405,{method:I.method,pathname:M.pathname,routeId:$e.route.id})};else if(Y=(await Be("action",I,[$e],G))[0],I.signal.aborted)return{shortCircuited:!0};if(fs(Y)){let ke;return je&&je.replace!=null?ke=je.replace:ke=WS(Y.response.headers.get("Location"),new URL(I.url),c)===j.location.pathname+j.location.search,await xe(I,Y,{submission:z,replace:ke}),{shortCircuited:!0}}if(ds(Y))throw An(400,{type:"defer-action"});if(sr(Y)){let ke=Ra(G,$e.route.id);return(je&&je.replace)!==!0&&(T=Yt.Push),{matches:G,pendingActionResult:[ke.route.id,Y]}}return{matches:G,pendingActionResult:[$e.route.id,Y]}}async function ue(I,M,z,G,le,je,Ie,Y,$e,ke,_e){let ot=le||Yp(M,je),ut=je||Ie||ew(ot),mt=!U&&(!f.v7_partialHydration||!$e);if(G){if(mt){let Ht=we(_e);Ve(Ft({navigation:ot},Ht!==void 0?{actionData:Ht}:{}),{flushSync:ke})}let He=await oo(z,M.pathname,I.signal);if(He.type==="aborted")return{shortCircuited:!0};if(He.type==="error"){let{boundaryId:Ht,error:or}=Or(M.pathname,He);return{matches:He.partialMatches,loaderData:{},errors:{[Ht]:or}}}else if(He.matches)z=He.matches;else{let{error:Ht,notFoundMatches:or,route:Mt}=Ki(M.pathname);return{matches:or,loaderData:{},errors:{[Mt.id]:Ht}}}}let it=l||a,[hn,Zt]=US(e.history,j,z,ut,M,f.v7_partialHydration&&$e===!0,f.v7_skipActionErrorRevalidation,N,F,D,Re,K,V,it,c,_e);if(jn(He=>!(z&&z.some(Ht=>Ht.route.id===He))||hn&&hn.some(Ht=>Ht.route.id===He)),$=++P,hn.length===0&&Zt.length===0){let He=ju();return Te(M,Ft({matches:z,loaderData:{},errors:_e&&sr(_e[1])?{[_e[0]]:_e[1].error}:null},KS(_e),He?{fetchers:new Map(j.fetchers)}:{}),{flushSync:ke}),{shortCircuited:!0}}if(mt){let He={};if(!G){He.navigation=ot;let Ht=we(_e);Ht!==void 0&&(He.actionData=Ht)}Zt.length>0&&(He.fetchers=We(Zt)),Ve(He,{flushSync:ke})}Zt.forEach(He=>{k.has(He.key)&&vr(He.key),He.controller&&k.set(He.key,He.controller)});let jl=()=>Zt.forEach(He=>vr(He.key));_&&_.signal.addEventListener("abort",jl);let{loaderResults:ii,fetcherResults:Js}=await Nt(j.matches,z,hn,Zt,I);if(I.signal.aborted)return{shortCircuited:!0};_&&_.signal.removeEventListener("abort",jl),Zt.forEach(He=>k.delete(He.key));let Zs=XS([...ii,...Js]);if(Zs){if(Zs.idx>=hn.length){let He=Zt[Zs.idx-hn.length].key;V.add(He)}return await xe(I,Zs.result,{replace:Y}),{shortCircuited:!0}}let{loaderData:ea,errors:io}=GS(j,z,hn,ii,_e,Zt,Js,ae);ae.forEach((He,Ht)=>{He.subscribe(or=>{(or||He.done)&&ae.delete(Ht)})}),f.v7_partialHydration&&$e&&j.errors&&Object.entries(j.errors).filter(He=>{let[Ht]=He;return!hn.some(or=>or.route.id===Ht)}).forEach(He=>{let[Ht,or]=He;io=Object.assign(io||{},{[Ht]:or})});let Tu=ju(),Pu=yr($),ku=Tu||Pu||Zt.length>0;return Ft({matches:z,loaderData:ea,errors:io},ku?{fetchers:new Map(j.fetchers)}:{})}function we(I){if(I&&!sr(I[1]))return{[I[0]]:I[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function We(I){return I.forEach(M=>{let z=j.fetchers.get(M.key),G=$l(void 0,z?z.data:void 0);j.fetchers.set(M.key,G)}),new Map(j.fetchers)}function ne(I,M,z,G){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.");k.has(I)&&vr(I);let le=(G&&G.unstable_flushSync)===!0,je=l||a,Ie=Rg(j.location,j.matches,c,f.v7_prependBasename,z,f.v7_relativeSplatPath,M,G==null?void 0:G.relative),Y=os(je,Ie,c),$e=Kt(Y,je,Ie);if($e.active&&$e.matches&&(Y=$e.matches),!Y){wt(I,M,An(404,{pathname:Ie}),{flushSync:le});return}let{path:ke,submission:_e,error:ot}=BS(f.v7_normalizeFormMethod,!0,Ie,G);if(ot){wt(I,M,ot,{flushSync:le});return}let ut=ql(Y,ke);if(E=(G&&G.preventScrollReset)===!0,_e&&Ur(_e.formMethod)){pe(I,M,ke,ut,Y,$e.active,le,_e);return}K.set(I,{routeId:M,path:ke}),Q(I,M,ke,ut,Y,$e.active,le,_e)}async function pe(I,M,z,G,le,je,Ie,Y){Pt(),K.delete(I);function $e(Mt){if(!Mt.route.action&&!Mt.route.lazy){let wo=An(405,{method:Y.formMethod,pathname:z,routeId:M});return wt(I,M,wo,{flushSync:Ie}),!0}return!1}if(!je&&$e(G))return;let ke=j.fetchers.get(I);$t(I,lG(Y,ke),{flushSync:Ie});let _e=new AbortController,ot=da(e.history,z,_e.signal,Y);if(je){let Mt=await oo(le,z,ot.signal);if(Mt.type==="aborted")return;if(Mt.type==="error"){let{error:wo}=Or(z,Mt);wt(I,M,wo,{flushSync:Ie});return}else if(Mt.matches){if(le=Mt.matches,G=ql(le,z),$e(G))return}else{wt(I,M,An(404,{pathname:z}),{flushSync:Ie});return}}k.set(I,_e);let ut=P,it=(await Be("action",ot,[G],le))[0];if(ot.signal.aborted){k.get(I)===_e&&k.delete(I);return}if(f.v7_fetcherPersist&&Re.has(I)){if(fs(it)||sr(it)){$t(I,li(void 0));return}}else{if(fs(it))if(k.delete(I),$>ut){$t(I,li(void 0));return}else return V.add(I),$t(I,$l(Y)),xe(ot,it,{fetcherSubmission:Y});if(sr(it)){wt(I,M,it.error);return}}if(ds(it))throw An(400,{type:"defer-action"});let hn=j.navigation.location||j.location,Zt=da(e.history,hn,_e.signal),jl=l||a,ii=j.navigation.state!=="idle"?os(jl,j.navigation.location,c):j.matches;Ue(ii,"Didn't find any matches after fetcher action");let Js=++P;O.set(I,Js);let Zs=$l(Y,it.data);j.fetchers.set(I,Zs);let[ea,io]=US(e.history,j,ii,Y,hn,!1,f.v7_skipActionErrorRevalidation,N,F,D,Re,K,V,jl,c,[G.route.id,it]);io.filter(Mt=>Mt.key!==I).forEach(Mt=>{let wo=Mt.key,w0=j.fetchers.get(wo),R2=$l(void 0,w0?w0.data:void 0);j.fetchers.set(wo,R2),k.has(wo)&&vr(wo),Mt.controller&&k.set(wo,Mt.controller)}),Ve({fetchers:new Map(j.fetchers)});let Tu=()=>io.forEach(Mt=>vr(Mt.key));_e.signal.addEventListener("abort",Tu);let{loaderResults:Pu,fetcherResults:ku}=await Nt(j.matches,ii,ea,io,Zt);if(_e.signal.aborted)return;_e.signal.removeEventListener("abort",Tu),O.delete(I),k.delete(I),io.forEach(Mt=>k.delete(Mt.key));let He=XS([...Pu,...ku]);if(He){if(He.idx>=ea.length){let Mt=io[He.idx-ea.length].key;V.add(Mt)}return xe(Zt,He.result)}let{loaderData:Ht,errors:or}=GS(j,j.matches,ea,Pu,void 0,io,ku,ae);if(j.fetchers.has(I)){let Mt=li(it.data);j.fetchers.set(I,Mt)}yr(Js),j.navigation.state==="loading"&&Js>$?(Ue(T,"Expected pending action"),_&&_.abort(),Te(j.navigation.location,{matches:ii,loaderData:Ht,errors:or,fetchers:new Map(j.fetchers)})):(Ve({errors:or,loaderData:QS(j.loaderData,Ht,ii,or),fetchers:new Map(j.fetchers)}),N=!1)}async function Q(I,M,z,G,le,je,Ie,Y){let $e=j.fetchers.get(I);$t(I,$l(Y,$e?$e.data:void 0),{flushSync:Ie});let ke=new AbortController,_e=da(e.history,z,ke.signal);if(je){let it=await oo(le,z,_e.signal);if(it.type==="aborted")return;if(it.type==="error"){let{error:hn}=Or(z,it);wt(I,M,hn,{flushSync:Ie});return}else if(it.matches)le=it.matches,G=ql(le,z);else{wt(I,M,An(404,{pathname:z}),{flushSync:Ie});return}}k.set(I,ke);let ot=P,mt=(await Be("loader",_e,[G],le))[0];if(ds(mt)&&(mt=await r2(mt,_e.signal,!0)||mt),k.get(I)===ke&&k.delete(I),!_e.signal.aborted){if(Re.has(I)){$t(I,li(void 0));return}if(fs(mt))if($>ot){$t(I,li(void 0));return}else{V.add(I),await xe(_e,mt);return}if(sr(mt)){wt(I,M,mt.error);return}Ue(!ds(mt),"Unhandled fetcher deferred data"),$t(I,li(mt.data))}}async function xe(I,M,z){let{submission:G,fetcherSubmission:le,replace:je}=z===void 0?{}:z;M.response.headers.has("X-Remix-Revalidate")&&(N=!0);let Ie=M.response.headers.get("Location");Ue(Ie,"Expected a Location header on the redirect Response"),Ie=WS(Ie,new URL(I.url),c);let Y=Mc(j.location,Ie,{_isRedirect:!0});if(n){let mt=!1;if(M.response.headers.has("X-Remix-Reload-Document"))mt=!0;else if(h0.test(Ie)){const it=e.history.createURL(Ie);mt=it.origin!==t.location.origin||xu(it.pathname,c)==null}if(mt){je?t.location.replace(Ie):t.location.assign(Ie);return}}_=null;let $e=je===!0||M.response.headers.has("X-Remix-Replace")?Yt.Replace:Yt.Push,{formMethod:ke,formAction:_e,formEncType:ot}=j.navigation;!G&&!le&&ke&&_e&&ot&&(G=ew(j.navigation));let ut=G||le;if(Uq.has(M.response.status)&&ut&&Ur(ut.formMethod))await Qe($e,Y,{submission:Ft({},ut,{formAction:Ie}),preventScrollReset:E});else{let mt=Yp(Y,G);await Qe($e,Y,{overrideNavigation:mt,fetcherSubmission:le,preventScrollReset:E})}}async function Be(I,M,z,G){try{let le=await Xq(u,I,M,z,G,i,o);return await Promise.all(le.map((je,Ie)=>{if(oG(je)){let Y=je.result;return{type:pt.redirect,response:eG(Y,M,z[Ie].route.id,G,c,f.v7_relativeSplatPath)}}return Zq(je)}))}catch(le){return z.map(()=>({type:pt.error,error:le}))}}async function Nt(I,M,z,G,le){let[je,...Ie]=await Promise.all([z.length?Be("loader",le,z,M):[],...G.map(Y=>{if(Y.matches&&Y.match&&Y.controller){let $e=da(e.history,Y.path,Y.controller.signal);return Be("loader",$e,[Y.match],Y.matches).then(ke=>ke[0])}else return Promise.resolve({type:pt.error,error:An(404,{pathname:Y.path})})})]);return await Promise.all([ZS(I,z,je,je.map(()=>le.signal),!1,j.loaderData),ZS(I,G.map(Y=>Y.match),Ie,G.map(Y=>Y.controller?Y.controller.signal:null),!0)]),{loaderResults:je,fetcherResults:Ie}}function Pt(){N=!0,F.push(...jn()),K.forEach((I,M)=>{k.has(M)&&(D.add(M),vr(M))})}function $t(I,M,z){z===void 0&&(z={}),j.fetchers.set(I,M),Ve({fetchers:new Map(j.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function wt(I,M,z,G){G===void 0&&(G={});let le=Ra(j.matches,M);rr(I),Ve({errors:{[le.route.id]:z},fetchers:new Map(j.fetchers)},{flushSync:(G&&G.flushSync)===!0})}function wn(I){return f.v7_fetcherPersist&&(ie.set(I,(ie.get(I)||0)+1),Re.has(I)&&Re.delete(I)),j.fetchers.get(I)||Vq}function rr(I){let M=j.fetchers.get(I);k.has(I)&&!(M&&M.state==="loading"&&O.has(I))&&vr(I),K.delete(I),O.delete(I),V.delete(I),Re.delete(I),D.delete(I),j.fetchers.delete(I)}function Gi(I){if(f.v7_fetcherPersist){let M=(ie.get(I)||0)-1;M<=0?(ie.delete(I),Re.add(I)):ie.set(I,M)}else rr(I);Ve({fetchers:new Map(j.fetchers)})}function vr(I){let M=k.get(I);Ue(M,"Expected fetch controller: "+I),M.abort(),k.delete(I)}function wu(I){for(let M of I){let z=wn(M),G=li(z.data);j.fetchers.set(M,G)}}function ju(){let I=[],M=!1;for(let z of V){let G=j.fetchers.get(z);Ue(G,"Expected fetcher: "+z),G.state==="loading"&&(V.delete(z),I.push(z),M=!0)}return wu(I),M}function yr(I){let M=[];for(let[z,G]of O)if(G<I){let le=j.fetchers.get(z);Ue(le,"Expected fetcher: "+z),le.state==="loading"&&(vr(z),O.delete(z),M.push(z))}return wu(M),M.length>0}function Sl(I,M){let z=j.blockers.get(I)||Ll;return Ee.get(I)!==M&&Ee.set(I,M),z}function Cu(I){j.blockers.delete(I),Ee.delete(I)}function Qi(I,M){let z=j.blockers.get(I)||Ll;Ue(z.state==="unblocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="proceeding"||z.state==="blocked"&&M.state==="unblocked"||z.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+z.state+" -> "+M.state);let G=new Map(j.blockers);G.set(I,M),Ve({blockers:G})}function Ys(I){let{currentLocation:M,nextLocation:z,historyAction:G}=I;if(Ee.size===0)return;Ee.size>1&&tl(!1,"A router only supports one blocker at a time");let le=Array.from(Ee.entries()),[je,Ie]=le[le.length-1],Y=j.blockers.get(je);if(!(Y&&Y.state==="proceeding")&&Ie({currentLocation:M,nextLocation:z,historyAction:G}))return je}function Ki(I){let M=An(404,{pathname:I}),z=l||a,{matches:G,route:le}=YS(z);return jn(),{notFoundMatches:G,route:le,error:M}}function Or(I,M){return{boundaryId:Ra(M.partialMatches).route.id,error:An(400,{type:"route-discovery",pathname:I,message:M.error!=null&&"message"in M.error?M.error:String(M.error)})}}function jn(I){let M=[];return ae.forEach((z,G)=>{(!I||I(G))&&(z.cancel(),M.push(G),ae.delete(G))}),M}function qh(I,M,z){if(g=I,w=M,v=z||null,!y&&j.navigation===Kp){y=!0;let G=Eu(j.location,j.matches);G!=null&&Ve({restoreScrollPosition:G})}return()=>{g=null,w=null,v=null}}function Gh(I,M){return v&&v(I,M.map(G=>bq(G,j.loaderData)))||I.key}function Qh(I,M){if(g&&w){let z=Gh(I,M);g[z]=w()}}function Eu(I,M){if(g){let z=Gh(I,M),G=g[z];if(typeof G=="number")return G}return null}function Kt(I,M,z){if(d)if(I){let G=I[I.length-1].route;if(G.path&&(G.path==="*"||G.path.endsWith("/*")))return{active:!0,matches:Ed(M,z,c,!0)}}else return{active:!0,matches:Ed(M,z,c,!0)||[]};return{active:!1,matches:null}}async function oo(I,M,z){let G=I,le=G.length>0?G[G.length-1].route:null;for(;;){let je=l==null,Ie=l||a;try{await Kq(d,M,G,Ie,i,o,Fe,z)}catch(_e){return{type:"error",error:_e,partialMatches:G}}finally{je&&(a=[...a])}if(z.aborted)return{type:"aborted"};let Y=os(Ie,M,c),$e=!1;if(Y){let _e=Y[Y.length-1].route;if(_e.index)return{type:"success",matches:Y};if(_e.path&&_e.path.length>0)if(_e.path==="*")$e=!0;else return{type:"success",matches:Y}}let ke=Ed(Ie,M,c,!0);if(!ke||G.map(_e=>_e.route.id).join("-")===ke.map(_e=>_e.route.id).join("-"))return{type:"success",matches:$e?Y:null};if(G=ke,le=G[G.length-1].route,le.path==="*")return{type:"success",matches:G}}}function wl(I){i={},l=Oc(I,o,void 0,i)}function Xs(I,M){let z=l==null;e2(I,M,l||a,i,o),z&&(a=[...a],Ve({}))}return C={get basename(){return c},get future(){return f},get state(){return j},get routes(){return a},get window(){return t},initialize:Le,subscribe:Tt,enableScrollRestoration:qh,navigate:Pe,fetch:ne,revalidate:Xe,createHref:I=>e.history.createHref(I),encodeLocation:I=>e.history.encodeLocation(I),getFetcher:wn,deleteFetcher:Gi,dispose:nt,getBlocker:Sl,deleteBlocker:Cu,patchRoutes:Xs,_internalFetchControllers:k,_internalActiveDeferreds:ae,_internalSetRoutes:wl},C}function qq(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Rg(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=YR(o||".",KR(c,i),xu(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&&!p0(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:ki([n,d.pathname])),yu(d)}function BS(e,t,n,r){if(!r||!qq(r))return{path:n};if(r.formMethod&&!sG(r.formMethod))return{path:n,error:An(405,{method:r.formMethod})};let o=()=>({path:n,error:An(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=t2(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Ur(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,w]=g;return""+m+v+"="+w+`
|
|
544
|
+
`},""):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(!Ur(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()}}}Ue(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=_g(r.formData),u=r.formData;else if(r.body instanceof FormData)c=_g(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=qS(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=qS(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(Ur(d.formMethod))return{path:n,submission:d};let f=ri(n);return t&&f.search&&p0(f.search)&&c.append("index",""),f.search="?"+c,{path:yu(f),submission:d}}function Gq(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 US(e,t,n,r,o,i,a,l,c,u,d,f,h,m,g,v){let w=v?sr(v[1])?v[1].error:v[1].data:void 0,y=e.createURL(t.location),S=e.createURL(o),b=v&&sr(v[1])?v[0]:void 0,x=b?Gq(n,b):n,C=v?v[1].statusCode:void 0,j=a&&C&&C>=400,T=x.filter((_,R)=>{let{route:A}=_;if(A.lazy)return!0;if(A.loader==null)return!1;if(i)return typeof A.loader!="function"||A.loader.hydrate?!0:t.loaderData[A.id]===void 0&&(!t.errors||t.errors[A.id]===void 0);if(Qq(t.loaderData,t.matches[R],_)||c.some(N=>N===_.route.id))return!0;let L=t.matches[R],U=_;return VS(_,Ft({currentUrl:y,currentParams:L.params,nextUrl:S,nextParams:U.params},r,{actionResult:w,actionStatus:C,defaultShouldRevalidate:j?!1:l||y.pathname+y.search===S.pathname+S.search||y.search!==S.search||ZR(L,U)}))}),E=[];return f.forEach((_,R)=>{if(i||!n.some(F=>F.route.id===_.routeId)||d.has(R))return;let A=os(m,_.path,g);if(!A){E.push({key:R,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let L=t.fetchers.get(R),U=ql(A,_.path),N=!1;h.has(R)?N=!1:u.has(R)?(u.delete(R),N=!0):L&&L.state!=="idle"&&L.data===void 0?N=l:N=VS(U,Ft({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:S,nextParams:n[n.length-1].params},r,{actionResult:w,actionStatus:C,defaultShouldRevalidate:j?!1:l})),N&&E.push({key:R,routeId:_.routeId,path:_.path,matches:A,match:U,controller:new AbortController})}),[T,E]}function Qq(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function ZR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function VS(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function Kq(e,t,n,r,o,i,a,l){let c=[t,...n.map(u=>u.route.id)].join("-");try{let u=a.get(c);u||(u=e({path:t,matches:n,patch:(d,f)=>{l.aborted||e2(d,f,r,o,i)}}),a.set(c,u)),u&&rG(u)&&await u}finally{a.delete(c)}}function e2(e,t,n,r,o){if(e){var i;let a=r[e];Ue(a,"No route found to patch children into: routeId = "+e);let l=Oc(t,o,[e,"patch",String(((i=a.children)==null?void 0:i.length)||"0")],r);a.children?a.children.push(...l):a.children=l}else{let a=Oc(t,o,["patch",String(n.length||"0")],r);n.push(...a)}}async function HS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Ue(o,"No route found in manifest");let i={};for(let a in r){let c=o[a]!==void 0&&a!=="hasErrorBoundary";tl(!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&&!yq.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,Ft({},t(o),{lazy:void 0}))}function Yq(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function Xq(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 Ft({},f,{shouldLoad:h,resolve:g=>(u.add(f.route.id),h?Jq(t,n,f,i,a,g,l):Promise.resolve({type:pt.data,result:void 0}))})}),request:n,params:o[0].params,context:l});return o.forEach(f=>Ue(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 Jq(e,t,n,r,o,i,a){let l,c,u=d=>{let f,h=new Promise((v,w)=>f=w);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}),HS(n.route,o,r)]);if(f!==void 0)throw f;l=h}else if(await HS(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 An(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:pt.data,result:void 0};else if(d)l=await u(d);else{let f=new URL(t.url),h=f.pathname+f.search;throw An(404,{pathname:h})}Ue(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:pt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return l}async function Zq(e){let{result:t,type:n}=e;if(n2(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:pt.error,error:d}}return n===pt.error?{type:pt.error,error:new yf(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:pt.data,data:u,statusCode:t.status,headers:t.headers}}if(n===pt.error){if(JS(t)){var r;if(t.data instanceof Error){var o;return{type:pt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new yf(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:pt.error,error:t,statusCode:$h(t)?t.status:void 0}}if(iG(t)){var i,a;return{type:pt.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(JS(t)){var l,c;return{type:pt.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}}return{type:pt.data,data:t}}function eG(e,t,n,r,o,i){let a=e.headers.get("Location");if(Ue(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!h0.test(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=Rg(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function WS(e,t,n){if(h0.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=xu(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function da(e,t,n,r){let o=e.createURL(t2(t)).toString(),i={signal:n};if(r&&Ur(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=_g(r.formData):i.body=r.formData}return new Request(o,i)}function _g(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function qS(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function tG(e,t,n,r,o,i){let a={},l=null,c,u=!1,d={},f=r&&sr(r[1])?r[1].error:void 0;return n.forEach((h,m)=>{let g=t[m].route.id;if(Ue(!fs(h),"Cannot handle redirect results in processLoaderData"),sr(h)){let v=h.error;f!==void 0&&(v=f,f=void 0),l=l||{};{let w=Ra(e,g);l[w.route.id]==null&&(l[w.route.id]=v)}a[g]=void 0,u||(u=!0,c=$h(h.error)?h.error.status:500),h.headers&&(d[g]=h.headers)}else ds(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 GS(e,t,n,r,o,i,a,l){let{loaderData:c,errors:u}=tG(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:m}=i[d];Ue(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let g=a[d];if(!(m&&m.signal.aborted))if(sr(g)){let v=Ra(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=Ft({},u,{[v.route.id]:g.error})),e.fetchers.delete(f)}else if(fs(g))Ue(!1,"Unhandled fetcher revalidation redirect");else if(ds(g))Ue(!1,"Unhandled fetcher deferred data");else{let v=li(g.data);e.fetchers.set(f,v)}}return{loaderData:c,errors:u}}function QS(e,t,n,r){let o=Ft({},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 KS(e){return e?sr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ra(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 YS(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 An(e,t){let{pathname:n,routeId:r,method:o,type:i,message:a}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",i==="route-discovery"?c='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnMiss()` '+(`function threw the following error:
|
|
545
|
+
`+a):o&&n&&r?c="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"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",c='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?c="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&&(c='Invalid request method "'+o.toUpperCase()+'"')),new yf(e||500,l,new Error(c),!0)}function XS(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(fs(n))return{result:n,idx:t}}}function t2(e){let t=typeof e=="string"?ri(e):e;return yu(Ft({},t,{hash:""}))}function nG(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function rG(e){return typeof e=="object"&&e!=null&&"then"in e}function oG(e){return n2(e.result)&&Bq.has(e.result.status)}function ds(e){return e.type===pt.deferred}function sr(e){return e.type===pt.error}function fs(e){return(e&&e.type)===pt.redirect}function JS(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function iG(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 n2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function sG(e){return zq.has(e.toLowerCase())}function Ur(e){return $q.has(e.toLowerCase())}async function ZS(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&&!ZR(u,c)&&(i&&i[c.route.id])!==void 0;if(ds(l)&&(o||d)){let f=r[a];Ue(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await r2(l,f,o).then(h=>{h&&(n[a]=h||n[a])})}}}async function r2(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:pt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:pt.error,error:o}}return{type:pt.data,data:e.deferredData.data}}}function p0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function ql(e,t){let n=typeof t=="string"?ri(t).search:t.search;if(e[e.length-1].route.index&&p0(n||""))return e[e.length-1];let r=QR(e);return r[r.length-1]}function ew(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 Yp(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 aG(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 $l(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 lG(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 li(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 cG(e,t){try{let n=e.sessionStorage.getItem(JR);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 uG(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(JR,JSON.stringify(n))}catch(r){tl(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
546
|
+
* React Router v6.26.0
|
|
547
|
+
*
|
|
548
|
+
* Copyright (c) Remix Software Inc.
|
|
549
|
+
*
|
|
550
|
+
* This source code is licensed under the MIT license found in the
|
|
551
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
552
|
+
*
|
|
553
|
+
* @license MIT
|
|
554
|
+
*/function Lc(){return Lc=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},Lc.apply(this,arguments)}const Fh=p.createContext(null),o2=p.createContext(null),zh=p.createContext(null),Bh=p.createContext(null),Hi=p.createContext({outlet:null,matches:[],isDataRoute:!1}),i2=p.createContext(null);function Uh(){return p.useContext(Bh)!=null}function oi(){return Uh()||Ue(!1),p.useContext(Bh).location}function s2(e){p.useContext(zh).static||p.useLayoutEffect(e)}function Qt(){let{isDataRoute:e}=p.useContext(Hi);return e?CG():dG()}function dG(){Uh()||Ue(!1);let e=p.useContext(Fh),{basename:t,future:n,navigator:r}=p.useContext(zh),{matches:o}=p.useContext(Hi),{pathname:i}=oi(),a=JSON.stringify(KR(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return s2(()=>{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=YR(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:ki([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const fG=p.createContext(null);function hG(e){let t=p.useContext(Hi).outlet;return t&&p.createElement(fG.Provider,{value:e},t)}function ct(){let{matches:e}=p.useContext(Hi),t=e[e.length-1];return t?t.params:{}}function pG(e,t){return a2(e,t)}function a2(e,t,n,r){Uh()||Ue(!1);let{navigator:o}=p.useContext(zh),{matches:i}=p.useContext(Hi),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=oi(),d;if(t){var f;let w=typeof t=="string"?ri(t):t;c==="/"||(f=w.pathname)!=null&&f.startsWith(c)||Ue(!1),d=w}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let w=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(w.length).join("/")}let g=os(e,{pathname:m}),v=xG(g&&g.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ki([c,o.encodeLocation?o.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?c:ki([c,o.encodeLocation?o.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),i,n,r);return t&&v?p.createElement(Bh.Provider,{value:{location:Lc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Yt.Pop}},v):v}function mG(){let e=jG(),t=$h(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 gG=p.createElement(mG,null);class vG 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(Hi.Provider,{value:this.props.routeContext},p.createElement(i2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function yG(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(Fh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Hi.Provider,{value:t},r)}function xG(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(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)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||Ue(!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,w=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||gG,c&&(u<0&&h===0?(EG("route-fallback"),g=!0,w=null):u===h&&(g=!0,w=f.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,h+1)),S=()=>{let b;return m?b=v:g?b=w:f.route.Component?b=p.createElement(f.route.Component,null):f.route.element?b=f.route.element:b=d,p.createElement(yG,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:b})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(vG,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:S(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):S()},null)}var l2=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(l2||{}),xf=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}(xf||{});function bG(e){let t=p.useContext(Fh);return t||Ue(!1),t}function SG(e){let t=p.useContext(o2);return t||Ue(!1),t}function wG(e){let t=p.useContext(Hi);return t||Ue(!1),t}function c2(e){let t=wG(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function jG(){var e;let t=p.useContext(i2),n=SG(xf.UseRouteError),r=c2(xf.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function CG(){let{router:e}=bG(l2.UseNavigateStable),t=c2(xf.UseNavigateStable),n=p.useRef(!1);return s2(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Lc({fromRouteId:t},i)))},[e,t])}const tw={};function EG(e,t,n){tw[e]||(tw[e]=!0)}function m0(e){return hG(e.context)}function Se(e){Ue(!1)}function TG(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Yt.Pop,navigator:i,static:a=!1,future:l}=e;Uh()&&Ue(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:a,future:Lc({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=ri(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,v=p.useMemo(()=>{let w=xu(d,c);return w==null?null:{location:{pathname:w,search:f,hash:h,state:m,key:g},navigationType:o}},[c,d,f,h,m,g,o]);return v==null?null:p.createElement(zh.Provider,{value:u},p.createElement(Bh.Provider,{children:n,value:v}))}function PG(e){let{children:t,location:n}=e;return pG(Dg(t),n)}new Promise(()=>{});function Dg(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,Dg(r.props.children,i));return}r.type!==Se&&Ue(!1),!r.props.index||!r.props.children||Ue(!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=Dg(r.props.children,i)),n.push(a)}),n}function kG(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}/**
|
|
555
|
+
* React Router DOM v6.26.0
|
|
556
|
+
*
|
|
557
|
+
* Copyright (c) Remix Software Inc.
|
|
558
|
+
*
|
|
559
|
+
* This source code is licensed under the MIT license found in the
|
|
560
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
561
|
+
*
|
|
562
|
+
* @license MIT
|
|
563
|
+
*/function bf(){return bf=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},bf.apply(this,arguments)}function Ig(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 RG(e,t){let n=Ig(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const _G="6";try{window.__reactRouterVersion=_G}catch{}function DG(e,t){return Wq({basename:void 0,future:bf({},void 0,{v7_prependBasename:!0}),history:mq({window:void 0}),hydrationData:IG(),routes:e,mapRouteProperties:kG,unstable_dataStrategy:void 0,unstable_patchRoutesOnMiss:void 0,window:void 0}).initialize()}function IG(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=bf({},t,{errors:AG(t.errors)})),t}function AG(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 yf(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 NG=p.createContext({isTransitioning:!1}),MG=p.createContext(new Map),OG="startTransition",nw=Aw[OG],LG="flushSync",rw=jN[LG];function $G(e){nw?nw(e):e()}function Fl(e){rw?rw(e):e()}class FG{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 zG(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(),w=p.useRef(new Map),{v7_startTransition:y}=r||{},S=p.useCallback(E=>{y?$G(E):E()},[y]),b=p.useCallback((E,_)=>{let{deletedFetchers:R,unstable_flushSync:A,unstable_viewTransitionOpts:L}=_;R.forEach(N=>w.current.delete(N)),E.fetchers.forEach((N,F)=>{N.data!==void 0&&w.current.set(F,N.data)});let U=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!L||U){A?Fl(()=>i(E)):S(()=>i(E));return}if(A){Fl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:L.currentLocation,nextLocation:L.nextLocation})});let N=n.window.document.startViewTransition(()=>{Fl(()=>i(E))});N.finished.finally(()=>{Fl(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),Fl(()=>m(N));return}h?(d&&d.resolve(),h.skipTransition(),v({state:E,currentLocation:L.currentLocation,nextLocation:L.nextLocation})):(l(E),u({isTransitioning:!0,flushSync:!1,currentLocation:L.currentLocation,nextLocation:L.nextLocation}))},[n.window,h,d,w,S]);p.useLayoutEffect(()=>n.subscribe(b),[n,b]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new FG)},[c]),p.useEffect(()=>{if(d&&a&&n.window){let E=a,_=d.promise,R=n.window.document.startViewTransition(async()=>{S(()=>i(E)),await _});R.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(R)}},[S,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 x=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:E=>n.navigate(E),push:(E,_,R)=>n.navigate(E,{state:_,preventScrollReset:R==null?void 0:R.preventScrollReset}),replace:(E,_,R)=>n.navigate(E,{replace:!0,state:_,preventScrollReset:R==null?void 0:R.preventScrollReset})}),[n]),C=n.basename||"/",j=p.useMemo(()=>({router:n,navigator:x,static:!1,basename:C}),[n,x,C]),T=p.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return p.createElement(p.Fragment,null,p.createElement(Fh.Provider,{value:j},p.createElement(o2.Provider,{value:o},p.createElement(MG.Provider,{value:w.current},p.createElement(NG.Provider,{value:c},p.createElement(TG,{basename:C,location:o.location,navigationType:o.historyAction,navigator:x,future:T},o.initialized||n.future.v7_partialHydration?p.createElement(BG,{routes:n.routes,future:n.future,state:o}):t))))),null)}const BG=p.memo(UG);function UG(e){let{routes:t,future:n,state:r}=e;return a2(t,void 0,r,n)}var ow;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(ow||(ow={}));var iw;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(iw||(iw={}));function g0(e){let t=p.useRef(Ig(e)),n=p.useRef(!1),r=oi(),o=p.useMemo(()=>RG(r.search,n.current?null:t.current),[r.search]),i=Qt(),a=p.useCallback((l,c)=>{const u=Ig(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 bu(e,t){const n=HG(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 HG(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 bl=(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 WG=[".DS_Store","Thumbs.db"];function qG(e){return bl(this,null,function*(){return Sf(e)&&GG(e.dataTransfer)?XG(e.dataTransfer,e.type):QG(e)?KG(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?YG(e):[]})}function GG(e){return Sf(e)}function QG(e){return Sf(e)&&Sf(e.target)}function Sf(e){return typeof e=="object"&&e!==null}function KG(e){return Ag(e.target.files).map(t=>bu(t))}function YG(e){return bl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>bu(n))})}function XG(e,t){return bl(this,null,function*(){if(e.items){const n=Ag(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(JG));return sw(u2(r))}return sw(Ag(e.files).map(n=>bu(n)))})}function sw(e){return e.filter(t=>WG.indexOf(t.name)===-1)}function Ag(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function JG(e){if(typeof e.webkitGetAsEntry!="function")return aw(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?d2(t):aw(e)}function u2(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?u2(n):[n]],[])}function aw(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=bu(t);return Promise.resolve(n)}function ZG(e){return bl(this,null,function*(){return e.isDirectory?d2(e):eQ(e)})}function d2(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>bl(this,null,function*(){if(a.length){const l=Promise.all(a.map(ZG));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),a=>{r(a)})}i()})}function eQ(e){return bl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=bu(r,e.fullPath);t(o)},r=>{n(r)})})})}function tQ(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 nQ=Object.defineProperty,rQ=Object.defineProperties,oQ=Object.getOwnPropertyDescriptors,lw=Object.getOwnPropertySymbols,iQ=Object.prototype.hasOwnProperty,sQ=Object.prototype.propertyIsEnumerable,cw=(e,t,n)=>t in e?nQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,aQ=(e,t)=>{for(var n in t||(t={}))iQ.call(t,n)&&cw(e,n,t[n]);if(lw)for(var n of lw(t))sQ.call(t,n)&&cw(e,n,t[n]);return e},lQ=(e,t)=>rQ(e,oQ(t));const cQ="file-invalid-type",uQ="file-too-large",dQ="file-too-small",fQ="too-many-files",hQ=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:cQ,message:`File type must be ${t}`}},uw=e=>({code:uQ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),dw=e=>({code:dQ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),pQ={code:fQ,message:"Too many files"};function f2(e,t){const n=e.type==="application/x-moz-file"||tQ(e,t);return[n,n?null:hQ(t)]}function h2(e,t,n){if(is(e.size))if(is(t)&&is(n)){if(e.size>n)return[!1,uw(n)];if(e.size<t)return[!1,dw(t)]}else{if(is(t)&&e.size<t)return[!1,dw(t)];if(is(n)&&e.size>n)return[!1,uw(n)]}return[!0,null]}function is(e){return e!=null}function mQ({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]=f2(l,t),[u]=h2(l,n,r),d=a?a(l):null;return c&&u&&!d})}function wf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function od(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 fw(e){e.preventDefault()}function gQ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vQ(e){return e.indexOf("Edge/")!==-1}function yQ(e=window.navigator.userAgent){return gQ(e)||vQ(e)}function lo(...e){return(t,...n)=>e.some(r=>(!wf(t)&&r&&r(t,...n),wf(t)))}function xQ(){return"showOpenFilePicker"in window}function bQ(e){return is(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return p2(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(m2))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>lQ(aQ({},n),{[r]:o}),{})}]:e}function SQ(e){if(is(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>p2(t)||m2(t)).join(",")}function wQ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function jQ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function p2(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function m2(e){return/^.*\.[\w]+$/.test(e)}var CQ=Object.defineProperty,EQ=Object.defineProperties,TQ=Object.getOwnPropertyDescriptors,jf=Object.getOwnPropertySymbols,g2=Object.prototype.hasOwnProperty,v2=Object.prototype.propertyIsEnumerable,hw=(e,t,n)=>t in e?CQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Mn=(e,t)=>{for(var n in t||(t={}))g2.call(t,n)&&hw(e,n,t[n]);if(jf)for(var n of jf(t))v2.call(t,n)&&hw(e,n,t[n]);return e},fi=(e,t)=>EQ(e,TQ(t)),Cf=(e,t)=>{var n={};for(var r in e)g2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jf)for(var r of jf(e))t.indexOf(r)<0&&v2.call(e,r)&&(n[r]=e[r]);return n};const v0=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=Cf(n,["children"]);const i=x2(o),{open:a}=i,l=Cf(i,["open"]);return p.useImperativeHandle(t,()=>({open:a}),[a]),un.createElement(p.Fragment,null,r(fi(Mn({},l),{open:a})))});v0.displayName="Dropzone";const y2={disabled:!1,getFilesFromEvent:qG,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};v0.defaultProps=y2;v0.propTypes={children:gt.func,accept:gt.objectOf(gt.arrayOf(gt.string)),multiple:gt.bool,preventDropOnDocument:gt.bool,noClick:gt.bool,noKeyboard:gt.bool,noDrag:gt.bool,noDragEventsBubbling:gt.bool,minSize:gt.number,maxSize:gt.number,maxFiles:gt.number,disabled:gt.bool,getFilesFromEvent:gt.func,onFileDialogCancel:gt.func,onFileDialogOpen:gt.func,useFsAccessApi:gt.bool,autoFocus:gt.bool,onDragEnter:gt.func,onDragLeave:gt.func,onDragOver:gt.func,onDrop:gt.func,onDropAccepted:gt.func,onDropRejected:gt.func,onError:gt.func,validator:gt.func};const Ng={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function x2(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:w,autoFocus:y,preventDropOnDocument:S,noClick:b,noKeyboard:x,noDrag:C,noDragEventsBubbling:j,onError:T,validator:E}=Mn(Mn({},y2),e),_=p.useMemo(()=>SQ(t),[t]),R=p.useMemo(()=>bQ(t),[t]),A=p.useMemo(()=>typeof v=="function"?v:pw,[v]),L=p.useMemo(()=>typeof g=="function"?g:pw,[g]),U=p.useRef(null),N=p.useRef(null),[F,D]=p.useReducer(PQ,Ng),{isFocused:k,isFileDialogActive:P}=F,$=p.useRef(typeof window<"u"&&window.isSecureContext&&w&&xQ()),O=()=>{!$.current&&P&&setTimeout(()=>{if(N.current){const{files:ne}=N.current;ne.length||(D({type:"closeDialog"}),L())}},300)};p.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[N,P,L,$]);const V=p.useRef([]),K=ne=>{U.current&&U.current.contains(ne.target)||(ne.preventDefault(),V.current=[])};p.useEffect(()=>(S&&(document.addEventListener("dragover",fw,!1),document.addEventListener("drop",K,!1)),()=>{S&&(document.removeEventListener("dragover",fw),document.removeEventListener("drop",K))}),[U,S]),p.useEffect(()=>(!n&&y&&U.current&&U.current.focus(),()=>{}),[U,y,n]);const ie=p.useCallback(ne=>{T?T(ne):console.error(ne)},[T]),Re=p.useCallback(ne=>{ne.preventDefault(),ne.persist(),Z(ne),V.current=[...V.current,ne.target],od(ne)&&Promise.resolve(r(ne)).then(pe=>{if(wf(ne)&&!j)return;const Q=pe.length,xe=Q>0&&mQ({files:pe,accept:_,minSize:i,maxSize:o,multiple:a,maxFiles:l,validator:E}),Be=Q>0&&!xe;D({isDragAccept:xe,isDragReject:Be,isDragActive:!0,type:"setDraggedFiles"}),c&&c(ne)}).catch(pe=>ie(pe))},[r,c,ie,j,_,i,o,a,l,E]),ae=p.useCallback(ne=>{ne.preventDefault(),ne.persist(),Z(ne);const pe=od(ne);if(pe&&ne.dataTransfer)try{ne.dataTransfer.dropEffect="copy"}catch{}return pe&&d&&d(ne),!1},[d,j]),Ee=p.useCallback(ne=>{ne.preventDefault(),ne.persist(),Z(ne);const pe=V.current.filter(xe=>U.current&&U.current.contains(xe)),Q=pe.indexOf(ne.target);Q!==-1&&pe.splice(Q,1),V.current=pe,!(pe.length>0)&&(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),od(ne)&&u&&u(ne))},[U,u,j]),Fe=p.useCallback((ne,pe)=>{const Q=[],xe=[];ne.forEach(Be=>{const[Nt,Pt]=f2(Be,_),[$t,wt]=h2(Be,i,o),wn=E?E(Be):null;if(Nt&&$t&&!wn)Q.push(Be);else{let rr=[Pt,wt];wn&&(rr=rr.concat(wn)),xe.push({file:Be,errors:rr.filter(Gi=>Gi)})}}),(!a&&Q.length>1||a&&l>=1&&Q.length>l)&&(Q.forEach(Be=>{xe.push({file:Be,errors:[pQ]})}),Q.splice(0)),D({acceptedFiles:Q,fileRejections:xe,type:"setFiles"}),f&&f(Q,xe,pe),xe.length>0&&m&&m(xe,pe),Q.length>0&&h&&h(Q,pe)},[D,a,_,i,o,l,f,h,m,E]),me=p.useCallback(ne=>{ne.preventDefault(),ne.persist(),Z(ne),V.current=[],od(ne)&&Promise.resolve(r(ne)).then(pe=>{wf(ne)&&!j||Fe(pe,ne)}).catch(pe=>ie(pe)),D({type:"reset"})},[r,Fe,ie,j]),Le=p.useCallback(()=>{if($.current){D({type:"openDialog"}),A();const ne={multiple:a,types:R};window.showOpenFilePicker(ne).then(pe=>r(pe)).then(pe=>{Fe(pe,null),D({type:"closeDialog"})}).catch(pe=>{wQ(pe)?(L(pe),D({type:"closeDialog"})):jQ(pe)?($.current=!1,N.current?(N.current.value=null,N.current.click()):ie(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."))):ie(pe)});return}N.current&&(D({type:"openDialog"}),A(),N.current.value=null,N.current.click())},[D,A,L,w,Fe,ie,R,a]),nt=p.useCallback(ne=>{!U.current||!U.current.isEqualNode(ne.target)||(ne.key===" "||ne.key==="Enter"||ne.keyCode===32||ne.keyCode===13)&&(ne.preventDefault(),Le())},[U,Le]),Tt=p.useCallback(()=>{D({type:"focus"})},[]),Ve=p.useCallback(()=>{D({type:"blur"})},[]),Te=p.useCallback(()=>{b||(yQ()?setTimeout(Le,0):Le())},[b,Le]),Pe=ne=>n?null:ne,Xe=ne=>x?null:Pe(ne),Qe=ne=>C?null:Pe(ne),Z=ne=>{j&&ne.stopPropagation()},ue=p.useMemo(()=>(ne={})=>{var pe=ne,{refKey:Q="ref",role:xe,onKeyDown:Be,onFocus:Nt,onBlur:Pt,onClick:$t,onDragEnter:wt,onDragOver:wn,onDragLeave:rr,onDrop:Gi}=pe,vr=Cf(pe,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Mn(Mn({onKeyDown:Xe(lo(Be,nt)),onFocus:Xe(lo(Nt,Tt)),onBlur:Xe(lo(Pt,Ve)),onClick:Pe(lo($t,Te)),onDragEnter:Qe(lo(wt,Re)),onDragOver:Qe(lo(wn,ae)),onDragLeave:Qe(lo(rr,Ee)),onDrop:Qe(lo(Gi,me)),role:typeof xe=="string"&&xe!==""?xe:"presentation",[Q]:U},!n&&!x?{tabIndex:0}:{}),vr)},[U,nt,Tt,Ve,Te,Re,ae,Ee,me,x,C,n]),we=p.useCallback(ne=>{ne.stopPropagation()},[]),We=p.useMemo(()=>(ne={})=>{var pe=ne,{refKey:Q="ref",onChange:xe,onClick:Be}=pe,Nt=Cf(pe,["refKey","onChange","onClick"]);const Pt={accept:_,multiple:a,type:"file",style:{display:"none"},onChange:Pe(lo(xe,me)),onClick:Pe(lo(Be,we)),tabIndex:-1,[Q]:N};return Mn(Mn({},Pt),Nt)},[N,t,a,me,n]);return fi(Mn({},F),{isFocused:k&&!n,getRootProps:ue,getInputProps:We,rootRef:U,inputRef:N,open:Pe(Le)})}function PQ(e,t){switch(t.type){case"focus":return fi(Mn({},e),{isFocused:!0});case"blur":return fi(Mn({},e),{isFocused:!1});case"openDialog":return fi(Mn({},Ng),{isFileDialogActive:!0});case"closeDialog":return fi(Mn({},e),{isFileDialogActive:!1});case"setDraggedFiles":return fi(Mn({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return fi(Mn({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Mn({},Ng);default:return e}}function pw(){}const[kQ,RQ]=Bn("Dropzone component was not found in tree");function y0(e){const t=n=>{const{children:r,...o}=H(`Dropzone${A0(e)}`,{},n),i=RQ(),a=qo(r)?r:s.jsx("span",{children:r});return i[e]?p.cloneElement(a,o):null};return t.displayName=`@mantine/dropzone/${A0(e)}`,t}const _Q=y0("accept"),DQ=y0("reject"),IQ=y0("idle");var $c={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"},NQ=(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":lt(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":a.color,"--dropzone-reject-bg":a.background}}},Wi=X((e,t)=>{const n=H("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:w,onDrop:y,onReject:S,openRef:b,name:x,maxFiles:C,autoFocus:j,activateOnClick:T,activateOnDrag:E,dragEventsBubbling:_,activateOnKeyboard:R,onDragEnter:A,onDragLeave:L,onDragOver:U,onFileDialogCancel:N,onFileDialogOpen:F,preventDropOnDocument:D,useFsAccessApi:k,getFilesFromEvent:P,validator:$,rejectColor:O,acceptColor:V,enablePointerEvents:K,loaderProps:ie,inputProps:Re,mod:ae,...Ee}=n,Fe=ce({name:"Dropzone",classes:$c,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:NQ}),{getRootProps:me,getInputProps:Le,isDragAccept:nt,isDragReject:Tt,open:Ve}=x2({onDrop:w,onDropAccepted:y,onDropRejected:S,disabled:d||f,accept:Array.isArray(g)?g.reduce((Pe,Xe)=>({...Pe,[Xe]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:C,autoFocus:j,noClick:!T,noDrag:!E,noDragEventsBubbling:!_,noKeyboard:!R,onDragEnter:A,onDragLeave:L,onDragOver:U,onFileDialogCancel:N,onFileDialogOpen:F,preventDropOnDocument:D,useFsAccessApi:k,validator:$,...P?{getFilesFromEvent:P}:null});Rf(b,Ve);const Te=!nt&&!Tt;return s.jsx(kQ,{value:{accept:nt,reject:Tt,idle:Te},children:s.jsxs(q,{...me(),...Fe("root",{focusable:!0}),...Ee,mod:[{accept:nt,reject:Tt,idle:Te,loading:f,"activate-on-click":T},ae],children:[s.jsx(By,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:ie}),s.jsx("input",{...Le(Re),name:x}),s.jsx("div",{...Fe("inner"),ref:t,"data-enable-pointer-events":K||void 0,children:v})]})})});Wi.classes=$c;Wi.displayName="@mantine/dropzone/Dropzone";Wi.Accept=_Q;Wi.Idle=IQ;Wi.Reject=DQ;const MQ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:eo("max"),withinPortal:!0},x0=X((e,t)=>{const n=H("DropzoneFullScreen",MQ,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,w=ce({name:"DropzoneFullScreen",classes:$c,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:y,resolvedStyles:S}=zc({classNames:r,styles:a,props:n}),[b,x]=p.useState(0),[C,{open:j,close:T}]=Qg(!1),E=R=>{var A;(A=R.dataTransfer)!=null&&A.types.includes("Files")&&(x(L=>L+1),j())},_=()=>{x(R=>R-1)};return p.useEffect(()=>{b===0&&T()},[b]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",E,!1),document.addEventListener("dragleave",_,!1),()=>{document.removeEventListener("dragenter",E,!1),document.removeEventListener("dragleave",_,!1)}},[u]),s.jsx(Ls,{...g,withinPortal:m,children:s.jsx(q,{...w("fullScreen",{style:{opacity:C?1:0,pointerEvents:C?"all":"none",zIndex:h}}),ref:t,children:s.jsx(Wi,{...v,classNames:y,styles:S,unstyled:l,className:$c.dropzone,onDrop:R=>{d==null||d(R),T(),x(0)},onReject:R=>{f==null||f(R),T(),x(0)}})})})});x0.classes=$c;x0.displayName="@mantine/dropzone/DropzoneFullScreen";Wi.FullScreen=x0;const id=Wi,OQ='{"resourceType": "Bundle"}';function Xp({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:a="show",loading:l}){vo[a]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function LQ(){const e=At(),t=se(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";Xp({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=dk(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),Xp({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(Gs,{size:"1rem"}),withCloseButton:!0})}catch(d){Xp({id:u,title:"Batch Upload Failed",color:"red",message:De(d),method:"update",icon:s.jsx(hf,{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(Ne,{children:[s.jsx(ge,{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(et,{defaultValue:"upload",children:[s.jsxs(et.List,{children:[s.jsx(et.Tab,{value:"upload",children:"File Upload"}),s.jsx(et.Tab,{value:"json",children:"JSON"})]}),s.jsx(et.Panel,{value:"upload",pt:"xs",children:s.jsx(id,{onDrop:i,accept:["application/json"],children:s.jsxs(te,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(id.Accept,{children:s.jsx(gS,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(id.Reject,{children:s.jsx(hf,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(id.Idle,{children:s.jsx(gS,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(fe,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(fe,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(et.Panel,{value:"json",pt:"xs",children:s.jsxs(Ke,{onSubmit:a,children:[s.jsx(ul,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:OQ,deserialize:JSON.parse}),s.jsx(te,{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(et,{defaultValue:Object.keys(n)[0],children:[s.jsx(et.List,{children:Object.keys(n).map(l=>s.jsx(et.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>s.jsx(et.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{onClick:()=>r({}),children:"Start over"})})]})]})}function $Q(){const{resourceType:e}=ct(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=el("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(Ne,{children:[s.jsxs(ge,{children:["No apps for ",e]}),s.jsx(Ge,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(Ne,{children:s.jsx("div",{children:r.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Ge,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(Jr,{})}function FQ(){const e=se(),[t,n]=p.useState(),[r,o]=p.useState(!1);return s.jsx(Ne,{width:450,children:s.jsxs(Ke,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>n(ht(a)))},children:[s.jsxs(mn,{style:{flexDirection:"column"},children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Change password"})]}),!r&&s.jsxs(Oe,{gap:"xl",mt:"xl",children:[s.jsx(Qr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Je(t,"oldPassword")}),s.jsx(Qr,{name:"newPassword",label:"New password",required:!0,error:Je(t,"newPassword")}),s.jsx(Qr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Je(t,"confirmPassword")}),s.jsx(te,{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 Mg=["Form","JSON","Profiles"],zQ=["Profiles"],Jp=Mg[0].toLowerCase();function BQ(){const e=Qt(),t=At(),{resourceType:n}=ct(),[r,o]=p.useState(()=>{const a=window.location.pathname.split("/").pop();return a&&Mg.map(l=>l.toLowerCase()).includes(a)?a:Jp});function i(a){a||(a=Jp),o(a),e(`/${n}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Yn,{children:[s.jsxs(fe,{p:"md",fw:500,children:["New ",n]}),s.jsx(Ir,{children:s.jsx(et,{defaultValue:Jp,value:r,onChange:i,children:s.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Mg.map(a=>s.jsx(et.Tab,{value:a.toLowerCase(),px:"md",children:zQ.includes(a)?s.jsxs(te,{gap:"xs",wrap:"nowrap",children:[a,s.jsx(Jc,{color:t.primaryColor,size:"sm",children:"Beta"})]}):a},a))})})})]}),s.jsx(m0,{})]})}function UQ(){return s.jsx(Ne,{children:s.jsxs(Oe,{children:[s.jsx(ge,{order:1,children:"Unexpected Error"}),s.jsx(fe,{children:"We're sorry, something went wrong."}),s.jsxs(fe,{children:["Please contact ",s.jsx(Ze,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const VQ="_root_1fbwr_1",HQ="_entry_1fbwr_8",WQ="_key_1fbwr_13",qQ="_value_1fbwr_20",Vh={root:VQ,entry:HQ,key:WQ,value:qQ};function ze(e){return s.jsx(Ir,{children:s.jsx("div",{className:Vh.root,children:e.children})})}ze.Entry=function(t){return s.jsx("div",{className:Vh.entry,children:t.children})};ze.Key=function(t){return s.jsx("div",{className:Vh.key,children:t.children})};ze.Value=function(t){return s.jsx("div",{className:Vh.value,children:t.children})};function GQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function b2(e){var n,r;const t=St(e.patient);return t?s.jsxs(ze,{children:[s.jsx(Vi,{value:t,size:"lg",color:GQ(t)}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Name"}),s.jsx(ze.Value,{children:s.jsx(Ge,{to:t,fw:500,children:t.name?s.jsx(Ux,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"DoB"}),s.jsx(ze.Value,{children:t.birthDate})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Age"}),s.jsx(ze.Value,{children:Q7(t.birthDate)})]})]}),t.gender&&s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Gender"}),s.jsx(ze.Value,{children:t.gender})]}),t.address&&s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"State"}),s.jsx(ze.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:o==null?void 0:o.system}),s.jsx(ze.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=St(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(Ge,{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=Ho(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(ze,{children:n.map(a=>s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:a.key}),s.jsx(ze.Value,{children:a.value})]},`${a.key}-${a.value}`))})}function b0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function QQ(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 Td(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 qi(e){var t;return au((t=e.getActiveLogin())==null?void 0:t.project)}function KQ(e,t){const n=new Blob([e],{type:on.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 YQ(){const{id:e}=ct(),t=oi(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=se(),[i,a]=p.useState(!0),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,w]=p.useState();if(p.useEffect(()=>{const b={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const x=r.split(",").filter(C=>!!C);x.length===1&&b.entry.push({request:{method:"GET",url:x[0]}}),d(x)}o.executeBatch(b).then(x=>{var C,j,T,E,_,R,A,L;((T=(j=(C=x.entry)==null?void 0:C[0])==null?void 0:j.response)==null?void 0:T.status)!=="200"?g((R=(_=(E=x.entry)==null?void 0:E[0])==null?void 0:_.response)==null?void 0:R.outcome):(c((A=x.entry[0])==null?void 0:A.resource),h((L=x.entry[1])==null?void 0:L.resource)),a(!1)}).catch(x=>{g(x),a(!1)})},[o,e,r]),m)return s.jsx(Ne,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(v)return s.jsxs(Ne,{children:[s.jsx(ge,{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(Ge,{to:v[0],children:"Review your answers"})}),v.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:v.map(b=>s.jsx("li",{children:s.jsx(Ge,{to:b,children:st(b)})},b.id))})]}),f&&s.jsx("li",{children:s.jsxs(Ge,{to:f,children:["Back to ",Ho(f)]})}),s.jsx("li",{children:s.jsx(Ge,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(Jr,{});const y=f&&b0(f);return s.jsxs(s.Fragment,{children:[s.jsxs(Yn,{shadow:"xs",radius:0,children:[y&&s.jsx(b2,{patient:y}),f&&f.resourceType!=="Patient"&&s.jsx(S2,{resource:f}),s.jsx(q,{px:"xl",py:"md",children:s.jsxs(fe,{children:[Ho(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),s.jsx(Ne,{children:s.jsx(MR,{questionnaire:l,subject:f&&Et(f),onSubmit:S})})]});async function S(b){const x=[];if(!u||u.length===0)x.push(await o.createResource(b));else for(const C of u)x.push(await o.createResource({...b,subject:{reference:C}}));w(x)}}const XQ="_paper_unw9o_1",JQ={paper:XQ},ZQ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function w2(e,t){const n=e.resourceType||eK(t),r=e.fields??tK(n),o=e.filters??(e.resourceType?void 0:nK(n)),i=e.sortRules??rK(n),a=e.offset??0,l=e.count??Ph;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:a,count:l}}function eK(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 tK(e){const t=S0(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 nK(e){var t;return(t=S0(e))==null?void 0:t.filters}function rK(e){const t=S0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function S0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function oK(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function iK(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=w2(n,t.getUserConfiguration()),o=await t.search(r.resourceType,Pa({...r,total:"accurate",fields:void 0}));return dk(o)}function mw(){const e=se(),t=Qt(),n=oi(),[r,o]=p.useState();return p.useEffect(()=>{const i=sk(n.pathname+n.search),a=w2(i,e.getUserConfiguration());n.pathname===`/${a.resourceType}`&&n.search===Pa(a)?(oK(a),o(a)):t(`/${a.resourceType}${Pa(a)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(Jr,{}):s.jsx(Yn,{shadow:"xs",m:"md",p:"xs",className:JQ.paper,children:s.jsx(vu,{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}${Pa(i.definition)}`)},onNew:()=>{t(ZQ[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+Pa(r);e.download(i).then(a=>{window.open(window.URL.createObjectURL(a),"_blank")}).catch(a=>he({color:"red",message:De(a),autoClose:!1}))},onExportTransactionBundle:async()=>{iK(r,e).then(i=>KQ(JSON.stringify(i,void 0,2))).catch(i=>he({color:"red",message:De(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=>he({color:"red",message:De(a),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function sK(){const e=se(),[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=>he({color:"red",message:De(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),he({color:"green",message:"Success"})}).catch(c=>he({color:"red",message:De(c),autoClose:!1}))},[e]),a=p.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?s.jsx(Ne,{children:s.jsxs(te,{children:[s.jsx(ge,{children:"MFA is enabled"}),s.jsx(oe,{onClick:a,children:"Disable MFA"})]})}):s.jsx(Ne,{width:400,children:s.jsxs(Ke,{onSubmit:i,children:[s.jsx(ge,{children:"Multi Factor Auth Setup"}),s.jsx(mn,{children:s.jsx("img",{src:t})}),s.jsx(ve,{name:"token",label:"Code"}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Enroll"})})]})})}var Zp={BASE_URL:"/",DEV:!1,GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.2.5-30739a930",MODE:"production",PROD:!0,RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",SSR:!1};const Og={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Zp==null?void 0:Zp.MEDPLUM_AWS_TEXTRACT_ENABLED};function Su(){return Og}function j2(){return C2("registerEnabled")}function aK(){return C2("awsTextractEnabled")}function C2(e){try{return Og[e]!==!1&&Og[e]!=="false"}catch{return!0}}function lK(){const e=Qt(),[t]=g0(),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(HR,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Su().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(ro,{size:32}),s.jsx(ge,{children:"Sign in to Medplum"})]})}function cK(){const e=se(),t=Qt(),n=Su();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),j2()?s.jsxs(aq,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Create a new account"})]}):s.jsx(Ne,{width:450,children:s.jsx(Bi,{icon:s.jsx(vl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function uK(){const e=Qt(),t=se(),[n,r]=p.useState(),[o,i]=p.useState(!1),a=Su().recaptchaSiteKey;return p.useEffect(()=>{a&&UR(a)},[a]),s.jsx(Ne,{width:450,children:s.jsxs(Ke,{onSubmit:async l=>{let c="";a&&(c=await VR(a)),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(ht(u)))},children:[s.jsxs(Oe,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Medplum Password Reset"})]}),s.jsxs(Oe,{gap:"xl",children:[s.jsx(Mr,{issues:hu(n,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(ve,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Je(n,"email")}),s.jsxs(te,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Ze,{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 dK(){var i;const e=Qt(),t=se(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me").then(r).catch(a=>he({color:"red",message:De(a),autoClose:!1}))},[t]);function o(a){t.post("auth/revoke",{loginId:a}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>he({color:"green",message:"Login revoked"})).catch(l=>he({color:"red",message:De(l),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(Ne,{children:[s.jsx(ge,{children:"Security"}),s.jsxs(qx,{children:[s.jsx(No,{term:"ID",children:s.jsx(Ze,{href:`/${st(n.profile)}`,children:n.profile.id})}),s.jsx(No,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(No,{term:"Name",children:lu((i=n.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(Ne,{children:[s.jsx(ge,{children:"Sessions"}),s.jsxs(de,{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:Fn(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Ze,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(Ne,{children:[s.jsx(ge,{children:"Password"}),s.jsx(oe,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(Ne,{children:[s.jsx(ge,{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 fK(){const{id:e,secret:t}=ct(),n=se(),[r,o]=p.useState(),[i,a]=p.useState(!1),l=hu(r,void 0);return s.jsxs(Ne,{width:450,children:[s.jsx(Mr,{issues:l}),s.jsxs(Ke,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(Pi("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>a(!0)).catch(d=>o(ht(d)))},children:[s.jsxs(mn,{style:{flexDirection:"column"},children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Set password"})]}),!i&&s.jsxs(Oe,{children:[s.jsx(Qr,{name:"password",label:"New password",required:!0,error:Je(r,"password")}),s.jsx(Qr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Je(r,"confirmPassword")}),s.jsx(te,{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(Ge,{to:"/signin",children:"sign in"}),"."]})]})]})}function hK(){const e=Ih(),t=Qt(),[n]=g0(),r=Su(),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(HR,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:j2()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(ro,{size:32}),s.jsx(ge,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function pK(){const e=Qt(),t=oi(),[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(uH,{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 Hh(e){const t=se(),n=qi(t),r=Qt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:re.EQUALS,value:"Project/"+n},{code:"profile-type",operator:re.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(vu,{search:o,onClick:a=>r(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function mK(){return s.jsxs(s.Fragment,{children:[s.jsx(ge,{children:"Bots"}),s.jsx(Hh,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(Ge,{to:"/admin/bots/new",children:"Create new bot"})})]})}function gK(){return s.jsxs(s.Fragment,{children:[s.jsx(ge,{children:"Clients"}),s.jsx(Hh,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(Ge,{to:"/admin/clients/new",children:"Create new client"})})]})}function Wh(e){return s.jsx(Qs,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{ni(t)?e.onChange(Et(t)):e.onChange(void 0)}})}function vK(){const e=se(),t=qi(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(ge,{children:"Create new Bot"}),s.jsxs(Ke,{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),he({color:"green",message:"Bot created"})}).catch(m=>{he({color:"red",message:De(m),autoClose:!1}),u(ht(m))})},children:[!d&&s.jsxs(Oe,{children:[s.jsx(vt,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(ve,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Je(c,"name")})}),s.jsx(vt,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(ve,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Je(c,"description")})}),s.jsx(vt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(Wh,{name:"accessPolicy",onChange:l})}),s.jsx(te,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(fe,{children:"Bot created"}),s.jsxs(Ln,{children:[s.jsx(Ln.Item,{children:s.jsx(Ge,{to:d,children:"Go to new bot"})}),s.jsx(Ln.Item,{children:s.jsx(Ge,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function yK(){const e=se(),t=qi(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(ge,{children:"Create new Client"}),s.jsxs(Ke,{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),he({color:"green",message:"Client created"})}).catch(v=>{he({color:"red",message:De(v),autoClose:!1}),f(ht(v))})},children:[!h&&s.jsxs(Oe,{children:[s.jsx(vt,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(ve,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Je(d,"name")})}),s.jsx(vt,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(ve,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Je(d,"description")})}),s.jsx(vt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(ve,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Je(d,"redirectUri")})}),s.jsx(vt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(Wh,{name:"accessPolicy",onChange:u})}),s.jsx(te,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(fe,{children:"Client created"}),s.jsxs(Ln,{children:[s.jsx(Ln.Item,{children:s.jsx(Ge,{to:h,children:"Go to new client"})}),s.jsx(Ln.Item,{children:s.jsx(Ge,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function xK(e){return s.jsx(Qs,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{ni(t)?e.onChange(Et(t)):e.onChange(void 0)}})}function bK(){const{membershipId:e}=ct(),t=se(),n=qi(t),r=Qt(),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(w=>h(ht(w)))}return s.jsxs(s.Fragment,{children:[s.jsx(ge,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(Fa,{value:o.profile,link:!0})}),s.jsxs(Ke,{onSubmit:()=>{const w={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,w).then(()=>g(!0)).catch(y=>h(ht(y)))},children:[!m&&s.jsxs(Oe,{children:[s.jsx(vt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(Wh,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(vt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:s.jsx(xK,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(vt,{title:"Admin",htmlFor:"admin",outcome:f,children:s.jsx(_n,{id:"admin",name:"admin",defaultChecked:u,onChange:w=>d(w.currentTarget.checked)})}),s.jsxs(te,{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(Ge,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function SK(){const e=se(),[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"),Ch(g)?a(g):d(g),c(m.sendEmail??!1),he({color:"green",message:"Invite success"})}).catch(g=>{he({color:"red",message:De(g),autoClose:!1}),a(ht(g))})},[e,t,r]);return s.jsxs(Ke,{onSubmit:f,children:[!u&&!i&&s.jsxs(Oe,{children:[s.jsx(ge,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(vt,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(Qs,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(It,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Je(i,"resourceType")}),s.jsx(ve,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Je(i,"firstName")}),s.jsx(ve,{name:"lastName",label:"Last Name",required:!0,error:Je(i,"lastName")}),s.jsx(ve,{name:"email",type:"email",label:"Email",required:!0,error:Je(i,"email")}),s.jsx(vt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(Wh,{name:"accessPolicy",onChange:o})}),s.jsx(_n,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(_n,{name:"isAdmin",label:"Admin"}),s.jsx(te,{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(Ge,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(fe,{children:"User created"}),l&&s.jsx(fe,{children:"Email sent"}),s.jsxs(Ln,{children:[s.jsx(Ln.Item,{children:s.jsx(Ge,{to:u,children:"Go to new membership"})}),s.jsx(Ln.Item,{children:s.jsx(Ge,{to:u.profile,children:"Go to new profile"})}),s.jsx(Ln.Item,{children:s.jsx(Ge,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function wK(){return s.jsxs(s.Fragment,{children:[s.jsx(ge,{children:"Patients"}),s.jsx(Hh,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(Ge,{to:"/admin/invite",children:"Invite new patient"})})]})}function jK(){const e=se();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Mr,{outcome:AP});function t(n){e.post("admin/projects/setpassword",n).then(()=>he({color:"green",message:"Done"})).catch(r=>he({color:"red",message:De(r),autoClose:!1}))}return s.jsxs(Ne,{width:600,children:[s.jsx(ge,{order:1,children:"Project Admin"}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{order:2,children:"Force Set Password"}),s.jsx(fe,{children:"Sets the password for the specified user in this project."}),s.jsx(fe,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(Ke,{onSubmit:t,children:s.jsxs(Oe,{children:[s.jsx(ve,{name:"email",label:"Email",required:!0}),s.jsx(Qr,{name:"password",label:"Password",required:!0}),s.jsx(oe,{type:"submit",children:"Force Set Password"})]})})]})}function gw(){const e=se(),t=qi(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(ge,{children:"Details"}),s.jsxs(qx,{children:[s.jsx(No,{term:"ID",children:n.project.id}),s.jsx(No,{term:"Name",children:n.project.name})]})]})}const vw=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function CK(){const e=Qt(),n=oi().pathname.replace("/admin/","")||vw[0],r=se(),o=qi(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(Yn,{children:[s.jsx(ze,{children:s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Project"}),s.jsx(ze.Value,{children:i.project.name})]})}),s.jsx(Ir,{children:s.jsx(et,{value:n.toLowerCase(),onChange:a,children:s.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:vw.map(l=>s.jsx(et.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(Ne,{children:s.jsx(m0,{})})]})}function EK(){const e=se(),t=qi(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(Xr(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(()=>he({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(ge,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(yl,{property:Ws("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(oe,{type:"submit",children:"Save"})]})}function TK(){const e=se(),t=qi(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(Xr(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(()=>he({color:"green",message:"Saved"})).catch(c=>{var d,f,h,m;const u=ht(c);he({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(ge,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(yl,{property:Ws("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(oe,{type:"submit",children:"Save"})]})}function PK(){const e=se(),[t,{open:n,close:r}]=Qg(!1),[o,i]=p.useState(""),[a,l]=p.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Mr,{outcome:AP});function c(){sd(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function u(){sd(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function d(){sd(e,"Rebuilding Value Sets","admin/super/valuesets")}function f(w){sd(e,"Reindexing Resources","admin/super/reindex",w)}function h(w){e.post("admin/super/removebotidjobsfromqueue",w).then(()=>he({color:"green",message:"Done"})).catch(y=>he({color:"red",message:De(y),autoClose:!1}))}function m(w){e.post("admin/super/purge",{...w,before:qk(w.before)}).then(()=>he({color:"green",message:"Done"})).catch(y=>he({color:"red",message:De(y),autoClose:!1}))}function g(w){e.post("admin/super/setpassword",w).then(()=>he({color:"green",message:"Done"})).catch(y=>he({color:"red",message:De(y),autoClose:!1}))}function v(){e.post("fhir/R4/$db-stats",{}).then(w=>{var y,S;i("Database Stats"),l(s.jsx("pre",{children:(S=(y=w.parameter)==null?void 0:y.find(b=>b.name==="tableString"))==null?void 0:S.valueString})),n()}).catch(w=>he({color:"red",message:De(w),autoClose:!1}))}return s.jsxs(Ne,{width:600,children:[s.jsx(ge,{order:1,children:"Super Admin"}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{children:s.jsx(oe,{onClick:c,children:"Rebuild StructureDefinitions"})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{children:s.jsx(oe,{onClick:u,children:"Rebuild SearchParameters"})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{children:s.jsx(oe,{onClick:d,children:"Rebuild ValueSets"})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{onSubmit:f,children:s.jsxs(Oe,{children:[s.jsx(vt,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(ve,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(vt,{title:"Search Filter",htmlFor:"filter",children:s.jsx(ve,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(oe,{type:"submit",children:"Reindex"})]})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{onSubmit:m,children:s.jsxs(Oe,{children:[s.jsx(vt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(It,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(vt,{title:"Purge Before",htmlFor:"before",children:s.jsx(Ps,{name:"before",placeholder:"Before Date"})}),s.jsx(oe,{type:"submit",children:"Purge"})]})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(Ke,{onSubmit:h,children:s.jsxs(Oe,{children:[s.jsx(vt,{title:"Bot ID",children:s.jsx(ve,{name:"botId",placeholder:"Bot Id"})}),s.jsx(oe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{onSubmit:g,children:s.jsxs(Oe,{children:[s.jsx(ve,{name:"email",label:"Email",required:!0}),s.jsx(Qr,{name:"password",label:"Password",required:!0}),s.jsx(ve,{name:"projectId",label:"Project ID"}),s.jsx(oe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(Ke,{onSubmit:v,children:s.jsx(oe,{type:"submit",children:"Get Database Stats"})}),s.jsx(Sn,{opened:t,onClose:r,title:o,centered:!0,children:a})]})}function sd(e,t,n,r){vo.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(()=>{vo.update({id:n,color:"green",title:t,message:"Done",icon:s.jsx(Gs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{vo.update({id:n,color:"red",title:t,message:De(i),icon:s.jsx(hf,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function kK(){return s.jsxs(s.Fragment,{children:[s.jsx(ge,{children:"Users"}),s.jsx(Hh,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(Ge,{to:"/admin/invite",children:"Invite new user"})})]})}function RK(){const[e]=el("ObservationDefinition","_count=100");return e?s.jsxs(de,{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(yo,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(yo,{value:t.code})}),s.jsx("td",{children:s.jsx(yo,{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(Lg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(Jr,{})}function Lg(e){const{ranges:t}=e;if(!t)return null;const n=yw(t.map(o=>o.gender));if(n.length>1)return Rc(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:nn(o)})}),s.jsx(Lg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const r=yw(t.map(o=>o.age&&_c(o.age)));return r.length>1?(Rc(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:nn(o)})}),s.jsx(Lg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>_c(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(Qx,{value:o.range})})]})})},`range-${o.condition}`))})}function yw(e){return[...new Set(e.filter(t=>!!t))]}function _K(){const[e]=el("ActivityDefinition","_count=100"),[t]=el("ObservationDefinition","_count=100");return!e||!t?s.jsx(Jr,{}):s.jsxs(de,{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(yo,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(yo,{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 DK(e){var a;const t=se(),[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(Ge,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(Ge,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(Ke,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(i).catch(console.log)},children:s.jsxs(Oe,{children:[s.jsxs(ge,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(fe,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(fe,{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(yo,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(vt,{title:"Subject",children:s.jsx(Nh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"Go"})})]})})}function IK(){const{resourceType:e,id:t}=ct(),n=St({reference:e+"/"+t});return n?s.jsx(Ne,{children:s.jsx(DK,{planDefinition:n})}):null}function AK(){const{resourceType:e,id:t}=ct(),n=St({reference:e+"/"+t}),[r,o]=el("Questionnaire","subject-type="+e),[i,a]=el("ClientApplication",{_count:1e3});if(!n||o||a)return s.jsx(Jr,{});const l=i==null?void 0:i.filter(d=>NK(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return s.jsxs(Ne,{children:[s.jsx(ge,{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=Et(n):n.resourceType==="Encounter"&&(c=n.subject,u=Et(n)),s.jsxs(Ne,{children:[r==null?void 0:r.map(d=>s.jsxs("div",{children:[s.jsx(ge,{order:3,children:s.jsx(Ge,{to:`/forms/${d.id}?subject=${st(n)}`,children:d.title||d.name})}),s.jsx(fe,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>s.jsxs("div",{children:[s.jsx(ge,{order:3,children:s.jsx(oq,{client:d,patient:c,encounter:u,children:d.name})}),s.jsx(fe,{children:d.description})]},d.id))]})}function NK(e){return e==="Patient"||e==="Encounter"}function MK(){const{resourceType:e,id:t}=ct(),n=Qt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:re.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(Ne,{children:s.jsx(vu,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function OK(){const e=se(),{resourceType:t,id:n}=ct(),r=e.readHistory(t,n).read();return s.jsx(Ne,{children:s.jsx(GW,{history:r})})}const LK="_hl7Input_k5xm3_1",$K={hl7Input:LK};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 zK(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=>{Td(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const BK=`{
|
|
564
|
+
"resourceType": "Patient",
|
|
565
|
+
"name": [
|
|
566
|
+
{
|
|
567
|
+
"given": [
|
|
568
|
+
"Alice"
|
|
569
|
+
],
|
|
570
|
+
"family": "Smith"
|
|
571
|
+
}
|
|
572
|
+
]
|
|
573
|
+
}`,UK="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 VK(){const e=se(),{id:t}=ct(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState(BK),[c,u]=p.useState(UK),[d,f]=p.useState(on.FHIR_JSON),h=p.useRef(null),m=p.useRef(null),[g,v]=p.useState(!1);p.useEffect(()=>{e.readResource("Bot",t).then(async j=>{r(j),i(await HK(e,j))}).catch(j=>he({color:"red",message:De(j),autoClose:!1}))},[e,t]);const w=p.useCallback(()=>Td(h.current,{command:"getValue"}),[]),y=p.useCallback(()=>Td(h.current,{command:"getOutput"}),[]),S=p.useCallback(async()=>d===on.FHIR_JSON?JSON.parse(a):c,[d,a,c]),b=p.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),v(!0);try{const T=await w(),E=await e.createAttachment(T,"index.ts","text/typescript"),_=[];n!=null&&n.sourceCode?_.push({op:"replace",path:"/sourceCode",value:E}):_.push({op:"add",path:"/sourceCode",value:E}),await e.patchResource("Bot",t,_),he({color:"green",message:"Saved"})}catch(T){he({color:"red",message:De(T),autoClose:!1})}finally{v(!1)}},[e,t,n,w]),x=p.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),v(!0);try{const T=await y();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:T}),he({color:"green",message:"Deployed"})}catch(T){he({color:"red",message:De(T),autoClose:!1})}finally{v(!1)}},[e,t,y]),C=p.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),v(!0);try{const T=await S(),E=await e.post(e.fhirUrl("Bot",t,"$execute"),T,d);await Td(m.current,{command:"setValue",value:E}),he({color:"green",message:"Success"})}catch(T){he({color:"red",message:De(T),autoClose:!1})}finally{v(!1)}},[e,t,S,d]);return!n||o===void 0?null:s.jsxs(ur,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(ur.Col,{span:8,children:s.jsxs(Yn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(zK,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(te,{justify:"flex-end",gap:"xs",children:[s.jsx(oe,{type:"button",onClick:b,loading:g,leftSection:s.jsx(Y8,{size:"1rem"}),children:"Save"}),s.jsx(oe,{type:"button",onClick:x,loading:g,leftSection:s.jsx($x,{size:"1rem"}),children:"Deploy"}),s.jsx(oe,{type:"button",onClick:C,loading:g,leftSection:s.jsx(uz,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(ur.Col,{span:4,children:[s.jsxs(Yn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(It,{data:[{label:"FHIR",value:on.FHIR_JSON},{label:"HL7",value:on.HL7_V2}],onChange:j=>f(j.currentTarget.value)}),d===on.FHIR_JSON?s.jsx(ul,{value:a,onChange:j=>l(j),autosize:!0,minRows:15}):s.jsx("textarea",{className:$K.hl7Input,value:c,onChange:j=>u(j.currentTarget.value),rows:15})]}),s.jsx(Yn,{m:2,p:"xs",shadow:"md",children:s.jsx(FK,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function HK(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(QP);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function Ks(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function WK(){const e=se(),{resourceType:t,id:n}=ct(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(Ks(i)).then(()=>{he({color:"green",message:"Success"})}).catch(a=>{he({color:"red",message:De(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Ne,{children:s.jsx(wH,{value:r,onSubmit:o})});case"Questionnaire":return s.jsx(Ne,{children:s.jsx(iW,{questionnaire:r,onSubmit:o})});default:return null}}function qK(){const{resourceType:e,id:t}=ct(),n=St({reference:e+"/"+t}),r=Qt();return n?s.jsx(Ne,{children:s.jsx(RW,{value:n,onStart:(o,i)=>r(`/forms/${au(i)}`),onEdit:(o,i,a)=>r(`/${a.reference}}`)})}):null}function GK(){const e=se(),{resourceType:t,id:n}=ct(),r=Qt();return s.jsxs(Ne,{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=>he({color:"red",message:De(o),autoClose:!1}))},children:"Delete"})]})}const QK="_selectProfileBtn_tbaz6_1",KK="_chevron_tbaz6_13",xw={selectProfileBtn:QK,chevron:KK};function YK(){var c,u;const{resourceType:e,id:t}=ct(),n=St({reference:e+"/"+t}),[r,o]=p.useState(),i=Xc({onDropdownClose:()=>i.resetSelectedOption()}),a=p.useMemo(()=>{var d;if(Bt((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[s.jsx(Me.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>s.jsx(Me.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 Bt(a)&&(l=s.jsx(te,{justify:"flex-end",children:s.jsxs(Oe,{align:"flex-end",gap:"xs",children:[s.jsxs(Me,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[s.jsx(Me.Target,{children:s.jsx(bn,{onClick:()=>i.toggleDropdown(),children:s.jsxs(Ny,{fw:"bold",fs:"sm",className:xw.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(Lx,{stroke:1.5,className:xw.chevron})]})})}),s.jsx(Me.Dropdown,{w:"max-content",children:s.jsx(Me.Options,{children:a})})]}),s.jsx(q,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(fe,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(fe,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(fe,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(Ne,{children:s.jsxs(Oe,{gap:"xl",children:[l,s.jsx(s0,{value:n,profileUrl:r})]})})}function XK(){const e=se(),{resourceType:t,id:n}=ct(),[r,o]=p.useState(),[i,a]=p.useState(),l=Qt(),[c,u]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(m=>{o(Xr(m)),a(Xr(m))}).catch(m=>{u(ht(m)),he({color:"red",message:De(m),autoClose:!1})})},[e,t,n]);const d=p.useCallback(m=>{u(void 0),e.updateResource(Ks(m)).then(()=>{l(`/${t}/${n}/details`),he({color:"green",message:"Success"})}).catch(g=>{u(ht(g)),he({color:"red",message:De(g),autoClose:!1})})},[e,t,n,l]),f=p.useCallback(m=>{u(void 0);const g=t0.createPatch(r,m);e.patchResource(t,n,g).then(()=>{l(`/${t}/${n}/details`),he({color:"green",message:"Success"})}).catch(v=>{u(ht(v)),he({color:"red",message:De(v),autoClose:!1})})},[e,t,n,r,l]),h=p.useCallback(()=>l(`/${t}/${n}/delete`),[l,t,n]);return i?s.jsx(Ne,{children:s.jsx(vf,{defaultValue:i,onSubmit:d,onPatch:f,onDelete:h,outcome:c})}):null}function E2({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=se(),[i,a]=p.useState();return p.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{a(l.filter(IB))}).catch(console.error)},[o,n,r]),s.jsx(et,{value:t==null?void 0:t.url,onChange:l=>{const c=i==null?void 0:i.find(u=>u.url===l);c&&n(c)},children:s.jsx(et.List,{children:i==null?void 0:i.map(l=>{var d,f;const c=(f=(d=e.meta)==null?void 0:d.profile)==null?void 0:f.includes(l.url),u=c?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(et.Tab,{value:l.url,title:u,rightSection:c&&s.jsx(mx,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(Cz,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function T2(e,t){const n=se(),r=Qt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),n.createResource(a).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ht(l)),he({color:"red",message:De(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function em(){const{resourceType:e}=ct(),t=oi(),[n,r]=p.useState(),{defaultValue:o,handleSubmit:i}=T2(e,r),[a,l]=p.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=p.useCallback(d=>{const f=Ks(d);a&&XP(f,a.url),i(f)},[a,i]);return c?s.jsx(Ne,{children:s.jsxs(Oe,{children:[s.jsx(E2,{resource:o,currentProfile:a,onChange:l}),a?s.jsx(vf,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:a.url},a.url):s.jsx(fe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(Ne,{children:s.jsx(vf,{defaultValue:o,onSubmit:i,outcome:n})})}function JK(){const e=se(),{resourceType:t,id:n}=ct(),r=e.readHistory(t,n).read();return s.jsx(Ne,{children:s.jsx(eq,{history:r})})}function ZK(){const{resourceType:e}=ct(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=T2(e,n),i=p.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Ne,{children:[t&&s.jsx(Mr,{outcome:t}),s.jsxs(Ke,{onSubmit:i,children:[s.jsx(ul,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:pr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"OK"})})]})]})}function eY(){const e=se(),{resourceType:t,id:n}=ct(),r=St({reference:t+"/"+n}),o=Qt(),[i,a]=p.useState(),l=p.useCallback(c=>{e.updateResource(Ks(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${n}/details`),he({color:"green",message:"Success"})}).catch(u=>{he({color:"red",message:De(u),autoClose:!1})})},[e,t,n,o]);return r?s.jsxs(Ne,{children:[i&&s.jsx(Mr,{outcome:i}),s.jsxs(Ke,{onSubmit:l,children:[s.jsx(ul,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:pr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(oe,{type:"submit",children:"OK"})})]})]}):null}function tY(){const{resourceType:e,id:t}=ct();return St({reference:e+"/"+t})?s.jsxs(Ne,{children:[s.jsxs(Bi,{icon:s.jsx(vl,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Ze,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(MR,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function nY(){const e=se(),{resourceType:t,id:n}=ct(),[r,o]=p.useState(),[i,a]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(l=>o(Xr(l))).catch(l=>{he({color:"red",message:De(l)})})},[e,t,n]),r?s.jsxs(Ne,{children:[s.jsxs(ge,{order:2,children:["Available ",t," profiles"]}),s.jsx(Oe,{children:s.jsxs(s.Fragment,{children:[s.jsx(E2,{resource:r,currentProfile:i,onChange:a}),i?s.jsx(rY,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):s.jsx(fe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const rY=({profile:e,resource:t,onResourceUpdated:n})=>{const r=se(),[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=Ks(u);a?XP(d,e.url):f6(d,e.url),r.updateResource(d).then(f=>{n(f),he({color:"green",message:"Success"})}).catch(f=>{i(ht(f)),he({color:"red",message:De(f),autoClose:!1})})},[r,e.url,n,a]);return s.jsxs(Oe,{children:[s.jsx(ru,{size:"md",checked:a,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),a?s.jsx(vf,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(oe,{type:"submit",children:"OK"})})})]})};function oY(){const e=se(),{id:t}=ct(),[n,r]=p.useState(),[o,i]=p.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>iY(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"),he({color:"green",message:"Success"})}).catch(c=>he({color:"red",message:De(c),autoClose:!1}))}return s.jsxs(Ne,{children:[s.jsx(ge,{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(xl,{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(ge,{children:"Connect to bot"}),s.jsxs(te,{children:[s.jsx(Qs,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),s.jsx(oe,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function iY(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 sY(){const{id:e}=ct(),t=Qt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:re.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Ne,{children:s.jsx(vu,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function aY(){const e=se(),{resourceType:t,id:n}=ct(),r=St({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(Ks(i)).then(()=>{he({color:"green",message:"Success"})}).catch(a=>{he({color:"red",message:De(a),autoClose:!1})})},[e]);return r?s.jsx(Ne,{children:s.jsx(SW,{onSubmit:o,definition:r})}):null}function lY(){const{resourceType:e,id:t}=ct(),n=St({reference:e+"/"+t});return n?s.jsx(Ne,{children:e==="MeasureReport"?s.jsx(gH,{measureReport:n}):s.jsx(Zx,{value:n})}):null}const cY="_container_1ue98_1",uY="_entry_1ue98_14",dY="_active_1ue98_21",tm={container:cY,entry:uY,active:dY};function fY(e){const t=se(),n=St(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=b0(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);dR(u),u.reverse(),o(u)}).catch(l=>he({color:"red",message:De(l),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:tm.container,children:r.map(i=>{var a,l,c,u,d,f,h;return s.jsxs("div",{className:rt(tm.entry,{[tm.active]:i.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(Ge,{to:i,children:hY(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:pY(i)})]},i.id)})}):null}function hY(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function pY(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const mY="_container_1l2dh_1",gY={container:mY};function vY(e){var o,i,a,l;const t=St(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:gY.container,children:s.jsx(It,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function yY(e){var n,r;const t=St(e.specimen);return t?s.jsxs(ze,{children:[s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Type"}),s.jsx(ze.Value,{children:"Specimen"})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Collected"}),s.jsx(ze.Value,{children:Fn((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Specimen Age"}),s.jsx(ze.Value,{children:xY(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Specimen Stability"}),s.jsx(ze.Value,{children:bY(t)})]}):s.jsx(s.Fragment,{})]}):null}function xY(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return P2(k2(n,new Date))}function bY(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 P2(k2(t,n))}function P2(e){return e.toString().padStart(3,"0")+"D"}function k2(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function SY(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 wY=["Profiles"];function jY(){var b,x,C,j,T,E,_;const e=se(),{resourceType:t,id:n}=ct(),r={reference:t+"/"+n},o=Qt(),[i,a]=p.useState(),l=St(r,a),c=SY(t),[u,d]=p.useState(()=>{const R=window.location.pathname.split("/").pop();return R&&c.map(A=>A.toLowerCase()).includes(R)?R:c[0].toLowerCase()}),f=At();async function h(){var L,U;const A=(U=(L=(await e.readHistory(t,n)).entry)==null?void 0:L.find(N=>!!N.resource))==null?void 0:U.resource;A?m(A):he({color:"red",message:"No history to restore",autoClose:!1})}function m(R){e.updateResource(Ks(R)).then(()=>{a(void 0),he({color:"green",message:"Success"})}).catch(A=>{he({color:"red",message:De(A),autoClose:!1})})}if(i)return A$(i)?s.jsxs(Ne,{children:[s.jsx(ge,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(oe,{color:"red",onClick:h,children:"Restore"})]}):s.jsx(Mr,{outcome:i});function g(R){R||(R=c[0].toLowerCase()),d(R),o(`/${t}/${n}/${R}`)}function v(R){const A=l,L=A.orderDetail||[];L.length===0&&L.push({}),L[0].text!==R&&(L[0].text=R,m({...A,orderDetail:L}))}const w=l&&b0(l),y=l&&QQ(l),S=(C=(x=(b=e.getUserConfiguration())==null?void 0:b.option)==null?void 0:x.find(R=>R.id==="statusValueSet"))==null?void 0:C.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&S&&s.jsx(vY,{valueSet:{reference:S},defaultValue:(T=(j=l.orderDetail)==null?void 0:j[0])==null?void 0:T.text,onChange:v},st(l)+"-"+((_=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:_.text)),l&&s.jsx(fY,{value:l}),l&&s.jsxs(Yn,{children:[w&&s.jsx(b2,{patient:w}),y&&s.jsx(yY,{specimen:y}),t!=="Patient"&&s.jsx(S2,{resource:r}),s.jsx(Ir,{children:s.jsx(et,{value:u.toLowerCase(),onChange:g,children:s.jsx(et.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(R=>s.jsx(et.Tab,{value:R.toLowerCase(),children:wY.includes(R)?s.jsxs(te,{gap:"xs",wrap:"nowrap",children:[R,s.jsx(Jc,{color:f.primaryColor,size:"sm",children:"Beta"})]}):R},R))})})})]}),s.jsx(m0,{})]})}function bw(){var y,S,b,x;const e=Qt(),{resourceType:t,id:n,versionId:r,tab:o}=ct(),i=se(),[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(C=>u(C)).then(()=>l(!1)).catch(C=>{f(C),l(!1)})},[i,t,n]),a)return s.jsx(Jr,{});if(!c)return s.jsxs(Ne,{children:[s.jsx(ge,{children:"Resource not found"}),s.jsx(Ge,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(C=>{var j,T;return((T=(j=C.resource)==null?void 0:j.meta)==null?void 0:T.versionId)===r});if(m===-1)return s.jsxs(Ne,{children:[s.jsx(ge,{children:"Version not found"}),s.jsx(Ge,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[m].resource,v=m<h.length-1?h[m+1].resource:void 0,w="diff";return s.jsxs(et,{value:o||w,onChange:C=>e(`/${t}/${n}/_history/${r}/${C||w}`),children:[s.jsxs(Yn,{children:[s.jsx(pu,{fluid:!0,p:"md",children:s.jsx(fe,{children:`${t} ${n}`})}),s.jsxs(et.List,{children:[s.jsx(et.Tab,{value:"diff",children:"Diff"}),s.jsx(et.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Ne,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(et.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(Ge,{to:`/${t}/${n}/_history/${(S=v.meta)==null?void 0:S.versionId}`,children:(b=v.meta)==null?void 0:b.versionId})]})]}),s.jsx(YW,{original:v,revised:g})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(x=g.meta)==null?void 0:x.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),s.jsx(et.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function CY(){const{resourceType:e,id:t}=ct(),n=Qt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:re.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Ne,{children:s.jsx(oH,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function EY(e){const t=se(),{resource:n,opened:r,onClose:o}=e,[i,a]=p.useState(!1),[l,c]=p.useState(),[u,d]=p.useState(!1),f=p.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:i&&l?st(l):void 0,verbose:u}),he({color:"green",message:"Done"}),o()}catch(h){he({color:"red",message:De(h),autoClose:!1})}},[t,n,o,i,l,u]);return s.jsx(Sn,{opened:r,onClose:o,title:"Resend Subscriptions",children:s.jsx(Ke,{onSubmit:f,children:s.jsxs(Oe,{children:[s.jsx(_n,{label:"Choose subscription (all subscriptions by default)",onChange:h=>a(h.currentTarget.checked)}),i&&s.jsx(Qs,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:c}),s.jsx(_n,{label:"Verbose mode",onChange:h=>d(h.currentTarget.checked)}),s.jsx(te,{justify:"flex-end",children:s.jsx(oe,{type:"submit",children:"Resend"})})]})})})}function Sw(){const e=se(),t=Dh(),{resourceType:n,id:r}=ct(),o={reference:n+"/"+r},[i,a]=p.useState(),l=Qg(!1);function c(S,b){return e.updateResource({...S,priority:b})}function u(S,b){c(S,"stat").then(b).catch(console.error)}function d(S,b){c(S,"routine").then(b).catch(console.error)}function f(S){t(`/${S.resourceType}/${S.id}`)}function h(S){t(`/${S.resourceType}/${S.id}/edit`)}function m(S){t(`/${S.resourceType}/${S.id}/delete`)}function g(S){a(S),l[1].open()}function v(S){var b;t(`/${S.resourceType}/${S.id}/_history/${(b=S.meta)==null?void 0:b.versionId}`)}function w(S,b){e.post(e.fhirUrl(S.resourceType,S.id,"$aws-textract"),{}).then(b).catch(console.error)}function y(S){var D;const{primaryResource:b,currentResource:x,reloadTimeline:C}=S,j=x.resourceType===b.resourceType&&x.id===b.id,T=x.resourceType==="Communication"&&x.priority!=="stat",E=x.resourceType==="Communication"&&x.priority==="stat",_=j,R=!j,A=!j,L=!j,U=(D=e.getProjectMembership())==null?void 0:D.admin,N=U,F=aK()&&(x.resourceType==="DocumentReference"||x.resourceType==="Media");return s.jsxs(J.Dropdown,{children:[s.jsx(J.Label,{children:"Resource"}),T&&s.jsx(J.Item,{leftSection:s.jsx(lz,{size:14}),onClick:()=>u(x,C),"aria-label":`Pin ${st(x)}`,children:"Pin"}),E&&s.jsx(J.Item,{leftSection:s.jsx(cz,{size:14}),onClick:()=>d(x,C),"aria-label":`Unpin ${st(x)}`,children:"Unpin"}),R&&s.jsx(J.Item,{leftSection:s.jsx(mS,{size:14}),onClick:()=>f(x),"aria-label":`Details ${st(x)}`,children:"Details"}),_&&s.jsx(J.Item,{leftSection:s.jsx(mS,{size:14}),onClick:()=>v(x),"aria-label":`Details ${st(x)}`,children:"Details"}),A&&s.jsx(J.Item,{leftSection:s.jsx(Tk,{size:14}),onClick:()=>h(x),"aria-label":`Edit ${st(x)}`,children:"Edit"}),U&&s.jsxs(s.Fragment,{children:[s.jsx(J.Divider,{}),s.jsx(J.Label,{children:"Admin"}),N&&s.jsx(J.Item,{leftSection:s.jsx(pz,{size:14}),onClick:()=>g(x),"aria-label":`Resend Subscriptions ${st(x)}`,children:"Resend Subscriptions"})]}),F&&s.jsxs(s.Fragment,{children:[s.jsx(J.Divider,{}),s.jsx(J.Label,{children:"AWS AI"}),s.jsx(J.Item,{leftSection:s.jsx(wz,{size:14}),onClick:()=>w(x,C),"aria-label":`AWS Textract ${st(x)}`,children:"AWS Textract"})]}),L&&s.jsxs(s.Fragment,{children:[s.jsx(J.Divider,{}),s.jsx(J.Label,{children:"Danger zone"}),s.jsx(J.Item,{color:"red",leftSection:s.jsx(Bx,{size:14}),onClick:()=>m(x),"aria-label":`Delete ${st(x)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(hV,{encounter:o,getMenu:y}),n==="Patient"&&s.jsx(vH,{patient:o,getMenu:y}),n==="ServiceRequest"&&s.jsx(rq,{serviceRequest:o,getMenu:y}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(fV,{resource:o,getMenu:y}),s.jsx(EY,{resource:i,opened:l[0],onClose:l[1].close},`resend-subscriptions-${i==null?void 0:i.id}`)]})}function TY(){const e=se(),{id:t}=ct(),n=p.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=p.useState(!1),[i,a]=p.useState(!1),[l,c]=p.useState(!1),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,w]=p.useState(),[y,S]=p.useState(!1),[b,x]=p.useState(!1);p.useEffect(()=>{if(r||i||l||y){x(!0);return}x(!1)},[r,i,l,y]);const C=p.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(A=>{var L,U,N,F,D,k;d((U=(L=A.parameter)==null?void 0:L.find(P=>P.name==="status"))==null?void 0:U.valueCode),h((F=(N=A.parameter)==null?void 0:N.find(P=>P.name==="version"))==null?void 0:F.valueString),g((k=(D=A.parameter)==null?void 0:D.find(P=>P.name==="lastUpdated"))==null?void 0:k.valueInstant)}).catch(A=>R(De(A))).finally(()=>o(!1))},[e,t]),j=p.useCallback(A=>{const L=A.host,U=A.pingCount||1;L&&(S(!0),e.pushToAgent(n,L,`PING ${U}`,on.PING,!0).then(N=>w(N)).catch(N=>R(De(N))).finally(()=>S(!1)))},[e,n]),T=p.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(A=>{_("Agent config reloaded successfully.")}).catch(A=>R(De(A))).finally(()=>a(!1))},[e,t]),E=p.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(A=>{_("Agent upgraded successfully.")}).catch(A=>R(De(A))).finally(()=>c(!1))},[e,t]);function _(A){he({color:"green",title:"Success",icon:s.jsx(Gs,{size:"1rem"}),message:A})}function R(A){he({color:"red",title:"Error",message:A,autoClose:!1})}return s.jsxs(Ne,{children:[s.jsx(ge,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(xl,{value:n,link:!0})]}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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:C,loading:r,disabled:b&&!r,children:"Get Status"}),!r&&u&&s.jsx(de,{children:s.jsxs(de.Tbody,{children:[s.jsxs(de.Tr,{children:[s.jsx(de.Td,{children:"Status"}),s.jsx(de.Td,{children:s.jsx(Jx,{status:u})})]}),s.jsxs(de.Tr,{children:[s.jsx(de.Td,{children:"Version"}),s.jsx(de.Td,{children:f})]}),s.jsxs(de.Tr,{children:[s.jsx(de.Td,{children:"Last Updated"}),s.jsx(de.Td,{children:Fn(m,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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:T,loading:i,disabled:b&&!i,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(oe,{onClick:E,loading:l,disabled:b&&!l,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(cn,{my:"lg"}),s.jsx(ge,{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(Ke,{onSubmit:j,children:s.jsxs(te,{children:[s.jsx(ve,{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:y,disabled:b&&!y,children:s.jsx(gz,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Jy,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!y&&v&&s.jsxs(s.Fragment,{children:[s.jsx(ge,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:v})]})]})}function PY(){return s.jsx(PG,{children:s.jsxs(Se,{errorElement:s.jsx(UQ,{}),children:[s.jsx(Se,{path:"/signin",element:s.jsx(hK,{})}),s.jsx(Se,{path:"/oauth",element:s.jsx(lK,{})}),s.jsx(Se,{path:"/resetpassword",element:s.jsx(uK,{})}),s.jsx(Se,{path:"/setpassword/:id/:secret",element:s.jsx(fK,{})}),s.jsx(Se,{path:"/register",element:s.jsx(cK,{})}),s.jsx(Se,{path:"/changepassword",element:s.jsx(FQ,{})}),s.jsx(Se,{path:"/security",element:s.jsx(dK,{})}),s.jsx(Se,{path:"/mfa",element:s.jsx(sK,{})}),s.jsx(Se,{path:"/batch",element:s.jsx(LQ,{})}),s.jsx(Se,{path:"/bulk/:resourceType",element:s.jsx($Q,{})}),s.jsx(Se,{path:"/smart",element:s.jsx(pK,{})}),s.jsx(Se,{path:"/forms/:id",element:s.jsx(YQ,{})}),s.jsx(Se,{path:"/admin/super",element:s.jsx(PK,{})}),s.jsx(Se,{path:"/admin/config",element:s.jsx(jK,{})}),s.jsxs(Se,{path:"/admin",element:s.jsx(CK,{}),children:[s.jsx(Se,{path:"patients",element:s.jsx(wK,{})}),s.jsx(Se,{path:"bots/new",element:s.jsx(vK,{})}),s.jsx(Se,{path:"bots",element:s.jsx(mK,{})}),s.jsx(Se,{path:"clients/new",element:s.jsx(yK,{})}),s.jsx(Se,{path:"clients",element:s.jsx(gK,{})}),s.jsx(Se,{path:"details",element:s.jsx(gw,{})}),s.jsx(Se,{path:"invite",element:s.jsx(SK,{})}),s.jsx(Se,{path:"users",element:s.jsx(kK,{})}),s.jsx(Se,{path:"project",element:s.jsx(gw,{})}),s.jsx(Se,{path:"secrets",element:s.jsx(EK,{})}),s.jsx(Se,{path:"sites",element:s.jsx(TK,{})}),s.jsx(Se,{path:"members/:membershipId",element:s.jsx(bK,{})})]}),s.jsx(Se,{path:"/lab/assays",element:s.jsx(RK,{})}),s.jsx(Se,{path:"/lab/panels",element:s.jsx(_K,{})}),s.jsx(Se,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(bw,{})}),s.jsx(Se,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(bw,{})}),s.jsxs(Se,{path:"/:resourceType/new",element:s.jsx(BQ,{}),children:[s.jsx(Se,{index:!0,element:s.jsx(em,{})}),s.jsx(Se,{path:"form",element:s.jsx(em,{})}),s.jsx(Se,{path:"json",element:s.jsx(ZK,{})}),s.jsx(Se,{path:"profiles",element:s.jsx(em,{})})]}),s.jsxs(Se,{path:"/:resourceType/:id",element:s.jsx(jY,{}),children:[s.jsx(Se,{index:!0,element:s.jsx(Sw,{})}),s.jsx(Se,{path:"apply",element:s.jsx(IK,{})}),s.jsx(Se,{path:"apps",element:s.jsx(AK,{})}),s.jsx(Se,{path:"event",element:s.jsx(MK,{})}),s.jsx(Se,{path:"blame",element:s.jsx(OK,{})}),s.jsx(Se,{path:"bots",element:s.jsx(oY,{})}),s.jsx(Se,{path:"builder",element:s.jsx(WK,{})}),s.jsx(Se,{path:"checklist",element:s.jsx(qK,{})}),s.jsx(Se,{path:"delete",element:s.jsx(GK,{})}),s.jsx(Se,{path:"details",element:s.jsx(YK,{})}),s.jsx(Se,{path:"edit",element:s.jsx(XK,{})}),s.jsx(Se,{path:"editor",element:s.jsx(VK,{})}),s.jsx(Se,{path:"history",element:s.jsx(JK,{})}),s.jsx(Se,{path:"json",element:s.jsx(eY,{})}),s.jsx(Se,{path:"preview",element:s.jsx(tY,{})}),s.jsx(Se,{path:"responses",element:s.jsx(sY,{})}),s.jsx(Se,{path:"report",element:s.jsx(lY,{})}),s.jsx(Se,{path:"ranges",element:s.jsx(aY,{})}),s.jsx(Se,{path:"subscriptions",element:s.jsx(CY,{})}),s.jsx(Se,{path:"timeline",element:s.jsx(Sw,{})}),s.jsx(Se,{path:"tools",element:s.jsx(TY,{})}),s.jsx(Se,{path:"profiles",element:s.jsx(nY,{})})]}),s.jsx(Se,{path:"/:resourceType",element:s.jsx(mw,{})}),s.jsx(Se,{path:"/",element:s.jsx(mw,{})})]})})}function kY(){const e=se(),t=e.getUserConfiguration(),n=oi(),[r]=g0();return e.isLoading()?s.jsx(Jr,{}):s.jsx(mB,{logo:s.jsx(ro,{size:24}),pathname:n.pathname,searchParams:r,version:a8,menus:RY(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(p.Suspense,{fallback:s.jsx(Jr,{}),children:s.jsx(PY,{})})})}function RY(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:_Y(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(rz,{})}]}),t}const ww={Patient:xz,Practitioner:tz,Organization:q8,ServiceRequest:fz,DiagnosticReport:mz,Questionnaire:ez,admin:V8,AccessPolicy:nz,Subscription:jz,batch:az,Observation:sz};function _Y(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in ww){const n=ww[t];return s.jsx(n,{})}}catch{}return s.jsx(jh,{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 DY(){const e=Su(),t=new gk({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=DG([{path:"*",element:s.jsx(kY,{})}]),o=a=>r.navigate(a);WR(document.getElementById("root")).render(s.jsx(p.StrictMode,{children:s.jsx(P8,{medplum:t,navigate:o,children:s.jsxs(oj,{theme:n,children:[s.jsx(ti,{position:"bottom-right"}),s.jsx(zG,{router:r})]})})}))}DY().catch(console.error);
|
|
574
|
+
//# sourceMappingURL=index-Dv35Xlqp.js.map
|