@medplum/app 4.1.5 → 4.1.6
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,581 @@
|
|
|
1
|
+
function n3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}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 a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function rx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var hv={exports:{}},ku={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and 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 Nj;function r3(){if(Nj)return ku;Nj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var c=null;if(o!==void 0&&(c=""+o),a.key!==void 0&&(c=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:c,ref:a!==void 0?a:null,props:o}}return ku.Fragment=t,ku.jsx=n,ku.jsxs=n,ku}var Oj;function a3(){return Oj||(Oj=1,hv.exports=r3()),hv.exports}var s=a3(),ei=function(){return ei=Object.assign||function(t){for(var n,r=1,a=arguments.length;r<a;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},ei.apply(this,arguments)};function KT(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}function i3(e,t,n){if(n||arguments.length===2)for(var r=0,a=t.length,o;r<a;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var pv={exports:{}},vt={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and 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 Mj;function o3(){if(Mj)return vt;Mj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,j={};function C(O,U,Z){this.props=O,this.context=U,this.refs=j,this.updater=Z||b}C.prototype.isReactComponent={},C.prototype.setState=function(O,U){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,U,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function R(){}R.prototype=C.prototype;function D(O,U,Z){this.props=O,this.context=U,this.refs=j,this.updater=Z||b}var E=D.prototype=new R;E.constructor=D,S(E,C.prototype),E.isPureReactComponent=!0;var T=Array.isArray,A={H:null,A:null,T:null,S:null,V:null},_=Object.prototype.hasOwnProperty;function M(O,U,Z,ee,ye,be){return Z=be.ref,{$$typeof:e,type:O,key:U,ref:Z!==void 0?Z:null,props:be}}function L(O,U){return M(O.type,U,void 0,void 0,void 0,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var U={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Z){return U[Z]})}var X=/\/+/g;function Q(O,U){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):U.toString(36)}function J(){}function W(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(J,J):(O.status="pending",O.then(function(U){O.status==="pending"&&(O.status="fulfilled",O.value=U)},function(U){O.status==="pending"&&(O.status="rejected",O.reason=U)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function Y(O,U,Z,ee,ye){var be=typeof O;(be==="undefined"||be==="boolean")&&(O=null);var ve=!1;if(O===null)ve=!0;else switch(be){case"bigint":case"string":case"number":ve=!0;break;case"object":switch(O.$$typeof){case e:case t:ve=!0;break;case m:return ve=O._init,Y(ve(O._payload),U,Z,ee,ye)}}if(ve)return ye=ye(O),ve=ee===""?"."+Q(O,0):ee,T(ye)?(Z="",ve!=null&&(Z=ve.replace(X,"$&/")+"/"),Y(ye,U,Z,"",function(et){return et})):ye!=null&&($(ye)&&(ye=L(ye,Z+(ye.key==null||O&&O.key===ye.key?"":(""+ye.key).replace(X,"$&/")+"/")+ve)),U.push(ye)),1;ve=0;var Ge=ee===""?".":ee+":";if(T(O))for(var ke=0;ke<O.length;ke++)ee=O[ke],be=Ge+Q(ee,ke),ve+=Y(ee,U,Z,be,ye);else if(ke=v(O),typeof ke=="function")for(O=ke.call(O),ke=0;!(ee=O.next()).done;)ee=ee.value,be=Ge+Q(ee,ke++),ve+=Y(ee,U,Z,be,ye);else if(be==="object"){if(typeof O.then=="function")return Y(W(O),U,Z,ee,ye);throw U=String(O),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ve}function P(O,U,Z){if(O==null)return O;var ee=[],ye=0;return Y(O,ee,"","",function(be){return U.call(Z,be,ye++)}),ee}function I(O){if(O._status===-1){var U=O._result;U=U(),U.then(function(Z){(O._status===0||O._status===-1)&&(O._status=1,O._result=Z)},function(Z){(O._status===0||O._status===-1)&&(O._status=2,O._result=Z)}),O._status===-1&&(O._status=0,O._result=U)}if(O._status===1)return O._result.default;throw O._result}var z=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function F(){}return vt.Children={map:P,forEach:function(O,U,Z){P(O,function(){U.apply(this,arguments)},Z)},count:function(O){var U=0;return P(O,function(){U++}),U},toArray:function(O){return P(O,function(U){return U})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},vt.Component=C,vt.Fragment=n,vt.Profiler=a,vt.PureComponent=D,vt.StrictMode=r,vt.Suspense=f,vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,vt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return A.H.useMemoCache(O)}},vt.cache=function(O){return function(){return O.apply(null,arguments)}},vt.cloneElement=function(O,U,Z){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ee=S({},O.props),ye=O.key,be=void 0;if(U!=null)for(ve in U.ref!==void 0&&(be=void 0),U.key!==void 0&&(ye=""+U.key),U)!_.call(U,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&U.ref===void 0||(ee[ve]=U[ve]);var ve=arguments.length-2;if(ve===1)ee.children=Z;else if(1<ve){for(var Ge=Array(ve),ke=0;ke<ve;ke++)Ge[ke]=arguments[ke+2];ee.children=Ge}return M(O.type,ye,void 0,void 0,be,ee)},vt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},vt.createElement=function(O,U,Z){var ee,ye={},be=null;if(U!=null)for(ee in U.key!==void 0&&(be=""+U.key),U)_.call(U,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ye[ee]=U[ee]);var ve=arguments.length-2;if(ve===1)ye.children=Z;else if(1<ve){for(var Ge=Array(ve),ke=0;ke<ve;ke++)Ge[ke]=arguments[ke+2];ye.children=Ge}if(O&&O.defaultProps)for(ee in ve=O.defaultProps,ve)ye[ee]===void 0&&(ye[ee]=ve[ee]);return M(O,be,void 0,void 0,null,ye)},vt.createRef=function(){return{current:null}},vt.forwardRef=function(O){return{$$typeof:u,render:O}},vt.isValidElement=$,vt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:I}},vt.memo=function(O,U){return{$$typeof:p,type:O,compare:U===void 0?null:U}},vt.startTransition=function(O){var U=A.T,Z={};A.T=Z;try{var ee=O(),ye=A.S;ye!==null&&ye(Z,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(F,z)}catch(be){z(be)}finally{A.T=U}},vt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},vt.use=function(O){return A.H.use(O)},vt.useActionState=function(O,U,Z){return A.H.useActionState(O,U,Z)},vt.useCallback=function(O,U){return A.H.useCallback(O,U)},vt.useContext=function(O){return A.H.useContext(O)},vt.useDebugValue=function(){},vt.useDeferredValue=function(O,U){return A.H.useDeferredValue(O,U)},vt.useEffect=function(O,U,Z){var ee=A.H;if(typeof Z=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ee.useEffect(O,U)},vt.useId=function(){return A.H.useId()},vt.useImperativeHandle=function(O,U,Z){return A.H.useImperativeHandle(O,U,Z)},vt.useInsertionEffect=function(O,U){return A.H.useInsertionEffect(O,U)},vt.useLayoutEffect=function(O,U){return A.H.useLayoutEffect(O,U)},vt.useMemo=function(O,U){return A.H.useMemo(O,U)},vt.useOptimistic=function(O,U){return A.H.useOptimistic(O,U)},vt.useReducer=function(O,U,Z){return A.H.useReducer(O,U,Z)},vt.useRef=function(O){return A.H.useRef(O)},vt.useState=function(O){return A.H.useState(O)},vt.useSyncExternalStore=function(O,U,Z){return A.H.useSyncExternalStore(O,U,Z)},vt.useTransition=function(){return A.H.useTransition()},vt.version="19.1.0",vt}var Ij;function ax(){return Ij||(Ij=1,pv.exports=o3()),pv.exports}var y=ax();const Cn=rx(y),s3=n3({__proto__:null,default:Cn},[y]);var fh="right-scroll-bar-position",hh="width-before-scroll-bar",l3="with-scroll-bars-hidden",c3="--removed-body-scroll-bar-size";function mv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function u3(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var a=n.value;a!==r&&(n.value=r,n.callback(r,a))}}}})[0];return n.callback=t,n.facade}var d3=typeof window<"u"?y.useLayoutEffect:y.useEffect,Lj=new WeakMap;function f3(e,t){var n=u3(null,function(r){return e.forEach(function(a){return mv(a,r)})});return d3(function(){var r=Lj.get(n);if(r){var a=new Set(r),o=new Set(e),c=n.current;a.forEach(function(u){o.has(u)||mv(u,null)}),o.forEach(function(u){a.has(u)||mv(u,c)})}Lj.set(n,e)},[e]),n}function h3(e){return e}function p3(e,t){t===void 0&&(t=h3);var n=[],r=!1,a={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(o){var c=t(o,r);return n.push(c),function(){n=n.filter(function(u){return u!==c})}},assignSyncMedium:function(o){for(r=!0;n.length;){var c=n;n=[],c.forEach(o)}n={push:function(u){return o(u)},filter:function(){return n}}},assignMedium:function(o){r=!0;var c=[];if(n.length){var u=n;n=[],u.forEach(o),c=n}var f=function(){var m=c;c=[],m.forEach(o)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return a}function m3(e){e===void 0&&(e={});var t=p3(null);return t.options=ei({async:!0,ssr:!1},e),t}var XT=function(e){var t=e.sideCar,n=KT(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 y.createElement(r,ei({},n))};XT.isSideCarExport=!0;function g3(e,t){return e.useMedium(t),XT}var ZT=m3(),gv=function(){},rp=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:gv,onWheelCapture:gv,onTouchMoveCapture:gv}),a=r[0],o=r[1],c=e.forwardProps,u=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,v=e.sideCar,b=e.noRelative,S=e.noIsolation,j=e.inert,C=e.allowPinchZoom,R=e.as,D=R===void 0?"div":R,E=e.gapMode,T=KT(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),A=v,_=f3([n,t]),M=ei(ei({},T),a);return y.createElement(y.Fragment,null,m&&y.createElement(A,{sideCar:ZT,removeScrollBar:p,shards:g,noRelative:b,noIsolation:S,inert:j,setCallbacks:o,allowPinchZoom:!!C,lockRef:n,gapMode:E}),c?y.cloneElement(y.Children.only(u),ei(ei({},M),{ref:_})):y.createElement(D,ei({},M,{className:f,ref:_}),u))});rp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};rp.classNames={fullWidth:hh,zeroRight:fh};var v3=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y3(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=v3();return t&&e.setAttribute("nonce",t),e}function x3(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function b3(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var S3=function(){var e=0,t=null;return{add:function(n){e==0&&(t=y3())&&(x3(t,n),b3(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},w3=function(){var e=S3();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JT=function(){var e=w3(),t=function(n){var r=n.styles,a=n.dynamic;return e(r,a),null};return t},j3={left:0,top:0,right:0,gap:0},vv=function(e){return parseInt(e||"",10)||0},C3=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],a=t[e==="padding"?"paddingRight":"marginRight"];return[vv(n),vv(r),vv(a)]},E3=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return j3;var t=C3(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])}},T3=JT(),nc="data-scroll-locked",R3=function(e,t,n,r){var a=e.left,o=e.top,c=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
+
.`.concat(l3,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(nc,`] {
|
|
23
|
+
overflow: hidden `).concat(r,`;
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
26
|
+
padding-left: `.concat(a,`px;
|
|
27
|
+
padding-top: `).concat(o,`px;
|
|
28
|
+
padding-right: `).concat(c,`px;
|
|
29
|
+
margin-left:0;
|
|
30
|
+
margin-top:0;
|
|
31
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
32
|
+
`),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(fh,` {
|
|
36
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(hh,` {
|
|
40
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(fh," .").concat(fh,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(hh," .").concat(hh,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(nc,`] {
|
|
52
|
+
`).concat(c3,": ").concat(u,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},zj=function(){var e=parseInt(document.body.getAttribute(nc)||"0",10);return isFinite(e)?e:0},D3=function(){y.useEffect(function(){return document.body.setAttribute(nc,(zj()+1).toString()),function(){var e=zj()-1;e<=0?document.body.removeAttribute(nc):document.body.setAttribute(nc,e.toString())}},[])},A3=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;D3();var o=y.useMemo(function(){return E3(a)},[a]);return y.createElement(T3,{styles:R3(o,!t,a,n?"":"!important")})},dy=!1;if(typeof window<"u")try{var Xf=Object.defineProperty({},"passive",{get:function(){return dy=!0,!0}});window.addEventListener("test",Xf,Xf),window.removeEventListener("test",Xf,Xf)}catch{dy=!1}var Ul=dy?{passive:!1}:!1,_3=function(e){return e.tagName==="TEXTAREA"},eR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_3(e)&&n[t]==="visible")},k3=function(e){return eR(e,"overflowY")},P3=function(e){return eR(e,"overflowX")},$j=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=tR(e,r);if(a){var o=nR(e,r),c=o[1],u=o[2];if(c>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},N3=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},O3=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tR=function(e,t){return e==="v"?k3(t):P3(t)},nR=function(e,t){return e==="v"?N3(t):O3(t)},M3=function(e,t){return e==="h"&&t==="rtl"?-1:1},I3=function(e,t,n,r,a){var o=M3(e,window.getComputedStyle(t).direction),c=o*r,u=n.target,f=t.contains(u),p=!1,m=c>0,g=0,v=0;do{var b=nR(e,u),S=b[0],j=b[1],C=b[2],R=j-C-o*S;(S||R)&&tR(e,u)&&(g+=R,v+=S),u=u.parentNode.host||u.parentNode}while(!f&&u!==document.body||f&&(t.contains(u)||t===u));return(m&&Math.abs(g)<1||!m&&Math.abs(v)<1)&&(p=!0),p},Zf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Uj=function(e){return[e.deltaX,e.deltaY]},Bj=function(e){return e&&"current"in e?e.current:e},L3=function(e,t){return e[0]===t[0]&&e[1]===t[1]},z3=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},$3=0,Bl=[];function U3(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),a=y.useState($3++)[0],o=y.useState(JT)[0],c=y.useRef(e);y.useEffect(function(){c.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var j=i3([e.lockRef.current],(e.shards||[]).map(Bj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var R=Zf(j),D=n.current,E="deltaX"in j?j.deltaX:D[0]-R[0],T="deltaY"in j?j.deltaY:D[1]-R[1],A,_=j.target,M=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in j&&M==="h"&&_.type==="range")return!1;var L=$j(M,_);if(!L)return!0;if(L?A=M:(A=M==="v"?"h":"v",L=$j(M,_)),!L)return!1;if(!r.current&&"changedTouches"in j&&(E||T)&&(r.current=A),!A)return!0;var $=r.current||A;return I3($,C,j,$==="h"?E:T)},[]),f=y.useCallback(function(j){var C=j;if(!(!Bl.length||Bl[Bl.length-1]!==o)){var R="deltaY"in C?Uj(C):Zf(C),D=t.current.filter(function(A){return A.name===C.type&&(A.target===C.target||C.target===A.shadowParent)&&L3(A.delta,R)})[0];if(D&&D.should){C.cancelable&&C.preventDefault();return}if(!D){var E=(c.current.shards||[]).map(Bj).filter(Boolean).filter(function(A){return A.contains(C.target)}),T=E.length>0?u(C,E[0]):!c.current.noIsolation;T&&C.cancelable&&C.preventDefault()}}},[]),p=y.useCallback(function(j,C,R,D){var E={name:j,delta:C,target:R,should:D,shadowParent:B3(R)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(T){return T!==E})},1)},[]),m=y.useCallback(function(j){n.current=Zf(j),r.current=void 0},[]),g=y.useCallback(function(j){p(j.type,Uj(j),j.target,u(j,e.lockRef.current))},[]),v=y.useCallback(function(j){p(j.type,Zf(j),j.target,u(j,e.lockRef.current))},[]);y.useEffect(function(){return Bl.push(o),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:v}),document.addEventListener("wheel",f,Ul),document.addEventListener("touchmove",f,Ul),document.addEventListener("touchstart",m,Ul),function(){Bl=Bl.filter(function(j){return j!==o}),document.removeEventListener("wheel",f,Ul),document.removeEventListener("touchmove",f,Ul),document.removeEventListener("touchstart",m,Ul)}},[]);var b=e.removeScrollBar,S=e.inert;return y.createElement(y.Fragment,null,S?y.createElement(o,{styles:z3(a)}):null,b?y.createElement(A3,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function B3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const V3=g3(ZT,U3);var lc=y.forwardRef(function(e,t){return y.createElement(rp,ei({},e,{ref:t,sideCar:V3}))});lc.classNames=rp.classNames;function sn(e){return Object.keys(e)}function yv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function ix(e,t){const n={...e},r=t;return yv(e)&&yv(t)&&Object.keys(t).forEach(a=>{yv(r[a])&&a in e?n[a]=ix(n[a],r[a]):n[a]=r[a]}),n}function F3(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function H3(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 Wu(e){const t=H3(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 xv(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function rR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const a=`${r/16}${e}`;return t?xv(a):a}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(o=>n(o)).join(",");if(r.includes(" "))return r.split(" ").map(o=>n(o)).join(" ");if(r.includes(e))return t?xv(r):r;const a=r.replace("px","");if(!Number.isNaN(Number(a))){const o=`${Number(a)/16}${e}`;return t?xv(o):o}}return r}return n}const le=rR("rem",{shouldScale:!0}),jh=rR("em");function Fo(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function aR(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(r=>t.test(r))}return!1}function Hi(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==y.Fragment:!1}function vr(e){const t=y.createContext(null);return[({children:a,value:o})=>s.jsx(t.Provider,{value:o,children:a}),()=>{const a=y.useContext(t);if(a===null)throw new Error(e);return a}]}function qi(e=null){const t=y.createContext(e);return[({children:a,value:o})=>s.jsx(t.Provider,{value:o,children:a}),()=>y.useContext(t)]}function Vj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Ch(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function q3(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 G3(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 Q3(e,t,n){return Ch(e,n)===Ch(t,n)}function iR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:a=!1,dir:o="rtl",orientation:c}){return u=>{var S;n==null||n(u);const f=Array.from(((S=Ch(u.currentTarget,e))==null?void 0:S.querySelectorAll(t))||[]).filter(j=>Q3(u.currentTarget,j,e)),p=f.findIndex(j=>u.currentTarget===j),m=G3(p,f,r),g=q3(p,f,r),v=o==="rtl"?g:m,b=o==="rtl"?m:g;switch(u.key){case"ArrowRight":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[v].focus(),a&&f[v].click());break}case"ArrowLeft":{c==="horizontal"&&(u.stopPropagation(),u.preventDefault(),f[b].focus(),a&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[g].focus(),a&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(u.stopPropagation(),u.preventDefault(),f[m].focus(),a&&f[m].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const j=f.length-1;!f[j].disabled&&f[j].focus();break}}}}const W3={app:100,modal:200,popover:300,overlay:400,max:9999};function Wr(e){return W3[e]}const Eh=()=>{};function Y3(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Eh:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function nt(e,t="size",n=!0){if(e!==void 0)return aR(e)?n?le(e):e:`var(--${t}-${e})`}function On(e){return nt(e,"mantine-spacing")}function Ft(e){return e===void 0?"var(--mantine-radius-default)":nt(e,"mantine-radius")}function Mn(e){return nt(e,"mantine-font-size")}function oR(e){return nt(e,"mantine-line-height",!1)}function ox(e){if(e)return nt(e,"mantine-shadow",!1)}function Rr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function sx(e,t){return e in t?Wu(t[e]):Wu(e)}function Yu(e,t){const n=e.map(r=>({value:r,px:sx(r,t)}));return n.sort((r,a)=>r.px-a.px),n}function ka(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function K3(e,t,n){var r;return n?Array.from(((r=Ch(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(a=>a===n):null}function X3(){const[e,t]=y.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function ph(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 Th(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function Z3(e,t){if(e===t)return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let a=0;a<r;a+=1){const o=n[a];if(!(o in t)||e[o]!==t[o])return!1}return!0}function Fj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function ws(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function ap(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,a=ws(e),o=y.useRef(0),c=y.useRef(()=>{}),u=Object.assign(y.useCallback((...f)=>{window.clearTimeout(o.current);const p=()=>{o.current!==0&&(o.current=0,a(...f))};c.current=p,u.flush=p,o.current=window.setTimeout(p,n)},[a,n]),{flush:c.current});return y.useEffect(()=>()=>{window.clearTimeout(o.current),r&&u.flush()},[u,r]),u}const Hj=["mousedown","touchstart"];function J3(e,t,n){const r=y.useRef(null);return y.useEffect(()=>{const a=o=>{const{target:c}=o??{};if(Array.isArray(n)){const u=(c==null?void 0:c.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(c)&&c.tagName!=="HTML";n.every(p=>!!p&&!o.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Hj).forEach(o=>document.addEventListener(o,a)),()=>{(t||Hj).forEach(o=>document.removeEventListener(o,a))}},[r,e,n]),r}function sR({timeout:e=2e3}={}){const[t,n]=y.useState(null),[r,a]=y.useState(!1),[o,c]=y.useState(null),u=m=>{window.clearTimeout(o),c(window.setTimeout(()=>a(!1),e)),a(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>u(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{a(!1),n(null),window.clearTimeout(o)},error:t,copied:r}}function eN(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function tN(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function lR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,a]=y.useState(n?t:tN(e)),o=y.useRef(null);return y.useEffect(()=>{if("matchMedia"in window)return o.current=window.matchMedia(e),a(o.current.matches),eN(o.current,c=>a(c.matches))},[e]),r}function nN(e,t){return lR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Sc=typeof document<"u"?y.useLayoutEffect:y.useEffect;function $i(e,t){const n=y.useRef(!1);y.useEffect(()=>()=>{n.current=!1},[]),y.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function cR({opened:e,shouldReturnFocus:t=!0}){const n=y.useRef(null),r=()=>{var a;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((a=n.current)==null||a.focus({preventScroll:!0}))};return $i(()=>{let a=-1;const o=c=>{c.key==="Tab"&&window.clearTimeout(a)};return document.addEventListener("keydown",o),e?n.current=document.activeElement:t&&(a=window.setTimeout(r,10)),()=>{window.clearTimeout(a),document.removeEventListener("keydown",o)}},[e,t]),r}const rN=/input|select|textarea|button|object/,uR="a, input, select, textarea, button, object, [tabindex]";function aN(e){return e.style.display==="none"}function iN(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(aN(n))return!1;n=n.parentNode}return!0}function dR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function fy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(dR(e));return(rN.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&iN(e)}function fR(e){const t=dR(e);return(Number.isNaN(t)||t>=0)&&fy(e)}function oN(e){return Array.from(e.querySelectorAll(uR)).filter(fR)}function sN(e,t){const n=oN(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],a=e.getRootNode();let o=r===a.activeElement||e===a.activeElement;const c=a.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(o=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!o)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function lN(e=!0){const t=y.useRef(null),n=a=>{let o=a.querySelector("[data-autofocus]");if(!o){const c=Array.from(a.querySelectorAll(uR));o=c.find(fR)||c.find(fy)||null,!o&&fy(a)&&(o=a)}o&&o.focus({preventScroll:!0})},r=y.useCallback(a=>{e&&a!==null&&t.current!==a&&(a?(setTimeout(()=>{a.getRootNode()&&n(a)}),t.current=a):t.current=null)},[e]);return y.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const a=o=>{o.key==="Tab"&&t.current&&sN(t.current,o)};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e]),r}const cN=e=>(e+1)%1e6;function uN(){const[,e]=y.useReducer(cN,0);return e}const dN=Cn.useId||(()=>{});function fN(){const e=dN();return e?`mantine-${e.replace(/:/g,"")}`:""}function yr(e){const t=fN(),[n,r]=y.useState(t);return Sc(()=>{r(Th())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function hR(e,t,n){y.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Ku(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function hN(...e){const t=new Map;return n=>{if(e.forEach(r=>{const a=Ku(r,n);a&&t.set(r,a)}),t.size>0)return()=>{e.forEach(r=>{const a=t.get(r);a?a():Ku(r,null)}),t.clear()}}}function Un(...e){return y.useCallback(hN(...e),e)}function Wn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[a,o]=y.useState(t!==void 0?t:n),c=(u,...f)=>{o(u),r==null||r(u,...f)};return e!==void 0?[e,r,!0]:[a,c,!1]}function _o(e,t){const n=t-e+1;return Array.from({length:n},(r,a)=>a+e)}const Jf="dots";function pN({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:a=1,onChange:o}){const c=Math.max(Math.trunc(e),0),[u,f]=Wn({value:r,onChange:o,defaultValue:a,finalValue:a}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(u+1),g=()=>p(u-1),v=()=>p(1),b=()=>p(c);return{range:y.useMemo(()=>{if(t*2+3+n*2>=c)return _o(1,c);const C=Math.max(u-t,n),R=Math.min(u+t,c-n),D=C>n+2,E=R<c-(n+1);if(!D&&E){const T=t*2+n+2;return[..._o(1,T),Jf,..._o(c-(n-1),c)]}if(D&&!E){const T=n+1+2*t;return[..._o(1,n),Jf,..._o(c-T,c)]}return[..._o(1,n),Jf,..._o(C,R),Jf,..._o(c-n+1,c)]},[c,t,u]),active:u,setPage:p,next:m,previous:g,first:v,last:b}}function lx(e,t){return lR("(prefers-reduced-motion: reduce)",e,t)}function mN(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!Z3(e[n],t[n]))return!1;return!0}function gN(e){const t=y.useRef([]),n=y.useRef(0);return mN(t.current,e)||(t.current=e,n.current+=1),[n.current]}function vN(e,t){y.useEffect(e,gN(t))}function ip(e=!1,t){const{onOpen:n,onClose:r}={},[a,o]=y.useState(e),c=y.useCallback(()=>{o(p=>p||(n==null||n(),!0))},[n]),u=y.useCallback(()=>{o(p=>p&&(r==null||r(),!1))},[r]),f=y.useCallback(()=>{a?u():c()},[u,c,a]);return[a,{open:c,close:u,toggle:f}]}function yN(e,t,n={autoInvoke:!1}){const r=y.useRef(null),a=y.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),o=y.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return y.useEffect(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function xN(e,t,n){const r=y.useRef(null),a=y.useRef(null);return y.useEffect(()=>{const o=typeof n=="function"?n():n;return(o||a.current)&&(r.current=new MutationObserver(e),r.current.observe(o||a.current,t)),()=>{var c;(c=r.current)==null||c.disconnect()}},[e,t]),a}function bN(){const[e,t]=y.useState(!1);return y.useEffect(()=>t(!0),[]),e}var SN={};function pR(){return typeof process<"u"&&SN?"production":"development"}function op(e){var n;const t=Cn.version;return typeof Cn.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function mR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=mR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $t(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=mR(e))&&(r&&(r+=" "),r+=t);return r}const wN={};function jN(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,a])=>{t[r]?t[r]=$t(t[r],a):t[r]=a})}),t}function sp({theme:e,classNames:t,props:n,stylesCtx:r}){const o=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||wN);return jN(o)}function Rh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((o,c)=>typeof c=="function"?{...o,...c(e,n,r)}:{...o,...c},{})}const cx=y.createContext(null);function Gi(){const e=y.useContext(cx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function CN(){return Gi().cssVariablesResolver}function EN(){return Gi().classNamesPrefix}function lp(){return Gi().getStyleNonce}function TN(){return Gi().withStaticClasses}function RN(){return Gi().headless}function DN(){var e;return(e=Gi().stylesTransform)==null?void 0:e.sx}function AN(){var e;return(e=Gi().stylesTransform)==null?void 0:e.styles}function gR(){return Gi().env||"default"}function _N(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function kN(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=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:c}}const n=parseInt(t,16),r=n>>16&255,a=n>>8&255,o=n&255;return{r,g:a,b:o,a:1}}function PN(e){const[t,n,r,a]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:a||1}}function NN(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),a=parseInt(n[2],10)/100,o=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*o-1))*a,f=r/60,p=u*(1-Math.abs(f%2-1)),m=o-u/2;let g,v,b;return f>=0&&f<1?(g=u,v=p,b=0):f>=1&&f<2?(g=p,v=u,b=0):f>=2&&f<3?(g=0,v=u,b=p):f>=3&&f<4?(g=0,v=p,b=u):f>=4&&f<5?(g=p,v=0,b=u):(g=u,v=0,b=p),{r:Math.round((g+m)*255),g:Math.round((v+m)*255),b:Math.round((b+m)*255),a:c||1}}function ux(e){return _N(e)?kN(e):e.startsWith("rgb")?PN(e):e.startsWith("hsl")?NN(e):{r:0,g:0,b:0,a:1}}function eh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:a,a:o}=ux(e),c=1-t,u=f=>Math.round(f*c);return`rgba(${u(n)}, ${u(r)}, ${u(a)}, ${o})`}function Xu(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function bv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function ON(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function MN(e){if(e.startsWith("oklch("))return(ON(e)||0)/100;const{r:t,g:n,b:r}=ux(e),a=t/255,o=n/255,c=r/255,u=bv(a),f=bv(o),p=bv(c);return .2126*u+.7152*f+.0722*p}function Pu(e,t=.179){return e.startsWith("var(")?!1:MN(e)>t}function da({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:Pu(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:Pu(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:Pu(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,a]=e.split("."),o=a?Number(a):void 0,c=r in t.colors;if(c){const u=o!==void 0?t.colors[r][o]:t.colors[r][Xu(t,n||"light")];return{color:r,value:u,shade:o,isThemeColor:c,isLight:Pu(u,t.luminanceThreshold),variable:a?`--mantine-color-${r}-${o}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Pu(e,t.luminanceThreshold),shade:o,variable:void 0}}function Gt(e,t){const n=da({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function hy(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=Gt(n.from,t),a=Gt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${a} 100%)`}function sa(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const o=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${o}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:a}=ux(e);return`rgba(${n}, ${r}, ${a}, ${t})`}const Vl=sa,IN=({color:e,theme:t,variant:n,gradient:r,autoContrast:a})=>{const o=da({color:e,theme:t}),c=typeof a=="boolean"?a:t.autoContrast;if(n==="filled"){const u=c&&o.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return o.isThemeColor?o.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${o.color}-${o.shade})`,hover:`var(--mantine-color-${o.color}-${o.shade===9?8:o.shade+1})`,color:u,border:`${le(1)} solid transparent`}:{background:e,hover:eh(e,.1),color:u,border:`${le(1)} solid transparent`}}if(n==="light"){if(o.isThemeColor){if(o.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:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:sa(u,.1),hover:sa(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:sa(e,.1),hover:sa(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return o.isThemeColor?o.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:sa(t.colors[o.color][o.shade],.05),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid var(--mantine-color-${o.color}-${o.shade})`}:{background:"transparent",hover:sa(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(o.isThemeColor){if(o.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const u=t.colors[o.color][o.shade];return{background:"transparent",hover:sa(u,.12),color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:sa(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?o.isThemeColor?o.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${o.color}-${Math.min(o.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?o.isThemeColor?o.shade===void 0?{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:`var(--mantine-color-${o.color}-${o.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:eh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:hy(r,t),hover:hy(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:`${le(1)} solid var(--mantine-color-default-border)`}:{}},LN={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"]},qj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",dx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:LN,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:IN,autoContrast:!1,luminanceThreshold:.3,fontFamily:qj,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:qj,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function Gj(e){return e==="auto"||e==="dark"||e==="light"}function zN({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 Gj(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&&Gj(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const $N="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Qj="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Sv(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Wj(e){if(!(e.primaryColor in e.colors))throw new Error($N);if(typeof e.primaryShade=="object"&&(!Sv(e.primaryShade.dark)||!Sv(e.primaryShade.light)))throw new Error(Qj);if(typeof e.primaryShade=="number"&&!Sv(e.primaryShade))throw new Error(Qj)}function UN(e,t){var r;if(!t)return Wj(e),e;const n=ix(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),Wj(n),n}const fx=y.createContext(null),BN=()=>y.useContext(fx)||dx;function Sn(){const e=y.useContext(fx);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 vR({theme:e,children:t,inherit:n=!0}){const r=BN(),a=y.useMemo(()=>UN(n?r:dx,e),[e,r,n]);return s.jsx(fx.Provider,{value:a,children:t})}vR.displayName="@mantine/core/MantineThemeProvider";function VN(){const e=Sn(),t=lp(),n=sn(e.breakpoints).reduce((r,a)=>{const o=e.breakpoints[a].includes("px"),c=Wu(e.breakpoints[a]),u=o?`${c-.1}px`:jh(c-.1),f=o?`${c}px`:jh(c);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${a} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${a} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function wv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Nu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,a)=>`${a}{${r}}`,t)}function FN(e,t){const n=wv(e.variables),r=n?Nu(t,n):"",a=wv(e.dark),o=wv(e.light),c=a?Nu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,a):"",u=o?Nu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,o):"";return`${r}${c}${u}`}function Qi({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&da({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function Yj(e,t){return Qi({color:e.colors[e.primaryColor][Xu(e,t)],theme:e,autoContrast:null})}function th({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:a=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Xu(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${u===9?8:u+1})`,[`--mantine-color-${r}-light`]:Vl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:Vl(e.colors[t][u],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline-hover`]:Vl(e.colors[t][u],.05)};return a?{[`--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],...f}:f}const o=Xu(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${o})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${o===9?8:o+1})`,[`--mantine-color-${r}-light`]:Vl(e.colors[t][Math.max(0,o-2)],.15),[`--mantine-color-${r}-light-hover`]:Vl(e.colors[t][Math.max(0,o-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(o-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(o-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Vl(e.colors[t][Math.max(o-4,0)],.05)};return a?{[`--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}function HN(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Fl(e,t,n){sn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const yR=e=>{const t=Xu(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(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":Yj(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":Yj(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)"}};Fl(r.variables,e.breakpoints,"breakpoint"),Fl(r.variables,e.spacing,"spacing"),Fl(r.variables,e.fontSizes,"font-size"),Fl(r.variables,e.lineHeights,"line-height"),Fl(r.variables,e.shadows,"shadow"),Fl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((o,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),sn(e.colors).forEach(o=>{const c=e.colors[o];if(HN(c)){Object.assign(r.light,th({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,th({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((u,f)=>{r.variables[`--mantine-color-${o}-${f}`]=u}),Object.assign(r.light,th({theme:e,color:o,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,th({theme:e,color:o,colorScheme:"dark",withColorValues:!1}))});const a=e.headings.sizes;return sn(a).forEach(o=>{r.variables[`--mantine-${o}-font-size`]=a[o].fontSize,r.variables[`--mantine-${o}-line-height`]=a[o].lineHeight,r.variables[`--mantine-${o}-font-weight`]=a[o].fontWeight||e.headings.fontWeight}),r};function qN({theme:e,generator:t}){const n=yR(e),r=t==null?void 0:t(e);return r?ix(n,r):n}const jv=yR(dx);function GN(e){const t={variables:{},light:{},dark:{}};return sn(e.variables).forEach(n=>{jv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),sn(e.light).forEach(n=>{jv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),sn(e.dark).forEach(n=>{jv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function QN(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 xR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=lp(),a=CN(),o=qN({theme:n,generator:a}),c=e===":root"&&t,u=c?GN(o):o,f=FN(u,e);return f?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${f}${c?"":QN(e)}`}}):null}xR.displayName="@mantine/CssVariables";function WN(){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 Hl(e,t){var a,o;const n=typeof window<"u"&&"matchMedia"in window&&((a=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:a.matches),r=e!=="auto"?e:n?"dark":"light";(o=t())==null||o.setAttribute("data-mantine-color-scheme",r)}function YN({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const a=y.useRef(null),[o,c]=y.useState(()=>e.get(t)),u=r||o,f=y.useCallback(m=>{r||(Hl(m,n),c(m),e.set(m))},[e.set,u,r]),p=y.useCallback(()=>{c(t),Hl(t,n),e.clear()},[e.clear,t]);return y.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Sc(()=>{Hl(e.get(t),n)},[]),y.useEffect(()=>{var g;if(r)return Hl(r,n),()=>{};r===void 0&&Hl(o,n),typeof window<"u"&&"matchMedia"in window&&(a.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=v=>{o==="auto"&&Hl(v.matches?"dark":"light",n)};return(g=a.current)==null||g.addEventListener("change",m),()=>{var v;return(v=a.current)==null?void 0:v.removeEventListener("change",m)}},[o,r]),{colorScheme:u,setColorScheme:f,clearColorScheme:p}}function KN({respectReducedMotion:e,getRootElement:t}){Sc(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}WN();function bR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:a=!0,deduplicateCssVariables:o=!0,withCssVariables:c=!0,cssVariablesSelector:u=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=zN(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:v,forceColorScheme:b,stylesTransform:S,env:j}){const{colorScheme:C,setColorScheme:R,clearColorScheme:D}=YN({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return KN({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:g}),s.jsx(cx.Provider,{value:{colorScheme:C,setColorScheme:R,clearColorScheme:D,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:v,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:S,env:j},children:s.jsxs(vR,{theme:e,children:[c&&s.jsx(xR,{cssVariablesSelector:u,deduplicateCssVariables:o}),a&&s.jsx(VN,{}),t]})})}bR.displayName="@mantine/core/MantineProvider";function Gs({classNames:e,styles:t,props:n,stylesCtx:r}){const a=Sn();return{resolvedClassNames:sp({theme:a,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Rh({theme:a,styles:t,props:n,stylesCtx:r||void 0})}}const XN={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function ZN({theme:e,options:t,unstyled:n}){return $t((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||XN[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function JN({selector:e,stylesCtx:t,options:n,props:r,theme:a}){return sp({theme:a,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function Kj({selector:e,stylesCtx:t,theme:n,classNames:r,props:a}){return sp({theme:n,classNames:r,props:a,stylesCtx:t})[e]}function eO({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function tO({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function nO({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(a=>`${t}-${a}-${n}`)}function rO({themeName:e,theme:t,selector:n,props:r,stylesCtx:a}){return e.map(o=>{var c,u;return(u=sp({theme:t,classNames:(c=t.components[o])==null?void 0:c.classNames,props:r,stylesCtx:a}))==null?void 0:u[n]})}function aO({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function iO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:a,classNames:o,classes:c,unstyled:u,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:v,headless:b,transformedStyles:S}){return $t(ZN({theme:e,options:t,unstyled:u||b}),rO({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),aO({options:t,classes:c,selector:r,unstyled:u}),Kj({selector:r,stylesCtx:g,theme:e,classNames:o,props:m}),Kj({selector:r,stylesCtx:g,theme:e,classNames:S,props:m}),JN({selector:r,stylesCtx:g,options:t,props:m,theme:e}),eO({rootSelector:p,selector:r,className:f}),tO({selector:r,classes:c,unstyled:u||b}),v&&!b&&nO({themeName:n,classNamesPrefix:a,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function oO({theme:e,themeName:t,props:n,stylesCtx:r,selector:a}){return t.map(o=>{var c;return Rh({theme:e,styles:(c=e.components[o])==null?void 0:c.styles,props:n,stylesCtx:r})[a]}).reduce((o,c)=>({...o,...c}),{})}function py({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...py({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function sO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Fo(n[r])}}),t),{})}function lO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:a,selector:o,themeName:c,headless:u}){var f;return(f=sO([u?{}:t==null?void 0:t(n,r,a),...c.map(p=>{var m,g,v;return(v=(g=(m=n.components)==null?void 0:m[p])==null?void 0:g.vars)==null?void 0:v.call(g,n,r,a)}),e==null?void 0:e(n,r,a)]))==null?void 0:f[o]}function cO({theme:e,themeName:t,selector:n,options:r,props:a,stylesCtx:o,rootSelector:c,styles:u,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:v}){return{...!v&&oO({theme:e,themeName:t,props:a,stylesCtx:o,selector:n}),...!v&&Rh({theme:e,styles:u,props:a,stylesCtx:o})[n],...!v&&Rh({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||a,stylesCtx:o})[n],...lO({theme:e,props:a,stylesCtx:o,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?py({style:f,theme:e}):null,...py({style:r==null?void 0:r.style,theme:e})}}function uO({props:e,stylesCtx:t,themeName:n}){var c;const r=Sn(),a=(c=AN())==null?void 0:c();return{getTransformedStyles:u=>a?[...u.map(p=>a(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var m;return a((m=r.components[p])==null?void 0:m.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!a}}function Me({name:e,classes:t,props:n,stylesCtx:r,className:a,style:o,rootSelector:c="root",unstyled:u,classNames:f,styles:p,vars:m,varsResolver:g}){const v=Sn(),b=EN(),S=TN(),j=RN(),C=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:R,getTransformedStyles:D}=uO({props:n,stylesCtx:r,themeName:C});return(E,T)=>({className:iO({theme:v,options:T,themeName:C,selector:E,classNamesPrefix:b,classNames:f,classes:t,unstyled:u,className:a,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:S,headless:j,transformedStyles:D([T==null?void 0:T.styles,p])}),style:cO({theme:v,themeName:C,selector:E,options:T,props:n,stylesCtx:r,rootSelector:c,styles:p,style:o,vars:m,varsResolver:g,headless:j,withStylesTransform:R})})}function Qs(e,t){return typeof e=="boolean"?e:t.autoContrast}function Xj(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 dO({keepTransitions:e}={}){const t=y.useRef(Eh),n=y.useRef(-1),r=y.useContext(cx),a=lp(),o=y.useRef(a==null?void 0:a());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:Xj(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var v;(v=t.current)==null||v.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:Xj(o.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var g;(g=t.current)==null||g.call(t)},10)},f=nN("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=y.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return y.useEffect(()=>()=>{var g;(g=t.current)==null||g.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:u,toggleColorScheme:m}}function se(e,t,n){var c;const r=Sn(),a=(c=r.components[e])==null?void 0:c.defaultProps,o=typeof a=="function"?a(r):a;return{...t,...o,...Fo(n)}}function Cv(e){return sn(e).reduce((t,n)=>e[n]!==void 0?`${t}${F3(n)}:${e[n]};`:t,"").trim()}function fO({selector:e,styles:t,media:n,container:r}){const a=t?Cv(t):"",o=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Cv(u.styles)}}}`):[],c=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Cv(u.styles)}}}`):[];return`${a?`${e}{${a}}`:""}${o.join("")}${c.join("")}`.trim()}function Ws(e){const t=lp();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:fO(e)}})}function Wi(e){const{m:t,mx:n,my:r,mt:a,mb:o,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:v,pt:b,pb:S,pl:j,pr:C,pe:R,ps:D,bd:E,bg:T,c:A,opacity:_,ff:M,fz:L,fw:$,lts:V,ta:X,lh:Q,fs:J,tt:W,td:Y,w:P,miw:I,maw:z,h:F,mih:O,mah:U,bgsz:Z,bgp:ee,bgr:ye,bga:be,pos:ve,top:Ge,left:ke,bottom:et,right:Re,inset:ft,display:Ut,flex:Ot,hiddenFrom:xt,visibleFrom:Ht,lightHidden:Bt,darkHidden:Se,sx:Ne,...Ve}=e;return{styleProps:Fo({m:t,mx:n,my:r,mt:a,mb:o,ml:c,mr:u,me:f,ms:p,p:m,px:g,py:v,pt:b,pb:S,pl:j,pr:C,pe:R,ps:D,bd:E,bg:T,c:A,opacity:_,ff:M,fz:L,fw:$,lts:V,ta:X,lh:Q,fs:J,tt:W,td:Y,w:P,miw:I,maw:z,h:F,mih:O,mah:U,bgsz:Z,bgp:ee,bgr:ye,bga:be,pos:ve,top:Ge,left:ke,bottom:et,right:Re,inset:ft,display:Ut,flex:Ot,hiddenFrom:xt,visibleFrom:Ht,lightHidden:Bt,darkHidden:Se,sx:Ne}),rest:Ve}}const hO={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:"size",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 hx(e,t){const n=da({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 pO(e,t){const n=da({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:hx(e,t)}function mO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...a]=e.split(" ").filter(c=>c.trim()!=="");let o=`${le(n)}`;return r&&(o+=` ${r}`),a.length>0&&(o+=` ${hx(a.join(" "),t)}`),o.trim()}return e}const Zj={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 gO(e){return typeof e=="string"&&e in Zj?Zj[e]:e}const vO=["h1","h2","h3","h4","h5","h6"];function yO(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&vO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function xO(e){return e}const bO=["h1","h2","h3","h4","h5","h6"];function SO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&bO.includes(e)?`var(--mantine-${e}-line-height)`:e}function wO(e){return typeof e=="number"?le(e):e}function jO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Ev={color:hx,textColor:pO,fontSize:yO,spacing:jO,identity:xO,size:wO,lineHeight:SO,fontFamily:gO,border:mO};function Jj(e){return e.replace("(min-width: ","").replace("em)","")}function CO({media:e,...t}){const r=Object.keys(e).sort((a,o)=>Number(Jj(a))-Number(Jj(o))).map(a=>({query:a,styles:e[a]}));return{...t,media:r}}function EO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function TO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function RO(e){return typeof e=="object"&&e!==null?sn(e).filter(t=>t!=="base"):[]}function DO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function SR({styleProps:e,data:t,theme:n}){return CO(sn(e).reduce((r,a)=>{if(a==="hiddenFrom"||a==="visibleFrom"||a==="sx")return r;const o=t[a],c=Array.isArray(o.property)?o.property:[o.property],u=TO(e[a]);if(!EO(e[a]))return c.forEach(p=>{r.inlineStyles[p]=Ev[o.type](u,n)}),r;r.hasResponsiveStyles=!0;const f=RO(e[a]);return c.forEach(p=>{u&&(r.styles[p]=Ev[o.type](u,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:Ev[o.type](DO(e[a],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function ud(){return`__m__-${y.useId().replace(/:/g,"")}`}function wR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...wR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function jR(e){return e.startsWith("data-")?e:`data-${e}`}function AO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[jR(n)]=e[n]),t},{})}function CR(e){return e?typeof e=="string"?{[jR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...CR(n)}),{}):AO(e):null}function my(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...my(r,t)}),{}):typeof e=="function"?e(t):e??{}}function _O({theme:e,style:t,vars:n,styleProps:r}){const a=my(t,e),o=my(n,e);return{...a,...o,...r}}const ER=y.forwardRef(({component:e,style:t,__vars:n,className:r,variant:a,mod:o,size:c,hiddenFrom:u,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:v,...b},S)=>{var L;const j=Sn(),C=e||"div",{styleProps:R,rest:D}=Wi(b),E=DN(),T=(L=E==null?void 0:E())==null?void 0:L(R.sx),A=ud(),_=SR({styleProps:R,theme:j,data:hO}),M={ref:S,style:_O({theme:j,style:t,vars:n,styleProps:_.inlineStyles}),className:$t(r,T,{[A]:_.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${f}`]:f}),"data-variant":a,"data-size":aR(c)?void 0:c||void 0,size:v,...CR(o),...D};return s.jsxs(s.Fragment,{children:[_.hasResponsiveStyles&&s.jsx(Ws,{selector:`.${A}`,styles:_.styles,media:_.media}),typeof g=="function"?g(M):s.jsx(C,{...M})]})});ER.displayName="@mantine/core/Box";const ce=ER;function TR(e){return e}function kO(e){const t=e;return n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function me(e){const t=y.forwardRef(e);return t.extend=TR,t.withProps=n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function lr(e){const t=y.forwardRef(e);return t.withProps=n=>{const r=y.forwardRef((a,o)=>s.jsx(t,{...n,...a,ref:o}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=TR,t}const PO=y.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ys(){return y.useContext(PO)}var Tv={exports:{}},ar={};/**
|
|
61
|
+
* @license React
|
|
62
|
+
* react-dom.production.js
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Meta Platforms, Inc. and 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
|
+
*/var eC;function NO(){if(eC)return ar;eC=1;var e=ax();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ar.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ar.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return o(f,p,null,m)},ar.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},ar.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},ar.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},ar.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:v,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ar.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=u(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},ar.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=u(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ar.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=u(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},ar.requestFormReset=function(f){r.d.r(f)},ar.unstable_batchedUpdates=function(f,p){return f(p)},ar.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},ar.useFormStatus=function(){return c.H.useHostTransitionStatus()},ar.version="19.1.0",ar}var tC;function RR(){if(tC)return Tv.exports;tC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Tv.exports=NO(),Tv.exports}var px=RR();const Vu=rx(px);function cp(){return typeof window<"u"}function wc(e){return DR(e)?(e.nodeName||"").toLowerCase():"#document"}function Dr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function fi(e){var t;return(t=(DR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function DR(e){return cp()?e instanceof Node||e instanceof Dr(e).Node:!1}function vn(e){return cp()?e instanceof Element||e instanceof Dr(e).Element:!1}function Gr(e){return cp()?e instanceof HTMLElement||e instanceof Dr(e).HTMLElement:!1}function gy(e){return!cp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Dr(e).ShadowRoot}function dd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=fa(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function OO(e){return["table","td","th"].includes(wc(e))}function up(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function mx(e){const t=dp(),n=vn(e)?fa(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function MO(e){let t=Ui(e);for(;Gr(t)&&!$o(t);){if(mx(t))return t;if(up(t))return null;t=Ui(t)}return null}function dp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $o(e){return["html","body","#document"].includes(wc(e))}function fa(e){return Dr(e).getComputedStyle(e)}function fp(e){return vn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ui(e){if(wc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||gy(e)&&e.host||fi(e);return gy(t)?t.host:t}function AR(e){const t=Ui(e);return $o(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&dd(t)?t:AR(t)}function Li(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=AR(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),c=Dr(a);if(o){const u=vy(c);return t.concat(c,c.visualViewport||[],dd(a)?a:[],u&&n?Li(u):[])}return t.concat(a,Li(a,[],n))}function vy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nC(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 Zu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&gy(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function _R(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function kR(){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 IO(e){return $O()?!1:!rC()&&e.width===0&&e.height===0||rC()&&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 LO(){return/apple/i.test(navigator.vendor)}function rC(){const e=/android/i;return e.test(_R())||e.test(kR())}function zO(){return _R().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function $O(){return kR().includes("jsdom/")}function yy(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function UO(e){return"nativeEvent"in e}function BO(e){return e.matches("html,body")}function Ts(e){return(e==null?void 0:e.ownerDocument)||document}function Rv(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 Xl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const VO="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function FO(e){return Gr(e)&&e.matches(VO)}const Oa=Math.min,ir=Math.max,Dh=Math.round,nh=Math.floor,ni=e=>({x:e,y:e}),HO={left:"right",right:"left",bottom:"top",top:"bottom"},qO={start:"end",end:"start"};function xy(e,t,n){return ir(e,Oa(t,n))}function Bi(e,t){return typeof e=="function"?e(t):e}function Ma(e){return e.split("-")[0]}function jc(e){return e.split("-")[1]}function gx(e){return e==="x"?"y":"x"}function vx(e){return e==="y"?"height":"width"}function ri(e){return["top","bottom"].includes(Ma(e))?"y":"x"}function yx(e){return gx(ri(e))}function GO(e,t,n){n===void 0&&(n=!1);const r=jc(e),a=yx(e),o=vx(a);let c=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(c=Ah(c)),[c,Ah(c)]}function QO(e){const t=Ah(e);return[by(e),t,by(t)]}function by(e){return e.replace(/start|end/g,t=>qO[t])}function WO(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:c;default:return[]}}function YO(e,t,n,r){const a=jc(e);let o=WO(Ma(e),n==="start",r);return a&&(o=o.map(c=>c+"-"+a),t&&(o=o.concat(o.map(by)))),o}function Ah(e){return e.replace(/left|right|bottom|top/g,t=>HO[t])}function KO(e){return{top:0,right:0,bottom:0,left:0,...e}}function xx(e){return typeof e!="number"?KO(e):{top:e,right:e,bottom:e,left:e}}function cc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function aC(e,t,n){let{reference:r,floating:a}=e;const o=ri(t),c=yx(t),u=vx(c),f=Ma(t),p=o==="y",m=r.x+r.width/2-a.width/2,g=r.y+r.height/2-a.height/2,v=r[u]/2-a[u]/2;let b;switch(f){case"top":b={x:m,y:r.y-a.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-a.width,y:g};break;default:b={x:r.x,y:r.y}}switch(jc(t)){case"start":b[c]-=v*(n&&p?-1:1);break;case"end":b[c]+=v*(n&&p?-1:1);break}return b}const XO=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:c}=n,u=o.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:a}),{x:m,y:g}=aC(p,r,f),v=r,b={},S=0;for(let j=0;j<u.length;j++){const{name:C,fn:R}=u[j],{x:D,y:E,data:T,reset:A}=await R({x:m,y:g,initialPlacement:r,placement:v,strategy:a,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=D??m,g=E??g,b={...b,[C]:{...b[C],...T}},A&&S<=50&&(S++,typeof A=="object"&&(A.placement&&(v=A.placement),A.rects&&(p=A.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:a}):A.rects),{x:m,y:g}=aC(p,v,f)),j=-1)}return{x:m,y:g,placement:v,strategy:a,middlewareData:b}};async function bx(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:c,elements:u,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:v=!1,padding:b=0}=Bi(t,e),S=xx(b),C=u[v?g==="floating"?"reference":"floating":g],R=cc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(C)))==null||n?C:C.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:p,rootBoundary:m,strategy:f})),D=g==="floating"?{x:r,y:a,width:c.floating.width,height:c.floating.height}:c.reference,E=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),T=await(o.isElement==null?void 0:o.isElement(E))?await(o.getScale==null?void 0:o.getScale(E))||{x:1,y:1}:{x:1,y:1},A=cc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:D,offsetParent:E,strategy:f}):D);return{top:(R.top-A.top+S.top)/T.y,bottom:(A.bottom-R.bottom+S.bottom)/T.y,left:(R.left-A.left+S.left)/T.x,right:(A.right-R.right+S.right)/T.x}}const ZO=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:c,elements:u,middlewareData:f}=t,{element:p,padding:m=0}=Bi(e,t)||{};if(p==null)return{};const g=xx(m),v={x:n,y:r},b=yx(a),S=vx(b),j=await c.getDimensions(p),C=b==="y",R=C?"top":"left",D=C?"bottom":"right",E=C?"clientHeight":"clientWidth",T=o.reference[S]+o.reference[b]-v[b]-o.floating[S],A=v[b]-o.reference[b],_=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let M=_?_[E]:0;(!M||!await(c.isElement==null?void 0:c.isElement(_)))&&(M=u.floating[E]||o.floating[S]);const L=T/2-A/2,$=M/2-j[S]/2-1,V=Oa(g[R],$),X=Oa(g[D],$),Q=V,J=M-j[S]-X,W=M/2-j[S]/2+L,Y=xy(Q,W,J),P=!f.arrow&&jc(a)!=null&&W!==Y&&o.reference[S]/2-(W<Q?V:X)-j[S]/2<0,I=P?W<Q?W-Q:W-J:0;return{[b]:v[b]+I,data:{[b]:Y,centerOffset:W-Y-I,...P&&{alignmentOffset:I}},reset:P}}}),JO=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:c,initialPlacement:u,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:j=!0,...C}=Bi(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const R=Ma(a),D=ri(u),E=Ma(u)===u,T=await(f.isRTL==null?void 0:f.isRTL(p.floating)),A=v||(E||!j?[Ah(u)]:QO(u)),_=S!=="none";!v&&_&&A.push(...YO(u,j,S,T));const M=[u,...A],L=await bx(t,C),$=[];let V=((r=o.flip)==null?void 0:r.overflows)||[];if(m&&$.push(L[R]),g){const Y=GO(a,c,T);$.push(L[Y[0]],L[Y[1]])}if(V=[...V,{placement:a,overflows:$}],!$.every(Y=>Y<=0)){var X,Q;const Y=(((X=o.flip)==null?void 0:X.index)||0)+1,P=M[Y];if(P){var J;const z=g==="alignment"?D!==ri(P):!1,F=((J=V[0])==null?void 0:J.overflows[0])>0;if(!z||F)return{data:{index:Y,overflows:V},reset:{placement:P}}}let I=(Q=V.filter(z=>z.overflows[0]<=0).sort((z,F)=>z.overflows[1]-F.overflows[1])[0])==null?void 0:Q.placement;if(!I)switch(b){case"bestFit":{var W;const z=(W=V.filter(F=>{if(_){const O=ri(F.placement);return O===D||O==="y"}return!0}).map(F=>[F.placement,F.overflows.filter(O=>O>0).reduce((O,U)=>O+U,0)]).sort((F,O)=>F[1]-O[1])[0])==null?void 0:W[0];z&&(I=z);break}case"initialPlacement":I=u;break}if(a!==I)return{reset:{placement:I}}}return{}}}};function PR(e){const t=Oa(...e.map(o=>o.left)),n=Oa(...e.map(o=>o.top)),r=ir(...e.map(o=>o.right)),a=ir(...e.map(o=>o.bottom));return{x:t,y:n,width:r-t,height:a-n}}function eM(e){const t=e.slice().sort((a,o)=>a.y-o.y),n=[];let r=null;for(let a=0;a<t.length;a++){const o=t[a];!r||o.y-r.y>r.height/2?n.push([o]):n[n.length-1].push(o),r=o}return n.map(a=>cc(PR(a)))}const tM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:a,platform:o,strategy:c}=t,{padding:u=2,x:f,y:p}=Bi(e,t),m=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(r.reference))||[]),g=eM(m),v=cc(PR(m)),b=xx(u);function S(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||v;if(g.length>=2){if(ri(n)==="y"){const V=g[0],X=g[g.length-1],Q=Ma(n)==="top",J=V.top,W=X.bottom,Y=Q?V.left:X.left,P=Q?V.right:X.right,I=P-Y,z=W-J;return{top:J,bottom:W,left:Y,right:P,width:I,height:z,x:Y,y:J}}const C=Ma(n)==="left",R=ir(...g.map(V=>V.right)),D=Oa(...g.map(V=>V.left)),E=g.filter(V=>C?V.left===D:V.right===R),T=E[0].top,A=E[E.length-1].bottom,_=D,M=R,L=M-_,$=A-T;return{top:T,bottom:A,left:_,right:M,width:L,height:$,x:_,y:T}}return v}const j=await o.getElementRects({reference:{getBoundingClientRect:S},floating:r.floating,strategy:c});return a.reference.x!==j.reference.x||a.reference.y!==j.reference.y||a.reference.width!==j.reference.width||a.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}};async function nM(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),c=Ma(n),u=jc(n),f=ri(n)==="y",p=["left","top"].includes(c)?-1:1,m=o&&f?-1:1,g=Bi(t,e);let{mainAxis:v,crossAxis:b,alignmentAxis:S}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return u&&typeof S=="number"&&(b=u==="end"?S*-1:S),f?{x:b*m,y:v*p}:{x:v*p,y:b*m}}const rM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:c,middlewareData:u}=t,f=await nM(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+f.x,y:o+f.y,data:{...f,placement:c}}}}},aM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:c=!1,limiter:u={fn:C=>{let{x:R,y:D}=C;return{x:R,y:D}}},...f}=Bi(e,t),p={x:n,y:r},m=await bx(t,f),g=ri(Ma(a)),v=gx(g);let b=p[v],S=p[g];if(o){const C=v==="y"?"top":"left",R=v==="y"?"bottom":"right",D=b+m[C],E=b-m[R];b=xy(D,b,E)}if(c){const C=g==="y"?"top":"left",R=g==="y"?"bottom":"right",D=S+m[C],E=S-m[R];S=xy(D,S,E)}const j=u.fn({...t,[v]:b,[g]:S});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[v]:o,[g]:c}}}}}},iM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:c}=t,{offset:u=0,mainAxis:f=!0,crossAxis:p=!0}=Bi(e,t),m={x:n,y:r},g=ri(a),v=gx(g);let b=m[v],S=m[g];const j=Bi(u,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const E=v==="y"?"height":"width",T=o.reference[v]-o.floating[E]+C.mainAxis,A=o.reference[v]+o.reference[E]-C.mainAxis;b<T?b=T:b>A&&(b=A)}if(p){var R,D;const E=v==="y"?"width":"height",T=["top","left"].includes(Ma(a)),A=o.reference[g]-o.floating[E]+(T&&((R=c.offset)==null?void 0:R[g])||0)+(T?0:C.crossAxis),_=o.reference[g]+o.reference[E]+(T?0:((D=c.offset)==null?void 0:D[g])||0)-(T?C.crossAxis:0);S<A?S=A:S>_&&(S=_)}return{[v]:b,[g]:S}}}},oM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:c,elements:u}=t,{apply:f=()=>{},...p}=Bi(e,t),m=await bx(t,p),g=Ma(a),v=jc(a),b=ri(a)==="y",{width:S,height:j}=o.floating;let C,R;g==="top"||g==="bottom"?(C=g,R=v===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(R=g,C=v==="end"?"top":"bottom");const D=j-m.top-m.bottom,E=S-m.left-m.right,T=Oa(j-m[C],D),A=Oa(S-m[R],E),_=!t.middlewareData.shift;let M=T,L=A;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(L=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=D),_&&!v){const V=ir(m.left,0),X=ir(m.right,0),Q=ir(m.top,0),J=ir(m.bottom,0);b?L=S-2*(V!==0||X!==0?V+X:ir(m.left,m.right)):M=j-2*(Q!==0||J!==0?Q+J:ir(m.top,m.bottom))}await f({...t,availableWidth:L,availableHeight:M});const $=await c.getDimensions(u.floating);return S!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function NR(e){const t=fa(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Gr(e),o=a?e.offsetWidth:n,c=a?e.offsetHeight:r,u=Dh(n)!==o||Dh(r)!==c;return u&&(n=o,r=c),{width:n,height:r,$:u}}function Sx(e){return vn(e)?e:e.contextElement}function rc(e){const t=Sx(e);if(!Gr(t))return ni(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=NR(t);let c=(o?Dh(n.width):n.width)/r,u=(o?Dh(n.height):n.height)/a;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const sM=ni(0);function OR(e){const t=Dr(e);return!dp()||!t.visualViewport?sM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function lM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Dr(e)?!1:t}function Os(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Sx(e);let c=ni(1);t&&(r?vn(r)&&(c=rc(r)):c=rc(e));const u=lM(o,n,r)?OR(o):ni(0);let f=(a.left+u.x)/c.x,p=(a.top+u.y)/c.y,m=a.width/c.x,g=a.height/c.y;if(o){const v=Dr(o),b=r&&vn(r)?Dr(r):r;let S=v,j=vy(S);for(;j&&r&&b!==S;){const C=rc(j),R=j.getBoundingClientRect(),D=fa(j),E=R.left+(j.clientLeft+parseFloat(D.paddingLeft))*C.x,T=R.top+(j.clientTop+parseFloat(D.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=E,p+=T,S=Dr(j),j=vy(S)}}return cc({width:m,height:g,x:f,y:p})}function wx(e,t){const n=fp(e).scrollLeft;return t?t.left+n:Os(fi(e)).left+n}function MR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),a=r.left+t.scrollLeft-(n?0:wx(e,r)),o=r.top+t.scrollTop;return{x:a,y:o}}function cM(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",c=fi(r),u=t?up(t.floating):!1;if(r===c||u&&o)return n;let f={scrollLeft:0,scrollTop:0},p=ni(1);const m=ni(0),g=Gr(r);if((g||!g&&!o)&&((wc(r)!=="body"||dd(c))&&(f=fp(r)),Gr(r))){const b=Os(r);p=rc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const v=c&&!g&&!o?MR(c,f,!0):ni(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+v.x,y:n.y*p.y-f.scrollTop*p.y+m.y+v.y}}function uM(e){return Array.from(e.getClientRects())}function dM(e){const t=fi(e),n=fp(e),r=e.ownerDocument.body,a=ir(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ir(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+wx(e);const u=-n.scrollTop;return fa(r).direction==="rtl"&&(c+=ir(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:c,y:u}}function fM(e,t){const n=Dr(e),r=fi(e),a=n.visualViewport;let o=r.clientWidth,c=r.clientHeight,u=0,f=0;if(a){o=a.width,c=a.height;const p=dp();(!p||p&&t==="fixed")&&(u=a.offsetLeft,f=a.offsetTop)}return{width:o,height:c,x:u,y:f}}function hM(e,t){const n=Os(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Gr(e)?rc(e):ni(1),c=e.clientWidth*o.x,u=e.clientHeight*o.y,f=a*o.x,p=r*o.y;return{width:c,height:u,x:f,y:p}}function iC(e,t,n){let r;if(t==="viewport")r=fM(e,n);else if(t==="document")r=dM(fi(e));else if(vn(t))r=hM(t,n);else{const a=OR(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return cc(r)}function IR(e,t){const n=Ui(e);return n===t||!vn(n)||$o(n)?!1:fa(n).position==="fixed"||IR(n,t)}function pM(e,t){const n=t.get(e);if(n)return n;let r=Li(e,[],!1).filter(u=>vn(u)&&wc(u)!=="body"),a=null;const o=fa(e).position==="fixed";let c=o?Ui(e):e;for(;vn(c)&&!$o(c);){const u=fa(c),f=mx(c);!f&&u.position==="fixed"&&(a=null),(o?!f&&!a:!f&&u.position==="static"&&!!a&&["absolute","fixed"].includes(a.position)||dd(c)&&!f&&IR(e,c))?r=r.filter(m=>m!==c):a=u,c=Ui(c)}return t.set(e,r),r}function mM(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const c=[...n==="clippingAncestors"?up(t)?[]:pM(t,this._c):[].concat(n),r],u=c[0],f=c.reduce((p,m)=>{const g=iC(t,m,a);return p.top=ir(g.top,p.top),p.right=Oa(g.right,p.right),p.bottom=Oa(g.bottom,p.bottom),p.left=ir(g.left,p.left),p},iC(t,u,a));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function gM(e){const{width:t,height:n}=NR(e);return{width:t,height:n}}function vM(e,t,n){const r=Gr(t),a=fi(t),o=n==="fixed",c=Os(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const f=ni(0);function p(){f.x=wx(a)}if(r||!r&&!o)if((wc(t)!=="body"||dd(a))&&(u=fp(t)),r){const b=Os(t,!0,o,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else a&&p();o&&!r&&a&&p();const m=a&&!r&&!o?MR(a,u):ni(0),g=c.left+u.scrollLeft-f.x-m.x,v=c.top+u.scrollTop-f.y-m.y;return{x:g,y:v,width:c.width,height:c.height}}function Dv(e){return fa(e).position==="static"}function oC(e,t){if(!Gr(e)||fa(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return fi(e)===n&&(n=n.ownerDocument.body),n}function LR(e,t){const n=Dr(e);if(up(e))return n;if(!Gr(e)){let a=Ui(e);for(;a&&!$o(a);){if(vn(a)&&!Dv(a))return a;a=Ui(a)}return n}let r=oC(e,t);for(;r&&OO(r)&&Dv(r);)r=oC(r,t);return r&&$o(r)&&Dv(r)&&!mx(r)?n:r||MO(e)||n}const yM=async function(e){const t=this.getOffsetParent||LR,n=this.getDimensions,r=await n(e.floating);return{reference:vM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function xM(e){return fa(e).direction==="rtl"}const bM={convertOffsetParentRelativeRectToViewportRelativeRect:cM,getDocumentElement:fi,getClippingRect:mM,getOffsetParent:LR,getElementRects:yM,getClientRects:uM,getDimensions:gM,getScale:rc,isElement:vn,isRTL:xM};function zR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function SM(e,t){let n=null,r;const a=fi(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const p=e.getBoundingClientRect(),{left:m,top:g,width:v,height:b}=p;if(u||t(),!v||!b)return;const S=nh(g),j=nh(a.clientWidth-(m+v)),C=nh(a.clientHeight-(g+b)),R=nh(m),E={rootMargin:-S+"px "+-j+"px "+-C+"px "+-R+"px",threshold:ir(0,Oa(1,f))||1};let T=!0;function A(_){const M=_[0].intersectionRatio;if(M!==f){if(!T)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!zR(p,e.getBoundingClientRect())&&c(),T=!1}try{n=new IntersectionObserver(A,{...E,root:a.ownerDocument})}catch{n=new IntersectionObserver(A,E)}n.observe(e)}return c(!0),o}function wM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Sx(e),m=a||o?[...p?Li(p):[],...Li(t)]:[];m.forEach(R=>{a&&R.addEventListener("scroll",n,{passive:!0}),o&&R.addEventListener("resize",n)});const g=p&&u?SM(p,n):null;let v=-1,b=null;c&&(b=new ResizeObserver(R=>{let[D]=R;D&&D.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=b)==null||E.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let S,j=f?Os(e):null;f&&C();function C(){const R=Os(e);j&&!zR(j,R)&&n(),j=R,S=requestAnimationFrame(C)}return n(),()=>{var R;m.forEach(D=>{a&&D.removeEventListener("scroll",n),o&&D.removeEventListener("resize",n)}),g==null||g(),(R=b)==null||R.disconnect(),b=null,f&&cancelAnimationFrame(S)}}const jM=rM,CM=aM,EM=JO,TM=oM,sC=ZO,RM=tM,DM=iM,AM=(e,t,n)=>{const r=new Map,a={platform:bM,...n},o={...a.platform,_c:r};return XO(e,t,{...a,platform:o})};var mh=typeof document<"u"?y.useLayoutEffect:y.useEffect;function _h(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,a;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(!_h(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!_h(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function $R(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lC(e,t){const n=$R(e);return Math.round(t*n)/n}function Av(e){const t=y.useRef(e);return mh(()=>{t.current=e}),t}function _M(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:c}={},transform:u=!0,whileElementsMounted:f,open:p}=e,[m,g]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,b]=y.useState(r);_h(v,r)||b(r);const[S,j]=y.useState(null),[C,R]=y.useState(null),D=y.useCallback(z=>{z!==_.current&&(_.current=z,j(z))},[]),E=y.useCallback(z=>{z!==M.current&&(M.current=z,R(z))},[]),T=o||S,A=c||C,_=y.useRef(null),M=y.useRef(null),L=y.useRef(m),$=f!=null,V=Av(f),X=Av(a),Q=Av(p),J=y.useCallback(()=>{if(!_.current||!M.current)return;const z={placement:t,strategy:n,middleware:v};X.current&&(z.platform=X.current),AM(_.current,M.current,z).then(F=>{const O={...F,isPositioned:Q.current!==!1};W.current&&!_h(L.current,O)&&(L.current=O,px.flushSync(()=>{g(O)}))})},[v,t,n,X,Q]);mh(()=>{p===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const W=y.useRef(!1);mh(()=>(W.current=!0,()=>{W.current=!1}),[]),mh(()=>{if(T&&(_.current=T),A&&(M.current=A),T&&A){if(V.current)return V.current(T,A,J);J()}},[T,A,J,V,$]);const Y=y.useMemo(()=>({reference:_,floating:M,setReference:D,setFloating:E}),[D,E]),P=y.useMemo(()=>({reference:T,floating:A}),[T,A]),I=y.useMemo(()=>{const z={position:n,left:0,top:0};if(!P.floating)return z;const F=lC(P.floating,m.x),O=lC(P.floating,m.y);return u?{...z,transform:"translate("+F+"px, "+O+"px)",...$R(P.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:O}},[n,u,P.floating,m.x,m.y]);return y.useMemo(()=>({...m,update:J,refs:Y,elements:P,floatingStyles:I}),[m,J,Y,P,I])}const kM=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?sC({element:r.current,padding:a}).fn(n):{}:r?sC({element:r,padding:a}).fn(n):{}}}},UR=(e,t)=>({...jM(e),options:[e,t]}),jx=(e,t)=>({...CM(e),options:[e,t]}),cC=(e,t)=>({...DM(e),options:[e,t]}),kh=(e,t)=>({...EM(e),options:[e,t]}),PM=(e,t)=>({...TM(e),options:[e,t]}),Gu=(e,t)=>({...RM(e),options:[e,t]}),BR=(e,t)=>({...kM(e),options:[e,t]});function NM(e){return y.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const VR={...s3},OM=VR.useInsertionEffect,MM=OM||(e=>e());function Ii(e){const t=y.useRef(()=>{});return MM(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return t.current==null?void 0:t.current(...r)},[])}var ai=typeof document<"u"?y.useLayoutEffect:y.useEffect;let uC=!1,IM=0;const dC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+IM++;function LM(){const[e,t]=y.useState(()=>uC?dC():void 0);return ai(()=>{e==null&&t(dC())},[]),y.useEffect(()=>{uC=!0},[]),e}const zM=VR.useId,FR=zM||LM;function $M(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(a=>a(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(a=>a!==n))||[])}}}const UM=y.createContext(null),BM=y.createContext(null),Cx=()=>{var e;return((e=y.useContext(UM))==null?void 0:e.id)||null},Ex=()=>y.useContext(BM);function Tx(e){return"data-floating-ui-"+e}function _v(e){const t=y.useRef(e);return ai(()=>{t.current=e}),t}const fC=Tx("safe-polygon");function gh(e,t,n){return n&&!yy(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function VM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:a,events:o,elements:c}=e,{enabled:u=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:v=!0}=t,b=Ex(),S=Cx(),j=_v(p),C=_v(f),R=_v(n),D=y.useRef(),E=y.useRef(-1),T=y.useRef(),A=y.useRef(-1),_=y.useRef(!0),M=y.useRef(!1),L=y.useRef(()=>{}),$=y.useRef(!1),V=y.useCallback(()=>{var I;const z=(I=a.current.openEvent)==null?void 0:I.type;return(z==null?void 0:z.includes("mouse"))&&z!=="mousedown"},[a]);y.useEffect(()=>{if(!u)return;function I(z){let{open:F}=z;F||(clearTimeout(E.current),clearTimeout(A.current),_.current=!0,$.current=!1)}return o.on("openchange",I),()=>{o.off("openchange",I)}},[u,o]),y.useEffect(()=>{if(!u||!j.current||!n)return;function I(F){V()&&r(!1,F,"hover")}const z=Ts(c.floating).documentElement;return z.addEventListener("mouseleave",I),()=>{z.removeEventListener("mouseleave",I)}},[c.floating,n,r,u,j,V]);const X=y.useCallback(function(I,z,F){z===void 0&&(z=!0),F===void 0&&(F="hover");const O=gh(C.current,"close",D.current);O&&!T.current?(clearTimeout(E.current),E.current=window.setTimeout(()=>r(!1,I,F),O)):z&&(clearTimeout(E.current),r(!1,I,F))},[C,r]),Q=Ii(()=>{L.current(),T.current=void 0}),J=Ii(()=>{if(M.current){const I=Ts(c.floating).body;I.style.pointerEvents="",I.removeAttribute(fC),M.current=!1}}),W=Ii(()=>a.current.openEvent?["click","mousedown"].includes(a.current.openEvent.type):!1);y.useEffect(()=>{if(!u)return;function I(U){if(clearTimeout(E.current),_.current=!1,m&&!yy(D.current)||g>0&&!gh(C.current,"open"))return;const Z=gh(C.current,"open",D.current);Z?E.current=window.setTimeout(()=>{R.current||r(!0,U,"hover")},Z):n||r(!0,U,"hover")}function z(U){if(W())return;L.current();const Z=Ts(c.floating);if(clearTimeout(A.current),$.current=!1,j.current&&a.current.floatingContext){n||clearTimeout(E.current),T.current=j.current({...a.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),Q(),W()||X(U,!0,"safe-polygon")}});const ye=T.current;Z.addEventListener("mousemove",ye),L.current=()=>{Z.removeEventListener("mousemove",ye)};return}(D.current==="touch"?!Zu(c.floating,U.relatedTarget):!0)&&X(U)}function F(U){W()||a.current.floatingContext&&(j.current==null||j.current({...a.current.floatingContext,tree:b,x:U.clientX,y:U.clientY,onClose(){J(),Q(),W()||X(U)}})(U))}if(vn(c.domReference)){var O;const U=c.domReference;return n&&U.addEventListener("mouseleave",F),(O=c.floating)==null||O.addEventListener("mouseleave",F),v&&U.addEventListener("mousemove",I,{once:!0}),U.addEventListener("mouseenter",I),U.addEventListener("mouseleave",z),()=>{var Z;n&&U.removeEventListener("mouseleave",F),(Z=c.floating)==null||Z.removeEventListener("mouseleave",F),v&&U.removeEventListener("mousemove",I),U.removeEventListener("mouseenter",I),U.removeEventListener("mouseleave",z)}}},[c,u,e,m,g,v,X,Q,J,r,n,R,b,C,j,a,W]),ai(()=>{var I;if(u&&n&&(I=j.current)!=null&&I.__options.blockPointerEvents&&V()){M.current=!0;const F=c.floating;if(vn(c.domReference)&&F){var z;const O=Ts(c.floating).body;O.setAttribute(fC,"");const U=c.domReference,Z=b==null||(z=b.nodesRef.current.find(ee=>ee.id===S))==null||(z=z.context)==null?void 0:z.elements.floating;return Z&&(Z.style.pointerEvents=""),O.style.pointerEvents="none",U.style.pointerEvents="auto",F.style.pointerEvents="auto",()=>{O.style.pointerEvents="",U.style.pointerEvents="",F.style.pointerEvents=""}}}},[u,n,S,c,b,j,V]),ai(()=>{n||(D.current=void 0,$.current=!1,Q(),J())},[n,Q,J]),y.useEffect(()=>()=>{Q(),clearTimeout(E.current),clearTimeout(A.current),J()},[u,c.domReference,Q,J]);const Y=y.useMemo(()=>{function I(z){D.current=z.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(z){const{nativeEvent:F}=z;function O(){!_.current&&!R.current&&r(!0,F,"hover")}m&&!yy(D.current)||n||g===0||$.current&&z.movementX**2+z.movementY**2<2||(clearTimeout(A.current),D.current==="touch"?O():($.current=!0,A.current=window.setTimeout(O,g)))}}},[m,r,n,R,g]),P=y.useMemo(()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(I){W()||X(I.nativeEvent,!1)}}),[X,W]);return y.useMemo(()=>u?{reference:Y,floating:P}:{},[u,Y,P])}const Sy=()=>{},HR=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Sy,setState:Sy,isInstantPhase:!1}),FM=()=>y.useContext(HR);function HM(e){const{children:t,delay:n,timeoutMs:r=0}=e,[a,o]=y.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=y.useRef(null),u=y.useCallback(f=>{o({currentId:f})},[]);return ai(()=>{a.currentId?c.current===null?c.current=a.currentId:a.isInstantPhase||o({isInstantPhase:!0}):(a.isInstantPhase&&o({isInstantPhase:!1}),c.current=null)},[a.currentId,a.isInstantPhase]),y.createElement(HR.Provider,{value:y.useMemo(()=>({...a,setState:o,setCurrentId:u}),[a,u])},t)}function qM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:a}=e,{id:o,enabled:c=!0}=t,u=o??a,f=FM(),{currentId:p,setCurrentId:m,initialDelay:g,setState:v,timeoutMs:b}=f;return ai(()=>{c&&p&&(v({delay:{open:1,close:gh(g,"close")}}),p!==u&&r(!1))},[c,u,r,v,p,g]),ai(()=>{function S(){r(!1),v({delay:g,currentId:null})}if(c&&p&&!n&&p===u){if(b){const j=window.setTimeout(S,b);return()=>{clearTimeout(j)}}S()}},[c,n,v,p,u,r,g,b]),ai(()=>{c&&(m===Sy||!n||m(u))},[c,n,m,u]),f}function kv(e,t){let n=e.filter(a=>{var o;return a.parentId===t&&((o=a.context)==null?void 0:o.open)}),r=n;for(;r.length;)r=e.filter(a=>{var o;return(o=r)==null?void 0:o.some(c=>{var u;return a.parentId===c.id&&((u=a.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const GM="data-floating-ui-focusable",QM={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},WM={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},hC=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 YM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:a,dataRef:o}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:b,capture:S}=t,j=Ex(),C=Ii(typeof f=="function"?f:()=>!1),R=typeof f=="function"?C:f,D=y.useRef(!1),E=y.useRef(!1),{escapeKey:T,outsidePress:A}=hC(b),{escapeKey:_,outsidePress:M}=hC(S),L=y.useRef(!1),$=Ii(Y=>{var P;if(!n||!c||!u||Y.key!=="Escape"||L.current)return;const I=(P=o.current.floatingContext)==null?void 0:P.nodeId,z=j?kv(j.nodesRef.current,I):[];if(!T&&(Y.stopPropagation(),z.length>0)){let F=!0;if(z.forEach(O=>{var U;if((U=O.context)!=null&&U.open&&!O.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}r(!1,UO(Y)?Y.nativeEvent:Y,"escape-key")}),V=Ii(Y=>{var P;const I=()=>{var z;$(Y),(z=Xl(Y))==null||z.removeEventListener("keydown",I)};(P=Xl(Y))==null||P.addEventListener("keydown",I)}),X=Ii(Y=>{var P;const I=D.current;D.current=!1;const z=E.current;if(E.current=!1,p==="click"&&z||I||typeof R=="function"&&!R(Y))return;const F=Xl(Y),O="["+Tx("inert")+"]",U=Ts(a.floating).querySelectorAll(O);let Z=vn(F)?F:null;for(;Z&&!$o(Z);){const ve=Ui(Z);if($o(ve)||!vn(ve))break;Z=ve}if(U.length&&vn(F)&&!BO(F)&&!Zu(F,a.floating)&&Array.from(U).every(ve=>!Zu(Z,ve)))return;if(Gr(F)&&W){const ve=F.clientWidth>0&&F.scrollWidth>F.clientWidth,Ge=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let ke=Ge&&Y.offsetX>F.clientWidth;if(Ge&&fa(F).direction==="rtl"&&(ke=Y.offsetX<=F.offsetWidth-F.clientWidth),ke||ve&&Y.offsetY>F.clientHeight)return}const ee=(P=o.current.floatingContext)==null?void 0:P.nodeId,ye=j&&kv(j.nodesRef.current,ee).some(ve=>{var Ge;return Rv(Y,(Ge=ve.context)==null?void 0:Ge.elements.floating)});if(Rv(Y,a.floating)||Rv(Y,a.domReference)||ye)return;const be=j?kv(j.nodesRef.current,ee):[];if(be.length>0){let ve=!0;if(be.forEach(Ge=>{var ke;if((ke=Ge.context)!=null&&ke.open&&!Ge.context.dataRef.current.__outsidePressBubbles){ve=!1;return}}),!ve)return}r(!1,Y,"outside-press")}),Q=Ii(Y=>{var P;const I=()=>{var z;X(Y),(z=Xl(Y))==null||z.removeEventListener(p,I)};(P=Xl(Y))==null||P.addEventListener(p,I)});y.useEffect(()=>{if(!n||!c)return;o.current.__escapeKeyBubbles=T,o.current.__outsidePressBubbles=A;let Y=-1;function P(U){r(!1,U,"ancestor-scroll")}function I(){window.clearTimeout(Y),L.current=!0}function z(){Y=window.setTimeout(()=>{L.current=!1},dp()?5:0)}const F=Ts(a.floating);u&&(F.addEventListener("keydown",_?V:$,_),F.addEventListener("compositionstart",I),F.addEventListener("compositionend",z)),R&&F.addEventListener(p,M?Q:X,M);let O=[];return v&&(vn(a.domReference)&&(O=Li(a.domReference)),vn(a.floating)&&(O=O.concat(Li(a.floating))),!vn(a.reference)&&a.reference&&a.reference.contextElement&&(O=O.concat(Li(a.reference.contextElement)))),O=O.filter(U=>{var Z;return U!==((Z=F.defaultView)==null?void 0:Z.visualViewport)}),O.forEach(U=>{U.addEventListener("scroll",P,{passive:!0})}),()=>{u&&(F.removeEventListener("keydown",_?V:$,_),F.removeEventListener("compositionstart",I),F.removeEventListener("compositionend",z)),R&&F.removeEventListener(p,M?Q:X,M),O.forEach(U=>{U.removeEventListener("scroll",P)}),window.clearTimeout(Y)}},[o,a,u,R,p,n,r,v,c,T,A,$,_,V,X,M,Q]),y.useEffect(()=>{D.current=!1},[R,p]);const J=y.useMemo(()=>({onKeyDown:$,[QM[g]]:Y=>{m&&r(!1,Y.nativeEvent,"reference-press")}}),[$,r,m,g]),W=y.useMemo(()=>({onKeyDown:$,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[WM[p]]:()=>{D.current=!0}}),[$,p]);return y.useMemo(()=>c?{reference:J,floating:W}:{},[c,J,W])}function KM(e){const{open:t=!1,onOpenChange:n,elements:r}=e,a=FR(),o=y.useRef({}),[c]=y.useState(()=>$M()),u=Cx()!=null,[f,p]=y.useState(r.reference),m=Ii((b,S,j)=>{o.current.openEvent=b?S:void 0,c.emit("openchange",{open:b,event:S,reason:j,nested:u}),n==null||n(b,S,j)}),g=y.useMemo(()=>({setPositionReference:p}),[]),v=y.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return y.useMemo(()=>({dataRef:o,open:t,onOpenChange:m,elements:v,events:c,floatingId:a,refs:g}),[t,m,v,c,a,g])}function Rx(e){e===void 0&&(e={});const{nodeId:t}=e,n=KM({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,a=r.elements,[o,c]=y.useState(null),[u,f]=y.useState(null),m=(a==null?void 0:a.domReference)||o,g=y.useRef(null),v=Ex();ai(()=>{m&&(g.current=m)},[m]);const b=_M({...e,elements:{...a,...u&&{reference:u}}}),S=y.useCallback(E=>{const T=vn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;f(T),b.refs.setReference(T)},[b.refs]),j=y.useCallback(E=>{(vn(E)||E===null)&&(g.current=E,c(E)),(vn(b.refs.reference.current)||b.refs.reference.current===null||E!==null&&!vn(E))&&b.refs.setReference(E)},[b.refs]),C=y.useMemo(()=>({...b.refs,setReference:j,setPositionReference:S,domReference:g}),[b.refs,j,S]),R=y.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),D=y.useMemo(()=>({...b,...r,refs:C,elements:R,nodeId:t}),[b,C,R,t,r]);return ai(()=>{r.dataRef.current.floatingContext=D;const E=v==null?void 0:v.nodesRef.current.find(T=>T.id===t);E&&(E.context=D)}),y.useMemo(()=>({...b,context:D,refs:C,elements:R}),[b,C,R,D])}function XM(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:a,dataRef:o,elements:c}=e,{enabled:u=!0,visibleOnly:f=!0}=t,p=y.useRef(!1),m=y.useRef(),g=y.useRef(!0);y.useEffect(()=>{if(!u)return;const b=Dr(c.domReference);function S(){!n&&Gr(c.domReference)&&c.domReference===nC(Ts(c.domReference))&&(p.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",S),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",S),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,u]),y.useEffect(()=>{if(!u)return;function b(S){let{reason:j}=S;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return a.on("openchange",b),()=>{a.off("openchange",b)}},[a,u]),y.useEffect(()=>()=>{clearTimeout(m.current)},[]);const v=y.useMemo(()=>({onPointerDown(b){IO(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const S=Xl(b.nativeEvent);if(f&&vn(S))try{if(LO()&&zO())throw Error();if(!S.matches(":focus-visible"))return}catch{if(!g.current&&!FO(S))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const S=b.relatedTarget,j=b.nativeEvent,C=vn(S)&&S.hasAttribute(Tx("focus-guard"))&&S.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var R;const D=nC(c.domReference?c.domReference.ownerDocument:document);!S&&D===c.domReference||Zu((R=o.current.floatingContext)==null?void 0:R.refs.floating.current,D)||Zu(c.domReference,D)||C||r(!1,j,"focus")})}}),[o,c.domReference,r,f]);return y.useMemo(()=>u?{reference:v}:{},[u,v])}const pC="active",mC="selected";function Pv(e,t,n){const r=new Map,a=n==="item";let o=e;if(a&&e){const{[pC]:c,[mC]:u,...f}=e;o=f}return{...n==="floating"&&{tabIndex:-1,[GM]:""},...o,...t.map(c=>{const u=c?c[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((c,u)=>(u&&Object.entries(u).forEach(f=>{let[p,m]=f;if(!(a&&[pC,mC].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var v,b=arguments.length,S=new Array(b),j=0;j<b;j++)S[j]=arguments[j];return(v=r.get(p))==null?void 0:v.map(C=>C(...S)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function ZM(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),a=y.useCallback(u=>Pv(u,e,"reference"),t),o=y.useCallback(u=>Pv(u,e,"floating"),n),c=y.useCallback(u=>Pv(u,e,"item"),r);return y.useMemo(()=>({getReferenceProps:a,getFloatingProps:o,getItemProps:c}),[a,o,c])}const JM=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function e9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:a}=e,{enabled:o=!0,role:c="dialog"}=t,u=(n=JM.get(c))!=null?n:c,f=FR(),m=Cx()!=null,g=y.useMemo(()=>u==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?a:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?a:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:f},...u==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[u,a,m,r,f,c]),v=y.useMemo(()=>{const S={id:a,...u&&{role:u}};return u==="tooltip"||c==="label"?S:{...S,...u==="menu"&&{"aria-labelledby":f}}},[u,a,f,c]),b=y.useCallback(S=>{let{active:j,selected:C}=S;const R={role:"option",...j&&{id:a+"-option"}};switch(c){case"select":return{...R,"aria-selected":j&&C};case"combobox":return{...R,...j&&{"aria-selected":!0}}}return{}},[a,c]);return y.useMemo(()=>o?{reference:g,floating:v,item:b}:{},[o,g,v,b])}const[t9,ga]=vr("ScrollArea.Root component was not found in tree");function uc(e,t){const n=ws(t);Sc(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}const n9=y.forwardRef((e,t)=>{const{style:n,...r}=e,a=ga(),[o,c]=y.useState(0),[u,f]=y.useState(0),p=!!(o&&u);return uc(a.scrollbarX,()=>{var g;const m=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(m),f(m)}),uc(a.scrollbarY,()=>{var g;const m=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(m),c(m)}),p?s.jsx("div",{...r,ref:t,style:{...n,width:o,height:u}}):null}),r9=y.forwardRef((e,t)=>{const n=ga(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(n9,{...e,ref:t}):null}),a9={scrollHideDelay:1e3,type:"hover"},qR=y.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",a9,e),{type:r,scrollHideDelay:a,scrollbars:o,...c}=n,[u,f]=y.useState(null),[p,m]=y.useState(null),[g,v]=y.useState(null),[b,S]=y.useState(null),[j,C]=y.useState(null),[R,D]=y.useState(0),[E,T]=y.useState(0),[A,_]=y.useState(!1),[M,L]=y.useState(!1),$=Un(t,V=>f(V));return s.jsx(t9,{value:{type:r,scrollHideDelay:a,scrollArea:u,viewport:p,onViewportChange:m,content:g,onContentChange:v,scrollbarX:b,onScrollbarXChange:S,scrollbarXEnabled:A,onScrollbarXEnabledChange:_,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:L,onCornerWidthChange:D,onCornerHeightChange:T},children:s.jsx(ce,{...c,ref:$,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${R}px`,"--sa-corner-height":o!=="xy"?"0px":`${E}px`}})})});qR.displayName="@mantine/core/ScrollAreaRoot";function GR(e,t){const n=e/t;return Number.isNaN(n)?0:n}function hp(e){const t=GR(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function QR(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 i9(e,[t,n]){return Math.min(n,Math.max(t,e))}function gC(e,t,n="ltr"){const r=hp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,c=t.content-t.viewport,u=o-r,f=n==="ltr"?[0,c]:[c*-1,0],p=i9(e,f);return QR([0,c],[0,u])(p)}function o9(e,t,n,r="ltr"){const a=hp(n),o=a/2,c=t||o,u=a-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return QR([f,p],g)(e)}function WR(e,t){return e>0&&e<t}function zo(e){return e?parseInt(e,10):0}function Ps(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[s9,YR]=vr("ScrollAreaScrollbar was not found in tree"),KR=y.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:a,onThumbPointerUp:o,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,v=ga(),[b,S]=y.useState(null),j=Un(t,L=>S(L)),C=y.useRef(null),R=y.useRef(""),{viewport:D}=v,E=n.content-n.viewport,T=ws(p),A=ws(u),_=ap(m,10),M=L=>{if(C.current){const $=L.clientX-C.current.left,V=L.clientY-C.current.top;f({x:$,y:V})}};return y.useEffect(()=>{const L=$=>{const V=$.target;(b==null?void 0:b.contains(V))&&T($,E)};return document.addEventListener("wheel",L,{passive:!1}),()=>document.removeEventListener("wheel",L,{passive:!1})},[D,b,E,T]),y.useEffect(A,[n,A]),uc(b,_),uc(v.content,_),s.jsx(s9,{value:{scrollbar:b,hasThumb:r,onThumbChange:ws(a),onThumbPointerUp:ws(o),onThumbPositionChange:A,onThumbPointerDown:ws(c)},children:s.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Ps(e.onPointerDown,L=>{L.preventDefault(),L.button===0&&(L.target.setPointerCapture(L.pointerId),C.current=b.getBoundingClientRect(),R.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(L))}),onPointerMove:Ps(e.onPointerMove,M),onPointerUp:Ps(e.onPointerUp,L=>{const $=L.target;$.hasPointerCapture(L.pointerId)&&(L.preventDefault(),$.releasePointerCapture(L.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=R.current,C.current=null}})})}),XR=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:a,...o}=e,c=ga(),[u,f]=y.useState(),p=y.useRef(null),m=Un(t,p,c.onScrollbarXChange);return y.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),s.jsx(KR,{"data-orientation":"horizontal",...o,ref:m,sizes:n,style:{...a,"--sa-thumb-width":`${hp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),WR(b,v)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:zo(u.paddingLeft),paddingEnd:zo(u.paddingRight)}})}})});XR.displayName="@mantine/core/ScrollAreaScrollbarX";const ZR=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:a,...o}=e,c=ga(),[u,f]=y.useState(),p=y.useRef(null),m=Un(t,p,c.onScrollbarYChange);return y.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),s.jsx(KR,{...o,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${hp(n)}px`,...a},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,v)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),WR(b,v)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&u&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:zo(u.paddingTop),paddingEnd:zo(u.paddingBottom)}})}})});ZR.displayName="@mantine/core/ScrollAreaScrollbarY";const pp=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:a}=Ys(),o=ga(),c=y.useRef(null),u=y.useRef(0),[f,p]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=GR(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:b=>{u.current=b}},v=(b,S)=>o9(b,u.current,f,S);return n==="horizontal"?s.jsx(XR,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollLeft,S=gC(b,f,a);c.current.style.transform=`translate3d(${S}px, 0, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollLeft=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollLeft=v(b,a))}}):n==="vertical"?s.jsx(ZR,{...g,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const b=o.viewport.scrollTop,S=gC(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${S}px, 0)`}},onWheelScroll:b=>{o.viewport&&(o.viewport.scrollTop=b)},onDragScroll:b=>{o.viewport&&(o.viewport.scrollTop=v(b))}}):null});pp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Dx=y.forwardRef((e,t)=>{const n=ga(),{forceMount:r,...a}=e,[o,c]=y.useState(!1),u=e.orientation==="horizontal",f=ap(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(u?p:m)}},10);return uc(n.viewport,f),uc(n.content,f),r||o?s.jsx(pp,{"data-state":o?"visible":"hidden",...a,ref:t}):null});Dx.displayName="@mantine/core/ScrollAreaScrollbarAuto";const JR=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ga(),[o,c]=y.useState(!1);return y.useEffect(()=>{const{scrollArea:u}=a;let f=0;if(u){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",m)}}},[a.scrollArea,a.scrollHideDelay]),n||o?s.jsx(Dx,{"data-state":o?"visible":"hidden",...r,ref:t}):null});JR.displayName="@mantine/core/ScrollAreaScrollbarHover";const l9=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ga(),o=e.orientation==="horizontal",[c,u]=y.useState("hidden"),f=ap(()=>u("idle"),100);return y.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>u("hidden"),a.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,a.scrollHideDelay]),y.useEffect(()=>{const{viewport:p}=a,m=o?"scrollLeft":"scrollTop";if(p){let g=p[m];const v=()=>{const b=p[m];g!==b&&(u("scrolling"),f()),g=b};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[a.viewport,o,f]),n||c!=="hidden"?s.jsx(pp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ps(e.onPointerEnter,()=>u("interacting")),onPointerLeave:Ps(e.onPointerLeave,()=>u("idle"))}):null}),wy=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ga(),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:c}=a,u=e.orientation==="horizontal";return y.useEffect(()=>(u?o(!0):c(!0),()=>{u?o(!1):c(!1)}),[u,o,c]),a.type==="hover"?s.jsx(JR,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(l9,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(Dx,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(pp,{...r,ref:t}):null});wy.displayName="@mantine/core/ScrollAreaScrollbar";function c9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const o={left:e.scrollLeft,top:e.scrollTop},c=n.left!==o.left,u=n.top!==o.top;(c||u)&&t(),n=o,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)}const e2=y.forwardRef((e,t)=>{const{style:n,...r}=e,a=ga(),o=YR(),{onThumbPositionChange:c}=o,u=Un(t,m=>o.onThumbChange(m)),f=y.useRef(void 0),p=ap(()=>{f.current&&(f.current(),f.current=void 0)},100);return y.useEffect(()=>{const{viewport:m}=a;if(m){const g=()=>{if(p(),!f.current){const v=c9(m,c);f.current=v,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[a.viewport,p,c]),s.jsx("div",{"data-state":o.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Ps(e.onPointerDownCapture,m=>{const v=m.target.getBoundingClientRect(),b=m.clientX-v.left,S=m.clientY-v.top;o.onThumbPointerDown({x:b,y:S})}),onPointerUp:Ps(e.onPointerUp,o.onThumbPointerUp)})});e2.displayName="@mantine/core/ScrollAreaThumb";const jy=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=YR();return n||a.hasThumb?s.jsx(e2,{ref:t,...r}):null});jy.displayName="@mantine/core/ScrollAreaThumb";const t2=y.forwardRef(({children:e,style:t,...n},r)=>{const a=ga(),o=Un(r,a.onViewportChange);return s.jsx(ce,{...n,ref:o,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%"},ref:a.onContentChange,children:e})})});t2.displayName="@mantine/core/ScrollAreaViewport";var Ax={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const n2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},u9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Yr=me((e,t)=>{const n=se("ScrollArea",n2,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:v,viewportRef:b,onScrollPositionChange:S,children:j,offsetScrollbars:C,scrollbars:R,onBottomReached:D,onTopReached:E,overscrollBehavior:T,...A}=n,[_,M]=y.useState(!1),[L,$]=y.useState(!1),[V,X]=y.useState(!1),Q=Me({name:"ScrollArea",props:n,classes:Ax,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:u9}),J=y.useRef(null),W=NM([b,J]);return y.useEffect(()=>{if(!J.current||C!=="present")return;const Y=J.current,P=new ResizeObserver(()=>{const{scrollHeight:I,clientHeight:z,scrollWidth:F,clientWidth:O}=Y;$(I>z),X(F>O)});return P.observe(Y),()=>P.disconnect()},[J,C]),s.jsxs(qR,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:R,...Q("root"),...A,children:[s.jsx(t2,{...v,...Q("viewport",{style:v==null?void 0:v.style}),ref:W,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":R||void 0,"data-horizontal-hidden":C==="present"&&!V?"true":void 0,"data-vertical-hidden":C==="present"&&!L?"true":void 0,onScroll:Y=>{var F;(F=v==null?void 0:v.onScroll)==null||F.call(v,Y),S==null||S({x:Y.currentTarget.scrollLeft,y:Y.currentTarget.scrollTop});const{scrollTop:P,scrollHeight:I,clientHeight:z}=Y.currentTarget;P-(I-z)>=0&&(D==null||D()),P===0&&(E==null||E())},children:j}),(R==="xy"||R==="x")&&s.jsx(wy,{...Q("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!V?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(jy,{...Q("thumb")})}),(R==="xy"||R==="y")&&s.jsx(wy,{...Q("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!L?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:s.jsx(jy,{...Q("thumb")})}),s.jsx(r9,{...Q("corner"),"data-hovered":_||void 0,"data-hidden":m==="never"||void 0})]})});Yr.displayName="@mantine/core/ScrollArea";const mp=me((e,t)=>{const{children:n,classNames:r,styles:a,scrollbarSize:o,scrollHideDelay:c,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,scrollbars:j,style:C,vars:R,onBottomReached:D,onTopReached:E,...T}=se("ScrollAreaAutosize",n2,e);return s.jsx(ce,{...T,ref:t,style:[{display:"flex",overflow:"auto"},C],children:s.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Yr,{classNames:r,styles:a,scrollHideDelay:c,scrollbarSize:o,type:u,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:v,variant:b,viewportProps:S,vars:R,scrollbars:j,onBottomReached:D,onTopReached:E,children:n})})})});Yr.classes=Ax;mp.displayName="@mantine/core/ScrollAreaAutosize";mp.classes=Ax;Yr.Autosize=mp;var r2={root:"m_87cf2631"};const d9={__staticSelector:"UnstyledButton"},tr=lr((e,t)=>{const n=se("UnstyledButton",d9,e),{className:r,component:a="button",__staticSelector:o,unstyled:c,classNames:u,styles:f,style:p,...m}=n,g=Me({name:o,props:n,classes:r2,className:r,style:p,classNames:u,styles:f,unstyled:c});return s.jsx(ce,{...g("root",{focusable:!0}),component:a,ref:t,type:a==="button"?"button":void 0,...m})});tr.classes=r2;tr.displayName="@mantine/core/UnstyledButton";var a2={root:"m_515a97f8"};const f9={},_x=me((e,t)=>{const n=se("VisuallyHidden",f9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,...p}=n,m=Me({name:"VisuallyHidden",classes:a2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u});return s.jsx(ce,{component:"span",ref:t,...m("root"),...p})});_x.classes=a2;_x.displayName="@mantine/core/VisuallyHidden";var i2={root:"m_1b7284a3"};const h9={},p9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ft(t),"--paper-shadow":ox(n)}}),mr=lr((e,t)=>{const n=se("Paper",h9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,withBorder:f,vars:p,radius:m,shadow:g,variant:v,mod:b,...S}=n,j=Me({name:"Paper",props:n,classes:i2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:p9});return s.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:v,...S})});mr.classes=i2;mr.displayName="@mantine/core/Paper";function o2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),a=n==="right"?"left":"right";return r===void 0?a:`${a}-${r}`}return t}function vC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function yC(e,t,n,r,a){return e==="center"||r==="center"?{left:t}:e==="end"?{[a==="ltr"?"right":"left"]:n}:e==="start"?{[a==="ltr"?"left":"right"]:n}:{}}const m9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function g9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,arrowX:o,arrowY:c,dir:u}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[m9[f]]:r},g=-t/2;return f==="left"?{...m,...vC(p,c,n,a),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...vC(p,c,n,a),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...yC(p,o,n,a,u),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...yC(p,o,n,a,u),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const kx=y.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,visible:o,arrowX:c,arrowY:u,style:f,...p},m)=>{const{dir:g}=Ys();return o?s.jsx("div",{...p,ref:m,style:{...f,...g9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:a,dir:g,arrowX:c,arrowY:u})}}):null});kx.displayName="@mantine/core/FloatingArrow";var s2={root:"m_9814e45f"};const v9={zIndex:Wr("modal")},y9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:a,radius:o,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&sa(n||"#000",r??.6)||void 0,"--overlay-filter":a?`blur(${le(a)})`:void 0,"--overlay-radius":o===void 0?void 0:Ft(o),"--overlay-z-index":c==null?void 0:c.toString()}}),dc=lr((e,t)=>{const n=se("Overlay",v9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,fixed:p,center:m,children:g,radius:v,zIndex:b,gradient:S,blur:j,color:C,backgroundOpacity:R,mod:D,...E}=n,T=Me({name:"Overlay",props:n,classes:s2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:y9});return s.jsx(ce,{ref:t,...T("root"),mod:[{center:m,fixed:p},D],...E,children:g})});dc.classes=s2;dc.displayName="@mantine/core/Overlay";function Nv(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}function x9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Nv(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const a=Nv(n);return a.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(a),a}return Nv(n)}const b9={},l2=me((e,t)=>{const{children:n,target:r,reuseTargetNode:a,...o}=se("Portal",b9,e),[c,u]=y.useState(!1),f=y.useRef(null);return Sc(()=>(u(!0),f.current=x9({target:r,reuseTargetNode:a,...o}),Ku(t,f.current),!r&&!a&&f.current&&document.body.appendChild(f.current),()=>{!r&&!a&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:px.createPortal(s.jsx(s.Fragment,{children:n}),f.current)});l2.displayName="@mantine/core/Portal";const Ho=me(({withinPortal:e=!0,children:t,...n},r)=>gR()==="test"||!e?s.jsx(s.Fragment,{children:t}):s.jsx(l2,{ref:r,...n,children:t}));Ho.displayName="@mantine/core/OptionalPortal";const Ou=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rh={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},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(-20px) 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(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) 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:{...Ou("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Ou("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Ou("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Ou("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Ou("top"),common:{transformOrigin:"top right"}}},xC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function S9({transition:e,state:t,duration:n,timingFunction:r}){const a={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in rh?{transitionProperty:rh[e].transitionProperty,...a,...rh[e].common,...rh[e][xC[t]]}:{}:{transitionProperty:e.transitionProperty,...a,...e.common,...e[xC[t]]}}function w9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:a,onExit:o,onEntered:c,onExited:u,enterDelay:f,exitDelay:p}){const m=Sn(),g=lx(),v=m.respectReducedMotion?g:!1,[b,S]=y.useState(v?0:e),[j,C]=y.useState(r?"entered":"exited"),R=y.useRef(-1),D=y.useRef(-1),E=y.useRef(-1),T=_=>{const M=_?a:o,L=_?c:u;window.clearTimeout(R.current);const $=v?0:_?e:t;S($),$===0?(typeof M=="function"&&M(),typeof L=="function"&&L(),C(_?"entered":"exited")):E.current=requestAnimationFrame(()=>{Vu.flushSync(()=>{C(_?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof M=="function"&&M(),C(_?"entering":"exiting"),R.current=window.setTimeout(()=>{typeof L=="function"&&L(),C(_?"entered":"exited")},$)})})},A=_=>{if(window.clearTimeout(D.current),typeof(_?f:p)!="number"){T(_);return}D.current=window.setTimeout(()=>{T(_)},_?f:p)};return $i(()=>{A(r)},[r]),y.useEffect(()=>()=>{window.clearTimeout(R.current),cancelAnimationFrame(E.current)},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function hi({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:a,children:o,timingFunction:c="ease",onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:v}){const b=gR(),{transitionDuration:S,transitionStatus:j,transitionTimingFunction:C}=w9({mounted:a,exitDuration:r,duration:n,timingFunction:c,onExit:u,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:v});return S===0||b==="test"?a?s.jsx(s.Fragment,{children:o({})}):e?o({display:"none"}):null:j==="exited"?e?o({display:"none"}):null:s.jsx(s.Fragment,{children:o(S9({transition:t,duration:S,state:j,timingFunction:C}))})}hi.displayName="@mantine/core/Transition";const[j9,c2]=vr("Popover component was not found in the tree");function gp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const a=lN(t),o=Un(a,r);return Hi(e)?y.cloneElement(e,{[n]:o}):e}function u2(e){return s.jsx(_x,{tabIndex:-1,"data-autofocus":!0,...e})}gp.displayName="@mantine/core/FocusTrap";u2.displayName="@mantine/core/FocusTrapInitialFocus";gp.InitialFocus=u2;var d2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const C9={},Px=me((e,t)=>{var C,R,D,E;const n=se("PopoverDropdown",C9,e),{className:r,style:a,vars:o,children:c,onKeyDownCapture:u,variant:f,classNames:p,styles:m,...g}=n,v=c2(),b=cR({opened:v.opened,shouldReturnFocus:v.returnFocus}),S=v.withRoles?{"aria-labelledby":v.getTargetId(),id:v.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Un(t,v.floating);return v.disabled?null:s.jsx(Ho,{...v.portalProps,withinPortal:v.withinPortal,children:s.jsx(hi,{mounted:v.opened,...v.transitionProps,transition:((C=v.transitionProps)==null?void 0:C.transition)||"fade",duration:((R=v.transitionProps)==null?void 0:R.duration)??150,keepMounted:v.keepMounted,exitDuration:typeof((D=v.transitionProps)==null?void 0:D.exitDuration)=="number"?v.transitionProps.exitDuration:(E=v.transitionProps)==null?void 0:E.duration,children:T=>s.jsx(gp,{active:v.trapFocus&&v.opened,innerRef:j,children:s.jsxs(ce,{...S,...g,variant:f,onKeyDownCapture:Y3(()=>{var A,_;(A=v.onClose)==null||A.call(v),(_=v.onDismiss)==null||_.call(v)},{active:v.closeOnEscape,onTrigger:b,onKeyDown:u}),"data-position":v.placement,"data-fixed":v.floatingStrategy==="fixed"||void 0,...v.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...T,zIndex:v.zIndex,top:v.y??0,left:v.x??0,width:v.width==="target"?void 0:le(v.width)},v.resolvedStyles.dropdown,m==null?void 0:m.dropdown,a]}),children:[c,s.jsx(kx,{ref:v.arrowRef,arrowX:v.arrowX,arrowY:v.arrowY,visible:v.withArrow,position:v.placement,arrowSize:v.arrowSize,arrowRadius:v.arrowRadius,arrowOffset:v.arrowOffset,arrowPosition:v.arrowPosition,...v.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Px.classes=d2;Px.displayName="@mantine/core/PopoverDropdown";const E9={refProp:"ref",popupType:"dialog"},f2=me((e,t)=>{const{children:n,refProp:r,popupType:a,...o}=se("PopoverTarget",E9,e);if(!Hi(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 c=o,u=c2(),f=Un(u.reference,op(n),t),p=u.withRoles?{"aria-haspopup":a,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return y.cloneElement(n,{...c,...p,...u.targetProps,className:$t(u.targetProps.className,c.className,n.props.className),[r]:f,...u.controlled?null:{onClick:u.onToggle}})});f2.displayName="@mantine/core/PopoverTarget";function h2({opened:e,floating:t,position:n,positionDependencies:r}){const[a,o]=y.useState(0);y.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return wM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,a,n]),$i(()=>{t.update()},r),$i(()=>{o(c=>c+1)},[e])}function T9(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 R9(e,t){const n=T9(e.middlewares),r=[UR(e.offset)];return n.shift&&r.push(jx(typeof n.shift=="boolean"?{limiter:cC(),padding:5}:{limiter:cC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?kh():kh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Gu():Gu(n.inline)),r.push(BR({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(PM({...typeof n.size=="boolean"?{}:n.size,apply({rects:a,availableWidth:o,availableHeight:c,...u}){var m;const p=((m=t().refs.floating.current)==null?void 0:m.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:a,availableWidth:o,availableHeight:c,...u}):Object.assign(p,{maxWidth:`${o}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${a.reference.width}px`})}})),r}function D9(e){const[t,n]=Wn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=y.useRef(t),a=()=>{t&&n(!1)},o=()=>n(!t),c=Rx({strategy:e.strategy,placement:e.position,middleware:R9(e,()=>c)});return h2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),$i(()=>{var u;(u=e.onPositionChange)==null||u.call(e,c.placement)},[c.placement]),$i(()=>{var u,f;t!==r.current&&(t?(f=e.onOpen)==null||f.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:a,onToggle:o}}const A9={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,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Wr("popover"),__staticSelector:"Popover",width:"max-content"},_9=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ft(t),"--popover-shadow":ox(n)}});function za(e){var $e,gt,ht,Wt,_t,mn;const t=se("Popover",A9,e),{children:n,position:r,offset:a,onPositionChange:o,positionDependencies:c,opened:u,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:v,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,unstyled:D,classNames:E,styles:T,closeOnClickOutside:A,withinPortal:_,portalProps:M,closeOnEscape:L,clickOutsideEvents:$,trapFocus:V,onClose:X,onDismiss:Q,onOpen:J,onChange:W,zIndex:Y,radius:P,shadow:I,id:z,defaultOpened:F,__staticSelector:O,withRoles:U,disabled:Z,returnFocus:ee,variant:ye,keepMounted:be,vars:ve,floatingStrategy:Ge,withOverlay:ke,overlayProps:et,...Re}=t,ft=Me({name:O,props:t,classes:d2,classNames:E,styles:T,unstyled:D,rootSelector:"dropdown",vars:ve,varsResolver:_9}),{resolvedStyles:Ut}=Gs({classNames:E,styles:T,props:t}),Ot=y.useRef(null),[xt,Ht]=y.useState(null),[Bt,Se]=y.useState(null),{dir:Ne}=Ys(),Ve=yr(z),Te=D9({middlewares:v,width:g,position:o2(Ne,r),offset:typeof a=="number"?a+(b?S/2:0):a,arrowRef:Ot,arrowOffset:j,onPositionChange:o,positionDependencies:c,opened:u,defaultOpened:F,onChange:W,onOpen:J,onClose:X,onDismiss:Q,strategy:Ge});J3(()=>{A&&(Te.onClose(),Q==null||Q())},$,[xt,Bt]);const ge=y.useCallback(St=>{Ht(St),Te.floating.refs.setReference(St)},[Te.floating.refs.setReference]),we=y.useCallback(St=>{Se(St),Te.floating.refs.setFloating(St)},[Te.floating.refs.setFloating]),Le=y.useCallback(()=>{var St;(St=f==null?void 0:f.onExited)==null||St.call(f),p==null||p()},[f==null?void 0:f.onExited,p]),xe=y.useCallback(()=>{var St;(St=f==null?void 0:f.onEntered)==null||St.call(f),m==null||m()},[f==null?void 0:f.onEntered,m]);return s.jsxs(j9,{value:{returnFocus:ee,disabled:Z,controlled:Te.controlled,reference:ge,floating:we,x:Te.floating.x,y:Te.floating.y,arrowX:(ht=(gt=($e=Te.floating)==null?void 0:$e.middlewareData)==null?void 0:gt.arrow)==null?void 0:ht.x,arrowY:(mn=(_t=(Wt=Te.floating)==null?void 0:Wt.middlewareData)==null?void 0:_t.arrow)==null?void 0:mn.y,opened:Te.opened,arrowRef:Ot,transitionProps:{...f,onExited:Le,onEntered:xe},width:g,withArrow:b,arrowSize:S,arrowOffset:j,arrowRadius:C,arrowPosition:R,placement:Te.floating.placement,trapFocus:V,withinPortal:_,portalProps:M,zIndex:Y,radius:P,shadow:I,closeOnEscape:L,onDismiss:Q,onClose:Te.onClose,onToggle:Te.onToggle,getTargetId:()=>`${Ve}-target`,getDropdownId:()=>`${Ve}-dropdown`,withRoles:U,targetProps:Re,__staticSelector:O,classNames:E,styles:T,unstyled:D,variant:ye,keepMounted:be,getStyles:ft,resolvedStyles:Ut,floatingStrategy:Ge},children:[n,ke&&s.jsx(hi,{transition:"fade",mounted:Te.opened,duration:(f==null?void 0:f.duration)||250,exitDuration:(f==null?void 0:f.exitDuration)||250,children:St=>s.jsx(Ho,{withinPortal:_,children:s.jsx(dc,{...et,...ft("overlay",{className:et==null?void 0:et.className,style:[St,et==null?void 0:et.style]})})})})]})}za.Target=f2;za.Dropdown=Px;za.displayName="@mantine/core/Popover";za.extend=e=>e;var Pa={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 p2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:$t(Pa.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pa.bar}),s.jsx("span",{className:Pa.bar}),s.jsx("span",{className:Pa.bar})]}));p2.displayName="@mantine/core/Bars";const m2=y.forwardRef(({className:e,...t},n)=>s.jsxs(ce,{component:"span",className:$t(Pa.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Pa.dot}),s.jsx("span",{className:Pa.dot}),s.jsx("span",{className:Pa.dot})]}));m2.displayName="@mantine/core/Dots";const g2=y.forwardRef(({className:e,...t},n)=>s.jsx(ce,{component:"span",className:$t(Pa.ovalLoader,e),...t,ref:n}));g2.displayName="@mantine/core/Oval";const v2={bars:p2,oval:g2,dots:m2},k9={loaders:v2,type:"oval"},P9=(e,{size:t,color:n})=>({root:{"--loader-size":nt(t,"loader-size"),"--loader-color":n?Gt(n,e):void 0}}),_r=me((e,t)=>{const n=se("Loader",k9,e),{size:r,color:a,type:o,vars:c,className:u,style:f,classNames:p,styles:m,unstyled:g,loaders:v,variant:b,children:S,...j}=n,C=Me({name:"Loader",props:n,classes:Pa,className:u,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:P9});return S?s.jsx(ce,{...C("root"),ref:t,...j,children:S}):s.jsx(ce,{...C("root"),ref:t,component:v[o],variant:b,size:r,...j})});_r.defaultLoaders=v2;_r.classes=Pa;_r.displayName="@mantine/core/Loader";var Cc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const bC={orientation:"horizontal"},N9=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),Nx=me((e,t)=>{const n=se("ActionIconGroup",bC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:v,...b}=se("ActionIconGroup",bC,e),S=Me({name:"ActionIconGroup",props:n,classes:Cc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:p,varsResolver:N9,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});Nx.classes=Cc;Nx.displayName="@mantine/core/ActionIconGroup";const SC={},O9=(e,{radius:t,color:n,gradient:r,variant:a,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:o});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":Mn(c),"--section-radius":t===void 0?void 0:Ft(t),"--section-bg":n||a?u.background:void 0,"--section-color":u.color,"--section-bd":n||a?u.border:void 0}}},Ox=me((e,t)=>{const n=se("ActionIconGroupSection",SC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:v,...b}=se("ActionIconGroupSection",SC,e),S=Me({name:"ActionIconGroupSection",props:n,classes:Cc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:O9,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});Ox.classes=Cc;Ox.displayName="@mantine/core/ActionIconGroupSection";const M9={},I9=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:a,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":nt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ft(n),"--ai-bg":o||r?u.background:void 0,"--ai-hover":o||r?u.hover:void 0,"--ai-hover-color":o||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":o||r?u.border:void 0}}},_n=lr((e,t)=>{const n=se("ActionIcon",M9,e),{className:r,unstyled:a,variant:o,classNames:c,styles:u,style:f,loading:p,loaderProps:m,size:g,color:v,radius:b,__staticSelector:S,gradient:j,vars:C,children:R,disabled:D,"data-disabled":E,autoContrast:T,mod:A,..._}=n,M=Me({name:["ActionIcon",S],props:n,className:r,style:f,classes:Cc,classNames:c,styles:u,unstyled:a,vars:C,varsResolver:I9});return s.jsxs(tr,{...M("root",{active:!D&&!p&&!E}),..._,unstyled:a,variant:o,size:g,disabled:D||p,ref:t,mod:[{loading:p,disabled:D||E},A],children:[s.jsx(hi,{mounted:!!p,transition:"slide-down",duration:150,children:L=>s.jsx(ce,{component:"span",...M("loader",{style:L}),"aria-hidden":!0,children:s.jsx(_r,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),s.jsx(ce,{component:"span",mod:{loading:p},...M("icon"),children:R})]})});_n.classes=Cc;_n.displayName="@mantine/core/ActionIcon";_n.Group=Nx;_n.GroupSection=Ox;const y2=y.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"})}));y2.displayName="@mantine/core/CloseIcon";var x2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const L9={variant:"subtle"},z9=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":nt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ft(n),"--cb-icon-size":le(r)}}),qo=lr((e,t)=>{const n=se("CloseButton",L9,e),{iconSize:r,children:a,vars:o,radius:c,className:u,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":v,disabled:b,variant:S,icon:j,mod:C,__staticSelector:R,...D}=n,E=Me({name:R||"CloseButton",props:n,className:u,style:p,classes:x2,classNames:f,styles:m,unstyled:g,vars:o,varsResolver:z9});return s.jsxs(tr,{ref:t,...D,unstyled:g,variant:S,disabled:b,mod:[{disabled:b||v},C],...E("root",{variant:S,active:!b&&!v}),children:[j||s.jsx(y2,{}),a]})});qo.classes=x2;qo.displayName="@mantine/core/CloseButton";function $9(e){return y.Children.toArray(e).filter(Boolean)}var b2={root:"m_4081bf90"};const U9={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},B9=(e,{grow:t,preventGrowOverflow:n,gap:r,align:a,justify:o,wrap:c},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":On(r),"--group-align":a,"--group-justify":o,"--group-wrap":c}}),Ce=me((e,t)=>{const n=se("Group",U9,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,children:f,gap:p,align:m,justify:g,wrap:v,grow:b,preventGrowOverflow:S,vars:j,variant:C,__size:R,mod:D,...E}=n,T=$9(f),A=T.length,_=On(p??"md"),L={childWidth:`calc(${100/A}% - (${_} - ${_} / ${A}))`},$=Me({name:"Group",props:n,stylesCtx:L,className:a,style:o,classes:b2,classNames:r,styles:c,unstyled:u,vars:j,varsResolver:B9});return s.jsx(ce,{...$("root"),ref:t,variant:C,mod:[{grow:b},D],size:R,...E,children:T})});Ce.classes=b2;Ce.displayName="@mantine/core/Group";const[V9,Yi]=vr("ModalBase component was not found in tree");function F9({opened:e,transitionDuration:t}){const[n,r]=y.useState(e),a=y.useRef(-1),c=lx()?0:t;return y.useEffect(()=>(e?(r(!0),window.clearTimeout(a.current)):c===0?r(!1):a.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(a.current)),[e,c]),n}function H9({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:a,onClose:o,returnFocus:c}){const u=yr(e),[f,p]=y.useState(!1),[m,g]=y.useState(!1),v=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,b=F9({opened:n,transitionDuration:v});return hR("keydown",S=>{var j;S.key==="Escape"&&a&&!S.isComposing&&n&&((j=S.target)==null?void 0:j.getAttribute("data-mantine-stop-propagation"))!=="true"&&o()},{capture:!0}),cR({opened:n,shouldReturnFocus:r&&c}),{_id:u,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const S2=y.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:c,trapFocus:u,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:v,lockScroll:b,children:S,zIndex:j,shadow:C,padding:R,__vars:D,unstyled:E,removeScrollProps:T,...A},_)=>{const{_id:M,titleMounted:L,bodyMounted:$,shouldLockScroll:V,setTitleMounted:X,setBodyMounted:Q}=H9({id:r,transitionProps:a,opened:t,trapFocus:u,closeOnEscape:f,onClose:n,returnFocus:p}),{key:J,...W}=T||{};return s.jsx(Ho,{...v,withinPortal:g,children:s.jsx(V9,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:o,onEnterTransitionEnd:c,transitionProps:{...a,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:L,bodyMounted:$,setTitleMounted:X,setBodyMounted:Q,trapFocus:u,closeOnEscape:f,zIndex:j,unstyled:E},children:s.jsx(lc,{enabled:V&&b,...W,children:s.jsx(ce,{ref:_,...A,__vars:{...D,"--mb-z-index":(j||Wr("modal")).toString(),"--mb-shadow":ox(C),"--mb-padding":On(R)},children:S})},J)})})});S2.displayName="@mantine/core/ModalBase";function q9(){const e=Yi();return y.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var fc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const w2=y.forwardRef(({className:e,...t},n)=>{const r=q9(),a=Yi();return s.jsx(ce,{ref:n,...t,id:r,className:$t({[fc.body]:!a.unstyled},e)})});w2.displayName="@mantine/core/ModalBaseBody";const j2=y.forwardRef(({className:e,onClick:t,...n},r)=>{const a=Yi();return s.jsx(qo,{ref:r,...n,onClick:o=>{a.onClose(),t==null||t(o)},className:$t({[fc.close]:!a.unstyled},e),unstyled:a.unstyled})});j2.displayName="@mantine/core/ModalBaseCloseButton";const C2=y.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:a,...o},c)=>{const u=Yi();return s.jsx(hi,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var f,p,m;(f=u.onExitTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onExited)==null||m.call(p)},onEntered:()=>{var f,p,m;(f=u.onEnterTransitionEnd)==null||f.call(u),(m=(p=u.transitionProps)==null?void 0:p.onEntered)==null||m.call(p)},...e,children:f=>s.jsx("div",{...n,className:$t({[fc.inner]:!u.unstyled},n.className),children:s.jsx(gp,{active:u.opened&&u.trapFocus,innerRef:c,children:s.jsx(mr,{...o,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[a,f],className:$t({[fc.content]:!u.unstyled},t),unstyled:u.unstyled,children:o.children})})})})});C2.displayName="@mantine/core/ModalBaseContent";const E2=y.forwardRef(({className:e,...t},n)=>{const r=Yi();return s.jsx(ce,{component:"header",ref:n,className:$t({[fc.header]:!r.unstyled},e),...t})});E2.displayName="@mantine/core/ModalBaseHeader";const G9={duration:200,timingFunction:"ease",transition:"fade"};function Q9(e){const t=Yi();return{...G9,...t.transitionProps,...e}}const T2=y.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...a},o)=>{const c=Yi(),u=Q9(t);return s.jsx(hi,{mounted:r!==void 0?r:c.opened,...u,transition:"fade",children:f=>s.jsx(dc,{ref:o,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e==null||e(p),c.closeOnClickOutside&&c.onClose()},...a})})});T2.displayName="@mantine/core/ModalBaseOverlay";function W9(){const e=Yi();return y.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const R2=y.forwardRef(({className:e,...t},n)=>{const r=W9(),a=Yi();return s.jsx(ce,{component:"h2",ref:n,className:$t({[fc.title]:!a.unstyled},e),...t,id:r})});R2.displayName="@mantine/core/ModalBaseTitle";function Y9({children:e}){return s.jsx(s.Fragment,{children:e})}const[K9,X9]=qi({size:"sm"}),Z9={},D2=me((e,t)=>{const n=se("InputClearButton",Z9,e),{size:r,variant:a,vars:o,classNames:c,styles:u,...f}=n,p=X9(),{resolvedClassNames:m,resolvedStyles:g}=Gs({classNames:c,styles:u,props:n});return s.jsx(qo,{variant:a||"transparent",ref:t,size:r||(p==null?void 0:p.size)||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});D2.displayName="@mantine/core/InputClearButton";const[J9,Ec]=qi({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var va={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 wC={},e5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`}}),vp=me((e,t)=>{const n=se("InputDescription",wC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=se("InputDescription",wC,n),S=Ec(),j=Me({name:["InputWrapper",m],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"description",vars:f,varsResolver:e5}),C=g&&(S==null?void 0:S.getStyles)||j;return s.jsx(ce,{component:"p",ref:t,variant:v,size:p,...C("description",S!=null&&S.getStyles?{className:a,style:o}:void 0),...b})});vp.classes=va;vp.displayName="@mantine/core/InputDescription";const t5={},n5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`}}),yp=me((e,t)=>{const n=se("InputError",t5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:v,...b}=n,S=Me({name:["InputWrapper",m],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"error",vars:f,varsResolver:n5}),j=Ec(),C=g&&(j==null?void 0:j.getStyles)||S;return s.jsx(ce,{component:"p",ref:t,variant:v,size:p,...C("error",j!=null&&j.getStyles?{className:a,style:o}:void 0),...b})});yp.classes=va;yp.displayName="@mantine/core/InputError";const jC={labelElement:"label"},r5=(e,{size:t})=>({label:{"--input-label-size":Mn(t),"--input-asterisk-color":void 0}}),fd=me((e,t)=>{const n=se("InputLabel",jC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,labelElement:p,size:m,required:g,htmlFor:v,onMouseDown:b,children:S,__staticSelector:j,variant:C,mod:R,...D}=se("InputLabel",jC,n),E=Me({name:["InputWrapper",j],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"label",vars:f,varsResolver:r5}),T=Ec(),A=(T==null?void 0:T.getStyles)||E;return s.jsxs(ce,{...A("label",T!=null&&T.getStyles?{className:a,style:o}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?v:void 0,mod:[{required:g},R],onMouseDown:_=>{b==null||b(_),!_.defaultPrevented&&_.detail>1&&_.preventDefault()},...D,children:[S,g&&s.jsx("span",{...A("required"),"aria-hidden":!0,children:" *"})]})});fd.classes=va;fd.displayName="@mantine/core/InputLabel";const CC={},Mx=me((e,t)=>{const n=se("InputPlaceholder",CC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,__staticSelector:p,variant:m,error:g,mod:v,...b}=se("InputPlaceholder",CC,n),S=Me({name:["InputPlaceholder",p],props:n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"placeholder"});return s.jsx(ce,{...S("placeholder"),mod:[{error:!!g},v],component:"span",variant:m,ref:t,...b})});Mx.classes=va;Mx.displayName="@mantine/core/InputPlaceholder";function a5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),a=e.slice(0,r),o=e.slice(r+1),c=t&&a.includes("description")||n&&a.includes("error");return{offsetBottom:t&&o.includes("description")||n&&o.includes("error"),offsetTop:c}}const i5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},o5=(e,{size:t})=>({label:{"--input-label-size":Mn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Mn(t)} - ${le(2)})`}}),Ix=me((e,t)=>{const n=se("InputWrapper",i5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:v,inputWrapperOrder:b,label:S,error:j,description:C,labelProps:R,descriptionProps:D,errorProps:E,labelElement:T,children:A,withAsterisk:_,id:M,required:L,__stylesApiProps:$,mod:V,...X}=n,Q=Me({name:["InputWrapper",g],props:$||n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:o5}),J={size:p,variant:m,__staticSelector:g},W=yr(M),Y=typeof _=="boolean"?_:L,P=(E==null?void 0:E.id)||`${W}-error`,I=(D==null?void 0:D.id)||`${W}-description`,z=W,F=!!j&&typeof j!="boolean",O=!!C,U=`${F?P:""} ${O?I:""}`,Z=U.trim().length>0?U.trim():void 0,ee=(R==null?void 0:R.id)||`${W}-label`,ye=S&&s.jsx(fd,{labelElement:T,id:ee,htmlFor:z,required:Y,...J,...R,children:S},"label"),be=O&&s.jsx(vp,{...D,...J,size:(D==null?void 0:D.size)||J.size,id:(D==null?void 0:D.id)||I,children:C},"description"),ve=s.jsx(y.Fragment,{children:v(A)},"input"),Ge=F&&y.createElement(yp,{...E,...J,size:(E==null?void 0:E.size)||J.size,key:"error",id:(E==null?void 0:E.id)||P},j),ke=b.map(et=>{switch(et){case"label":return ye;case"input":return ve;case"description":return be;case"error":return Ge;default:return null}});return s.jsx(J9,{value:{getStyles:Q,describedBy:Z,inputId:z,labelId:ee,...a5(b,{hasDescription:O,hasError:F})},children:s.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},V],...Q("root"),...X,children:ke})})});Ix.classes=va;Ix.displayName="@mantine/core/InputWrapper";const s5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},l5=(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":nt(t.size,"input-height"),"--input-fz":Mn(t.size),"--input-radius":t.radius===void 0?void 0:Ft(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?nt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),pn=lr((e,t)=>{const n=se("Input",s5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:v,error:b,disabled:S,leftSection:j,leftSectionProps:C,leftSectionWidth:R,rightSection:D,rightSectionProps:E,rightSectionWidth:T,rightSectionPointerEvents:A,leftSectionPointerEvents:_,variant:M,vars:L,pointer:$,multiline:V,radius:X,id:Q,withAria:J,withErrorStyles:W,mod:Y,inputSize:P,__clearSection:I,__clearable:z,__defaultRightSection:F,...O}=n,{styleProps:U,rest:Z}=Wi(O),ee=Ec(),ye={offsetBottom:ee==null?void 0:ee.offsetBottom,offsetTop:ee==null?void 0:ee.offsetTop},be=Me({name:["Input",p],props:m||n,classes:va,className:a,style:o,classNames:r,styles:c,unstyled:u,stylesCtx:ye,rootSelector:"wrapper",vars:L,varsResolver:l5}),ve=J?{required:f,disabled:S,"aria-invalid":!!b,"aria-describedby":ee==null?void 0:ee.describedBy,id:(ee==null?void 0:ee.inputId)||Q}:{},Ge=D||z&&I||F;return s.jsx(K9,{value:{size:g||"sm"},children:s.jsxs(ce,{...be("wrapper"),...U,...v,mod:[{error:!!b&&W,pointer:$,disabled:S,multiline:V,"data-with-right-section":!!Ge,"data-with-left-section":!!j},Y],variant:M,size:g,children:[j&&s.jsx("div",{...C,"data-position":"left",...be("section",{className:C==null?void 0:C.className,style:C==null?void 0:C.style}),children:j}),s.jsx(ce,{component:"input",...Z,...ve,ref:t,required:f,mod:{disabled:S,error:!!b&&W},variant:M,__size:P,...be("input")}),Ge&&s.jsx("div",{...E,"data-position":"right",...be("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:Ge})]})})});pn.classes=va;pn.Wrapper=Ix;pn.Label=fd;pn.Error=yp;pn.Description=vp;pn.Placeholder=Mx;pn.ClearButton=D2;pn.displayName="@mantine/core/Input";function c5(e,t,n){const r=se(e,t,n),{label:a,description:o,error:c,required:u,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:v,__stylesApiProps:b,errorProps:S,labelProps:j,descriptionProps:C,wrapperProps:R,id:D,size:E,style:T,inputContainer:A,inputWrapperOrder:_,withAsterisk:M,variant:L,vars:$,mod:V,...X}=r,{styleProps:Q,rest:J}=Wi(X),W={label:a,description:o,error:c,required:u,classNames:f,className:m,__staticSelector:v,__stylesApiProps:b||r,errorProps:S,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:E,style:T,inputContainer:A,inputWrapperOrder:_,withAsterisk:M,variant:L,id:D,mod:V,...R};return{...J,classNames:f,styles:p,unstyled:g,wrapperProps:{...W,...Q},inputProps:{required:u,classNames:f,styles:p,unstyled:g,size:E,__staticSelector:v,__stylesApiProps:b||r,error:c,variant:L,id:D}}}const u5={__staticSelector:"InputBase",withAria:!0},Pr=lr((e,t)=>{const{inputProps:n,wrapperProps:r,...a}=c5("InputBase",u5,e);return s.jsx(pn.Wrapper,{...r,children:s.jsx(pn,{...n,...a,ref:t})})});Pr.classes={...pn.classes,...pn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const d5={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 A2={root:"m_8bffd616"};const f5={},Uo=lr((e,t)=>{const n=se("Flex",f5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,gap:p,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:j,...C}=n,R=Me({name:"Flex",classes:A2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f}),D=Sn(),E=ud(),T=SR({styleProps:{gap:p,rowGap:m,columnGap:g,align:v,justify:b,wrap:S,direction:j},theme:D,data:d5});return s.jsxs(s.Fragment,{children:[T.hasResponsiveStyles&&s.jsx(Ws,{selector:`.${E}`,styles:T.styles,media:T.media}),s.jsx(ce,{ref:t,...R("root",{className:E,style:Fo(T.inlineStyles)}),...C})]})});Uo.classes=A2;Uo.displayName="@mantine/core/Flex";function h5(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 p5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const a=y.useRef(-1),[o,c]=y.useState(!1),[u,f]=y.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),S=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),R=zo(j.borderTopWidth)+zo(C.borderTopWidth),D=zo(j.borderLeftWidth)+zo(C.borderLeftWidth),E={top:b.top-S.top-R,left:b.left-S.left-D,width:b.width,height:b.height};n.current.style.transform=`translateY(${E.top}px) translateX(${E.left}px)`,n.current.style.width=`${E.width}px`,n.current.style.height=`${E.height}px`},m=()=>{window.clearTimeout(a.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),a.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=y.useRef(null),v=y.useRef(null);return y.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(v.current=new ResizeObserver(m),v.current.observe(t)),()=>{var b,S;(b=g.current)==null||b.disconnect(),(S=v.current)==null||S.disconnect()}},[t,e]),y.useEffect(()=>{if(t){const b=S=>{h5(S.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),yN(()=>{pR()!=="test"&&c(!0)},20,{autoInvoke:!0}),xN(b=>{b.forEach(S=>{S.type==="attributes"&&S.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:o,hidden:u}}var _2={root:"m_96b553a6"};const m5={},g5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Lx=me((e,t)=>{const n=se("FloatingIndicator",m5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,target:p,parent:m,transitionDuration:g,mod:v,displayAfterTransitionEnd:b,...S}=n,j=Me({name:"FloatingIndicator",classes:_2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:g5}),C=y.useRef(null),{initialized:R,hidden:D}=p5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),E=Un(t,C);return!p||!m?null:s.jsx(ce,{ref:E,mod:[{initialized:R,hidden:D},v],...j("root"),...S})});Lx.displayName="@mantine/core/FloatingIndicator";Lx.classes=_2;var k2={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 v5={},y5=(e,{radius:t,color:n,variant:r,autoContrast:a})=>{const o=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:a});return{root:{"--alert-radius":t===void 0?void 0:Ft(t),"--alert-bg":n||r?o.background:void 0,"--alert-color":o.color,"--alert-bd":n||r?o.border:void 0}}},Ki=me((e,t)=>{const n=se("Alert",v5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,color:m,title:g,children:v,id:b,icon:S,withCloseButton:j,onClose:C,closeButtonLabel:R,variant:D,autoContrast:E,...T}=n,A=Me({name:"Alert",classes:k2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:y5}),_=yr(b),M=g&&`${_}-title`||void 0,L=`${_}-body`;return s.jsx(ce,{id:_,...A("root",{variant:D}),variant:D,ref:t,...T,role:"alert","aria-describedby":L,"aria-labelledby":M,children:s.jsxs("div",{...A("wrapper"),children:[S&&s.jsx("div",{...A("icon"),children:S}),s.jsxs("div",{...A("body"),children:[g&&s.jsx("div",{...A("title"),"data-with-close-button":j||void 0,children:s.jsx("span",{id:M,...A("label"),children:g})}),v&&s.jsx("div",{id:L,...A("message"),"data-variant":D,children:v})]}),j&&s.jsx(qo,{...A("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":R,unstyled:u})]})})});Ki.classes=k2;Ki.displayName="@mantine/core/Alert";var P2={root:"m_b6d8b162"};function x5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const b5={inherit:!1},S5=(e,{variant:t,lineClamp:n,gradient:r,size:a,color:o})=>({root:{"--text-fz":Mn(a),"--text-lh":oR(a),"--text-gradient":t==="gradient"?hy(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":o?Gt(o,e):void 0}}),De=lr((e,t)=>{const n=se("Text",b5,e),{lineClamp:r,truncate:a,inline:o,inherit:c,gradient:u,span:f,__staticSelector:p,vars:m,className:g,style:v,classNames:b,styles:S,unstyled:j,variant:C,mod:R,size:D,...E}=n,T=Me({name:["Text",p],props:n,classes:P2,className:g,style:v,classNames:b,styles:S,unstyled:j,vars:m,varsResolver:S5});return s.jsx(ce,{...T("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":x5(a),"data-line-clamp":typeof r=="number","data-inline":o,"data-inherit":c},R],size:D,...E})});De.classes=P2;De.displayName="@mantine/core/Text";var N2={root:"m_849cf0da"};const w5={underline:"hover"},Pt=lr((e,t)=>{const{underline:n,className:r,unstyled:a,mod:o,...c}=se("Anchor",w5,e);return s.jsx(De,{component:"a",ref:t,className:$t({[N2.root]:!a},r),...c,mod:[{underline:n},o],__staticSelector:"Anchor",unstyled:a})});Pt.classes=N2;Pt.displayName="@mantine/core/Anchor";const[j5,Tc]=vr("AppShell was not found in tree");var Go={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const C5={},zx=me((e,t)=>{const n=se("AppShellAside",C5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:a,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});zx.classes=Go;zx.displayName="@mantine/core/AppShellAside";const E5={},$x=me((e,t)=>{var S;const n=se("AppShellFooter",E5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:$t({[lc.classNames.zeroRight]:b.offsetScrollbars},a),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-footer-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});$x.classes=Go;$x.displayName="@mantine/core/AppShellFooter";const T5={},Ux=me((e,t)=>{var S;const n=se("AppShellHeader",T5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:$t({[lc.classNames.zeroRight]:b.offsetScrollbars},a),classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-header-z-index":(S=m??b.zIndex)==null?void 0:S.toString()}})});Ux.classes=Go;Ux.displayName="@mantine/core/AppShellHeader";const R5={},Bx=me((e,t)=>{const n=se("AppShellMain",R5,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=Tc();return s.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:a,style:o,classNames:r,styles:c}),...f})});Bx.classes=Go;Bx.displayName="@mantine/core/AppShellMain";function hd(e){return typeof e=="object"?e.base:e}function pd(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 md(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function D5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:a}){var f,p,m;const o=r==null?void 0:r.width,c="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.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"),pd(o)){const g=le(hd(o));e["--app-shell-aside-width"]=g,e["--app-shell-aside-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-aside-width"]=le(o.base),e["--app-shell-aside-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-aside-width"]=le(o[g]),t[g]["--app-shell-aside-offset"]=le(o[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-aside-transform"]=c,t[g]["--app-shell-aside-transform-rtl"]=u,t[g]["--app-shell-aside-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=sx(r.breakpoint,a.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-aside-width"]="100%",n[g]["--app-shell-aside-offset"]="0px",n[g]["--app-shell-aside-transform"]=c,n[g]["--app-shell-aside-transform-rtl"]=u}}function A5({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,a="translateY(var(--app-shell-footer-height))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-footer-height"]=c,o&&(e["--app-shell-footer-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),o&&(e["--app-shell-footer-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),o&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=a,e["--app-shell-footer-offset"]="0px !important")}function _5({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,a="translateY(calc(var(--app-shell-header-height) * -1))",o=(n==null?void 0:n.offset)??!0;if(pd(r)){const c=le(hd(r));e["--app-shell-header-height"]=c,o&&(e["--app-shell-header-offset"]=c)}md(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),o&&(e["--app-shell-header-offset"]=le(r.base))),sn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),o&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=a,e["--app-shell-header-offset"]="0px !important")}function k5({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:a}){var f,p,m;const o=r==null?void 0:r.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((f=r==null?void 0:r.collapsed)!=null&&f.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"),pd(o)){const g=le(hd(o));e["--app-shell-navbar-width"]=g,e["--app-shell-navbar-offset"]=g}if(md(o)&&(typeof o.base<"u"&&(e["--app-shell-navbar-width"]=le(o.base),e["--app-shell-navbar-offset"]=le(o.base)),sn(o).forEach(g=>{g!=="base"&&(t[g]=t[g]||{},t[g]["--app-shell-navbar-width"]=le(o[g]),t[g]["--app-shell-navbar-offset"]=le(o[g]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const g=r.breakpoint;t[g]=t[g]||{},t[g]["--app-shell-navbar-transform"]=c,t[g]["--app-shell-navbar-transform-rtl"]=u,t[g]["--app-shell-navbar-offset"]="0px !important"}if((m=r==null?void 0:r.collapsed)!=null&&m.mobile){const g=sx(r.breakpoint,a.breakpoints)-.1;n[g]=n[g]||{},n[g]["--app-shell-navbar-width"]="100%",n[g]["--app-shell-navbar-offset"]="0px",n[g]["--app-shell-navbar-transform"]=c,n[g]["--app-shell-navbar-transform-rtl"]=u}}function Ov(e){return Number(e)===0?"0px":On(e)}function P5({padding:e,baseStyles:t,minMediaStyles:n}){pd(e)&&(t["--app-shell-padding"]=Ov(hd(e))),md(e)&&(e.base&&(t["--app-shell-padding"]=Ov(e.base)),sn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Ov(e[r]))}))}function N5({navbar:e,header:t,footer:n,aside:r,padding:a,theme:o}){const c={},u={},f={};k5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,navbar:e,theme:o}),D5({baseStyles:f,minMediaStyles:c,maxMediaStyles:u,aside:r,theme:o}),_5({baseStyles:f,minMediaStyles:c,header:t}),A5({baseStyles:f,minMediaStyles:c,footer:n}),P5({baseStyles:f,minMediaStyles:c,padding:a});const p=Yu(sn(c),o.breakpoints).map(v=>({query:`(min-width: ${jh(v.px)})`,styles:c[v.value]})),m=Yu(sn(u),o.breakpoints).map(v=>({query:`(max-width: ${jh(v.px)})`,styles:u[v.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function O5({navbar:e,header:t,aside:n,footer:r,padding:a}){const o=Sn(),c=Gi(),{media:u,baseStyles:f}=N5({navbar:e,header:t,footer:r,aside:n,padding:a,theme:o});return s.jsx(Ws,{media:u,styles:f,selector:c.cssVariablesSelector})}const M5={},Vx=me((e,t)=>{const n=se("AppShellNavbar",M5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,withBorder:p,zIndex:m,mod:g,...v}=n,b=Tc();return b.disabled?null:s.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:a,classNames:r,styles:c,style:o}),...v,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});Vx.classes=Go;Vx.displayName="@mantine/core/AppShellNavbar";const I5={},Fx=lr((e,t)=>{const n=se("AppShellSection",I5,e),{classNames:r,className:a,style:o,styles:c,vars:u,grow:f,mod:p,...m}=n,g=Tc();return s.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:a,style:o,classNames:r,styles:c}),...m})});Fx.classes=Go;Fx.displayName="@mantine/core/AppShellSection";function L5({transitionDuration:e,disabled:t}){const[n,r]=y.useState(!0),a=y.useRef(-1),o=y.useRef(-1);return hR("resize",()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),200)}),Sc(()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const z5={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Wr("app")},$5=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Ar=me((e,t)=>{const n=se("AppShell",z5,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:v,transitionTimingFunction:b,header:S,zIndex:j,layout:C,disabled:R,aside:D,footer:E,offsetScrollbars:T=C!=="alt",mod:A,..._}=n,M=Me({name:"AppShell",classes:Go,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:$5}),L=L5({disabled:R,transitionDuration:v});return s.jsxs(j5,{value:{getStyles:M,withBorder:m,zIndex:j,disabled:R,offsetScrollbars:T},children:[s.jsx(O5,{navbar:p,header:S,aside:D,footer:E,padding:g}),s.jsx(ce,{ref:t,...M("root"),mod:[{resizing:L,layout:C,disabled:R},A],..._})]})});Ar.classes=Go;Ar.displayName="@mantine/core/AppShell";Ar.Navbar=Vx;Ar.Header=Ux;Ar.Main=Bx;Ar.Aside=zx;Ar.Footer=$x;Ar.Section=Fx;function O2(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=>O2(t))}:e}function M2(e){return e?e.map(t=>O2(t)):[]}function I2(e){return e.reduce((t,n)=>"group"in n?{...t,...I2(n.items)}:(t[n.value]=n,t),{})}var kr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",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 U5={error:null},B5=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":nt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Gt(n,e):void 0}}),xp=me((e,t)=>{const n=se("ComboboxChevron",U5,e),{size:r,error:a,style:o,className:c,classNames:u,styles:f,unstyled:p,vars:m,mod:g,...v}=n,b=Me({name:"ComboboxChevron",classes:kr,props:n,style:o,className:c,classNames:u,styles:f,unstyled:p,vars:m,varsResolver:B5,rootSelector:"chevron"});return s.jsx(ce,{component:"svg",...v,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:a},g],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"})})});xp.classes=kr;xp.displayName="@mantine/core/ComboboxChevron";const[V5,ya]=vr("Combobox component was not found in tree"),L2=y.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...a},o)=>s.jsx(pn.ClearButton,{ref:o,tabIndex:-1,"aria-hidden":!0,...a,onMouseDown:c=>{c.preventDefault(),t==null||t(c)},onClick:c=>{r(),n==null||n(c)}}));L2.displayName="@mantine/core/ComboboxClearButton";const F5={},Hx=me((e,t)=>{const{classNames:n,styles:r,className:a,style:o,hidden:c,...u}=se("ComboboxDropdown",F5,e),f=ya();return s.jsx(za.Dropdown,{...u,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:a,style:o,classNames:n,styles:r})})});Hx.classes=kr;Hx.displayName="@mantine/core/ComboboxDropdown";const H5={refProp:"ref"},z2=me((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",H5,e);if(ya(),!Hi(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(za.Target,{ref:t,refProp:r,children:n})});z2.displayName="@mantine/core/ComboboxDropdownTarget";const q5={},qx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxEmpty",q5,e),f=ya();return s.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:o,style:a}),...u})});qx.classes=kr;qx.displayName="@mantine/core/ComboboxEmpty";function Gx({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:a,autoComplete:o}){const c=ya(),[u,f]=y.useState(null),p=g=>{if(e==null||e(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const v=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&v!==-1?(g.preventDefault(),c.store.clickSelectedOption()):a==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&a==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&u||void 0,autoComplete:o,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const G5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},$2=me((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxEventsTarget",G5,e);if(!Hi(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 m=ya(),g=Gx({targetType:u,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return y.cloneElement(n,{...g,...p,[r]:Un(t,m.store.targetRef,op(n))})});$2.displayName="@mantine/core/ComboboxEventsTarget";const Q5={},Qx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxFooter",Q5,e),f=ya();return s.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:a,styles:o}),...u,onMouseDown:p=>{p.preventDefault()}})});Qx.classes=kr;Qx.displayName="@mantine/core/ComboboxFooter";const W5={},Wx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,children:u,label:f,...p}=se("ComboboxGroup",W5,e),m=ya();return s.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:a,styles:o}),...p,children:[f&&s.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:o}),children:f}),u]})});Wx.classes=kr;Wx.displayName="@mantine/core/ComboboxGroup";const Y5={},Yx=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("ComboboxHeader",Y5,e),f=ya();return s.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:a,styles:o}),...u,onMouseDown:p=>{p.preventDefault()}})});Yx.classes=kr;Yx.displayName="@mantine/core/ComboboxHeader";function U2({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}U2.displayName="@mantine/core/ComboboxHiddenInput";const K5={},Kx=me((e,t)=>{const n=se("ComboboxOption",K5,e),{classNames:r,className:a,style:o,styles:c,vars:u,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:v,disabled:b,selected:S,mod:j,...C}=n,R=ya(),D=y.useId(),E=p||D;return s.jsx(ce,{...R.getStyles("option",{className:a,classNames:r,styles:c,style:o}),...C,ref:t,id:E,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":S},j],role:"option",onClick:T=>{var A;b?T.preventDefault():((A=R.onOptionSubmit)==null||A.call(R,n.value,n),f==null||f(T))},onMouseDown:T=>{T.preventDefault(),g==null||g(T)},onMouseOver:T=>{R.resetSelectionOnOptionHover&&R.store.resetSelectedOption(),v==null||v(T)}})});Kx.classes=kr;Kx.displayName="@mantine/core/ComboboxOption";const X5={},Xx=me((e,t)=>{const n=se("ComboboxOptions",X5,e),{classNames:r,className:a,style:o,styles:c,id:u,onMouseDown:f,labelledBy:p,...m}=n,g=ya(),v=yr(u);return y.useEffect(()=>{g.store.setListId(v)},[v]),s.jsx(ce,{ref:t,...g.getStyles("options",{className:a,style:o,classNames:r,styles:c}),...m,id:v,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f==null||f(b)}})});Xx.classes=kr;Xx.displayName="@mantine/core/ComboboxOptions";const Z5={withAriaAttributes:!0,withKeyboardNavigation:!0},Zx=me((e,t)=>{const n=se("ComboboxSearch",Z5,e),{classNames:r,styles:a,unstyled:o,vars:c,withAriaAttributes:u,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,v=ya(),b=v.getStyles("search"),S=Gx({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return s.jsx(pn,{ref:Un(t,v.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},a],size:m||v.size,...S,...g,__staticSelector:"Combobox"})});Zx.classes=kr;Zx.displayName="@mantine/core/ComboboxSearch";const J5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},B2=me((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:a,withAriaAttributes:o,withExpandedAttribute:c,targetType:u,autoComplete:f,...p}=se("ComboboxTarget",J5,e);if(!Hi(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 m=ya(),g=Gx({targetType:u,withAriaAttributes:o,withKeyboardNavigation:a,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),v=y.cloneElement(n,{...g,...p});return s.jsx(za.Target,{ref:Un(t,m.store.targetRef),children:v})});B2.displayName="@mantine/core/ComboboxTarget";function e7(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 t7(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 n7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function gd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:a,loop:o=!0,scrollBehavior:c="instant"}={}){const[u,f]=Wn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=y.useRef(null),m=y.useRef(-1),g=y.useRef(null),v=y.useRef(null),b=y.useRef(-1),S=y.useRef(-1),j=y.useRef(-1),C=y.useCallback((P="unknown")=>{u||(f(!0),a==null||a(P))},[f,a,u]),R=y.useCallback((P="unknown")=>{u&&(f(!1),r==null||r(P))},[f,r,u]),D=y.useCallback((P="unknown")=>{u?R(P):C(P)},[R,C,u]),E=y.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-selected]`);P==null||P.removeAttribute("data-combobox-selected"),P==null||P.removeAttribute("aria-selected")},[]),T=y.useCallback(P=>{const I=document.getElementById(p.current),z=I==null?void 0:I.querySelectorAll("[data-combobox-option]");if(!z)return null;const F=P>=z.length?0:P<0?z.length-1:P;return m.current=F,z!=null&&z[F]&&!z[F].hasAttribute("data-combobox-disabled")?(E(),z[F].setAttribute("data-combobox-selected","true"),z[F].setAttribute("aria-selected","true"),z[F].scrollIntoView({block:"nearest",behavior:c}),z[F].id):null},[c,E]),A=y.useCallback(()=>{const P=document.querySelector(`#${p.current} [data-combobox-active]`);if(P){const I=document.querySelectorAll(`#${p.current} [data-combobox-option]`),z=Array.from(I).findIndex(F=>F===P);return T(z)}return T(0)},[T]),_=y.useCallback(()=>T(t7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),o)),[T,o]),M=y.useCallback(()=>T(e7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),o)),[T,o]),L=y.useCallback(()=>T(n7(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[T]),$=y.useCallback((P="selected",I)=>{j.current=window.setTimeout(()=>{var O;const z=document.querySelectorAll(`#${p.current} [data-combobox-option]`),F=Array.from(z).findIndex(U=>U.hasAttribute(`data-combobox-${P}`));m.current=F,I!=null&&I.scrollIntoView&&((O=z[F])==null||O.scrollIntoView({block:"nearest",behavior:c}))},0)},[]),V=y.useCallback(()=>{m.current=-1,E()},[E]),X=y.useCallback(()=>{const P=document.querySelectorAll(`#${p.current} [data-combobox-option]`),I=P==null?void 0:P[m.current];I==null||I.click()},[]),Q=y.useCallback(P=>{p.current=P},[]),J=y.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),W=y.useCallback(()=>{S.current=window.setTimeout(()=>v.current.focus(),0)},[]),Y=y.useCallback(()=>m.current,[]);return y.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(S.current),window.clearTimeout(j.current)},[]),{dropdownOpened:u,openDropdown:C,closeDropdown:R,toggleDropdown:D,selectedOptionIndex:m.current,getSelectedOptionIndex:Y,selectOption:T,selectFirstOption:L,selectActiveOption:A,selectNextOption:_,selectPreviousOption:M,resetSelectedOption:V,updateSelectedOptionIndex:$,listId:p.current,setListId:Q,clickSelectedOption:X,searchRef:g,focusSearchInput:J,targetRef:v,focusTarget:W}}const r7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},a7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Mn(t),"--combobox-option-padding":nt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":Mn(t),"--combobox-option-padding":nt(t,"combobox-option-padding")}});function ct(e){const t=se("Combobox",r7,e),{classNames:n,styles:r,unstyled:a,children:o,store:c,vars:u,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:v,__staticSelector:b,readOnly:S,...j}=t,C=gd(),R=c||C,D=Me({name:b||"Combobox",classes:kr,props:t,classNames:n,styles:r,unstyled:a,vars:u,varsResolver:a7}),E=()=>{p==null||p(),R.closeDropdown()};return s.jsx(V5,{value:{getStyles:D,store:R,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:v,readOnly:S},children:s.jsx(za,{opened:R.dropdownOpened,...j,onChange:T=>!T&&E(),withRoles:!1,unstyled:a,children:o})})}const i7=e=>e;ct.extend=i7;ct.classes=kr;ct.displayName="@mantine/core/Combobox";ct.Target=B2;ct.Dropdown=Hx;ct.Options=Xx;ct.Option=Kx;ct.Search=Zx;ct.Empty=qx;ct.Chevron=xp;ct.Footer=Qx;ct.Header=Yx;ct.EventsTarget=$2;ct.DropdownTarget=z2;ct.Group=Wx;ct.ClearButton=L2;ct.HiddenInput=U2;var V2={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const F2=V2,bp=y.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:a,unstyled:o,children:c,label:u,description:f,id:p,disabled:m,error:g,size:v,labelPosition:b="left",bodyElement:S="div",labelElement:j="label",variant:C,style:R,vars:D,mod:E,...T},A)=>{const _=Me({name:e,props:t,className:n,style:R,classes:V2,classNames:r,styles:a,unstyled:o});return s.jsx(ce,{..._("root"),ref:A,__vars:{"--label-fz":Mn(v),"--label-lh":nt(v,"label-lh")},mod:[{"label-position":b},E],variant:C,size:v,...T,children:s.jsxs(ce,{component:S,htmlFor:S==="label"?p:void 0,..._("body"),children:[c,s.jsxs("div",{..._("labelWrapper"),"data-disabled":m||void 0,children:[u&&s.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,..._("label"),"data-disabled":m||void 0,children:u}),f&&s.jsx(pn.Description,{size:v,__inheritStyles:!1,..._("description"),children:f}),g&&typeof g!="boolean"&&s.jsx(pn.Error,{size:v,__inheritStyles:!1,..._("error"),children:g})]})]})})});bp.displayName="@mantine/core/InlineInput";const H2=y.createContext(null),o7=H2.Provider,q2=()=>y.useContext(H2),[s7,l7]=qi();var G2={card:"m_26775b0a"};const c7={withBorder:!0},u7=(e,{radius:t})=>({card:{"--card-radius":Ft(t)}}),Jx=me((e,t)=>{const n=se("CheckboxCard",c7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:v,onClick:b,defaultChecked:S,onChange:j,...C}=n,R=Me({name:"CheckboxCard",classes:G2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:u7,rootSelector:"card"}),D=q2(),E=typeof p=="boolean"?p:D?D.value.includes(v||""):void 0,[T,A]=Wn({value:E,defaultValue:S,finalValue:!1,onChange:j});return s.jsx(s7,{value:{checked:T},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:T},m],...R("card"),...C,role:"checkbox","aria-checked":T,onClick:_=>{b==null||b(_),D==null||D.onChange(v||""),A(!T)}})})});Jx.displayName="@mantine/core/CheckboxCard";Jx.classes=G2;function e0({children:e,role:t}){const n=Ec();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const d7={},t0=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,readOnly:f,...p}=se("CheckboxGroup",d7,e),[m,g]=Wn({value:n,defaultValue:r,finalValue:[],onChange:a}),v=b=>{const S=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(o7,{value:{value:m,onChange:v,size:o},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(e0,{role:"group",children:u})})})});t0.classes=pn.Wrapper.classes;t0.displayName="@mantine/core/CheckboxGroup";function Sp({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(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 Q2({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(Sp,{...t})}var W2={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const f7={icon:Q2},h7=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ft(t),"--checkbox-color":o==="outline"?f:Gt(n,e),"--checkbox-icon-color":a?Gt(a,e):Qs(c,e)?Qi({color:n,theme:e,autoContrast:c}):void 0}}},n0=me((e,t)=>{const n=se("CheckboxIndicator",f7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,icon:p,indeterminate:m,radius:g,color:v,iconColor:b,autoContrast:S,checked:j,mod:C,variant:R,disabled:D,...E}=n,T=p,A=Me({name:"CheckboxIndicator",classes:W2,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:h7,rootSelector:"indicator"}),_=l7(),M=typeof j=="boolean"||typeof m=="boolean"?j||m:(_==null?void 0:_.checked)||!1;return s.jsx(ce,{ref:t,...A("indicator",{variant:R}),variant:R,mod:[{checked:M,disabled:D},C],...E,children:s.jsx(T,{indeterminate:m,...A("icon")})})});n0.displayName="@mantine/core/CheckboxIndicator";n0.classes=W2;var Y2={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const p7={labelPosition:"right",icon:Q2},m7=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ft(t),"--checkbox-color":o==="outline"?f:Gt(n,e),"--checkbox-icon-color":a?Gt(a,e):Qs(c,e)?Qi({color:n,theme:e,autoContrast:c}):void 0}}},Hn=me((e,t)=>{const n=se("Checkbox",p7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,label:m,id:g,size:v,radius:b,wrapperProps:S,checked:j,labelPosition:C,description:R,error:D,disabled:E,variant:T,indeterminate:A,icon:_,rootRef:M,iconColor:L,onChange:$,autoContrast:V,mod:X,...Q}=n,J=q2(),W=v||(J==null?void 0:J.size),Y=_,P=Me({name:"Checkbox",props:n,classes:Y2,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:m7}),{styleProps:I,rest:z}=Wi(Q),F=yr(g),O=J?{checked:J.value.includes(z.value),onChange:ee=>{J.onChange(ee),$==null||$(ee)}}:{},U=y.useRef(null),Z=t||U;return y.useEffect(()=>{Z&&"current"in Z&&Z.current&&(Z.current.indeterminate=A||!1)},[A,Z]),s.jsx(bp,{...P("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:F,size:W,labelPosition:C,label:m,description:R,error:D,disabled:E,classNames:r,styles:c,unstyled:u,"data-checked":O.checked||j||void 0,variant:T,ref:M,mod:X,...I,...S,children:s.jsxs(ce,{...P("inner"),mod:{"data-label-position":C},children:[s.jsx(ce,{component:"input",id:F,ref:Z,checked:j,disabled:E,mod:{error:!!D,indeterminate:A},...P("input",{focusable:!0,variant:T}),onChange:$,...z,...O,type:"checkbox"}),s.jsx(Y,{indeterminate:A,...P("icon")})]})})});Hn.classes={...Y2,...F2};Hn.displayName="@mantine/core/Checkbox";Hn.Group=t0;Hn.Indicator=n0;Hn.Card=Jx;function hc(e){return"group"in e}function K2({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),a=[];for(let o=0;o<e.length;o+=1){const c=e[o];if(a.length===n)return a;hc(c)&&a.push({group:c.group,items:K2({options:c.items,search:t,limit:n-a.length})}),hc(c)||c.label.toLowerCase().includes(r)&&a.push(c)}return a}function g7(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 X2(e,t=new Set){if(Array.isArray(e))for(const n of e)if(hc(n))X2(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 v7(e,t){return Array.isArray(e)?e.includes(t):e===t}function Z2({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:a,renderOption:o}){if(!hc(e)){const u=v7(n,e.value),f=t&&u&&s.jsx(Sp,{className:kr.optionsDropdownCheckIcon}),p=s.jsxs(s.Fragment,{children:[r==="left"&&f,s.jsx("span",{children:e.label}),r==="right"&&f]});return s.jsx(ct.Option,{value:e.value,disabled:e.disabled,className:$t({[kr.optionsDropdownOption]:!a}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof o=="function"?o({option:e,checked:u}):p})}const c=e.items.map(u=>s.jsx(Z2,{data:u,value:n,unstyled:a,withCheckIcon:t,checkIconPosition:r,renderOption:o},u.value));return s.jsx(ct.Group,{label:e.group,children:c})}function y7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:a,limit:o,maxDropdownHeight:c,withScrollArea:u=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:v,unstyled:b,labelId:S,renderOption:j,scrollAreaProps:C,"aria-label":R}){X2(e);const E=typeof a=="string"?(r||K2)({options:e,search:f?a:"",limit:o??1/0}):e,T=g7(E),A=E.map(_=>s.jsx(Z2,{data:_,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},hc(_)?_.group:_.value));return s.jsx(ct.Dropdown,{hidden:t||n&&T,"data-composed":!0,children:s.jsxs(ct.Options,{labelledBy:S,"aria-label":R,children:[u?s.jsx(Yr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:A}):A,T&&v&&s.jsx(ct.Empty,{children:v})]})})}const J2=y.createContext(null),x7=J2.Provider;function b7(){return{withinGroup:!!y.useContext(J2)}}var wp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const S7={},w7=(e,{spacing:t})=>({group:{"--ag-spacing":On(t)}}),r0=me((e,t)=>{const n=se("AvatarGroup",S7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,spacing:p,...m}=n,g=Me({name:"AvatarGroup",classes:wp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:w7,rootSelector:"group"});return s.jsx(x7,{value:!0,children:s.jsx(ce,{ref:t,...g("group"),...m})})});r0.classes=wp;r0.displayName="@mantine/core/AvatarGroup";function j7(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 C7(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 E7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function T7(e,t=E7){const n=C7(e),r=Math.abs(n)%t.length;return t[r]}function R7(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()}const D7={},A7=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c,name:u,allowedInitialsColors:f})=>{const p=o==="initials"&&typeof u=="string"?T7(u,f):o,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:a,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":nt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ft(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},Ms=lr((e,t)=>{const n=se("Avatar",D7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,src:p,alt:m,radius:g,color:v,gradient:b,imageProps:S,children:j,autoContrast:C,mod:R,name:D,allowedInitialsColors:E,...T}=n,A=b7(),[_,M]=y.useState(!p),L=Me({name:"Avatar",props:n,classes:wp,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:A7});return y.useEffect(()=>M(!p),[p]),s.jsx(ce,{...L("root"),mod:[{"within-group":A.withinGroup},R],ref:t,...T,children:_?s.jsx("span",{...L("placeholder"),title:m,children:j||typeof D=="string"&&R7(D)||s.jsx(j7,{})}):s.jsx("img",{...S,...L("image"),src:p,alt:m,onError:$=>{var V;M(!0),(V=S==null?void 0:S.onError)==null||V.call(S,$)}})})});Ms.classes=wp;Ms.displayName="@mantine/core/Avatar";Ms.Group=r0;var eD={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const _7={},k7=(e,{radius:t,color:n,gradient:r,variant:a,size:o,autoContrast:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:c});return{root:{"--badge-height":nt(o,"badge-height"),"--badge-padding-x":nt(o,"badge-padding-x"),"--badge-fz":nt(o,"badge-fz"),"--badge-radius":t===void 0?void 0:Ft(t),"--badge-bg":n||a?u.background:void 0,"--badge-color":n||a?u.color:void 0,"--badge-bd":n||a?u.border:void 0,"--badge-dot-color":a==="dot"?Gt(n,e):void 0}}},jp=lr((e,t)=>{const n=se("Badge",_7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,color:m,gradient:g,leftSection:v,rightSection:b,children:S,variant:j,fullWidth:C,autoContrast:R,circle:D,mod:E,...T}=n,A=Me({name:"Badge",props:n,classes:eD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:k7});return s.jsxs(ce,{variant:j,mod:[{block:C,circle:D,"with-right-section":!!b,"with-left-section":!!v},E],...A("root",{variant:j}),ref:t,...T,children:[v&&s.jsx("span",{...A("section"),"data-position":"left",children:v}),s.jsx("span",{...A("label"),children:S}),b&&s.jsx("span",{...A("section"),"data-position":"right",children:b})]})});jp.classes=eD;jp.displayName="@mantine/core/Badge";var tD={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const P7={iconSize:48},N7=(e,{color:t,iconSize:n,radius:r})=>{const a=da({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),o=da({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":sa(o.value,.07),"--bq-bg-dark":sa(a.value,.06),"--bq-bd":Gt(t,e),"--bq-icon-size":le(n),"--bq-radius":Ft(r)}}},a0=me((e,t)=>{const n=se("Blockquote",P7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,icon:m,iconSize:g,cite:v,...b}=n,S=Me({name:"Blockquote",classes:tD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:N7});return s.jsxs(ce,{component:"blockquote",ref:t,...S("root"),...b,children:[m&&s.jsx("span",{...S("icon"),children:m}),p,v&&s.jsx("cite",{...S("cite"),children:v})]})});a0.classes=tD;a0.displayName="@mantine/core/Blockquote";var Rc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const EC={orientation:"horizontal"},O7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),i0=me((e,t)=>{const n=se("ButtonGroup",EC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,orientation:f,vars:p,borderWidth:m,variant:g,mod:v,...b}=se("ButtonGroup",EC,e),S=Me({name:"ButtonGroup",props:n,classes:Rc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:p,varsResolver:O7,rootSelector:"group"});return s.jsx(ce,{...S("group"),ref:t,variant:g,mod:[{"data-orientation":f},v],role:"group",...b})});i0.classes=Rc;i0.displayName="@mantine/core/ButtonGroup";const TC={},M7=(e,{radius:t,color:n,gradient:r,variant:a,autoContrast:o,size:c})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:o});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":c!=null&&c.includes("compact")?Mn(c.replace("compact-","")):Mn(c),"--section-radius":t===void 0?void 0:Ft(t),"--section-bg":n||a?u.background:void 0,"--section-color":u.color,"--section-bd":n||a?u.border:void 0}}},o0=me((e,t)=>{const n=se("ButtonGroupSection",TC,e),{className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,variant:p,gradient:m,radius:g,autoContrast:v,...b}=se("ButtonGroupSection",TC,e),S=Me({name:"ButtonGroupSection",props:n,classes:Rc,className:r,style:a,classNames:o,styles:c,unstyled:u,vars:f,varsResolver:M7,rootSelector:"groupSection"});return s.jsx(ce,{...S("groupSection"),ref:t,variant:p,...b})});o0.classes=Rc;o0.displayName="@mantine/core/ButtonGroupSection";const I7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},L7={},z7=(e,{radius:t,color:n,gradient:r,variant:a,size:o,justify:c,autoContrast:u})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:a||"filled",autoContrast:u});return{root:{"--button-justify":c,"--button-height":nt(o,"button-height"),"--button-padding-x":nt(o,"button-padding-x"),"--button-fz":o!=null&&o.includes("compact")?Mn(o.replace("compact-","")):Mn(o),"--button-radius":t===void 0?void 0:Ft(t),"--button-bg":n||a?f.background:void 0,"--button-hover":n||a?f.hover:void 0,"--button-color":f.color,"--button-bd":n||a?f.border:void 0,"--button-hover-color":n||a?f.hoverColor:void 0}}},Pe=lr((e,t)=>{const n=se("Button",L7,e),{style:r,vars:a,className:o,color:c,disabled:u,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:v,radius:b,loading:S,loaderProps:j,gradient:C,classNames:R,styles:D,unstyled:E,"data-disabled":T,autoContrast:A,mod:_,...M}=n,L=Me({name:"Button",props:n,classes:Rc,className:o,style:r,classNames:R,styles:D,unstyled:E,vars:a,varsResolver:z7}),$=!!p,V=!!m;return s.jsxs(tr,{ref:t,...L("root",{active:!u&&!S&&!T}),unstyled:E,variant:v,disabled:u||S,mod:[{disabled:u||T,loading:S,block:g,"with-left-section":$,"with-right-section":V},_],...M,children:[s.jsx(hi,{mounted:!!S,transition:I7,duration:150,children:X=>s.jsx(ce,{component:"span",...L("loader",{style:X}),"aria-hidden":!0,children:s.jsx(_r,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),s.jsxs("span",{...L("inner"),children:[p&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"left"},children:p}),s.jsx(ce,{component:"span",mod:{loading:S},...L("label"),children:f}),m&&s.jsx(ce,{component:"span",...L("section"),mod:{position:"right"},children:m})]})]})});Pe.classes=Rc;Pe.displayName="@mantine/core/Button";Pe.Group=i0;Pe.GroupSection=o0;var nD={root:"m_4451eb3a"};const $7={},er=lr((e,t)=>{const n=se("Center",$7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,inline:p,mod:m,...g}=n,v=Me({name:"Center",props:n,classes:nD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f});return s.jsx(ce,{ref:t,mod:[{inline:p},m],...v("root"),...g})});er.classes=nD;er.displayName="@mantine/core/Center";const[U7,B7]=qi(),V7={};function rD(e){const{value:t,defaultValue:n,onChange:r,multiple:a,children:o}=se("ChipGroup",V7,e),[c,u]=Wn({value:t,defaultValue:n,finalValue:a?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?u(c.includes(g)?c.filter(v=>v!==g):[...c,g]):u(g)};return s.jsx(U7,{value:{isChipSelected:f,onChange:p,multiple:a},children:o})}rD.displayName="@mantine/core/ChipGroup";var aD={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 F7={type:"checkbox"},H7=(e,{size:t,radius:n,variant:r,color:a,autoContrast:o})=>{const c=e.variantColorResolver({color:a||e.primaryColor,theme:e,variant:r||"filled",autoContrast:o});return{root:{"--chip-fz":Mn(t),"--chip-size":nt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ft(n),"--chip-checked-padding":nt(t,"chip-checked-padding"),"--chip-padding":nt(t,"chip-padding"),"--chip-icon-size":nt(t,"chip-icon-size"),"--chip-bg":a||r?c.background:void 0,"--chip-hover":a||r?c.hover:void 0,"--chip-color":a||r?c.color:void 0,"--chip-bd":a||r?c.border:void 0,"--chip-spacing":nt(t,"chip-spacing")}}},Ju=me((e,t)=>{const n=se("Chip",F7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,id:p,checked:m,defaultChecked:g,onChange:v,value:b,wrapperProps:S,type:j,disabled:C,children:R,size:D,variant:E,icon:T,rootRef:A,autoContrast:_,mod:M,...L}=n,$=Me({name:"Chip",classes:aD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:H7}),V=B7(),X=yr(p),{styleProps:Q,rest:J}=Wi(L),[W,Y]=Wn({value:m,defaultValue:g,finalValue:!1,onChange:v}),P=V?{checked:V.isChipSelected(b),onChange:z=>{V.onChange(z),v==null||v(z.currentTarget.checked)},type:V.multiple?"checkbox":"radio"}:{},I=P.checked||W;return s.jsxs(ce,{size:D,variant:E,ref:A,mod:M,...$("root"),...Q,...S,children:[s.jsx("input",{type:j,...$("input"),checked:I,onChange:z=>Y(z.currentTarget.checked),id:X,disabled:C,ref:t,value:b,...P,...J}),s.jsxs("label",{htmlFor:X,"data-checked":I||void 0,"data-disabled":C||void 0,...$("label",{variant:E||"filled"}),children:[I&&s.jsx("span",{...$("iconWrapper"),children:T||s.jsx(Sp,{...$("checkIcon")})}),s.jsx("span",{children:R})]})]})});Ju.classes=aD;Ju.displayName="@mantine/core/Chip";Ju.Group=rD;var iD={root:"m_b183c0a2"};const q7={},G7=(e,{color:t})=>({root:{"--code-bg":t?Gt(t,e):void 0}}),s0=me((e,t)=>{const n=se("Code",q7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,block:m,variant:g,mod:v,...b}=n,S=Me({name:"Code",props:n,classes:iD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:G7});return s.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},v],...S("root"),...b,dir:"ltr"})});s0.classes=iD;s0.displayName="@mantine/core/Code";var oD={root:"m_7485cace"};const Q7={},W7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:nt(t,"container-size")}}),l0=me((e,t)=>{const n=se("Container",Q7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,fluid:p,mod:m,...g}=n,v=Me({name:"Container",classes:oD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:W7});return s.jsx(ce,{ref:t,mod:[{fluid:p},m],...v("root"),...g})});l0.classes=oD;l0.displayName="@mantine/core/Container";const Y7={timeout:1e3};function sD(e){const{children:t,timeout:n,value:r,...a}=se("CopyButton",Y7,e),o=sR({timeout:n}),c=()=>o.copy(r);return s.jsx(s.Fragment,{children:t({copy:c,copied:o.copied,...a})})}sD.displayName="@mantine/core/CopyButton";var lD={root:"m_3eebeb36",label:"m_9e365f20"};const K7={orientation:"horizontal"},X7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Gt(t,e):void 0,"--divider-border-style":n,"--divider-size":nt(r,"divider-size")}}),jn=me((e,t)=>{const n=se("Divider",K7,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,orientation:m,label:g,labelPosition:v,mod:b,...S}=n,j=Me({name:"Divider",classes:lD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:X7});return s.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...S,role:"separator",children:g&&s.jsx(ce,{component:"span",mod:{position:v},...j("label"),children:g})})});jn.classes=lD;jn.displayName="@mantine/core/Divider";function Z7({open:e,close:t,openDelay:n,closeDelay:r}){const a=y.useRef(-1),o=y.useRef(-1),c=()=>{window.clearTimeout(a.current),window.clearTimeout(o.current)},u=()=>{c(),n===0||n===void 0?e():a.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():o.current=window.setTimeout(t,r)};return y.useEffect(()=>c,[]),{openDropdown:u,closeDropdown:f}}const[RC,cD]=vr("Grid component was not found in tree"),Cy=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,DC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Cy(e,t),AC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},_C=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function J7({span:e,order:t,offset:n,selector:r}){var b;const a=Sn(),o=cD(),c=o.breakpoints||a.breakpoints,f=ka(e)===void 0?12:ka(e),p=Fo({"--col-order":(b=ka(t))==null?void 0:b.toString(),"--col-flex-grow":AC(f,o.grow),"--col-flex-basis":Cy(f,o.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":DC(f,o.columns,o.grow),"--col-offset":_C(ka(n),o.columns)}),m=sn(c).reduce((S,j)=>{var C;return S[j]||(S[j]={}),typeof t=="object"&&t[j]!==void 0&&(S[j]["--col-order"]=(C=t[j])==null?void 0:C.toString()),typeof e=="object"&&e[j]!==void 0&&(S[j]["--col-flex-grow"]=AC(e[j],o.grow),S[j]["--col-flex-basis"]=Cy(e[j],o.columns),S[j]["--col-width"]=e[j]==="content"?"auto":void 0,S[j]["--col-max-width"]=DC(e[j],o.columns,o.grow)),typeof n=="object"&&n[j]!==void 0&&(S[j]["--col-offset"]=_C(n[j],o.columns)),S},{}),v=Yu(sn(m),c).filter(S=>sn(m[S.value]).length>0).map(S=>({query:o.type==="container"?`mantine-grid (min-width: ${c[S.value]})`:`(min-width: ${c[S.value]})`,styles:m[S.value]}));return s.jsx(Ws,{styles:p,media:o.type==="container"?void 0:v,container:o.type==="container"?v:void 0,selector:r})}var c0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const eI={span:12},u0=me((e,t)=>{const n=se("GridCol",eI,e),{classNames:r,className:a,style:o,styles:c,vars:u,span:f,order:p,offset:m,...g}=n,v=cD(),b=ud();return s.jsxs(s.Fragment,{children:[s.jsx(J7,{selector:`.${b}`,span:f,order:p,offset:m}),s.jsx(ce,{ref:t,...v.getStyles("col",{className:$t(a,b),style:o,classNames:r,styles:c}),...g})]})});u0.classes=c0;u0.displayName="@mantine/core/GridCol";function kC({gutter:e,selector:t,breakpoints:n,type:r}){const a=Sn(),o=n||a.breakpoints,c=Fo({"--grid-gutter":On(ka(e))}),u=sn(o).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=On(e[g])),m),{}),p=Yu(sn(u),o).filter(m=>sn(u[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${o[m.value]})`:`(min-width: ${o[m.value]})`,styles:u[m.value]}));return s.jsx(Ws,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const tI={gutter:"md",grow:!1,columns:12},nI=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),or=me((e,t)=>{const n=se("Grid",tI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,grow:p,gutter:m,columns:g,align:v,justify:b,children:S,breakpoints:j,type:C,...R}=n,D=Me({name:"Grid",classes:c0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:nI}),E=ud();return C==="container"&&j?s.jsxs(RC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[s.jsx(kC,{selector:`.${E}`,...n}),s.jsx("div",{...D("container"),children:s.jsx(ce,{ref:t,...D("root",{className:E}),...R,children:s.jsx("div",{...D("inner"),children:S})})})]}):s.jsxs(RC,{value:{getStyles:D,grow:p,columns:g||12,breakpoints:j,type:C},children:[s.jsx(kC,{selector:`.${E}`,...n}),s.jsx(ce,{ref:t,...D("root",{className:E}),...R,children:s.jsx("div",{...D("inner"),children:S})})]})});or.classes=c0;or.displayName="@mantine/core/Grid";or.Col=u0;function Ph(){return Ph=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},Ph.apply(null,arguments)}function d0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rI=y.useLayoutEffect,aI=function(t){var n=Cn.useRef(t);return rI(function(){n.current=t}),n},PC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},iI=function(t,n){var r=Cn.useRef();return Cn.useCallback(function(a){t.current=a,r.current&&PC(r.current,null),r.current=n,n&&PC(n,a)},[n])},NC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},oI=function(t){Object.keys(NC).forEach(function(n){t.style.setProperty(n,NC[n],"important")})},OC=oI,dr=null,MC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function sI(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),dr||(dr=document.createElement("textarea"),dr.setAttribute("tabindex","-1"),dr.setAttribute("aria-hidden","true"),OC(dr)),dr.parentNode===null&&document.body.appendChild(dr);var a=e.paddingSize,o=e.borderSize,c=e.sizingStyle,u=c.boxSizing;Object.keys(c).forEach(function(v){var b=v;dr.style[b]=c[b]}),OC(dr),dr.value=t;var f=MC(dr,e);dr.value=t,f=MC(dr,e),dr.value="x";var p=dr.scrollHeight-a,m=p*n;u==="border-box"&&(m=m+a+o),f=Math.max(m,f);var g=p*r;return u==="border-box"&&(g=g+a+o),f=Math.min(g,f),[f,p]}var IC=function(){},lI=function(t,n){return t.reduce(function(r,a){return r[a]=n[a],r},{})},cI=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],uI=!!document.documentElement.currentStyle,dI=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=lI(cI,n),a=r.boxSizing;if(a==="")return null;uI&&a==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:c}},fI=dI;function f0(e,t,n){var r=aI(n);y.useLayoutEffect(function(){var a=function(c){return r.current(c)};if(e)return e.addEventListener(t,a),function(){return e.removeEventListener(t,a)}},[])}var hI=function(t,n){f0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},pI=function(t){f0(window,"resize",t)},mI=function(t){f0(document.fonts,"loadingdone",t)},gI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],vI=function(t,n){var r=t.cacheMeasurements,a=t.maxRows,o=t.minRows,c=t.onChange,u=c===void 0?IC:c,f=t.onHeightChange,p=f===void 0?IC:f,m=d0(t,gI),g=m.value!==void 0,v=y.useRef(null),b=iI(v,n),S=y.useRef(0),j=y.useRef(),C=function(){var E=v.current,T=r&&j.current?j.current:fI(E);if(T){j.current=T;var A=sI(T,E.value||E.placeholder||"x",o,a),_=A[0],M=A[1];S.current!==_&&(S.current=_,E.style.setProperty("height",_+"px","important"),p(_,{rowHeight:M}))}},R=function(E){g||C(),u(E)};return y.useLayoutEffect(C),hI(v,function(){if(!g){var D=v.current.value;requestAnimationFrame(function(){var E=v.current;E&&D!==E.value&&C()})}}),pI(C),mI(C),y.createElement("textarea",Ph({},m,{onChange:R,ref:b}))},yI=y.forwardRef(vI);const xI={},Ks=me((e,t)=>{const{autosize:n,maxRows:r,minRows:a,__staticSelector:o,resize:c,...u}=se("Textarea",xI,e),f=n&&pR()!=="test",p=f?{maxRows:r,minRows:a}:{};return s.jsx(Pr,{component:f?yI:"textarea",ref:t,...u,__staticSelector:o||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});Ks.classes=Pr.classes;Ks.displayName="@mantine/core/Textarea";function LC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const bI={serialize:JSON.stringify,deserialize:JSON.parse},Dc=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,formatOnBlur:o,validationError:c,serialize:u,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:v,...b}=se("JsonInput",bI,e),[S,j]=Wn({value:n,defaultValue:r,finalValue:"",onChange:a}),[C,R]=y.useState(LC(S,f)),D=T=>{p==null||p(T),R(!0)},E=T=>{typeof m=="function"&&m(T);const A=LC(T.currentTarget.value,f);o&&!g&&A&&T.currentTarget.value.trim()!==""&&j(u(f(T.currentTarget.value),null,2)),R(A)};return s.jsx(Ks,{value:S,onChange:T=>j(T.currentTarget.value),onFocus:D,onBlur:E,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?v:c||!0,"data-monospace":!0})});Dc.classes=Pr.classes;Dc.displayName="@mantine/core/JsonInput";const[SI,wI]=vr("List component was not found in tree");var h0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const jI={},p0=me((e,t)=>{const n=se("ListItem",jI,e),{classNames:r,className:a,style:o,styles:c,vars:u,icon:f,children:p,mod:m,...g}=n,v=wI(),b=f||v.icon,S={classNames:r,styles:c};return s.jsx(ce,{...v.getStyles("item",{...S,className:a,style:o}),component:"li",mod:[{"with-icon":!!b,centered:v.center},m],ref:t,...g,children:s.jsxs("div",{...v.getStyles("itemWrapper",S),children:[b&&s.jsx("span",{...v.getStyles("itemIcon",S),children:b}),s.jsx("span",{...v.getStyles("itemLabel",S),children:p})]})})});p0.classes=h0;p0.displayName="@mantine/core/ListItem";const CI={type:"unordered"},EI=(e,{size:t,spacing:n})=>({root:{"--list-fz":Mn(t),"--list-lh":oR(t),"--list-spacing":On(n)}}),pr=me((e,t)=>{const n=se("List",CI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,type:m,withPadding:g,icon:v,spacing:b,center:S,listStyleType:j,mod:C,...R}=n,D=Me({name:"List",classes:h0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:EI});return s.jsx(SI,{value:{center:S,icon:v,getStyles:D},children:s.jsx(ce,{...D("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...R,children:p})})});pr.classes=h0;pr.displayName="@mantine/core/List";pr.Item=p0;var uD={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const zC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Wr("overlay")},TI=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),m0=me((e,t)=>{const n=se("LoadingOverlay",zC,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:v,zIndex:b,...S}=n,j=Sn(),C=Me({name:"LoadingOverlay",classes:uD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:TI}),R={...zC.overlayProps,...g};return s.jsx(hi,{transition:"fade",...p,mounted:!!v,children:D=>s.jsxs(ce,{...C("root",{style:D}),ref:t,...S,children:[s.jsx(_r,{...C("loader"),unstyled:u,...m}),s.jsx(dc,{...R,...C("overlay"),darkHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.white}),s.jsx(dc,{...R,...C("overlay"),lightHidden:!0,unstyled:u,color:(g==null?void 0:g.color)||j.colors.dark[5]})]})})});m0.classes=uD;m0.displayName="@mantine/core/LoadingOverlay";const[RI,vd]=vr("Menu component was not found in the tree");var Ac={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const DI={},g0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("MenuDivider",DI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:a,styles:o,classNames:n}),...u})});g0.classes=Ac;g0.displayName="@mantine/core/MenuDivider";const AI={},v0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,onMouseEnter:u,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",AI,e),v=y.useRef(null),b=vd(),S=Rr(p,R=>{var D,E;(R.key==="ArrowUp"||R.key==="ArrowDown")&&(R.preventDefault(),(E=(D=v.current)==null?void 0:D.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||E.focus())}),j=Rr(u,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Rr(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return s.jsxs(za.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Un(t,v),...b.getStyles("dropdown",{className:r,style:a,styles:o,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:S,children:[b.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});v0.classes=Ac;v0.displayName="@mantine/core/MenuDropdown";const _I={},y0=lr((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,color:u,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:v,"data-disabled":b,...S}=se("MenuItem",_I,e),j=vd(),C=Sn(),{dir:R}=Ys(),D=y.useRef(null),E=j.getItemIndex(D.current),T=S,A=Rr(T.onMouseLeave,()=>j.setHovered(-1)),_=Rr(T.onMouseEnter,()=>j.setHovered(j.getItemIndex(D.current))),M=Rr(T.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),L=Rr(T.onFocus,()=>j.setHovered(j.getItemIndex(D.current))),$=u?C.variantColorResolver({color:u,theme:C,variant:"light"}):void 0,V=u?da({color:u,theme:C}):null;return s.jsxs(tr,{...S,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:L,...j.getStyles("item",{className:r,style:a,styles:o,classNames:n}),ref:Un(D,t),role:"menuitem",disabled:v,"data-menu-item":!0,"data-disabled":v||b||void 0,"data-hovered":j.hovered===E?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:_,onMouseLeave:A,onClick:M,onKeyDown:iR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:R,orientation:"vertical",onKeyDown:T.onKeyDown}),__vars:{"--menu-item-color":V!=null&&V.isThemeColor&&(V==null?void 0:V.shade)===void 0?`var(--mantine-color-${V.color}-6)`:$==null?void 0:$.color,"--menu-item-hover":$==null?void 0:$.hover},children:[p&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"left",children:p}),g&&s.jsx("div",{...j.getStyles("itemLabel",{styles:o,classNames:n}),children:g}),m&&s.jsx("div",{...j.getStyles("itemSection",{styles:o,classNames:n}),"data-position":"right",children:m})]})});y0.classes=Ac;y0.displayName="@mantine/core/MenuItem";const kI={},x0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,...u}=se("MenuLabel",kI,e),f=vd();return s.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:a,styles:o,classNames:n}),...u})});x0.classes=Ac;x0.displayName="@mantine/core/MenuLabel";const PI={refProp:"ref"},dD=y.forwardRef((e,t)=>{const{children:n,refProp:r,...a}=se("MenuTarget",PI,e);if(!Hi(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 o=vd(),c=n.props,u=Rr(c.onClick,()=>{o.trigger==="click"?o.toggleDropdown():o.trigger==="click-hover"&&(o.setOpenedViaClick(!0),o.opened||o.openDropdown())}),f=Rr(c.onMouseEnter,()=>(o.trigger==="hover"||o.trigger==="click-hover")&&o.openDropdown()),p=Rr(c.onMouseLeave,()=>{(o.trigger==="hover"||o.trigger==="click-hover"&&!o.openedViaClick)&&o.closeDropdown()});return s.jsx(za.Target,{refProp:r,popupType:"menu",ref:t,...a,children:y.cloneElement(n,{onClick:u,onMouseEnter:f,onMouseLeave:p,"data-expanded":o.opened?!0:void 0})})});dD.displayName="@mantine/core/MenuTarget";const NI={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function je(e){const t=se("Menu",NI,e),{children:n,onOpen:r,onClose:a,opened:o,defaultOpened:c,trapFocus:u,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:v,openDelay:b,closeDelay:S,classNames:j,styles:C,unstyled:R,variant:D,vars:E,menuItemTabIndex:T,keepMounted:A,withInitialFocusPlaceholder:_,...M}=t,L=Me({name:"Menu",classes:Ac,props:t,classNames:j,styles:C,unstyled:R}),[$,{setHovered:V,resetHovered:X}]=X3(),[Q,J]=Wn({value:o,defaultValue:c,finalValue:!1,onChange:f}),[W,Y]=y.useState(!1),P=()=>{J(!1),Y(!1),Q&&(a==null||a())},I=()=>{J(!0),!Q&&(r==null||r())},z=()=>{Q?P():I()},{openDropdown:F,closeDropdown:O}=Z7({open:I,close:P,closeDelay:S,openDelay:b}),U=ye=>K3("[data-menu-item]","[data-menu-dropdown]",ye),{resolvedClassNames:Z,resolvedStyles:ee}=Gs({classNames:j,styles:C,props:t});return $i(()=>{X()},[Q]),s.jsx(RI,{value:{getStyles:L,opened:Q,toggleDropdown:z,getItemIndex:U,hovered:$,setHovered:V,openedViaClick:W,setOpenedViaClick:Y,closeOnItemClick:p,closeDropdown:v==="click"?P:O,openDropdown:v==="click"?I:F,closeDropdownImmediately:P,loop:m,trigger:v,unstyled:R,menuItemTabIndex:T,withInitialFocusPlaceholder:_},children:s.jsx(za,{...M,opened:Q,onChange:z,defaultOpened:c,trapFocus:A?!1:u,closeOnEscape:g,__staticSelector:"Menu",classNames:Z,styles:ee,unstyled:R,variant:D,keepMounted:A,children:n})})}je.extend=e=>e;je.withProps=kO(je);je.classes=Ac;je.displayName="@mantine/core/Menu";je.Item=y0;je.Label=x0;je.Dropdown=v0;je.Target=dD;je.Divider=g0;const[OI,_c]=vr("Modal component was not found in tree");var Xi={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const MI={},Cp=me((e,t)=>{const n=se("ModalBody",MI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(w2,{ref:t,...p.getStyles("body",{classNames:r,style:o,styles:c,className:a}),...f})});Cp.classes=Xi;Cp.displayName="@mantine/core/ModalBody";const II={},Ep=me((e,t)=>{const n=se("ModalCloseButton",II,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(j2,{ref:t,...p.getStyles("close",{classNames:r,style:o,styles:c,className:a}),...f})});Ep.classes=Xi;Ep.displayName="@mantine/core/ModalCloseButton";const LI={},Tp=me((e,t)=>{const n=se("ModalContent",LI,e),{classNames:r,className:a,style:o,styles:c,vars:u,children:f,__hidden:p,...m}=n,g=_c(),v=g.scrollAreaComponent||Y9;return s.jsx(C2,{...g.getStyles("content",{className:a,style:o,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:a,style:o,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:s.jsx(v,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Tp.classes=Xi;Tp.displayName="@mantine/core/ModalContent";const zI={},Rp=me((e,t)=>{const n=se("ModalHeader",zI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(E2,{ref:t,...p.getStyles("header",{classNames:r,style:o,styles:c,className:a}),...f})});Rp.classes=Xi;Rp.displayName="@mantine/core/ModalHeader";const $I={},Dp=me((e,t)=>{const n=se("ModalOverlay",$I,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(T2,{ref:t,...p.getStyles("overlay",{classNames:r,style:o,styles:c,className:a}),...f})});Dp.classes=Xi;Dp.displayName="@mantine/core/ModalOverlay";const UI={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},BI=(e,{radius:t,size:n,yOffset:r,xOffset:a})=>({root:{"--modal-radius":t===void 0?void 0:Ft(t),"--modal-size":nt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(a)}}),Ap=me((e,t)=>{const n=se("ModalRoot",UI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:v,centered:b,xOffset:S,__staticSelector:j,...C}=n,R=Me({name:j,classes:Xi,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:BI});return s.jsx(OI,{value:{yOffset:p,scrollAreaComponent:m,getStyles:R,fullScreen:v},children:s.jsx(S2,{ref:t,...R("root"),"data-full-screen":v||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Yr.Autosize||void 0,unstyled:u,...C})})});Ap.classes=Xi;Ap.displayName="@mantine/core/ModalRoot";const[VI,FI]=qi();function fD({children:e}){const[t,n]=y.useState([]),[r,a]=y.useState(Wr("modal"));return s.jsx(VI,{value:{stack:t,addModal:(o,c)=>{n(u=>[...new Set([...u,o])]),a(u=>typeof c=="number"&&typeof u=="number"?Math.max(u,c):u)},removeModal:o=>n(c=>c.filter(u=>u!==o)),getZIndex:o=>`calc(${r} + ${t.indexOf(o)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}fD.displayName="@mantine/core/ModalStack";const HI={},_p=me((e,t)=>{const n=se("ModalTitle",HI,e),{classNames:r,className:a,style:o,styles:c,vars:u,...f}=n,p=_c();return s.jsx(R2,{ref:t,...p.getStyles("title",{classNames:r,style:o,styles:c,className:a}),...f})});_p.classes=Xi;_p.displayName="@mantine/core/ModalTitle";const qI={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Bn=me((e,t)=>{const{title:n,withOverlay:r,overlayProps:a,withCloseButton:o,closeButtonProps:c,children:u,radius:f,opened:p,stackId:m,zIndex:g,...v}=se("Modal",qI,e),b=FI(),S=!!n||o,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return y.useEffect(()=>{b&&m&&(p?b.addModal(m,g||Wr("modal")):b.removeModal(m))},[p,m,g]),s.jsxs(Ap,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...v,...j,children:[r&&s.jsx(Dp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...a}),s.jsxs(Tp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[S&&s.jsxs(Rp,{children:[n&&s.jsx(_p,{children:n}),o&&s.jsx(Ep,{...c})]}),s.jsx(Cp,{children:u})]})]})});Bn.classes=Xi;Bn.displayName="@mantine/core/Modal";Bn.Root=Ap;Bn.Overlay=Dp;Bn.Content=Tp;Bn.Body=Cp;Bn.Header=Rp;Bn.Title=_p;Bn.CloseButton=Ep;Bn.Stack=fD;const[GI,b0]=qi(),[QI,WI]=qi();var kp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const YI={},KI=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?nt(t):nt(n,"pg-gap")}}),S0=me((e,t)=>{const n=se("PillGroup",YI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,disabled:m,...g}=n,v=b0(),b=(v==null?void 0:v.size)||p||void 0,S=Me({name:"PillGroup",classes:kp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:KI,stylesCtx:{size:b},rootSelector:"group"});return s.jsx(QI,{value:{size:b,disabled:m},children:s.jsx(ce,{ref:t,size:b,...S("group"),...g})})});S0.classes=kp;S0.displayName="@mantine/core/PillGroup";const XI={variant:"default"},ZI=(e,{radius:t},{size:n})=>({root:{"--pill-fz":nt(n,"pill-fz"),"--pill-height":nt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ft(t)}}),Is=me((e,t)=>{const n=se("Pill",XI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:v,removeButtonProps:b,radius:S,size:j,disabled:C,mod:R,...D}=n,E=WI(),T=b0(),A=j||(E==null?void 0:E.size)||void 0,_=(T==null?void 0:T.variant)==="filled"?"contrast":p||"default",M=Me({name:"Pill",classes:kp,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:ZI,stylesCtx:{size:A}});return s.jsxs(ce,{component:"span",ref:t,variant:_,size:A,...M("root",{variant:_}),mod:[{"with-remove":g&&!C,disabled:C||(E==null?void 0:E.disabled)},R],...D,children:[s.jsx("span",{...M("label"),children:m}),g&&s.jsx(qo,{variant:"transparent",radius:S,tabIndex:-1,"aria-hidden":!0,unstyled:u,...b,...M("remove",{className:b==null?void 0:b.className,style:b==null?void 0:b.style}),onMouseDown:L=>{var $;L.preventDefault(),L.stopPropagation(),($=b==null?void 0:b.onMouseDown)==null||$.call(b,L)},onClick:L=>{var $;L.stopPropagation(),v==null||v(),($=b==null?void 0:b.onClick)==null||$.call(b,L)}})]})});Is.classes=kp;Is.displayName="@mantine/core/Pill";Is.Group=S0;var hD={field:"m_45c4369d"};const JI={type:"visible"},w0=me((e,t)=>{const n=se("PillsInputField",JI,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,type:p,disabled:m,id:g,pointer:v,mod:b,...S}=n,j=b0(),C=Ec(),R=Me({name:"PillsInputField",classes:hD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"field"}),D=m||(j==null?void 0:j.disabled);return s.jsx(ce,{component:"input",ref:Un(t,j==null?void 0:j.fieldRef),"data-type":p,disabled:D,mod:[{disabled:D,pointer:v},b],...R("field"),...S,id:(C==null?void 0:C.inputId)||g,"aria-invalid":j==null?void 0:j.hasError,"aria-describedby":C==null?void 0:C.describedBy,type:"text",onMouseDown:E=>!v&&E.stopPropagation()})});w0.classes=hD;w0.displayName="@mantine/core/PillsInputField";const eL={},pc=me((e,t)=>{const n=se("PillsInput",eL,e),{children:r,onMouseDown:a,onClick:o,size:c,disabled:u,__staticSelector:f,error:p,variant:m,...g}=n,v=y.useRef(null);return s.jsx(GI,{value:{fieldRef:v,size:c,disabled:u,hasError:!!p,variant:m},children:s.jsx(Pr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{var S;b.preventDefault(),a==null||a(b),(S=v.current)==null||S.focus()},onClick:b=>{var j;b.preventDefault();const S=b.currentTarget.closest("fieldset");S!=null&&S.disabled||((j=v.current)==null||j.focus(),o==null||o(b))},...g,multiline:!0,disabled:u,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});pc.displayName="@mantine/core/PillsInput";pc.Field=w0;function tL({data:e,value:t}){const n=t.map(a=>a.trim().toLowerCase());return e.reduce((a,o)=>(hc(o)?a.push({group:o.group,items:o.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(o.value.toLowerCase().trim())===-1&&a.push(o),a),[])}const nL={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Pp=me((e,t)=>{const n=se("MultiSelect",nL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,size:p,value:m,defaultValue:g,onChange:v,onKeyDown:b,variant:S,data:j,dropdownOpened:C,defaultDropdownOpened:R,onDropdownOpen:D,onDropdownClose:E,selectFirstOptionOnChange:T,onOptionSubmit:A,comboboxProps:_,filter:M,limit:L,withScrollArea:$,maxDropdownHeight:V,searchValue:X,defaultSearchValue:Q,onSearchChange:J,readOnly:W,disabled:Y,onFocus:P,onBlur:I,onPaste:z,radius:F,rightSection:O,rightSectionWidth:U,rightSectionPointerEvents:Z,rightSectionProps:ee,leftSection:ye,leftSectionWidth:be,leftSectionPointerEvents:ve,leftSectionProps:Ge,inputContainer:ke,inputWrapperOrder:et,withAsterisk:Re,labelProps:ft,descriptionProps:Ut,errorProps:Ot,wrapperProps:xt,description:Ht,label:Bt,error:Se,maxValues:Ne,searchable:Ve,nothingFoundMessage:Te,withCheckIcon:ge,checkIconPosition:we,hidePickedOptions:Le,withErrorStyles:xe,name:$e,form:gt,id:ht,clearable:Wt,clearButtonProps:_t,hiddenInputProps:mn,placeholder:St,hiddenInputValuesDivider:Va,required:ba,mod:gi,renderOption:Sa,onRemove:Yn,onClear:xr,scrollAreaProps:il,chevronColor:ro,...Zo}=n,Fa=yr(ht),wa=M2(j),ja=I2(wa),kn=gd({opened:C,defaultOpened:R,onDropdownOpen:D,onDropdownClose:()=>{E==null||E(),kn.resetSelectedOption()}}),{styleProps:vi,rest:{type:ol,autoComplete:Jo,...H}}=Wi(Zo),[G,re]=Wn({value:m,defaultValue:g,finalValue:[],onChange:v}),[he,Ee]=Wn({value:X,defaultValue:Q,finalValue:"",onChange:J}),Be=at=>{Ee(at),kn.resetSelectedOption()},tt=Me({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:u}),{resolvedClassNames:Ue,resolvedStyles:Xe}=Gs({props:n,styles:c,classNames:r}),Ze=at=>{b==null||b(at),at.key===" "&&!Ve&&(at.preventDefault(),kn.toggleDropdown()),at.key==="Backspace"&&he.length===0&&G.length>0&&(Yn==null||Yn(G[G.length-1]),re(G.slice(0,G.length-1)))},rt=G.map((at,rn)=>{var kt,jt;return s.jsx(Is,{withRemoveButton:!W&&!((kt=ja[at])!=null&&kt.disabled),onRemove:()=>{re(G.filter(Ha=>at!==Ha)),Yn==null||Yn(at)},unstyled:u,disabled:Y,...tt("pill"),children:((jt=ja[at])==null?void 0:jt.label)||at},`${at}-${rn}`)});y.useEffect(()=>{T&&kn.selectFirstOption()},[T,he]);const Ye=s.jsx(ct.ClearButton,{..._t,onClear:()=>{xr==null||xr(),re([]),Be("")}}),lt=tL({data:wa,value:G}),Dt=Wt&&G.length>0&&!Y&&!W;return s.jsxs(s.Fragment,{children:[s.jsxs(ct,{store:kn,classNames:Ue,styles:Xe,unstyled:u,size:p,readOnly:W,__staticSelector:"MultiSelect",onOptionSubmit:at=>{A==null||A(at),Be(""),kn.updateSelectedOptionIndex("selected"),G.includes(ja[at].value)?(re(G.filter(rn=>rn!==ja[at].value)),Yn==null||Yn(ja[at].value)):G.length<Ne&&re([...G,ja[at].value])},..._,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(pc,{...vi,__staticSelector:"MultiSelect",classNames:Ue,styles:Xe,unstyled:u,size:p,className:a,style:o,variant:S,disabled:Y,radius:F,__defaultRightSection:s.jsx(ct.Chevron,{size:p,error:Se,unstyled:u,color:ro}),__clearSection:Ye,__clearable:Dt,rightSection:O,rightSectionPointerEvents:Z||(Ye?"all":"none"),rightSectionWidth:U,rightSectionProps:ee,leftSection:ye,leftSectionWidth:be,leftSectionPointerEvents:ve,leftSectionProps:Ge,inputContainer:ke,inputWrapperOrder:et,withAsterisk:Re,labelProps:ft,descriptionProps:Ut,errorProps:Ot,wrapperProps:xt,description:Ht,label:Bt,error:Se,withErrorStyles:xe,__stylesApiProps:{...n,rightSectionPointerEvents:Z||(Dt?"all":"none"),multiline:!0},pointer:!Ve,onClick:()=>Ve?kn.openDropdown():kn.toggleDropdown(),"data-expanded":kn.dropdownOpened||void 0,id:Fa,required:ba,mod:gi,children:s.jsxs(Is.Group,{disabled:Y,unstyled:u,...tt("pillsList"),children:[rt,s.jsx(ct.EventsTarget,{autoComplete:Jo,children:s.jsx(pc.Field,{...H,ref:t,id:Fa,placeholder:St,type:!Ve&&!St?"hidden":"visible",...tt("inputField"),unstyled:u,onFocus:at=>{P==null||P(at),Ve&&kn.openDropdown()},onBlur:at=>{I==null||I(at),kn.closeDropdown(),Be("")},onKeyDown:Ze,value:he,onChange:at=>{Be(at.currentTarget.value),Ve&&kn.openDropdown(),T&&kn.selectFirstOption()},disabled:Y,readOnly:W||!Ve,pointer:!Ve})})]})})}),s.jsx(y7,{data:Le?lt:wa,hidden:W||Y,filter:M,search:he,limit:L,hiddenWhenEmpty:!Te,withScrollArea:$,maxDropdownHeight:V,filterOptions:Ve,value:G,checkIconPosition:we,withCheckIcon:ge,nothingFoundMessage:Te,unstyled:u,labelId:Bt?`${Fa}-label`:void 0,"aria-label":Bt?void 0:Zo["aria-label"],renderOption:Sa,scrollAreaProps:il})]}),s.jsx(ct.HiddenInput,{name:$e,valuesDivider:Va,value:G,form:gt,disabled:Y,...mn})]})});Pp.classes={...Pr.classes,...ct.classes};Pp.displayName="@mantine/core/MultiSelect";function rL(e){return"group"in e}function j0({data:e}){if(rL(e)){const a=e.items.map(o=>s.jsx(j0,{data:o},o.value));return s.jsx("optgroup",{label:e.group,children:a})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}j0.displayName="@mantine/core/NativeSelectOption";const aL={rightSectionPointerEvents:"none"},ln=me((e,t)=>{const{data:n,children:r,size:a,error:o,rightSection:c,unstyled:u,...f}=se("NativeSelect",aL,e),p=M2(n).map((m,g)=>s.jsx(j0,{data:m},g));return s.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:a,pointer:!0,error:o,unstyled:u,rightSection:c||s.jsx(xp,{size:a,error:o,unstyled:u}),children:r||p})});ln.classes=Pr.classes;ln.displayName="@mantine/core/NativeSelect";var pD={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const iL={withCloseButton:!0},oL=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ft(t),"--notification-color":n?Gt(n,e):void 0}}),C0=me((e,t)=>{const n=se("Notification",iL,e),{className:r,color:a,radius:o,loading:c,withCloseButton:u,withBorder:f,title:p,icon:m,children:g,onClose:v,closeButtonProps:b,classNames:S,style:j,styles:C,unstyled:R,variant:D,vars:E,mod:T,loaderProps:A,role:_,...M}=n,L=Me({name:"Notification",classes:pD,props:n,className:r,style:j,classNames:S,styles:C,unstyled:R,vars:E,varsResolver:oL});return s.jsxs(ce,{...L("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},T],ref:t,variant:D,role:_||"alert",...M,children:[m&&!c&&s.jsx("div",{...L("icon"),children:m}),c&&s.jsx(_r,{size:28,color:a,...A,...L("loader")}),s.jsxs("div",{...L("body"),children:[p&&s.jsx("div",{...L("title"),children:p}),s.jsx(ce,{...L("description"),mod:{"data-with-title":!!p},children:g})]}),u&&s.jsx(qo,{iconSize:16,color:"gray",...b,unstyled:R,onClick:v,...L("closeButton")})]})});C0.classes=pD;C0.displayName="@mantine/core/Notification";function mD(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 a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n}var ed;(function(e){e.event="event",e.props="prop"})(ed||(ed={}));function Io(){}function sL(e){var t,n=void 0;return function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t&&r.length===t.length&&r.every(function(o,c){return o===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function td(e){return!!(e||"").match(/\d/)}function ac(e){return e==null}function lL(e){return typeof e=="number"&&isNaN(e)}function gD(e){return ac(e)||lL(e)||typeof e=="number"&&!isFinite(e)}function vD(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function cL(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 uL(e,t,n){var r=cL(n),a=e.search(/[1-9]/);return a=a===-1?e.length:a,e.substring(0,a)+e.substring(a,e.length).replace(r,"$1"+t)}function dL(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],a=arguments.length;a--;)r[a]=arguments[a];return t.current.apply(t,r)});return n.current}function E0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var a=e.split("."),o=a[0],c=a[1]||"";return{beforeDecimal:o,afterDecimal:c,hasNegation:n,addNegation:r}}function fL(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",a=n[1]||"";return(t?"-":"")+r+(a?"."+a:"")}function yD(e,t,n){for(var r="",a=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||a;return r}function $C(e,t){return Array(t+1).join(e)}function xD(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),a=r[0],o=r[1];if(o=Number(o),!o)return n+a;a=a.replace(".","");var c=1+o,u=a.length;return c<0?a="0."+$C("0",Math.abs(c))+a:c>=u?a=a+$C("0",c-u):a=(a.substring(0,c)||"0")+"."+a.substring(c),n+a}function UC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,a=E0(e),o=a.beforeDecimal,c=a.afterDecimal,u=a.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=o;o&&Number(m[0])&&(g=o.split("").reverse().reduce(function(j,C,R){return j.length>R?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var v=yD(m[1]||"",t,n),b=u?"-":"",S=r?".":"";return""+b+g+S+v}function js(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 bD=sL(function(e,t){for(var n=0,r=0,a=e.length,o=t.length;e[n]===t[n]&&n<a;)n++;for(;e[a-1-r]===t[o-1-r]&&o-r>n&&a-r>n;)r++;return{from:{start:n,end:a-r},to:{start:n,end:o-r}}}),hL=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function pL(e,t,n){return Math.min(Math.max(e,t),n)}function Mv(e){return Math.max(e.selectionStart,e.selectionEnd)}function mL(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function gL(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function vL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,a=e.formattedValueIndex;return t[r]===n[a]}function yL(e,t,n,r,a,o,c){c===void 0&&(c=vL);var u=a.findIndex(function(T){return T}),f=e.slice(0,u);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},v=new Array(p),b=0;b<p;b++){v[b]=-1;for(var S=0,j=m;S<j;S++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:S});if(C&&g[S]!==!0){v[b]=S,g[S]=!0;break}}}for(var R=r;R<p&&(v[R]===-1||!o(n[R]));)R++;var D=R===p||v[R]===-1?m:v[R];for(R=r-1;R>0&&v[R]===-1;)R--;var E=R===-1||v[R]===-1?0:v[R]+1;return E>D?D:r-E<D-r?E:D}function BC(e,t,n,r){var a=e.length;if(t=pL(t,0,a),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=a&&!n[t];)t++;t>a&&(t=n.lastIndexOf(!0))}return t===-1&&(t=a),t}function xL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(td(e[n])||td(e[n-1]));return t}function SD(e,t,n,r,a,o){o===void 0&&(o=Io);var c=dL(function(S,j){var C,R;return gD(S)?(R="",C=""):typeof S=="number"||j?(R=typeof S=="number"?xD(S):S,C=r(R)):(R=a(S,void 0),C=r(R)),{formattedValue:C,numAsString:R}}),u=y.useState(function(){return c(ac(e)?t:e,n)}),f=u[0],p=u[1],m=function(S,j){S.formattedValue!==f.formattedValue&&p({formattedValue:S.formattedValue,numAsString:S.value}),o(S,j)},g=e,v=n;ac(e)&&(g=f.numAsString,v=!0);var b=c(g,v);return y.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function bL(e){return e.replace(/[^0-9]/g,"")}function SL(e){return e}function wL(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,a=e.renderText,o=e.getInputRef,c=e.format;c===void 0&&(c=SL);var u=e.removeFormatting;u===void 0&&(u=bL);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,v=e.onChange;v===void 0&&(v=Io);var b=e.onKeyDown;b===void 0&&(b=Io);var S=e.onMouseUp;S===void 0&&(S=Io);var j=e.onFocus;j===void 0&&(j=Io);var C=e.onBlur;C===void 0&&(C=Io);var R=e.value,D=e.getCaretBoundary;D===void 0&&(D=xL);var E=e.isValidInputCharacter;E===void 0&&(E=td);var T=e.isCharacterSame,A=mD(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),_=SD(R,f,!!p,c,u,m),M=_[0],L=M.formattedValue,$=M.numAsString,V=_[1],X=y.useRef(),Q=y.useRef({formattedValue:L,numAsString:$}),J=function(Se,Ne){Q.current={formattedValue:Se.formattedValue,numAsString:Se.value},V(Se,Ne)},W=y.useState(!1),Y=W[0],P=W[1],I=y.useRef(null),z=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return P(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var F=c,O=function(Se,Ne){var Ve=parseFloat(Ne);return{formattedValue:Se,value:Ne,floatValue:isNaN(Ve)?void 0:Ve}},U=function(Se,Ne,Ve){Se.selectionStart===0&&Se.selectionEnd===Se.value.length||(js(Se,Ne),z.current.setCaretTimeout=setTimeout(function(){Se.value===Ve&&Se.selectionStart!==Ne&&js(Se,Ne)},0))},Z=function(Se,Ne,Ve){return BC(Se,Ne,D(Se),Ve)},ee=function(Se,Ne,Ve){var Te=D(Ne),ge=yL(Ne,L,Se,Ve,Te,E,T);return ge=BC(Ne,ge,Te),ge},ye=function(Se){var Ne=Se.formattedValue;Ne===void 0&&(Ne="");var Ve=Se.input,Te=Se.source,ge=Se.event,we=Se.numAsString,Le;if(Ve){var xe=Se.inputValue||Ve.value,$e=Mv(Ve);Ve.value=Ne,Le=ee(xe,Ne,$e),Le!==void 0&&U(Ve,Le,Ne)}Ne!==L&&J(O(Ne,we),{event:ge,source:Te})};y.useEffect(function(){var Se=Q.current,Ne=Se.formattedValue,Ve=Se.numAsString;(L!==Ne||$!==Ve)&&J(O(L,$),{event:void 0,source:ed.props})},[L,$]);var be=I.current?Mv(I.current):void 0,ve=typeof window<"u"?y.useLayoutEffect:y.useEffect;ve(function(){var Se=I.current;if(L!==Q.current.formattedValue&&Se){var Ne=ee(Q.current.formattedValue,L,be);Se.value=L,U(Se,Ne,L)}},[L]);var Ge=function(Se,Ne,Ve){var Te=Ne.target,ge=X.current?hL(X.current,Te.selectionEnd):bD(L,Se),we=Object.assign(Object.assign({},ge),{lastValue:L}),Le=u(Se,we),xe=F(Le);if(Le=u(xe,void 0),g&&!g(O(xe,Le))){var $e=Ne.target,gt=Mv($e),ht=ee(Se,L,gt);return $e.value=L,U($e,ht,L),!1}return ye({formattedValue:xe,numAsString:Le,inputValue:Se,event:Ne,source:Ve,input:Ne.target}),!0},ke=function(Se,Ne){Ne===void 0&&(Ne=0);var Ve=Se.selectionStart,Te=Se.selectionEnd;X.current={selectionStart:Ve,selectionEnd:Te+Ne}},et=function(Se){var Ne=Se.target,Ve=Ne.value,Te=Ge(Ve,Se,ed.event);Te&&v(Se),X.current=void 0},Re=function(Se){var Ne=Se.target,Ve=Se.key,Te=Ne.selectionStart,ge=Ne.selectionEnd,we=Ne.value;we===void 0&&(we="");var Le;Ve==="ArrowLeft"||Ve==="Backspace"?Le=Math.max(Te-1,0):Ve==="ArrowRight"?Le=Math.min(Te+1,we.length):Ve==="Delete"&&(Le=Te);var xe=0;Ve==="Delete"&&Te===ge&&(xe=1);var $e=Ve==="ArrowLeft"||Ve==="ArrowRight";if(Le===void 0||Te!==ge&&!$e){b(Se),ke(Ne,xe);return}var gt=Le;if($e){var ht=Ve==="ArrowLeft"?"left":"right";gt=Z(we,Le,ht),gt!==Le&&Se.preventDefault()}else Ve==="Delete"&&!E(we[Le])?gt=Z(we,Le,"right"):Ve==="Backspace"&&!E(we[Le])&&(gt=Z(we,Le,"left"));gt!==Le&&U(Ne,gt,we),b(Se),ke(Ne,xe)},ft=function(Se){var Ne=Se.target,Ve=function(){var Te=Ne.selectionStart,ge=Ne.selectionEnd,we=Ne.value;if(we===void 0&&(we=""),Te===ge){var Le=Z(we,Te);Le!==Te&&U(Ne,Le,we)}};Ve(),requestAnimationFrame(function(){Ve()}),S(Se),ke(Ne)},Ut=function(Se){Se.persist&&Se.persist();var Ne=Se.target,Ve=Se.currentTarget;I.current=Ne,z.current.focusTimeout=setTimeout(function(){var Te=Ne.selectionStart,ge=Ne.selectionEnd,we=Ne.value;we===void 0&&(we="");var Le=Z(we,Te);Le!==Te&&!(Te===0&&ge===we.length)&&U(Ne,Le,we),j(Object.assign(Object.assign({},Se),{currentTarget:Ve}))},0)},Ot=function(Se){I.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Se)},xt=Y&&mL()?"numeric":void 0,Ht=Object.assign({inputMode:xt},A,{type:t,value:L,onChange:et,onKeyDown:Re,onMouseUp:ft,onFocus:Ut,onBlur:Ot});if(n==="text")return a?Cn.createElement(Cn.Fragment,null,a(L,A)||null):Cn.createElement("span",Object.assign({},A,{ref:o}),L);if(r){var Bt=r;return Cn.createElement(Bt,Object.assign({},Ht,{ref:o}))}return Cn.createElement("input",Object.assign({},Ht,{ref:o}))}function VC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,a=t.prefix;a===void 0&&(a="");var o=t.suffix;o===void 0&&(o="");var c=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var f=Np(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,v=E0(e,c),b=v.beforeDecimal,S=v.afterDecimal,j=v.addNegation;return n!==void 0&&(S=yD(S,n,!!r)),p&&(b=uL(b,p,u)),a&&(b=a+b),o&&(S=S+o),j&&(b="-"+b),e=b+(g&&m||"")+S,e}function Np(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 jL(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),a=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),a&&!o&&t&&(e="-"+e),e}function CL(e,t){return new RegExp("(^-)|[0-9]|"+vD(e),"g")}function EL(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function TL(e,t,n){var r;t===void 0&&(t=gL(e));var a=n.allowNegative,o=n.prefix;o===void 0&&(o="");var c=n.suffix;c===void 0&&(c="");var u=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,v=Np(n),b=v.allowedDecimalSeparators,S=v.decimalSeparator,j=e[g]===S;if(td(e)&&(e===o||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=u===0?"":S;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var R=function(I,z,F){var O=!1,U=!1;o.startsWith("-")?O=!1:I.startsWith("--")?(O=!1,U=!0):c.startsWith("-")&&I.length===c.length?O=!1:I[0]==="-"&&(O=!0);var Z=O?1:0;return U&&(Z=2),Z&&(I=I.substring(Z),z-=Z,F-=Z),{value:I,start:z,end:F,hasNegation:O}},D=R(e,m,g),E=D.hasNegation;r=D,e=r.value,m=r.start,g=r.end;var T=R(t.lastValue,f.start,f.end),A=T.start,_=T.end,M=T.value,L=e.substring(m,g);e.length&&M.length&&(A>M.length-c.length||_<o.length)&&!(L&&c.startsWith(L))&&(e=M);var $=0;e.startsWith(o)?$+=o.length:m<o.length&&($=m),e=e.substring($),g-=$;var V=e.length,X=e.length-c.length;e.endsWith(c)?V=X:(g>X||g>e.length-c.length)&&(V=g),e=e.substring(0,V),e=jL(E?"-"+e:e,a),e=(e.match(CL(S))||[]).join("");var Q=e.indexOf(S);e=e.replace(new RegExp(vD(S),"g"),function(I,z){return z===Q?".":""});var J=E0(e,a),W=J.beforeDecimal,Y=J.afterDecimal,P=J.addNegation;return p.end-p.start<f.end-f.start&&W===""&&j&&!parseFloat(Y)&&(e=P?"-":""),e}function RL(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";a.fill(!1,0,n.length+(o?1:0));var c=e.length;return a.fill(!1,c-r.length+1,c+1),a}function DL(e){var t=Np(e),n=t.thousandSeparator,r=t.decimalSeparator,a=e.prefix;a===void 0&&(a="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
|
|
69
|
+
Decimal separator can't be same as thousand separator.
|
|
70
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
71
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
72
|
+
`);return a.startsWith("-")&&o&&(console.error(`
|
|
73
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
74
|
+
prefix: `+a+`
|
|
75
|
+
allowNegative: `+o+`
|
|
76
|
+
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function AL(e){e=DL(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,a=e.onKeyDown;a===void 0&&(a=Io);var o=e.onBlur;o===void 0&&(o=Io);var c=e.thousandSeparator,u=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,v=e.valueIsNumericString,b=e.onValueChange,S=mD(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Np(e),C=j.decimalSeparator,R=j.allowedDecimalSeparators,D=function(P){return VC(P,e)},E=function(P,I){return TL(P,I,e)},T=ac(g)?m:g,A=v??EL(T,p,t);ac(g)?ac(m)||(A=A||typeof m=="number"):A=A||typeof g=="number";var _=function(P){return gD(P)?P:(typeof P=="number"&&(P=xD(P)),A&&typeof u=="number"?UC(P,u,!!f):P)},M=SD(_(g),_(m),!!A,D,E,b),L=M[0],$=L.numAsString,V=L.formattedValue,X=M[1],Q=function(P){var I=P.target,z=P.key,F=I.selectionStart,O=I.selectionEnd,U=I.value;if(U===void 0&&(U=""),(z==="Backspace"||z==="Delete")&&O<p.length){P.preventDefault();return}if(F!==O){a(P);return}z==="Backspace"&&U[0]==="-"&&F===p.length+1&&n&&js(I,1),u&&f&&(z==="Backspace"&&U[F-1]===C?(js(I,F-1),P.preventDefault()):z==="Delete"&&U[F]===C&&P.preventDefault()),R!=null&&R.includes(z)&&U[F]===C&&js(I,F+1);var Z=c===!0?",":c;z==="Backspace"&&U[F-1]===Z&&js(I,F-1),z==="Delete"&&U[F]===Z&&js(I,F+1),a(P)},J=function(P){var I=$;if(I.match(/\d/g)||(I=""),r||(I=fL(I)),f&&u&&(I=UC(I,u,f)),I!==$){var z=VC(I,e);X({formattedValue:z,value:I,floatValue:parseFloat(I)},{event:P,source:ed.event})}o(P)},W=function(P){return P===C?!0:td(P)},Y=function(P){var I=P.currentValue,z=P.lastValue,F=P.formattedValue,O=P.currentValueIndex,U=P.formattedValueIndex,Z=I[O],ee=F[U],ye=bD(z,I),be=ye.to,ve=function(Ge){return E(Ge).indexOf(".")+p.length};return g===0&&f&&u&&I[be.start]===C&&ve(I)<O&&ve(F)>U?!1:O>=be.start&&O<be.end&&R&&R.includes(Z)&&ee===C?!0:Z===ee};return Object.assign(Object.assign({},S),{value:V,valueIsNumericString:!1,isValidInputCharacter:W,isCharacterSame:Y,onValueChange:X,format:D,removeFormatting:E,getCaretBoundary:function(P){return RL(P,e)},onKeyDown:Q,onBlur:J})}function _L(e){var t=AL(e);return Cn.createElement(wL,Object.assign({},t))}function FC({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 Ey={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const kL=/^(0\.0*|-0(\.0*)?)$/,PL=/^-?0\d+(\.\d+)?\.?$/;function Ty(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Iv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Ty(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function NL(e){return e.toString().replace(".","").length}function OL(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&NL(t)<14&&t!==""}function HC(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,a=n===void 0||e<=n;return r&&a}const ML={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},IL=(e,{size:t})=>({controls:{"--ni-chevron-size":nt(t,"ni-chevron-size")}});function LL(e,t,n){const r=e.toString().replace(/^0+/,""),a=parseFloat(r);return Number.isNaN(a)?r:a>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:ph(a,n,t)}const Op=me((e,t)=>{const n=se("NumberInput",ML,e),{className:r,classNames:a,styles:o,unstyled:c,vars:u,onChange:f,onValueChange:p,value:m,defaultValue:g,max:v,min:b,step:S,hideControls:j,rightSection:C,isAllowed:R,clampBehavior:D,onBlur:E,allowDecimal:T,decimalScale:A,onKeyDown:_,onKeyDownCapture:M,handlersRef:L,startValue:$,disabled:V,rightSectionPointerEvents:X,allowNegative:Q,readOnly:J,size:W,rightSectionWidth:Y,stepHoldInterval:P,stepHoldDelay:I,allowLeadingZeros:z,withKeyboardEvents:F,trimLeadingZeroesOnBlur:O,...U}=n,Z=Me({name:"NumberInput",classes:Ey,props:n,classNames:a,styles:o,unstyled:c,vars:u,varsResolver:IL}),{resolvedClassNames:ee,resolvedStyles:ye}=Gs({classNames:a,styles:o,props:n}),[be,ve]=Wn({value:m,defaultValue:g,finalValue:"",onChange:f}),Ge=I!==void 0&&P!==void 0,ke=y.useRef(null),et=y.useRef(null),Re=y.useRef(0),ft=(xe,$e)=>{$e.source==="event"&&ve(OL(xe.floatValue,xe.value)&&!kL.test(xe.value)&&!(z&&PL.test(xe.value))?xe.floatValue:xe.value),p==null||p(xe,$e)},Ut=xe=>{const $e=String(xe).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return $e?Math.max(0,($e[1]?$e[1].length:0)-($e[2]?+$e[2]:0)):0},Ot=xe=>{ke.current&&typeof xe<"u"&&ke.current.setSelectionRange(xe,xe)},xt=y.useRef(Eh);xt.current=()=>{if(!Iv(be))return;let xe;const $e=Ut(be),gt=Ut(S),ht=Math.max($e,gt),Wt=10**ht;if(!Ty(be)&&(typeof be!="number"||Number.isNaN(be)))xe=ph($,b,v);else if(v!==void 0){const mn=(Math.round(Number(be)*Wt)+Math.round(S*Wt))/Wt;xe=mn<=v?mn:v}else xe=(Math.round(Number(be)*Wt)+Math.round(S*Wt))/Wt;const _t=xe.toFixed(ht);ve(parseFloat(_t)),p==null||p({floatValue:parseFloat(_t),formattedValue:_t,value:_t},{source:"increment"}),setTimeout(()=>{var mn;return Ot((mn=ke.current)==null?void 0:mn.value.length)},0)};const Ht=y.useRef(Eh);Ht.current=()=>{if(!Iv(be))return;let xe;const $e=b!==void 0?b:Q?Number.MIN_SAFE_INTEGER:0,gt=Ut(be),ht=Ut(S),Wt=Math.max(gt,ht),_t=10**Wt;if(!Ty(be)&&typeof be!="number"||Number.isNaN(be))xe=ph($,$e,v);else{const St=(Math.round(Number(be)*_t)-Math.round(S*_t))/_t;xe=$e!==void 0&&St<$e?$e:St}const mn=xe.toFixed(Wt);ve(parseFloat(mn)),p==null||p({floatValue:parseFloat(mn),formattedValue:mn,value:mn},{source:"decrement"}),setTimeout(()=>{var St;return Ot((St=ke.current)==null?void 0:St.value.length)},0)};const Bt=xe=>{_==null||_(xe),!(J||!F)&&(xe.key==="ArrowUp"&&(xe.preventDefault(),xt.current()),xe.key==="ArrowDown"&&(xe.preventDefault(),Ht.current()))},Se=xe=>{if(M==null||M(xe),xe.key==="Backspace"){const $e=ke.current;$e.selectionStart===0&&$e.selectionStart===$e.selectionEnd&&(xe.preventDefault(),window.setTimeout(()=>Ot(0),0))}},Ne=xe=>{let $e=be;D==="blur"&&typeof $e=="number"&&($e=ph($e,b,v)),O&&typeof $e=="string"&&Ut($e)<15&&($e=LL($e,v,b)),be!==$e&&ve($e),E==null||E(xe)};Ku(L,{increment:xt.current,decrement:Ht.current});const Ve=xe=>{xe?xt.current():Ht.current(),Re.current+=1},Te=xe=>{if(Ve(xe),Ge){const $e=typeof P=="number"?P:P(Re.current);et.current=window.setTimeout(()=>Te(xe),$e)}},ge=(xe,$e)=>{var gt;xe.preventDefault(),(gt=ke.current)==null||gt.focus(),Ve($e),Ge&&(et.current=window.setTimeout(()=>Te($e),I))},we=()=>{et.current&&window.clearTimeout(et.current),et.current=null,Re.current=0},Le=s.jsxs("div",{...Z("controls"),children:[s.jsx(tr,{...Z("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof be=="number"&&v!==void 0&&be>=v,mod:{direction:"up"},onMouseDown:xe=>xe.preventDefault(),onPointerDown:xe=>{ge(xe,!0)},onPointerUp:we,onPointerLeave:we,children:s.jsx(FC,{direction:"up"})}),s.jsx(tr,{...Z("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof be=="number"&&b!==void 0&&be<=b,mod:{direction:"down"},onMouseDown:xe=>xe.preventDefault(),onPointerDown:xe=>{ge(xe,!1)},onPointerUp:we,onPointerLeave:we,children:s.jsx(FC,{direction:"down"})})]});return s.jsx(Pr,{component:_L,allowNegative:Q,className:$t(Ey.root,r),size:W,...U,readOnly:J,disabled:V,value:be,getInputRef:Un(t,ke),onValueChange:ft,rightSection:j||J||!Iv(be)?C:C||Le,classNames:ee,styles:ye,unstyled:c,__staticSelector:"NumberInput",decimalScale:T?A:0,onKeyDown:Bt,onKeyDownCapture:Se,rightSectionPointerEvents:X??(V?"none":void 0),rightSectionWidth:Y??`var(--ni-right-section-width-${W||"sm"})`,allowLeadingZeros:z,onBlur:Ne,isAllowed:xe=>D==="strict"?R?R(xe)&&HC(xe.floatValue,b,v):HC(xe.floatValue,b,v):R?R(xe):!0})});Op.classes={...Pr.classes,...Ey};Op.displayName="@mantine/core/NumberInput";const[zL,Mp]=vr("Pagination.Root component was not found in tree");var yd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const $L={withPadding:!0},xd=me((e,t)=>{const n=se("PaginationControl",$L,e),{classNames:r,className:a,style:o,styles:c,vars:u,active:f,disabled:p,withPadding:m,mod:g,...v}=n,b=Mp(),S=p||b.disabled;return s.jsx(tr,{ref:t,disabled:S,mod:[{active:f,disabled:S,"with-padding":m},g],...b.getStyles("control",{className:a,style:o,classNames:r,styles:c,active:!S}),...v})});xd.classes=yd;xd.displayName="@mantine/core/PaginationControl";function bd({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 UL=e=>s.jsx(bd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),BL=e=>s.jsx(bd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),VL=e=>s.jsx(bd,{...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"}),FL=e=>s.jsx(bd,{...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"}),HL=e=>s.jsx(bd,{...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"}),qL={icon:HL},Ip=me((e,t)=>{const n=se("PaginationDots",qL,e),{classNames:r,className:a,style:o,styles:c,vars:u,icon:f,...p}=n,m=Mp(),g=f;return s.jsx(ce,{ref:t,...m.getStyles("dots",{className:a,style:o,styles:c,classNames:r}),...p,children:s.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Ip.classes=yd;Ip.displayName="@mantine/core/PaginationDots";function Lp({icon:e,name:t,action:n,type:r}){const a={icon:e},o=y.forwardRef((c,u)=>{const{icon:f,...p}=se(t,a,c),m=f,g=Mp(),v=r==="next"?g.active===g.total:g.active===1;return s.jsx(xd,{disabled:g.disabled||v,ref:u,onClick:g[n],withPadding:!1,...p,children:s.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return o.displayName=`@mantine/core/${t}`,o}const wD=Lp({icon:UL,name:"PaginationNext",action:"onNext",type:"next"}),jD=Lp({icon:BL,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),CD=Lp({icon:VL,name:"PaginationFirst",action:"onFirst",type:"previous"}),ED=Lp({icon:FL,name:"PaginationLast",action:"onLast",type:"next"});function T0({dotsIcon:e}){const t=Mp(),n=t.range.map((r,a)=>{var o,c,u;return r==="dots"?s.jsx(Ip,{icon:e},a):s.jsx(xd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(o=t.getItemProps)==null?void 0:o.call(t,r),children:((u=(c=t.getItemProps)==null?void 0:c.call(t,r))==null?void 0:u.children)??r},a)});return s.jsx(s.Fragment,{children:n})}T0.displayName="@mantine/core/PaginationItems";const GL={siblings:1,boundaries:1},QL=(e,{size:t,radius:n,color:r,autoContrast:a})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ft(n),"--pagination-control-size":nt(t,"pagination-control-size"),"--pagination-control-fz":Mn(t),"--pagination-active-bg":r?Gt(r,e):void 0,"--pagination-active-color":Qs(a,e)?Qi({color:r,theme:e,autoContrast:a}):void 0}}),zp=me((e,t)=>{const n=se("PaginationRoot",GL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,total:p,value:m,defaultValue:g,onChange:v,disabled:b,siblings:S,boundaries:j,color:C,radius:R,onNextPage:D,onPreviousPage:E,onFirstPage:T,onLastPage:A,getItemProps:_,autoContrast:M,...L}=n,$=Me({name:"Pagination",classes:yd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:QL}),{range:V,setPage:X,next:Q,previous:J,active:W,first:Y,last:P}=pN({page:m,initialPage:g,onChange:v,total:p,siblings:S,boundaries:j}),I=Rr(D,Q),z=Rr(E,J),F=Rr(T,Y),O=Rr(A,P);return s.jsx(zL,{value:{total:p,range:V,active:W,disabled:b,getItemProps:_,onChange:X,onNext:I,onPrevious:z,onFirst:F,onLast:O,getStyles:$},children:s.jsx(ce,{ref:t,...$("root"),...L})})});zp.classes=yd;zp.displayName="@mantine/core/PaginationRoot";const WL={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},$a=me((e,t)=>{const n=se("Pagination",WL,e),{withEdges:r,withControls:a,getControlProps:o,nextIcon:c,previousIcon:u,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:v,hideWithOnePage:b,withPages:S,...j}=n;return g<=0||b&&g===1?null:s.jsx(zp,{ref:t,total:g,...j,children:s.jsxs(Ce,{gap:v,children:[r&&s.jsx(CD,{icon:p,...o==null?void 0:o("first")}),a&&s.jsx(jD,{icon:u,...o==null?void 0:o("previous")}),S&&s.jsx(T0,{dotsIcon:m}),a&&s.jsx(wD,{icon:c,...o==null?void 0:o("next")}),r&&s.jsx(ED,{icon:f,...o==null?void 0:o("last")})]})})});$a.classes=yd;$a.displayName="@mantine/core/Pagination";$a.Root=zp;$a.Control=xd;$a.Dots=Ip;$a.First=CD;$a.Last=ED;$a.Next=wD;$a.Previous=jD;$a.Items=T0;const YL=({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 Ry={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const KL={visibilityToggleIcon:YL},XL=(e,{size:t})=>({root:{"--psi-icon-size":nt(t,"psi-icon-size"),"--psi-button-size":nt(t,"psi-button-size")}}),Na=me((e,t)=>{const n=se("PasswordInput",KL,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,required:p,error:m,leftSection:g,disabled:v,id:b,variant:S,inputContainer:j,description:C,label:R,size:D,errorProps:E,descriptionProps:T,labelProps:A,withAsterisk:_,inputWrapperOrder:M,wrapperProps:L,radius:$,rightSection:V,rightSectionWidth:X,rightSectionPointerEvents:Q,leftSectionWidth:J,visible:W,defaultVisible:Y,onVisibilityChange:P,visibilityToggleIcon:I,visibilityToggleButtonProps:z,rightSectionProps:F,leftSectionProps:O,leftSectionPointerEvents:U,withErrorStyles:Z,mod:ee,...ye}=n,be=yr(b),[ve,Ge]=Wn({value:W,defaultValue:Y,finalValue:!1,onChange:P}),ke=()=>Ge(!ve),et=Me({name:"PasswordInput",classes:Ry,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:XL}),{resolvedClassNames:Re,resolvedStyles:ft}=Gs({classNames:r,styles:c,props:n}),{styleProps:Ut,rest:Ot}=Wi(ye),xt=I,Ht=s.jsx(_n,{...et("visibilityToggle"),disabled:v,radius:$,"aria-hidden":!z,tabIndex:-1,...z,variant:(z==null?void 0:z.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:Bt=>{var Se;Bt.preventDefault(),(Se=z==null?void 0:z.onTouchEnd)==null||Se.call(z,Bt),ke()},onMouseDown:Bt=>{var Se;Bt.preventDefault(),(Se=z==null?void 0:z.onMouseDown)==null||Se.call(z,Bt),ke()},onKeyDown:Bt=>{var Se;(Se=z==null?void 0:z.onKeyDown)==null||Se.call(z,Bt),Bt.key===" "&&(Bt.preventDefault(),ke())},children:s.jsx(xt,{reveal:ve})});return s.jsx(pn.Wrapper,{required:p,id:be,label:R,error:m,description:C,size:D,classNames:Re,styles:ft,__staticSelector:"PasswordInput",errorProps:E,descriptionProps:T,unstyled:u,withAsterisk:_,inputWrapperOrder:M,inputContainer:j,variant:S,labelProps:{...A,htmlFor:be},mod:ee,...et("root"),...Ut,...L,children:s.jsx(pn,{component:"div",error:m,leftSection:g,size:D,classNames:{...Re,input:$t(Ry.input,Re.input)},styles:ft,radius:$,disabled:v,__staticSelector:"PasswordInput",rightSectionWidth:X,rightSection:V??Ht,variant:S,unstyled:u,leftSectionWidth:J,rightSectionPointerEvents:Q||"all",rightSectionProps:F,leftSectionProps:O,leftSectionPointerEvents:U,withAria:!1,withErrorStyles:Z,children:s.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...et("innerInput"),disabled:v,id:be,ref:t,...Ot,autoComplete:Ot.autoComplete||"off",type:ve?"text":"password"})})})});Na.classes={...Pr.classes,...Ry};Na.displayName="@mantine/core/PasswordInput";const[ZL,TD]=qi(),[JL,e6]=qi();var RD={card:"m_9dc8ae12"};const t6={withBorder:!0},n6=(e,{radius:t})=>({card:{"--card-radius":Ft(t)}}),R0=me((e,t)=>{const n=se("RadioCard",t6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,checked:p,mod:m,withBorder:g,value:v,onClick:b,name:S,onKeyDown:j,...C}=n,R=Me({name:"RadioCard",classes:RD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:n6,rootSelector:"card"}),{dir:D}=Ys(),E=TD(),T=typeof p=="boolean"?p:(E==null?void 0:E.value)===v||!1,A=S||(E==null?void 0:E.name),_=M=>{if(j==null||j(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const L=Array.from(document.querySelectorAll(`[role="radio"][name="${A||"__mantine"}"]`)),$=L.findIndex(Q=>Q===M.target),V=$+1>=L.length?0:$+1,X=$-1<0?L.length-1:$-1;M.nativeEvent.code==="ArrowDown"&&(L[V].focus(),L[V].click()),M.nativeEvent.code==="ArrowUp"&&(L[X].focus(),L[X].click()),M.nativeEvent.code==="ArrowLeft"&&(L[D==="ltr"?X:V].focus(),L[D==="ltr"?X:V].click()),M.nativeEvent.code==="ArrowRight"&&(L[D==="ltr"?V:X].focus(),L[D==="ltr"?V:X].click())}};return s.jsx(JL,{value:{checked:T},children:s.jsx(tr,{ref:t,mod:[{"with-border":g,checked:T},m],...R("card"),...C,role:"radio","aria-checked":T,name:A,onClick:M=>{b==null||b(M),E==null||E.onChange(v||"")},onKeyDown:_})})});R0.displayName="@mantine/core/RadioCard";R0.classes=RD;const r6={},D0=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,name:f,readOnly:p,...m}=se("RadioGroup",r6,e),g=yr(f),[v,b]=Wn({value:n,defaultValue:r,finalValue:"",onChange:a}),S=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return s.jsx(ZL,{value:{value:v,onChange:S,size:o,name:g},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(e0,{role:"radiogroup",children:u})})})});D0.classes=pn.Wrapper.classes;D0.displayName="@mantine/core/RadioGroup";function DD({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:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var AD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const a6={icon:DD},i6=(e,{radius:t,color:n,size:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:n||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":nt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ft(t),"--radio-color":o==="outline"?f:Gt(n,e),"--radio-icon-size":nt(r,"radio-icon-size"),"--radio-icon-color":a?Gt(a,e):Qs(c,e)?Qi({color:n,theme:e,autoContrast:c}):void 0}}},A0=me((e,t)=>{const n=se("RadioIndicator",a6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,icon:p,radius:m,color:g,iconColor:v,autoContrast:b,checked:S,mod:j,variant:C,disabled:R,...D}=n,E=p,T=Me({name:"RadioIndicator",classes:AD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:i6,rootSelector:"indicator"}),A=e6(),_=typeof S=="boolean"?S:(A==null?void 0:A.checked)||!1;return s.jsx(ce,{ref:t,...T("indicator",{variant:C}),variant:C,mod:[{checked:_,disabled:R},j],...D,children:s.jsx(E,{...T("icon")})})});A0.displayName="@mantine/core/RadioIndicator";A0.classes=AD;var _D={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const o6={labelPosition:"right"},s6=(e,{size:t,radius:n,color:r,iconColor:a,variant:o,autoContrast:c})=>{const u=da({color:r||e.primaryColor,theme:e}),f=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":nt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ft(n),"--radio-color":o==="outline"?f:Gt(r,e),"--radio-icon-color":a?Gt(a,e):Qs(c,e)?Qi({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":nt(t,"radio-icon-size")}}},Ls=me((e,t)=>{const n=se("Radio",o6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,id:p,size:m,label:g,labelPosition:v,description:b,error:S,radius:j,color:C,variant:R,disabled:D,wrapperProps:E,icon:T=DD,rootRef:A,iconColor:_,onChange:M,mod:L,...$}=n,V=Me({name:"Radio",classes:_D,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:s6}),X=TD(),Q=(X==null?void 0:X.size)??m,J=n.size?m:Q,{styleProps:W,rest:Y}=Wi($),P=yr(p),I=X?{checked:X.value===Y.value,name:Y.name??X.name,onChange:z=>{X.onChange(z),M==null||M(z)}}:{};return s.jsx(bp,{...V("root"),__staticSelector:"Radio",__stylesApiProps:n,id:P,size:J,labelPosition:v,label:g,description:b,error:S,disabled:D,classNames:r,styles:c,unstyled:u,"data-checked":I.checked||void 0,variant:R,ref:A,mod:L,...W,...E,children:s.jsxs(ce,{...V("inner"),mod:{"label-position":v},children:[s.jsx(ce,{...V("radio",{focusable:!0,variant:R}),onChange:M,...Y,...I,component:"input",mod:{error:!!S},ref:t,id:P,disabled:D,type:"radio"}),s.jsx(T,{...V("icon"),"aria-hidden":!0})]})})});Ls.classes=_D;Ls.displayName="@mantine/core/Radio";Ls.Group=D0;Ls.Card=R0;Ls.Indicator=A0;const l6={duration:100,transition:"fade"};function c6(e,t){return{...l6,...t,...e}}function u6({offset:e,position:t,defaultOpened:n}){const[r,a]=y.useState(n),o=y.useRef(null),{x:c,y:u,elements:f,refs:p,update:m,placement:g}=Rx({placement:t,middleware:[jx({crossAxis:!0,padding:5,rootBoundary:"document"})]}),v=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,S=y.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+v,top:C+b,right:j,bottom:C}}})},[f.reference]);return y.useEffect(()=>{if(p.floating.current){const j=o.current;j.addEventListener("mousemove",S);const C=Li(p.floating.current);return C.forEach(R=>{R.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",S),C.forEach(R=>{R.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,S,r]),{handleMouseMove:S,x:c,y:u,opened:r,setOpened:a,boundaryRef:o,floating:p.setFloating}}var $p={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const d6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Wr("popover")},f6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ft(t),"--tooltip-bg":n?Gt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),_0=me((e,t)=>{const n=se("TooltipFloating",d6,e),{children:r,refProp:a,withinPortal:o,style:c,className:u,classNames:f,styles:p,unstyled:m,radius:g,color:v,label:b,offset:S,position:j,multiline:C,zIndex:R,disabled:D,defaultOpened:E,variant:T,vars:A,portalProps:_,...M}=n,L=Sn(),$=Me({name:"TooltipFloating",props:n,classes:$p,className:u,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:A,varsResolver:f6}),{handleMouseMove:V,x:X,y:Q,opened:J,boundaryRef:W,floating:Y,setOpened:P}=u6({offset:S,position:j,defaultOpened:E});if(!Hi(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const I=Un(W,op(r),t),z=r.props,F=U=>{var Z;(Z=z.onMouseEnter)==null||Z.call(z,U),V(U),P(!0)},O=U=>{var Z;(Z=z.onMouseLeave)==null||Z.call(z,U),P(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Ho,{..._,withinPortal:o,children:s.jsx(ce,{...M,...$("tooltip",{style:{...wR(c,L),zIndex:R,display:!D&&J?"block":"none",top:(Q&&Math.round(Q))??"",left:(X&&Math.round(X))??""}}),variant:T,ref:Y,mod:{multiline:C},children:b})}),y.cloneElement(r,{...z,[a]:I,onMouseEnter:F,onMouseLeave:O})]})});_0.classes=$p;_0.displayName="@mantine/core/TooltipFloating";const kD=y.createContext(!1),h6=kD.Provider,p6=()=>y.useContext(kD),m6={openDelay:0,closeDelay:0};function k0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",m6,e);return s.jsx(h6,{value:!0,children:s.jsx(HM,{delay:{open:t,close:n},children:r})})}k0.displayName="@mantine/core/TooltipGroup";k0.extend=e=>e;function g6(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 v6(e){const t=g6(e.middlewares),n=[UR(e.offset)];return t.shift&&n.push(jx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?kh():kh(t.flip)),n.push(BR({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Gu():Gu(t.inline)):e.inline&&n.push(Gu()),n}function y6(e){var _,M,L;const[t,n]=y.useState(e.defaultOpened),a=typeof e.opened=="boolean"?e.opened:t,o=p6(),c=yr(),u=y.useCallback($=>{n($),$&&D(c)},[c]),{x:f,y:p,context:m,refs:g,update:v,placement:b,middlewareData:{arrow:{x:S,y:j}={}}}=Rx({strategy:e.strategy,placement:e.position,open:a,onOpenChange:u,middleware:v6(e)}),{delay:C,currentId:R,setCurrentId:D}=qM(m,{id:c}),{getReferenceProps:E,getFloatingProps:T}=ZM([VM(m,{enabled:(_=e.events)==null?void 0:_.hover,delay:o?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),XM(m,{enabled:(L=e.events)==null?void 0:L.focus,visibleOnly:!0}),e9(m,{role:"tooltip"}),YM(m,{enabled:typeof e.opened>"u"})]);h2({opened:a,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),$i(()=>{var $;($=e.onPositionChange)==null||$.call(e,b)},[b]);const A=a&&R&&R!==c;return{x:f,y:p,arrowX:S,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:T,getReferenceProps:E,isGroupPhase:A,opened:a,placement:b}}const qC={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:Wr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},x6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ft(t),"--tooltip-bg":n?Gt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Xs=me((e,t)=>{const n=se("Tooltip",qC,e),{children:r,position:a,refProp:o,label:c,openDelay:u,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:v,radius:b,color:S,classNames:j,styles:C,unstyled:R,style:D,className:E,withArrow:T,arrowSize:A,arrowOffset:_,arrowRadius:M,arrowPosition:L,offset:$,transitionProps:V,multiline:X,events:Q,zIndex:J,disabled:W,positionDependencies:Y,onClick:P,onMouseEnter:I,onMouseLeave:z,inline:F,variant:O,keepMounted:U,vars:Z,portalProps:ee,mod:ye,floatingStrategy:be,middlewares:ve,...Ge}=se("Tooltip",qC,n),{dir:ke}=Ys(),et=y.useRef(null),Re=y6({position:o2(ke,a),closeDelay:f,openDelay:u,onPositionChange:p,opened:m,defaultOpened:g,events:Q,arrowRef:et,arrowOffset:_,offset:typeof $=="number"?$+(T?A/2:0):$,positionDependencies:[...Y,r],inline:F,strategy:be,middlewares:ve}),ft=Me({name:"Tooltip",props:n,classes:$p,className:E,style:D,classNames:j,styles:C,unstyled:R,rootSelector:"tooltip",vars:Z,varsResolver:x6});if(!Hi(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const Ut=Un(Re.reference,op(r),t),Ot=c6(V,{duration:100,transition:"fade"}),xt=r.props;return s.jsxs(s.Fragment,{children:[s.jsx(Ho,{...ee,withinPortal:v,children:s.jsx(hi,{...Ot,keepMounted:U,mounted:!W&&!!Re.opened,duration:Re.isGroupPhase?10:Ot.duration,children:Ht=>s.jsxs(ce,{...Ge,"data-fixed":be==="fixed"||void 0,variant:O,mod:[{multiline:X},ye],...Re.getFloatingProps({ref:Re.floating,className:ft("tooltip").className,style:{...ft("tooltip").style,...Ht,zIndex:J,top:Re.y??0,left:Re.x??0}}),children:[c,s.jsx(kx,{ref:et,arrowX:Re.arrowX,arrowY:Re.arrowY,visible:T,position:Re.placement,arrowSize:A,arrowOffset:_,arrowRadius:M,arrowPosition:L,...ft("arrow")})]})})}),y.cloneElement(r,Re.getReferenceProps({onClick:P,onMouseEnter:I,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:$t(E,xt.className),...xt,[o]:Ut}))]})});Xs.classes=$p;Xs.displayName="@mantine/core/Tooltip";Xs.Floating=_0;Xs.Group=k0;function b6({size:e,thickness:t,sum:n,value:r,root:a,offset:o}){const c=(e*.9-t*2)/2,u=Math.PI*c*2/100,f=a||r===void 0?`${(100-n)*u}, ${n*u}`:`${r*u}, ${(100-r)*u}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:a?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:a?0:o||0}}function PD({size:e,value:t,offset:n,sum:r,thickness:a,root:o,color:c,lineRoundCaps:u,tooltip:f,getStyles:p,display:m,...g}){const v=Sn();return s.jsx(Xs.Floating,{disabled:!f,label:f,children:s.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Gt(c,v):void 0},fill:"none",strokeLinecap:u?"round":"butt",...b6({sum:r,size:e,thickness:a,value:t,offset:n,root:o})})})}PD.displayName="@mantine/core/Curve";function S6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:a}){const o=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let u=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:o,offset:u,data:n[m],root:!1}),u-=n[m].value/100*c;if(f.push({sum:o,offset:u,data:{color:a},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var ND={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function w6(e,t){return Math.min(e||12,(t||120)/4)}const j6={size:120,thickness:12},C6=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Up=me((e,t)=>{const n=se("RingProgress",j6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,label:p,sections:m,size:g,thickness:v,roundCaps:b,rootColor:S,transitionDuration:j,...C}=n,R=Me({name:"RingProgress",classes:ND,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:C6}),D=w6(v,g),E=S6({size:g,thickness:D,sections:m,renderRoundedLineCaps:b,rootColor:S}).map(({data:T,sum:A,root:_,lineRoundCaps:M,offset:L},$)=>y.createElement(PD,{...T,key:$,size:g,thickness:D,sum:A,offset:L,color:T==null?void 0:T.color,root:_,lineRoundCaps:M,getStyles:R}));return s.jsxs(ce,{...R("root"),size:g,ref:t,...C,children:[s.jsx("svg",{...R("svg"),children:E}),p&&s.jsx("div",{...R("label"),children:p})]})});Up.classes=ND;Up.displayName="@mantine/core/RingProgress";var OD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const E6={withItemsBorders:!0},T6=(e,{radius:t,color:n,transitionDuration:r,size:a,transitionTimingFunction:o})=>({root:{"--sc-radius":t===void 0?void 0:Ft(t),"--sc-color":n?Gt(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":o,"--sc-padding":nt(a,"sc-padding"),"--sc-font-size":Mn(a)}}),Bp=me((e,t)=>{var ke,et;const n=se("SegmentedControl",E6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,data:p,value:m,defaultValue:g,onChange:v,size:b,name:S,disabled:j,readOnly:C,fullWidth:R,orientation:D,radius:E,color:T,transitionDuration:A,transitionTimingFunction:_,variant:M,autoContrast:L,withItemsBorders:$,mod:V,...X}=n,Q=Me({name:"SegmentedControl",props:n,classes:OD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:T6}),J=Sn(),W=p.map(Re=>typeof Re=="string"?{label:Re,value:Re}:Re),Y=bN(),[P,I]=y.useState(Th()),[z,F]=y.useState(null),[O,U]=y.useState({}),Z=(Re,ft)=>{O[ft]=Re,U(O)},[ee,ye]=Wn({value:m,defaultValue:g,finalValue:Array.isArray(p)?((ke=W.find(Re=>!Re.disabled))==null?void 0:ke.value)??((et=p[0])==null?void 0:et.value)??null:null,onChange:v}),be=yr(S),ve=W.map(Re=>y.createElement(ce,{...Q("control"),mod:{active:ee===Re.value,orientation:D},key:Re.value},y.createElement("input",{...Q("input"),disabled:j||Re.disabled,type:"radio",name:be,value:Re.value,id:`${be}-${Re.value}`,checked:ee===Re.value,onChange:()=>!C&&ye(Re.value),"data-focus-ring":J.focusRing,key:`${Re.value}-input`}),y.createElement(ce,{component:"label",...Q("label"),mod:{active:ee===Re.value&&!(j||Re.disabled),disabled:j||Re.disabled,"read-only":C},htmlFor:`${be}-${Re.value}`,ref:ft=>Z(ft,Re.value),__vars:{"--sc-label-color":T!==void 0?Qi({color:T,theme:J,autoContrast:L}):void 0},key:`${Re.value}-label`},s.jsx("span",{...Q("innerLabel"),children:Re.label})))),Ge=Un(t,Re=>F(Re));return vN(()=>{I(Th())},[p.length]),p.length===0?null:s.jsxs(ce,{...Q("root"),variant:M,size:b,ref:Ge,mod:[{"full-width":R,orientation:D,initialized:Y,"with-items-borders":$},V],...X,role:"radiogroup","data-disabled":j,children:[typeof ee=="string"&&s.jsx(Lx,{target:O[ee],parent:z,component:"span",transitionDuration:"var(--sc-transition-duration)",...Q("indicator")},P),ve]})});Bp.classes=OD;Bp.displayName="@mantine/core/SegmentedControl";function R6({spacing:e,verticalSpacing:t,cols:n,selector:r}){var m;const a=Sn(),o=t===void 0?e:t,c=Fo({"--sg-spacing-x":On(ka(e)),"--sg-spacing-y":On(ka(o)),"--sg-cols":(m=ka(n))==null?void 0:m.toString()}),u=sn(a.breakpoints).reduce((g,v)=>(g[v]||(g[v]={}),typeof e=="object"&&e[v]!==void 0&&(g[v]["--sg-spacing-x"]=On(e[v])),typeof o=="object"&&o[v]!==void 0&&(g[v]["--sg-spacing-y"]=On(o[v])),typeof n=="object"&&n[v]!==void 0&&(g[v]["--sg-cols"]=n[v]),g),{}),p=Yu(sn(u),a.breakpoints).filter(g=>sn(u[g.value]).length>0).map(g=>({query:`(min-width: ${a.breakpoints[g.value]})`,styles:u[g.value]}));return s.jsx(Ws,{styles:c,media:p,selector:r})}function Lv(e){return typeof e=="object"&&e!==null?sn(e):[]}function D6(e){return e.sort((t,n)=>Wu(t)-Wu(n))}function A6({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Lv(e),...Lv(t),...Lv(n)]));return D6(r)}function _6({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const a=t===void 0?e:t,o=Fo({"--sg-spacing-x":On(ka(e)),"--sg-spacing-y":On(ka(a)),"--sg-cols":(p=ka(n))==null?void 0:p.toString()}),c=A6({spacing:e,verticalSpacing:t,cols:n}),u=c.reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=On(e[g])),typeof a=="object"&&a[g]!==void 0&&(m[g]["--sg-spacing-y"]=On(a[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),f=c.map(m=>({query:`simple-grid (min-width: ${m})`,styles:u[m]}));return s.jsx(Ws,{styles:o,container:f,selector:r})}var MD={container:"m_925c2d2c",root:"m_2415a157"};const k6={cols:1,spacing:"md",type:"media"},P0=me((e,t)=>{const n=se("SimpleGrid",k6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,cols:p,verticalSpacing:m,spacing:g,type:v,...b}=n,S=Me({name:"SimpleGrid",classes:MD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f}),j=ud();return v==="container"?s.jsxs(s.Fragment,{children:[s.jsx(_6,{...n,selector:`.${j}`}),s.jsx("div",{...S("container"),children:s.jsx(ce,{ref:t,...S("root",{className:j}),...b})})]}):s.jsxs(s.Fragment,{children:[s.jsx(R6,{...n,selector:`.${j}`}),s.jsx(ce,{ref:t,...S("root",{className:j}),...b})]})});P0.classes=MD;P0.displayName="@mantine/core/SimpleGrid";const P6={},Vp=me((e,t)=>{const{w:n,h:r,miw:a,mih:o,...c}=se("Space",P6,e);return s.jsx(ce,{ref:t,...c,w:n,miw:a??n,h:r,mih:o??r})});Vp.displayName="@mantine/core/Space";var ID={root:"m_6d731127"};const N6={gap:"md",align:"stretch",justify:"flex-start"},O6=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":On(t),"--stack-align":n,"--stack-justify":r}}),We=me((e,t)=>{const n=se("Stack",N6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,align:p,justify:m,gap:g,variant:v,...b}=n,S=Me({name:"Stack",props:n,classes:ID,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:O6});return s.jsx(ce,{ref:t,...S("root"),variant:v,...b})});We.classes=ID;We.displayName="@mantine/core/Stack";const[M6,I6]=vr("Stepper component was not found in tree"),Nh=()=>null;Nh.displayName="@mantine/core/StepperCompleted";var N0={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 ah=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,L6={withIcon:!0,allowStepClick:!0,iconPosition:"left"},O0=me((e,t)=>{const{classNames:n,className:r,style:a,styles:o,vars:c,step:u,state:f,color:p,icon:m,completedIcon:g,progressIcon:v,label:b,description:S,withIcon:j,iconSize:C,loading:R,allowStepClick:D,allowStepSelect:E,iconPosition:T,orientation:A,mod:_,...M}=se("StepperStep",L6,e),L=I6(),$=Sn(),V={classNames:n,styles:o},X=f==="stepCompleted"?null:f==="stepProgress"?v:m,Q={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return s.jsxs(tr,{...L.getStyles("step",{className:r,style:a,variant:L.orientation,...V}),mod:[{"icon-position":T||L.iconPosition,"allow-click":D},_],ref:t,...Q,...M,__vars:{"--step-color":p?Gt(p,$):void 0},tabIndex:D?0:-1,children:[j&&s.jsxs("span",{...L.getStyles("stepWrapper",V),children:[s.jsxs("span",{...L.getStyles("stepIcon",V),...Q,children:[s.jsx(hi,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:J=>s.jsx("span",{...L.getStyles("stepCompletedIcon",{style:J,...V}),children:R?s.jsx(_r,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...L.getStyles("stepLoader",V)}):ah(g,u)||s.jsx(Sp,{size:"60%"})})}),f!=="stepCompleted"?R?s.jsx(_r,{...L.getStyles("stepLoader",V),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ah(X||m,u):null]}),A==="vertical"&&s.jsx("span",{...L.getStyles("verticalSeparator",V),"data-active":f==="stepCompleted"||void 0})]}),(b||S)&&s.jsxs("span",{...L.getStyles("stepBody",V),"data-orientation":L.orientation,"data-icon-position":T||L.iconPosition,children:[b&&s.jsx("span",{...L.getStyles("stepLabel",V),children:ah(b,u)}),S&&s.jsx("span",{...L.getStyles("stepDescription",V),children:ah(S,u)})]})]})});O0.classes=N0;O0.displayName="@mantine/core/StepperStep";const z6={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},$6=(e,{color:t,iconSize:n,size:r,contentPadding:a,radius:o,autoContrast:c})=>({root:{"--stepper-color":t?Gt(t,e):void 0,"--stepper-icon-color":Qs(c,e)?Qi({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?nt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":On(a),"--stepper-radius":o===void 0?void 0:Ft(o),"--stepper-fz":Mn(r),"--stepper-spacing":On(r)}}),mc=me((e,t)=>{var z,F,O;const n=se("Stepper",z6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,onStepClick:m,active:g,icon:v,completedIcon:b,progressIcon:S,color:j,iconSize:C,contentPadding:R,orientation:D,iconPosition:E,size:T,radius:A,allowNextStepsSelect:_,wrap:M,autoContrast:L,...$}=n,V=Me({name:"Stepper",classes:N0,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:$6}),X=y.Children.toArray(p),Q=X.filter(U=>U.type!==Nh),J=X.find(U=>U.type===Nh),W=Q.reduce((U,Z,ee)=>{const ye=g===ee?"stepProgress":g>ee?"stepCompleted":"stepInactive",ve=typeof m!="function"?!1:typeof Z.props.allowStepSelect=="boolean"?Z.props.allowStepSelect:ye==="stepCompleted"||_;return U.push(y.cloneElement(Z,{icon:Z.props.icon||v||ee+1,key:ee,step:ee,state:ye,onClick:()=>ve&&(m==null?void 0:m(ee)),allowStepClick:ve,completedIcon:Z.props.completedIcon||b,progressIcon:Z.props.progressIcon||S,color:Z.props.color||j,iconSize:C,iconPosition:Z.props.iconPosition||E,orientation:D})),D==="horizontal"&&ee!==Q.length-1&&U.push(y.createElement("div",{...V("separator"),"data-active":ee<g||void 0,"data-orientation":D,key:`separator-${ee}`})),U},[]),Y=(F=(z=Q[g])==null?void 0:z.props)==null?void 0:F.children,P=(O=J==null?void 0:J.props)==null?void 0:O.children,I=g>Q.length-1?P:Y;return s.jsx(M6,{value:{getStyles:V,orientation:D,iconPosition:E},children:s.jsxs(ce,{...V("root"),ref:t,size:T,...$,children:[s.jsx(ce,{...V("steps"),mod:{orientation:D,"icon-position":E,wrap:M&&D!=="vertical"},children:W}),I&&s.jsx("div",{...V("content"),children:I})]})})});mc.classes=N0;mc.displayName="@mantine/core/Stepper";mc.Completed=Nh;mc.Step=O0;const LD=y.createContext(null),U6=LD.Provider,B6=()=>y.useContext(LD),V6={},M0=me((e,t)=>{const{value:n,defaultValue:r,onChange:a,size:o,wrapperProps:c,children:u,readOnly:f,...p}=se("SwitchGroup",V6,e),[m,g]=Wn({value:n,defaultValue:r,finalValue:[],onChange:a}),v=b=>{const S=b.currentTarget.value;!f&&g(m.includes(S)?m.filter(j=>j!==S):[...m,S])};return s.jsx(U6,{value:{value:m,onChange:v,size:o},children:s.jsx(pn.Wrapper,{size:o,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(e0,{role:"group",children:u})})})});M0.classes=pn.Wrapper.classes;M0.displayName="@mantine/core/SwitchGroup";var zD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const F6={labelPosition:"right"},H6=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ft(t),"--switch-height":nt(r,"switch-height"),"--switch-width":nt(r,"switch-width"),"--switch-thumb-size":nt(r,"switch-thumb-size"),"--switch-label-font-size":nt(r,"switch-label-font-size"),"--switch-track-label-padding":nt(r,"switch-track-label-padding"),"--switch-color":n?Gt(n,e):void 0}}),Sd=me((e,t)=>{const n=se("Switch",F6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,color:p,label:m,offLabel:g,onLabel:v,id:b,size:S,radius:j,wrapperProps:C,thumbIcon:R,checked:D,defaultChecked:E,onChange:T,labelPosition:A,description:_,error:M,disabled:L,variant:$,rootRef:V,mod:X,...Q}=n,J=B6(),W=S||(J==null?void 0:J.size),Y=Me({name:"Switch",props:n,classes:zD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:H6}),{styleProps:P,rest:I}=Wi(Q),z=yr(b),F=J?{checked:J.value.includes(I.value),onChange:J.onChange}:{},[O,U]=Wn({value:F.checked??D,defaultValue:E,finalValue:!1});return s.jsxs(bp,{...Y("root"),__staticSelector:"Switch",__stylesApiProps:n,id:z,size:W,labelPosition:A,label:m,description:_,error:M,disabled:L,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:u,"data-checked":F.checked||D||void 0,variant:$,ref:V,mod:X,...P,...C,children:[s.jsx("input",{...I,disabled:L,checked:O,"data-checked":F.checked||D||void 0,onChange:Z=>{var ee;J?(ee=F.onChange)==null||ee.call(F,Z):T==null||T(Z),U(Z.currentTarget.checked)},id:z,ref:t,type:"checkbox",role:"switch",...Y("input")}),s.jsxs(ce,{"aria-hidden":"true",mod:{error:M,"label-position":A,"without-labels":!v&&!g},...Y("track"),children:[s.jsx(ce,{component:"span",mod:"reduce-motion",...Y("thumb"),children:R}),s.jsx("span",{...Y("trackLabel"),children:O?v:g})]})]})});Sd.classes={...zD,...F2};Sd.displayName="@mantine/core/Switch";Sd.Group=M0;const[q6,G6]=vr("Table component was not found in the tree");var wd={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 Q6(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 Zs(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=me((a,o)=>{const c=se(n,{},a),{classNames:u,className:f,style:p,styles:m,...g}=c,v=G6();return s.jsx(ce,{component:e,ref:o,...Q6(v,t),...v.getStyles(e,{className:f,classNames:u,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=wd,r}const Dy=Zs("th",{columnBorder:!0}),$D=Zs("td",{columnBorder:!0}),vh=Zs("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),UD=Zs("thead",{stickyHeader:!0}),BD=Zs("tbody"),VD=Zs("tfoot"),FD=Zs("caption",{captionSide:!0});function I0({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(FD,{children:e.caption}),e.head&&s.jsx(UD,{children:s.jsx(vh,{children:e.head.map((t,n)=>s.jsx(Dy,{children:t},n))})}),e.body&&s.jsx(BD,{children:e.body.map((t,n)=>s.jsx(vh,{children:t.map((r,a)=>s.jsx($D,{children:r},a))},n))}),e.foot&&s.jsx(VD,{children:s.jsx(vh,{children:e.foot.map((t,n)=>s.jsx(Dy,{children:t},n))})})]})}I0.displayName="@mantine/core/TableDataRenderer";const W6={type:"scrollarea"},Y6=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),L0=me((e,t)=>{const n=se("TableScrollContainer",W6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,children:p,minWidth:m,maxHeight:g,type:v,...b}=n,S=Me({name:"TableScrollContainer",classes:wd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Y6,rootSelector:"scrollContainer"});return s.jsx(ce,{component:v==="scrollarea"?Yr:"div",...v==="scrollarea"?g?{offsetScrollbars:"xy"}:{offsetScrollbars:"x"}:{},ref:t,...S("scrollContainer"),...b,children:s.jsx("div",{...S("scrollContainerInner"),children:p})})});L0.classes=wd;L0.displayName="@mantine/core/TableScrollContainer";const K6={withRowBorders:!0,verticalSpacing:7},X6=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:a,borderColor:o,stripedColor:c,highlightOnHoverColor:u,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":On(r),"--table-vertical-spacing":On(a),"--table-border-color":o?Gt(o,e):void 0,"--table-striped-color":f&&c?Gt(c,e):void 0,"--table-highlight-on-hover-color":p&&u?Gt(u,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),Oe=me((e,t)=>{const n=se("Table",K6,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:v,highlightOnHoverColor:b,striped:S,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,withTableBorder:D,borderColor:E,layout:T,variant:A,data:_,children:M,stickyHeader:L,stickyHeaderOffset:$,mod:V,tabularNums:X,...Q}=n,J=Me({name:"Table",props:n,className:a,style:o,classes:wd,classNames:r,styles:c,unstyled:u,rootSelector:"table",vars:f,varsResolver:X6});return s.jsx(q6,{value:{getStyles:J,stickyHeader:L,striped:S===!0?"odd":S||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:R,captionSide:g||"bottom"},children:s.jsx(ce,{component:"table",variant:A,ref:t,mod:[{"data-with-table-border":D,"data-tabular-nums":X},V],...J("table"),...Q,children:M||!!_&&s.jsx(I0,{data:_})})})});Oe.classes=wd;Oe.displayName="@mantine/core/Table";Oe.Td=$D;Oe.Th=Dy;Oe.Tr=vh;Oe.Thead=UD;Oe.Tbody=BD;Oe.Tfoot=VD;Oe.Caption=FD;Oe.ScrollContainer=L0;Oe.DataRenderer=I0;const[Z6,z0]=vr("Tabs component was not found in the tree");var jd={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 J6={},$0=me((e,t)=>{const n=se("TabsList",J6,e),{children:r,className:a,grow:o,justify:c,classNames:u,styles:f,style:p,mod:m,...g}=n,v=z0();return s.jsx(ce,{...g,...v.getStyles("list",{className:a,style:p,classNames:u,styles:f,props:n,variant:v.variant}),ref:t,role:"tablist",variant:v.variant,mod:[{grow:o,orientation:v.orientation,placement:v.orientation==="vertical"&&v.placement,inverted:v.inverted},m],"aria-orientation":v.orientation,__vars:{"--tabs-justify":c},children:r})});$0.classes=jd;$0.displayName="@mantine/core/TabsList";const ez={},U0=me((e,t)=>{const n=se("TabsPanel",ez,e),{children:r,className:a,value:o,classNames:c,styles:u,style:f,mod:p,keepMounted:m,...g}=n,v=z0(),b=v.value===o,S=v.keepMounted||m||b?r:null;return s.jsx(ce,{...g,...v.getStyles("panel",{className:a,classNames:c,styles:u,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:v.orientation},p],role:"tabpanel",id:v.getPanelId(o),"aria-labelledby":v.getTabId(o),children:S})});U0.classes=jd;U0.displayName="@mantine/core/TabsPanel";const tz={},B0=me((e,t)=>{const n=se("TabsTab",tz,e),{className:r,children:a,rightSection:o,leftSection:c,value:u,onClick:f,onKeyDown:p,disabled:m,color:g,style:v,classNames:b,styles:S,vars:j,mod:C,tabIndex:R,...D}=n,E=Sn(),{dir:T}=Ys(),A=z0(),_=u===A.value,M=$=>{A.onChange(A.allowTabDeactivation&&u===A.value?null:u),f==null||f($)},L={classNames:b,styles:S,props:n};return s.jsxs(tr,{...D,...A.getStyles("tab",{className:r,style:v,variant:A.variant,...L}),disabled:m,unstyled:A.unstyled,variant:A.variant,mod:[{active:_,disabled:m,orientation:A.orientation,inverted:A.inverted,placement:A.orientation==="vertical"&&A.placement},C],ref:t,role:"tab",id:A.getTabId(u),"aria-selected":_,tabIndex:R!==void 0?R:_||A.value===null?0:-1,"aria-controls":A.getPanelId(u),onClick:M,__vars:{"--tabs-color":g?Gt(g,E):void 0},onKeyDown:iR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:A.activateTabWithKeyboard,loop:A.loop,orientation:A.orientation||"horizontal",dir:T,onKeyDown:p}),children:[c&&s.jsx("span",{...A.getStyles("tabSection",L),"data-position":"left",children:c}),a&&s.jsx("span",{...A.getStyles("tabLabel",L),children:a}),o&&s.jsx("span",{...A.getStyles("tabSection",L),"data-position":"right",children:o})]})});B0.classes=jd;B0.displayName="@mantine/core/TabsTab";const GC="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",nz={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},rz=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ft(t),"--tabs-color":Gt(n,e),"--tabs-text-color":Qs(r,e)?Qi({color:n,theme:e,autoContrast:r}):void 0}}),It=me((e,t)=>{const n=se("Tabs",nz,e),{defaultValue:r,value:a,onChange:o,orientation:c,children:u,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:j,placement:C,keepMounted:R,classNames:D,styles:E,unstyled:T,className:A,style:_,vars:M,autoContrast:L,mod:$,...V}=n,X=yr(p),[Q,J]=Wn({value:a,defaultValue:r,finalValue:null,onChange:o}),W=Me({name:"Tabs",props:n,classes:jd,className:A,style:_,classNames:D,styles:E,unstyled:T,vars:M,varsResolver:rz});return s.jsx(Z6,{value:{placement:C,value:Q,orientation:c,id:X,loop:f,activateTabWithKeyboard:m,getTabId:Vj(`${X}-tab`,GC),getPanelId:Vj(`${X}-panel`,GC),onChange:J,allowTabDeactivation:g,variant:v,color:b,radius:S,inverted:j,keepMounted:R,unstyled:T,getStyles:W},children:s.jsx(ce,{ref:t,id:X,variant:v,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...W("root"),...V,children:u})})});It.classes=jd;It.displayName="@mantine/core/Tabs";It.Tab=B0;It.Panel=U0;It.List=$0;const az={},ze=me((e,t)=>{const n=se("TextInput",az,e);return s.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ze.classes=Pr.classes;ze.displayName="@mantine/core/TextInput";var HD={root:"m_7341320d"};const iz={},oz=(e,{size:t,radius:n,variant:r,gradient:a,color:o,autoContrast:c})=>{const u=e.variantColorResolver({color:o||e.primaryColor,theme:e,gradient:a,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":nt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ft(n),"--ti-bg":o||r?u.background:void 0,"--ti-color":o||r?u.color:void 0,"--ti-bd":o||r?u.border:void 0}}},V0=me((e,t)=>{const n=se("ThemeIcon",iz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,autoContrast:p,...m}=n,g=Me({name:"ThemeIcon",classes:HD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:oz});return s.jsx(ce,{ref:t,...g("root"),...m})});V0.classes=HD;V0.displayName="@mantine/core/ThemeIcon";const sz=["h1","h2","h3","h4","h5","h6"],lz=["xs","sm","md","lg","xl"];function cz(e,t){const n=t!==void 0?t:`h${e}`;return sz.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:lz.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var qD={root:"m_8a5d1357"};const uz={order:1},dz=(e,{order:t,size:n,lineClamp:r,textWrap:a})=>{const o=cz(t,n);return{root:{"--title-fw":o.fontWeight,"--title-lh":o.lineHeight,"--title-fz":o.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":a}}},Ie=me((e,t)=>{const n=se("Title",uz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,order:f,vars:p,size:m,variant:g,lineClamp:v,textWrap:b,mod:S,...j}=n,C=Me({name:"Title",props:n,classes:qD,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:p,varsResolver:dz});return[1,2,3,4,5,6].includes(f)?s.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof v=="number"},S],size:m,...j}):null});Ie.classes=qD;Ie.displayName="@mantine/core/Title";function fz(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(a){t=typeof a=="function"?a(t):a},setState(a){this.updateState(a),r.forEach(o=>o(t))},initialize(a){n||(t=a,n=!0)},subscribe(a){return r.add(a),()=>r.delete(a)}}}function hz(e){return y.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function pz(e,t,n){const r=[],a=[],o={};for(const c of e){const u=c.position||t;o[u]=o[u]||0,o[u]+=1,o[u]<=n?a.push(c):r.push(c)}return{notifications:a,queue:r}}const mz=()=>fz({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Js=mz(),gz=(e=Js)=>hz(e);function kc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),a=pz(r,n.defaultPosition,n.limit);e.setState({notifications:a.notifications,queue:a.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function _e(e,t=Js){const n=e.id||Th();return kc(t,r=>e.id&&r.some(a=>a.id===e.id)?r:[...r,{...e,id:n}]),n}function GD(e,t=Js){return kc(t,n=>n.filter(r=>{var a;return r.id===e?((a=r.onClose)==null||a.call(r,r),!1):!0})),e}function Rs(e,t=Js){return kc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function vz(e=Js){kc(e,()=>[])}function yz(e=Js){kc(e,t=>t.slice(0,e.getState().limit))}const ca={show:_e,hide:GD,update:Rs,clean:vz,cleanQueue:yz,updateState:kc};function Ay(e,t){return Ay=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ay(e,t)}function QD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Ay(e,t)}var zv={exports:{}},$v,QC;function xz(){if(QC)return $v;QC=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return $v=e,$v}var Uv,WC;function bz(){if(WC)return Uv;WC=1;var e=xz();function t(){}function n(){}return n.resetWarningCache=t,Uv=function(){function r(c,u,f,p,m,g){if(g!==e){var v=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 v.name="Invariant Violation",v}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},Uv}var YC;function Sz(){return YC||(YC=1,zv.exports=bz()()),zv.exports}var wz=Sz();const on=rx(wz),KC={disabled:!1},Oh=Cn.createContext(null);var jz=function(t){return t.scrollTop},Fu="unmounted",bs="exited",Ss="entering",Zl="entered",_y="exiting",Zi=function(e){QD(t,e);function t(r,a){var o;o=e.call(this,r,a)||this;var c=a,u=c&&!c.isMounting?r.enter:r.appear,f;return o.appearStatus=null,r.in?u?(f=bs,o.appearStatus=Ss):f=Zl:r.unmountOnExit||r.mountOnEnter?f=Fu:f=bs,o.state={status:f},o.nextCallback=null,o}t.getDerivedStateFromProps=function(a,o){var c=a.in;return c&&o.status===Fu?{status:bs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(a){var o=null;if(a!==this.props){var c=this.state.status;this.props.in?c!==Ss&&c!==Zl&&(o=Ss):(c===Ss||c===Zl)&&(o=_y)}this.updateStatus(!1,o)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var a=this.props.timeout,o,c,u;return o=c=u=a,a!=null&&typeof a!="number"&&(o=a.exit,c=a.enter,u=a.appear!==void 0?a.appear:c),{exit:o,enter:c,appear:u}},n.updateStatus=function(a,o){if(a===void 0&&(a=!1),o!==null)if(this.cancelNextCallback(),o===Ss){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Vu.findDOMNode(this);c&&jz(c)}this.performEnter(a)}else this.performExit();else this.props.unmountOnExit&&this.state.status===bs&&this.setState({status:Fu})},n.performEnter=function(a){var o=this,c=this.props.enter,u=this.context?this.context.isMounting:a,f=this.props.nodeRef?[u]:[Vu.findDOMNode(this),u],p=f[0],m=f[1],g=this.getTimeouts(),v=u?g.appear:g.enter;if(!a&&!c||KC.disabled){this.safeSetState({status:Zl},function(){o.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Ss},function(){o.props.onEntering(p,m),o.onTransitionEnd(v,function(){o.safeSetState({status:Zl},function(){o.props.onEntered(p,m)})})})},n.performExit=function(){var a=this,o=this.props.exit,c=this.getTimeouts(),u=this.props.nodeRef?void 0:Vu.findDOMNode(this);if(!o||KC.disabled){this.safeSetState({status:bs},function(){a.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:_y},function(){a.props.onExiting(u),a.onTransitionEnd(c.exit,function(){a.safeSetState({status:bs},function(){a.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(a,o){o=this.setNextCallback(o),this.setState(a,o)},n.setNextCallback=function(a){var o=this,c=!0;return this.nextCallback=function(u){c&&(c=!1,o.nextCallback=null,a(u))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(a,o){this.setNextCallback(o);var c=this.props.nodeRef?this.props.nodeRef.current:Vu.findDOMNode(this),u=a==null&&!this.props.addEndListener;if(!c||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}a!=null&&setTimeout(this.nextCallback,a)},n.render=function(){var a=this.state.status;if(a===Fu)return null;var o=this.props,c=o.children;o.in,o.mountOnEnter,o.unmountOnExit,o.appear,o.enter,o.exit,o.timeout,o.addEndListener,o.onEnter,o.onEntering,o.onEntered,o.onExit,o.onExiting,o.onExited,o.nodeRef;var u=d0(o,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Cn.createElement(Oh.Provider,{value:null},typeof c=="function"?c(a,u):Cn.cloneElement(Cn.Children.only(c),u))},t}(Cn.Component);Zi.contextType=Oh;Zi.propTypes={};function ql(){}Zi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ql,onEntering:ql,onEntered:ql,onExit:ql,onExiting:ql,onExited:ql};Zi.UNMOUNTED=Fu;Zi.EXITED=bs;Zi.ENTERING=Ss;Zi.ENTERED=Zl;Zi.EXITING=_y;function Cz(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function F0(e,t){var n=function(o){return t&&y.isValidElement(o)?t(o):o},r=Object.create(null);return e&&y.Children.map(e,function(a){return a}).forEach(function(a){r[a.key]=n(a)}),r}function Ez(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),a=[];for(var o in e)o in t?a.length&&(r[o]=a,a=[]):a.push(o);var c,u={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];u[r[f][c]]=n(p)}u[f]=n(f)}for(c=0;c<a.length;c++)u[a[c]]=n(a[c]);return u}function Ds(e,t,n){return n[t]!=null?n[t]:e.props[t]}function Tz(e,t){return F0(e.children,function(n){return y.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ds(n,"appear",e),enter:Ds(n,"enter",e),exit:Ds(n,"exit",e)})})}function Rz(e,t,n){var r=F0(e.children),a=Ez(t,r);return Object.keys(a).forEach(function(o){var c=a[o];if(y.isValidElement(c)){var u=o in t,f=o in r,p=t[o],m=y.isValidElement(p)&&!p.props.in;f&&(!u||m)?a[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Ds(c,"exit",e),enter:Ds(c,"enter",e)}):!f&&u&&!m?a[o]=y.cloneElement(c,{in:!1}):f&&u&&y.isValidElement(p)&&(a[o]=y.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Ds(c,"exit",e),enter:Ds(c,"enter",e)}))}}),a}var Dz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},Az={component:"div",childFactory:function(t){return t}},No=function(e){QD(t,e);function t(r,a){var o;o=e.call(this,r,a)||this;var c=o.handleExited.bind(Cz(o));return o.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},o}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(a,o){var c=o.children,u=o.handleExited,f=o.firstRender;return{children:f?Tz(a,u):Rz(a,c,u),firstRender:!1}},n.handleExited=function(a,o){var c=F0(this.props.children);a.key in c||(a.props.onExited&&a.props.onExited(o),this.mounted&&this.setState(function(u){var f=Ph({},u.children);return delete f[a.key],{children:f}}))},n.render=function(){var a=this.props,o=a.component,c=a.childFactory,u=d0(a,["component","childFactory"]),f=this.state.contextValue,p=Dz(this.state.children).map(c);return delete u.appear,delete u.enter,delete u.exit,o===null?Cn.createElement(Oh.Provider,{value:f},p):Cn.createElement(Oh.Provider,{value:f},Cn.createElement(o,u,p))},t}(Cn.Component);No.propTypes={};No.defaultProps=Az;const WD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function _z(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),WD.reduce((n,r)=>(n[r]=[],n),{}))}const XC={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},kz={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Pz({state:e,maxHeight:t,position:n,transitionDuration:r}){const[a,o]=n.split("-"),c=o==="center"?`${a}-center`:o,u={opacity:0,maxHeight:t,transform:XC[c],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"},f={opacity:1,transform:kz[c]},p={opacity:0,maxHeight:0,transform:XC[c]};return{...u,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function Nz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const YD=y.forwardRef(({data:e,onHide:t,autoClose:n,...r},a)=>{const{autoClose:o,message:c,...u}=e,f=Nz(n,e.autoClose),p=y.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},v=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return y.useEffect(()=>{var b;(b=e.onOpen)==null||b.call(e,e)},[]),y.useEffect(()=>(v(),m),[f]),s.jsx(C0,{...r,...u,onClose:g,ref:a,onMouseEnter:m,onMouseLeave:v,children:c})});YD.displayName="@mantine/notifications/NotificationContainer";var KD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Oz=Zi,Mz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Wr("overlay"),store:Js,withinPortal:!0},Iz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":le(n)}}),Ji=me((e,t)=>{const n=se("Notifications",Mz,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:v,notificationMaxHeight:b,limit:S,zIndex:j,store:C,portalProps:R,withinPortal:D,...E}=n,T=Sn(),A=gz(C),_=uN(),M=lx(),L=y.useRef({}),$=y.useRef(0),X=(T.respectReducedMotion?M:!1)?1:g,Q=Me({name:"Notifications",classes:KD,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:Iz});y.useEffect(()=>{C==null||C.updateState(Y=>({...Y,limit:S||5,defaultPosition:p}))},[S,p]),$i(()=>{A.notifications.length>$.current&&setTimeout(()=>_(),0),$.current=A.notifications.length},[A.notifications]);const J=_z(A.notifications,p),W=WD.reduce((Y,P)=>(Y[P]=J[P].map(({style:I,...z})=>s.jsx(Oz,{timeout:X,onEnter:()=>L.current[z.id].offsetHeight,nodeRef:{current:L.current[z.id]},children:F=>s.jsx(YD,{ref:O=>{L.current[z.id]=O},data:z,onHide:O=>GD(O,C),autoClose:m,...Q("notification",{style:{...Pz({state:F,position:P,transitionDuration:X,maxHeight:b}),...I}})})},z.id)),Y),{});return s.jsxs(Ho,{withinPortal:D,...R,children:[s.jsx(ce,{...Q("root"),"data-position":"top-center",ref:t,...E,children:s.jsx(No,{children:W["top-center"]})}),s.jsx(ce,{...Q("root"),"data-position":"top-left",...E,children:s.jsx(No,{children:W["top-left"]})}),s.jsx(ce,{...Q("root",{className:lc.classNames.fullWidth}),"data-position":"top-right",...E,children:s.jsx(No,{children:W["top-right"]})}),s.jsx(ce,{...Q("root",{className:lc.classNames.fullWidth}),"data-position":"bottom-right",...E,children:s.jsx(No,{children:W["bottom-right"]})}),s.jsx(ce,{...Q("root"),"data-position":"bottom-left",...E,children:s.jsx(No,{children:W["bottom-left"]})}),s.jsx(ce,{...Q("root"),"data-position":"bottom-center",...E,children:s.jsx(No,{children:W["bottom-center"]})})]})});Ji.classes=KD;Ji.displayName="@mantine/notifications/Notifications";Ji.show=ca.show;Ji.hide=ca.hide;Ji.update=ca.update;Ji.clean=ca.clean;Ji.cleanQueue=ca.cleanQueue;Ji.updateState=ca.updateState;class Lz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Cd{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class zz{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(a,o){const c=a.consumeAndParse(n);return r(o,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(a,o,c){const u=a.consumeAndParse(n);return r(o,c,u)},precedence:n})}construct(t){return new $z(t,this.prefixParselets,this.infixParselets)}}class $z{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 a=r.parse(this,n);for(;t>this.getPrecedence();){const o=this.consume();a=this.getInfixParselet(o).parse(this,a,o)}return a}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,a;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const o=this.peek();throw Error(`Expected ${t} but got "${o.id}" (${o.value}) at line ${o.line} column ${o.column}.`)}if(n&&((a=this.peek())==null?void 0:a.value)!==n){const o=this.peek();throw Error(`Expected "${n}" but got "${o.value}" at line ${o.line} column ${o.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]}}class XD{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 Ed="http://hl7.org",ZD="ok",Uz="created",Bz="gone",Vz="not-modified",Fz="not-found",Hz="unauthorized",qz="forbidden",Gz="accepted",Qz={resourceType:"OperationOutcome",id:ZD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Wz={resourceType:"OperationOutcome",id:Fz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},nd={resourceType:"OperationOutcome",id:Hz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Yz={...nd,issue:[...nd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},ZC={...nd,issue:[...nd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},JD={resourceType:"OperationOutcome",id:qz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ii(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function yn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Kz(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Fp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function eA(e){return e.id===ZD||e.id===Uz||e.id===Vz||e.id===Gz}function Xz(e){return e.id===Bz}class dt extends Error{constructor(t,n){super(tA(t)),this.outcome=t,this.cause=n}}function Jt(e){return e instanceof dt?e.outcome:Fp(e)?e:ii(Ke(e))}function Ke(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Fp(e)?tA(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function tA(e){var n;const t=((n=e.issue)==null?void 0:n.map(nA))??[];return t.length>0?t.join("; "):"Unknown error"}function nA(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 Zz(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 Jz(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([a,o])=>[a,Zz(a,o)])),constraints:[],innerTypes:[]};return t}const e8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},t8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},n8={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"}]}}},r8={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"}]}}},a8={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"}]}}},i8={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"}]}}},o8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},s8={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"}]}}},l8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},c8={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"}]}}},u8={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"}]}}},d8={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"}]}}},f8={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"}]}}},h8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},p8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},m8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},g8={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"}]}}},v8={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"]}]}}},y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},x8={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"}]}}},b8={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"}]}}},S8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},w8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},discriminator:{max:9007199254740991,type:[{code:"ElementDefinitionSlicingDiscriminator"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},j8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},C8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:9007199254740991,type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},E8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,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"}]}}},T8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},R8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},D8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},A8={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"}]}}},_8={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"}]}}},k8={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"}]}}},P8={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"]}]}}},N8={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"}]}}},O8={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"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},M8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},I8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},L8={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"]}]}}},z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},$8={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"}]}}},U8={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"}]}}},B8={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"}]}}},V8={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"}]}}},F8={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"]}]}}},H8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},q8={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"}]}}},G8={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"]}]}}},Q8={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"}]}}},W8={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"}]}}},Y8={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"}]}}},K8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},X8={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"}]}}},Z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:9007199254740991,type:[{code:"code"}]},timeOfDay:{max:9007199254740991,type:[{code:"time"}]},when:{max:9007199254740991,type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},J8={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"}]}}},e$={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"]}]}}},t$={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"}]}}},n$={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"}]}}},r$={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"}]}}},a$={Element:e8,BackboneElement:t8,Address:n8,Age:r8,Annotation:a8,Attachment:i8,CodeableConcept:o8,Coding:s8,ContactDetail:l8,ContactPoint:c8,Contributor:u8,Count:d8,DataRequirement:f8,DataRequirementCodeFilter:h8,DataRequirementDateFilter:p8,DataRequirementSort:m8,Distance:g8,Dosage:v8,DosageDoseAndRate:y8,Duration:x8,ElementDefinition:b8,ElementDefinitionSlicingDiscriminator:S8,ElementDefinitionSlicing:w8,ElementDefinitionBase:j8,ElementDefinitionType:C8,ElementDefinitionExample:E8,ElementDefinitionConstraint:T8,ElementDefinitionBinding:R8,ElementDefinitionMapping:D8,Expression:A8,Extension:_8,HumanName:k8,Identifier:P8,MarketingStatus:N8,Meta:O8,Money:M8,Narrative:I8,ParameterDefinition:L8,Period:z8,Population:$8,ProdCharacteristic:U8,ProductShelfLife:B8,Quantity:V8,Range:F8,Ratio:H8,Reference:q8,RelatedArtifact:G8,SampledData:Q8,Signature:W8,SubstanceAmount:Y8,SubstanceAmountReferenceRange:K8,Timing:X8,TimingRepeat:Z8,TriggerDefinition:J8,UsageContext:e$,MoneyQuantity:t$,SimpleQuantity:n$,IdentityProvider:r$};function i$(e){return new s$(e).parse()}const Mh=Jz(a$),H0=Object.create(null),JC=Object.create(null),o$={"http://hl7.org/fhir/StructureDefinition/MoneyQuantity":"MoneyQuantity","http://hl7.org/fhir/StructureDefinition/SimpleQuantity":"SimpleQuantity","http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition":"ViewDefinition"};function rA(e){let t;return t=JC[e],t||(t=JC[e]=Object.create(null)),t}function eE(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(a=>a.resource))??[]).filter(a=>(a==null?void 0:a.resourceType)==="StructureDefinition");Z$(n);for(const a of n)aA(a)}function aA(e){var o,c;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=i$(e),n=o$[e.url];let r,a;n?(r=Mh,a=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(o=e.type)!=null&&o.startsWith("http://")||(c=e.type)!=null&&c.startsWith("https://")?(r=Mh,a=e.type):(r=rA(e.url),a=e.type),r[a]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;H0[e.url]=t}function iA(e){return!!Mh[e]}function Hp(e,t){if(t){const n=rA(t)[e];if(n)return n}return Mh[e]}function oA(e,t){const n=Hp(e,t);if(!n)throw new dt(ii("Unknown data type: "+e));return n}function q0(e){return!!H0[e]}function Pc(e){return H0[e]}class s${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,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:u$(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,a,o,c;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 u=Bv(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let f=this.backboneContext;for(;f;){if((a=t.path)!=null&&a.startsWith(f.path+".")){f.type.elements[Bv(t,f.path)]=u;break}f=f.parent}if(!f){const p=Bv(t,this.root.path);t.isSummary&&((o=this.resourceSchema.summaryProperties)==null||o.add(p.replace("[x]",""))),u.min>0&&((c=this.resourceSchema.mandatoryProperties)==null||c.add(p.replace("[x]",""))),this.resourceSchema.elements[p]=u}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),this.slicingContext&&!Gl(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,a,o;for(;this.backboneContext&&!Gl((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=cE(t);this.backboneContext={type:{name:n,type:n,path:t.path,title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path,parent:Gl((a=this.backboneContext)==null?void 0:a.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,a,o,c;c$(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((a=t.slicing)==null?void 0:a.discriminator)??[]).map(u=>{if(u.type!=="value"&&u.type!=="pattern"&&u.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${u.type}`);return{path:u.path,type:u.type}}),slices:[],ordered:((o=t.slicing)==null?void 0:o.ordered)??!1,rule:(c=t.slicing)==null?void 0:c.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!Gl(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&&!Gl(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,a,o,c;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const u=t.contentReference.slice(t.contentReference.indexOf("#")+1),f=this.elementIndex[u];return f?{...f,id:t.id,path:t.path,min:t.min??f.min,max:t.max??f.max,base:{path:((n=f.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((a=f.base)==null?void 0:a.min)??f.min,max:((o=t.base)==null?void 0:o.max)??((c=f.base)==null?void 0:c.max)??f.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(Gl(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(a=>["BackboneElement","Element"].includes(a.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var a;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=cE(t)),r||(r=(a=eo(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:a.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var o,c;const n=tE(t.max),r=(o=t.base)!=null&&o.max?tE(t.base.max):n,a={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((c=t.base)==null?void 0:c.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(u=>({key:u.key??"",severity:u.severity??"error",expression:u.expression??"",description:u.human??""})),type:this.parseElementDefinitionType(t),fixed:nE(gc(a,"fixed[x]")),pattern:nE(gc(a,"pattern[x]")),binding:t.binding}}}function tE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Bv(e,t=""){return l$(e.path,t)}function l$(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Gl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function nE(e){return Array.isArray(e)&&e.length>0?e[0]:Tn(e)?void 0:e}function c$(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(a=>a.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function u$(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 d$(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?f$:gc,[a,...o]=t.split(".");let c=[r(e,a,n)];for(const u of o){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&f.push(r(p,u,n));c=f}return c}function f$(e,t,n){const r=e.path;return h$(gc(e,t,n),r,t)}function h$(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((a,o)=>({...a,path:`${r}${n}[${o}]`})):{...e,path:`${r}${n}`}}const sA={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)?)?)?$/};function p$(e,t,n,r){var c;if(Array.isArray(e))return!1;let a;t.path==="$this"?a=n:a=(r??n.elements)[t.path];const o=n.type;switch(t.type){case"value":case"pattern":if(!e||!a)return!1;if(a.pattern)return W0(e,a.pattern);if(a.fixed)return ci(e,a.fixed);if(((c=a.binding)==null?void 0:c.strength)==="required"&&a.binding.valueSet)return!0;break;case"type":return!e||!(o!=null&&o.length)?!1:o.some(u=>u.code===e.type)}return!1}function Qe(e){return[{type:oe.boolean,value:e}]}function ha(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:oe.integer,value:e}:typeof e=="number"?{type:oe.decimal,value:e}:typeof e=="boolean"?{type:oe.boolean,value:e}:typeof e=="string"?{type:oe.string,value:e}:ua(e)?{type:oe.Quantity,value:e}:pi(e)?{type:e.resourceType,value:e}:vA(e)?{type:oe.CodeableConcept,value:e}:gA(e)?{type:oe.Coding,value:e}:{type:oe.BackboneElement,value:e}}function ti(e){return e.length===0?!1:!!e[0].value}function Vi(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 gc(e,t,n){if(!e.value)return;const r=Qo(e.type,t,n==null?void 0:n.profileUrl);return r?lA(e,t,r):Td(e,t)}function lA(e,t,n){const r=e.value,a=n.type;if(!a||a.length===0)return;let o,c="undefined",u;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of a){const g=p.replace("[x]",$n(m.code));if(o=r[g],u=r["_"+g],o!==void 0||u!==void 0){c=m.code;break}}if(u)if(Array.isArray(o)){o=o.slice();for(let m=0;m<Math.max(o.length,u.length);m++)o[m]=oE(o[m],u[m])}else o=oE(o,u);if(!Tn(o))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(o)?o.map(m=>rE(m,c)):rE(o,c)}function rE(e,t){return t==="Resource"&&pi(e)&&(t=e.resourceType),{type:t,value:e}}function Td(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const a=n[t];Array.isArray(a)?r=a.map(ha):r=ha(a)}else{const a=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const o of Object.values(oe)){const c=a+$n(o);if(c in n){const u=n[c];Array.isArray(u)?r=u.map(f=>({type:o,value:f})):r={type:o,value:u};break}}}if(Array.isArray(r)){if(r.length===0||Tn(r[0]))return}else if(Tn(r))return;return r}function cA(e){const t=[];for(const n of e){let r=!1;for(const a of t)if(ti(qp(n,a))){r=!0;break}r||t.push(n)}return t}function m$(e){return Qe(!ti(e))}function g$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!1):Qe(e.every((n,r)=>ti(qp(n,t[r]))))}function v$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Qe(!0):Qe(e.some((n,r)=>!ti(qp(n,t[r]))))}function qp(e,t){var a,o;const n=(a=e.value)==null?void 0:a.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?Qe(Math.abs(n-r)<1e-8):ua(n)&&ua(r)?Qe(hA(n,r)):Qe(typeof n=="object"&&typeof r=="object"?G0(e,t):n===r)}function uA(e,t){return e.length===0&&t.length===0?Qe(!0):e.length!==t.length?Qe(!1):(e.sort(aE),t.sort(aE),Qe(e.every((n,r)=>ti(y$(n,t[r])))))}function y$(e,t){const{type:n,value:r}=e,{type:a,value:o}=t,c=r==null?void 0:r.valueOf(),u=o==null?void 0:o.valueOf();return typeof c=="number"&&typeof u=="number"?Qe(Math.abs(c-u)<.01):ua(c)&&ua(u)?Qe(hA(c,u)):Qe(n==="Coding"&&a==="Coding"?typeof c!="object"||typeof u!="object"?!1:c.code===u.code&&c.system===u.system:typeof c=="object"&&typeof u=="object"?G0({...c,id:void 0},{...u,id:void 0}):typeof c=="string"&&typeof u=="string"?c.toLowerCase()===u.toLowerCase():c===u)}function aE(e,t){var a,o;const n=(a=e.value)==null?void 0:a.valueOf(),r=(o=t.value)==null?void 0:o.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function dA(e,t){const{value:n}=e;if(n==null)return!1;let r=t;switch(r.startsWith("System.")&&(r=r.substring(7)),r.startsWith("FHIR.")&&(r=r.substring(5)),r){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return x$(n);case"DateTime":return Ih(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return fA(n);case"Quantity":return ua(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function x$(e){return typeof e=="string"&&!!sA.date.exec(e)}function Ih(e){return typeof e=="string"&&!!sA.dateTime.exec(e)}function fA(e){return!!(e&&typeof e=="object"&&("start"in e&&Ih(e.start)||"end"in e&&Ih(e.end)))}function ua(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function hA(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 G0(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const a of n){const o=e[a],c=t[a];if(iE(o)&&iE(c)){if(!G0(o,c))return!1}else if(o!==c)return!1}return!0}function iE(e){return e!==null&&typeof e=="object"}function oE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return b$(e??{},t)}return e}function b$(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function S$(e,t){return pi(e,t)&&"id"in e&&typeof e.id=="string"}function fn(e){const t=Lt(e)??"undefined/undefined",n=Fi(e);return n===t?{reference:t}:{reference:t,display:n}}function Lt(e){if(Wo(e))return e.reference;if(S$(e))return`${e.resourceType}/${e.id}`}function zs(e){if(e)return Wo(e)?e.reference.split("/")[1]:e.id}function w$(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Fi(e){if(w$(e)){const t=j$(e);if(t)return t}if(e.resourceType==="Device"){const t=C$(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Bo(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]),vA(t))return Bo(t);if(O$(t))return t.text}return Lt(e)??""}function j$(e){const t=e.name;if(t&&t.length>0)return Nc(t[0])}function C$(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function E$(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=sE(n);if(r)return r}else return sE(t)}function sE(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function pA(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 a=n.getUTCFullYear(),o=n.getUTCMonth(),c=n.getUTCDate(),u=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=u-a;(f<o||f===o&&p<c)&&m--;let g=u*12+f-(a*12+o);p<c&&g--;const v=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:v}}function T$(e,t){const{years:n,months:r,days:a}=pA(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":a.toString().padStart(3,"0")+"D"}function eo(e,...t){var r;let n=e;for(let a=0;a<t.length&&n;a++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(o=>o.url===t[a]);return n}function Ia(e,t){const n=Q0(e);return JSON.stringify(n,null,t?2:void 0)??""}function Q0(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?R$(e):D$(e):e}function R$(e){const t=e.length;if(t===0)return;let n,r=0;for(let a=0;a<t;a++){const o=e[a],c=Q0(o);c!==o&&!n&&(n=Array.from(e)),c===void 0?n&&(n[a]=null):(n&&(n[a]=c),r++)}if(r!==0)return n??e}function D$(e){let t,n=0;for(const r in e){const a=e[r],o=Q0(a);o!==a&&!t&&(t={...e}),o===void 0?t&&delete t[r]:(t&&(t[r]=o),n++)}if(n!==0)return t??e}function Tn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!En(e):!1}function En(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 ci(e,t,n){return e===t||Tn(e)&&Tn(t)?!0:Tn(e)||Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?A$(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?_$(e,t,n):(sr(e)||sr(t),!1)}function A$(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!ci(e[n],t[n]))return!1;return!0}function _$(e,t,n){const r=new Set;Object.keys(e).forEach(a=>r.add(a)),Object.keys(t).forEach(a=>r.add(a)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const a of r){const o=e[a],c=t[a];if(!ci(o,c,a))return!1}return!0}function W0(e,t){return Tn(e)?!0:Tn(t)?!1:Array.isArray(e)&&Array.isArray(t)?k$(e,t):Array.isArray(e)||Array.isArray(t)?!1:sr(e)&&sr(t)?P$(e,t):sr(e)||sr(t)?!1:e===t}function k$(e,t){return t.every(n=>e.some(r=>W0(r,n)))}function P$(e,t){return Object.entries(t).every(([n,r])=>n in e&&W0(e[n],r))}function Qr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function mA(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function sr(e){return e!==null&&typeof e=="object"}function N$(e){return typeof e=="string"}function gA(e){return sr(e)&&"code"in e&&typeof e.code=="string"}function vA(e){return sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(gA)}function O$(e){return sr(e)&&"text"in e&&typeof e.text=="string"}const yA=[];for(let e=0;e<256;e++)yA.push(e.toString(16).padStart(2,"0"));function M$(e){const t=xA(e),n=new Uint8Array(t),r=new Array(n.length);for(let a=0;a<n.length;a++)r[a]=yA[n[a]];return r.join("")}function I$(e){const t=xA(e),n=new Uint8Array(t),r=new Array(n.length);for(let a=0;a<n.length;a++)r[a]=String.fromCharCode(n[a]);return window.btoa(r.join(""))}function xA(e){return ArrayBuffer.isView(e)?e.buffer:e}function $n(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Y0(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function As(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function L$(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(a=>a.system===t))==null?void 0:r.code}function z$(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const lE=e=>new Promise(t=>{setTimeout(t,e)});function ky(e,t,n){const r=[];for(let a=0;a<n-1;a++){const o=e.indexOf(t);if(o<0)break;r.push(e.slice(0,o)),e=e.slice(o+t.length)}return r.push(e),r}function $$(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Mu(e,t){return e?(e.push(t),e):[t]}function rd(e){return e.sort((t,n)=>t.localeCompare(n))}function K0(e){return e.endsWith("/")?e:e+"/"}function U$(e){return e.startsWith("/")?e.slice(1):e}function Za(e,t){return new URL(U$(t),K0(e.toString())).toString()}function B$(e,t){return Za(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function V$(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 bA(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 F$(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const a=e.meta.profile.indexOf(t);e.meta.profile.splice(a,1)}return e}function vc(e){if(!e)return"";switch(e.type){case"Address":return SA(e.value);case"CodeableConcept":return Bo(e.value);case"Coding":return Rd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Nc(e.value);case"Quantity":return _s(e.value);case"Reference":return H$(e.value);default:return e.value.toString()}}function H$(e){return e?e.display??e.reference??Ia(e):""}function SA(e,t){if(!e)return"";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 Nc(e,t){if(!e)return"";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=id(e.text);if(r)return r}return n.join(" ").trim()}function Gp(e){return e instanceof Date&&!isNaN(e.getTime())}function q$(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Gp(r)?r.toLocaleTimeString(t,n):""}function gr(e,t,n){if(!e)return"";const r=new Date(e);return Gp(r)?r.toLocaleString(t,n):""}function G$(e,t,n){return!e||!e.start&&!e.end?"":gr(e.start,t,n)+" - "+gr(e.end,t,n)}const Q$={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},W$={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},Y$={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function wA(e){if(!e)return"";const t=[];return K$(t,e.repeat),e.event&&t.push(e.event.map(n=>gr(n)).join(", ")),$n(t.join(" ").trim())}function K$(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,a=t.periodUnit;n===1&&r===1?e.push(Q$[a]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+W$[a]):e.push("per "+r+" "+Y$[a])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map($n).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(o=>q$(o)).join(", "))}function ad(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},a=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(a==null?void 0:a.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(a==null?void 0:a.value)===void 0?`>= ${_s(r)}`:(r==null?void 0:r.value)===void 0&&(a==null?void 0:a.value)!==void 0?`<= ${_s(a)}`:((r==null?void 0:r.unit)===(a==null?void 0:a.unit)&&(r==null||delete r.unit),`${_s(r)} - ${_s(a)}`)}function _s(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 X$(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Bo(e){if(!e)return"";const t=id(e.text);return t||(e.coding?e.coding.map(n=>Rd(n)).join(", "):"")}function Rd(e,t){const n=id(e==null?void 0:e.display);return n?`${n}`:id(e==null?void 0:e.code)??""}function jA(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(_s(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Bo(e.valueCodeableConcept));else{const n=id(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>jA(n)).join(" / ")),t.join(" / ").trim()}function id(e){return typeof e=="string"?e:void 0}const oe={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 Z$(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)(r==null?void 0:r.resourceType)==="StructureDefinition"&&r.kind==="resource"&&CA(r.type)}function CA(e){let t=ui.types[e];return t||(t={searchParamsDetails:{}},ui.types[e]=t),t.searchParams||(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function J$(e){for(const t of e.base??[]){const n=CA(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function cE(e){var n,r,a,o;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?eU((o=((a=e.base)==null?void 0:a.path)??e.path)==null?void 0:o.split(".")):t}function eU(e){return e.length===1?e[0]:e.map($n).join("")}function X0(e){var t;return(t=ui.types[e])==null?void 0:t.searchParams}function tU(e,t){var n,r;return(r=(n=ui.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function $s(e){const t=e.replaceAll("[x]","").split(".").pop();return EA(t)}function EA(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(rU).join(" ").replace("_"," ").replace(/\s+/g," ")}const nU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function rU(e){const t=e.toUpperCase();return e===t?e:nU.has(t)?t:t.charAt(0)+e.slice(1)}function Qo(e,t,n){const r=Hp(e,n);if(r)return aU(r.elements,t)}function aU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const a=t[r];if(a>="A"&&a<="Z"){const o=t.slice(0,r)+"[x]",c=e[o];if(c)return c}}}function pi(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Wo(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const ui={types:{}};function yh(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 Ni=()=>[],Tr={empty:(e,t)=>Qe(t.length===0||t.every(n=>Tn(n.value))),hasValue:(e,t)=>Qe(t.length!==0),exists:(e,t,n)=>Qe(n?t.filter(r=>ti(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!Tn(r.value))),all:(e,t,n)=>Qe(t.every(r=>ti(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Qe(!1);return Qe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Qe(!0);return Qe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Qe(!1);return Qe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Qe(!0);return Qe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Qe(!0);const r=n.eval(e,vs(e));return r.length===0?Qe(!1):Qe(t.every(a=>r.some(o=>o.value===a.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,vs(e));return r.length===0?Qe(!0):t.length===0?Qe(!1):Qe(r.every(a=>t.some(o=>o.value===a.value)))},count:(e,t)=>[{type:oe.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(a=>a.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Qe(t.length===Tr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ti(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Ni,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 a;const r=(a=n.eval(e,t)[0])==null?void 0:a.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 a;const r=(a=n.eval(e,t)[0])==null?void 0:a.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,vs(e)),a=[];for(const o of t)!a.some(c=>c.value===o.value)&&r.some(c=>c.value===o.value)&&a.push(o);return a},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,vs(e)),a=[];for(const o of t)r.some(c=>c.value===o.value)||a.push(o);return a},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,vs(e));return cA([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,vs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[ha(!0)],iif:(e,t,n,r,a)=>{const o=n.eval(e,t);if(o.length>1||o.length===1&&typeof o[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ti(o)?r.eval(e,t):a?a.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);if(typeof n=="boolean")return[{type:oe.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Qe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Qe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Qe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Qe(Tr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);return typeof n=="number"?[{type:oe.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:oe.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:oe.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Qe(Tr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:oe.date,value:yh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Qe(Tr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:oe.dateTime,value:yh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Qe(Tr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);return typeof n=="number"?[{type:oe.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:oe.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:oe.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Qe(Tr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);return ua(n)?[{type:oe.Quantity,value:n}]:typeof n=="number"?[{type:oe.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:oe.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:oe.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Qe(Tr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);return n==null?[]:ua(n)?[{type:oe.string,value:`${n.value} '${n.unit}'`}]:[{type:oe.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Qe(Tr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Ja(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:oe.time,value:yh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Qe(Tr.toTime(e,t).length===1),indexOf:(e,t,n)=>oa((r,a)=>r.indexOf(a),e,t,n),substring:(e,t,n,r)=>oa((a,o,c)=>{const u=o,f=c?u+c:a.length;return u<0||u>=a.length?void 0:a.substring(u,f)},e,t,n,r),startsWith:(e,t,n)=>oa((r,a)=>r.startsWith(a),e,t,n),endsWith:(e,t,n)=>oa((r,a)=>r.endsWith(a),e,t,n),contains:(e,t,n)=>oa((r,a)=>r.includes(a),e,t,n),upper:(e,t)=>oa(n=>n.toUpperCase(),e,t),lower:(e,t)=>oa(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>oa((a,o,c)=>a.replaceAll(o,c),e,t,n,r),matches:(e,t,n)=>oa((r,a)=>!!new RegExp(a).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>oa((a,o,c)=>a.replaceAll(o,c),e,t,n,r),length:(e,t)=>oa(n=>n.length,e,t),toChars:(e,t)=>oa(n=>n?n.split(""):void 0,e,t),encode:Ni,decode:Ni,escape:Ni,unescape:Ni,trim:Ni,split:Ni,join:(e,t,n)=>{var a;const r=((a=n==null?void 0:n.eval(e,vs(e))[0])==null?void 0:a.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:oe.string,value:t.map(o=>{var c;return((c=o.value)==null?void 0:c.toString())??""}).join(r)}]},abs:(e,t)=>Ka(Math.abs,e,t),ceiling:(e,t)=>Ka(Math.ceil,e,t),exp:(e,t)=>Ka(Math.exp,e,t),floor:(e,t)=>Ka(Math.floor,e,t),ln:(e,t)=>Ka(Math.log,e,t),log:(e,t,n)=>Ka((r,a)=>Math.log(r)/Math.log(a),e,t,n),power:(e,t,n)=>Ka(Math.pow,e,t,n),round:(e,t)=>Ka(Math.round,e,t),sqrt:(e,t)=>Ka(Math.sqrt,e,t),truncate:(e,t)=>Ka(n=>n|0,e,t),children:Ni,descendants:Ni,trace:(e,t,n)=>t,now:()=>[{type:oe.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:oe.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:oe.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,a)=>{var p;const o=Tr.toDateTime(e,n.eval(e,t));if(o.length===0)throw new Error("Invalid start date");const c=Tr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const u=(p=a.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const f=pA(o[0].value,c[0].value);return[{type:oe.Quantity,value:{value:f[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof Lh?r=n.name:n instanceof Z0&&(r=n.left.name+"."+n.right.name),r?t.map(a=>({type:oe.boolean,value:dA(a,r)})):[]},not:(e,t)=>Tr.toBoolean(e,t).map(n=>({type:oe.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let a;if(typeof r=="string")a=r;else if(typeof r=="object"){const o=r;if(o.resource)return ha(o.resource);o.reference?a=o.reference:o.type&&o.identifier&&(a=`${o.type}?identifier=${o.identifier.system}|${o.identifier.value}`)}if(a!=null&&a.includes("?")){const[o]=a.split("?");return{type:o,value:{resourceType:o}}}if(a!=null&&a.includes("/")){const[o,c]=a.split("/");return{type:o,value:{resourceType:o,id:c}}}return{type:oe.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:oe.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:oe.BackboneElement,value:{namespace:"System",name:"Integer"}}:pi(n)?{type:oe.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:oe.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 a=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(o=>{var c;return{type:oe.boolean,value:((c=o.value)==null?void 0:c.resourceType)===a}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:oe.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let a="";return n instanceof Lh&&(a=n.name),a&&!r.reference.startsWith(a+"/")?[]:[{type:oe.id,value:zs(r)}]},extension:(e,t,n)=>{var o;const r=n.eval(e,t)[0].value,a=(o=t==null?void 0:t[0])==null?void 0:o.value;if(a){const c=eo(a,r);if(c)return[{type:oe.Extension,value:c}]}return[]}};function oa(e,t,n,...r){if(n.length===0)return[];const[{value:a}]=Ja(n,1);if(typeof a!="string")throw new Error("String function cannot be called with non-string");const o=e(a,...r.map(c=>{var u;return(u=c==null?void 0:c.eval(t,n)[0])==null?void 0:u.value}));return o===void 0?[]:Array.isArray(o)?o.map(ha):[ha(o)]}function Ka(e,t,n,...r){if(n.length===0)return[];const[{value:a}]=Ja(n,1),o=ua(a),c=o?a.value:a;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const u=e(c,...r.map(m=>{var g;return(g=m.eval(t,n)[0])==null?void 0:g.value})),f=o?oe.Quantity:n[0].type,p=o?{...a,value:u}:u;return[{type:f,value:p}]}function Ja(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 vs(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class TA{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const a of n)r.push(this.child.eval({parent:t,variables:{$this:a}},[a]));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 Ql{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Lh{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(a=>this.evalValue(a)).filter(a=>(a==null?void 0:a.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 pi(n,this.name)?t:gc(t,this.name)}toString(){return this.name}}class iU{eval(){return[]}toString(){return"{}"}}class oU extends Lz{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 zh extends Cd{constructor(t,n){super("as",t,n)}eval(t,n){return Tr.ofType(t,this.left.eval(t,n),this.right)}}class Nr extends Cd{}class Aa extends Nr{constructor(t,n,r,a){super(t,n,r),this.impl=a}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const a=this.right.eval(t,n);if(a.length!==1)return[];const o=r[0].value,c=a[0].value,u=ua(o)?o.value:o,f=ua(c)?c.value:c,p=this.impl(u,f);return typeof p=="boolean"?Qe(p):ua(o)?[{type:oe.Quantity,value:{...o,value:p}}]:[ha(p)]}}class sU extends Cd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n),o=[...r,...a];return o.length>0&&o.every(c=>typeof c.value=="string")?[{type:oe.string,value:o.map(c=>c.value).join("")}]:o}}class lU extends Nr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return Qe(r.some(o=>o.value===a[0].value))}}class cU extends Nr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Vi(this.left.eval(t,n)),a=this.right.eval(t,n);return r?Qe(a.some(o=>qp(r,o)[0].value)):[]}}class Z0 extends Cd{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 J0 extends Cd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return cA([...r,...a])}}class uU extends Nr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return g$(r,a)}}class dU extends Nr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return v$(r,a)}}class fU extends Nr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return uA(r,a)}}class hU extends Nr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),a=this.right.eval(t,n);return m$(uA(r,a))}}class eb 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 a=this.right.name;return Qe(dA(r[0],a))}}class pU extends Nr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Vi(this.left.eval(t,n),"boolean"),a=Vi(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(a==null?void 0:a.value)===!0?Qe(!0):(r==null?void 0:r.value)===!1||(a==null?void 0:a.value)===!1?Qe(!1):[]}}class mU extends Nr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Vi(this.left.eval(t,n),"boolean"),a=Vi(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(a==null?void 0:a.value)===!1?Qe(!1):r!=null&&r.value||a!=null&&a.value?Qe(!0):[]}}class gU extends Nr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Vi(this.left.eval(t,n),"boolean"),a=Vi(this.right.eval(t,n),"boolean");return!r||!a?[]:Qe(r.value!==a.value)}}class vU extends Nr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Vi(this.left.eval(t,n),"boolean"),a=Vi(this.right.eval(t,n),"boolean");return(a==null?void 0:a.value)===!0||(r==null?void 0:r.value)===!1?Qe(!0):!r||!a?[]:Qe(!1)}}class tb{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Tr[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 nb{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 a=r[0].value;if(typeof a!="number")throw new Error("Invalid indexer expression: should return integer}");const o=this.left.eval(t,n);return a in o?[o[a]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const yU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class xU{constructor(t,n,r,a){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(a!=null&&a.dateTimeLiterals),this.symbolRegex=(a==null?void 0:a.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==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):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()!==`
|
|
77
|
+
`))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(o,c)=>String.fromCodePoint(parseInt(c,16))),a=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),a}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}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 a=this.str.substring(t,this.pos.index);return a.endsWith("T")?a=a.substring(0,a.length-1):!a.startsWith("T")&&n&&!r&&(a+="Z"),this.buildToken("DateTime",a)}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()===" "&&bU(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()===`
|
|
78
|
+
`?(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 bU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&yU.includes(e.value)))}const SU=["true","false"],wU=["!=","!~","<=",">=","{}","->"];function jU(e){return new xU(e,SU,wU).tokenize()}const Zt={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide: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},CU={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}},EU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new nb(t,n)},precedence:Zt.Indexer},TU={parse(e,t){if(!(t instanceof Lh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new tb(t.name,n)},precedence:Zt.FunctionCall};function RU(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 DU(){return new zz().registerPrefix("String",{parse:(e,t)=>new Ql({type:oe.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Ql({type:oe.dateTime,value:yh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Ql({type:oe.Quantity,value:RU(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Ql({type:t.value.includes(".")?oe.decimal:oe.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Ql({type:oe.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Ql({type:oe.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Lh(t.value)}).registerPrefix("{}",{parse:()=>new iU}).registerPrefix("(",CU).registerInfix("[",EU).registerInfix("(",TU).prefix("+",Zt.UnaryAdd,(e,t)=>new oU("+",t,n=>n)).prefix("-",Zt.UnarySubtract,(e,t)=>new Aa("-",t,t,(n,r)=>-r)).infixLeft(".",Zt.Dot,(e,t,n)=>new Z0(e,n)).infixLeft("/",Zt.Divide,(e,t,n)=>new Aa("/",e,n,(r,a)=>r/a)).infixLeft("*",Zt.Multiply,(e,t,n)=>new Aa("*",e,n,(r,a)=>r*a)).infixLeft("+",Zt.Add,(e,t,n)=>new Aa("+",e,n,(r,a)=>r+a)).infixLeft("-",Zt.Subtract,(e,t,n)=>new Aa("-",e,n,(r,a)=>r-a)).infixLeft("|",Zt.Union,(e,t,n)=>new J0(e,n)).infixLeft("=",Zt.Equals,(e,t,n)=>new uU(e,n)).infixLeft("!=",Zt.NotEquals,(e,t,n)=>new dU(e,n)).infixLeft("~",Zt.Equivalent,(e,t,n)=>new fU(e,n)).infixLeft("!~",Zt.NotEquivalent,(e,t,n)=>new hU(e,n)).infixLeft("<",Zt.LessThan,(e,t,n)=>new Aa("<",e,n,(r,a)=>r<a)).infixLeft("<=",Zt.LessThanOrEquals,(e,t,n)=>new Aa("<=",e,n,(r,a)=>r<=a)).infixLeft(">",Zt.GreaterThan,(e,t,n)=>new Aa(">",e,n,(r,a)=>r>a)).infixLeft(">=",Zt.GreaterThanOrEquals,(e,t,n)=>new Aa(">=",e,n,(r,a)=>r>=a)).infixLeft("&",Zt.Ampersand,(e,t,n)=>new sU(e,n)).infixLeft("and",Zt.And,(e,t,n)=>new pU(e,n)).infixLeft("as",Zt.As,(e,t,n)=>new zh(e,n)).infixLeft("contains",Zt.Contains,(e,t,n)=>new lU(e,n)).infixLeft("div",Zt.Divide,(e,t,n)=>new Aa("div",e,n,(r,a)=>r/a|0)).infixLeft("in",Zt.In,(e,t,n)=>new cU(e,n)).infixLeft("is",Zt.Is,(e,t,n)=>new eb(e,n)).infixLeft("mod",Zt.Modulo,(e,t,n)=>new Aa("mod",e,n,(r,a)=>r%a)).infixLeft("or",Zt.Or,(e,t,n)=>new mU(e,n)).infixLeft("xor",Zt.Xor,(e,t,n)=>new gU(e,n)).infixLeft("implies",Zt.Implies,(e,t,n)=>new vU(e,n))}const AU=DU();function rb(e){return new TA(e,AU.construct(jU(e)).consumeAndParse())}function Oc(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const a=n[r];typeof a=="object"&&"type"in a&&"value"in a||(n[r]=ha(n[r]))}return Us(e,n).map(r=>r.value)}function Us(e,t,n={},r=void 0){let a;if(typeof e=="string"){const o=r==null?void 0:r.get(e);a=o??rb(e),r&&!o&&r.set(e,a)}else a=e;return a.eval({variables:n},t).map(o=>{var c;return{type:o.type,value:(c=o.value)==null?void 0:c.valueOf()}})}const Jn={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Mc(e,t){var r,a;let n=(a=(r=ui.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:a[t.code];return n||(n=kU(e,t)),n}function _U(e,t,n){let r=ui.types[e];r||(r={},ui.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function kU(e,t){const n=t.code,r=MU(e,t.expression),a={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const u=xh(c),f=$$(()=>u.join("."));u.length===1&&u[0]instanceof Nr?a.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?a.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(a.array=!0,a.propertyTypes.add("code")):RA(a,u,e,1),f().endsWith("extension.valueDateTime")&&(a.array=!1)}const o={type:OU(t,a.propertyTypes),elementDefinitions:a.elementDefinitions,parsedExpression:IU(e,t.expression),array:a.array};return _U(e,n,o),o}function RA(e,t,n,r){const a=t[r];if(a instanceof zh){e.propertyTypes.add(a.right.toString());return}if(a instanceof tb){PU(e,a);return}const o=a.toString(),c=Qo(n,o);if(!c)throw new Error(`Element definition not found for ${n} ${o}`);let u=!1,f=r+1;f<t.length&&t[f]instanceof nb&&(u=!0,f++);const p=t[f];if(c.isArray&&!u&&(e.array=!0),f===t.length-1&&p instanceof zh){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;NU(g)&&(g=c.type[0].code),RA(e,t,g,f)}}function PU(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="ofType"){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 eb){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function NU(e){return e==="Element"||e==="BackboneElement"}function OU(e,t){switch(e.type){case"date":return t.size===1&&t.has(oe.date)?Jn.DATE:Jn.DATETIME;case"number":return Jn.NUMBER;case"quantity":return Jn.QUANTITY;case"reference":return t.has(oe.canonical)?Jn.CANONICAL:Jn.REFERENCE;case"token":return t.size===1&&t.has(oe.boolean)?Jn.BOOLEAN:Jn.TEXT;default:return Jn.TEXT}}function MU(e,t){const n=[],r=rb(t);return $h(e,r.child,n),n}function IU(e,t){const n=[],r=rb(t);if($h(e,r.child,n),n.length===0)return r;let a=n[0];for(let o=1;o<n.length;o++)a=new J0(a,n[o]);return new TA("<original-not-available>",a)}function $h(e,t,n){t instanceof J0?($h(e,t.left,n),$h(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function xh(e){if(e instanceof zh||e instanceof nb)return[xh(e.left),e].flat();if(e instanceof Nr)return[e];if(e instanceof Z0)return[xh(e.left),xh(e.right)].flat();if(e instanceof tb){if(e.name==="where"&&!(e.args[0]instanceof eb))return[];if(e.name==="last")return[]}return[e]}const Qp=20,de={EQUALS:"eq",NOT_EQUALS:"ne",GREATER_THAN:"gt",LESS_THAN:"lt",GREATER_THAN_OR_EQUALS:"ge",LESS_THAN_OR_EQUALS:"le",STARTS_AFTER:"sa",ENDS_BEFORE:"eb",APPROXIMATELY:"ap",CONTAINS:"contains",STARTS_WITH:"sw",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"},DA={contains:de.CONTAINS,exact:de.EXACT,above:de.ABOVE,below:de.BELOW,text:de.TEXT,not:de.NOT,in:de.IN,"not-in":de.NOT_IN,"of-type":de.OF_TYPE,missing:de.MISSING,identifier:de.IDENTIFIER,iterate:de.ITERATE},ab={eq:de.EQUALS,ne:de.NOT_EQUALS,lt:de.LESS_THAN,le:de.LESS_THAN_OR_EQUALS,gt:de.GREATER_THAN,ge:de.GREATER_THAN_OR_EQUALS,sa:de.STARTS_AFTER,eb:de.ENDS_BEFORE,ap:de.APPROXIMATELY,sw:de.STARTS_WITH};function AA(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,u]=e.split("?");n=c,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let a;n.includes("/")?a=n.split("/").filter(Boolean).pop():a=n;const o=[];return r&&o.push(...r.entries()),LU(a,o)}function LU(e,t){const n={resourceType:e};for(const[r,a]of t)zU(n,r,a);return n}function zU(e,t,n){var c,u;let r,a;const o=t.indexOf(":");if(o>=0?(r=t.substring(0,o),a=t.substring(o+1)):(r=t,a=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Mu(e.filters,{code:t,operator:de.EQUALS,value:n});return}switch(r){case"_sort":$U(e,n);break;case"_cursor":e.cursor=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 f=uE(n);a==="iterate"&&(f.modifier=de.ITERATE),e.include=Mu(e.include,f);break}case"_revinclude":{const f=uE(n);a==="iterate"&&(f.modifier=de.ITERATE),e.revInclude=Mu(e.revInclude,f);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 f=(u=(c=ui.types[e.resourceType])==null?void 0:c.searchParams)==null?void 0:u[r];f?e.filters=Mu(e.filters,BU(f,a,n)):e.filters=Mu(e.filters,VU(r,a,n))}}}}function $U(e,t){for(const n of t.split(",")){let r,a=!1;n.startsWith("-")?(r=n.substring(1),a=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:a})}}const UU=[de.MISSING,de.PRESENT];function BU(e,t,n){if(UU.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:a}=FU(n);if(!dE(e,a))throw new dt(ii(`Invalid format for ${e.type} search parameter: ${a}`));return{code:e.code,operator:r,value:a}}case"reference":case"string":case"token":case"uri":if(!dE(e,n))throw new dt(ii(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:HU(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function VU(e,t,n){var a;let r=de.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in ab&&(n.length===2||(a=n.at(2))!=null&&a.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function FU(e){const t=e.substring(0,2),n=ab[t];return n?{operator:n,value:e.substring(2)}:{operator:de.EQUALS,value:e}}function HU(e){return DA[e]??de.EQUALS}function uE(e){const t=e.split(":");if(t.includes("*"))throw new dt(ii("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(ii(`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 dt(ii(`Invalid include value '${e}'`))}function dE(e,t){switch(e.type){case"date":return Ih(t);default:return!0}}function ec(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(qU(n))),e.sortRules&&e.sortRules.length>0&&t.push(GU(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==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.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(fE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(fE("_revinclude",n))),t.length===0?"":(rd(t),"?"+t.join("&"))}function qU(e){const t=e.operator in DA?":"+e.operator:"",n=e.operator!==de.EQUALS&&e.operator in ab?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function GU(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function fE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function ib(e){const t=[];let n="",r=!1;for(const a of e)r?(n+=a,r=!1):a==="\\"?r=!0:a===","?(t.push(n),n=""):n+=a;return t.push(n),t}function QU(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!WU(e,t,n))return!1}return!0}function WU(e,t,n){var a,o;const r=(o=(a=ui.types[t.resourceType])==null?void 0:a.searchParams)==null?void 0:o[n.code];if(!r)return!1;if(n.operator===de.MISSING||n.operator===de.PRESENT)return YU(e,n,r);switch(r.type){case"reference":return KU(e,n,r);case"string":case"uri":return _A(e,n,r);case"token":return XU(e,n,r);case"date":return tB(e,n,r);default:return!1}}function YU(e,t,n){const a=Oc(n.expression,e).length>0;return(t.operator===de.MISSING&&t.value==="false"||t.operator===de.PRESENT&&t.value==="true")===a}function KU(e,t,n){const r=Oc(n.expression,e),a=Wp(t.operator);if(t.value===""&&r.length===0)return t.operator===de.EQUALS;const o=r.map(c=>typeof c=="string"?c:c.reference);for(const c of ib(t.value)){let u=o.includes(c);if(!u&&t.code==="_compartment"&&(u=o.some(f=>f==null?void 0:f.endsWith("/"+c))),u)return!a}return a}function XU(e,t,n){return Mc(e.resourceType,n).type===Jn.BOOLEAN?ZU(e,t,n):_A(e,t,n,!0)}function ZU(e,t,n){const r=Oc(n.expression,e),a=t.value==="true",o=r.includes(a);return Wp(t.operator)?!o:o}function _A(e,t,n,r){var p,m,g,v;const o=(v=(g=(m=(p=Mc(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:m.type)==null?void 0:g[0])==null?void 0:v.code,c=Oc(n.expression,e),u=ib(t.value),f=Wp(t.operator);for(const b of c)for(const S of u){let j;if(o===oe.Identifier?j=JU(b,t.operator,S):o===oe.CodeableConcept?j=eB(b,t.operator,S):j=Py(b,t.operator,S,r),j)return!f}return f}function Py(e,t,n,r){if(r&&n.includes("|")){const[o,c]=n.split("|");return Py(e,t,o,!1)&&(!c||Py(e,t,c,!1))}let a="";return e&&(typeof e=="string"?a=e:typeof e=="object"&&(a=JSON.stringify(e))),a.toLowerCase().includes(n.toLowerCase())}function JU(e,t,n){var r,a,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((a=e.system)==null?void 0:a.toLowerCase())===u&&(!f||((o=e.value)==null?void 0:o.toLowerCase())===f):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===f}return((c=e.value)==null?void 0:c.toLowerCase())===n.toLowerCase()}function eB(e,t,n){var r,a,o,c;if(n.includes("|")){const[u,f]=n.split("|").map(p=>p.toLowerCase());return!u&&!f?!1:u?((a=e.coding)==null?void 0:a.some(p=>{var m,g;return((m=p.system)==null?void 0:m.toLowerCase())===u&&(!f||((g=p.code)==null?void 0:g.toLowerCase())===f)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var m;return!p.system&&((m=p.code)==null?void 0:m.toLowerCase())===f}))??!1}return((o=e.text)==null?void 0:o.toLowerCase())===n.toLowerCase()||(((c=e.coding)==null?void 0:c.some(u=>{var f;return((f=u.code)==null?void 0:f.toLowerCase())===n.toLowerCase()}))??!1)}function tB(e,t,n){const r=Oc(n.expression,e),a=ib(t.value),o=Wp(t.operator);for(const c of r)for(const u of a)if(nB(Uh(c),t.operator,Uh(u)))return!o;return o}function nB(e,t,n){if(!e)return!1;switch(t){case de.STARTS_AFTER:case de.GREATER_THAN:return e>n;case de.GREATER_THAN_OR_EQUALS:return e>=n;case de.ENDS_BEFORE:case de.LESS_THAN:return e<n;case de.LESS_THAN_OR_EQUALS:return e<=n;case de.EQUALS:case de.NOT_EQUALS:return e===n;default:return!1}}function Uh(e){if(N$(e))try{return new Date(e).toISOString()}catch(t){console.debug("Failed to parse date",e,t)}else if(fA(e)){if("start"in e)return Uh(e.start);if("end"in e)return Uh(e.end)}}function Wp(e){return e===de.NOT_EQUALS||e===de.NOT}const rB={resourceType:"*"},aB=["DomainConfiguration","JsonWebKey","Login"],iB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],tc={READ:"read",VREAD:"vread",HISTORY:"history",HISTORY_INSTANCE:"history-instance"},oB=[tc.READ,tc.VREAD,tc.HISTORY,tc.HISTORY_INSTANCE];function sB(e,t){if(aB.includes(t))return!1;if(e.resource){for(const n of e.resource)if(PA(n.resourceType,t)&&!n.readonly)return!0}return!1}function kA(e,t,n){if(!n)return rB;if(n.resource){for(const r of n.resource)if(lB(e,t,r))return r}}function lB(e,t,n){var a,o;const r=e.resourceType;return!(!PA(n.resourceType,r)||n.readonly&&!oB.includes(t)||n.compartment&&!((o=(a=e.meta)==null?void 0:a.compartment)!=null&&o.find(c=>{var u;return c.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!QU(e,AA(n.criteria)))}function PA(e,t){return e===t||e==="*"&&!iB.includes(t)}function cB(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function hE(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function pE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),M$(e.buffer)}async function uB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function NA(){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 OA(e){var a;const t={};e=Qr(e);for(const o of e.entry||[]){const c=o.resource;if(!c)continue;c.meta!==void 0&&(delete c.meta.author,delete c.meta.compartment,delete c.meta.lastUpdated,delete c.meta.project,delete c.meta.versionId,Object.keys(c.meta).length===0&&delete c.meta);const u=c==null?void 0:c.id;u&&(t[u]=NA(),o.fullUrl="urn:uuid:"+t[u],(a=o.resource)==null||delete a.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(o=>{var c;return{fullUrl:o.fullUrl,request:{method:"POST",url:(c=o.resource)==null?void 0:c.resourceType},resource:o.resource}})},(o,c)=>dB(o,c,t),2);return fB(JSON.parse(r))}function dB(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 a=n[r];if(a)return"urn:uuid:"+a}}return t}function fB(e){const t=pB(e),{sorted:n,cycles:r}=hB(t),a={};for(const c of e.entry??[])c.fullUrl&&(a[c.fullUrl]=c);const o=n.map(c=>a[c]);for(const c of r)for(const u of c){const f=a[u],p={...f,request:{...f.request,method:"PUT"}};o.push(p)}return{...e,entry:o}}const Wl={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function hB(e){const t=[],n={},r=[];for(const o of Object.keys(e))n[o]=Wl.NotVisited;function a(o,c){if(n[o]===Wl.Visited)return!0;if(n[o]===Wl.Visiting){const f=c.lastIndexOf(o);return f!==-1&&r.push(c.slice(f)),!0}n[o]=Wl.Visiting,c.push(o);let u=!1;for(const f of e[o])a(f,c)||(u=!0);return n[o]=Wl.Visited,c.pop(),t.unshift(o),!u}for(const o in e)n[o]===Wl.NotVisited&&a(o,[]);return{sorted:t,cycles:r}}function MA(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Wo(r)){const a=r.reference;a.startsWith("urn:uuid:")&&t(a)}else MA(r,t)}}function pB(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&&MA(n.resource,a=>{t[a]&&t[a].push(r)})}return t}const dn={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};class mB{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 a=0;a<r.length;a++)if(r[a]===n){r.splice(a,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 Yp{constructor(){this.emitter=new mB}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 Ny={"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"},gB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],ob=["DiagnosticReport-update"];function vB(e){return ob.includes(e)}function yB(e){if(ob.includes(e))throw new dt(yn(`'context.version' is required for '${e}'.`))}const xB={"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",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},select:{resourceType:"*",reference:!0,manyAllowed:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function bB(e){return gB.includes(e)}function IA(e){return!!e.endpoint}function mE(e){if(!sb(e))throw new dt(yn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:a}=e,o={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":a.join(",")};return IA(e)&&(o.endpoint=e.endpoint),new URLSearchParams(o).toString()}function sb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:a}=e;if(!(t&&n&&r&&a)||typeof r!="string"||typeof a!="object"||!Array.isArray(a)||a.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const o of a)if(!Ny[o])return!1;return!(IA(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function SB(e,t,n,r){if(typeof t!="object")throw new dt(yn(`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 dt(yn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(yn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const a=r.resourceType;if(a!=="*"){if(!bB(t.resourceType))throw new dt(yn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(a&&t.resourceType!==a)throw new dt(yn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${a}.`))}}function wB(e,t,n,r,a){if(a.set(t.key,(a.get(t.key)??0)+1),r.reference){if(!Wo(t.reference))throw new dt(yn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else SB(e,t.resource,n,r)}function jB(e,t){const n=new Map,r=xB[e];for(let a=0;a<t.length;a++){const o=t[a].key;if(!r[o])throw new dt(yn(`Key '${o}' not found for event '${e}'. Make sure to add only valid keys.`));wB(e,t[a],a,r[o],n)}for(const[a,o]of Object.entries(r)){if(!(o.optional||n.has(a)))throw new dt(yn(`Missing required key '${a}' on context for '${e}' event.`));if(!o.manyAllowed&&(n.get(a)??0)>1)throw new dt(yn(`${n.get(a)} context entries with key '${a}' found for the '${e}' event when schema only allows for 1.`))}}function gE(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(yn("Must provide a topic."));if(!Ny[t])throw new dt(yn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Ny).join(", ")}`));if(typeof n!="object")throw new dt(yn("context must be a context object or array of context objects."));if(ob.includes(t)&&!r)throw new dt(yn(`The '${t}' event must contain a 'context.versionId'.`));const a=Array.isArray(n)?n:[n];return jB(t,a),{timestamp:new Date().toISOString(),id:NA(),event:{"hub.topic":e,"hub.event":t,context:a,...r?{"context.versionId":r}:{}}}}class CB extends Yp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(yn("Subscription request should contain an endpoint."));if(!sb(t))throw new dt(yn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const a=JSON.parse(r.data);if(a["hub.topic"])return;const o=a;o.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:o}),n.send(JSON.stringify({id:a==null?void 0:a.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function EB(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=cB(t),r=Array.from(n).reduce((o,c)=>{const u=("00"+c.charCodeAt(0).toString(16)).slice(-2);return`${o}%${u}`},""),a=decodeURIComponent(r);return JSON.parse(a)}function TB(e){return e.split(".").length===3}function lb(e){const[t,n,r]=e.split(".");return EB(n)}function RB(e){try{return typeof lb(e).login_id=="string"}catch{return!1}}function DB(e){try{const n=lb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class AB{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,dn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var LA;LA=Symbol.toStringTag;class _a{constructor(t){this[LA]="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 _B{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new kB)}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?Ia(n):void 0)}}class kB{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]}}/*!
|
|
79
|
+
* Reconnecting WebSocket
|
|
80
|
+
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
81
|
+
* https://github.com/pladaria/reconnecting-websocket
|
|
82
|
+
* License MIT
|
|
83
|
+
*
|
|
84
|
+
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
85
|
+
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
86
|
+
*/const ic={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let vE=!1;function PB(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");ic.Event=globalThis.Event,ic.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},ic.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function NB(e,t){if(!e)throw new Error(t)}function ih(e){return new e.constructor(e.type,e)}const ys={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let yE=!1;class Oo extends Yp{constructor(t,n,r={}){vE||(PB(),vE=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=a=>{this._debug("open event");const{minUptime:o=ys.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),o),NB(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>{var u;return(u=this._ws)==null?void 0:u.send(c)}),this._messageQueue=[],this.onopen&&this.onopen(a),this.dispatchEvent(ih(a))},this._handleMessage=a=>{this._debug("message event"),this.onmessage&&this.onmessage(a),this.dispatchEvent(ih(a))},this._handleError=a=>{this._debug("error event",a.message),this._disconnect(void 0,a.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(a),this._debug("exec error listeners"),this.dispatchEvent(ih(a)),this._connect()},this._handleClose=a=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(a),this.dispatchEvent(ih(a))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Oo.CONNECTING}get OPEN(){return Oo.OPEN}get CLOSING(){return Oo.CLOSING}get CLOSED(){return Oo.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){var n;return this._messageQueue.reduce((r,a)=>(typeof a=="string"?r+=a.length:a instanceof Blob?r+=a.size:r+=a.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Oo.CLOSED:Oo.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=ys.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){const{reconnectionDelayGrowFactor:t=ys.reconnectionDelayGrowFactor,minReconnectionDelay:n=ys.minReconnectionDelay,maxReconnectionDelay:r=ys.maxReconnectionDelay}=this._options;let a=0;return this._retryCount>0&&(a=n*Math.pow(t,this._retryCount-1),a>r&&(a=r)),this._debug("next delay",a),a}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=ys.maxRetries,connectionTimeout:n=ys.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!yE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),yE=!0);const r=this._options.WebSocket||WebSocket;this._debug("connect",{url:this._url,protocols:this._protocols}),this._ws=this._protocols?new r(this._url,this._protocols):new r(this._url),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new ic.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new ic.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new ic.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const OB=5e3;class Oy extends Yp{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 MB{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Oy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class IB{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof $A))throw new dt(yn("First arg of constructor should be a `MedplumClient`"));let a;try{a=new URL(n).toString()}catch{throw new dt(yn("Not a valid URL"))}const o=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(a,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new Oo(a,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=o,this.masterSubEmitter=new Oy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??OB,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,a,o,c,u,f;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const m=p,g=(a=(r=m==null?void 0:m.entry)==null?void 0:r[0])==null?void 0:a.resource;if(g.type==="heartbeat"){(o=this.masterSubEmitter)==null||o.dispatchEvent({type:"heartbeat",payload:m});return}if(g.type==="handshake"){const b=zs(g.subscription),S={type:"connect",payload:{subscriptionId:b}};(c=this.masterSubEmitter)==null||c.dispatchEvent(S);const j=this.criteriaEntriesBySubscriptionId.get(b);if(!j){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}j.connecting=!1,j.emitter.dispatchEvent({...S});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:m});const v=this.criteriaEntriesBySubscriptionId.get(zs(g.subscription));if(!v){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}v.emitter.dispatchEvent({type:"message",payload:m})}catch(p){console.error(p);const m={type:"error",payload:p};(f=this.masterSubEmitter)==null||f.dispatchEvent(m);for(const g of this.getAllCriteriaEmitters())g.dispatchEvent({...m})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new dt(Kz(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const a of this.getAllCriteriaEmitters())a.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,a;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(a=this.masterSubEmitter)==null||a.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const a of this.getAllCriteriaEmitters())a.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var a;const r={type:"error",payload:n};(a=this.masterSubEmitter)==null||a.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const a={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(a),t.emitter.dispatchEvent({...a})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var c,u;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Lt(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`),a=(c=r==null?void 0:r.find(f=>f.name==="token"))==null?void 0:c.valueString,o=(u=r==null?void 0:r.find(f=>f.name==="websocket-url"))==null?void 0:u.valueUrl;if(!a)throw new dt(yn("Failed to get token"));if(!o)throw new dt(yn("Failed to get URL from $get-ws-binding-token"));return[n,a]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const a of r.criteriaWithProps)if(ci(n,a.subscriptionProps))return a}}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 a;this.criteriaEntries.has(n)?a=this.criteriaEntries.get(n):(a={criteriaWithProps:[]},this.criteriaEntries.set(n,a)),r?a.criteriaWithProps.push(t):a.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:a,token:o}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(f=>{const p=f.subscriptionProps;return!ci(r,p)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),a&&this.criteriaEntriesBySubscriptionId.delete(a),o&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:o}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ke(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const a=new MB(t,n);return this.addCriteriaEntry(a),this.subscribeToCriteria(a).catch(console.error),a.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))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Oy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const zA="4.1.6-489ec081e",LB=dn.FHIR_JSON+", */*; q=0.1",zB="https://api.medplum.com/",$B=1e3,UB=6e4,BB=0,VB=3e5,FB="Binary/",xE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},Yl={ClientCredentials:"client_credentials",AuthorizationCode:"authorization_code",RefreshToken:"refresh_token",JwtBearer:"urn:ietf:params:oauth:grant-type:jwt-bearer",TokenExchange:"urn:ietf:params:oauth:grant-type:token-exchange"},HB={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},qB={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class $A extends Yp{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)??GB(),this.storage=(t==null?void 0:t.storage)??new _B,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=K0((t==null?void 0:t.baseUrl)??zB),this.fhirBaseUrl=Za(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Za(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Za(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Za(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Za(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.credentialsInHeader=(t==null?void 0:t.authCredentialsMethod)==="header",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??VB,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?BB:UB),this.cacheTime>0?this.requestCache=new XD((t==null?void 0:t.resourceCacheSize)??$B):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}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}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=Za(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 a;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?a=new Promise((c,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):a=this.request("GET",t,n);const o=new _a(a);return this.setCacheEntry(t,o),o}post(t,n,r,a={}){return t=t.toString(),this.setRequestBody(a,n),r&&this.setRequestContentType(a,r),this.invalidateUrl(t),this.request("POST",t,a)}put(t,n,r,a={}){return t=t.toString(),this.setRequestBody(a,n),r&&this.setRequestContentType(a,r),this.invalidateUrl(t),this.request("PUT",t,a)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,dn.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:a}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:a},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,a,o=!0){let c=a;o&&(c=await this.ensureCodeChallenge(a)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,o))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:Yl.TokenExchange,subject_token_type:HB.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,a,o=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",a.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(a)),o){const{codeChallenge:u,codeChallengeMethod:f}=a;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",u)}return c.toString()}fhirUrl(...t){return new URL(Za(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=V$(n)),r}search(t,n,r){const a=this.fhirSearchUrl(t,n),o="search-"+a.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=this.getBundle(a,r);return this.setCacheEntry(o,u),u}searchOne(t,n,r){const a=this.fhirSearchUrl(t,n);a.searchParams.set("_count","1"),a.searchParams.sort();const o="searchOne-"+a.toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new _a(this.search(t,a.searchParams,r).then(f=>{var p,m;return(m=(p=f.entry)==null?void 0:p[0])==null?void 0:m.resource}));return this.setCacheEntry(o,u),u}searchResources(t,n,r){const o="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(o,r);if(c)return c.value;const u=new _a(this.search(t,n,r).then(wE));return this.setCacheEntry(o,u),u}async*searchResourcePages(t,n,r){var o,c;let a=this.fhirSearchUrl(t,n);for(;a;){const u=new URL(a).searchParams,f=await this.search(t,u,r),p=(o=f.link)==null?void 0:o.find(m=>m.relation==="next");if(!((c=f.entry)!=null&&c.length)&&!p)break;yield wE(f),a=p!=null&&p.url?new URL(p.url):void 0}}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 a,o;const r=(o=(a=this.requestCache)==null?void 0:a.get(this.fhirUrl(t,n).toString()))==null?void 0:o.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return xE;const[r,a]=n.split("/");if(!(!r||!a))return this.getCached(r,a)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new _a(Promise.reject(new Error("Missing reference")));if(r==="system")return new _a(Promise.resolve(xE));const[a,o]=r.split("/");return!a||!o?new _a(Promise.reject(new Error("Invalid reference"))):this.readResource(a,o,n)}requestSchema(t){if(iA(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const a=new _a((async()=>{const o=`{
|
|
87
|
+
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
88
|
+
resourceType,
|
|
89
|
+
name,
|
|
90
|
+
kind,
|
|
91
|
+
description,
|
|
92
|
+
type,
|
|
93
|
+
url,
|
|
94
|
+
snapshot {
|
|
95
|
+
element {
|
|
96
|
+
id,
|
|
97
|
+
path,
|
|
98
|
+
definition,
|
|
99
|
+
min,
|
|
100
|
+
max,
|
|
101
|
+
base {
|
|
102
|
+
path,
|
|
103
|
+
min,
|
|
104
|
+
max
|
|
105
|
+
},
|
|
106
|
+
contentReference,
|
|
107
|
+
type {
|
|
108
|
+
code,
|
|
109
|
+
profile,
|
|
110
|
+
targetProfile
|
|
111
|
+
},
|
|
112
|
+
binding {
|
|
113
|
+
strength,
|
|
114
|
+
valueSet
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
120
|
+
base,
|
|
121
|
+
code,
|
|
122
|
+
type,
|
|
123
|
+
expression,
|
|
124
|
+
target
|
|
125
|
+
}
|
|
126
|
+
}`.replace(/\s+/g," "),c=await this.graphql(o);eE(c.data.StructureDefinitionList);for(const u of c.data.SearchParameterList)J$(u)})());return this.setCacheEntry(n,a),a}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&q0(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),a=this.getCacheEntry(r,void 0);if(a)return a.value;const o=new _a((async()=>{if(n!=null&&n.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const u=await this.post(c.toString(),{});eE(u)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}aA(c)}})());return this.setCacheEntry(r,o),o}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,a){return this.get(this.fhirUrl(t,n,"_history",r),a)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),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){const a=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const o=await this.post(a,t,void 0,r);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async upsertResource(t,n,r){const a=this.fhirSearchUrl(t.resourceType,n);let o=await this.put(a,t,void 0,r);return o||(o=t),this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),o}async createAttachment(t,n,r,a,o){let c=jE(t,n,r,a);if(c.contentType===dn.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,v)=>{const b=new FileReader;b.onload=()=>{if(!b.result){v(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:dn.CDA_XML})}const u=o??(typeof n=="object"?n:{}),f=await this.createBinary(c,u);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,a,o){const c=jE(t,n,r,a),u=o??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:v}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g!=null&&g.reference&&this.setRequestHeader(u,"X-Security-Context",g.reference),v?this.uploadwithProgress(b,f,p,v,u):this.post(b,f,p,u)}uploadwithProgress(t,n,r,a,o){return new Promise((c,u)=>{var g;const f=new XMLHttpRequest,p=()=>f.abort();(g=o==null?void 0:o.signal)==null||g.addEventListener("abort",p);const m=v=>{var b;(b=o==null?void 0:o.signal)==null||b.removeEventListener("abort",p),v instanceof Error?u(v):c(v)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),a&&(f.upload.onprogress=v=>a(v),f.upload.onload=v=>a(v)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new dt(Jt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),o!=null&&o.headers){const v=o.headers;for(const[b,S]of Object.entries(v))f.setRequestHeader(b,S)}f.send(n)})}async createPdf(t,n,r,a){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const o=YB(t,n,r,a),c=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:f,fonts:p,...m}=o,g=await this.createPdfImpl(u,f,p),v={...m,data:g,contentType:"application/pdf"};return this.createBinary(v,c)}createComment(t,n,r){const a=this.getProfile();let o,c;return t.resourceType==="Encounter"&&(o=fn(t),c=t.subject),t.resourceType==="ServiceRequest"&&(o=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=fn(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[fn(t)],encounter:o,subject:c,sender:a?fn(a):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,a){const o=await this.patch(this.fhirUrl(t,n),r,a);return this.cacheResource(o),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),o}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,a){let o;if(typeof t=="string"){const c=t;o=this.fhirUrl("Bot",c,"$execute")}else{const c=t;o=this.fhirUrl("Bot","$execute"),o.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(o,n,r,a)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,dn.JSON,n)}graphql(t,n,r,a){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},dn.JSON,a)}readResourceGraph(t,n,r,a){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,a)}pushToAgent(t,n,r,a,o,c){return this.post(this.fhirUrl("Agent",zs(t),"$push"),{destination:typeof n=="string"?n:Lt(n),body:r,contentType:a,waitForResponse:o},dn.FHIR_JSON,c)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||Lt(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}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=DB(t),this.medplumServer=RB(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var a,o;return((a=r.profile)==null?void 0:a.reference)!==((o=t.profile)==null?void 0:o.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var o,c;this.profilePromise=void 0;const a=((c=(o=this.sessionDetails)==null?void 0:o.profile)==null?void 0:c.id)!==r.profile.id;this.sessionDetails=r,a&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}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(FB)&&(t=this.fhirUrl(r));let a=n.headers;return a||(a={},n.headers=a),a.Accept||(a.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...a}=t,o=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});a.securityContext||(a.securityContext=fn(o));const c=await this.createAttachment(a,n);return this.updateResource({...o,status:"completed",content:c})}async uploadMedia(t,n,r,a,o){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:a},o)}async bulkExport(t="",n,r,a){const o=t&&`${t}/`,c=this.fhirUrl(`${o}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),a)}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 AB(this)),this.keyValueClient}getBundle(t,n){return new _a((async()=>{const r=await this.get(t,n);if(r.entry)for(const a of r.entry)this.cacheResource(a.resource);return r})())}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(a=>a.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new _a(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},a={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const o=await this.fetchWithRetry(n,r);if(o.status===401)return this.handleUnauthenticated(t,n,r);if(o.status===204||o.status===304)return;const c=o.headers.get("content-type"),u=c==null?void 0:c.includes("json");if(o.status===404&&!u)throw new dt(Wz);const f=await this.parseBody(o,u);if(o.status===200&&r.followRedirectOnOk||o.status===201&&r.followRedirectOnCreated){const p=await SE(o,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(o.status===202&&r.pollStatusOnAccepted){const m=await SE(o,f)??a.statusUrl;if(m)return this.pollStatus(m,r,a)}if(o.status>=400)throw new dt(Jt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(a){throw console.error("Error parsing response",t.status,a),a}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Za(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2;for(let a=0;a<=r;a++)try{this.options.verbose&&this.logRequest(t,n);const o=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(o),this.setCurrentRateLimit(o),a>=r||!KB(o))return o;await lE(this.getRetryDelay(a))}catch(o){if(o.message==="Failed to fetch"&&a===0&&this.dispatchEvent({type:"offline"}),o.name==="AbortError"||a===r)throw o}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const a of rd(Object.keys(r)))console.log(`> ${a}: ${r[a]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){var r;const n=(r=t.headers)==null?void 0:r.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const a=r[0].substring(1,r[0].length-1),o=r.find(p=>p.startsWith("r=")),c=o?parseInt(o.substring(2),10):NaN,u=r.find(p=>p.startsWith("t=")),f=u?parseInt(u.substring(2),10):NaN;if(!a||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:a,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const a of n)a.remainingUnits||(r=Math.max(r,a.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const a={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(a.headers={...n.headers},delete a.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const o=n.pollStatusPeriod??1e3;await lE(o),r.pollCount++}return this.request("GET",t,a,r)}async executeAutoBatch(){var a,o;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const c=t[0];try{c.resolve(await this.request(c.method,Za(this.fhirBaseUrl,c.url),c.options))}catch(u){c.reject(new dt(Jt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(c=>({request:{method:c.method,url:c.url},resource:c.options.body?JSON.parse(c.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let c=0;c<t.length;c++){const u=t[c],f=(a=r.entry)==null?void 0:a[c];(o=f==null?void 0:f.response)!=null&&o.outcome&&!eA(f.response.outcome)?u.reject(new dt(f.response.outcome)):u.resolve(f==null?void 0:f.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",LB,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",dn.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,a=!1){t.headers||(t.headers={});const o=t.headers;a&&o[n]||(o[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0: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 dt(nd)))}async startPkce(){const t=pE();sessionStorage.setItem("pkceState",t);const n=pE().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await uB(n),a=I$(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",a),{codeChallengeMethod:"S256",codeChallenge:a}}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??bE()),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={grant_type:Yl.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??bE()};if(typeof sessionStorage<"u"){const a=sessionStorage.getItem("codeVerifier");a&&(r.code_verifier=a)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:Yl.RefreshToken,client_id:this.clientId??"",refresh_token:this.refreshToken}),this.refreshPromise;if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){return this.clientId=t,this.clientSecret=n,this.fetchTokens({grant_type:Yl.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:Yl.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:Yl.ClientCredentials,client_assertion_type:qB.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=hE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(yn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(yn("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},o=(await this.post(this.fhircastHubUrl,mE(r),dn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!o)throw new Error("Invalid response!");return r.endpoint=o,r}async fhircastUnsubscribe(t){if(!sb(t))throw new dt(yn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(yn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,mE(t),dn.FORM_URL_ENCODED)}fhircastConnect(t){return new CB(t)}async fhircastPublish(t,n,r,a){return vB(n)?this.post(this.fhircastHubUrl,gE(t,n,r,a),dn.JSON):(yB(n),this.post(this.fhircastHubUrl,gE(t,n,r),dn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":dn.FORM_URL_ENCODED};this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`),this.credentialsInHeader&&(n.delete("client_id"),n.delete("client_secret"),!this.basicAuth&&t.client_id&&t.client_secret&&(r.Authorization=`Basic ${hE(t.client_id+":"+t.client_secret)}`));const a={method:"POST",headers:r,body:n.toString(),credentials:"include"};let o;try{o=await this.fetchWithRetry(this.tokenUrl,a)}catch(u){throw this.refreshPromise=void 0,u}if(!o.ok){this.clearActiveLogin();try{const u=await o.json();throw new dt(ii(u.error_description))}catch(u){throw new dt(ii("Failed to fetch tokens"),u)}}const c=await o.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(TB(n)){const r=lb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(Yz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(ZC)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(ZC)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new IB(this,B$(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 GB(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function bE(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function SE(e,t){var a,o;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Fp(t)&&((o=(a=t.issue)==null?void 0:a[0])!=null&&o.diagnostics))return t.issue[0].diagnostics}function wE(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function QB(e){return sr(e)&&"data"in e&&"contentType"in e}function jE(e,t,n,r){return QB(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function WB(e){return sr(e)&&"docDefinition"in e}function YB(e,t,n,r){return WB(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function KB(e){return e.status===429||e.status>=500}function yc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:a,accessPolicyResource:o}){if(t===(e==null?void 0:e.path))return;a??(a=(e==null?void 0:e.debugMode)??!1),o??(o=e==null?void 0:e.accessPolicyResource);let c=XB(t,n,e,!!a);const u=ky(t,".",2)[1];c=ZB(c,o,u),c=JB(c,o,u);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const v=ky(g,".",2)[1];if(v){if(!m[v]){const b=Bh(v,o==null?void 0:o.hiddenFields);m[v]={hidden:b,readonly:b||Bh(v,o==null?void 0:o.readonlyFields)}}return m[v]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:a,getExtendedProps:p,accessPolicyResource:o}}function XB(e,t,n,r){const a=Object.create(null);if(n)for(const[c,u]of Object.entries(n.elementsByPath)){const f=As(e,c);f!==void 0&&(a[f]=u)}let o=!1;if(t)for(const[c,u]of Object.entries(t))c in a||(a[c]=u,o=!0);return r&&console.assert(o,"Unnecessary ElementsContext; not using any newly provided elements"),a}function ZB(e,t,n){var a;if(!((a=t==null?void 0:t.hiddenFields)!=null&&a.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!Bh(r+o,t.hiddenFields)))}function JB(e,t,n){var o;if(!((o=t==null?void 0:t.readonlyFields)!=null&&o.length))return e;const r=Object.create(null),a=n?n+".":"";for(const[c,u]of Object.entries(e))Bh(a+c,t.readonlyFields)?r[c]={...u,readonly:!0}:r[c]=u;return r}function Bh(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const a=n.slice(0,r).join(".");if(t.includes(a))return!0}return!1}function UA(e){return e.type!==void 0&&e.type.length>0}function eV(e,t,n,r){var o;const a=d$(e,t.path,{profileUrl:r});if(a){const c=((o=n.typeSchema)==null?void 0:o.elements)??n.elements;return a.some(u=>p$(u,t,n,c))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function BA(e,t,n,r){var a,o;if(e)for(const c of t){const u={value:e,type:((a=c.typeSchema)==null?void 0:a.type)??((o=c.type)==null?void 0:o[0].code)};if(n.every(f=>{var p;return eV(u,f,c,((p=c.typeSchema)==null?void 0:p.url)??r)}))return c.name}}class tV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const a=yc({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(a===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[a],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 a=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([o])=>o.startsWith(n)));this.crawlElementsImpl(a,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const a=this.prepareSlices(r.slices,r);if(!En(a.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(a.slices[0],n.path,a),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=nV(t);for(const a of r)this.crawlElementNode(a,n)}crawlElementNode(t,n){var a,o;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const c of t.children)this.crawlElementNode(c,n);En((o=(a=t.element)==null?void 0:a.slicing)==null?void 0:o.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var o,c;const r=[];for(const u of t){if(!UA(u))continue;const f=(c=(o=u.type.find(p=>En(p.profile)))==null?void 0:o.profile)==null?void 0:c[0];if(En(f)){const p=Pc(f);p&&(u.typeSchema=p)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const a of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(a))&&this.crawlSliceImpl(a,n,r)}crawlSliceImpl(t,n,r){const a=t.typeSchema;a&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(a),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let o;const c=(a==null?void 0:a.elements)??t.elements;En(c)&&(o=yc({path:n,parentContext:this.elementsContext,elements:c})),o&&this.elementsContextStack.push(o),this.crawlElementsImpl(c,n),o&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),a&&this.visitor.onExitSchema&&this.visitor.onExitSchema(a)}}function nV(e){const t=[];function n(o,c){return c.startsWith(o+".")}function r(o,c){for(const u of o.children)if(n(u.key,c.key)){r(u,c);return}o.children.push(c)}const a=Object.entries(e);a.sort((o,c)=>o[0].localeCompare(c[0]));for(const[o,c]of a){const u={key:o,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,o)){r(p,u),f=!0;break}f||t.push(u)}return t}const Vv="__sliceName";function rV(e,t){const n=new aV(e,e.resourceType,"resource");return new tV(t,n).crawlResource(),n.getDefaultValue()}function CE(e,t,n){for(const[r,a]of Object.entries(t)){if(n===void 0||n===r){Vh(e,r,a,t);continue}const o=As(n,r);o!==void 0&&Vh(e,o,a,t)}return e}class aV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Qr(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 a=this.value.values,o=this.value.path,c=As(o,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${o}`);const u=[];for(const f of a){if(f===void 0)continue;const p=As(r.path,o),m=Array.isArray(f)?f:[f];for(const g of m){iV(g,c,n,r.elements,p),Vh(g,c,n,r.elements);const v=Iy(g,c,r.elements,p);v!==void 0&&u.push(v)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const o=As(this.value.path,t);if(o===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=As(r.path,this.value.path);for(const u of this.value.values){const f=Iy(u,o,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];En(m)||f.splice(p,1)}Tn(f)&&My(u,void 0,o,n)}}onEnterSlice(t,n,r){const a=this.value.values,o=[];for(const c of a)if(c!==void 0){const u=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(u,n,r);o.push(f)}this.valueStack.push({type:"slice",path:t,values:o})}getMatchingSliceValues(t,n,r){const a=[];for(const o of t)(o[Vv]??BA(o,[n],r.discriminator,this.schema.url))===n.name&&a.push(o);for(let o=a.length;o<n.min;o++)if(Y0(n.type[0].code)){const c=Object.create(null);a.push(c),t.push(c)}return a}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 a=n[r];Vv in a&&delete a[Vv]}}getDefaultValue(){return this.rootValue}}function iV(e,t,n,r,a){const o=Iy(e,t,r,a);n.min>0&&o===void 0&&Y0(n.type[0].code)&&(n.isArray?My(e,[Object.create(null)],t,n):My(e,Object.create(null),t,n))}function My(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let a=n;if(n.includes("[x]")){const o=r.type[0].code;a=n.replace("[x]",$n(o))}t===void 0?delete e[a]:e[a]=t}function Iy(e,t,n,r){const a=t.split(".");let o=e,c;for(let u=0;u<a.length;u++){let f=a[u];if(f.includes("[x]")){const p=(r?r+".":"")+a.slice(0,u+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",$n(g))}if(u===a.length-1){Array.isArray(o)?c=o.map(p=>p[f]):c=o[f];continue}if(Array.isArray(o))o=o.map(p=>p[f]);else if(sr(o)){if(o[f]===void 0)return;o=o[f]}else return}return c}function Vh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Vh(u,t,n,r));e==null&&(e=Object.create(null));const a=e,o=t.split(".");let c=a;for(let u=0;u<o.length;u++){let f=o[u];if(f.includes("[x]")){const m=r[o.slice(0,u+1).join(".")].type[0].code;f=f.replace("[x]",$n(m))}if(u===o.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??(m[f]=n.fixed.value):n.pattern&&(m[f]=VA(m[f],n.pattern.value))}else{if(!(f in c)){const p=o.slice(0,u+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return a}function VA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Qr(t);if(sr(t)&&(sr(e)&&!Array.isArray(e)||e===void 0)){const n=Qr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=VA(n[r],t[r]);return n}return e}const oV="https://meta.medplum.com/releases",Fv=new Map;function sV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!(n!=null&&n.length))throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function lV(e,t,n){let r=Fv.get("latest");if(!r){const a="latest",o=new URL(`${oV}/${a}.json`);o.searchParams.set("a",e),o.searchParams.set("c",zA);const c=await fetch(o.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ke(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const u=await c.json();sV(u),r=u,Fv.set("latest",r),Fv.set(r.tag_name.slice(1),r)}return r}async function cV(e){const t=await lV(e);if(!t.tag_name.startsWith("v"))throw new Error(`Invalid release name found. Release tag '${t.tag_name}' did not start with 'v'`);return t.tag_name.slice(1)}const FA=y.createContext(void 0);function Kp(){return y.useContext(FA)}function Ae(){return Kp().medplum}function Xp(){return Kp().navigate}function Zp(){return Kp().profile}const EE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function uV(e){const t=e.medplum,n=e.navigate??dV,[r,a]=y.useState({profile:t.getProfile(),loading:t.isLoading()});y.useEffect(()=>{function c(){a(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of EE)t.addEventListener(u,c);return()=>{for(const u of EE)t.removeEventListener(u,c)}},[t]);const o=y.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(FA.Provider,{value:o,children:e.children})}function dV(e){window.location.assign(e)}const TE=new Map,HA=e=>y.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 a=TE.get(t);if(a){const c=new URLSearchParams(new URL(a).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return a}return TE.set(t,e),e},[e]);function fV(e){const t=y.useRef(void 0);return y.useEffect(()=>{t.current=e}),t.current}function Yt(e,t){const n=Ae(),[r,a]=y.useState(()=>RE(n,e)),o=y.useCallback(c=>{ci(c,r)||a(c)},[r]);return y.useEffect(()=>{let c=!0;const u=RE(n,e);return!u&&Wo(e)?n.readReference(e).then(f=>{c&&o(f)}).catch(f=>{c&&(o(void 0),t&&t(Jt(f)))}):o(u),()=>c=!1},[n,e,o,t]),r}function RE(e,t){if(t){if(pi(t))return t;if(Wo(t))return e.getCachedReference(t)}}function hV(e,t,n={leading:!1}){const[r,a]=y.useState(e),o=y.useRef(!1),c=y.useRef(void 0),u=y.useRef(!1),f=y.useCallback(()=>window.clearTimeout(c.current),[]);return y.useEffect(()=>{o.current&&(!u.current&&n.leading?(u.current=!0,a(e)):(f(),c.current=setTimeout(()=>{u.current=!1,a(e)},t)))},[e,n.leading,t,f]),y.useEffect(()=>(o.current=!0,f),[f]),[r,f]}const pV=250;function mV(e,t,n){return qA("searchOne",e,t)}function xc(e,t,n){return qA("searchResources",e,t)}function qA(e,t,n,r){const a=Ae(),[o,c]=y.useState(),[u,f]=y.useState(!0),[p,m]=y.useState(),[g,v]=y.useState(),b=a.fhirSearchUrl(t,n).toString(),[S]=hV(b,pV,{leading:!0});return y.useEffect(()=>{S!==o&&(c(S),a[e](t,n).then(j=>{f(!1),m(j),v(Qz)}).catch(j=>{f(!1),m(void 0),v(Jt(j))}))},[a,e,t,n,o,S]),[p,u,g]}function gV(e){const t=e.value;return t?s.jsx(s.Fragment,{children:SA(t)}):null}const GA=["meta","implicitRules","contained","extension","modifierExtension"],QA=["language","text"],cn=y.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});cn.displayName="ElementsContext";const cb=["extension","modifierExtension"],vV=["id",...GA].filter(e=>!cb.includes(e));function yV(e){return Object.entries(e).filter(([n,r])=>{var a;return!En(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||cb.includes(n)&&!En((a=r.slicing)==null?void 0:a.slices)||vV.includes(n)?!1:!(QA.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function DE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function AE(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function xV(e){const[t,n]=y.useState(e.defaultValue||{}),r=y.useRef(t);r.current=t;const{getExtendedProps:a}=y.useContext(cn),[o,c,u,f,p,m,g]=y.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(T=>a(e.path+"."+T)),[a,e.path]);function v(T){n(T),e.onChange&&e.onChange(T)}function b(T){v({...r.current,use:T})}function S(T){v({...r.current,type:T})}function j(T){v(AE(r.current||{},0,T))}function C(T){v(AE(r.current||{},1,T))}function R(T){v({...r.current,city:T})}function D(T){v({...r.current,state:T})}function E(T){v({...r.current,postalCode:T})}return s.jsxs(Ce,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:T=>b(T.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:T=>S(T.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:DE(t,0),onChange:T=>j(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Line 2",defaultValue:DE(t,1),onChange:T=>C(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:T=>R(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"State",defaultValue:t.state,onChange:T=>D(T.currentTarget.value)}),s.jsx(ze,{disabled:e.disabled||(g==null?void 0:g.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:T=>E(T.currentTarget.value)})]})}function bV(e){const t=Zp(),[n,r]=y.useState(e.defaultValue||{});function a(o){const c=o?{text:o,authorReference:t&&fn(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return s.jsx(ze,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:o=>a(o.currentTarget.value)})}/**
|
|
127
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the MIT license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/var SV={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"}};/**
|
|
132
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the MIT license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const Fe=(e,t,n,r)=>{const a=y.forwardRef(({color:o="currentColor",size:c=24,stroke:u=2,title:f,className:p,children:m,...g},v)=>y.createElement("svg",{ref:v,...SV[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:o}:{strokeWidth:u,stroke:o},...g},[f&&y.createElement("title",{key:"svg-title"},f),...r.map(([b,S])=>y.createElement(b,S)),...Array.isArray(m)?m:[m]]));return a.displayName=`${n}`,a};/**
|
|
137
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the MIT license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/var wV=Fe("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"}]]);/**
|
|
142
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the MIT license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/var el=Fe("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"}]]);/**
|
|
147
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the MIT license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/var jV=Fe("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"}]]);/**
|
|
152
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the MIT license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/var CV=Fe("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"}]]);/**
|
|
157
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the MIT license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/var EV=Fe("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"}]]);/**
|
|
162
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the MIT license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/var TV=Fe("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"}]]);/**
|
|
167
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the MIT license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/var RV=Fe("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"}]]);/**
|
|
172
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the MIT license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/var DV=Fe("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"}]]);/**
|
|
177
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the MIT license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/var AV=Fe("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"}]]);/**
|
|
182
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the MIT license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/var _V=Fe("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"}]]);/**
|
|
187
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the MIT license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/var kV=Fe("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"}]]);/**
|
|
192
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/var PV=Fe("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"}]]);/**
|
|
197
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the MIT license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/var ko=Fe("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"}]]);/**
|
|
202
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the MIT license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/var to=Fe("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
207
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the MIT license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/var NV=Fe("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"}]]);/**
|
|
212
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the MIT license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/var ub=Fe("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
217
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the MIT license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/var OV=Fe("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
|
|
222
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the MIT license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/var Fh=Fe("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"}]]);/**
|
|
227
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the MIT license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/var Hh=Fe("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"}]]);/**
|
|
232
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the MIT license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/var db=Fe("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"}]]);/**
|
|
237
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the MIT license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/var MV=Fe("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"}]]);/**
|
|
242
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the MIT license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/var WA=Fe("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"}]]);/**
|
|
247
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the MIT license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/var IV=Fe("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"}]]);/**
|
|
252
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the MIT license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/var LV=Fe("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"}]]);/**
|
|
257
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the MIT license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/var zV=Fe("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"}]]);/**
|
|
262
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the MIT license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/var YA=Fe("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"}]]);/**
|
|
267
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the MIT license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/var Dd=Fe("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"}]]);/**
|
|
272
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the MIT license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/var Ad=Fe("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
277
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the MIT license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/var _E=Fe("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"}]]);/**
|
|
282
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the MIT license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/var $V=Fe("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"}]]);/**
|
|
287
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the MIT license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/var UV=Fe("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"}]]);/**
|
|
292
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the MIT license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/var BV=Fe("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"}]]);/**
|
|
297
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the MIT license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/var VV=Fe("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"}]]);/**
|
|
302
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the MIT license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/var kE=Fe("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"}]]);/**
|
|
307
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the MIT license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/var FV=Fe("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"}]]);/**
|
|
312
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the MIT license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/var HV=Fe("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"}]]);/**
|
|
317
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the MIT license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/var qV=Fe("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"}]]);/**
|
|
322
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/var KA=Fe("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
327
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the MIT license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/var XA=Fe("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
332
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the MIT license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/var GV=Fe("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"}]]);/**
|
|
337
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the MIT license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/var QV=Fe("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"}]]);/**
|
|
342
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the MIT license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/var WV=Fe("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"}]]);/**
|
|
347
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/var YV=Fe("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"}]]);/**
|
|
352
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/var KV=Fe("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"}]]);/**
|
|
357
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the MIT license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/var XV=Fe("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
362
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the MIT license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/var ZV=Fe("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
367
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the MIT license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/var JV=Fe("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"}]]);/**
|
|
372
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the MIT license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/var eF=Fe("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"}]]);/**
|
|
377
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the MIT license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/var tF=Fe("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"}]]);/**
|
|
382
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the MIT license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/var nF=Fe("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"}]]);/**
|
|
387
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the MIT license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/var rF=Fe("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"}]]);/**
|
|
392
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the MIT license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/var aF=Fe("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"}]]);/**
|
|
397
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the MIT license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/var Ly=Fe("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"}]]);/**
|
|
402
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the MIT license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/var fb=Fe("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"}]]);/**
|
|
407
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the MIT license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/var hb=Fe("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"}]]);/**
|
|
412
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the MIT license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/var iF=Fe("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"}]]);/**
|
|
417
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the MIT license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/var oF=Fe("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"}]]);/**
|
|
422
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
423
|
+
*
|
|
424
|
+
* This source code is licensed under the MIT license.
|
|
425
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
+
*/var sF=Fe("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"}]]);/**
|
|
427
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the MIT license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/var lF=Fe("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"}]]);/**
|
|
432
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the MIT license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/var cF=Fe("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"}]]);/**
|
|
437
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
438
|
+
*
|
|
439
|
+
* This source code is licensed under the MIT license.
|
|
440
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
+
*/var pb=Fe("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"}]]);/**
|
|
442
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the MIT license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/var PE=Fe("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"}]]);/**
|
|
447
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
448
|
+
*
|
|
449
|
+
* This source code is licensed under the MIT license.
|
|
450
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
+
*/var uF=Fe("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"}]]);/**
|
|
452
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
453
|
+
*
|
|
454
|
+
* This source code is licensed under the MIT license.
|
|
455
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
+
*/var Bs=Fe("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
457
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
458
|
+
*
|
|
459
|
+
* This source code is licensed under the MIT license.
|
|
460
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
+
*/var dF=Fe("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 ZA extends y.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(Ki,{icon:s.jsx(el,{size:16}),title:"Something went wrong",color:"red",children:Ke(this.state.error)}):this.props.children}}function pa(){return s.jsx(er,{style:{width:"100%",height:"100vh"},children:s.jsx(_r,{})})}const fF="_main_6f7o5_1",hF={main:fF};function hn(e){e.preventDefault(),e.stopPropagation()}function JA(e){return e.button===1||e.ctrlKey||e.metaKey}function e_(e){if(NE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&NE(t[0]))return!0}return!1}function NE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Qu(e,t){return new Promise((n,r)=>{var o;const a=new MessageChannel;a.port1.onmessage=({data:c})=>{a.port1.close(),c.error?r(c.error):n(c.result)},(o=e.contentWindow)==null||o.postMessage(t,new URL(e.src).origin,[a.port2])})}function t_(e,t){const n=new Blob([e],{type:dn.JSON}),r=URL.createObjectURL(n),a=document.createElement("a");a.href=r;const o=t??new Date().toISOString().replace(/\D/g,"");a.download=`${o}.json`,document.body.appendChild(a),a.click(),URL.revokeObjectURL(r)}function bt(e){const t=Xp(),{to:n,suffix:r,label:a,onClick:o,children:c,...u}=e;let f=pF(n);return r&&(f+="/"+r),s.jsx(Pt,{href:f,"aria-label":a,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),o?(p.preventDefault(),o(p)):n&&(JA(p)||(p.preventDefault(),t(f)))},...u,children:c})}function pF(e){if(e){if(typeof e=="string")return mF(e);if(pi(e))return gF(e);if(Wo(e))return vF(e)}return"#"}function mF(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function gF(e){return`/${e.resourceType}/${e.id}`}function vF(e){return`/${e.reference}`}function yF(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 Yo(e){const t=Yt(e.value),n=t?Fi(t):e.alt??"",r=yF(n),a=(t&&E$(t))??e.src,o=HA(a??void 0),c=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?s.jsx(bt,{to:t,children:s.jsx(Ms,{src:o,alt:n,radius:c,...u,children:r})}):s.jsx(Ms,{src:o,alt:n,radius:c,...u,children:r})}const xF="_logoButton_189g3_1",bF="_user_189g3_11",SF="_userName_189g3_21",wF="_userActive_189g3_31",oh={logoButton:xF,user:bF,userName:SF,userActive:wF};function mb(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Nc(t,e.options)}):null}function jF(e){var f,p,m;const t=Kp(),{medplum:n,profile:r,navigate:a}=t,o=n.getLogins(),{colorScheme:c,setColorScheme:u}=dO();return s.jsxs(s.Fragment,{children:[s.jsxs(We,{align:"center",p:"xl",children:[s.jsx(Yo,{size:"xl",radius:100,value:t.profile}),s.jsx(mb,{value:(p=(f=t.profile)==null?void 0:f.name)==null?void 0:p[0]}),s.jsx(De,{c:"dimmed",size:"xs",children:(m=n.getActiveLogin())==null?void 0:m.project.display})]}),o.length>1&&s.jsx(je.Divider,{}),o.map(g=>g.profile.reference!==Lt(t.profile)&&s.jsx(je.Item,{onClick:()=>{n.setActiveLogin(g).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(Ce,{children:[s.jsx(Ms,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(De,{size:"sm",fw:500,children:g.profile.display}),s.jsx(De,{c:"dimmed",size:"xs",children:g.project.display})]})]})},g.profile.reference)),s.jsx(je.Divider,{}),s.jsx(Ce,{justify:"center",children:s.jsx(Bp,{size:"xs",value:c,onChange:g=>u(g),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(sF,{size:14,stroke:1.5}),onClick:()=>a("/signin"),children:"Add another account"}),s.jsx(je.Item,{leftSection:s.jsx(Ly,{size:14,stroke:1.5}),onClick:()=>a(`/${Lt(r)}`),children:"Account settings"}),s.jsx(je.Item,{leftSection:s.jsx(qV,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),a("/signin")},children:"Sign out"}),s.jsx(De,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const OE={selectedItems:"selected-items",options:"options"};function gb(e){const t=gd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:a,error:o,defaultValue:c,toOption:u,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:v,onCreate:b,creatable:S,clearable:j,required:C,placeholder:R,leftSection:D,maxValues:E,optionsDropdownMaxHeight:T=320,minInputLength:A=0,..._}=e,M=_.disabled,L=CF(c),[$,V]=y.useState(""),[X,Q]=y.useState(),[J,W]=y.useState(),[Y,P]=y.useState(),[I,z]=y.useState(L.map(u)),[F,O]=y.useState([]),U=p??EF,Z=m??TF,ee=g??RF,ye=y.useRef($);ye.current=$;const be=y.useRef(void 0),ve=y.useRef(void 0),Ge=y.useRef(X);Ge.current=X;const ke=y.useRef(J);ke.current=J;const et=y.useRef(Y);et.current=Y;const Re=y.useRef(F);Re.current=F;const ft=y.useCallback(()=>{var ge;if(Q(void 0),ye.current===ve.current&&f===be.current||(((ge=ye.current)==null?void 0:ge.length)??0)<A)return;ve.current=ye.current,be.current=f;const Te=new AbortController;W(Te),f(ye.current??"",Te.signal).then(we=>{Te.signal.aborted||(O(we.map(u)),et.current?(we.length>0&&v(we.slice(0,1)),P(!1)):we.length>0&&t.openDropdown())}).catch(we=>{Te.signal.aborted||we.message.includes("aborted")||_e({color:"red",message:Ke(we)})}).finally(()=>{Te.signal.aborted||W(void 0)})},[t,f,v,u,A]),Ut=y.useCallback(Te=>{(F&&F.length>0||S)&&t.openDropdown(),t.updateSelectedOptionIndex(),V(Te.currentTarget.value),ke.current&&(ke.current.abort(),W(void 0)),Ge.current!==void 0&&window.clearTimeout(Ge.current);const ge=window.setTimeout(()=>ft(),100);Q(ge)},[t,F,S,ft]),Ot=y.useCallback(Te=>{const ge=I.some(xe=>xe.value===Te),we=ge?I.filter(xe=>xe.value!==Te):[...I];let Le=F==null?void 0:F.find(xe=>xe.value===Te);if(!Le&&S!==!1&&b){const xe=b(Te);Le=u(xe)}if(Le){if(E===0){v([Le.resource]),I.length>0&&z([]);return}ge||we.push(Le)}if(E!==void 0)for(;we.length>E;)we.shift();v(we.map(xe=>xe.resource)),z(we)},[S,F,I,E,v,b,u]),xt=y.useMemo(()=>{if(!M)return Te=>{M||(E===1&&(V(""),O([]),t.closeDropdown()),ve.current=void 0,Te==="$create"?(V(""),Ot($)):Ot(Te))}},[Ot,t,M,E,$]),Ht=y.useCallback(Te=>{const ge=I.filter(we=>we.value!==Te.value);v(ge.map(we=>we.resource)),z(ge)},[I,v]),Bt=y.useCallback(Te=>{Te.key==="Enter"?(X||J)&&P(!0):Te.key==="Backspace"&&$.length===0&&(hn(Te),Ht(I[I.length-1]))},[J,Ht,$.length,I,X]);y.useEffect(()=>()=>{ke.current&&ke.current.abort()},[]);const Se=!M&&j&&I.length>0&&s.jsx(ct.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{V(""),z([]),v([]),t.closeDropdown()}}),Ne=S&&$.trim().length>0,Ve=F.length>0||Ne;return s.jsxs(ct,{store:t,onOptionSubmit:xt,withinPortal:!0,shadow:"xl",..._,children:[s.jsx(ct.DropdownTarget,{children:s.jsx(pc,{label:r,description:a,error:o,className:e.className,leftSection:D,rightSection:J?s.jsx(_r,{size:16}):Se,required:C,disabled:M,children:s.jsxs(Is.Group,{"data-testid":OE.selectedItems,children:[I.map(Te=>s.jsx(Z,{item:Te,disabled:M,onRemove:()=>Ht(Te)},Te.value)),!M&&(E===void 0||E===0||I.length<E)&&s.jsx(ct.EventsTarget,{children:s.jsx(pc.Field,{role:"searchbox",name:n,value:$,placeholder:R,onFocus:Ut,onBlur:()=>{t.closeDropdown(),V("")},onKeyDown:Bt,onChange:Ut})})]})})}),s.jsx(ct.Dropdown,{hidden:!Ve,"data-testid":OE.options,children:s.jsx(ct.Options,{children:s.jsxs(mp,{type:"scroll",mah:T,children:[F.map(Te=>{const ge=I.some(we=>we.value===Te.value);return s.jsx(ct.Option,{value:Te.value,active:ge,children:s.jsx(U,{...Te,active:ge})},Te.value)}),Ne&&s.jsxs(ct.Option,{value:"$create",children:["+ Create ",$]}),!S&&$.trim().length>0&&F.length===0&&s.jsx(ee,{search:$})]})})})]})}function CF(e){return e?Array.isArray(e)?e:[e]:[]}function EF(e){return s.jsxs(Ce,{gap:"xs",children:[e.active&&s.jsx(to,{size:12}),s.jsx("span",{children:e.label})]})}function TF({item:e,disabled:t,onRemove:n}){return s.jsx(Is,{withRemoveButton:!t,onRemove:n,children:e.label})}function RF(){return s.jsx(ct.Empty,{children:"Nothing found"})}const DF="_searchInput_dick8_1",AF={searchInput:DF};function _F(e){return{value:e.id,label:Fi(e),resource:e}}function kF(e){const t=Xp(),n=Ae(),r=y.useCallback(async(o,c)=>{const u=NF(o),f={signal:c},p=await n.graphql(u,void 0,void 0,f);return OF(p,o)},[n]),a=y.useCallback(o=>{o.length>0&&t(`/${Lt(o[0])}`)},[t]);return s.jsx(gb,{size:"sm",radius:"md",className:AF.searchInput,leftSection:s.jsx(aF,{size:16}),placeholder:"Search",itemComponent:PF,toOption:_F,onChange:a,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const PF=y.forwardRef(({resource:e,active:t,...n},r)=>{var o;let a;return e.resourceType==="Patient"?a=e.birthDate:e.resourceType==="ServiceRequest"&&(a=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...n,children:s.jsxs(Ce,{wrap:"nowrap",children:[s.jsx(Yo,{value:e}),s.jsxs("div",{children:[s.jsx(De,{children:Fi(e)}),s.jsx(De,{size:"xs",c:"dimmed",children:a})]})]})})});function NF(e){const t=JSON.stringify(e);return mA(e)?`{
|
|
462
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
463
|
+
resourceType
|
|
464
|
+
id
|
|
465
|
+
identifier {
|
|
466
|
+
system
|
|
467
|
+
value
|
|
468
|
+
}
|
|
469
|
+
name {
|
|
470
|
+
given
|
|
471
|
+
family
|
|
472
|
+
}
|
|
473
|
+
birthDate
|
|
474
|
+
}
|
|
475
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
476
|
+
resourceType
|
|
477
|
+
id
|
|
478
|
+
identifier {
|
|
479
|
+
system
|
|
480
|
+
value
|
|
481
|
+
}
|
|
482
|
+
subject {
|
|
483
|
+
display
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
}`.replace(/\s+/g," "):`{
|
|
487
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
488
|
+
resourceType
|
|
489
|
+
id
|
|
490
|
+
identifier {
|
|
491
|
+
system
|
|
492
|
+
value
|
|
493
|
+
}
|
|
494
|
+
name {
|
|
495
|
+
given
|
|
496
|
+
family
|
|
497
|
+
}
|
|
498
|
+
birthDate
|
|
499
|
+
}
|
|
500
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
501
|
+
resourceType
|
|
502
|
+
id
|
|
503
|
+
identifier {
|
|
504
|
+
system
|
|
505
|
+
value
|
|
506
|
+
}
|
|
507
|
+
name {
|
|
508
|
+
given
|
|
509
|
+
family
|
|
510
|
+
}
|
|
511
|
+
birthDate
|
|
512
|
+
}
|
|
513
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
514
|
+
resourceType
|
|
515
|
+
id
|
|
516
|
+
identifier {
|
|
517
|
+
system
|
|
518
|
+
value
|
|
519
|
+
}
|
|
520
|
+
subject {
|
|
521
|
+
display
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}`.replace(/\s+/g," ")}function OF(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),IF(MF(n),t).slice(0,5)}function MF(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 IF(e,t){return e.sort((n,r)=>ME(r,t)-ME(n,t))}function ME(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,IE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,IE(Nc(r),t));return n}function IE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function LF(e){var a;const t=Zp(),[n,r]=y.useState(!1);return s.jsx(Ar.Header,{p:8,style:{zIndex:101},children:s.jsxs(Ce,{justify:"space-between",children:[s.jsxs(Ce,{gap:"xs",children:[s.jsx(tr,{className:oh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(kF,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(Ce,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(je,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(je.Target,{children:s.jsx(tr,{className:$t(oh.user,{[oh.userActive]:n}),onClick:()=>r(o=>!o),children:s.jsxs(Ce,{gap:7,children:[s.jsx(Yo,{value:t,radius:"xl",size:24}),s.jsx(De,{size:"sm",className:oh.userName,children:Nc((a=t==null?void 0:t.name)==null?void 0:a[0])}),s.jsx(ub,{size:12,stroke:1.5})]})})}),s.jsx(je.Dropdown,{children:s.jsx(jF,{version:e.version})})]})]})]})})}const vb=y.createContext({submitting:!1});vb.displayName="FormContext";function zF(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?$F(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&UF(t,n);return t}function $F(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function UF(e,t){e[t.name]=t.value}function mt(e){const[t,n]=y.useState(!1);return s.jsx(vb.Provider,{value:{submitting:t},children:s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const a=zF(r.target);if(e.onSubmit){n(!0);const o=e.onSubmit(a);o!=null&&o.then?o.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function Or(e){const{children:t,...n}=e,{submitting:r}=y.useContext(vb);return s.jsx(Pe,{type:"submit",loading:r,...n,children:t})}function BF(e){const t=Ae(),n=t.getUserConfiguration();function r(a){var m,g;const{menuname:o,bookmarkname:c}=a,u=`${e.pathname}?${e.searchParams.toString()}`,f=Qr(n),p=(m=f.menu)==null?void 0:m.find(({title:v})=>v===o);(g=p==null?void 0:p.link)==null||g.push({name:c,target:u}),t.updateResource(f).then(v=>{n.menu=v.menu,t.dispatchEvent({type:"change"}),_e({color:"green",message:"Success"}),e.onOk()}).catch(v=>{_e({color:"red",message:Ke(v)})})}return s.jsx(Bn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(We,{children:[s.jsx(VF,{config:n}),s.jsx(ze,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Or,{mt:"sm",children:"OK"})})]})})})}function VF(e){function t(r){var a;return(a=r==null?void 0:r.menu)==null?void 0:a.map(o=>o.title)}const n=t(e.config);return s.jsx(ln,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function n_(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function FF(e){return typeof e.display=="string"?e.display:n_(e)}function HF(e){return{value:n_(e),label:FF(e),resource:e}}function qF(e){return{code:e,display:e}}function Jp(e){const t=Ae(),{binding:n,creatable:r,clearable:a,expandParams:o,withHelpText:c,...u}=e,f=y.useCallback(async(p,m)=>{var S;if(!n)return[];const v=((S=(await t.valueSetExpand({...o,url:n,filter:p,count:10},{signal:m})).expansion)==null?void 0:S.contains)??[],b=[];for(const j of v)j.code&&!b.some(C=>C.code===j.code)&&b.push(j);return b},[t,o,n]);return s.jsx(gb,{...u,creatable:r??!0,clearable:a??!0,toOption:HF,loadOptions:f,onCreate:qF,itemComponent:c?GF:void 0})}const GF=y.forwardRef(({label:e,resource:t,active:n,...r},a)=>s.jsx("div",{ref:a,...r,children:s.jsxs(Ce,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(to,{size:12}),s.jsxs("div",{children:[s.jsx(De,{children:e}),s.jsx(De,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function r_(e){const{defaultValue:t,onChange:n,withHelpText:r,...a}=e,[o,c]=y.useState(t);function u(f){const p=f[0],m=WF(p);c(m),n&&n(m)}return s.jsx(Jp,{defaultValue:QF(o),onChange:u,withHelpText:r??!0,...a})}function QF(e){return e?{code:e}:void 0}function WF(e){return e==null?void 0:e.code}function yb(e){const[t,n]=y.useState(e.defaultValue),r=e.onChange,a=y.useCallback(o=>{n(o),r&&r(o)},[r]);return s.jsx(r_,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:a,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 YF="_menuTitle_9g6l5_1",KF="_link_9g6l5_9",XF="_linkActive_9g6l5_38",zy={menuTitle:YF,link:KF,linkActive:XF};function ZF(e){var u;const t=Xp(),n=tH(e.pathname,e.searchParams,e.menus),[r,a]=y.useState(!1);function o(f,p){f.stopPropagation(),f.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function c(f){f&&t(`/${f}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Ar.Navbar,{children:s.jsxs(Yr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Ar.Section,{mb:"sm",children:s.jsx(yb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:f=>c(f)},window.location.pathname)}),s.jsxs(Ar.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(f=>{var p;return s.jsxs(y.Fragment,{children:[s.jsx(De,{className:zy.menuTitle,children:f.title}),(p=f.links)==null?void 0:p.map(m=>s.jsxs(JF,{to:m.href,active:m.href===(n==null?void 0:n.href),onClick:g=>o(g,m.href),children:[s.jsx(eH,{icon:m.icon}),s.jsx("span",{children:m.label})]},m.href))]},`menu-${f.title}`)}),e.displayAddBookmark&&s.jsx(Pe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(ZV,{size:"0.75rem"}),onClick:()=>a(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(BF,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>a(!1),onCancel:()=>a(!1)})]})}function JF(e){return s.jsx(bt,{onClick:e.onClick,to:e.to,className:$t(zy.link,{[zy.linkActive]:e.active}),children:e.children})}function eH(e){return e.icon?e.icon:s.jsx(Vp,{w:30})}function tH(e,t,n){if(!e||!t||!n)return;let r,a=0;for(const o of n)if(o.links)for(const c of o.links){const u=nH(e,t,c.href);u>a&&(a=u,r=c)}return r}function nH(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const a=["_count","_offset"];for(const[c,u]of r.searchParams.entries())if(!a.includes(c)&&t.get(c)!==u)return 0;let o=1;for(const[c,u]of t.entries())a.includes(c)||r.searchParams.get(c)===u&&o++;return o}function rH(e){const[t,n]=y.useState(localStorage.navbarOpen==="true"),r=Ae(),a=Zp();y.useEffect(()=>{function f(){_e({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function o(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){o(!1)}function u(){o(!t)}return r.isLoading()?s.jsx(pa,{}):s.jsxs(Ar,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!a||!t,mobile:!a||!t}},padding:0,children:[a&&s.jsx(LF,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),a&&t?s.jsx(ZF,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Ar.Main,{className:hF.main,children:s.jsx(ZA,{children:s.jsx(y.Suspense,{fallback:s.jsx(pa,{}),children:e.children})})})]})}const aH="https://ccda.medplum.com",iH="https://ccda-validator.medplum.com/";function oH(e){const{url:t}=e,[n,r]=y.useState(!1),a=y.useRef(null),[o,c]=y.useState(),[u,f]=y.useState(!1);y.useEffect(()=>{t&&n&&a.current&&(Qu(a.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),S=new FormData;S.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${iH}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:S,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const R=await C.json();c(R)}catch(v){c(void 0),console.error("CCDA validation error:",v)}finally{f(!1)}},m=()=>{if(!o)return;const v=JSON.stringify(o,null,2);t_(v,"ccda-validation-results")},g=()=>o?o.resultsMetaData.resultMetaData.filter(v=>v==null?void 0:v.type.includes("Error")).reduce((v,b)=>v+(b.count||0),0):0;return t?s.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[s.jsx("div",{style:{minHeight:400},children:s.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:a,src:aH,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),s.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[s.jsx(Pe,{type:"button",onClick:p,disabled:u,children:u?"Validating...":"Validate"}),o&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{marginLeft:"15px"},children:[s.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),s.jsx(Pe,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function _d(e){const{contentType:t,url:n,title:r}=e.value??{},a=HA(n);return a?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:a,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:a})}),((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",{title:"Attachment",width:"100%",height:"400",src:a+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===dn.CDA_XML&&s.jsx(oH,{url:a}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Pt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:sH(r),children:r||"Download"})})]}):null}function sH(e){return e!=null&&e.includes(".")?e:void 0}const lH="_root_17n8t_1",cH="_compact_17n8t_25",LE={root:lH,compact:cH};function xb(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:$t(LE.root,{[LE.compact]:n}),children:t})}function zi(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function uH(e){var r;const t=(r=e.values)==null?void 0:r.map((a,o)=>s.jsx("div",{children:s.jsx(_d,{value:a,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!En(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const a=e.path.split(".").pop();n=s.jsx(zi,{term:$s(a),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function bb(e){const t=Ae(),n=y.useRef(null);function r(c){var u;hn(c),(u=n.current)==null||u.click()}function a(c){hn(c);const u=c.target.files;u&&Array.from(u).forEach(o)}function o(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Jt(f))}))}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:c=>a(c)}),e.children({onClick:r,disabled:e.disabled})]})}function dH(e){const[t,n]=y.useState(e.defaultValue??[]),r=y.useRef(t);r.current=t;function a(o){n(o),e.onChange&&e.onChange(o)}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((o,c)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(_d,{value:o,maxWidth:200})}),s.jsx("td",{children:s.jsx(_n,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{hn(u);const f=t.slice();f.splice(c,1),a(f)},children:s.jsx(Fh,{})})})]},`${c}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(bb,{disabled:e.disabled,onUpload:o=>{a([...r.current,o])},children:o=>s.jsx(_n,{...o,title:"Add",variant:"subtle",size:"sm",color:o.disabled?"gray":"green",children:s.jsx(db,{})})})})]})]})]})}function a_(e){const[t,n]=y.useState(e.defaultValue);function r(a){n(a),e.onChange&&e.onChange(a)}return t?s.jsxs(s.Fragment,{children:[s.jsx(_d,{value:t,maxWidth:200}),s.jsx(Pe,{disabled:e.disabled,onClick:a=>{hn(a),r(void 0)},children:"Remove"})]}):s.jsx(bb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:a=>s.jsx(Pe,{...a,children:"Upload..."})})}const fH="_root_1vii2_1",hH={root:fH};function kd(e){const{children:t,...n}=e;return s.jsx(l0,{className:hH.root,...n,children:t})}const pH="_paper_1igaj_1",mH="_fill_1igaj_20",zE={paper:pH,fill:mH};function Sb(e){const{width:t,fill:n,className:r,children:a,...o}=e,c=t?{maxWidth:t}:void 0;return s.jsx(mr,{className:$t(zE.paper,n&&zE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...o,children:a})}function ot(e){const{children:t,...n}=e;return s.jsx(kd,{children:s.jsx(Sb,{...n,children:t})})}function Ua(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 Nt(e,t){var n,r,a;return(a=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(o=>{var c;return i_((c=o.expression)==null?void 0:c[0],t)}))==null?void 0:r.map(o=>{var c;return(c=o.details)==null?void 0:c.text}))==null?void 0:a.join(`
|
|
525
|
+
`)}function Pd(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var a;return i_((a=r.expression)==null?void 0:a[0],t)})}const sh=/\[\d+\]/;function i_(e,t){const n=typeof e=="string"&&sh.test(e),r=typeof t=="string"&&sh.test(t);if(n!==r&&(e=e==null?void 0:e.replace(sh,""),t=t==null?void 0:t.replace(sh,"")),e===t)return!0;if(!e||!t)return!1;const a=e.indexOf(".");if(a>=0&&e.substring(a+1)===t)return!0;const o=t.indexOf(".");return o>=0&&t.substring(o+1)===e}function o_(e){const t=Ae(),[n,r]=y.useState();return s.jsxs(mt,{onSubmit:async a=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:a.projectName}))}catch(o){r(Jt(o))}},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Create project"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ze,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Nt(n,"projectName")}),s.jsxs(De,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Or,{children:"Create project"})})]})}function s_(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 l_(e){const t=Ae(),{googleClientId:n,handleGoogleCredential:r}=e,a=y.useRef(null),[o,c]=y.useState(typeof google<"u"),[u,f]=y.useState(!1),[p,m]=y.useState(!1);return y.useEffect(()=>{if(typeof google>"u"){s_("https://accounts.google.com/gsi/client",()=>c(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),a.current&&!p&&(google.accounts.id.renderButton(a.current,{}),m(!0))},[t,n,u,o,a,p,r]),n?s.jsx("div",{ref:a}):null}function c_(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function xa(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Ki,{icon:s.jsx(el,{size:16}),color:"red",children:t.map(r=>{var a;return s.jsx("div",{"data-testid":"text-field-error",children:nA(r)},(a=r.details)==null?void 0:a.text)})})}function u_(e){typeof grecaptcha>"u"&&s_("https://www.google.com/recaptcha/api.js?render="+e)}function d_(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function gH(e){const t=c_(e.googleClientId),n=e.recaptchaSiteKey,r=Ae(),[a,o]=y.useState(),c=Pd(a,void 0);return y.useEffect(()=>{n&&u_(n)},[n]),s.jsxs(mt,{onSubmit:async u=>{o(void 0);try{let f="";n&&(f=await d_(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){o(Jt(f))}},children:[s.jsx(er,{style:{flexDirection:"column"},children:e.children}),s.jsx(xa,{issues:c}),t&&s.jsxs(s.Fragment,{children:[s.jsx(Ce,{justify:"center",p:"xl",style:{height:70},children:s.jsx(l_,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(f){o(Jt(f))}}})}),s.jsx(jn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(ze,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Nt(a,"firstName")}),s.jsx(ze,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Nt(a,"lastName")}),s.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Nt(a,"email")}),s.jsx(Na,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Nt(a,"password")}),s.jsxs(De,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Pt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(De,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Pt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Pt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(Ce,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Hn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(Or,{children:"Create account"})]})]})}function vH(e){const{type:t,projectId:n,clientId:r,googleClientId:a,recaptchaSiteKey:o,onSuccess:c}=e,u=Ae(),[f,p]=y.useState(),[m,g]=y.useState();y.useEffect(()=>{t==="patient"&&f&&u.startNewPatient({login:f,projectId:n}).then(b=>u.processCode(b.code)).then(()=>c()).catch(b=>g(Jt(b)))},[u,t,n,f,c]);function v(b){b.code?u.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return s.jsxs(ot,{width:450,children:[m&&s.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&s.jsx(gH,{projectId:n,clientId:r,googleClientId:a,recaptchaSiteKey:o,handleAuthResponse:v,children:e.children}),f&&t==="project"&&s.jsx(o_,{login:f,handleAuthResponse:v})]})}function yH(e){const[t,n]=y.useState();return t?s.jsx(bH,{email:t,...e}):s.jsx(xH,{setEmail:n,...e})}function xH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:a,disableEmailAuth:o,...c}=e,u=Ae(),f=!e.disableGoogleAuth&&c_(e.googleClientId),[p,m]=y.useState(),g=Pd(p,void 0),v=y.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await u.ensureCodeChallenge(c),domain:j.domain}),R=new URL(j.authorizeUrl);return R.searchParams.set("state",C),window.location.assign(R.toString()),!0},[u,c]),b=y.useCallback(async j=>{const C=await u.post("auth/method",{email:j.email});await v(C)||t(j.email)},[u,v,t]),S=y.useCallback(async j=>{try{const C=await u.startGoogleLogin({...c,googleCredential:j.credential});await v(C)||r(C)}catch(C){m(Jt(C))}},[u,c,v,r]);return s.jsxs(mt,{onSubmit:b,children:[s.jsx(er,{style:{flexDirection:"column"},children:a}),s.jsx(xa,{issues:g}),f&&s.jsxs(s.Fragment,{children:[s.jsx(Ce,{justify:"center",p:"xl",style:{height:70},children:s.jsx(l_,{googleClientId:f,handleGoogleCredential:S})}),!o&&s.jsx(jn,{label:"or",labelPosition:"center",my:"lg"})]}),!o&&s.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Nt(p,"email")}),s.jsxs(Ce,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!o&&s.jsx(Or,{children:"Next"})]})]})}function bH(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...a}=e,o=Ae(),[c,u]=y.useState(),f=Pd(c,void 0),p=y.useCallback(m=>{o.startLogin({...a,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>u(Jt(g)))},[o,a,n]);return s.jsxs(mt,{onSubmit:p,children:[s.jsx(er,{style:{flexDirection:"column"},children:r}),s.jsx(xa,{issues:f}),s.jsx(We,{gap:"xl",children:s.jsx(Na,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Nt(c,"password")})}),s.jsxs(Ce,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Pt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Hn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(Or,{children:"Sign in"})]})]})}function SH(e){const t=Ae(),n=gd(),[r,a]=y.useState(""),[o,c]=y.useState();function u(g){var v;return!!((v=g==null?void 0:g.toLowerCase())!=null&&v.includes(r.toLowerCase()))}function f(g){var v,b;return u((v=g.profile)==null?void 0:v.display)||u((b=g.project)==null?void 0:b.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(v=>c(Jt(v)))}const m=e.memberships.filter(f).slice(0,10).map(g=>s.jsx(ct.Option,{value:g.id,children:s.jsx(wH,{...g})},g.id));return s.jsxs(We,{children:[s.jsxs(Uo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{order:3,children:"Choose profile"})]}),s.jsx(xa,{outcome:o}),s.jsxs(ct,{store:n,onOptionSubmit:p,children:[s.jsx(ct.EventsTarget,{children:s.jsx(ze,{placeholder:"Search",value:r,onChange:g=>{a(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(ct.Options,{children:m.length>0?m:s.jsx(ct.Empty,{children:"Nothing found..."})})})]})]})}function wH(e){var t,n;return s.jsxs(Ce,{children:[s.jsx(Ms,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(De,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(De,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const jH=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,CH="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",EH="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",TH="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",RH=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,DH="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",AH="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",_H="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",kH="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",PH="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",NH="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function OH(e){const t=Ae();return s.jsx(mt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(We,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Choose scope"})]}),s.jsx(We,{children:(e.scope??"openid").split(" ").map(n=>{let r;return jH.test(n)?r=[n+CH,n+EH,n+TH]:RH.test(n)&&(r=[n+DH,n+AH,n+_H,n+kH,n+PH,n+NH]),s.jsxs(s.Fragment,{children:[s.jsx(Hn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(a=>s.jsx(Hn,{id:a,name:a,label:a},a))]},n+"_group")})}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"Set scope"})})]})})}function f_(e){const[t,n]=y.useState();return s.jsx(mt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(a=>n(Ke(a)))},children:s.jsxs(We,{children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Enter MFA code"})]}),t&&s.jsx(Ki,{icon:s.jsx(el,{size:16}),title:"Error",color:"red",children:t}),s.jsx(We,{children:s.jsx(ze,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"Submit code"})})]})})}function h_(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:a,onRegister:o,onCode:c,...u}=e,f=Ae(),[p,m]=y.useState(),g=y.useRef(!1),[v,b]=y.useState(!1),[S,j]=y.useState(),C=y.useCallback(E=>{c?c(E):f.processCode(E).then(()=>{r&&r()}).catch(T=>_e({color:"red",message:Ke(T)}))},[f,c,r]),R=y.useCallback(E=>{b(!!E.mfaRequired),E.login&&m(E.login),E.memberships&&j(E.memberships),E.code&&(n?j(void 0):C(E.code))},[n,C]),D=y.useCallback(E=>{C(E.code)},[C]);return y.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(R).catch(E=>_e({color:"red",message:Ke(E)})))},[f,t,g,p,R]),s.jsx(ot,{width:450,px:"sm",py:"md",children:p?v?s.jsx(f_,{onSubmit:async E=>{const T=await f.post("auth/mfa/verify",{login:p,token:E.token});R(T)}}):S?s.jsx(SH,{login:p,memberships:S,handleAuthResponse:R}):e.projectId==="new"?s.jsx(o_,{login:p,handleAuthResponse:R}):e.chooseScopes?s.jsx(OH,{login:p,scope:e.scope,handleAuthResponse:D}):s.jsx("div",{children:"Success"}):s.jsx(yH,{onForgotPassword:a,onRegister:o,handleAuthResponse:R,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function oi(e){return s.jsx(s.Fragment,{children:Bo(e.value)})}function MH(e){return s.jsx(s.Fragment,{children:Rd(e.value)})}function p_(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 IH(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(p_,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function em(e,t,n){const r=gc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(a=>a.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function LH(e,t,n){const r=lA(e,t,n);return r?Array.isArray(r)?[r.map(a=>a.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function zH(e){const{elementDefinitionType:t}=e,n=Ae(),r=y.useContext(cn),[a,o]=y.useState(oA("Extension")),c=y.useMemo(()=>{if(En(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,f]=y.useState(c!==void 0);if(y.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=Pc(c);f(!1),g&&o(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(u||!q0(c)))return s.jsx("div",{children:"Loading..."});const p=a.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[g,v]=em({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return s.jsx(La,{propertyType:v,value:g})}return s.jsx(qh,{path:e.path,value:{type:a.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function $H(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 UH(e){return s.jsx(s.Fragment,{children:X$(e.value)})}function od(e){return s.jsx(s.Fragment,{children:_s(e.value)})}function wb(e){return s.jsx(s.Fragment,{children:ad(e.value)})}function BH(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(od,{value:t.numerator})," / ",s.jsx(od,{value:t.denominator})]}):null}function $y(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ia(e.value);return e.link!==!1&&e.value.reference?s.jsx(bt,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function m_(e,t,n,r){if(!En(n==null?void 0:n.slices))return[e];const a=new Array(t.length+1);for(let o=0;o<a.length;o++)a[o]=[];for(const o of e){const c=BA(o,t,n.discriminator,r);let u=c?t.findIndex(f=>f.name===c):-1;u===-1&&(u=t.length),a[u].push(o)}return a}async function g_({medplum:e,property:t}){return new Promise((n,r)=>{var u,f;if(!t.slicing){n([]);return}const a=[],o=[],c=[];for(const p of t.slicing.slices){if(!UA(p)){console.debug("Unsupported slice definition",p);continue}let m;En(p.elements)||(m=(f=(u=p.type[0])==null?void 0:u.profile)==null?void 0:f[0]),a.push(p),o.push(m),m&&c.push(e.requestProfileSchema(m))}Promise.all(c).then(()=>{for(let p=0;p<a.length;p++){const m=a[p],g=o[p];if(g){const v=Pc(g);m.typeSchema=v}}n(a)}).catch(r)})}function tm(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function VH(e){var c,u;const{slice:t,property:n}=e,r=((c=t.typeSchema)==null?void 0:c.elements)??t.elements,a=y.useContext(cn),o=y.useMemo(()=>{var f;if(En(r))return yc({parentContext:a,elements:r,path:e.path,profileUrl:(f=t.typeSchema)==null?void 0:f.url})},[a,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return tm(cn.Provider,o,s.jsx(s.Fragment,{children:e.value.map((f,p)=>s.jsx("div",{children:s.jsx(La,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:f,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}function FH(e){var S;const{property:t,propertyType:n}=e,r=Ae(),a=y.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[o,c]=y.useState(!0),[u,f]=y.useState([]),[p,m]=y.useState(()=>[a]),g=y.useContext(cn);if(y.useEffect(()=>{g_({medplum:r,property:t}).then(j=>{f(j);const C=m_(a,j,t.slicing,g.profileUrl);m(C),c(!1)}).catch(j=>{console.error(j),c(!1)})},[r,t,g.profileUrl,m,a]),o)return s.jsx("div",{children:"Loading..."});let v;if(((S=t.type[0])==null?void 0:S.code)!=="Extension"){const j=p[u.length],C=j.map((R,D)=>s.jsx("div",{children:s.jsx(La,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${D}-${j.length}`));if(e.includeDescriptionListEntry){if(!En(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();v=s.jsx(zi,{term:$s(R),children:C})}else v=s.jsx(s.Fragment,{children:C})}return s.jsxs(s.Fragment,{children:[u.map((j,C)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=s.jsx(VH,{path:e.path,slice:j,property:t,value:p[C],ignoreMissingValues:e.ignoreMissingValues,link:e.link},j.name);return e.includeDescriptionListEntry&&(R=s.jsx(zi,{term:$s(j.name),children:R},j.name)),R}),v]})}function La(e){var o;const{property:t,propertyType:n,value:r}=e;if((o=t==null?void 0:t.path)==null?void 0:o.endsWith(".id"))return s.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!Tn(r)&&s.jsx(sD,{value:r,timeout:2e3,children:({copied:c,copy:u})=>s.jsx(Xs,{label:c?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(_n,{variant:"subtle",color:c?"teal":"gray",onClick:u,children:c?s.jsx(to,{size:"1rem"}):s.jsx(WA,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===oe.Attachment?s.jsx(uH,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(FH,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case oe.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case oe.SystemString:case oe.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case oe.code:case oe.date:case oe.decimal:case oe.id:case oe.integer:case oe.positiveInt:case oe.unsignedInt:case oe.uri:case oe.url:return s.jsx(s.Fragment,{children:r});case oe.canonical:return s.jsx($y,{value:{reference:r},link:e.link});case oe.dateTime:case oe.instant:return s.jsx(s.Fragment,{children:gr(r)});case oe.markdown:return s.jsx("pre",{children:r});case oe.Address:return s.jsx(gV,{value:r});case oe.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case oe.Attachment:return s.jsx(_d,{value:r,maxWidth:e.maxWidth});case oe.CodeableConcept:return s.jsx(oi,{value:r});case oe.Coding:return s.jsx(MH,{value:r});case oe.ContactDetail:return s.jsx(IH,{value:r});case oe.ContactPoint:return s.jsx(p_,{value:r});case oe.HumanName:return s.jsx(mb,{value:r});case oe.Identifier:return s.jsx($H,{value:r});case oe.Money:return s.jsx(UH,{value:r});case oe.Period:return s.jsx(s.Fragment,{children:G$(r)});case oe.Quantity:case oe.Duration:return s.jsx(od,{value:r});case oe.Range:return s.jsx(wb,{value:r});case oe.Ratio:return s.jsx(BH,{value:r});case oe.Reference:return s.jsx($y,{value:r,link:e.link});case oe.Timing:return s.jsx(s.Fragment,{children:wA(r)});case oe.Dosage:case oe.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(qh,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case oe.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(zH,{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(qh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const v_=["extension","modifierExtension"],HH=GA.filter(e=>!v_.includes(e));function qh(e){const t=e.value,{value:n,type:r}=t,a=y.useContext(cn),o=e.profileUrl??(a==null?void 0:a.profileUrl),c=y.useMemo(()=>Hp(r,o),[o,r]),u=y.useMemo(()=>{if(c)return yc({parentContext:a,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,a,e.path,e.accessPolicyResource]);if(Tn(n))return null;if(!c)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 f=u??a;return tm(cn.Provider,u,s.jsx(xb,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{var j;if(v_.includes(p)&&Tn((j=m.slicing)==null?void 0:j.slices))return null;if(HH.includes(p))return null;if(QA.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,v]=em(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&Tn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,S=s.jsx(La,{property:m,propertyType:v,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?S:s.jsx(zi,{term:$s(p),children:S},p)})}))}const qH="_dimmed_11me5_1",GH="_preserveBreaks_11me5_5",Uy={dimmed:qH,preserveBreaks:GH},y_="Read Only";function x_(e,t){return e?s.jsx(Xs.Floating,{label:e,children:t}):t}function b_(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,x_(e!=null&&e.readonly?y_:void 0,s.jsxs(Ce,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?Uy.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function zt(e){const{debugMode:t}=y.useContext(cn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,x_(e!=null&&e.readonly?y_:void 0,s.jsx(pn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:$t({[Uy.dimmed]:e==null?void 0:e.readonly},Uy.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Nt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function QH(e,t,n,r,a){const o=r.type;if(o.length>1)for(const c of o){const u=t.replace("[x]",$n(c.code));u in e&&delete e[u]}return Tn(a)?e[n]=void 0:e[n]=a,e}function WH(e){return!!e&&!Tn(e.url)&&!Tn(e.name)}function YH(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:a,path:o,valuePath:c,...u}=e,[f,p]=y.useState(t);function m(g){const v=XH(g);p(v),n&&n(v)}return s.jsx(Jp,{defaultValue:f&&KH(f),onChange:m,withHelpText:r??!0,...u})}function KH(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function XH(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function ZH(e){var p,m;const{defaultValue:t,onChange:n,withHelpText:r,response:a,...o}=e,[c,u]=y.useState(((m=(p=a==null?void 0:a.answer)==null?void 0:p[0])==null?void 0:m.valueCoding)??t);function f(g){const v=g[0],b=v&&eq(v);u(b),n&&n(b)}return s.jsx(Jp,{defaultValue:c?JH(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...o})}function JH(e){return{system:e.system,code:e.code,display:e.display}}function eq(e){return{system:e.system,code:e.code,display:e.display}}function S_(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:a}=y.useContext(cn),[o,c]=y.useState(e.defaultValue),u=y.useRef(o);u.current=o;const[f,p,m]=y.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[g,v,b]=y.useMemo(()=>["system","use","value"].map(E=>a(t+"."+E)),[a,t]);function S(E){E&&Object.keys(E).length===0&&(E=void 0),c(E),e.onChange&&e.onChange(E)}function j(E){const T={...u.current,system:E};E||delete T.system,S(T)}function C(E){const T={...u.current,use:E};E||delete T.use,S(T)}function R(E){const T={...u.current,value:E};E||delete T.value,S(T)}const D=e.valuePath??t;return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.disabled||(g==null?void 0:g.readonly),"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((f==null?void 0:f.min)??0)>0,onChange:E=>j(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Nt(n,D+".system")}),s.jsx(ln,{disabled:e.disabled||(v==null?void 0:v.readonly),"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((p==null?void 0:p.min)??0)>0,onChange:E=>C(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Nt(n,D+".use")}),s.jsx(ze,{disabled:e.disabled||(b==null?void 0:b.readonly),placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((m==null?void 0:m.min)??0)>0,onChange:E=>R(E.currentTarget.value),error:Nt(n,D+".value")})]})}function tq(e){var m;const[t,n]=y.useState(e.defaultValue),r=y.useRef(t);r.current=t;const{getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["name","telecom"].map(g=>a(e.path+"."+g)),[a,e.path]);function u(g){n(g),e.onChange&&e.onChange(g)}function f(g){const v={...r.current,name:g};g||delete v.name,u(v)}function p(g){const v={...r.current,telecom:g&&[g]};g||delete v.telecom,u(v)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ze,{disabled:e.disabled||(o==null?void 0:o.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:g=>f(g.currentTarget.value)}),s.jsx(S_,{disabled:e.disabled||(c==null?void 0:c.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(m=t==null?void 0:t.telecom)==null?void 0:m[0],onChange:p,outcome:e.outcome})]})}function nq(e){if(!e)return"";const t=new Date(e);return Gp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function jb(e){if(!e)return"";const t=new Date(e);return Gp(t)?t.toISOString():""}function si(e){return s.jsx(ze,{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:rq(),step:1,defaultValue:nq(e.defaultValue),autoFocus:e.autoFocus,error:Nt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(jb(n))}}})}function rq(){return"datetime-local"}function aq(e){const{propertyType:t}=e,n=Ae(),r=y.useMemo(()=>{if(En(t.profile))return t.profile[0]},[t]),[a,o]=y.useState(r!==void 0);return y.useEffect(()=>{r&&(o(!0),n.requestProfileSchema(r).then(()=>o(!1)).catch(c=>{o(!1),console.warn(c)}))},[n,r]),r&&(a||!q0(r))?s.jsx("div",{children:"Loading..."}):s.jsx(Rb,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function iq(e){var D,E,T;const{outcome:t,path:n}=e,[r,a]=y.useState(e.defaultValue),{getExtendedProps:o}=y.useContext(cn),[c,u,f,p,m]=y.useMemo(()=>["use","prefix","given","family","suffix"].map(A=>o(e.path+"."+A)),[o,e.path]);function g(A){a(A),e.onChange&&e.onChange(A)}function v(A){g({...r,use:A||void 0})}function b(A){g({...r,prefix:A?A.split(" "):void 0})}function S(A){g({...r,given:A?A.split(" "):void 0})}function j(A){g({...r,family:A||void 0})}function C(A){g({...r,suffix:A?A.split(" "):void 0})}const R=e.valuePath??n;return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(c==null?void 0:c.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:A=>v(A.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Nt(t,R+".use")}),s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(D=r==null?void 0:r.prefix)==null?void 0:D.join(" "),onChange:A=>b(A.currentTarget.value),error:Nt(t,R+".prefix")}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(E=r==null?void 0:r.given)==null?void 0:E.join(" "),onChange:A=>S(A.currentTarget.value),error:Nt(t,R+".given")}),s.jsx(ze,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:A=>j(A.currentTarget.value),error:Nt(t,R+".family")}),s.jsx(ze,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(T=r==null?void 0:r.suffix)==null?void 0:T.join(" "),onChange:A=>C(A.currentTarget.value),error:Nt(t,R+".suffix")})]})}function oq(e){const[t,n]=y.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[u,f]=y.useMemo(()=>["system","value"].map(g=>a(e.path+"."+g)),[a,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ze,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Nt(e.outcome,m+".system")}),s.jsx(ze,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Value",required:((c==null?void 0:c.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:Nt(e.outcome,m+".value")})]})}const sq=["USD","EUR","CAD","GBP","AUD"];function lq(e){var g;const{onChange:t}=e,[n,r]=y.useState(e.defaultValue),{getExtendedProps:a}=y.useContext(cn),[o,c]=y.useMemo(()=>["currency","value"].map(v=>a(e.path+"."+v)),[a,e.path]),u=y.useCallback(v=>{r(v),t&&t(v)},[t]),f=y.useCallback(v=>{u({...n,currency:v.currentTarget.value})},[n,u]),p=y.useCallback(v=>{u({...n,value:v.currentTarget.valueAsNumber})},[n,u]),m=s.jsx(ln,{disabled:e.disabled||(o==null?void 0:o.readonly),defaultValue:n==null?void 0:n.currency,data:sq,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return s.jsx(ze,{disabled:e.disabled||(c==null?void 0:c.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((g=n==null?void 0:n.value)==null?void 0:g.toString())??"USD",leftSection:s.jsx(IV,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function cq(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(si,{disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>c({...t,start:u})}),s.jsx(si,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>c({...t,end:u})})]})}function Vs(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o,c]=y.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ln,{disabled:e.disabled||(a==null?void 0:a.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:f=>u({...t,comparator:f.currentTarget.value})}),s.jsx(ze,{disabled:e.disabled||(o==null?void 0:o.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:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{u({...t,value:uq(f.currentTarget.value)})}}),s.jsx(ze,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:f=>u({...t,unit:f.currentTarget.value})})]})}function uq(e){if(e)return parseFloat(e)}function Cb(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Vs,{path:e.path+".low",disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>c({...t,low:u})}),s.jsx(Vs,{path:e.path+".high",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>c({...t,high:u})})]})}function dq(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(cn),[a,o]=y.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function c(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Vs,{path:e.path+".numerator",disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>c({...t,numerator:u})}),s.jsx(Vs,{path:e.path+".denominator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>c({...t,denominator:u})})]})}const fq={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},hq=["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","ResearchStudy","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function pq(e){return{value:Lt(e)??"",label:Fi(e),resource:e}}function tl(e){const t=Ae(),{resourceType:n,searchCriteria:r}=e,[a,o]=y.useState(),c=Yt(e.defaultValue,o),u=e.itemComponent??mq,f=e.onChange,p=y.useCallback(async(g,v)=>{const b=gq(n),S=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,S,{signal:v})},[t,n,r]),m=y.useCallback(g=>{f&&f(g[0])},[f]);return En(e.defaultValue)&&!a&&!c?null:s.jsx(gb,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:pq,loadOptions:p,onChange:m,clearable:!0})}const mq=y.forwardRef(({label:e,resource:t,active:n,...r},a)=>s.jsx("div",{ref:a,...r,children:s.jsxs(Ce,{wrap:"nowrap",children:[s.jsx(Yo,{value:t}),s.jsxs("div",{children:[s.jsx(De,{children:e}),s.jsx(De,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function gq(e){return fq[e]??(hq.includes(e)?"name":"_id")}function Nd(e){const{onChange:t}=e,n=Ae(),[r,a]=y.useState(e.defaultValue),[o,c]=y.useState(()=>vq(e.targetTypes)),[u,f]=y.useState(()=>yq(e.defaultValue,o)),p=y.useRef(new XD),m=y.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);y.useEffect(()=>{let b=!1;const S=o==null?void 0:o.map(j=>{if(!bq(j))return Promise.resolve(j);b=!0;const C=j.value,R=p.current.get(C);if(R)return R;const D=xq(n,j.value).then(T=>{const A={...j};return T?En(T.type)?(A.resourceType=T.type,A.name=T.name,A.title=T.title):(console.error(`StructureDefinition.type missing for ${j.value}`),A.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),A.error="StructureDefinition not found"),A}).catch(T=>(console.error(T),{...j,error:T})),E=new _a(D);return p.current.set(C,E),E});!S||!b||Promise.all(S).then(j=>{if(c(j),!u)return;const C=j.findIndex(R=>R.value===u.value||R.resourceType===u.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}f(j[C])}).catch(console.error)},[n,u,o]);const g=y.useCallback(b=>{const S=b?fn(b):void 0;a(S),t&&t(S)},[t]),v=y.useMemo(()=>o?o.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[o]);return s.jsxs(s.Fragment,{children:[e.name&&s.jsx("input",{type:"hidden",name:e.name,value:(r==null?void 0:r.reference)??""}),s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[o&&o.length>1&&s.jsx(ln,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u==null?void 0:u.resourceType,autoFocus:e.autoFocus,onChange:b=>{const S=b.currentTarget.value,j=o.find(C=>C.value===S);f(j)},data:v}),!o&&s.jsx(yb,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(tl,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function vq(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 yq(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const a=t==null?void 0:t.find(o=>o.resourceType===n);return a||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function xq(e,t){const n=Pc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
526
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
527
|
+
type,
|
|
528
|
+
name,
|
|
529
|
+
title,
|
|
530
|
+
}
|
|
531
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function bq(e){return e.type==="profile"&&!(e!=null&&e.error)&&Tn(e.resourceType)}function Sq(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const wq="_indented_ldk1d_1",w_={indented:wq};function Eb({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(Pe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Hh,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(_n,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Hh,{size:"1.25rem"})})}function j_({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(_n,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(Fh,{size:"1.25rem"})})}function jq(e){var b,S;const{slice:t,property:n}=e,[r,a]=y.useState(e.defaultValue),o=((b=t.typeSchema)==null?void 0:b.elements)??t.elements,c=y.useContext(cn),u=y.useMemo(()=>{var j;if(En(o))return yc({parentContext:c,elements:o,path:e.path,profileUrl:(j=t.typeSchema)==null?void 0:j.url})},[c,e.path,(S=t.typeSchema)==null?void 0:S.url,o]);function f(j){a(j),e.onChange&&e.onChange(j)}const p=t.min>0,m=Tn(t.elements),g=EA(t.name),v=e.property.readonly&&r.length===0;return tm(cn.Provider,u,s.jsx(zt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:v?s.jsx(De,{c:"dimmed",children:"(empty)"}):s.jsxs(We,{className:m?w_.indented:void 0,children:[r.map((j,C)=>s.jsxs(Ce,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${C}`,children:s.jsx(Tb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:j,onChange:R=>{const D=[...r];D[C]=R,f(D)},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(j_,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${C}`,onClick:R=>{hn(R);const D=[...r];D.splice(C,1),f(D)}})]},`${C}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(Ce,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Eb,{propertyDisplayName:g,onClick:j=>{hn(j);const C=[...r,void 0];f(C)},testId:e.testId&&`${e.testId}-add`})})]})}))}function Cq(e){var D;const{property:t}=e,n=Ae(),[r,a]=y.useState(!0),[o,c]=y.useState([]),[u]=y.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=y.useState(()=>[u]),m=y.useContext(cn),g=(D=t.type[0])==null?void 0:D.code;y.useEffect(()=>{g_({medplum:n,property:t}).then(E=>{c(E);const T=m_(u,E,t.slicing,m.profileUrl);Eq(T,E),p(T),a(!1)}).catch(E=>{console.error(E),a(!1)})},[n,t,u,m.profileUrl,p]);function v(E,T){const A=[...f];if(A[T]=E,p(A),e.onChange){const _=A.flat().filter(M=>M!==void 0);e.onChange(_)}}if(r)return s.jsx("div",{children:"Loading..."});const b=o.length,S=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&o.length>0)),C=$s(t.path),R=e.property.readonly&&o.length===0&&u.length===0;return s.jsxs(We,{className:e.indent?w_.indented:void 0,children:[R&&s.jsx(De,{c:"dimmed",children:"(empty)"}),o.map((E,T)=>s.jsx(jq,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:A=>{v(A,T)},testId:`slice-${E.name}`},E.name)),j&&S.map((E,T)=>s.jsxs(Ce,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Od,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:Sq(e.path,e.valuePath,T),defaultValue:E,onChange:A=>{const _=[...S];_[T]=A,v(_,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(j_,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:A=>{hn(A);const _=[...S];_.splice(T,1),v(_,b)}})]},`${T}-${S.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&s.jsx(Ce,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Eb,{propertyDisplayName:C,onClick:E=>{hn(E);const T=[...S];T.push(void 0),v(T,b)},testId:"nonsliced-add"})})]})}function Eq(e,t){for(let n=0;n<t.length;n++){const r=t[n],a=e[n];for(;a.length<r.min;)a.push(void 0)}}function Tq(e){const[t,n]=y.useState(!1),r=sR(),a=y.useRef(null),o={...e.styles};return t||(o.input||(o.input={}),o.input.WebkitTextSecurity="disc"),s.jsxs(Uo,{gap:"xs",children:[s.jsx(Ks,{...e,styles:{...o,root:{...o.root??{},flexGrow:1}},ref:a,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(_n,{title:"Copy secret",onClick:()=>{var c;r.copy((c=a.current)==null?void 0:c.value),_e({color:"green",message:"Copied"})},children:s.jsx(WA,{})})]})}const Rq=["sun","mon","tue","wed","thu","fri","sat"];function Dq(e){const[t,n]=y.useState(e.defaultValue),[r,a]=y.useState(!e.disabled&&(e.defaultModalOpen??!1)),o=y.useRef(t);return o.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:wA(o.current)||"No repeat"}),s.jsx(Pe,{disabled:e.disabled,onClick:()=>a(!0),children:"Edit"})]}),!e.disabled&&s.jsx(Aq,{path:e.path,visible:r,defaultValue:o.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),a(!1)},onCancel:()=>a(!1)})]})}const $E={repeat:{period:1,periodUnit:"d"}};function Aq(e){const[t,n]=y.useState(e.defaultValue||$E),{getExtendedProps:r}=y.useContext(cn),[a,o,c,u,f]=y.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=y.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function v(j){var C;g({...(C=p.current)==null?void 0:C.repeat,period:j})}function b(j){var C;g({...(C=p.current)==null?void 0:C.repeat,periodUnit:j})}function S(j){var C;g({...(C=p.current)==null?void 0:C.repeat,dayOfWeek:j})}return s.jsx(Bn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(We,{children:[s.jsx(zt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(si,{disabled:a==null?void 0:a.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),s.jsx(Sd,{disabled:o==null?void 0:o.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?$E.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(zt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ze,{disabled:c==null?void 0:c.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>v(parseInt(j.currentTarget.value,10)||1)}),s.jsx(ln,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.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(zt,{title:"Repeat on",children:s.jsx(Ju.Group,{multiple:!0,onChange:S,children:s.jsx(Ce,{justify:"space-between",mt:"md",gap:"xs",children:Rq.map(j=>s.jsx(Ju,{value:j,size:"xs",radius:"xl",disabled:f==null?void 0:f.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Od(e){var u;const{property:t,name:n,onChange:r,defaultValue:a}=e,o=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(o===oe.Attachment)return s.jsx(dH,{name:n,defaultValue:a,onChange:r,disabled:t.readonly});const f=((u=c[0])==null?void 0:u.code)!==oe.Extension;return s.jsx(Cq,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:a,indent:f,onChange:r,outcome:e.outcome})}else return c.length>1?s.jsx(_q,{elementDefinitionTypes:c,...e}):s.jsx(Tb,{name:n,defaultValue:a,onChange:f=>{if(e.onChange){const p=e.name.replace("[x]",$n(c[0].code));e.onChange(f,p)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function _q(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(o=>o.code===e.defaultPropertyType)),n||(n=t[0]);const[r,a]=y.useState(n);return s.jsxs(Ce,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ln,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:o=>{a(t.find(c=>c.code===o.currentTarget.value))},data:t.map(o=>({value:o.code,label:o.code}))}),s.jsx(Tb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:o=>{e.onChange&&e.onChange(o,e.name.replace("[x]",$n(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 Tb(e){const{name:t,onChange:n,outcome:r,binding:a,path:o,valuePath:c,readOnly:u}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=y.useContext(cn),g=y.useMemo(()=>{if(!Y0(p)||!Tn(e.defaultValue))return e.defaultValue;const S=Object.create(null);if(m.path===e.path)CE(S,m.elements);else{const j=As(m.path,e.path);if(j===void 0)return e.defaultValue;CE(S,m.elements,j)}return En(S)?S:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return s.jsx("div",{children:"Property type not specified "});function v(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:o,valuePath:c,disabled:u}}function b(){const S=Nt(e.outcome,c??o);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:S,disabled:u}}switch(p){case oe.SystemString:case oe.canonical:case oe.string:case oe.time:case oe.uri:case oe.url:return e.path==="Project.secret.value[x]"?s.jsx(Tq,{...b(),onChange:S=>{e.onChange&&e.onChange(S.currentTarget.value)}}):s.jsx(ze,{...b(),onChange:S=>{n&&n(S.currentTarget.value)}});case oe.date:return s.jsx(ze,{...b(),type:"date",onChange:S=>{n&&n(S.currentTarget.value)}});case oe.dateTime:case oe.instant:return s.jsx(si,{...b(),onChange:n,outcome:r});case oe.decimal:case oe.integer:case oe.positiveInt:case oe.unsignedInt:return s.jsx(ze,{...b(),type:"number",step:p===oe.decimal?"any":"1",onChange:S=>{if(n){const j=S.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case oe.code:return s.jsx(r_,{...b(),error:void 0,onChange:n,binding:a==null?void 0:a.valueSet,creatable:!0,maxValues:1});case oe.boolean:return s.jsx(Hn,{...b(),defaultChecked:!!g,onChange:S=>{n&&n(S.currentTarget.checked)}});case oe.base64Binary:case oe.markdown:return s.jsx(Ks,{...b(),spellCheck:p!==oe.base64Binary,onChange:S=>{n&&n(S.currentTarget.value)}});case oe.Address:return s.jsx(xV,{...v()});case oe.Annotation:return s.jsx(bV,{...v()});case oe.Attachment:return s.jsx(a_,{...v()});case oe.CodeableConcept:return s.jsx(YH,{binding:a==null?void 0:a.valueSet,...v()});case oe.Coding:return s.jsx(ZH,{binding:a==null?void 0:a.valueSet,...v()});case oe.ContactDetail:return s.jsx(tq,{...v()});case oe.ContactPoint:return s.jsx(S_,{...v()});case oe.Extension:return s.jsx(aq,{...v(),propertyType:e.elementDefinitionType});case oe.HumanName:return s.jsx(iq,{...v()});case oe.Identifier:return s.jsx(oq,{...v()});case oe.Money:return s.jsx(lq,{...v()});case oe.Period:return s.jsx(cq,{...v()});case oe.Duration:case oe.Quantity:return s.jsx(Vs,{...v()});case oe.Range:return s.jsx(Cb,{...v()});case oe.Ratio:return s.jsx(dq,{...v()});case oe.Reference:return s.jsx(Nd,{...v(),targetTypes:Pq(e.elementDefinitionType)});case oe.Timing:return s.jsx(Dq,{...v()});case oe.Dosage:case oe.UsageContext:default:return s.jsx(Rb,{...v(),typeName:p})}}const kq=[`${Ed}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function Pq(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=kq.find(a=>n.startsWith(a));return r?n.slice(r.length):n})}function Nq(e){const[t,n]=y.useState(e.defaultValue??{}),r=y.useContext(cn),a=y.useMemo(()=>yV(r.elements),[r.elements]);function o(u){n(u),e.onChange&&e.onChange(u)}const c={type:e.type,value:t};return s.jsx(We,{style:{flexGrow:1},"data-testid":e.testId,children:a.map(([u,f])=>{const[p,m]=LH(c,u,f),g=f.min!==void 0&&f.min>0,v=e.valuePath?e.valuePath+"."+u:void 0,b=s.jsx(Od,{property:f,name:u,path:e.path+"."+u,valuePath:v,defaultValue:p,defaultPropertyType:m,onChange:(S,j)=>{o(QH({...t},u,j??u,f,S))},outcome:e.outcome},u);return e.type==="Extension"||cb.includes(u)?b:f.type.length===1&&f.type[0].code==="boolean"?s.jsx(b_,{title:$s(u),description:f.description,htmlFor:u,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},u):s.jsx(zt,{title:$s(u),description:f.description,withAsterisk:g,htmlFor:u,outcome:e.outcome,fhirPath:f.path,errorExpression:v,readonly:f.readonly,children:b},u)})})}function Rb(e){const[t]=y.useState(()=>e.defaultValue??{}),n=y.useContext(cn),r=e.profileUrl??(n==null?void 0:n.profileUrl),a=y.useMemo(()=>Hp(e.typeName,r),[e.typeName,r]),o=(a==null?void 0:a.type)??e.typeName,c=y.useMemo(()=>{if(a)return yc({parentContext:n,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,n,e.path,e.accessPolicyResource]);return a?tm(cn.Provider,c,s.jsx(Nq,{path:e.path,valuePath:e.valuePath,type:o,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[o," not implemented"]})}const Oq="_noteCite_10swh_5",Mq="_noteRoot_10swh_10",UE={noteCite:Oq,noteRoot:Mq};function C_({value:e}){return e?s.jsx(We,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(a0,{classNames:{cite:UE.noteCite,root:UE.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Ic(e){const{value:t,link:n,...r}=e,[a,o]=y.useState(),c=Yt(t,o);let u;if(a&&!eA(a))u=`[${Ke(a)}]`;else if(c)u=Fi(c);else return null;return n?s.jsx(bt,{to:t,...r,children:u}):s.jsx(De,{component:"span",...r,children:u})}function oc(e){return s.jsxs(Ce,{gap:"xs",children:[s.jsx(Yo,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Ic,{value:e.value,link:e.link})]})}const Iq={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",finished:"green",planned:"gray"};function Db(e){return s.jsx(jp,{color:e.color||Iq[e.status],variant:e.variant,children:e.status.replace(/-/g," ")})}const Lq="_table_pe9td_1",zq="_criticalRow_pe9td_12",E_={table:Lq,criticalRow:zq};Ab.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Ab(e){var c;const t=Ae(),n=Yt(e.value),[r,a]=y.useState();if(y.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(f=>f.status==="fulfilled").map(f=>f.value)).then(a).catch(console.error)},[t,n]),!n)return null;const o=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(c=u.contentType)!=null&&c.startsWith("text/plain")&&u.data&&o.push({text:window.atob(u.data)})}return s.jsxs(We,{children:[s.jsx(Ie,{children:"Diagnostic Report"}),s.jsx($q,{value:n}),r&&!e.hideSpecimenInfo&&Uq(r),n.result&&s.jsx(Bq,{hideObservationNotes:e.hideObservationNotes,value:n.result}),o.length>0&&s.jsx(C_,{value:o})]})}function $q({value:e}){var t,n;return s.jsxs(Ce,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(oc,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(oc,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(oc,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(De,{children:gr(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(De,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(De,{children:$n(e.status)})]})]})}function Uq(e){return s.jsxs(We,{gap:"xs",children:[s.jsx(Ie,{order:2,size:"h6",children:"Specimens"}),s.jsx(pr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(pr.Item,{ml:"sm",children:s.jsxs(Ce,{gap:20,children:[s.jsxs(Ce,{gap:5,children:[s.jsx(De,{fw:500,children:"Collected:"})," ",gr((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(Ce,{gap:5,children:[s.jsx(De,{fw:500,children:"Received:"})," ",gr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Bq(e){return s.jsxs("table",{className:E_.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(T_,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function T_(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(Vq,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Wo(n)?n.reference:n.id}`))})}function Vq(e){var a,o;const t=Yt(e.value);if(!t||(a=e.ancestorIds)!=null&&a.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=qq(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:$t({[E_.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(bt,{to:t,children:s.jsx(oi,{value:t.code})})}),s.jsx("td",{children:s.jsx(Fq,{value:t})}),s.jsx("td",{children:s.jsx(Hq,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(oi,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(c=>s.jsx("div",{children:s.jsx(oi,{value:c})},`category-${Bo(c)}`))})}),s.jsx("td",{children:(o=t.performer)==null?void 0:o.map(c=>s.jsx($y,{value:c},c.reference))}),s.jsx("td",{children:t.status&&s.jsx(Db,{status:t.status})})]}),t.hasMember&&s.jsx(T_,{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(C_,{value:t.note})})})]})}function Fq(e){const t=e.value;return s.jsx(s.Fragment,{children:jA(t)})}function Hq(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(wb,{value:t}):null}function qq(e){var n,r,a,o;const t=(o=(a=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var Hv={},Oi={},BE;function R_(){if(BE)return Oi;BE=1,Object.defineProperty(Oi,"__esModule",{value:!0}),Oi.Pointer=Oi.escapeToken=Oi.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}Oi.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}Oi.escapeToken=t;var n=function(){function r(a){a===void 0&&(a=[""]),this.tokens=a}return r.fromJSON=function(a){var o=a.split("/").map(e);if(o[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(a));return new r(o)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(a){for(var o=null,c="",u=a,f=1,p=this.tokens.length;f<p;f++)o=u,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(u=(o||{})[c]);return{parent:o,key:c,value:u}},r.prototype.get=function(a){return this.evaluate(a).value},r.prototype.set=function(a,o){var c=this.evaluate(a);c.parent&&(c.parent[c.key]=o)},r.prototype.push=function(a){this.tokens.push(a)},r.prototype.add=function(a){var o=this.tokens.concat(String(a));return new r(o)},r}();return Oi.Pointer=n,Oi}var gn={},qv={},VE;function D_(){return VE||(VE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(a){return a===void 0?"undefined":a===null?"null":Array.isArray(a)?"array":typeof a}e.objectType=t;function n(a){return a!=null&&typeof a=="object"}function r(a){if(!n(a))return a;if(a.constructor==Array){for(var o=a.length,c=new Array(o),u=0;u<o;u++)c[u]=r(a[u]);return c}if(a.constructor==Date){var f=new Date(+a);return f}var p={};for(var m in a)e.hasOwnProperty.call(a,m)&&(p[m]=r(a[m]));return p}e.clone=r}(qv)),qv}var fr={},FE;function A_(){if(FE)return fr;FE=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffAny=fr.diffObjects=fr.diffArrays=fr.intersection=fr.subtract=fr.isDestructive=void 0;var e=D_();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}fr.isDestructive=t;function n(m,g){var v={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(v[b]=1);for(var S in g)e.hasOwnProperty.call(g,S)&&g[S]!==void 0&&delete v[S];return Object.keys(v)}fr.subtract=n;function r(m){for(var g=m.length,v={},b=0;b<g;b++){var S=m[b];for(var j in S)e.hasOwnProperty.call(S,j)&&S[j]!==void 0&&(v[j]=(v[j]||0)+1)}for(var j in v)v[j]<g&&delete v[j];return Object.keys(v)}fr.intersection=r;function a(m){return m.op==="add"}function o(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function u(m,g,v,b){b===void 0&&(b=p);var S={"0,0":{operations:[],cost:0}};function j(T,A){var _="".concat(T,",").concat(A),M=S[_];if(M===void 0){if(T>0&&A>0&&!b(m[T-1],g[A-1],v.add(String(T-1))).length)M=j(T-1,A-1);else{var L=[];if(T>0){var $=j(T-1,A),V={op:"remove",index:T-1};L.push(c($,V))}if(A>0){var X=j(T,A-1),Q={op:"add",index:T-1,value:g[A-1]};L.push(c(X,Q))}if(T>0&&A>0){var J=j(T-1,A-1),W={op:"replace",index:T-1,original:m[T-1],value:g[A-1]};L.push(c(J,W))}var Y=L.sort(function(P,I){return P.cost-I.cost})[0];M=Y}S[_]=M}return M}var C=isNaN(m.length)||m.length<=0?0:m.length,R=isNaN(g.length)||g.length<=0?0:g.length,D=j(C,R).operations,E=D.reduce(function(T,A){var _=T[0],M=T[1];if(a(A)){var L=A.index+1+M,$=L<C+M?String(L):"-",V={op:A.op,path:v.add($).toString(),value:A.value};return[_.concat(V),M+1]}else if(o(A)){var V={op:A.op,path:v.add(String(A.index+M)).toString()};return[_.concat(V),M-1]}else{var X=v.add(String(A.index+M)),Q=b(A.original,A.value,X);return[_.concat.apply(_,Q),M]}},[[],0])[0];return E}fr.diffArrays=u;function f(m,g,v,b){b===void 0&&(b=p);var S=[];return n(m,g).forEach(function(j){S.push({op:"remove",path:v.add(j).toString()})}),n(g,m).forEach(function(j){S.push({op:"add",path:v.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){S.push.apply(S,b(m[j],g[j],v.add(j)))}),S}fr.diffObjects=f;function p(m,g,v,b){if(b===void 0&&(b=p),m===g)return[];var S=(0,e.objectType)(m),j=(0,e.objectType)(g);return S=="array"&&j=="array"?u(m,g,v,b):S=="object"&&j=="object"?f(m,g,v,b):[{op:"replace",path:v.toString(),value:g}]}return fr.diffAny=p,fr}var HE;function Gq(){if(HE)return gn;HE=1;var e=gn&&gn.__extends||function(){var C=function(R,D){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,T){E.__proto__=T}||function(E,T){for(var A in T)Object.prototype.hasOwnProperty.call(T,A)&&(E[A]=T[A])},C(R,D)};return function(R,D){if(typeof D!="function"&&D!==null)throw new TypeError("Class extends value "+String(D)+" is not a constructor or null");C(R,D);function E(){this.constructor=R}R.prototype=D===null?Object.create(D):(E.prototype=D.prototype,new E)}}();Object.defineProperty(gn,"__esModule",{value:!0}),gn.apply=gn.InvalidOperationError=gn.test=gn.copy=gn.move=gn.replace=gn.remove=gn.add=gn.TestError=gn.MissingError=void 0;var t=R_(),n=D_(),r=A_(),a=function(C){e(R,C);function R(D){var E=C.call(this,"Value required at path: ".concat(D))||this;return E.path=D,E.name="MissingError",E}return R}(Error);gn.MissingError=a;var o=function(C){e(R,C);function R(D,E){var T=C.call(this,"Test failed: ".concat(D," != ").concat(E))||this;return T.actual=D,T.expected=E,T.name="TestError",T}return R}(Error);gn.TestError=o;function c(C,R,D){if(Array.isArray(C))if(R=="-")C.push(D);else{var E=parseInt(R,10);C.splice(E,0,D)}else C[R]=D}function u(C,R){if(Array.isArray(C)){var D=parseInt(R,10);C.splice(D,1)}else delete C[R]}function f(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return D.parent===void 0?new a(R.path):(c(D.parent,D.key,(0,n.clone)(R.value)),null)}gn.add=f;function p(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return D.value===void 0?new a(R.path):(u(D.parent,D.key),null)}gn.remove=p;function m(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);if(D.parent===null)return new a(R.path);if(Array.isArray(D.parent)){if(parseInt(D.key,10)>=D.parent.length)return new a(R.path)}else if(D.value===void 0)return new a(R.path);return D.parent[D.key]=(0,n.clone)(R.value),null}gn.replace=m;function g(C,R){var D=t.Pointer.fromJSON(R.from).evaluate(C);if(D.value===void 0)return new a(R.from);var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new a(R.path):(u(D.parent,D.key),c(E.parent,E.key,D.value),null)}gn.move=g;function v(C,R){var D=t.Pointer.fromJSON(R.from).evaluate(C);if(D.value===void 0)return new a(R.from);var E=t.Pointer.fromJSON(R.path).evaluate(C);return E.parent===void 0?new a(R.path):(c(E.parent,E.key,(0,n.clone)(D.value)),null)}gn.copy=v;function b(C,R){var D=t.Pointer.fromJSON(R.path).evaluate(C);return(0,r.diffAny)(D.value,R.value,new t.Pointer).length?new o(D.value,R.value):null}gn.test=b;var S=function(C){e(R,C);function R(D){var E=C.call(this,"Invalid operation: ".concat(D.op))||this;return E.operation=D,E.name="InvalidOperationError",E}return R}(Error);gn.InvalidOperationError=S;function j(C,R){switch(R.op){case"add":return f(C,R);case"remove":return p(C,R);case"replace":return m(C,R);case"move":return g(C,R);case"copy":return v(C,R);case"test":return b(C,R)}return new S(R)}return gn.apply=j,gn}var qE;function Qq(){return qE||(qE=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=R_();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Gq(),r=A_();function a(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=a;function o(p){function m(g,v,b){var S=p(g,v,b);return Array.isArray(S)?S:(0,r.diffAny)(g,v,b,m)}return m}function c(p,m,g){var v=new t.Pointer;return(g?o(g):r.diffAny)(p,m,v)}e.createPatch=c;function u(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(v){var b=u(p,v.path);if(b&&g.push(b),"from"in v){var S=u(p,v.from);S&&g.push(S)}}),g}e.createTests=f}(Hv)),Hv}var __=Qq();const Wq="_removed_el5zk_1",Yq="_added_el5zk_6",GE={removed:Wq,added:Yq};function Kq(e){var m;const{name:t,path:n,property:r,originalValue:a,revisedValue:o}=e,c=!!((m=r==null?void 0:r.type)!=null&&m.find(g=>g.code==="Attachment")),[u,f]=y.useState(c),p=()=>f(g=>!g);return s.jsx(s.Fragment,{children:c&&!u||!c?s.jsx(s.Fragment,{children:s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:t}),s.jsx(Oe.Td,{className:GE.removed,children:a&&s.jsx(La,{path:n,property:r,propertyType:a.type,value:a.value,ignoreMissingValues:!0})}),s.jsx(Oe.Td,{className:GE.added,children:o&&s.jsx(La,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})})]})}):s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:t}),s.jsx(Oe.Td,{colSpan:2,style:{textAlign:"right"},children:s.jsx(Pe,{onClick:p,variant:"light",children:"Expand"})})]})})}const Xq="_root_15xvr_1",Zq={root:Xq};function Jq(e){const t=Ae(),{original:n,revised:r}=e,[a,o]=y.useState(!1);y.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[t,e.original.resourceType]);const c=y.useMemo(()=>{if(!a)return null;const u=[ha(n)],f=[ha(r)],p=[],m=eG(__.createPatch(n,r));for(const g of m){const v=g.path,b=tG(v),S=nG(n.resourceType,b),j=g.op==="add"?void 0:Us(b,u),C=g.op==="remove"?void 0:Us(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${$n(g.op)} ${b}`,path:(S==null?void 0:S.path)??n.resourceType+"."+b,property:S,originalValue:QE(S,j),revisedValue:QE(S,C)})}return p},[a,n,r]);return c?s.jsxs(Oe,{className:Zq.root,children:[s.jsx(Oe.Thead,{children:s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Th,{}),s.jsx(Oe.Th,{children:"Before"}),s.jsx(Oe.Th,{children:"After"})]})}),s.jsx(Oe.Tbody,{children:c.map(u=>{const{key:f,...p}=u;return s.jsx(Kq,{...p},f)})})]}):null}function eG(e){const t=[];for(const n of e){const{op:r,path:a}=n;if(a.startsWith("/meta/author")||a.startsWith("/meta/compartment")||a.startsWith("/meta/lastUpdated")||a.startsWith("/meta/versionId"))continue;const o=e.filter(u=>u.op===r&&u.path===a).length,c={op:r,path:a};o>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(a)&&(c.op="replace",c.path=a.replace(/\/[^/]+$/,"")),t.some(u=>u.op===c.op&&u.path===c.path)||t.push(c)}return t}function tG(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const a=t[r];a==="-"?n+=".last()":/^\d+$/.test(a)?n+=`[${a}]`:(r>0&&(n+="."),n+=a)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function nG(e,t){var r;const n=Mc(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function QE(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:rG(t,!!(e!=null&&e.isArray))}}function rG(e,t){const n=z$(e).flatMap(r=>r.value);return t?n:n[0]}function _b(e){const{profileUrl:t}=e,n=Ae(),r=n.getAccessPolicy(),a=Yt(e.value),[o,c]=y.useState(!1);y.useEffect(()=>{if(a)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Pc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=a.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,a]);const u=y.useMemo(()=>a&&kA(a,tc.READ,r),[r,a]);return!o||!a?null:s.jsx(qh,{path:a.resourceType,value:{type:a.resourceType,value:e.forceUseInput?e.value:a},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const aG="_item_5q6yx_1",iG="_itemPadding_5q6yx_5",WE={item:aG,itemPadding:iG};function oG(e){return s.jsx(kd,{children:e.children})}function Fs(e){var f,p;const{resource:t,profile:n,padding:r,popupMenuItems:a,...o}=e,c=n??((f=t.meta)==null?void 0:f.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return s.jsxs(Sb,{"data-testid":"timeline-item",fill:!0,...o,children:[s.jsxs(Ce,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Yo,{value:c,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(De,{size:"sm",children:s.jsx(Ic,{c:"dark",fw:500,value:c,link:!0})}),s.jsxs(De,{size:"xs",children:[s.jsx(bt,{c:"dimmed",to:e.resource,children:gr(u)}),s.jsx(De,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(bt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),a&&s.jsxs(je,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(je.Target,{children:s.jsx(_n,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Lt(e.resource)}`,children:s.jsx(zV,{})})}),a]})]}),s.jsx(ZA,{children:s.jsx("div",{className:$t(WE.item,{[WE.itemPadding]:r}),children:e.children})})]})}function k_(e,t){e.sort((n,r)=>{const a=YE(n,t),o=YE(r,t);return a>o?1:a<o?-1:KE(n,t)-KE(r,t)})}function YE(e,t){if(!P_(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function KE(e,t){var r;if(!P_(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 P_(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const sG="_pinnedComment_u08s5_1",lG={pinnedComment:sG};function nm(e){const t=Ae(),n=t.getProfile(),r=y.useRef(null),a=Yt(e.value),[o,c]=y.useState(),[u,f]=y.useState([]),p=e.loadTimelineResources,m=y.useRef(u);m.current=u;const g=y.useCallback(T=>{k_(T,a),T.reverse(),f(T)},[a]),v=y.useCallback(T=>{const A=[];for(const _ of T){if(_.status!=="fulfilled")continue;const M=_.value;if(M.type==="history"&&c(M),M.entry)for(const L of M.entry)A.push(L.resource)}g(A)},[g]),b=y.useCallback(T=>g([...m.current,T]),[g]),S=y.useCallback(()=>{var _;let T,A;"resourceType"in e.value?(T=e.value.resourceType,A=e.value.id):[T,A]=(_=e.value.reference)==null?void 0:_.split("/"),p(t,T,A).then(v).catch(console.error)},[t,e.value,p,v]);y.useEffect(()=>S(),[S]);function j(T){!a||!e.createCommunication||t.createResource(e.createCommunication(a,n,T)).then(A=>b(A)).catch(console.error)}function C(T){!a||!e.createMedia||t.createResource(e.createMedia(a,n,T)).then(A=>b(A)).then(()=>Rs({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(to,{size:16}),autoClose:2e3})).catch(A=>Rs({id:"upload-notification",color:"red",title:"Upload error",message:Ke(A),icon:s.jsx(_E,{size:16}),autoClose:2e3}))}function R(){_e({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(T){Rs({id:"upload-notification",loading:!0,title:"Uploading...",message:mG(T),autoClose:!1,withCloseButton:!1})}function E(T){Rs({id:"upload-notification",color:"red",title:"Upload error",message:Ke(T),icon:s.jsx(_E,{size:16}),autoClose:2e3})}return a?s.jsxs(oG,{children:[e.createCommunication&&s.jsx(Sb,{children:s.jsx(mt,{testid:"timeline-form",onSubmit:T=>{j(T.text);const A=r.current;A&&(A.value="",A.focus())},children:s.jsxs(Ce,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Yo,{value:n}),s.jsx(ze,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(_n,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(GV,{size:16})}),s.jsx(bb,{securityContext:fn(a),onUpload:C,onUploadStart:R,onUploadProgress:D,onUploadError:E,children:T=>s.jsx(_n,{...T,radius:"xl",color:"blue",variant:"filled",children:s.jsx(db,{size:16})})})]})})}),u.map(T=>{var M;if(!T)return null;const A=`${T.resourceType}/${T.id}/${(M=T.meta)==null?void 0:M.versionId}`,_=e.getMenu?e.getMenu({primaryResource:a,currentResource:T,reloadTimeline:S}):void 0;if(T.resourceType===a.resourceType&&T.id===a.id)return s.jsx(cG,{history:o,resource:T,popupMenuItems:_},A);switch(T.resourceType){case"AuditEvent":return s.jsx(hG,{resource:T,popupMenuItems:_},A);case"Communication":return s.jsx(dG,{resource:T,popupMenuItems:_},A);case"DiagnosticReport":return s.jsx(pG,{resource:T,popupMenuItems:_},A);case"Media":return s.jsx(fG,{resource:T,popupMenuItems:_},A);default:return s.jsx(Fs,{resource:T,padding:!0,children:s.jsx(_b,{value:T,ignoreMissingValues:!0})},A)}})]}):s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(_r,{})})}function cG(e){const{history:t,resource:n,...r}=e,a=uG(t,n);return a?s.jsx(Fs,{resource:n,padding:!0,...r,children:s.jsx(Jq,{original:a,revised:e.resource})}):s.jsxs(Fs,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(_b,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function uG(e,t){const n=e.entry??[],r=n.findIndex(a=>{var o,c,u;return((c=(o=a.resource)==null?void 0:o.meta)==null?void 0:c.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function dG(e){var r,a;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:lG.pinnedComment;return s.jsx(Fs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(a=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:a.contentString})})}function fG(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(Fs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(_d,{value:e.resource.content})})}function hG(e){return s.jsx(Fs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Yr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function pG(e){return s.jsx(Fs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(Ab,{value:e.resource})})}function mG(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Gv(e.loaded)} / ${Gv(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Gv(e.loaded)}`}function Gv(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 gG(e){const{resource:t,...n}=e;return s.jsx(nm,{value:t,loadTimelineResources:async(r,a,o)=>{const c=`${a}/${o}`;return Promise.allSettled([r.readHistory(a,o),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function vG(e){const{encounter:t,...n}=e;return s.jsx(nm,{value:t,loadTimelineResources:async(r,a,o)=>Promise.allSettled([r.readHistory("Encounter",o),r.search("Communication","encounter=Encounter/"+o),r.search("Media","encounter=Encounter/"+o)]),createCommunication:(r,a,o)=>({resourceType:"Communication",status:"completed",encounter:fn(r),subject:r.subject,sender:fn(a),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,a,o)=>({resourceType:"Media",status:"completed",encounter:fn(r),subject:r.subject,operator:fn(a),issued:new Date().toISOString(),content:o}),...n})}function yG(e){let t;try{t=Oc(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(La,{value:t[0]||"",propertyType:e.propertyType})}function xG(e){return s.jsxs(Bn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(XE,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(XE,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(De,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function XE(e){return s.jsx(Pe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const bG={string:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],fulltext:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],token:[de.EQUALS,de.NOT],reference:[de.EQUALS,de.NOT],numeric:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],quantity:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],date:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],datetime:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],uri:[de.EQUALS,de.NOT,de.ABOVE,de.BELOW]},SG={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",sw:"starts with",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 kb(e,t){return{...e,filters:t,offset:0,name:void 0}}function N_(e,t){return kb(e,(e.filters??[]).filter(n=>n.code!==t))}function rm(e,t,n,r,a){const o=[];return e.filters&&o.push(...e.filters),o.push({code:t,operator:n,value:r??""}),kb(e,o)}function wG(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function jG(e,t){return Pb(e,t,-1)}function CG(e,t){return Pb(e,t,0)}function EG(e,t){return Pb(e,t,1)}function Pb(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const a=new Date(r.getTime());return a.setDate(a.getDate()+1),a.setTime(a.getTime()-1),am(e,t,r,a)}function TG(e,t){const n=new Date,r=new Date(n.getTime()+24*60*60*1e3);return am(e,t,n,r)}function RG(e,t){return Nb(e,t,-1)}function DG(e,t){return Nb(e,t,0)}function AG(e,t){return Nb(e,t,1)}function Nb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const a=new Date(r.getTime());return a.setMonth(a.getMonth()+1),a.setDate(1),a.setHours(0,0,0,0),a.setTime(a.getTime()-1),am(e,t,r,a)}function _G(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),am(e,t,n,new Date)}function am(e,t,n,r){return e=N_(e,t),e=ZE(e,t,de.GREATER_THAN_OR_EQUALS,n),e=ZE(e,t,de.LESS_THAN_OR_EQUALS,r),e}function ZE(e,t,n,r){return rm(e,t,n,r.toISOString())}function JE(e,t,n=!0){return rm(e,t,de.MISSING,n.toString())}function kG(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function PG(e,t){const n=e.count??Qp,r=(t-1)*n;return kG(e,r)}function NG(e,t,n){return t===OG(e)&&n!==void 0&&n===MG(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function OG(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function MG(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function IG(e){return bG[e.type]}function O_(e){return SG[e]??""}function Hs(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($n).join(" "))}function LG(e,t){var r,a;const n=t.name;return n==="id"?s.jsx(bt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?gr((a=e.meta)==null?void 0:a.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?zG(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?$G(e,t.searchParams[0]):null}function zG(e,t){var o,c,u;const n=((u=(c=(o=t.path)==null?void 0:o.split("."))==null?void 0:c.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,a]=em({type:e.resourceType,value:e},n);return r?s.jsx(La,{path:t.path,property:t,propertyType:a,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function $G(e,t){const n=Us(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,a)=>s.jsx(La,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${a}-${n.length}`))})}function UG(e){const t=y.useRef(!1),[n,r]=y.useState({search:JSON.parse(Ia(e.search))}),[a,o]=y.useState(!1);y.useEffect(()=>{r({search:e.search})},[e.search]);const c=y.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=oA(f),m=X0(f);return rd(BG(p,m)).map(g=>({value:g,label:Hs(g)}))},[e.visible,e.search.resourceType]);function u(f){r({search:{...n.search,fields:f}})}return s.jsx(Bn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=a},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(We,{children:[s.jsx(Pp,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>o(!0),onDropdownClose:()=>o(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function BG(e,t){const n=[],r=new Set,a=new Set;for(const o of Object.keys(e.elements))n.push(o),r.add(o.toLowerCase()),a.add(Hs(o));if(t)for(const o of Object.keys(t)){const c=Hs(o);!r.has(o)&&!a.has(c)&&(n.push(o),r.add(o),a.add(c))}return n}function M_(e){const t=Mc(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case Jn.REFERENCE:return s.jsx(Nd,{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 Jn.BOOLEAN:return s.jsx(Hn,{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 Jn.DATE:return s.jsx(ze,{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 Jn.DATETIME:return s.jsx(si,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Jn.NUMBER:return s.jsx(ze,{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 Jn.QUANTITY:return s.jsx(Vs,{name:n,path:"",defaultValue:VG(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(ze,{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 VG(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function FG(e){const[t,n]=y.useState(Qr(e.search)),r=y.useRef(t);r.current=t,y.useEffect(()=>{n(Qr(e.search))},[e.search]);function a(f){n(rm(r.current,f.code,f.operator,f.value))}const o=e.search.resourceType,c=X0(o)??{},u=t.filters||[];return s.jsx(Bn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:s.jsxs(mt,{onSubmit:()=>e.onOk(r.current),children:[s.jsxs("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:40}})]}),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",{})]})}),s.jsx("tbody",{children:u.map((f,p)=>s.jsx(HG,{id:`filter-${p}-row`,resourceType:o,searchParams:c,value:f,onChange:m=>{const g=[...u];g[p]=m,n(kb(r.current,g))},onDelete:()=>n(wG(r.current,p))},`filter-${p}-row`))})]}),s.jsx(Eb,{propertyDisplayName:"Filter",onClick:()=>a({})})]}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Or,{children:"OK"})})]})})}function HG(e){const t=e.value,n=y.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=de.EQUALS,n.current.value="",e.onChange(n.current)}function a(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function o(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],u=c&&IG(c);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ln,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Hs(f)}))]})}),s.jsx("td",{children:u&&s.jsx(ln,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>a(f.currentTarget.value),data:["",...u.map(f=>({value:f,label:O_(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),s.jsx("td",{children:c&&t.operator&&s.jsx(M_,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:o},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),s.jsx("td",{children:e.onDelete&&s.jsx(_n,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:s.jsx(Bs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function qG(e){const[t,n]=y.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(Bn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(or,{children:[s.jsx(or.Col,{span:10,children:s.jsx(M_,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(or.Col,{span:2,children:s.jsx(Pe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function GG(e){var a;const{resourceType:t,filter:n}=e,r=(a=ui.types[t].searchParams)==null?void 0:a[n.code];if(r){if(r.type==="reference"&&(n.operator===de.EQUALS||n.operator===de.NOT_EQUALS))return s.jsx(Ic,{value:{reference:n.value}});const o=Mc(t,r);if(n.code==="_lastUpdated"||o.type===Jn.DATETIME)return s.jsx(s.Fragment,{children:gr(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function QG(e){if(!e.searchParams)return null;function t(o,c){a(NG(e.search,o.code,c))}function n(o){a(N_(e.search,o.code))}function r(o,c){e.onPrompt(o,{code:o.code,operator:c,value:""})}function a(o){e.onChange(o)}return e.searchParams.length===1?s.jsx(WG,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:a,onClear:n}):s.jsx(je.Dropdown,{children:e.searchParams.map(o=>s.jsx(je.Item,{children:Hs(o.code)},o.code))})}function WG(e){switch(e.searchParam.type){case"date":return s.jsx(YG,{...e});case"number":case"quantity":return s.jsx(KG,{...e});case"reference":return s.jsx(XG,{...e});case"string":return s.jsx(ZG,{...e});case"token":case"uri":return s.jsx(JG,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function YG(e){const{searchParam:t}=e,n=t.code;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(fb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(je.Item,{leftSection:s.jsx(hb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(XA,{size:14}),onClick:()=>e.onPrompt(t,de.ENDS_BEFORE),children:"Before..."}),s.jsx(je.Item,{leftSection:s.jsx(KA,{size:14}),onClick:()=>e.onPrompt(t,de.STARTS_AFTER),children:"After..."}),s.jsx(je.Item,{leftSection:s.jsx(DV,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Between..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(EG(e.search,n)),children:"Tomorrow"}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(CG(e.search,n)),children:"Today"}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(jG(e.search,n)),children:"Yesterday"}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(TG(e.search,n)),children:"Next 24 Hours"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(AG(e.search,n)),children:"Next Month"}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(DG(e.search,n)),children:"This Month"}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(RG(e.search,n)),children:"Last Month"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(ko,{size:14}),onClick:()=>e.onChange(_G(e.search,n)),children:"Year to date"}),s.jsx(Md,{...e})]})}function KG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(fb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(je.Item,{leftSection:s.jsx(hb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(KA,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN),children:"Greater than..."}),s.jsx(je.Item,{leftSection:s.jsx(Ly,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(je.Item,{leftSection:s.jsx(XA,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN),children:"Less than..."}),s.jsx(je.Item,{leftSection:s.jsx(Ly,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Md,{...e})]})}function XG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(Md,{...e})]})}function ZG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(fb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(je.Item,{leftSection:s.jsx(hb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(kV,{size:14}),onClick:()=>e.onPrompt(t,de.CONTAINS),children:"Contains..."}),s.jsx(je.Item,{leftSection:s.jsx(_V,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Does not contain..."}),s.jsx(Md,{...e})]})}function JG(e){const{searchParam:t}=e;return s.jsxs(je.Dropdown,{children:[s.jsx(je.Item,{leftSection:s.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),s.jsx(je.Item,{leftSection:s.jsx(Dd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),s.jsx(Md,{...e})]})}function Md(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(TV,{size:14}),onClick:()=>e.onChange(JE(e.search,n)),children:"Missing"}),s.jsx(je.Item,{leftSection:s.jsx(EV,{size:14}),onClick:()=>e.onChange(JE(e.search,n,!1)),children:"Not missing"}),s.jsx(je.Divider,{}),s.jsx(je.Item,{leftSection:s.jsx(Bs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const eQ="_root_vlout_1",tQ="_table_vlout_8",nQ="_tr_vlout_12",rQ="_control_vlout_22",aQ="_icon_vlout_31",Iu={root:eQ,table:tQ,tr:nQ,control:rQ,icon:aQ};function iQ(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(oQ(t,r));return n}function oQ(e,t){var a;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=Qo(e,t),r=tU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=X0(e);let c;if(o){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);c=Object.values(o).filter(f=>!!f.expression&&u.test(f==null?void 0:f.expression)),c.length===0&&(c=void 0)}return{name:t,elementDefinition:n,searchParams:c}}if(r){const o=Mc(e,r);return{name:t,elementDefinition:(a=o.elementDefinitions)==null?void 0:a[0],searchParams:[r]}}return{name:t}}class sQ extends Event{constructor(t){super("change"),this.definition=t}}class lQ extends Event{constructor(t){super("load"),this.response=t}}class Gh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function Id(e){var W,Y;const t=Ae(),[n,r]=y.useState(),{search:a,onLoad:o}=e,[c,u]=y.useState(a);ci(a,c)||u(a);const[f,p]=y.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=y.useRef(f);m.current=f;const g=c.total??"accurate",v=y.useCallback(P=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,ec({...c,total:g,fields:void 0}),P)).then(I=>{p({...m.current,searchResponse:I}),o&&o(new lQ(I))}).catch(I=>{p({...m.current,searchResponse:void 0}),r(Jt(I))})},[t,c,g,o]),b=y.useCallback(()=>{p({...m.current,searchResponse:void 0}),v({cache:"reload"})},[v]);y.useEffect(()=>{v()},[v]);function S(P,I){P.stopPropagation();const F=P.target.checked,O={...m.current.selected};F?O[I]=!0:delete O[I],p({...m.current,selected:O})}function j(P){P.stopPropagation();const z=P.target.checked,F={},O=m.current.searchResponse;z&&(O!=null&&O.entry)&&O.entry.forEach(U=>{var Z;(Z=U.resource)!=null&&Z.id&&(F[U.resource.id]=!0)}),p({...m.current,selected:F})}function C(){var I,z;const P=m.current;if(!((I=P.searchResponse)!=null&&I.entry)||P.searchResponse.entry.length===0)return!1;for(const F of P.searchResponse.entry)if((z=F.resource)!=null&&z.id&&!P.selected[F.resource.id])return!1;return!0}function R(P){e.onChange&&e.onChange(new sQ(P))}function D(P,I){if(e_(P.target)||P.button===2)return;hn(P);const z=JA(P);!z&&e.onClick&&e.onClick(new Gh(I,P)),z&&e.onAuxClick&&e.onAuxClick(new Gh(I,P))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(xa,{outcome:n});if(!iA(c.resourceType))return s.jsx(er,{style:{width:"100%",height:"100%"},children:s.jsx(_r,{})});const T=e.checkboxesEnabled,A=iQ(c),_=c.resourceType,M=f.searchResponse,L=M==null?void 0:M.entry,$=L==null?void 0:L.map(P=>P.resource),V="subtle",X="gray",Q=16,J=window.innerWidth<768;return s.jsxs("div",{className:Iu.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(Ce,{justify:"space-between",mb:"xl",children:[s.jsxs(Ce,{gap:2,children:[s.jsx(Pe,{size:"compact-md",variant:V,color:X,leftSection:s.jsx(MV,{size:Q}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),s.jsx(Pe,{size:"compact-md",variant:V,color:X,leftSection:s.jsx(UV,{size:Q}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&s.jsx(Pe,{size:"compact-md",variant:V,color:X,leftSection:s.jsx($V,{size:Q}),onClick:e.onNew,children:"New..."}),!J&&E()&&s.jsx(Pe,{size:"compact-md",variant:V,color:X,leftSection:s.jsx(lF,{size:Q}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!J&&e.onDelete&&s.jsx(Pe,{size:"compact-md",variant:V,color:X,leftSection:s.jsx(pb,{size:Q}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!J&&e.onBulk&&s.jsx(Pe,{size:"compact-md",variant:V,color:X,leftSection:s.jsx(RV,{size:Q}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),s.jsxs(Ce,{gap:2,children:[M&&s.jsxs(De,{size:"xs",c:"dimmed","data-testid":"count-display",children:[I_(c,M).toLocaleString(),"-",hQ(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${(W=M.total)==null?void 0:W.toLocaleString()}`]}),s.jsx(_n,{variant:V,color:X,title:"Refresh",onClick:b,children:s.jsx(eF,{size:Q})})]})]}),s.jsxs(Oe,{className:Iu.table,children:[s.jsxs(Oe.Thead,{children:[s.jsxs(Oe.Tr,{children:[T&&s.jsx(Oe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:P=>j(P)})}),A.map(P=>s.jsx(Oe.Th,{children:s.jsxs(je,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(je.Target,{children:s.jsx(tr,{className:Iu.control,p:2,children:s.jsxs(Ce,{justify:"space-between",wrap:"nowrap",children:[s.jsx(De,{fw:500,children:Hs(P.name)}),s.jsx(er,{className:Iu.icon,children:s.jsx(wV,{size:14,stroke:1.5})})]})})}),s.jsx(QG,{search:c,searchParams:P.searchParams,onPrompt:(I,z)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:I,filterDialogFilter:z,dialogOpenTime:Date.now()})},onChange:I=>{R(I)}})]})},P.name))]}),!e.hideFilters&&s.jsxs(Oe.Tr,{children:[T&&s.jsx(Oe.Th,{}),A.map(P=>s.jsx(Oe.Th,{children:P.searchParams&&s.jsx(uQ,{resourceType:_,searchParams:P.searchParams,filters:c.filters})},P.name))]})]}),s.jsx(Oe.Tbody,{children:$==null?void 0:$.map(P=>P&&s.jsxs(Oe.Tr,{className:Iu.tr,"data-testid":"search-control-row",onClick:I=>D(I,P),onAuxClick:I=>D(I,P),children:[T&&s.jsx(Oe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${P.id}`,checked:!!f.selected[P.id],onChange:I=>S(I,P.id)})}),A.map(I=>s.jsx(Oe.Td,{children:LG(P,I)},I.name))]},P.id))})]}),!($!=null&&$.length)&&s.jsx(kd,{children:s.jsx(er,{style:{height:150},children:s.jsx(De,{size:"xl",c:"dimmed",children:"No results"})})}),M&&s.jsx(er,{m:"md",p:"md",children:s.jsx($a,{value:dQ(c),total:fQ(c,M),onChange:P=>R(PG(c,P)),getControlProps:P=>{switch(P){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(UG,{search:c,visible:m.current.fieldEditorVisible,onOk:P=>{R(P),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),s.jsx(FG,{search:c,visible:m.current.filterEditorVisible,onOk:P=>{R(P),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),s.jsx(xG,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),s.jsx(qG,{visible:m.current.filterDialogVisible,title:(Y=f.filterDialogSearchParam)!=null&&Y.code?Hs(f.filterDialogSearchParam.code):"",resourceType:_,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:P=>{R(rm(c,P.code,P.operator,P.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const cQ=Id;function uQ(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:[O_(n.operator)," ",s.jsx(GG,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function dQ(e){return Math.floor((e.offset??0)/(e.count??Qp))+1}function fQ(e,t){const n=e.count??Qp,r=L_(e,t);return Math.ceil(r/n)}function I_(e,t){return Math.min(L_(e,t),(e.offset??0)+1)}function hQ(e,t){var n;return Math.max(I_(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function L_(e,t){var r,a;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((a=t.link)!=null&&a.some(o=>o.relation==="next")?1:0)),n}function pQ(e){const t=Ae(),[n,r]=y.useState(!1),[a,o]=y.useState(),{query:c,fields:u}=e,[f,p]=y.useState(),[m,g]=y.useState({}),v=y.useRef(f);v.current=f;const b=y.useRef({});b.current=m,y.useEffect(()=>{o(void 0),t.graphql(c).then(p).catch(E=>o(Jt(E)))},[t,c]);function S(E,T){E.stopPropagation();const _=E.target.checked,M={...b.current};_?M[T]=!0:delete M[T],g(M)}function j(E){var L;E.stopPropagation();const A=E.target.checked,_={},M=(L=v.current)==null?void 0:L.data.ResourceList;A&&M&&M.forEach($=>{$.id&&(_[$.id]=!0)}),g(_)}function C(){var T;const E=(T=v.current)==null?void 0:T.data.ResourceList;if(!E||E.length===0)return!1;for(const A of E)if(A.id&&!b.current[A.id])return!1;return!0}function R(E,T){e_(E.target)||(hn(E),E.button!==1&&e.onClick&&e.onClick(new Gh(T,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new Gh(T,E)))}if(y.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(_r,{});const D=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:E=>hn(E),"data-testid":"search-control",children:[s.jsxs(Oe,{children:[s.jsx(Oe.Thead,{children:s.jsxs(Oe.Tr,{children:[D&&s.jsx(Oe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:E=>j(E)})}),u.map(E=>s.jsx(Oe.Th,{children:E.name},E.name))]})}),s.jsx(Oe.Tbody,{children:f==null?void 0:f.data.ResourceList.map(E=>E&&s.jsxs(Oe.Tr,{"data-testid":"search-control-row",onClick:T=>R(T,E),onAuxClick:T=>R(T,E),children:[D&&s.jsx(Oe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!m[E.id],onChange:T=>S(T,E.id)})}),u.map(T=>s.jsx(Oe.Td,{children:s.jsx(yG,{propertyType:T.propertyType,path:T.fhirPath,resource:E})},T.name))]},E.id))})]}),(f==null?void 0:f.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),a&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(a,void 0,2)})}),e.onBulk&&s.jsx(Pe,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const mQ=y.memo(pQ),gQ="_root_1fbwr_1",vQ="_entry_1fbwr_8",yQ="_key_1fbwr_13",xQ="_value_1fbwr_20",im={root:gQ,entry:vQ,key:yQ,value:xQ};function pt(e){return s.jsx(Yr,{children:s.jsx("div",{className:im.root,children:e.children})})}pt.Entry=function(t){return s.jsx("div",{className:im.entry,children:t.children})};pt.Key=function(t){return s.jsx("div",{className:im.key,children:t.children})};pt.Value=function(t){return s.jsx("div",{className:im.value,children:t.children})};function bQ(e){const{group:t}=e;return s.jsx(mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(Ce,{children:[t.measureScore&&s.jsx(jQ,{group:t}),!t.measureScore&&s.jsx(wQ,{group:t})]})})}function SQ(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(De,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(De,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function wQ(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(f=>Bo(f.code)==="numerator"),a=n==null?void 0:n.find(f=>Bo(f.code)==="denominator"),o=r==null?void 0:r.count,c=a==null?void 0:a.count;if(c===0)return s.jsxs(ce,{children:[s.jsx(Ie,{order:3,children:"Not Applicable"}),s.jsx(De,{children:`Denominator: ${c}`})]});if(o===void 0||c===void 0)return s.jsxs(ce,{children:[s.jsx(Ie,{order:3,children:"Insufficient Data"}),s.jsx(De,{children:`Numerator: ${o}`}),s.jsx(De,{children:`Denominator: ${c}`})]});const u=o/c*100;return s.jsx(Up,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:z_(u)}],label:s.jsx(Uo,{justify:"center",children:s.jsxs(De,{fw:700,fz:18,children:[o," / ",c]})})})}function jQ(e){var r,a,o;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((a=t.measureScore)==null?void 0:a.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Up,{size:120,thickness:12,roundCaps:!0,sections:[{value:CQ(t),color:z_(((o=t==null?void 0:t.measureScore)==null?void 0:o.value)??0)}],label:s.jsx(Uo,{justify:"center",children:s.jsx(De,{fw:700,fz:18,children:s.jsx(od,{value:t.measureScore})})})}):s.jsx(Uo,{h:120,align:"center",children:s.jsx(Ie,{order:3,children:s.jsx(od,{value:t.measureScore})})})})}function CQ(e){var r,a;const t=(r=e.measureScore)==null?void 0:r.value,n=(a=e.measureScore)==null?void 0:a.unit;return t?t<=1&&n==="%"?t*100:t:0}function z_(e){return e<=33?"red":e<=67?"yellow":"green"}function EQ(e){var r;const t=Yt(e.measureReport),[n]=mV("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(ce,{children:[n&&s.jsx(SQ,{measure:n}),s.jsx(P0,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((a,o)=>s.jsx(bQ,{group:a},a.id??o))})]}):null}const Qv="patient-export",Wv="Patient Export",TQ={everything:{operation:"$everything",extension:"json",contentType:dn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:dn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:dn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:dn.CDA_XML}};function RQ(e){const t=Ae(),{patient:n}=e,r=y.useCallback(async a=>{const o=zs(n),c=a.format,{operation:u,type:f,contentType:p,extension:m}=TQ[c],g=t.fhirUrl("Patient",o,u),v={};f&&(v.type=f),a.author&&(v.author={reference:a.author}),a.authoredOn&&(v.authoredOn=jb(a.authoredOn)),a.startDate&&(v.start=a.startDate),a.endDate&&(v.end=a.endDate),ca.show({id:Qv,title:Wv,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,v,void 0,{cache:"no-cache",headers:{Accept:p}}),S=`Patient-export-${o}-${new Date().toISOString().replaceAll(":","-")}.${m}`;DQ(b,S,p),ca.update({id:Qv,title:Wv,color:"green",message:"Done",icon:s.jsx(to,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){ca.update({id:Qv,title:Wv,color:"red",message:Ke(b),icon:s.jsx(Bs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return s.jsx(mt,{onSubmit:r,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Export Format",description:"Required",withAsterisk:!0,children:s.jsx(Bp,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),s.jsx(zt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:s.jsx(Nd,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),s.jsx(zt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:s.jsx(si,{name:"authoredOn",placeholder:"Authored on"})}),s.jsx(zt,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:s.jsx(si,{name:"startDate",placeholder:"Start date"})}),s.jsx(zt,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:s.jsx(si,{name:"endDate",placeholder:"End date"})}),s.jsx(Ce,{justify:"right",children:s.jsx(Or,{children:"Request Export"})})]})})}function DQ(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),a=new Blob([r],{type:n}),o=window.URL.createObjectURL(a),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=o,c.download=t,c.click(),window.URL.revokeObjectURL(o)}function AQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function $_(e){var n,r;const t=Yt(e.patient);return t?s.jsxs(pt,{children:[s.jsx(Yo,{value:t,size:"lg",color:AQ(t)}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Name"}),s.jsx(pt.Value,{children:s.jsx(bt,{to:t,fw:500,children:t.name?s.jsx(mb,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"DoB"}),s.jsx(pt.Value,{children:t.birthDate})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Age"}),s.jsx(pt.Value,{children:T$(t.birthDate)})]})]}),t.gender&&s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Gender"}),s.jsx(pt.Value,{children:t.gender})]}),t.address&&s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"State"}),s.jsx(pt.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(a=>s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:a==null?void 0:a.system}),s.jsx(pt.Value,{children:a==null?void 0:a.value})]},`${a==null?void 0:a.system}-${a==null?void 0:a.value}`))]}):null}function _Q(e){const{patient:t,...n}=e,r=y.useCallback((a,o,c)=>{const u=`${o}/${c}`,f=100;return Promise.allSettled([a.readHistory("Patient",c),a.search("Communication",{subject:u,_count:f}),a.search("Device",{patient:u,_count:f}),a.search("DeviceRequest",{patient:u,_count:f}),a.search("DiagnosticReport",{subject:u,_count:f}),a.search("Media",{subject:u,_count:f}),a.search("ServiceRequest",{subject:u,_count:f}),a.search("Task",{subject:u,_count:f})])},[]);return s.jsx(nm,{value:t,loadTimelineResources:r,createCommunication:(a,o,c)=>({resourceType:"Communication",status:"completed",subject:fn(a),sender:fn(o),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(a,o,c)=>({resourceType:"Media",status:"completed",subject:fn(a),operator:fn(o),issued:new Date().toISOString(),content:c}),...n})}const kQ="_section_pqpwm_1",PQ="_hovering_pqpwm_7",By={section:kQ,hovering:PQ};function NQ(e){const t=Ae(),n=Yt(e.value),[r,a]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[p,m]=y.useState();function g(){f(void 0)}function v(){c(void 0)}const b=y.useRef(p);if(b.current=p,y.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>a(!0)).catch(console.log)},[t]),y.useEffect(()=>(m(zQ(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]),!r||!p)return null;function S(j,C){m({...b.current,[j]:C})}return s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[s.jsx(ze,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>S("title",j.currentTarget.value)}),s.jsx(OQ,{actions:p.action||[],selectedKey:o,setSelectedKey:c,hoverKey:u,setHoverKey:f,onChange:j=>S("action",j)}),s.jsx(Or,{children:"Save"})]})})}function OQ(e){const t=y.useRef(e.actions);t.current=e.actions;function n(o){e.onChange(t.current.map(c=>c.id===o.id?o:c))}function r(o){e.onChange([...t.current,o]),e.setSelectedKey(o.id)}function a(o){e.onChange(t.current.filter(c=>c!==o))}return s.jsxs(We,{gap:"md",className:By.section,children:[e.actions.map(o=>s.jsx(MQ,{action:o,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>a(o)},o.id)),s.jsx("div",{children:s.jsx(Pe,{variant:"outline",onClick:o=>{hn(o),r({id:U_()})},children:"Add action"})})]})}function MQ(e){const{action:t}=e,n=LQ(t);function r(o){o.stopPropagation(),e.setSelectedKey(e.action.id)}function a(o){hn(o),e.setHoverKey(e.action.id)}return s.jsx("div",{onClick:r,onMouseOver:a,onFocus:a,children:s.jsx(IQ,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function IQ(e){const{action:t}=e,[n,r]=y.useState(e.actionType),a=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const u=$t(By.section,{[By.hovering]:o&&!a});return s.jsxs(mr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[s.jsxs(Uo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[s.jsx(ze,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),s.jsx(qo,{"data-testid":"close-button",onClick:e.onRemove})]}),a&&s.jsxs(We,{gap:"xl",p:"md",children:[s.jsx(ce,{children:s.jsx(ze,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),s.jsx(ce,{children:s.jsx(ln,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&s.jsxs(We,{gap:0,children:[s.jsxs(Ce,{gap:0,mb:"xs",children:[s.jsx(De,{fw:600,children:"Select questionnaire"}),s.jsx(De,{c:"red",children:"*"})]}),s.jsxs(De,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),s.jsx(eT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&s.jsxs(We,{gap:0,children:[s.jsxs(Ce,{gap:0,mb:"xs",children:[s.jsx(De,{fw:600,children:"Select activity definition"}),s.jsx(De,{c:"red",children:"*"})]}),s.jsxs(De,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",s.jsx(Pt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),s.jsx(eT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function eT(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(tl,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:a=>{a?e.onChange({...e.action,definitionCanonical:Lt(a)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function LQ(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let Yv=1;function U_(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Yv=Math.max(Yv,t+1))}return e}return"id-"+Yv++}function zQ(e){return{...e,action:B_(e.action)}}function B_(e){if(e)return e.map(t=>({...t,id:U_(t.id),action:B_(t.action)}))}const At={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"};function $Q(e){return e.type==="choice"||e.type==="open-choice"}function UQ(e,t){var a;const n=eo(e,Ed+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const o=(a=n.valueExpression)==null?void 0:a.expression;if(o){const c=ha(t),u=Us(o,[c],{"%resource":c});return ti(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const o of e.enableWhen){const c=F_(t==null?void 0:t.item,o.question);if(o.operator==="exists"&&!o.answerBoolean&&!(c!=null&&c.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:f}=HQ(o,c,r);if(r==="any"&&u)return!0;if(r==="all"&&!f)return!1}return r!=="any"}function Ob(e,t){return e.map(n=>{if(n.item)return{...n,item:Ob(n.item,t)};try{const r=VQ(n,t);if(!r)return null;const a=BQ(n,r);return a?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[a]}:null}catch(r){return{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[],extension:[{url:`${Ed}/fhir/StructureDefinition/questionnaire-validationError`,valueString:`Expression evaluation failed: ${Ke(r)}`}]}}}).filter(n=>n!==null)}function BQ(e,t){if(e.type)switch(e.type){case At.boolean:return t.type===oe.boolean?{valueBoolean:t.value}:void 0;case At.date:return t.type===oe.date?{valueDate:t.value}:void 0;case At.dateTime:return t.type===oe.dateTime?{valueDateTime:t.value}:void 0;case At.time:return t.type===oe.time?{valueTime:t.value}:void 0;case At.url:return t.type===oe.url?{valueString:t.value}:void 0;case At.text:return t.type===oe.string?{valueString:t.value}:void 0;case At.attachment:return t.type===oe.Attachment?{valueAttachment:t.value}:void 0;case At.reference:return t.type===oe.Reference?{valueReference:t.value}:void 0;case At.quantity:return{valueQuantity:t.value};case At.decimal:return{valueDecimal:t.value};case At.integer:return{valueInteger:t.value};case At.string:return{valueString:t.value};default:return}}function VQ(e,t){var r;if(!t)return;const n=eo(e,Ed+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const a=(r=n.valueExpression)==null?void 0:r.expression;if(a){const o=ha(t),c=Us(a,[o],{"%resource":o});return c.length!==0?c[0]:void 0}}}function Mb(e,t){return e.map(n=>{const r=t.find(a=>a.linkId===n.linkId);return r?{...n,item:r.item?Mb(n.item||[],r.item):n.item,answer:r.answer||n.answer,extension:r.extension||n.extension}:n})}function V_(e,t,n){var a;const r=[];for(const o of e){const c=(a=n.answerOption)==null?void 0:a.find(u=>vc(di(u))===o);if(c){const u=di(c);u&&r.push({[t]:u.value})}}return r}function F_(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=F_(n.item,t);if(r)return r}}}function FQ(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:a}]=Us(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return a}else return!1}function HQ(e,t,n){const r=t||[],a=KQ(e);let o=!1,c=!0;for(const u of r){const f=XQ(u),{operator:p}=e;if(FQ(f,a,p)?o=!0:c=!1,n==="any"&&o)break}return{anyMatch:o,allMatch:c}}function H_(e){var n,r;const t=eo(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(a=>a.code)}}function Kv(e,t){var a;const n=Qr(e);let r=eo(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(a=n.extension)==null?void 0:a.filter(o=>o!==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(o=>({code:o}))},delete r.valueCode),n)}function qQ(e,t,n){const r=eo(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let a=r.valueString;t!=null&&t.reference&&(a=a.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(a=a.replaceAll("$encounter",n.reference));const o={},c=a.split("&");for(const u of c){const[f,p]=ky(u,"=",2);o[f]=p}return o}function tT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Lt(e),item:q_(e.item,t==null?void 0:t.item),status:"in-progress"}}function q_(e,t){return(e==null?void 0:e.map(n=>G_(n,t)))??[]}function G_(e,t){var r;const n=t==null?void 0:t.find(a=>a.linkId===e.linkId);return{id:n?n.id:QQ(),linkId:e.linkId,text:e.text,item:q_(e.item,n==null?void 0:n.item),answer:n?n.answer:((r=e.initial)==null?void 0:r.map(WQ))??[]}}let GQ=1;function QQ(){return"id-"+GQ++}function WQ(e){return{...e}}function YQ(e){var n,r,a,o;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const c=eo(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((o=(a=(r=c==null?void 0:c.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:a[0])==null?void 0:o.code)==="page")return e.item.length}return 1}function Ib(e){return Td({value:e},"value")}function di(e){return Td({value:e},"value")}function KQ(e){return Td({value:e},"answer")}function XQ(e){return Td({value:e},"value")}const Q_=y.createContext({}),Ns=30,Qh=50;function Vy(e){const t=y.useContext(Q_),n=e.item,r=e.response;function a(g){var b,S,j,C;let v;Array.isArray(g)?v=g:e.index>=(((S=(b=e.response)==null?void 0:b.answer)==null?void 0:S.length)??0)?v=(((j=e.response)==null?void 0:j.answer)??[]).concat([g]):v=(((C=e.response)==null?void 0:C.answer)??[]).map((D,E)=>E===e.index?g:D)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:v})}const o=n.type;if(!o)return null;const c=n.linkId;if(!c)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,f=zb(r,e.index)??Ib(u),p=eo(r,`${Ed}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(o){case At.display:m=s.jsx("p",{children:e.item.text},e.item.linkId);break;case At.boolean:m=s.jsx(b_,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Hn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:f==null?void 0:f.value,onChange:g=>a({valueBoolean:g.currentTarget.checked})})},e.item.linkId);break;case At.decimal:m=s.jsx(ze,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDecimal:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber})});break;case At.integer:m=s.jsx(ze,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueInteger:g.currentTarget.value===""?void 0:g.currentTarget.valueAsNumber})});break;case At.date:m=s.jsx(ze,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDate:g.currentTarget.value})});break;case At.dateTime:m=s.jsx(si,{name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueDateTime:g})});break;case At.time:m=s.jsx(ze,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueTime:g.currentTarget.value})});break;case At.string:case At.url:m=s.jsx(ze,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;a({valueString:v===""?void 0:v})}});break;case At.text:m=s.jsx(Ks,{id:c,name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>{const v=g.currentTarget.value;a({valueString:v===""?void 0:v})}});break;case At.attachment:m=s.jsx(Ce,{py:4,children:s.jsx(a_,{path:"",name:c,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueAttachment:g})})});break;case At.reference:m=s.jsx(Nd,{name:c,required:e.required??n.required,targetTypes:H_(n),searchCriteria:qQ(n,t.subject,t.encounter),defaultValue:f==null?void 0:f.value,onChange:g=>a({valueReference:g})});break;case At.quantity:m=s.jsx(Vs,{path:"",name:c,required:e.required??n.required,defaultValue:f==null?void 0:f.value,onChange:g=>a({valueQuantity:g}),disableWheel:!0});break;case At.choice:case At.openChoice:aW(n)?m=s.jsx(tW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)}):rW(n)||n.answerValueSet&&!iW(n)?m=s.jsx(ZQ,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)}):m=s.jsx(eW,{name:c,item:n,initial:u,response:r,onChangeAnswer:g=>a(g)});break;default:return null}return s.jsxs(s.Fragment,{children:[m,(p==null?void 0:p.valueString)&&s.jsx(De,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function ZQ(e){var m;const{name:t,item:n,initial:r,onChangeAnswer:a,response:o}=e;if(!((m=n.answerOption)!=null&&m.length)&&!n.answerValueSet)return s.jsx(Lb,{});const c=Ib(r),u=zb(o)??c,f=K_(o),p=n.repeats||oW(n);if(n.answerValueSet)return s.jsx(Jp,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:p?void 0:1,onChange:g=>{p?g.length===0?a({}):a(g.map(v=>({valueCoding:v}))):a({valueCoding:g[0]})},defaultValue:u==null?void 0:u.value});if(p){const{propertyName:g,data:v}=sW(n);return s.jsx(Pp,{data:v,placeholder:"Select items",searchable:!0,defaultValue:f||[vc(c)],onChange:b=>{if(b.length===0)a({});else{const S=V_(b,g,n);a(S)}}})}else{const g=[""];if(n.answerOption)for(const v of n.answerOption){const b=di(v);g.push(vc(b))}return s.jsx(ln,{id:t,name:t,onChange:v=>{const b=v.currentTarget.selectedIndex;if(b===0){a({});return}const S=n.answerOption[b-1],j=di(S),C="value"+$n(j.type);a({[C]:j.value})},defaultValue:Rd(u==null?void 0:u.value)||(u==null?void 0:u.value),data:g})}}function JQ(e,t){return e?t.valueSetExpand({url:e,count:Ns+1}).then(n=>{var r;return((r=n.expansion)==null?void 0:r.contains)??[]}):Promise.resolve([])}function W_(e){const t=Ae(),[n,r]=y.useState([]),[a,o]=y.useState(!1);return y.useEffect(()=>{async function c(){if(e){o(!0);try{const u=await JQ(e,t);r(u)}catch(u){console.error("Error loading value set:",u)}finally{o(!1)}}}c().catch(console.error)},[e,t]),[n,a]}function Y_(e,t){return e.map((n,r)=>{const a=`${t}-valueset-${r}`,o={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[a,o]})}function eW(e){const{name:t,item:n,initial:r,onChangeAnswer:a,response:o}=e,c=Qo("QuestionnaireItemAnswerOption","value[x]"),u=Ib(r),[f,p]=W_(n.answerValueSet),m=[];let g;if(n.answerValueSet)m.push(...Y_(f,t));else if(n.answerOption){const j=n.answerOption.slice(0,Qh).map((C,R)=>{const D=`${t}-option-${R}`,E=di(C);return E!=null&&E.value?(u&&Ia(E)===Ia(u)&&(g=D),[D,E]):null}).filter(C=>C!==null);m.push(...j)}const v=zb(o),b=nW(m,v);if(p)return s.jsx(De,{children:"Loading options..."});if(m.length===0)return s.jsx(Lb,{});const S=m.slice(0,Ns);return s.jsxs(s.Fragment,{children:[s.jsx(Ls.Group,{name:t,value:b??g,onChange:j=>{const C=m.find(R=>R[0]===j);if(C){const R=C[1],D="value"+$n(R.type);a({[D]:R.value})}},children:S.map(([j,C])=>s.jsx(Ls,{id:j,value:j,py:4,label:s.jsx(La,{property:c,propertyType:C.type,value:C.value})},j))}),(n.answerValueSet&&m.length>Ns||n.answerOption&&m.length>Qh)&&s.jsxs(De,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Ns," options"]})]})}function tW(e){var S;const{name:t,item:n,onChangeAnswer:r,response:a}=e,o=Qo("QuestionnaireItemAnswerOption","value[x]"),[c,u]=W_(n.answerValueSet),f=n.answerValueSet?(((S=a.answer)==null?void 0:S.map(j=>j.valueCoding))||[]).filter(j=>j!==void 0):K_(a),[p,m]=y.useState(f),g=[];if(n.answerValueSet)g.push(...Y_(c,t));else if(n.answerOption){const j=n.answerOption.slice(0,Qh).map((C,R)=>{const D=`${t}-option-${R}`,E=di(C);return E!=null&&E.value?[D,E]:null}).filter(C=>C!==null);g.push(...j)}if(u)return s.jsx(De,{children:"Loading options..."});if(g.length===0)return s.jsx(Lb,{});const v=g.slice(0,Ns),b=(j,C)=>{if(n.answerValueSet){const R=p;let D;C?D=[...R,j.value]:D=R.filter(E=>!ci(E,j.value)),m(D),D.length===0?r({}):r(D.map(E=>({valueCoding:E})))}else{const R=p,D=vc(j);let E;if(C?E=[...R,D]:E=R.filter(T=>T!==D),m(E),E.length===0)r({});else{const T=V_(E,"value"+$n(j.type),n);r(T)}}};return s.jsxs(Ce,{style:{flexDirection:"column",alignItems:"flex-start"},children:[v.map(([j,C])=>{const R=vc(C),D=n.answerValueSet?p.some(E=>ci(E,C.value)):p.includes(R);return s.jsx(Hn,{id:j,label:s.jsx(La,{property:o,propertyType:C.type,value:C.value}),checked:D,onChange:E=>b(C,E.currentTarget.checked)},j)}),(n.answerValueSet&&g.length>Ns||n.answerOption&&g.length>Qh)&&s.jsxs(De,{size:"sm",c:"dimmed",children:["Showing first ",Ns," options"]})]})}function Lb(){return s.jsx(ze,{disabled:!0,placeholder:"No Answers Defined"})}function zb(e,t=0){const n=e.answer;return di((n==null?void 0:n[t])??{})}function K_(e){const t=e.answer;return t?t.map(r=>di(r)).map(r=>Rd(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function nW(e,t){var n;return(n=e.find(r=>ci(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function om(e,t){var n;return!!((n=e.extension)!=null&&n.some(r=>{var a,o,c;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((c=(o=(a=r.valueCodeableConcept)==null?void 0:a.coding)==null?void 0:o[0])==null?void 0:c.code)===t}))}function rW(e){return om(e,"drop-down")}function aW(e){return om(e,"check-box")}function iW(e){return om(e,"radio-button")}function oW(e){return om(e,"multi-select")}function sW(e){var o;if(((o=e.answerOption)==null?void 0:o.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=di(t),r="value"+$n(n.type),a=(e.answerOption??[]).map(c=>{const u=di(c),f=vc(u);return{value:f,label:f}});return{propertyName:r,data:a}}const lW="_section_my8o4_1",cW="_hovering_my8o4_10",uW="_editing_my8o4_14",dW="_questionBody_my8o4_20",fW="_topActions_my8o4_24",hW="_bottomActions_my8o4_33",pW="_movementActions_my8o4_44",mW="_movementIcons_my8o4_56",gW="_columnAlignment_my8o4_60",vW="_linkIdInput_my8o4_65",yW="_typeSelect_my8o4_70",xW="_preserveBreaks_my8o4_74",Fr={section:lW,hovering:cW,editing:uW,questionBody:dW,topActions:fW,bottomActions:hW,movementActions:pW,movementIcons:mW,columnAlignment:gW,linkIdInput:vW,typeSelect:yW,preserveBreaks:xW};function bW(e){const t=Ae(),n=Yt(e.questionnaire),[r,a]=y.useState(!1),[o,c]=y.useState(),[u,f]=y.useState(),[p,m]=y.useState();function g(){m(void 0)}function v(){f(void 0)}y.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>a(!0)).catch(console.log)},[t]),y.useEffect(()=>(c(CW(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",v)}),[n]);const b=(S,j)=>{c(S),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(S)};return!r||!o?null:s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(o),children:[s.jsx(X_,{item:o,selectedKey:u,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),s.jsx(Or,{children:"Save"})]})})}function X_(e){var E;const t=e.item,n=e.item,r=pi(e.item),a=r||n.type===At.group,o=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,f=y.useRef(e.item);f.current=e.item;function p(T){hn(T),e.setSelectedKey(e.item.id)}function m(T){hn(T),e.setHoverKey(e.item.id)}function g(T){var _;const A=f.current;e.onChange({...A,item:(_=A.item)==null?void 0:_.map(M=>M.id===T.id?T:M)})}function v(T,A){e.onChange({...e.item,item:[...e.item.item??[],T]},A)}function b(T){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.filter(_=>_!==T)})}function S(T,A){e.onChange({...f.current,[T]:A})}function j(T){e.onChange({...e.item,...T})}function C(T){var A;e.onChange({...e.item,item:(A=e.item.item)==null?void 0:A.map(_=>_===T?{..._,repeats:!_.repeats}:_)})}function R(T,A){const _=RW(e.item.item,T,A);e.onChange({...e.item,item:_})}const D=$t(Fr.section,{[Fr.editing]:c,[Fr.hovering]:u&&!c});return s.jsxs("div",{"data-testid":n.linkId,className:D,onClick:p,onMouseOver:m,onFocus:m,children:[s.jsx("div",{className:Fr.questionBody,children:c?s.jsxs(s.Fragment,{children:[r&&s.jsx(ze,{size:"xl",defaultValue:t.title,onBlur:T=>S("title",T.currentTarget.value)}),!r&&s.jsx(Ks,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>S("text",T.currentTarget.value)}),n.type==="reference"&&s.jsx(jW,{item:n,onChange:j}),$Q(n)&&s.jsx(SW,{item:n,onChange:T=>j(T)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(Ie,{children:t.title}),n.text&&s.jsx("div",{className:Fr.preserveBreaks,children:n.text}),!a&&s.jsx(Vy,{item:n,index:0,required:!1,onChange:()=>{},response:{linkId:n.linkId}})]})}),(E=n.item)==null?void 0:E.map((T,A)=>s.jsx("div",{children:s.jsx(X_,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:A===0,isLast:A===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>R(A,-1),onMoveDown:()=>R(A,1)})},T.id)),!a&&s.jsx("div",{className:Fr.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(ze,{size:"xs",className:Fr.linkIdInput,defaultValue:n.linkId,onBlur:T=>S("linkId",T.currentTarget.value)}),!a&&s.jsx(ln,{size:"xs",className:Fr.typeSelect,defaultValue:n.type,onChange:T=>S("type",T.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:o})}),!r&&s.jsx(ce,{className:Fr.movementActions,children:s.jsxs(ce,{className:Fr.columnAlignment,children:[!e.isFirst&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(CV,{"data-testid":"up-button",size:15,className:Fr.movementIcons})}),!e.isLast&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(jV,{"data-testid":"down-button",size:15,className:Fr.movementIcons})})]})}),s.jsxs("div",{className:Fr.bottomActions,children:[a&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v({id:qs(),linkId:qy("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v({id:qs(),linkId:qy("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),v(TW(),!0)},children:"Add Page"}),c&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Pt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function SW(e){const t=Qo("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(ze,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(wW,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(ce,{display:"flex",children:[s.jsx(Pt,{href:"#",onClick:r=>{hn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:qs()}]})},children:"Add choice"}),s.jsx(Vp,{w:"lg"}),s.jsx(Pt,{href:"#",onClick:r=>{hn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function wW(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=em({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(Od,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(a,o)=>{const c=[...e.options],u=c.findIndex(f=>f.id===t.id);c[u]={id:t.id,[o]:a},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Pt,{href:"#",onClick:a=>{hn(a),e.onChange({...e.item,answerOption:e.options.filter(o=>o.id!==t.id)})},children:"Remove"})})]},t.id)})})}function jW(e){const t=H_(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(Ce,{children:[s.jsx(yb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:a=>{e.onChange(Kv(e.item,t.map(o=>o===n?a:o)))}}),s.jsx(Pt,{href:"#",onClick:a=>{hn(a),e.onChange(Kv(e.item,t.filter(o=>o!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Pt,{href:"#",onClick:n=>{hn(n),e.onChange(Kv(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Fy=1,Hy=1;function qy(e){return e+Fy++}function qs(){return"id-"+Hy++}function CW(e){return{...e,id:e.id||qs(),item:Z_(e.item)}}function Z_(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(Hy=Math.max(Hy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Fy=Math.max(Fy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||qs(),item:Z_(t.item),answerOption:EW(t.answerOption)}))}function EW(e){if(e)return e.map(t=>({...t,id:t.id||qs()}))}function TW(){return{id:qs(),linkId:qy("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 RW(e,t,n){const r=e??[],a=t+n;if(a<0||a>=r.length)return r;const o=[...r];return[o[t],o[a]]=[o[a],o[t]],o}function J_(e){const{item:t,response:n,onChange:r}=e,[a,o]=y.useState(DW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===At.display)return s.jsx("p",{children:t.text},t.linkId);const c=(t==null?void 0:t.repeats)&&t.type!==At.choice&&t.type!==At.openChoice;return t.type===At.boolean?s.jsx(Vy,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):s.jsxs(zt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(a)].map((u,f)=>s.jsx(Vy,{item:t,response:n,onChange:p=>r([p]),index:f},`${t.linkId}-${f}`)),c&&s.jsx(Pt,{onClick:()=>o(u=>u+1),children:"Add Item"})]},e.item.linkId)}function DW(e,t){if(e.type===At.choice||e.type===At.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function ek(e){const[t,n]=y.useState(e.response);if(y.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(o,c){const u=t.map((f,p)=>p===c?o[0]:f);n(u),e.onChange(u)}function a(){const o=G_(e.item,void 0);n([...t,o])}return s.jsxs(s.Fragment,{children:[t.map((o,c)=>s.jsx(tk,{item:e.item,response:o,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,c)},o.id)),e.item.repeats&&s.jsx(Pt,{onClick:a,children:`Add Group: ${e.item.text}`})]})}function tk(e){var o;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function a(c){var m;const u=(m=t.item)==null?void 0:m.map(g=>c.find(b=>b.id===g.id)??g),f=u==null?void 0:u.concat(c.slice(1)),p={...t,item:f};r([p])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(Ie,{order:3,mb:"md",children:e.item.text}),s.jsx(We,{children:(o=e.item.item)==null?void 0:o.map(c=>{var u,f,p;return c.type===At.group?c.repeats?s.jsx(ek,{item:c,response:((u=t.item)==null?void 0:u.filter(m=>m.linkId===c.linkId))??[],checkForQuestionEnabled:n,onChange:a},c.linkId):s.jsx(tk,{item:c,checkForQuestionEnabled:n,response:((f=t.item)==null?void 0:f.find(m=>m.linkId===c.linkId))??{linkId:c.linkId},onChange:a},c.linkId):s.jsx(J_,{item:c,response:(p=t.item)==null?void 0:p.find(m=>m.linkId===c.linkId),onChange:a,checkForQuestionEnabled:n},c.linkId)})})]},e.item.linkId):null}function AW(e){const{items:t,response:n,activePage:r,onChange:a,nextStep:o,prevStep:c,numberOfPages:u,renderPages:f,submitButtonText:p,excludeButtons:m,checkForQuestionEnabled:g}=e,v=t.map(b=>{var C;const S=((C=n==null?void 0:n.item)==null?void 0:C.filter(R=>R.linkId===b.linkId))??[],j=b.type===At.group?s.jsx(ek,{item:b,response:S,onChange:a,checkForQuestionEnabled:g},b.linkId):s.jsx(J_,{item:b,response:S==null?void 0:S[0],onChange:a,checkForQuestionEnabled:g},b.linkId);return f?s.jsx(mc.Step,{label:b.text,children:j},b.linkId):j});return s.jsxs(s.Fragment,{children:[f&&s.jsx(mc,{active:r??0,allowNextStepsSelect:!1,p:6,children:v}),!f&&s.jsx(We,{children:v}),!m&&s.jsx(_W,{activePage:r??0,numberOfPages:u,nextStep:f?o:void 0,prevStep:f?c:void 0,renderPages:f,submitButtonText:p})]})}function _W(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(Ce,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(Pe,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(Pe,{onClick:a=>{const o=a.currentTarget.closest("form");e.nextStep&&o.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(Or,{children:e.submitButtonText??"Submit"})]})}function nk(e){const t=Ae(),{subject:n,source:r}=e,a=Yt(e.questionnaire),o=fV(a),c=Yt(e.questionnaireResponse),[u,f]=y.useState(c),[p,m]=y.useState(0),g=y.useRef(e.onChange);g.current=e.onChange;const v=y.useRef(e.onSubmit);v.current=e.onSubmit,y.useEffect(()=>{if(c!=null&&c.item&&a){const E=tT(a,c),T=ak(E,a);f(T)}else{if(a&&nT(o)===nT(a))return;f(a?tT(a):void 0)}},[c,a,o]),y.useEffect(()=>{if(u&&g.current)try{g.current(u)}catch(E){console.error("Error invoking QuestionnaireForm.onChange callback",E)}},[u]);const b=y.useCallback(E=>{f(T=>PW(T,E,a))},[a]),S=y.useCallback(()=>{const E=v.current;if(E&&a&&u){let T=r;if(!T){const A=t.getProfile();A&&(T=fn(A))}E({...u,questionnaire:a.url??Lt(a),subject:n,source:T,authored:new Date().toISOString(),status:"completed"})}},[t,a,u,n,r]);function j(E){return UQ(E,u)}if(!a||!u)return null;const C=YQ(a),R=()=>m(E=>E+1),D=()=>m(E=>E-1);return s.jsx(Q_.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:S,children:[a.title&&s.jsx(Ie,{children:a.title}),s.jsx(AW,{items:a.item??[],response:u,onChange:b,renderPages:!e.disablePagination&&C>1,activePage:p,numberOfPages:C,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:j,nextStep:R,prevStep:D})]})})}function kW(e,t){const n=rk(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 rk(e,t){const n=[],r=new Set;for(const a of e){const o=a.id,c=t.find(u=>u.id===o);c?(n.push(kW(a,c)),r.add(c.id)):n.push(a)}for(const a of t)r.has(a.id)||n.push(a);return n}function nT(e){return(e==null?void 0:e.id)||e}function PW(e,t,n){if(!t)return{resourceType:"QuestionnaireResponse",status:"in-progress"};const r=(e==null?void 0:e.item)??[],a=rk(r,Array.isArray(t)?t:[t]),o={resourceType:"QuestionnaireResponse",status:"in-progress",item:a},c=Ob((n==null?void 0:n.item)??[],o);return o.item=Mb(a,c),ak(o,n)}function ak(e,t){const n=Ob((t==null?void 0:t.item)??[],e);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:Mb(e.item??[],n)}}const NW="_section_4m5it_1",OW={section:NW},MW=["gender","age","gestationalAge","context","appliesTo","category"],IW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function LW(e){e=Object.assign(IW,e);const t=e.definition,[n,r]=y.useState([]),[a,o]=y.useState(1),[c,u]=y.useState(1);return y.useEffect(()=>{const S=UW(t,u);r(BW(S.qualifiedInterval||[],o))},[t]),s.jsxs(mt,{testid:"reference-range-editor",onSubmit:f,children:[s.jsx(We,{children:n.map(S=>{var j;return s.jsx(zW,{unit:FW((j=t.quantitativeDetails)==null?void 0:j.unit),onChange:g,onAdd:v,onRemove:b,onRemoveGroup:m,intervalGroup:S},`group-${S.id}`)})}),s.jsx(_n,{title:"Add Group",variant:"subtle",size:"sm",onClick:S=>{hn(S),p({id:`group-id-${a}`,filters:{},intervals:[]}),o(j=>j+1)},children:s.jsx(Hh,{})}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Or,{children:"Save"})})]});function f(){const S=n.flatMap(j=>j.intervals).filter(j=>!HW(j));e.onSubmit({...t,qualifiedInterval:S})}function p(S){r(j=>[...j,S])}function m(S){r(j=>j.filter(C=>C.id!==S.id))}function g(S,j){r(C=>{C=[...C];const R=C.find(E=>E.id===S),D=R==null?void 0:R.intervals.findIndex(E=>E.id===j.id);return D!==void 0&&(R!=null&&R.intervals[D])&&(R.intervals[D]=j),C})}function v(S,j){j.id===void 0&&(j.id=`id-${c}`,u(C=>C+1)),r(C=>{C=[...C];const R=C.findIndex(D=>D.id===S);if(R!==-1){const D={...C[R]};j={...j,...D.filters},D.intervals=[...D.intervals,j],C[R]=D}return C})}function b(S,j){r(C=>{C=[...C];const R=C.find(D=>D.id===S);return R&&(R.intervals=R.intervals.filter(D=>D.id!==j.id)),C})}}function zW(e){const{intervalGroup:t,unit:n}=e;return s.jsx(kd,{"data-testid":t.id,className:OW.section,children:s.jsxs(We,{gap:"lg",children:[s.jsx(Ce,{justify:"flex-end",children:s.jsx(_n,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{hn(r),e.onRemoveGroup(t)},children:s.jsx(Fh,{})},`remove-group-button-${t.id}`)}),s.jsx($W,{intervalGroup:t,onChange:e.onChange}),s.jsx(jn,{}),t.intervals.map(r=>s.jsxs(We,{gap:"xs",children:[s.jsxs(Ce,{children:[s.jsx(ze,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:a=>{hn(a),e.onChange(t.id,{...r,condition:a.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(_n,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:a=>{hn(a),e.onRemove(t.id,r)},children:s.jsx(Fh,{})},`remove-interval-${r.id}`)]}),s.jsx(Cb,{path:"",onChange:a=>{e.onChange(t.id,{...r,range:a})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(_n,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{hn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Hh,{})})]})})}function $W(e){var r,a;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const o of["low","high"])(r=t.filters.age[o])!=null&&r.unit||(t.filters.age[o]={...t.filters.age[o],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(We,{style:{maxWidth:"50%"},children:[s.jsx(Ce,{children:s.jsx(ln,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""&&(u=void 0),n(t.id,{...c,gender:u})}}})}),s.jsxs(Ce,{gap:"xs",children:[s.jsx(De,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Cb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:o=>{for(const c of t.intervals)n(t.id,{...c,age:o})}},`age-${t.id}`)})]}),s.jsx(ln,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((a=t.filters.context)==null?void 0:a.text)||"",onChange:o=>{for(const c of t.intervals){let u=o.currentTarget.value;u===""?(u=void 0,n(t.id,{...c,context:void 0})):n(t.id,{...c,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ln,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:o=>{for(const c of t.intervals){const u=o.currentTarget.value;u===""?n(t.id,{...c,category:void 0}):n(t.id,{...c,category:u})}}})]})}function UW(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(a=>{var c;const o=parseInt(((c=a.id)==null?void 0:c.substring(3))||"",10);return isNaN(o)?Number.NEGATIVE_INFINITY:o}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(a=>({...a,id:a.id||`id-${r++}`}))},t(r),e}function BW(e,t){let n=1;const r={};for(const a of e){const o=VW(a);o in r||(r[o]={id:`group-id-${n++}`,filters:Object.fromEntries(MW.map(c=>[c,a[c]])),intervals:[]}),r[o].intervals.push(a)}return t(n),Object.values(r)}function VW(e){var n,r;return[`gender=${e.gender}`,`age=${ad(e.age)}`,`gestationalAge=${ad(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(a=>a.text).join("+")}`,`category=${e.category}`].join(":")}function FW(e){return e&&(L$(e,"http://unitsofmeasure.org")||e.text)}function HW(e){var t,n,r,a;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((a=(r=e.range)==null?void 0:r.high)==null?void 0:a.value)===void 0}function qW(e){var p;const t=Ae(),n=Yt(e.value),[r,a]=y.useState(!1),[o,c]=y.useState();if(y.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(c).catch(console.log),a(!0))},[t,n,r]),!n||!o)return null;return s.jsx(or,{children:(p=n.action)==null?void 0:p.map((m,g)=>{var j,C,R,D,E,T;const v=m.resource&&f(m.resource),b=(C=(j=v==null?void 0:v.input)==null?void 0:j[0])==null?void 0:C.valueReference,S=(D=(R=v==null?void 0:v.output)==null?void 0:R[0])==null?void 0:D.valueReference;return s.jsxs(y.Fragment,{children:[s.jsx(or.Col,{span:1,p:"md",children:(v==null?void 0:v.status)==="completed"?s.jsx(NV,{}):s.jsx(iF,{color:"gray"})}),s.jsxs(or.Col,{span:9,p:"xs",children:[s.jsx(De,{fw:500,children:m.title}),m.description&&s.jsx("div",{children:m.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Ic,{value:(E=v==null?void 0:v.meta)==null?void 0:E.author})," on ",gr((T=v==null?void 0:v.meta)==null?void 0:T.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(Db,{status:(v==null?void 0:v.status)||"unknown"})]})]}),s.jsxs(or.Col,{span:2,p:"md",children:[b&&!S&&s.jsx(Pe,{onClick:()=>e.onStart(v,b),children:"Start"}),b&&S&&s.jsx(Pe,{onClick:()=>e.onEdit(v,b,S),children:"Edit"})]})]},`action-${g}`)})});function u(m){var v;const g=[];if(m.action)for(const b of m.action)(v=b.resource)!=null&&v.reference&&g.push({request:{method:"GET",url:b.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:g}}function f(m){for(const g of(o==null?void 0:o.entry)??[])if(g.resource&&m.reference===Lt(g.resource))return g.resource}}function ik(e,t){const n=GW(e,t);return QW(n,e,t)}function GW(e,t){const n=e.length,r=t.length,a=n+r+1,o=1+2*a,c=o/2|0,u=new Array(o);u[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<a;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,v=m-1,b=u[g],S=u[v];let j,C=0;p===-f||p!==f&&S.i<b.i?(C=b.i,j=b):(C=S.i+1,j=S),u[v]=void 0;let R=C-p,D={i:C,j:R,prev:WW(j),snake:!1};for(;C<n&&R<r&&e[C]===t[R];)C++,R++;if(C>D.i&&(D={i:C,j:R,prev:D,snake:!0}),u[m]=D,C>=n&&R>=r)return u[m]}u[c+f-1]=void 0}}function QW(e,t,n){const r=[];let a=e;for(a.snake&&(a=a.prev);a!=null&&a.prev&&a.prev.j>=0;){const o=a.i,c=a.j;a=a.prev;const u=a.i,f=a.j,p={position:u,lines:t.slice(u,o)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),a.snake&&(a=a.prev)}return r}function WW(e){return e&&!e.snake&&e.prev?e.prev:e}function YW(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var a;return{meta:(a=r.resource)==null?void 0:a.meta,lines:Ia(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,a)=>r.meta.lastUpdated.localeCompare(a.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return KW(n,t),XW(n),n}function KW(e,t){for(let n=1;n<t.length;n++){const r=ik(t[n-1].lines,t[n].lines);for(const a of r){const o=a.original.position,c=a.original.lines,u=a.revised.lines;if((a.type==="delete"||a.type==="change")&&e.splice(o,c.length),a.type==="insert"||a.type==="change")for(let f=0;f<a.revised.lines.length;f++)e.splice(o+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[f],span:1})}}}function XW(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 ZW="_container_1oj0p_1",JW="_root_1oj0p_5",eY="_startRow_1oj0p_20",tY="_normalRow_1oj0p_24",nY="_author_1oj0p_28",rY="_dateTime_1oj0p_32",aY="_lineNumber_1oj0p_37",iY="_line_1oj0p_37",oY="_pre_1oj0p_52",Mi={container:ZW,root:JW,startRow:eY,normalRow:tY,author:nY,dateTime:rY,lineNumber:aY,line:iY,pre:oY};function sY(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function lY(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Kl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Kl(r,"month");const a=Math.floor(t/86400);if(a>0)return Kl(a,"day");const o=Math.floor(t/3600);if(o>0)return Kl(o,"hour");const c=Math.floor(t/60);return c>0?Kl(c,"minute"):Kl(t,"second")}function Kl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function cY(e){var c,u;const t=Ae(),[n,r]=y.useState(e.history);if(y.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 a=(u=(c=n.entry)==null?void 0:c[0])==null?void 0:u.resource;if(!a)return null;const o=YW(n);return s.jsx("div",{className:Mi.container,children:s.jsx("table",{className:Mi.root,children:s.jsx("tbody",{children:o.map((f,p)=>s.jsxs("tr",{className:f.span>0?Mi.startRow:Mi.normalRow,children:[f.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:Mi.author,rowSpan:f.span,children:s.jsx(oc,{value:f.meta.author,link:!0})}),s.jsx("td",{className:Mi.dateTime,rowSpan:f.span,children:s.jsx(bt,{to:sY(a,f.meta.versionId),children:lY(f.meta.lastUpdated)})})]}),s.jsx("td",{className:Mi.lineNumber,children:p+1}),s.jsx("td",{className:Mi.line,children:s.jsx("pre",{className:Mi.pre,children:f.value})})]},"row-"+p))})})})}const uY="_removed_el5zk_1",dY="_added_el5zk_6",rT={removed:uY,added:dY};function fY(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ia(t,!0).match(/[^\r\n]+/g),a=Ia(n,!0).match(/[^\r\n]+/g),o=ik(r,a);return s.jsx("pre",{style:{color:"gray"},children:o.map((c,u)=>s.jsx(hY,{delta:c},"delta"+u))})}function hY(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:rT.removed,children:e.delta.original.lines.join(`
|
|
532
|
+
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:rT.added,children:e.delta.revised.lines.join(`
|
|
533
|
+
`)}),"...",s.jsx("br",{})]})}const pY="_splitButton_1i0gi_1",mY="_menuControl_1i0gi_6",aT={splitButton:pY,menuControl:mY};function Wh(e){const{outcome:t}=e,n=Ae(),r=Yt(e.defaultValue),a=r==null?void 0:r.resourceType,[o,c]=y.useState(!1),[u,f]=y.useState(),p=n.getAccessPolicy(),m=Sn();y.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const S=Pc(b);if(S){c(!0);const j=rV(r,S);f(j)}else console.error(`Schema not found for ${b}`)}).catch(S=>{console.error("Error in requestProfileSchema",S)})}else n.requestSchema(a).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,a,e.profileUrl]);const g=y.useMemo(()=>r&&kA(r,tc.READ,p),[p,r]),v=y.useMemo(()=>n.isSuperAdmin()||!p||!En(u==null?void 0:u.resourceType)?!0:sB(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!o||!u?s.jsx("div",{children:"Loading..."}):v?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[s.jsxs(We,{mb:"xl",children:[s.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(ze,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),s.jsx(zt,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(ze,{name:"id",defaultValue:u.id,disabled:!0})})]}),s.jsx(Rb,{path:u.resourceType,valuePath:u.resourceType,typeName:a,defaultValue:u,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),s.jsxs(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(Pe,{type:"submit",className:$t((e.onPatch||e.onDelete)&&aT.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(je,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(je.Target,{children:s.jsx(_n,{variant:"filled",color:m.primaryColor,size:36,className:aT.menuControl,"aria-label":"More actions",children:s.jsx(ub,{size:14,stroke:1.5})})}),s.jsxs(je.Dropdown,{children:[e.onPatch&&s.jsx(je.Item,{leftSection:s.jsx(YA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&s.jsx(je.Item,{color:"red",leftSection:s.jsx(pb,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):s.jsxs(Ki,{color:"red",title:"Permission denied",icon:s.jsx(el,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function gY(e){var a;const t=Ae(),[n,r]=y.useState(e.history);return y.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(Oe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(Oe.Thead,{children:s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Th,{children:"Author"}),s.jsx(Oe.Th,{children:"Date"}),s.jsx(Oe.Th,{children:"Version"})]})}),s.jsx(Oe.Tbody,{children:(a=n.entry)==null?void 0:a.map((o,c)=>s.jsx(vY,{entry:o},"entry-"+c))})]}):s.jsx("div",{children:"Loading..."})}function vY(e){var r,a,o;const{response:t,resource:n}=e.entry;return n?s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:s.jsx(oc,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(Oe.Td,{children:gr((a=n.meta)==null?void 0:a.lastUpdated)}),s.jsx(Oe.Td,{children:s.jsx(bt,{to:yY(n),children:(o=n.meta)==null?void 0:o.versionId})})]}):s.jsx(Oe.Tr,{children:s.jsx(Oe.Td,{colSpan:3,children:Ke(t==null?void 0:t.outcome)})})}function yY(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function xY(e){const{serviceRequest:t,...n}=e;return s.jsx(nm,{value:t,loadTimelineResources:async(r,a,o)=>{const c=`${a}/${o}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",o),r.search("Communication",{"based-on":c,_count:u}),r.search("DiagnosticReport",{"based-on":c,_count:u}),r.search("Media",{"based-on":c,_count:u}),r.search("DocumentReference",{related:c,_count:u}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:u})])},createCommunication:(r,a,o)=>({resourceType:"Communication",status:"completed",basedOn:[fn(r)],subject:r.subject,sender:fn(a),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,a,o)=>({resourceType:"Media",status:"completed",basedOn:[fn(r)],subject:r.subject,operator:fn(a),issued:new Date().toISOString(),content:o}),...n})}function bY(e){const t=Ae(),{client:n,patient:r,encounter:a,children:o,...c}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:a}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",K0(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),window.location.assign(p.toString())}).catch(f=>_e({color:"red",message:Ke(f),autoClose:!1}))}return s.jsx(Pt,{onClick:()=>u(),...c,children:o})}var Xv={exports:{}},Lu={},Zv={exports:{}},Jv={};/**
|
|
534
|
+
* @license React
|
|
535
|
+
* scheduler.production.js
|
|
536
|
+
*
|
|
537
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
538
|
+
*
|
|
539
|
+
* This source code is licensed under the MIT license found in the
|
|
540
|
+
* LICENSE file in the root directory of this source tree.
|
|
541
|
+
*/var iT;function SY(){return iT||(iT=1,function(e){function t(P,I){var z=P.length;P.push(I);e:for(;0<z;){var F=z-1>>>1,O=P[F];if(0<a(O,I))P[F]=I,P[z]=O,z=F;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var I=P[0],z=P.pop();if(z!==I){P[0]=z;e:for(var F=0,O=P.length,U=O>>>1;F<U;){var Z=2*(F+1)-1,ee=P[Z],ye=Z+1,be=P[ye];if(0>a(ee,z))ye<O&&0>a(be,ee)?(P[F]=be,P[ye]=z,F=ye):(P[F]=ee,P[Z]=z,F=Z);else if(ye<O&&0>a(be,z))P[F]=be,P[ye]=z,F=ye;else break e}}return I}function a(P,I){var z=P.sortIndex-I.sortIndex;return z!==0?z:P.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var f=[],p=[],m=1,g=null,v=3,b=!1,S=!1,j=!1,C=!1,R=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function T(P){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=P)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function A(P){if(j=!1,T(P),!S)if(n(f)!==null)S=!0,_||(_=!0,Q());else{var I=n(p);I!==null&&Y(A,I.startTime-P)}}var _=!1,M=-1,L=5,$=-1;function V(){return C?!0:!(e.unstable_now()-$<L)}function X(){if(C=!1,_){var P=e.unstable_now();$=P;var I=!0;try{e:{S=!1,j&&(j=!1,D(M),M=-1),b=!0;var z=v;try{t:{for(T(P),g=n(f);g!==null&&!(g.expirationTime>P&&V());){var F=g.callback;if(typeof F=="function"){g.callback=null,v=g.priorityLevel;var O=F(g.expirationTime<=P);if(P=e.unstable_now(),typeof O=="function"){g.callback=O,T(P),I=!0;break t}g===n(f)&&r(f),T(P)}else r(f);g=n(f)}if(g!==null)I=!0;else{var U=n(p);U!==null&&Y(A,U.startTime-P),I=!1}}break e}finally{g=null,v=z,b=!1}I=void 0}}finally{I?Q():_=!1}}}var Q;if(typeof E=="function")Q=function(){E(X)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,W=J.port2;J.port1.onmessage=X,Q=function(){W.postMessage(null)}}else Q=function(){R(X,0)};function Y(P,I){M=R(function(){P(e.unstable_now())},I)}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_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"):L=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(P){switch(v){case 1:case 2:case 3:var I=3;break;default:I=v}var z=v;v=I;try{return P()}finally{v=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(P,I){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var z=v;v=P;try{return I()}finally{v=z}},e.unstable_scheduleCallback=function(P,I,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,P){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=z+O,P={id:m++,callback:I,priorityLevel:P,startTime:z,expirationTime:O,sortIndex:-1},z>F?(P.sortIndex=z,t(p,P),n(f)===null&&P===n(p)&&(j?(D(M),M=-1):j=!0,Y(A,z-F))):(P.sortIndex=O,t(f,P),S||b||(S=!0,_||(_=!0,Q()))),P},e.unstable_shouldYield=V,e.unstable_wrapCallback=function(P){var I=v;return function(){var z=v;v=I;try{return P.apply(this,arguments)}finally{v=z}}}}(Jv)),Jv}var oT;function wY(){return oT||(oT=1,Zv.exports=SY()),Zv.exports}/**
|
|
542
|
+
* @license React
|
|
543
|
+
* react-dom-client.production.js
|
|
544
|
+
*
|
|
545
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
546
|
+
*
|
|
547
|
+
* This source code is licensed under the MIT license found in the
|
|
548
|
+
* LICENSE file in the root directory of this source tree.
|
|
549
|
+
*/var sT;function jY(){if(sT)return Lu;sT=1;var e=wY(),t=ax(),n=RR();function r(i){var l="https://react.dev/errors/"+i;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)l+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var l=i,d=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(d=l.return),i=l.return;while(i)}return l.tag===3?d:null}function c(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function u(i){if(o(i)!==i)throw Error(r(188))}function f(i){var l=i.alternate;if(!l){if(l=o(i),l===null)throw Error(r(188));return l!==i?null:i}for(var d=i,h=l;;){var x=d.return;if(x===null)break;var w=x.alternate;if(w===null){if(h=x.return,h!==null){d=h;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===d)return u(x),i;if(w===h)return u(x),l;w=w.sibling}throw Error(r(188))}if(d.return!==h.return)d=x,h=w;else{for(var k=!1,N=x.child;N;){if(N===d){k=!0,d=x,h=w;break}if(N===h){k=!0,h=x,d=w;break}N=N.sibling}if(!k){for(N=w.child;N;){if(N===d){k=!0,d=w,h=x;break}if(N===h){k=!0,h=w,d=x;break}N=N.sibling}if(!k)throw Error(r(189))}}if(d.alternate!==h)throw Error(r(190))}if(d.tag!==3)throw Error(r(188));return d.stateNode.current===d?i:l}function p(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i;for(i=i.child;i!==null;){if(l=p(i),l!==null)return l;i=i.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),R=Symbol.for("react.provider"),D=Symbol.for("react.consumer"),E=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),X=Symbol.iterator;function Q(i){return i===null||typeof i!="object"?null:(i=X&&i[X]||i["@@iterator"],typeof i=="function"?i:null)}var J=Symbol.for("react.client.reference");function W(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===J?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case S:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case A:return"Suspense";case _:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case b:return"Portal";case E:return(i.displayName||"Context")+".Provider";case D:return(i._context.displayName||"Context")+".Consumer";case T:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case M:return l=i.displayName||null,l!==null?l:W(i.type)||"Memo";case L:l=i._payload,i=i._init;try{return W(i(l))}catch{}}return null}var Y=Array.isArray,P=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},F=[],O=-1;function U(i){return{current:i}}function Z(i){0>O||(i.current=F[O],F[O]=null,O--)}function ee(i,l){O++,F[O]=i.current,i.current=l}var ye=U(null),be=U(null),ve=U(null),Ge=U(null);function ke(i,l){switch(ee(ve,l),ee(be,i),ee(ye,null),l.nodeType){case 9:case 11:i=(i=l.documentElement)&&(i=i.namespaceURI)?sj(i):0;break;default:if(i=l.tagName,l=l.namespaceURI)l=sj(l),i=lj(l,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}Z(ye),ee(ye,i)}function et(){Z(ye),Z(be),Z(ve)}function Re(i){i.memoizedState!==null&&ee(Ge,i);var l=ye.current,d=lj(l,i.type);l!==d&&(ee(be,i),ee(ye,d))}function ft(i){be.current===i&&(Z(ye),Z(be)),Ge.current===i&&(Z(Ge),Tu._currentValue=z)}var Ut=Object.prototype.hasOwnProperty,Ot=e.unstable_scheduleCallback,xt=e.unstable_cancelCallback,Ht=e.unstable_shouldYield,Bt=e.unstable_requestPaint,Se=e.unstable_now,Ne=e.unstable_getCurrentPriorityLevel,Ve=e.unstable_ImmediatePriority,Te=e.unstable_UserBlockingPriority,ge=e.unstable_NormalPriority,we=e.unstable_LowPriority,Le=e.unstable_IdlePriority,xe=e.log,$e=e.unstable_setDisableYieldValue,gt=null,ht=null;function Wt(i){if(typeof xe=="function"&&$e(i),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(gt,i)}catch{}}var _t=Math.clz32?Math.clz32:Va,mn=Math.log,St=Math.LN2;function Va(i){return i>>>=0,i===0?32:31-(mn(i)/St|0)|0}var ba=256,gi=4194304;function Sa(i){var l=i&42;if(l!==0)return l;switch(i&-i){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:return 64;case 128:return 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 i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Yn(i,l,d){var h=i.pendingLanes;if(h===0)return 0;var x=0,w=i.suspendedLanes,k=i.pingedLanes;i=i.warmLanes;var N=h&134217727;return N!==0?(h=N&~w,h!==0?x=Sa(h):(k&=N,k!==0?x=Sa(k):d||(d=N&~i,d!==0&&(x=Sa(d))))):(N=h&~w,N!==0?x=Sa(N):k!==0?x=Sa(k):d||(d=h&~i,d!==0&&(x=Sa(d)))),x===0?0:l!==0&&l!==x&&(l&w)===0&&(w=x&-x,d=l&-l,w>=d||w===32&&(d&4194048)!==0)?l:x}function xr(i,l){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&l)===0}function il(i,l){switch(i){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32: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 l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ro(){var i=ba;return ba<<=1,(ba&4194048)===0&&(ba=256),i}function Zo(){var i=gi;return gi<<=1,(gi&62914560)===0&&(gi=4194304),i}function Fa(i){for(var l=[],d=0;31>d;d++)l.push(i);return l}function wa(i,l){i.pendingLanes|=l,l!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function ja(i,l,d,h,x,w){var k=i.pendingLanes;i.pendingLanes=d,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=d,i.entangledLanes&=d,i.errorRecoveryDisabledLanes&=d,i.shellSuspendCounter=0;var N=i.entanglements,B=i.expirationTimes,ne=i.hiddenUpdates;for(d=k&~d;0<d;){var ue=31-_t(d),pe=1<<ue;N[ue]=0,B[ue]=-1;var ae=ne[ue];if(ae!==null)for(ne[ue]=null,ue=0;ue<ae.length;ue++){var ie=ae[ue];ie!==null&&(ie.lane&=-536870913)}d&=~pe}h!==0&&kn(i,h,0),w!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=w&~(k&~l))}function kn(i,l,d){i.pendingLanes|=l,i.suspendedLanes&=~l;var h=31-_t(l);i.entangledLanes|=l,i.entanglements[h]=i.entanglements[h]|1073741824|d&4194090}function vi(i,l){var d=i.entangledLanes|=l;for(i=i.entanglements;d;){var h=31-_t(d),x=1<<h;x&l|i[h]&l&&(i[h]|=l),d&=~x}}function ol(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Jo(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function H(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:Rj(i.type))}function G(i,l){var d=I.p;try{return I.p=i,l()}finally{I.p=d}}var re=Math.random().toString(36).slice(2),he="__reactFiber$"+re,Ee="__reactProps$"+re,Be="__reactContainer$"+re,tt="__reactEvents$"+re,Ue="__reactListeners$"+re,Xe="__reactHandles$"+re,Ze="__reactResources$"+re,rt="__reactMarker$"+re;function Ye(i){delete i[he],delete i[Ee],delete i[tt],delete i[Ue],delete i[Xe]}function lt(i){var l=i[he];if(l)return l;for(var d=i.parentNode;d;){if(l=d[Be]||d[he]){if(d=l.alternate,l.child!==null||d!==null&&d.child!==null)for(i=fj(i);i!==null;){if(d=i[he])return d;i=fj(i)}return l}i=d,d=i.parentNode}return null}function Dt(i){if(i=i[he]||i[Be]){var l=i.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return i}return null}function at(i){var l=i.tag;if(l===5||l===26||l===27||l===6)return i.stateNode;throw Error(r(33))}function rn(i){var l=i[Ze];return l||(l=i[Ze]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function kt(i){i[rt]=!0}var jt=new Set,Ha={};function cr(i,l){Kr(i,l),Kr(i+"Capture",l)}function Kr(i,l){for(Ha[i]=l,i=0;i<l.length;i++)jt.add(l[i])}var br=RegExp("^[: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]*$"),ao={},io={};function Lc(i){return Ut.call(io,i)?!0:Ut.call(ao,i)?!1:br.test(i)?io[i]=!0:(ao[i]=!0,!1)}function Xr(i,l,d){if(Lc(l))if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":i.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(l);return}}i.setAttribute(l,""+d)}}function yi(i,l,d){if(d===null)i.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(l);return}i.setAttribute(l,""+d)}}function Ct(i,l,d,h){if(h===null)i.removeAttribute(d);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(d);return}i.setAttributeNS(l,d,""+h)}}var nr,Ca;function Ea(i){if(nr===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);nr=l&&l[1]||"",Ca=-1<d.stack.indexOf(`
|
|
550
|
+
at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
551
|
+
`+nr+i+Ca}var es=!1;function xn(i,l){if(!i||es)return"";es=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ie){var ae=ie}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(ie){ae=ie}i.call(pe.prototype)}}else{try{throw Error()}catch(ie){ae=ie}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ie){if(ie&&ae&&typeof ie.stack=="string")return[ie.stack,ae.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=h.DetermineComponentFrameRoot(),k=w[0],N=w[1];if(k&&N){var B=k.split(`
|
|
552
|
+
`),ne=N.split(`
|
|
553
|
+
`);for(x=h=0;h<B.length&&!B[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ne.length&&!ne[x].includes("DetermineComponentFrameRoot");)x++;if(h===B.length||x===ne.length)for(h=B.length-1,x=ne.length-1;1<=h&&0<=x&&B[h]!==ne[x];)x--;for(;1<=h&&0<=x;h--,x--)if(B[h]!==ne[x]){if(h!==1||x!==1)do if(h--,x--,0>x||B[h]!==ne[x]){var ue=`
|
|
554
|
+
`+B[h].replace(" at new "," at ");return i.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",i.displayName)),ue}while(1<=h&&0<=x);break}}}finally{es=!1,Error.prepareStackTrace=d}return(d=i?i.displayName||i.name:"")?Ea(d):""}function oo(i){switch(i.tag){case 26:case 27:case 5:return Ea(i.type);case 16:return Ea("Lazy");case 13:return Ea("Suspense");case 19:return Ea("SuspenseList");case 0:case 15:return xn(i.type,!1);case 11:return xn(i.type.render,!1);case 1:return xn(i.type,!0);case 31:return Ea("Activity");default:return""}}function zc(i){try{var l="";do l+=oo(i),i=i.return;while(i);return l}catch(d){return`
|
|
555
|
+
Error generating stack: `+d.message+`
|
|
556
|
+
`+d.stack}}function Sr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function n1(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Xk(i){var l=n1(i)?"checked":"value",d=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),h=""+i[l];if(!i.hasOwnProperty(l)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var x=d.get,w=d.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return x.call(this)},set:function(k){h=""+k,w.call(this,k)}}),Object.defineProperty(i,l,{enumerable:d.enumerable}),{getValue:function(){return h},setValue:function(k){h=""+k},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Vd(i){i._valueTracker||(i._valueTracker=Xk(i))}function r1(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var d=l.getValue(),h="";return i&&(h=n1(i)?i.checked?"true":"false":i.value),i=h,i!==d?(l.setValue(i),!0):!1}function Fd(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Zk=/[\n"\\]/g;function Zr(i){return i.replace(Zk,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function um(i,l,d,h,x,w,k,N){i.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?i.type=k:i.removeAttribute("type"),l!=null?k==="number"?(l===0&&i.value===""||i.value!=l)&&(i.value=""+Sr(l)):i.value!==""+Sr(l)&&(i.value=""+Sr(l)):k!=="submit"&&k!=="reset"||i.removeAttribute("value"),l!=null?dm(i,k,Sr(l)):d!=null?dm(i,k,Sr(d)):h!=null&&i.removeAttribute("value"),x==null&&w!=null&&(i.defaultChecked=!!w),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+Sr(N):i.removeAttribute("name")}function a1(i,l,d,h,x,w,k,N){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),l!=null||d!=null){if(!(w!=="submit"&&w!=="reset"||l!=null))return;d=d!=null?""+Sr(d):"",l=l!=null?""+Sr(l):d,N||l===i.value||(i.value=l),i.defaultValue=l}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=N?i.checked:!!h,i.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(i.name=k)}function dm(i,l,d){l==="number"&&Fd(i.ownerDocument)===i||i.defaultValue===""+d||(i.defaultValue=""+d)}function sl(i,l,d,h){if(i=i.options,l){l={};for(var x=0;x<d.length;x++)l["$"+d[x]]=!0;for(d=0;d<i.length;d++)x=l.hasOwnProperty("$"+i[d].value),i[d].selected!==x&&(i[d].selected=x),x&&h&&(i[d].defaultSelected=!0)}else{for(d=""+Sr(d),l=null,x=0;x<i.length;x++){if(i[x].value===d){i[x].selected=!0,h&&(i[x].defaultSelected=!0);return}l!==null||i[x].disabled||(l=i[x])}l!==null&&(l.selected=!0)}}function i1(i,l,d){if(l!=null&&(l=""+Sr(l),l!==i.value&&(i.value=l),d==null)){i.defaultValue!==l&&(i.defaultValue=l);return}i.defaultValue=d!=null?""+Sr(d):""}function o1(i,l,d,h){if(l==null){if(h!=null){if(d!=null)throw Error(r(92));if(Y(h)){if(1<h.length)throw Error(r(93));h=h[0]}d=h}d==null&&(d=""),l=d}d=Sr(l),i.defaultValue=d,h=i.textContent,h===d&&h!==""&&h!==null&&(i.value=h)}function ll(i,l){if(l){var d=i.firstChild;if(d&&d===i.lastChild&&d.nodeType===3){d.nodeValue=l;return}}i.textContent=l}var Jk=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function s1(i,l,d){var h=l.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?h?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="":h?i.setProperty(l,d):typeof d!="number"||d===0||Jk.has(l)?l==="float"?i.cssFloat=d:i[l]=(""+d).trim():i[l]=d+"px"}function l1(i,l,d){if(l!=null&&typeof l!="object")throw Error(r(62));if(i=i.style,d!=null){for(var h in d)!d.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var x in l)h=l[x],l.hasOwnProperty(x)&&d[x]!==h&&s1(i,x,h)}else for(var w in l)l.hasOwnProperty(w)&&s1(i,w,l[w])}function fm(i){if(i.indexOf("-")===-1)return!1;switch(i){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 e4=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),t4=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Hd(i){return t4.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var hm=null;function pm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var cl=null,ul=null;function c1(i){var l=Dt(i);if(l&&(i=l.stateNode)){var d=i[Ee]||null;e:switch(i=l.stateNode,l.type){case"input":if(um(i,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),l=d.name,d.type==="radio"&&l!=null){for(d=i;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Zr(""+l)+'"][type="radio"]'),l=0;l<d.length;l++){var h=d[l];if(h!==i&&h.form===i.form){var x=h[Ee]||null;if(!x)throw Error(r(90));um(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(l=0;l<d.length;l++)h=d[l],h.form===i.form&&r1(h)}break e;case"textarea":i1(i,d.value,d.defaultValue);break e;case"select":l=d.value,l!=null&&sl(i,!!d.multiple,l,!1)}}}var mm=!1;function u1(i,l,d){if(mm)return i(l,d);mm=!0;try{var h=i(l);return h}finally{if(mm=!1,(cl!==null||ul!==null)&&(_f(),cl&&(l=cl,i=ul,ul=cl=null,c1(l),i)))for(l=0;l<i.length;l++)c1(i[l])}}function $c(i,l){var d=i.stateNode;if(d===null)return null;var h=d[Ee]||null;if(h===null)return null;d=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(d&&typeof d!="function")throw Error(r(231,l,typeof d));return d}var xi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gm=!1;if(xi)try{var Uc={};Object.defineProperty(Uc,"passive",{get:function(){gm=!0}}),window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{gm=!1}var so=null,vm=null,qd=null;function d1(){if(qd)return qd;var i,l=vm,d=l.length,h,x="value"in so?so.value:so.textContent,w=x.length;for(i=0;i<d&&l[i]===x[i];i++);var k=d-i;for(h=1;h<=k&&l[d-h]===x[w-h];h++);return qd=x.slice(i,1<h?1-h:void 0)}function Gd(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Qd(){return!0}function f1(){return!1}function wr(i){function l(d,h,x,w,k){this._reactName=d,this._targetInst=x,this.type=h,this.nativeEvent=w,this.target=k,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(d=i[N],this[N]=d?d(w):w[N]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?Qd:f1,this.isPropagationStopped=f1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Qd)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Qd)},persist:function(){},isPersistent:Qd}),l}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wd=wr(ts),Bc=m({},ts,{view:0,detail:0}),n4=wr(Bc),ym,xm,Vc,Yd=m({},Bc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sm,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Vc&&(Vc&&i.type==="mousemove"?(ym=i.screenX-Vc.screenX,xm=i.screenY-Vc.screenY):xm=ym=0,Vc=i),ym)},movementY:function(i){return"movementY"in i?i.movementY:xm}}),h1=wr(Yd),r4=m({},Yd,{dataTransfer:0}),a4=wr(r4),i4=m({},Bc,{relatedTarget:0}),bm=wr(i4),o4=m({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),s4=wr(o4),l4=m({},ts,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),c4=wr(l4),u4=m({},ts,{data:0}),p1=wr(u4),d4={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},f4={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"},h4={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function p4(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=h4[i])?!!l[i]:!1}function Sm(){return p4}var m4=m({},Bc,{key:function(i){if(i.key){var l=d4[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Gd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?f4[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sm,charCode:function(i){return i.type==="keypress"?Gd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Gd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),g4=wr(m4),v4=m({},Yd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),m1=wr(v4),y4=m({},Bc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sm}),x4=wr(y4),b4=m({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),S4=wr(b4),w4=m({},Yd,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),j4=wr(w4),C4=m({},ts,{newState:0,oldState:0}),E4=wr(C4),T4=[9,13,27,32],wm=xi&&"CompositionEvent"in window,Fc=null;xi&&"documentMode"in document&&(Fc=document.documentMode);var R4=xi&&"TextEvent"in window&&!Fc,g1=xi&&(!wm||Fc&&8<Fc&&11>=Fc),v1=" ",y1=!1;function x1(i,l){switch(i){case"keyup":return T4.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function b1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var dl=!1;function D4(i,l){switch(i){case"compositionend":return b1(l);case"keypress":return l.which!==32?null:(y1=!0,v1);case"textInput":return i=l.data,i===v1&&y1?null:i;default:return null}}function A4(i,l){if(dl)return i==="compositionend"||!wm&&x1(i,l)?(i=d1(),qd=vm=so=null,dl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return g1&&l.locale!=="ko"?null:l.data;default:return null}}var _4={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 S1(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!_4[i.type]:l==="textarea"}function w1(i,l,d,h){cl?ul?ul.push(h):ul=[h]:cl=h,l=If(l,"onChange"),0<l.length&&(d=new Wd("onChange","change",null,d,h),i.push({event:d,listeners:l}))}var Hc=null,qc=null;function k4(i){nj(i,0)}function Kd(i){var l=at(i);if(r1(l))return i}function j1(i,l){if(i==="change")return l}var C1=!1;if(xi){var jm;if(xi){var Cm="oninput"in document;if(!Cm){var E1=document.createElement("div");E1.setAttribute("oninput","return;"),Cm=typeof E1.oninput=="function"}jm=Cm}else jm=!1;C1=jm&&(!document.documentMode||9<document.documentMode)}function T1(){Hc&&(Hc.detachEvent("onpropertychange",R1),qc=Hc=null)}function R1(i){if(i.propertyName==="value"&&Kd(qc)){var l=[];w1(l,qc,i,pm(i)),u1(k4,l)}}function P4(i,l,d){i==="focusin"?(T1(),Hc=l,qc=d,Hc.attachEvent("onpropertychange",R1)):i==="focusout"&&T1()}function N4(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Kd(qc)}function O4(i,l){if(i==="click")return Kd(l)}function M4(i,l){if(i==="input"||i==="change")return Kd(l)}function I4(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Ir=typeof Object.is=="function"?Object.is:I4;function Gc(i,l){if(Ir(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var d=Object.keys(i),h=Object.keys(l);if(d.length!==h.length)return!1;for(h=0;h<d.length;h++){var x=d[h];if(!Ut.call(l,x)||!Ir(i[x],l[x]))return!1}return!0}function D1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function A1(i,l){var d=D1(i);i=0;for(var h;d;){if(d.nodeType===3){if(h=i+d.textContent.length,i<=l&&h>=l)return{node:d,offset:l-i};i=h}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=D1(d)}}function _1(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?_1(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function k1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var l=Fd(i.document);l instanceof i.HTMLIFrameElement;){try{var d=typeof l.contentWindow.location.href=="string"}catch{d=!1}if(d)i=l.contentWindow;else break;l=Fd(i.document)}return l}function Em(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}var L4=xi&&"documentMode"in document&&11>=document.documentMode,fl=null,Tm=null,Qc=null,Rm=!1;function P1(i,l,d){var h=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Rm||fl==null||fl!==Fd(h)||(h=fl,"selectionStart"in h&&Em(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Qc&&Gc(Qc,h)||(Qc=h,h=If(Tm,"onSelect"),0<h.length&&(l=new Wd("onSelect","select",null,l,d),i.push({event:l,listeners:h}),l.target=fl)))}function ns(i,l){var d={};return d[i.toLowerCase()]=l.toLowerCase(),d["Webkit"+i]="webkit"+l,d["Moz"+i]="moz"+l,d}var hl={animationend:ns("Animation","AnimationEnd"),animationiteration:ns("Animation","AnimationIteration"),animationstart:ns("Animation","AnimationStart"),transitionrun:ns("Transition","TransitionRun"),transitionstart:ns("Transition","TransitionStart"),transitioncancel:ns("Transition","TransitionCancel"),transitionend:ns("Transition","TransitionEnd")},Dm={},N1={};xi&&(N1=document.createElement("div").style,"AnimationEvent"in window||(delete hl.animationend.animation,delete hl.animationiteration.animation,delete hl.animationstart.animation),"TransitionEvent"in window||delete hl.transitionend.transition);function rs(i){if(Dm[i])return Dm[i];if(!hl[i])return i;var l=hl[i],d;for(d in l)if(l.hasOwnProperty(d)&&d in N1)return Dm[i]=l[d];return i}var O1=rs("animationend"),M1=rs("animationiteration"),I1=rs("animationstart"),z4=rs("transitionrun"),$4=rs("transitionstart"),U4=rs("transitioncancel"),L1=rs("transitionend"),z1=new Map,Am="abort auxClick beforeToggle 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(" ");Am.push("scrollEnd");function Ta(i,l){z1.set(i,l),cr(l,[i])}var $1=new WeakMap;function Jr(i,l){if(typeof i=="object"&&i!==null){var d=$1.get(i);return d!==void 0?d:(l={value:i,source:l,stack:zc(l)},$1.set(i,l),l)}return{value:i,source:l,stack:zc(l)}}var ea=[],pl=0,_m=0;function Xd(){for(var i=pl,l=_m=pl=0;l<i;){var d=ea[l];ea[l++]=null;var h=ea[l];ea[l++]=null;var x=ea[l];ea[l++]=null;var w=ea[l];if(ea[l++]=null,h!==null&&x!==null){var k=h.pending;k===null?x.next=x:(x.next=k.next,k.next=x),h.pending=x}w!==0&&U1(d,x,w)}}function Zd(i,l,d,h){ea[pl++]=i,ea[pl++]=l,ea[pl++]=d,ea[pl++]=h,_m|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function km(i,l,d,h){return Zd(i,l,d,h),Jd(i)}function ml(i,l){return Zd(i,null,null,l),Jd(i)}function U1(i,l,d){i.lanes|=d;var h=i.alternate;h!==null&&(h.lanes|=d);for(var x=!1,w=i.return;w!==null;)w.childLanes|=d,h=w.alternate,h!==null&&(h.childLanes|=d),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(x=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,x&&l!==null&&(x=31-_t(d),i=w.hiddenUpdates,h=i[x],h===null?i[x]=[l]:h.push(l),l.lane=d|536870912),w):null}function Jd(i){if(50<yu)throw yu=0,Lg=null,Error(r(185));for(var l=i.return;l!==null;)i=l,l=i.return;return i.tag===3?i.stateNode:null}var gl={};function B4(i,l,d,h){this.tag=i,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Lr(i,l,d,h){return new B4(i,l,d,h)}function Pm(i){return i=i.prototype,!(!i||!i.isReactComponent)}function bi(i,l){var d=i.alternate;return d===null?(d=Lr(i.tag,l,i.key,i.mode),d.elementType=i.elementType,d.type=i.type,d.stateNode=i.stateNode,d.alternate=i,i.alternate=d):(d.pendingProps=l,d.type=i.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=i.flags&65011712,d.childLanes=i.childLanes,d.lanes=i.lanes,d.child=i.child,d.memoizedProps=i.memoizedProps,d.memoizedState=i.memoizedState,d.updateQueue=i.updateQueue,l=i.dependencies,d.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},d.sibling=i.sibling,d.index=i.index,d.ref=i.ref,d.refCleanup=i.refCleanup,d}function B1(i,l){i.flags&=65011714;var d=i.alternate;return d===null?(i.childLanes=0,i.lanes=l,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=d.childLanes,i.lanes=d.lanes,i.child=d.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=d.memoizedProps,i.memoizedState=d.memoizedState,i.updateQueue=d.updateQueue,i.type=d.type,l=d.dependencies,i.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),i}function ef(i,l,d,h,x,w){var k=0;if(h=i,typeof i=="function")Pm(i)&&(k=1);else if(typeof i=="string")k=FP(i,d,ye.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=Lr(31,d,l,x),i.elementType=$,i.lanes=w,i;case S:return as(d.children,x,w,l);case j:k=8,x|=24;break;case C:return i=Lr(12,d,l,x|2),i.elementType=C,i.lanes=w,i;case A:return i=Lr(13,d,l,x),i.elementType=A,i.lanes=w,i;case _:return i=Lr(19,d,l,x),i.elementType=_,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:case E:k=10;break e;case D:k=9;break e;case T:k=11;break e;case M:k=14;break e;case L:k=16,h=null;break e}k=29,d=Error(r(130,i===null?"null":typeof i,"")),h=null}return l=Lr(k,d,l,x),l.elementType=i,l.type=h,l.lanes=w,l}function as(i,l,d,h){return i=Lr(7,i,h,l),i.lanes=d,i}function Nm(i,l,d){return i=Lr(6,i,null,l),i.lanes=d,i}function Om(i,l,d){return l=Lr(4,i.children!==null?i.children:[],i.key,l),l.lanes=d,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}var vl=[],yl=0,tf=null,nf=0,ta=[],na=0,is=null,Si=1,wi="";function os(i,l){vl[yl++]=nf,vl[yl++]=tf,tf=i,nf=l}function V1(i,l,d){ta[na++]=Si,ta[na++]=wi,ta[na++]=is,is=i;var h=Si;i=wi;var x=32-_t(h)-1;h&=~(1<<x),d+=1;var w=32-_t(l)+x;if(30<w){var k=x-x%5;w=(h&(1<<k)-1).toString(32),h>>=k,x-=k,Si=1<<32-_t(l)+x|d<<x|h,wi=w+i}else Si=1<<w|d<<x|h,wi=i}function Mm(i){i.return!==null&&(os(i,1),V1(i,1,0))}function Im(i){for(;i===tf;)tf=vl[--yl],vl[yl]=null,nf=vl[--yl],vl[yl]=null;for(;i===is;)is=ta[--na],ta[na]=null,wi=ta[--na],ta[na]=null,Si=ta[--na],ta[na]=null}var ur=null,Dn=null,qt=!1,ss=null,qa=!1,Lm=Error(r(519));function ls(i){var l=Error(r(418,""));throw Kc(Jr(l,i)),Lm}function F1(i){var l=i.stateNode,d=i.type,h=i.memoizedProps;switch(l[he]=i,l[Ee]=h,d){case"dialog":Rt("cancel",l),Rt("close",l);break;case"iframe":case"object":case"embed":Rt("load",l);break;case"video":case"audio":for(d=0;d<bu.length;d++)Rt(bu[d],l);break;case"source":Rt("error",l);break;case"img":case"image":case"link":Rt("error",l),Rt("load",l);break;case"details":Rt("toggle",l);break;case"input":Rt("invalid",l),a1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Vd(l);break;case"select":Rt("invalid",l);break;case"textarea":Rt("invalid",l),o1(l,h.value,h.defaultValue,h.children),Vd(l)}d=h.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||l.textContent===""+d||h.suppressHydrationWarning===!0||oj(l.textContent,d)?(h.popover!=null&&(Rt("beforetoggle",l),Rt("toggle",l)),h.onScroll!=null&&Rt("scroll",l),h.onScrollEnd!=null&&Rt("scrollend",l),h.onClick!=null&&(l.onclick=Lf),l=!0):l=!1,l||ls(i)}function H1(i){for(ur=i.return;ur;)switch(ur.tag){case 5:case 13:qa=!1;return;case 27:case 3:qa=!0;return;default:ur=ur.return}}function Wc(i){if(i!==ur)return!1;if(!qt)return H1(i),qt=!0,!1;var l=i.tag,d;if((d=l!==3&&l!==27)&&((d=l===5)&&(d=i.type,d=!(d!=="form"&&d!=="button")||Jg(i.type,i.memoizedProps)),d=!d),d&&Dn&&ls(i),H1(i),l===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8)if(d=i.data,d==="/$"){if(l===0){Dn=Da(i.nextSibling);break e}l--}else d!=="$"&&d!=="$!"&&d!=="$?"||l++;i=i.nextSibling}Dn=null}}else l===27?(l=Dn,Co(i.type)?(i=rv,rv=null,Dn=i):Dn=l):Dn=ur?Da(i.stateNode.nextSibling):null;return!0}function Yc(){Dn=ur=null,qt=!1}function q1(){var i=ss;return i!==null&&(Er===null?Er=i:Er.push.apply(Er,i),ss=null),i}function Kc(i){ss===null?ss=[i]:ss.push(i)}var zm=U(null),cs=null,ji=null;function lo(i,l,d){ee(zm,l._currentValue),l._currentValue=d}function Ci(i){i._currentValue=zm.current,Z(zm)}function $m(i,l,d){for(;i!==null;){var h=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),i===d)break;i=i.return}}function Um(i,l,d,h){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var w=x.dependencies;if(w!==null){var k=x.child;w=w.firstContext;e:for(;w!==null;){var N=w;w=x;for(var B=0;B<l.length;B++)if(N.context===l[B]){w.lanes|=d,N=w.alternate,N!==null&&(N.lanes|=d),$m(w.return,d,i),h||(k=null);break e}w=N.next}}else if(x.tag===18){if(k=x.return,k===null)throw Error(r(341));k.lanes|=d,w=k.alternate,w!==null&&(w.lanes|=d),$m(k,d,i),k=null}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===i){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}}function Xc(i,l,d,h){i=null;for(var x=l,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var k=x.alternate;if(k===null)throw Error(r(387));if(k=k.memoizedProps,k!==null){var N=x.type;Ir(x.pendingProps.value,k.value)||(i!==null?i.push(N):i=[N])}}else if(x===Ge.current){if(k=x.alternate,k===null)throw Error(r(387));k.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(Tu):i=[Tu])}x=x.return}i!==null&&Um(l,i,d,h),l.flags|=262144}function rf(i){for(i=i.firstContext;i!==null;){if(!Ir(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function us(i){cs=i,ji=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function rr(i){return G1(cs,i)}function af(i,l){return cs===null&&us(i),G1(i,l)}function G1(i,l){var d=l._currentValue;if(l={context:l,memoizedValue:d,next:null},ji===null){if(i===null)throw Error(r(308));ji=l,i.dependencies={lanes:0,firstContext:l},i.flags|=524288}else ji=ji.next=l;return d}var V4=typeof AbortController<"u"?AbortController:function(){var i=[],l=this.signal={aborted:!1,addEventListener:function(d,h){i.push(h)}};this.abort=function(){l.aborted=!0,i.forEach(function(d){return d()})}},F4=e.unstable_scheduleCallback,H4=e.unstable_NormalPriority,Vn={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bm(){return{controller:new V4,data:new Map,refCount:0}}function Zc(i){i.refCount--,i.refCount===0&&F4(H4,function(){i.controller.abort()})}var Jc=null,Vm=0,xl=0,bl=null;function q4(i,l){if(Jc===null){var d=Jc=[];Vm=0,xl=Hg(),bl={status:"pending",value:void 0,then:function(h){d.push(h)}}}return Vm++,l.then(Q1,Q1),l}function Q1(){if(--Vm===0&&Jc!==null){bl!==null&&(bl.status="fulfilled");var i=Jc;Jc=null,xl=0,bl=null;for(var l=0;l<i.length;l++)(0,i[l])()}}function G4(i,l){var d=[],h={status:"pending",value:null,reason:null,then:function(x){d.push(x)}};return i.then(function(){h.status="fulfilled",h.value=l;for(var x=0;x<d.length;x++)(0,d[x])(l)},function(x){for(h.status="rejected",h.reason=x,x=0;x<d.length;x++)(0,d[x])(void 0)}),h}var W1=P.S;P.S=function(i,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&q4(i,l),W1!==null&&W1(i,l)};var ds=U(null);function Fm(){var i=ds.current;return i!==null?i:un.pooledCache}function of(i,l){l===null?ee(ds,ds.current):ee(ds,l.pool)}function Y1(){var i=Fm();return i===null?null:{parent:Vn._currentValue,pool:i}}var eu=Error(r(460)),K1=Error(r(474)),sf=Error(r(542)),Hm={then:function(){}};function X1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function lf(){}function Z1(i,l,d){switch(d=i[d],d===void 0?i.push(l):d!==l&&(l.then(lf,lf),l=d),l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,eS(i),i;default:if(typeof l.status=="string")l.then(lf,lf);else{if(i=un,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=l,i.status="pending",i.then(function(h){if(l.status==="pending"){var x=l;x.status="fulfilled",x.value=h}},function(h){if(l.status==="pending"){var x=l;x.status="rejected",x.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw i=l.reason,eS(i),i}throw tu=l,eu}}var tu=null;function J1(){if(tu===null)throw Error(r(459));var i=tu;return tu=null,i}function eS(i){if(i===eu||i===sf)throw Error(r(483))}var co=!1;function qm(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Gm(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function uo(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function fo(i,l,d){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Kt&2)!==0){var x=h.pending;return x===null?l.next=l:(l.next=x.next,x.next=l),h.pending=l,l=Jd(i),U1(i,null,d),l}return Zd(i,h,l,d),Jd(i)}function nu(i,l,d){if(l=l.updateQueue,l!==null&&(l=l.shared,(d&4194048)!==0)){var h=l.lanes;h&=i.pendingLanes,d|=h,l.lanes=d,vi(i,d)}}function Qm(i,l){var d=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,d===h)){var x=null,w=null;if(d=d.firstBaseUpdate,d!==null){do{var k={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};w===null?x=w=k:w=w.next=k,d=d.next}while(d!==null);w===null?x=w=l:w=w.next=l}else x=w=l;d={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:h.shared,callbacks:h.callbacks},i.updateQueue=d;return}i=d.lastBaseUpdate,i===null?d.firstBaseUpdate=l:i.next=l,d.lastBaseUpdate=l}var Wm=!1;function ru(){if(Wm){var i=bl;if(i!==null)throw i}}function au(i,l,d,h){Wm=!1;var x=i.updateQueue;co=!1;var w=x.firstBaseUpdate,k=x.lastBaseUpdate,N=x.shared.pending;if(N!==null){x.shared.pending=null;var B=N,ne=B.next;B.next=null,k===null?w=ne:k.next=ne,k=B;var ue=i.alternate;ue!==null&&(ue=ue.updateQueue,N=ue.lastBaseUpdate,N!==k&&(N===null?ue.firstBaseUpdate=ne:N.next=ne,ue.lastBaseUpdate=B))}if(w!==null){var pe=x.baseState;k=0,ue=ne=B=null,N=w;do{var ae=N.lane&-536870913,ie=ae!==N.lane;if(ie?(Mt&ae)===ae:(h&ae)===ae){ae!==0&&ae===xl&&(Wm=!0),ue!==null&&(ue=ue.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var ut=i,it=N;ae=l;var nn=d;switch(it.tag){case 1:if(ut=it.payload,typeof ut=="function"){pe=ut.call(nn,pe,ae);break e}pe=ut;break e;case 3:ut.flags=ut.flags&-65537|128;case 0:if(ut=it.payload,ae=typeof ut=="function"?ut.call(nn,pe,ae):ut,ae==null)break e;pe=m({},pe,ae);break e;case 2:co=!0}}ae=N.callback,ae!==null&&(i.flags|=64,ie&&(i.flags|=8192),ie=x.callbacks,ie===null?x.callbacks=[ae]:ie.push(ae))}else ie={lane:ae,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ue===null?(ne=ue=ie,B=pe):ue=ue.next=ie,k|=ae;if(N=N.next,N===null){if(N=x.shared.pending,N===null)break;ie=N,N=ie.next,ie.next=null,x.lastBaseUpdate=ie,x.shared.pending=null}}while(!0);ue===null&&(B=pe),x.baseState=B,x.firstBaseUpdate=ne,x.lastBaseUpdate=ue,w===null&&(x.shared.lanes=0),bo|=k,i.lanes=k,i.memoizedState=pe}}function tS(i,l){if(typeof i!="function")throw Error(r(191,i));i.call(l)}function nS(i,l){var d=i.callbacks;if(d!==null)for(i.callbacks=null,i=0;i<d.length;i++)tS(d[i],l)}var Sl=U(null),cf=U(0);function rS(i,l){i=ki,ee(cf,i),ee(Sl,l),ki=i|l.baseLanes}function Ym(){ee(cf,ki),ee(Sl,Sl.current)}function Km(){ki=cf.current,Z(Sl),Z(cf)}var ho=0,wt=null,en=null,Ln=null,uf=!1,wl=!1,fs=!1,df=0,iu=0,jl=null,Q4=0;function Pn(){throw Error(r(321))}function Xm(i,l){if(l===null)return!1;for(var d=0;d<l.length&&d<i.length;d++)if(!Ir(i[d],l[d]))return!1;return!0}function Zm(i,l,d,h,x,w){return ho=w,wt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=i===null||i.memoizedState===null?US:BS,fs=!1,w=d(h,x),fs=!1,wl&&(w=iS(l,d,h,x)),aS(i),w}function aS(i){P.H=vf;var l=en!==null&&en.next!==null;if(ho=0,Ln=en=wt=null,uf=!1,iu=0,jl=null,l)throw Error(r(300));i===null||qn||(i=i.dependencies,i!==null&&rf(i)&&(qn=!0))}function iS(i,l,d,h){wt=i;var x=0;do{if(wl&&(jl=null),iu=0,wl=!1,25<=x)throw Error(r(301));if(x+=1,Ln=en=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}P.H=eP,w=l(d,h)}while(wl);return w}function W4(){var i=P.H,l=i.useState()[0];return l=typeof l.then=="function"?ou(l):l,i=i.useState()[0],(en!==null?en.memoizedState:null)!==i&&(wt.flags|=1024),l}function Jm(){var i=df!==0;return df=0,i}function eg(i,l,d){l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~d}function tg(i){if(uf){for(i=i.memoizedState;i!==null;){var l=i.queue;l!==null&&(l.pending=null),i=i.next}uf=!1}ho=0,Ln=en=wt=null,wl=!1,iu=df=0,jl=null}function jr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?wt.memoizedState=Ln=i:Ln=Ln.next=i,Ln}function zn(){if(en===null){var i=wt.alternate;i=i!==null?i.memoizedState:null}else i=en.next;var l=Ln===null?wt.memoizedState:Ln.next;if(l!==null)Ln=l,en=i;else{if(i===null)throw wt.alternate===null?Error(r(467)):Error(r(310));en=i,i={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},Ln===null?wt.memoizedState=Ln=i:Ln=Ln.next=i}return Ln}function ng(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ou(i){var l=iu;return iu+=1,jl===null&&(jl=[]),i=Z1(jl,i,l),l=wt,(Ln===null?l.memoizedState:Ln.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?US:BS),i}function ff(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return ou(i);if(i.$$typeof===E)return rr(i)}throw Error(r(438,String(i)))}function rg(i){var l=null,d=wt.updateQueue;if(d!==null&&(l=d.memoCache),l==null){var h=wt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(x){return x.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),d===null&&(d=ng(),wt.updateQueue=d),d.memoCache=l,d=l.data[l.index],d===void 0)for(d=l.data[l.index]=Array(i),h=0;h<i;h++)d[h]=V;return l.index++,d}function Ei(i,l){return typeof l=="function"?l(i):l}function hf(i){var l=zn();return ag(l,en,i)}function ag(i,l,d){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=d;var x=i.baseQueue,w=h.pending;if(w!==null){if(x!==null){var k=x.next;x.next=w.next,w.next=k}l.baseQueue=x=w,h.pending=null}if(w=i.baseState,x===null)i.memoizedState=w;else{l=x.next;var N=k=null,B=null,ne=l,ue=!1;do{var pe=ne.lane&-536870913;if(pe!==ne.lane?(Mt&pe)===pe:(ho&pe)===pe){var ae=ne.revertLane;if(ae===0)B!==null&&(B=B.next={lane:0,revertLane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),pe===xl&&(ue=!0);else if((ho&ae)===ae){ne=ne.next,ae===xl&&(ue=!0);continue}else pe={lane:0,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=pe,k=w):B=B.next=pe,wt.lanes|=ae,bo|=ae;pe=ne.action,fs&&d(w,pe),w=ne.hasEagerState?ne.eagerState:d(w,pe)}else ae={lane:pe,revertLane:ne.revertLane,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},B===null?(N=B=ae,k=w):B=B.next=ae,wt.lanes|=pe,bo|=pe;ne=ne.next}while(ne!==null&&ne!==l);if(B===null?k=w:B.next=N,!Ir(w,i.memoizedState)&&(qn=!0,ue&&(d=bl,d!==null)))throw d;i.memoizedState=w,i.baseState=k,i.baseQueue=B,h.lastRenderedState=w}return x===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function ig(i){var l=zn(),d=l.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=i;var h=d.dispatch,x=d.pending,w=l.memoizedState;if(x!==null){d.pending=null;var k=x=x.next;do w=i(w,k.action),k=k.next;while(k!==x);Ir(w,l.memoizedState)||(qn=!0),l.memoizedState=w,l.baseQueue===null&&(l.baseState=w),d.lastRenderedState=w}return[w,h]}function oS(i,l,d){var h=wt,x=zn(),w=qt;if(w){if(d===void 0)throw Error(r(407));d=d()}else d=l();var k=!Ir((en||x).memoizedState,d);k&&(x.memoizedState=d,qn=!0),x=x.queue;var N=cS.bind(null,h,x,i);if(su(2048,8,N,[i]),x.getSnapshot!==l||k||Ln!==null&&Ln.memoizedState.tag&1){if(h.flags|=2048,Cl(9,pf(),lS.bind(null,h,x,d,l),null),un===null)throw Error(r(349));w||(ho&124)!==0||sS(h,l,d)}return d}function sS(i,l,d){i.flags|=16384,i={getSnapshot:l,value:d},l=wt.updateQueue,l===null?(l=ng(),wt.updateQueue=l,l.stores=[i]):(d=l.stores,d===null?l.stores=[i]:d.push(i))}function lS(i,l,d,h){l.value=d,l.getSnapshot=h,uS(l)&&dS(i)}function cS(i,l,d){return d(function(){uS(l)&&dS(i)})}function uS(i){var l=i.getSnapshot;i=i.value;try{var d=l();return!Ir(i,d)}catch{return!0}}function dS(i){var l=ml(i,2);l!==null&&Vr(l,i,2)}function og(i){var l=jr();if(typeof i=="function"){var d=i;if(i=d(),fs){Wt(!0);try{d()}finally{Wt(!1)}}}return l.memoizedState=l.baseState=i,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:i},l}function fS(i,l,d,h){return i.baseState=d,ag(i,en,typeof h=="function"?h:Ei)}function Y4(i,l,d,h,x){if(gf(i))throw Error(r(485));if(i=l.action,i!==null){var w={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){w.listeners.push(k)}};P.T!==null?d(!0):w.isTransition=!1,h(w),d=l.pending,d===null?(w.next=l.pending=w,hS(l,w)):(w.next=d.next,l.pending=d.next=w)}}function hS(i,l){var d=l.action,h=l.payload,x=i.state;if(l.isTransition){var w=P.T,k={};P.T=k;try{var N=d(x,h),B=P.S;B!==null&&B(k,N),pS(i,l,N)}catch(ne){sg(i,l,ne)}finally{P.T=w}}else try{w=d(x,h),pS(i,l,w)}catch(ne){sg(i,l,ne)}}function pS(i,l,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(h){mS(i,l,h)},function(h){return sg(i,l,h)}):mS(i,l,d)}function mS(i,l,d){l.status="fulfilled",l.value=d,gS(l),i.state=d,l=i.pending,l!==null&&(d=l.next,d===l?i.pending=null:(d=d.next,l.next=d,hS(i,d)))}function sg(i,l,d){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=d,gS(l),l=l.next;while(l!==h)}i.action=null}function gS(i){i=i.listeners;for(var l=0;l<i.length;l++)(0,i[l])()}function vS(i,l){return l}function yS(i,l){if(qt){var d=un.formState;if(d!==null){e:{var h=wt;if(qt){if(Dn){t:{for(var x=Dn,w=qa;x.nodeType!==8;){if(!w){x=null;break t}if(x=Da(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Dn=Da(x.nextSibling),h=x.data==="F!";break e}}ls(h)}h=!1}h&&(l=d[0])}}return d=jr(),d.memoizedState=d.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vS,lastRenderedState:l},d.queue=h,d=LS.bind(null,wt,h),h.dispatch=d,h=og(!1),w=fg.bind(null,wt,!1,h.queue),h=jr(),x={state:l,dispatch:null,action:i,pending:null},h.queue=x,d=Y4.bind(null,wt,x,w,d),x.dispatch=d,h.memoizedState=i,[l,d,!1]}function xS(i){var l=zn();return bS(l,en,i)}function bS(i,l,d){if(l=ag(i,l,vS)[0],i=hf(Ei)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=ou(l)}catch(k){throw k===eu?sf:k}else h=l;l=zn();var x=l.queue,w=x.dispatch;return d!==l.memoizedState&&(wt.flags|=2048,Cl(9,pf(),K4.bind(null,x,d),null)),[h,w,i]}function K4(i,l){i.action=l}function SS(i){var l=zn(),d=en;if(d!==null)return bS(l,d,i);zn(),l=l.memoizedState,d=zn();var h=d.queue.dispatch;return d.memoizedState=i,[l,h,!1]}function Cl(i,l,d,h){return i={tag:i,create:d,deps:h,inst:l,next:null},l=wt.updateQueue,l===null&&(l=ng(),wt.updateQueue=l),d=l.lastEffect,d===null?l.lastEffect=i.next=i:(h=d.next,d.next=i,i.next=h,l.lastEffect=i),i}function pf(){return{destroy:void 0,resource:void 0}}function wS(){return zn().memoizedState}function mf(i,l,d,h){var x=jr();h=h===void 0?null:h,wt.flags|=i,x.memoizedState=Cl(1|l,pf(),d,h)}function su(i,l,d,h){var x=zn();h=h===void 0?null:h;var w=x.memoizedState.inst;en!==null&&h!==null&&Xm(h,en.memoizedState.deps)?x.memoizedState=Cl(l,w,d,h):(wt.flags|=i,x.memoizedState=Cl(1|l,w,d,h))}function jS(i,l){mf(8390656,8,i,l)}function CS(i,l){su(2048,8,i,l)}function ES(i,l){return su(4,2,i,l)}function TS(i,l){return su(4,4,i,l)}function RS(i,l){if(typeof l=="function"){i=i();var d=l(i);return function(){typeof d=="function"?d():l(null)}}if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function DS(i,l,d){d=d!=null?d.concat([i]):null,su(4,4,RS.bind(null,l,i),d)}function lg(){}function AS(i,l){var d=zn();l=l===void 0?null:l;var h=d.memoizedState;return l!==null&&Xm(l,h[1])?h[0]:(d.memoizedState=[i,l],i)}function _S(i,l){var d=zn();l=l===void 0?null:l;var h=d.memoizedState;if(l!==null&&Xm(l,h[1]))return h[0];if(h=i(),fs){Wt(!0);try{i()}finally{Wt(!1)}}return d.memoizedState=[h,l],h}function cg(i,l,d){return d===void 0||(ho&1073741824)!==0?i.memoizedState=l:(i.memoizedState=d,i=Nw(),wt.lanes|=i,bo|=i,d)}function kS(i,l,d,h){return Ir(d,l)?d:Sl.current!==null?(i=cg(i,d,h),Ir(i,l)||(qn=!0),i):(ho&42)===0?(qn=!0,i.memoizedState=d):(i=Nw(),wt.lanes|=i,bo|=i,l)}function PS(i,l,d,h,x){var w=I.p;I.p=w!==0&&8>w?w:8;var k=P.T,N={};P.T=N,fg(i,!1,l,d);try{var B=x(),ne=P.S;if(ne!==null&&ne(N,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ue=G4(B,h);lu(i,l,ue,Br(i))}else lu(i,l,h,Br(i))}catch(pe){lu(i,l,{then:function(){},status:"rejected",reason:pe},Br())}finally{I.p=w,P.T=k}}function X4(){}function ug(i,l,d,h){if(i.tag!==5)throw Error(r(476));var x=NS(i).queue;PS(i,x,l,z,d===null?X4:function(){return OS(i),d(h)})}function NS(i){var l=i.memoizedState;if(l!==null)return l;l={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:z},next:null};var d={};return l.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ei,lastRenderedState:d},next:null},i.memoizedState=l,i=i.alternate,i!==null&&(i.memoizedState=l),l}function OS(i){var l=NS(i).next.queue;lu(i,l,{},Br())}function dg(){return rr(Tu)}function MS(){return zn().memoizedState}function IS(){return zn().memoizedState}function Z4(i){for(var l=i.return;l!==null;){switch(l.tag){case 24:case 3:var d=Br();i=uo(d);var h=fo(l,i,d);h!==null&&(Vr(h,l,d),nu(h,l,d)),l={cache:Bm()},i.payload=l;return}l=l.return}}function J4(i,l,d){var h=Br();d={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},gf(i)?zS(l,d):(d=km(i,l,d,h),d!==null&&(Vr(d,i,h),$S(d,l,h)))}function LS(i,l,d){var h=Br();lu(i,l,d,h)}function lu(i,l,d,h){var x={lane:h,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(gf(i))zS(l,x);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=l.lastRenderedReducer,w!==null))try{var k=l.lastRenderedState,N=w(k,d);if(x.hasEagerState=!0,x.eagerState=N,Ir(N,k))return Zd(i,l,x,0),un===null&&Xd(),!1}catch{}finally{}if(d=km(i,l,x,h),d!==null)return Vr(d,i,h),$S(d,l,h),!0}return!1}function fg(i,l,d,h){if(h={lane:2,revertLane:Hg(),action:h,hasEagerState:!1,eagerState:null,next:null},gf(i)){if(l)throw Error(r(479))}else l=km(i,d,h,2),l!==null&&Vr(l,i,2)}function gf(i){var l=i.alternate;return i===wt||l!==null&&l===wt}function zS(i,l){wl=uf=!0;var d=i.pending;d===null?l.next=l:(l.next=d.next,d.next=l),i.pending=l}function $S(i,l,d){if((d&4194048)!==0){var h=l.lanes;h&=i.pendingLanes,d|=h,l.lanes=d,vi(i,d)}}var vf={readContext:rr,use:ff,useCallback:Pn,useContext:Pn,useEffect:Pn,useImperativeHandle:Pn,useLayoutEffect:Pn,useInsertionEffect:Pn,useMemo:Pn,useReducer:Pn,useRef:Pn,useState:Pn,useDebugValue:Pn,useDeferredValue:Pn,useTransition:Pn,useSyncExternalStore:Pn,useId:Pn,useHostTransitionStatus:Pn,useFormState:Pn,useActionState:Pn,useOptimistic:Pn,useMemoCache:Pn,useCacheRefresh:Pn},US={readContext:rr,use:ff,useCallback:function(i,l){return jr().memoizedState=[i,l===void 0?null:l],i},useContext:rr,useEffect:jS,useImperativeHandle:function(i,l,d){d=d!=null?d.concat([i]):null,mf(4194308,4,RS.bind(null,l,i),d)},useLayoutEffect:function(i,l){return mf(4194308,4,i,l)},useInsertionEffect:function(i,l){mf(4,2,i,l)},useMemo:function(i,l){var d=jr();l=l===void 0?null:l;var h=i();if(fs){Wt(!0);try{i()}finally{Wt(!1)}}return d.memoizedState=[h,l],h},useReducer:function(i,l,d){var h=jr();if(d!==void 0){var x=d(l);if(fs){Wt(!0);try{d(l)}finally{Wt(!1)}}}else x=l;return h.memoizedState=h.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},h.queue=i,i=i.dispatch=J4.bind(null,wt,i),[h.memoizedState,i]},useRef:function(i){var l=jr();return i={current:i},l.memoizedState=i},useState:function(i){i=og(i);var l=i.queue,d=LS.bind(null,wt,l);return l.dispatch=d,[i.memoizedState,d]},useDebugValue:lg,useDeferredValue:function(i,l){var d=jr();return cg(d,i,l)},useTransition:function(){var i=og(!1);return i=PS.bind(null,wt,i.queue,!0,!1),jr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,l,d){var h=wt,x=jr();if(qt){if(d===void 0)throw Error(r(407));d=d()}else{if(d=l(),un===null)throw Error(r(349));(Mt&124)!==0||sS(h,l,d)}x.memoizedState=d;var w={value:d,getSnapshot:l};return x.queue=w,jS(cS.bind(null,h,w,i),[i]),h.flags|=2048,Cl(9,pf(),lS.bind(null,h,w,d,l),null),d},useId:function(){var i=jr(),l=un.identifierPrefix;if(qt){var d=wi,h=Si;d=(h&~(1<<32-_t(h)-1)).toString(32)+d,l="«"+l+"R"+d,d=df++,0<d&&(l+="H"+d.toString(32)),l+="»"}else d=Q4++,l="«"+l+"r"+d.toString(32)+"»";return i.memoizedState=l},useHostTransitionStatus:dg,useFormState:yS,useActionState:yS,useOptimistic:function(i){var l=jr();l.memoizedState=l.baseState=i;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=d,l=fg.bind(null,wt,!0,d),d.dispatch=l,[i,l]},useMemoCache:rg,useCacheRefresh:function(){return jr().memoizedState=Z4.bind(null,wt)}},BS={readContext:rr,use:ff,useCallback:AS,useContext:rr,useEffect:CS,useImperativeHandle:DS,useInsertionEffect:ES,useLayoutEffect:TS,useMemo:_S,useReducer:hf,useRef:wS,useState:function(){return hf(Ei)},useDebugValue:lg,useDeferredValue:function(i,l){var d=zn();return kS(d,en.memoizedState,i,l)},useTransition:function(){var i=hf(Ei)[0],l=zn().memoizedState;return[typeof i=="boolean"?i:ou(i),l]},useSyncExternalStore:oS,useId:MS,useHostTransitionStatus:dg,useFormState:xS,useActionState:xS,useOptimistic:function(i,l){var d=zn();return fS(d,en,i,l)},useMemoCache:rg,useCacheRefresh:IS},eP={readContext:rr,use:ff,useCallback:AS,useContext:rr,useEffect:CS,useImperativeHandle:DS,useInsertionEffect:ES,useLayoutEffect:TS,useMemo:_S,useReducer:ig,useRef:wS,useState:function(){return ig(Ei)},useDebugValue:lg,useDeferredValue:function(i,l){var d=zn();return en===null?cg(d,i,l):kS(d,en.memoizedState,i,l)},useTransition:function(){var i=ig(Ei)[0],l=zn().memoizedState;return[typeof i=="boolean"?i:ou(i),l]},useSyncExternalStore:oS,useId:MS,useHostTransitionStatus:dg,useFormState:SS,useActionState:SS,useOptimistic:function(i,l){var d=zn();return en!==null?fS(d,en,i,l):(d.baseState=i,[i,d.queue.dispatch])},useMemoCache:rg,useCacheRefresh:IS},El=null,cu=0;function yf(i){var l=cu;return cu+=1,El===null&&(El=[]),Z1(El,i,l)}function uu(i,l){l=l.props.ref,i.ref=l!==void 0?l:null}function xf(i,l){throw l.$$typeof===g?Error(r(525)):(i=Object.prototype.toString.call(l),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i)))}function VS(i){var l=i._init;return l(i._payload)}function FS(i){function l(K,q){if(i){var te=K.deletions;te===null?(K.deletions=[q],K.flags|=16):te.push(q)}}function d(K,q){if(!i)return null;for(;q!==null;)l(K,q),q=q.sibling;return null}function h(K){for(var q=new Map;K!==null;)K.key!==null?q.set(K.key,K):q.set(K.index,K),K=K.sibling;return q}function x(K,q){return K=bi(K,q),K.index=0,K.sibling=null,K}function w(K,q,te){return K.index=te,i?(te=K.alternate,te!==null?(te=te.index,te<q?(K.flags|=67108866,q):te):(K.flags|=67108866,q)):(K.flags|=1048576,q)}function k(K){return i&&K.alternate===null&&(K.flags|=67108866),K}function N(K,q,te,fe){return q===null||q.tag!==6?(q=Nm(te,K.mode,fe),q.return=K,q):(q=x(q,te),q.return=K,q)}function B(K,q,te,fe){var He=te.type;return He===S?ue(K,q,te.props.children,fe,te.key):q!==null&&(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&VS(He)===q.type)?(q=x(q,te.props),uu(q,te),q.return=K,q):(q=ef(te.type,te.key,te.props,null,K.mode,fe),uu(q,te),q.return=K,q)}function ne(K,q,te,fe){return q===null||q.tag!==4||q.stateNode.containerInfo!==te.containerInfo||q.stateNode.implementation!==te.implementation?(q=Om(te,K.mode,fe),q.return=K,q):(q=x(q,te.children||[]),q.return=K,q)}function ue(K,q,te,fe,He){return q===null||q.tag!==7?(q=as(te,K.mode,fe,He),q.return=K,q):(q=x(q,te),q.return=K,q)}function pe(K,q,te){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Nm(""+q,K.mode,te),q.return=K,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return te=ef(q.type,q.key,q.props,null,K.mode,te),uu(te,q),te.return=K,te;case b:return q=Om(q,K.mode,te),q.return=K,q;case L:var fe=q._init;return q=fe(q._payload),pe(K,q,te)}if(Y(q)||Q(q))return q=as(q,K.mode,te,null),q.return=K,q;if(typeof q.then=="function")return pe(K,yf(q),te);if(q.$$typeof===E)return pe(K,af(K,q),te);xf(K,q)}return null}function ae(K,q,te,fe){var He=q!==null?q.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return He!==null?null:N(K,q,""+te,fe);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===He?B(K,q,te,fe):null;case b:return te.key===He?ne(K,q,te,fe):null;case L:return He=te._init,te=He(te._payload),ae(K,q,te,fe)}if(Y(te)||Q(te))return He!==null?null:ue(K,q,te,fe,null);if(typeof te.then=="function")return ae(K,q,yf(te),fe);if(te.$$typeof===E)return ae(K,q,af(K,te),fe);xf(K,te)}return null}function ie(K,q,te,fe,He){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return K=K.get(te)||null,N(q,K,""+fe,He);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case v:return K=K.get(fe.key===null?te:fe.key)||null,B(q,K,fe,He);case b:return K=K.get(fe.key===null?te:fe.key)||null,ne(q,K,fe,He);case L:var Et=fe._init;return fe=Et(fe._payload),ie(K,q,te,fe,He)}if(Y(fe)||Q(fe))return K=K.get(te)||null,ue(q,K,fe,He,null);if(typeof fe.then=="function")return ie(K,q,te,yf(fe),He);if(fe.$$typeof===E)return ie(K,q,te,af(q,fe),He);xf(q,fe)}return null}function ut(K,q,te,fe){for(var He=null,Et=null,Je=q,st=q=0,Qn=null;Je!==null&&st<te.length;st++){Je.index>st?(Qn=Je,Je=null):Qn=Je.sibling;var Vt=ae(K,Je,te[st],fe);if(Vt===null){Je===null&&(Je=Qn);break}i&&Je&&Vt.alternate===null&&l(K,Je),q=w(Vt,q,st),Et===null?He=Vt:Et.sibling=Vt,Et=Vt,Je=Qn}if(st===te.length)return d(K,Je),qt&&os(K,st),He;if(Je===null){for(;st<te.length;st++)Je=pe(K,te[st],fe),Je!==null&&(q=w(Je,q,st),Et===null?He=Je:Et.sibling=Je,Et=Je);return qt&&os(K,st),He}for(Je=h(Je);st<te.length;st++)Qn=ie(Je,K,st,te[st],fe),Qn!==null&&(i&&Qn.alternate!==null&&Je.delete(Qn.key===null?st:Qn.key),q=w(Qn,q,st),Et===null?He=Qn:Et.sibling=Qn,Et=Qn);return i&&Je.forEach(function(Ao){return l(K,Ao)}),qt&&os(K,st),He}function it(K,q,te,fe){if(te==null)throw Error(r(151));for(var He=null,Et=null,Je=q,st=q=0,Qn=null,Vt=te.next();Je!==null&&!Vt.done;st++,Vt=te.next()){Je.index>st?(Qn=Je,Je=null):Qn=Je.sibling;var Ao=ae(K,Je,Vt.value,fe);if(Ao===null){Je===null&&(Je=Qn);break}i&&Je&&Ao.alternate===null&&l(K,Je),q=w(Ao,q,st),Et===null?He=Ao:Et.sibling=Ao,Et=Ao,Je=Qn}if(Vt.done)return d(K,Je),qt&&os(K,st),He;if(Je===null){for(;!Vt.done;st++,Vt=te.next())Vt=pe(K,Vt.value,fe),Vt!==null&&(q=w(Vt,q,st),Et===null?He=Vt:Et.sibling=Vt,Et=Vt);return qt&&os(K,st),He}for(Je=h(Je);!Vt.done;st++,Vt=te.next())Vt=ie(Je,K,st,Vt.value,fe),Vt!==null&&(i&&Vt.alternate!==null&&Je.delete(Vt.key===null?st:Vt.key),q=w(Vt,q,st),Et===null?He=Vt:Et.sibling=Vt,Et=Vt);return i&&Je.forEach(function(t3){return l(K,t3)}),qt&&os(K,st),He}function nn(K,q,te,fe){if(typeof te=="object"&&te!==null&&te.type===S&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var He=te.key;q!==null;){if(q.key===He){if(He=te.type,He===S){if(q.tag===7){d(K,q.sibling),fe=x(q,te.props.children),fe.return=K,K=fe;break e}}else if(q.elementType===He||typeof He=="object"&&He!==null&&He.$$typeof===L&&VS(He)===q.type){d(K,q.sibling),fe=x(q,te.props),uu(fe,te),fe.return=K,K=fe;break e}d(K,q);break}else l(K,q);q=q.sibling}te.type===S?(fe=as(te.props.children,K.mode,fe,te.key),fe.return=K,K=fe):(fe=ef(te.type,te.key,te.props,null,K.mode,fe),uu(fe,te),fe.return=K,K=fe)}return k(K);case b:e:{for(He=te.key;q!==null;){if(q.key===He)if(q.tag===4&&q.stateNode.containerInfo===te.containerInfo&&q.stateNode.implementation===te.implementation){d(K,q.sibling),fe=x(q,te.children||[]),fe.return=K,K=fe;break e}else{d(K,q);break}else l(K,q);q=q.sibling}fe=Om(te,K.mode,fe),fe.return=K,K=fe}return k(K);case L:return He=te._init,te=He(te._payload),nn(K,q,te,fe)}if(Y(te))return ut(K,q,te,fe);if(Q(te)){if(He=Q(te),typeof He!="function")throw Error(r(150));return te=He.call(te),it(K,q,te,fe)}if(typeof te.then=="function")return nn(K,q,yf(te),fe);if(te.$$typeof===E)return nn(K,q,af(K,te),fe);xf(K,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,q!==null&&q.tag===6?(d(K,q.sibling),fe=x(q,te),fe.return=K,K=fe):(d(K,q),fe=Nm(te,K.mode,fe),fe.return=K,K=fe),k(K)):d(K,q)}return function(K,q,te,fe){try{cu=0;var He=nn(K,q,te,fe);return El=null,He}catch(Je){if(Je===eu||Je===sf)throw Je;var Et=Lr(29,Je,null,K.mode);return Et.lanes=fe,Et.return=K,Et}finally{}}}var Tl=FS(!0),HS=FS(!1),ra=U(null),Ga=null;function po(i){var l=i.alternate;ee(Fn,Fn.current&1),ee(ra,i),Ga===null&&(l===null||Sl.current!==null||l.memoizedState!==null)&&(Ga=i)}function qS(i){if(i.tag===22){if(ee(Fn,Fn.current),ee(ra,i),Ga===null){var l=i.alternate;l!==null&&l.memoizedState!==null&&(Ga=i)}}else mo()}function mo(){ee(Fn,Fn.current),ee(ra,ra.current)}function Ti(i){Z(ra),Ga===i&&(Ga=null),Z(Fn)}var Fn=U(0);function bf(i){for(var l=i;l!==null;){if(l.tag===13){var d=l.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||d.data==="$?"||nv(d)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function hg(i,l,d,h){l=i.memoizedState,d=d(h,l),d=d==null?l:m({},l,d),i.memoizedState=d,i.lanes===0&&(i.updateQueue.baseState=d)}var pg={enqueueSetState:function(i,l,d){i=i._reactInternals;var h=Br(),x=uo(h);x.payload=l,d!=null&&(x.callback=d),l=fo(i,x,h),l!==null&&(Vr(l,i,h),nu(l,i,h))},enqueueReplaceState:function(i,l,d){i=i._reactInternals;var h=Br(),x=uo(h);x.tag=1,x.payload=l,d!=null&&(x.callback=d),l=fo(i,x,h),l!==null&&(Vr(l,i,h),nu(l,i,h))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var d=Br(),h=uo(d);h.tag=2,l!=null&&(h.callback=l),l=fo(i,h,d),l!==null&&(Vr(l,i,d),nu(l,i,d))}};function GS(i,l,d,h,x,w,k){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,w,k):l.prototype&&l.prototype.isPureReactComponent?!Gc(d,h)||!Gc(x,w):!0}function QS(i,l,d,h){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(d,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(d,h),l.state!==i&&pg.enqueueReplaceState(l,l.state,null)}function hs(i,l){var d=l;if("ref"in l){d={};for(var h in l)h!=="ref"&&(d[h]=l[h])}if(i=i.defaultProps){d===l&&(d=m({},d));for(var x in i)d[x]===void 0&&(d[x]=i[x])}return d}var Sf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function WS(i){Sf(i)}function YS(i){console.error(i)}function KS(i){Sf(i)}function wf(i,l){try{var d=i.onUncaughtError;d(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function XS(i,l,d){try{var h=i.onCaughtError;h(d.value,{componentStack:d.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function mg(i,l,d){return d=uo(d),d.tag=3,d.payload={element:null},d.callback=function(){wf(i,l)},d}function ZS(i){return i=uo(i),i.tag=3,i}function JS(i,l,d,h){var x=d.type.getDerivedStateFromError;if(typeof x=="function"){var w=h.value;i.payload=function(){return x(w)},i.callback=function(){XS(l,d,h)}}var k=d.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(i.callback=function(){XS(l,d,h),typeof x!="function"&&(So===null?So=new Set([this]):So.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function tP(i,l,d,h,x){if(d.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=d.alternate,l!==null&&Xc(l,d,x,!0),d=ra.current,d!==null){switch(d.tag){case 13:return Ga===null?$g():d.alternate===null&&An===0&&(An=3),d.flags&=-257,d.flags|=65536,d.lanes=x,h===Hm?d.flags|=16384:(l=d.updateQueue,l===null?d.updateQueue=new Set([h]):l.add(h),Bg(i,h,x)),!1;case 22:return d.flags|=65536,h===Hm?d.flags|=16384:(l=d.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},d.updateQueue=l):(d=l.retryQueue,d===null?l.retryQueue=new Set([h]):d.add(h)),Bg(i,h,x)),!1}throw Error(r(435,d.tag))}return Bg(i,h,x),$g(),!1}if(qt)return l=ra.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=x,h!==Lm&&(i=Error(r(422),{cause:h}),Kc(Jr(i,d)))):(h!==Lm&&(l=Error(r(423),{cause:h}),Kc(Jr(l,d))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,h=Jr(h,d),x=mg(i.stateNode,h,x),Qm(i,x),An!==4&&(An=2)),!1;var w=Error(r(520),{cause:h});if(w=Jr(w,d),vu===null?vu=[w]:vu.push(w),An!==4&&(An=2),l===null)return!0;h=Jr(h,d),d=l;do{switch(d.tag){case 3:return d.flags|=65536,i=x&-x,d.lanes|=i,i=mg(d.stateNode,h,i),Qm(d,i),!1;case 1:if(l=d.type,w=d.stateNode,(d.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(So===null||!So.has(w))))return d.flags|=65536,x&=-x,d.lanes|=x,x=ZS(x),JS(x,i,d,h),Qm(d,x),!1}d=d.return}while(d!==null);return!1}var ew=Error(r(461)),qn=!1;function Kn(i,l,d,h){l.child=i===null?HS(l,null,d,h):Tl(l,i.child,d,h)}function tw(i,l,d,h,x){d=d.render;var w=l.ref;if("ref"in h){var k={};for(var N in h)N!=="ref"&&(k[N]=h[N])}else k=h;return us(l),h=Zm(i,l,d,k,w,x),N=Jm(),i!==null&&!qn?(eg(i,l,x),Ri(i,l,x)):(qt&&N&&Mm(l),l.flags|=1,Kn(i,l,h,x),l.child)}function nw(i,l,d,h,x){if(i===null){var w=d.type;return typeof w=="function"&&!Pm(w)&&w.defaultProps===void 0&&d.compare===null?(l.tag=15,l.type=w,rw(i,l,w,h,x)):(i=ef(d.type,null,h,l,l.mode,x),i.ref=l.ref,i.return=l,l.child=i)}if(w=i.child,!jg(i,x)){var k=w.memoizedProps;if(d=d.compare,d=d!==null?d:Gc,d(k,h)&&i.ref===l.ref)return Ri(i,l,x)}return l.flags|=1,i=bi(w,h),i.ref=l.ref,i.return=l,l.child=i}function rw(i,l,d,h,x){if(i!==null){var w=i.memoizedProps;if(Gc(w,h)&&i.ref===l.ref)if(qn=!1,l.pendingProps=h=w,jg(i,x))(i.flags&131072)!==0&&(qn=!0);else return l.lanes=i.lanes,Ri(i,l,x)}return gg(i,l,d,h,x)}function aw(i,l,d){var h=l.pendingProps,x=h.children,w=i!==null?i.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=w!==null?w.baseLanes|d:d,i!==null){for(x=l.child=i.child,w=0;x!==null;)w=w|x.lanes|x.childLanes,x=x.sibling;l.childLanes=w&~h}else l.childLanes=0,l.child=null;return iw(i,l,h,d)}if((d&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},i!==null&&of(l,w!==null?w.cachePool:null),w!==null?rS(l,w):Ym(),qS(l);else return l.lanes=l.childLanes=536870912,iw(i,l,w!==null?w.baseLanes|d:d,d)}else w!==null?(of(l,w.cachePool),rS(l,w),mo(),l.memoizedState=null):(i!==null&&of(l,null),Ym(),mo());return Kn(i,l,x,d),l.child}function iw(i,l,d,h){var x=Fm();return x=x===null?null:{parent:Vn._currentValue,pool:x},l.memoizedState={baseLanes:d,cachePool:x},i!==null&&of(l,null),Ym(),qS(l),i!==null&&Xc(i,l,h,!0),null}function jf(i,l){var d=l.ref;if(d===null)i!==null&&i.ref!==null&&(l.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(r(284));(i===null||i.ref!==d)&&(l.flags|=4194816)}}function gg(i,l,d,h,x){return us(l),d=Zm(i,l,d,h,void 0,x),h=Jm(),i!==null&&!qn?(eg(i,l,x),Ri(i,l,x)):(qt&&h&&Mm(l),l.flags|=1,Kn(i,l,d,x),l.child)}function ow(i,l,d,h,x,w){return us(l),l.updateQueue=null,d=iS(l,h,d,x),aS(i),h=Jm(),i!==null&&!qn?(eg(i,l,w),Ri(i,l,w)):(qt&&h&&Mm(l),l.flags|=1,Kn(i,l,d,w),l.child)}function sw(i,l,d,h,x){if(us(l),l.stateNode===null){var w=gl,k=d.contextType;typeof k=="object"&&k!==null&&(w=rr(k)),w=new d(h,w),l.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=pg,l.stateNode=w,w._reactInternals=l,w=l.stateNode,w.props=h,w.state=l.memoizedState,w.refs={},qm(l),k=d.contextType,w.context=typeof k=="object"&&k!==null?rr(k):gl,w.state=l.memoizedState,k=d.getDerivedStateFromProps,typeof k=="function"&&(hg(l,d,k,h),w.state=l.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(k=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),k!==w.state&&pg.enqueueReplaceState(w,w.state,null),au(l,h,w,x),ru(),w.state=l.memoizedState),typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(i===null){w=l.stateNode;var N=l.memoizedProps,B=hs(d,N);w.props=B;var ne=w.context,ue=d.contextType;k=gl,typeof ue=="object"&&ue!==null&&(k=rr(ue));var pe=d.getDerivedStateFromProps;ue=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",N=l.pendingProps!==N,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(N||ne!==k)&&QS(l,w,h,k),co=!1;var ae=l.memoizedState;w.state=ae,au(l,h,w,x),ru(),ne=l.memoizedState,N||ae!==ne||co?(typeof pe=="function"&&(hg(l,d,pe,h),ne=l.memoizedState),(B=co||GS(l,d,B,h,ae,ne,k))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(l.flags|=4194308)):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ne),w.props=h,w.state=ne,w.context=k,h=B):(typeof w.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{w=l.stateNode,Gm(i,l),k=l.memoizedProps,ue=hs(d,k),w.props=ue,pe=l.pendingProps,ae=w.context,ne=d.contextType,B=gl,typeof ne=="object"&&ne!==null&&(B=rr(ne)),N=d.getDerivedStateFromProps,(ne=typeof N=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(k!==pe||ae!==B)&&QS(l,w,h,B),co=!1,ae=l.memoizedState,w.state=ae,au(l,h,w,x),ru();var ie=l.memoizedState;k!==pe||ae!==ie||co||i!==null&&i.dependencies!==null&&rf(i.dependencies)?(typeof N=="function"&&(hg(l,d,N,h),ie=l.memoizedState),(ue=co||GS(l,d,ue,h,ae,ie,B)||i!==null&&i.dependencies!==null&&rf(i.dependencies))?(ne||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(h,ie,B),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(h,ie,B)),typeof w.componentDidUpdate=="function"&&(l.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof w.componentDidUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ie),w.props=h,w.state=ie,w.context=B,h=ue):(typeof w.componentDidUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||k===i.memoizedProps&&ae===i.memoizedState||(l.flags|=1024),h=!1)}return w=h,jf(i,l),h=(l.flags&128)!==0,w||h?(w=l.stateNode,d=h&&typeof d.getDerivedStateFromError!="function"?null:w.render(),l.flags|=1,i!==null&&h?(l.child=Tl(l,i.child,null,x),l.child=Tl(l,null,d,x)):Kn(i,l,d,x),l.memoizedState=w.state,i=l.child):i=Ri(i,l,x),i}function lw(i,l,d,h){return Yc(),l.flags|=256,Kn(i,l,d,h),l.child}var vg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function yg(i){return{baseLanes:i,cachePool:Y1()}}function xg(i,l,d){return i=i!==null?i.childLanes&~d:0,l&&(i|=aa),i}function cw(i,l,d){var h=l.pendingProps,x=!1,w=(l.flags&128)!==0,k;if((k=w)||(k=i!==null&&i.memoizedState===null?!1:(Fn.current&2)!==0),k&&(x=!0,l.flags&=-129),k=(l.flags&32)!==0,l.flags&=-33,i===null){if(qt){if(x?po(l):mo(),qt){var N=Dn,B;if(B=N){e:{for(B=N,N=qa;B.nodeType!==8;){if(!N){N=null;break e}if(B=Da(B.nextSibling),B===null){N=null;break e}}N=B}N!==null?(l.memoizedState={dehydrated:N,treeContext:is!==null?{id:Si,overflow:wi}:null,retryLane:536870912,hydrationErrors:null},B=Lr(18,null,null,0),B.stateNode=N,B.return=l,l.child=B,ur=l,Dn=null,B=!0):B=!1}B||ls(l)}if(N=l.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return nv(N)?l.lanes=32:l.lanes=536870912,null;Ti(l)}return N=h.children,h=h.fallback,x?(mo(),x=l.mode,N=Cf({mode:"hidden",children:N},x),h=as(h,x,d,null),N.return=l,h.return=l,N.sibling=h,l.child=N,x=l.child,x.memoizedState=yg(d),x.childLanes=xg(i,k,d),l.memoizedState=vg,h):(po(l),bg(l,N))}if(B=i.memoizedState,B!==null&&(N=B.dehydrated,N!==null)){if(w)l.flags&256?(po(l),l.flags&=-257,l=Sg(i,l,d)):l.memoizedState!==null?(mo(),l.child=i.child,l.flags|=128,l=null):(mo(),x=h.fallback,N=l.mode,h=Cf({mode:"visible",children:h.children},N),x=as(x,N,d,null),x.flags|=2,h.return=l,x.return=l,h.sibling=x,l.child=h,Tl(l,i.child,null,d),h=l.child,h.memoizedState=yg(d),h.childLanes=xg(i,k,d),l.memoizedState=vg,l=x);else if(po(l),nv(N)){if(k=N.nextSibling&&N.nextSibling.dataset,k)var ne=k.dgst;k=ne,h=Error(r(419)),h.stack="",h.digest=k,Kc({value:h,source:null,stack:null}),l=Sg(i,l,d)}else if(qn||Xc(i,l,d,!1),k=(d&i.childLanes)!==0,qn||k){if(k=un,k!==null&&(h=d&-d,h=(h&42)!==0?1:ol(h),h=(h&(k.suspendedLanes|d))!==0?0:h,h!==0&&h!==B.retryLane))throw B.retryLane=h,ml(i,h),Vr(k,i,h),ew;N.data==="$?"||$g(),l=Sg(i,l,d)}else N.data==="$?"?(l.flags|=192,l.child=i.child,l=null):(i=B.treeContext,Dn=Da(N.nextSibling),ur=l,qt=!0,ss=null,qa=!1,i!==null&&(ta[na++]=Si,ta[na++]=wi,ta[na++]=is,Si=i.id,wi=i.overflow,is=l),l=bg(l,h.children),l.flags|=4096);return l}return x?(mo(),x=h.fallback,N=l.mode,B=i.child,ne=B.sibling,h=bi(B,{mode:"hidden",children:h.children}),h.subtreeFlags=B.subtreeFlags&65011712,ne!==null?x=bi(ne,x):(x=as(x,N,d,null),x.flags|=2),x.return=l,h.return=l,h.sibling=x,l.child=h,h=x,x=l.child,N=i.child.memoizedState,N===null?N=yg(d):(B=N.cachePool,B!==null?(ne=Vn._currentValue,B=B.parent!==ne?{parent:ne,pool:ne}:B):B=Y1(),N={baseLanes:N.baseLanes|d,cachePool:B}),x.memoizedState=N,x.childLanes=xg(i,k,d),l.memoizedState=vg,h):(po(l),d=i.child,i=d.sibling,d=bi(d,{mode:"visible",children:h.children}),d.return=l,d.sibling=null,i!==null&&(k=l.deletions,k===null?(l.deletions=[i],l.flags|=16):k.push(i)),l.child=d,l.memoizedState=null,d)}function bg(i,l){return l=Cf({mode:"visible",children:l},i.mode),l.return=i,i.child=l}function Cf(i,l){return i=Lr(22,i,null,l),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Sg(i,l,d){return Tl(l,i.child,null,d),i=bg(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function uw(i,l,d){i.lanes|=l;var h=i.alternate;h!==null&&(h.lanes|=l),$m(i.return,l,d)}function wg(i,l,d,h,x){var w=i.memoizedState;w===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:d,tailMode:x}:(w.isBackwards=l,w.rendering=null,w.renderingStartTime=0,w.last=h,w.tail=d,w.tailMode=x)}function dw(i,l,d){var h=l.pendingProps,x=h.revealOrder,w=h.tail;if(Kn(i,l,h.children,d),h=Fn.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&uw(i,d,l);else if(i.tag===19)uw(i,d,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}h&=1}switch(ee(Fn,h),x){case"forwards":for(d=l.child,x=null;d!==null;)i=d.alternate,i!==null&&bf(i)===null&&(x=d),d=d.sibling;d=x,d===null?(x=l.child,l.child=null):(x=d.sibling,d.sibling=null),wg(l,!1,x,d,w);break;case"backwards":for(d=null,x=l.child,l.child=null;x!==null;){if(i=x.alternate,i!==null&&bf(i)===null){l.child=x;break}i=x.sibling,x.sibling=d,d=x,x=i}wg(l,!0,d,null,w);break;case"together":wg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Ri(i,l,d){if(i!==null&&(l.dependencies=i.dependencies),bo|=l.lanes,(d&l.childLanes)===0)if(i!==null){if(Xc(i,l,d,!1),(d&l.childLanes)===0)return null}else return null;if(i!==null&&l.child!==i.child)throw Error(r(153));if(l.child!==null){for(i=l.child,d=bi(i,i.pendingProps),l.child=d,d.return=l;i.sibling!==null;)i=i.sibling,d=d.sibling=bi(i,i.pendingProps),d.return=l;d.sibling=null}return l.child}function jg(i,l){return(i.lanes&l)!==0?!0:(i=i.dependencies,!!(i!==null&&rf(i)))}function nP(i,l,d){switch(l.tag){case 3:ke(l,l.stateNode.containerInfo),lo(l,Vn,i.memoizedState.cache),Yc();break;case 27:case 5:Re(l);break;case 4:ke(l,l.stateNode.containerInfo);break;case 10:lo(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(po(l),l.flags|=128,null):(d&l.child.childLanes)!==0?cw(i,l,d):(po(l),i=Ri(i,l,d),i!==null?i.sibling:null);po(l);break;case 19:var x=(i.flags&128)!==0;if(h=(d&l.childLanes)!==0,h||(Xc(i,l,d,!1),h=(d&l.childLanes)!==0),x){if(h)return dw(i,l,d);l.flags|=128}if(x=l.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),ee(Fn,Fn.current),h)break;return null;case 22:case 23:return l.lanes=0,aw(i,l,d);case 24:lo(l,Vn,i.memoizedState.cache)}return Ri(i,l,d)}function fw(i,l,d){if(i!==null)if(i.memoizedProps!==l.pendingProps)qn=!0;else{if(!jg(i,d)&&(l.flags&128)===0)return qn=!1,nP(i,l,d);qn=(i.flags&131072)!==0}else qn=!1,qt&&(l.flags&1048576)!==0&&V1(l,nf,l.index);switch(l.lanes=0,l.tag){case 16:e:{i=l.pendingProps;var h=l.elementType,x=h._init;if(h=x(h._payload),l.type=h,typeof h=="function")Pm(h)?(i=hs(h,i),l.tag=1,l=sw(null,l,h,i,d)):(l.tag=0,l=gg(null,l,h,i,d));else{if(h!=null){if(x=h.$$typeof,x===T){l.tag=11,l=tw(null,l,h,i,d);break e}else if(x===M){l.tag=14,l=nw(null,l,h,i,d);break e}}throw l=W(h)||h,Error(r(306,l,""))}}return l;case 0:return gg(i,l,l.type,l.pendingProps,d);case 1:return h=l.type,x=hs(h,l.pendingProps),sw(i,l,h,x,d);case 3:e:{if(ke(l,l.stateNode.containerInfo),i===null)throw Error(r(387));h=l.pendingProps;var w=l.memoizedState;x=w.element,Gm(i,l),au(l,h,null,d);var k=l.memoizedState;if(h=k.cache,lo(l,Vn,h),h!==w.cache&&Um(l,[Vn],d,!0),ru(),h=k.element,w.isDehydrated)if(w={element:h,isDehydrated:!1,cache:k.cache},l.updateQueue.baseState=w,l.memoizedState=w,l.flags&256){l=lw(i,l,h,d);break e}else if(h!==x){x=Jr(Error(r(424)),l),Kc(x),l=lw(i,l,h,d);break e}else{switch(i=l.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Dn=Da(i.firstChild),ur=l,qt=!0,ss=null,qa=!0,d=HS(l,null,h,d),l.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(Yc(),h===x){l=Ri(i,l,d);break e}Kn(i,l,h,d)}l=l.child}return l;case 26:return jf(i,l),i===null?(d=gj(l.type,null,l.pendingProps,null))?l.memoizedState=d:qt||(d=l.type,i=l.pendingProps,h=zf(ve.current).createElement(d),h[he]=l,h[Ee]=i,Zn(h,d,i),kt(h),l.stateNode=h):l.memoizedState=gj(l.type,i.memoizedProps,l.pendingProps,i.memoizedState),null;case 27:return Re(l),i===null&&qt&&(h=l.stateNode=hj(l.type,l.pendingProps,ve.current),ur=l,qa=!0,x=Dn,Co(l.type)?(rv=x,Dn=Da(h.firstChild)):Dn=x),Kn(i,l,l.pendingProps.children,d),jf(i,l),i===null&&(l.flags|=4194304),l.child;case 5:return i===null&&qt&&((x=h=Dn)&&(h=_P(h,l.type,l.pendingProps,qa),h!==null?(l.stateNode=h,ur=l,Dn=Da(h.firstChild),qa=!1,x=!0):x=!1),x||ls(l)),Re(l),x=l.type,w=l.pendingProps,k=i!==null?i.memoizedProps:null,h=w.children,Jg(x,w)?h=null:k!==null&&Jg(x,k)&&(l.flags|=32),l.memoizedState!==null&&(x=Zm(i,l,W4,null,null,d),Tu._currentValue=x),jf(i,l),Kn(i,l,h,d),l.child;case 6:return i===null&&qt&&((i=d=Dn)&&(d=kP(d,l.pendingProps,qa),d!==null?(l.stateNode=d,ur=l,Dn=null,i=!0):i=!1),i||ls(l)),null;case 13:return cw(i,l,d);case 4:return ke(l,l.stateNode.containerInfo),h=l.pendingProps,i===null?l.child=Tl(l,null,h,d):Kn(i,l,h,d),l.child;case 11:return tw(i,l,l.type,l.pendingProps,d);case 7:return Kn(i,l,l.pendingProps,d),l.child;case 8:return Kn(i,l,l.pendingProps.children,d),l.child;case 12:return Kn(i,l,l.pendingProps.children,d),l.child;case 10:return h=l.pendingProps,lo(l,l.type,h.value),Kn(i,l,h.children,d),l.child;case 9:return x=l.type._context,h=l.pendingProps.children,us(l),x=rr(x),h=h(x),l.flags|=1,Kn(i,l,h,d),l.child;case 14:return nw(i,l,l.type,l.pendingProps,d);case 15:return rw(i,l,l.type,l.pendingProps,d);case 19:return dw(i,l,d);case 31:return h=l.pendingProps,d=l.mode,h={mode:h.mode,children:h.children},i===null?(d=Cf(h,d),d.ref=l.ref,l.child=d,d.return=l,l=d):(d=bi(i.child,h),d.ref=l.ref,l.child=d,d.return=l,l=d),l;case 22:return aw(i,l,d);case 24:return us(l),h=rr(Vn),i===null?(x=Fm(),x===null&&(x=un,w=Bm(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=d),x=w),l.memoizedState={parent:h,cache:x},qm(l),lo(l,Vn,x)):((i.lanes&d)!==0&&(Gm(i,l),au(l,null,null,d),ru()),x=i.memoizedState,w=l.memoizedState,x.parent!==h?(x={parent:h,cache:h},l.memoizedState=x,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=x),lo(l,Vn,h)):(h=w.cache,lo(l,Vn,h),h!==x.cache&&Um(l,[Vn],d,!0))),Kn(i,l,l.pendingProps.children,d),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function Di(i){i.flags|=4}function hw(i,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Sj(l)){if(l=ra.current,l!==null&&((Mt&4194048)===Mt?Ga!==null:(Mt&62914560)!==Mt&&(Mt&536870912)===0||l!==Ga))throw tu=Hm,K1;i.flags|=8192}}function Ef(i,l){l!==null&&(i.flags|=4),i.flags&16384&&(l=i.tag!==22?Zo():536870912,i.lanes|=l,_l|=l)}function du(i,l){if(!qt)switch(i.tailMode){case"hidden":l=i.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i.tail=null:d.sibling=null;break;case"collapsed":d=i.tail;for(var h=null;d!==null;)d.alternate!==null&&(h=d),d=d.sibling;h===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function wn(i){var l=i.alternate!==null&&i.alternate.child===i.child,d=0,h=0;if(l)for(var x=i.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)d|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=h,i.childLanes=d,l}function rP(i,l,d){var h=l.pendingProps;switch(Im(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return wn(l),null;case 1:return wn(l),null;case 3:return d=l.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Ci(Vn),et(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(i===null||i.child===null)&&(Wc(l)?Di(l):i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,q1())),wn(l),null;case 26:return d=l.memoizedState,i===null?(Di(l),d!==null?(wn(l),hw(l,d)):(wn(l),l.flags&=-16777217)):d?d!==i.memoizedState?(Di(l),wn(l),hw(l,d)):(wn(l),l.flags&=-16777217):(i.memoizedProps!==h&&Di(l),wn(l),l.flags&=-16777217),null;case 27:ft(l),d=ve.current;var x=l.type;if(i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Di(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return wn(l),null}i=ye.current,Wc(l)?F1(l):(i=hj(x,h,d),l.stateNode=i,Di(l))}return wn(l),null;case 5:if(ft(l),d=l.type,i!==null&&l.stateNode!=null)i.memoizedProps!==h&&Di(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return wn(l),null}if(i=ye.current,Wc(l))F1(l);else{switch(x=zf(ve.current),i){case 1:i=x.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:i=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":i=x.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":i=x.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":i=x.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof h.is=="string"?x.createElement("select",{is:h.is}):x.createElement("select"),h.multiple?i.multiple=!0:h.size&&(i.size=h.size);break;default:i=typeof h.is=="string"?x.createElement(d,{is:h.is}):x.createElement(d)}}i[he]=l,i[Ee]=h;e:for(x=l.child;x!==null;){if(x.tag===5||x.tag===6)i.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===l)break e;for(;x.sibling===null;){if(x.return===null||x.return===l)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}l.stateNode=i;e:switch(Zn(i,d,h),d){case"button":case"input":case"select":case"textarea":i=!!h.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Di(l)}}return wn(l),l.flags&=-16777217,null;case 6:if(i&&l.stateNode!=null)i.memoizedProps!==h&&Di(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(i=ve.current,Wc(l)){if(i=l.stateNode,d=l.memoizedProps,h=null,x=ur,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}i[he]=l,i=!!(i.nodeValue===d||h!==null&&h.suppressHydrationWarning===!0||oj(i.nodeValue,d)),i||ls(l)}else i=zf(i).createTextNode(h),i[he]=l,l.stateNode=i}return wn(l),null;case 13:if(h=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Wc(l),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[he]=l}else Yc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;wn(l),x=!1}else x=q1(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return l.flags&256?(Ti(l),l):(Ti(l),null)}if(Ti(l),(l.flags&128)!==0)return l.lanes=d,l;if(d=h!==null,i=i!==null&&i.memoizedState!==null,d){h=l.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool);var w=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(w=h.memoizedState.cachePool.pool),w!==x&&(h.flags|=2048)}return d!==i&&d&&(l.child.flags|=8192),Ef(l,l.updateQueue),wn(l),null;case 4:return et(),i===null&&Wg(l.stateNode.containerInfo),wn(l),null;case 10:return Ci(l.type),wn(l),null;case 19:if(Z(Fn),x=l.memoizedState,x===null)return wn(l),null;if(h=(l.flags&128)!==0,w=x.rendering,w===null)if(h)du(x,!1);else{if(An!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(w=bf(i),w!==null){for(l.flags|=128,du(x,!1),i=w.updateQueue,l.updateQueue=i,Ef(l,i),l.subtreeFlags=0,i=d,d=l.child;d!==null;)B1(d,i),d=d.sibling;return ee(Fn,Fn.current&1|2),l.child}i=i.sibling}x.tail!==null&&Se()>Df&&(l.flags|=128,h=!0,du(x,!1),l.lanes=4194304)}else{if(!h)if(i=bf(w),i!==null){if(l.flags|=128,h=!0,i=i.updateQueue,l.updateQueue=i,Ef(l,i),du(x,!0),x.tail===null&&x.tailMode==="hidden"&&!w.alternate&&!qt)return wn(l),null}else 2*Se()-x.renderingStartTime>Df&&d!==536870912&&(l.flags|=128,h=!0,du(x,!1),l.lanes=4194304);x.isBackwards?(w.sibling=l.child,l.child=w):(i=x.last,i!==null?i.sibling=w:l.child=w,x.last=w)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Se(),l.sibling=null,i=Fn.current,ee(Fn,h?i&1|2:i&1),l):(wn(l),null);case 22:case 23:return Ti(l),Km(),h=l.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(d&536870912)!==0&&(l.flags&128)===0&&(wn(l),l.subtreeFlags&6&&(l.flags|=8192)):wn(l),d=l.updateQueue,d!==null&&Ef(l,d.retryQueue),d=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==d&&(l.flags|=2048),i!==null&&Z(ds),null;case 24:return d=null,i!==null&&(d=i.memoizedState.cache),l.memoizedState.cache!==d&&(l.flags|=2048),Ci(Vn),wn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function aP(i,l){switch(Im(l),l.tag){case 1:return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Ci(Vn),et(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 26:case 27:case 5:return ft(l),null;case 13:if(Ti(l),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Yc()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return Z(Fn),null;case 4:return et(),null;case 10:return Ci(l.type),null;case 22:case 23:return Ti(l),Km(),i!==null&&Z(ds),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 24:return Ci(Vn),null;case 25:return null;default:return null}}function pw(i,l){switch(Im(l),l.tag){case 3:Ci(Vn),et();break;case 26:case 27:case 5:ft(l);break;case 4:et();break;case 13:Ti(l);break;case 19:Z(Fn);break;case 10:Ci(l.type);break;case 22:case 23:Ti(l),Km(),i!==null&&Z(ds);break;case 24:Ci(Vn)}}function fu(i,l){try{var d=l.updateQueue,h=d!==null?d.lastEffect:null;if(h!==null){var x=h.next;d=x;do{if((d.tag&i)===i){h=void 0;var w=d.create,k=d.inst;h=w(),k.destroy=h}d=d.next}while(d!==x)}}catch(N){an(l,l.return,N)}}function go(i,l,d){try{var h=l.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var w=x.next;h=w;do{if((h.tag&i)===i){var k=h.inst,N=k.destroy;if(N!==void 0){k.destroy=void 0,x=l;var B=d,ne=N;try{ne()}catch(ue){an(x,B,ue)}}}h=h.next}while(h!==w)}}catch(ue){an(l,l.return,ue)}}function mw(i){var l=i.updateQueue;if(l!==null){var d=i.stateNode;try{nS(l,d)}catch(h){an(i,i.return,h)}}}function gw(i,l,d){d.props=hs(i.type,i.memoizedProps),d.state=i.memoizedState;try{d.componentWillUnmount()}catch(h){an(i,l,h)}}function hu(i,l){try{var d=i.ref;if(d!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof d=="function"?i.refCleanup=d(h):d.current=h}}catch(x){an(i,l,x)}}function Qa(i,l){var d=i.ref,h=i.refCleanup;if(d!==null)if(typeof h=="function")try{h()}catch(x){an(i,l,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(x){an(i,l,x)}else d.current=null}function vw(i){var l=i.type,d=i.memoizedProps,h=i.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":d.autoFocus&&h.focus();break e;case"img":d.src?h.src=d.src:d.srcSet&&(h.srcset=d.srcSet)}}catch(x){an(i,i.return,x)}}function Cg(i,l,d){try{var h=i.stateNode;EP(h,i.type,d,l),h[Ee]=l}catch(x){an(i,i.return,x)}}function yw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Co(i.type)||i.tag===4}function Eg(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||yw(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Co(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Tg(i,l,d){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(i,l):(l=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,l.appendChild(i),d=d._reactRootContainer,d!=null||l.onclick!==null||(l.onclick=Lf));else if(h!==4&&(h===27&&Co(i.type)&&(d=i.stateNode,l=null),i=i.child,i!==null))for(Tg(i,l,d),i=i.sibling;i!==null;)Tg(i,l,d),i=i.sibling}function Tf(i,l,d){var h=i.tag;if(h===5||h===6)i=i.stateNode,l?d.insertBefore(i,l):d.appendChild(i);else if(h!==4&&(h===27&&Co(i.type)&&(d=i.stateNode),i=i.child,i!==null))for(Tf(i,l,d),i=i.sibling;i!==null;)Tf(i,l,d),i=i.sibling}function xw(i){var l=i.stateNode,d=i.memoizedProps;try{for(var h=i.type,x=l.attributes;x.length;)l.removeAttributeNode(x[0]);Zn(l,h,d),l[he]=i,l[Ee]=d}catch(w){an(i,i.return,w)}}var Ai=!1,Nn=!1,Rg=!1,bw=typeof WeakSet=="function"?WeakSet:Set,Gn=null;function iP(i,l){if(i=i.containerInfo,Xg=Hf,i=k1(i),Em(i)){if("selectionStart"in i)var d={start:i.selectionStart,end:i.selectionEnd};else e:{d=(d=i.ownerDocument)&&d.defaultView||window;var h=d.getSelection&&d.getSelection();if(h&&h.rangeCount!==0){d=h.anchorNode;var x=h.anchorOffset,w=h.focusNode;h=h.focusOffset;try{d.nodeType,w.nodeType}catch{d=null;break e}var k=0,N=-1,B=-1,ne=0,ue=0,pe=i,ae=null;t:for(;;){for(var ie;pe!==d||x!==0&&pe.nodeType!==3||(N=k+x),pe!==w||h!==0&&pe.nodeType!==3||(B=k+h),pe.nodeType===3&&(k+=pe.nodeValue.length),(ie=pe.firstChild)!==null;)ae=pe,pe=ie;for(;;){if(pe===i)break t;if(ae===d&&++ne===x&&(N=k),ae===w&&++ue===h&&(B=k),(ie=pe.nextSibling)!==null)break;pe=ae,ae=pe.parentNode}pe=ie}d=N===-1||B===-1?null:{start:N,end:B}}else d=null}d=d||{start:0,end:0}}else d=null;for(Zg={focusedElem:i,selectionRange:d},Hf=!1,Gn=l;Gn!==null;)if(l=Gn,i=l.child,(l.subtreeFlags&1024)!==0&&i!==null)i.return=l,Gn=i;else for(;Gn!==null;){switch(l=Gn,w=l.alternate,i=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,d=l,x=w.memoizedProps,w=w.memoizedState,h=d.stateNode;try{var ut=hs(d.type,x,d.elementType===d.type);i=h.getSnapshotBeforeUpdate(ut,w),h.__reactInternalSnapshotBeforeUpdate=i}catch(it){an(d,d.return,it)}}break;case 3:if((i&1024)!==0){if(i=l.stateNode.containerInfo,d=i.nodeType,d===9)tv(i);else if(d===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":tv(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=l.sibling,i!==null){i.return=l.return,Gn=i;break}Gn=l.return}}function Sw(i,l,d){var h=d.flags;switch(d.tag){case 0:case 11:case 15:vo(i,d),h&4&&fu(5,d);break;case 1:if(vo(i,d),h&4)if(i=d.stateNode,l===null)try{i.componentDidMount()}catch(k){an(d,d.return,k)}else{var x=hs(d.type,l.memoizedProps);l=l.memoizedState;try{i.componentDidUpdate(x,l,i.__reactInternalSnapshotBeforeUpdate)}catch(k){an(d,d.return,k)}}h&64&&mw(d),h&512&&hu(d,d.return);break;case 3:if(vo(i,d),h&64&&(i=d.updateQueue,i!==null)){if(l=null,d.child!==null)switch(d.child.tag){case 27:case 5:l=d.child.stateNode;break;case 1:l=d.child.stateNode}try{nS(i,l)}catch(k){an(d,d.return,k)}}break;case 27:l===null&&h&4&&xw(d);case 26:case 5:vo(i,d),l===null&&h&4&&vw(d),h&512&&hu(d,d.return);break;case 12:vo(i,d);break;case 13:vo(i,d),h&4&&Cw(i,d),h&64&&(i=d.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(d=pP.bind(null,d),PP(i,d))));break;case 22:if(h=d.memoizedState!==null||Ai,!h){l=l!==null&&l.memoizedState!==null||Nn,x=Ai;var w=Nn;Ai=h,(Nn=l)&&!w?yo(i,d,(d.subtreeFlags&8772)!==0):vo(i,d),Ai=x,Nn=w}break;case 30:break;default:vo(i,d)}}function ww(i){var l=i.alternate;l!==null&&(i.alternate=null,ww(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&Ye(l)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var bn=null,Cr=!1;function _i(i,l,d){for(d=d.child;d!==null;)jw(i,l,d),d=d.sibling}function jw(i,l,d){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(gt,d)}catch{}switch(d.tag){case 26:Nn||Qa(d,l),_i(i,l,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Nn||Qa(d,l);var h=bn,x=Cr;Co(d.type)&&(bn=d.stateNode,Cr=!1),_i(i,l,d),wu(d.stateNode),bn=h,Cr=x;break;case 5:Nn||Qa(d,l);case 6:if(h=bn,x=Cr,bn=null,_i(i,l,d),bn=h,Cr=x,bn!==null)if(Cr)try{(bn.nodeType===9?bn.body:bn.nodeName==="HTML"?bn.ownerDocument.body:bn).removeChild(d.stateNode)}catch(w){an(d,l,w)}else try{bn.removeChild(d.stateNode)}catch(w){an(d,l,w)}break;case 18:bn!==null&&(Cr?(i=bn,dj(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,d.stateNode),_u(i)):dj(bn,d.stateNode));break;case 4:h=bn,x=Cr,bn=d.stateNode.containerInfo,Cr=!0,_i(i,l,d),bn=h,Cr=x;break;case 0:case 11:case 14:case 15:Nn||go(2,d,l),Nn||go(4,d,l),_i(i,l,d);break;case 1:Nn||(Qa(d,l),h=d.stateNode,typeof h.componentWillUnmount=="function"&&gw(d,l,h)),_i(i,l,d);break;case 21:_i(i,l,d);break;case 22:Nn=(h=Nn)||d.memoizedState!==null,_i(i,l,d),Nn=h;break;default:_i(i,l,d)}}function Cw(i,l){if(l.memoizedState===null&&(i=l.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{_u(i)}catch(d){an(l,l.return,d)}}function oP(i){switch(i.tag){case 13:case 19:var l=i.stateNode;return l===null&&(l=i.stateNode=new bw),l;case 22:return i=i.stateNode,l=i._retryCache,l===null&&(l=i._retryCache=new bw),l;default:throw Error(r(435,i.tag))}}function Dg(i,l){var d=oP(i);l.forEach(function(h){var x=mP.bind(null,i,h);d.has(h)||(d.add(h),h.then(x,x))})}function zr(i,l){var d=l.deletions;if(d!==null)for(var h=0;h<d.length;h++){var x=d[h],w=i,k=l,N=k;e:for(;N!==null;){switch(N.tag){case 27:if(Co(N.type)){bn=N.stateNode,Cr=!1;break e}break;case 5:bn=N.stateNode,Cr=!1;break e;case 3:case 4:bn=N.stateNode.containerInfo,Cr=!0;break e}N=N.return}if(bn===null)throw Error(r(160));jw(w,k,x),bn=null,Cr=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Ew(l,i),l=l.sibling}var Ra=null;function Ew(i,l){var d=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:zr(l,i),$r(i),h&4&&(go(3,i,i.return),fu(3,i),go(5,i,i.return));break;case 1:zr(l,i),$r(i),h&512&&(Nn||d===null||Qa(d,d.return)),h&64&&Ai&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(d=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=d===null?h:d.concat(h))));break;case 26:var x=Ra;if(zr(l,i),$r(i),h&512&&(Nn||d===null||Qa(d,d.return)),h&4){var w=d!==null?d.memoizedState:null;if(h=i.memoizedState,d===null)if(h===null)if(i.stateNode===null){e:{h=i.type,d=i.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":w=x.getElementsByTagName("title")[0],(!w||w[rt]||w[he]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(h),x.head.insertBefore(w,x.querySelector("head > title"))),Zn(w,h,d),w[he]=i,kt(w),h=w;break e;case"link":var k=xj("link","href",x).get(h+(d.href||""));if(k){for(var N=0;N<k.length;N++)if(w=k[N],w.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&w.getAttribute("rel")===(d.rel==null?null:d.rel)&&w.getAttribute("title")===(d.title==null?null:d.title)&&w.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){k.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;case"meta":if(k=xj("meta","content",x).get(h+(d.content||""))){for(N=0;N<k.length;N++)if(w=k[N],w.getAttribute("content")===(d.content==null?null:""+d.content)&&w.getAttribute("name")===(d.name==null?null:d.name)&&w.getAttribute("property")===(d.property==null?null:d.property)&&w.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&w.getAttribute("charset")===(d.charSet==null?null:d.charSet)){k.splice(N,1);break t}}w=x.createElement(h),Zn(w,h,d),x.head.appendChild(w);break;default:throw Error(r(468,h))}w[he]=i,kt(w),h=w}i.stateNode=h}else bj(x,i.type,i.stateNode);else i.stateNode=yj(x,h,i.memoizedProps);else w!==h?(w===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):w.count--,h===null?bj(x,i.type,i.stateNode):yj(x,h,i.memoizedProps)):h===null&&i.stateNode!==null&&Cg(i,i.memoizedProps,d.memoizedProps)}break;case 27:zr(l,i),$r(i),h&512&&(Nn||d===null||Qa(d,d.return)),d!==null&&h&4&&Cg(i,i.memoizedProps,d.memoizedProps);break;case 5:if(zr(l,i),$r(i),h&512&&(Nn||d===null||Qa(d,d.return)),i.flags&32){x=i.stateNode;try{ll(x,"")}catch(ie){an(i,i.return,ie)}}h&4&&i.stateNode!=null&&(x=i.memoizedProps,Cg(i,x,d!==null?d.memoizedProps:x)),h&1024&&(Rg=!0);break;case 6:if(zr(l,i),$r(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,d=i.stateNode;try{d.nodeValue=h}catch(ie){an(i,i.return,ie)}}break;case 3:if(Bf=null,x=Ra,Ra=$f(l.containerInfo),zr(l,i),Ra=x,$r(i),h&4&&d!==null&&d.memoizedState.isDehydrated)try{_u(l.containerInfo)}catch(ie){an(i,i.return,ie)}Rg&&(Rg=!1,Tw(i));break;case 4:h=Ra,Ra=$f(i.stateNode.containerInfo),zr(l,i),$r(i),Ra=h;break;case 12:zr(l,i),$r(i);break;case 13:zr(l,i),$r(i),i.child.flags&8192&&i.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Og=Se()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Dg(i,h)));break;case 22:x=i.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,ne=Ai,ue=Nn;if(Ai=ne||x,Nn=ue||B,zr(l,i),Nn=ue,Ai=ne,$r(i),h&8192)e:for(l=i.stateNode,l._visibility=x?l._visibility&-2:l._visibility|1,x&&(d===null||B||Ai||Nn||ps(i)),d=null,l=i;;){if(l.tag===5||l.tag===26){if(d===null){B=d=l;try{if(w=B.stateNode,x)k=w.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{N=B.stateNode;var pe=B.memoizedProps.style,ae=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(ie){an(B,B.return,ie)}}}else if(l.tag===6){if(d===null){B=l;try{B.stateNode.nodeValue=x?"":B.memoizedProps}catch(ie){an(B,B.return,ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===i)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break e;for(;l.sibling===null;){if(l.return===null||l.return===i)break e;d===l&&(d=null),l=l.return}d===l&&(d=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=i.updateQueue,h!==null&&(d=h.retryQueue,d!==null&&(h.retryQueue=null,Dg(i,d))));break;case 19:zr(l,i),$r(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Dg(i,h)));break;case 30:break;case 21:break;default:zr(l,i),$r(i)}}function $r(i){var l=i.flags;if(l&2){try{for(var d,h=i.return;h!==null;){if(yw(h)){d=h;break}h=h.return}if(d==null)throw Error(r(160));switch(d.tag){case 27:var x=d.stateNode,w=Eg(i);Tf(i,w,x);break;case 5:var k=d.stateNode;d.flags&32&&(ll(k,""),d.flags&=-33);var N=Eg(i);Tf(i,N,k);break;case 3:case 4:var B=d.stateNode.containerInfo,ne=Eg(i);Tg(i,ne,B);break;default:throw Error(r(161))}}catch(ue){an(i,i.return,ue)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function Tw(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var l=i;Tw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),i=i.sibling}}function vo(i,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Sw(i,l.alternate,l),l=l.sibling}function ps(i){for(i=i.child;i!==null;){var l=i;switch(l.tag){case 0:case 11:case 14:case 15:go(4,l,l.return),ps(l);break;case 1:Qa(l,l.return);var d=l.stateNode;typeof d.componentWillUnmount=="function"&&gw(l,l.return,d),ps(l);break;case 27:wu(l.stateNode);case 26:case 5:Qa(l,l.return),ps(l);break;case 22:l.memoizedState===null&&ps(l);break;case 30:ps(l);break;default:ps(l)}i=i.sibling}}function yo(i,l,d){for(d=d&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,x=i,w=l,k=w.flags;switch(w.tag){case 0:case 11:case 15:yo(x,w,d),fu(4,w);break;case 1:if(yo(x,w,d),h=w,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ne){an(h,h.return,ne)}if(h=w,x=h.updateQueue,x!==null){var N=h.stateNode;try{var B=x.shared.hiddenCallbacks;if(B!==null)for(x.shared.hiddenCallbacks=null,x=0;x<B.length;x++)tS(B[x],N)}catch(ne){an(h,h.return,ne)}}d&&k&64&&mw(w),hu(w,w.return);break;case 27:xw(w);case 26:case 5:yo(x,w,d),d&&h===null&&k&4&&vw(w),hu(w,w.return);break;case 12:yo(x,w,d);break;case 13:yo(x,w,d),d&&k&4&&Cw(x,w);break;case 22:w.memoizedState===null&&yo(x,w,d),hu(w,w.return);break;case 30:break;default:yo(x,w,d)}l=l.sibling}}function Ag(i,l){var d=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),i=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(i=l.memoizedState.cachePool.pool),i!==d&&(i!=null&&i.refCount++,d!=null&&Zc(d))}function _g(i,l){i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Zc(i))}function Wa(i,l,d,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Rw(i,l,d,h),l=l.sibling}function Rw(i,l,d,h){var x=l.flags;switch(l.tag){case 0:case 11:case 15:Wa(i,l,d,h),x&2048&&fu(9,l);break;case 1:Wa(i,l,d,h);break;case 3:Wa(i,l,d,h),x&2048&&(i=null,l.alternate!==null&&(i=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==i&&(l.refCount++,i!=null&&Zc(i)));break;case 12:if(x&2048){Wa(i,l,d,h),i=l.stateNode;try{var w=l.memoizedProps,k=w.id,N=w.onPostCommit;typeof N=="function"&&N(k,l.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(B){an(l,l.return,B)}}else Wa(i,l,d,h);break;case 13:Wa(i,l,d,h);break;case 23:break;case 22:w=l.stateNode,k=l.alternate,l.memoizedState!==null?w._visibility&2?Wa(i,l,d,h):pu(i,l):w._visibility&2?Wa(i,l,d,h):(w._visibility|=2,Rl(i,l,d,h,(l.subtreeFlags&10256)!==0)),x&2048&&Ag(k,l);break;case 24:Wa(i,l,d,h),x&2048&&_g(l.alternate,l);break;default:Wa(i,l,d,h)}}function Rl(i,l,d,h,x){for(x=x&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var w=i,k=l,N=d,B=h,ne=k.flags;switch(k.tag){case 0:case 11:case 15:Rl(w,k,N,B,x),fu(8,k);break;case 23:break;case 22:var ue=k.stateNode;k.memoizedState!==null?ue._visibility&2?Rl(w,k,N,B,x):pu(w,k):(ue._visibility|=2,Rl(w,k,N,B,x)),x&&ne&2048&&Ag(k.alternate,k);break;case 24:Rl(w,k,N,B,x),x&&ne&2048&&_g(k.alternate,k);break;default:Rl(w,k,N,B,x)}l=l.sibling}}function pu(i,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var d=i,h=l,x=h.flags;switch(h.tag){case 22:pu(d,h),x&2048&&Ag(h.alternate,h);break;case 24:pu(d,h),x&2048&&_g(h.alternate,h);break;default:pu(d,h)}l=l.sibling}}var mu=8192;function Dl(i){if(i.subtreeFlags&mu)for(i=i.child;i!==null;)Dw(i),i=i.sibling}function Dw(i){switch(i.tag){case 26:Dl(i),i.flags&mu&&i.memoizedState!==null&&qP(Ra,i.memoizedState,i.memoizedProps);break;case 5:Dl(i);break;case 3:case 4:var l=Ra;Ra=$f(i.stateNode.containerInfo),Dl(i),Ra=l;break;case 22:i.memoizedState===null&&(l=i.alternate,l!==null&&l.memoizedState!==null?(l=mu,mu=16777216,Dl(i),mu=l):Dl(i));break;default:Dl(i)}}function Aw(i){var l=i.alternate;if(l!==null&&(i=l.child,i!==null)){l.child=null;do l=i.sibling,i.sibling=null,i=l;while(i!==null)}}function gu(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];Gn=h,kw(h,i)}Aw(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)_w(i),i=i.sibling}function _w(i){switch(i.tag){case 0:case 11:case 15:gu(i),i.flags&2048&&go(9,i,i.return);break;case 3:gu(i);break;case 12:gu(i);break;case 22:var l=i.stateNode;i.memoizedState!==null&&l._visibility&2&&(i.return===null||i.return.tag!==13)?(l._visibility&=-3,Rf(i)):gu(i);break;default:gu(i)}}function Rf(i){var l=i.deletions;if((i.flags&16)!==0){if(l!==null)for(var d=0;d<l.length;d++){var h=l[d];Gn=h,kw(h,i)}Aw(i)}for(i=i.child;i!==null;){switch(l=i,l.tag){case 0:case 11:case 15:go(8,l,l.return),Rf(l);break;case 22:d=l.stateNode,d._visibility&2&&(d._visibility&=-3,Rf(l));break;default:Rf(l)}i=i.sibling}}function kw(i,l){for(;Gn!==null;){var d=Gn;switch(d.tag){case 0:case 11:case 15:go(8,d,l);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var h=d.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Zc(d.memoizedState.cache)}if(h=d.child,h!==null)h.return=d,Gn=h;else e:for(d=i;Gn!==null;){h=Gn;var x=h.sibling,w=h.return;if(ww(h),h===d){Gn=null;break e}if(x!==null){x.return=w,Gn=x;break e}Gn=w}}}var sP={getCacheForType:function(i){var l=rr(Vn),d=l.data.get(i);return d===void 0&&(d=i(),l.data.set(i,d)),d}},lP=typeof WeakMap=="function"?WeakMap:Map,Kt=0,un=null,Tt=null,Mt=0,Xt=0,Ur=null,xo=!1,Al=!1,kg=!1,ki=0,An=0,bo=0,ms=0,Pg=0,aa=0,_l=0,vu=null,Er=null,Ng=!1,Og=0,Df=1/0,Af=null,So=null,Xn=0,wo=null,kl=null,Pl=0,Mg=0,Ig=null,Pw=null,yu=0,Lg=null;function Br(){if((Kt&2)!==0&&Mt!==0)return Mt&-Mt;if(P.T!==null){var i=xl;return i!==0?i:Hg()}return H()}function Nw(){aa===0&&(aa=(Mt&536870912)===0||qt?ro():536870912);var i=ra.current;return i!==null&&(i.flags|=32),aa}function Vr(i,l,d){(i===un&&(Xt===2||Xt===9)||i.cancelPendingCommit!==null)&&(Nl(i,0),jo(i,Mt,aa,!1)),wa(i,d),((Kt&2)===0||i!==un)&&(i===un&&((Kt&2)===0&&(ms|=d),An===4&&jo(i,Mt,aa,!1)),Ya(i))}function Ow(i,l,d){if((Kt&6)!==0)throw Error(r(327));var h=!d&&(l&124)===0&&(l&i.expiredLanes)===0||xr(i,l),x=h?dP(i,l):Ug(i,l,!0),w=h;do{if(x===0){Al&&!h&&jo(i,l,0,!1);break}else{if(d=i.current.alternate,w&&!cP(d)){x=Ug(i,l,!1),w=!1;continue}if(x===2){if(w=l,i.errorRecoveryDisabledLanes&w)var k=0;else k=i.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){l=k;e:{var N=i;x=vu;var B=N.current.memoizedState.isDehydrated;if(B&&(Nl(N,k).flags|=256),k=Ug(N,k,!1),k!==2){if(kg&&!B){N.errorRecoveryDisabledLanes|=w,ms|=w,x=4;break e}w=Er,Er=x,w!==null&&(Er===null?Er=w:Er.push.apply(Er,w))}x=k}if(w=!1,x!==2)continue}}if(x===1){Nl(i,0),jo(i,l,0,!0);break}e:{switch(h=i,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:jo(h,l,aa,!xo);break e;case 2:Er=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(x=Og+300-Se(),10<x)){if(jo(h,l,aa,!xo),Yn(h,0,!0)!==0)break e;h.timeoutHandle=cj(Mw.bind(null,h,d,Er,Af,Ng,l,aa,ms,_l,xo,w,2,-0,0),x);break e}Mw(h,d,Er,Af,Ng,l,aa,ms,_l,xo,w,0,-0,0)}}break}while(!0);Ya(i)}function Mw(i,l,d,h,x,w,k,N,B,ne,ue,pe,ae,ie){if(i.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Eu={stylesheets:null,count:0,unsuspend:HP},Dw(l),pe=GP(),pe!==null)){i.cancelPendingCommit=pe(Vw.bind(null,i,l,w,d,h,x,k,N,B,ue,1,ae,ie)),jo(i,w,k,!ne);return}Vw(i,l,w,d,h,x,k,N,B)}function cP(i){for(var l=i;;){var d=l.tag;if((d===0||d===11||d===15)&&l.flags&16384&&(d=l.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var h=0;h<d.length;h++){var x=d[h],w=x.getSnapshot;x=x.value;try{if(!Ir(w(),x))return!1}catch{return!1}}if(d=l.child,l.subtreeFlags&16384&&d!==null)d.return=l,l=d;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function jo(i,l,d,h){l&=~Pg,l&=~ms,i.suspendedLanes|=l,i.pingedLanes&=~l,h&&(i.warmLanes|=l),h=i.expirationTimes;for(var x=l;0<x;){var w=31-_t(x),k=1<<w;h[w]=-1,x&=~k}d!==0&&kn(i,d,l)}function _f(){return(Kt&6)===0?(xu(0),!1):!0}function zg(){if(Tt!==null){if(Xt===0)var i=Tt.return;else i=Tt,ji=cs=null,tg(i),El=null,cu=0,i=Tt;for(;i!==null;)pw(i.alternate,i),i=i.return;Tt=null}}function Nl(i,l){var d=i.timeoutHandle;d!==-1&&(i.timeoutHandle=-1,RP(d)),d=i.cancelPendingCommit,d!==null&&(i.cancelPendingCommit=null,d()),zg(),un=i,Tt=d=bi(i.current,null),Mt=l,Xt=0,Ur=null,xo=!1,Al=xr(i,l),kg=!1,_l=aa=Pg=ms=bo=An=0,Er=vu=null,Ng=!1,(l&8)!==0&&(l|=l&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=l;0<h;){var x=31-_t(h),w=1<<x;l|=i[x],h&=~w}return ki=l,Xd(),d}function Iw(i,l){wt=null,P.H=vf,l===eu||l===sf?(l=J1(),Xt=3):l===K1?(l=J1(),Xt=4):Xt=l===ew?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Ur=l,Tt===null&&(An=1,wf(i,Jr(l,i.current)))}function Lw(){var i=P.H;return P.H=vf,i===null?vf:i}function zw(){var i=P.A;return P.A=sP,i}function $g(){An=4,xo||(Mt&4194048)!==Mt&&ra.current!==null||(Al=!0),(bo&134217727)===0&&(ms&134217727)===0||un===null||jo(un,Mt,aa,!1)}function Ug(i,l,d){var h=Kt;Kt|=2;var x=Lw(),w=zw();(un!==i||Mt!==l)&&(Af=null,Nl(i,l)),l=!1;var k=An;e:do try{if(Xt!==0&&Tt!==null){var N=Tt,B=Ur;switch(Xt){case 8:zg(),k=6;break e;case 3:case 2:case 9:case 6:ra.current===null&&(l=!0);var ne=Xt;if(Xt=0,Ur=null,Ol(i,N,B,ne),d&&Al){k=0;break e}break;default:ne=Xt,Xt=0,Ur=null,Ol(i,N,B,ne)}}uP(),k=An;break}catch(ue){Iw(i,ue)}while(!0);return l&&i.shellSuspendCounter++,ji=cs=null,Kt=h,P.H=x,P.A=w,Tt===null&&(un=null,Mt=0,Xd()),k}function uP(){for(;Tt!==null;)$w(Tt)}function dP(i,l){var d=Kt;Kt|=2;var h=Lw(),x=zw();un!==i||Mt!==l?(Af=null,Df=Se()+500,Nl(i,l)):Al=xr(i,l);e:do try{if(Xt!==0&&Tt!==null){l=Tt;var w=Ur;t:switch(Xt){case 1:Xt=0,Ur=null,Ol(i,l,w,1);break;case 2:case 9:if(X1(w)){Xt=0,Ur=null,Uw(l);break}l=function(){Xt!==2&&Xt!==9||un!==i||(Xt=7),Ya(i)},w.then(l,l);break e;case 3:Xt=7;break e;case 4:Xt=5;break e;case 7:X1(w)?(Xt=0,Ur=null,Uw(l)):(Xt=0,Ur=null,Ol(i,l,w,7));break;case 5:var k=null;switch(Tt.tag){case 26:k=Tt.memoizedState;case 5:case 27:var N=Tt;if(!k||Sj(k)){Xt=0,Ur=null;var B=N.sibling;if(B!==null)Tt=B;else{var ne=N.return;ne!==null?(Tt=ne,kf(ne)):Tt=null}break t}}Xt=0,Ur=null,Ol(i,l,w,5);break;case 6:Xt=0,Ur=null,Ol(i,l,w,6);break;case 8:zg(),An=6;break e;default:throw Error(r(462))}}fP();break}catch(ue){Iw(i,ue)}while(!0);return ji=cs=null,P.H=h,P.A=x,Kt=d,Tt!==null?0:(un=null,Mt=0,Xd(),An)}function fP(){for(;Tt!==null&&!Ht();)$w(Tt)}function $w(i){var l=fw(i.alternate,i,ki);i.memoizedProps=i.pendingProps,l===null?kf(i):Tt=l}function Uw(i){var l=i,d=l.alternate;switch(l.tag){case 15:case 0:l=ow(d,l,l.pendingProps,l.type,void 0,Mt);break;case 11:l=ow(d,l,l.pendingProps,l.type.render,l.ref,Mt);break;case 5:tg(l);default:pw(d,l),l=Tt=B1(l,ki),l=fw(d,l,ki)}i.memoizedProps=i.pendingProps,l===null?kf(i):Tt=l}function Ol(i,l,d,h){ji=cs=null,tg(l),El=null,cu=0;var x=l.return;try{if(tP(i,x,l,d,Mt)){An=1,wf(i,Jr(d,i.current)),Tt=null;return}}catch(w){if(x!==null)throw Tt=x,w;An=1,wf(i,Jr(d,i.current)),Tt=null;return}l.flags&32768?(qt||h===1?i=!0:Al||(Mt&536870912)!==0?i=!1:(xo=i=!0,(h===2||h===9||h===3||h===6)&&(h=ra.current,h!==null&&h.tag===13&&(h.flags|=16384))),Bw(l,i)):kf(l)}function kf(i){var l=i;do{if((l.flags&32768)!==0){Bw(l,xo);return}i=l.return;var d=rP(l.alternate,l,ki);if(d!==null){Tt=d;return}if(l=l.sibling,l!==null){Tt=l;return}Tt=l=i}while(l!==null);An===0&&(An=5)}function Bw(i,l){do{var d=aP(i.alternate,i);if(d!==null){d.flags&=32767,Tt=d;return}if(d=i.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!l&&(i=i.sibling,i!==null)){Tt=i;return}Tt=i=d}while(i!==null);An=6,Tt=null}function Vw(i,l,d,h,x,w,k,N,B){i.cancelPendingCommit=null;do Pf();while(Xn!==0);if((Kt&6)!==0)throw Error(r(327));if(l!==null){if(l===i.current)throw Error(r(177));if(w=l.lanes|l.childLanes,w|=_m,ja(i,d,w,k,N,B),i===un&&(Tt=un=null,Mt=0),kl=l,wo=i,Pl=d,Mg=w,Ig=x,Pw=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,gP(ge,function(){return Qw(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=P.T,P.T=null,x=I.p,I.p=2,k=Kt,Kt|=4;try{iP(i,l,d)}finally{Kt=k,I.p=x,P.T=h}}Xn=1,Fw(),Hw(),qw()}}function Fw(){if(Xn===1){Xn=0;var i=wo,l=kl,d=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||d){d=P.T,P.T=null;var h=I.p;I.p=2;var x=Kt;Kt|=4;try{Ew(l,i);var w=Zg,k=k1(i.containerInfo),N=w.focusedElem,B=w.selectionRange;if(k!==N&&N&&N.ownerDocument&&_1(N.ownerDocument.documentElement,N)){if(B!==null&&Em(N)){var ne=B.start,ue=B.end;if(ue===void 0&&(ue=ne),"selectionStart"in N)N.selectionStart=ne,N.selectionEnd=Math.min(ue,N.value.length);else{var pe=N.ownerDocument||document,ae=pe&&pe.defaultView||window;if(ae.getSelection){var ie=ae.getSelection(),ut=N.textContent.length,it=Math.min(B.start,ut),nn=B.end===void 0?it:Math.min(B.end,ut);!ie.extend&&it>nn&&(k=nn,nn=it,it=k);var K=A1(N,it),q=A1(N,nn);if(K&&q&&(ie.rangeCount!==1||ie.anchorNode!==K.node||ie.anchorOffset!==K.offset||ie.focusNode!==q.node||ie.focusOffset!==q.offset)){var te=pe.createRange();te.setStart(K.node,K.offset),ie.removeAllRanges(),it>nn?(ie.addRange(te),ie.extend(q.node,q.offset)):(te.setEnd(q.node,q.offset),ie.addRange(te))}}}}for(pe=[],ie=N;ie=ie.parentNode;)ie.nodeType===1&&pe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var fe=pe[N];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Hf=!!Xg,Zg=Xg=null}finally{Kt=x,I.p=h,P.T=d}}i.current=l,Xn=2}}function Hw(){if(Xn===2){Xn=0;var i=wo,l=kl,d=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||d){d=P.T,P.T=null;var h=I.p;I.p=2;var x=Kt;Kt|=4;try{Sw(i,l.alternate,l)}finally{Kt=x,I.p=h,P.T=d}}Xn=3}}function qw(){if(Xn===4||Xn===3){Xn=0,Bt();var i=wo,l=kl,d=Pl,h=Pw;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Xn=5:(Xn=0,kl=wo=null,Gw(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(So=null),Jo(d),l=l.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(gt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=P.T,x=I.p,I.p=2,P.T=null;try{for(var w=i.onRecoverableError,k=0;k<h.length;k++){var N=h[k];w(N.value,{componentStack:N.stack})}}finally{P.T=l,I.p=x}}(Pl&3)!==0&&Pf(),Ya(i),x=i.pendingLanes,(d&4194090)!==0&&(x&42)!==0?i===Lg?yu++:(yu=0,Lg=i):yu=0,xu(0)}}function Gw(i,l){(i.pooledCacheLanes&=l)===0&&(l=i.pooledCache,l!=null&&(i.pooledCache=null,Zc(l)))}function Pf(i){return Fw(),Hw(),qw(),Qw()}function Qw(){if(Xn!==5)return!1;var i=wo,l=Mg;Mg=0;var d=Jo(Pl),h=P.T,x=I.p;try{I.p=32>d?32:d,P.T=null,d=Ig,Ig=null;var w=wo,k=Pl;if(Xn=0,kl=wo=null,Pl=0,(Kt&6)!==0)throw Error(r(331));var N=Kt;if(Kt|=4,_w(w.current),Rw(w,w.current,k,d),Kt=N,xu(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(gt,w)}catch{}return!0}finally{I.p=x,P.T=h,Gw(i,l)}}function Ww(i,l,d){l=Jr(d,l),l=mg(i.stateNode,l,2),i=fo(i,l,2),i!==null&&(wa(i,2),Ya(i))}function an(i,l,d){if(i.tag===3)Ww(i,i,d);else for(;l!==null;){if(l.tag===3){Ww(l,i,d);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(So===null||!So.has(h))){i=Jr(d,i),d=ZS(2),h=fo(l,d,2),h!==null&&(JS(d,h,l,i),wa(h,2),Ya(h));break}}l=l.return}}function Bg(i,l,d){var h=i.pingCache;if(h===null){h=i.pingCache=new lP;var x=new Set;h.set(l,x)}else x=h.get(l),x===void 0&&(x=new Set,h.set(l,x));x.has(d)||(kg=!0,x.add(d),i=hP.bind(null,i,l,d),l.then(i,i))}function hP(i,l,d){var h=i.pingCache;h!==null&&h.delete(l),i.pingedLanes|=i.suspendedLanes&d,i.warmLanes&=~d,un===i&&(Mt&d)===d&&(An===4||An===3&&(Mt&62914560)===Mt&&300>Se()-Og?(Kt&2)===0&&Nl(i,0):Pg|=d,_l===Mt&&(_l=0)),Ya(i)}function Yw(i,l){l===0&&(l=Zo()),i=ml(i,l),i!==null&&(wa(i,l),Ya(i))}function pP(i){var l=i.memoizedState,d=0;l!==null&&(d=l.retryLane),Yw(i,d)}function mP(i,l){var d=0;switch(i.tag){case 13:var h=i.stateNode,x=i.memoizedState;x!==null&&(d=x.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),Yw(i,d)}function gP(i,l){return Ot(i,l)}var Nf=null,Ml=null,Vg=!1,Of=!1,Fg=!1,gs=0;function Ya(i){i!==Ml&&i.next===null&&(Ml===null?Nf=Ml=i:Ml=Ml.next=i),Of=!0,Vg||(Vg=!0,yP())}function xu(i,l){if(!Fg&&Of){Fg=!0;do for(var d=!1,h=Nf;h!==null;){if(i!==0){var x=h.pendingLanes;if(x===0)var w=0;else{var k=h.suspendedLanes,N=h.pingedLanes;w=(1<<31-_t(42|i)+1)-1,w&=x&~(k&~N),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(d=!0,Jw(h,w))}else w=Mt,w=Yn(h,h===un?w:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(w&3)===0||xr(h,w)||(d=!0,Jw(h,w));h=h.next}while(d);Fg=!1}}function vP(){Kw()}function Kw(){Of=Vg=!1;var i=0;gs!==0&&(TP()&&(i=gs),gs=0);for(var l=Se(),d=null,h=Nf;h!==null;){var x=h.next,w=Xw(h,l);w===0?(h.next=null,d===null?Nf=x:d.next=x,x===null&&(Ml=d)):(d=h,(i!==0||(w&3)!==0)&&(Of=!0)),h=x}xu(i)}function Xw(i,l){for(var d=i.suspendedLanes,h=i.pingedLanes,x=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var k=31-_t(w),N=1<<k,B=x[k];B===-1?((N&d)===0||(N&h)!==0)&&(x[k]=il(N,l)):B<=l&&(i.expiredLanes|=N),w&=~N}if(l=un,d=Mt,d=Yn(i,i===l?d:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,d===0||i===l&&(Xt===2||Xt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&xt(h),i.callbackNode=null,i.callbackPriority=0;if((d&3)===0||xr(i,d)){if(l=d&-d,l===i.callbackPriority)return l;switch(h!==null&&xt(h),Jo(d)){case 2:case 8:d=Te;break;case 32:d=ge;break;case 268435456:d=Le;break;default:d=ge}return h=Zw.bind(null,i),d=Ot(d,h),i.callbackPriority=l,i.callbackNode=d,l}return h!==null&&h!==null&&xt(h),i.callbackPriority=2,i.callbackNode=null,2}function Zw(i,l){if(Xn!==0&&Xn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var d=i.callbackNode;if(Pf()&&i.callbackNode!==d)return null;var h=Mt;return h=Yn(i,i===un?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Ow(i,h,l),Xw(i,Se()),i.callbackNode!=null&&i.callbackNode===d?Zw.bind(null,i):null)}function Jw(i,l){if(Pf())return null;Ow(i,l,!0)}function yP(){DP(function(){(Kt&6)!==0?Ot(Ve,vP):Kw()})}function Hg(){return gs===0&&(gs=ro()),gs}function ej(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Hd(""+i)}function tj(i,l){var d=l.ownerDocument.createElement("input");return d.name=l.name,d.value=l.value,i.id&&d.setAttribute("form",i.id),l.parentNode.insertBefore(d,l),i=new FormData(i),d.parentNode.removeChild(d),i}function xP(i,l,d,h,x){if(l==="submit"&&d&&d.stateNode===x){var w=ej((x[Ee]||null).action),k=h.submitter;k&&(l=(l=k[Ee]||null)?ej(l.formAction):k.getAttribute("formAction"),l!==null&&(w=l,k=null));var N=new Wd("action","action",null,h,x);i.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(gs!==0){var B=k?tj(x,k):new FormData(x);ug(d,{pending:!0,data:B,method:x.method,action:w},null,B)}}else typeof w=="function"&&(N.preventDefault(),B=k?tj(x,k):new FormData(x),ug(d,{pending:!0,data:B,method:x.method,action:w},w,B))},currentTarget:x}]})}}for(var qg=0;qg<Am.length;qg++){var Gg=Am[qg],bP=Gg.toLowerCase(),SP=Gg[0].toUpperCase()+Gg.slice(1);Ta(bP,"on"+SP)}Ta(O1,"onAnimationEnd"),Ta(M1,"onAnimationIteration"),Ta(I1,"onAnimationStart"),Ta("dblclick","onDoubleClick"),Ta("focusin","onFocus"),Ta("focusout","onBlur"),Ta(z4,"onTransitionRun"),Ta($4,"onTransitionStart"),Ta(U4,"onTransitionCancel"),Ta(L1,"onTransitionEnd"),Kr("onMouseEnter",["mouseout","mouseover"]),Kr("onMouseLeave",["mouseout","mouseover"]),Kr("onPointerEnter",["pointerout","pointerover"]),Kr("onPointerLeave",["pointerout","pointerover"]),cr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),cr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),cr("onBeforeInput",["compositionend","keypress","textInput","paste"]),cr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),cr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bu="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(" "),wP=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(bu));function nj(i,l){l=(l&4)!==0;for(var d=0;d<i.length;d++){var h=i[d],x=h.event;h=h.listeners;e:{var w=void 0;if(l)for(var k=h.length-1;0<=k;k--){var N=h[k],B=N.instance,ne=N.currentTarget;if(N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(ue){Sf(ue)}x.currentTarget=null,w=B}else for(k=0;k<h.length;k++){if(N=h[k],B=N.instance,ne=N.currentTarget,N=N.listener,B!==w&&x.isPropagationStopped())break e;w=N,x.currentTarget=ne;try{w(x)}catch(ue){Sf(ue)}x.currentTarget=null,w=B}}}}function Rt(i,l){var d=l[tt];d===void 0&&(d=l[tt]=new Set);var h=i+"__bubble";d.has(h)||(rj(l,i,2,!1),d.add(h))}function Qg(i,l,d){var h=0;l&&(h|=4),rj(d,i,h,l)}var Mf="_reactListening"+Math.random().toString(36).slice(2);function Wg(i){if(!i[Mf]){i[Mf]=!0,jt.forEach(function(d){d!=="selectionchange"&&(wP.has(d)||Qg(d,!1,i),Qg(d,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Mf]||(l[Mf]=!0,Qg("selectionchange",!1,l))}}function rj(i,l,d,h){switch(Rj(l)){case 2:var x=YP;break;case 8:x=KP;break;default:x=lv}d=x.bind(null,l,d,i),x=void 0,!gm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(x=!0),h?x!==void 0?i.addEventListener(l,d,{capture:!0,passive:x}):i.addEventListener(l,d,!0):x!==void 0?i.addEventListener(l,d,{passive:x}):i.addEventListener(l,d,!1)}function Yg(i,l,d,h,x){var w=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var N=h.stateNode.containerInfo;if(N===x)break;if(k===4)for(k=h.return;k!==null;){var B=k.tag;if((B===3||B===4)&&k.stateNode.containerInfo===x)return;k=k.return}for(;N!==null;){if(k=lt(N),k===null)return;if(B=k.tag,B===5||B===6||B===26||B===27){h=w=k;continue e}N=N.parentNode}}h=h.return}u1(function(){var ne=w,ue=pm(d),pe=[];e:{var ae=z1.get(i);if(ae!==void 0){var ie=Wd,ut=i;switch(i){case"keypress":if(Gd(d)===0)break e;case"keydown":case"keyup":ie=g4;break;case"focusin":ut="focus",ie=bm;break;case"focusout":ut="blur",ie=bm;break;case"beforeblur":case"afterblur":ie=bm;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=h1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=a4;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=x4;break;case O1:case M1:case I1:ie=s4;break;case L1:ie=S4;break;case"scroll":case"scrollend":ie=n4;break;case"wheel":ie=j4;break;case"copy":case"cut":case"paste":ie=c4;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=m1;break;case"toggle":case"beforetoggle":ie=E4}var it=(l&4)!==0,nn=!it&&(i==="scroll"||i==="scrollend"),K=it?ae!==null?ae+"Capture":null:ae;it=[];for(var q=ne,te;q!==null;){var fe=q;if(te=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||te===null||K===null||(fe=$c(q,K),fe!=null&&it.push(Su(q,fe,te))),nn)break;q=q.return}0<it.length&&(ae=new ie(ae,ut,null,d,ue),pe.push({event:ae,listeners:it}))}}if((l&7)===0){e:{if(ae=i==="mouseover"||i==="pointerover",ie=i==="mouseout"||i==="pointerout",ae&&d!==hm&&(ut=d.relatedTarget||d.fromElement)&&(lt(ut)||ut[Be]))break e;if((ie||ae)&&(ae=ue.window===ue?ue:(ae=ue.ownerDocument)?ae.defaultView||ae.parentWindow:window,ie?(ut=d.relatedTarget||d.toElement,ie=ne,ut=ut?lt(ut):null,ut!==null&&(nn=o(ut),it=ut.tag,ut!==nn||it!==5&&it!==27&&it!==6)&&(ut=null)):(ie=null,ut=ne),ie!==ut)){if(it=h1,fe="onMouseLeave",K="onMouseEnter",q="mouse",(i==="pointerout"||i==="pointerover")&&(it=m1,fe="onPointerLeave",K="onPointerEnter",q="pointer"),nn=ie==null?ae:at(ie),te=ut==null?ae:at(ut),ae=new it(fe,q+"leave",ie,d,ue),ae.target=nn,ae.relatedTarget=te,fe=null,lt(ue)===ne&&(it=new it(K,q+"enter",ut,d,ue),it.target=te,it.relatedTarget=nn,fe=it),nn=fe,ie&&ut)t:{for(it=ie,K=ut,q=0,te=it;te;te=Il(te))q++;for(te=0,fe=K;fe;fe=Il(fe))te++;for(;0<q-te;)it=Il(it),q--;for(;0<te-q;)K=Il(K),te--;for(;q--;){if(it===K||K!==null&&it===K.alternate)break t;it=Il(it),K=Il(K)}it=null}else it=null;ie!==null&&aj(pe,ae,ie,it,!1),ut!==null&&nn!==null&&aj(pe,nn,ut,it,!0)}}e:{if(ae=ne?at(ne):window,ie=ae.nodeName&&ae.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ae.type==="file")var He=j1;else if(S1(ae))if(C1)He=M4;else{He=N4;var Et=P4}else ie=ae.nodeName,!ie||ie.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&fm(ne.elementType)&&(He=j1):He=O4;if(He&&(He=He(i,ne))){w1(pe,He,d,ue);break e}Et&&Et(i,ae,ne),i==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&dm(ae,"number",ae.value)}switch(Et=ne?at(ne):window,i){case"focusin":(S1(Et)||Et.contentEditable==="true")&&(fl=Et,Tm=ne,Qc=null);break;case"focusout":Qc=Tm=fl=null;break;case"mousedown":Rm=!0;break;case"contextmenu":case"mouseup":case"dragend":Rm=!1,P1(pe,d,ue);break;case"selectionchange":if(L4)break;case"keydown":case"keyup":P1(pe,d,ue)}var Je;if(wm)e:{switch(i){case"compositionstart":var st="onCompositionStart";break e;case"compositionend":st="onCompositionEnd";break e;case"compositionupdate":st="onCompositionUpdate";break e}st=void 0}else dl?x1(i,d)&&(st="onCompositionEnd"):i==="keydown"&&d.keyCode===229&&(st="onCompositionStart");st&&(g1&&d.locale!=="ko"&&(dl||st!=="onCompositionStart"?st==="onCompositionEnd"&&dl&&(Je=d1()):(so=ue,vm="value"in so?so.value:so.textContent,dl=!0)),Et=If(ne,st),0<Et.length&&(st=new p1(st,i,null,d,ue),pe.push({event:st,listeners:Et}),Je?st.data=Je:(Je=b1(d),Je!==null&&(st.data=Je)))),(Je=R4?D4(i,d):A4(i,d))&&(st=If(ne,"onBeforeInput"),0<st.length&&(Et=new p1("onBeforeInput","beforeinput",null,d,ue),pe.push({event:Et,listeners:st}),Et.data=Je)),xP(pe,i,ne,d,ue)}nj(pe,l)})}function Su(i,l,d){return{instance:i,listener:l,currentTarget:d}}function If(i,l){for(var d=l+"Capture",h=[];i!==null;){var x=i,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=$c(i,d),x!=null&&h.unshift(Su(i,x,w)),x=$c(i,l),x!=null&&h.push(Su(i,x,w))),i.tag===3)return h;i=i.return}return[]}function Il(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function aj(i,l,d,h,x){for(var w=l._reactName,k=[];d!==null&&d!==h;){var N=d,B=N.alternate,ne=N.stateNode;if(N=N.tag,B!==null&&B===h)break;N!==5&&N!==26&&N!==27||ne===null||(B=ne,x?(ne=$c(d,w),ne!=null&&k.unshift(Su(d,ne,B))):x||(ne=$c(d,w),ne!=null&&k.push(Su(d,ne,B)))),d=d.return}k.length!==0&&i.push({event:l,listeners:k})}var jP=/\r\n?/g,CP=/\u0000|\uFFFD/g;function ij(i){return(typeof i=="string"?i:""+i).replace(jP,`
|
|
557
|
+
`).replace(CP,"")}function oj(i,l){return l=ij(l),ij(i)===l}function Lf(){}function tn(i,l,d,h,x,w){switch(d){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||ll(i,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&ll(i,""+h);break;case"className":yi(i,"class",h);break;case"tabIndex":yi(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":yi(i,d,h);break;case"style":l1(i,h,w);break;case"data":if(l!=="object"){yi(i,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||d!=="href")){i.removeAttribute(d);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(d);break}h=Hd(""+h),i.setAttribute(d,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(d==="formAction"?(l!=="input"&&tn(i,l,"name",x.name,x,null),tn(i,l,"formEncType",x.formEncType,x,null),tn(i,l,"formMethod",x.formMethod,x,null),tn(i,l,"formTarget",x.formTarget,x,null)):(tn(i,l,"encType",x.encType,x,null),tn(i,l,"method",x.method,x,null),tn(i,l,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(d);break}h=Hd(""+h),i.setAttribute(d,h);break;case"onClick":h!=null&&(i.onclick=Lf);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}d=Hd(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,""+h):i.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,""):i.removeAttribute(d);break;case"capture":case"download":h===!0?i.setAttribute(d,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(d,h):i.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(d,h):i.removeAttribute(d);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(d):i.setAttribute(d,h);break;case"popover":Rt("beforetoggle",i),Rt("toggle",i),Xr(i,"popover",h);break;case"xlinkActuate":Ct(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ct(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ct(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ct(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ct(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ct(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ct(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ct(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ct(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Xr(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=e4.get(d)||d,Xr(i,d,h))}}function Kg(i,l,d,h,x,w){switch(d){case"style":l1(i,h,w);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(d=h.__html,d!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=d}}break;case"children":typeof h=="string"?ll(i,h):(typeof h=="number"||typeof h=="bigint")&&ll(i,""+h);break;case"onScroll":h!=null&&Rt("scroll",i);break;case"onScrollEnd":h!=null&&Rt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Lf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ha.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(x=d.endsWith("Capture"),l=d.slice(2,x?d.length-7:void 0),w=i[Ee]||null,w=w!=null?w[d]:null,typeof w=="function"&&i.removeEventListener(l,w,x),typeof h=="function")){typeof w!="function"&&w!==null&&(d in i?i[d]=null:i.hasAttribute(d)&&i.removeAttribute(d)),i.addEventListener(l,h,x);break e}d in i?i[d]=h:h===!0?i.setAttribute(d,""):Xr(i,d,h)}}}function Zn(i,l,d){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Rt("error",i),Rt("load",i);var h=!1,x=!1,w;for(w in d)if(d.hasOwnProperty(w)){var k=d[w];if(k!=null)switch(w){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:tn(i,l,w,k,d,null)}}x&&tn(i,l,"srcSet",d.srcSet,d,null),h&&tn(i,l,"src",d.src,d,null);return;case"input":Rt("invalid",i);var N=w=k=x=null,B=null,ne=null;for(h in d)if(d.hasOwnProperty(h)){var ue=d[h];if(ue!=null)switch(h){case"name":x=ue;break;case"type":k=ue;break;case"checked":B=ue;break;case"defaultChecked":ne=ue;break;case"value":w=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,l));break;default:tn(i,l,h,ue,d,null)}}a1(i,w,N,B,ne,k,x,!1),Vd(i);return;case"select":Rt("invalid",i),h=k=w=null;for(x in d)if(d.hasOwnProperty(x)&&(N=d[x],N!=null))switch(x){case"value":w=N;break;case"defaultValue":k=N;break;case"multiple":h=N;default:tn(i,l,x,N,d,null)}l=w,d=k,i.multiple=!!h,l!=null?sl(i,!!h,l,!1):d!=null&&sl(i,!!h,d,!0);return;case"textarea":Rt("invalid",i),w=x=h=null;for(k in d)if(d.hasOwnProperty(k)&&(N=d[k],N!=null))switch(k){case"value":h=N;break;case"defaultValue":x=N;break;case"children":w=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:tn(i,l,k,N,d,null)}o1(i,h,x,w),Vd(i);return;case"option":for(B in d)if(d.hasOwnProperty(B)&&(h=d[B],h!=null))switch(B){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:tn(i,l,B,h,d,null)}return;case"dialog":Rt("beforetoggle",i),Rt("toggle",i),Rt("cancel",i),Rt("close",i);break;case"iframe":case"object":Rt("load",i);break;case"video":case"audio":for(h=0;h<bu.length;h++)Rt(bu[h],i);break;case"image":Rt("error",i),Rt("load",i);break;case"details":Rt("toggle",i);break;case"embed":case"source":case"link":Rt("error",i),Rt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in d)if(d.hasOwnProperty(ne)&&(h=d[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:tn(i,l,ne,h,d,null)}return;default:if(fm(l)){for(ue in d)d.hasOwnProperty(ue)&&(h=d[ue],h!==void 0&&Kg(i,l,ue,h,d,void 0));return}}for(N in d)d.hasOwnProperty(N)&&(h=d[N],h!=null&&tn(i,l,N,h,d,null))}function EP(i,l,d,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,k=null,N=null,B=null,ne=null,ue=null;for(ie in d){var pe=d[ie];if(d.hasOwnProperty(ie)&&pe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":B=pe;default:h.hasOwnProperty(ie)||tn(i,l,ie,null,h,pe)}}for(var ae in h){var ie=h[ae];if(pe=d[ae],h.hasOwnProperty(ae)&&(ie!=null||pe!=null))switch(ae){case"type":w=ie;break;case"name":x=ie;break;case"checked":ne=ie;break;case"defaultChecked":ue=ie;break;case"value":k=ie;break;case"defaultValue":N=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:ie!==pe&&tn(i,l,ae,ie,h,pe)}}um(i,k,N,B,ne,ue,w,x);return;case"select":ie=k=N=ae=null;for(w in d)if(B=d[w],d.hasOwnProperty(w)&&B!=null)switch(w){case"value":break;case"multiple":ie=B;default:h.hasOwnProperty(w)||tn(i,l,w,null,h,B)}for(x in h)if(w=h[x],B=d[x],h.hasOwnProperty(x)&&(w!=null||B!=null))switch(x){case"value":ae=w;break;case"defaultValue":N=w;break;case"multiple":k=w;default:w!==B&&tn(i,l,x,w,h,B)}l=N,d=k,h=ie,ae!=null?sl(i,!!d,ae,!1):!!h!=!!d&&(l!=null?sl(i,!!d,l,!0):sl(i,!!d,d?[]:"",!1));return;case"textarea":ie=ae=null;for(N in d)if(x=d[N],d.hasOwnProperty(N)&&x!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:tn(i,l,N,null,h,x)}for(k in h)if(x=h[k],w=d[k],h.hasOwnProperty(k)&&(x!=null||w!=null))switch(k){case"value":ae=x;break;case"defaultValue":ie=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&tn(i,l,k,x,h,w)}i1(i,ae,ie);return;case"option":for(var ut in d)if(ae=d[ut],d.hasOwnProperty(ut)&&ae!=null&&!h.hasOwnProperty(ut))switch(ut){case"selected":i.selected=!1;break;default:tn(i,l,ut,null,h,ae)}for(B in h)if(ae=h[B],ie=d[B],h.hasOwnProperty(B)&&ae!==ie&&(ae!=null||ie!=null))switch(B){case"selected":i.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:tn(i,l,B,ae,h,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in d)ae=d[it],d.hasOwnProperty(it)&&ae!=null&&!h.hasOwnProperty(it)&&tn(i,l,it,null,h,ae);for(ne in h)if(ae=h[ne],ie=d[ne],h.hasOwnProperty(ne)&&ae!==ie&&(ae!=null||ie!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(r(137,l));break;default:tn(i,l,ne,ae,h,ie)}return;default:if(fm(l)){for(var nn in d)ae=d[nn],d.hasOwnProperty(nn)&&ae!==void 0&&!h.hasOwnProperty(nn)&&Kg(i,l,nn,void 0,h,ae);for(ue in h)ae=h[ue],ie=d[ue],!h.hasOwnProperty(ue)||ae===ie||ae===void 0&&ie===void 0||Kg(i,l,ue,ae,h,ie);return}}for(var K in d)ae=d[K],d.hasOwnProperty(K)&&ae!=null&&!h.hasOwnProperty(K)&&tn(i,l,K,null,h,ae);for(pe in h)ae=h[pe],ie=d[pe],!h.hasOwnProperty(pe)||ae===ie||ae==null&&ie==null||tn(i,l,pe,ae,h,ie)}var Xg=null,Zg=null;function zf(i){return i.nodeType===9?i:i.ownerDocument}function sj(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lj(i,l){if(i===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&l==="foreignObject"?0:i}function Jg(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var ev=null;function TP(){var i=window.event;return i&&i.type==="popstate"?i===ev?!1:(ev=i,!0):(ev=null,!1)}var cj=typeof setTimeout=="function"?setTimeout:void 0,RP=typeof clearTimeout=="function"?clearTimeout:void 0,uj=typeof Promise=="function"?Promise:void 0,DP=typeof queueMicrotask=="function"?queueMicrotask:typeof uj<"u"?function(i){return uj.resolve(null).then(i).catch(AP)}:cj;function AP(i){setTimeout(function(){throw i})}function Co(i){return i==="head"}function dj(i,l){var d=l,h=0,x=0;do{var w=d.nextSibling;if(i.removeChild(d),w&&w.nodeType===8)if(d=w.data,d==="/$"){if(0<h&&8>h){d=h;var k=i.ownerDocument;if(d&1&&wu(k.documentElement),d&2&&wu(k.body),d&4)for(d=k.head,wu(d),k=d.firstChild;k;){var N=k.nextSibling,B=k.nodeName;k[rt]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&k.rel.toLowerCase()==="stylesheet"||d.removeChild(k),k=N}}if(x===0){i.removeChild(w),_u(l);return}x--}else d==="$"||d==="$?"||d==="$!"?x++:h=d.charCodeAt(0)-48;else h=0;d=w}while(d);_u(l)}function tv(i){var l=i.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var d=l;switch(l=l.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":tv(d),Ye(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}i.removeChild(d)}}function _P(i,l,d,h){for(;i.nodeType===1;){var x=d;if(i.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[rt])switch(l){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(l==="input"&&i.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Da(i.nextSibling),i===null)break}return null}function kP(i,l,d){if(l==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!d||(i=Da(i.nextSibling),i===null))return null;return i}function nv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function PP(i,l){var d=i.ownerDocument;if(i.data!=="$?"||d.readyState==="complete")l();else{var h=function(){l(),d.removeEventListener("DOMContentLoaded",h)};d.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function Da(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return i}var rv=null;function fj(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var d=i.data;if(d==="$"||d==="$!"||d==="$?"){if(l===0)return i;l--}else d==="/$"&&l++}i=i.previousSibling}return null}function hj(i,l,d){switch(l=zf(d),i){case"html":if(i=l.documentElement,!i)throw Error(r(452));return i;case"head":if(i=l.head,!i)throw Error(r(453));return i;case"body":if(i=l.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function wu(i){for(var l=i.attributes;l.length;)i.removeAttributeNode(l[0]);Ye(i)}var ia=new Map,pj=new Set;function $f(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Pi=I.d;I.d={f:NP,r:OP,D:MP,C:IP,L:LP,m:zP,X:UP,S:$P,M:BP};function NP(){var i=Pi.f(),l=_f();return i||l}function OP(i){var l=Dt(i);l!==null&&l.tag===5&&l.type==="form"?OS(l):Pi.r(i)}var Ll=typeof document>"u"?null:document;function mj(i,l,d){var h=Ll;if(h&&typeof l=="string"&&l){var x=Zr(l);x='link[rel="'+i+'"][href="'+x+'"]',typeof d=="string"&&(x+='[crossorigin="'+d+'"]'),pj.has(x)||(pj.add(x),i={rel:i,crossOrigin:d,href:l},h.querySelector(x)===null&&(l=h.createElement("link"),Zn(l,"link",i),kt(l),h.head.appendChild(l)))}}function MP(i){Pi.D(i),mj("dns-prefetch",i,null)}function IP(i,l){Pi.C(i,l),mj("preconnect",i,l)}function LP(i,l,d){Pi.L(i,l,d);var h=Ll;if(h&&i&&l){var x='link[rel="preload"][as="'+Zr(l)+'"]';l==="image"&&d&&d.imageSrcSet?(x+='[imagesrcset="'+Zr(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(x+='[imagesizes="'+Zr(d.imageSizes)+'"]')):x+='[href="'+Zr(i)+'"]';var w=x;switch(l){case"style":w=zl(i);break;case"script":w=$l(i)}ia.has(w)||(i=m({rel:"preload",href:l==="image"&&d&&d.imageSrcSet?void 0:i,as:l},d),ia.set(w,i),h.querySelector(x)!==null||l==="style"&&h.querySelector(ju(w))||l==="script"&&h.querySelector(Cu(w))||(l=h.createElement("link"),Zn(l,"link",i),kt(l),h.head.appendChild(l)))}}function zP(i,l){Pi.m(i,l);var d=Ll;if(d&&i){var h=l&&typeof l.as=="string"?l.as:"script",x='link[rel="modulepreload"][as="'+Zr(h)+'"][href="'+Zr(i)+'"]',w=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=$l(i)}if(!ia.has(w)&&(i=m({rel:"modulepreload",href:i},l),ia.set(w,i),d.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector(Cu(w)))return}h=d.createElement("link"),Zn(h,"link",i),kt(h),d.head.appendChild(h)}}}function $P(i,l,d){Pi.S(i,l,d);var h=Ll;if(h&&i){var x=rn(h).hoistableStyles,w=zl(i);l=l||"default";var k=x.get(w);if(!k){var N={loading:0,preload:null};if(k=h.querySelector(ju(w)))N.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":l},d),(d=ia.get(w))&&av(i,d);var B=k=h.createElement("link");kt(B),Zn(B,"link",i),B._p=new Promise(function(ne,ue){B.onload=ne,B.onerror=ue}),B.addEventListener("load",function(){N.loading|=1}),B.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Uf(k,l,h)}k={type:"stylesheet",instance:k,count:1,state:N},x.set(w,k)}}}function UP(i,l){Pi.X(i,l);var d=Ll;if(d&&i){var h=rn(d).hoistableScripts,x=$l(i),w=h.get(x);w||(w=d.querySelector(Cu(x)),w||(i=m({src:i,async:!0},l),(l=ia.get(x))&&iv(i,l),w=d.createElement("script"),kt(w),Zn(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function BP(i,l){Pi.M(i,l);var d=Ll;if(d&&i){var h=rn(d).hoistableScripts,x=$l(i),w=h.get(x);w||(w=d.querySelector(Cu(x)),w||(i=m({src:i,async:!0,type:"module"},l),(l=ia.get(x))&&iv(i,l),w=d.createElement("script"),kt(w),Zn(w,"link",i),d.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},h.set(x,w))}}function gj(i,l,d,h){var x=(x=ve.current)?$f(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(l=zl(d.href),d=rn(x).hoistableStyles,h=d.get(l),h||(h={type:"style",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){i=zl(d.href);var w=rn(x).hoistableStyles,k=w.get(i);if(k||(x=x.ownerDocument||x,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,k),(w=x.querySelector(ju(i)))&&!w._p&&(k.instance=w,k.state.loading=5),ia.has(i)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},ia.set(i,d),w||VP(x,i,d,k.state))),l&&h===null)throw Error(r(528,""));return k}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=d.async,d=d.src,typeof d=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=$l(d),d=rn(x).hoistableScripts,h=d.get(l),h||(h={type:"script",instance:null,count:0,state:null},d.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function zl(i){return'href="'+Zr(i)+'"'}function ju(i){return'link[rel="stylesheet"]['+i+"]"}function vj(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function VP(i,l,d,h){i.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=i.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Zn(l,"link",d),kt(l),i.head.appendChild(l))}function $l(i){return'[src="'+Zr(i)+'"]'}function Cu(i){return"script[async]"+i}function yj(i,l,d){if(l.count++,l.instance===null)switch(l.type){case"style":var h=i.querySelector('style[data-href~="'+Zr(d.href)+'"]');if(h)return l.instance=h,kt(h),h;var x=m({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),kt(h),Zn(h,"style",x),Uf(h,d.precedence,i),l.instance=h;case"stylesheet":x=zl(d.href);var w=i.querySelector(ju(x));if(w)return l.state.loading|=4,l.instance=w,kt(w),w;h=vj(d),(x=ia.get(x))&&av(h,x),w=(i.ownerDocument||i).createElement("link"),kt(w);var k=w;return k._p=new Promise(function(N,B){k.onload=N,k.onerror=B}),Zn(w,"link",h),l.state.loading|=4,Uf(w,d.precedence,i),l.instance=w;case"script":return w=$l(d.src),(x=i.querySelector(Cu(w)))?(l.instance=x,kt(x),x):(h=d,(x=ia.get(w))&&(h=m({},d),iv(h,x)),i=i.ownerDocument||i,x=i.createElement("script"),kt(x),Zn(x,"link",h),i.head.appendChild(x),l.instance=x);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Uf(h,d.precedence,i));return l.instance}function Uf(i,l,d){for(var h=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,w=x,k=0;k<h.length;k++){var N=h[k];if(N.dataset.precedence===l)w=N;else if(w!==x)break}w?w.parentNode.insertBefore(i,w.nextSibling):(l=d.nodeType===9?d.head:d,l.insertBefore(i,l.firstChild))}function av(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.title==null&&(i.title=l.title)}function iv(i,l){i.crossOrigin==null&&(i.crossOrigin=l.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=l.referrerPolicy),i.integrity==null&&(i.integrity=l.integrity)}var Bf=null;function xj(i,l,d){if(Bf===null){var h=new Map,x=Bf=new Map;x.set(d,h)}else x=Bf,h=x.get(d),h||(h=new Map,x.set(d,h));if(h.has(i))return h;for(h.set(i,null),d=d.getElementsByTagName(i),x=0;x<d.length;x++){var w=d[x];if(!(w[rt]||w[he]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var k=w.getAttribute(l)||"";k=i+k;var N=h.get(k);N?N.push(w):h.set(k,[w])}}return h}function bj(i,l,d){i=i.ownerDocument||i,i.head.insertBefore(d,l==="title"?i.querySelector("head > title"):null)}function FP(i,l,d){if(d===1||l.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return i=l.disabled,typeof l.precedence=="string"&&i==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Sj(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Eu=null;function HP(){}function qP(i,l,d){if(Eu===null)throw Error(r(475));var h=Eu;if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var x=zl(d.href),w=i.querySelector(ju(x));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(h.count++,h=Vf.bind(h),i.then(h,h)),l.state.loading|=4,l.instance=w,kt(w);return}w=i.ownerDocument||i,d=vj(d),(x=ia.get(x))&&av(d,x),w=w.createElement("link"),kt(w);var k=w;k._p=new Promise(function(N,B){k.onload=N,k.onerror=B}),Zn(w,"link",d),l.instance=w}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Vf.bind(h),i.addEventListener("load",l),i.addEventListener("error",l))}}function GP(){if(Eu===null)throw Error(r(475));var i=Eu;return i.stylesheets&&i.count===0&&ov(i,i.stylesheets),0<i.count?function(l){var d=setTimeout(function(){if(i.stylesheets&&ov(i,i.stylesheets),i.unsuspend){var h=i.unsuspend;i.unsuspend=null,h()}},6e4);return i.unsuspend=l,function(){i.unsuspend=null,clearTimeout(d)}}:null}function Vf(){if(this.count--,this.count===0){if(this.stylesheets)ov(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ff=null;function ov(i,l){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ff=new Map,l.forEach(QP,i),Ff=null,Vf.call(i))}function QP(i,l){if(!(l.state.loading&4)){var d=Ff.get(i);if(d)var h=d.get(null);else{d=new Map,Ff.set(i,d);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var k=x[w];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(d.set(k.dataset.precedence,k),h=k)}h&&d.set(null,h)}x=l.instance,k=x.getAttribute("data-precedence"),w=d.get(k)||h,w===h&&d.set(null,x),d.set(k,x),this.count++,h=Vf.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),w?w.parentNode.insertBefore(x,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),l.state.loading|=4}}var Tu={$$typeof:E,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function WP(i,l,d,h,x,w,k,N){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.hiddenUpdates=Fa(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function wj(i,l,d,h,x,w,k,N,B,ne,ue,pe){return i=new WP(i,l,d,k,N,B,ne,pe),l=1,w===!0&&(l|=24),w=Lr(3,null,null,l),i.current=w,w.stateNode=i,l=Bm(),l.refCount++,i.pooledCache=l,l.refCount++,w.memoizedState={element:h,isDehydrated:d,cache:l},qm(w),i}function jj(i){return i?(i=gl,i):gl}function Cj(i,l,d,h,x,w){x=jj(x),h.context===null?h.context=x:h.pendingContext=x,h=uo(l),h.payload={element:d},w=w===void 0?null:w,w!==null&&(h.callback=w),d=fo(i,h,l),d!==null&&(Vr(d,i,l),nu(d,i,l))}function Ej(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var d=i.retryLane;i.retryLane=d!==0&&d<l?d:l}}function sv(i,l){Ej(i,l),(i=i.alternate)&&Ej(i,l)}function Tj(i){if(i.tag===13){var l=ml(i,67108864);l!==null&&Vr(l,i,67108864),sv(i,67108864)}}var Hf=!0;function YP(i,l,d,h){var x=P.T;P.T=null;var w=I.p;try{I.p=2,lv(i,l,d,h)}finally{I.p=w,P.T=x}}function KP(i,l,d,h){var x=P.T;P.T=null;var w=I.p;try{I.p=8,lv(i,l,d,h)}finally{I.p=w,P.T=x}}function lv(i,l,d,h){if(Hf){var x=cv(h);if(x===null)Yg(i,l,h,qf,d),Dj(i,h);else if(ZP(x,i,l,d,h))h.stopPropagation();else if(Dj(i,h),l&4&&-1<XP.indexOf(i)){for(;x!==null;){var w=Dt(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var k=Sa(w.pendingLanes);if(k!==0){var N=w;for(N.pendingLanes|=2,N.entangledLanes|=2;k;){var B=1<<31-_t(k);N.entanglements[1]|=B,k&=~B}Ya(w),(Kt&6)===0&&(Df=Se()+500,xu(0))}}break;case 13:N=ml(w,2),N!==null&&Vr(N,w,2),_f(),sv(w,2)}if(w=cv(h),w===null&&Yg(i,l,h,qf,d),w===x)break;x=w}x!==null&&h.stopPropagation()}else Yg(i,l,h,null,d)}}function cv(i){return i=pm(i),uv(i)}var qf=null;function uv(i){if(qf=null,i=lt(i),i!==null){var l=o(i);if(l===null)i=null;else{var d=l.tag;if(d===13){if(i=c(l),i!==null)return i;i=null}else if(d===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null)}}return qf=i,null}function Rj(i){switch(i){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ne()){case Ve:return 2;case Te:return 8;case ge:case we:return 32;case Le:return 268435456;default:return 32}default:return 32}}var dv=!1,Eo=null,To=null,Ro=null,Ru=new Map,Du=new Map,Do=[],XP="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".split(" ");function Dj(i,l){switch(i){case"focusin":case"focusout":Eo=null;break;case"dragenter":case"dragleave":To=null;break;case"mouseover":case"mouseout":Ro=null;break;case"pointerover":case"pointerout":Ru.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Du.delete(l.pointerId)}}function Au(i,l,d,h,x,w){return i===null||i.nativeEvent!==w?(i={blockedOn:l,domEventName:d,eventSystemFlags:h,nativeEvent:w,targetContainers:[x]},l!==null&&(l=Dt(l),l!==null&&Tj(l)),i):(i.eventSystemFlags|=h,l=i.targetContainers,x!==null&&l.indexOf(x)===-1&&l.push(x),i)}function ZP(i,l,d,h,x){switch(l){case"focusin":return Eo=Au(Eo,i,l,d,h,x),!0;case"dragenter":return To=Au(To,i,l,d,h,x),!0;case"mouseover":return Ro=Au(Ro,i,l,d,h,x),!0;case"pointerover":var w=x.pointerId;return Ru.set(w,Au(Ru.get(w)||null,i,l,d,h,x)),!0;case"gotpointercapture":return w=x.pointerId,Du.set(w,Au(Du.get(w)||null,i,l,d,h,x)),!0}return!1}function Aj(i){var l=lt(i.target);if(l!==null){var d=o(l);if(d!==null){if(l=d.tag,l===13){if(l=c(d),l!==null){i.blockedOn=l,G(i.priority,function(){if(d.tag===13){var h=Br();h=ol(h);var x=ml(d,h);x!==null&&Vr(x,d,h),sv(d,h)}});return}}else if(l===3&&d.stateNode.current.memoizedState.isDehydrated){i.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gf(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var d=cv(i.nativeEvent);if(d===null){d=i.nativeEvent;var h=new d.constructor(d.type,d);hm=h,d.target.dispatchEvent(h),hm=null}else return l=Dt(d),l!==null&&Tj(l),i.blockedOn=d,!1;l.shift()}return!0}function _j(i,l,d){Gf(i)&&d.delete(l)}function JP(){dv=!1,Eo!==null&&Gf(Eo)&&(Eo=null),To!==null&&Gf(To)&&(To=null),Ro!==null&&Gf(Ro)&&(Ro=null),Ru.forEach(_j),Du.forEach(_j)}function Qf(i,l){i.blockedOn===l&&(i.blockedOn=null,dv||(dv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,JP)))}var Wf=null;function kj(i){Wf!==i&&(Wf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Wf===i&&(Wf=null);for(var l=0;l<i.length;l+=3){var d=i[l],h=i[l+1],x=i[l+2];if(typeof h!="function"){if(uv(h||d)===null)continue;break}var w=Dt(d);w!==null&&(i.splice(l,3),l-=3,ug(w,{pending:!0,data:x,method:d.method,action:h},h,x))}}))}function _u(i){function l(B){return Qf(B,i)}Eo!==null&&Qf(Eo,i),To!==null&&Qf(To,i),Ro!==null&&Qf(Ro,i),Ru.forEach(l),Du.forEach(l);for(var d=0;d<Do.length;d++){var h=Do[d];h.blockedOn===i&&(h.blockedOn=null)}for(;0<Do.length&&(d=Do[0],d.blockedOn===null);)Aj(d),d.blockedOn===null&&Do.shift();if(d=(i.ownerDocument||i).$$reactFormReplay,d!=null)for(h=0;h<d.length;h+=3){var x=d[h],w=d[h+1],k=x[Ee]||null;if(typeof w=="function")k||kj(d);else if(k){var N=null;if(w&&w.hasAttribute("formAction")){if(x=w,k=w[Ee]||null)N=k.formAction;else if(uv(x)!==null)continue}else N=k.action;typeof N=="function"?d[h+1]=N:(d.splice(h,3),h-=3),kj(d)}}}function fv(i){this._internalRoot=i}Yf.prototype.render=fv.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(r(409));var d=l.current,h=Br();Cj(d,h,i,l,null,null)},Yf.prototype.unmount=fv.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;Cj(i.current,2,null,i,null,null),_f(),l[Be]=null}};function Yf(i){this._internalRoot=i}Yf.prototype.unstable_scheduleHydration=function(i){if(i){var l=H();i={blockedOn:null,target:i,priority:l};for(var d=0;d<Do.length&&l!==0&&l<Do[d].priority;d++);Do.splice(d,0,i),d===0&&Aj(i)}};var Pj=t.version;if(Pj!=="19.1.0")throw Error(r(527,Pj,"19.1.0"));I.findDOMNode=function(i){var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=f(l),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var e3={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kf.isDisabled&&Kf.supportsFiber)try{gt=Kf.inject(e3),ht=Kf}catch{}}return Lu.createRoot=function(i,l){if(!a(i))throw Error(r(299));var d=!1,h="",x=WS,w=YS,k=KS,N=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(N=l.unstable_transitionCallbacks)),l=wj(i,1,!1,null,null,d,h,x,w,k,N,null),i[Be]=l.current,Wg(i),new fv(l)},Lu.hydrateRoot=function(i,l,d){if(!a(i))throw Error(r(299));var h=!1,x="",w=WS,k=YS,N=KS,B=null,ne=null;return d!=null&&(d.unstable_strictMode===!0&&(h=!0),d.identifierPrefix!==void 0&&(x=d.identifierPrefix),d.onUncaughtError!==void 0&&(w=d.onUncaughtError),d.onCaughtError!==void 0&&(k=d.onCaughtError),d.onRecoverableError!==void 0&&(N=d.onRecoverableError),d.unstable_transitionCallbacks!==void 0&&(B=d.unstable_transitionCallbacks),d.formState!==void 0&&(ne=d.formState)),l=wj(i,1,!0,l,d??null,h,x,w,k,N,B,ne),l.context=jj(null),d=l.current,h=Br(),h=ol(h),x=uo(h),x.callback=null,fo(d,x,h),d=h,l.current.lanes=d,wa(l,d),Ya(l),i[Be]=l.current,Wg(i),new Yf(l)},Lu.version="19.1.0",Lu}var lT;function CY(){if(lT)return Xv.exports;lT=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Xv.exports=jY(),Xv.exports}var EY=CY(),zu={},cT;function TY(){if(cT)return zu;cT=1,Object.defineProperty(zu,"__esModule",{value:!0}),zu.parse=c,zu.serialize=p;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function c(v,b){const S=new o,j=v.length;if(j<2)return S;const C=(b==null?void 0:b.decode)||m;let R=0;do{const D=v.indexOf("=",R);if(D===-1)break;const E=v.indexOf(";",R),T=E===-1?j:E;if(D>T){R=v.lastIndexOf(";",D-1)+1;continue}const A=u(v,R,D),_=f(v,D,A),M=v.slice(A,_);if(S[M]===void 0){let L=u(v,D+1,T),$=f(v,T,L);const V=C(v.slice(L,$));S[M]=V}R=T+1}while(R<j);return S}function u(v,b,S){do{const j=v.charCodeAt(b);if(j!==32&&j!==9)return b}while(++b<S);return S}function f(v,b,S){for(;b>S;){const j=v.charCodeAt(--b);if(j!==32&&j!==9)return b+1}return S}function p(v,b,S){const j=(S==null?void 0:S.encode)||encodeURIComponent;if(!e.test(v))throw new TypeError(`argument name is invalid: ${v}`);const C=j(b);if(!t.test(C))throw new TypeError(`argument val is invalid: ${b}`);let R=v+"="+C;if(!S)return R;if(S.maxAge!==void 0){if(!Number.isInteger(S.maxAge))throw new TypeError(`option maxAge is invalid: ${S.maxAge}`);R+="; Max-Age="+S.maxAge}if(S.domain){if(!n.test(S.domain))throw new TypeError(`option domain is invalid: ${S.domain}`);R+="; Domain="+S.domain}if(S.path){if(!r.test(S.path))throw new TypeError(`option path is invalid: ${S.path}`);R+="; Path="+S.path}if(S.expires){if(!g(S.expires)||!Number.isFinite(S.expires.valueOf()))throw new TypeError(`option expires is invalid: ${S.expires}`);R+="; Expires="+S.expires.toUTCString()}if(S.httpOnly&&(R+="; HttpOnly"),S.secure&&(R+="; Secure"),S.partitioned&&(R+="; Partitioned"),S.priority)switch(typeof S.priority=="string"?S.priority.toLowerCase():void 0){case"low":R+="; Priority=Low";break;case"medium":R+="; Priority=Medium";break;case"high":R+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${S.priority}`)}if(S.sameSite)switch(typeof S.sameSite=="string"?S.sameSite.toLowerCase():S.sameSite){case!0:case"strict":R+="; SameSite=Strict";break;case"lax":R+="; SameSite=Lax";break;case"none":R+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${S.sameSite}`)}return R}function m(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function g(v){return a.call(v)==="[object Date]"}return zu}TY();/**
|
|
558
|
+
* react-router v7.6.1
|
|
559
|
+
*
|
|
560
|
+
* Copyright (c) Remix Software Inc.
|
|
561
|
+
*
|
|
562
|
+
* This source code is licensed under the MIT license found in the
|
|
563
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
564
|
+
*
|
|
565
|
+
* @license MIT
|
|
566
|
+
*/var ok=e=>{throw TypeError(e)},RY=(e,t,n)=>t.has(e)||ok("Cannot "+n),ey=(e,t,n)=>(RY(e,t,"read from private field"),n?n.call(e):t.get(e)),DY=(e,t,n)=>t.has(e)?ok("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),uT="popstate";function AY(e={}){function t(r,a){let{pathname:o,search:c,hash:u}=r.location;return sd("",{pathname:o,search:c,hash:u},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(r,a){return typeof a=="string"?a:Vo(a)}return kY(t,n,null,e)}function yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function In(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _Y(){return Math.random().toString(36).substring(2,10)}function dT(e,t){return{usr:e.state,key:e.key,idx:t}}function sd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?no(t):t,state:n,key:t&&t.key||r||_Y()}}function Vo({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function no(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function kY(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,c=a.history,u="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){u="POP";let C=m(),R=C==null?null:C-p;p=C,f&&f({action:u,location:j.location,delta:R})}function v(C,R){u="PUSH";let D=sd(j.location,C,R);p=m()+1;let E=dT(D,p),T=j.createHref(D);try{c.pushState(E,"",T)}catch(A){if(A instanceof DOMException&&A.name==="DataCloneError")throw A;a.location.assign(T)}o&&f&&f({action:u,location:j.location,delta:1})}function b(C,R){u="REPLACE";let D=sd(j.location,C,R);p=m();let E=dT(D,p),T=j.createHref(D);c.replaceState(E,"",T),o&&f&&f({action:u,location:j.location,delta:0})}function S(C){return sk(C)}let j={get action(){return u},get location(){return e(a,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(uT,g),f=C,()=>{a.removeEventListener(uT,g),f=null}},createHref(C){return t(a,C)},createURL:S,encodeLocation(C){let R=S(C);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:v,replace:b,go(C){return c.go(C)}};return j}function sk(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),yt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Vo(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Hu,fT=class{constructor(e){if(DY(this,Hu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(ey(this,Hu).has(e))return ey(this,Hu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){ey(this,Hu).set(e,t)}};Hu=new WeakMap;var PY=new Set(["lazy","caseSensitive","path","id","index","children"]);function NY(e){return PY.has(e)}var OY=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function MY(e){return OY.has(e)}function IY(e){return e.index===!0}function Yh(e,t,n=[],r={}){return e.map((a,o)=>{let c=[...n,String(o)],u=typeof a.id=="string"?a.id:c.join("-");if(yt(a.index!==!0||!a.children,"Cannot specify children on an index route"),yt(!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),IY(a)){let f={...a,...t(a),id:u};return r[u]=f,f}else{let f={...a,...t(a),id:u,children:void 0};return r[u]=f,a.children&&(f.children=Yh(a.children,t,c,r)),f}})}function Lo(e,t,n="/"){return bh(e,t,n,!1)}function bh(e,t,n,r){let a=typeof t=="string"?no(t):t,o=ma(a.pathname||"/",n);if(o==null)return null;let c=lk(e);zY(c);let u=null;for(let f=0;u==null&&f<c.length;++f){let p=YY(o);u=QY(c[f],p,r)}return u}function LY(e,t){let{route:n,pathname:r,params:a}=e;return{id:n.id,pathname:r,params:a,data:t[n.id],handle:n.handle}}function lk(e,t=[],n=[],r=""){let a=(o,c,u)=>{let f={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:c,route:o};f.relativePath.startsWith("/")&&(yt(f.relativePath.startsWith(r),`Absolute route path "${f.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),f.relativePath=f.relativePath.slice(r.length));let p=li([r,f.relativePath]),m=n.concat(f);o.children&&o.children.length>0&&(yt(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),lk(o.children,t,m,p)),!(o.path==null&&!o.index)&&t.push({path:p,score:qY(p,o.index),routesMeta:m})};return e.forEach((o,c)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))a(o,c);else for(let f of ck(o.path))a(o,c,f)}),t}function ck(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let c=ck(r.join("/")),u=[];return u.push(...c.map(f=>f===""?o:[o,f].join("/"))),a&&u.push(...c),u.map(f=>e.startsWith("/")&&f===""?"/":f)}function zY(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:GY(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var $Y=/^:[\w-]+$/,UY=3,BY=2,VY=1,FY=10,HY=-2,hT=e=>e==="*";function qY(e,t){let n=e.split("/"),r=n.length;return n.some(hT)&&(r+=HY),t&&(r+=BY),n.filter(a=>!hT(a)).reduce((a,o)=>a+($Y.test(o)?UY:o===""?VY:FY),r)}function GY(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function QY(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",c=[];for(let u=0;u<r.length;++u){let f=r[u],p=u===r.length-1,m=o==="/"?t:t.slice(o.length)||"/",g=Kh({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),v=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=Kh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(a,g.params),c.push({params:a,pathname:li([o,g.pathname]),pathnameBase:ZY(li([o,g.pathnameBase])),route:v}),g.pathnameBase!=="/"&&(o=li([o,g.pathnameBase]))}return c}function Kh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=WY(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],c=o.replace(/(.)\/+$/,"$1"),u=a.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},v)=>{if(m==="*"){let S=u[v]||"";c=o.slice(0,o.length-S.length).replace(/(.)\/+$/,"$1")}const b=u[v];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:o,pathnameBase:c,pattern:e}}function WY(e,t=!1,n=!0){In(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=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,f)=>(r.push({paramName:u,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function YY(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return In(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ma(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 KY(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?no(e):e;return{pathname:n?n.startsWith("/")?n:XY(n,t):t,search:JY(r),hash:eK(a)}}function XY(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function ty(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 uk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function $b(e){let t=uk(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Ub(e,t,n,r=!1){let a;typeof e=="string"?a=no(e):(a={...e},yt(!a.pathname||!a.pathname.includes("?"),ty("?","pathname","search",a)),yt(!a.pathname||!a.pathname.includes("#"),ty("#","pathname","hash",a)),yt(!a.search||!a.search.includes("#"),ty("#","search","hash",a)));let o=e===""||a.pathname==="",c=o?"/":a.pathname,u;if(c==null)u=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let v=c.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}u=g>=0?t[g]:"/"}let f=KY(a,u),p=c&&c!=="/"&&c.endsWith("/"),m=(o||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var li=e=>e.join("/").replace(/\/\/+/g,"/"),ZY=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),JY=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,eK=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Xh=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function ld(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var dk=["POST","PUT","PATCH","DELETE"],tK=new Set(dk),nK=["GET",...dk],rK=new Set(nK),aK=new Set([301,302,303,307,308]),iK=new Set([307,308]),ny={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},oK={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},$u={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Bb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sK=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),fk="remix-router-transitions",hk=Symbol("ResetLoaderData");function lK(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";yt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],a=e.mapRouteProperties||sK,o={},c=Yh(e.routes,a,void 0,o),u,f=e.basename||"/",p=e.dataStrategy||hK,m={unstable_middleware:!1,...e.future},g=null,v=new Set,b=null,S=null,j=null,C=e.hydrationData!=null,R=Lo(c,e.history.location,f),D=!1,E=null,T;if(R==null&&!e.patchRoutesOnNavigation){let H=la(404,{pathname:e.history.location.pathname}),{matches:G,route:re}=ET(c);T=!0,R=G,E={[re.id]:H}}else if(R&&!e.hydrationData&&kn(R,c,e.history.location.pathname).active&&(R=null),R)if(R.some(H=>H.route.lazy))T=!1;else if(!R.some(H=>H.route.loader))T=!0;else{let H=e.hydrationData?e.hydrationData.loaderData:null,G=e.hydrationData?e.hydrationData.errors:null;if(G){let re=R.findIndex(he=>G[he.route.id]!==void 0);T=R.slice(0,re+1).every(he=>!Qy(he.route,H,G))}else T=R.every(re=>!Qy(re.route,H,G))}else{T=!1,R=[];let H=kn(null,c,e.history.location.pathname);H.active&&H.matches&&(D=!0,R=H.matches)}let A,_={historyAction:e.history.action,location:e.history.location,matches:R,initialized:T,navigation:ny,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||E,fetchers:new Map,blockers:new Map},M="POP",L=!1,$,V=!1,X=new Map,Q=null,J=!1,W=!1,Y=new Set,P=new Map,I=0,z=-1,F=new Map,O=new Set,U=new Map,Z=new Map,ee=new Set,ye=new Map,be,ve=null;function Ge(){if(g=e.history.listen(({action:H,location:G,delta:re})=>{if(be){be(),be=void 0;return}In(ye.size===0||re!=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 he=il({currentLocation:_.location,nextLocation:G,historyAction:H});if(he&&re!=null){let Ee=new Promise(Be=>{be=Be});e.history.go(re*-1),xr(he,{state:"blocked",location:G,proceed(){xr(he,{state:"proceeding",proceed:void 0,reset:void 0,location:G}),Ee.then(()=>e.history.go(re))},reset(){let Be=new Map(_.blockers);Be.set(he,$u),Re({blockers:Be})}});return}return xt(H,G)}),n){CK(t,X);let H=()=>EK(t,X);t.addEventListener("pagehide",H),Q=()=>t.removeEventListener("pagehide",H)}return _.initialized||xt("POP",_.location,{initialHydration:!0}),A}function ke(){g&&g(),Q&&Q(),v.clear(),$&&$.abort(),_.fetchers.forEach((H,G)=>_t(G)),_.blockers.forEach((H,G)=>Yn(G))}function et(H){return v.add(H),()=>v.delete(H)}function Re(H,G={}){_={..._,...H};let re=[],he=[];_.fetchers.forEach((Ee,Be)=>{Ee.state==="idle"&&(ee.has(Be)?re.push(Be):he.push(Be))}),ee.forEach(Ee=>{!_.fetchers.has(Ee)&&!P.has(Ee)&&re.push(Ee)}),[...v].forEach(Ee=>Ee(_,{deletedFetchers:re,viewTransitionOpts:G.viewTransitionOpts,flushSync:G.flushSync===!0})),re.forEach(Ee=>_t(Ee)),he.forEach(Ee=>_.fetchers.delete(Ee))}function ft(H,G,{flushSync:re}={}){var Ze,rt;let he=_.actionData!=null&&_.navigation.formMethod!=null&&qr(_.navigation.formMethod)&&_.navigation.state==="loading"&&((Ze=H.state)==null?void 0:Ze._isRedirect)!==!0,Ee;G.actionData?Object.keys(G.actionData).length>0?Ee=G.actionData:Ee=null:he?Ee=_.actionData:Ee=null;let Be=G.loaderData?jT(_.loaderData,G.loaderData,G.matches||[],G.errors):_.loaderData,tt=_.blockers;tt.size>0&&(tt=new Map(tt),tt.forEach((Ye,lt)=>tt.set(lt,$u)));let Ue=L===!0||_.navigation.formMethod!=null&&qr(_.navigation.formMethod)&&((rt=H.state)==null?void 0:rt._isRedirect)!==!0;u&&(c=u,u=void 0),J||M==="POP"||(M==="PUSH"?e.history.push(H,H.state):M==="REPLACE"&&e.history.replace(H,H.state));let Xe;if(M==="POP"){let Ye=X.get(_.location.pathname);Ye&&Ye.has(H.pathname)?Xe={currentLocation:_.location,nextLocation:H}:X.has(H.pathname)&&(Xe={currentLocation:H,nextLocation:_.location})}else if(V){let Ye=X.get(_.location.pathname);Ye?Ye.add(H.pathname):(Ye=new Set([H.pathname]),X.set(_.location.pathname,Ye)),Xe={currentLocation:_.location,nextLocation:H}}Re({...G,actionData:Ee,loaderData:Be,historyAction:M,location:H,initialized:!0,navigation:ny,revalidation:"idle",restoreScrollPosition:ja(H,G.matches||_.matches),preventScrollReset:Ue,blockers:tt},{viewTransitionOpts:Xe,flushSync:re===!0}),M="POP",L=!1,V=!1,J=!1,W=!1,ve==null||ve.resolve(),ve=null}async function Ut(H,G){if(typeof H=="number"){e.history.go(H);return}let re=Gy(_.location,_.matches,f,H,G==null?void 0:G.fromRouteId,G==null?void 0:G.relative),{path:he,submission:Ee,error:Be}=pT(!1,re,G),tt=_.location,Ue=sd(_.location,he,G&&G.state);Ue={...Ue,...e.history.encodeLocation(Ue)};let Xe=G&&G.replace!=null?G.replace:void 0,Ze="PUSH";Xe===!0?Ze="REPLACE":Xe===!1||Ee!=null&&qr(Ee.formMethod)&&Ee.formAction===_.location.pathname+_.location.search&&(Ze="REPLACE");let rt=G&&"preventScrollReset"in G?G.preventScrollReset===!0:void 0,Ye=(G&&G.flushSync)===!0,lt=il({currentLocation:tt,nextLocation:Ue,historyAction:Ze});if(lt){xr(lt,{state:"blocked",location:Ue,proceed(){xr(lt,{state:"proceeding",proceed:void 0,reset:void 0,location:Ue}),Ut(H,G)},reset(){let Dt=new Map(_.blockers);Dt.set(lt,$u),Re({blockers:Dt})}});return}await xt(Ze,Ue,{submission:Ee,pendingError:Be,preventScrollReset:rt,replace:G&&G.replace,enableViewTransition:G&&G.viewTransition,flushSync:Ye})}function Ot(){ve||(ve=TK()),$e(),Re({revalidation:"loading"});let H=ve.promise;return _.navigation.state==="submitting"?H:_.navigation.state==="idle"?(xt(_.historyAction,_.location,{startUninterruptedRevalidation:!0}),H):(xt(M||_.historyAction,_.navigation.location,{overrideNavigation:_.navigation,enableViewTransition:V===!0}),H)}async function xt(H,G,re){$&&$.abort(),$=null,M=H,J=(re&&re.startUninterruptedRevalidation)===!0,wa(_.location,_.matches),L=(re&&re.preventScrollReset)===!0,V=(re&&re.enableViewTransition)===!0;let he=u||c,Ee=re&&re.overrideNavigation,Be=re!=null&&re.initialHydration&&_.matches&&_.matches.length>0&&!D?_.matches:Lo(he,G,f),tt=(re&&re.flushSync)===!0;if(Be&&_.initialized&&!W&&xK(_.location,G)&&!(re&&re.submission&&qr(re.submission.formMethod))){ft(G,{matches:Be},{flushSync:tt});return}let Ue=kn(Be,he,G.pathname);if(Ue.active&&Ue.matches&&(Be=Ue.matches),!Be){let{error:rn,notFoundMatches:kt,route:jt}=ro(G.pathname);ft(G,{matches:kt,loaderData:{},errors:{[jt.id]:rn}},{flushSync:tt});return}$=new AbortController;let Xe=Jl(e.history,G,$.signal,re&&re.submission),Ze=new fT(e.unstable_getContext?await e.unstable_getContext():void 0),rt;if(re&&re.pendingError)rt=[Cs(Be).route.id,{type:"error",error:re.pendingError}];else if(re&&re.submission&&qr(re.submission.formMethod)){let rn=await Ht(Xe,G,re.submission,Be,Ze,Ue.active,re&&re.initialHydration===!0,{replace:re.replace,flushSync:tt});if(rn.shortCircuited)return;if(rn.pendingActionResult){let[kt,jt]=rn.pendingActionResult;if(Hr(jt)&&ld(jt.error)&&jt.error.status===404){$=null,ft(G,{matches:rn.matches,loaderData:{},errors:{[kt]:jt.error}});return}}Be=rn.matches||Be,rt=rn.pendingActionResult,Ee=ry(G,re.submission),tt=!1,Ue.active=!1,Xe=Jl(e.history,Xe.url,Xe.signal)}let{shortCircuited:Ye,matches:lt,loaderData:Dt,errors:at}=await Bt(Xe,G,Be,Ze,Ue.active,Ee,re&&re.submission,re&&re.fetcherSubmission,re&&re.replace,re&&re.initialHydration===!0,tt,rt);Ye||($=null,ft(G,{matches:lt||Be,...CT(rt),loaderData:Dt,errors:at}))}async function Ht(H,G,re,he,Ee,Be,tt,Ue={}){$e();let Xe=wK(G,re);if(Re({navigation:Xe},{flushSync:Ue.flushSync===!0}),Be){let Ye=await vi(he,G.pathname,H.signal);if(Ye.type==="aborted")return{shortCircuited:!0};if(Ye.type==="error"){let lt=Cs(Ye.partialMatches).route.id;return{matches:Ye.partialMatches,pendingActionResult:[lt,{type:"error",error:Ye.error}]}}else if(Ye.matches)he=Ye.matches;else{let{notFoundMatches:lt,error:Dt,route:at}=ro(G.pathname);return{matches:lt,pendingActionResult:[at.id,{type:"error",error:Dt}]}}}let Ze,rt=qu(he,G);if(!rt.route.action&&!rt.route.lazy)Ze={type:"error",error:la(405,{method:H.method,pathname:G.pathname,routeId:rt.route.id})};else{let Ye=sc(a,o,H,he,rt,tt?[]:r,Ee),lt=await Le(H,Ye,Ee,null);if(Ze=lt[rt.route.id],!Ze){for(let Dt of he)if(lt[Dt.route.id]){Ze=lt[Dt.route.id];break}}if(H.signal.aborted)return{shortCircuited:!0}}if(ks(Ze)){let Ye;return Ue&&Ue.replace!=null?Ye=Ue.replace:Ye=bT(Ze.response.headers.get("Location"),new URL(H.url),f)===_.location.pathname+_.location.search,await we(H,Ze,!0,{submission:re,replace:Ye}),{shortCircuited:!0}}if(Hr(Ze)){let Ye=Cs(he,rt.route.id);return(Ue&&Ue.replace)!==!0&&(M="PUSH"),{matches:he,pendingActionResult:[Ye.route.id,Ze,rt.route.id]}}return{matches:he,pendingActionResult:[rt.route.id,Ze]}}async function Bt(H,G,re,he,Ee,Be,tt,Ue,Xe,Ze,rt,Ye){let lt=Be||ry(G,tt),Dt=tt||Ue||RT(lt),at=!J&&!Ze;if(Ee){if(at){let nr=Se(Ye);Re({navigation:lt,...nr!==void 0?{actionData:nr}:{}},{flushSync:rt})}let Ct=await vi(re,G.pathname,H.signal);if(Ct.type==="aborted")return{shortCircuited:!0};if(Ct.type==="error"){let nr=Cs(Ct.partialMatches).route.id;return{matches:Ct.partialMatches,loaderData:{},errors:{[nr]:Ct.error}}}else if(Ct.matches)re=Ct.matches;else{let{error:nr,notFoundMatches:Ca,route:Ea}=ro(G.pathname);return{matches:Ca,loaderData:{},errors:{[Ea.id]:nr}}}}let rn=u||c,{dsMatches:kt,revalidatingFetchers:jt}=mT(H,he,a,o,e.history,_,re,Dt,G,Ze?[]:r,Ze===!0,W,Y,ee,U,O,rn,f,e.patchRoutesOnNavigation!=null,Ye);if(z=++I,!e.dataStrategy&&!kt.some(Ct=>Ct.shouldLoad)&&jt.length===0){let Ct=ba();return ft(G,{matches:re,loaderData:{},errors:Ye&&Hr(Ye[1])?{[Ye[0]]:Ye[1].error}:null,...CT(Ye),...Ct?{fetchers:new Map(_.fetchers)}:{}},{flushSync:rt}),{shortCircuited:!0}}if(at){let Ct={};if(!Ee){Ct.navigation=lt;let nr=Se(Ye);nr!==void 0&&(Ct.actionData=nr)}jt.length>0&&(Ct.fetchers=Ne(jt)),Re(Ct,{flushSync:rt})}jt.forEach(Ct=>{St(Ct.key),Ct.controller&&P.set(Ct.key,Ct.controller)});let Ha=()=>jt.forEach(Ct=>St(Ct.key));$&&$.signal.addEventListener("abort",Ha);let{loaderResults:cr,fetcherResults:Kr}=await xe(kt,jt,H,he);if(H.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Ha),jt.forEach(Ct=>P.delete(Ct.key));let br=lh(cr);if(br)return await we(H,br.result,!0,{replace:Xe}),{shortCircuited:!0};if(br=lh(Kr),br)return O.add(br.key),await we(H,br.result,!0,{replace:Xe}),{shortCircuited:!0};let{loaderData:ao,errors:io}=wT(_,re,cr,Ye,jt,Kr);Ze&&_.errors&&(io={..._.errors,...io});let Lc=ba(),Xr=gi(z),yi=Lc||Xr||jt.length>0;return{matches:re,loaderData:ao,errors:io,...yi?{fetchers:new Map(_.fetchers)}:{}}}function Se(H){if(H&&!Hr(H[1]))return{[H[0]]:H[1].data};if(_.actionData)return Object.keys(_.actionData).length===0?null:_.actionData}function Ne(H){return H.forEach(G=>{let re=_.fetchers.get(G.key),he=Uu(void 0,re?re.data:void 0);_.fetchers.set(G.key,he)}),new Map(_.fetchers)}async function Ve(H,G,re,he){St(H);let Ee=(he&&he.flushSync)===!0,Be=u||c,tt=Gy(_.location,_.matches,f,re,G,he==null?void 0:he.relative),Ue=Lo(Be,tt,f),Xe=kn(Ue,Be,tt);if(Xe.active&&Xe.matches&&(Ue=Xe.matches),!Ue){ht(H,G,la(404,{pathname:tt}),{flushSync:Ee});return}let{path:Ze,submission:rt,error:Ye}=pT(!0,tt,he);if(Ye){ht(H,G,Ye,{flushSync:Ee});return}let lt=qu(Ue,Ze),Dt=new fT(e.unstable_getContext?await e.unstable_getContext():void 0),at=(he&&he.preventScrollReset)===!0;if(rt&&qr(rt.formMethod)){await Te(H,G,Ze,lt,Ue,Dt,Xe.active,Ee,at,rt);return}U.set(H,{routeId:G,path:Ze}),await ge(H,G,Ze,lt,Ue,Dt,Xe.active,Ee,at,rt)}async function Te(H,G,re,he,Ee,Be,tt,Ue,Xe,Ze){$e(),U.delete(H);function rt(xn){if(!xn.route.action&&!xn.route.lazy){let oo=la(405,{method:Ze.formMethod,pathname:re,routeId:G});return ht(H,G,oo,{flushSync:Ue}),!0}return!1}if(!tt&&rt(he))return;let Ye=_.fetchers.get(H);gt(H,jK(Ze,Ye),{flushSync:Ue});let lt=new AbortController,Dt=Jl(e.history,re,lt.signal,Ze);if(tt){let xn=await vi(Ee,re,Dt.signal,H);if(xn.type==="aborted")return;if(xn.type==="error"){ht(H,G,xn.error,{flushSync:Ue});return}else if(xn.matches){if(Ee=xn.matches,he=qu(Ee,re),rt(he))return}else{ht(H,G,la(404,{pathname:re}),{flushSync:Ue});return}}P.set(H,lt);let at=I,rn=sc(a,o,Dt,Ee,he,r,Be),jt=(await Le(Dt,rn,Be,H))[he.route.id];if(Dt.signal.aborted){P.get(H)===lt&&P.delete(H);return}if(ee.has(H)){if(ks(jt)||Hr(jt)){gt(H,Po(void 0));return}}else{if(ks(jt))if(P.delete(H),z>at){gt(H,Po(void 0));return}else return O.add(H),gt(H,Uu(Ze)),we(Dt,jt,!1,{fetcherSubmission:Ze,preventScrollReset:Xe});if(Hr(jt)){ht(H,G,jt.error);return}}let Ha=_.navigation.location||_.location,cr=Jl(e.history,Ha,lt.signal),Kr=u||c,br=_.navigation.state!=="idle"?Lo(Kr,_.navigation.location,f):_.matches;yt(br,"Didn't find any matches after fetcher action");let ao=++I;F.set(H,ao);let io=Uu(Ze,jt.data);_.fetchers.set(H,io);let{dsMatches:Lc,revalidatingFetchers:Xr}=mT(cr,Be,a,o,e.history,_,br,Ze,Ha,r,!1,W,Y,ee,U,O,Kr,f,e.patchRoutesOnNavigation!=null,[he.route.id,jt]);Xr.filter(xn=>xn.key!==H).forEach(xn=>{let oo=xn.key,zc=_.fetchers.get(oo),Sr=Uu(void 0,zc?zc.data:void 0);_.fetchers.set(oo,Sr),St(oo),xn.controller&&P.set(oo,xn.controller)}),Re({fetchers:new Map(_.fetchers)});let yi=()=>Xr.forEach(xn=>St(xn.key));lt.signal.addEventListener("abort",yi);let{loaderResults:Ct,fetcherResults:nr}=await xe(Lc,Xr,cr,Be);if(lt.signal.aborted)return;if(lt.signal.removeEventListener("abort",yi),F.delete(H),P.delete(H),Xr.forEach(xn=>P.delete(xn.key)),_.fetchers.has(H)){let xn=Po(jt.data);_.fetchers.set(H,xn)}let Ca=lh(Ct);if(Ca)return we(cr,Ca.result,!1,{preventScrollReset:Xe});if(Ca=lh(nr),Ca)return O.add(Ca.key),we(cr,Ca.result,!1,{preventScrollReset:Xe});let{loaderData:Ea,errors:es}=wT(_,br,Ct,void 0,Xr,nr);gi(ao),_.navigation.state==="loading"&&ao>z?(yt(M,"Expected pending action"),$&&$.abort(),ft(_.navigation.location,{matches:br,loaderData:Ea,errors:es,fetchers:new Map(_.fetchers)})):(Re({errors:es,loaderData:jT(_.loaderData,Ea,br,es),fetchers:new Map(_.fetchers)}),W=!1)}async function ge(H,G,re,he,Ee,Be,tt,Ue,Xe,Ze){let rt=_.fetchers.get(H);gt(H,Uu(Ze,rt?rt.data:void 0),{flushSync:Ue});let Ye=new AbortController,lt=Jl(e.history,re,Ye.signal);if(tt){let jt=await vi(Ee,re,lt.signal,H);if(jt.type==="aborted")return;if(jt.type==="error"){ht(H,G,jt.error,{flushSync:Ue});return}else if(jt.matches)Ee=jt.matches,he=qu(Ee,re);else{ht(H,G,la(404,{pathname:re}),{flushSync:Ue});return}}P.set(H,Ye);let Dt=I,at=sc(a,o,lt,Ee,he,r,Be),kt=(await Le(lt,at,Be,H))[he.route.id];if(P.get(H)===Ye&&P.delete(H),!lt.signal.aborted){if(ee.has(H)){gt(H,Po(void 0));return}if(ks(kt))if(z>Dt){gt(H,Po(void 0));return}else{O.add(H),await we(lt,kt,!1,{preventScrollReset:Xe});return}if(Hr(kt)){ht(H,G,kt.error);return}gt(H,Po(kt.data))}}async function we(H,G,re,{submission:he,fetcherSubmission:Ee,preventScrollReset:Be,replace:tt}={}){G.response.headers.has("X-Remix-Revalidate")&&(W=!0);let Ue=G.response.headers.get("Location");yt(Ue,"Expected a Location header on the redirect Response"),Ue=bT(Ue,new URL(H.url),f);let Xe=sd(_.location,Ue,{_isRedirect:!0});if(n){let at=!1;if(G.response.headers.has("X-Remix-Reload-Document"))at=!0;else if(Bb.test(Ue)){const rn=sk(Ue,!0);at=rn.origin!==t.location.origin||ma(rn.pathname,f)==null}if(at){tt?t.location.replace(Ue):t.location.assign(Ue);return}}$=null;let Ze=tt===!0||G.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:rt,formAction:Ye,formEncType:lt}=_.navigation;!he&&!Ee&&rt&&Ye&<&&(he=RT(_.navigation));let Dt=he||Ee;if(iK.has(G.response.status)&&Dt&&qr(Dt.formMethod))await xt(Ze,Xe,{submission:{...Dt,formAction:Ue},preventScrollReset:Be||L,enableViewTransition:re?V:void 0});else{let at=ry(Xe,he);await xt(Ze,Xe,{overrideNavigation:at,fetcherSubmission:Ee,preventScrollReset:Be||L,enableViewTransition:re?V:void 0})}}async function Le(H,G,re,he){let Ee,Be={};try{Ee=await pK(p,H,G,he,re,!1)}catch(tt){return G.filter(Ue=>Ue.shouldLoad).forEach(Ue=>{Be[Ue.route.id]={type:"error",error:tt}}),Be}if(H.signal.aborted)return Be;for(let[tt,Ue]of Object.entries(Ee))if(bK(Ue)){let Xe=Ue.result;Be[tt]={type:"redirect",response:vK(Xe,H,tt,G,f)}}else Be[tt]=await gK(Ue);return Be}async function xe(H,G,re,he){let Ee=Le(re,H,he,null),Be=Promise.all(G.map(async Xe=>{if(Xe.matches&&Xe.match&&Xe.request&&Xe.controller){let rt=(await Le(Xe.request,Xe.matches,he,Xe.key))[Xe.match.route.id];return{[Xe.key]:rt}}else return Promise.resolve({[Xe.key]:{type:"error",error:la(404,{pathname:Xe.path})}})})),tt=await Ee,Ue=(await Be).reduce((Xe,Ze)=>Object.assign(Xe,Ze),{});return{loaderResults:tt,fetcherResults:Ue}}function $e(){W=!0,U.forEach((H,G)=>{P.has(G)&&Y.add(G),St(G)})}function gt(H,G,re={}){_.fetchers.set(H,G),Re({fetchers:new Map(_.fetchers)},{flushSync:(re&&re.flushSync)===!0})}function ht(H,G,re,he={}){let Ee=Cs(_.matches,G);_t(H),Re({errors:{[Ee.route.id]:re},fetchers:new Map(_.fetchers)},{flushSync:(he&&he.flushSync)===!0})}function Wt(H){return Z.set(H,(Z.get(H)||0)+1),ee.has(H)&&ee.delete(H),_.fetchers.get(H)||oK}function _t(H){let G=_.fetchers.get(H);P.has(H)&&!(G&&G.state==="loading"&&F.has(H))&&St(H),U.delete(H),F.delete(H),O.delete(H),ee.delete(H),Y.delete(H),_.fetchers.delete(H)}function mn(H){let G=(Z.get(H)||0)-1;G<=0?(Z.delete(H),ee.add(H)):Z.set(H,G),Re({fetchers:new Map(_.fetchers)})}function St(H){let G=P.get(H);G&&(G.abort(),P.delete(H))}function Va(H){for(let G of H){let re=Wt(G),he=Po(re.data);_.fetchers.set(G,he)}}function ba(){let H=[],G=!1;for(let re of O){let he=_.fetchers.get(re);yt(he,`Expected fetcher: ${re}`),he.state==="loading"&&(O.delete(re),H.push(re),G=!0)}return Va(H),G}function gi(H){let G=[];for(let[re,he]of F)if(he<H){let Ee=_.fetchers.get(re);yt(Ee,`Expected fetcher: ${re}`),Ee.state==="loading"&&(St(re),F.delete(re),G.push(re))}return Va(G),G.length>0}function Sa(H,G){let re=_.blockers.get(H)||$u;return ye.get(H)!==G&&ye.set(H,G),re}function Yn(H){_.blockers.delete(H),ye.delete(H)}function xr(H,G){let re=_.blockers.get(H)||$u;yt(re.state==="unblocked"&&G.state==="blocked"||re.state==="blocked"&&G.state==="blocked"||re.state==="blocked"&&G.state==="proceeding"||re.state==="blocked"&&G.state==="unblocked"||re.state==="proceeding"&&G.state==="unblocked",`Invalid blocker state transition: ${re.state} -> ${G.state}`);let he=new Map(_.blockers);he.set(H,G),Re({blockers:he})}function il({currentLocation:H,nextLocation:G,historyAction:re}){if(ye.size===0)return;ye.size>1&&In(!1,"A router only supports one blocker at a time");let he=Array.from(ye.entries()),[Ee,Be]=he[he.length-1],tt=_.blockers.get(Ee);if(!(tt&&tt.state==="proceeding")&&Be({currentLocation:H,nextLocation:G,historyAction:re}))return Ee}function ro(H){let G=la(404,{pathname:H}),re=u||c,{matches:he,route:Ee}=ET(re);return{notFoundMatches:he,route:Ee,error:G}}function Zo(H,G,re){if(b=H,j=G,S=re||null,!C&&_.navigation===ny){C=!0;let he=ja(_.location,_.matches);he!=null&&Re({restoreScrollPosition:he})}return()=>{b=null,j=null,S=null}}function Fa(H,G){return S&&S(H,G.map(he=>LY(he,_.loaderData)))||H.key}function wa(H,G){if(b&&j){let re=Fa(H,G);b[re]=j()}}function ja(H,G){if(b){let re=Fa(H,G),he=b[re];if(typeof he=="number")return he}return null}function kn(H,G,re){if(e.patchRoutesOnNavigation)if(H){if(Object.keys(H[0].params).length>0)return{active:!0,matches:bh(G,re,f,!0)}}else return{active:!0,matches:bh(G,re,f,!0)||[]};return{active:!1,matches:null}}async function vi(H,G,re,he){if(!e.patchRoutesOnNavigation)return{type:"success",matches:H};let Ee=H;for(;;){let Be=u==null,tt=u||c,Ue=o;try{await e.patchRoutesOnNavigation({signal:re,path:G,matches:Ee,fetcherKey:he,patch:(rt,Ye)=>{re.aborted||gT(rt,Ye,tt,Ue,a)}})}catch(rt){return{type:"error",error:rt,partialMatches:Ee}}finally{Be&&!re.aborted&&(c=[...c])}if(re.aborted)return{type:"aborted"};let Xe=Lo(tt,G,f);if(Xe)return{type:"success",matches:Xe};let Ze=bh(tt,G,f,!0);if(!Ze||Ee.length===Ze.length&&Ee.every((rt,Ye)=>rt.route.id===Ze[Ye].route.id))return{type:"success",matches:null};Ee=Ze}}function ol(H){o={},u=Yh(H,a,void 0,o)}function Jo(H,G){let re=u==null;gT(H,G,u||c,o,a),re&&(c=[...c],Re({}))}return A={get basename(){return f},get future(){return m},get state(){return _},get routes(){return c},get window(){return t},initialize:Ge,subscribe:et,enableScrollRestoration:Zo,navigate:Ut,fetch:Ve,revalidate:Ot,createHref:H=>e.history.createHref(H),encodeLocation:H=>e.history.encodeLocation(H),getFetcher:Wt,deleteFetcher:mn,dispose:ke,getBlocker:Sa,deleteBlocker:Yn,patchRoutes:Jo,_internalFetchControllers:P,_internalSetRoutes:ol},A}function cK(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Gy(e,t,n,r,a,o){let c,u;if(a){c=[];for(let p of t)if(c.push(p),p.route.id===a){u=p;break}}else c=t,u=t[t.length-1];let f=Ub(r||".",$b(c),ma(e.pathname,n)||e.pathname,o==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&u){let p=Vb(f.search);if(u.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let v=m.toString();f.search=v?`?${v}`:""}}return n!=="/"&&(f.pathname=f.pathname==="/"?n:li([n,f.pathname])),Vo(f)}function pT(e,t,n){if(!n||!cK(n))return{path:t};if(n.formMethod&&!SK(n.formMethod))return{path:t,error:la(405,{method:n.formMethod})};let r=()=>({path:t,error:la(400,{type:"invalid-body"})}),o=(n.formMethod||"get").toUpperCase(),c=xk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!qr(o))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[b,S])=>`${v}${b}=${S}
|
|
567
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!qr(o))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:o,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}yt(typeof FormData=="function","FormData is not available in this environment");let u,f;if(n.formData)u=Yy(n.formData),f=n.formData;else if(n.body instanceof FormData)u=Yy(n.body),f=n.body;else if(n.body instanceof URLSearchParams)u=n.body,f=ST(u);else if(n.body==null)u=new URLSearchParams,f=new FormData;else try{u=new URLSearchParams(n.body),f=ST(u)}catch{return r()}let p={formMethod:o,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(qr(p.formMethod))return{path:t,submission:p};let m=no(t);return e&&m.search&&Vb(m.search)&&u.append("index",""),m.search=`?${u}`,{path:Vo(m),submission:p}}function mT(e,t,n,r,a,o,c,u,f,p,m,g,v,b,S,j,C,R,D,E){var J;let T=E?Hr(E[1])?E[1].error:E[1].data:void 0,A=a.createURL(o.location),_=a.createURL(f),M;if(m&&o.errors){let W=Object.keys(o.errors)[0];M=c.findIndex(Y=>Y.route.id===W)}else if(E&&Hr(E[1])){let W=E[0];M=c.findIndex(Y=>Y.route.id===W)-1}let L=E?E[1].statusCode:void 0,$=L&&L>=400,V={currentUrl:A,currentParams:((J=o.matches[0])==null?void 0:J.params)||{},nextUrl:_,nextParams:c[0].params,...u,actionResult:T,actionStatus:L},X=c.map((W,Y)=>{let{route:P}=W,I=null;if(M!=null&&Y>M?I=!1:P.lazy?I=!0:P.loader==null?I=!1:m?I=Qy(P,o.loaderData,o.errors):uK(o.loaderData,o.matches[Y],W)&&(I=!0),I!==null)return Wy(n,r,e,W,p,t,I);let z=$?!1:g||A.pathname+A.search===_.pathname+_.search||A.search!==_.search||dK(o.matches[Y],W),F={...V,defaultShouldRevalidate:z},O=Zh(W,F);return Wy(n,r,e,W,p,t,O,F)}),Q=[];return S.forEach((W,Y)=>{if(m||!c.some(ee=>ee.route.id===W.routeId)||b.has(Y))return;let P=o.fetchers.get(Y),I=P&&P.state!=="idle"&&P.data===void 0,z=Lo(C,W.path,R);if(!z){if(D&&I)return;Q.push({key:Y,routeId:W.routeId,path:W.path,matches:null,match:null,request:null,controller:null});return}if(j.has(Y))return;let F=qu(z,W.path),O=new AbortController,U=Jl(a,W.path,O.signal),Z=null;if(v.has(Y))v.delete(Y),Z=sc(n,r,U,z,F,p,t);else if(I)g&&(Z=sc(n,r,U,z,F,p,t));else{let ee={...V,defaultShouldRevalidate:$?!1:g};Zh(F,ee)&&(Z=sc(n,r,U,z,F,p,t,ee))}Z&&Q.push({key:Y,routeId:W.routeId,path:W.path,matches:Z,match:F,request:U,controller:O})}),{dsMatches:X,revalidatingFetchers:Q}}function Qy(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,a=n!=null&&n[e.id]!==void 0;return!r&&a?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!a}function uK(e,t,n){let r=!t||n.route.id!==t.route.id,a=!e.hasOwnProperty(n.route.id);return r||a}function dK(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Zh(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function gT(e,t,n,r,a){let o;if(e){let f=r[e];yt(f,`No route found to patch children into: routeId = ${e}`),f.children||(f.children=[]),o=f.children}else o=n;let c=t.filter(f=>!o.some(p=>pk(f,p))),u=Yh(c,a,[e||"_","patch",String((o==null?void 0:o.length)||"0")],r);o.push(...u)}function pk(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var a;return(a=t.children)==null?void 0:a.some(o=>pk(n,o))}):!1}var vT=new WeakMap,mk=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let a=n[t.id];if(yt(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let o=a.lazy[e];if(!o)return;let c=vT.get(a);c||(c={},vT.set(a,c));let u=c[e];if(u)return u;let f=(async()=>{let p=NY(e),g=a[e]!==void 0&&e!=="hasErrorBoundary";if(p)In(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)In(!1,`Route "${a.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await o();v!=null&&(Object.assign(a,{[e]:v}),Object.assign(a,r(a)))}typeof a.lazy=="object"&&(a.lazy[e]=void 0,Object.values(a.lazy).every(v=>v===void 0)&&(a.lazy=void 0))})();return c[e]=f,f},yT=new WeakMap;function fK(e,t,n,r,a){let o=n[e.id];if(yt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=yT.get(o);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{yt(typeof e.lazy=="function","No lazy route function found");let v=await e.lazy(),b={};for(let S in v){let j=v[S];if(j===void 0)continue;let C=MY(S),D=o[S]!==void 0&&S!=="hasErrorBoundary";C?In(!C,"Route property "+S+" is not a supported property to be returned from a lazy route function. This property will be ignored."):D?In(!D,`Route "${o.id}" has a static property "${S}" defined but its lazy function is also returning a value for this property. The lazy route property "${S}" will be ignored.`):b[S]=j}Object.assign(o,b),Object.assign(o,{...r(o),lazy:void 0})})();return yT.set(o,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),u=[],f;for(let m of c){if(a&&a.includes(m))continue;let g=mk({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(u.push(g),m===t&&(f=g))}let p=u.length>0?Promise.all(u).then(()=>{}):void 0;return p==null||p.catch(()=>{}),f==null||f.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function xT(e){let t=e.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(t.map(a=>a.resolve()))).forEach((a,o)=>{n[t[o].route.id]=a}),n}async function hK(e){return e.matches.some(t=>t.route.unstable_middleware)?gk(e,!1,()=>xT(e),(t,n)=>({[n]:{type:"error",result:t}})):xT(e)}async function gk(e,t,n,r){let{matches:a,request:o,params:c,context:u}=e,f={handlerResult:void 0};try{let p=a.flatMap(g=>g.route.unstable_middleware?g.route.unstable_middleware.map(v=>[g.route.id,v]):[]),m=await vk({request:o,params:c,context:u},p,t,f,n);return t?m:f.handlerResult}catch(p){if(!f.middlewareError)throw p;let m=await r(f.middlewareError.error,f.middlewareError.routeId);return f.handlerResult?Object.assign(f.handlerResult,m):m}}async function vk(e,t,n,r,a,o=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let u=t[o];if(!u)return r.handlerResult=await a(),r.handlerResult;let[f,p]=u,m=!1,g,v=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0,await vk(e,t,n,r,a,o+1)};try{let b=await p({request:e.request,params:e.params,context:e.context},v);return m?b===void 0?g:b:v()}catch(b){throw r.middlewareError?r.middlewareError.error!==b&&(r.middlewareError={routeId:f,error:b}):r.middlewareError={routeId:f,error:b},b}}function yk(e,t,n,r,a){let o=mk({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=fK(r.route,qr(n.method)?"action":"loader",t,e,a);return{middleware:o,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Wy(e,t,n,r,a,o,c,u=null){let f=!1,p=yk(e,t,n,r,a);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler(m){return f=!0,u?typeof m=="boolean"?Zh(r,{...u,defaultShouldRevalidate:m}):Zh(r,u):c},resolve(m){return f||c||m&&n.method==="GET"&&(r.route.lazy||r.route.loader)?mK({request:n,match:r,lazyHandlerPromise:p==null?void 0:p.handler,lazyRoutePromise:p==null?void 0:p.route,handlerOverride:m,scopedContext:o}):Promise.resolve({type:"data",result:void 0})}}}function sc(e,t,n,r,a,o,c,u=null){return r.map(f=>f.route.id!==a.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:u,unstable_shouldCallHandler:()=>!1,_lazyPromises:yk(e,t,n,f,o),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Wy(e,t,n,f,o,c,!0,u))}async function pK(e,t,n,r,a,o){n.some(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware})&&await Promise.all(n.map(p=>{var m;return(m=p._lazyPromises)==null?void 0:m.middleware}));let c={request:t,params:n[0].params,context:a,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:p=>{let m=c;return gk(m,!1,()=>p({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}}),(g,v)=>({[v]:{type:"error",result:g}}))}});try{await Promise.all(n.flatMap(p=>{var m,g;return[(m=p._lazyPromises)==null?void 0:m.handler,(g=p._lazyPromises)==null?void 0:g.route]}))}catch{}return f}async function mK({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:a,scopedContext:o}){let c,u,f=qr(e.method),p=f?"action":"loader",m=g=>{let v,b=new Promise((C,R)=>v=R);u=()=>v(),e.signal.addEventListener("abort",u);let S=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:o},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(a?a(R=>S(R)):S())}}catch(C){return{type:"error",result:C}}})();return Promise.race([j,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let v,[b]=await Promise.all([m(g).catch(S=>{v=S}),n,r]);if(v!==void 0)throw v;c=b}else{await n;let v=f?t.route.action:t.route.loader;if(v)[c]=await Promise.all([m(v),r]);else if(p==="action"){let b=new URL(e.url),S=b.pathname+b.search;throw la(405,{method:e.method,pathname:S,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let v=new URL(e.url),b=v.pathname+v.search;throw la(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{u&&e.signal.removeEventListener("abort",u)}return c}async function gK(e){var r,a,o,c,u,f;let{result:t,type:n}=e;if(bk(t)){let p;try{let m=t.headers.get("Content-Type");m&&/\bapplication\/json\b/.test(m)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(m){return{type:"error",error:m}}return n==="error"?{type:"error",error:new Xh(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:"data",data:p,statusCode:t.status,headers:t.headers}}return n==="error"?TT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(a=t.init)!=null&&a.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Xh(((o=t.init)==null?void 0:o.status)||500,void 0,t.data),statusCode:ld(t)?t.status:void 0,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:ld(t)?t.status:void 0}:TT(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(f=t.init)!=null&&f.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function vK(e,t,n,r,a){let o=e.headers.get("Location");if(yt(o,"Redirects returned/thrown from loaders/actions must have a Location header"),!Bb.test(o)){let c=r.slice(0,r.findIndex(u=>u.route.id===n)+1);o=Gy(new URL(t.url),c,a,o),e.headers.set("Location",o)}return e}function bT(e,t,n){if(Bb.test(e)){let r=e,a=r.startsWith("//")?new URL(t.protocol+r):new URL(r),o=ma(a.pathname,n)!=null;if(a.origin===t.origin&&o)return a.pathname+a.search+a.hash}return e}function Jl(e,t,n,r){let a=e.createURL(xk(t)).toString(),o={signal:n};if(r&&qr(r.formMethod)){let{formMethod:c,formEncType:u}=r;o.method=c.toUpperCase(),u==="application/json"?(o.headers=new Headers({"Content-Type":u}),o.body=JSON.stringify(r.json)):u==="text/plain"?o.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?o.body=Yy(r.formData):o.body=r.formData}return new Request(a,o)}function Yy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function ST(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function yK(e,t,n,r=!1,a=!1){let o={},c=null,u,f=!1,p={},m=n&&Hr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let v=g.route.id,b=t[v];if(yt(!ks(b),"Cannot handle redirect results in processLoaderData"),Hr(b)){let S=b.error;if(m!==void 0&&(S=m,m=void 0),c=c||{},a)c[v]=S;else{let j=Cs(e,v);c[j.route.id]==null&&(c[j.route.id]=S)}r||(o[v]=hk),f||(f=!0,u=ld(b.error)?b.error.status:500),b.headers&&(p[v]=b.headers)}else o[v]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(u=b.statusCode),b.headers&&(p[v]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(o[n[2]]=void 0)),{loaderData:o,errors:c,statusCode:u||200,loaderHeaders:p}}function wT(e,t,n,r,a,o){let{loaderData:c,errors:u}=yK(t,n,r);return a.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f,v=o[p];if(yt(v,"Did not find corresponding fetcher result"),!(g&&g.signal.aborted))if(Hr(v)){let b=Cs(e.matches,m==null?void 0:m.route.id);u&&u[b.route.id]||(u={...u,[b.route.id]:v.error}),e.fetchers.delete(p)}else if(ks(v))yt(!1,"Unhandled fetcher revalidation redirect");else{let b=Po(v.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:u}}function jT(e,t,n,r){let a=Object.entries(t).filter(([,o])=>o!==hk).reduce((o,[c,u])=>(o[c]=u,o),{});for(let o of n){let c=o.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&o.route.loader&&(a[c]=e[c]),r&&r.hasOwnProperty(c))break}return a}function CT(e){return e?Hr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Cs(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 ET(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 la(e,{pathname:t,routeId:n,method:r,type:a,message:o}={}){let c="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?u=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(u="Unable to encode submission body")):e===403?(c="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",u=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?u=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(u=`Invalid request method "${r.toUpperCase()}"`)),new Xh(e||500,c,new Error(u),!0)}function lh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,a]=t[n];if(ks(a))return{key:r,result:a}}}function xk(e){let t=typeof e=="string"?no(e):e;return Vo({...t,hash:""})}function xK(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function bK(e){return bk(e.result)&&aK.has(e.result.status)}function Hr(e){return e.type==="error"}function ks(e){return(e&&e.type)==="redirect"}function TT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function bk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function SK(e){return rK.has(e.toUpperCase())}function qr(e){return tK.has(e.toUpperCase())}function Vb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function qu(e,t){let n=typeof t=="string"?no(t).search:t.search;if(e[e.length-1].route.index&&Vb(n||""))return e[e.length-1];let r=uk(e);return r[r.length-1]}function RT(e){let{formMethod:t,formAction:n,formEncType:r,text:a,formData:o,json:c}=e;if(!(!t||!n||!r)){if(a!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:a};if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:o,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function ry(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 wK(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 Uu(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 jK(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 Po(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 CK(e,t){try{let n=e.sessionStorage.getItem(fk);if(n){let r=JSON.parse(n);for(let[a,o]of Object.entries(r||{}))o&&Array.isArray(o)&&t.set(a,new Set(o||[]))}}catch{}}function EK(e,t){if(t.size>0){let n={};for(let[r,a]of t)n[r]=[...a];try{e.sessionStorage.setItem(fk,JSON.stringify(n))}catch(r){In(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function TK(){let e,t,n=new Promise((r,a)=>{e=async o=>{r(o);try{await n}catch{}},t=async o=>{a(o);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var nl=y.createContext(null);nl.displayName="DataRouter";var Ld=y.createContext(null);Ld.displayName="DataRouterState";var Fb=y.createContext({isTransitioning:!1});Fb.displayName="ViewTransition";var Sk=y.createContext(new Map);Sk.displayName="Fetchers";var RK=y.createContext(null);RK.displayName="Await";var mi=y.createContext(null);mi.displayName="Navigation";var zd=y.createContext(null);zd.displayName="Location";var Ba=y.createContext({outlet:null,matches:[],isDataRoute:!1});Ba.displayName="Route";var Hb=y.createContext(null);Hb.displayName="RouteError";function DK(e,{relative:t}={}){yt($d(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=y.useContext(mi),{hash:a,pathname:o,search:c}=Ud(e,{relative:t}),u=o;return n!=="/"&&(u=o==="/"?n:li([n,o])),r.createHref({pathname:u,search:c,hash:a})}function $d(){return y.useContext(zd)!=null}function Mr(){return yt($d(),"useLocation() may be used only in the context of a <Router> component."),y.useContext(zd).location}var wk="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function jk(e){y.useContext(mi).static||y.useLayoutEffect(e)}function Rn(){let{isDataRoute:e}=y.useContext(Ba);return e?FK():AK()}function AK(){yt($d(),"useNavigate() may be used only in the context of a <Router> component.");let e=y.useContext(nl),{basename:t,navigator:n}=y.useContext(mi),{matches:r}=y.useContext(Ba),{pathname:a}=Mr(),o=JSON.stringify($b(r)),c=y.useRef(!1);return jk(()=>{c.current=!0}),y.useCallback((f,p={})=>{if(In(c.current,wk),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Ub(f,JSON.parse(o),a,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:li([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,o,a,e])}var _K=y.createContext(null);function kK(e){let t=y.useContext(Ba).outlet;return t&&y.createElement(_K.Provider,{value:e},t)}function Qt(){let{matches:e}=y.useContext(Ba),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=y.useContext(Ba),{pathname:r}=Mr(),a=JSON.stringify($b(n));return y.useMemo(()=>Ub(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function PK(e,t){return Ck(e,t)}function Ck(e,t,n,r){var R;yt($d(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=y.useContext(mi),{matches:o}=y.useContext(Ba),c=o[o.length-1],u=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let D=m&&m.path||"";Ek(f,!m||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${D}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
568
|
+
|
|
569
|
+
Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let g=Mr(),v;if(t){let D=typeof t=="string"?no(t):t;yt(p==="/"||((R=D.pathname)==null?void 0:R.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${D.pathname}" was given in the \`location\` prop.`),v=D}else v=g;let b=v.pathname||"/",S=b;if(p!=="/"){let D=p.replace(/^\//,"").split("/");S="/"+b.replace(/^\//,"").split("/").slice(D.length).join("/")}let j=Lo(e,{pathname:S});In(m||j!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),In(j==null||j[j.length-1].route.element!==void 0||j[j.length-1].route.Component!==void 0||j[j.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=LK(j&&j.map(D=>Object.assign({},D,{params:Object.assign({},u,D.params),pathname:li([p,a.encodeLocation?a.encodeLocation(D.pathname).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?p:li([p,a.encodeLocation?a.encodeLocation(D.pathnameBase).pathname:D.pathnameBase])})),o,n,r);return t&&C?y.createElement(zd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},C):C}function NK(){let e=VK(),t=ld(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=y.createElement(y.Fragment,null,y.createElement("p",null,"💿 Hey developer 👋"),y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",y.createElement("code",{style:o},"ErrorBoundary")," or"," ",y.createElement("code",{style:o},"errorElement")," prop on your route.")),y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:a},n):null,c)}var OK=y.createElement(NK,null),MK=class extends y.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?y.createElement(Ba.Provider,{value:this.props.routeContext},y.createElement(Hb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function IK({routeContext:e,match:t,children:n}){let r=y.useContext(nl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),y.createElement(Ba.Provider,{value:e},n)}function LK(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,o=n==null?void 0:n.errors;if(o!=null){let f=a.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);yt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,f+1))}let c=!1,u=-1;if(n)for(let f=0;f<a.length;f++){let p=a[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=f),p.route.id){let{loaderData:m,errors:g}=n,v=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||v){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((f,p,m)=>{let g,v=!1,b=null,S=null;n&&(g=o&&p.route.id?o[p.route.id]:void 0,b=p.route.errorElement||OK,c&&(u<0&&m===0?(Ek("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,S=null):u===m&&(v=!0,S=p.route.hydrateFallbackElement||null)));let j=t.concat(a.slice(0,m+1)),C=()=>{let R;return g?R=b:v?R=S:p.route.Component?R=y.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=f,y.createElement(IK,{match:p,routeContext:{outlet:f,matches:j,isDataRoute:n!=null},children:R})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?y.createElement(MK,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):C()},null)}function qb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function zK(e){let t=y.useContext(nl);return yt(t,qb(e)),t}function $K(e){let t=y.useContext(Ld);return yt(t,qb(e)),t}function UK(e){let t=y.useContext(Ba);return yt(t,qb(e)),t}function Gb(e){let t=UK(e),n=t.matches[t.matches.length-1];return yt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function BK(){return Gb("useRouteId")}function VK(){var r;let e=y.useContext(Hb),t=$K("useRouteError"),n=Gb("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function FK(){let{router:e}=zK("useNavigate"),t=Gb("useNavigate"),n=y.useRef(!1);return jk(()=>{n.current=!0}),y.useCallback(async(a,o={})=>{In(n.current,wk),n.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var DT={};function Ek(e,t,n){!t&&!DT[e]&&(DT[e]=!0,In(!1,n))}var AT={};function _T(e,t){!e&&!AT[t]&&(AT[t]=!0,console.warn(t))}function HK(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&In(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:y.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&In(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&In(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var qK=["HydrateFallback","hydrateFallbackElement"],GK=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function QK({router:e,flushSync:t}){let[n,r]=y.useState(e.state),[a,o]=y.useState(),[c,u]=y.useState({isTransitioning:!1}),[f,p]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(),S=y.useRef(new Map),j=y.useCallback((E,{deletedFetchers:T,flushSync:A,viewTransitionOpts:_})=>{E.fetchers.forEach((L,$)=>{L.data!==void 0&&S.current.set($,L.data)}),T.forEach(L=>S.current.delete(L)),_T(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(_T(_==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!_||!M){t&&A?t(()=>r(E)):y.startTransition(()=>r(E));return}if(t&&A){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:_.currentLocation,nextLocation:_.nextLocation})});let L=e.window.document.startViewTransition(()=>{t(()=>r(E))});L.finished.finally(()=>{t(()=>{p(void 0),g(void 0),o(void 0),u({isTransitioning:!1})})}),t(()=>g(L));return}m?(f&&f.resolve(),m.skipTransition(),b({state:E,currentLocation:_.currentLocation,nextLocation:_.nextLocation})):(o(E),u({isTransitioning:!0,flushSync:!1,currentLocation:_.currentLocation,nextLocation:_.nextLocation}))},[e.window,t,m,f]);y.useLayoutEffect(()=>e.subscribe(j),[e,j]),y.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new GK)},[c]),y.useEffect(()=>{if(f&&a&&e.window){let E=a,T=f.promise,A=e.window.document.startViewTransition(async()=>{y.startTransition(()=>r(E)),await T});A.finished.finally(()=>{p(void 0),g(void 0),o(void 0),u({isTransitioning:!1})}),g(A)}},[a,f,e.window]),y.useEffect(()=>{f&&a&&n.location.key===a.location.key&&f.resolve()},[f,m,n.location,a]),y.useEffect(()=>{!c.isTransitioning&&v&&(o(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),b(void 0))},[c.isTransitioning,v]);let C=y.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,T,A)=>e.navigate(E,{state:T,preventScrollReset:A==null?void 0:A.preventScrollReset}),replace:(E,T,A)=>e.navigate(E,{replace:!0,state:T,preventScrollReset:A==null?void 0:A.preventScrollReset})}),[e]),R=e.basename||"/",D=y.useMemo(()=>({router:e,navigator:C,static:!1,basename:R}),[e,C,R]);return y.createElement(y.Fragment,null,y.createElement(nl.Provider,{value:D},y.createElement(Ld.Provider,{value:n},y.createElement(Sk.Provider,{value:S.current},y.createElement(Fb.Provider,{value:c},y.createElement(KK,{basename:R,location:n.location,navigationType:n.historyAction,navigator:C},y.createElement(WK,{routes:e.routes,future:e.future,state:n})))))),null)}var WK=y.memo(YK);function YK({routes:e,future:t,state:n}){return Ck(e,void 0,n,t)}function Qb(e){return kK(e.context)}function qe(e){yt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function KK({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1}){yt(!$d(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=y.useMemo(()=>({basename:c,navigator:a,static:o,future:{}}),[c,a,o]);typeof n=="string"&&(n=no(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:v="default"}=n,b=y.useMemo(()=>{let S=ma(f,c);return S==null?null:{location:{pathname:S,search:p,hash:m,state:g,key:v},navigationType:r}},[c,f,p,m,g,v,r]);return In(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:y.createElement(mi.Provider,{value:u},y.createElement(zd.Provider,{children:t,value:b}))}function XK({children:e,location:t}){return PK(Ky(e),t)}function Ky(e,t=[]){let n=[];return y.Children.forEach(e,(r,a)=>{if(!y.isValidElement(r))return;let o=[...t,a];if(r.type===y.Fragment){n.push.apply(n,Ky(r.props.children,o));return}yt(r.type===qe,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||o.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,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=Ky(r.props.children,o)),n.push(c)}),n}var Sh="get",wh="application/x-www-form-urlencoded";function sm(e){return e!=null&&typeof e.tagName=="string"}function ZK(e){return sm(e)&&e.tagName.toLowerCase()==="button"}function JK(e){return sm(e)&&e.tagName.toLowerCase()==="form"}function eX(e){return sm(e)&&e.tagName.toLowerCase()==="input"}function tX(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function nX(e,t){return e.button===0&&(!t||t==="_self")&&!tX(e)}function Xy(e=""){return 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(a=>[n,a]):[[n,r]])},[]))}function rX(e,t){let n=Xy(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}var ch=null;function aX(){if(ch===null)try{new FormData(document.createElement("form"),0),ch=!1}catch{ch=!0}return ch}var iX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ay(e){return e!=null&&!iX.has(e)?(In(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${wh}"`),null):e}function oX(e,t){let n,r,a,o,c;if(JK(e)){let u=e.getAttribute("action");r=u?ma(u,t):null,n=e.getAttribute("method")||Sh,a=ay(e.getAttribute("enctype"))||wh,o=new FormData(e)}else if(ZK(e)||eX(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||u.getAttribute("action");if(r=f?ma(f,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Sh,a=ay(e.getAttribute("formenctype"))||ay(u.getAttribute("enctype"))||wh,o=new FormData(u,e),!aX()){let{name:p,type:m,value:g}=e;if(m==="image"){let v=p?`${p}.`:"";o.append(`${v}x`,"0"),o.append(`${v}y`,"0")}else p&&o.append(p,g)}}else{if(sm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sh,r=null,a=wh,c=e}return o&&a==="text/plain"&&(c=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:c}}function Wb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function sX(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function lX(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function cX(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let c=await sX(o,n);return c.links?c.links():[]}return[]}));return hX(r.flat(1).filter(lX).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function kT(e,t,n,r,a,o){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,u=(f,p)=>{var m;return n[p].pathname!==f.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,p)=>c(f,p)||u(f,p)):o==="data"?t.filter((f,p)=>{var g;let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||u(f,p))return!0;if(f.route.shouldRevalidate){let v=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function uX(e,t,{includeHydrateFallback:n}={}){return dX(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function dX(e){return[...new Set(e)]}function fX(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hX(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(fX(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var pX=new Set([100,101,204,205]);function mX(e,t){let n=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n.pathname==="/"?n.pathname="_root.data":t&&ma(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function Tk(){let e=y.useContext(nl);return Wb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function gX(){let e=y.useContext(Ld);return Wb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Yb=y.createContext(void 0);Yb.displayName="FrameworkContext";function Rk(){let e=y.useContext(Yb);return Wb(e,"You must render this element inside a <HydratedRouter> element"),e}function vX(e,t){let n=y.useContext(Yb),[r,a]=y.useState(!1),[o,c]=y.useState(!1),{onFocus:u,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,v=y.useRef(null);y.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=R=>{R.forEach(D=>{c(D.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return v.current&&C.observe(v.current),()=>{C.disconnect()}}},[e]),y.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{a(!0)},S=()=>{a(!1),c(!1)};return n?e!=="intent"?[o,v,{}]:[o,v,{onFocus:Bu(u,b),onBlur:Bu(f,S),onMouseEnter:Bu(p,b),onMouseLeave:Bu(m,S),onTouchStart:Bu(g,b)}]:[!1,v,{}]}function Bu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function yX({page:e,...t}){let{router:n}=Tk(),r=y.useMemo(()=>Lo(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?y.createElement(bX,{page:e,matches:r,...t}):null}function xX(e){let{manifest:t,routeModules:n}=Rk(),[r,a]=y.useState([]);return y.useEffect(()=>{let o=!1;return cX(e,t,n).then(c=>{o||a(c)}),()=>{o=!0}},[e,t,n]),r}function bX({page:e,matches:t,...n}){let r=Mr(),{manifest:a,routeModules:o}=Rk(),{basename:c}=Tk(),{loaderData:u,matches:f}=gX(),p=y.useMemo(()=>kT(e,t,f,a,r,"data"),[e,t,f,a,r]),m=y.useMemo(()=>kT(e,t,f,a,r,"assets"),[e,t,f,a,r]),g=y.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let S=new Set,j=!1;if(t.forEach(R=>{var E;let D=a.routes[R.route.id];!D||!D.hasLoader||(!p.some(T=>T.route.id===R.route.id)&&R.route.id in u&&((E=o[R.route.id])!=null&&E.shouldRevalidate)||D.hasClientLoader?j=!0:S.add(R.route.id))}),S.size===0)return[];let C=mX(e,c);return j&&S.size>0&&C.searchParams.set("_routes",t.filter(R=>S.has(R.route.id)).map(R=>R.route.id).join(",")),[C.pathname+C.search]},[c,u,r,a,p,t,e,o]),v=y.useMemo(()=>uX(m,a),[m,a]),b=xX(m);return y.createElement(y.Fragment,null,g.map(S=>y.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...n})),v.map(S=>y.createElement("link",{key:S,rel:"modulepreload",href:S,...n})),b.map(({key:S,link:j})=>y.createElement("link",{key:S,...j})))}function SX(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var Dk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Dk&&(window.__reactRouterVersion="7.6.1")}catch{}function wX(e,t){return lK({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:AY({window:t==null?void 0:t.window}),hydrationData:jX(),routes:e,mapRouteProperties:HK,hydrationRouteProperties:qK,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function jX(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:CX(e.errors)}),e}function CX(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new Xh(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let c=new o(a.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}var Ak=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,_k=y.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:c,state:u,target:f,to:p,preventScrollReset:m,viewTransition:g,...v},b){let{basename:S}=y.useContext(mi),j=typeof p=="string"&&Ak.test(p),C,R=!1;if(typeof p=="string"&&j&&(C=p,Dk))try{let $=new URL(window.location.href),V=p.startsWith("//")?new URL($.protocol+p):new URL(p),X=ma(V.pathname,S);V.origin===$.origin&&X!=null?p=X+V.search+V.hash:R=!0}catch{In(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let D=DK(p,{relative:a}),[E,T,A]=vX(r,v),_=DX(p,{replace:c,state:u,target:f,preventScrollReset:m,relative:a,viewTransition:g});function M($){t&&t($),$.defaultPrevented||_($)}let L=y.createElement("a",{...v,...A,href:C||D,onClick:R||o?t:M,ref:SX(b,T),target:f,"data-discover":!j&&n==="render"?"true":void 0});return E&&!j?y.createElement(y.Fragment,null,L,y.createElement(yX,{page:D})):L});_k.displayName="Link";var EX=y.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:c,viewTransition:u,children:f,...p},m){let g=Ud(c,{relative:p.relative}),v=Mr(),b=y.useContext(Ld),{navigator:S,basename:j}=y.useContext(mi),C=b!=null&&NX(g)&&u===!0,R=S.encodeLocation?S.encodeLocation(g).pathname:g.pathname,D=v.pathname,E=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(D=D.toLowerCase(),E=E?E.toLowerCase():null,R=R.toLowerCase()),E&&j&&(E=ma(E,j)||E);const T=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let A=D===R||!a&&D.startsWith(R)&&D.charAt(T)==="/",_=E!=null&&(E===R||!a&&E.startsWith(R)&&E.charAt(R.length)==="/"),M={isActive:A,isPending:_,isTransitioning:C},L=A?t:void 0,$;typeof r=="function"?$=r(M):$=[r,A?"active":null,_?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let V=typeof o=="function"?o(M):o;return y.createElement(_k,{...p,"aria-current":L,className:$,ref:m,style:V,to:c,viewTransition:u},typeof f=="function"?f(M):f)});EX.displayName="NavLink";var TX=y.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:c=Sh,action:u,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...v},b)=>{let S=kX(),j=PX(u,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",R=typeof u=="string"&&Ak.test(u),D=E=>{if(f&&f(E),E.defaultPrevented)return;E.preventDefault();let T=E.nativeEvent.submitter,A=(T==null?void 0:T.getAttribute("formmethod"))||c;S(T||E.currentTarget,{fetcherKey:t,method:A,navigate:n,replace:a,state:o,relative:p,preventScrollReset:m,viewTransition:g})};return y.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:D,...v,"data-discover":!R&&e==="render"?"true":void 0})});TX.displayName="Form";function RX(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kk(e){let t=y.useContext(nl);return yt(t,RX(e)),t}function DX(e,{target:t,replace:n,state:r,preventScrollReset:a,relative:o,viewTransition:c}={}){let u=Rn(),f=Mr(),p=Ud(e,{relative:o});return y.useCallback(m=>{if(nX(m,t)){m.preventDefault();let g=n!==void 0?n:Vo(f)===Vo(p);u(e,{replace:g,state:r,preventScrollReset:a,relative:o,viewTransition:c})}},[f,u,p,n,r,t,e,a,o,c])}function Kb(e){In(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=y.useRef(Xy(e)),n=y.useRef(!1),r=Mr(),a=y.useMemo(()=>rX(r.search,n.current?null:t.current),[r.search]),o=Rn(),c=y.useCallback((u,f)=>{const p=Xy(typeof u=="function"?u(a):u);n.current=!0,o("?"+p,f)},[o,a]);return[a,c]}var AX=0,_X=()=>`__${String(++AX)}__`;function kX(){let{router:e}=kk("useSubmit"),{basename:t}=y.useContext(mi),n=BK();return y.useCallback(async(r,a={})=>{let{action:o,method:c,encType:u,formData:f,body:p}=oX(r,t);if(a.navigate===!1){let m=a.fetcherKey||_X();await e.fetch(m,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,flushSync:a.flushSync})}else await e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:f,body:p,formMethod:a.method||c,formEncType:a.encType||u,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[e,t,n])}function PX(e,{relative:t}={}){let{basename:n}=y.useContext(mi),r=y.useContext(Ba);yt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Ud(e||".",{relative:t})},c=Mr();if(e==null){o.search=c.search;let u=new URLSearchParams(o.search),f=u.getAll("index");if(f.some(m=>m==="")){u.delete("index"),f.filter(g=>g).forEach(g=>u.append("index",g));let m=u.toString();o.search=m?`?${m}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:li([n,o.pathname])),Vo(o)}function NX(e,t={}){let n=y.useContext(Fb);yt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=kk("useViewTransitionState"),a=Ud(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=ma(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=ma(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Kh(a.pathname,c)!=null||Kh(a.pathname,o)!=null}[...pX];const OX=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function bc(e,t,n){const r=MX(e),{webkitRelativePath:a}=e,o=typeof t=="string"?t:typeof a=="string"&&a.length>0?a:`./${e.name}`;return typeof r.path!="string"&&PT(r,"path",o),PT(r,"relativePath",o),r}function MX(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),a=OX.get(r);a&&Object.defineProperty(e,"type",{value:a,writable:!1,configurable:!1,enumerable:!0})}return e}function PT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var rl=(e,t,n)=>new Promise((r,a)=>{var o=f=>{try{u(n.next(f))}catch(p){a(p)}},c=f=>{try{u(n.throw(f))}catch(p){a(p)}},u=f=>f.done?r(f.value):Promise.resolve(f.value).then(o,c);u((n=n.apply(e,t)).next())});const IX=[".DS_Store","Thumbs.db"];function LX(e){return rl(this,null,function*(){return Jh(e)&&zX(e.dataTransfer)?VX(e.dataTransfer,e.type):$X(e)?UX(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?BX(e):[]})}function zX(e){return Jh(e)}function $X(e){return Jh(e)&&Jh(e.target)}function Jh(e){return typeof e=="object"&&e!==null}function UX(e){return Zy(e.target.files).map(t=>bc(t))}function BX(e){return rl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>bc(n))})}function VX(e,t){return rl(this,null,function*(){if(e.items){const n=Zy(e.items).filter(a=>a.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(FX));return NT(Pk(r))}return NT(Zy(e.files).map(n=>bc(n)))})}function NT(e){return e.filter(t=>IX.indexOf(t.name)===-1)}function Zy(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 FX(e){if(typeof e.webkitGetAsEntry!="function")return OT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?Nk(t):OT(e,t)}function Pk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?Pk(n):[n]],[])}function OT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(o=>rl(this,null,function*(){const c=yield o.getFile();return c.handle=o,bc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const a=bc(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(a)}function HX(e){return rl(this,null,function*(){return e.isDirectory?Nk(e):qX(e)})}function Nk(e){const t=e.createReader();return new Promise((n,r)=>{const a=[];function o(){t.readEntries(c=>rl(this,null,function*(){if(c.length){const u=Promise.all(c.map(HX));a.push(u),o()}else try{const u=yield Promise.all(a);n(u)}catch(u){r(u)}}),c=>{r(c)})}o()})}function qX(e){return rl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const a=bc(r,e.fullPath);t(a)},r=>{n(r)})})})}function iy(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",a=(e.type||"").toLowerCase(),o=a.replace(/\/.*$/,"");return n.some(c=>{const u=c.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?o===u.replace(/\/.*$/,""):a===u})}return!0}var GX=Object.defineProperty,QX=Object.defineProperties,WX=Object.getOwnPropertyDescriptors,MT=Object.getOwnPropertySymbols,YX=Object.prototype.hasOwnProperty,KX=Object.prototype.propertyIsEnumerable,IT=(e,t,n)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,XX=(e,t)=>{for(var n in t||(t={}))YX.call(t,n)&&IT(e,n,t[n]);if(MT)for(var n of MT(t))KX.call(t,n)&&IT(e,n,t[n]);return e},ZX=(e,t)=>QX(e,WX(t));const JX=typeof iy=="function"?iy:iy.default,eZ="file-invalid-type",tZ="file-too-large",nZ="file-too-small",rZ="too-many-files",aZ=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:eZ,message:`File type must be ${n}`}},LT=e=>({code:tZ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),zT=e=>({code:nZ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),iZ={code:rZ,message:"Too many files"};function Ok(e,t){const n=e.type==="application/x-moz-file"||JX(e,t);return[n,n?null:aZ(t)]}function Mk(e,t,n){if(Es(e.size))if(Es(t)&&Es(n)){if(e.size>n)return[!1,LT(n)];if(e.size<t)return[!1,zT(t)]}else{if(Es(t)&&e.size<t)return[!1,zT(t)];if(Es(n)&&e.size>n)return[!1,LT(n)]}return[!0,null]}function Es(e){return e!=null}function oZ({files:e,accept:t,minSize:n,maxSize:r,multiple:a,maxFiles:o,validator:c}){return!a&&e.length>1||a&&o>=1&&e.length>o?!1:e.every(u=>{const[f]=Ok(u,t),[p]=Mk(u,n,r),m=c?c(u):null;return f&&p&&!m})}function ep(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function uh(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 $T(e){e.preventDefault()}function sZ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function lZ(e){return e.indexOf("Edge/")!==-1}function cZ(e=window.navigator.userAgent){return sZ(e)||lZ(e)}function Xa(...e){return(t,...n)=>e.some(r=>(!ep(t)&&r&&r(t,...n),ep(t)))}function uZ(){return"showOpenFilePicker"in window}function dZ(e){return Es(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let a=!0;return Ik(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.`),a=!1),(!Array.isArray(r)||!r.every(Lk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),a=!1),a}).reduce((n,[r,a])=>ZX(XX({},n),{[r]:a}),{})}]:e}function fZ(e){if(Es(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>Ik(t)||Lk(t)).join(",")}function hZ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function pZ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Ik(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Lk(e){return/^.*\.[\w]+$/.test(e)}var mZ=Object.defineProperty,gZ=Object.defineProperties,vZ=Object.getOwnPropertyDescriptors,tp=Object.getOwnPropertySymbols,zk=Object.prototype.hasOwnProperty,$k=Object.prototype.propertyIsEnumerable,UT=(e,t,n)=>t in e?mZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))zk.call(t,n)&&UT(e,n,t[n]);if(tp)for(var n of tp(t))$k.call(t,n)&&UT(e,n,t[n]);return e},Mo=(e,t)=>gZ(e,vZ(t)),np=(e,t)=>{var n={};for(var r in e)zk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&tp)for(var r of tp(e))t.indexOf(r)<0&&$k.call(e,r)&&(n[r]=e[r]);return n};const Xb=y.forwardRef((e,t)=>{var n=e,{children:r}=n,a=np(n,["children"]);const o=Bk(a),{open:c}=o,u=np(o,["open"]);return y.useImperativeHandle(t,()=>({open:c}),[c]),Cn.createElement(y.Fragment,null,r(Mo(hr({},u),{open:c})))});Xb.displayName="Dropzone";const Uk={disabled:!1,getFilesFromEvent:LX,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Xb.defaultProps=Uk;Xb.propTypes={children:on.func,accept:on.objectOf(on.arrayOf(on.string)),multiple:on.bool,preventDropOnDocument:on.bool,noClick:on.bool,noKeyboard:on.bool,noDrag:on.bool,noDragEventsBubbling:on.bool,minSize:on.number,maxSize:on.number,maxFiles:on.number,disabled:on.bool,getFilesFromEvent:on.func,onFileDialogCancel:on.func,onFileDialogOpen:on.func,useFsAccessApi:on.bool,autoFocus:on.bool,onDragEnter:on.func,onDragLeave:on.func,onDragOver:on.func,onDrop:on.func,onDropAccepted:on.func,onDropRejected:on.func,onError:on.func,validator:on.func};const Jy={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Bk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:a,minSize:o,multiple:c,maxFiles:u,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:v,onDropRejected:b,onFileDialogCancel:S,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:R,preventDropOnDocument:D,noClick:E,noKeyboard:T,noDrag:A,noDragEventsBubbling:_,onError:M,validator:L}=hr(hr({},Uk),e),$=y.useMemo(()=>fZ(t),[t]),V=y.useMemo(()=>dZ(t),[t]),X=y.useMemo(()=>typeof j=="function"?j:BT,[j]),Q=y.useMemo(()=>typeof S=="function"?S:BT,[S]),J=y.useRef(null),W=y.useRef(null),[Y,P]=y.useReducer(yZ,Jy),{isFocused:I,isFileDialogActive:z}=Y,F=y.useRef(typeof window<"u"&&window.isSecureContext&&C&&uZ()),O=()=>{!F.current&&z&&setTimeout(()=>{if(W.current){const{files:ge}=W.current;ge.length||(P({type:"closeDialog"}),Q())}},300)};y.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[W,z,Q,F]);const U=y.useRef([]),Z=ge=>{J.current&&J.current.contains(ge.target)||(ge.preventDefault(),U.current=[])};y.useEffect(()=>(D&&(document.addEventListener("dragover",$T,!1),document.addEventListener("drop",Z,!1)),()=>{D&&(document.removeEventListener("dragover",$T),document.removeEventListener("drop",Z))}),[J,D]),y.useEffect(()=>(!n&&R&&J.current&&J.current.focus(),()=>{}),[J,R,n]);const ee=y.useCallback(ge=>{M?M(ge):console.error(ge)},[M]),ye=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge),U.current=[...U.current,ge.target],uh(ge)&&Promise.resolve(r(ge)).then(we=>{if(ep(ge)&&!_)return;const Le=we.length,xe=Le>0&&oZ({files:we,accept:$,minSize:o,maxSize:a,multiple:c,maxFiles:u,validator:L}),$e=Le>0&&!xe;P({isDragAccept:xe,isDragReject:$e,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ge)}).catch(we=>ee(we))},[r,f,ee,_,$,o,a,c,u,L]),be=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge);const we=uh(ge);if(we&&ge.dataTransfer)try{ge.dataTransfer.dropEffect="copy"}catch{}return we&&m&&m(ge),!1},[m,_]),ve=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge);const we=U.current.filter(xe=>J.current&&J.current.contains(xe)),Le=we.indexOf(ge.target);Le!==-1&&we.splice(Le,1),U.current=we,!(we.length>0)&&(P({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),uh(ge)&&p&&p(ge))},[J,p,_]),Ge=y.useCallback((ge,we)=>{const Le=[],xe=[];ge.forEach($e=>{const[gt,ht]=Ok($e,$),[Wt,_t]=Mk($e,o,a),mn=L?L($e):null;if(gt&&Wt&&!mn)Le.push($e);else{let St=[ht,_t];mn&&(St=St.concat(mn)),xe.push({file:$e,errors:St.filter(Va=>Va)})}}),(!c&&Le.length>1||c&&u>=1&&Le.length>u)&&(Le.forEach($e=>{xe.push({file:$e,errors:[iZ]})}),Le.splice(0)),P({acceptedFiles:Le,fileRejections:xe,isDragReject:xe.length>0,type:"setFiles"}),g&&g(Le,xe,we),xe.length>0&&b&&b(xe,we),Le.length>0&&v&&v(Le,we)},[P,c,$,o,a,u,g,v,b,L]),ke=y.useCallback(ge=>{ge.preventDefault(),ge.persist(),Se(ge),U.current=[],uh(ge)&&Promise.resolve(r(ge)).then(we=>{ep(ge)&&!_||Ge(we,ge)}).catch(we=>ee(we)),P({type:"reset"})},[r,Ge,ee,_]),et=y.useCallback(()=>{if(F.current){P({type:"openDialog"}),X();const ge={multiple:c,types:V};window.showOpenFilePicker(ge).then(we=>r(we)).then(we=>{Ge(we,null),P({type:"closeDialog"})}).catch(we=>{hZ(we)?(Q(we),P({type:"closeDialog"})):pZ(we)?(F.current=!1,W.current?(W.current.value=null,W.current.click()):ee(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."))):ee(we)});return}W.current&&(P({type:"openDialog"}),X(),W.current.value=null,W.current.click())},[P,X,Q,C,Ge,ee,V,c]),Re=y.useCallback(ge=>{!J.current||!J.current.isEqualNode(ge.target)||(ge.key===" "||ge.key==="Enter"||ge.keyCode===32||ge.keyCode===13)&&(ge.preventDefault(),et())},[J,et]),ft=y.useCallback(()=>{P({type:"focus"})},[]),Ut=y.useCallback(()=>{P({type:"blur"})},[]),Ot=y.useCallback(()=>{E||(cZ()?setTimeout(et,0):et())},[E,et]),xt=ge=>n?null:ge,Ht=ge=>T?null:xt(ge),Bt=ge=>A?null:xt(ge),Se=ge=>{_&&ge.stopPropagation()},Ne=y.useMemo(()=>(ge={})=>{var we=ge,{refKey:Le="ref",role:xe,onKeyDown:$e,onFocus:gt,onBlur:ht,onClick:Wt,onDragEnter:_t,onDragOver:mn,onDragLeave:St,onDrop:Va}=we,ba=np(we,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return hr(hr({onKeyDown:Ht(Xa($e,Re)),onFocus:Ht(Xa(gt,ft)),onBlur:Ht(Xa(ht,Ut)),onClick:xt(Xa(Wt,Ot)),onDragEnter:Bt(Xa(_t,ye)),onDragOver:Bt(Xa(mn,be)),onDragLeave:Bt(Xa(St,ve)),onDrop:Bt(Xa(Va,ke)),role:typeof xe=="string"&&xe!==""?xe:"presentation",[Le]:J},!n&&!T?{tabIndex:0}:{}),ba)},[J,Re,ft,Ut,Ot,ye,be,ve,ke,T,A,n]),Ve=y.useCallback(ge=>{ge.stopPropagation()},[]),Te=y.useMemo(()=>(ge={})=>{var we=ge,{refKey:Le="ref",onChange:xe,onClick:$e}=we,gt=np(we,["refKey","onChange","onClick"]);const ht={accept:$,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:xt(Xa(xe,ke)),onClick:xt(Xa($e,Ve)),tabIndex:-1,[Le]:W};return hr(hr({},ht),gt)},[W,t,c,ke,n]);return Mo(hr({},Y),{isFocused:I&&!n,getRootProps:Ne,getInputProps:Te,rootRef:J,inputRef:W,open:xt(et)})}function yZ(e,t){switch(t.type){case"focus":return Mo(hr({},e),{isFocused:!0});case"blur":return Mo(hr({},e),{isFocused:!1});case"openDialog":return Mo(hr({},Jy),{isFileDialogActive:!0});case"closeDialog":return Mo(hr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Mo(hr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Mo(hr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return hr({},Jy);default:return e}}function BT(){}const[xZ,bZ]=vr("Dropzone component was not found in tree");function Zb(e){const t=n=>{const{children:r,...a}=se(`Dropzone${Fj(e)}`,{},n),o=bZ(),c=Hi(r)?r:s.jsx("span",{children:r});return o[e]?y.cloneElement(c,a):null};return t.displayName=`@mantine/dropzone/${Fj(e)}`,t}const SZ=Zb("accept"),wZ=Zb("reject"),jZ=Zb("idle");var cd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const CZ={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},EZ=(e,{radius:t,variant:n,acceptColor:r,rejectColor:a})=>{const o=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:a||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Ft(t),"--dropzone-accept-color":o.color,"--dropzone-accept-bg":o.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Ko=me((e,t)=>{const n=se("Dropzone",CZ,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,radius:p,disabled:m,loading:g,multiple:v,maxSize:b,accept:S,children:j,onDropAny:C,onDrop:R,onReject:D,openRef:E,name:T,maxFiles:A,autoFocus:_,activateOnClick:M,activateOnDrag:L,dragEventsBubbling:$,activateOnKeyboard:V,onDragEnter:X,onDragLeave:Q,onDragOver:J,onFileDialogCancel:W,onFileDialogOpen:Y,preventDropOnDocument:P,useFsAccessApi:I,getFilesFromEvent:z,validator:F,rejectColor:O,acceptColor:U,enablePointerEvents:Z,loaderProps:ee,inputProps:ye,mod:be,...ve}=n,Ge=Me({name:"Dropzone",classes:cd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,vars:f,varsResolver:EZ}),{getRootProps:ke,getInputProps:et,isDragAccept:Re,isDragReject:ft,open:Ut}=Bk({onDrop:C,onDropAccepted:R,onDropRejected:D,disabled:m||g,accept:Array.isArray(S)?S.reduce((xt,Ht)=>({...xt,[Ht]:[]}),{}):S,multiple:v,maxSize:b,maxFiles:A,autoFocus:_,noClick:!M,noDrag:!L,noDragEventsBubbling:!$,noKeyboard:!V,onDragEnter:X,onDragLeave:Q,onDragOver:J,onFileDialogCancel:W,onFileDialogOpen:Y,preventDropOnDocument:P,useFsAccessApi:I,validator:F,...z?{getFilesFromEvent:z}:null});Ku(E,Ut);const Ot=!Re&&!ft;return s.jsx(xZ,{value:{accept:Re,reject:ft,idle:Ot},children:s.jsxs(ce,{...ke(),...Ge("root",{focusable:!0}),...ve,mod:[{accept:Re,reject:ft,idle:Ot,disabled:m,loading:g,"activate-on-click":M},be],children:[s.jsx(m0,{visible:g,overlayProps:{radius:p},unstyled:u,loaderProps:ee}),s.jsx("input",{...et(ye),name:T}),s.jsx("div",{...Ge("inner"),ref:t,"data-enable-pointer-events":Z||void 0,children:j})]})})});Ko.classes=cd;Ko.displayName="@mantine/dropzone/Dropzone";Ko.Accept=SZ;Ko.Idle=jZ;Ko.Reject=wZ;const TZ={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Wr("max"),withinPortal:!0},Jb=me((e,t)=>{const n=se("DropzoneFullScreen",TZ,e),{classNames:r,className:a,style:o,styles:c,unstyled:u,vars:f,active:p,onDrop:m,onReject:g,zIndex:v,withinPortal:b,portalProps:S,...j}=n,C=Me({name:"DropzoneFullScreen",classes:cd,props:n,className:a,style:o,classNames:r,styles:c,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:R,resolvedStyles:D}=Gs({classNames:r,styles:c,props:n}),[E,T]=y.useState(0),[A,{open:_,close:M}]=ip(!1),L=V=>{var X;(X=V.dataTransfer)!=null&&X.types.includes("Files")&&(T(Q=>Q+1),_())},$=()=>{T(V=>V-1)};return y.useEffect(()=>{E===0&&M()},[E]),y.useEffect(()=>{if(p)return document.addEventListener("dragenter",L,!1),document.addEventListener("dragleave",$,!1),()=>{document.removeEventListener("dragenter",L,!1),document.removeEventListener("dragleave",$,!1)}},[p]),s.jsx(Ho,{...S,withinPortal:b,children:s.jsx(ce,{...C("fullScreen",{style:{opacity:A?1:0,pointerEvents:A?"all":"none",zIndex:v}}),ref:t,children:s.jsx(Ko,{...j,classNames:R,styles:D,unstyled:u,className:cd.dropzone,onDrop:V=>{m==null||m(V),M(),T(0)},onReject:V=>{g==null||g(V),M(),T(0)}})})})});Jb.classes=cd;Jb.displayName="@mantine/dropzone/DropzoneFullScreen";Ko.FullScreen=Jb;const dh=Ko,RZ='{"resourceType": "Bundle"}';function oy({id:e,title:t,message:n,color:r,icon:a,withCloseButton:o=!1,method:c="show",loading:u}){ca[c]({id:e,loading:u,title:t,message:n,color:r,icon:a,withCloseButton:o,autoClose:!1})}function DZ(){const e=Sn(),t=Ae(),[n,r]=y.useState({}),a=y.useCallback(async(u,f)=>{const p="batch-upload";oy({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(u);m.type!=="batch"&&m.type!=="transaction"&&(m=OA(m));const g=await t.executeBatch(m);r(v=>({...v,[f]:g})),oy({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(to,{size:"1rem"}),withCloseButton:!0})}catch(m){oy({id:p,title:"Batch Upload Failed",color:"red",message:Ke(m),method:"update",icon:s.jsx(Bs,{size:"1rem"}),withCloseButton:!0})}},[t]),o=y.useCallback(async u=>{for(const f of u){const p=new FileReader;p.onload=m=>{var g;return a((g=m.target)==null?void 0:g.result,f.name)},p.readAsText(f)}},[a]),c=y.useCallback(async u=>{await a(u.input,"JSON Data")},[a]);return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Batch Create"}),s.jsxs(De,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",s.jsx(Pt,{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(It,{defaultValue:"upload",children:[s.jsxs(It.List,{children:[s.jsx(It.Tab,{value:"upload",children:"File Upload"}),s.jsx(It.Tab,{value:"json",children:"JSON"})]}),s.jsx(It.Panel,{value:"upload",pt:"xs",children:s.jsx(dh,{onDrop:o,accept:["application/json"],children:s.jsxs(Ce,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(dh.Accept,{children:s.jsx(PE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(dh.Reject,{children:s.jsx(Bs,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(dh.Idle,{children:s.jsx(PE,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(De,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(De,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(It.Panel,{value:"json",pt:"xs",children:s.jsxs(mt,{onSubmit:c,children:[s.jsx(Dc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:RZ,deserialize:JSON.parse}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(It,{defaultValue:Object.keys(n)[0],children:[s.jsx(It.List,{children:Object.keys(n).map(u=>s.jsx(It.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>s.jsx(It.Panel,{value:u,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{onClick:()=>r({}),children:"Start over"})})]})]})}function AZ(){const{resourceType:e}=Qt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(a=>!!a),[r]=xc("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(ot,{children:[s.jsxs(Ie,{children:["No apps for ",e]}),s.jsx(bt,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(ot,{children:s.jsx("div",{children:r.map(a=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(bt,{to:`/forms/${a.id}?subject=`+n.map(o=>`${e}/${o}`).join(","),children:a.name})}),s.jsx("p",{children:a.description})]},a.id))})}):s.jsx(pa,{})}function _Z(){const e=Ae(),[t,n]=y.useState(),[r,a]=y.useState(!1);return s.jsx(ot,{width:450,children:s.jsxs(mt,{onSubmit:o=>{n(void 0),e.post("auth/changepassword",o).then(()=>a(!0)).catch(c=>n(Jt(c)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Change password"})]}),!r&&s.jsxs(We,{gap:"xl",mt:"xl",children:[s.jsx(Na,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Nt(t,"oldPassword")}),s.jsx(Na,{name:"newPassword",label:"New password",required:!0,error:Nt(t,"newPassword")}),s.jsx(Na,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(t,"confirmPassword")}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const ex=["Form","JSON","Profiles"],kZ=["Profiles"],sy=ex[0].toLowerCase();function PZ(){const e=Rn(),t=Sn(),{resourceType:n}=Qt(),[r,a]=y.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&ex.map(u=>u.toLowerCase()).includes(c)?c:sy});function o(c){var u;c||(c=sy),a(c),(u=e(`/${n}/new/${c}`))==null||u.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{children:[s.jsxs(De,{p:"md",fw:500,children:["New ",n]}),s.jsx(Yr,{children:s.jsx(It,{defaultValue:sy,value:r,onChange:o,children:s.jsx(It.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:ex.map(c=>s.jsx(It.Tab,{value:c.toLowerCase(),px:"md",children:kZ.includes(c)?s.jsxs(Ce,{gap:"xs",wrap:"nowrap",children:[c,s.jsx(jp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),s.jsx(Qb,{})]})}function NZ(){return s.jsx(ot,{children:s.jsxs(We,{children:[s.jsx(Ie,{order:1,children:"Unexpected Error"}),s.jsx(De,{children:"We're sorry, something went wrong."}),s.jsxs(De,{children:["Please contact ",s.jsx(Pt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Vk(e){const t=Yt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(bt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,u){c&&u&&n.push({key:c,value:u})}function a(c){c&&r(c.system,c.value)}function o(c,u){Array.isArray(u)?u.forEach(f=>o(c,f)):typeof u=="string"?r(c,u):u&&(Array.isArray(u.coding)?r(c,u.coding.map(f=>f.display||f.code).join(", ")):r(c,u.text))}if("name"in t){const c=Fi(t);c!==Lt(t)&&r("Name",c)}return"category"in t&&o("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&o("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(a):a(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),s.jsx(pt,{children:n.map((c,u)=>s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:c.key}),s.jsx(pt.Value,{children:c.value})]},`${c.key}-${u}`))})}function e1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function OZ(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 Xo(e){var t;return zs((t=e.getActiveLogin())==null?void 0:t.project)}function MZ(){const{id:e}=Qt(),t=Mr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,a=Ae(),[o,c]=y.useState(!0),[u,f]=y.useState(),[p,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[j,C]=y.useState();if(y.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const T=r.split(",").filter(A=>!!A);T.length===1&&E.entry.push({request:{method:"GET",url:T[0]}}),m(T)}a.executeBatch(E).then(T=>{var A,_,M,L,$,V,X,Q;((M=(_=(A=T.entry)==null?void 0:A[0])==null?void 0:_.response)==null?void 0:M.status)!=="200"?S((V=($=(L=T.entry)==null?void 0:L[0])==null?void 0:$.response)==null?void 0:V.outcome):(f((X=T.entry[0])==null?void 0:X.resource),v((Q=T.entry[1])==null?void 0:Q.resource)),c(!1)}).catch(T=>{S(T),c(!1)})},[a,e,r]),b)return s.jsx(ot,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return s.jsxs(ot,{children:[s.jsx(Ie,{children:u==null?void 0:u.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[j.length===1&&s.jsx("li",{children:s.jsx(bt,{to:j[0],children:"Review your answers"})}),j.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:j.map(E=>s.jsx("li",{children:s.jsx(bt,{to:E,children:Lt(E)})},E.id))})]}),g&&s.jsx("li",{children:s.jsxs(bt,{to:g,children:["Back to ",Fi(g)]})}),s.jsx("li",{children:s.jsx(bt,{to:"/",children:"Go back home"})})]})]});if(o||!u)return s.jsx(pa,{});const R=g&&e1(g);return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{shadow:"xs",radius:0,children:[R&&s.jsx($_,{patient:R}),g&&g.resourceType!=="Patient"&&s.jsx(Vk,{resource:g}),s.jsx(ce,{px:"xl",py:"md",children:s.jsxs(De,{children:[Fi(u),p&&p.length>1&&s.jsxs(s.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),s.jsx(ot,{children:s.jsx(nk,{questionnaire:u,subject:g&&fn(g),onSubmit:D})})]});async function D(E){const T=[];if(!p||p.length===0)T.push(await a.createResource(E));else for(const A of p)T.push(await a.createResource({...E,subject:{reference:A}}));C(T)}}const IZ="_paper_unw9o_1",LZ={paper:IZ},zZ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function Fk(e,t){const n=e.resourceType||$Z(t),r=e.fields??UZ(n),a=e.filters??(e.resourceType?void 0:BZ(n)),o=e.sortRules??VZ(n),c=e.offset??0,u=e.count??Qp;return{...e,resourceType:n,fields:r,filters:a,sortRules:o,offset:c,count:u}}function $Z(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 UZ(e){const t=t1(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");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 BZ(e){var t;return(t=t1(e))==null?void 0:t.filters}function VZ(e){const t=t1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function t1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function FZ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function HZ(e,t){const n={...e,count:1e3,offset:0},r=Fk(n,t.getUserConfiguration()),a=await t.search(r.resourceType,ec({...r,total:"accurate",fields:void 0}));return OA(a)}function VT(){const e=Ae(),t=Rn(),n=Mr(),[r,a]=y.useState();return y.useEffect(()=>{var u;const o=AA(n.pathname+n.search),c=Fk(o,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===ec(c)?(FZ(c),a(c)):(u=t(`/${c.resourceType}${ec(c)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(pa,{}):s.jsx(mr,{shadow:"xs",m:"md",p:"xs",className:LZ.paper,children:s.jsx(Id,{checkboxesEnabled:!0,search:r,onClick:o=>{var c;return(c=t(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onAuxClick:o=>window.open(`/${o.resource.resourceType}/${o.resource.id}`,"_blank"),onChange:o=>{var c;(c=t(`/${r.resourceType}${ec(o.definition)}`))==null||c.catch(console.error)},onNew:()=>{var o;(o=t(zZ[r.resourceType]??`/${r.resourceType}/new`))==null||o.catch(console.error)},onExportCsv:()=>{const o=e.fhirUrl(r.resourceType,"$csv")+ec(r);e.download(o).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>_e({color:"red",message:Ke(c),autoClose:!1}))},onExportTransactionBundle:async()=>{HZ(r,e).then(o=>t_(JSON.stringify(o,void 0,2))).catch(o=>_e({color:"red",message:Ke(o),autoClose:!1}))},onDelete:o=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:o.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>a({...r})).catch(c=>_e({color:"red",message:Ke(c),autoClose:!1})))},onBulk:o=>{var c;(c=t(`/bulk/${r.resourceType}?ids=${o.join(",")}`))==null||c.catch(console.error)}})})}function qZ(){const e=Ae(),[t,n]=y.useState(),[r,a]=y.useState(void 0),[o,c]=y.useState(!1),u=y.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),a(m.enrolled)}).catch(m=>_e({color:"red",message:Ke(m),autoClose:!1}))},[e]);y.useEffect(()=>{u()},[u]);const f=y.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{a(!0),_e({color:"green",message:"Success"})}).catch(g=>_e({color:"red",message:Ke(g),autoClose:!1}))},[e]),p=y.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?s.jsxs(ot,{children:[s.jsx(Bn,{title:"Disable MFA",opened:o,onClose:()=>c(!1),children:s.jsx(f_,{onSubmit:async m=>{await p(m),c(!1),a(!1),_e({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:s.jsx(OV,{})}),u()}})}),s.jsxs(Ce,{children:[s.jsx(Ie,{children:"MFA is enabled"}),s.jsx(Pe,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):s.jsx(ot,{width:400,children:s.jsxs(mt,{onSubmit:f,children:[s.jsx(Ie,{children:"Multi Factor Auth Setup"}),s.jsx(er,{children:s.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),s.jsx(ze,{name:"token",label:"Code"}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Enroll"})})]})})}const ly={},tx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:ly==null?void 0:ly.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return tx}function Hk(){return qk("registerEnabled")}function GZ(){return qk("awsTextractEnabled")}function qk(e){try{return tx[e]!==!1&&tx[e]!=="false"}catch{return!0}}function QZ(){var g,v;const e=Rn(),[t]=Kb(),n=Ae(),r=t.get("scope")||"openid",[a,o]=y.useState(),[c,u]=y.useState(!0),f=t.get("client_id"),p=t.get("login");if(y.useEffect(()=>{if(!f||f==="medplum-cli")return;async function b(){try{const S=await n.get(`/auth/clientinfo/${f}`);o(S)}catch(S){_e({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ke(S),withCloseButton:!0})}finally{u(!1)}}b().catch(console.error)},[n,f]),!f)return null;function m(b){const S=new URL(t.get("redirect_uri"));for(const j of["scope","state","nonce"])t.has(j)&&S.searchParams.set(j,t.get(j));S.searchParams.set("code",b),window.location.assign(S.toString())}return s.jsx(h_,{onCode:m,onForgotPassword:()=>{var b;return(b=e("/resetpassword"))==null?void 0:b.catch(console.error)},onRegister:()=>{var b;return(b=e("/register"))==null?void 0:b.catch(console.error)},googleClientId:Bd().googleClientId,clientId:f||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",login:p||void 0,children:!c&&s.jsxs(s.Fragment,{children:[(g=a==null?void 0:a.logo)!=null&&g.url?s.jsx("img",{src:(v=a==null?void 0:a.logo)==null?void 0:v.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):s.jsx(Ua,{size:32}),s.jsx(Ie,{children:(a==null?void 0:a.welcomeString)??"Sign in to Medplum"})]})})}function WZ(){const e=Ae(),t=Rn(),n=Bd();return y.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),Hk()?s.jsxs(vH,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Create a new account"})]}):s.jsx(ot,{width:450,children:s.jsx(Ki,{icon:s.jsx(el,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function YZ(){const e=Rn(),t=Ae(),[n,r]=y.useState(),[a,o]=y.useState(!1),c=Bd().recaptchaSiteKey;return y.useEffect(()=>{u_(c)},[c]),s.jsx(ot,{width:450,children:s.jsxs(mt,{onSubmit:async u=>{let f="";f=await d_(c),t.post("auth/resetpassword",{...u,recaptchaToken:f}).then(()=>o(!0)).catch(p=>r(Jt(p)))},children:[s.jsxs(We,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Medplum Password Reset"})]}),s.jsxs(We,{gap:"xl",children:[s.jsx(xa,{issues:Pd(n,void 0)}),!a&&s.jsxs(s.Fragment,{children:[s.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Nt(n,"email")}),s.jsxs(Ce,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Pt,{component:"button",type:"button",color:"dimmed",onClick:()=>{var u;return(u=e("/register"))==null?void 0:u.catch(console.error)},size:"xs",children:"Register"}),s.jsx(Pe,{type:"submit",children:"Reset password"})]})]}),a&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function KZ(){var o;const e=Rn(),t=Ae(),[n,r]=y.useState();y.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(c=>_e({color:"red",message:Ke(c),autoClose:!1}))},[t]);function a(c){t.post("auth/revoke",{loginId:c}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>_e({color:"green",message:"Login revoked"})).catch(u=>_e({color:"red",message:Ke(u),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(ot,{children:[s.jsx(Ie,{children:"Security"}),s.jsxs(xb,{children:[s.jsx(zi,{term:"ID",children:s.jsx(Pt,{href:`/${Lt(n.profile)}`,children:n.profile.id})}),s.jsx(zi,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(zi,{term:"Name",children:Nc((o=n.profile.name)==null?void 0:o[0])})]})]}),s.jsxs(ot,{children:[s.jsx(Ie,{children:"Sessions"}),s.jsxs(Oe,{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(c=>s.jsxs("tr",{children:[s.jsx("td",{children:c.os}),s.jsx("td",{children:c.browser}),s.jsx("td",{children:c.remoteAddress}),s.jsx("td",{children:c.authMethod}),s.jsx("td",{children:gr(c.lastUpdated)}),s.jsx("td",{children:s.jsx(Pt,{href:"#",onClick:()=>a(c.id),children:"Revoke"})})]},c.id))})]})]}),s.jsxs(ot,{children:[s.jsx(Ie,{children:"Password"}),s.jsx(Pe,{onClick:()=>{var c;return(c=e("/changepassword"))==null?void 0:c.catch(console.error)},children:"Change password"})]}),s.jsxs(ot,{children:[s.jsx(Ie,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(Pe,{onClick:()=>{var c;return(c=e("/mfa"))==null?void 0:c.catch(console.error)},children:"Enroll"})]})]}):null}function XZ(){const{id:e,secret:t}=Qt(),n=Ae(),[r,a]=y.useState(),[o,c]=y.useState(!1),u=Pd(r,void 0);return s.jsxs(ot,{width:450,children:[s.jsx(xa,{issues:u}),s.jsxs(mt,{onSubmit:f=>{if(f.password!==f.confirmPassword){a(ii("Passwords do not match","confirmPassword"));return}a(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>a(Jt(m)))},children:[s.jsxs(er,{style:{flexDirection:"column"},children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Set password"})]}),!o&&s.jsxs(We,{children:[s.jsx(Na,{name:"password",label:"New password",required:!0,error:Nt(r,"password")}),s.jsx(Na,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Nt(r,"confirmPassword")}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Set password"})})]}),o&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(bt,{to:"/signin",children:"sign in"}),"."]})]})]})}function ZZ(){const e=Zp(),t=Rn(),[n]=Kb(),r=Bd(),a=y.useCallback(()=>{var c;const o=n.get("next");(c=t(o!=null&&o.startsWith("/")?o:"/"))==null||c.catch(console.error)},[n,t]);return y.useEffect(()=>{e&&n.has("next")&&a()},[e,n,a]),s.jsxs(h_,{onSuccess:()=>a(),onForgotPassword:()=>{var o;return(o=t("/resetpassword"))==null?void 0:o.catch(console.error)},onRegister:Hk()?()=>{var o;return(o=t("/register"))==null?void 0:o.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(Ua,{size:32}),s.jsx(Ie,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function JZ(){const e=Rn(),t=Mr(),[n,r]=y.useState(),[a,o]=y.useState(),[c,u]=y.useState();return y.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),o(f.query),u(JSON.parse(f.fields))},[t]),!n||!a||!c?null:s.jsx(mQ,{resourceType:n,checkboxesEnabled:!0,query:a,fields:c,onClick:f=>{var p;return(p=e(`/${n}/${f.resource.id}`))==null?void 0:p.catch(console.error)},onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{var p;(p=e(`/bulk/${n}?ids=${f.join(",")}`))==null||p.catch(console.error)}})}function lm(e){const t=Ae(),n=Xo(t),r=Rn(),[a,o]=y.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:de.EQUALS,value:"Project/"+n},{code:"profile-type",operator:de.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(Id,{search:a,onClick:c=>{var u;return(u=r(`/admin/members/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})}function eJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Bots"}),s.jsx(lm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function tJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Clients"}),s.jsx(lm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/clients/new",children:"Create new client"})})]})}function cm(e){return s.jsx(tl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{pi(t)?e.onChange(fn(t)):e.onChange(void 0)}})}function nJ(){const e=Ae(),t=Xo(e),[n,r]=y.useState(""),[a,o]=y.useState(""),[c,u]=y.useState(),[f,p]=y.useState(),[m,g]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Create new Bot"}),s.jsxs(mt,{onSubmit:()=>{const v={name:n,description:a,accessPolicy:c};e.post("admin/projects/"+t+"/bot",v).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),_e({color:"green",message:"Bot created"})}).catch(b=>{_e({color:"red",message:Ke(b),autoClose:!1}),p(Jt(b))})},children:[!m&&s.jsxs(We,{children:[s.jsx(zt,{title:"Name",htmlFor:"name",outcome:f,children:s.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>r(v.currentTarget.value),error:Nt(f,"name")})}),s.jsx(zt,{title:"Description",htmlFor:"description",outcome:f,children:s.jsx(ze,{id:"description",name:"description",onChange:v=>o(v.currentTarget.value),error:Nt(f,"description")})}),s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(cm,{name:"accessPolicy",onChange:u})}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Bot"})})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(De,{children:"Bot created"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:m,children:"Go to new bot"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function rJ(){const e=Ae(),t=Xo(e),[n,r]=y.useState(""),[a,o]=y.useState(""),[c,u]=y.useState(""),[f,p]=y.useState(),[m,g]=y.useState(),[v,b]=y.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Create new Client"}),s.jsxs(mt,{onSubmit:()=>{const S={name:n,description:a,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",S).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),_e({color:"green",message:"Client created"})}).catch(j=>{_e({color:"red",message:Ke(j),autoClose:!1}),g(Jt(j))})},children:[!v&&s.jsxs(We,{children:[s.jsx(zt,{title:"Name",htmlFor:"name",outcome:m,children:s.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:S=>r(S.currentTarget.value),error:Nt(m,"name")})}),s.jsx(zt,{title:"Description",htmlFor:"description",outcome:m,children:s.jsx(ze,{id:"description",name:"description",onChange:S=>o(S.currentTarget.value),error:Nt(m,"description")})}),s.jsx(zt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:s.jsx(ze,{id:"redirectUri",name:"redirectUri",onChange:S=>u(S.currentTarget.value),error:Nt(m,"redirectUri")})}),s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:s.jsx(cm,{name:"accessPolicy",onChange:p})}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Create Client"})})]}),v&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(De,{children:"Client created"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:v,children:"Go to new client"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function aJ(e){return s.jsx(tl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{pi(t)?e.onChange(fn(t)):e.onChange(void 0)}})}function iJ(){const{membershipId:e}=Qt(),t=Ae(),n=Xo(t),r=Rn(),a=t.get(`admin/projects/${n}/members/${e}`).read(),[o,c]=y.useState(a.accessPolicy),[u,f]=y.useState(a.userConfiguration),[p,m]=y.useState(a.admin),[g,v]=y.useState(),[b,S]=y.useState(!1);function j(){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(C=>v(Jt(C)))}return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(oc,{value:a.profile,link:!0})}),s.jsxs(mt,{onSubmit:()=>{const C={...a,accessPolicy:o,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>S(!0)).catch(R=>v(Jt(R)))},children:[!b&&s.jsxs(We,{children:[s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:s.jsx(cm,{name:"accessPolicy",defaultValue:o,onChange:c})}),s.jsx(zt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:s.jsx(aJ,{name:"userConfiguration",defaultValue:u,onChange:f})}),s.jsx(zt,{title:"Admin",htmlFor:"admin",outcome:g,children:s.jsx(Hn,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),s.jsxs(Ce,{justify:"flex-end",mt:"xl",children:[s.jsx(Pe,{type:"submit",children:"Save"}),s.jsx(Pe,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(bt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function oJ(){const e=Ae(),[t,n]=y.useState(e.getProject()),[r,a]=y.useState(),[o,c]=y.useState(),[u,f]=y.useState(!1),[p,m]=y.useState(void 0),g=y.useCallback(v=>{const b={resourceType:v.resourceType,firstName:v.firstName,lastName:v.lastName,email:v.email,sendEmail:v.sendEmail==="on",accessPolicy:r,admin:v.isAdmin==="on",scope:v.isProjectScoped==="on"?"project":"server"};return e.invite(t==null?void 0:t.id,b).then(S=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Fp(S)?c(S):m(S),f(b.sendEmail??!1),_e({color:"green",message:"Invite success"})}).catch(S=>{_e({color:"red",message:Ke(S),autoClose:!1}),c(Jt(S))})},[e,t,r]);return s.jsxs(mt,{onSubmit:g,children:[!p&&!o&&s.jsxs(We,{children:[s.jsx(Ie,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(zt,{title:"Project",htmlFor:"project",outcome:o,children:s.jsx(tl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(ln,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Nt(o,"resourceType")}),s.jsx(ze,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Nt(o,"firstName")}),s.jsx(ze,{name:"lastName",label:"Last Name",required:!0,error:Nt(o,"lastName")}),s.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,error:Nt(o,"email")}),s.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:o,children:s.jsx(cm,{name:"accessPolicy",onChange:a})}),s.jsx(Hn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Hn,{name:"isAdmin",label:"Admin"}),s.jsx(Hn,{name:"isProjectScoped",label:"Project scoped"}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Or,{children:"Invite"})})]}),o&&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(bt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(De,{children:"User created"}),u&&s.jsx(De,{children:"Email sent"}),s.jsxs(pr,{children:[s.jsx(pr.Item,{children:s.jsx(bt,{to:p,children:"Go to new membership"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:p.profile,children:"Go to new profile"})}),s.jsx(pr.Item,{children:s.jsx(bt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function sJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Patients"}),s.jsx(lm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/invite",children:"Invite new patient"})})]})}function lJ(){const e=Ae();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(xa,{outcome:JD});function t(n){e.post("admin/projects/setpassword",n).then(()=>_e({color:"green",message:"Done"})).catch(r=>_e({color:"red",message:Ke(r),autoClose:!1}))}return s.jsxs(ot,{width:600,children:[s.jsx(Ie,{order:1,children:"Project Admin"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Force Set Password"}),s.jsx(De,{children:"Sets the password for the specified user in this project."}),s.jsx(De,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(mt,{onSubmit:t,children:s.jsxs(We,{children:[s.jsx(ze,{name:"email",label:"Email",required:!0}),s.jsx(Na,{name:"password",label:"Password",required:!0}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})})]})}function FT(){const e=Ae(),t=Xo(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Details"}),s.jsxs(xb,{children:[s.jsx(zi,{term:"ID",children:n.project.id}),s.jsx(zi,{term:"Name",children:n.project.name})]})]})}const HT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function cJ(){const e=Rn(),n=Mr().pathname.replace("/admin/","")||HT[0],r=Ae(),a=Xo(r),o=y.useMemo(()=>r.get("admin/projects/"+a).read(),[r,a]);function c(u){var f;(f=e(`/admin/${u}`))==null||f.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(mr,{children:[s.jsx(pt,{children:s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Project"}),s.jsx(pt.Value,{children:o.project.name})]})}),s.jsx(Yr,{children:s.jsx(It,{value:n.toLowerCase(),onChange:c,children:s.jsx(It.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:HT.map(u=>s.jsx(It.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),s.jsx(ot,{children:s.jsx(Qb,{})})]})}function uJ(){const e=Ae(),t=Xo(e),n=e.get(`admin/projects/${t}`).read(),[r,a]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>a(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Qr(n.project.secret||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>_e({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(Ie,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Od,{property:Qo("Project","secret"),name:"secret",path:"Project.secret",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function dJ(){const e=Ae(),t=Xo(e),n=e.get(`admin/projects/${t}`).read(),[r,a]=y.useState(!1),[o,c]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>a(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&c(Qr(n.project.site||[]))},[e,n]),!r||!o?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,o).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>_e({color:"green",message:"Saved"})).catch(f=>{var m,g,v,b;const p=Jt(f);_e({color:"red",message:`Error ${(g=(m=p.issue)==null?void 0:m[0].details)==null?void 0:g.text} ${(b=(v=p.issue)==null?void 0:v[0].expression)==null?void 0:b[0]}`,autoClose:!1})})},children:[s.jsx(Ie,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Od,{property:Qo("Project","site"),name:"site",path:"Project.site",defaultValue:o,onChange:c,outcome:void 0}),s.jsx(Pe,{type:"submit",children:"Save"})]})}function fJ(){const e=Ae(),[t,{open:n,close:r}]=ip(!1),[a,o]=y.useState(""),[c,u]=y.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(xa,{outcome:JD});function f(){xs(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){xs(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){xs(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(A){xs(e,"Reindexing Resources","admin/super/reindex",A)}function v(){xs(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){xs(e,"Run Pending Data Migration","admin/super/migrate")}function S(A){e.post("admin/super/removebotidjobsfromqueue",A).then(()=>_e({color:"green",message:"Done"})).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function j(A){e.post("admin/super/purge",{...A,before:jb(A.before)}).then(()=>_e({color:"green",message:"Done"})).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function C(A){e.post("admin/super/setpassword",A).then(()=>_e({color:"green",message:"Done"})).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function R(A){e.post("fhir/R4/$db-stats",A.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:A.tableNames}]}:void 0).then(_=>{var M,L;o("Database Stats"),u(s.jsx("pre",{children:(L=(M=_.parameter)==null?void 0:M.find($=>$.name==="tableString"))==null?void 0:L.valueString})),n()}).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))}function D(){e.post("fhir/R4/$db-invalid-indexes").then(A=>{var _;o("Database Invalid Indexes"),u(s.jsx("pre",{children:(_=A.parameter)==null?void 0:_.filter(M=>M.name==="invalidIndex").map(M=>M.valueString).join(`
|
|
570
|
+
`)})),n()}).catch(A=>_e({color:"red",message:Ke(A),autoClose:!1}))}function E(){e.post("fhir/R4/$db-schema-diff").then(A=>{var _,M;o("Schema Diff"),u(s.jsx("pre",{children:(M=(_=A.parameter)==null?void 0:_.find(L=>L.name==="migrationString"))==null?void 0:M.valueString})),n()}).catch(A=>_e({color:"red",message:Ke(A),autoClose:!1}))}function T(){xs(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return s.jsxs(ot,{width:600,children:[s.jsx(Ie,{order:1,children:"Super Admin"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{children:s.jsx(Pe,{onClick:f,children:"Rebuild StructureDefinitions"})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{children:s.jsx(Pe,{onClick:p,children:"Rebuild SearchParameters"})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{children:s.jsx(Pe,{onClick:m,children:"Rebuild ValueSets"})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Run Pending Data Migration"}),s.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),s.jsx(mt,{onSubmit:b,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Start Migration"})})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:g,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(ze,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(zt,{title:"Search Filter",htmlFor:"filter",children:s.jsx(ze,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(zt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:s.jsx(hJ,{})}),s.jsx(Pe,{type:"submit",children:"Reindex"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:j,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(ln,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(zt,{title:"Purge Before",htmlFor:"before",children:s.jsx(si,{name:"before",placeholder:"Before Date"})}),s.jsx(Pe,{type:"submit",children:"Purge"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(mt,{onSubmit:S,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Bot ID",children:s.jsx(ze,{name:"botId",placeholder:"Bot Id"})}),s.jsx(Pe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:C,children:s.jsxs(We,{children:[s.jsx(ze,{name:"email",label:"Email",required:!0}),s.jsx(Na,{name:"password",label:"Password",required:!0}),s.jsx(ze,{name:"projectId",label:"Project ID"}),s.jsx(Pe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(mt,{onSubmit:R,children:s.jsxs(We,{children:[s.jsx(zt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:s.jsx(ze,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),s.jsx(Pe,{type:"submit",children:"Get Database Stats"})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Invalid Indexes"}),s.jsx("p",{children:"Query invalid indexes from the database."}),s.jsx(mt,{onSubmit:D,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Get Database Invalid Indexes"})})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Database Schema Drift"}),s.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),s.jsxs(or,{children:[s.jsx(or.Col,{span:6,children:s.jsx(mt,{onSubmit:E,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Get Schema Drift"})})})}),s.jsx(or.Col,{span:6,children:s.jsx(mt,{onSubmit:T,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{order:2,children:"Reload Cron Resources"}),s.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),s.jsx(mt,{onSubmit:v,children:s.jsx(We,{children:s.jsx(Pe,{type:"submit",children:"Reload Cron Resources"})})}),s.jsx(Bn,{opened:t,onClose:r,title:a,centered:!0,size:"auto",children:c})]})}function hJ(){const[e,t]=y.useState("outdated");return s.jsxs(s.Fragment,{children:[s.jsx(ln,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&s.jsx(Op,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function xs(e,t,n,r){const a=Date.now().toString();_e({id:a,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(c=>{var f,p,m;let u="Done";c.resourceType==="AsyncJob"?u=s.jsx(bt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&((m=(p=(f=c.issue)==null?void 0:f[0])==null?void 0:p.details)!=null&&m.text)&&(u=s.jsx(De,{children:c.issue[0].details.text})),ca.update({id:a,color:"green",title:t,message:u,icon:s.jsx(to,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(c=>{ca.update({id:a,color:"red",title:t,message:Ke(c),icon:s.jsx(Bs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function pJ(){return s.jsxs(s.Fragment,{children:[s.jsx(Ie,{children:"Users"}),s.jsx(lm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(bt,{to:"/admin/invite",children:"Invite new user"})})]})}function mJ(){const[e]=xc("ObservationDefinition","_count=100");return e?s.jsxs(Oe,{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,a,o;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(oi,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(oi,{value:t.code})}),s.jsx("td",{children:s.jsx(oi,{value:t.method})}),s.jsx("td",{children:(a=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:a.text}),s.jsx("td",{children:(o=t.quantitativeDetails)==null?void 0:o.decimalPrecision}),s.jsx("td",{children:s.jsx(nx,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(pa,{})}function nx(e){const{ranges:t}=e;if(!t)return null;const n=qT(t.map(a=>a.gender));if(n.length>1)return rd(n),s.jsx(s.Fragment,{children:n.map(a=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:$n(a)})}),s.jsx(nx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>c.gender===a)})]},a)})});const r=qT(t.map(a=>a.age&&ad(a.age)));return r.length>1?(rd(r),s.jsx(s.Fragment,{children:r.map(a=>{var o;return s.jsxs(y.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:$n(a)})}),s.jsx(nx,{ranges:(o=e.ranges)==null?void 0:o.filter(c=>ad(c.age)===a)})]},a)})})):s.jsx(s.Fragment,{children:t.map(a=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:a.condition}),s.jsx("td",{children:s.jsx(wb,{value:a.range})})]})})},`range-${a.condition}`))})}function qT(e){return[...new Set(e.filter(t=>!!t))]}function gJ(){const[e]=xc("ActivityDefinition","_count=100"),[t]=xc("ObservationDefinition","_count=100");return!e||!t?s.jsx(pa,{}):s.jsxs(Oe,{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(oi,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(oi,{value:n.code})}),e.map(a=>{var o;return s.jsx("td",{children:(o=a.observationResultRequirement)!=null&&o.find(c=>{var u;return(u=c.reference)==null?void 0:u.includes(n.id)})?"✅":""},a.id)})]},n.id)})})]})}function vJ(e){var c;const t=Ae(),[n,r]=y.useState(),[a,o]=y.useState();return a?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(bt,{to:a,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(bt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(mt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(o).catch(console.log)},children:s.jsxs(We,{children:[s.jsxs(Ie,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(De,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(De,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(c=e.planDefinition.action)==null?void 0:c.map((u,f)=>{var p;return s.jsxs("li",{children:[((p=u.definitionCanonical)==null?void 0:p.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&s.jsx(s.Fragment,{children:u.title}),u.code&&s.jsx(oi,{value:u.code[0]})]},`action-${f}`)})}),s.jsx(zt,{title:"Subject",children:s.jsx(Nd,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"Go"})})]})})}function yJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t});return n?s.jsx(ot,{children:s.jsx(vJ,{planDefinition:n})}):null}function xJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t}),[r,a]=xc("Questionnaire","subject-type="+e),[o,c]=xc("ClientApplication",{_count:1e3});if(!n||a||c)return s.jsx(pa,{});const u=o==null?void 0:o.filter(m=>bJ(e)&&!!m.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return s.jsxs(ot,{children:[s.jsx(Ie,{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 f,p;return n.resourceType==="Patient"?f=fn(n):n.resourceType==="Encounter"&&(f=n.subject,p=fn(n)),s.jsxs(ot,{children:[r==null?void 0:r.map(m=>s.jsxs("div",{children:[s.jsx(Ie,{order:3,children:s.jsx(bt,{to:`/forms/${m.id}?subject=${Lt(n)}`,children:m.title||m.name})}),s.jsx(De,{children:m.description})]},m.id)),u==null?void 0:u.map(m=>s.jsxs("div",{children:[s.jsx(Ie,{order:3,children:s.jsx(bY,{client:m,patient:f,encounter:p,children:m.name})}),s.jsx(De,{children:m.description})]},m.id))]})}function bJ(e){return e==="Patient"||e==="Encounter"}function SJ(){const{resourceType:e,id:t}=Qt(),n=Rn(),[r,a]=y.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(ot,{children:s.jsx(Id,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>a(o.definition),hideFilters:!0})})}function wJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(cY,{history:r})})}const jJ="_hl7Input_k5xm3_1",CJ={hl7Input:jJ};function EJ(e){return s.jsx("iframe",{title:"Bot Runner",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 TJ(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",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Qu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const RJ=`{
|
|
571
|
+
"resourceType": "Patient",
|
|
572
|
+
"name": [
|
|
573
|
+
{
|
|
574
|
+
"given": [
|
|
575
|
+
"Alice"
|
|
576
|
+
],
|
|
577
|
+
"family": "Smith"
|
|
578
|
+
}
|
|
579
|
+
]
|
|
580
|
+
}`,DJ="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 AJ(){const e=Ae(),{id:t}=Qt(),[n,r]=y.useState(),[a,o]=y.useState(),[c,u]=y.useState(RJ),[f,p]=y.useState(DJ),[m,g]=y.useState(dn.FHIR_JSON),v=y.useRef(null),b=y.useRef(null),[S,j]=y.useState(!1);y.useEffect(()=>{e.readResource("Bot",t).then(async _=>{r(_),o(await _J(e,_))}).catch(_=>_e({color:"red",message:Ke(_),autoClose:!1}))},[e,t]);const C=y.useCallback(async()=>Qu(v.current,{command:"getValue"}),[]),R=y.useCallback(async()=>Qu(v.current,{command:"getOutput"}),[]),D=y.useCallback(async()=>m===dn.FHIR_JSON?JSON.parse(c):f,[m,c,f]),E=y.useCallback(async _=>{_.preventDefault(),_.stopPropagation(),j(!0);try{const M=await C(),L=await R(),$=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),V=await e.createAttachment({data:L,filename:"index.js",contentType:"text/typescript"}),X=[{op:"add",path:"/sourceCode",value:$},{op:"add",path:"/executableCode",value:V}];await e.patchResource("Bot",t,X),_e({color:"green",message:"Saved"})}catch(M){_e({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,C,R]),T=y.useCallback(async _=>{_.preventDefault(),_.stopPropagation(),j(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),_e({color:"green",message:"Deployed"})}catch(M){_e({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t]),A=y.useCallback(async _=>{_.preventDefault(),_.stopPropagation(),j(!0);try{const M=await D(),L=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await Qu(b.current,{command:"setValue",value:L}),_e({color:"green",message:"Success"})}catch(M){_e({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,D,m]);return!n||a===void 0?null:s.jsxs(or,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(or.Col,{span:8,children:s.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(TJ,{iframeRef:v,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:a,minHeight:"528px"}),s.jsxs(Ce,{justify:"flex-end",gap:"xs",children:[s.jsx(Pe,{type:"button",onClick:E,loading:S,leftSection:s.jsx(LV,{size:"1rem"}),children:"Save"}),s.jsx(Pe,{type:"button",onClick:T,loading:S,leftSection:s.jsx(db,{size:"1rem"}),children:"Deploy"}),s.jsx(Pe,{type:"button",onClick:A,loading:S,leftSection:s.jsx(XV,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(or.Col,{span:4,children:[s.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ln,{data:[{label:"FHIR",value:dn.FHIR_JSON},{label:"HL7",value:dn.HL7_V2}],onChange:_=>g(_.currentTarget.value)}),m===dn.FHIR_JSON?s.jsx(Dc,{value:c,onChange:_=>u(_),autosize:!0,minRows:15}):s.jsx("textarea",{className:CJ.hl7Input,value:f,onChange:_=>p(_.currentTarget.value),rows:15})]}),s.jsx(mr,{m:2,p:"xs",shadow:"md",children:s.jsx(EJ,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function _J(e,t){var n,r,a;if((n=t.sourceCode)!=null&&n.url){const o=(a=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:a.find(mA);return(await e.download(e.fhirUrl("Binary",o))).text()}return t.code??""}function al(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function kJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),r={reference:t+"/"+n},a=y.useCallback(o=>{e.updateResource(al(o)).then(()=>{_e({color:"green",message:"Success"})}).catch(c=>{_e({color:"red",message:Ke(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(ot,{children:s.jsx(NQ,{value:r,onSubmit:a})});case"Questionnaire":return s.jsx(ot,{children:s.jsx(bW,{questionnaire:r,onSubmit:a})});default:return null}}function PJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t}),r=Rn();return n?s.jsx(ot,{children:s.jsx(qW,{value:n,onStart:(a,o)=>{var c;return(c=r(`/forms/${zs(o)}`))==null?void 0:c.catch(console.error)},onEdit:(a,o,c)=>{var u;return(u=r(`/${c.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function NJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),r=Rn();return s.jsxs(ot,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(Pe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>{var a;return(a=r(`/${t}`))==null?void 0:a.catch(console.error)}).catch(a=>_e({color:"red",message:Ke(a),autoClose:!1}))},children:"Delete"})]})}const OJ="_selectProfileBtn_tbaz6_1",MJ="_chevron_tbaz6_13",GT={selectProfileBtn:OJ,chevron:MJ};function IJ(){var f,p;const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t}),[r,a]=y.useState(),o=gd({onDropdownClose:()=>o.resetSelectedOption()}),c=y.useMemo(()=>{var m;if(En((m=n==null?void 0:n.meta)==null?void 0:m.profile))return[s.jsx(ct.Option,{value:"",children:"None"},""),...n.meta.profile.map(g=>s.jsx(ct.Option,{value:g,children:g},g))]},[(f=n==null?void 0:n.meta)==null?void 0:f.profile]);if(y.useEffect(()=>{var m,g;((g=(m=n==null?void 0:n.meta)==null?void 0:m.profile)==null?void 0:g.length)===1&&a(n.meta.profile[0])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return En(c)&&(u=s.jsx(Ce,{justify:"flex-end",children:s.jsxs(We,{align:"flex-end",gap:"xs",children:[s.jsxs(ct,{store:o,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:m=>{a(m),o.closeDropdown()},children:[s.jsx(ct.Target,{children:s.jsx(tr,{onClick:()=>o.toggleDropdown(),children:s.jsxs(s0,{fw:"bold",fs:"sm",className:GT.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(ub,{stroke:1.5,className:GT.chevron})]})})}),s.jsx(ct.Dropdown,{w:"max-content",children:s.jsx(ct.Options,{children:c})})]}),s.jsx(ce,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(De,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(De,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(De,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(ot,{children:s.jsxs(We,{gap:"xl",children:[u,s.jsx(_b,{value:n,profileUrl:r})]})})}function LJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),[r,a]=y.useState(),[o,c]=y.useState(),u=Rn(),[f,p]=y.useState();y.useEffect(()=>{e.readResource(t,n).then(b=>{a(Qr(b)),c(Qr(b))}).catch(b=>{p(Jt(b)),_e({color:"red",message:Ke(b),autoClose:!1})})},[e,t,n]);const m=y.useCallback(b=>{p(void 0),e.updateResource(al(b)).then(()=>{var S;(S=u(`/${t}/${n}/details`))==null||S.catch(console.error),_e({id:"succes",color:"green",message:"Success"})}).catch(S=>{p(Jt(S)),_e({color:"red",message:Ke(S),autoClose:!1})})},[e,t,n,u]),g=y.useCallback(b=>{p(void 0);const S=__.createPatch(r,b);e.patchResource(t,n,S).then(()=>{var j;(j=u(`/${t}/${n}/details`))==null||j.catch(console.error),_e({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Jt(j)),_e({color:"red",message:Ke(j),autoClose:!1})})},[e,t,n,r,u]),v=y.useCallback(()=>{var b;return(b=u(`/${t}/${n}/delete`))==null?void 0:b.catch(console.error)},[u,t,n]);return o?s.jsx(ot,{children:s.jsx(Wh,{defaultValue:o,onSubmit:m,onPatch:g,onDelete:v,outcome:f})}):null}function zJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t});return n?s.jsx(ot,{maw:700,children:n.resourceType==="Patient"?s.jsx(RQ,{patient:n}):s.jsx(Ki,{icon:s.jsx(el,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function Gk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,a=Ae(),[o,c]=y.useState();return y.useEffect(()=>{a.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{c(u.filter(WH))}).catch(console.error)},[a,n,r]),s.jsx(It,{value:t==null?void 0:t.url,onChange:u=>{const f=o==null?void 0:o.find(p=>p.url===u);f&&n(f)},children:s.jsx(It.List,{children:o==null?void 0:o.map(u=>{var m,g;const f=(g=(m=e.meta)==null?void 0:m.profile)==null?void 0:g.includes(u.url),p=f?"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(It.Tab,{value:u.url,title:p,rightSection:f&&s.jsx(V0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(dF,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function Qk(e,t){const n=Ae(),r=Rn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Jt(u)),_e({color:"red",message:Ke(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function cy(){const{resourceType:e}=Qt(),t=Mr(),[n,r]=y.useState(),{defaultValue:a,handleSubmit:o}=Qk(e,r),[c,u]=y.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=y.useCallback(m=>{const g=al(m);c&&bA(g,c.url),o(g)},[c,o]);return f?s.jsx(ot,{children:s.jsxs(We,{children:[s.jsx(Gk,{resource:a,currentProfile:c,onChange:u}),c?s.jsx(Wh,{defaultValue:a,onSubmit:p,outcome:n,profileUrl:c.url},c.url):s.jsx(De,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(ot,{children:s.jsx(Wh,{defaultValue:a,onSubmit:o,outcome:n})})}function $J(){const e=Ae(),{resourceType:t,id:n}=Qt(),r=e.readHistory(t,n).read();return s.jsx(ot,{children:s.jsx(gY,{history:r})})}function UJ(){const{resourceType:e}=Qt(),[t,n]=y.useState(),{defaultValue:r,handleSubmit:a}=Qk(e,n),o=y.useCallback(c=>{a(JSON.parse(c["new-resource"]))},[a]);return s.jsxs(ot,{children:[t&&s.jsx(xa,{outcome:t}),s.jsxs(mt,{onSubmit:o,children:[s.jsx(Dc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ia(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]})}function BJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),r=Yt({reference:t+"/"+n}),a=Rn(),[o,c]=y.useState(),u=y.useCallback(f=>{e.updateResource(al(JSON.parse(f.resource))).then(()=>{var p;c(void 0),(p=a(`/${t}/${n}/details`))==null||p.catch(console.error),_e({color:"green",message:"Success"})}).catch(p=>{_e({color:"red",message:Ke(p),autoClose:!1})})},[e,t,n,a]);return r?s.jsxs(ot,{children:[o&&s.jsx(xa,{outcome:o}),s.jsxs(mt,{onSubmit:u,children:[s.jsx(Dc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ia(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Ce,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Pe,{type:"submit",children:"OK"})})]})]}):null}function VJ(){const{resourceType:e,id:t}=Qt();return Yt({reference:e+"/"+t})?s.jsxs(ot,{children:[s.jsxs(Ki,{icon:s.jsx(el,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Pt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(nk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function FJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),[r,a]=y.useState(),[o,c]=y.useState();return y.useEffect(()=>{e.readResource(t,n).then(u=>a(Qr(u))).catch(u=>{_e({color:"red",message:Ke(u)})})},[e,t,n]),r?s.jsxs(ot,{children:[s.jsxs(Ie,{order:2,children:["Available ",t," profiles"]}),s.jsx(We,{children:s.jsxs(s.Fragment,{children:[s.jsx(Gk,{resource:r,currentProfile:o,onChange:c}),o?s.jsx(HJ,{profile:o,resource:r,onResourceUpdated:u=>a(u)},o.url):s.jsx(De,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const HJ=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Ae(),[a,o]=y.useState(),[c,u]=y.useState(()=>{var p,m;return(m=(p=t.meta)==null?void 0:p.profile)==null?void 0:m.includes(e.url)}),f=y.useCallback(p=>{o(void 0);const m=al(p);c?bA(m,e.url):F$(m,e.url),r.updateResource(m).then(g=>{n(g),_e({color:"green",message:"Success"})}).catch(g=>{o(Jt(g)),_e({color:"red",message:Ke(g),autoClose:!1})})},[r,e.url,n,c]);return s.jsxs(We,{children:[s.jsx(Sd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?s.jsx(Wh,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:a}):s.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:s.jsx(Ce,{justify:"flex-end",mt:"xl",children:s.jsx(Pe,{type:"submit",children:"OK"})})})]})},Wk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},qJ=Object.keys(Wk);function GJ(){const e=Ae(),{id:t}=Qt(),n=Yt({reference:`Questionnaire/${t}`}),[r,a]=y.useState(),[o,c]=y.useState("create"),[u,f]=y.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>QJ(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Lt(n)}`:Lt(n)}`,channel:{type:"rest-hook",endpoint:Lt(r)},...o?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:o}]}:void 0}).then(()=>{a(void 0),f(Date.now()),e.invalidateSearches("Subscription"),_e({color:"green",message:"Success"})}).catch(g=>_e({color:"red",message:Ke(g),autoClose:!1}))}return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Bots"}),s.jsxs(We,{children:[p.length===0&&s.jsx("p",{children:"No bots found."}),p.map(g=>{var v;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Ic,{value:{reference:(v=g.channel)==null?void 0:v.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id)})]}),s.jsx(jn,{}),s.jsxs(We,{mt:10,children:[s.jsx(fd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),s.jsxs(Ce,{children:[s.jsx(tl,{name:"bot",resourceType:"Bot",onChange:g=>a(g)}),s.jsx(Pe,{onClick:m,children:"Connect"})]}),s.jsx(Ce,{children:s.jsx(ln,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:qJ,onChange:g=>c(Wk[g.target.value])})})]}),s.jsx("div",{style:{display:"none"},children:u})]})}function QJ(e,t){var a;if(!t)return!1;const n=e.criteria||"",r=((a=e.channel)==null?void 0:a.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Lt(t))||(t.url?n.includes(t.url):!1))}function WJ(){const{id:e}=Qt(),t=Rn(),r=Ae().readReference({reference:`Questionnaire/${e}`}).read(),[a,o]=y.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:de.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(Id,{search:a,onClick:c=>{var u;return(u=t(`/${c.resource.resourceType}/${c.resource.id}`))==null?void 0:u.catch(console.error)},onChange:c=>o(c.definition),hideFilters:!0,hideToolbar:!0})})}function YJ(){const e=Ae(),{resourceType:t,id:n}=Qt(),r=Yt({reference:t+"/"+n}),a=y.useCallback(o=>{e.updateResource(al(o)).then(()=>{_e({color:"green",message:"Success"})}).catch(c=>{_e({color:"red",message:Ke(c),autoClose:!1})})},[e]);return r?s.jsx(ot,{children:s.jsx(LW,{onSubmit:a,definition:r})}):null}function KJ(){const{resourceType:e,id:t}=Qt(),n=Yt({reference:e+"/"+t});return n?s.jsx(ot,{children:e==="MeasureReport"?s.jsx(EQ,{measureReport:n}):s.jsx(Ab,{value:n})}):null}const XJ="_container_1ue98_1",ZJ="_entry_1ue98_14",JJ="_active_1ue98_21",uy={container:XJ,entry:ZJ,active:JJ};function eee(e){const t=Ae(),n=Yt(e.value),[r,a]=y.useState();return y.useEffect(()=>{if(!n)return;const o=e1(n);if(!o)return;const c="reference"in o?o.reference:Lt(o);t.search("ServiceRequest","subject="+c).then(u=>{const p=(u.entry??[]).map(m=>m.resource);k_(p),p.reverse(),a(p)}).catch(u=>_e({color:"red",message:Ke(u),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:uy.container,children:r.map(o=>{var c,u,f,p,m,g,v;return s.jsxs("div",{className:$t(uy.entry,{[uy.active]:o.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(bt,{to:o,children:tee(o)})}),((u=(c=o.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(f=o.category[0])==null?void 0:f.text}),((g=(m=(p=o.code)==null?void 0:p.coding)==null?void 0:m[0])==null?void 0:g.code)&&s.jsx("p",{children:(v=o.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:nee(o)})]},o.id)})}):null}function tee(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function nee(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const ree="_container_1l2dh_1",aee={container:ree};function iee(e){var a,o,c,u;const t=Yt(e.valueSet);if(!t)return null;const n=[""],r=(u=(c=(o=(a=t.compose)==null?void 0:a.include)==null?void 0:o[0])==null?void 0:c.concept)==null?void 0:u.map(f=>f.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:aee.container,children:s.jsx(ln,{defaultValue:e.defaultValue,onChange:f=>e.onChange(f.currentTarget.value),data:n})})}function oee(e){var n,r;const t=Yt(e.specimen);return t?s.jsxs(pt,{children:[s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Type"}),s.jsx(pt.Value,{children:"Specimen"})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Collected"}),s.jsx(pt.Value,{children:gr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Specimen Age"}),s.jsx(pt.Value,{children:see(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(pt.Entry,{children:[s.jsx(pt.Key,{children:"Specimen Stability"}),s.jsx(pt.Value,{children:lee(t)})]}):s.jsx(s.Fragment,{})]}):null}function see(e){var a;const t=(a=e.collection)==null?void 0:a.collectedDateTime;if(!t)return;const n=new Date(t);return Yk(Kk(n,new Date))}function lee(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return Yk(Kk(t,n))}function Yk(e){return e.toString().padStart(3,"0")+"D"}function Kk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function cee(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"),e==="Patient"&&t.push("Export"),t}function uee(){var D,E,T,A,_,M,L;const e=Ae(),{resourceType:t,id:n}=Qt(),r={reference:t+"/"+n},a=Rn(),[o,c]=y.useState(),u=Yt(r,c),f=cee(t),[p,m]=y.useState(()=>{const $=window.location.pathname.split("/").pop();return $&&f.map(V=>V.toLowerCase()).includes($)?$:f[0].toLowerCase()});async function g(){var X,Q;const V=(Q=(X=(await e.readHistory(t,n)).entry)==null?void 0:X.find(J=>!!J.resource))==null?void 0:Q.resource;V?v(V):_e({color:"red",message:"No history to restore",autoClose:!1})}function v($){e.updateResource(al($)).then(()=>{c(void 0),_e({color:"green",message:"Success"})}).catch(V=>{_e({color:"red",message:Ke(V),autoClose:!1})})}if(o)return Xz(o)?s.jsxs(ot,{children:[s.jsx(Ie,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(Pe,{color:"red",onClick:g,children:"Restore"})]}):s.jsx(xa,{outcome:o});function b($){var V;$||($=f[0].toLowerCase()),m($),(V=a(`/${t}/${n}/${$}`))==null||V.catch(console.error)}function S($){const V=u,X=V.orderDetail||[];X.length===0&&X.push({}),X[0].text!==$&&(X[0].text=$,v({...V,orderDetail:X}))}const j=u&&e1(u),C=u&&OZ(u),R=(T=(E=(D=e.getUserConfiguration())==null?void 0:D.option)==null?void 0:E.find($=>$.id==="statusValueSet"))==null?void 0:T.valueString;return s.jsxs(s.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&R&&s.jsx(iee,{valueSet:{reference:R},defaultValue:(_=(A=u.orderDetail)==null?void 0:A[0])==null?void 0:_.text,onChange:S},Lt(u)+"-"+((L=(M=u.orderDetail)==null?void 0:M[0])==null?void 0:L.text)),u&&s.jsx(eee,{value:u}),u&&s.jsxs(mr,{children:[j&&s.jsx($_,{patient:j}),C&&s.jsx(oee,{specimen:C}),t!=="Patient"&&s.jsx(Vk,{resource:r}),s.jsx(Yr,{children:s.jsx(It,{value:p.toLowerCase(),onChange:b,children:s.jsx(It.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map($=>s.jsx(It.Tab,{value:$.toLowerCase(),children:$},$))})})})]}),s.jsx(Qb,{})]})}function QT(){var R,D,E,T;const e=Rn(),{resourceType:t,id:n,versionId:r,tab:a}=Qt(),o=Ae(),[c,u]=y.useState(!0),[f,p]=y.useState(),[m,g]=y.useState();if(y.useEffect(()=>{g(void 0),u(!0),o.readHistory(t,n).then(A=>p(A)).then(()=>u(!1)).catch(A=>{g(A),u(!1)})},[o,t,n]),c)return s.jsx(pa,{});if(!f)return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Resource not found"}),s.jsx(bt,{to:`/${t}`,children:"Return to search page"})]});const v=f.entry??[],b=v.findIndex(A=>{var _,M;return((M=(_=A.resource)==null?void 0:_.meta)==null?void 0:M.versionId)===r});if(b===-1)return s.jsxs(ot,{children:[s.jsx(Ie,{children:"Version not found"}),s.jsx(bt,{to:`/${t}/${n}`,children:"Return to resource"})]});const S=v[b].resource,j=b<v.length-1?v[b+1].resource:void 0,C="diff";return s.jsxs(It,{value:a||C,onChange:A=>{var _;return(_=e(`/${t}/${n}/_history/${r}/${A||C}`))==null?void 0:_.catch(console.error)},children:[s.jsxs(mr,{children:[s.jsx(kd,{fluid:!0,p:"md",children:s.jsx(De,{children:`${t} ${n}`})}),s.jsxs(It.List,{children:[s.jsx(It.Tab,{value:"diff",children:"Diff"}),s.jsx(It.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(ot,{children:[m&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),s.jsx(It.Panel,{value:"diff",children:j?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(R=S.meta)==null?void 0:R.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(bt,{to:`/${t}/${n}/_history/${(D=j.meta)==null?void 0:D.versionId}`,children:(E=j.meta)==null?void 0:E.versionId})]})]}),s.jsx(fY,{original:j,revised:S})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(T=S.meta)==null?void 0:T.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(S,void 0,2)})]})}),s.jsx(It.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(S,void 0,2)})})]})]})}function dee(){const{resourceType:e,id:t}=Qt(),n=Rn(),[r,a]=y.useState({resourceType:"Subscription",filters:[{code:"url",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(ot,{children:s.jsx(cQ,{search:r,onClick:o=>{var c;return(c=n(`/${o.resource.resourceType}/${o.resource.id}`))==null?void 0:c.catch(console.error)},onChange:o=>a(o.definition),hideFilters:!0})})}function fee(e){const t=Ae(),{resource:n,opened:r,onClose:a}=e,[o,c]=y.useState(!1),[u,f]=y.useState(),[p,m]=y.useState(!1),g=y.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:o&&u?Lt(u):void 0,verbose:p}),_e({color:"green",message:"Done"}),a()}catch(v){_e({color:"red",message:Ke(v),autoClose:!1})}},[t,n,a,o,u,p]);return s.jsx(Bn,{opened:r,onClose:a,title:"Resend Subscriptions",children:s.jsx(mt,{onSubmit:g,children:s.jsxs(We,{children:[s.jsx(Hn,{label:"Choose subscription (all subscriptions by default)",onChange:v=>c(v.currentTarget.checked)}),o&&s.jsx(tl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),s.jsx(Hn,{label:"Verbose mode",onChange:v=>m(v.currentTarget.checked)}),s.jsx(Ce,{justify:"flex-end",children:s.jsx(Pe,{type:"submit",children:"Resend"})})]})})})}function WT(){const e=Ae(),t=Xp(),{resourceType:n,id:r}=Qt(),a={reference:n+"/"+r},[o,c]=y.useState(),u=ip(!1);function f(D,E){return e.updateResource({...D,priority:E})}function p(D,E){f(D,"stat").then(E).catch(console.error)}function m(D,E){f(D,"routine").then(E).catch(console.error)}function g(D){t(`/${D.resourceType}/${D.id}`)}function v(D){t(`/${D.resourceType}/${D.id}/edit`)}function b(D){t(`/${D.resourceType}/${D.id}/delete`)}function S(D){c(D),u[1].open()}function j(D){var E;t(`/${D.resourceType}/${D.id}/_history/${(E=D.meta)==null?void 0:E.versionId}`)}function C(D,E){const T="aws-textract";_e({id:T,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(D.resourceType,D.id,"$aws-textract"),{}).then(()=>{E(),Rs({id:T,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:s.jsx(to,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(A=>Rs({id:T,title:"AWS Textract Error",color:"red",message:Ke(A),icon:s.jsx(Bs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function R(D){var P;const{primaryResource:E,currentResource:T,reloadTimeline:A}=D,_=T.resourceType===E.resourceType&&T.id===E.id,M=T.resourceType==="Communication"&&T.priority!=="stat",L=T.resourceType==="Communication"&&T.priority==="stat",$=_,V=!_,X=!_,Q=!_,J=(P=e.getProjectMembership())==null?void 0:P.admin,W=J,Y=GZ()&&(T.resourceType==="DocumentReference"||T.resourceType==="Media");return s.jsxs(je.Dropdown,{children:[s.jsx(je.Label,{children:"Resource"}),M&&s.jsx(je.Item,{leftSection:s.jsx(YV,{size:14}),onClick:()=>p(T,A),"aria-label":`Pin ${Lt(T)}`,children:"Pin"}),L&&s.jsx(je.Item,{leftSection:s.jsx(KV,{size:14}),onClick:()=>m(T,A),"aria-label":`Unpin ${Lt(T)}`,children:"Unpin"}),V&&s.jsx(je.Item,{leftSection:s.jsx(kE,{size:14}),onClick:()=>g(T),"aria-label":`Details ${Lt(T)}`,children:"Details"}),$&&s.jsx(je.Item,{leftSection:s.jsx(kE,{size:14}),onClick:()=>j(T),"aria-label":`Details ${Lt(T)}`,children:"Details"}),X&&s.jsx(je.Item,{leftSection:s.jsx(YA,{size:14}),onClick:()=>v(T),"aria-label":`Edit ${Lt(T)}`,children:"Edit"}),J&&s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Label,{children:"Admin"}),W&&s.jsx(je.Item,{leftSection:s.jsx(tF,{size:14}),onClick:()=>S(T),"aria-label":`Resend Subscriptions ${Lt(T)}`,children:"Resend Subscriptions"})]}),Y&&s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Label,{children:"AWS AI"}),s.jsx(je.Item,{leftSection:s.jsx(cF,{size:14}),onClick:()=>C(T,A),"aria-label":`AWS Textract ${Lt(T)}`,children:"AWS Textract"})]}),Q&&s.jsxs(s.Fragment,{children:[s.jsx(je.Divider,{}),s.jsx(je.Label,{children:"Danger zone"}),s.jsx(je.Item,{color:"red",leftSection:s.jsx(pb,{size:14}),onClick:()=>b(T),"aria-label":`Delete ${Lt(T)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(vG,{encounter:a,getMenu:R}),n==="Patient"&&s.jsx(_Q,{patient:a,getMenu:R}),n==="ServiceRequest"&&s.jsx(xY,{serviceRequest:a,getMenu:R}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(gG,{resource:a,getMenu:R}),s.jsx(fee,{resource:o,opened:u[0],onClose:u[1].close},`resend-subscriptions-${o==null?void 0:o.id}`)]})}function hee(e){const{opened:t,close:n,version:r,loadingStatus:a,handleStatus:o,handleUpgrade:c}=e,[u,f]=y.useState();return y.useEffect(()=>{t&&(u||cV("app-tools-page").then(f).catch(console.error),o())},[t,u,o]),u&&r&&!a?r==="unknown"?s.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?s.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),s.jsx(Pe,{onClick:()=>{c(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):s.jsx(pa,{})}function pee(){const e=Ae(),{id:t}=Qt(),n=y.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,a]=y.useState(!1),[o,c]=y.useState(!1),[u,f]=y.useState(!1),[p,m]=y.useState(),[g,v]=y.useState(),[b,S]=y.useState(),[j,C]=y.useState(),[R,D]=y.useState(!1),[E,T]=y.useState(!1),[A,{open:_,close:M}]=ip(!1);y.useEffect(()=>{if(r||o||u||R){T(!0);return}T(!1)},[r,o,u,R]);const L=y.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(W=>{var Y,P,I,z,F,O;m((P=(Y=W.parameter)==null?void 0:Y.find(U=>U.name==="status"))==null?void 0:P.valueCode),v((z=(I=W.parameter)==null?void 0:I.find(U=>U.name==="version"))==null?void 0:z.valueString),S((O=(F=W.parameter)==null?void 0:F.find(U=>U.name==="lastUpdated"))==null?void 0:O.valueInstant)}).catch(W=>J(Ke(W))).finally(()=>a(!1))},[e,t]),$=y.useCallback(W=>{const Y=W.host,P=W.pingCount||1;Y&&(D(!0),e.pushToAgent(n,Y,`PING ${P}`,dn.PING,!0).then(I=>C(I)).catch(I=>J(Ke(I))).finally(()=>D(!1)))},[e,n]),V=y.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(W=>{Q("Agent config reloaded successfully.")}).catch(W=>J(Ke(W))).finally(()=>c(!1))},[e,t]),X=y.useCallback(()=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(W=>{Q("Agent upgraded successfully.")}).catch(W=>J(Ke(W))).finally(()=>f(!1))},[e,t]);function Q(W){_e({color:"green",title:"Success",icon:s.jsx(to,{size:"1rem"}),message:W})}function J(W){_e({color:"red",title:"Error",message:W,autoClose:!1})}return s.jsxs(ot,{children:[s.jsx(Bn,{opened:A,onClose:M,title:"Upgrade Agent",centered:!0,children:s.jsx(hee,{opened:A,close:M,version:g,loadingStatus:r,handleStatus:L,handleUpgrade:X})}),s.jsx(Ie,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Ic,{value:n,link:!0})]}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(Pe,{onClick:L,loading:r,disabled:E&&!r,children:"Get Status"}),!r&&p&&s.jsx(Oe,{children:s.jsxs(Oe.Tbody,{children:[s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:"Status"}),s.jsx(Oe.Td,{children:s.jsx(Db,{status:p})})]}),s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:"Version"}),s.jsx(Oe.Td,{children:g})]}),s.jsxs(Oe.Tr,{children:[s.jsx(Oe.Td,{children:"Last Updated"}),s.jsx(Oe.Td,{children:gr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(Pe,{onClick:V,loading:o,disabled:E&&!o,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(Pe,{onClick:_,loading:u,disabled:E&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(jn,{my:"lg"}),s.jsx(Ie,{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(mt,{onSubmit:$,children:s.jsxs(Ce,{children:[s.jsx(ze,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(_n,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:R,disabled:E&&!R,children:s.jsx(rF,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Op,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!R&&j&&s.jsxs(s.Fragment,{children:[s.jsx(Ie,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:j})]})]})}function mee(){return s.jsx(XK,{children:s.jsxs(qe,{errorElement:s.jsx(NZ,{}),children:[s.jsx(qe,{path:"/signin",element:s.jsx(ZZ,{})}),s.jsx(qe,{path:"/oauth",element:s.jsx(QZ,{})}),s.jsx(qe,{path:"/resetpassword",element:s.jsx(YZ,{})}),s.jsx(qe,{path:"/setpassword/:id/:secret",element:s.jsx(XZ,{})}),s.jsx(qe,{path:"/register",element:s.jsx(WZ,{})}),s.jsx(qe,{path:"/changepassword",element:s.jsx(_Z,{})}),s.jsx(qe,{path:"/security",element:s.jsx(KZ,{})}),s.jsx(qe,{path:"/mfa",element:s.jsx(qZ,{})}),s.jsx(qe,{path:"/batch",element:s.jsx(DZ,{})}),s.jsx(qe,{path:"/bulk/:resourceType",element:s.jsx(AZ,{})}),s.jsx(qe,{path:"/smart",element:s.jsx(JZ,{})}),s.jsx(qe,{path:"/forms/:id",element:s.jsx(MZ,{})}),s.jsx(qe,{path:"/admin/super",element:s.jsx(fJ,{})}),s.jsx(qe,{path:"/admin/config",element:s.jsx(lJ,{})}),s.jsxs(qe,{path:"/admin",element:s.jsx(cJ,{}),children:[s.jsx(qe,{path:"patients",element:s.jsx(sJ,{})}),s.jsx(qe,{path:"bots/new",element:s.jsx(nJ,{})}),s.jsx(qe,{path:"bots",element:s.jsx(eJ,{})}),s.jsx(qe,{path:"clients/new",element:s.jsx(rJ,{})}),s.jsx(qe,{path:"clients",element:s.jsx(tJ,{})}),s.jsx(qe,{path:"details",element:s.jsx(FT,{})}),s.jsx(qe,{path:"invite",element:s.jsx(oJ,{})}),s.jsx(qe,{path:"users",element:s.jsx(pJ,{})}),s.jsx(qe,{path:"project",element:s.jsx(FT,{})}),s.jsx(qe,{path:"secrets",element:s.jsx(uJ,{})}),s.jsx(qe,{path:"sites",element:s.jsx(dJ,{})}),s.jsx(qe,{path:"members/:membershipId",element:s.jsx(iJ,{})})]}),s.jsx(qe,{path:"/lab/assays",element:s.jsx(mJ,{})}),s.jsx(qe,{path:"/lab/panels",element:s.jsx(gJ,{})}),s.jsx(qe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(QT,{})}),s.jsx(qe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(QT,{})}),s.jsxs(qe,{path:"/:resourceType/new",element:s.jsx(PZ,{}),children:[s.jsx(qe,{index:!0,element:s.jsx(cy,{})}),s.jsx(qe,{path:"form",element:s.jsx(cy,{})}),s.jsx(qe,{path:"json",element:s.jsx(UJ,{})}),s.jsx(qe,{path:"profiles",element:s.jsx(cy,{})})]}),s.jsxs(qe,{path:"/:resourceType/:id",element:s.jsx(uee,{}),children:[s.jsx(qe,{index:!0,element:s.jsx(WT,{})}),s.jsx(qe,{path:"apply",element:s.jsx(yJ,{})}),s.jsx(qe,{path:"apps",element:s.jsx(xJ,{})}),s.jsx(qe,{path:"event",element:s.jsx(SJ,{})}),s.jsx(qe,{path:"blame",element:s.jsx(wJ,{})}),s.jsx(qe,{path:"bots",element:s.jsx(GJ,{})}),s.jsx(qe,{path:"builder",element:s.jsx(kJ,{})}),s.jsx(qe,{path:"checklist",element:s.jsx(PJ,{})}),s.jsx(qe,{path:"delete",element:s.jsx(NJ,{})}),s.jsx(qe,{path:"details",element:s.jsx(IJ,{})}),s.jsx(qe,{path:"edit",element:s.jsx(LJ,{})}),s.jsx(qe,{path:"editor",element:s.jsx(AJ,{})}),s.jsx(qe,{path:"history",element:s.jsx($J,{})}),s.jsx(qe,{path:"json",element:s.jsx(BJ,{})}),s.jsx(qe,{path:"preview",element:s.jsx(VJ,{})}),s.jsx(qe,{path:"responses",element:s.jsx(WJ,{})}),s.jsx(qe,{path:"report",element:s.jsx(KJ,{})}),s.jsx(qe,{path:"ranges",element:s.jsx(YJ,{})}),s.jsx(qe,{path:"subscriptions",element:s.jsx(dee,{})}),s.jsx(qe,{path:"timeline",element:s.jsx(WT,{})}),s.jsx(qe,{path:"tools",element:s.jsx(pee,{})}),s.jsx(qe,{path:"profiles",element:s.jsx(FJ,{})}),s.jsx(qe,{path:"export",element:s.jsx(zJ,{})})]}),s.jsx(qe,{path:"/:resourceType",element:s.jsx(VT,{})}),s.jsx(qe,{path:"/",element:s.jsx(VT,{})})]})})}function gee(){const e=Ae(),t=e.getUserConfiguration(),n=Mr(),[r]=Kb();return e.isLoading()?s.jsx(pa,{}):s.jsx(rH,{logo:s.jsx(Ua,{size:24}),pathname:n.pathname,searchParams:r,version:zA,menus:vee(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(y.Suspense,{fallback:s.jsx(pa,{}),children:s.jsx(mee,{})})})}function vee(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var a;return{title:r.title,links:((a=r.link)==null?void 0:a.map(o=>({label:o.name,href:o.target,icon:yee(o.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(HV,{})}]}),t}const YT={Patient:oF,Practitioner:VV,Organization:PV,ServiceRequest:JV,DiagnosticReport:nF,Questionnaire:BV,admin:AV,AccessPolicy:FV,Subscription:uF,batch:WV,Observation:QV};function yee(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in YT){const n=YT[t];return s.jsx(n,{})}}catch{}return s.jsx(Vp,{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 xee(){const e=Bd(),t=new $A({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=wX([{path:"*",element:s.jsx(gee,{})}]),a=c=>r.navigate(c);EY.createRoot(document.getElementById("root")).render(s.jsx(y.StrictMode,{children:s.jsx(uV,{medplum:t,navigate:a,children:s.jsxs(bR,{theme:n,children:[s.jsx(Ji,{position:"bottom-right"}),s.jsx(QK,{router:r})]})})}))}xee().catch(console.error);
|
|
581
|
+
//# sourceMappingURL=index-B4cIQfJJ.js.map
|