@medplum/app 4.0.3 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-B8-TyGj_.js +572 -0
- package/dist/assets/index-B8-TyGj_.js.map +1 -0
- package/dist/assets/index-B_jdBrwP.css +1 -0
- package/dist/index.html +3 -3
- package/package.json +15 -15
- package/dist/assets/index-tN1OR-Ou.js +0 -571
- package/dist/assets/index-tN1OR-Ou.js.map +0 -1
- package/dist/assets/index-uhUaDcmX.css +0 -1
|
@@ -0,0 +1,572 @@
|
|
|
1
|
+
function X_(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();function Tv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fm={exports:{}},Oc={},zm={exports:{}},St={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Xw;function J_(){if(Xw)return St;Xw=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),i=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=m&&I[m]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function j(I,z,J){this.props=I,this.context=z,this.refs=w,this.updater=J||x}j.prototype.isReactComponent={},j.prototype.setState=function(I,z){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,z,"setState")},j.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function T(){}T.prototype=j.prototype;function R(I,z,J){this.props=I,this.context=z,this.refs=w,this.updater=J||x}var E=R.prototype=new T;E.constructor=R,b(E,j.prototype),E.isPureReactComponent=!0;var C=Array.isArray,P=Object.prototype.hasOwnProperty,D={current:null},A={key:!0,ref:!0,__self:!0,__source:!0};function O(I,z,J){var ae,je={},ge=null,Ce=null;if(z!=null)for(ae in z.ref!==void 0&&(Ce=z.ref),z.key!==void 0&&(ge=""+z.key),z)P.call(z,ae)&&!A.hasOwnProperty(ae)&&(je[ae]=z[ae]);var Re=arguments.length-2;if(Re===1)je.children=J;else if(1<Re){for(var ke=Array(Re),_e=0;_e<Re;_e++)ke[_e]=arguments[_e+2];je.children=ke}if(I&&I.defaultProps)for(ae in Re=I.defaultProps,Re)je[ae]===void 0&&(je[ae]=Re[ae]);return{$$typeof:e,type:I,key:ge,ref:Ce,props:je,_owner:D.current}}function L(I,z){return{$$typeof:e,type:I.type,key:z,ref:I.ref,props:I.props,_owner:I._owner}}function V(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function q(I){var z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(J){return z[J]})}var G=/\/+/g;function Q(I,z){return typeof I=="object"&&I!==null&&I.key!=null?q(""+I.key):z.toString(36)}function Y(I,z,J,ae,je){var ge=typeof I;(ge==="undefined"||ge==="boolean")&&(I=null);var Ce=!1;if(I===null)Ce=!0;else switch(ge){case"string":case"number":Ce=!0;break;case"object":switch(I.$$typeof){case e:case t:Ce=!0}}if(Ce)return Ce=I,je=je(Ce),I=ae===""?"."+Q(Ce,0):ae,C(je)?(J="",I!=null&&(J=I.replace(G,"$&/")+"/"),Y(je,z,J,"",function(_e){return _e})):je!=null&&(V(je)&&(je=L(je,J+(!je.key||Ce&&Ce.key===je.key?"":(""+je.key).replace(G,"$&/")+"/")+I)),z.push(je)),1;if(Ce=0,ae=ae===""?".":ae+":",C(I))for(var Re=0;Re<I.length;Re++){ge=I[Re];var ke=ae+Q(ge,Re);Ce+=Y(ge,z,J,ke,je)}else if(ke=v(I),typeof ke=="function")for(I=ke.call(I),Re=0;!(ge=I.next()).done;)ge=ge.value,ke=ae+Q(ge,Re++),Ce+=Y(ge,z,J,ke,je);else if(ge==="object")throw z=String(I),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.");return Ce}function X(I,z,J){if(I==null)return I;var ae=[],je=0;return Y(I,ae,"","",function(ge){return z.call(J,ge,je++)}),ae}function B(I){if(I._status===-1){var z=I._result;z=z(),z.then(function(J){(I._status===0||I._status===-1)&&(I._status=1,I._result=J)},function(J){(I._status===0||I._status===-1)&&(I._status=2,I._result=J)}),I._status===-1&&(I._status=0,I._result=z)}if(I._status===1)return I._result.default;throw I._result}var M={current:null},N={transition:null},F={ReactCurrentDispatcher:M,ReactCurrentBatchConfig:N,ReactCurrentOwner:D};return St.Children={map:X,forEach:function(I,z,J){X(I,function(){z.apply(this,arguments)},J)},count:function(I){var z=0;return X(I,function(){z++}),z},toArray:function(I){return X(I,function(z){return z})||[]},only:function(I){if(!V(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},St.Component=j,St.Fragment=n,St.Profiler=o,St.PureComponent=R,St.StrictMode=r,St.Suspense=d,St.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,St.cloneElement=function(I,z,J){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ae=b({},I.props),je=I.key,ge=I.ref,Ce=I._owner;if(z!=null){if(z.ref!==void 0&&(ge=z.ref,Ce=D.current),z.key!==void 0&&(je=""+z.key),I.type&&I.type.defaultProps)var Re=I.type.defaultProps;for(ke in z)P.call(z,ke)&&!A.hasOwnProperty(ke)&&(ae[ke]=z[ke]===void 0&&Re!==void 0?Re[ke]:z[ke])}var ke=arguments.length-2;if(ke===1)ae.children=J;else if(1<ke){Re=Array(ke);for(var _e=0;_e<ke;_e++)Re[_e]=arguments[_e+2];ae.children=Re}return{$$typeof:e,type:I.type,key:je,ref:ge,props:ae,_owner:Ce}},St.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:i,_context:I},I.Consumer=I},St.createElement=O,St.createFactory=function(I){var z=O.bind(null,I);return z.type=I,z},St.createRef=function(){return{current:null}},St.forwardRef=function(I){return{$$typeof:u,render:I}},St.isValidElement=V,St.lazy=function(I){return{$$typeof:h,_payload:{_status:-1,_result:I},_init:B}},St.memo=function(I,z){return{$$typeof:p,type:I,compare:z===void 0?null:z}},St.startTransition=function(I){var z=N.transition;N.transition={};try{I()}finally{N.transition=z}},St.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},St.useCallback=function(I,z){return M.current.useCallback(I,z)},St.useContext=function(I){return M.current.useContext(I)},St.useDebugValue=function(){},St.useDeferredValue=function(I){return M.current.useDeferredValue(I)},St.useEffect=function(I,z){return M.current.useEffect(I,z)},St.useId=function(){return M.current.useId()},St.useImperativeHandle=function(I,z,J){return M.current.useImperativeHandle(I,z,J)},St.useInsertionEffect=function(I,z){return M.current.useInsertionEffect(I,z)},St.useLayoutEffect=function(I,z){return M.current.useLayoutEffect(I,z)},St.useMemo=function(I,z){return M.current.useMemo(I,z)},St.useReducer=function(I,z,J){return M.current.useReducer(I,z,J)},St.useRef=function(I){return M.current.useRef(I)},St.useState=function(I){return M.current.useState(I)},St.useSyncExternalStore=function(I,z,J){return M.current.useSyncExternalStore(I,z,J)},St.useTransition=function(){return M.current.useTransition()},St.version="18.2.0",St}var Jw;function Pv(){return Jw||(Jw=1,zm.exports=J_()),zm.exports}/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Zw;function Z_(){if(Zw)return Oc;Zw=1;var e=Pv(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var h,m={},v=null,x=null;p!==void 0&&(v=""+p),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!i.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:v,ref:x,props:m,_owner:o.current}}return Oc.Fragment=n,Oc.jsx=l,Oc.jsxs=l,Oc}var e1;function eD(){return e1||(e1=1,Fm.exports=Z_()),Fm.exports}var s=eD(),Wo=function(){return Wo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Wo.apply(this,arguments)};function mC(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function tD(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var g=Pv();const xn=Tv(g),nD=X_({__proto__:null,default:xn},[g]);var hf="right-scroll-bar-position",mf="width-before-scroll-bar",rD="with-scroll-bars-hidden",oD="--removed-body-scroll-bar-size";function Vm(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function iD(e,t){var n=g.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var sD=typeof window<"u"?g.useLayoutEffect:g.useEffect,t1=new WeakMap;function aD(e,t){var n=iD(null,function(r){return e.forEach(function(o){return Vm(o,r)})});return sD(function(){var r=t1.get(n);if(r){var o=new Set(r),i=new Set(e),l=n.current;o.forEach(function(u){i.has(u)||Vm(u,null)}),i.forEach(function(u){o.has(u)||Vm(u,l)})}t1.set(n,e)},[e]),n}function lD(e){return e}function cD(e,t){t===void 0&&(t=lD);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var l=t(i,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(i){for(r=!0;n.length;){var l=n;n=[],l.forEach(i)}n={push:function(u){return i(u)},filter:function(){return n}}},assignMedium:function(i){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(i),l=n}var d=function(){var h=l;l=[],h.forEach(i)},p=function(){return Promise.resolve().then(d)};p(),n={push:function(h){l.push(h),p()},filter:function(h){return l=l.filter(h),n}}}};return o}function uD(e){e===void 0&&(e={});var t=cD(null);return t.options=Wo({async:!0,ssr:!1},e),t}var gC=function(e){var t=e.sideCar,n=mC(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 g.createElement(r,Wo({},n))};gC.isSideCarExport=!0;function dD(e,t){return e.useMedium(t),gC}var vC=uD(),Bm=function(){},tp=g.forwardRef(function(e,t){var n=g.useRef(null),r=g.useState({onScrollCapture:Bm,onWheelCapture:Bm,onTouchMoveCapture:Bm}),o=r[0],i=r[1],l=e.forwardProps,u=e.children,d=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,x=e.noIsolation,b=e.inert,w=e.allowPinchZoom,j=e.as,T=j===void 0?"div":j,R=e.gapMode,E=mC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,P=aD([n,t]),D=Wo(Wo({},E),o);return g.createElement(g.Fragment,null,h&&g.createElement(C,{sideCar:vC,removeScrollBar:p,shards:m,noIsolation:x,inert:b,setCallbacks:i,allowPinchZoom:!!w,lockRef:n,gapMode:R}),l?g.cloneElement(g.Children.only(u),Wo(Wo({},D),{ref:P})):g.createElement(T,Wo({},D,{className:d,ref:P}),u))});tp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};tp.classNames={fullWidth:mf,zeroRight:hf};var fD=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function pD(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=fD();return t&&e.setAttribute("nonce",t),e}function hD(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function mD(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var gD=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pD())&&(hD(t,n),mD(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vD=function(){var e=gD();return function(t,n){g.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},yC=function(){var e=vD(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},yD={left:0,top:0,right:0,gap:0},Um=function(e){return parseInt(e||"",10)||0},xD=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Um(n),Um(r),Um(o)]},bD=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return yD;var t=xD(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])}},wD=yC(),wl="data-scroll-locked",SD=function(e,t,n,r){var o=e.left,i=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
+
.`.concat(rD,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(u,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(wl,`] {
|
|
23
|
+
overflow: hidden `).concat(r,`;
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
26
|
+
padding-left: `.concat(o,`px;
|
|
27
|
+
padding-top: `).concat(i,`px;
|
|
28
|
+
padding-right: `).concat(l,`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(hf,` {
|
|
36
|
+
right: `).concat(u,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(mf,` {
|
|
40
|
+
margin-right: `).concat(u,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(hf," .").concat(hf,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(mf," .").concat(mf,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(wl,`] {
|
|
52
|
+
`).concat(oD,": ").concat(u,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},n1=function(){var e=parseInt(document.body.getAttribute(wl)||"0",10);return isFinite(e)?e:0},jD=function(){g.useEffect(function(){return document.body.setAttribute(wl,(n1()+1).toString()),function(){var e=n1()-1;e<=0?document.body.removeAttribute(wl):document.body.setAttribute(wl,e.toString())}},[])},CD=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;jD();var i=g.useMemo(function(){return bD(o)},[o]);return g.createElement(wD,{styles:SD(i,!t,o,n?"":"!important")})},Mg=!1;if(typeof window<"u")try{var Yd=Object.defineProperty({},"passive",{get:function(){return Mg=!0,!0}});window.addEventListener("test",Yd,Yd),window.removeEventListener("test",Yd,Yd)}catch{Mg=!1}var ol=Mg?{passive:!1}:!1,ED=function(e){return e.tagName==="TEXTAREA"},xC=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!ED(e)&&n[t]==="visible")},kD=function(e){return xC(e,"overflowY")},TD=function(e){return xC(e,"overflowX")},r1=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=bC(e,r);if(o){var i=wC(e,r),l=i[1],u=i[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},PD=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},RD=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},bC=function(e,t){return e==="v"?kD(t):TD(t)},wC=function(e,t){return e==="v"?PD(t):RD(t)},_D=function(e,t){return e==="h"&&t==="rtl"?-1:1},DD=function(e,t,n,r,o){var i=_D(e,window.getComputedStyle(t).direction),l=i*r,u=n.target,d=t.contains(u),p=!1,h=l>0,m=0,v=0;do{var x=wC(e,u),b=x[0],w=x[1],j=x[2],T=w-j-i*b;(b||T)&&bC(e,u)&&(m+=T,v+=b),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(m)<1||!h&&Math.abs(v)<1)&&(p=!0),p},Xd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},o1=function(e){return[e.deltaX,e.deltaY]},i1=function(e){return e&&"current"in e?e.current:e},ID=function(e,t){return e[0]===t[0]&&e[1]===t[1]},AD=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},ND=0,il=[];function OD(e){var t=g.useRef([]),n=g.useRef([0,0]),r=g.useRef(),o=g.useState(ND++)[0],i=g.useState(yC)[0],l=g.useRef(e);g.useEffect(function(){l.current=e},[e]),g.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var w=tD([e.lockRef.current],(e.shards||[]).map(i1),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var u=g.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var T=Xd(w),R=n.current,E="deltaX"in w?w.deltaX:R[0]-T[0],C="deltaY"in w?w.deltaY:R[1]-T[1],P,D=w.target,A=Math.abs(E)>Math.abs(C)?"h":"v";if("touches"in w&&A==="h"&&D.type==="range")return!1;var O=r1(A,D);if(!O)return!0;if(O?P=A:(P=A==="v"?"h":"v",O=r1(A,D)),!O)return!1;if(!r.current&&"changedTouches"in w&&(E||C)&&(r.current=P),!P)return!0;var L=r.current||P;return DD(L,j,w,L==="h"?E:C)},[]),d=g.useCallback(function(w){var j=w;if(!(!il.length||il[il.length-1]!==i)){var T="deltaY"in j?o1(j):Xd(j),R=t.current.filter(function(P){return P.name===j.type&&(P.target===j.target||j.target===P.shadowParent)&&ID(P.delta,T)})[0];if(R&&R.should){j.cancelable&&j.preventDefault();return}if(!R){var E=(l.current.shards||[]).map(i1).filter(Boolean).filter(function(P){return P.contains(j.target)}),C=E.length>0?u(j,E[0]):!l.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),p=g.useCallback(function(w,j,T,R){var E={name:w,delta:j,target:T,should:R,shadowParent:MD(T)};t.current.push(E),setTimeout(function(){t.current=t.current.filter(function(C){return C!==E})},1)},[]),h=g.useCallback(function(w){n.current=Xd(w),r.current=void 0},[]),m=g.useCallback(function(w){p(w.type,o1(w),w.target,u(w,e.lockRef.current))},[]),v=g.useCallback(function(w){p(w.type,Xd(w),w.target,u(w,e.lockRef.current))},[]);g.useEffect(function(){return il.push(i),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",d,ol),document.addEventListener("touchmove",d,ol),document.addEventListener("touchstart",h,ol),function(){il=il.filter(function(w){return w!==i}),document.removeEventListener("wheel",d,ol),document.removeEventListener("touchmove",d,ol),document.removeEventListener("touchstart",h,ol)}},[]);var x=e.removeScrollBar,b=e.inert;return g.createElement(g.Fragment,null,b?g.createElement(i,{styles:AD(o)}):null,x?g.createElement(CD,{gapMode:e.gapMode}):null)}function MD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const LD=dD(vC,OD);var kl=g.forwardRef(function(e,t){return g.createElement(tp,Wo({},e,{ref:t,sideCar:LD}))});kl.classNames=tp.classNames;function Xt(e){return Object.keys(e)}function Wm(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Rv(e,t){const n={...e},r=t;return Wm(e)&&Wm(t)&&Object.keys(t).forEach(o=>{Wm(r[o])&&o in e?n[o]=Rv(n[o],r[o]):n[o]=r[o]}),n}function $D(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function FD(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 Xc(e){const t=FD(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 Hm(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function SC(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?Hm(o):o}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(i=>n(i)).join(",");if(r.includes(" "))return r.split(" ").map(i=>n(i)).join(" ");if(r.includes(e))return t?Hm(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?Hm(i):i}}return r}return n}const ie=SC("rem",{shouldScale:!0}),Cf=SC("em");function bs(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function jC(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 Pi(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==g.Fragment:!1}function dr(e){const t=g.createContext(null);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>{const o=g.useContext(t);if(o===null)throw new Error(e);return o}]}function Ri(e=null){const t=g.createContext(e);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>g.useContext(t)]}function s1(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Ef(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function zD(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 VD(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 BD(e,t,n){return Ef(e,n)===Ef(t,n)}function CC({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:l}){return u=>{var b;n==null||n(u);const d=Array.from(((b=Ef(u.currentTarget,e))==null?void 0:b.querySelectorAll(t))||[]).filter(w=>BD(u.currentTarget,w,e)),p=d.findIndex(w=>u.currentTarget===w),h=VD(p,d,r),m=zD(p,d,r),v=i==="rtl"?m:h,x=i==="rtl"?h:m;switch(u.key){case"ArrowRight":{l==="horizontal"&&(u.stopPropagation(),u.preventDefault(),d[v].focus(),o&&d[v].click());break}case"ArrowLeft":{l==="horizontal"&&(u.stopPropagation(),u.preventDefault(),d[x].focus(),o&&d[x].click());break}case"ArrowUp":{l==="vertical"&&(u.stopPropagation(),u.preventDefault(),d[m].focus(),o&&d[m].click());break}case"ArrowDown":{l==="vertical"&&(u.stopPropagation(),u.preventDefault(),d[h].focus(),o&&d[h].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!d[0].disabled&&d[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const w=d.length-1;!d[w].disabled&&d[w].focus();break}}}}const UD={app:100,modal:200,popover:300,overlay:400,max:9999};function Br(e){return UD[e]}const kf=()=>{};function WD(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||kf:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function ot(e,t="size",n=!0){if(e!==void 0)return jC(e)?n?ie(e):e:`var(--${t}-${e})`}function Rn(e){return ot(e,"mantine-spacing")}function Mt(e){return e===void 0?"var(--mantine-radius-default)":ot(e,"mantine-radius")}function _n(e){return ot(e,"mantine-font-size")}function EC(e){return ot(e,"mantine-line-height",!1)}function _v(e){if(e)return ot(e,"mantine-shadow",!1)}function wr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function Dv(e,t){return e in t?Xc(t[e]):Xc(e)}function Jc(e,t){const n=e.map(r=>({value:r,px:Dv(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function jo(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function HD(e,t,n){var r;return n?Array.from(((r=Ef(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function qD(){const[e,t]=g.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Jd(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 Tf(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function GD(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 o=0;o<r;o+=1){const i=n[o];if(!(i in t)||e[i]!==t[i])return!1}return!0}function a1(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Qs(e){const t=g.useRef(e);return g.useEffect(()=>{t.current=e}),g.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}const QD=()=>{};function np(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,o=Qs(e),i=g.useRef(0),l=Object.assign(g.useCallback((...u)=>{window.clearTimeout(i.current);const d=()=>{i.current!==0&&(i.current=0,o(...u))};l.flush=d,i.current=window.setTimeout(d,n)},[o,n]),{flush:QD});return g.useEffect(()=>()=>{window.clearTimeout(i.current),r&&l.flush()},[l,r]),l}const l1=["mousedown","touchstart"];function KD(e,t,n){const r=g.useRef(null);return g.useEffect(()=>{const o=i=>{const{target:l}=i??{};if(Array.isArray(n)){const u=(l==null?void 0:l.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(l)&&l.tagName!=="HTML";n.every(p=>!!p&&!i.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(l)&&e()};return(t||l1).forEach(i=>document.addEventListener(i,o)),()=>{(t||l1).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function kC({timeout:e=2e3}={}){const[t,n]=g.useState(null),[r,o]=g.useState(!1),[i,l]=g.useState(null),u=h=>{window.clearTimeout(i),l(window.setTimeout(()=>o(!1),e)),o(h)};return{copy:h=>{"clipboard"in navigator?navigator.clipboard.writeText(h).then(()=>u(!0)).catch(m=>n(m)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(i)},error:t,copied:r}}function YD(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function XD(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function TC(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=g.useState(n?t:XD(e)),i=g.useRef(null);return g.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),YD(i.current,l=>o(l.matches))},[e]),r}function JD(e,t){return TC("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const $l=typeof document<"u"?g.useLayoutEffect:g.useEffect;function wi(e,t){const n=g.useRef(!1);g.useEffect(()=>()=>{n.current=!1},[]),g.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function PC({opened:e,shouldReturnFocus:t=!0}){const n=g.useRef(null),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return wi(()=>{let o=-1;const i=l=>{l.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}const ZD=/input|select|textarea|button|object/,RC="a, input, select, textarea, button, object, [tabindex]";function eI(e){return e.style.display==="none"}function tI(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(eI(n))return!1;n=n.parentNode}return!0}function _C(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Lg(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(_C(e));return(ZD.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&tI(e)}function DC(e){const t=_C(e);return(Number.isNaN(t)||t>=0)&&Lg(e)}function nI(e){return Array.from(e.querySelectorAll(RC)).filter(DC)}function rI(e,t){const n=nI(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const l=o.activeElement;if(l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(i=n.filter(h=>h.getAttribute("type")==="radio"&&h.getAttribute("name")===l.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const d=n[t.shiftKey?n.length-1:0];d&&d.focus()}function oI(e=!0){const t=g.useRef(null),n=o=>{let i=o.querySelector("[data-autofocus]");if(!i){const l=Array.from(o.querySelectorAll(RC));i=l.find(DC)||l.find(Lg)||null,!i&&Lg(o)&&(i=o)}i&&i.focus({preventScroll:!0})},r=g.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return g.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=i=>{i.key==="Tab"&&t.current&&rI(t.current,i)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const iI=e=>(e+1)%1e6;function sI(){const[,e]=g.useReducer(iI,0);return e}const aI=xn.useId||(()=>{});function lI(){const e=aI();return e?`mantine-${e.replace(/:/g,"")}`:""}function fr(e){const t=lI(),[n,r]=g.useState(t);return $l(()=>{r(Tf())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function IC(e,t,n){g.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Zc(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function cI(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=Zc(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o?o():Zc(r,null)}),t.clear()}}}function An(...e){return g.useCallback(cI(...e),e)}function Bn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=g.useState(t!==void 0?t:n),l=(u,...d)=>{i(u),r==null||r(u,...d)};return e!==void 0?[e,r,!0]:[o,l,!1]}function as(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Zd="dots";function uI({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const l=Math.max(Math.trunc(e),0),[u,d]=Bn({value:r,onChange:i,defaultValue:o,finalValue:o}),p=w=>{w<=0?d(1):w>l?d(l):d(w)},h=()=>p(u+1),m=()=>p(u-1),v=()=>p(1),x=()=>p(l);return{range:g.useMemo(()=>{if(t*2+3+n*2>=l)return as(1,l);const j=Math.max(u-t,n),T=Math.min(u+t,l-n),R=j>n+2,E=T<l-(n+1);if(!R&&E){const C=t*2+n+2;return[...as(1,C),Zd,...as(l-(n-1),l)]}if(R&&!E){const C=n+1+2*t;return[...as(1,n),Zd,...as(l-C,l)]}return[...as(1,n),Zd,...as(j,T),Zd,...as(l-n+1,l)]},[l,t,u]),active:u,setPage:p,next:h,previous:m,first:v,last:x}}function Iv(e,t){return TC("(prefers-reduced-motion: reduce)",e,t)}function dI(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(!GD(e[n],t[n]))return!1;return!0}function fI(e){const t=g.useRef([]),n=g.useRef(0);return dI(t.current,e)||(t.current=e,n.current+=1),[n.current]}function pI(e,t){g.useEffect(e,fI(t))}function rp(e=!1,t){const{onOpen:n,onClose:r}={},[o,i]=g.useState(e),l=g.useCallback(()=>{i(p=>p||(n==null||n(),!0))},[n]),u=g.useCallback(()=>{i(p=>p&&(r==null||r(),!1))},[r]),d=g.useCallback(()=>{o?u():l()},[u,l,o]);return[o,{open:l,close:u,toggle:d}]}function hI(e,t,n={autoInvoke:!1}){const r=g.useRef(null),o=g.useCallback((...l)=>{r.current||(r.current=window.setTimeout(()=>{e(l),r.current=null},t))},[t]),i=g.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return g.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}function mI(e,t,n){const r=g.useRef(null),o=g.useRef(null);return g.useEffect(()=>{const i=typeof n=="function"?n():n;return(i||o.current)&&(r.current=new MutationObserver(e),r.current.observe(i||o.current,t)),()=>{var l;(l=r.current)==null||l.disconnect()}},[e,t]),o}function gI(){const[e,t]=g.useState(!1);return g.useEffect(()=>t(!0),[]),e}var vI={};function AC(){return typeof process<"u"&&vI?"production":"development"}function op(e){var n;const t=xn.version;return typeof xn.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function NC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=NC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function At(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=NC(e))&&(r&&(r+=" "),r+=t);return r}const yI={};function xI(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=At(t[r],o):t[r]=o})}),t}function ip({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(l=>typeof l=="function"?l(e,n,r):l||yI);return xI(i)}function Pf({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,l)=>typeof l=="function"?{...i,...l(e,n,r)}:{...i,...l},{})}const Av=g.createContext(null);function _i(){const e=g.useContext(Av);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function bI(){return _i().cssVariablesResolver}function wI(){return _i().classNamesPrefix}function sp(){return _i().getStyleNonce}function SI(){return _i().withStaticClasses}function jI(){return _i().headless}function CI(){var e;return(e=_i().stylesTransform)==null?void 0:e.sx}function EI(){var e;return(e=_i().stylesTransform)==null?void 0:e.styles}function OC(){return _i().env||"default"}function kI(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function TI(e){let t=e.replace("#","");if(t.length===3){const l=t.split("");t=[l[0],l[0],l[1],l[1],l[2],l[2]].join("")}if(t.length===8){const l=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:l}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function PI(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function RI(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,i=parseInt(n[3],10)/100,l=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*i-1))*o,d=r/60,p=u*(1-Math.abs(d%2-1)),h=i-u/2;let m,v,x;return d>=0&&d<1?(m=u,v=p,x=0):d>=1&&d<2?(m=p,v=u,x=0):d>=2&&d<3?(m=0,v=u,x=p):d>=3&&d<4?(m=0,v=p,x=u):d>=4&&d<5?(m=p,v=0,x=u):(m=u,v=0,x=p),{r:Math.round((m+h)*255),g:Math.round((v+h)*255),b:Math.round((x+h)*255),a:l||1}}function Nv(e){return kI(e)?TI(e):e.startsWith("rgb")?PI(e):e.startsWith("hsl")?RI(e):{r:0,g:0,b:0,a:1}}function ef(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Nv(e),l=1-t,u=d=>Math.round(d*l);return`rgba(${u(n)}, ${u(r)}, ${u(o)}, ${i})`}function eu(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function qm(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function _I(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function DI(e){if(e.startsWith("oklch("))return(_I(e)||0)/100;const{r:t,g:n,b:r}=Nv(e),o=t/255,i=n/255,l=r/255,u=qm(o),d=qm(i),p=qm(l);return .2126*u+.7152*d+.0722*p}function Mc(e,t=.179){return e.startsWith("var(")?!1:DI(e)>t}function ro({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:Mc(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:Mc(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:Mc(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,l=r in t.colors;if(l){const u=i!==void 0?t.colors[r][i]:t.colors[r][eu(t,n||"light")];return{color:r,value:u,shade:i,isThemeColor:l,isLight:Mc(u,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:l,isLight:Mc(e,t.luminanceThreshold),shade:i,variable:void 0}}function Lt(e,t){const n=ro({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function $g(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=Lt(n.from,t),o=Lt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function eo(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const i=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${i}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=Nv(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const sl=eo,II=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=ro({color:e,theme:t}),l=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const u=l&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?i.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${ie(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${i.shade===9?8:i.shade+1})`,color:u,border:`${ie(1)} solid transparent`}:{background:e,hover:ef(e,.1),color:u,border:`${ie(1)} solid transparent`}}if(n==="light"){if(i.isThemeColor){if(i.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${ie(1)} solid transparent`};const u=t.colors[i.color][i.shade];return{background:eo(u,.1),hover:eo(u,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${ie(1)} solid transparent`}}return{background:eo(e,.1),hover:eo(e,.12),color:e,border:`${ie(1)} solid transparent`}}if(n==="outline")return i.isThemeColor?i.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${ie(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:eo(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${ie(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:eo(e,.05),color:e,border:`${ie(1)} solid ${e}`};if(n==="subtle"){if(i.isThemeColor){if(i.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${ie(1)} solid transparent`};const u=t.colors[i.color][i.shade];return{background:"transparent",hover:eo(u,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${ie(1)} solid transparent`}}return{background:"transparent",hover:eo(e,.12),color:e,border:`${ie(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${ie(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${ie(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${ie(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:ef(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${ie(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:ef(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${ie(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:ef(t.white,.01),color:e,border:`${ie(1)} solid transparent`}:n==="gradient"?{background:$g(r,t),hover:$g(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:`${ie(1)} solid var(--mantine-color-default-border)`}:{}},AI={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"]},c1="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Ov={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:AI,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:II,autoContrast:!1,luminanceThreshold:.3,fontFamily:c1,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:c1,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:ie(34),lineHeight:"1.3"},h2:{fontSize:ie(26),lineHeight:"1.35"},h3:{fontSize:ie(22),lineHeight:"1.4"},h4:{fontSize:ie(18),lineHeight:"1.45"},h5:{fontSize:ie(16),lineHeight:"1.5"},h6:{fontSize:ie(14),lineHeight:"1.5"}}},fontSizes:{xs:ie(12),sm:ie(14),md:ie(16),lg:ie(18),xl:ie(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:ie(2),sm:ie(4),md:ie(8),lg:ie(16),xl:ie(32)},spacing:{xs:ie(10),sm:ie(12),md:ie(16),lg:ie(20),xl:ie(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${ie(1)} ${ie(3)} rgba(0, 0, 0, 0.05), 0 ${ie(1)} ${ie(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${ie(1)} ${ie(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ie(10)} ${ie(15)} ${ie(-5)}, rgba(0, 0, 0, 0.04) 0 ${ie(7)} ${ie(7)} ${ie(-5)}`,md:`0 ${ie(1)} ${ie(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ie(20)} ${ie(25)} ${ie(-5)}, rgba(0, 0, 0, 0.04) 0 ${ie(10)} ${ie(10)} ${ie(-5)}`,lg:`0 ${ie(1)} ${ie(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ie(28)} ${ie(23)} ${ie(-7)}, rgba(0, 0, 0, 0.04) 0 ${ie(12)} ${ie(12)} ${ie(-7)}`,xl:`0 ${ie(1)} ${ie(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${ie(36)} ${ie(28)} ${ie(-7)}, rgba(0, 0, 0, 0.04) 0 ${ie(17)} ${ie(17)} ${ie(-7)}`},other:{},components:{}};function u1(e){return e==="auto"||e==="dark"||e==="light"}function NI({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 u1(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&&u1(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const OI="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",d1="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Gm(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function f1(e){if(!(e.primaryColor in e.colors))throw new Error(OI);if(typeof e.primaryShade=="object"&&(!Gm(e.primaryShade.dark)||!Gm(e.primaryShade.light)))throw new Error(d1);if(typeof e.primaryShade=="number"&&!Gm(e.primaryShade))throw new Error(d1)}function MI(e,t){var r;if(!t)return f1(e),e;const n=Rv(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),f1(n),n}const Mv=g.createContext(null),LI=()=>g.useContext(Mv)||Ov;function mn(){const e=g.useContext(Mv);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 MC({theme:e,children:t,inherit:n=!0}){const r=LI(),o=g.useMemo(()=>MI(n?r:Ov,e),[e,r,n]);return s.jsx(Mv.Provider,{value:o,children:t})}MC.displayName="@mantine/core/MantineThemeProvider";function $I(){const e=mn(),t=sp(),n=Xt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),l=Xc(e.breakpoints[o]),u=i?`${l-.1}px`:Cf(l-.1),d=i?`${l}px`:Cf(l);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${d}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function Qm(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Lc(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function FI(e,t){const n=Qm(e.variables),r=n?Lc(t,n):"",o=Qm(e.dark),i=Qm(e.light),l=o?Lc(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",u=i?Lc(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,i):"";return`${r}${l}${u}`}function Di({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&ro({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function p1(e,t){return Di({color:e.colors[e.primaryColor][eu(e,t)],theme:e,autoContrast:null})}function tf({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const u=eu(e,"light"),d={[`--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`]:sl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:sl(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`]:sl(e.colors[t][u],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...d}:d}const i=eu(e,"dark"),l={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${i===9?8:i+1})`,[`--mantine-color-${r}-light`]:sl(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:sl(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:sl(e.colors[t][Math.max(i-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...l}:l}function zI(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function al(e,t,n){Xt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const LC=e=>{const t=eu(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:ie(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":p1(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":p1(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)"}};al(r.variables,e.breakpoints,"breakpoint"),al(r.variables,e.spacing,"spacing"),al(r.variables,e.fontSizes,"font-size"),al(r.variables,e.lineHeights,"line-height"),al(r.variables,e.shadows,"shadow"),al(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,l)=>{r.variables[`--mantine-primary-color-${l}`]=`var(--mantine-color-${e.primaryColor}-${l})`}),Xt(e.colors).forEach(i=>{const l=e.colors[i];if(zI(l)){Object.assign(r.light,tf({theme:e,name:l.name,color:l.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,tf({theme:e,name:l.name,color:l.dark,colorScheme:"dark",withColorValues:!0}));return}l.forEach((u,d)=>{r.variables[`--mantine-color-${i}-${d}`]=u}),Object.assign(r.light,tf({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,tf({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return Xt(o).forEach(i=>{r.variables[`--mantine-${i}-font-size`]=o[i].fontSize,r.variables[`--mantine-${i}-line-height`]=o[i].lineHeight,r.variables[`--mantine-${i}-font-weight`]=o[i].fontWeight||e.headings.fontWeight}),r};function VI({theme:e,generator:t}){const n=LC(e),r=t==null?void 0:t(e);return r?Rv(n,r):n}const Km=LC(Ov);function BI(e){const t={variables:{},light:{},dark:{}};return Xt(e.variables).forEach(n=>{Km.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Xt(e.light).forEach(n=>{Km.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Xt(e.dark).forEach(n=>{Km.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function UI(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 $C({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=mn(),r=sp(),o=bI(),i=VI({theme:n,generator:o}),l=e===":root"&&t,u=l?BI(i):i,d=FI(u,e);return d?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${d}${l?"":UI(e)}`}}):null}$C.displayName="@mantine/CssVariables";function WI(){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 ll(e,t){var o,i;const n=typeof window<"u"&&"matchMedia"in window&&((o=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:o.matches),r=e!=="auto"?e:n?"dark":"light";(i=t())==null||i.setAttribute("data-mantine-color-scheme",r)}function HI({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=g.useRef(null),[i,l]=g.useState(()=>e.get(t)),u=r||i,d=g.useCallback(h=>{r||(ll(h,n),l(h),e.set(h))},[e.set,u,r]),p=g.useCallback(()=>{l(t),ll(t,n),e.clear()},[e.clear,t]);return g.useEffect(()=>(e.subscribe(d),e.unsubscribe),[e.subscribe,e.unsubscribe]),$l(()=>{ll(e.get(t),n)},[]),g.useEffect(()=>{var m;if(r)return ll(r,n),()=>{};r===void 0&&ll(i,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const h=v=>{i==="auto"&&ll(v.matches?"dark":"light",n)};return(m=o.current)==null||m.addEventListener("change",h),()=>{var v;return(v=o.current)==null?void 0:v.removeEventListener("change",h)}},[i,r]),{colorScheme:u,setColorScheme:d,clearColorScheme:p}}function qI({respectReducedMotion:e,getRootElement:t}){$l(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}WI();function FC({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:l=!0,cssVariablesSelector:u=":root",classNamesPrefix:d="mantine",colorSchemeManager:p=NI(),defaultColorScheme:h="light",getRootElement:m=()=>document.documentElement,cssVariablesResolver:v,forceColorScheme:x,stylesTransform:b,env:w}){const{colorScheme:j,setColorScheme:T,clearColorScheme:R}=HI({defaultColorScheme:h,forceColorScheme:x,manager:p,getRootElement:m});return qI({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:m}),s.jsx(Av.Provider,{value:{colorScheme:j,setColorScheme:T,clearColorScheme:R,getRootElement:m,classNamesPrefix:d,getStyleNonce:n,cssVariablesResolver:v,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:b,env:w},children:s.jsxs(MC,{theme:e,children:[l&&s.jsx($C,{cssVariablesSelector:u,deduplicateCssVariables:i}),o&&s.jsx($I,{}),t]})})}FC.displayName="@mantine/core/MantineProvider";function va({classNames:e,styles:t,props:n,stylesCtx:r}){const o=mn();return{resolvedClassNames:ip({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Pf({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const GI={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function QI({theme:e,options:t,unstyled:n}){return At((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||GI[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function KI({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return ip({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function h1({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return ip({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function YI({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function XI({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function JI({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function ZI({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var l,u;return(u=ip({theme:t,classNames:(l=t.components[i])==null?void 0:l.classNames,props:r,stylesCtx:o}))==null?void 0:u[n]})}function eA({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function tA({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:l,unstyled:u,className:d,rootSelector:p,props:h,stylesCtx:m,withStaticClasses:v,headless:x,transformedStyles:b}){return At(QI({theme:e,options:t,unstyled:u||x}),ZI({theme:e,themeName:n,selector:r,props:h,stylesCtx:m}),eA({options:t,classes:l,selector:r,unstyled:u}),h1({selector:r,stylesCtx:m,theme:e,classNames:i,props:h}),h1({selector:r,stylesCtx:m,theme:e,classNames:b,props:h}),KI({selector:r,stylesCtx:m,options:t,props:h,theme:e}),YI({rootSelector:p,selector:r,className:d}),XI({selector:r,classes:l,unstyled:u||x}),v&&!x&&JI({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function nA({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var l;return Pf({theme:e,styles:(l=e.components[i])==null?void 0:l.styles,props:n,stylesCtx:r})[o]}).reduce((i,l)=>({...i,...l}),{})}function Fg({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Fg({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function rA(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...bs(n[r])}}),t),{})}function oA({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:l,headless:u}){var d;return(d=rA([u?{}:t==null?void 0:t(n,r,o),...l.map(p=>{var h,m,v;return(v=(m=(h=n.components)==null?void 0:h[p])==null?void 0:m.vars)==null?void 0:v.call(m,n,r,o)}),e==null?void 0:e(n,r,o)]))==null?void 0:d[i]}function iA({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:l,styles:u,style:d,vars:p,varsResolver:h,headless:m,withStylesTransform:v}){return{...!v&&nA({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!v&&Pf({theme:e,styles:u,props:o,stylesCtx:i})[n],...!v&&Pf({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...oA({theme:e,props:o,stylesCtx:i,vars:p,varsResolver:h,selector:n,themeName:t,headless:m}),...l===n?Fg({style:d,theme:e}):null,...Fg({style:r==null?void 0:r.style,theme:e})}}function sA({props:e,stylesCtx:t,themeName:n}){var l;const r=mn(),o=(l=EI())==null?void 0:l();return{getTransformedStyles:u=>o?[...u.map(p=>o(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var h;return o((h=r.components[p])==null?void 0:h.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!o}}function Le({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:l="root",unstyled:u,classNames:d,styles:p,vars:h,varsResolver:m}){const v=mn(),x=wI(),b=SI(),w=jI(),j=(Array.isArray(e)?e:[e]).filter(E=>E),{withStylesTransform:T,getTransformedStyles:R}=sA({props:n,stylesCtx:r,themeName:j});return(E,C)=>({className:tA({theme:v,options:C,themeName:j,selector:E,classNamesPrefix:x,classNames:d,classes:t,unstyled:u,className:o,rootSelector:l,props:n,stylesCtx:r,withStaticClasses:b,headless:w,transformedStyles:R([C==null?void 0:C.styles,p])}),style:iA({theme:v,themeName:j,selector:E,options:C,props:n,stylesCtx:r,rootSelector:l,styles:p,style:i,vars:h,varsResolver:m,headless:w,withStylesTransform:T})})}function ya(e,t){return typeof e=="boolean"?e:t.autoContrast}function m1(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 aA({keepTransitions:e}={}){const t=g.useRef(kf),n=g.useRef(-1),r=g.useContext(Av),o=sp(),i=g.useRef(o==null?void 0:o());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const l=m=>{r.setColorScheme(m),t.current=e?()=>{}:m1(i.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?()=>{}:m1(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var m;(m=t.current)==null||m.call(t)},10)},d=JD("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?d:r.colorScheme,h=g.useCallback(()=>l(p==="light"?"dark":"light"),[l,p]);return g.useEffect(()=>()=>{var m;(m=t.current)==null||m.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:l,clearColorScheme:u,toggleColorScheme:h}}function oe(e,t,n){var l;const r=mn(),o=(l=r.components[e])==null?void 0:l.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...bs(n)}}function Ym(e){return Xt(e).reduce((t,n)=>e[n]!==void 0?`${t}${$D(n)}:${e[n]};`:t,"").trim()}function lA({selector:e,styles:t,media:n,container:r}){const o=t?Ym(t):"",i=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Ym(u.styles)}}}`):[],l=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Ym(u.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${l.join("")}`.trim()}function xa(e){const t=sp();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:lA(e)}})}function Ii(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:l,mr:u,me:d,ms:p,p:h,px:m,py:v,pt:x,pb:b,pl:w,pr:j,pe:T,ps:R,bd:E,bg:C,c:P,opacity:D,ff:A,fz:O,fw:L,lts:V,ta:q,lh:G,fs:Q,tt:Y,td:X,w:B,miw:M,maw:N,h:F,mih:I,mah:z,bgsz:J,bgp:ae,bgr:je,bga:ge,pos:Ce,top:Re,left:ke,bottom:_e,right:$e,inset:yt,display:Ft,flex:gt,hiddenFrom:Tt,visibleFrom:Nt,lightHidden:Pt,darkHidden:be,sx:Ie,...Be}=e;return{styleProps:bs({m:t,mx:n,my:r,mt:o,mb:i,ml:l,mr:u,me:d,ms:p,p:h,px:m,py:v,pt:x,pb:b,pl:w,pr:j,pe:T,ps:R,bd:E,bg:C,c:P,opacity:D,ff:A,fz:O,fw:L,lts:V,ta:q,lh:G,fs:Q,tt:Y,td:X,w:B,miw:M,maw:N,h:F,mih:I,mah:z,bgsz:J,bgp:ae,bgr:je,bga:ge,pos:Ce,top:Re,left:ke,bottom:_e,right:$e,inset:yt,display:Ft,flex:gt,hiddenFrom:Tt,visibleFrom:Nt,lightHidden:Pt,darkHidden:be,sx:Ie}),rest:Be}}const cA={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 Lv(e,t){const n=ro({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 uA(e,t){const n=ro({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Lv(e,t)}function dA(e,t){if(typeof e=="number")return ie(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(l=>l.trim()!=="");let i=`${ie(n)}`;return r&&(i+=` ${r}`),o.length>0&&(i+=` ${Lv(o.join(" "),t)}`),i.trim()}return e}const g1={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 fA(e){return typeof e=="string"&&e in g1?g1[e]:e}const pA=["h1","h2","h3","h4","h5","h6"];function hA(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&pA.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?ie(e):e}function mA(e){return e}const gA=["h1","h2","h3","h4","h5","h6"];function vA(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&gA.includes(e)?`var(--mantine-${e}-line-height)`:e}function yA(e){return typeof e=="number"?ie(e):e}function xA(e,t){if(typeof e=="number")return ie(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return ie(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Xm={color:Lv,textColor:uA,fontSize:hA,spacing:xA,identity:mA,size:yA,lineHeight:vA,fontFamily:fA,border:dA};function v1(e){return e.replace("(min-width: ","").replace("em)","")}function bA({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(v1(o))-Number(v1(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function wA(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function SA(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function jA(e){return typeof e=="object"&&e!==null?Xt(e).filter(t=>t!=="base"):[]}function CA(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function zC({styleProps:e,data:t,theme:n}){return bA(Xt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const i=t[o],l=Array.isArray(i.property)?i.property:[i.property],u=SA(e[o]);if(!wA(e[o]))return l.forEach(p=>{r.inlineStyles[p]=Xm[i.type](u,n)}),r;r.hasResponsiveStyles=!0;const d=jA(e[o]);return l.forEach(p=>{u&&(r.styles[p]=Xm[i.type](u,n)),d.forEach(h=>{const m=`(min-width: ${n.breakpoints[h]})`;r.media[m]={...r.media[m],[p]:Xm[i.type](CA(e[o],h),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function hu(){return`__m__-${g.useId().replace(/:/g,"")}`}function VC(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...VC(r,t)}),{}):typeof e=="function"?e(t):e??{}}function BC(e){return e.startsWith("data-")?e:`data-${e}`}function EA(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[BC(n)]=e[n]),t},{})}function UC(e){return e?typeof e=="string"?{[BC(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...UC(n)}),{}):EA(e):null}function zg(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...zg(r,t)}),{}):typeof e=="function"?e(t):e??{}}function kA({theme:e,style:t,vars:n,styleProps:r}){const o=zg(t,e),i=zg(n,e);return{...o,...i,...r}}const WC=g.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:l,hiddenFrom:u,visibleFrom:d,lightHidden:p,darkHidden:h,renderRoot:m,__size:v,...x},b)=>{var O;const w=mn(),j=e||"div",{styleProps:T,rest:R}=Ii(x),E=CI(),C=(O=E==null?void 0:E())==null?void 0:O(T.sx),P=hu(),D=zC({styleProps:T,theme:w,data:cA}),A={ref:b,style:kA({theme:w,style:t,vars:n,styleProps:D.inlineStyles}),className:At(r,C,{[P]:D.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":h,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${d}`]:d}),"data-variant":o,"data-size":jC(l)?void 0:l||void 0,size:v,...UC(i),...R};return s.jsxs(s.Fragment,{children:[D.hasResponsiveStyles&&s.jsx(xa,{selector:`.${P}`,styles:D.styles,media:D.media}),typeof m=="function"?m(A):s.jsx(j,{...A})]})});WC.displayName="@mantine/core/Box";const se=WC;function HC(e){return e}function TA(e){const t=e;return n=>{const r=g.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ue(e){const t=g.forwardRef(e);return t.extend=HC,t.withProps=n=>{const r=g.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function nr(e){const t=g.forwardRef(e);return t.withProps=n=>{const r=g.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=HC,t}const PA=g.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function ba(){return g.useContext(PA)}var Jm={exports:{}},xr={},Zm={exports:{}},eg={};/**
|
|
61
|
+
* @license React
|
|
62
|
+
* scheduler.production.min.js
|
|
63
|
+
*
|
|
64
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
65
|
+
*
|
|
66
|
+
* This source code is licensed under the MIT license found in the
|
|
67
|
+
* LICENSE file in the root directory of this source tree.
|
|
68
|
+
*/var y1;function RA(){return y1||(y1=1,function(e){function t(N,F){var I=N.length;N.push(F);e:for(;0<I;){var z=I-1>>>1,J=N[z];if(0<o(J,F))N[z]=F,N[I]=J,I=z;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var F=N[0],I=N.pop();if(I!==F){N[0]=I;e:for(var z=0,J=N.length,ae=J>>>1;z<ae;){var je=2*(z+1)-1,ge=N[je],Ce=je+1,Re=N[Ce];if(0>o(ge,I))Ce<J&&0>o(Re,ge)?(N[z]=Re,N[Ce]=I,z=Ce):(N[z]=ge,N[je]=I,z=je);else if(Ce<J&&0>o(Re,I))N[z]=Re,N[Ce]=I,z=Ce;else break e}}return F}function o(N,F){var I=N.sortIndex-F.sortIndex;return I!==0?I:N.id-F.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,v=3,x=!1,b=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function E(N){for(var F=n(p);F!==null;){if(F.callback===null)r(p);else if(F.startTime<=N)r(p),F.sortIndex=F.expirationTime,t(d,F);else break;F=n(p)}}function C(N){if(w=!1,E(N),!b)if(n(d)!==null)b=!0,B(P);else{var F=n(p);F!==null&&M(C,F.startTime-N)}}function P(N,F){b=!1,w&&(w=!1,T(O),O=-1),x=!0;var I=v;try{for(E(F),m=n(d);m!==null&&(!(m.expirationTime>F)||N&&!q());){var z=m.callback;if(typeof z=="function"){m.callback=null,v=m.priorityLevel;var J=z(m.expirationTime<=F);F=e.unstable_now(),typeof J=="function"?m.callback=J:m===n(d)&&r(d),E(F)}else r(d);m=n(d)}if(m!==null)var ae=!0;else{var je=n(p);je!==null&&M(C,je.startTime-F),ae=!1}return ae}finally{m=null,v=I,x=!1}}var D=!1,A=null,O=-1,L=5,V=-1;function q(){return!(e.unstable_now()-V<L)}function G(){if(A!==null){var N=e.unstable_now();V=N;var F=!0;try{F=A(!0,N)}finally{F?Q():(D=!1,A=null)}}else D=!1}var Q;if(typeof R=="function")Q=function(){R(G)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,X=Y.port2;Y.port1.onmessage=G,Q=function(){X.postMessage(null)}}else Q=function(){j(G,0)};function B(N){A=N,D||(D=!0,Q())}function M(N,F){O=j(function(){N(e.unstable_now())},F)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(N){N.callback=null},e.unstable_continueExecution=function(){b||x||(b=!0,B(P))},e.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(N){switch(v){case 1:case 2:case 3:var F=3;break;default:F=v}var I=v;v=F;try{return N()}finally{v=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(N,F){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var I=v;v=N;try{return F()}finally{v=I}},e.unstable_scheduleCallback=function(N,F,I){var z=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?z+I:z):I=z,N){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=I+J,N={id:h++,callback:F,priorityLevel:N,startTime:I,expirationTime:J,sortIndex:-1},I>z?(N.sortIndex=I,t(p,N),n(d)===null&&N===n(p)&&(w?(T(O),O=-1):w=!0,M(C,I-z))):(N.sortIndex=J,t(d,N),b||x||(b=!0,B(P))),N},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(N){var F=v;return function(){var I=v;v=F;try{return N.apply(this,arguments)}finally{v=I}}}}(eg)),eg}var x1;function _A(){return x1||(x1=1,Zm.exports=RA()),Zm.exports}/**
|
|
69
|
+
* @license React
|
|
70
|
+
* react-dom.production.min.js
|
|
71
|
+
*
|
|
72
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
73
|
+
*
|
|
74
|
+
* This source code is licensed under the MIT license found in the
|
|
75
|
+
* LICENSE file in the root directory of this source tree.
|
|
76
|
+
*/var b1;function DA(){if(b1)return xr;b1=1;var e=Pv(),t=_A();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,o={};function i(a,c){l(a,c),l(a+"Capture",c)}function l(a,c){for(o[a]=c,a=0;a<c.length;a++)r.add(c[a])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[: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]*$/,h={},m={};function v(a){return d.call(m,a)?!0:d.call(h,a)?!1:p.test(a)?m[a]=!0:(h[a]=!0,!1)}function x(a,c,f,y){if(f!==null&&f.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return y?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,f,y){if(c===null||typeof c>"u"||x(a,c,f,y))return!0;if(y)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function w(a,c,f,y,S,k,_){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=y,this.attributeNamespace=S,this.mustUseProperty=f,this.propertyName=a,this.type=c,this.sanitizeURL=k,this.removeEmptyString=_}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){j[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];j[c]=new w(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){j[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){j[a]=new w(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){j[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){j[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){j[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){j[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){j[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var T=/[\-:]([a-z])/g;function R(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(T,R);j[c]=new w(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(T,R);j[c]=new w(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(T,R);j[c]=new w(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){j[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),j.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){j[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function E(a,c,f,y){var S=j.hasOwnProperty(c)?j[c]:null;(S!==null?S.type!==0:y||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(b(c,f,S,y)&&(f=null),y||S===null?v(c)&&(f===null?a.removeAttribute(c):a.setAttribute(c,""+f)):S.mustUseProperty?a[S.propertyName]=f===null?S.type===3?!1:"":f:(c=S.attributeName,y=S.attributeNamespace,f===null?a.removeAttribute(c):(S=S.type,f=S===3||S===4&&f===!0?"":""+f,y?a.setAttributeNS(y,c,f):a.setAttribute(c,f))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),D=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),V=Symbol.for("react.provider"),q=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),Q=Symbol.for("react.suspense"),Y=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),M=Symbol.for("react.offscreen"),N=Symbol.iterator;function F(a){return a===null||typeof a!="object"?null:(a=N&&a[N]||a["@@iterator"],typeof a=="function"?a:null)}var I=Object.assign,z;function J(a){if(z===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);z=c&&c[1]||""}return`
|
|
77
|
+
`+z+a}var ae=!1;function je(a,c){if(!a||ae)return"";ae=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(ne){var y=ne}Reflect.construct(a,[],c)}else{try{c.call()}catch(ne){y=ne}a.call(c.prototype)}else{try{throw Error()}catch(ne){y=ne}a()}}catch(ne){if(ne&&y&&typeof ne.stack=="string"){for(var S=ne.stack.split(`
|
|
78
|
+
`),k=y.stack.split(`
|
|
79
|
+
`),_=S.length-1,$=k.length-1;1<=_&&0<=$&&S[_]!==k[$];)$--;for(;1<=_&&0<=$;_--,$--)if(S[_]!==k[$]){if(_!==1||$!==1)do if(_--,$--,0>$||S[_]!==k[$]){var U=`
|
|
80
|
+
`+S[_].replace(" at new "," at ");return a.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",a.displayName)),U}while(1<=_&&0<=$);break}}}finally{ae=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?J(a):""}function ge(a){switch(a.tag){case 5:return J(a.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return a=je(a.type,!1),a;case 11:return a=je(a.type.render,!1),a;case 1:return a=je(a.type,!0),a;default:return""}}function Ce(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case A:return"Fragment";case D:return"Portal";case L:return"Profiler";case O:return"StrictMode";case Q:return"Suspense";case Y:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case q:return(a.displayName||"Context")+".Consumer";case V:return(a._context.displayName||"Context")+".Provider";case G:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case X:return c=a.displayName||null,c!==null?c:Ce(a.type)||"Memo";case B:c=a._payload,a=a._init;try{return Ce(a(c))}catch{}}return null}function Re(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ce(c);case 8:return c===O?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function ke(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function _e(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function $e(a){var c=_e(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),y=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var S=f.get,k=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(_){y=""+_,k.call(this,_)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return y},setValue:function(_){y=""+_},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function yt(a){a._valueTracker||(a._valueTracker=$e(a))}function Ft(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),y="";return a&&(y=_e(a)?a.checked?"true":"false":a.value),a=y,a!==f?(c.setValue(a),!0):!1}function gt(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Tt(a,c){var f=c.checked;return I({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function Nt(a,c){var f=c.defaultValue==null?"":c.defaultValue,y=c.checked!=null?c.checked:c.defaultChecked;f=ke(c.value!=null?c.value:f),a._wrapperState={initialChecked:y,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function Pt(a,c){c=c.checked,c!=null&&E(a,"checked",c,!1)}function be(a,c){Pt(a,c);var f=ke(c.value),y=c.type;if(f!=null)y==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(y==="submit"||y==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?Be(a,c.type,f):c.hasOwnProperty("defaultValue")&&Be(a,c.type,ke(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function Ie(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var y=c.type;if(!(y!=="submit"&&y!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function Be(a,c,f){(c!=="number"||gt(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var Se=Array.isArray;function ce(a,c,f,y){if(a=a.options,c){c={};for(var S=0;S<f.length;S++)c["$"+f[S]]=!0;for(f=0;f<a.length;f++)S=c.hasOwnProperty("$"+a[f].value),a[f].selected!==S&&(a[f].selected=S),S&&y&&(a[f].defaultSelected=!0)}else{for(f=""+ke(f),c=null,S=0;S<a.length;S++){if(a[S].value===f){a[S].selected=!0,y&&(a[S].defaultSelected=!0);return}c!==null||a[S].disabled||(c=a[S])}c!==null&&(c.selected=!0)}}function me(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return I({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Ue(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(n(92));if(Se(f)){if(1<f.length)throw Error(n(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:ke(f)}}function de(a,c){var f=ke(c.value),y=ke(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),y!=null&&(a.defaultValue=""+y)}function Ae(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function pt(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function zt(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?pt(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Qt,jn=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,y,S){MSApp.execUnsafeLocalFunction(function(){return a(c,f,y,S)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Qt=Qt||document.createElement("div"),Qt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Qt.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function Ct(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var bt={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ao=["Webkit","ms","Moz","O"];Object.keys(bt).forEach(function(a){Ao.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),bt[c]=bt[a]})});function oi(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||bt.hasOwnProperty(a)&&bt[a]?(""+c).trim():c+"px"}function Da(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var y=f.indexOf("--")===0,S=oi(f,c[f],y);f==="float"&&(f="cssFloat"),y?a.setProperty(f,S):a[f]=S}}var Ia=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $n(a,c){if(c){if(Ia[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function No(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){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 ii=null;function Rs(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var si=null,Wr=null,Rr=null;function pr(a){if(a=bc(a)){if(typeof si!="function")throw Error(n(280));var c=a.stateNode;c&&(c=dd(c),si(a.stateNode,a.type,c))}}function kn(a){Wr?Rr?Rr.push(a):Rr=[a]:Wr=a}function Aa(){if(Wr){var a=Wr,c=Rr;if(Rr=Wr=null,pr(a),c)for(a=0;a<c.length;a++)pr(c[a])}}function ec(a,c){return a(c)}function W(){}var K=!1;function ee(a,c,f){if(K)return a(c,f);K=!0;try{return ec(a,c,f)}finally{K=!1,(Wr!==null||Rr!==null)&&(W(),Aa())}}function fe(a,c){var f=a.stateNode;if(f===null)return null;var y=dd(f);if(y===null)return null;f=y[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(a=a.type,y=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!y;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,c,typeof f));return f}var Ee=!1;if(u)try{var rt={};Object.defineProperty(rt,"passive",{get:function(){Ee=!0}}),window.addEventListener("test",rt,rt),window.removeEventListener("test",rt,rt)}catch{Ee=!1}function nt(a,c,f,y,S,k,_,$,U){var ne=Array.prototype.slice.call(arguments,3);try{c.apply(f,ne)}catch(he){this.onError(he)}}var We=!1,Ke=null,Ne=!1,Xe=null,at={onError:function(a){We=!0,Ke=a}};function wt(a,c,f,y,S,k,_,$,U){We=!1,Ke=null,nt.apply(at,arguments)}function en(a,c,f,y,S,k,_,$,U){if(wt.apply(this,arguments),We){if(We){var ne=Ke;We=!1,Ke=null}else throw Error(n(198));Ne||(Ne=!0,Xe=ne)}}function Kt(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,(c.flags&4098)!==0&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function ct(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function Bt(a){if(Kt(a)!==a)throw Error(n(188))}function pn(a){var c=a.alternate;if(!c){if(c=Kt(a),c===null)throw Error(n(188));return c!==a?null:a}for(var f=a,y=c;;){var S=f.return;if(S===null)break;var k=S.alternate;if(k===null){if(y=S.return,y!==null){f=y;continue}break}if(S.child===k.child){for(k=S.child;k;){if(k===f)return Bt(S),a;if(k===y)return Bt(S),c;k=k.sibling}throw Error(n(188))}if(f.return!==y.return)f=S,y=k;else{for(var _=!1,$=S.child;$;){if($===f){_=!0,f=S,y=k;break}if($===y){_=!0,y=S,f=k;break}$=$.sibling}if(!_){for($=k.child;$;){if($===f){_=!0,f=k,y=S;break}if($===y){_=!0,y=k,f=S;break}$=$.sibling}if(!_)throw Error(n(189))}}if(f.alternate!==y)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:c}function Hr(a){return a=pn(a),a!==null?Oo(a):null}function Oo(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=Oo(a);if(c!==null)return c;a=a.sibling}return null}var qr=t.unstable_scheduleCallback,_r=t.unstable_cancelCallback,tc=t.unstable_shouldYield,_s=t.unstable_requestPaint,Ut=t.unstable_now,Na=t.unstable_getCurrentPriorityLevel,zi=t.unstable_ImmediatePriority,Wt=t.unstable_UserBlockingPriority,Tn=t.unstable_NormalPriority,Oa=t.unstable_LowPriority,Vi=t.unstable_IdlePriority,an=null,Un=null;function qu(a){if(Un&&typeof Un.onCommitFiberRoot=="function")try{Un.onCommitFiberRoot(an,a,void 0,(a.current.flags&128)===128)}catch{}}var Dr=Math.clz32?Math.clz32:m2,p2=Math.log,h2=Math.LN2;function m2(a){return a>>>=0,a===0?32:31-(p2(a)/h2|0)|0}var Gu=64,Qu=4194304;function nc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Ku(a,c){var f=a.pendingLanes;if(f===0)return 0;var y=0,S=a.suspendedLanes,k=a.pingedLanes,_=f&268435455;if(_!==0){var $=_&~S;$!==0?y=nc($):(k&=_,k!==0&&(y=nc(k)))}else _=f&~S,_!==0?y=nc(_):k!==0&&(y=nc(k));if(y===0)return 0;if(c!==0&&c!==y&&(c&S)===0&&(S=y&-y,k=c&-c,S>=k||S===16&&(k&4194240)!==0))return c;if((y&4)!==0&&(y|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=y;0<c;)f=31-Dr(c),S=1<<f,y|=a[f],c&=~S;return y}function g2(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function v2(a,c){for(var f=a.suspendedLanes,y=a.pingedLanes,S=a.expirationTimes,k=a.pendingLanes;0<k;){var _=31-Dr(k),$=1<<_,U=S[_];U===-1?(($&f)===0||($&y)!==0)&&(S[_]=g2($,c)):U<=c&&(a.expiredLanes|=$),k&=~$}}function sh(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function T0(){var a=Gu;return Gu<<=1,(Gu&4194240)===0&&(Gu=64),a}function ah(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function rc(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Dr(c),a[c]=f}function y2(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var y=a.eventTimes;for(a=a.expirationTimes;0<f;){var S=31-Dr(f),k=1<<S;c[S]=0,y[S]=-1,a[S]=-1,f&=~k}}function lh(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var y=31-Dr(f),S=1<<y;S&c|a[y]&c&&(a[y]|=c),f&=~S}}var Ht=0;function P0(a){return a&=-a,1<a?4<a?(a&268435455)!==0?16:536870912:4:1}var R0,ch,_0,D0,I0,uh=!1,Yu=[],Bi=null,Ui=null,Wi=null,oc=new Map,ic=new Map,Hi=[],x2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function A0(a,c){switch(a){case"focusin":case"focusout":Bi=null;break;case"dragenter":case"dragleave":Ui=null;break;case"mouseover":case"mouseout":Wi=null;break;case"pointerover":case"pointerout":oc.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ic.delete(c.pointerId)}}function sc(a,c,f,y,S,k){return a===null||a.nativeEvent!==k?(a={blockedOn:c,domEventName:f,eventSystemFlags:y,nativeEvent:k,targetContainers:[S]},c!==null&&(c=bc(c),c!==null&&ch(c)),a):(a.eventSystemFlags|=y,c=a.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),a)}function b2(a,c,f,y,S){switch(c){case"focusin":return Bi=sc(Bi,a,c,f,y,S),!0;case"dragenter":return Ui=sc(Ui,a,c,f,y,S),!0;case"mouseover":return Wi=sc(Wi,a,c,f,y,S),!0;case"pointerover":var k=S.pointerId;return oc.set(k,sc(oc.get(k)||null,a,c,f,y,S)),!0;case"gotpointercapture":return k=S.pointerId,ic.set(k,sc(ic.get(k)||null,a,c,f,y,S)),!0}return!1}function N0(a){var c=Ds(a.target);if(c!==null){var f=Kt(c);if(f!==null){if(c=f.tag,c===13){if(c=ct(f),c!==null){a.blockedOn=c,I0(a.priority,function(){_0(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Xu(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=fh(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var y=new f.constructor(f.type,f);ii=y,f.target.dispatchEvent(y),ii=null}else return c=bc(f),c!==null&&ch(c),a.blockedOn=f,!1;c.shift()}return!0}function O0(a,c,f){Xu(a)&&f.delete(c)}function w2(){uh=!1,Bi!==null&&Xu(Bi)&&(Bi=null),Ui!==null&&Xu(Ui)&&(Ui=null),Wi!==null&&Xu(Wi)&&(Wi=null),oc.forEach(O0),ic.forEach(O0)}function ac(a,c){a.blockedOn===c&&(a.blockedOn=null,uh||(uh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,w2)))}function lc(a){function c(S){return ac(S,a)}if(0<Yu.length){ac(Yu[0],a);for(var f=1;f<Yu.length;f++){var y=Yu[f];y.blockedOn===a&&(y.blockedOn=null)}}for(Bi!==null&&ac(Bi,a),Ui!==null&&ac(Ui,a),Wi!==null&&ac(Wi,a),oc.forEach(c),ic.forEach(c),f=0;f<Hi.length;f++)y=Hi[f],y.blockedOn===a&&(y.blockedOn=null);for(;0<Hi.length&&(f=Hi[0],f.blockedOn===null);)N0(f),f.blockedOn===null&&Hi.shift()}var Ma=C.ReactCurrentBatchConfig,Ju=!0;function S2(a,c,f,y){var S=Ht,k=Ma.transition;Ma.transition=null;try{Ht=1,dh(a,c,f,y)}finally{Ht=S,Ma.transition=k}}function j2(a,c,f,y){var S=Ht,k=Ma.transition;Ma.transition=null;try{Ht=4,dh(a,c,f,y)}finally{Ht=S,Ma.transition=k}}function dh(a,c,f,y){if(Ju){var S=fh(a,c,f,y);if(S===null)Rh(a,c,y,Zu,f),A0(a,y);else if(b2(S,a,c,f,y))y.stopPropagation();else if(A0(a,y),c&4&&-1<x2.indexOf(a)){for(;S!==null;){var k=bc(S);if(k!==null&&R0(k),k=fh(a,c,f,y),k===null&&Rh(a,c,y,Zu,f),k===S)break;S=k}S!==null&&y.stopPropagation()}else Rh(a,c,y,null,f)}}var Zu=null;function fh(a,c,f,y){if(Zu=null,a=Rs(y),a=Ds(a),a!==null)if(c=Kt(a),c===null)a=null;else if(f=c.tag,f===13){if(a=ct(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Zu=a,null}function M0(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Na()){case zi:return 1;case Wt:return 4;case Tn:case Oa:return 16;case Vi:return 536870912;default:return 16}default:return 16}}var qi=null,ph=null,ed=null;function L0(){if(ed)return ed;var a,c=ph,f=c.length,y,S="value"in qi?qi.value:qi.textContent,k=S.length;for(a=0;a<f&&c[a]===S[a];a++);var _=f-a;for(y=1;y<=_&&c[f-y]===S[k-y];y++);return ed=S.slice(a,1<y?1-y:void 0)}function td(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function nd(){return!0}function $0(){return!1}function Ir(a){function c(f,y,S,k,_){this._reactName=f,this._targetInst=S,this.type=y,this.nativeEvent=k,this.target=_,this.currentTarget=null;for(var $ in a)a.hasOwnProperty($)&&(f=a[$],this[$]=f?f(k):k[$]);return this.isDefaultPrevented=(k.defaultPrevented!=null?k.defaultPrevented:k.returnValue===!1)?nd:$0,this.isPropagationStopped=$0,this}return I(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=nd)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=nd)},persist:function(){},isPersistent:nd}),c}var La={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hh=Ir(La),cc=I({},La,{view:0,detail:0}),C2=Ir(cc),mh,gh,uc,rd=I({},cc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yh,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==uc&&(uc&&a.type==="mousemove"?(mh=a.screenX-uc.screenX,gh=a.screenY-uc.screenY):gh=mh=0,uc=a),mh)},movementY:function(a){return"movementY"in a?a.movementY:gh}}),F0=Ir(rd),E2=I({},rd,{dataTransfer:0}),k2=Ir(E2),T2=I({},cc,{relatedTarget:0}),vh=Ir(T2),P2=I({},La,{animationName:0,elapsedTime:0,pseudoElement:0}),R2=Ir(P2),_2=I({},La,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),D2=Ir(_2),I2=I({},La,{data:0}),z0=Ir(I2),A2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},N2={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"},O2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function M2(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=O2[a])?!!c[a]:!1}function yh(){return M2}var L2=I({},cc,{key:function(a){if(a.key){var c=A2[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=td(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?N2[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yh,charCode:function(a){return a.type==="keypress"?td(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?td(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),$2=Ir(L2),F2=I({},rd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),V0=Ir(F2),z2=I({},cc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yh}),V2=Ir(z2),B2=I({},La,{propertyName:0,elapsedTime:0,pseudoElement:0}),U2=Ir(B2),W2=I({},rd,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),H2=Ir(W2),q2=[9,13,27,32],xh=u&&"CompositionEvent"in window,dc=null;u&&"documentMode"in document&&(dc=document.documentMode);var G2=u&&"TextEvent"in window&&!dc,B0=u&&(!xh||dc&&8<dc&&11>=dc),U0=" ",W0=!1;function H0(a,c){switch(a){case"keyup":return q2.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function q0(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var $a=!1;function Q2(a,c){switch(a){case"compositionend":return q0(c);case"keypress":return c.which!==32?null:(W0=!0,U0);case"textInput":return a=c.data,a===U0&&W0?null:a;default:return null}}function K2(a,c){if($a)return a==="compositionend"||!xh&&H0(a,c)?(a=L0(),ed=ph=qi=null,$a=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return B0&&c.locale!=="ko"?null:c.data;default:return null}}var Y2={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 G0(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!Y2[a.type]:c==="textarea"}function Q0(a,c,f,y){kn(y),c=ld(c,"onChange"),0<c.length&&(f=new hh("onChange","change",null,f,y),a.push({event:f,listeners:c}))}var fc=null,pc=null;function X2(a){fb(a,0)}function od(a){var c=Ua(a);if(Ft(c))return a}function J2(a,c){if(a==="change")return c}var K0=!1;if(u){var bh;if(u){var wh="oninput"in document;if(!wh){var Y0=document.createElement("div");Y0.setAttribute("oninput","return;"),wh=typeof Y0.oninput=="function"}bh=wh}else bh=!1;K0=bh&&(!document.documentMode||9<document.documentMode)}function X0(){fc&&(fc.detachEvent("onpropertychange",J0),pc=fc=null)}function J0(a){if(a.propertyName==="value"&&od(pc)){var c=[];Q0(c,pc,a,Rs(a)),ee(X2,c)}}function Z2(a,c,f){a==="focusin"?(X0(),fc=c,pc=f,fc.attachEvent("onpropertychange",J0)):a==="focusout"&&X0()}function e_(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return od(pc)}function t_(a,c){if(a==="click")return od(c)}function n_(a,c){if(a==="input"||a==="change")return od(c)}function r_(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var ho=typeof Object.is=="function"?Object.is:r_;function hc(a,c){if(ho(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),y=Object.keys(c);if(f.length!==y.length)return!1;for(y=0;y<f.length;y++){var S=f[y];if(!d.call(c,S)||!ho(a[S],c[S]))return!1}return!0}function Z0(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function eb(a,c){var f=Z0(a);a=0;for(var y;f;){if(f.nodeType===3){if(y=a+f.textContent.length,a<=c&&y>=c)return{node:f,offset:c-a};a=y}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Z0(f)}}function tb(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?tb(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function nb(){for(var a=window,c=gt();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=gt(a.document)}return c}function Sh(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function o_(a){var c=nb(),f=a.focusedElem,y=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&tb(f.ownerDocument.documentElement,f)){if(y!==null&&Sh(f)){if(c=y.start,a=y.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=f.textContent.length,k=Math.min(y.start,S);y=y.end===void 0?k:Math.min(y.end,S),!a.extend&&k>y&&(S=y,y=k,k=S),S=eb(f,k);var _=eb(f,y);S&&_&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==_.node||a.focusOffset!==_.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),k>y?(a.addRange(c),a.extend(_.node,_.offset)):(c.setEnd(_.node,_.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var i_=u&&"documentMode"in document&&11>=document.documentMode,Fa=null,jh=null,mc=null,Ch=!1;function rb(a,c,f){var y=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Ch||Fa==null||Fa!==gt(y)||(y=Fa,"selectionStart"in y&&Sh(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),mc&&hc(mc,y)||(mc=y,y=ld(jh,"onSelect"),0<y.length&&(c=new hh("onSelect","select",null,c,f),a.push({event:c,listeners:y}),c.target=Fa)))}function id(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var za={animationend:id("Animation","AnimationEnd"),animationiteration:id("Animation","AnimationIteration"),animationstart:id("Animation","AnimationStart"),transitionend:id("Transition","TransitionEnd")},Eh={},ob={};u&&(ob=document.createElement("div").style,"AnimationEvent"in window||(delete za.animationend.animation,delete za.animationiteration.animation,delete za.animationstart.animation),"TransitionEvent"in window||delete za.transitionend.transition);function sd(a){if(Eh[a])return Eh[a];if(!za[a])return a;var c=za[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in ob)return Eh[a]=c[f];return a}var ib=sd("animationend"),sb=sd("animationiteration"),ab=sd("animationstart"),lb=sd("transitionend"),cb=new Map,ub="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Gi(a,c){cb.set(a,c),i(c,[a])}for(var kh=0;kh<ub.length;kh++){var Th=ub[kh],s_=Th.toLowerCase(),a_=Th[0].toUpperCase()+Th.slice(1);Gi(s_,"on"+a_)}Gi(ib,"onAnimationEnd"),Gi(sb,"onAnimationIteration"),Gi(ab,"onAnimationStart"),Gi("dblclick","onDoubleClick"),Gi("focusin","onFocus"),Gi("focusout","onBlur"),Gi(lb,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),i("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),i("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),i("onBeforeInput",["compositionend","keypress","textInput","paste"]),i("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),i("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var gc="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(" "),l_=new Set("cancel close invalid load scroll toggle".split(" ").concat(gc));function db(a,c,f){var y=a.type||"unknown-event";a.currentTarget=f,en(y,c,void 0,a),a.currentTarget=null}function fb(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var y=a[f],S=y.event;y=y.listeners;e:{var k=void 0;if(c)for(var _=y.length-1;0<=_;_--){var $=y[_],U=$.instance,ne=$.currentTarget;if($=$.listener,U!==k&&S.isPropagationStopped())break e;db(S,$,ne),k=U}else for(_=0;_<y.length;_++){if($=y[_],U=$.instance,ne=$.currentTarget,$=$.listener,U!==k&&S.isPropagationStopped())break e;db(S,$,ne),k=U}}}if(Ne)throw a=Xe,Ne=!1,Xe=null,a}function ln(a,c){var f=c[Oh];f===void 0&&(f=c[Oh]=new Set);var y=a+"__bubble";f.has(y)||(pb(c,a,2,!1),f.add(y))}function Ph(a,c,f){var y=0;c&&(y|=4),pb(f,a,y,c)}var ad="_reactListening"+Math.random().toString(36).slice(2);function vc(a){if(!a[ad]){a[ad]=!0,r.forEach(function(f){f!=="selectionchange"&&(l_.has(f)||Ph(f,!1,a),Ph(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[ad]||(c[ad]=!0,Ph("selectionchange",!1,c))}}function pb(a,c,f,y){switch(M0(c)){case 1:var S=S2;break;case 4:S=j2;break;default:S=dh}f=S.bind(null,c,f,a),S=void 0,!Ee||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),y?S!==void 0?a.addEventListener(c,f,{capture:!0,passive:S}):a.addEventListener(c,f,!0):S!==void 0?a.addEventListener(c,f,{passive:S}):a.addEventListener(c,f,!1)}function Rh(a,c,f,y,S){var k=y;if((c&1)===0&&(c&2)===0&&y!==null)e:for(;;){if(y===null)return;var _=y.tag;if(_===3||_===4){var $=y.stateNode.containerInfo;if($===S||$.nodeType===8&&$.parentNode===S)break;if(_===4)for(_=y.return;_!==null;){var U=_.tag;if((U===3||U===4)&&(U=_.stateNode.containerInfo,U===S||U.nodeType===8&&U.parentNode===S))return;_=_.return}for(;$!==null;){if(_=Ds($),_===null)return;if(U=_.tag,U===5||U===6){y=k=_;continue e}$=$.parentNode}}y=y.return}ee(function(){var ne=k,he=Rs(f),ye=[];e:{var pe=cb.get(a);if(pe!==void 0){var ze=hh,Ge=a;switch(a){case"keypress":if(td(f)===0)break e;case"keydown":case"keyup":ze=$2;break;case"focusin":Ge="focus",ze=vh;break;case"focusout":Ge="blur",ze=vh;break;case"beforeblur":case"afterblur":ze=vh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ze=F0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ze=k2;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ze=V2;break;case ib:case sb:case ab:ze=R2;break;case lb:ze=U2;break;case"scroll":ze=C2;break;case"wheel":ze=H2;break;case"copy":case"cut":case"paste":ze=D2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ze=V0}var Ye=(c&4)!==0,Pn=!Ye&&a==="scroll",Z=Ye?pe!==null?pe+"Capture":null:pe;Ye=[];for(var H=ne,te;H!==null;){te=H;var we=te.stateNode;if(te.tag===5&&we!==null&&(te=we,Z!==null&&(we=fe(H,Z),we!=null&&Ye.push(yc(H,we,te)))),Pn)break;H=H.return}0<Ye.length&&(pe=new ze(pe,Ge,null,f,he),ye.push({event:pe,listeners:Ye}))}}if((c&7)===0){e:{if(pe=a==="mouseover"||a==="pointerover",ze=a==="mouseout"||a==="pointerout",pe&&f!==ii&&(Ge=f.relatedTarget||f.fromElement)&&(Ds(Ge)||Ge[ai]))break e;if((ze||pe)&&(pe=he.window===he?he:(pe=he.ownerDocument)?pe.defaultView||pe.parentWindow:window,ze?(Ge=f.relatedTarget||f.toElement,ze=ne,Ge=Ge?Ds(Ge):null,Ge!==null&&(Pn=Kt(Ge),Ge!==Pn||Ge.tag!==5&&Ge.tag!==6)&&(Ge=null)):(ze=null,Ge=ne),ze!==Ge)){if(Ye=F0,we="onMouseLeave",Z="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(Ye=V0,we="onPointerLeave",Z="onPointerEnter",H="pointer"),Pn=ze==null?pe:Ua(ze),te=Ge==null?pe:Ua(Ge),pe=new Ye(we,H+"leave",ze,f,he),pe.target=Pn,pe.relatedTarget=te,we=null,Ds(he)===ne&&(Ye=new Ye(Z,H+"enter",Ge,f,he),Ye.target=te,Ye.relatedTarget=Pn,we=Ye),Pn=we,ze&&Ge)t:{for(Ye=ze,Z=Ge,H=0,te=Ye;te;te=Va(te))H++;for(te=0,we=Z;we;we=Va(we))te++;for(;0<H-te;)Ye=Va(Ye),H--;for(;0<te-H;)Z=Va(Z),te--;for(;H--;){if(Ye===Z||Z!==null&&Ye===Z.alternate)break t;Ye=Va(Ye),Z=Va(Z)}Ye=null}else Ye=null;ze!==null&&hb(ye,pe,ze,Ye,!1),Ge!==null&&Pn!==null&&hb(ye,Pn,Ge,Ye,!0)}}e:{if(pe=ne?Ua(ne):window,ze=pe.nodeName&&pe.nodeName.toLowerCase(),ze==="select"||ze==="input"&&pe.type==="file")var Ze=J2;else if(G0(pe))if(K0)Ze=n_;else{Ze=e_;var it=Z2}else(ze=pe.nodeName)&&ze.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Ze=t_);if(Ze&&(Ze=Ze(a,ne))){Q0(ye,Ze,f,he);break e}it&&it(a,pe,ne),a==="focusout"&&(it=pe._wrapperState)&&it.controlled&&pe.type==="number"&&Be(pe,"number",pe.value)}switch(it=ne?Ua(ne):window,a){case"focusin":(G0(it)||it.contentEditable==="true")&&(Fa=it,jh=ne,mc=null);break;case"focusout":mc=jh=Fa=null;break;case"mousedown":Ch=!0;break;case"contextmenu":case"mouseup":case"dragend":Ch=!1,rb(ye,f,he);break;case"selectionchange":if(i_)break;case"keydown":case"keyup":rb(ye,f,he)}var st;if(xh)e:{switch(a){case"compositionstart":var dt="onCompositionStart";break e;case"compositionend":dt="onCompositionEnd";break e;case"compositionupdate":dt="onCompositionUpdate";break e}dt=void 0}else $a?H0(a,f)&&(dt="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(dt="onCompositionStart");dt&&(B0&&f.locale!=="ko"&&($a||dt!=="onCompositionStart"?dt==="onCompositionEnd"&&$a&&(st=L0()):(qi=he,ph="value"in qi?qi.value:qi.textContent,$a=!0)),it=ld(ne,dt),0<it.length&&(dt=new z0(dt,a,null,f,he),ye.push({event:dt,listeners:it}),st?dt.data=st:(st=q0(f),st!==null&&(dt.data=st)))),(st=G2?Q2(a,f):K2(a,f))&&(ne=ld(ne,"onBeforeInput"),0<ne.length&&(he=new z0("onBeforeInput","beforeinput",null,f,he),ye.push({event:he,listeners:ne}),he.data=st))}fb(ye,c)})}function yc(a,c,f){return{instance:a,listener:c,currentTarget:f}}function ld(a,c){for(var f=c+"Capture",y=[];a!==null;){var S=a,k=S.stateNode;S.tag===5&&k!==null&&(S=k,k=fe(a,f),k!=null&&y.unshift(yc(a,k,S)),k=fe(a,c),k!=null&&y.push(yc(a,k,S))),a=a.return}return y}function Va(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function hb(a,c,f,y,S){for(var k=c._reactName,_=[];f!==null&&f!==y;){var $=f,U=$.alternate,ne=$.stateNode;if(U!==null&&U===y)break;$.tag===5&&ne!==null&&($=ne,S?(U=fe(f,k),U!=null&&_.unshift(yc(f,U,$))):S||(U=fe(f,k),U!=null&&_.push(yc(f,U,$)))),f=f.return}_.length!==0&&a.push({event:c,listeners:_})}var c_=/\r\n?/g,u_=/\u0000|\uFFFD/g;function mb(a){return(typeof a=="string"?a:""+a).replace(c_,`
|
|
81
|
+
`).replace(u_,"")}function cd(a,c,f){if(c=mb(c),mb(a)!==c&&f)throw Error(n(425))}function ud(){}var _h=null,Dh=null;function Ih(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Ah=typeof setTimeout=="function"?setTimeout:void 0,d_=typeof clearTimeout=="function"?clearTimeout:void 0,gb=typeof Promise=="function"?Promise:void 0,f_=typeof queueMicrotask=="function"?queueMicrotask:typeof gb<"u"?function(a){return gb.resolve(null).then(a).catch(p_)}:Ah;function p_(a){setTimeout(function(){throw a})}function Nh(a,c){var f=c,y=0;do{var S=f.nextSibling;if(a.removeChild(f),S&&S.nodeType===8)if(f=S.data,f==="/$"){if(y===0){a.removeChild(S),lc(c);return}y--}else f!=="$"&&f!=="$?"&&f!=="$!"||y++;f=S}while(f);lc(c)}function Qi(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function vb(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var Ba=Math.random().toString(36).slice(2),Mo="__reactFiber$"+Ba,xc="__reactProps$"+Ba,ai="__reactContainer$"+Ba,Oh="__reactEvents$"+Ba,h_="__reactListeners$"+Ba,m_="__reactHandles$"+Ba;function Ds(a){var c=a[Mo];if(c)return c;for(var f=a.parentNode;f;){if(c=f[ai]||f[Mo]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=vb(a);a!==null;){if(f=a[Mo])return f;a=vb(a)}return c}a=f,f=a.parentNode}return null}function bc(a){return a=a[Mo]||a[ai],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function Ua(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function dd(a){return a[xc]||null}var Mh=[],Wa=-1;function Ki(a){return{current:a}}function cn(a){0>Wa||(a.current=Mh[Wa],Mh[Wa]=null,Wa--)}function tn(a,c){Wa++,Mh[Wa]=a.current,a.current=c}var Yi={},Yn=Ki(Yi),hr=Ki(!1),Is=Yi;function Ha(a,c){var f=a.type.contextTypes;if(!f)return Yi;var y=a.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===c)return y.__reactInternalMemoizedMaskedChildContext;var S={},k;for(k in f)S[k]=c[k];return y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function mr(a){return a=a.childContextTypes,a!=null}function fd(){cn(hr),cn(Yn)}function yb(a,c,f){if(Yn.current!==Yi)throw Error(n(168));tn(Yn,c),tn(hr,f)}function xb(a,c,f){var y=a.stateNode;if(c=c.childContextTypes,typeof y.getChildContext!="function")return f;y=y.getChildContext();for(var S in y)if(!(S in c))throw Error(n(108,Re(a)||"Unknown",S));return I({},f,y)}function pd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Yi,Is=Yn.current,tn(Yn,a),tn(hr,hr.current),!0}function bb(a,c,f){var y=a.stateNode;if(!y)throw Error(n(169));f?(a=xb(a,c,Is),y.__reactInternalMemoizedMergedChildContext=a,cn(hr),cn(Yn),tn(Yn,a)):cn(hr),tn(hr,f)}var li=null,hd=!1,Lh=!1;function wb(a){li===null?li=[a]:li.push(a)}function g_(a){hd=!0,wb(a)}function Xi(){if(!Lh&&li!==null){Lh=!0;var a=0,c=Ht;try{var f=li;for(Ht=1;a<f.length;a++){var y=f[a];do y=y(!0);while(y!==null)}li=null,hd=!1}catch(S){throw li!==null&&(li=li.slice(a+1)),qr(zi,Xi),S}finally{Ht=c,Lh=!1}}return null}var qa=[],Ga=0,md=null,gd=0,Gr=[],Qr=0,As=null,ci=1,ui="";function Ns(a,c){qa[Ga++]=gd,qa[Ga++]=md,md=a,gd=c}function Sb(a,c,f){Gr[Qr++]=ci,Gr[Qr++]=ui,Gr[Qr++]=As,As=a;var y=ci;a=ui;var S=32-Dr(y)-1;y&=~(1<<S),f+=1;var k=32-Dr(c)+S;if(30<k){var _=S-S%5;k=(y&(1<<_)-1).toString(32),y>>=_,S-=_,ci=1<<32-Dr(c)+S|f<<S|y,ui=k+a}else ci=1<<k|f<<S|y,ui=a}function $h(a){a.return!==null&&(Ns(a,1),Sb(a,1,0))}function Fh(a){for(;a===md;)md=qa[--Ga],qa[Ga]=null,gd=qa[--Ga],qa[Ga]=null;for(;a===As;)As=Gr[--Qr],Gr[Qr]=null,ui=Gr[--Qr],Gr[Qr]=null,ci=Gr[--Qr],Gr[Qr]=null}var Ar=null,Nr=null,hn=!1,mo=null;function jb(a,c){var f=Jr(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function Cb(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,Ar=a,Nr=Qi(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,Ar=a,Nr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=As!==null?{id:ci,overflow:ui}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=Jr(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,Ar=a,Nr=null,!0):!1;default:return!1}}function zh(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Vh(a){if(hn){var c=Nr;if(c){var f=c;if(!Cb(a,c)){if(zh(a))throw Error(n(418));c=Qi(f.nextSibling);var y=Ar;c&&Cb(a,c)?jb(y,f):(a.flags=a.flags&-4097|2,hn=!1,Ar=a)}}else{if(zh(a))throw Error(n(418));a.flags=a.flags&-4097|2,hn=!1,Ar=a}}}function Eb(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Ar=a}function vd(a){if(a!==Ar)return!1;if(!hn)return Eb(a),hn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Ih(a.type,a.memoizedProps)),c&&(c=Nr)){if(zh(a))throw kb(),Error(n(418));for(;c;)jb(a,c),c=Qi(c.nextSibling)}if(Eb(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){Nr=Qi(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}Nr=null}}else Nr=Ar?Qi(a.stateNode.nextSibling):null;return!0}function kb(){for(var a=Nr;a;)a=Qi(a.nextSibling)}function Qa(){Nr=Ar=null,hn=!1}function Bh(a){mo===null?mo=[a]:mo.push(a)}var v_=C.ReactCurrentBatchConfig;function go(a,c){if(a&&a.defaultProps){c=I({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}var yd=Ki(null),xd=null,Ka=null,Uh=null;function Wh(){Uh=Ka=xd=null}function Hh(a){var c=yd.current;cn(yd),a._currentValue=c}function qh(a,c,f){for(;a!==null;){var y=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,y!==null&&(y.childLanes|=c)):y!==null&&(y.childLanes&c)!==c&&(y.childLanes|=c),a===f)break;a=a.return}}function Ya(a,c){xd=a,Uh=Ka=null,a=a.dependencies,a!==null&&a.firstContext!==null&&((a.lanes&c)!==0&&(gr=!0),a.firstContext=null)}function Kr(a){var c=a._currentValue;if(Uh!==a)if(a={context:a,memoizedValue:c,next:null},Ka===null){if(xd===null)throw Error(n(308));Ka=a,xd.dependencies={lanes:0,firstContext:a}}else Ka=Ka.next=a;return c}var Os=null;function Gh(a){Os===null?Os=[a]:Os.push(a)}function Tb(a,c,f,y){var S=c.interleaved;return S===null?(f.next=f,Gh(c)):(f.next=S.next,S.next=f),c.interleaved=f,di(a,y)}function di(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Ji=!1;function Qh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pb(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function fi(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Zi(a,c,f){var y=a.updateQueue;if(y===null)return null;if(y=y.shared,(Rt&2)!==0){var S=y.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),y.pending=c,di(a,f)}return S=y.interleaved,S===null?(c.next=c,Gh(y)):(c.next=S.next,S.next=c),y.interleaved=c,di(a,f)}function bd(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,lh(a,f)}}function Rb(a,c){var f=a.updateQueue,y=a.alternate;if(y!==null&&(y=y.updateQueue,f===y)){var S=null,k=null;if(f=f.firstBaseUpdate,f!==null){do{var _={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};k===null?S=k=_:k=k.next=_,f=f.next}while(f!==null);k===null?S=k=c:k=k.next=c}else S=k=c;f={baseState:y.baseState,firstBaseUpdate:S,lastBaseUpdate:k,shared:y.shared,effects:y.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function wd(a,c,f,y){var S=a.updateQueue;Ji=!1;var k=S.firstBaseUpdate,_=S.lastBaseUpdate,$=S.shared.pending;if($!==null){S.shared.pending=null;var U=$,ne=U.next;U.next=null,_===null?k=ne:_.next=ne,_=U;var he=a.alternate;he!==null&&(he=he.updateQueue,$=he.lastBaseUpdate,$!==_&&($===null?he.firstBaseUpdate=ne:$.next=ne,he.lastBaseUpdate=U))}if(k!==null){var ye=S.baseState;_=0,he=ne=U=null,$=k;do{var pe=$.lane,ze=$.eventTime;if((y&pe)===pe){he!==null&&(he=he.next={eventTime:ze,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Ge=a,Ye=$;switch(pe=c,ze=f,Ye.tag){case 1:if(Ge=Ye.payload,typeof Ge=="function"){ye=Ge.call(ze,ye,pe);break e}ye=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=Ye.payload,pe=typeof Ge=="function"?Ge.call(ze,ye,pe):Ge,pe==null)break e;ye=I({},ye,pe);break e;case 2:Ji=!0}}$.callback!==null&&$.lane!==0&&(a.flags|=64,pe=S.effects,pe===null?S.effects=[$]:pe.push($))}else ze={eventTime:ze,lane:pe,tag:$.tag,payload:$.payload,callback:$.callback,next:null},he===null?(ne=he=ze,U=ye):he=he.next=ze,_|=pe;if($=$.next,$===null){if($=S.shared.pending,$===null)break;pe=$,$=pe.next,pe.next=null,S.lastBaseUpdate=pe,S.shared.pending=null}}while(!0);if(he===null&&(U=ye),S.baseState=U,S.firstBaseUpdate=ne,S.lastBaseUpdate=he,c=S.shared.interleaved,c!==null){S=c;do _|=S.lane,S=S.next;while(S!==c)}else k===null&&(S.shared.lanes=0);$s|=_,a.lanes=_,a.memoizedState=ye}}function _b(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var y=a[c],S=y.callback;if(S!==null){if(y.callback=null,y=f,typeof S!="function")throw Error(n(191,S));S.call(y)}}}var Db=new e.Component().refs;function Kh(a,c,f,y){c=a.memoizedState,f=f(y,c),f=f==null?c:I({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var Sd={isMounted:function(a){return(a=a._reactInternals)?Kt(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var y=or(),S=rs(a),k=fi(y,S);k.payload=c,f!=null&&(k.callback=f),c=Zi(a,k,S),c!==null&&(xo(c,a,S,y),bd(c,a,S))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var y=or(),S=rs(a),k=fi(y,S);k.tag=1,k.payload=c,f!=null&&(k.callback=f),c=Zi(a,k,S),c!==null&&(xo(c,a,S,y),bd(c,a,S))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=or(),y=rs(a),S=fi(f,y);S.tag=2,c!=null&&(S.callback=c),c=Zi(a,S,y),c!==null&&(xo(c,a,y,f),bd(c,a,y))}};function Ib(a,c,f,y,S,k,_){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(y,k,_):c.prototype&&c.prototype.isPureReactComponent?!hc(f,y)||!hc(S,k):!0}function Ab(a,c,f){var y=!1,S=Yi,k=c.contextType;return typeof k=="object"&&k!==null?k=Kr(k):(S=mr(c)?Is:Yn.current,y=c.contextTypes,k=(y=y!=null)?Ha(a,S):Yi),c=new c(f,k),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Sd,a.stateNode=c,c._reactInternals=a,y&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=S,a.__reactInternalMemoizedMaskedChildContext=k),c}function Nb(a,c,f,y){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,y),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,y),c.state!==a&&Sd.enqueueReplaceState(c,c.state,null)}function Yh(a,c,f,y){var S=a.stateNode;S.props=f,S.state=a.memoizedState,S.refs=Db,Qh(a);var k=c.contextType;typeof k=="object"&&k!==null?S.context=Kr(k):(k=mr(c)?Is:Yn.current,S.context=Ha(a,k)),S.state=a.memoizedState,k=c.getDerivedStateFromProps,typeof k=="function"&&(Kh(a,c,k,f),S.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(c=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),c!==S.state&&Sd.enqueueReplaceState(S,S.state,null),wd(a,f,S,y),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308)}function wc(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var y=f.stateNode}if(!y)throw Error(n(147,a));var S=y,k=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===k?c.ref:(c=function(_){var $=S.refs;$===Db&&($=S.refs={}),_===null?delete $[k]:$[k]=_},c._stringRef=k,c)}if(typeof a!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,a))}return a}function jd(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function Ob(a){var c=a._init;return c(a._payload)}function Mb(a){function c(Z,H){if(a){var te=Z.deletions;te===null?(Z.deletions=[H],Z.flags|=16):te.push(H)}}function f(Z,H){if(!a)return null;for(;H!==null;)c(Z,H),H=H.sibling;return null}function y(Z,H){for(Z=new Map;H!==null;)H.key!==null?Z.set(H.key,H):Z.set(H.index,H),H=H.sibling;return Z}function S(Z,H){return Z=is(Z,H),Z.index=0,Z.sibling=null,Z}function k(Z,H,te){return Z.index=te,a?(te=Z.alternate,te!==null?(te=te.index,te<H?(Z.flags|=2,H):te):(Z.flags|=2,H)):(Z.flags|=1048576,H)}function _(Z){return a&&Z.alternate===null&&(Z.flags|=2),Z}function $(Z,H,te,we){return H===null||H.tag!==6?(H=Am(te,Z.mode,we),H.return=Z,H):(H=S(H,te),H.return=Z,H)}function U(Z,H,te,we){var Ze=te.type;return Ze===A?he(Z,H,te.props.children,we,te.key):H!==null&&(H.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===B&&Ob(Ze)===H.type)?(we=S(H,te.props),we.ref=wc(Z,H,te),we.return=Z,we):(we=Bd(te.type,te.key,te.props,null,Z.mode,we),we.ref=wc(Z,H,te),we.return=Z,we)}function ne(Z,H,te,we){return H===null||H.tag!==4||H.stateNode.containerInfo!==te.containerInfo||H.stateNode.implementation!==te.implementation?(H=Nm(te,Z.mode,we),H.return=Z,H):(H=S(H,te.children||[]),H.return=Z,H)}function he(Z,H,te,we,Ze){return H===null||H.tag!==7?(H=Bs(te,Z.mode,we,Ze),H.return=Z,H):(H=S(H,te),H.return=Z,H)}function ye(Z,H,te){if(typeof H=="string"&&H!==""||typeof H=="number")return H=Am(""+H,Z.mode,te),H.return=Z,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case P:return te=Bd(H.type,H.key,H.props,null,Z.mode,te),te.ref=wc(Z,null,H),te.return=Z,te;case D:return H=Nm(H,Z.mode,te),H.return=Z,H;case B:var we=H._init;return ye(Z,we(H._payload),te)}if(Se(H)||F(H))return H=Bs(H,Z.mode,te,null),H.return=Z,H;jd(Z,H)}return null}function pe(Z,H,te,we){var Ze=H!==null?H.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Ze!==null?null:$(Z,H,""+te,we);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case P:return te.key===Ze?U(Z,H,te,we):null;case D:return te.key===Ze?ne(Z,H,te,we):null;case B:return Ze=te._init,pe(Z,H,Ze(te._payload),we)}if(Se(te)||F(te))return Ze!==null?null:he(Z,H,te,we,null);jd(Z,te)}return null}function ze(Z,H,te,we,Ze){if(typeof we=="string"&&we!==""||typeof we=="number")return Z=Z.get(te)||null,$(H,Z,""+we,Ze);if(typeof we=="object"&&we!==null){switch(we.$$typeof){case P:return Z=Z.get(we.key===null?te:we.key)||null,U(H,Z,we,Ze);case D:return Z=Z.get(we.key===null?te:we.key)||null,ne(H,Z,we,Ze);case B:var it=we._init;return ze(Z,H,te,it(we._payload),Ze)}if(Se(we)||F(we))return Z=Z.get(te)||null,he(H,Z,we,Ze,null);jd(H,we)}return null}function Ge(Z,H,te,we){for(var Ze=null,it=null,st=H,dt=H=0,Vn=null;st!==null&&dt<te.length;dt++){st.index>dt?(Vn=st,st=null):Vn=st.sibling;var Ot=pe(Z,st,te[dt],we);if(Ot===null){st===null&&(st=Vn);break}a&&st&&Ot.alternate===null&&c(Z,st),H=k(Ot,H,dt),it===null?Ze=Ot:it.sibling=Ot,it=Ot,st=Vn}if(dt===te.length)return f(Z,st),hn&&Ns(Z,dt),Ze;if(st===null){for(;dt<te.length;dt++)st=ye(Z,te[dt],we),st!==null&&(H=k(st,H,dt),it===null?Ze=st:it.sibling=st,it=st);return hn&&Ns(Z,dt),Ze}for(st=y(Z,st);dt<te.length;dt++)Vn=ze(st,Z,dt,te[dt],we),Vn!==null&&(a&&Vn.alternate!==null&&st.delete(Vn.key===null?dt:Vn.key),H=k(Vn,H,dt),it===null?Ze=Vn:it.sibling=Vn,it=Vn);return a&&st.forEach(function(ss){return c(Z,ss)}),hn&&Ns(Z,dt),Ze}function Ye(Z,H,te,we){var Ze=F(te);if(typeof Ze!="function")throw Error(n(150));if(te=Ze.call(te),te==null)throw Error(n(151));for(var it=Ze=null,st=H,dt=H=0,Vn=null,Ot=te.next();st!==null&&!Ot.done;dt++,Ot=te.next()){st.index>dt?(Vn=st,st=null):Vn=st.sibling;var ss=pe(Z,st,Ot.value,we);if(ss===null){st===null&&(st=Vn);break}a&&st&&ss.alternate===null&&c(Z,st),H=k(ss,H,dt),it===null?Ze=ss:it.sibling=ss,it=ss,st=Vn}if(Ot.done)return f(Z,st),hn&&Ns(Z,dt),Ze;if(st===null){for(;!Ot.done;dt++,Ot=te.next())Ot=ye(Z,Ot.value,we),Ot!==null&&(H=k(Ot,H,dt),it===null?Ze=Ot:it.sibling=Ot,it=Ot);return hn&&Ns(Z,dt),Ze}for(st=y(Z,st);!Ot.done;dt++,Ot=te.next())Ot=ze(st,Z,dt,Ot.value,we),Ot!==null&&(a&&Ot.alternate!==null&&st.delete(Ot.key===null?dt:Ot.key),H=k(Ot,H,dt),it===null?Ze=Ot:it.sibling=Ot,it=Ot);return a&&st.forEach(function(Y_){return c(Z,Y_)}),hn&&Ns(Z,dt),Ze}function Pn(Z,H,te,we){if(typeof te=="object"&&te!==null&&te.type===A&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case P:e:{for(var Ze=te.key,it=H;it!==null;){if(it.key===Ze){if(Ze=te.type,Ze===A){if(it.tag===7){f(Z,it.sibling),H=S(it,te.props.children),H.return=Z,Z=H;break e}}else if(it.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===B&&Ob(Ze)===it.type){f(Z,it.sibling),H=S(it,te.props),H.ref=wc(Z,it,te),H.return=Z,Z=H;break e}f(Z,it);break}else c(Z,it);it=it.sibling}te.type===A?(H=Bs(te.props.children,Z.mode,we,te.key),H.return=Z,Z=H):(we=Bd(te.type,te.key,te.props,null,Z.mode,we),we.ref=wc(Z,H,te),we.return=Z,Z=we)}return _(Z);case D:e:{for(it=te.key;H!==null;){if(H.key===it)if(H.tag===4&&H.stateNode.containerInfo===te.containerInfo&&H.stateNode.implementation===te.implementation){f(Z,H.sibling),H=S(H,te.children||[]),H.return=Z,Z=H;break e}else{f(Z,H);break}else c(Z,H);H=H.sibling}H=Nm(te,Z.mode,we),H.return=Z,Z=H}return _(Z);case B:return it=te._init,Pn(Z,H,it(te._payload),we)}if(Se(te))return Ge(Z,H,te,we);if(F(te))return Ye(Z,H,te,we);jd(Z,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,H!==null&&H.tag===6?(f(Z,H.sibling),H=S(H,te),H.return=Z,Z=H):(f(Z,H),H=Am(te,Z.mode,we),H.return=Z,Z=H),_(Z)):f(Z,H)}return Pn}var Xa=Mb(!0),Lb=Mb(!1),Sc={},Lo=Ki(Sc),jc=Ki(Sc),Cc=Ki(Sc);function Ms(a){if(a===Sc)throw Error(n(174));return a}function Xh(a,c){switch(tn(Cc,c),tn(jc,a),tn(Lo,Sc),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:zt(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=zt(c,a)}cn(Lo),tn(Lo,c)}function Ja(){cn(Lo),cn(jc),cn(Cc)}function $b(a){Ms(Cc.current);var c=Ms(Lo.current),f=zt(c,a.type);c!==f&&(tn(jc,a),tn(Lo,f))}function Jh(a){jc.current===a&&(cn(Lo),cn(jc))}var gn=Ki(0);function Cd(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Zh=[];function em(){for(var a=0;a<Zh.length;a++)Zh[a]._workInProgressVersionPrimary=null;Zh.length=0}var Ed=C.ReactCurrentDispatcher,tm=C.ReactCurrentBatchConfig,Ls=0,vn=null,On=null,Fn=null,kd=!1,Ec=!1,kc=0,y_=0;function Xn(){throw Error(n(321))}function nm(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!ho(a[f],c[f]))return!1;return!0}function rm(a,c,f,y,S,k){if(Ls=k,vn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Ed.current=a===null||a.memoizedState===null?S_:j_,a=f(y,S),Ec){k=0;do{if(Ec=!1,kc=0,25<=k)throw Error(n(301));k+=1,Fn=On=null,c.updateQueue=null,Ed.current=C_,a=f(y,S)}while(Ec)}if(Ed.current=Rd,c=On!==null&&On.next!==null,Ls=0,Fn=On=vn=null,kd=!1,c)throw Error(n(300));return a}function om(){var a=kc!==0;return kc=0,a}function $o(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fn===null?vn.memoizedState=Fn=a:Fn=Fn.next=a,Fn}function Yr(){if(On===null){var a=vn.alternate;a=a!==null?a.memoizedState:null}else a=On.next;var c=Fn===null?vn.memoizedState:Fn.next;if(c!==null)Fn=c,On=a;else{if(a===null)throw Error(n(310));On=a,a={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},Fn===null?vn.memoizedState=Fn=a:Fn=Fn.next=a}return Fn}function Tc(a,c){return typeof c=="function"?c(a):c}function im(a){var c=Yr(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var y=On,S=y.baseQueue,k=f.pending;if(k!==null){if(S!==null){var _=S.next;S.next=k.next,k.next=_}y.baseQueue=S=k,f.pending=null}if(S!==null){k=S.next,y=y.baseState;var $=_=null,U=null,ne=k;do{var he=ne.lane;if((Ls&he)===he)U!==null&&(U=U.next={lane:0,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),y=ne.hasEagerState?ne.eagerState:a(y,ne.action);else{var ye={lane:he,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null};U===null?($=U=ye,_=y):U=U.next=ye,vn.lanes|=he,$s|=he}ne=ne.next}while(ne!==null&&ne!==k);U===null?_=y:U.next=$,ho(y,c.memoizedState)||(gr=!0),c.memoizedState=y,c.baseState=_,c.baseQueue=U,f.lastRenderedState=y}if(a=f.interleaved,a!==null){S=a;do k=S.lane,vn.lanes|=k,$s|=k,S=S.next;while(S!==a)}else S===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function sm(a){var c=Yr(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var y=f.dispatch,S=f.pending,k=c.memoizedState;if(S!==null){f.pending=null;var _=S=S.next;do k=a(k,_.action),_=_.next;while(_!==S);ho(k,c.memoizedState)||(gr=!0),c.memoizedState=k,c.baseQueue===null&&(c.baseState=k),f.lastRenderedState=k}return[k,y]}function Fb(){}function zb(a,c){var f=vn,y=Yr(),S=c(),k=!ho(y.memoizedState,S);if(k&&(y.memoizedState=S,gr=!0),y=y.queue,am(Ub.bind(null,f,y,a),[a]),y.getSnapshot!==c||k||Fn!==null&&Fn.memoizedState.tag&1){if(f.flags|=2048,Pc(9,Bb.bind(null,f,y,S,c),void 0,null),zn===null)throw Error(n(349));(Ls&30)!==0||Vb(f,c,S)}return S}function Vb(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=vn.updateQueue,c===null?(c={lastEffect:null,stores:null},vn.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function Bb(a,c,f,y){c.value=f,c.getSnapshot=y,Wb(c)&&Hb(a)}function Ub(a,c,f){return f(function(){Wb(c)&&Hb(a)})}function Wb(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!ho(a,f)}catch{return!0}}function Hb(a){var c=di(a,1);c!==null&&xo(c,a,1,-1)}function qb(a){var c=$o();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tc,lastRenderedState:a},c.queue=a,a=a.dispatch=w_.bind(null,vn,a),[c.memoizedState,a]}function Pc(a,c,f,y){return a={tag:a,create:c,destroy:f,deps:y,next:null},c=vn.updateQueue,c===null?(c={lastEffect:null,stores:null},vn.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(y=f.next,f.next=a,a.next=y,c.lastEffect=a)),a}function Gb(){return Yr().memoizedState}function Td(a,c,f,y){var S=$o();vn.flags|=a,S.memoizedState=Pc(1|c,f,void 0,y===void 0?null:y)}function Pd(a,c,f,y){var S=Yr();y=y===void 0?null:y;var k=void 0;if(On!==null){var _=On.memoizedState;if(k=_.destroy,y!==null&&nm(y,_.deps)){S.memoizedState=Pc(c,f,k,y);return}}vn.flags|=a,S.memoizedState=Pc(1|c,f,k,y)}function Qb(a,c){return Td(8390656,8,a,c)}function am(a,c){return Pd(2048,8,a,c)}function Kb(a,c){return Pd(4,2,a,c)}function Yb(a,c){return Pd(4,4,a,c)}function Xb(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function Jb(a,c,f){return f=f!=null?f.concat([a]):null,Pd(4,4,Xb.bind(null,c,a),f)}function lm(){}function Zb(a,c){var f=Yr();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&nm(c,y[1])?y[0]:(f.memoizedState=[a,c],a)}function ew(a,c){var f=Yr();c=c===void 0?null:c;var y=f.memoizedState;return y!==null&&c!==null&&nm(c,y[1])?y[0]:(a=a(),f.memoizedState=[a,c],a)}function tw(a,c,f){return(Ls&21)===0?(a.baseState&&(a.baseState=!1,gr=!0),a.memoizedState=f):(ho(f,c)||(f=T0(),vn.lanes|=f,$s|=f,a.baseState=!0),c)}function x_(a,c){var f=Ht;Ht=f!==0&&4>f?f:4,a(!0);var y=tm.transition;tm.transition={};try{a(!1),c()}finally{Ht=f,tm.transition=y}}function nw(){return Yr().memoizedState}function b_(a,c,f){var y=rs(a);if(f={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null},rw(a))ow(c,f);else if(f=Tb(a,c,f,y),f!==null){var S=or();xo(f,a,y,S),iw(f,c,y)}}function w_(a,c,f){var y=rs(a),S={lane:y,action:f,hasEagerState:!1,eagerState:null,next:null};if(rw(a))ow(c,S);else{var k=a.alternate;if(a.lanes===0&&(k===null||k.lanes===0)&&(k=c.lastRenderedReducer,k!==null))try{var _=c.lastRenderedState,$=k(_,f);if(S.hasEagerState=!0,S.eagerState=$,ho($,_)){var U=c.interleaved;U===null?(S.next=S,Gh(c)):(S.next=U.next,U.next=S),c.interleaved=S;return}}catch{}finally{}f=Tb(a,c,S,y),f!==null&&(S=or(),xo(f,a,y,S),iw(f,c,y))}}function rw(a){var c=a.alternate;return a===vn||c!==null&&c===vn}function ow(a,c){Ec=kd=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function iw(a,c,f){if((f&4194240)!==0){var y=c.lanes;y&=a.pendingLanes,f|=y,c.lanes=f,lh(a,f)}}var Rd={readContext:Kr,useCallback:Xn,useContext:Xn,useEffect:Xn,useImperativeHandle:Xn,useInsertionEffect:Xn,useLayoutEffect:Xn,useMemo:Xn,useReducer:Xn,useRef:Xn,useState:Xn,useDebugValue:Xn,useDeferredValue:Xn,useTransition:Xn,useMutableSource:Xn,useSyncExternalStore:Xn,useId:Xn,unstable_isNewReconciler:!1},S_={readContext:Kr,useCallback:function(a,c){return $o().memoizedState=[a,c===void 0?null:c],a},useContext:Kr,useEffect:Qb,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,Td(4194308,4,Xb.bind(null,c,a),f)},useLayoutEffect:function(a,c){return Td(4194308,4,a,c)},useInsertionEffect:function(a,c){return Td(4,2,a,c)},useMemo:function(a,c){var f=$o();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var y=$o();return c=f!==void 0?f(c):c,y.memoizedState=y.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},y.queue=a,a=a.dispatch=b_.bind(null,vn,a),[y.memoizedState,a]},useRef:function(a){var c=$o();return a={current:a},c.memoizedState=a},useState:qb,useDebugValue:lm,useDeferredValue:function(a){return $o().memoizedState=a},useTransition:function(){var a=qb(!1),c=a[0];return a=x_.bind(null,a[1]),$o().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var y=vn,S=$o();if(hn){if(f===void 0)throw Error(n(407));f=f()}else{if(f=c(),zn===null)throw Error(n(349));(Ls&30)!==0||Vb(y,c,f)}S.memoizedState=f;var k={value:f,getSnapshot:c};return S.queue=k,Qb(Ub.bind(null,y,k,a),[a]),y.flags|=2048,Pc(9,Bb.bind(null,y,k,f,c),void 0,null),f},useId:function(){var a=$o(),c=zn.identifierPrefix;if(hn){var f=ui,y=ci;f=(y&~(1<<32-Dr(y)-1)).toString(32)+f,c=":"+c+"R"+f,f=kc++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=y_++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},j_={readContext:Kr,useCallback:Zb,useContext:Kr,useEffect:am,useImperativeHandle:Jb,useInsertionEffect:Kb,useLayoutEffect:Yb,useMemo:ew,useReducer:im,useRef:Gb,useState:function(){return im(Tc)},useDebugValue:lm,useDeferredValue:function(a){var c=Yr();return tw(c,On.memoizedState,a)},useTransition:function(){var a=im(Tc)[0],c=Yr().memoizedState;return[a,c]},useMutableSource:Fb,useSyncExternalStore:zb,useId:nw,unstable_isNewReconciler:!1},C_={readContext:Kr,useCallback:Zb,useContext:Kr,useEffect:am,useImperativeHandle:Jb,useInsertionEffect:Kb,useLayoutEffect:Yb,useMemo:ew,useReducer:sm,useRef:Gb,useState:function(){return sm(Tc)},useDebugValue:lm,useDeferredValue:function(a){var c=Yr();return On===null?c.memoizedState=a:tw(c,On.memoizedState,a)},useTransition:function(){var a=sm(Tc)[0],c=Yr().memoizedState;return[a,c]},useMutableSource:Fb,useSyncExternalStore:zb,useId:nw,unstable_isNewReconciler:!1};function Za(a,c){try{var f="",y=c;do f+=ge(y),y=y.return;while(y);var S=f}catch(k){S=`
|
|
82
|
+
Error generating stack: `+k.message+`
|
|
83
|
+
`+k.stack}return{value:a,source:c,stack:S,digest:null}}function cm(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function um(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var E_=typeof WeakMap=="function"?WeakMap:Map;function sw(a,c,f){f=fi(-1,f),f.tag=3,f.payload={element:null};var y=c.value;return f.callback=function(){Md||(Md=!0,Em=y),um(a,c)},f}function aw(a,c,f){f=fi(-1,f),f.tag=3;var y=a.type.getDerivedStateFromError;if(typeof y=="function"){var S=c.value;f.payload=function(){return y(S)},f.callback=function(){um(a,c)}}var k=a.stateNode;return k!==null&&typeof k.componentDidCatch=="function"&&(f.callback=function(){um(a,c),typeof y!="function"&&(ts===null?ts=new Set([this]):ts.add(this));var _=c.stack;this.componentDidCatch(c.value,{componentStack:_!==null?_:""})}),f}function lw(a,c,f){var y=a.pingCache;if(y===null){y=a.pingCache=new E_;var S=new Set;y.set(c,S)}else S=y.get(c),S===void 0&&(S=new Set,y.set(c,S));S.has(f)||(S.add(f),a=F_.bind(null,a,c,f),c.then(a,a))}function cw(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function uw(a,c,f,y,S){return(a.mode&1)===0?(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=fi(-1,1),c.tag=2,Zi(f,c,1))),f.lanes|=1),a):(a.flags|=65536,a.lanes=S,a)}var k_=C.ReactCurrentOwner,gr=!1;function rr(a,c,f,y){c.child=a===null?Lb(c,null,f,y):Xa(c,a.child,f,y)}function dw(a,c,f,y,S){f=f.render;var k=c.ref;return Ya(c,S),y=rm(a,c,f,y,k,S),f=om(),a!==null&&!gr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,pi(a,c,S)):(hn&&f&&$h(c),c.flags|=1,rr(a,c,y,S),c.child)}function fw(a,c,f,y,S){if(a===null){var k=f.type;return typeof k=="function"&&!Im(k)&&k.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=k,pw(a,c,k,y,S)):(a=Bd(f.type,null,y,c,c.mode,S),a.ref=c.ref,a.return=c,c.child=a)}if(k=a.child,(a.lanes&S)===0){var _=k.memoizedProps;if(f=f.compare,f=f!==null?f:hc,f(_,y)&&a.ref===c.ref)return pi(a,c,S)}return c.flags|=1,a=is(k,y),a.ref=c.ref,a.return=c,c.child=a}function pw(a,c,f,y,S){if(a!==null){var k=a.memoizedProps;if(hc(k,y)&&a.ref===c.ref)if(gr=!1,c.pendingProps=y=k,(a.lanes&S)!==0)(a.flags&131072)!==0&&(gr=!0);else return c.lanes=a.lanes,pi(a,c,S)}return dm(a,c,f,y,S)}function hw(a,c,f){var y=c.pendingProps,S=y.children,k=a!==null?a.memoizedState:null;if(y.mode==="hidden")if((c.mode&1)===0)c.memoizedState={baseLanes:0,cachePool:null,transitions:null},tn(tl,Or),Or|=f;else{if((f&1073741824)===0)return a=k!==null?k.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,tn(tl,Or),Or|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=k!==null?k.baseLanes:f,tn(tl,Or),Or|=y}else k!==null?(y=k.baseLanes|f,c.memoizedState=null):y=f,tn(tl,Or),Or|=y;return rr(a,c,S,f),c.child}function mw(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function dm(a,c,f,y,S){var k=mr(f)?Is:Yn.current;return k=Ha(c,k),Ya(c,S),f=rm(a,c,f,y,k,S),y=om(),a!==null&&!gr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,pi(a,c,S)):(hn&&y&&$h(c),c.flags|=1,rr(a,c,f,S),c.child)}function gw(a,c,f,y,S){if(mr(f)){var k=!0;pd(c)}else k=!1;if(Ya(c,S),c.stateNode===null)Dd(a,c),Ab(c,f,y),Yh(c,f,y,S),y=!0;else if(a===null){var _=c.stateNode,$=c.memoizedProps;_.props=$;var U=_.context,ne=f.contextType;typeof ne=="object"&&ne!==null?ne=Kr(ne):(ne=mr(f)?Is:Yn.current,ne=Ha(c,ne));var he=f.getDerivedStateFromProps,ye=typeof he=="function"||typeof _.getSnapshotBeforeUpdate=="function";ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||($!==y||U!==ne)&&Nb(c,_,y,ne),Ji=!1;var pe=c.memoizedState;_.state=pe,wd(c,y,_,S),U=c.memoizedState,$!==y||pe!==U||hr.current||Ji?(typeof he=="function"&&(Kh(c,f,he,y),U=c.memoizedState),($=Ji||Ib(c,f,$,y,pe,U,ne))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(c.flags|=4194308)):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=y,c.memoizedState=U),_.props=y,_.state=U,_.context=ne,y=$):(typeof _.componentDidMount=="function"&&(c.flags|=4194308),y=!1)}else{_=c.stateNode,Pb(a,c),$=c.memoizedProps,ne=c.type===c.elementType?$:go(c.type,$),_.props=ne,ye=c.pendingProps,pe=_.context,U=f.contextType,typeof U=="object"&&U!==null?U=Kr(U):(U=mr(f)?Is:Yn.current,U=Ha(c,U));var ze=f.getDerivedStateFromProps;(he=typeof ze=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||($!==ye||pe!==U)&&Nb(c,_,y,U),Ji=!1,pe=c.memoizedState,_.state=pe,wd(c,y,_,S);var Ge=c.memoizedState;$!==ye||pe!==Ge||hr.current||Ji?(typeof ze=="function"&&(Kh(c,f,ze,y),Ge=c.memoizedState),(ne=Ji||Ib(c,f,ne,y,pe,Ge,U)||!1)?(he||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(y,Ge,U),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(y,Ge,U)),typeof _.componentDidUpdate=="function"&&(c.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof _.componentDidUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),c.memoizedProps=y,c.memoizedState=Ge),_.props=y,_.state=Ge,_.context=U,y=ne):(typeof _.componentDidUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),y=!1)}return fm(a,c,f,y,k,S)}function fm(a,c,f,y,S,k){mw(a,c);var _=(c.flags&128)!==0;if(!y&&!_)return S&&bb(c,f,!1),pi(a,c,k);y=c.stateNode,k_.current=c;var $=_&&typeof f.getDerivedStateFromError!="function"?null:y.render();return c.flags|=1,a!==null&&_?(c.child=Xa(c,a.child,null,k),c.child=Xa(c,null,$,k)):rr(a,c,$,k),c.memoizedState=y.state,S&&bb(c,f,!0),c.child}function vw(a){var c=a.stateNode;c.pendingContext?yb(a,c.pendingContext,c.pendingContext!==c.context):c.context&&yb(a,c.context,!1),Xh(a,c.containerInfo)}function yw(a,c,f,y,S){return Qa(),Bh(S),c.flags|=256,rr(a,c,f,y),c.child}var pm={dehydrated:null,treeContext:null,retryLane:0};function hm(a){return{baseLanes:a,cachePool:null,transitions:null}}function xw(a,c,f){var y=c.pendingProps,S=gn.current,k=!1,_=(c.flags&128)!==0,$;if(($=_)||($=a!==null&&a.memoizedState===null?!1:(S&2)!==0),$?(k=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(S|=1),tn(gn,S&1),a===null)return Vh(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?((c.mode&1)===0?c.lanes=1:a.data==="$!"?c.lanes=8:c.lanes=1073741824,null):(_=y.children,a=y.fallback,k?(y=c.mode,k=c.child,_={mode:"hidden",children:_},(y&1)===0&&k!==null?(k.childLanes=0,k.pendingProps=_):k=Ud(_,y,0,null),a=Bs(a,y,f,null),k.return=c,a.return=c,k.sibling=a,c.child=k,c.child.memoizedState=hm(f),c.memoizedState=pm,a):mm(c,_));if(S=a.memoizedState,S!==null&&($=S.dehydrated,$!==null))return T_(a,c,_,y,$,S,f);if(k){k=y.fallback,_=c.mode,S=a.child,$=S.sibling;var U={mode:"hidden",children:y.children};return(_&1)===0&&c.child!==S?(y=c.child,y.childLanes=0,y.pendingProps=U,c.deletions=null):(y=is(S,U),y.subtreeFlags=S.subtreeFlags&14680064),$!==null?k=is($,k):(k=Bs(k,_,f,null),k.flags|=2),k.return=c,y.return=c,y.sibling=k,c.child=y,y=k,k=c.child,_=a.child.memoizedState,_=_===null?hm(f):{baseLanes:_.baseLanes|f,cachePool:null,transitions:_.transitions},k.memoizedState=_,k.childLanes=a.childLanes&~f,c.memoizedState=pm,y}return k=a.child,a=k.sibling,y=is(k,{mode:"visible",children:y.children}),(c.mode&1)===0&&(y.lanes=f),y.return=c,y.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=y,c.memoizedState=null,y}function mm(a,c){return c=Ud({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function _d(a,c,f,y){return y!==null&&Bh(y),Xa(c,a.child,null,f),a=mm(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function T_(a,c,f,y,S,k,_){if(f)return c.flags&256?(c.flags&=-257,y=cm(Error(n(422))),_d(a,c,_,y)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(k=y.fallback,S=c.mode,y=Ud({mode:"visible",children:y.children},S,0,null),k=Bs(k,S,_,null),k.flags|=2,y.return=c,k.return=c,y.sibling=k,c.child=y,(c.mode&1)!==0&&Xa(c,a.child,null,_),c.child.memoizedState=hm(_),c.memoizedState=pm,k);if((c.mode&1)===0)return _d(a,c,_,null);if(S.data==="$!"){if(y=S.nextSibling&&S.nextSibling.dataset,y)var $=y.dgst;return y=$,k=Error(n(419)),y=cm(k,y,void 0),_d(a,c,_,y)}if($=(_&a.childLanes)!==0,gr||$){if(y=zn,y!==null){switch(_&-_){case 4:S=2;break;case 16:S=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:S=32;break;case 536870912:S=268435456;break;default:S=0}S=(S&(y.suspendedLanes|_))!==0?0:S,S!==0&&S!==k.retryLane&&(k.retryLane=S,di(a,S),xo(y,a,S,-1))}return Dm(),y=cm(Error(n(421))),_d(a,c,_,y)}return S.data==="$?"?(c.flags|=128,c.child=a.child,c=z_.bind(null,a),S._reactRetry=c,null):(a=k.treeContext,Nr=Qi(S.nextSibling),Ar=c,hn=!0,mo=null,a!==null&&(Gr[Qr++]=ci,Gr[Qr++]=ui,Gr[Qr++]=As,ci=a.id,ui=a.overflow,As=c),c=mm(c,y.children),c.flags|=4096,c)}function bw(a,c,f){a.lanes|=c;var y=a.alternate;y!==null&&(y.lanes|=c),qh(a.return,c,f)}function gm(a,c,f,y,S){var k=a.memoizedState;k===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:y,tail:f,tailMode:S}:(k.isBackwards=c,k.rendering=null,k.renderingStartTime=0,k.last=y,k.tail=f,k.tailMode=S)}function ww(a,c,f){var y=c.pendingProps,S=y.revealOrder,k=y.tail;if(rr(a,c,y.children,f),y=gn.current,(y&2)!==0)y=y&1|2,c.flags|=128;else{if(a!==null&&(a.flags&128)!==0)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&bw(a,f,c);else if(a.tag===19)bw(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}y&=1}if(tn(gn,y),(c.mode&1)===0)c.memoizedState=null;else switch(S){case"forwards":for(f=c.child,S=null;f!==null;)a=f.alternate,a!==null&&Cd(a)===null&&(S=f),f=f.sibling;f=S,f===null?(S=c.child,c.child=null):(S=f.sibling,f.sibling=null),gm(c,!1,S,f,k);break;case"backwards":for(f=null,S=c.child,c.child=null;S!==null;){if(a=S.alternate,a!==null&&Cd(a)===null){c.child=S;break}a=S.sibling,S.sibling=f,f=S,S=a}gm(c,!0,f,null,k);break;case"together":gm(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Dd(a,c){(c.mode&1)===0&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function pi(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),$s|=c.lanes,(f&c.childLanes)===0)return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,f=is(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=is(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function P_(a,c,f){switch(c.tag){case 3:vw(c),Qa();break;case 5:$b(c);break;case 1:mr(c.type)&&pd(c);break;case 4:Xh(c,c.stateNode.containerInfo);break;case 10:var y=c.type._context,S=c.memoizedProps.value;tn(yd,y._currentValue),y._currentValue=S;break;case 13:if(y=c.memoizedState,y!==null)return y.dehydrated!==null?(tn(gn,gn.current&1),c.flags|=128,null):(f&c.child.childLanes)!==0?xw(a,c,f):(tn(gn,gn.current&1),a=pi(a,c,f),a!==null?a.sibling:null);tn(gn,gn.current&1);break;case 19:if(y=(f&c.childLanes)!==0,(a.flags&128)!==0){if(y)return ww(a,c,f);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),tn(gn,gn.current),y)break;return null;case 22:case 23:return c.lanes=0,hw(a,c,f)}return pi(a,c,f)}var Sw,vm,jw,Cw;Sw=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},vm=function(){},jw=function(a,c,f,y){var S=a.memoizedProps;if(S!==y){a=c.stateNode,Ms(Lo.current);var k=null;switch(f){case"input":S=Tt(a,S),y=Tt(a,y),k=[];break;case"select":S=I({},S,{value:void 0}),y=I({},y,{value:void 0}),k=[];break;case"textarea":S=me(a,S),y=me(a,y),k=[];break;default:typeof S.onClick!="function"&&typeof y.onClick=="function"&&(a.onclick=ud)}$n(f,y);var _;f=null;for(ne in S)if(!y.hasOwnProperty(ne)&&S.hasOwnProperty(ne)&&S[ne]!=null)if(ne==="style"){var $=S[ne];for(_ in $)$.hasOwnProperty(_)&&(f||(f={}),f[_]="")}else ne!=="dangerouslySetInnerHTML"&&ne!=="children"&&ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&ne!=="autoFocus"&&(o.hasOwnProperty(ne)?k||(k=[]):(k=k||[]).push(ne,null));for(ne in y){var U=y[ne];if($=S!=null?S[ne]:void 0,y.hasOwnProperty(ne)&&U!==$&&(U!=null||$!=null))if(ne==="style")if($){for(_ in $)!$.hasOwnProperty(_)||U&&U.hasOwnProperty(_)||(f||(f={}),f[_]="");for(_ in U)U.hasOwnProperty(_)&&$[_]!==U[_]&&(f||(f={}),f[_]=U[_])}else f||(k||(k=[]),k.push(ne,f)),f=U;else ne==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,$=$?$.__html:void 0,U!=null&&$!==U&&(k=k||[]).push(ne,U)):ne==="children"?typeof U!="string"&&typeof U!="number"||(k=k||[]).push(ne,""+U):ne!=="suppressContentEditableWarning"&&ne!=="suppressHydrationWarning"&&(o.hasOwnProperty(ne)?(U!=null&&ne==="onScroll"&&ln("scroll",a),k||$===U||(k=[])):(k=k||[]).push(ne,U))}f&&(k=k||[]).push("style",f);var ne=k;(c.updateQueue=ne)&&(c.flags|=4)}},Cw=function(a,c,f,y){f!==y&&(c.flags|=4)};function Rc(a,c){if(!hn)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:y.sibling=null}}function Jn(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,y=0;if(c)for(var S=a.child;S!==null;)f|=S.lanes|S.childLanes,y|=S.subtreeFlags&14680064,y|=S.flags&14680064,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)f|=S.lanes|S.childLanes,y|=S.subtreeFlags,y|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=y,a.childLanes=f,c}function R_(a,c,f){var y=c.pendingProps;switch(Fh(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jn(c),null;case 1:return mr(c.type)&&fd(),Jn(c),null;case 3:return y=c.stateNode,Ja(),cn(hr),cn(Yn),em(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(a===null||a.child===null)&&(vd(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,mo!==null&&(Pm(mo),mo=null))),vm(a,c),Jn(c),null;case 5:Jh(c);var S=Ms(Cc.current);if(f=c.type,a!==null&&c.stateNode!=null)jw(a,c,f,y,S),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!y){if(c.stateNode===null)throw Error(n(166));return Jn(c),null}if(a=Ms(Lo.current),vd(c)){y=c.stateNode,f=c.type;var k=c.memoizedProps;switch(y[Mo]=c,y[xc]=k,a=(c.mode&1)!==0,f){case"dialog":ln("cancel",y),ln("close",y);break;case"iframe":case"object":case"embed":ln("load",y);break;case"video":case"audio":for(S=0;S<gc.length;S++)ln(gc[S],y);break;case"source":ln("error",y);break;case"img":case"image":case"link":ln("error",y),ln("load",y);break;case"details":ln("toggle",y);break;case"input":Nt(y,k),ln("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!k.multiple},ln("invalid",y);break;case"textarea":Ue(y,k),ln("invalid",y)}$n(f,k),S=null;for(var _ in k)if(k.hasOwnProperty(_)){var $=k[_];_==="children"?typeof $=="string"?y.textContent!==$&&(k.suppressHydrationWarning!==!0&&cd(y.textContent,$,a),S=["children",$]):typeof $=="number"&&y.textContent!==""+$&&(k.suppressHydrationWarning!==!0&&cd(y.textContent,$,a),S=["children",""+$]):o.hasOwnProperty(_)&&$!=null&&_==="onScroll"&&ln("scroll",y)}switch(f){case"input":yt(y),Ie(y,k,!0);break;case"textarea":yt(y),Ae(y);break;case"select":case"option":break;default:typeof k.onClick=="function"&&(y.onclick=ud)}y=S,c.updateQueue=y,y!==null&&(c.flags|=4)}else{_=S.nodeType===9?S:S.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=pt(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=_.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof y.is=="string"?a=_.createElement(f,{is:y.is}):(a=_.createElement(f),f==="select"&&(_=a,y.multiple?_.multiple=!0:y.size&&(_.size=y.size))):a=_.createElementNS(a,f),a[Mo]=c,a[xc]=y,Sw(a,c,!1,!1),c.stateNode=a;e:{switch(_=No(f,y),f){case"dialog":ln("cancel",a),ln("close",a),S=y;break;case"iframe":case"object":case"embed":ln("load",a),S=y;break;case"video":case"audio":for(S=0;S<gc.length;S++)ln(gc[S],a);S=y;break;case"source":ln("error",a),S=y;break;case"img":case"image":case"link":ln("error",a),ln("load",a),S=y;break;case"details":ln("toggle",a),S=y;break;case"input":Nt(a,y),S=Tt(a,y),ln("invalid",a);break;case"option":S=y;break;case"select":a._wrapperState={wasMultiple:!!y.multiple},S=I({},y,{value:void 0}),ln("invalid",a);break;case"textarea":Ue(a,y),S=me(a,y),ln("invalid",a);break;default:S=y}$n(f,S),$=S;for(k in $)if($.hasOwnProperty(k)){var U=$[k];k==="style"?Da(a,U):k==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&jn(a,U)):k==="children"?typeof U=="string"?(f!=="textarea"||U!=="")&&Ct(a,U):typeof U=="number"&&Ct(a,""+U):k!=="suppressContentEditableWarning"&&k!=="suppressHydrationWarning"&&k!=="autoFocus"&&(o.hasOwnProperty(k)?U!=null&&k==="onScroll"&&ln("scroll",a):U!=null&&E(a,k,U,_))}switch(f){case"input":yt(a),Ie(a,y,!1);break;case"textarea":yt(a),Ae(a);break;case"option":y.value!=null&&a.setAttribute("value",""+ke(y.value));break;case"select":a.multiple=!!y.multiple,k=y.value,k!=null?ce(a,!!y.multiple,k,!1):y.defaultValue!=null&&ce(a,!!y.multiple,y.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=ud)}switch(f){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return Jn(c),null;case 6:if(a&&c.stateNode!=null)Cw(a,c,a.memoizedProps,y);else{if(typeof y!="string"&&c.stateNode===null)throw Error(n(166));if(f=Ms(Cc.current),Ms(Lo.current),vd(c)){if(y=c.stateNode,f=c.memoizedProps,y[Mo]=c,(k=y.nodeValue!==f)&&(a=Ar,a!==null))switch(a.tag){case 3:cd(y.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&cd(y.nodeValue,f,(a.mode&1)!==0)}k&&(c.flags|=4)}else y=(f.nodeType===9?f:f.ownerDocument).createTextNode(y),y[Mo]=c,c.stateNode=y}return Jn(c),null;case 13:if(cn(gn),y=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(hn&&Nr!==null&&(c.mode&1)!==0&&(c.flags&128)===0)kb(),Qa(),c.flags|=98560,k=!1;else if(k=vd(c),y!==null&&y.dehydrated!==null){if(a===null){if(!k)throw Error(n(318));if(k=c.memoizedState,k=k!==null?k.dehydrated:null,!k)throw Error(n(317));k[Mo]=c}else Qa(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;Jn(c),k=!1}else mo!==null&&(Pm(mo),mo=null),k=!0;if(!k)return c.flags&65536?c:null}return(c.flags&128)!==0?(c.lanes=f,c):(y=y!==null,y!==(a!==null&&a.memoizedState!==null)&&y&&(c.child.flags|=8192,(c.mode&1)!==0&&(a===null||(gn.current&1)!==0?Mn===0&&(Mn=3):Dm())),c.updateQueue!==null&&(c.flags|=4),Jn(c),null);case 4:return Ja(),vm(a,c),a===null&&vc(c.stateNode.containerInfo),Jn(c),null;case 10:return Hh(c.type._context),Jn(c),null;case 17:return mr(c.type)&&fd(),Jn(c),null;case 19:if(cn(gn),k=c.memoizedState,k===null)return Jn(c),null;if(y=(c.flags&128)!==0,_=k.rendering,_===null)if(y)Rc(k,!1);else{if(Mn!==0||a!==null&&(a.flags&128)!==0)for(a=c.child;a!==null;){if(_=Cd(a),_!==null){for(c.flags|=128,Rc(k,!1),y=_.updateQueue,y!==null&&(c.updateQueue=y,c.flags|=4),c.subtreeFlags=0,y=f,f=c.child;f!==null;)k=f,a=y,k.flags&=14680066,_=k.alternate,_===null?(k.childLanes=0,k.lanes=a,k.child=null,k.subtreeFlags=0,k.memoizedProps=null,k.memoizedState=null,k.updateQueue=null,k.dependencies=null,k.stateNode=null):(k.childLanes=_.childLanes,k.lanes=_.lanes,k.child=_.child,k.subtreeFlags=0,k.deletions=null,k.memoizedProps=_.memoizedProps,k.memoizedState=_.memoizedState,k.updateQueue=_.updateQueue,k.type=_.type,a=_.dependencies,k.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return tn(gn,gn.current&1|2),c.child}a=a.sibling}k.tail!==null&&Ut()>nl&&(c.flags|=128,y=!0,Rc(k,!1),c.lanes=4194304)}else{if(!y)if(a=Cd(_),a!==null){if(c.flags|=128,y=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),Rc(k,!0),k.tail===null&&k.tailMode==="hidden"&&!_.alternate&&!hn)return Jn(c),null}else 2*Ut()-k.renderingStartTime>nl&&f!==1073741824&&(c.flags|=128,y=!0,Rc(k,!1),c.lanes=4194304);k.isBackwards?(_.sibling=c.child,c.child=_):(f=k.last,f!==null?f.sibling=_:c.child=_,k.last=_)}return k.tail!==null?(c=k.tail,k.rendering=c,k.tail=c.sibling,k.renderingStartTime=Ut(),c.sibling=null,f=gn.current,tn(gn,y?f&1|2:f&1),c):(Jn(c),null);case 22:case 23:return _m(),y=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==y&&(c.flags|=8192),y&&(c.mode&1)!==0?(Or&1073741824)!==0&&(Jn(c),c.subtreeFlags&6&&(c.flags|=8192)):Jn(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function __(a,c){switch(Fh(c),c.tag){case 1:return mr(c.type)&&fd(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Ja(),cn(hr),cn(Yn),em(),a=c.flags,(a&65536)!==0&&(a&128)===0?(c.flags=a&-65537|128,c):null;case 5:return Jh(c),null;case 13:if(cn(gn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Qa()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return cn(gn),null;case 4:return Ja(),null;case 10:return Hh(c.type._context),null;case 22:case 23:return _m(),null;case 24:return null;default:return null}}var Id=!1,Zn=!1,D_=typeof WeakSet=="function"?WeakSet:Set,He=null;function el(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(y){Cn(a,c,y)}else f.current=null}function ym(a,c,f){try{f()}catch(y){Cn(a,c,y)}}var Ew=!1;function I_(a,c){if(_h=Ju,a=nb(),Sh(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var y=f.getSelection&&f.getSelection();if(y&&y.rangeCount!==0){f=y.anchorNode;var S=y.anchorOffset,k=y.focusNode;y=y.focusOffset;try{f.nodeType,k.nodeType}catch{f=null;break e}var _=0,$=-1,U=-1,ne=0,he=0,ye=a,pe=null;t:for(;;){for(var ze;ye!==f||S!==0&&ye.nodeType!==3||($=_+S),ye!==k||y!==0&&ye.nodeType!==3||(U=_+y),ye.nodeType===3&&(_+=ye.nodeValue.length),(ze=ye.firstChild)!==null;)pe=ye,ye=ze;for(;;){if(ye===a)break t;if(pe===f&&++ne===S&&($=_),pe===k&&++he===y&&(U=_),(ze=ye.nextSibling)!==null)break;ye=pe,pe=ye.parentNode}ye=ze}f=$===-1||U===-1?null:{start:$,end:U}}else f=null}f=f||{start:0,end:0}}else f=null;for(Dh={focusedElem:a,selectionRange:f},Ju=!1,He=c;He!==null;)if(c=He,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,He=a;else for(;He!==null;){c=He;try{var Ge=c.alternate;if((c.flags&1024)!==0)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ge!==null){var Ye=Ge.memoizedProps,Pn=Ge.memoizedState,Z=c.stateNode,H=Z.getSnapshotBeforeUpdate(c.elementType===c.type?Ye:go(c.type,Ye),Pn);Z.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var te=c.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(we){Cn(c,c.return,we)}if(a=c.sibling,a!==null){a.return=c.return,He=a;break}He=c.return}return Ge=Ew,Ew=!1,Ge}function _c(a,c,f){var y=c.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var S=y=y.next;do{if((S.tag&a)===a){var k=S.destroy;S.destroy=void 0,k!==void 0&&ym(c,f,k)}S=S.next}while(S!==y)}}function Ad(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var y=f.create;f.destroy=y()}f=f.next}while(f!==c)}}function xm(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function kw(a){var c=a.alternate;c!==null&&(a.alternate=null,kw(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Mo],delete c[xc],delete c[Oh],delete c[h_],delete c[m_])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function Tw(a){return a.tag===5||a.tag===3||a.tag===4}function Pw(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Tw(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function bm(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=ud));else if(y!==4&&(a=a.child,a!==null))for(bm(a,c,f),a=a.sibling;a!==null;)bm(a,c,f),a=a.sibling}function wm(a,c,f){var y=a.tag;if(y===5||y===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(y!==4&&(a=a.child,a!==null))for(wm(a,c,f),a=a.sibling;a!==null;)wm(a,c,f),a=a.sibling}var Wn=null,vo=!1;function es(a,c,f){for(f=f.child;f!==null;)Rw(a,c,f),f=f.sibling}function Rw(a,c,f){if(Un&&typeof Un.onCommitFiberUnmount=="function")try{Un.onCommitFiberUnmount(an,f)}catch{}switch(f.tag){case 5:Zn||el(f,c);case 6:var y=Wn,S=vo;Wn=null,es(a,c,f),Wn=y,vo=S,Wn!==null&&(vo?(a=Wn,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Wn.removeChild(f.stateNode));break;case 18:Wn!==null&&(vo?(a=Wn,f=f.stateNode,a.nodeType===8?Nh(a.parentNode,f):a.nodeType===1&&Nh(a,f),lc(a)):Nh(Wn,f.stateNode));break;case 4:y=Wn,S=vo,Wn=f.stateNode.containerInfo,vo=!0,es(a,c,f),Wn=y,vo=S;break;case 0:case 11:case 14:case 15:if(!Zn&&(y=f.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){S=y=y.next;do{var k=S,_=k.destroy;k=k.tag,_!==void 0&&((k&2)!==0||(k&4)!==0)&&ym(f,c,_),S=S.next}while(S!==y)}es(a,c,f);break;case 1:if(!Zn&&(el(f,c),y=f.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=f.memoizedProps,y.state=f.memoizedState,y.componentWillUnmount()}catch($){Cn(f,c,$)}es(a,c,f);break;case 21:es(a,c,f);break;case 22:f.mode&1?(Zn=(y=Zn)||f.memoizedState!==null,es(a,c,f),Zn=y):es(a,c,f);break;default:es(a,c,f)}}function _w(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new D_),c.forEach(function(y){var S=V_.bind(null,a,y);f.has(y)||(f.add(y),y.then(S,S))})}}function yo(a,c){var f=c.deletions;if(f!==null)for(var y=0;y<f.length;y++){var S=f[y];try{var k=a,_=c,$=_;e:for(;$!==null;){switch($.tag){case 5:Wn=$.stateNode,vo=!1;break e;case 3:Wn=$.stateNode.containerInfo,vo=!0;break e;case 4:Wn=$.stateNode.containerInfo,vo=!0;break e}$=$.return}if(Wn===null)throw Error(n(160));Rw(k,_,S),Wn=null,vo=!1;var U=S.alternate;U!==null&&(U.return=null),S.return=null}catch(ne){Cn(S,c,ne)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)Dw(c,a),c=c.sibling}function Dw(a,c){var f=a.alternate,y=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(yo(c,a),Fo(a),y&4){try{_c(3,a,a.return),Ad(3,a)}catch(Ye){Cn(a,a.return,Ye)}try{_c(5,a,a.return)}catch(Ye){Cn(a,a.return,Ye)}}break;case 1:yo(c,a),Fo(a),y&512&&f!==null&&el(f,f.return);break;case 5:if(yo(c,a),Fo(a),y&512&&f!==null&&el(f,f.return),a.flags&32){var S=a.stateNode;try{Ct(S,"")}catch(Ye){Cn(a,a.return,Ye)}}if(y&4&&(S=a.stateNode,S!=null)){var k=a.memoizedProps,_=f!==null?f.memoizedProps:k,$=a.type,U=a.updateQueue;if(a.updateQueue=null,U!==null)try{$==="input"&&k.type==="radio"&&k.name!=null&&Pt(S,k),No($,_);var ne=No($,k);for(_=0;_<U.length;_+=2){var he=U[_],ye=U[_+1];he==="style"?Da(S,ye):he==="dangerouslySetInnerHTML"?jn(S,ye):he==="children"?Ct(S,ye):E(S,he,ye,ne)}switch($){case"input":be(S,k);break;case"textarea":de(S,k);break;case"select":var pe=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!k.multiple;var ze=k.value;ze!=null?ce(S,!!k.multiple,ze,!1):pe!==!!k.multiple&&(k.defaultValue!=null?ce(S,!!k.multiple,k.defaultValue,!0):ce(S,!!k.multiple,k.multiple?[]:"",!1))}S[xc]=k}catch(Ye){Cn(a,a.return,Ye)}}break;case 6:if(yo(c,a),Fo(a),y&4){if(a.stateNode===null)throw Error(n(162));S=a.stateNode,k=a.memoizedProps;try{S.nodeValue=k}catch(Ye){Cn(a,a.return,Ye)}}break;case 3:if(yo(c,a),Fo(a),y&4&&f!==null&&f.memoizedState.isDehydrated)try{lc(c.containerInfo)}catch(Ye){Cn(a,a.return,Ye)}break;case 4:yo(c,a),Fo(a);break;case 13:yo(c,a),Fo(a),S=a.child,S.flags&8192&&(k=S.memoizedState!==null,S.stateNode.isHidden=k,!k||S.alternate!==null&&S.alternate.memoizedState!==null||(Cm=Ut())),y&4&&_w(a);break;case 22:if(he=f!==null&&f.memoizedState!==null,a.mode&1?(Zn=(ne=Zn)||he,yo(c,a),Zn=ne):yo(c,a),Fo(a),y&8192){if(ne=a.memoizedState!==null,(a.stateNode.isHidden=ne)&&!he&&(a.mode&1)!==0)for(He=a,he=a.child;he!==null;){for(ye=He=he;He!==null;){switch(pe=He,ze=pe.child,pe.tag){case 0:case 11:case 14:case 15:_c(4,pe,pe.return);break;case 1:el(pe,pe.return);var Ge=pe.stateNode;if(typeof Ge.componentWillUnmount=="function"){y=pe,f=pe.return;try{c=y,Ge.props=c.memoizedProps,Ge.state=c.memoizedState,Ge.componentWillUnmount()}catch(Ye){Cn(y,f,Ye)}}break;case 5:el(pe,pe.return);break;case 22:if(pe.memoizedState!==null){Nw(ye);continue}}ze!==null?(ze.return=pe,He=ze):Nw(ye)}he=he.sibling}e:for(he=null,ye=a;;){if(ye.tag===5){if(he===null){he=ye;try{S=ye.stateNode,ne?(k=S.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none"):($=ye.stateNode,U=ye.memoizedProps.style,_=U!=null&&U.hasOwnProperty("display")?U.display:null,$.style.display=oi("display",_))}catch(Ye){Cn(a,a.return,Ye)}}}else if(ye.tag===6){if(he===null)try{ye.stateNode.nodeValue=ne?"":ye.memoizedProps}catch(Ye){Cn(a,a.return,Ye)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===a)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===a)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===a)break e;he===ye&&(he=null),ye=ye.return}he===ye&&(he=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:yo(c,a),Fo(a),y&4&&_w(a);break;case 21:break;default:yo(c,a),Fo(a)}}function Fo(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(Tw(f)){var y=f;break e}f=f.return}throw Error(n(160))}switch(y.tag){case 5:var S=y.stateNode;y.flags&32&&(Ct(S,""),y.flags&=-33);var k=Pw(a);wm(a,k,S);break;case 3:case 4:var _=y.stateNode.containerInfo,$=Pw(a);bm(a,$,_);break;default:throw Error(n(161))}}catch(U){Cn(a,a.return,U)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function A_(a,c,f){He=a,Iw(a)}function Iw(a,c,f){for(var y=(a.mode&1)!==0;He!==null;){var S=He,k=S.child;if(S.tag===22&&y){var _=S.memoizedState!==null||Id;if(!_){var $=S.alternate,U=$!==null&&$.memoizedState!==null||Zn;$=Id;var ne=Zn;if(Id=_,(Zn=U)&&!ne)for(He=S;He!==null;)_=He,U=_.child,_.tag===22&&_.memoizedState!==null?Ow(S):U!==null?(U.return=_,He=U):Ow(S);for(;k!==null;)He=k,Iw(k),k=k.sibling;He=S,Id=$,Zn=ne}Aw(a)}else(S.subtreeFlags&8772)!==0&&k!==null?(k.return=S,He=k):Aw(a)}}function Aw(a){for(;He!==null;){var c=He;if((c.flags&8772)!==0){var f=c.alternate;try{if((c.flags&8772)!==0)switch(c.tag){case 0:case 11:case 15:Zn||Ad(5,c);break;case 1:var y=c.stateNode;if(c.flags&4&&!Zn)if(f===null)y.componentDidMount();else{var S=c.elementType===c.type?f.memoizedProps:go(c.type,f.memoizedProps);y.componentDidUpdate(S,f.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var k=c.updateQueue;k!==null&&_b(c,k,y);break;case 3:var _=c.updateQueue;if(_!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}_b(c,_,f)}break;case 5:var $=c.stateNode;if(f===null&&c.flags&4){f=$;var U=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&f.focus();break;case"img":U.src&&(f.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var ne=c.alternate;if(ne!==null){var he=ne.memoizedState;if(he!==null){var ye=he.dehydrated;ye!==null&&lc(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Zn||c.flags&512&&xm(c)}catch(pe){Cn(c,c.return,pe)}}if(c===a){He=null;break}if(f=c.sibling,f!==null){f.return=c.return,He=f;break}He=c.return}}function Nw(a){for(;He!==null;){var c=He;if(c===a){He=null;break}var f=c.sibling;if(f!==null){f.return=c.return,He=f;break}He=c.return}}function Ow(a){for(;He!==null;){var c=He;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Ad(4,c)}catch(U){Cn(c,f,U)}break;case 1:var y=c.stateNode;if(typeof y.componentDidMount=="function"){var S=c.return;try{y.componentDidMount()}catch(U){Cn(c,S,U)}}var k=c.return;try{xm(c)}catch(U){Cn(c,k,U)}break;case 5:var _=c.return;try{xm(c)}catch(U){Cn(c,_,U)}}}catch(U){Cn(c,c.return,U)}if(c===a){He=null;break}var $=c.sibling;if($!==null){$.return=c.return,He=$;break}He=c.return}}var N_=Math.ceil,Nd=C.ReactCurrentDispatcher,Sm=C.ReactCurrentOwner,Xr=C.ReactCurrentBatchConfig,Rt=0,zn=null,In=null,Hn=0,Or=0,tl=Ki(0),Mn=0,Dc=null,$s=0,Od=0,jm=0,Ic=null,vr=null,Cm=0,nl=1/0,hi=null,Md=!1,Em=null,ts=null,Ld=!1,ns=null,$d=0,Ac=0,km=null,Fd=-1,zd=0;function or(){return(Rt&6)!==0?Ut():Fd!==-1?Fd:Fd=Ut()}function rs(a){return(a.mode&1)===0?1:(Rt&2)!==0&&Hn!==0?Hn&-Hn:v_.transition!==null?(zd===0&&(zd=T0()),zd):(a=Ht,a!==0||(a=window.event,a=a===void 0?16:M0(a.type)),a)}function xo(a,c,f,y){if(50<Ac)throw Ac=0,km=null,Error(n(185));rc(a,f,y),((Rt&2)===0||a!==zn)&&(a===zn&&((Rt&2)===0&&(Od|=f),Mn===4&&os(a,Hn)),yr(a,y),f===1&&Rt===0&&(c.mode&1)===0&&(nl=Ut()+500,hd&&Xi()))}function yr(a,c){var f=a.callbackNode;v2(a,c);var y=Ku(a,a===zn?Hn:0);if(y===0)f!==null&&_r(f),a.callbackNode=null,a.callbackPriority=0;else if(c=y&-y,a.callbackPriority!==c){if(f!=null&&_r(f),c===1)a.tag===0?g_(Lw.bind(null,a)):wb(Lw.bind(null,a)),f_(function(){(Rt&6)===0&&Xi()}),f=null;else{switch(P0(y)){case 1:f=zi;break;case 4:f=Wt;break;case 16:f=Tn;break;case 536870912:f=Vi;break;default:f=Tn}f=Hw(f,Mw.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function Mw(a,c){if(Fd=-1,zd=0,(Rt&6)!==0)throw Error(n(327));var f=a.callbackNode;if(rl()&&a.callbackNode!==f)return null;var y=Ku(a,a===zn?Hn:0);if(y===0)return null;if((y&30)!==0||(y&a.expiredLanes)!==0||c)c=Vd(a,y);else{c=y;var S=Rt;Rt|=2;var k=Fw();(zn!==a||Hn!==c)&&(hi=null,nl=Ut()+500,zs(a,c));do try{L_();break}catch($){$w(a,$)}while(!0);Wh(),Nd.current=k,Rt=S,In!==null?c=0:(zn=null,Hn=0,c=Mn)}if(c!==0){if(c===2&&(S=sh(a),S!==0&&(y=S,c=Tm(a,S))),c===1)throw f=Dc,zs(a,0),os(a,y),yr(a,Ut()),f;if(c===6)os(a,y);else{if(S=a.current.alternate,(y&30)===0&&!O_(S)&&(c=Vd(a,y),c===2&&(k=sh(a),k!==0&&(y=k,c=Tm(a,k))),c===1))throw f=Dc,zs(a,0),os(a,y),yr(a,Ut()),f;switch(a.finishedWork=S,a.finishedLanes=y,c){case 0:case 1:throw Error(n(345));case 2:Vs(a,vr,hi);break;case 3:if(os(a,y),(y&130023424)===y&&(c=Cm+500-Ut(),10<c)){if(Ku(a,0)!==0)break;if(S=a.suspendedLanes,(S&y)!==y){or(),a.pingedLanes|=a.suspendedLanes&S;break}a.timeoutHandle=Ah(Vs.bind(null,a,vr,hi),c);break}Vs(a,vr,hi);break;case 4:if(os(a,y),(y&4194240)===y)break;for(c=a.eventTimes,S=-1;0<y;){var _=31-Dr(y);k=1<<_,_=c[_],_>S&&(S=_),y&=~k}if(y=S,y=Ut()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*N_(y/1960))-y,10<y){a.timeoutHandle=Ah(Vs.bind(null,a,vr,hi),y);break}Vs(a,vr,hi);break;case 5:Vs(a,vr,hi);break;default:throw Error(n(329))}}}return yr(a,Ut()),a.callbackNode===f?Mw.bind(null,a):null}function Tm(a,c){var f=Ic;return a.current.memoizedState.isDehydrated&&(zs(a,c).flags|=256),a=Vd(a,c),a!==2&&(c=vr,vr=f,c!==null&&Pm(c)),a}function Pm(a){vr===null?vr=a:vr.push.apply(vr,a)}function O_(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var y=0;y<f.length;y++){var S=f[y],k=S.getSnapshot;S=S.value;try{if(!ho(k(),S))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function os(a,c){for(c&=~jm,c&=~Od,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-Dr(c),y=1<<f;a[f]=-1,c&=~y}}function Lw(a){if((Rt&6)!==0)throw Error(n(327));rl();var c=Ku(a,0);if((c&1)===0)return yr(a,Ut()),null;var f=Vd(a,c);if(a.tag!==0&&f===2){var y=sh(a);y!==0&&(c=y,f=Tm(a,y))}if(f===1)throw f=Dc,zs(a,0),os(a,c),yr(a,Ut()),f;if(f===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Vs(a,vr,hi),yr(a,Ut()),null}function Rm(a,c){var f=Rt;Rt|=1;try{return a(c)}finally{Rt=f,Rt===0&&(nl=Ut()+500,hd&&Xi())}}function Fs(a){ns!==null&&ns.tag===0&&(Rt&6)===0&&rl();var c=Rt;Rt|=1;var f=Xr.transition,y=Ht;try{if(Xr.transition=null,Ht=1,a)return a()}finally{Ht=y,Xr.transition=f,Rt=c,(Rt&6)===0&&Xi()}}function _m(){Or=tl.current,cn(tl)}function zs(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,d_(f)),In!==null)for(f=In.return;f!==null;){var y=f;switch(Fh(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&fd();break;case 3:Ja(),cn(hr),cn(Yn),em();break;case 5:Jh(y);break;case 4:Ja();break;case 13:cn(gn);break;case 19:cn(gn);break;case 10:Hh(y.type._context);break;case 22:case 23:_m()}f=f.return}if(zn=a,In=a=is(a.current,null),Hn=Or=c,Mn=0,Dc=null,jm=Od=$s=0,vr=Ic=null,Os!==null){for(c=0;c<Os.length;c++)if(f=Os[c],y=f.interleaved,y!==null){f.interleaved=null;var S=y.next,k=f.pending;if(k!==null){var _=k.next;k.next=S,y.next=_}f.pending=y}Os=null}return a}function $w(a,c){do{var f=In;try{if(Wh(),Ed.current=Rd,kd){for(var y=vn.memoizedState;y!==null;){var S=y.queue;S!==null&&(S.pending=null),y=y.next}kd=!1}if(Ls=0,Fn=On=vn=null,Ec=!1,kc=0,Sm.current=null,f===null||f.return===null){Mn=1,Dc=c,In=null;break}e:{var k=a,_=f.return,$=f,U=c;if(c=Hn,$.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var ne=U,he=$,ye=he.tag;if((he.mode&1)===0&&(ye===0||ye===11||ye===15)){var pe=he.alternate;pe?(he.updateQueue=pe.updateQueue,he.memoizedState=pe.memoizedState,he.lanes=pe.lanes):(he.updateQueue=null,he.memoizedState=null)}var ze=cw(_);if(ze!==null){ze.flags&=-257,uw(ze,_,$,k,c),ze.mode&1&&lw(k,ne,c),c=ze,U=ne;var Ge=c.updateQueue;if(Ge===null){var Ye=new Set;Ye.add(U),c.updateQueue=Ye}else Ge.add(U);break e}else{if((c&1)===0){lw(k,ne,c),Dm();break e}U=Error(n(426))}}else if(hn&&$.mode&1){var Pn=cw(_);if(Pn!==null){(Pn.flags&65536)===0&&(Pn.flags|=256),uw(Pn,_,$,k,c),Bh(Za(U,$));break e}}k=U=Za(U,$),Mn!==4&&(Mn=2),Ic===null?Ic=[k]:Ic.push(k),k=_;do{switch(k.tag){case 3:k.flags|=65536,c&=-c,k.lanes|=c;var Z=sw(k,U,c);Rb(k,Z);break e;case 1:$=U;var H=k.type,te=k.stateNode;if((k.flags&128)===0&&(typeof H.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(ts===null||!ts.has(te)))){k.flags|=65536,c&=-c,k.lanes|=c;var we=aw(k,$,c);Rb(k,we);break e}}k=k.return}while(k!==null)}Vw(f)}catch(Ze){c=Ze,In===f&&f!==null&&(In=f=f.return);continue}break}while(!0)}function Fw(){var a=Nd.current;return Nd.current=Rd,a===null?Rd:a}function Dm(){(Mn===0||Mn===3||Mn===2)&&(Mn=4),zn===null||($s&268435455)===0&&(Od&268435455)===0||os(zn,Hn)}function Vd(a,c){var f=Rt;Rt|=2;var y=Fw();(zn!==a||Hn!==c)&&(hi=null,zs(a,c));do try{M_();break}catch(S){$w(a,S)}while(!0);if(Wh(),Rt=f,Nd.current=y,In!==null)throw Error(n(261));return zn=null,Hn=0,Mn}function M_(){for(;In!==null;)zw(In)}function L_(){for(;In!==null&&!tc();)zw(In)}function zw(a){var c=Ww(a.alternate,a,Or);a.memoizedProps=a.pendingProps,c===null?Vw(a):In=c,Sm.current=null}function Vw(a){var c=a;do{var f=c.alternate;if(a=c.return,(c.flags&32768)===0){if(f=R_(f,c,Or),f!==null){In=f;return}}else{if(f=__(f,c),f!==null){f.flags&=32767,In=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Mn=6,In=null;return}}if(c=c.sibling,c!==null){In=c;return}In=c=a}while(c!==null);Mn===0&&(Mn=5)}function Vs(a,c,f){var y=Ht,S=Xr.transition;try{Xr.transition=null,Ht=1,$_(a,c,f,y)}finally{Xr.transition=S,Ht=y}return null}function $_(a,c,f,y){do rl();while(ns!==null);if((Rt&6)!==0)throw Error(n(327));f=a.finishedWork;var S=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var k=f.lanes|f.childLanes;if(y2(a,k),a===zn&&(In=zn=null,Hn=0),(f.subtreeFlags&2064)===0&&(f.flags&2064)===0||Ld||(Ld=!0,Hw(Tn,function(){return rl(),null})),k=(f.flags&15990)!==0,(f.subtreeFlags&15990)!==0||k){k=Xr.transition,Xr.transition=null;var _=Ht;Ht=1;var $=Rt;Rt|=4,Sm.current=null,I_(a,f),Dw(f,a),o_(Dh),Ju=!!_h,Dh=_h=null,a.current=f,A_(f),_s(),Rt=$,Ht=_,Xr.transition=k}else a.current=f;if(Ld&&(Ld=!1,ns=a,$d=S),k=a.pendingLanes,k===0&&(ts=null),qu(f.stateNode),yr(a,Ut()),c!==null)for(y=a.onRecoverableError,f=0;f<c.length;f++)S=c[f],y(S.value,{componentStack:S.stack,digest:S.digest});if(Md)throw Md=!1,a=Em,Em=null,a;return($d&1)!==0&&a.tag!==0&&rl(),k=a.pendingLanes,(k&1)!==0?a===km?Ac++:(Ac=0,km=a):Ac=0,Xi(),null}function rl(){if(ns!==null){var a=P0($d),c=Xr.transition,f=Ht;try{if(Xr.transition=null,Ht=16>a?16:a,ns===null)var y=!1;else{if(a=ns,ns=null,$d=0,(Rt&6)!==0)throw Error(n(331));var S=Rt;for(Rt|=4,He=a.current;He!==null;){var k=He,_=k.child;if((He.flags&16)!==0){var $=k.deletions;if($!==null){for(var U=0;U<$.length;U++){var ne=$[U];for(He=ne;He!==null;){var he=He;switch(he.tag){case 0:case 11:case 15:_c(8,he,k)}var ye=he.child;if(ye!==null)ye.return=he,He=ye;else for(;He!==null;){he=He;var pe=he.sibling,ze=he.return;if(kw(he),he===ne){He=null;break}if(pe!==null){pe.return=ze,He=pe;break}He=ze}}}var Ge=k.alternate;if(Ge!==null){var Ye=Ge.child;if(Ye!==null){Ge.child=null;do{var Pn=Ye.sibling;Ye.sibling=null,Ye=Pn}while(Ye!==null)}}He=k}}if((k.subtreeFlags&2064)!==0&&_!==null)_.return=k,He=_;else e:for(;He!==null;){if(k=He,(k.flags&2048)!==0)switch(k.tag){case 0:case 11:case 15:_c(9,k,k.return)}var Z=k.sibling;if(Z!==null){Z.return=k.return,He=Z;break e}He=k.return}}var H=a.current;for(He=H;He!==null;){_=He;var te=_.child;if((_.subtreeFlags&2064)!==0&&te!==null)te.return=_,He=te;else e:for(_=H;He!==null;){if($=He,($.flags&2048)!==0)try{switch($.tag){case 0:case 11:case 15:Ad(9,$)}}catch(Ze){Cn($,$.return,Ze)}if($===_){He=null;break e}var we=$.sibling;if(we!==null){we.return=$.return,He=we;break e}He=$.return}}if(Rt=S,Xi(),Un&&typeof Un.onPostCommitFiberRoot=="function")try{Un.onPostCommitFiberRoot(an,a)}catch{}y=!0}return y}finally{Ht=f,Xr.transition=c}}return!1}function Bw(a,c,f){c=Za(f,c),c=sw(a,c,1),a=Zi(a,c,1),c=or(),a!==null&&(rc(a,1,c),yr(a,c))}function Cn(a,c,f){if(a.tag===3)Bw(a,a,f);else for(;c!==null;){if(c.tag===3){Bw(c,a,f);break}else if(c.tag===1){var y=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(ts===null||!ts.has(y))){a=Za(f,a),a=aw(c,a,1),c=Zi(c,a,1),a=or(),c!==null&&(rc(c,1,a),yr(c,a));break}}c=c.return}}function F_(a,c,f){var y=a.pingCache;y!==null&&y.delete(c),c=or(),a.pingedLanes|=a.suspendedLanes&f,zn===a&&(Hn&f)===f&&(Mn===4||Mn===3&&(Hn&130023424)===Hn&&500>Ut()-Cm?zs(a,0):jm|=f),yr(a,c)}function Uw(a,c){c===0&&((a.mode&1)===0?c=1:(c=Qu,Qu<<=1,(Qu&130023424)===0&&(Qu=4194304)));var f=or();a=di(a,c),a!==null&&(rc(a,c,f),yr(a,f))}function z_(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),Uw(a,f)}function V_(a,c){var f=0;switch(a.tag){case 13:var y=a.stateNode,S=a.memoizedState;S!==null&&(f=S.retryLane);break;case 19:y=a.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(c),Uw(a,f)}var Ww;Ww=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||hr.current)gr=!0;else{if((a.lanes&f)===0&&(c.flags&128)===0)return gr=!1,P_(a,c,f);gr=(a.flags&131072)!==0}else gr=!1,hn&&(c.flags&1048576)!==0&&Sb(c,gd,c.index);switch(c.lanes=0,c.tag){case 2:var y=c.type;Dd(a,c),a=c.pendingProps;var S=Ha(c,Yn.current);Ya(c,f),S=rm(null,c,y,a,S,f);var k=om();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,mr(y)?(k=!0,pd(c)):k=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Qh(c),S.updater=Sd,c.stateNode=S,S._reactInternals=c,Yh(c,y,a,f),c=fm(null,c,y,!0,k,f)):(c.tag=0,hn&&k&&$h(c),rr(null,c,S,f),c=c.child),c;case 16:y=c.elementType;e:{switch(Dd(a,c),a=c.pendingProps,S=y._init,y=S(y._payload),c.type=y,S=c.tag=U_(y),a=go(y,a),S){case 0:c=dm(null,c,y,a,f);break e;case 1:c=gw(null,c,y,a,f);break e;case 11:c=dw(null,c,y,a,f);break e;case 14:c=fw(null,c,y,go(y.type,a),f);break e}throw Error(n(306,y,""))}return c;case 0:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:go(y,S),dm(a,c,y,S,f);case 1:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:go(y,S),gw(a,c,y,S,f);case 3:e:{if(vw(c),a===null)throw Error(n(387));y=c.pendingProps,k=c.memoizedState,S=k.element,Pb(a,c),wd(c,y,null,f);var _=c.memoizedState;if(y=_.element,k.isDehydrated)if(k={element:y,isDehydrated:!1,cache:_.cache,pendingSuspenseBoundaries:_.pendingSuspenseBoundaries,transitions:_.transitions},c.updateQueue.baseState=k,c.memoizedState=k,c.flags&256){S=Za(Error(n(423)),c),c=yw(a,c,y,f,S);break e}else if(y!==S){S=Za(Error(n(424)),c),c=yw(a,c,y,f,S);break e}else for(Nr=Qi(c.stateNode.containerInfo.firstChild),Ar=c,hn=!0,mo=null,f=Lb(c,null,y,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Qa(),y===S){c=pi(a,c,f);break e}rr(a,c,y,f)}c=c.child}return c;case 5:return $b(c),a===null&&Vh(c),y=c.type,S=c.pendingProps,k=a!==null?a.memoizedProps:null,_=S.children,Ih(y,S)?_=null:k!==null&&Ih(y,k)&&(c.flags|=32),mw(a,c),rr(a,c,_,f),c.child;case 6:return a===null&&Vh(c),null;case 13:return xw(a,c,f);case 4:return Xh(c,c.stateNode.containerInfo),y=c.pendingProps,a===null?c.child=Xa(c,null,y,f):rr(a,c,y,f),c.child;case 11:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:go(y,S),dw(a,c,y,S,f);case 7:return rr(a,c,c.pendingProps,f),c.child;case 8:return rr(a,c,c.pendingProps.children,f),c.child;case 12:return rr(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(y=c.type._context,S=c.pendingProps,k=c.memoizedProps,_=S.value,tn(yd,y._currentValue),y._currentValue=_,k!==null)if(ho(k.value,_)){if(k.children===S.children&&!hr.current){c=pi(a,c,f);break e}}else for(k=c.child,k!==null&&(k.return=c);k!==null;){var $=k.dependencies;if($!==null){_=k.child;for(var U=$.firstContext;U!==null;){if(U.context===y){if(k.tag===1){U=fi(-1,f&-f),U.tag=2;var ne=k.updateQueue;if(ne!==null){ne=ne.shared;var he=ne.pending;he===null?U.next=U:(U.next=he.next,he.next=U),ne.pending=U}}k.lanes|=f,U=k.alternate,U!==null&&(U.lanes|=f),qh(k.return,f,c),$.lanes|=f;break}U=U.next}}else if(k.tag===10)_=k.type===c.type?null:k.child;else if(k.tag===18){if(_=k.return,_===null)throw Error(n(341));_.lanes|=f,$=_.alternate,$!==null&&($.lanes|=f),qh(_,f,c),_=k.sibling}else _=k.child;if(_!==null)_.return=k;else for(_=k;_!==null;){if(_===c){_=null;break}if(k=_.sibling,k!==null){k.return=_.return,_=k;break}_=_.return}k=_}rr(a,c,S.children,f),c=c.child}return c;case 9:return S=c.type,y=c.pendingProps.children,Ya(c,f),S=Kr(S),y=y(S),c.flags|=1,rr(a,c,y,f),c.child;case 14:return y=c.type,S=go(y,c.pendingProps),S=go(y.type,S),fw(a,c,y,S,f);case 15:return pw(a,c,c.type,c.pendingProps,f);case 17:return y=c.type,S=c.pendingProps,S=c.elementType===y?S:go(y,S),Dd(a,c),c.tag=1,mr(y)?(a=!0,pd(c)):a=!1,Ya(c,f),Ab(c,y,S),Yh(c,y,S,f),fm(null,c,y,!0,a,f);case 19:return ww(a,c,f);case 22:return hw(a,c,f)}throw Error(n(156,c.tag))};function Hw(a,c){return qr(a,c)}function B_(a,c,f,y){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jr(a,c,f,y){return new B_(a,c,f,y)}function Im(a){return a=a.prototype,!(!a||!a.isReactComponent)}function U_(a){if(typeof a=="function")return Im(a)?1:0;if(a!=null){if(a=a.$$typeof,a===G)return 11;if(a===X)return 14}return 2}function is(a,c){var f=a.alternate;return f===null?(f=Jr(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function Bd(a,c,f,y,S,k){var _=2;if(y=a,typeof a=="function")Im(a)&&(_=1);else if(typeof a=="string")_=5;else e:switch(a){case A:return Bs(f.children,S,k,c);case O:_=8,S|=8;break;case L:return a=Jr(12,f,c,S|2),a.elementType=L,a.lanes=k,a;case Q:return a=Jr(13,f,c,S),a.elementType=Q,a.lanes=k,a;case Y:return a=Jr(19,f,c,S),a.elementType=Y,a.lanes=k,a;case M:return Ud(f,S,k,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case V:_=10;break e;case q:_=9;break e;case G:_=11;break e;case X:_=14;break e;case B:_=16,y=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Jr(_,f,c,S),c.elementType=a,c.type=y,c.lanes=k,c}function Bs(a,c,f,y){return a=Jr(7,a,y,c),a.lanes=f,a}function Ud(a,c,f,y){return a=Jr(22,a,y,c),a.elementType=M,a.lanes=f,a.stateNode={isHidden:!1},a}function Am(a,c,f){return a=Jr(6,a,null,c),a.lanes=f,a}function Nm(a,c,f){return c=Jr(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function W_(a,c,f,y,S){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ah(0),this.expirationTimes=ah(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ah(0),this.identifierPrefix=y,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function Om(a,c,f,y,S,k,_,$,U){return a=new W_(a,c,f,$,U),c===1?(c=1,k===!0&&(c|=8)):c=0,k=Jr(3,null,null,c),a.current=k,k.stateNode=a,k.memoizedState={element:y,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Qh(k),a}function H_(a,c,f){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:D,key:y==null?null:""+y,children:a,containerInfo:c,implementation:f}}function qw(a){if(!a)return Yi;a=a._reactInternals;e:{if(Kt(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(mr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var f=a.type;if(mr(f))return xb(a,f,c)}return c}function Gw(a,c,f,y,S,k,_,$,U){return a=Om(f,y,!0,a,S,k,_,$,U),a.context=qw(null),f=a.current,y=or(),S=rs(f),k=fi(y,S),k.callback=c??null,Zi(f,k,S),a.current.lanes=S,rc(a,S,y),yr(a,y),a}function Wd(a,c,f,y){var S=c.current,k=or(),_=rs(S);return f=qw(f),c.context===null?c.context=f:c.pendingContext=f,c=fi(k,_),c.payload={element:a},y=y===void 0?null:y,y!==null&&(c.callback=y),a=Zi(S,c,_),a!==null&&(xo(a,S,_,k),bd(a,S,_)),_}function Hd(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function Qw(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function Mm(a,c){Qw(a,c),(a=a.alternate)&&Qw(a,c)}function q_(){return null}var Kw=typeof reportError=="function"?reportError:function(a){console.error(a)};function Lm(a){this._internalRoot=a}qd.prototype.render=Lm.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));Wd(a,c,null,null)},qd.prototype.unmount=Lm.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;Fs(function(){Wd(null,a,null,null)}),c[ai]=null}};function qd(a){this._internalRoot=a}qd.prototype.unstable_scheduleHydration=function(a){if(a){var c=D0();a={blockedOn:null,target:a,priority:c};for(var f=0;f<Hi.length&&c!==0&&c<Hi[f].priority;f++);Hi.splice(f,0,a),f===0&&N0(a)}};function $m(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Gd(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function Yw(){}function G_(a,c,f,y,S){if(S){if(typeof y=="function"){var k=y;y=function(){var ne=Hd(_);k.call(ne)}}var _=Gw(c,y,a,0,null,!1,!1,"",Yw);return a._reactRootContainer=_,a[ai]=_.current,vc(a.nodeType===8?a.parentNode:a),Fs(),_}for(;S=a.lastChild;)a.removeChild(S);if(typeof y=="function"){var $=y;y=function(){var ne=Hd(U);$.call(ne)}}var U=Om(a,0,!1,null,null,!1,!1,"",Yw);return a._reactRootContainer=U,a[ai]=U.current,vc(a.nodeType===8?a.parentNode:a),Fs(function(){Wd(c,U,f,y)}),U}function Qd(a,c,f,y,S){var k=f._reactRootContainer;if(k){var _=k;if(typeof S=="function"){var $=S;S=function(){var U=Hd(_);$.call(U)}}Wd(c,_,a,S)}else _=G_(f,c,a,S,y);return Hd(_)}R0=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=nc(c.pendingLanes);f!==0&&(lh(c,f|1),yr(c,Ut()),(Rt&6)===0&&(nl=Ut()+500,Xi()))}break;case 13:Fs(function(){var y=di(a,1);if(y!==null){var S=or();xo(y,a,1,S)}}),Mm(a,1)}},ch=function(a){if(a.tag===13){var c=di(a,134217728);if(c!==null){var f=or();xo(c,a,134217728,f)}Mm(a,134217728)}},_0=function(a){if(a.tag===13){var c=rs(a),f=di(a,c);if(f!==null){var y=or();xo(f,a,c,y)}Mm(a,c)}},D0=function(){return Ht},I0=function(a,c){var f=Ht;try{return Ht=a,c()}finally{Ht=f}},si=function(a,c,f){switch(c){case"input":if(be(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var y=f[c];if(y!==a&&y.form===a.form){var S=dd(y);if(!S)throw Error(n(90));Ft(y),be(y,S)}}}break;case"textarea":de(a,f);break;case"select":c=f.value,c!=null&&ce(a,!!f.multiple,c,!1)}},ec=Rm,W=Fs;var Q_={usingClientEntryPoint:!1,Events:[bc,Ua,dd,kn,Aa,Rm]},Nc={findFiberByHostInstance:Ds,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},K_={bundleType:Nc.bundleType,version:Nc.version,rendererPackageName:Nc.rendererPackageName,rendererConfig:Nc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Hr(a),a===null?null:a.stateNode},findFiberByHostInstance:Nc.findFiberByHostInstance||q_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Kd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kd.isDisabled&&Kd.supportsFiber)try{an=Kd.inject(K_),Un=Kd}catch{}}return xr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q_,xr.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$m(c))throw Error(n(200));return H_(a,c,null,f)},xr.createRoot=function(a,c){if(!$m(a))throw Error(n(299));var f=!1,y="",S=Kw;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(y=c.identifierPrefix),c.onRecoverableError!==void 0&&(S=c.onRecoverableError)),c=Om(a,1,!1,null,null,f,!1,y,S),a[ai]=c.current,vc(a.nodeType===8?a.parentNode:a),new Lm(c)},xr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Hr(c),a=a===null?null:a.stateNode,a},xr.flushSync=function(a){return Fs(a)},xr.hydrate=function(a,c,f){if(!Gd(c))throw Error(n(200));return Qd(null,a,c,!0,f)},xr.hydrateRoot=function(a,c,f){if(!$m(a))throw Error(n(405));var y=f!=null&&f.hydratedSources||null,S=!1,k="",_=Kw;if(f!=null&&(f.unstable_strictMode===!0&&(S=!0),f.identifierPrefix!==void 0&&(k=f.identifierPrefix),f.onRecoverableError!==void 0&&(_=f.onRecoverableError)),c=Gw(c,null,a,1,f??null,S,!1,k,_),a[ai]=c.current,vc(a),y)for(a=0;a<y.length;a++)f=y[a],S=f._getVersion,S=S(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,S]:c.mutableSourceEagerHydrationData.push(f,S);return new qd(c)},xr.render=function(a,c,f){if(!Gd(c))throw Error(n(200));return Qd(null,a,c,!1,f)},xr.unmountComponentAtNode=function(a){if(!Gd(a))throw Error(n(40));return a._reactRootContainer?(Fs(function(){Qd(null,null,a,!1,function(){a._reactRootContainer=null,a[ai]=null})}),!0):!1},xr.unstable_batchedUpdates=Rm,xr.unstable_renderSubtreeIntoContainer=function(a,c,f,y){if(!Gd(f))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Qd(a,c,f,!1,y)},xr.version="18.2.0-next-9e3b772b8-20220608",xr}var w1;function qC(){if(w1)return Jm.exports;w1=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(),Jm.exports=DA(),Jm.exports}var $v=qC();const Hc=Tv($v);function ap(){return typeof window<"u"}function Fl(e){return GC(e)?(e.nodeName||"").toLowerCase():"#document"}function Sr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ei(e){var t;return(t=(GC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function GC(e){return ap()?e instanceof Node||e instanceof Sr(e).Node:!1}function dn(e){return ap()?e instanceof Element||e instanceof Sr(e).Element:!1}function zr(e){return ap()?e instanceof HTMLElement||e instanceof Sr(e).HTMLElement:!1}function Vg(e){return!ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Sr(e).ShadowRoot}function mu(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=oo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function IA(e){return["table","td","th"].includes(Fl(e))}function lp(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Fv(e){const t=cp(),n=dn(e)?oo(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 AA(e){let t=Si(e);for(;zr(t)&&!ms(t);){if(Fv(t))return t;if(lp(t))return null;t=Si(t)}return null}function cp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ms(e){return["html","body","#document"].includes(Fl(e))}function oo(e){return Sr(e).getComputedStyle(e)}function up(e){return dn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Si(e){if(Fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Vg(e)&&e.host||ei(e);return Vg(t)?t.host:t}function QC(e){const t=Si(e);return ms(t)?e.ownerDocument?e.ownerDocument.body:e.body:zr(t)&&mu(t)?t:QC(t)}function xi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=QC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),l=Sr(o);if(i){const u=Bg(l);return t.concat(l,l.visualViewport||[],mu(o)?o:[],u&&n?xi(u):[])}return t.concat(o,xi(o,[],n))}function Bg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function S1(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 tu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Vg(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function KC(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function YC(){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 NA(e){return LA()?!1:!j1()&&e.width===0&&e.height===0||j1()&&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 OA(){return/apple/i.test(navigator.vendor)}function j1(){const e=/android/i;return e.test(KC())||e.test(YC())}function MA(){return KC().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function LA(){return YC().includes("jsdom/")}function Ug(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function $A(e){return"nativeEvent"in e}function FA(e){return e.matches("html,body")}function Js(e){return(e==null?void 0:e.ownerDocument)||document}function tg(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 vl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const zA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function VA(e){return zr(e)&&e.matches(zA)}const ko=Math.min,er=Math.max,Rf=Math.round,nf=Math.floor,qo=e=>({x:e,y:e}),BA={left:"right",right:"left",bottom:"top",top:"bottom"},UA={start:"end",end:"start"};function Wg(e,t,n){return er(e,ko(t,n))}function ji(e,t){return typeof e=="function"?e(t):e}function To(e){return e.split("-")[0]}function zl(e){return e.split("-")[1]}function zv(e){return e==="x"?"y":"x"}function Vv(e){return e==="y"?"height":"width"}function Ci(e){return["top","bottom"].includes(To(e))?"y":"x"}function Bv(e){return zv(Ci(e))}function WA(e,t,n){n===void 0&&(n=!1);const r=zl(e),o=Bv(e),i=Vv(o);let l=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=_f(l)),[l,_f(l)]}function HA(e){const t=_f(e);return[Hg(e),t,Hg(t)]}function Hg(e){return e.replace(/start|end/g,t=>UA[t])}function qA(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:l;default:return[]}}function GA(e,t,n,r){const o=zl(e);let i=qA(To(e),n==="start",r);return o&&(i=i.map(l=>l+"-"+o),t&&(i=i.concat(i.map(Hg)))),i}function _f(e){return e.replace(/left|right|bottom|top/g,t=>BA[t])}function QA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Uv(e){return typeof e!="number"?QA(e):{top:e,right:e,bottom:e,left:e}}function Tl(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function C1(e,t,n){let{reference:r,floating:o}=e;const i=Ci(t),l=Bv(t),u=Vv(l),d=To(t),p=i==="y",h=r.x+r.width/2-o.width/2,m=r.y+r.height/2-o.height/2,v=r[u]/2-o[u]/2;let x;switch(d){case"top":x={x:h,y:r.y-o.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-o.width,y:m};break;default:x={x:r.x,y:r.y}}switch(zl(t)){case"start":x[l]-=v*(n&&p?-1:1);break;case"end":x[l]+=v*(n&&p?-1:1);break}return x}const KA=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,u=i.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:o}),{x:h,y:m}=C1(p,r,d),v=r,x={},b=0;for(let w=0;w<u.length;w++){const{name:j,fn:T}=u[w],{x:R,y:E,data:C,reset:P}=await T({x:h,y:m,initialPlacement:r,placement:v,strategy:o,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});h=R??h,m=E??m,x={...x,[j]:{...x[j],...C}},P&&b<=50&&(b++,typeof P=="object"&&(P.placement&&(v=P.placement),P.rects&&(p=P.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:h,y:m}=C1(p,v,d)),w=-1)}return{x:h,y:m,placement:v,strategy:o,middlewareData:x}};async function Wv(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:x=0}=ji(t,e),b=Uv(x),j=u[v?m==="floating"?"reference":"floating":m],T=Tl(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(j)))==null||n?j:j.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),R=m==="floating"?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u.floating)),C=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},P=Tl(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:R,offsetParent:E,strategy:d}):R);return{top:(T.top-P.top+b.top)/C.y,bottom:(P.bottom-T.bottom+b.bottom)/C.y,left:(T.left-P.left+b.left)/C.x,right:(P.right-T.right+b.right)/C.x}}const YA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0}=ji(e,t)||{};if(p==null)return{};const m=Uv(h),v={x:n,y:r},x=Bv(o),b=Vv(x),w=await l.getDimensions(p),j=x==="y",T=j?"top":"left",R=j?"bottom":"right",E=j?"clientHeight":"clientWidth",C=i.reference[b]+i.reference[x]-v[x]-i.floating[b],P=v[x]-i.reference[x],D=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let A=D?D[E]:0;(!A||!await(l.isElement==null?void 0:l.isElement(D)))&&(A=u.floating[E]||i.floating[b]);const O=C/2-P/2,L=A/2-w[b]/2-1,V=ko(m[T],L),q=ko(m[R],L),G=V,Q=A-w[b]-q,Y=A/2-w[b]/2+O,X=Wg(G,Y,Q),B=!d.arrow&&zl(o)!=null&&Y!==X&&i.reference[b]/2-(Y<G?V:q)-w[b]/2<0,M=B?Y<G?Y-G:Y-Q:0;return{[x]:v[x]+M,data:{[x]:X,centerOffset:Y-X-M,...B&&{alignmentOffset:M}},reset:B}}}),XA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...j}=ji(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const T=To(o),R=Ci(u),E=To(u)===u,C=await(d.isRTL==null?void 0:d.isRTL(p.floating)),P=v||(E||!w?[_f(u)]:HA(u)),D=b!=="none";!v&&D&&P.push(...GA(u,w,b,C));const A=[u,...P],O=await Wv(t,j),L=[];let V=((r=i.flip)==null?void 0:r.overflows)||[];if(h&&L.push(O[T]),m){const Y=WA(o,l,C);L.push(O[Y[0]],O[Y[1]])}if(V=[...V,{placement:o,overflows:L}],!L.every(Y=>Y<=0)){var q,G;const Y=(((q=i.flip)==null?void 0:q.index)||0)+1,X=A[Y];if(X)return{data:{index:Y,overflows:V},reset:{placement:X}};let B=(G=V.filter(M=>M.overflows[0]<=0).sort((M,N)=>M.overflows[1]-N.overflows[1])[0])==null?void 0:G.placement;if(!B)switch(x){case"bestFit":{var Q;const M=(Q=V.filter(N=>{if(D){const F=Ci(N.placement);return F===R||F==="y"}return!0}).map(N=>[N.placement,N.overflows.filter(F=>F>0).reduce((F,I)=>F+I,0)]).sort((N,F)=>N[1]-F[1])[0])==null?void 0:Q[0];M&&(B=M);break}case"initialPlacement":B=u;break}if(o!==B)return{reset:{placement:B}}}return{}}}};function XC(e){const t=ko(...e.map(i=>i.left)),n=ko(...e.map(i=>i.top)),r=er(...e.map(i=>i.right)),o=er(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function JA(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;o<t.length;o++){const i=t[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>Tl(XC(o)))}const ZA=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:l}=t,{padding:u=2,x:d,y:p}=ji(e,t),h=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),m=JA(h),v=Tl(XC(h)),x=Uv(u);function b(){if(m.length===2&&m[0].left>m[1].right&&d!=null&&p!=null)return m.find(j=>d>j.left-x.left&&d<j.right+x.right&&p>j.top-x.top&&p<j.bottom+x.bottom)||v;if(m.length>=2){if(Ci(n)==="y"){const V=m[0],q=m[m.length-1],G=To(n)==="top",Q=V.top,Y=q.bottom,X=G?V.left:q.left,B=G?V.right:q.right,M=B-X,N=Y-Q;return{top:Q,bottom:Y,left:X,right:B,width:M,height:N,x:X,y:Q}}const j=To(n)==="left",T=er(...m.map(V=>V.right)),R=ko(...m.map(V=>V.left)),E=m.filter(V=>j?V.left===R:V.right===T),C=E[0].top,P=E[E.length-1].bottom,D=R,A=T,O=A-D,L=P-C;return{top:C,bottom:P,left:D,right:A,width:O,height:L,x:D,y:C}}return v}const w=await i.getElementRects({reference:{getBoundingClientRect:b},floating:r.floating,strategy:l});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};async function eN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),l=To(n),u=zl(n),d=Ci(n)==="y",p=["left","top"].includes(l)?-1:1,h=i&&d?-1:1,m=ji(t,e);let{mainAxis:v,crossAxis:x,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof b=="number"&&(x=u==="end"?b*-1:b),d?{x:x*h,y:v*p}:{x:v*p,y:x*h}}const tN=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:l,middlewareData:u}=t,d=await eN(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:o+d.x,y:i+d.y,data:{...d,placement:l}}}}},nN=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:u={fn:j=>{let{x:T,y:R}=j;return{x:T,y:R}}},...d}=ji(e,t),p={x:n,y:r},h=await Wv(t,d),m=Ci(To(o)),v=zv(m);let x=p[v],b=p[m];if(i){const j=v==="y"?"top":"left",T=v==="y"?"bottom":"right",R=x+h[j],E=x-h[T];x=Wg(R,x,E)}if(l){const j=m==="y"?"top":"left",T=m==="y"?"bottom":"right",R=b+h[j],E=b-h[T];b=Wg(R,b,E)}const w=u.fn({...t,[v]:x,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[v]:i,[m]:l}}}}}},rN=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=ji(e,t),h={x:n,y:r},m=Ci(o),v=zv(m);let x=h[v],b=h[m];const w=ji(u,t),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const E=v==="y"?"height":"width",C=i.reference[v]-i.floating[E]+j.mainAxis,P=i.reference[v]+i.reference[E]-j.mainAxis;x<C?x=C:x>P&&(x=P)}if(p){var T,R;const E=v==="y"?"width":"height",C=["top","left"].includes(To(o)),P=i.reference[m]-i.floating[E]+(C&&((T=l.offset)==null?void 0:T[m])||0)+(C?0:j.crossAxis),D=i.reference[m]+i.reference[E]+(C?0:((R=l.offset)==null?void 0:R[m])||0)-(C?j.crossAxis:0);b<P?b=P:b>D&&(b=D)}return{[v]:x,[m]:b}}}},oN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:l,elements:u}=t,{apply:d=()=>{},...p}=ji(e,t),h=await Wv(t,p),m=To(o),v=zl(o),x=Ci(o)==="y",{width:b,height:w}=i.floating;let j,T;m==="top"||m==="bottom"?(j=m,T=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(T=m,j=v==="end"?"top":"bottom");const R=w-h.top-h.bottom,E=b-h.left-h.right,C=ko(w-h[j],R),P=ko(b-h[T],E),D=!t.middlewareData.shift;let A=C,O=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=E),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=R),D&&!v){const V=er(h.left,0),q=er(h.right,0),G=er(h.top,0),Q=er(h.bottom,0);x?O=b-2*(V!==0||q!==0?V+q:er(h.left,h.right)):A=w-2*(G!==0||Q!==0?G+Q:er(h.top,h.bottom))}await d({...t,availableWidth:O,availableHeight:A});const L=await l.getDimensions(u.floating);return b!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function JC(e){const t=oo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=zr(e),i=o?e.offsetWidth:n,l=o?e.offsetHeight:r,u=Rf(n)!==i||Rf(r)!==l;return u&&(n=i,r=l),{width:n,height:r,$:u}}function Hv(e){return dn(e)?e:e.contextElement}function Sl(e){const t=Hv(e);if(!zr(t))return qo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=JC(t);let l=(i?Rf(n.width):n.width)/r,u=(i?Rf(n.height):n.height)/o;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const iN=qo(0);function ZC(e){const t=Sr(e);return!cp()||!t.visualViewport?iN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function sN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Sr(e)?!1:t}function ia(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Hv(e);let l=qo(1);t&&(r?dn(r)&&(l=Sl(r)):l=Sl(e));const u=sN(i,n,r)?ZC(i):qo(0);let d=(o.left+u.x)/l.x,p=(o.top+u.y)/l.y,h=o.width/l.x,m=o.height/l.y;if(i){const v=Sr(i),x=r&&dn(r)?Sr(r):r;let b=v,w=Bg(b);for(;w&&r&&x!==b;){const j=Sl(w),T=w.getBoundingClientRect(),R=oo(w),E=T.left+(w.clientLeft+parseFloat(R.paddingLeft))*j.x,C=T.top+(w.clientTop+parseFloat(R.paddingTop))*j.y;d*=j.x,p*=j.y,h*=j.x,m*=j.y,d+=E,p+=C,b=Sr(w),w=Bg(b)}}return Tl({width:h,height:m,x:d,y:p})}function qv(e,t){const n=up(e).scrollLeft;return t?t.left+n:ia(ei(e)).left+n}function eE(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),o=r.left+t.scrollLeft-(n?0:qv(e,r)),i=r.top+t.scrollTop;return{x:o,y:i}}function aN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",l=ei(r),u=t?lp(t.floating):!1;if(r===l||u&&i)return n;let d={scrollLeft:0,scrollTop:0},p=qo(1);const h=qo(0),m=zr(r);if((m||!m&&!i)&&((Fl(r)!=="body"||mu(l))&&(d=up(r)),zr(r))){const x=ia(r);p=Sl(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const v=l&&!m&&!i?eE(l,d,!0):qo(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+h.x+v.x,y:n.y*p.y-d.scrollTop*p.y+h.y+v.y}}function lN(e){return Array.from(e.getClientRects())}function cN(e){const t=ei(e),n=up(e),r=e.ownerDocument.body,o=er(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=er(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+qv(e);const u=-n.scrollTop;return oo(r).direction==="rtl"&&(l+=er(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:u}}function uN(e,t){const n=Sr(e),r=ei(e),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,u=0,d=0;if(o){i=o.width,l=o.height;const p=cp();(!p||p&&t==="fixed")&&(u=o.offsetLeft,d=o.offsetTop)}return{width:i,height:l,x:u,y:d}}function dN(e,t){const n=ia(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=zr(e)?Sl(e):qo(1),l=e.clientWidth*i.x,u=e.clientHeight*i.y,d=o*i.x,p=r*i.y;return{width:l,height:u,x:d,y:p}}function E1(e,t,n){let r;if(t==="viewport")r=uN(e,n);else if(t==="document")r=cN(ei(e));else if(dn(t))r=dN(t,n);else{const o=ZC(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Tl(r)}function tE(e,t){const n=Si(e);return n===t||!dn(n)||ms(n)?!1:oo(n).position==="fixed"||tE(n,t)}function fN(e,t){const n=t.get(e);if(n)return n;let r=xi(e,[],!1).filter(u=>dn(u)&&Fl(u)!=="body"),o=null;const i=oo(e).position==="fixed";let l=i?Si(e):e;for(;dn(l)&&!ms(l);){const u=oo(l),d=Fv(l);!d&&u.position==="fixed"&&(o=null),(i?!d&&!o:!d&&u.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||mu(l)&&!d&&tE(e,l))?r=r.filter(h=>h!==l):o=u,l=Si(l)}return t.set(e,r),r}function pN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const l=[...n==="clippingAncestors"?lp(t)?[]:fN(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((p,h)=>{const m=E1(t,h,o);return p.top=er(m.top,p.top),p.right=ko(m.right,p.right),p.bottom=ko(m.bottom,p.bottom),p.left=er(m.left,p.left),p},E1(t,u,o));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function hN(e){const{width:t,height:n}=JC(e);return{width:t,height:n}}function mN(e,t,n){const r=zr(t),o=ei(t),i=n==="fixed",l=ia(e,!0,i,t);let u={scrollLeft:0,scrollTop:0};const d=qo(0);if(r||!r&&!i)if((Fl(t)!=="body"||mu(o))&&(u=up(t)),r){const v=ia(t,!0,i,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else o&&(d.x=qv(o));const p=o&&!r&&!i?eE(o,u):qo(0),h=l.left+u.scrollLeft-d.x-p.x,m=l.top+u.scrollTop-d.y-p.y;return{x:h,y:m,width:l.width,height:l.height}}function ng(e){return oo(e).position==="static"}function k1(e,t){if(!zr(e)||oo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return ei(e)===n&&(n=n.ownerDocument.body),n}function nE(e,t){const n=Sr(e);if(lp(e))return n;if(!zr(e)){let o=Si(e);for(;o&&!ms(o);){if(dn(o)&&!ng(o))return o;o=Si(o)}return n}let r=k1(e,t);for(;r&&IA(r)&&ng(r);)r=k1(r,t);return r&&ms(r)&&ng(r)&&!Fv(r)?n:r||AA(e)||n}const gN=async function(e){const t=this.getOffsetParent||nE,n=this.getDimensions,r=await n(e.floating);return{reference:mN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vN(e){return oo(e).direction==="rtl"}const yN={convertOffsetParentRelativeRectToViewportRelativeRect:aN,getDocumentElement:ei,getClippingRect:pN,getOffsetParent:nE,getElementRects:gN,getClientRects:lN,getDimensions:hN,getScale:Sl,isElement:dn,isRTL:vN};function rE(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function xN(e,t){let n=null,r;const o=ei(e);function i(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),i();const p=e.getBoundingClientRect(),{left:h,top:m,width:v,height:x}=p;if(u||t(),!v||!x)return;const b=nf(m),w=nf(o.clientWidth-(h+v)),j=nf(o.clientHeight-(m+x)),T=nf(h),E={rootMargin:-b+"px "+-w+"px "+-j+"px "+-T+"px",threshold:er(0,ko(1,d))||1};let C=!0;function P(D){const A=D[0].intersectionRatio;if(A!==d){if(!C)return l();A?l(!1,A):r=setTimeout(()=>{l(!1,1e-7)},1e3)}A===1&&!rE(p,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(P,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,E)}n.observe(e)}return l(!0),i}function bN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,p=Hv(e),h=o||i?[...p?xi(p):[],...xi(t)]:[];h.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),i&&T.addEventListener("resize",n)});const m=p&&u?xN(p,n):null;let v=-1,x=null;l&&(x=new ResizeObserver(T=>{let[R]=T;R&&R.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var E;(E=x)==null||E.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let b,w=d?ia(e):null;d&&j();function j(){const T=ia(e);w&&!rE(w,T)&&n(),w=T,b=requestAnimationFrame(j)}return n(),()=>{var T;h.forEach(R=>{o&&R.removeEventListener("scroll",n),i&&R.removeEventListener("resize",n)}),m==null||m(),(T=x)==null||T.disconnect(),x=null,d&&cancelAnimationFrame(b)}}const wN=tN,SN=nN,jN=XA,CN=oN,T1=YA,EN=ZA,kN=rN,TN=(e,t,n)=>{const r=new Map,o={platform:yN,...n},i={...o.platform,_c:r};return KA(e,t,{...o,platform:i})};var gf=typeof document<"u"?g.useLayoutEffect:g.useEffect;function Df(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Df(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Df(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function oE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function P1(e,t){const n=oE(e);return Math.round(t*n)/n}function rg(e){const t=g.useRef(e);return gf(()=>{t.current=e}),t}function PN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=g.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,x]=g.useState(r);Df(v,r)||x(r);const[b,w]=g.useState(null),[j,T]=g.useState(null),R=g.useCallback(N=>{N!==D.current&&(D.current=N,w(N))},[]),E=g.useCallback(N=>{N!==A.current&&(A.current=N,T(N))},[]),C=i||b,P=l||j,D=g.useRef(null),A=g.useRef(null),O=g.useRef(h),L=d!=null,V=rg(d),q=rg(o),G=rg(p),Q=g.useCallback(()=>{if(!D.current||!A.current)return;const N={placement:t,strategy:n,middleware:v};q.current&&(N.platform=q.current),TN(D.current,A.current,N).then(F=>{const I={...F,isPositioned:G.current!==!1};Y.current&&!Df(O.current,I)&&(O.current=I,$v.flushSync(()=>{m(I)}))})},[v,t,n,q,G]);gf(()=>{p===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(N=>({...N,isPositioned:!1})))},[p]);const Y=g.useRef(!1);gf(()=>(Y.current=!0,()=>{Y.current=!1}),[]),gf(()=>{if(C&&(D.current=C),P&&(A.current=P),C&&P){if(V.current)return V.current(C,P,Q);Q()}},[C,P,Q,V,L]);const X=g.useMemo(()=>({reference:D,floating:A,setReference:R,setFloating:E}),[R,E]),B=g.useMemo(()=>({reference:C,floating:P}),[C,P]),M=g.useMemo(()=>{const N={position:n,left:0,top:0};if(!B.floating)return N;const F=P1(B.floating,h.x),I=P1(B.floating,h.y);return u?{...N,transform:"translate("+F+"px, "+I+"px)",...oE(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:I}},[n,u,B.floating,h.x,h.y]);return g.useMemo(()=>({...h,update:Q,refs:X,elements:B,floatingStyles:M}),[h,Q,X,B,M])}const RN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?T1({element:r.current,padding:o}).fn(n):{}:r?T1({element:r,padding:o}).fn(n):{}}}},iE=(e,t)=>({...wN(e),options:[e,t]}),Gv=(e,t)=>({...SN(e),options:[e,t]}),R1=(e,t)=>({...kN(e),options:[e,t]}),If=(e,t)=>({...jN(e),options:[e,t]}),_N=(e,t)=>({...CN(e),options:[e,t]}),Kc=(e,t)=>({...EN(e),options:[e,t]}),sE=(e,t)=>({...RN(e),options:[e,t]});function DN(e){return g.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const aE={...nD},IN=aE.useInsertionEffect,AN=IN||(e=>e());function yi(e){const t=g.useRef(()=>{});return AN(()=>{t.current=e}),g.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var Go=typeof document<"u"?g.useLayoutEffect:g.useEffect;let _1=!1,NN=0;const D1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+NN++;function ON(){const[e,t]=g.useState(()=>_1?D1():void 0);return Go(()=>{e==null&&t(D1())},[]),g.useEffect(()=>{_1=!0},[]),e}const MN=aE.useId,lE=MN||ON;function LN(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const $N=g.createContext(null),FN=g.createContext(null),Qv=()=>{var e;return((e=g.useContext($N))==null?void 0:e.id)||null},Kv=()=>g.useContext(FN);function Yv(e){return"data-floating-ui-"+e}function og(e){const t=g.useRef(e);return Go(()=>{t.current=e}),t}const I1=Yv("safe-polygon");function vf(e,t,n){return n&&!Ug(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function zN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:l}=e,{enabled:u=!0,delay:d=0,handleClose:p=null,mouseOnly:h=!1,restMs:m=0,move:v=!0}=t,x=Kv(),b=Qv(),w=og(p),j=og(d),T=og(n),R=g.useRef(),E=g.useRef(-1),C=g.useRef(),P=g.useRef(-1),D=g.useRef(!0),A=g.useRef(!1),O=g.useRef(()=>{}),L=g.useRef(!1),V=g.useCallback(()=>{var M;const N=(M=o.current.openEvent)==null?void 0:M.type;return(N==null?void 0:N.includes("mouse"))&&N!=="mousedown"},[o]);g.useEffect(()=>{if(!u)return;function M(N){let{open:F}=N;F||(clearTimeout(E.current),clearTimeout(P.current),D.current=!0,L.current=!1)}return i.on("openchange",M),()=>{i.off("openchange",M)}},[u,i]),g.useEffect(()=>{if(!u||!w.current||!n)return;function M(F){V()&&r(!1,F,"hover")}const N=Js(l.floating).documentElement;return N.addEventListener("mouseleave",M),()=>{N.removeEventListener("mouseleave",M)}},[l.floating,n,r,u,w,V]);const q=g.useCallback(function(M,N,F){N===void 0&&(N=!0),F===void 0&&(F="hover");const I=vf(j.current,"close",R.current);I&&!C.current?(clearTimeout(E.current),E.current=window.setTimeout(()=>r(!1,M,F),I)):N&&(clearTimeout(E.current),r(!1,M,F))},[j,r]),G=yi(()=>{O.current(),C.current=void 0}),Q=yi(()=>{if(A.current){const M=Js(l.floating).body;M.style.pointerEvents="",M.removeAttribute(I1),A.current=!1}}),Y=yi(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);g.useEffect(()=>{if(!u)return;function M(z){if(clearTimeout(E.current),D.current=!1,h&&!Ug(R.current)||m>0&&!vf(j.current,"open"))return;const J=vf(j.current,"open",R.current);J?E.current=window.setTimeout(()=>{T.current||r(!0,z,"hover")},J):n||r(!0,z,"hover")}function N(z){if(Y())return;O.current();const J=Js(l.floating);if(clearTimeout(P.current),L.current=!1,w.current&&o.current.floatingContext){n||clearTimeout(E.current),C.current=w.current({...o.current.floatingContext,tree:x,x:z.clientX,y:z.clientY,onClose(){Q(),G(),Y()||q(z,!0,"safe-polygon")}});const je=C.current;J.addEventListener("mousemove",je),O.current=()=>{J.removeEventListener("mousemove",je)};return}(R.current==="touch"?!tu(l.floating,z.relatedTarget):!0)&&q(z)}function F(z){Y()||o.current.floatingContext&&(w.current==null||w.current({...o.current.floatingContext,tree:x,x:z.clientX,y:z.clientY,onClose(){Q(),G(),Y()||q(z)}})(z))}if(dn(l.domReference)){var I;const z=l.domReference;return n&&z.addEventListener("mouseleave",F),(I=l.floating)==null||I.addEventListener("mouseleave",F),v&&z.addEventListener("mousemove",M,{once:!0}),z.addEventListener("mouseenter",M),z.addEventListener("mouseleave",N),()=>{var J;n&&z.removeEventListener("mouseleave",F),(J=l.floating)==null||J.removeEventListener("mouseleave",F),v&&z.removeEventListener("mousemove",M),z.removeEventListener("mouseenter",M),z.removeEventListener("mouseleave",N)}}},[l,u,e,h,m,v,q,G,Q,r,n,T,x,j,w,o,Y]),Go(()=>{var M;if(u&&n&&(M=w.current)!=null&&M.__options.blockPointerEvents&&V()){A.current=!0;const F=l.floating;if(dn(l.domReference)&&F){var N;const I=Js(l.floating).body;I.setAttribute(I1,"");const z=l.domReference,J=x==null||(N=x.nodesRef.current.find(ae=>ae.id===b))==null||(N=N.context)==null?void 0:N.elements.floating;return J&&(J.style.pointerEvents=""),I.style.pointerEvents="none",z.style.pointerEvents="auto",F.style.pointerEvents="auto",()=>{I.style.pointerEvents="",z.style.pointerEvents="",F.style.pointerEvents=""}}}},[u,n,b,l,x,w,V]),Go(()=>{n||(R.current=void 0,L.current=!1,G(),Q())},[n,G,Q]),g.useEffect(()=>()=>{G(),clearTimeout(E.current),clearTimeout(P.current),Q()},[u,l.domReference,G,Q]);const X=g.useMemo(()=>{function M(N){R.current=N.pointerType}return{onPointerDown:M,onPointerEnter:M,onMouseMove(N){const{nativeEvent:F}=N;function I(){!D.current&&!T.current&&r(!0,F,"hover")}h&&!Ug(R.current)||n||m===0||L.current&&N.movementX**2+N.movementY**2<2||(clearTimeout(P.current),R.current==="touch"?I():(L.current=!0,P.current=window.setTimeout(I,m)))}}},[h,r,n,T,m]),B=g.useMemo(()=>({onMouseEnter(){clearTimeout(E.current)},onMouseLeave(M){Y()||q(M.nativeEvent,!1)}}),[q,Y]);return g.useMemo(()=>u?{reference:X,floating:B}:{},[u,X,B])}const qg=()=>{},cE=g.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:qg,setState:qg,isInstantPhase:!1}),VN=()=>g.useContext(cE);function BN(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=g.useReducer((d,p)=>({...d,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=g.useRef(null),u=g.useCallback(d=>{i({currentId:d})},[]);return Go(()=>{o.currentId?l.current===null?l.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),l.current=null)},[o.currentId,o.isInstantPhase]),g.createElement(cE.Provider,{value:g.useMemo(()=>({...o,setState:i,setCurrentId:u}),[o,u])},t)}function UN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i,enabled:l=!0}=t,u=i??o,d=VN(),{currentId:p,setCurrentId:h,initialDelay:m,setState:v,timeoutMs:x}=d;return Go(()=>{l&&p&&(v({delay:{open:1,close:vf(m,"close")}}),p!==u&&r(!1))},[l,u,r,v,p,m]),Go(()=>{function b(){r(!1),v({delay:m,currentId:null})}if(l&&p&&!n&&p===u){if(x){const w=window.setTimeout(b,x);return()=>{clearTimeout(w)}}b()}},[l,n,v,p,u,r,m,x]),Go(()=>{l&&(h===qg||!n||h(u))},[l,n,h,u]),d}function ig(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(l=>{var u;return o.parentId===l.id&&((u=o.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const WN="data-floating-ui-focusable",HN={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},qN={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},A1=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function GN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:p="pointerdown",referencePress:h=!1,referencePressEvent:m="pointerdown",ancestorScroll:v=!1,bubbles:x,capture:b}=t,w=Kv(),j=yi(typeof d=="function"?d:()=>!1),T=typeof d=="function"?j:d,R=g.useRef(!1),E=g.useRef(!1),{escapeKey:C,outsidePress:P}=A1(x),{escapeKey:D,outsidePress:A}=A1(b),O=g.useRef(!1),L=yi(X=>{var B;if(!n||!l||!u||X.key!=="Escape"||O.current)return;const M=(B=i.current.floatingContext)==null?void 0:B.nodeId,N=w?ig(w.nodesRef.current,M):[];if(!C&&(X.stopPropagation(),N.length>0)){let F=!0;if(N.forEach(I=>{var z;if((z=I.context)!=null&&z.open&&!I.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}r(!1,$A(X)?X.nativeEvent:X,"escape-key")}),V=yi(X=>{var B;const M=()=>{var N;L(X),(N=vl(X))==null||N.removeEventListener("keydown",M)};(B=vl(X))==null||B.addEventListener("keydown",M)}),q=yi(X=>{var B;const M=R.current;R.current=!1;const N=E.current;if(E.current=!1,p==="click"&&N||M||typeof T=="function"&&!T(X))return;const F=vl(X),I="["+Yv("inert")+"]",z=Js(o.floating).querySelectorAll(I);let J=dn(F)?F:null;for(;J&&!ms(J);){const Ce=Si(J);if(ms(Ce)||!dn(Ce))break;J=Ce}if(z.length&&dn(F)&&!FA(F)&&!tu(F,o.floating)&&Array.from(z).every(Ce=>!tu(J,Ce)))return;if(zr(F)&&Y){const Ce=F.clientWidth>0&&F.scrollWidth>F.clientWidth,Re=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let ke=Re&&X.offsetX>F.clientWidth;if(Re&&oo(F).direction==="rtl"&&(ke=X.offsetX<=F.offsetWidth-F.clientWidth),ke||Ce&&X.offsetY>F.clientHeight)return}const ae=(B=i.current.floatingContext)==null?void 0:B.nodeId,je=w&&ig(w.nodesRef.current,ae).some(Ce=>{var Re;return tg(X,(Re=Ce.context)==null?void 0:Re.elements.floating)});if(tg(X,o.floating)||tg(X,o.domReference)||je)return;const ge=w?ig(w.nodesRef.current,ae):[];if(ge.length>0){let Ce=!0;if(ge.forEach(Re=>{var ke;if((ke=Re.context)!=null&&ke.open&&!Re.context.dataRef.current.__outsidePressBubbles){Ce=!1;return}}),!Ce)return}r(!1,X,"outside-press")}),G=yi(X=>{var B;const M=()=>{var N;q(X),(N=vl(X))==null||N.removeEventListener(p,M)};(B=vl(X))==null||B.addEventListener(p,M)});g.useEffect(()=>{if(!n||!l)return;i.current.__escapeKeyBubbles=C,i.current.__outsidePressBubbles=P;let X=-1;function B(z){r(!1,z,"ancestor-scroll")}function M(){window.clearTimeout(X),O.current=!0}function N(){X=window.setTimeout(()=>{O.current=!1},cp()?5:0)}const F=Js(o.floating);u&&(F.addEventListener("keydown",D?V:L,D),F.addEventListener("compositionstart",M),F.addEventListener("compositionend",N)),T&&F.addEventListener(p,A?G:q,A);let I=[];return v&&(dn(o.domReference)&&(I=xi(o.domReference)),dn(o.floating)&&(I=I.concat(xi(o.floating))),!dn(o.reference)&&o.reference&&o.reference.contextElement&&(I=I.concat(xi(o.reference.contextElement)))),I=I.filter(z=>{var J;return z!==((J=F.defaultView)==null?void 0:J.visualViewport)}),I.forEach(z=>{z.addEventListener("scroll",B,{passive:!0})}),()=>{u&&(F.removeEventListener("keydown",D?V:L,D),F.removeEventListener("compositionstart",M),F.removeEventListener("compositionend",N)),T&&F.removeEventListener(p,A?G:q,A),I.forEach(z=>{z.removeEventListener("scroll",B)}),window.clearTimeout(X)}},[i,o,u,T,p,n,r,v,l,C,P,L,D,V,q,A,G]),g.useEffect(()=>{R.current=!1},[T,p]);const Q=g.useMemo(()=>({onKeyDown:L,[HN[m]]:X=>{h&&r(!1,X.nativeEvent,"reference-press")}}),[L,r,h,m]),Y=g.useMemo(()=>({onKeyDown:L,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[qN[p]]:()=>{R.current=!0}}),[L,p]);return g.useMemo(()=>l?{reference:Q,floating:Y}:{},[l,Q,Y])}function QN(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=lE(),i=g.useRef({}),[l]=g.useState(()=>LN()),u=Qv()!=null,[d,p]=g.useState(r.reference),h=yi((x,b,w)=>{i.current.openEvent=x?b:void 0,l.emit("openchange",{open:x,event:b,reason:w,nested:u}),n==null||n(x,b,w)}),m=g.useMemo(()=>({setPositionReference:p}),[]),v=g.useMemo(()=>({reference:d||r.reference||null,floating:r.floating||null,domReference:r.reference}),[d,r.reference,r.floating]);return g.useMemo(()=>({dataRef:i,open:t,onOpenChange:h,elements:v,events:l,floatingId:o,refs:m}),[t,h,v,l,o,m])}function Xv(e){e===void 0&&(e={});const{nodeId:t}=e,n=QN({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,l]=g.useState(null),[u,d]=g.useState(null),h=(o==null?void 0:o.domReference)||i,m=g.useRef(null),v=Kv();Go(()=>{h&&(m.current=h)},[h]);const x=PN({...e,elements:{...o,...u&&{reference:u}}}),b=g.useCallback(E=>{const C=dn(E)?{getBoundingClientRect:()=>E.getBoundingClientRect(),contextElement:E}:E;d(C),x.refs.setReference(C)},[x.refs]),w=g.useCallback(E=>{(dn(E)||E===null)&&(m.current=E,l(E)),(dn(x.refs.reference.current)||x.refs.reference.current===null||E!==null&&!dn(E))&&x.refs.setReference(E)},[x.refs]),j=g.useMemo(()=>({...x.refs,setReference:w,setPositionReference:b,domReference:m}),[x.refs,w,b]),T=g.useMemo(()=>({...x.elements,domReference:h}),[x.elements,h]),R=g.useMemo(()=>({...x,...r,refs:j,elements:T,nodeId:t}),[x,j,T,t,r]);return Go(()=>{r.dataRef.current.floatingContext=R;const E=v==null?void 0:v.nodesRef.current.find(C=>C.id===t);E&&(E.context=R)}),g.useMemo(()=>({...x,context:R,refs:j,elements:T}),[x,j,T,R])}function KN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:l}=e,{enabled:u=!0,visibleOnly:d=!0}=t,p=g.useRef(!1),h=g.useRef(),m=g.useRef(!0);g.useEffect(()=>{if(!u)return;const x=Sr(l.domReference);function b(){!n&&zr(l.domReference)&&l.domReference===S1(Js(l.domReference))&&(p.current=!0)}function w(){m.current=!0}return x.addEventListener("blur",b),x.addEventListener("keydown",w,!0),()=>{x.removeEventListener("blur",b),x.removeEventListener("keydown",w,!0)}},[l.domReference,n,u]),g.useEffect(()=>{if(!u)return;function x(b){let{reason:w}=b;(w==="reference-press"||w==="escape-key")&&(p.current=!0)}return o.on("openchange",x),()=>{o.off("openchange",x)}},[o,u]),g.useEffect(()=>()=>{clearTimeout(h.current)},[]);const v=g.useMemo(()=>({onPointerDown(x){NA(x.nativeEvent)||(m.current=!1)},onMouseLeave(){p.current=!1},onFocus(x){if(p.current)return;const b=vl(x.nativeEvent);if(d&&dn(b))try{if(OA()&&MA())throw Error();if(!b.matches(":focus-visible"))return}catch{if(!m.current&&!VA(b))return}r(!0,x.nativeEvent,"focus")},onBlur(x){p.current=!1;const b=x.relatedTarget,w=x.nativeEvent,j=dn(b)&&b.hasAttribute(Yv("focus-guard"))&&b.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{var T;const R=S1(l.domReference?l.domReference.ownerDocument:document);!b&&R===l.domReference||tu((T=i.current.floatingContext)==null?void 0:T.refs.floating.current,R)||tu(l.domReference,R)||j||r(!1,w,"focus")})}}),[i,l.domReference,r,d]);return g.useMemo(()=>u?{reference:v}:{},[u,v])}const N1="active",O1="selected";function sg(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[N1]:l,[O1]:u,...d}=e;i=d}return{...n==="floating"&&{tabIndex:-1,[WN]:""},...i,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(d=>{let[p,h]=d;if(!(o&&[N1,O1].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof h=="function"){var m;(m=r.get(p))==null||m.push(h),l[p]=function(){for(var v,x=arguments.length,b=new Array(x),w=0;w<x;w++)b[w]=arguments[w];return(v=r.get(p))==null?void 0:v.map(j=>j(...b)).find(j=>j!==void 0)}}}else l[p]=h}),l),{})}}function YN(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),o=g.useCallback(u=>sg(u,e,"reference"),t),i=g.useCallback(u=>sg(u,e,"floating"),n),l=g.useCallback(u=>sg(u,e,"item"),r);return g.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:l}),[o,i,l])}const XN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function JN(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:l="dialog"}=t,u=(n=XN.get(l))!=null?n:l,d=lE(),h=Qv()!=null,m=g.useMemo(()=>u==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?o:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:d},...u==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[u,o,h,r,d,l]),v=g.useMemo(()=>{const b={id:o,...u&&{role:u}};return u==="tooltip"||l==="label"?b:{...b,...u==="menu"&&{"aria-labelledby":d}}},[u,o,d,l]),x=g.useCallback(b=>{let{active:w,selected:j}=b;const T={role:"option",...w&&{id:o+"-option"}};switch(l){case"select":return{...T,"aria-selected":w&&j};case"combobox":return{...T,...w&&{"aria-selected":!0}}}return{}},[o,l]);return g.useMemo(()=>i?{reference:m,floating:v,item:x}:{},[i,m,v,x])}const[ZN,lo]=dr("ScrollArea.Root component was not found in tree");function Pl(e,t){const n=Qs(t);$l(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const e4=g.forwardRef((e,t)=>{const{style:n,...r}=e,o=lo(),[i,l]=g.useState(0),[u,d]=g.useState(0),p=!!(i&&u);return Pl(o.scrollbarX,()=>{var m;const h=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(h),d(h)}),Pl(o.scrollbarY,()=>{var m;const h=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(h),l(h)}),p?s.jsx("div",{...r,ref:t,style:{...n,width:i,height:u}}):null}),t4=g.forwardRef((e,t)=>{const n=lo(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(e4,{...e,ref:t}):null}),n4={scrollHideDelay:1e3,type:"hover"},uE=g.forwardRef((e,t)=>{const n=oe("ScrollAreaRoot",n4,e),{type:r,scrollHideDelay:o,scrollbars:i,...l}=n,[u,d]=g.useState(null),[p,h]=g.useState(null),[m,v]=g.useState(null),[x,b]=g.useState(null),[w,j]=g.useState(null),[T,R]=g.useState(0),[E,C]=g.useState(0),[P,D]=g.useState(!1),[A,O]=g.useState(!1),L=An(t,V=>d(V));return s.jsx(ZN,{value:{type:r,scrollHideDelay:o,scrollArea:u,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:x,onScrollbarXChange:b,scrollbarXEnabled:P,onScrollbarXEnabledChange:D,scrollbarY:w,onScrollbarYChange:j,scrollbarYEnabled:A,onScrollbarYEnabledChange:O,onCornerWidthChange:R,onCornerHeightChange:C},children:s.jsx(se,{...l,ref:L,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${T}px`,"--sa-corner-height":i!=="xy"?"0px":`${E}px`}})})});uE.displayName="@mantine/core/ScrollAreaRoot";function dE(e,t){const n=e/t;return Number.isNaN(n)?0:n}function dp(e){const t=dE(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function fE(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 r4(e,[t,n]){return Math.min(n,Math.max(t,e))}function M1(e,t,n="ltr"){const r=dp(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,l=t.content-t.viewport,u=i-r,d=n==="ltr"?[0,l]:[l*-1,0],p=r4(e,d);return fE([0,l],[0,u])(p)}function o4(e,t,n,r="ltr"){const o=dp(n),i=o/2,l=t||i,u=o-l,d=n.scrollbar.paddingStart+l,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return fE([d,p],m)(e)}function pE(e,t){return e>0&&e<t}function hs(e){return e?parseInt(e,10):0}function oa(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[i4,hE]=dr("ScrollAreaScrollbar was not found in tree"),mE=g.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...m}=e,v=lo(),[x,b]=g.useState(null),w=An(t,O=>b(O)),j=g.useRef(null),T=g.useRef(""),{viewport:R}=v,E=n.content-n.viewport,C=Qs(p),P=Qs(u),D=np(h,10),A=O=>{if(j.current){const L=O.clientX-j.current.left,V=O.clientY-j.current.top;d({x:L,y:V})}};return g.useEffect(()=>{const O=L=>{const V=L.target;(x==null?void 0:x.contains(V))&&C(L,E)};return document.addEventListener("wheel",O,{passive:!1}),()=>document.removeEventListener("wheel",O,{passive:!1})},[R,x,E,C]),g.useEffect(P,[n,P]),Pl(x,D),Pl(v.content,D),s.jsx(i4,{value:{scrollbar:x,hasThumb:r,onThumbChange:Qs(o),onThumbPointerUp:Qs(i),onThumbPositionChange:P,onThumbPointerDown:Qs(l)},children:s.jsx("div",{...m,ref:w,"data-mantine-scrollbar":!0,style:{position:"absolute",...m.style},onPointerDown:oa(e.onPointerDown,O=>{O.preventDefault(),O.button===0&&(O.target.setPointerCapture(O.pointerId),j.current=x.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(O))}),onPointerMove:oa(e.onPointerMove,A),onPointerUp:oa(e.onPointerUp,O=>{const L=O.target;L.hasPointerCapture(O.pointerId)&&(O.preventDefault(),L.releasePointerCapture(O.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,j.current=null}})})}),gE=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,l=lo(),[u,d]=g.useState(),p=g.useRef(null),h=An(t,p,l.onScrollbarXChange);return g.useEffect(()=>{p.current&&d(getComputedStyle(p.current))},[p]),s.jsx(mE,{"data-orientation":"horizontal",...i,ref:h,sizes:n,style:{...o,"--sa-thumb-width":`${dp(n)}px`},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,v)=>{if(l.viewport){const x=l.viewport.scrollLeft+m.deltaX;e.onWheelScroll(x),pE(x,v)&&m.preventDefault()}},onResize:()=>{p.current&&l.viewport&&u&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:hs(u.paddingLeft),paddingEnd:hs(u.paddingRight)}})}})});gE.displayName="@mantine/core/ScrollAreaScrollbarX";const vE=g.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,l=lo(),[u,d]=g.useState(),p=g.useRef(null),h=An(t,p,l.onScrollbarYChange);return g.useEffect(()=>{p.current&&d(window.getComputedStyle(p.current))},[]),s.jsx(mE,{...i,"data-orientation":"vertical",ref:h,sizes:n,style:{"--sa-thumb-height":`${dp(n)}px`,...o},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,v)=>{if(l.viewport){const x=l.viewport.scrollTop+m.deltaY;e.onWheelScroll(x),pE(x,v)&&m.preventDefault()}},onResize:()=>{p.current&&l.viewport&&u&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:hs(u.paddingTop),paddingEnd:hs(u.paddingBottom)}})}})});vE.displayName="@mantine/core/ScrollAreaScrollbarY";const fp=g.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=ba(),i=lo(),l=g.useRef(null),u=g.useRef(0),[d,p]=g.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=dE(d.viewport,d.content),m={...r,sizes:d,onSizesChange:p,hasThumb:h>0&&h<1,onThumbChange:x=>{l.current=x},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:x=>{u.current=x}},v=(x,b)=>o4(x,u.current,d,b);return n==="horizontal"?s.jsx(gE,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const x=i.viewport.scrollLeft,b=M1(x,d,o);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{i.viewport&&(i.viewport.scrollLeft=x)},onDragScroll:x=>{i.viewport&&(i.viewport.scrollLeft=v(x,o))}}):n==="vertical"?s.jsx(vE,{...m,ref:t,onThumbPositionChange:()=>{if(i.viewport&&l.current){const x=i.viewport.scrollTop,b=M1(x,d);d.scrollbar.size===0?l.current.style.setProperty("--thumb-opacity","0"):l.current.style.setProperty("--thumb-opacity","1"),l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{i.viewport&&(i.viewport.scrollTop=x)},onDragScroll:x=>{i.viewport&&(i.viewport.scrollTop=v(x))}}):null});fp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Jv=g.forwardRef((e,t)=>{const n=lo(),{forceMount:r,...o}=e,[i,l]=g.useState(!1),u=e.orientation==="horizontal",d=np(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?p:h)}},10);return Pl(n.viewport,d),Pl(n.content,d),r||i?s.jsx(fp,{"data-state":i?"visible":"hidden",...o,ref:t}):null});Jv.displayName="@mantine/core/ScrollAreaScrollbarAuto";const yE=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=lo(),[i,l]=g.useState(!1);return g.useEffect(()=>{const{scrollArea:u}=o;let d=0;if(u){const p=()=>{window.clearTimeout(d),l(!0)},h=()=>{d=window.setTimeout(()=>l(!1),o.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",h)}}},[o.scrollArea,o.scrollHideDelay]),n||i?s.jsx(Jv,{"data-state":i?"visible":"hidden",...r,ref:t}):null});yE.displayName="@mantine/core/ScrollAreaScrollbarHover";const s4=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=lo(),i=e.orientation==="horizontal",[l,u]=g.useState("hidden"),d=np(()=>u("idle"),100);return g.useEffect(()=>{if(l==="idle"){const p=window.setTimeout(()=>u("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,o.scrollHideDelay]),g.useEffect(()=>{const{viewport:p}=o,h=i?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const x=p[h];m!==x&&(u("scrolling"),d()),m=x};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[o.viewport,i,d]),n||l!=="hidden"?s.jsx(fp,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:oa(e.onPointerEnter,()=>u("interacting")),onPointerLeave:oa(e.onPointerLeave,()=>u("idle"))}):null}),Gg=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=lo(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=o,u=e.orientation==="horizontal";return g.useEffect(()=>(u?i(!0):l(!0),()=>{u?i(!1):l(!1)}),[u,i,l]),o.type==="hover"?s.jsx(yE,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(s4,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(Jv,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(fp,{...r,ref:t}):null});Gg.displayName="@mantine/core/ScrollAreaScrollbar";function a4(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},l=n.left!==i.left,u=n.top!==i.top;(l||u)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const xE=g.forwardRef((e,t)=>{const{style:n,...r}=e,o=lo(),i=hE(),{onThumbPositionChange:l}=i,u=An(t,h=>i.onThumbChange(h)),d=g.useRef(void 0),p=np(()=>{d.current&&(d.current(),d.current=void 0)},100);return g.useEffect(()=>{const{viewport:h}=o;if(h){const m=()=>{if(p(),!d.current){const v=a4(h,l);d.current=v,l()}};return l(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[o.viewport,p,l]),s.jsx("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:oa(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),x=h.clientX-v.left,b=h.clientY-v.top;i.onThumbPointerDown({x,y:b})}),onPointerUp:oa(e.onPointerUp,i.onThumbPointerUp)})});xE.displayName="@mantine/core/ScrollAreaThumb";const Qg=g.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=hE();return n||o.hasThumb?s.jsx(xE,{ref:t,...r}):null});Qg.displayName="@mantine/core/ScrollAreaThumb";const bE=g.forwardRef(({children:e,style:t,...n},r)=>{const o=lo(),i=An(r,o.onViewportChange);return s.jsx(se,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});bE.displayName="@mantine/core/ScrollAreaViewport";var Zv={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const wE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},l4=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":ie(t),"--scrollarea-over-scroll-behavior":n}}),co=ue((e,t)=>{const n=oe("ScrollArea",wE,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,scrollbarSize:d,vars:p,type:h,scrollHideDelay:m,viewportProps:v,viewportRef:x,onScrollPositionChange:b,children:w,offsetScrollbars:j,scrollbars:T,onBottomReached:R,onTopReached:E,overscrollBehavior:C,...P}=n,[D,A]=g.useState(!1),[O,L]=g.useState(!1),[V,q]=g.useState(!1),G=Le({name:"ScrollArea",props:n,classes:Zv,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:l4}),Q=g.useRef(null),Y=DN([x,Q]);return g.useEffect(()=>{if(!Q.current||j!=="present")return;const X=Q.current,B=new ResizeObserver(()=>{const{scrollHeight:M,clientHeight:N,scrollWidth:F,clientWidth:I}=X;L(M>N),q(F>I)});return B.observe(X),()=>B.disconnect()},[Q,j]),s.jsxs(uE,{type:h==="never"?"always":h,scrollHideDelay:m,ref:t,scrollbars:T,...G("root"),...P,children:[s.jsx(bE,{...v,...G("viewport",{style:v==null?void 0:v.style}),ref:Y,"data-offset-scrollbars":j===!0?"xy":j||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":j==="present"&&!V?"true":void 0,"data-vertical-hidden":j==="present"&&!O?"true":void 0,onScroll:X=>{var F;(F=v==null?void 0:v.onScroll)==null||F.call(v,X),b==null||b({x:X.currentTarget.scrollLeft,y:X.currentTarget.scrollTop});const{scrollTop:B,scrollHeight:M,clientHeight:N}=X.currentTarget;B-(M-N)>=0&&(R==null||R()),B===0&&(E==null||E())},children:w}),(T==="xy"||T==="x")&&s.jsx(Gg,{...G("scrollbar"),orientation:"horizontal","data-hidden":h==="never"||j==="present"&&!V?!0:void 0,forceMount:!0,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:s.jsx(Qg,{...G("thumb")})}),(T==="xy"||T==="y")&&s.jsx(Gg,{...G("scrollbar"),orientation:"vertical","data-hidden":h==="never"||j==="present"&&!O?!0:void 0,forceMount:!0,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),children:s.jsx(Qg,{...G("thumb")})}),s.jsx(t4,{...G("corner"),"data-hovered":D||void 0,"data-hidden":h==="never"||void 0})]})});co.displayName="@mantine/core/ScrollArea";const pp=ue((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:l,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:x,viewportProps:b,scrollbars:w,style:j,vars:T,onBottomReached:R,onTopReached:E,...C}=oe("ScrollAreaAutosize",wE,e);return s.jsx(se,{...C,ref:t,style:[{display:"flex",overflow:"auto"},j],children:s.jsx(se,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(co,{classNames:r,styles:o,scrollHideDelay:l,scrollbarSize:i,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:x,viewportProps:b,vars:T,scrollbars:w,onBottomReached:R,onTopReached:E,children:n})})})});co.classes=Zv;pp.displayName="@mantine/core/ScrollAreaAutosize";pp.classes=Zv;co.Autosize=pp;var SE={root:"m_87cf2631"};const c4={__staticSelector:"UnstyledButton"},Qn=nr((e,t)=>{const n=oe("UnstyledButton",c4,e),{className:r,component:o="button",__staticSelector:i,unstyled:l,classNames:u,styles:d,style:p,...h}=n,m=Le({name:i,props:n,classes:SE,className:r,style:p,classNames:u,styles:d,unstyled:l});return s.jsx(se,{...m("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...h})});Qn.classes=SE;Qn.displayName="@mantine/core/UnstyledButton";var jE={root:"m_515a97f8"};const u4={},ey=ue((e,t)=>{const n=oe("VisuallyHidden",u4,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,...p}=n,h=Le({name:"VisuallyHidden",classes:jE,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u});return s.jsx(se,{component:"span",ref:t,...h("root"),...p})});ey.classes=jE;ey.displayName="@mantine/core/VisuallyHidden";var CE={root:"m_1b7284a3"};const d4={},f4=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Mt(t),"--paper-shadow":_v(n)}}),cr=nr((e,t)=>{const n=oe("Paper",d4,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,withBorder:d,vars:p,radius:h,shadow:m,variant:v,mod:x,...b}=n,w=Le({name:"Paper",props:n,classes:CE,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:f4});return s.jsx(se,{ref:t,mod:[{"data-with-border":d},x],...w("root"),variant:v,...b})});cr.classes=CE;cr.displayName="@mantine/core/Paper";function EE(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}function L1(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function $1(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const p4={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function h4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:l,dir:u}){const[d,p="center"]=e.split("-"),h={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[p4[d]]:r},m=-t/2;return d==="left"?{...h,...L1(p,l,n,o),right:m,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:d==="right"?{...h,...L1(p,l,n,o),left:m,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:d==="top"?{...h,...$1(p,i,n,o,u),bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:d==="bottom"?{...h,...$1(p,i,n,o,u),top:m,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const ty=g.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:l,arrowY:u,style:d,...p},h)=>{const{dir:m}=ba();return i?s.jsx("div",{...p,ref:h,style:{...d,...h4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:m,arrowX:l,arrowY:u})}}):null});ty.displayName="@mantine/core/FloatingArrow";var kE={root:"m_9814e45f"};const m4={zIndex:Br("modal")},g4=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:l})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&eo(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${ie(o)})`:void 0,"--overlay-radius":i===void 0?void 0:Mt(i),"--overlay-z-index":l==null?void 0:l.toString()}}),Rl=nr((e,t)=>{const n=oe("Overlay",m4,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,fixed:p,center:h,children:m,radius:v,zIndex:x,gradient:b,blur:w,color:j,backgroundOpacity:T,mod:R,...E}=n,C=Le({name:"Overlay",props:n,classes:kE,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:g4});return s.jsx(se,{ref:t,...C("root"),mod:[{center:h,fixed:p},R],...E,children:m})});Rl.classes=kE;Rl.displayName="@mantine/core/Overlay";function ag(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 v4({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||ag(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=ag(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return ag(n)}const y4={},TE=ue((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...i}=oe("Portal",y4,e),[l,u]=g.useState(!1),d=g.useRef(null);return $l(()=>(u(!0),d.current=v4({target:r,reuseTargetNode:o,...i}),Zc(t,d.current),!r&&!o&&d.current&&document.body.appendChild(d.current),()=>{!r&&!o&&d.current&&document.body.removeChild(d.current)}),[r]),!l||!d.current?null:$v.createPortal(s.jsx(s.Fragment,{children:n}),d.current)});TE.displayName="@mantine/core/Portal";const ws=ue(({withinPortal:e=!0,children:t,...n},r)=>OC()==="test"||!e?s.jsx(s.Fragment,{children:t}):s.jsx(TE,{ref:r,...n,children:t}));ws.displayName="@mantine/core/OptionalPortal";const $c=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),rf={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:{...$c("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...$c("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...$c("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...$c("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...$c("top"),common:{transformOrigin:"top right"}}},F1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function x4({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in rf?{transitionProperty:rf[e].transitionProperty,...o,...rf[e].common,...rf[e][F1[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[F1[t]]}}function b4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:l,onExited:u,enterDelay:d,exitDelay:p}){const h=mn(),m=Iv(),v=h.respectReducedMotion?m:!1,[x,b]=g.useState(v?0:e),[w,j]=g.useState(r?"entered":"exited"),T=g.useRef(-1),R=g.useRef(-1),E=g.useRef(-1),C=D=>{const A=D?o:i,O=D?l:u;window.clearTimeout(T.current);const L=v?0:D?e:t;b(L),L===0?(typeof A=="function"&&A(),typeof O=="function"&&O(),j(D?"entered":"exited")):E.current=requestAnimationFrame(()=>{Hc.flushSync(()=>{j(D?"pre-entering":"pre-exiting")}),E.current=requestAnimationFrame(()=>{typeof A=="function"&&A(),j(D?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof O=="function"&&O(),j(D?"entered":"exited")},L)})})},P=D=>{if(window.clearTimeout(R.current),typeof(D?d:p)!="number"){C(D);return}R.current=window.setTimeout(()=>{C(D)},D?d:p)};return wi(()=>{P(r)},[r]),g.useEffect(()=>()=>{window.clearTimeout(T.current),cancelAnimationFrame(E.current)},[]),{transitionDuration:x,transitionStatus:w,transitionTimingFunction:n||"ease"}}function ti({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:l="ease",onExit:u,onEntered:d,onEnter:p,onExited:h,enterDelay:m,exitDelay:v}){const x=OC(),{transitionDuration:b,transitionStatus:w,transitionTimingFunction:j}=b4({mounted:o,exitDuration:r,duration:n,timingFunction:l,onExit:u,onEntered:d,onEnter:p,onExited:h,enterDelay:m,exitDelay:v});return b===0||x==="test"?o?s.jsx(s.Fragment,{children:i({})}):e?i({display:"none"}):null:w==="exited"?e?i({display:"none"}):null:s.jsx(s.Fragment,{children:i(x4({transition:t,duration:b,state:w,timingFunction:j}))})}ti.displayName="@mantine/core/Transition";const[w4,PE]=dr("Popover component was not found in the tree");function hp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=oI(t),i=An(o,r);return Pi(e)?g.cloneElement(e,{[n]:i}):e}function RE(e){return s.jsx(ey,{tabIndex:-1,"data-autofocus":!0,...e})}hp.displayName="@mantine/core/FocusTrap";RE.displayName="@mantine/core/FocusTrapInitialFocus";hp.InitialFocus=RE;var _E={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const S4={},ny=ue((e,t)=>{var j,T,R,E;const n=oe("PopoverDropdown",S4,e),{className:r,style:o,vars:i,children:l,onKeyDownCapture:u,variant:d,classNames:p,styles:h,...m}=n,v=PE(),x=PC({opened:v.opened,shouldReturnFocus:v.returnFocus}),b=v.withRoles?{"aria-labelledby":v.getTargetId(),id:v.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=An(t,v.floating);return v.disabled?null:s.jsx(ws,{...v.portalProps,withinPortal:v.withinPortal,children:s.jsx(ti,{mounted:v.opened,...v.transitionProps,transition:((j=v.transitionProps)==null?void 0:j.transition)||"fade",duration:((T=v.transitionProps)==null?void 0:T.duration)??150,keepMounted:v.keepMounted,exitDuration:typeof((R=v.transitionProps)==null?void 0:R.exitDuration)=="number"?v.transitionProps.exitDuration:(E=v.transitionProps)==null?void 0:E.duration,children:C=>s.jsx(hp,{active:v.trapFocus&&v.opened,innerRef:w,children:s.jsxs(se,{...b,...m,variant:d,onKeyDownCapture:WD(()=>{var P,D;(P=v.onClose)==null||P.call(v),(D=v.onDismiss)==null||D.call(v)},{active:v.closeOnEscape,onTrigger:x,onKeyDown:u}),"data-position":v.placement,"data-fixed":v.floatingStrategy==="fixed"||void 0,...v.getStyles("dropdown",{className:r,props:n,classNames:p,styles:h,style:[{...C,zIndex:v.zIndex,top:v.y??0,left:v.x??0,width:v.width==="target"?void 0:ie(v.width)},v.resolvedStyles.dropdown,h==null?void 0:h.dropdown,o]}),children:[l,s.jsx(ty,{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:h})})]})})})})});ny.classes=_E;ny.displayName="@mantine/core/PopoverDropdown";const j4={refProp:"ref",popupType:"dialog"},DE=ue((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=oe("PopoverTarget",j4,e);if(!Pi(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 l=i,u=PE(),d=An(u.reference,op(n),t),p=u.withRoles?{"aria-haspopup":o,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return g.cloneElement(n,{...l,...p,...u.targetProps,className:At(u.targetProps.className,l.className,n.props.className),[r]:d,...u.controlled?null:{onClick:u.onToggle}})});DE.displayName="@mantine/core/PopoverTarget";function IE({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=g.useState(0);g.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return bN(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),wi(()=>{t.update()},r),wi(()=>{i(l=>l+1)},[e])}function C4(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 E4(e,t){const n=C4(e.middlewares),r=[iE(e.offset)];return n.shift&&r.push(Gv(typeof n.shift=="boolean"?{limiter:R1(),padding:5}:{limiter:R1(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?If():If(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Kc():Kc(n.inline)),r.push(sE({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(_N({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:l,...u}){var h;const p=((h=t().refs.floating.current)==null?void 0:h.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:o,availableWidth:i,availableHeight:l,...u}):Object.assign(p,{maxWidth:`${i}px`,maxHeight:`${l}px`})),e.width==="target"&&Object.assign(p,{width:`${o.reference.width}px`})}})),r}function k4(e){const[t,n]=Bn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=g.useRef(t),o=()=>{t&&n(!1)},i=()=>n(!t),l=Xv({strategy:e.strategy,placement:e.position,middleware:E4(e,()=>l)});return IE({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:l}),wi(()=>{var u;(u=e.onPositionChange)==null||u.call(e,l.placement)},[l.placement]),wi(()=>{var u,d;t!==r.current&&(t?(d=e.onOpen)==null||d.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:l,controlled:typeof e.opened=="boolean",opened:t,onClose:o,onToggle:i}}const T4={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:Br("popover"),__staticSelector:"Popover",width:"max-content"},P4=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Mt(t),"--popover-shadow":_v(n)}});function Ro(e){var Ae,pt,zt,Qt,jn,Ct;const t=oe("Popover",T4,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:l,opened:u,transitionProps:d,onExitTransitionEnd:p,onEnterTransitionEnd:h,width:m,middlewares:v,withArrow:x,arrowSize:b,arrowOffset:w,arrowRadius:j,arrowPosition:T,unstyled:R,classNames:E,styles:C,closeOnClickOutside:P,withinPortal:D,portalProps:A,closeOnEscape:O,clickOutsideEvents:L,trapFocus:V,onClose:q,onDismiss:G,onOpen:Q,onChange:Y,zIndex:X,radius:B,shadow:M,id:N,defaultOpened:F,__staticSelector:I,withRoles:z,disabled:J,returnFocus:ae,variant:je,keepMounted:ge,vars:Ce,floatingStrategy:Re,withOverlay:ke,overlayProps:_e,...$e}=t,yt=Le({name:I,props:t,classes:_E,classNames:E,styles:C,unstyled:R,rootSelector:"dropdown",vars:Ce,varsResolver:P4}),{resolvedStyles:Ft}=va({classNames:E,styles:C,props:t}),gt=g.useRef(null),[Tt,Nt]=g.useState(null),[Pt,be]=g.useState(null),{dir:Ie}=ba(),Be=fr(N),Se=k4({middlewares:v,width:m,position:EE(Ie,r),offset:typeof o=="number"?o+(x?b/2:0):o,arrowRef:gt,arrowOffset:w,onPositionChange:i,positionDependencies:l,opened:u,defaultOpened:F,onChange:Y,onOpen:Q,onClose:q,onDismiss:G,strategy:Re});KD(()=>{P&&(Se.onClose(),G==null||G())},L,[Tt,Pt]);const ce=g.useCallback(bt=>{Nt(bt),Se.floating.refs.setReference(bt)},[Se.floating.refs.setReference]),me=g.useCallback(bt=>{be(bt),Se.floating.refs.setFloating(bt)},[Se.floating.refs.setFloating]),Ue=g.useCallback(()=>{var bt;(bt=d==null?void 0:d.onExited)==null||bt.call(d),p==null||p()},[d==null?void 0:d.onExited,p]),de=g.useCallback(()=>{var bt;(bt=d==null?void 0:d.onEntered)==null||bt.call(d),h==null||h()},[d==null?void 0:d.onEntered,h]);return s.jsxs(w4,{value:{returnFocus:ae,disabled:J,controlled:Se.controlled,reference:ce,floating:me,x:Se.floating.x,y:Se.floating.y,arrowX:(zt=(pt=(Ae=Se.floating)==null?void 0:Ae.middlewareData)==null?void 0:pt.arrow)==null?void 0:zt.x,arrowY:(Ct=(jn=(Qt=Se.floating)==null?void 0:Qt.middlewareData)==null?void 0:jn.arrow)==null?void 0:Ct.y,opened:Se.opened,arrowRef:gt,transitionProps:{...d,onExited:Ue,onEntered:de},width:m,withArrow:x,arrowSize:b,arrowOffset:w,arrowRadius:j,arrowPosition:T,placement:Se.floating.placement,trapFocus:V,withinPortal:D,portalProps:A,zIndex:X,radius:B,shadow:M,closeOnEscape:O,onDismiss:G,onClose:Se.onClose,onToggle:Se.onToggle,getTargetId:()=>`${Be}-target`,getDropdownId:()=>`${Be}-dropdown`,withRoles:z,targetProps:$e,__staticSelector:I,classNames:E,styles:C,unstyled:R,variant:je,keepMounted:ge,getStyles:yt,resolvedStyles:Ft,floatingStrategy:Re},children:[n,ke&&s.jsx(ti,{transition:"fade",mounted:Se.opened,duration:(d==null?void 0:d.duration)||250,exitDuration:(d==null?void 0:d.exitDuration)||250,children:bt=>s.jsx(ws,{withinPortal:D,children:s.jsx(Rl,{..._e,...yt("overlay",{className:_e==null?void 0:_e.className,style:[bt,_e==null?void 0:_e.style]})})})})]})}Ro.Target=DE;Ro.Dropdown=ny;Ro.displayName="@mantine/core/Popover";Ro.extend=e=>e;var Co={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 AE=g.forwardRef(({className:e,...t},n)=>s.jsxs(se,{component:"span",className:At(Co.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Co.bar}),s.jsx("span",{className:Co.bar}),s.jsx("span",{className:Co.bar})]}));AE.displayName="@mantine/core/Bars";const NE=g.forwardRef(({className:e,...t},n)=>s.jsxs(se,{component:"span",className:At(Co.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Co.dot}),s.jsx("span",{className:Co.dot}),s.jsx("span",{className:Co.dot})]}));NE.displayName="@mantine/core/Dots";const OE=g.forwardRef(({className:e,...t},n)=>s.jsx(se,{component:"span",className:At(Co.ovalLoader,e),...t,ref:n}));OE.displayName="@mantine/core/Oval";const ME={bars:AE,oval:OE,dots:NE},R4={loaders:ME,type:"oval"},_4=(e,{size:t,color:n})=>({root:{"--loader-size":ot(t,"loader-size"),"--loader-color":n?Lt(n,e):void 0}}),Cr=ue((e,t)=>{const n=oe("Loader",R4,e),{size:r,color:o,type:i,vars:l,className:u,style:d,classNames:p,styles:h,unstyled:m,loaders:v,variant:x,children:b,...w}=n,j=Le({name:"Loader",props:n,classes:Co,className:u,style:d,classNames:p,styles:h,unstyled:m,vars:l,varsResolver:_4});return b?s.jsx(se,{...j("root"),ref:t,...w,children:b}):s.jsx(se,{...j("root"),ref:t,component:v[i],variant:x,size:r,...w})});Cr.defaultLoaders=ME;Cr.classes=Co;Cr.displayName="@mantine/core/Loader";var Vl={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const z1={orientation:"horizontal"},D4=(e,{borderWidth:t})=>({group:{"--ai-border-width":ie(t)}}),ry=ue((e,t)=>{const n=oe("ActionIconGroup",z1,e),{className:r,style:o,classNames:i,styles:l,unstyled:u,orientation:d,vars:p,borderWidth:h,variant:m,mod:v,...x}=oe("ActionIconGroup",z1,e),b=Le({name:"ActionIconGroup",props:n,classes:Vl,className:r,style:o,classNames:i,styles:l,unstyled:u,vars:p,varsResolver:D4,rootSelector:"group"});return s.jsx(se,{...b("group"),ref:t,variant:m,mod:[{"data-orientation":d},v],role:"group",...x})});ry.classes=Vl;ry.displayName="@mantine/core/ActionIconGroup";const V1={},I4=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:i,size:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:i});return{groupSection:{"--section-height":ot(l,"section-height"),"--section-padding-x":ot(l,"section-padding-x"),"--section-fz":_n(l),"--section-radius":t===void 0?void 0:Mt(t),"--section-bg":n||o?u.background:void 0,"--section-color":u.color,"--section-bd":n||o?u.border:void 0}}},oy=ue((e,t)=>{const n=oe("ActionIconGroupSection",V1,e),{className:r,style:o,classNames:i,styles:l,unstyled:u,vars:d,variant:p,gradient:h,radius:m,autoContrast:v,...x}=oe("ActionIconGroupSection",V1,e),b=Le({name:"ActionIconGroupSection",props:n,classes:Vl,className:r,style:o,classNames:i,styles:l,unstyled:u,vars:d,varsResolver:I4,rootSelector:"groupSection"});return s.jsx(se,{...b("groupSection"),ref:t,variant:p,...x})});oy.classes=Vl;oy.displayName="@mantine/core/ActionIconGroupSection";const A4={},N4=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:l})=>{const u=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:l});return{root:{"--ai-size":ot(t,"ai-size"),"--ai-radius":n===void 0?void 0:Mt(n),"--ai-bg":i||r?u.background:void 0,"--ai-hover":i||r?u.hover:void 0,"--ai-hover-color":i||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":i||r?u.border:void 0}}},En=nr((e,t)=>{const n=oe("ActionIcon",A4,e),{className:r,unstyled:o,variant:i,classNames:l,styles:u,style:d,loading:p,loaderProps:h,size:m,color:v,radius:x,__staticSelector:b,gradient:w,vars:j,children:T,disabled:R,"data-disabled":E,autoContrast:C,mod:P,...D}=n,A=Le({name:["ActionIcon",b],props:n,className:r,style:d,classes:Vl,classNames:l,styles:u,unstyled:o,vars:j,varsResolver:N4});return s.jsxs(Qn,{...A("root",{active:!R&&!p&&!E}),...D,unstyled:o,variant:i,size:m,disabled:R||p,ref:t,mod:[{loading:p,disabled:R||E},P],children:[s.jsx(ti,{mounted:!!p,transition:"slide-down",duration:150,children:O=>s.jsx(se,{component:"span",...A("loader",{style:O}),"aria-hidden":!0,children:s.jsx(Cr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...h})})}),s.jsx(se,{component:"span",mod:{loading:p},...A("icon"),children:T})]})});En.classes=Vl;En.displayName="@mantine/core/ActionIcon";En.Group=ry;En.GroupSection=oy;const LE=g.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"})}));LE.displayName="@mantine/core/CloseIcon";var $E={root:"m_86a44da5","root--subtle":"m_220c80f2"};const O4={variant:"subtle"},M4=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":ot(t,"cb-size"),"--cb-radius":n===void 0?void 0:Mt(n),"--cb-icon-size":ie(r)}}),Ss=nr((e,t)=>{const n=oe("CloseButton",O4,e),{iconSize:r,children:o,vars:i,radius:l,className:u,classNames:d,style:p,styles:h,unstyled:m,"data-disabled":v,disabled:x,variant:b,icon:w,mod:j,__staticSelector:T,...R}=n,E=Le({name:T||"CloseButton",props:n,className:u,style:p,classes:$E,classNames:d,styles:h,unstyled:m,vars:i,varsResolver:M4});return s.jsxs(Qn,{ref:t,...R,unstyled:m,variant:b,disabled:x,mod:[{disabled:x||v},j],...E("root",{variant:b,active:!x&&!v}),children:[w||s.jsx(LE,{}),o]})});Ss.classes=$E;Ss.displayName="@mantine/core/CloseButton";function L4(e){return g.Children.toArray(e).filter(Boolean)}var FE={root:"m_4081bf90"};const $4={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},F4=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:l},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Rn(r),"--group-align":o,"--group-justify":i,"--group-wrap":l}}),xe=ue((e,t)=>{const n=oe("Group",$4,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,children:d,gap:p,align:h,justify:m,wrap:v,grow:x,preventGrowOverflow:b,vars:w,variant:j,__size:T,mod:R,...E}=n,C=L4(d),P=C.length,D=Rn(p??"md"),O={childWidth:`calc(${100/P}% - (${D} - ${D} / ${P}))`},L=Le({name:"Group",props:n,stylesCtx:O,className:o,style:i,classes:FE,classNames:r,styles:l,unstyled:u,vars:w,varsResolver:F4});return s.jsx(se,{...L("root"),ref:t,variant:j,mod:[{grow:x},R],size:T,...E,children:C})});xe.classes=FE;xe.displayName="@mantine/core/Group";const[z4,Ai]=dr("ModalBase component was not found in tree");function V4({opened:e,transitionDuration:t}){const[n,r]=g.useState(e),o=g.useRef(-1),l=Iv()?0:t;return g.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):l===0?r(!1):o.current=window.setTimeout(()=>r(!1),l),()=>window.clearTimeout(o.current)),[e,l]),n}function B4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:l}){const u=fr(e),[d,p]=g.useState(!1),[h,m]=g.useState(!1),v=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,x=V4({opened:n,transitionDuration:v});return IC("keydown",b=>{var w;b.key==="Escape"&&o&&n&&((w=b.target)==null?void 0:w.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),PC({opened:n,shouldReturnFocus:r&&l}),{_id:u,titleMounted:d,bodyMounted:h,shouldLockScroll:x,setTitleMounted:p,setBodyMounted:m}}const zE=g.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:i,onEnterTransitionEnd:l,trapFocus:u,closeOnEscape:d,returnFocus:p,closeOnClickOutside:h,withinPortal:m,portalProps:v,lockScroll:x,children:b,zIndex:w,shadow:j,padding:T,__vars:R,unstyled:E,removeScrollProps:C,...P},D)=>{const{_id:A,titleMounted:O,bodyMounted:L,shouldLockScroll:V,setTitleMounted:q,setBodyMounted:G}=B4({id:r,transitionProps:o,opened:t,trapFocus:u,closeOnEscape:d,onClose:n,returnFocus:p}),{key:Q,...Y}=C||{};return s.jsx(ws,{...v,withinPortal:m,children:s.jsx(z4,{value:{opened:t,onClose:n,closeOnClickOutside:h,onExitTransitionEnd:i,onEnterTransitionEnd:l,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${A}-title`,getBodyId:()=>`${A}-body`,titleMounted:O,bodyMounted:L,setTitleMounted:q,setBodyMounted:G,trapFocus:u,closeOnEscape:d,zIndex:w,unstyled:E},children:s.jsx(kl,{enabled:V&&x,...Y,children:s.jsx(se,{ref:D,...P,__vars:{...R,"--mb-z-index":(w||Br("modal")).toString(),"--mb-shadow":_v(j),"--mb-padding":Rn(T)},children:b})},Q)})})});zE.displayName="@mantine/core/ModalBase";function U4(){const e=Ai();return g.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var _l={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const VE=g.forwardRef(({className:e,...t},n)=>{const r=U4(),o=Ai();return s.jsx(se,{ref:n,...t,id:r,className:At({[_l.body]:!o.unstyled},e)})});VE.displayName="@mantine/core/ModalBaseBody";const BE=g.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Ai();return s.jsx(Ss,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:At({[_l.close]:!o.unstyled},e),unstyled:o.unstyled})});BE.displayName="@mantine/core/ModalBaseCloseButton";const UE=g.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},l)=>{const u=Ai();return s.jsx(ti,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var d,p,h;(d=u.onExitTransitionEnd)==null||d.call(u),(h=(p=u.transitionProps)==null?void 0:p.onExited)==null||h.call(p)},onEntered:()=>{var d,p,h;(d=u.onEnterTransitionEnd)==null||d.call(u),(h=(p=u.transitionProps)==null?void 0:p.onEntered)==null||h.call(p)},...e,children:d=>s.jsx("div",{...n,className:At({[_l.inner]:!u.unstyled},n.className),children:s.jsx(hp,{active:u.opened&&u.trapFocus,innerRef:l,children:s.jsx(cr,{...i,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:[o,d],className:At({[_l.content]:!u.unstyled},t),unstyled:u.unstyled,children:i.children})})})})});UE.displayName="@mantine/core/ModalBaseContent";const WE=g.forwardRef(({className:e,...t},n)=>{const r=Ai();return s.jsx(se,{component:"header",ref:n,className:At({[_l.header]:!r.unstyled},e),...t})});WE.displayName="@mantine/core/ModalBaseHeader";const W4={duration:200,timingFunction:"ease",transition:"fade"};function H4(e){const t=Ai();return{...W4,...t.transitionProps,...e}}const HE=g.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},i)=>{const l=Ai(),u=H4(t);return s.jsx(ti,{mounted:r!==void 0?r:l.opened,...u,transition:"fade",children:d=>s.jsx(Rl,{ref:i,fixed:!0,style:[n,d],zIndex:l.zIndex,unstyled:l.unstyled,onClick:p=>{e==null||e(p),l.closeOnClickOutside&&l.onClose()},...o})})});HE.displayName="@mantine/core/ModalBaseOverlay";function q4(){const e=Ai();return g.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const qE=g.forwardRef(({className:e,...t},n)=>{const r=q4(),o=Ai();return s.jsx(se,{component:"h2",ref:n,className:At({[_l.title]:!o.unstyled},e),...t,id:r})});qE.displayName="@mantine/core/ModalBaseTitle";function G4({children:e}){return s.jsx(s.Fragment,{children:e})}const[Q4,K4]=Ri({size:"sm"}),Y4={},GE=ue((e,t)=>{const n=oe("InputClearButton",Y4,e),{size:r,variant:o,vars:i,classNames:l,styles:u,...d}=n,p=K4(),{resolvedClassNames:h,resolvedStyles:m}=va({classNames:l,styles:u,props:n});return s.jsx(Ss,{variant:o||"transparent",ref:t,size:r||(p==null?void 0:p.size)||"sm",classNames:h,styles:m,__staticSelector:"InputClearButton",...d})});GE.displayName="@mantine/core/InputClearButton";const[X4,Bl]=Ri({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var uo={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 B1={},J4=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${_n(t)} - ${ie(2)})`}}),mp=ue((e,t)=>{const n=oe("InputDescription",B1,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,size:p,__staticSelector:h,__inheritStyles:m=!0,variant:v,...x}=oe("InputDescription",B1,n),b=Bl(),w=Le({name:["InputWrapper",h],props:n,classes:uo,className:o,style:i,classNames:r,styles:l,unstyled:u,rootSelector:"description",vars:d,varsResolver:J4}),j=m&&(b==null?void 0:b.getStyles)||w;return s.jsx(se,{component:"p",ref:t,variant:v,size:p,...j("description",b!=null&&b.getStyles?{className:o,style:i}:void 0),...x})});mp.classes=uo;mp.displayName="@mantine/core/InputDescription";const Z4={},e3=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${_n(t)} - ${ie(2)})`}}),gp=ue((e,t)=>{const n=oe("InputError",Z4,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,size:p,__staticSelector:h,__inheritStyles:m=!0,variant:v,...x}=n,b=Le({name:["InputWrapper",h],props:n,classes:uo,className:o,style:i,classNames:r,styles:l,unstyled:u,rootSelector:"error",vars:d,varsResolver:e3}),w=Bl(),j=m&&(w==null?void 0:w.getStyles)||b;return s.jsx(se,{component:"p",ref:t,variant:v,size:p,...j("error",w!=null&&w.getStyles?{className:o,style:i}:void 0),...x})});gp.classes=uo;gp.displayName="@mantine/core/InputError";const U1={labelElement:"label"},t3=(e,{size:t})=>({label:{"--input-label-size":_n(t),"--input-asterisk-color":void 0}}),gu=ue((e,t)=>{const n=oe("InputLabel",U1,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,labelElement:p,size:h,required:m,htmlFor:v,onMouseDown:x,children:b,__staticSelector:w,variant:j,mod:T,...R}=oe("InputLabel",U1,n),E=Le({name:["InputWrapper",w],props:n,classes:uo,className:o,style:i,classNames:r,styles:l,unstyled:u,rootSelector:"label",vars:d,varsResolver:t3}),C=Bl(),P=(C==null?void 0:C.getStyles)||E;return s.jsxs(se,{...P("label",C!=null&&C.getStyles?{className:o,style:i}:void 0),component:p,variant:j,size:h,ref:t,htmlFor:p==="label"?v:void 0,mod:[{required:m},T],onMouseDown:D=>{x==null||x(D),!D.defaultPrevented&&D.detail>1&&D.preventDefault()},...R,children:[b,m&&s.jsx("span",{...P("required"),"aria-hidden":!0,children:" *"})]})});gu.classes=uo;gu.displayName="@mantine/core/InputLabel";const W1={},iy=ue((e,t)=>{const n=oe("InputPlaceholder",W1,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,__staticSelector:p,variant:h,error:m,mod:v,...x}=oe("InputPlaceholder",W1,n),b=Le({name:["InputPlaceholder",p],props:n,classes:uo,className:o,style:i,classNames:r,styles:l,unstyled:u,rootSelector:"placeholder"});return s.jsx(se,{...b("placeholder"),mod:[{error:!!m},v],component:"span",variant:h,ref:t,...x})});iy.classes=uo;iy.displayName="@mantine/core/InputPlaceholder";function n3(e,{hasDescription:t,hasError:n}){const r=e.findIndex(d=>d==="input"),o=e.slice(0,r),i=e.slice(r+1),l=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:l}}const r3={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},o3=(e,{size:t})=>({label:{"--input-label-size":_n(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${_n(t)} - ${ie(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${_n(t)} - ${ie(2)})`}}),sy=ue((e,t)=>{const n=oe("InputWrapper",r3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,size:p,variant:h,__staticSelector:m,inputContainer:v,inputWrapperOrder:x,label:b,error:w,description:j,labelProps:T,descriptionProps:R,errorProps:E,labelElement:C,children:P,withAsterisk:D,id:A,required:O,__stylesApiProps:L,mod:V,...q}=n,G=Le({name:["InputWrapper",m],props:L||n,classes:uo,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:o3}),Q={size:p,variant:h,__staticSelector:m},Y=fr(A),X=typeof D=="boolean"?D:O,B=(E==null?void 0:E.id)||`${Y}-error`,M=(R==null?void 0:R.id)||`${Y}-description`,N=Y,F=!!w&&typeof w!="boolean",I=!!j,z=`${F?B:""} ${I?M:""}`,J=z.trim().length>0?z.trim():void 0,ae=(T==null?void 0:T.id)||`${Y}-label`,je=b&&s.jsx(gu,{labelElement:C,id:ae,htmlFor:N,required:X,...Q,...T,children:b},"label"),ge=I&&s.jsx(mp,{...R,...Q,size:(R==null?void 0:R.size)||Q.size,id:(R==null?void 0:R.id)||M,children:j},"description"),Ce=s.jsx(g.Fragment,{children:v(P)},"input"),Re=F&&g.createElement(gp,{...E,...Q,size:(E==null?void 0:E.size)||Q.size,key:"error",id:(E==null?void 0:E.id)||B},w),ke=x.map(_e=>{switch(_e){case"label":return je;case"input":return Ce;case"description":return ge;case"error":return Re;default:return null}});return s.jsx(X4,{value:{getStyles:G,describedBy:J,inputId:N,labelId:ae,...n3(x,{hasDescription:I,hasError:F})},children:s.jsx(se,{ref:t,variant:h,size:p,mod:[{error:!!w},V],...G("root"),...q,children:ke})})});sy.classes=uo;sy.displayName="@mantine/core/InputWrapper";const i3={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},s3=(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":ot(t.size,"input-height"),"--input-fz":_n(t.size),"--input-radius":t.radius===void 0?void 0:Mt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?ie(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?ie(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?ot(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),sn=nr((e,t)=>{const n=oe("Input",i3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,required:d,__staticSelector:p,__stylesApiProps:h,size:m,wrapperProps:v,error:x,disabled:b,leftSection:w,leftSectionProps:j,leftSectionWidth:T,rightSection:R,rightSectionProps:E,rightSectionWidth:C,rightSectionPointerEvents:P,leftSectionPointerEvents:D,variant:A,vars:O,pointer:L,multiline:V,radius:q,id:G,withAria:Q,withErrorStyles:Y,mod:X,inputSize:B,__clearSection:M,__clearable:N,__defaultRightSection:F,...I}=n,{styleProps:z,rest:J}=Ii(I),ae=Bl(),je={offsetBottom:ae==null?void 0:ae.offsetBottom,offsetTop:ae==null?void 0:ae.offsetTop},ge=Le({name:["Input",p],props:h||n,classes:uo,className:o,style:i,classNames:r,styles:l,unstyled:u,stylesCtx:je,rootSelector:"wrapper",vars:O,varsResolver:s3}),Ce=Q?{required:d,disabled:b,"aria-invalid":!!x,"aria-describedby":ae==null?void 0:ae.describedBy,id:(ae==null?void 0:ae.inputId)||G}:{},Re=R||N&&M||F;return s.jsx(Q4,{value:{size:m||"sm"},children:s.jsxs(se,{...ge("wrapper"),...z,...v,mod:[{error:!!x&&Y,pointer:L,disabled:b,multiline:V,"data-with-right-section":!!Re,"data-with-left-section":!!w},X],variant:A,size:m,children:[w&&s.jsx("div",{...j,"data-position":"left",...ge("section",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),children:w}),s.jsx(se,{component:"input",...J,...Ce,ref:t,required:d,mod:{disabled:b,error:!!x&&Y},variant:A,__size:B,...ge("input")}),Re&&s.jsx("div",{...E,"data-position":"right",...ge("section",{className:E==null?void 0:E.className,style:E==null?void 0:E.style}),children:Re})]})})});sn.classes=uo;sn.Wrapper=sy;sn.Label=gu;sn.Error=gp;sn.Description=mp;sn.Placeholder=iy;sn.ClearButton=GE;sn.displayName="@mantine/core/Input";function a3(e,t,n){const r=oe(e,t,n),{label:o,description:i,error:l,required:u,classNames:d,styles:p,className:h,unstyled:m,__staticSelector:v,__stylesApiProps:x,errorProps:b,labelProps:w,descriptionProps:j,wrapperProps:T,id:R,size:E,style:C,inputContainer:P,inputWrapperOrder:D,withAsterisk:A,variant:O,vars:L,mod:V,...q}=r,{styleProps:G,rest:Q}=Ii(q),Y={label:o,description:i,error:l,required:u,classNames:d,className:h,__staticSelector:v,__stylesApiProps:x||r,errorProps:b,labelProps:w,descriptionProps:j,unstyled:m,styles:p,size:E,style:C,inputContainer:P,inputWrapperOrder:D,withAsterisk:A,variant:O,id:R,mod:V,...T};return{...Q,classNames:d,styles:p,unstyled:m,wrapperProps:{...Y,...G},inputProps:{required:u,classNames:d,styles:p,unstyled:m,size:E,__staticSelector:v,__stylesApiProps:x||r,error:l,variant:O,id:R}}}const l3={__staticSelector:"InputBase",withAria:!0},kr=nr((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=a3("InputBase",l3,e);return s.jsx(sn.Wrapper,{...r,children:s.jsx(sn,{...n,...o,ref:t})})});kr.classes={...sn.classes,...sn.Wrapper.classes};kr.displayName="@mantine/core/InputBase";const c3={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 QE={root:"m_8bffd616"};const u3={},gs=nr((e,t)=>{const n=oe("Flex",u3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,gap:p,rowGap:h,columnGap:m,align:v,justify:x,wrap:b,direction:w,...j}=n,T=Le({name:"Flex",classes:QE,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d}),R=mn(),E=hu(),C=zC({styleProps:{gap:p,rowGap:h,columnGap:m,align:v,justify:x,wrap:b,direction:w},theme:R,data:c3});return s.jsxs(s.Fragment,{children:[C.hasResponsiveStyles&&s.jsx(xa,{selector:`.${E}`,styles:C.styles,media:C.media}),s.jsx(se,{ref:t,...T("root",{className:E,style:bs(C.inlineStyles)}),...j})]})});gs.classes=QE;gs.displayName="@mantine/core/Flex";function d3(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 f3({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=g.useRef(-1),[i,l]=g.useState(!1),[u,d]=g.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const x=e.getBoundingClientRect(),b=t.getBoundingClientRect(),w=window.getComputedStyle(e),j=window.getComputedStyle(t),T=hs(w.borderTopWidth)+hs(j.borderTopWidth),R=hs(w.borderLeftWidth)+hs(j.borderLeftWidth),E={top:x.top-b.top-T,left:x.left-b.left-R,width:x.width,height:x.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`},h=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},m=g.useRef(null),v=g.useRef(null);return g.useEffect(()=>{if(p(),e)return m.current=new ResizeObserver(h),m.current.observe(e),t&&(v.current=new ResizeObserver(h),v.current.observe(t)),()=>{var x,b;(x=m.current)==null||x.disconnect(),(b=v.current)==null||b.disconnect()}},[t,e]),g.useEffect(()=>{if(t){const x=b=>{d3(b.target,t)&&(h(),d(!1))};return t.addEventListener("transitionend",x),()=>{t.removeEventListener("transitionend",x)}}},[t]),hI(()=>{AC()!=="test"&&l(!0)},20,{autoInvoke:!0}),mI(x=>{x.forEach(b=>{b.type==="attributes"&&b.attributeName==="dir"&&h()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:u}}var KE={root:"m_96b553a6"};const p3={},h3=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),ay=ue((e,t)=>{const n=oe("FloatingIndicator",p3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,target:p,parent:h,transitionDuration:m,mod:v,displayAfterTransitionEnd:x,...b}=n,w=Le({name:"FloatingIndicator",classes:KE,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:h3}),j=g.useRef(null),{initialized:T,hidden:R}=f3({target:p,parent:h,ref:j,displayAfterTransitionEnd:x}),E=An(t,j);return!p||!h?null:s.jsx(se,{ref:E,mod:[{initialized:T,hidden:R},v],...w("root"),...b})});ay.displayName="@mantine/core/FloatingIndicator";ay.classes=KE;var YE={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 m3={},g3=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:Mt(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Ni=ue((e,t)=>{const n=oe("Alert",m3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,radius:p,color:h,title:m,children:v,id:x,icon:b,withCloseButton:w,onClose:j,closeButtonLabel:T,variant:R,autoContrast:E,...C}=n,P=Le({name:"Alert",classes:YE,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:g3}),D=fr(x),A=m&&`${D}-title`||void 0,O=`${D}-body`;return s.jsx(se,{id:D,...P("root",{variant:R}),variant:R,ref:t,...C,role:"alert","aria-describedby":O,"aria-labelledby":A,children:s.jsxs("div",{...P("wrapper"),children:[b&&s.jsx("div",{...P("icon"),children:b}),s.jsxs("div",{...P("body"),children:[m&&s.jsx("div",{...P("title"),"data-with-close-button":w||void 0,children:s.jsx("span",{id:A,...P("label"),children:m})}),v&&s.jsx("div",{id:O,...P("message"),"data-variant":R,children:v})]}),w&&s.jsx(Ss,{...P("closeButton"),onClick:j,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:u})]})})});Ni.classes=YE;Ni.displayName="@mantine/core/Alert";var XE={root:"m_b6d8b162"};function v3(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const y3={inherit:!1},x3=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":_n(o),"--text-lh":EC(o),"--text-gradient":t==="gradient"?$g(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?Lt(i,e):void 0}}),Pe=nr((e,t)=>{const n=oe("Text",y3,e),{lineClamp:r,truncate:o,inline:i,inherit:l,gradient:u,span:d,__staticSelector:p,vars:h,className:m,style:v,classNames:x,styles:b,unstyled:w,variant:j,mod:T,size:R,...E}=n,C=Le({name:["Text",p],props:n,classes:XE,className:m,style:v,classNames:x,styles:b,unstyled:w,vars:h,varsResolver:x3});return s.jsx(se,{...C("root",{focusable:!0}),ref:t,component:d?"span":"p",variant:j,mod:[{"data-truncate":v3(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":l},T],size:R,...E})});Pe.classes=XE;Pe.displayName="@mantine/core/Text";var JE={root:"m_849cf0da"};const b3={underline:"hover"},Et=nr((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...l}=oe("Anchor",b3,e);return s.jsx(Pe,{component:"a",ref:t,className:At({[JE.root]:!o},r),...l,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Et.classes=JE;Et.displayName="@mantine/core/Anchor";const[w3,Ul]=dr("AppShell was not found in tree");var js={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const S3={},ly=ue((e,t)=>{const n=oe("AppShellAside",S3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:s.jsx(se,{component:"aside",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("aside",{className:o,classNames:r,styles:l,style:i}),...v,__vars:{"--app-shell-aside-z-index":`calc(${h??x.zIndex} + 1)`}})});ly.classes=js;ly.displayName="@mantine/core/AppShellAside";const j3={},cy=ue((e,t)=>{var b;const n=oe("AppShellFooter",j3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:s.jsx(se,{component:"footer",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("footer",{className:At({[kl.classNames.zeroRight]:x.offsetScrollbars},o),classNames:r,styles:l,style:i}),...v,__vars:{"--app-shell-footer-z-index":(b=h??x.zIndex)==null?void 0:b.toString()}})});cy.classes=js;cy.displayName="@mantine/core/AppShellFooter";const C3={},uy=ue((e,t)=>{var b;const n=oe("AppShellHeader",C3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:s.jsx(se,{component:"header",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("header",{className:At({[kl.classNames.zeroRight]:x.offsetScrollbars},o),classNames:r,styles:l,style:i}),...v,__vars:{"--app-shell-header-z-index":(b=h??x.zIndex)==null?void 0:b.toString()}})});uy.classes=js;uy.displayName="@mantine/core/AppShellHeader";const E3={},dy=ue((e,t)=>{const n=oe("AppShellMain",E3,e),{classNames:r,className:o,style:i,styles:l,vars:u,...d}=n,p=Ul();return s.jsx(se,{component:"main",ref:t,...p.getStyles("main",{className:o,style:i,classNames:r,styles:l}),...d})});dy.classes=js;dy.displayName="@mantine/core/AppShellMain";function vu(e){return typeof e=="object"?e.base:e}function yu(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 xu(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function k3({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var d,p,h;const i=r==null?void 0:r.width,l="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((d=r==null?void 0:r.collapsed)!=null&&d.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"),yu(i)){const m=ie(vu(i));e["--app-shell-aside-width"]=m,e["--app-shell-aside-offset"]=m}if(xu(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=ie(i.base),e["--app-shell-aside-offset"]=ie(i.base)),Xt(i).forEach(m=>{m!=="base"&&(t[m]=t[m]||{},t[m]["--app-shell-aside-width"]=ie(i[m]),t[m]["--app-shell-aside-offset"]=ie(i[m]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const m=r.breakpoint;t[m]=t[m]||{},t[m]["--app-shell-aside-transform"]=l,t[m]["--app-shell-aside-transform-rtl"]=u,t[m]["--app-shell-aside-offset"]="0px !important"}if((h=r==null?void 0:r.collapsed)!=null&&h.mobile){const m=Dv(r.breakpoint,o.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-aside-width"]="100%",n[m]["--app-shell-aside-offset"]="0px",n[m]["--app-shell-aside-transform"]=l,n[m]["--app-shell-aside-transform-rtl"]=u}}function T3({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,o="translateY(var(--app-shell-footer-height))",i=(n==null?void 0:n.offset)??!0;if(yu(r)){const l=ie(vu(r));e["--app-shell-footer-height"]=l,i&&(e["--app-shell-footer-offset"]=l)}xu(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=ie(r.base),i&&(e["--app-shell-footer-offset"]=ie(r.base))),Xt(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-footer-height"]=ie(r[l]),i&&(t[l]["--app-shell-footer-offset"]=ie(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function P3({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,o="translateY(calc(var(--app-shell-header-height) * -1))",i=(n==null?void 0:n.offset)??!0;if(yu(r)){const l=ie(vu(r));e["--app-shell-header-height"]=l,i&&(e["--app-shell-header-offset"]=l)}xu(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=ie(r.base),i&&(e["--app-shell-header-offset"]=ie(r.base))),Xt(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-header-height"]=ie(r[l]),i&&(t[l]["--app-shell-header-offset"]=ie(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function R3({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var d,p,h;const i=r==null?void 0:r.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((d=r==null?void 0:r.collapsed)!=null&&d.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"),yu(i)){const m=ie(vu(i));e["--app-shell-navbar-width"]=m,e["--app-shell-navbar-offset"]=m}if(xu(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=ie(i.base),e["--app-shell-navbar-offset"]=ie(i.base)),Xt(i).forEach(m=>{m!=="base"&&(t[m]=t[m]||{},t[m]["--app-shell-navbar-width"]=ie(i[m]),t[m]["--app-shell-navbar-offset"]=ie(i[m]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const m=r.breakpoint;t[m]=t[m]||{},t[m]["--app-shell-navbar-transform"]=l,t[m]["--app-shell-navbar-transform-rtl"]=u,t[m]["--app-shell-navbar-offset"]="0px !important"}if((h=r==null?void 0:r.collapsed)!=null&&h.mobile){const m=Dv(r.breakpoint,o.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-navbar-width"]="100%",n[m]["--app-shell-navbar-offset"]="0px",n[m]["--app-shell-navbar-transform"]=l,n[m]["--app-shell-navbar-transform-rtl"]=u}}function lg(e){return Number(e)===0?"0px":Rn(e)}function _3({padding:e,baseStyles:t,minMediaStyles:n}){yu(e)&&(t["--app-shell-padding"]=lg(vu(e))),xu(e)&&(e.base&&(t["--app-shell-padding"]=lg(e.base)),Xt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=lg(e[r]))}))}function D3({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const l={},u={},d={};R3({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,navbar:e,theme:i}),k3({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,aside:r,theme:i}),P3({baseStyles:d,minMediaStyles:l,header:t}),T3({baseStyles:d,minMediaStyles:l,footer:n}),_3({baseStyles:d,minMediaStyles:l,padding:o});const p=Jc(Xt(l),i.breakpoints).map(v=>({query:`(min-width: ${Cf(v.px)})`,styles:l[v.value]})),h=Jc(Xt(u),i.breakpoints).map(v=>({query:`(max-width: ${Cf(v.px)})`,styles:u[v.value]})),m=[...p,...h];return{baseStyles:d,media:m}}function I3({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=mn(),l=_i(),{media:u,baseStyles:d}=D3({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return s.jsx(xa,{media:u,styles:d,selector:l.cssVariablesSelector})}const A3={},fy=ue((e,t)=>{const n=oe("AppShellNavbar",A3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:s.jsx(se,{component:"nav",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("navbar",{className:o,classNames:r,styles:l,style:i}),...v,__vars:{"--app-shell-navbar-z-index":`calc(${h??x.zIndex} + 1)`}})});fy.classes=js;fy.displayName="@mantine/core/AppShellNavbar";const N3={},py=nr((e,t)=>{const n=oe("AppShellSection",N3,e),{classNames:r,className:o,style:i,styles:l,vars:u,grow:d,mod:p,...h}=n,m=Ul();return s.jsx(se,{ref:t,mod:[{grow:d},p],...m.getStyles("section",{className:o,style:i,classNames:r,styles:l}),...h})});py.classes=js;py.displayName="@mantine/core/AppShellSection";function O3({transitionDuration:e,disabled:t}){const[n,r]=g.useState(!0),o=g.useRef(-1),i=g.useRef(-1);return IC("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>g.startTransition(()=>{r(!1)}),200)}),$l(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>g.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const M3={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Br("app")},L3=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),jr=ue((e,t)=>{const n=oe("AppShell",M3,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,navbar:p,withBorder:h,padding:m,transitionDuration:v,transitionTimingFunction:x,header:b,zIndex:w,layout:j,disabled:T,aside:R,footer:E,offsetScrollbars:C=j!=="alt",mod:P,...D}=n,A=Le({name:"AppShell",classes:js,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:L3}),O=O3({disabled:T,transitionDuration:v});return s.jsxs(w3,{value:{getStyles:A,withBorder:h,zIndex:w,disabled:T,offsetScrollbars:C},children:[s.jsx(I3,{navbar:p,header:b,aside:R,footer:E,padding:m}),s.jsx(se,{ref:t,...A("root"),mod:[{resizing:O,layout:j,disabled:T},P],...D})]})});jr.classes=js;jr.displayName="@mantine/core/AppShell";jr.Navbar=fy;jr.Header=uy;jr.Main=dy;jr.Aside=ly;jr.Footer=cy;jr.Section=py;function ZE(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=>ZE(t))}:e}function ek(e){return e?e.map(t=>ZE(t)):[]}function tk(e){return e.reduce((t,n)=>"group"in n?{...t,...tk(n.items)}:(t[n.value]=n,t),{})}var Er={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 $3={error:null},F3=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":ot(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Lt(n,e):void 0}}),vp=ue((e,t)=>{const n=oe("ComboboxChevron",$3,e),{size:r,error:o,style:i,className:l,classNames:u,styles:d,unstyled:p,vars:h,mod:m,...v}=n,x=Le({name:"ComboboxChevron",classes:Er,props:n,style:i,className:l,classNames:u,styles:d,unstyled:p,vars:h,varsResolver:F3,rootSelector:"chevron"});return s.jsx(se,{component:"svg",...v,...x("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},m],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"})})});vp.classes=Er;vp.displayName="@mantine/core/ComboboxChevron";const[z3,fo]=dr("Combobox component was not found in tree"),nk=g.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>s.jsx(sn.ClearButton,{ref:i,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:l=>{l.preventDefault(),t==null||t(l)},onClick:l=>{r(),n==null||n(l)}}));nk.displayName="@mantine/core/ComboboxClearButton";const V3={},hy=ue((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:l,...u}=oe("ComboboxDropdown",V3,e),d=fo();return s.jsx(Ro.Dropdown,{...u,ref:t,role:"presentation","data-hidden":l||void 0,...d.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});hy.classes=Er;hy.displayName="@mantine/core/ComboboxDropdown";const B3={refProp:"ref"},rk=ue((e,t)=>{const{children:n,refProp:r}=oe("ComboboxDropdownTarget",B3,e);if(fo(),!Pi(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(Ro.Target,{ref:t,refProp:r,children:n})});rk.displayName="@mantine/core/ComboboxDropdownTarget";const U3={},my=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,...u}=oe("ComboboxEmpty",U3,e),d=fo();return s.jsx(se,{ref:t,...d.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...u})});my.classes=Er;my.displayName="@mantine/core/ComboboxEmpty";function gy({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const l=fo(),[u,d]=g.useState(null),p=m=>{if(e==null||e(m),!l.readOnly&&t){if(m.nativeEvent.isComposing)return;if(m.nativeEvent.code==="ArrowDown"&&(m.preventDefault(),l.store.dropdownOpened?d(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),m.nativeEvent.code==="ArrowUp"&&(m.preventDefault(),l.store.dropdownOpened?d(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),m.nativeEvent.code==="Enter"||m.nativeEvent.code==="NumpadEnter"){if(m.nativeEvent.keyCode===229)return;const v=l.store.getSelectedOptionIndex();l.store.dropdownOpened&&v!==-1?(m.preventDefault(),l.store.clickSelectedOption()):o==="button"&&(m.preventDefault(),l.store.openDropdown("keyboard"))}m.key==="Escape"&&l.store.closeDropdown("keyboard"),m.nativeEvent.code==="Space"&&o==="button"&&(m.preventDefault(),l.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(l.store.listId&&l.store.dropdownOpened)||void 0,"aria-controls":l.store.dropdownOpened?l.store.listId:void 0,"aria-activedescendant":l.store.dropdownOpened&&u||void 0,autoComplete:i,"data-expanded":l.store.dropdownOpened||void 0,"data-mantine-stop-propagation":l.store.dropdownOpened||void 0}:{},onKeyDown:p}}const W3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ok=ue((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:l,targetType:u,autoComplete:d,...p}=oe("ComboboxEventsTarget",W3,e);if(!Pi(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 h=fo(),m=gy({targetType:u,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:l,onKeyDown:n.props.onKeyDown,autoComplete:d});return g.cloneElement(n,{...m,...p,[r]:An(t,h.store.targetRef,op(n))})});ok.displayName="@mantine/core/ComboboxEventsTarget";const H3={},vy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,...u}=oe("ComboboxFooter",H3,e),d=fo();return s.jsx(se,{ref:t,...d.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...u,onMouseDown:p=>{p.preventDefault()}})});vy.classes=Er;vy.displayName="@mantine/core/ComboboxFooter";const q3={},yy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,children:u,label:d,...p}=oe("ComboboxGroup",q3,e),h=fo();return s.jsxs(se,{ref:t,...h.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...p,children:[d&&s.jsx("div",{...h.getStyles("groupLabel",{classNames:n,styles:i}),children:d}),u]})});yy.classes=Er;yy.displayName="@mantine/core/ComboboxGroup";const G3={},xy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,...u}=oe("ComboboxHeader",G3,e),d=fo();return s.jsx(se,{ref:t,...d.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...u,onMouseDown:p=>{p.preventDefault()}})});xy.classes=Er;xy.displayName="@mantine/core/ComboboxHeader";function ik({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}ik.displayName="@mantine/core/ComboboxHiddenInput";const Q3={},by=ue((e,t)=>{const n=oe("ComboboxOption",Q3,e),{classNames:r,className:o,style:i,styles:l,vars:u,onClick:d,id:p,active:h,onMouseDown:m,onMouseOver:v,disabled:x,selected:b,mod:w,...j}=n,T=fo(),R=g.useId(),E=p||R;return s.jsx(se,{...T.getStyles("option",{className:o,classNames:r,styles:l,style:i}),...j,ref:t,id:E,mod:["combobox-option",{"combobox-active":h,"combobox-disabled":x,"combobox-selected":b},w],role:"option",onClick:C=>{var P;x?C.preventDefault():((P=T.onOptionSubmit)==null||P.call(T,n.value,n),d==null||d(C))},onMouseDown:C=>{C.preventDefault(),m==null||m(C)},onMouseOver:C=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),v==null||v(C)}})});by.classes=Er;by.displayName="@mantine/core/ComboboxOption";const K3={},wy=ue((e,t)=>{const n=oe("ComboboxOptions",K3,e),{classNames:r,className:o,style:i,styles:l,id:u,onMouseDown:d,labelledBy:p,...h}=n,m=fo(),v=fr(u);return g.useEffect(()=>{m.store.setListId(v)},[v]),s.jsx(se,{ref:t,...m.getStyles("options",{className:o,style:i,classNames:r,styles:l}),...h,id:v,role:"listbox","aria-labelledby":p,onMouseDown:x=>{x.preventDefault(),d==null||d(x)}})});wy.classes=Er;wy.displayName="@mantine/core/ComboboxOptions";const Y3={withAriaAttributes:!0,withKeyboardNavigation:!0},Sy=ue((e,t)=>{const n=oe("ComboboxSearch",Y3,e),{classNames:r,styles:o,unstyled:i,vars:l,withAriaAttributes:u,onKeyDown:d,withKeyboardNavigation:p,size:h,...m}=n,v=fo(),x=v.getStyles("search"),b=gy({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:d,autoComplete:"off"});return s.jsx(sn,{ref:An(t,v.store.searchRef),classNames:[{input:x.className},r],styles:[{input:x.style},o],size:h||v.size,...b,...m,__staticSelector:"Combobox"})});Sy.classes=Er;Sy.displayName="@mantine/core/ComboboxSearch";const X3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},sk=ue((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:l,targetType:u,autoComplete:d,...p}=oe("ComboboxTarget",X3,e);if(!Pi(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 h=fo(),m=gy({targetType:u,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:l,onKeyDown:n.props.onKeyDown,autoComplete:d}),v=g.cloneElement(n,{...m,...p});return s.jsx(Ro.Target,{ref:An(t,h.store.targetRef),children:v})});sk.displayName="@mantine/core/ComboboxTarget";function J3(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 Z3(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 eO(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function bu({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:l="instant"}={}){const[u,d]=Bn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=g.useRef(null),h=g.useRef(-1),m=g.useRef(null),v=g.useRef(null),x=g.useRef(-1),b=g.useRef(-1),w=g.useRef(-1),j=g.useCallback((B="unknown")=>{u||(d(!0),o==null||o(B))},[d,o,u]),T=g.useCallback((B="unknown")=>{u&&(d(!1),r==null||r(B))},[d,r,u]),R=g.useCallback((B="unknown")=>{u?T(B):j(B)},[T,j,u]),E=g.useCallback(()=>{const B=document.querySelector(`#${p.current} [data-combobox-selected]`);B==null||B.removeAttribute("data-combobox-selected"),B==null||B.removeAttribute("aria-selected")},[]),C=g.useCallback(B=>{const M=document.getElementById(p.current),N=M==null?void 0:M.querySelectorAll("[data-combobox-option]");if(!N)return null;const F=B>=N.length?0:B<0?N.length-1:B;return h.current=F,N!=null&&N[F]&&!N[F].hasAttribute("data-combobox-disabled")?(E(),N[F].setAttribute("data-combobox-selected","true"),N[F].setAttribute("aria-selected","true"),N[F].scrollIntoView({block:"nearest",behavior:l}),N[F].id):null},[l,E]),P=g.useCallback(()=>{const B=document.querySelector(`#${p.current} [data-combobox-active]`);if(B){const M=document.querySelectorAll(`#${p.current} [data-combobox-option]`),N=Array.from(M).findIndex(F=>F===B);return C(N)}return C(0)},[C]),D=g.useCallback(()=>C(Z3(h.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),i)),[C,i]),A=g.useCallback(()=>C(J3(h.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),i)),[C,i]),O=g.useCallback(()=>C(eO(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[C]),L=g.useCallback((B="selected",M)=>{w.current=window.setTimeout(()=>{var I;const N=document.querySelectorAll(`#${p.current} [data-combobox-option]`),F=Array.from(N).findIndex(z=>z.hasAttribute(`data-combobox-${B}`));h.current=F,M!=null&&M.scrollIntoView&&((I=N[F])==null||I.scrollIntoView({block:"nearest",behavior:l}))},0)},[]),V=g.useCallback(()=>{h.current=-1,E()},[E]),q=g.useCallback(()=>{const B=document.querySelectorAll(`#${p.current} [data-combobox-option]`),M=B==null?void 0:B[h.current];M==null||M.click()},[]),G=g.useCallback(B=>{p.current=B},[]),Q=g.useCallback(()=>{x.current=window.setTimeout(()=>m.current.focus(),0)},[]),Y=g.useCallback(()=>{b.current=window.setTimeout(()=>v.current.focus(),0)},[]),X=g.useCallback(()=>h.current,[]);return g.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),{dropdownOpened:u,openDropdown:j,closeDropdown:T,toggleDropdown:R,selectedOptionIndex:h.current,getSelectedOptionIndex:X,selectOption:C,selectFirstOption:O,selectActiveOption:P,selectNextOption:D,selectPreviousOption:A,resetSelectedOption:V,updateSelectedOptionIndex:L,listId:p.current,setListId:G,clickSelectedOption:q,searchRef:m,focusSearchInput:Q,targetRef:v,focusTarget:Y}}const tO={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},nO=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":_n(t),"--combobox-option-padding":ot(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:ie(n),"--combobox-option-fz":_n(t),"--combobox-option-padding":ot(t,"combobox-option-padding")}});function ut(e){const t=oe("Combobox",tO,e),{classNames:n,styles:r,unstyled:o,children:i,store:l,vars:u,onOptionSubmit:d,onClose:p,size:h,dropdownPadding:m,resetSelectionOnOptionHover:v,__staticSelector:x,readOnly:b,...w}=t,j=bu(),T=l||j,R=Le({name:x||"Combobox",classes:Er,props:t,classNames:n,styles:r,unstyled:o,vars:u,varsResolver:nO}),E=()=>{p==null||p(),T.closeDropdown()};return s.jsx(z3,{value:{getStyles:R,store:T,onOptionSubmit:d,size:h,resetSelectionOnOptionHover:v,readOnly:b},children:s.jsx(Ro,{opened:T.dropdownOpened,...w,onChange:C=>!C&&E(),withRoles:!1,unstyled:o,children:i})})}const rO=e=>e;ut.extend=rO;ut.classes=Er;ut.displayName="@mantine/core/Combobox";ut.Target=sk;ut.Dropdown=hy;ut.Options=wy;ut.Option=by;ut.Search=Sy;ut.Empty=my;ut.Chevron=vp;ut.Footer=vy;ut.Header=xy;ut.EventsTarget=ok;ut.DropdownTarget=rk;ut.Group=yy;ut.ClearButton=nk;ut.HiddenInput=ik;var ak={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const lk=ak,yp=g.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:l,label:u,description:d,id:p,disabled:h,error:m,size:v,labelPosition:x="left",bodyElement:b="div",labelElement:w="label",variant:j,style:T,vars:R,mod:E,...C},P)=>{const D=Le({name:e,props:t,className:n,style:T,classes:ak,classNames:r,styles:o,unstyled:i});return s.jsx(se,{...D("root"),ref:P,__vars:{"--label-fz":_n(v),"--label-lh":ot(v,"label-lh")},mod:[{"label-position":x},E],variant:j,size:v,...C,children:s.jsxs(se,{component:b,htmlFor:b==="label"?p:void 0,...D("body"),children:[l,s.jsxs("div",{...D("labelWrapper"),"data-disabled":h||void 0,children:[u&&s.jsx(se,{component:w,htmlFor:w==="label"?p:void 0,...D("label"),"data-disabled":h||void 0,children:u}),d&&s.jsx(sn.Description,{size:v,__inheritStyles:!1,...D("description"),children:d}),m&&typeof m!="boolean"&&s.jsx(sn.Error,{size:v,__inheritStyles:!1,...D("error"),children:m})]})]})})});yp.displayName="@mantine/core/InlineInput";const ck=g.createContext(null),oO=ck.Provider,uk=()=>g.useContext(ck),[iO,sO]=Ri();var dk={card:"m_26775b0a"};const aO={withBorder:!0},lO=(e,{radius:t})=>({card:{"--card-radius":Mt(t)}}),jy=ue((e,t)=>{const n=oe("CheckboxCard",aO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,checked:p,mod:h,withBorder:m,value:v,onClick:x,defaultChecked:b,onChange:w,...j}=n,T=Le({name:"CheckboxCard",classes:dk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:lO,rootSelector:"card"}),R=uk(),E=typeof p=="boolean"?p:R?R.value.includes(v||""):void 0,[C,P]=Bn({value:E,defaultValue:b,finalValue:!1,onChange:w});return s.jsx(iO,{value:{checked:C},children:s.jsx(Qn,{ref:t,mod:[{"with-border":m,checked:C},h],...T("card"),...j,role:"checkbox","aria-checked":C,onClick:D=>{x==null||x(D),R==null||R.onChange(v||""),P(!C)}})})});jy.displayName="@mantine/core/CheckboxCard";jy.classes=dk;function Cy({children:e,role:t}){const n=Bl();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const cO={},Ey=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:l,children:u,readOnly:d,...p}=oe("CheckboxGroup",cO,e),[h,m]=Bn({value:n,defaultValue:r,finalValue:[],onChange:o}),v=x=>{const b=typeof x=="string"?x:x.currentTarget.value;!d&&m(h.includes(b)?h.filter(w=>w!==b):[...h,b])};return s.jsx(oO,{value:{value:h,onChange:v,size:i},children:s.jsx(sn.Wrapper,{size:i,ref:t,...l,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(Cy,{role:"group",children:u})})})});Ey.classes=sn.Wrapper.classes;Ey.displayName="@mantine/core/CheckboxGroup";function xp({size:e,style:t,...n}){const r=e!==void 0?{width:ie(e),height:ie(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 fk({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(xp,{...t})}var pk={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const uO={icon:fk},dO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:l})=>{const u=ro({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":ot(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Mt(t),"--checkbox-color":i==="outline"?d:Lt(n,e),"--checkbox-icon-color":o?Lt(o,e):ya(l,e)?Di({color:n,theme:e,autoContrast:l}):void 0}}},ky=ue((e,t)=>{const n=oe("CheckboxIndicator",uO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,icon:p,indeterminate:h,radius:m,color:v,iconColor:x,autoContrast:b,checked:w,mod:j,variant:T,disabled:R,...E}=n,C=p,P=Le({name:"CheckboxIndicator",classes:pk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:dO,rootSelector:"indicator"}),D=sO(),A=typeof w=="boolean"||typeof h=="boolean"?w||h:(D==null?void 0:D.checked)||!1;return s.jsx(se,{ref:t,...P("indicator",{variant:T}),variant:T,mod:[{checked:A,disabled:R},j],...E,children:s.jsx(C,{indeterminate:h,...P("icon")})})});ky.displayName="@mantine/core/CheckboxIndicator";ky.classes=pk;var hk={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const fO={labelPosition:"right",icon:fk},pO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:l})=>{const u=ro({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":ot(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Mt(t),"--checkbox-color":i==="outline"?d:Lt(n,e),"--checkbox-icon-color":o?Lt(o,e):ya(l,e)?Di({color:n,theme:e,autoContrast:l}):void 0}}},Kn=ue((e,t)=>{const n=oe("Checkbox",fO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,color:p,label:h,id:m,size:v,radius:x,wrapperProps:b,checked:w,labelPosition:j,description:T,error:R,disabled:E,variant:C,indeterminate:P,icon:D,rootRef:A,iconColor:O,onChange:L,autoContrast:V,mod:q,...G}=n,Q=uk(),Y=v||(Q==null?void 0:Q.size),X=D,B=Le({name:"Checkbox",props:n,classes:hk,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:pO}),{styleProps:M,rest:N}=Ii(G),F=fr(m),I=Q?{checked:Q.value.includes(N.value),onChange:ae=>{Q.onChange(ae),L==null||L(ae)}}:{},z=g.useRef(null),J=t||z;return g.useEffect(()=>{J&&"current"in J&&J.current&&(J.current.indeterminate=P||!1)},[P,J]),s.jsx(yp,{...B("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:F,size:Y,labelPosition:j,label:h,description:T,error:R,disabled:E,classNames:r,styles:l,unstyled:u,"data-checked":I.checked||w||void 0,variant:C,ref:A,mod:q,...M,...b,children:s.jsxs(se,{...B("inner"),mod:{"data-label-position":j},children:[s.jsx(se,{component:"input",id:F,ref:J,checked:w,disabled:E,mod:{error:!!R,indeterminate:P},...B("input",{focusable:!0,variant:C}),onChange:L,...N,...I,type:"checkbox"}),s.jsx(X,{indeterminate:P,...B("icon")})]})})});Kn.classes={...hk,...lk};Kn.displayName="@mantine/core/Checkbox";Kn.Group=Ey;Kn.Indicator=ky;Kn.Card=jy;function Dl(e){return"group"in e}function mk({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const l=e[i];if(o.length===n)return o;Dl(l)&&o.push({group:l.group,items:mk({options:l.items,search:t,limit:n-o.length})}),Dl(l)||l.label.toLowerCase().includes(r)&&o.push(l)}return o}function hO(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 gk(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Dl(n))gk(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 mO(e,t){return Array.isArray(e)?e.includes(t):e===t}function vk({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!Dl(e)){const u=mO(n,e.value),d=t&&u&&s.jsx(xp,{className:Er.optionsDropdownCheckIcon}),p=s.jsxs(s.Fragment,{children:[r==="left"&&d,s.jsx("span",{children:e.label}),r==="right"&&d]});return s.jsx(ut.Option,{value:e.value,disabled:e.disabled,className:At({[Er.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof i=="function"?i({option:e,checked:u}):p})}const l=e.items.map(u=>s.jsx(vk,{data:u,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},u.value));return s.jsx(ut.Group,{label:e.group,children:l})}function gO({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:l,withScrollArea:u=!0,filterOptions:d=!0,withCheckIcon:p=!1,value:h,checkIconPosition:m,nothingFoundMessage:v,unstyled:x,labelId:b,renderOption:w,scrollAreaProps:j,"aria-label":T}){gk(e);const E=typeof o=="string"?(r||mk)({options:e,search:d?o:"",limit:i??1/0}):e,C=hO(E),P=E.map(D=>s.jsx(vk,{data:D,withCheckIcon:p,value:h,checkIconPosition:m,unstyled:x,renderOption:w},Dl(D)?D.group:D.value));return s.jsx(ut.Dropdown,{hidden:t||n&&C,"data-composed":!0,children:s.jsxs(ut.Options,{labelledBy:b,"aria-label":T,children:[u?s.jsx(co.Autosize,{mah:l??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...j,children:P}):P,C&&v&&s.jsx(ut.Empty,{children:v})]})})}const yk=g.createContext(null),vO=yk.Provider;function yO(){return{withinGroup:!!g.useContext(yk)}}var bp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const xO={},bO=(e,{spacing:t})=>({group:{"--ag-spacing":Rn(t)}}),Ty=ue((e,t)=>{const n=oe("AvatarGroup",xO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,spacing:p,...h}=n,m=Le({name:"AvatarGroup",classes:bp,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:bO,rootSelector:"group"});return s.jsx(vO,{value:!0,children:s.jsx(se,{ref:t,...m("group"),...h})})});Ty.classes=bp;Ty.displayName="@mantine/core/AvatarGroup";function wO(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 SO(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 jO=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function CO(e,t=jO){const n=SO(e),r=Math.abs(n)%t.length;return t[r]}function EO(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 kO={},TO=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:l,name:u,allowedInitialsColors:d})=>{const p=i==="initials"&&typeof u=="string"?CO(u,d):i,h=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:l});return{root:{"--avatar-size":ot(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Mt(n),"--avatar-bg":p||r?h.background:void 0,"--avatar-color":p||r?h.color:void 0,"--avatar-bd":p||r?h.border:void 0}}},sa=nr((e,t)=>{const n=oe("Avatar",kO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,src:p,alt:h,radius:m,color:v,gradient:x,imageProps:b,children:w,autoContrast:j,mod:T,name:R,allowedInitialsColors:E,...C}=n,P=yO(),[D,A]=g.useState(!p),O=Le({name:"Avatar",props:n,classes:bp,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:TO});return g.useEffect(()=>A(!p),[p]),s.jsx(se,{...O("root"),mod:[{"within-group":P.withinGroup},T],ref:t,...C,children:D?s.jsx("span",{...O("placeholder"),title:h,children:w||typeof R=="string"&&EO(R)||s.jsx(wO,{})}):s.jsx("img",{...b,...O("image"),src:p,alt:h,onError:L=>{var V;A(!0),(V=b==null?void 0:b.onError)==null||V.call(b,L)}})})});sa.classes=bp;sa.displayName="@mantine/core/Avatar";sa.Group=Ty;var xk={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const PO={},RO=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--badge-height":ot(i,"badge-height"),"--badge-padding-x":ot(i,"badge-padding-x"),"--badge-fz":ot(i,"badge-fz"),"--badge-radius":t===void 0?void 0:Mt(t),"--badge-bg":n||o?u.background:void 0,"--badge-color":n||o?u.color:void 0,"--badge-bd":n||o?u.border:void 0,"--badge-dot-color":o==="dot"?Lt(n,e):void 0}}},wp=nr((e,t)=>{const n=oe("Badge",PO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,radius:p,color:h,gradient:m,leftSection:v,rightSection:x,children:b,variant:w,fullWidth:j,autoContrast:T,circle:R,mod:E,...C}=n,P=Le({name:"Badge",props:n,classes:xk,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:RO});return s.jsxs(se,{variant:w,mod:[{block:j,circle:R,"with-right-section":!!x,"with-left-section":!!v},E],...P("root",{variant:w}),ref:t,...C,children:[v&&s.jsx("span",{...P("section"),"data-position":"left",children:v}),s.jsx("span",{...P("label"),children:b}),x&&s.jsx("span",{...P("section"),"data-position":"right",children:x})]})});wp.classes=xk;wp.displayName="@mantine/core/Badge";var bk={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const _O={iconSize:48},DO=(e,{color:t,iconSize:n,radius:r})=>{const o=ro({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=ro({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":eo(i.value,.07),"--bq-bg-dark":eo(o.value,.06),"--bq-bd":Lt(t,e),"--bq-icon-size":ie(n),"--bq-radius":Mt(r)}}},Py=ue((e,t)=>{const n=oe("Blockquote",_O,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,children:p,icon:h,iconSize:m,cite:v,...x}=n,b=Le({name:"Blockquote",classes:bk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:DO});return s.jsxs(se,{component:"blockquote",ref:t,...b("root"),...x,children:[h&&s.jsx("span",{...b("icon"),children:h}),p,v&&s.jsx("cite",{...b("cite"),children:v})]})});Py.classes=bk;Py.displayName="@mantine/core/Blockquote";var Wl={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const H1={orientation:"horizontal"},IO=(e,{borderWidth:t})=>({group:{"--button-border-width":ie(t)}}),Ry=ue((e,t)=>{const n=oe("ButtonGroup",H1,e),{className:r,style:o,classNames:i,styles:l,unstyled:u,orientation:d,vars:p,borderWidth:h,variant:m,mod:v,...x}=oe("ButtonGroup",H1,e),b=Le({name:"ButtonGroup",props:n,classes:Wl,className:r,style:o,classNames:i,styles:l,unstyled:u,vars:p,varsResolver:IO,rootSelector:"group"});return s.jsx(se,{...b("group"),ref:t,variant:m,mod:[{"data-orientation":d},v],role:"group",...x})});Ry.classes=Wl;Ry.displayName="@mantine/core/ButtonGroup";const q1={},AO=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:i,size:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:i});return{groupSection:{"--section-height":ot(l,"section-height"),"--section-padding-x":ot(l,"section-padding-x"),"--section-fz":l!=null&&l.includes("compact")?_n(l.replace("compact-","")):_n(l),"--section-radius":t===void 0?void 0:Mt(t),"--section-bg":n||o?u.background:void 0,"--section-color":u.color,"--section-bd":n||o?u.border:void 0}}},_y=ue((e,t)=>{const n=oe("ButtonGroupSection",q1,e),{className:r,style:o,classNames:i,styles:l,unstyled:u,vars:d,variant:p,gradient:h,radius:m,autoContrast:v,...x}=oe("ButtonGroupSection",q1,e),b=Le({name:"ButtonGroupSection",props:n,classes:Wl,className:r,style:o,classNames:i,styles:l,unstyled:u,vars:d,varsResolver:AO,rootSelector:"groupSection"});return s.jsx(se,{...b("groupSection"),ref:t,variant:p,...x})});_y.classes=Wl;_y.displayName="@mantine/core/ButtonGroupSection";const NO={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${ie(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},OO={},MO=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:l,autoContrast:u})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:u});return{root:{"--button-justify":l,"--button-height":ot(i,"button-height"),"--button-padding-x":ot(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?_n(i.replace("compact-","")):_n(i),"--button-radius":t===void 0?void 0:Mt(t),"--button-bg":n||o?d.background:void 0,"--button-hover":n||o?d.hover:void 0,"--button-color":d.color,"--button-bd":n||o?d.border:void 0,"--button-hover-color":n||o?d.hoverColor:void 0}}},Oe=nr((e,t)=>{const n=oe("Button",OO,e),{style:r,vars:o,className:i,color:l,disabled:u,children:d,leftSection:p,rightSection:h,fullWidth:m,variant:v,radius:x,loading:b,loaderProps:w,gradient:j,classNames:T,styles:R,unstyled:E,"data-disabled":C,autoContrast:P,mod:D,...A}=n,O=Le({name:"Button",props:n,classes:Wl,className:i,style:r,classNames:T,styles:R,unstyled:E,vars:o,varsResolver:MO}),L=!!p,V=!!h;return s.jsxs(Qn,{ref:t,...O("root",{active:!u&&!b&&!C}),unstyled:E,variant:v,disabled:u||b,mod:[{disabled:u||C,loading:b,block:m,"with-left-section":L,"with-right-section":V},D],...A,children:[s.jsx(ti,{mounted:!!b,transition:NO,duration:150,children:q=>s.jsx(se,{component:"span",...O("loader",{style:q}),"aria-hidden":!0,children:s.jsx(Cr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...w})})}),s.jsxs("span",{...O("inner"),children:[p&&s.jsx(se,{component:"span",...O("section"),mod:{position:"left"},children:p}),s.jsx(se,{component:"span",mod:{loading:b},...O("label"),children:d}),h&&s.jsx(se,{component:"span",...O("section"),mod:{position:"right"},children:h})]})]})});Oe.classes=Wl;Oe.displayName="@mantine/core/Button";Oe.Group=Ry;Oe.GroupSection=_y;var wk={root:"m_4451eb3a"};const LO={},Gn=nr((e,t)=>{const n=oe("Center",LO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,inline:p,mod:h,...m}=n,v=Le({name:"Center",props:n,classes:wk,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d});return s.jsx(se,{ref:t,mod:[{inline:p},h],...v("root"),...m})});Gn.classes=wk;Gn.displayName="@mantine/core/Center";const[$O,FO]=Ri(),zO={};function Sk(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=oe("ChipGroup",zO,e),[l,u]=Bn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),d=h=>Array.isArray(l)?l.includes(h):h===l,p=h=>{const m=h.currentTarget.value;Array.isArray(l)?u(l.includes(m)?l.filter(v=>v!==m):[...l,m]):u(m)};return s.jsx($O,{value:{isChipSelected:d,onChange:p,multiple:o},children:i})}Sk.displayName="@mantine/core/ChipGroup";var jk={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 VO={type:"checkbox"},BO=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const l=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":_n(t),"--chip-size":ot(t,"chip-size"),"--chip-radius":n===void 0?void 0:Mt(n),"--chip-checked-padding":ot(t,"chip-checked-padding"),"--chip-padding":ot(t,"chip-padding"),"--chip-icon-size":ot(t,"chip-icon-size"),"--chip-bg":o||r?l.background:void 0,"--chip-hover":o||r?l.hover:void 0,"--chip-color":o||r?l.color:void 0,"--chip-bd":o||r?l.border:void 0,"--chip-spacing":ot(t,"chip-spacing")}}},nu=ue((e,t)=>{const n=oe("Chip",VO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,id:p,checked:h,defaultChecked:m,onChange:v,value:x,wrapperProps:b,type:w,disabled:j,children:T,size:R,variant:E,icon:C,rootRef:P,autoContrast:D,mod:A,...O}=n,L=Le({name:"Chip",classes:jk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:BO}),V=FO(),q=fr(p),{styleProps:G,rest:Q}=Ii(O),[Y,X]=Bn({value:h,defaultValue:m,finalValue:!1,onChange:v}),B=V?{checked:V.isChipSelected(x),onChange:N=>{V.onChange(N),v==null||v(N.currentTarget.checked)},type:V.multiple?"checkbox":"radio"}:{},M=B.checked||Y;return s.jsxs(se,{size:R,variant:E,ref:P,mod:A,...L("root"),...G,...b,children:[s.jsx("input",{type:w,...L("input"),checked:M,onChange:N=>X(N.currentTarget.checked),id:q,disabled:j,ref:t,value:x,...B,...Q}),s.jsxs("label",{htmlFor:q,"data-checked":M||void 0,"data-disabled":j||void 0,...L("label",{variant:E||"filled"}),children:[M&&s.jsx("span",{...L("iconWrapper"),children:C||s.jsx(xp,{...L("checkIcon")})}),s.jsx("span",{children:T})]})]})});nu.classes=jk;nu.displayName="@mantine/core/Chip";nu.Group=Sk;var Ck={root:"m_b183c0a2"};const UO={},WO=(e,{color:t})=>({root:{"--code-bg":t?Lt(t,e):void 0}}),Dy=ue((e,t)=>{const n=oe("Code",UO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,color:p,block:h,variant:m,mod:v,...x}=n,b=Le({name:"Code",props:n,classes:Ck,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:WO});return s.jsx(se,{component:h?"pre":"code",variant:m,ref:t,mod:[{block:h},v],...b("root"),...x,dir:"ltr"})});Dy.classes=Ck;Dy.displayName="@mantine/core/Code";var Ek={root:"m_7485cace"};const HO={},qO=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:ot(t,"container-size")}}),Iy=ue((e,t)=>{const n=oe("Container",HO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,fluid:p,mod:h,...m}=n,v=Le({name:"Container",classes:Ek,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:qO});return s.jsx(se,{ref:t,mod:[{fluid:p},h],...v("root"),...m})});Iy.classes=Ek;Iy.displayName="@mantine/core/Container";const GO={timeout:1e3};function kk(e){const{children:t,timeout:n,value:r,...o}=oe("CopyButton",GO,e),i=kC({timeout:n}),l=()=>i.copy(r);return s.jsx(s.Fragment,{children:t({copy:l,copied:i.copied,...o})})}kk.displayName="@mantine/core/CopyButton";var Tk={root:"m_3eebeb36",label:"m_9e365f20"};const QO={orientation:"horizontal"},KO=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Lt(t,e):void 0,"--divider-border-style":n,"--divider-size":ot(r,"divider-size")}}),yn=ue((e,t)=>{const n=oe("Divider",QO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,color:p,orientation:h,label:m,labelPosition:v,mod:x,...b}=n,w=Le({name:"Divider",classes:Tk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:KO});return s.jsx(se,{ref:t,mod:[{orientation:h,"with-label":!!m},x],...w("root"),...b,role:"separator",children:m&&s.jsx(se,{component:"span",mod:{position:v},...w("label"),children:m})})});yn.classes=Tk;yn.displayName="@mantine/core/Divider";function YO({open:e,close:t,openDelay:n,closeDelay:r}){const o=g.useRef(-1),i=g.useRef(-1),l=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},u=()=>{l(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},d=()=>{l(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return g.useEffect(()=>l,[]),{openDropdown:u,closeDropdown:d}}const[G1,Pk]=dr("Grid component was not found in tree"),Kg=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,Q1=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Kg(e,t),K1=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Y1=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function XO({span:e,order:t,offset:n,selector:r}){var x;const o=mn(),i=Pk(),l=i.breakpoints||o.breakpoints,d=jo(e)===void 0?12:jo(e),p=bs({"--col-order":(x=jo(t))==null?void 0:x.toString(),"--col-flex-grow":K1(d,i.grow),"--col-flex-basis":Kg(d,i.columns),"--col-width":d==="content"?"auto":void 0,"--col-max-width":Q1(d,i.columns,i.grow),"--col-offset":Y1(jo(n),i.columns)}),h=Xt(l).reduce((b,w)=>{var j;return b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=(j=t[w])==null?void 0:j.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=K1(e[w],i.grow),b[w]["--col-flex-basis"]=Kg(e[w],i.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=Q1(e[w],i.columns,i.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=Y1(n[w],i.columns)),b},{}),v=Jc(Xt(h),l).filter(b=>Xt(h[b.value]).length>0).map(b=>({query:i.type==="container"?`mantine-grid (min-width: ${l[b.value]})`:`(min-width: ${l[b.value]})`,styles:h[b.value]}));return s.jsx(xa,{styles:p,media:i.type==="container"?void 0:v,container:i.type==="container"?v:void 0,selector:r})}var Ay={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const JO={span:12},Ny=ue((e,t)=>{const n=oe("GridCol",JO,e),{classNames:r,className:o,style:i,styles:l,vars:u,span:d,order:p,offset:h,...m}=n,v=Pk(),x=hu();return s.jsxs(s.Fragment,{children:[s.jsx(XO,{selector:`.${x}`,span:d,order:p,offset:h}),s.jsx(se,{ref:t,...v.getStyles("col",{className:At(o,x),style:i,classNames:r,styles:l}),...m})]})});Ny.classes=Ay;Ny.displayName="@mantine/core/GridCol";function X1({gutter:e,selector:t,breakpoints:n,type:r}){const o=mn(),i=n||o.breakpoints,l=bs({"--grid-gutter":Rn(jo(e))}),u=Xt(i).reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--grid-gutter"]=Rn(e[m])),h),{}),p=Jc(Xt(u),i).filter(h=>Xt(u[h.value]).length>0).map(h=>({query:r==="container"?`mantine-grid (min-width: ${i[h.value]})`:`(min-width: ${i[h.value]})`,styles:u[h.value]}));return s.jsx(xa,{styles:l,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const ZO={gutter:"md",grow:!1,columns:12},eM=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),$r=ue((e,t)=>{const n=oe("Grid",ZO,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,grow:p,gutter:h,columns:m,align:v,justify:x,children:b,breakpoints:w,type:j,...T}=n,R=Le({name:"Grid",classes:Ay,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:eM}),E=hu();return j==="container"&&w?s.jsxs(G1,{value:{getStyles:R,grow:p,columns:m||12,breakpoints:w,type:j},children:[s.jsx(X1,{selector:`.${E}`,...n}),s.jsx("div",{...R("container"),children:s.jsx(se,{ref:t,...R("root",{className:E}),...T,children:s.jsx("div",{...R("inner"),children:b})})})]}):s.jsxs(G1,{value:{getStyles:R,grow:p,columns:m||12,breakpoints:w,type:j},children:[s.jsx(X1,{selector:`.${E}`,...n}),s.jsx(se,{ref:t,...R("root",{className:E}),...T,children:s.jsx("div",{...R("inner"),children:b})})]})});$r.classes=Ay;$r.displayName="@mantine/core/Grid";$r.Col=Ny;function Af(){return Af=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},Af.apply(null,arguments)}function Oy(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 tM=g.useLayoutEffect,nM=function(t){var n=xn.useRef(t);return tM(function(){n.current=t}),n},J1=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},rM=function(t,n){var r=xn.useRef();return xn.useCallback(function(o){t.current=o,r.current&&J1(r.current,null),r.current=n,n&&J1(n,o)},[n])},Z1={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},oM=function(t){Object.keys(Z1).forEach(function(n){t.style.setProperty(n,Z1[n],"important")})},eS=oM,ir=null,tS=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function iM(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),ir||(ir=document.createElement("textarea"),ir.setAttribute("tabindex","-1"),ir.setAttribute("aria-hidden","true"),eS(ir)),ir.parentNode===null&&document.body.appendChild(ir);var o=e.paddingSize,i=e.borderSize,l=e.sizingStyle,u=l.boxSizing;Object.keys(l).forEach(function(v){var x=v;ir.style[x]=l[x]}),eS(ir),ir.value=t;var d=tS(ir,e);ir.value=t,d=tS(ir,e),ir.value="x";var p=ir.scrollHeight-o,h=p*n;u==="border-box"&&(h=h+o+i),d=Math.max(h,d);var m=p*r;return u==="border-box"&&(m=m+o+i),d=Math.min(m,d),[d,p]}var nS=function(){},sM=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},aM=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],lM=!!document.documentElement.currentStyle,cM=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=sM(aM,n),o=r.boxSizing;if(o==="")return null;lM&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),l=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:l}},uM=cM;function My(e,t,n){var r=nM(n);g.useLayoutEffect(function(){var o=function(l){return r.current(l)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var dM=function(t,n){My(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},fM=function(t){My(window,"resize",t)},pM=function(t){My(document.fonts,"loadingdone",t)},hM=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],mM=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,l=t.onChange,u=l===void 0?nS:l,d=t.onHeightChange,p=d===void 0?nS:d,h=Oy(t,hM),m=h.value!==void 0,v=g.useRef(null),x=rM(v,n),b=g.useRef(0),w=g.useRef(),j=function(){var E=v.current,C=r&&w.current?w.current:uM(E);if(C){w.current=C;var P=iM(C,E.value||E.placeholder||"x",i,o),D=P[0],A=P[1];b.current!==D&&(b.current=D,E.style.setProperty("height",D+"px","important"),p(D,{rowHeight:A}))}},T=function(E){m||j(),u(E)};return g.useLayoutEffect(j),dM(v,function(){if(!m){var R=v.current.value;requestAnimationFrame(function(){var E=v.current;E&&R!==E.value&&j()})}}),fM(j),pM(j),g.createElement("textarea",Af({},h,{onChange:T,ref:x}))},gM=g.forwardRef(mM);const vM={},wa=ue((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:l,...u}=oe("Textarea",vM,e),d=n&&AC()!=="test",p=d?{maxRows:r,minRows:o}:{};return s.jsx(kr,{component:d?gM:"textarea",ref:t,...u,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":l},...p})});wa.classes=kr.classes;wa.displayName="@mantine/core/Textarea";function rS(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const yM={serialize:JSON.stringify,deserialize:JSON.parse},Hl=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:l,serialize:u,deserialize:d,onFocus:p,onBlur:h,readOnly:m,error:v,...x}=oe("JsonInput",yM,e),[b,w]=Bn({value:n,defaultValue:r,finalValue:"",onChange:o}),[j,T]=g.useState(rS(b,d)),R=C=>{p==null||p(C),T(!0)},E=C=>{typeof h=="function"&&h(C);const P=rS(C.currentTarget.value,d);i&&!m&&P&&C.currentTarget.value.trim()!==""&&w(u(d(C.currentTarget.value),null,2)),T(P)};return s.jsx(wa,{value:b,onChange:C=>w(C.currentTarget.value),onFocus:R,onBlur:E,ref:t,readOnly:m,...x,autoComplete:"off",__staticSelector:"JsonInput",error:j?v:l||!0,"data-monospace":!0})});Hl.classes=kr.classes;Hl.displayName="@mantine/core/JsonInput";const[xM,bM]=dr("List component was not found in tree");var Ly={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const wM={},$y=ue((e,t)=>{const n=oe("ListItem",wM,e),{classNames:r,className:o,style:i,styles:l,vars:u,icon:d,children:p,mod:h,...m}=n,v=bM(),x=d||v.icon,b={classNames:r,styles:l};return s.jsx(se,{...v.getStyles("item",{...b,className:o,style:i}),component:"li",mod:[{"with-icon":!!x,centered:v.center},h],ref:t,...m,children:s.jsxs("div",{...v.getStyles("itemWrapper",b),children:[x&&s.jsx("span",{...v.getStyles("itemIcon",b),children:x}),s.jsx("span",{...v.getStyles("itemLabel",b),children:p})]})})});$y.classes=Ly;$y.displayName="@mantine/core/ListItem";const SM={type:"unordered"},jM=(e,{size:t,spacing:n})=>({root:{"--list-fz":_n(t),"--list-lh":EC(t),"--list-spacing":Rn(n)}}),lr=ue((e,t)=>{const n=oe("List",SM,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,children:p,type:h,withPadding:m,icon:v,spacing:x,center:b,listStyleType:w,mod:j,...T}=n,R=Le({name:"List",classes:Ly,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:jM});return s.jsx(xM,{value:{center:b,icon:v,getStyles:R},children:s.jsx(se,{...R("root",{style:{listStyleType:w}}),component:h==="unordered"?"ul":"ol",mod:[{"with-padding":m},j],ref:t,...T,children:p})})});lr.classes=Ly;lr.displayName="@mantine/core/List";lr.Item=$y;var Rk={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const oS={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Br("overlay")},CM=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Fy=ue((e,t)=>{const n=oe("LoadingOverlay",oS,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,transitionProps:p,loaderProps:h,overlayProps:m,visible:v,zIndex:x,...b}=n,w=mn(),j=Le({name:"LoadingOverlay",classes:Rk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:CM}),T={...oS.overlayProps,...m};return s.jsx(ti,{transition:"fade",...p,mounted:!!v,children:R=>s.jsxs(se,{...j("root",{style:R}),ref:t,...b,children:[s.jsx(Cr,{...j("loader"),unstyled:u,...h}),s.jsx(Rl,{...T,...j("overlay"),darkHidden:!0,unstyled:u,color:(m==null?void 0:m.color)||w.white}),s.jsx(Rl,{...T,...j("overlay"),lightHidden:!0,unstyled:u,color:(m==null?void 0:m.color)||w.colors.dark[5]})]})})});Fy.classes=Rk;Fy.displayName="@mantine/core/LoadingOverlay";const[EM,wu]=dr("Menu component was not found in the tree");var ql={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const kM={},zy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,...u}=oe("MenuDivider",kM,e),d=wu();return s.jsx(se,{ref:t,...d.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...u})});zy.classes=ql;zy.displayName="@mantine/core/MenuDivider";const TM={},Vy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,onMouseEnter:u,onMouseLeave:d,onKeyDown:p,children:h,...m}=oe("MenuDropdown",TM,e),v=g.useRef(null),x=wu(),b=wr(p,T=>{var R,E;(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),(E=(R=v.current)==null?void 0:R.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||E.focus())}),w=wr(u,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.openDropdown()),j=wr(d,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.closeDropdown());return s.jsxs(Ro.Dropdown,{...m,onMouseEnter:w,onMouseLeave:j,role:"menu","aria-orientation":"vertical",ref:An(t,v),...x.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[x.withInitialFocusPlaceholder&&s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),h]})});Vy.classes=ql;Vy.displayName="@mantine/core/MenuDropdown";const PM={},By=nr((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,color:u,closeMenuOnClick:d,leftSection:p,rightSection:h,children:m,disabled:v,"data-disabled":x,...b}=oe("MenuItem",PM,e),w=wu(),j=mn(),{dir:T}=ba(),R=g.useRef(null),E=w.getItemIndex(R.current),C=b,P=wr(C.onMouseLeave,()=>w.setHovered(-1)),D=wr(C.onMouseEnter,()=>w.setHovered(w.getItemIndex(R.current))),A=wr(C.onClick,()=>{x||(typeof d=="boolean"?d&&w.closeDropdownImmediately():w.closeOnItemClick&&w.closeDropdownImmediately())}),O=wr(C.onFocus,()=>w.setHovered(w.getItemIndex(R.current))),L=u?j.variantColorResolver({color:u,theme:j,variant:"light"}):void 0,V=u?ro({color:u,theme:j}):null;return s.jsxs(Qn,{...b,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,onFocus:O,...w.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:An(R,t),role:"menuitem",disabled:v,"data-menu-item":!0,"data-disabled":v||x||void 0,"data-hovered":w.hovered===E?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:D,onMouseLeave:P,onClick:A,onKeyDown:CC({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:T,orientation:"vertical",onKeyDown:C.onKeyDown}),__vars:{"--menu-item-color":V!=null&&V.isThemeColor&&(V==null?void 0:V.shade)===void 0?`var(--mantine-color-${V.color}-6)`:L==null?void 0:L.color,"--menu-item-hover":L==null?void 0:L.hover},children:[p&&s.jsx("div",{...w.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:p}),m&&s.jsx("div",{...w.getStyles("itemLabel",{styles:i,classNames:n}),children:m}),h&&s.jsx("div",{...w.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:h})]})});By.classes=ql;By.displayName="@mantine/core/MenuItem";const RM={},Uy=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,...u}=oe("MenuLabel",RM,e),d=wu();return s.jsx(se,{ref:t,...d.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...u})});Uy.classes=ql;Uy.displayName="@mantine/core/MenuLabel";const _M={refProp:"ref"},_k=g.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=oe("MenuTarget",_M,e);if(!Pi(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const i=wu(),l=n.props,u=wr(l.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),d=wr(l.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),p=wr(l.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return s.jsx(Ro.Target,{refProp:r,popupType:"menu",ref:t,...o,children:g.cloneElement(n,{onClick:u,onMouseEnter:d,onMouseLeave:p,"data-expanded":i.opened?!0:void 0})})});_k.displayName="@mantine/core/MenuTarget";const DM={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function ve(e){const t=oe("Menu",DM,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:l,trapFocus:u,onChange:d,closeOnItemClick:p,loop:h,closeOnEscape:m,trigger:v,openDelay:x,closeDelay:b,classNames:w,styles:j,unstyled:T,variant:R,vars:E,menuItemTabIndex:C,keepMounted:P,withInitialFocusPlaceholder:D,...A}=t,O=Le({name:"Menu",classes:ql,props:t,classNames:w,styles:j,unstyled:T}),[L,{setHovered:V,resetHovered:q}]=qD(),[G,Q]=Bn({value:i,defaultValue:l,finalValue:!1,onChange:d}),[Y,X]=g.useState(!1),B=()=>{Q(!1),X(!1),G&&(o==null||o())},M=()=>{Q(!0),!G&&(r==null||r())},N=()=>{G?B():M()},{openDropdown:F,closeDropdown:I}=YO({open:M,close:B,closeDelay:b,openDelay:x}),z=je=>HD("[data-menu-item]","[data-menu-dropdown]",je),{resolvedClassNames:J,resolvedStyles:ae}=va({classNames:w,styles:j,props:t});return wi(()=>{q()},[G]),s.jsx(EM,{value:{getStyles:O,opened:G,toggleDropdown:N,getItemIndex:z,hovered:L,setHovered:V,openedViaClick:Y,setOpenedViaClick:X,closeOnItemClick:p,closeDropdown:v==="click"?B:I,openDropdown:v==="click"?M:F,closeDropdownImmediately:B,loop:h,trigger:v,unstyled:T,menuItemTabIndex:C,withInitialFocusPlaceholder:D},children:s.jsx(Ro,{...A,opened:G,onChange:N,defaultOpened:l,trapFocus:P?!1:u,closeOnEscape:m,__staticSelector:"Menu",classNames:J,styles:ae,unstyled:T,variant:R,keepMounted:P,children:n})})}ve.extend=e=>e;ve.withProps=TA(ve);ve.classes=ql;ve.displayName="@mantine/core/Menu";ve.Item=By;ve.Label=Uy;ve.Dropdown=Vy;ve.Target=_k;ve.Divider=zy;const[IM,Gl]=dr("Modal component was not found in tree");var Oi={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const AM={},Sp=ue((e,t)=>{const n=oe("ModalBody",AM,e),{classNames:r,className:o,style:i,styles:l,vars:u,...d}=n,p=Gl();return s.jsx(VE,{ref:t,...p.getStyles("body",{classNames:r,style:i,styles:l,className:o}),...d})});Sp.classes=Oi;Sp.displayName="@mantine/core/ModalBody";const NM={},jp=ue((e,t)=>{const n=oe("ModalCloseButton",NM,e),{classNames:r,className:o,style:i,styles:l,vars:u,...d}=n,p=Gl();return s.jsx(BE,{ref:t,...p.getStyles("close",{classNames:r,style:i,styles:l,className:o}),...d})});jp.classes=Oi;jp.displayName="@mantine/core/ModalCloseButton";const OM={},Cp=ue((e,t)=>{const n=oe("ModalContent",OM,e),{classNames:r,className:o,style:i,styles:l,vars:u,children:d,__hidden:p,...h}=n,m=Gl(),v=m.scrollAreaComponent||G4;return s.jsx(UE,{...m.getStyles("content",{className:o,style:i,styles:l,classNames:r}),innerProps:m.getStyles("inner",{className:o,style:i,styles:l,classNames:r}),"data-full-screen":m.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...h,children:s.jsx(v,{style:{maxHeight:m.fullScreen?"100dvh":`calc(100dvh - (${ie(m.yOffset)} * 2))`},children:d})})});Cp.classes=Oi;Cp.displayName="@mantine/core/ModalContent";const MM={},Ep=ue((e,t)=>{const n=oe("ModalHeader",MM,e),{classNames:r,className:o,style:i,styles:l,vars:u,...d}=n,p=Gl();return s.jsx(WE,{ref:t,...p.getStyles("header",{classNames:r,style:i,styles:l,className:o}),...d})});Ep.classes=Oi;Ep.displayName="@mantine/core/ModalHeader";const LM={},kp=ue((e,t)=>{const n=oe("ModalOverlay",LM,e),{classNames:r,className:o,style:i,styles:l,vars:u,...d}=n,p=Gl();return s.jsx(HE,{ref:t,...p.getStyles("overlay",{classNames:r,style:i,styles:l,className:o}),...d})});kp.classes=Oi;kp.displayName="@mantine/core/ModalOverlay";const $M={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Br("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},FM=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Mt(t),"--modal-size":ot(n,"modal-size"),"--modal-y-offset":ie(r),"--modal-x-offset":ie(o)}}),Tp=ue((e,t)=>{const n=oe("ModalRoot",$M,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,yOffset:p,scrollAreaComponent:h,radius:m,fullScreen:v,centered:x,xOffset:b,__staticSelector:w,...j}=n,T=Le({name:w,classes:Oi,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:FM});return s.jsx(IM,{value:{yOffset:p,scrollAreaComponent:h,getStyles:T,fullScreen:v},children:s.jsx(zE,{ref:t,...T("root"),"data-full-screen":v||void 0,"data-centered":x||void 0,unstyled:u,...j})})});Tp.classes=Oi;Tp.displayName="@mantine/core/ModalRoot";const[zM,VM]=Ri();function Dk({children:e}){const[t,n]=g.useState([]),[r,o]=g.useState(Br("modal"));return s.jsx(zM,{value:{stack:t,addModal:(i,l)=>{n(u=>[...new Set([...u,i])]),o(u=>typeof l=="number"&&typeof u=="number"?Math.max(u,l):u)},removeModal:i=>n(l=>l.filter(u=>u!==i)),getZIndex:i=>`calc(${r} + ${t.indexOf(i)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}Dk.displayName="@mantine/core/ModalStack";const BM={},Pp=ue((e,t)=>{const n=oe("ModalTitle",BM,e),{classNames:r,className:o,style:i,styles:l,vars:u,...d}=n,p=Gl();return s.jsx(qE,{ref:t,...p.getStyles("title",{classNames:r,style:i,styles:l,className:o}),...d})});Pp.classes=Oi;Pp.displayName="@mantine/core/ModalTitle";const UM={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Br("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Nn=ue((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:l,children:u,radius:d,opened:p,stackId:h,zIndex:m,...v}=oe("Modal",UM,e),x=VM(),b=!!n||i,w=x&&h?{closeOnEscape:x.currentId===h,trapFocus:x.currentId===h,zIndex:x.getZIndex(h)}:{},j=r===!1?!1:h&&x?x.currentId===h:p;return g.useEffect(()=>{x&&h&&(p?x.addModal(h,m||Br("modal")):x.removeModal(h))},[p,h,m]),s.jsxs(Tp,{ref:t,radius:d,opened:p,zIndex:x&&h?x.getZIndex(h):m,...v,...w,children:[r&&s.jsx(kp,{visible:j,transitionProps:x&&h?{duration:0}:void 0,...o}),s.jsxs(Cp,{radius:d,__hidden:x&&h&&p?h!==x.currentId:!1,children:[b&&s.jsxs(Ep,{children:[n&&s.jsx(Pp,{children:n}),i&&s.jsx(jp,{...l})]}),s.jsx(Sp,{children:u})]})]})});Nn.classes=Oi;Nn.displayName="@mantine/core/Modal";Nn.Root=Tp;Nn.Overlay=kp;Nn.Content=Cp;Nn.Body=Sp;Nn.Header=Ep;Nn.Title=Pp;Nn.CloseButton=jp;Nn.Stack=Dk;const[WM,Wy]=Ri(),[HM,qM]=Ri();var Rp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const GM={},QM=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?ot(t):ot(n,"pg-gap")}}),Hy=ue((e,t)=>{const n=oe("PillGroup",GM,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,size:p,disabled:h,...m}=n,v=Wy(),x=(v==null?void 0:v.size)||p||void 0,b=Le({name:"PillGroup",classes:Rp,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:QM,stylesCtx:{size:x},rootSelector:"group"});return s.jsx(HM,{value:{size:x,disabled:h},children:s.jsx(se,{ref:t,size:x,...b("group"),...m})})});Hy.classes=Rp;Hy.displayName="@mantine/core/PillGroup";const KM={variant:"default"},YM=(e,{radius:t},{size:n})=>({root:{"--pill-fz":ot(n,"pill-fz"),"--pill-height":ot(n,"pill-height"),"--pill-radius":t===void 0?void 0:Mt(t)}}),aa=ue((e,t)=>{const n=oe("Pill",KM,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,variant:p,children:h,withRemoveButton:m,onRemove:v,removeButtonProps:x,radius:b,size:w,disabled:j,mod:T,...R}=n,E=qM(),C=Wy(),P=w||(E==null?void 0:E.size)||void 0,D=(C==null?void 0:C.variant)==="filled"?"contrast":p||"default",A=Le({name:"Pill",classes:Rp,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:YM,stylesCtx:{size:P}});return s.jsxs(se,{component:"span",ref:t,variant:D,size:P,...A("root",{variant:D}),mod:[{"with-remove":m&&!j,disabled:j||(E==null?void 0:E.disabled)},T],...R,children:[s.jsx("span",{...A("label"),children:h}),m&&s.jsx(Ss,{variant:"transparent",radius:b,tabIndex:-1,"aria-hidden":!0,unstyled:u,...x,...A("remove",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),onMouseDown:O=>{var L;O.preventDefault(),O.stopPropagation(),(L=x==null?void 0:x.onMouseDown)==null||L.call(x,O)},onClick:O=>{var L;O.stopPropagation(),v==null||v(),(L=x==null?void 0:x.onClick)==null||L.call(x,O)}})]})});aa.classes=Rp;aa.displayName="@mantine/core/Pill";aa.Group=Hy;var Ik={field:"m_45c4369d"};const XM={type:"visible"},qy=ue((e,t)=>{const n=oe("PillsInputField",XM,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,type:p,disabled:h,id:m,pointer:v,mod:x,...b}=n,w=Wy(),j=Bl(),T=Le({name:"PillsInputField",classes:Ik,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,rootSelector:"field"}),R=h||(w==null?void 0:w.disabled);return s.jsx(se,{component:"input",ref:An(t,w==null?void 0:w.fieldRef),"data-type":p,disabled:R,mod:[{disabled:R,pointer:v},x],...T("field"),...b,id:(j==null?void 0:j.inputId)||m,"aria-invalid":w==null?void 0:w.hasError,"aria-describedby":j==null?void 0:j.describedBy,type:"text",onMouseDown:E=>!v&&E.stopPropagation()})});qy.classes=Ik;qy.displayName="@mantine/core/PillsInputField";const JM={},Il=ue((e,t)=>{const n=oe("PillsInput",JM,e),{children:r,onMouseDown:o,onClick:i,size:l,disabled:u,__staticSelector:d,error:p,variant:h,...m}=n,v=g.useRef(null);return s.jsx(WM,{value:{fieldRef:v,size:l,disabled:u,hasError:!!p,variant:h},children:s.jsx(kr,{size:l,error:p,variant:h,component:"div",ref:t,onMouseDown:x=>{var b;x.preventDefault(),o==null||o(x),(b=v.current)==null||b.focus()},onClick:x=>{var w;x.preventDefault();const b=x.currentTarget.closest("fieldset");b!=null&&b.disabled||((w=v.current)==null||w.focus(),i==null||i(x))},...m,multiline:!0,disabled:u,__staticSelector:d||"PillsInput",withAria:!1,children:r})})});Il.displayName="@mantine/core/PillsInput";Il.Field=qy;function ZM({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Dl(i)?o.push({group:i.group,items:i.items.filter(l=>n.indexOf(l.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const e9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Su=ue((e,t)=>{const n=oe("MultiSelect",e9,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,size:p,value:h,defaultValue:m,onChange:v,onKeyDown:x,variant:b,data:w,dropdownOpened:j,defaultDropdownOpened:T,onDropdownOpen:R,onDropdownClose:E,selectFirstOptionOnChange:C,onOptionSubmit:P,comboboxProps:D,filter:A,limit:O,withScrollArea:L,maxDropdownHeight:V,searchValue:q,defaultSearchValue:G,onSearchChange:Q,readOnly:Y,disabled:X,onFocus:B,onBlur:M,onPaste:N,radius:F,rightSection:I,rightSectionWidth:z,rightSectionPointerEvents:J,rightSectionProps:ae,leftSection:je,leftSectionWidth:ge,leftSectionPointerEvents:Ce,leftSectionProps:Re,inputContainer:ke,inputWrapperOrder:_e,withAsterisk:$e,labelProps:yt,descriptionProps:Ft,errorProps:gt,wrapperProps:Tt,description:Nt,label:Pt,error:be,maxValues:Ie,searchable:Be,nothingFoundMessage:Se,withCheckIcon:ce,checkIconPosition:me,hidePickedOptions:Ue,withErrorStyles:de,name:Ae,form:pt,id:zt,clearable:Qt,clearButtonProps:jn,hiddenInputProps:Ct,placeholder:bt,hiddenInputValuesDivider:Ao,required:oi,mod:Da,renderOption:Ia,onRemove:$n,onClear:No,scrollAreaProps:ii,chevronColor:Rs,...si}=n,Wr=fr(zt),Rr=ek(w),pr=tk(Rr),kn=bu({opened:j,defaultOpened:T,onDropdownOpen:R,onDropdownClose:()=>{E==null||E(),kn.resetSelectedOption()}}),{styleProps:Aa,rest:{type:ec,autoComplete:W,...K}}=Ii(si),[ee,fe]=Bn({value:h,defaultValue:m,finalValue:[],onChange:v}),[Ee,rt]=Bn({value:q,defaultValue:G,finalValue:"",onChange:Q}),nt=ct=>{rt(ct),kn.resetSelectedOption()},We=Le({name:"MultiSelect",classes:{},props:n,classNames:r,styles:l,unstyled:u}),{resolvedClassNames:Ke,resolvedStyles:Ne}=va({props:n,styles:l,classNames:r}),Xe=ct=>{x==null||x(ct),ct.key===" "&&!Be&&(ct.preventDefault(),kn.toggleDropdown()),ct.key==="Backspace"&&Ee.length===0&&ee.length>0&&($n==null||$n(ee[ee.length-1]),fe(ee.slice(0,ee.length-1)))},at=ee.map((ct,Bt)=>{var pn,Hr;return s.jsx(aa,{withRemoveButton:!Y&&!((pn=pr[ct])!=null&&pn.disabled),onRemove:()=>{fe(ee.filter(Oo=>ct!==Oo)),$n==null||$n(ct)},unstyled:u,disabled:X,...We("pill"),children:((Hr=pr[ct])==null?void 0:Hr.label)||ct},`${ct}-${Bt}`)});g.useEffect(()=>{C&&kn.selectFirstOption()},[C,Ee]);const wt=s.jsx(ut.ClearButton,{...jn,onClear:()=>{No==null||No(),fe([]),nt("")}}),en=ZM({data:Rr,value:ee}),Kt=Qt&&ee.length>0&&!X&&!Y;return s.jsxs(s.Fragment,{children:[s.jsxs(ut,{store:kn,classNames:Ke,styles:Ne,unstyled:u,size:p,readOnly:Y,__staticSelector:"MultiSelect",onOptionSubmit:ct=>{P==null||P(ct),nt(""),kn.updateSelectedOptionIndex("selected"),ee.includes(pr[ct].value)?(fe(ee.filter(Bt=>Bt!==pr[ct].value)),$n==null||$n(pr[ct].value)):ee.length<Ie&&fe([...ee,pr[ct].value])},...D,children:[s.jsx(ut.DropdownTarget,{children:s.jsx(Il,{...Aa,__staticSelector:"MultiSelect",classNames:Ke,styles:Ne,unstyled:u,size:p,className:o,style:i,variant:b,disabled:X,radius:F,__defaultRightSection:s.jsx(ut.Chevron,{size:p,error:be,unstyled:u,color:Rs}),__clearSection:wt,__clearable:Kt,rightSection:I,rightSectionPointerEvents:J||(wt?"all":"none"),rightSectionWidth:z,rightSectionProps:ae,leftSection:je,leftSectionWidth:ge,leftSectionPointerEvents:Ce,leftSectionProps:Re,inputContainer:ke,inputWrapperOrder:_e,withAsterisk:$e,labelProps:yt,descriptionProps:Ft,errorProps:gt,wrapperProps:Tt,description:Nt,label:Pt,error:be,multiline:!0,withErrorStyles:de,__stylesApiProps:{...n,rightSectionPointerEvents:J||(Kt?"all":"none"),multiline:!0},pointer:!Be,onClick:()=>Be?kn.openDropdown():kn.toggleDropdown(),"data-expanded":kn.dropdownOpened||void 0,id:Wr,required:oi,mod:Da,children:s.jsxs(aa.Group,{disabled:X,unstyled:u,...We("pillsList"),children:[at,s.jsx(ut.EventsTarget,{autoComplete:W,children:s.jsx(Il.Field,{...K,ref:t,id:Wr,placeholder:bt,type:!Be&&!bt?"hidden":"visible",...We("inputField"),unstyled:u,onFocus:ct=>{B==null||B(ct),Be&&kn.openDropdown()},onBlur:ct=>{M==null||M(ct),kn.closeDropdown(),nt("")},onKeyDown:Xe,value:Ee,onChange:ct=>{nt(ct.currentTarget.value),Be&&kn.openDropdown(),C&&kn.selectFirstOption()},disabled:X,readOnly:Y||!Be,pointer:!Be})})]})})}),s.jsx(gO,{data:Ue?en:Rr,hidden:Y||X,filter:A,search:Ee,limit:O,hiddenWhenEmpty:!Se,withScrollArea:L,maxDropdownHeight:V,filterOptions:Be,value:ee,checkIconPosition:me,withCheckIcon:ce,nothingFoundMessage:Se,unstyled:u,labelId:Pt?`${Wr}-label`:void 0,"aria-label":Pt?void 0:si["aria-label"],renderOption:Ia,scrollAreaProps:ii})]}),s.jsx(ut.HiddenInput,{name:Ae,valuesDivider:Ao,value:ee,form:pt,disabled:X,...Ct})]})});Su.classes={...kr.classes,...ut.classes};Su.displayName="@mantine/core/MultiSelect";function t9(e){return"group"in e}function Gy({data:e}){if(t9(e)){const o=e.items.map(i=>s.jsx(Gy,{data:i},i.value));return s.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}Gy.displayName="@mantine/core/NativeSelectOption";const n9={rightSectionPointerEvents:"none"},Jt=ue((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:l,unstyled:u,...d}=oe("NativeSelect",n9,e),p=ek(n).map((h,m)=>s.jsx(Gy,{data:h},m));return s.jsx(kr,{component:"select",ref:t,...d,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:u,rightSection:l||s.jsx(vp,{size:o,error:i,unstyled:u}),children:r||p})});Jt.classes=kr.classes;Jt.displayName="@mantine/core/NativeSelect";var Ak={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const r9={withCloseButton:!0},o9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Mt(t),"--notification-color":n?Lt(n,e):void 0}}),Qy=ue((e,t)=>{const n=oe("Notification",r9,e),{className:r,color:o,radius:i,loading:l,withCloseButton:u,withBorder:d,title:p,icon:h,children:m,onClose:v,closeButtonProps:x,classNames:b,style:w,styles:j,unstyled:T,variant:R,vars:E,mod:C,loaderProps:P,...D}=n,A=Le({name:"Notification",classes:Ak,props:n,className:r,style:w,classNames:b,styles:j,unstyled:T,vars:E,varsResolver:o9});return s.jsxs(se,{...A("root"),mod:[{"data-with-icon":!!h||l,"data-with-border":d},C],ref:t,variant:R,...D,role:"alert",children:[h&&!l&&s.jsx("div",{...A("icon"),children:h}),l&&s.jsx(Cr,{size:28,color:o,...P,...A("loader")}),s.jsxs("div",{...A("body"),children:[p&&s.jsx("div",{...A("title"),children:p}),s.jsx(se,{...A("description"),mod:{"data-with-title":!!p},children:m})]}),u&&s.jsx(Ss,{iconSize:16,color:"gray",...x,unstyled:T,onClick:v,...A("closeButton")})]})});Qy.classes=Ak;Qy.displayName="@mantine/core/Notification";function Nk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var ru;(function(e){e.event="event",e.props="prop"})(ru||(ru={}));function fs(){}function i9(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t&&r.length===t.length&&r.every(function(i,l){return i===t[l]})||(t=r,n=e.apply(void 0,r)),n}}function ou(e){return!!(e||"").match(/\d/)}function jl(e){return e==null}function s9(e){return typeof e=="number"&&isNaN(e)}function Ok(e){return jl(e)||s9(e)||typeof e=="number"&&!isFinite(e)}function Mk(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function a9(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function l9(e,t,n){var r=a9(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function c9(e){var t=g.useRef(e);t.current=e;var n=g.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function Ky(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),i=o[0],l=o[1]||"";return{beforeDecimal:i,afterDecimal:l,hasNegation:n,addNegation:r}}function u9(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function Lk(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function iS(e,t){return Array(t+1).join(e)}function $k(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(i=Number(i),!i)return n+o;o=o.replace(".","");var l=1+i,u=o.length;return l<0?o="0."+iS("0",Math.abs(l))+o:l>=u?o=o+iS("0",l-u):o=(o.substring(0,l)||"0")+"."+o.substring(l),n+o}function sS(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=Ky(e),i=o.beforeDecimal,l=o.afterDecimal,u=o.hasNegation,d=parseFloat("0."+(l||"0")),p=l.length<=t?"0."+l:d.toFixed(t),h=p.split("."),m=i;i&&Number(h[0])&&(m=i.split("").reverse().reduce(function(w,j,T){return w.length>T?(Number(w[0])+Number(j)).toString()+w.substring(1,w.length):j+w},h[0]));var v=Lk(h[1]||"",t,n),x=u?"-":"",b=r?".":"";return""+x+m+b+v}function Ks(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 Fk=i9(function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}}),d9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function f9(e,t,n){return Math.min(Math.max(e,t),n)}function cg(e){return Math.max(e.selectionStart,e.selectionEnd)}function p9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function h9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function m9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function g9(e,t,n,r,o,i,l){l===void 0&&(l=m9);var u=o.findIndex(function(C){return C}),d=e.slice(0,u);!t&&!n.startsWith(d)&&(t=d,n=d+n,r=r+d.length);for(var p=n.length,h=e.length,m={},v=new Array(p),x=0;x<p;x++){v[x]=-1;for(var b=0,w=h;b<w;b++){var j=l({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:x,formattedValueIndex:b});if(j&&m[b]!==!0){v[x]=b,m[b]=!0;break}}}for(var T=r;T<p&&(v[T]===-1||!i(n[T]));)T++;var R=T===p||v[T]===-1?h:v[T];for(T=r-1;T>0&&v[T]===-1;)T--;var E=T===-1||v[T]===-1?0:v[T]+1;return E>R?R:r-E<R-r?E:R}function aS(e,t,n,r){var o=e.length;if(t=f9(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function v9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(ou(e[n])||ou(e[n-1]));return t}function zk(e,t,n,r,o,i){i===void 0&&(i=fs);var l=c9(function(b,w){var j,T;return Ok(b)?(T="",j=""):typeof b=="number"||w?(T=typeof b=="number"?$k(b):b,j=r(T)):(T=o(b,void 0),j=r(T)),{formattedValue:j,numAsString:T}}),u=g.useState(function(){return l(jl(e)?t:e,n)}),d=u[0],p=u[1],h=function(b,w){b.formattedValue!==d.formattedValue&&p({formattedValue:b.formattedValue,numAsString:b.value}),i(b,w)},m=e,v=n;jl(e)&&(m=d.numAsString,v=!0);var x=l(m,v);return g.useMemo(function(){p(x)},[x.formattedValue]),[d,h]}function y9(e){return e.replace(/[^0-9]/g,"")}function x9(e){return e}function b9(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,i=e.getInputRef,l=e.format;l===void 0&&(l=x9);var u=e.removeFormatting;u===void 0&&(u=y9);var d=e.defaultValue,p=e.valueIsNumericString,h=e.onValueChange,m=e.isAllowed,v=e.onChange;v===void 0&&(v=fs);var x=e.onKeyDown;x===void 0&&(x=fs);var b=e.onMouseUp;b===void 0&&(b=fs);var w=e.onFocus;w===void 0&&(w=fs);var j=e.onBlur;j===void 0&&(j=fs);var T=e.value,R=e.getCaretBoundary;R===void 0&&(R=v9);var E=e.isValidInputCharacter;E===void 0&&(E=ou);var C=e.isCharacterSame,P=Nk(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),D=zk(T,d,!!p,l,u,h),A=D[0],O=A.formattedValue,L=A.numAsString,V=D[1],q=g.useRef(),G=g.useRef({formattedValue:O,numAsString:L}),Q=function(be,Ie){G.current={formattedValue:be.formattedValue,numAsString:be.value},V(be,Ie)},Y=g.useState(!1),X=Y[0],B=Y[1],M=g.useRef(null),N=g.useRef({setCaretTimeout:null,focusTimeout:null});g.useEffect(function(){return B(!0),function(){clearTimeout(N.current.setCaretTimeout),clearTimeout(N.current.focusTimeout)}},[]);var F=l,I=function(be,Ie){var Be=parseFloat(Ie);return{formattedValue:be,value:Ie,floatValue:isNaN(Be)?void 0:Be}},z=function(be,Ie,Be){be.selectionStart===0&&be.selectionEnd===be.value.length||(Ks(be,Ie),N.current.setCaretTimeout=setTimeout(function(){be.value===Be&&be.selectionStart!==Ie&&Ks(be,Ie)},0))},J=function(be,Ie,Be){return aS(be,Ie,R(be),Be)},ae=function(be,Ie,Be){var Se=R(Ie),ce=g9(Ie,O,be,Be,Se,E,C);return ce=aS(Ie,ce,Se),ce},je=function(be){var Ie=be.formattedValue;Ie===void 0&&(Ie="");var Be=be.input,Se=be.source,ce=be.event,me=be.numAsString,Ue;if(Be){var de=be.inputValue||Be.value,Ae=cg(Be);Be.value=Ie,Ue=ae(de,Ie,Ae),Ue!==void 0&&z(Be,Ue,Ie)}Ie!==O&&Q(I(Ie,me),{event:ce,source:Se})};g.useEffect(function(){var be=G.current,Ie=be.formattedValue,Be=be.numAsString;(O!==Ie||L!==Be)&&Q(I(O,L),{event:void 0,source:ru.props})},[O,L]);var ge=M.current?cg(M.current):void 0,Ce=typeof window<"u"?g.useLayoutEffect:g.useEffect;Ce(function(){var be=M.current;if(O!==G.current.formattedValue&&be){var Ie=ae(G.current.formattedValue,O,ge);be.value=O,z(be,Ie,O)}},[O]);var Re=function(be,Ie,Be){var Se=Ie.target,ce=q.current?d9(q.current,Se.selectionEnd):Fk(O,be),me=Object.assign(Object.assign({},ce),{lastValue:O}),Ue=u(be,me),de=F(Ue);if(Ue=u(de,void 0),m&&!m(I(de,Ue))){var Ae=Ie.target,pt=cg(Ae),zt=ae(be,O,pt);return Ae.value=O,z(Ae,zt,O),!1}return je({formattedValue:de,numAsString:Ue,inputValue:be,event:Ie,source:Be,input:Ie.target}),!0},ke=function(be,Ie){Ie===void 0&&(Ie=0);var Be=be.selectionStart,Se=be.selectionEnd;q.current={selectionStart:Be,selectionEnd:Se+Ie}},_e=function(be){var Ie=be.target,Be=Ie.value,Se=Re(Be,be,ru.event);Se&&v(be),q.current=void 0},$e=function(be){var Ie=be.target,Be=be.key,Se=Ie.selectionStart,ce=Ie.selectionEnd,me=Ie.value;me===void 0&&(me="");var Ue;Be==="ArrowLeft"||Be==="Backspace"?Ue=Math.max(Se-1,0):Be==="ArrowRight"?Ue=Math.min(Se+1,me.length):Be==="Delete"&&(Ue=Se);var de=0;Be==="Delete"&&Se===ce&&(de=1);var Ae=Be==="ArrowLeft"||Be==="ArrowRight";if(Ue===void 0||Se!==ce&&!Ae){x(be),ke(Ie,de);return}var pt=Ue;if(Ae){var zt=Be==="ArrowLeft"?"left":"right";pt=J(me,Ue,zt),pt!==Ue&&be.preventDefault()}else Be==="Delete"&&!E(me[Ue])?pt=J(me,Ue,"right"):Be==="Backspace"&&!E(me[Ue])&&(pt=J(me,Ue,"left"));pt!==Ue&&z(Ie,pt,me),x(be),ke(Ie,de)},yt=function(be){var Ie=be.target,Be=function(){var Se=Ie.selectionStart,ce=Ie.selectionEnd,me=Ie.value;if(me===void 0&&(me=""),Se===ce){var Ue=J(me,Se);Ue!==Se&&z(Ie,Ue,me)}};Be(),requestAnimationFrame(function(){Be()}),b(be),ke(Ie)},Ft=function(be){be.persist&&be.persist();var Ie=be.target,Be=be.currentTarget;M.current=Ie,N.current.focusTimeout=setTimeout(function(){var Se=Ie.selectionStart,ce=Ie.selectionEnd,me=Ie.value;me===void 0&&(me="");var Ue=J(me,Se);Ue!==Se&&!(Se===0&&ce===me.length)&&z(Ie,Ue,me),w(Object.assign(Object.assign({},be),{currentTarget:Be}))},0)},gt=function(be){M.current=null,clearTimeout(N.current.focusTimeout),clearTimeout(N.current.setCaretTimeout),j(be)},Tt=X&&p9()?"numeric":void 0,Nt=Object.assign({inputMode:Tt},P,{type:t,value:O,onChange:_e,onKeyDown:$e,onMouseUp:yt,onFocus:Ft,onBlur:gt});if(n==="text")return o?xn.createElement(xn.Fragment,null,o(O,P)||null):xn.createElement("span",Object.assign({},P,{ref:i}),O);if(r){var Pt=r;return xn.createElement(Pt,Object.assign({},Nt,{ref:i}))}return xn.createElement("input",Object.assign({},Nt,{ref:i}))}function lS(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var i=t.suffix;i===void 0&&(i="");var l=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var d=_p(t),p=d.thousandSeparator,h=d.decimalSeparator,m=n!==0&&e.indexOf(".")!==-1||n&&r,v=Ky(e,l),x=v.beforeDecimal,b=v.afterDecimal,w=v.addNegation;return n!==void 0&&(b=Lk(b,n,!!r)),p&&(x=l9(x,p,u)),o&&(x=o+x),i&&(b=b+i),w&&(x="-"+x),e=x+(m&&h||"")+b,e}function _p(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 w9(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}function S9(e,t){return new RegExp("(^-)|[0-9]|"+Mk(e),"g")}function j9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function C9(e,t,n){var r;t===void 0&&(t=h9(e));var o=n.allowNegative,i=n.prefix;i===void 0&&(i="");var l=n.suffix;l===void 0&&(l="");var u=n.decimalScale,d=t.from,p=t.to,h=p.start,m=p.end,v=_p(n),x=v.allowedDecimalSeparators,b=v.decimalSeparator,w=e[m]===b;if(ou(e)&&(e===i||e===l)&&t.lastValue==="")return e;if(m-h===1&&x.indexOf(e[h])!==-1){var j=u===0?"":b;e=e.substring(0,h)+j+e.substring(h+1,e.length)}var T=function(M,N,F){var I=!1,z=!1;i.startsWith("-")?I=!1:M.startsWith("--")?(I=!1,z=!0):l.startsWith("-")&&M.length===l.length?I=!1:M[0]==="-"&&(I=!0);var J=I?1:0;return z&&(J=2),J&&(M=M.substring(J),N-=J,F-=J),{value:M,start:N,end:F,hasNegation:I}},R=T(e,h,m),E=R.hasNegation;r=R,e=r.value,h=r.start,m=r.end;var C=T(t.lastValue,d.start,d.end),P=C.start,D=C.end,A=C.value,O=e.substring(h,m);e.length&&A.length&&(P>A.length-l.length||D<i.length)&&!(O&&l.startsWith(O))&&(e=A);var L=0;e.startsWith(i)?L+=i.length:h<i.length&&(L=h),e=e.substring(L),m-=L;var V=e.length,q=e.length-l.length;e.endsWith(l)?V=q:(m>q||m>e.length-l.length)&&(V=m),e=e.substring(0,V),e=w9(E?"-"+e:e,o),e=(e.match(S9(b))||[]).join("");var G=e.indexOf(b);e=e.replace(new RegExp(Mk(b),"g"),function(M,N){return N===G?".":""});var Q=Ky(e,o),Y=Q.beforeDecimal,X=Q.afterDecimal,B=Q.addNegation;return p.end-p.start<d.end-d.start&&Y===""&&w&&!parseFloat(X)&&(e=B?"-":""),e}function E9(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),i=e[0]==="-";o.fill(!1,0,n.length+(i?1:0));var l=e.length;return o.fill(!1,l-r.length+1,l+1),o}function k9(e){var t=_p(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var i=e.allowNegative;if(i===void 0&&(i=!0),n===r)throw new Error(`
|
|
84
|
+
Decimal separator can't be same as thousand separator.
|
|
85
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
86
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
87
|
+
`);return o.startsWith("-")&&i&&(console.error(`
|
|
88
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
89
|
+
prefix: `+o+`
|
|
90
|
+
allowNegative: `+i+`
|
|
91
|
+
`),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function T9(e){e=k9(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=fs);var i=e.onBlur;i===void 0&&(i=fs);var l=e.thousandSeparator,u=e.decimalScale,d=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var h=e.defaultValue,m=e.value,v=e.valueIsNumericString,x=e.onValueChange,b=Nk(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),w=_p(e),j=w.decimalSeparator,T=w.allowedDecimalSeparators,R=function(B){return lS(B,e)},E=function(B,M){return C9(B,M,e)},C=jl(m)?h:m,P=v??j9(C,p,t);jl(m)?jl(h)||(P=P||typeof h=="number"):P=P||typeof m=="number";var D=function(B){return Ok(B)?B:(typeof B=="number"&&(B=$k(B)),P&&typeof u=="number"?sS(B,u,!!d):B)},A=zk(D(m),D(h),!!P,R,E,x),O=A[0],L=O.numAsString,V=O.formattedValue,q=A[1],G=function(B){var M=B.target,N=B.key,F=M.selectionStart,I=M.selectionEnd,z=M.value;if(z===void 0&&(z=""),(N==="Backspace"||N==="Delete")&&I<p.length){B.preventDefault();return}if(F!==I){o(B);return}N==="Backspace"&&z[0]==="-"&&F===p.length+1&&n&&Ks(M,1),u&&d&&(N==="Backspace"&&z[F-1]===j?(Ks(M,F-1),B.preventDefault()):N==="Delete"&&z[F]===j&&B.preventDefault()),T!=null&&T.includes(N)&&z[F]===j&&Ks(M,F+1);var J=l===!0?",":l;N==="Backspace"&&z[F-1]===J&&Ks(M,F-1),N==="Delete"&&z[F]===J&&Ks(M,F+1),o(B)},Q=function(B){var M=L;if(M.match(/\d/g)||(M=""),r||(M=u9(M)),d&&u&&(M=sS(M,u,d)),M!==L){var N=lS(M,e);q({formattedValue:N,value:M,floatValue:parseFloat(M)},{event:B,source:ru.event})}i(B)},Y=function(B){return B===j?!0:ou(B)},X=function(B){var M=B.currentValue,N=B.lastValue,F=B.formattedValue,I=B.currentValueIndex,z=B.formattedValueIndex,J=M[I],ae=F[z],je=Fk(N,M),ge=je.to,Ce=function(Re){return E(Re).indexOf(".")+p.length};return m===0&&d&&u&&M[ge.start]===j&&Ce(M)<I&&Ce(F)>z?!1:I>=ge.start&&I<ge.end&&T&&T.includes(J)&&ae===j?!0:J===ae};return Object.assign(Object.assign({},b),{value:V,valueIsNumericString:!1,isValidInputCharacter:Y,isCharacterSame:X,onValueChange:q,format:R,removeFormatting:E,getCaretBoundary:function(B){return E9(B,e)},onKeyDown:G,onBlur:Q})}function P9(e){var t=T9(e);return xn.createElement(b9,Object.assign({},t))}function cS({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 Yg={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const R9=/^(0\.0*|-0(\.0*)?)$/,_9=/^-?0\d+(\.\d+)?\.?$/;function Xg(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function ug(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Xg(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function D9(e){return e.toString().replace(".","").length}function I9(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&D9(t)<14&&t!==""}function uS(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const A9={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},N9=(e,{size:t})=>({controls:{"--ni-chevron-size":ot(t,"ni-chevron-size")}}),Dp=ue((e,t)=>{const n=oe("NumberInput",A9,e),{className:r,classNames:o,styles:i,unstyled:l,vars:u,onChange:d,onValueChange:p,value:h,defaultValue:m,max:v,min:x,step:b,hideControls:w,rightSection:j,isAllowed:T,clampBehavior:R,onBlur:E,allowDecimal:C,decimalScale:P,onKeyDown:D,onKeyDownCapture:A,handlersRef:O,startValue:L,disabled:V,rightSectionPointerEvents:q,allowNegative:G,readOnly:Q,size:Y,rightSectionWidth:X,stepHoldInterval:B,stepHoldDelay:M,allowLeadingZeros:N,withKeyboardEvents:F,trimLeadingZeroesOnBlur:I,...z}=n,J=Le({name:"NumberInput",classes:Yg,props:n,classNames:o,styles:i,unstyled:l,vars:u,varsResolver:N9}),{resolvedClassNames:ae,resolvedStyles:je}=va({classNames:o,styles:i,props:n}),[ge,Ce]=Bn({value:h,defaultValue:m,finalValue:"",onChange:d}),Re=M!==void 0&&B!==void 0,ke=g.useRef(null),_e=g.useRef(null),$e=g.useRef(0),yt=(de,Ae)=>{Ae.source==="event"&&Ce(I9(de.floatValue,de.value)&&!R9.test(de.value)&&!(N&&_9.test(de.value))?de.floatValue:de.value),p==null||p(de,Ae)},Ft=de=>{const Ae=String(de).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ae?Math.max(0,(Ae[1]?Ae[1].length:0)-(Ae[2]?+Ae[2]:0)):0},gt=de=>{ke.current&&typeof de<"u"&&ke.current.setSelectionRange(de,de)},Tt=g.useRef(kf);Tt.current=()=>{if(!ug(ge))return;let de;const Ae=Ft(ge),pt=Ft(b),zt=Math.max(Ae,pt),Qt=10**zt;if(!Xg(ge)&&(typeof ge!="number"||Number.isNaN(ge)))de=Jd(L,x,v);else if(v!==void 0){const Ct=(Math.round(Number(ge)*Qt)+Math.round(b*Qt))/Qt;de=Ct<=v?Ct:v}else de=(Math.round(Number(ge)*Qt)+Math.round(b*Qt))/Qt;const jn=de.toFixed(zt);Ce(parseFloat(jn)),p==null||p({floatValue:parseFloat(jn),formattedValue:jn,value:jn},{source:"increment"}),setTimeout(()=>{var Ct;return gt((Ct=ke.current)==null?void 0:Ct.value.length)},0)};const Nt=g.useRef(kf);Nt.current=()=>{if(!ug(ge))return;let de;const Ae=x!==void 0?x:G?Number.MIN_SAFE_INTEGER:0,pt=Ft(ge),zt=Ft(b),Qt=Math.max(pt,zt),jn=10**Qt;if(!Xg(ge)&&typeof ge!="number"||Number.isNaN(ge))de=Jd(L,Ae,v);else{const bt=(Math.round(Number(ge)*jn)-Math.round(b*jn))/jn;de=Ae!==void 0&&bt<Ae?Ae:bt}const Ct=de.toFixed(Qt);Ce(parseFloat(Ct)),p==null||p({floatValue:parseFloat(Ct),formattedValue:Ct,value:Ct},{source:"decrement"}),setTimeout(()=>{var bt;return gt((bt=ke.current)==null?void 0:bt.value.length)},0)};const Pt=de=>{D==null||D(de),!(Q||!F)&&(de.key==="ArrowUp"&&(de.preventDefault(),Tt.current()),de.key==="ArrowDown"&&(de.preventDefault(),Nt.current()))},be=de=>{if(A==null||A(de),de.key==="Backspace"){const Ae=ke.current;Ae.selectionStart===0&&Ae.selectionStart===Ae.selectionEnd&&(de.preventDefault(),window.setTimeout(()=>gt(0),0))}},Ie=de=>{let Ae=ge;if(R==="blur"&&typeof Ae=="number"&&(Ae=Jd(Ae,x,v)),I&&typeof Ae=="string"&&Ft(Ae)<15){const pt=Ae.toString().replace(/^0+/,""),zt=parseFloat(pt);Ae=Number.isNaN(zt)||zt>Number.MAX_SAFE_INTEGER?pt:Jd(zt,x,v)}ge!==Ae&&Ce(Ae),E==null||E(de)};Zc(O,{increment:Tt.current,decrement:Nt.current});const Be=de=>{de?Tt.current():Nt.current(),$e.current+=1},Se=de=>{if(Be(de),Re){const Ae=typeof B=="number"?B:B($e.current);_e.current=window.setTimeout(()=>Se(de),Ae)}},ce=(de,Ae)=>{var pt;de.preventDefault(),(pt=ke.current)==null||pt.focus(),Be(Ae),Re&&(_e.current=window.setTimeout(()=>Se(Ae),M))},me=()=>{_e.current&&window.clearTimeout(_e.current),_e.current=null,$e.current=0},Ue=s.jsxs("div",{...J("controls"),children:[s.jsx(Qn,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof ge=="number"&&v!==void 0&&ge>=v,mod:{direction:"up"},onMouseDown:de=>de.preventDefault(),onPointerDown:de=>{ce(de,!0)},onPointerUp:me,onPointerLeave:me,children:s.jsx(cS,{direction:"up"})}),s.jsx(Qn,{...J("control"),tabIndex:-1,"aria-hidden":!0,disabled:V||typeof ge=="number"&&x!==void 0&&ge<=x,mod:{direction:"down"},onMouseDown:de=>de.preventDefault(),onPointerDown:de=>{ce(de,!1)},onPointerUp:me,onPointerLeave:me,children:s.jsx(cS,{direction:"down"})})]});return s.jsx(kr,{component:P9,allowNegative:G,className:At(Yg.root,r),size:Y,...z,readOnly:Q,disabled:V,value:ge,getInputRef:An(t,ke),onValueChange:yt,rightSection:w||Q||!ug(ge)?j:j||Ue,classNames:ae,styles:je,unstyled:l,__staticSelector:"NumberInput",decimalScale:C?P:0,onKeyDown:Pt,onKeyDownCapture:be,rightSectionPointerEvents:q??(V?"none":void 0),rightSectionWidth:X??`var(--ni-right-section-width-${Y||"sm"})`,allowLeadingZeros:N,onBlur:Ie,isAllowed:de=>R==="strict"?T?T(de)&&uS(de.floatValue,x,v):uS(de.floatValue,x,v):T?T(de):!0})});Dp.classes={...kr.classes,...Yg};Dp.displayName="@mantine/core/NumberInput";const[O9,Ip]=dr("Pagination.Root component was not found in tree");var ju={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const M9={withPadding:!0},Cu=ue((e,t)=>{const n=oe("PaginationControl",M9,e),{classNames:r,className:o,style:i,styles:l,vars:u,active:d,disabled:p,withPadding:h,mod:m,...v}=n,x=Ip(),b=p||x.disabled;return s.jsx(Qn,{ref:t,disabled:b,mod:[{active:d,disabled:b,"with-padding":h},m],...x.getStyles("control",{className:o,style:i,classNames:r,styles:l,active:!b}),...v})});Cu.classes=ju;Cu.displayName="@mantine/core/PaginationControl";function Eu({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 L9=e=>s.jsx(Eu,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),$9=e=>s.jsx(Eu,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),F9=e=>s.jsx(Eu,{...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"}),z9=e=>s.jsx(Eu,{...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"}),V9=e=>s.jsx(Eu,{...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"}),B9={icon:V9},Ap=ue((e,t)=>{const n=oe("PaginationDots",B9,e),{classNames:r,className:o,style:i,styles:l,vars:u,icon:d,...p}=n,h=Ip(),m=d;return s.jsx(se,{ref:t,...h.getStyles("dots",{className:o,style:i,styles:l,classNames:r}),...p,children:s.jsx(m,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Ap.classes=ju;Ap.displayName="@mantine/core/PaginationDots";function Np({icon:e,name:t,action:n,type:r}){const o={icon:e},i=g.forwardRef((l,u)=>{const{icon:d,...p}=oe(t,o,l),h=d,m=Ip(),v=r==="next"?m.active===m.total:m.active===1;return s.jsx(Cu,{disabled:m.disabled||v,ref:u,onClick:m[n],withPadding:!1,...p,children:s.jsx(h,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return i.displayName=`@mantine/core/${t}`,i}const Vk=Np({icon:L9,name:"PaginationNext",action:"onNext",type:"next"}),Bk=Np({icon:$9,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),Uk=Np({icon:F9,name:"PaginationFirst",action:"onFirst",type:"previous"}),Wk=Np({icon:z9,name:"PaginationLast",action:"onLast",type:"next"});function Yy({dotsIcon:e}){const t=Ip(),n=t.range.map((r,o)=>{var i,l,u;return r==="dots"?s.jsx(Ap,{icon:e},o):s.jsx(Cu,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(i=t.getItemProps)==null?void 0:i.call(t,r),children:((u=(l=t.getItemProps)==null?void 0:l.call(t,r))==null?void 0:u.children)??r},o)});return s.jsx(s.Fragment,{children:n})}Yy.displayName="@mantine/core/PaginationItems";const U9={siblings:1,boundaries:1},W9=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Mt(n),"--pagination-control-size":ot(t,"pagination-control-size"),"--pagination-control-fz":_n(t),"--pagination-active-bg":r?Lt(r,e):void 0,"--pagination-active-color":ya(o,e)?Di({color:r,theme:e,autoContrast:o}):void 0}}),Op=ue((e,t)=>{const n=oe("PaginationRoot",U9,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,total:p,value:h,defaultValue:m,onChange:v,disabled:x,siblings:b,boundaries:w,color:j,radius:T,onNextPage:R,onPreviousPage:E,onFirstPage:C,onLastPage:P,getItemProps:D,autoContrast:A,...O}=n,L=Le({name:"Pagination",classes:ju,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:W9}),{range:V,setPage:q,next:G,previous:Q,active:Y,first:X,last:B}=uI({page:h,initialPage:m,onChange:v,total:p,siblings:b,boundaries:w}),M=wr(R,G),N=wr(E,Q),F=wr(C,X),I=wr(P,B);return s.jsx(O9,{value:{total:p,range:V,active:Y,disabled:x,getItemProps:D,onChange:q,onNext:M,onPrevious:N,onFirst:F,onLast:I,getStyles:L},children:s.jsx(se,{ref:t,...L("root"),...O})})});Op.classes=ju;Op.displayName="@mantine/core/PaginationRoot";const H9={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},_o=ue((e,t)=>{const n=oe("Pagination",H9,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:l,previousIcon:u,lastIcon:d,firstIcon:p,dotsIcon:h,total:m,gap:v,hideWithOnePage:x,withPages:b,...w}=n;return m<=0||x&&m===1?null:s.jsx(Op,{ref:t,total:m,...w,children:s.jsxs(xe,{gap:v,children:[r&&s.jsx(Uk,{icon:p,...i==null?void 0:i("first")}),o&&s.jsx(Bk,{icon:u,...i==null?void 0:i("previous")}),b&&s.jsx(Yy,{dotsIcon:h}),o&&s.jsx(Vk,{icon:l,...i==null?void 0:i("next")}),r&&s.jsx(Wk,{icon:d,...i==null?void 0:i("last")})]})})});_o.classes=ju;_o.displayName="@mantine/core/Pagination";_o.Root=Op;_o.Control=Cu;_o.Dots=Ap;_o.First=Uk;_o.Last=Wk;_o.Next=Vk;_o.Previous=Bk;_o.Items=Yy;const q9=({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 Jg={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const G9={visibilityToggleIcon:q9},Q9=(e,{size:t})=>({root:{"--psi-icon-size":ot(t,"psi-icon-size"),"--psi-button-size":ot(t,"psi-button-size")}}),Eo=ue((e,t)=>{const n=oe("PasswordInput",G9,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,required:p,error:h,leftSection:m,disabled:v,id:x,variant:b,inputContainer:w,description:j,label:T,size:R,errorProps:E,descriptionProps:C,labelProps:P,withAsterisk:D,inputWrapperOrder:A,wrapperProps:O,radius:L,rightSection:V,rightSectionWidth:q,rightSectionPointerEvents:G,leftSectionWidth:Q,visible:Y,defaultVisible:X,onVisibilityChange:B,visibilityToggleIcon:M,visibilityToggleButtonProps:N,rightSectionProps:F,leftSectionProps:I,leftSectionPointerEvents:z,withErrorStyles:J,mod:ae,...je}=n,ge=fr(x),[Ce,Re]=Bn({value:Y,defaultValue:X,finalValue:!1,onChange:B}),ke=()=>Re(!Ce),_e=Le({name:"PasswordInput",classes:Jg,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:Q9}),{resolvedClassNames:$e,resolvedStyles:yt}=va({classNames:r,styles:l,props:n}),{styleProps:Ft,rest:gt}=Ii(je),Tt=M,Nt=s.jsx(En,{..._e("visibilityToggle"),disabled:v,radius:L,"aria-hidden":!N,tabIndex:-1,...N,variant:(N==null?void 0:N.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:Pt=>{var be;Pt.preventDefault(),(be=N==null?void 0:N.onTouchEnd)==null||be.call(N,Pt),ke()},onMouseDown:Pt=>{var be;Pt.preventDefault(),(be=N==null?void 0:N.onMouseDown)==null||be.call(N,Pt),ke()},onKeyDown:Pt=>{var be;(be=N==null?void 0:N.onKeyDown)==null||be.call(N,Pt),Pt.key===" "&&(Pt.preventDefault(),ke())},children:s.jsx(Tt,{reveal:Ce})});return s.jsx(sn.Wrapper,{required:p,id:ge,label:T,error:h,description:j,size:R,classNames:$e,styles:yt,__staticSelector:"PasswordInput",errorProps:E,descriptionProps:C,unstyled:u,withAsterisk:D,inputWrapperOrder:A,inputContainer:w,variant:b,labelProps:{...P,htmlFor:ge},mod:ae,..._e("root"),...Ft,...O,children:s.jsx(sn,{component:"div",error:h,leftSection:m,size:R,classNames:{...$e,input:At(Jg.input,$e.input)},styles:yt,radius:L,disabled:v,__staticSelector:"PasswordInput",rightSectionWidth:q,rightSection:V??Nt,variant:b,unstyled:u,leftSectionWidth:Q,rightSectionPointerEvents:G||"all",rightSectionProps:F,leftSectionProps:I,leftSectionPointerEvents:z,withAria:!1,withErrorStyles:J,children:s.jsx("input",{required:p,"data-invalid":!!h||void 0,"data-with-left-section":!!m||void 0,..._e("innerInput"),disabled:v,id:ge,ref:t,...gt,autoComplete:gt.autoComplete||"off",type:Ce?"text":"password"})})})});Eo.classes={...kr.classes,...Jg};Eo.displayName="@mantine/core/PasswordInput";const[K9,Hk]=Ri(),[Y9,X9]=Ri();var qk={card:"m_9dc8ae12"};const J9={withBorder:!0},Z9=(e,{radius:t})=>({card:{"--card-radius":Mt(t)}}),Xy=ue((e,t)=>{const n=oe("RadioCard",J9,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,checked:p,mod:h,withBorder:m,value:v,onClick:x,name:b,onKeyDown:w,...j}=n,T=Le({name:"RadioCard",classes:qk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:Z9,rootSelector:"card"}),{dir:R}=ba(),E=Hk(),C=typeof p=="boolean"?p:(E==null?void 0:E.value)===v||!1,P=b||(E==null?void 0:E.name),D=A=>{if(w==null||w(A),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(A.nativeEvent.code)){A.preventDefault();const O=Array.from(document.querySelectorAll(`[role="radio"][name="${P||"__mantine"}"]`)),L=O.findIndex(G=>G===A.target),V=L+1>=O.length?0:L+1,q=L-1<0?O.length-1:L-1;A.nativeEvent.code==="ArrowDown"&&(O[V].focus(),O[V].click()),A.nativeEvent.code==="ArrowUp"&&(O[q].focus(),O[q].click()),A.nativeEvent.code==="ArrowLeft"&&(O[R==="ltr"?q:V].focus(),O[R==="ltr"?q:V].click()),A.nativeEvent.code==="ArrowRight"&&(O[R==="ltr"?V:q].focus(),O[R==="ltr"?V:q].click())}};return s.jsx(Y9,{value:{checked:C},children:s.jsx(Qn,{ref:t,mod:[{"with-border":m,checked:C},h],...T("card"),...j,role:"radio","aria-checked":C,name:P,onClick:A=>{x==null||x(A),E==null||E.onChange(v||"")},onKeyDown:D})})});Xy.displayName="@mantine/core/RadioCard";Xy.classes=qk;const eL={},Jy=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:l,children:u,name:d,readOnly:p,...h}=oe("RadioGroup",eL,e),m=fr(d),[v,x]=Bn({value:n,defaultValue:r,finalValue:"",onChange:o}),b=w=>!p&&x(typeof w=="string"?w:w.currentTarget.value);return s.jsx(K9,{value:{value:v,onChange:b,size:i,name:m},children:s.jsx(sn.Wrapper,{size:i,ref:t,...l,...h,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(Cy,{role:"radiogroup",children:u})})})});Jy.classes=sn.Wrapper.classes;Jy.displayName="@mantine/core/RadioGroup";function Gk({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:ie(e),height:ie(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var Qk={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const tL={icon:Gk},nL=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:l})=>{const u=ro({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":ot(r,"radio-size"),"--radio-radius":t===void 0?void 0:Mt(t),"--radio-color":i==="outline"?d:Lt(n,e),"--radio-icon-size":ot(r,"radio-icon-size"),"--radio-icon-color":o?Lt(o,e):ya(l,e)?Di({color:n,theme:e,autoContrast:l}):void 0}}},Zy=ue((e,t)=>{const n=oe("RadioIndicator",tL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,icon:p,radius:h,color:m,iconColor:v,autoContrast:x,checked:b,mod:w,variant:j,disabled:T,...R}=n,E=p,C=Le({name:"RadioIndicator",classes:Qk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:nL,rootSelector:"indicator"}),P=X9(),D=typeof b=="boolean"?b:(P==null?void 0:P.checked)||!1;return s.jsx(se,{ref:t,...C("indicator",{variant:j}),variant:j,mod:[{checked:D,disabled:T},w],...R,children:s.jsx(E,{...C("icon")})})});Zy.displayName="@mantine/core/RadioIndicator";Zy.classes=Qk;var Kk={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const rL={labelPosition:"right"},oL=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:l})=>{const u=ro({color:r||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":ot(t,"radio-size"),"--radio-radius":n===void 0?void 0:Mt(n),"--radio-color":i==="outline"?d:Lt(r,e),"--radio-icon-color":o?Lt(o,e):ya(l,e)?Di({color:r,theme:e,autoContrast:l}):void 0,"--radio-icon-size":ot(t,"radio-icon-size")}}},la=ue((e,t)=>{const n=oe("Radio",rL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,id:p,size:h,label:m,labelPosition:v,description:x,error:b,radius:w,color:j,variant:T,disabled:R,wrapperProps:E,icon:C=Gk,rootRef:P,iconColor:D,onChange:A,mod:O,...L}=n,V=Le({name:"Radio",classes:Kk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:oL}),q=Hk(),G=(q==null?void 0:q.size)??h,Q=n.size?h:G,{styleProps:Y,rest:X}=Ii(L),B=fr(p),M=q?{checked:q.value===X.value,name:X.name??q.name,onChange:N=>{q.onChange(N),A==null||A(N)}}:{};return s.jsx(yp,{...V("root"),__staticSelector:"Radio",__stylesApiProps:n,id:B,size:Q,labelPosition:v,label:m,description:x,error:b,disabled:R,classNames:r,styles:l,unstyled:u,"data-checked":M.checked||void 0,variant:T,ref:P,mod:O,...Y,...E,children:s.jsxs(se,{...V("inner"),mod:{"label-position":v},children:[s.jsx(se,{...V("radio",{focusable:!0,variant:T}),onChange:A,...X,...M,component:"input",mod:{error:!!b},ref:t,id:B,disabled:R,type:"radio"}),s.jsx(C,{...V("icon"),"aria-hidden":!0})]})})});la.classes=Kk;la.displayName="@mantine/core/Radio";la.Group=Jy;la.Card=Xy;la.Indicator=Zy;const iL={duration:100,transition:"fade"};function sL(e,t){return{...iL,...t,...e}}function aL({offset:e,position:t,defaultOpened:n}){const[r,o]=g.useState(n),i=g.useRef(null),{x:l,y:u,elements:d,refs:p,update:h,placement:m}=Xv({placement:t,middleware:[Gv({crossAxis:!0,padding:5,rootBoundary:"document"})]}),v=m.includes("right")?e:t.includes("left")?e*-1:0,x=m.includes("bottom")?e:t.includes("top")?e*-1:0,b=g.useCallback(({clientX:w,clientY:j})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:w,y:j,left:w+v,top:j+x,right:w,bottom:j}}})},[d.reference]);return g.useEffect(()=>{if(p.floating.current){const w=i.current;w.addEventListener("mousemove",b);const j=xi(p.floating.current);return j.forEach(T=>{T.addEventListener("scroll",h)}),()=>{w.removeEventListener("mousemove",b),j.forEach(T=>{T.removeEventListener("scroll",h)})}}},[d.reference,p.floating.current,h,b,r]),{handleMouseMove:b,x:l,y:u,opened:r,setOpened:o,boundaryRef:i,floating:p.setFloating}}var Mp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const lL={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Br("popover")},cL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Mt(t),"--tooltip-bg":n?Lt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),ex=ue((e,t)=>{const n=oe("TooltipFloating",lL,e),{children:r,refProp:o,withinPortal:i,style:l,className:u,classNames:d,styles:p,unstyled:h,radius:m,color:v,label:x,offset:b,position:w,multiline:j,zIndex:T,disabled:R,defaultOpened:E,variant:C,vars:P,portalProps:D,...A}=n,O=mn(),L=Le({name:"TooltipFloating",props:n,classes:Mp,className:u,style:l,classNames:d,styles:p,unstyled:h,rootSelector:"tooltip",vars:P,varsResolver:cL}),{handleMouseMove:V,x:q,y:G,opened:Q,boundaryRef:Y,floating:X,setOpened:B}=aL({offset:b,position:w,defaultOpened:E});if(!Pi(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const M=An(Y,op(r),t),N=r.props,F=z=>{var J;(J=N.onMouseEnter)==null||J.call(N,z),V(z),B(!0)},I=z=>{var J;(J=N.onMouseLeave)==null||J.call(N,z),B(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(ws,{...D,withinPortal:i,children:s.jsx(se,{...A,...L("tooltip",{style:{...VC(l,O),zIndex:T,display:!R&&Q?"block":"none",top:(G&&Math.round(G))??"",left:(q&&Math.round(q))??""}}),variant:C,ref:X,mod:{multiline:j},children:x})}),g.cloneElement(r,{...N,[o]:M,onMouseEnter:F,onMouseLeave:I})]})});ex.classes=Mp;ex.displayName="@mantine/core/TooltipFloating";const Yk=g.createContext(!1),uL=Yk.Provider,dL=()=>g.useContext(Yk),fL={openDelay:0,closeDelay:0};function tx(e){const{openDelay:t,closeDelay:n,children:r}=oe("TooltipGroup",fL,e);return s.jsx(uL,{value:!0,children:s.jsx(BN,{delay:{open:t,close:n},children:r})})}tx.displayName="@mantine/core/TooltipGroup";tx.extend=e=>e;function pL(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 hL(e){const t=pL(e.middlewares),n=[iE(e.offset)];return t.shift&&n.push(Gv(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?If():If(t.flip)),n.push(sE({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?Kc():Kc(t.inline)):e.inline&&n.push(Kc()),n}function mL(e){var D,A,O;const[t,n]=g.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,i=dL(),l=fr(),u=g.useCallback(L=>{n(L),L&&R(l)},[l]),{x:d,y:p,context:h,refs:m,update:v,placement:x,middlewareData:{arrow:{x:b,y:w}={}}}=Xv({strategy:e.strategy,placement:e.position,open:o,onOpenChange:u,middleware:hL(e)}),{delay:j,currentId:T,setCurrentId:R}=UN(h,{id:l}),{getReferenceProps:E,getFloatingProps:C}=YN([zN(h,{enabled:(D=e.events)==null?void 0:D.hover,delay:i?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((A=e.events)!=null&&A.touch)}),KN(h,{enabled:(O=e.events)==null?void 0:O.focus,visibleOnly:!0}),JN(h,{role:"tooltip"}),GN(h,{enabled:typeof e.opened>"u"})]);IE({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:m,update:v}}),wi(()=>{var L;(L=e.onPositionChange)==null||L.call(e,x)},[x]);const P=o&&T&&T!==l;return{x:d,y:p,arrowX:b,arrowY:w,reference:m.setReference,floating:m.setFloating,getFloatingProps:C,getReferenceProps:E,isGroupPhase:P,opened:o,placement:x}}const dS={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:Br("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},gL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Mt(t),"--tooltip-bg":n?Lt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Sa=ue((e,t)=>{const n=oe("Tooltip",dS,e),{children:r,position:o,refProp:i,label:l,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,defaultOpened:m,withinPortal:v,radius:x,color:b,classNames:w,styles:j,unstyled:T,style:R,className:E,withArrow:C,arrowSize:P,arrowOffset:D,arrowRadius:A,arrowPosition:O,offset:L,transitionProps:V,multiline:q,events:G,zIndex:Q,disabled:Y,positionDependencies:X,onClick:B,onMouseEnter:M,onMouseLeave:N,inline:F,variant:I,keepMounted:z,vars:J,portalProps:ae,mod:je,floatingStrategy:ge,middlewares:Ce,...Re}=oe("Tooltip",dS,n),{dir:ke}=ba(),_e=g.useRef(null),$e=mL({position:EE(ke,o),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,defaultOpened:m,events:G,arrowRef:_e,arrowOffset:D,offset:typeof L=="number"?L+(C?P/2:0):L,positionDependencies:[...X,r],inline:F,strategy:ge,middlewares:Ce}),yt=Le({name:"Tooltip",props:n,classes:Mp,className:E,style:R,classNames:w,styles:j,unstyled:T,rootSelector:"tooltip",vars:J,varsResolver:gL});if(!Pi(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 Ft=An($e.reference,op(r),t),gt=sL(V,{duration:100,transition:"fade"}),Tt=r.props;return s.jsxs(s.Fragment,{children:[s.jsx(ws,{...ae,withinPortal:v,children:s.jsx(ti,{...gt,keepMounted:z,mounted:!Y&&!!$e.opened,duration:$e.isGroupPhase?10:gt.duration,children:Nt=>s.jsxs(se,{...Re,"data-fixed":ge==="fixed"||void 0,variant:I,mod:[{multiline:q},je],...$e.getFloatingProps({ref:$e.floating,className:yt("tooltip").className,style:{...yt("tooltip").style,...Nt,zIndex:Q,top:$e.y??0,left:$e.x??0}}),children:[l,s.jsx(ty,{ref:_e,arrowX:$e.arrowX,arrowY:$e.arrowY,visible:C,position:$e.placement,arrowSize:P,arrowOffset:D,arrowRadius:A,arrowPosition:O,...yt("arrow")})]})})}),g.cloneElement(r,$e.getReferenceProps({onClick:B,onMouseEnter:M,onMouseLeave:N,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:At(E,Tt.className),...Tt,[i]:Ft}))]})});Sa.classes=Mp;Sa.displayName="@mantine/core/Tooltip";Sa.Floating=ex;Sa.Group=tx;function vL({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const l=(e*.9-t*2)/2,u=Math.PI*l*2/100,d=o||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:l||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:d,strokeDashoffset:o?0:i||0}}function Xk({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:l,lineRoundCaps:u,tooltip:d,getStyles:p,display:h,...m}){const v=mn();return s.jsx(Sa.Floating,{disabled:!d,label:d,children:s.jsx(se,{component:"circle",...m,...p("curve"),__vars:{"--curve-color":l?Lt(l,v):void 0},fill:"none",strokeLinecap:u?"round":"butt",...vL({sum:r,size:e,thickness:o,value:t,offset:n,root:i})})})}Xk.displayName="@mantine/core/Curve";function yL({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((h,m)=>h+m.value,0),l=Math.PI*((e*.9-t*2)/2)*2;let u=l;const d=[],p=[];for(let h=0;h<n.length;h+=1)d.push({sum:i,offset:u,data:n[h],root:!1}),u-=n[h].value/100*l;if(d.push({sum:i,offset:u,data:{color:o},root:!0}),p.push({...d[d.length-1],lineRoundCaps:!1}),d.length>2){p.push({...d[0],lineRoundCaps:r}),p.push({...d[d.length-2],lineRoundCaps:r});for(let h=1;h<=d.length-3;h+=1)p.push({...d[h],lineRoundCaps:!1})}else p.push({...d[0],lineRoundCaps:r});return p}var Jk={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function xL(e,t){return Math.min(e||12,(t||120)/4)}const bL={size:120,thickness:12},wL=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":ie(t),"--rp-label-offset":ie(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Lp=ue((e,t)=>{const n=oe("RingProgress",bL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,label:p,sections:h,size:m,thickness:v,roundCaps:x,rootColor:b,transitionDuration:w,...j}=n,T=Le({name:"RingProgress",classes:Jk,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:wL}),R=xL(v,m),E=yL({size:m,thickness:R,sections:h,renderRoundedLineCaps:x,rootColor:b}).map(({data:C,sum:P,root:D,lineRoundCaps:A,offset:O},L)=>g.createElement(Xk,{...C,key:L,size:m,thickness:R,sum:P,offset:O,color:C==null?void 0:C.color,root:D,lineRoundCaps:A,getStyles:T}));return s.jsxs(se,{...T("root"),size:m,ref:t,...j,children:[s.jsx("svg",{...T("svg"),children:E}),p&&s.jsx("div",{...T("label"),children:p})]})});Lp.classes=Jk;Lp.displayName="@mantine/core/RingProgress";var Zk={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const SL={withItemsBorders:!0},jL=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:Mt(t),"--sc-color":n?Lt(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":i,"--sc-padding":ot(o,"sc-padding"),"--sc-font-size":_n(o)}}),$p=ue((e,t)=>{var ke,_e;const n=oe("SegmentedControl",SL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,data:p,value:h,defaultValue:m,onChange:v,size:x,name:b,disabled:w,readOnly:j,fullWidth:T,orientation:R,radius:E,color:C,transitionDuration:P,transitionTimingFunction:D,variant:A,autoContrast:O,withItemsBorders:L,mod:V,...q}=n,G=Le({name:"SegmentedControl",props:n,classes:Zk,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:jL}),Q=mn(),Y=p.map($e=>typeof $e=="string"?{label:$e,value:$e}:$e),X=gI(),[B,M]=g.useState(Tf()),[N,F]=g.useState(null),[I,z]=g.useState({}),J=($e,yt)=>{I[yt]=$e,z(I)},[ae,je]=Bn({value:h,defaultValue:m,finalValue:Array.isArray(p)?((ke=Y.find($e=>!$e.disabled))==null?void 0:ke.value)??((_e=p[0])==null?void 0:_e.value)??null:null,onChange:v}),ge=fr(b),Ce=Y.map($e=>g.createElement(se,{...G("control"),mod:{active:ae===$e.value,orientation:R},key:$e.value},g.createElement("input",{...G("input"),disabled:w||$e.disabled,type:"radio",name:ge,value:$e.value,id:`${ge}-${$e.value}`,checked:ae===$e.value,onChange:()=>!j&&je($e.value),"data-focus-ring":Q.focusRing,key:`${$e.value}-input`}),g.createElement(se,{component:"label",...G("label"),mod:{active:ae===$e.value&&!(w||$e.disabled),disabled:w||$e.disabled,"read-only":j},htmlFor:`${ge}-${$e.value}`,ref:yt=>J(yt,$e.value),__vars:{"--sc-label-color":C!==void 0?Di({color:C,theme:Q,autoContrast:O}):void 0},key:`${$e.value}-label`},s.jsx("span",{...G("innerLabel"),children:$e.label})))),Re=An(t,$e=>F($e));return pI(()=>{M(Tf())},[p]),p.length===0?null:s.jsxs(se,{...G("root"),variant:A,size:x,ref:Re,mod:[{"full-width":T,orientation:R,initialized:X,"with-items-borders":L},V],...q,role:"radiogroup","data-disabled":w,children:[typeof ae=="string"&&s.jsx(ay,{target:I[ae],parent:N,component:"span",transitionDuration:"var(--sc-transition-duration)",...G("indicator")},B),Ce]})});$p.classes=Zk;$p.displayName="@mantine/core/SegmentedControl";function CL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var h;const o=mn(),i=t===void 0?e:t,l=bs({"--sg-spacing-x":Rn(jo(e)),"--sg-spacing-y":Rn(jo(i)),"--sg-cols":(h=jo(n))==null?void 0:h.toString()}),u=Xt(o.breakpoints).reduce((m,v)=>(m[v]||(m[v]={}),typeof e=="object"&&e[v]!==void 0&&(m[v]["--sg-spacing-x"]=Rn(e[v])),typeof i=="object"&&i[v]!==void 0&&(m[v]["--sg-spacing-y"]=Rn(i[v])),typeof n=="object"&&n[v]!==void 0&&(m[v]["--sg-cols"]=n[v]),m),{}),p=Jc(Xt(u),o.breakpoints).filter(m=>Xt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return s.jsx(xa,{styles:l,media:p,selector:r})}function dg(e){return typeof e=="object"&&e!==null?Xt(e):[]}function EL(e){return e.sort((t,n)=>Xc(t)-Xc(n))}function kL({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...dg(e),...dg(t),...dg(n)]));return EL(r)}function TL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const o=t===void 0?e:t,i=bs({"--sg-spacing-x":Rn(jo(e)),"--sg-spacing-y":Rn(jo(o)),"--sg-cols":(p=jo(n))==null?void 0:p.toString()}),l=kL({spacing:e,verticalSpacing:t,cols:n}),u=l.reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--sg-spacing-x"]=Rn(e[m])),typeof o=="object"&&o[m]!==void 0&&(h[m]["--sg-spacing-y"]=Rn(o[m])),typeof n=="object"&&n[m]!==void 0&&(h[m]["--sg-cols"]=n[m]),h),{}),d=l.map(h=>({query:`simple-grid (min-width: ${h})`,styles:u[h]}));return s.jsx(xa,{styles:i,container:d,selector:r})}var eT={container:"m_925c2d2c",root:"m_2415a157"};const PL={cols:1,spacing:"md",type:"media"},nx=ue((e,t)=>{const n=oe("SimpleGrid",PL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,cols:p,verticalSpacing:h,spacing:m,type:v,...x}=n,b=Le({name:"SimpleGrid",classes:eT,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d}),w=hu();return v==="container"?s.jsxs(s.Fragment,{children:[s.jsx(TL,{...n,selector:`.${w}`}),s.jsx("div",{...b("container"),children:s.jsx(se,{ref:t,...b("root",{className:w}),...x})})]}):s.jsxs(s.Fragment,{children:[s.jsx(CL,{...n,selector:`.${w}`}),s.jsx(se,{ref:t,...b("root",{className:w}),...x})]})});nx.classes=eT;nx.displayName="@mantine/core/SimpleGrid";const RL={},Fp=ue((e,t)=>{const{w:n,h:r,miw:o,mih:i,...l}=oe("Space",RL,e);return s.jsx(se,{ref:t,...l,w:n,miw:o??n,h:r,mih:i??r})});Fp.displayName="@mantine/core/Space";var tT={root:"m_6d731127"};const _L={gap:"md",align:"stretch",justify:"flex-start"},DL=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Rn(t),"--stack-align":n,"--stack-justify":r}}),et=ue((e,t)=>{const n=oe("Stack",_L,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,align:p,justify:h,gap:m,variant:v,...x}=n,b=Le({name:"Stack",props:n,classes:tT,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:DL});return s.jsx(se,{ref:t,...b("root"),variant:v,...x})});et.classes=tT;et.displayName="@mantine/core/Stack";const[IL,AL]=dr("Stepper component was not found in tree"),Nf=()=>null;Nf.displayName="@mantine/core/StepperCompleted";var rx={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 of=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,NL={withIcon:!0,allowStepClick:!0,iconPosition:"left"},ox=ue((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:l,step:u,state:d,color:p,icon:h,completedIcon:m,progressIcon:v,label:x,description:b,withIcon:w,iconSize:j,loading:T,allowStepClick:R,allowStepSelect:E,iconPosition:C,orientation:P,mod:D,...A}=oe("StepperStep",NL,e),O=AL(),L=mn(),V={classNames:n,styles:i},q=d==="stepCompleted"?null:d==="stepProgress"?v:h,G={"data-progress":d==="stepProgress"||void 0,"data-completed":d==="stepCompleted"||void 0};return s.jsxs(Qn,{...O.getStyles("step",{className:r,style:o,variant:O.orientation,...V}),mod:[{"icon-position":C||O.iconPosition,"allow-click":R},D],ref:t,...G,...A,__vars:{"--step-color":p?Lt(p,L):void 0},tabIndex:R?0:-1,children:[w&&s.jsxs("span",{...O.getStyles("stepWrapper",V),children:[s.jsxs("span",{...O.getStyles("stepIcon",V),...G,children:[s.jsx(ti,{mounted:d==="stepCompleted",transition:"pop",duration:200,children:Q=>s.jsx("span",{...O.getStyles("stepCompletedIcon",{style:Q,...V}),children:T?s.jsx(Cr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...O.getStyles("stepLoader",V)}):of(m,u)||s.jsx(xp,{size:"60%"})})}),d!=="stepCompleted"?T?s.jsx(Cr,{...O.getStyles("stepLoader",V),size:"calc(var(--stepper-icon-size) / 2)",color:p}):of(q||h,u):null]}),P==="vertical"&&s.jsx("span",{...O.getStyles("verticalSeparator",V),"data-active":d==="stepCompleted"||void 0})]}),(x||b)&&s.jsxs("span",{...O.getStyles("stepBody",V),"data-orientation":O.orientation,"data-icon-position":C||O.iconPosition,children:[x&&s.jsx("span",{...O.getStyles("stepLabel",V),children:of(x,u)}),b&&s.jsx("span",{...O.getStyles("stepDescription",V),children:of(b,u)})]})]})});ox.classes=rx;ox.displayName="@mantine/core/StepperStep";const OL={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},ML=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:l})=>({root:{"--stepper-color":t?Lt(t,e):void 0,"--stepper-icon-color":ya(l,e)?Di({color:t,theme:e,autoContrast:l}):void 0,"--stepper-icon-size":n===void 0?ot(r,"stepper-icon-size"):ie(n),"--stepper-content-padding":Rn(o),"--stepper-radius":i===void 0?void 0:Mt(i),"--stepper-fz":_n(r),"--stepper-spacing":Rn(r)}}),Al=ue((e,t)=>{var N,F,I;const n=oe("Stepper",OL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,children:p,onStepClick:h,active:m,icon:v,completedIcon:x,progressIcon:b,color:w,iconSize:j,contentPadding:T,orientation:R,iconPosition:E,size:C,radius:P,allowNextStepsSelect:D,wrap:A,autoContrast:O,...L}=n,V=Le({name:"Stepper",classes:rx,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:ML}),q=g.Children.toArray(p),G=q.filter(z=>z.type!==Nf),Q=q.find(z=>z.type===Nf),Y=G.reduce((z,J,ae)=>{const je=m===ae?"stepProgress":m>ae?"stepCompleted":"stepInactive",Ce=typeof h!="function"?!1:typeof J.props.allowStepSelect=="boolean"?J.props.allowStepSelect:je==="stepCompleted"||D;return z.push(g.cloneElement(J,{icon:J.props.icon||v||ae+1,key:ae,step:ae,state:je,onClick:()=>Ce&&(h==null?void 0:h(ae)),allowStepClick:Ce,completedIcon:J.props.completedIcon||x,progressIcon:J.props.progressIcon||b,color:J.props.color||w,iconSize:j,iconPosition:J.props.iconPosition||E,orientation:R})),R==="horizontal"&&ae!==G.length-1&&z.push(g.createElement("div",{...V("separator"),"data-active":ae<m||void 0,"data-orientation":R,key:`separator-${ae}`})),z},[]),X=(F=(N=G[m])==null?void 0:N.props)==null?void 0:F.children,B=(I=Q==null?void 0:Q.props)==null?void 0:I.children,M=m>G.length-1?B:X;return s.jsx(IL,{value:{getStyles:V,orientation:R,iconPosition:E},children:s.jsxs(se,{...V("root"),ref:t,size:C,...L,children:[s.jsx(se,{...V("steps"),mod:{orientation:R,"icon-position":E,wrap:A&&R!=="vertical"},children:Y}),M&&s.jsx("div",{...V("content"),children:M})]})})});Al.classes=rx;Al.displayName="@mantine/core/Stepper";Al.Completed=Nf;Al.Step=ox;const nT=g.createContext(null),LL=nT.Provider,$L=()=>g.useContext(nT),FL={},ix=ue((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:l,children:u,readOnly:d,...p}=oe("SwitchGroup",FL,e),[h,m]=Bn({value:n,defaultValue:r,finalValue:[],onChange:o}),v=x=>{const b=x.currentTarget.value;!d&&m(h.includes(b)?h.filter(w=>w!==b):[...h,b])};return s.jsx(LL,{value:{value:h,onChange:v,size:i},children:s.jsx(sn.Wrapper,{size:i,ref:t,...l,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(Cy,{role:"group",children:u})})})});ix.classes=sn.Wrapper.classes;ix.displayName="@mantine/core/SwitchGroup";var rT={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const zL={labelPosition:"right"},VL=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Mt(t),"--switch-height":ot(r,"switch-height"),"--switch-width":ot(r,"switch-width"),"--switch-thumb-size":ot(r,"switch-thumb-size"),"--switch-label-font-size":ot(r,"switch-label-font-size"),"--switch-track-label-padding":ot(r,"switch-track-label-padding"),"--switch-color":n?Lt(n,e):void 0}}),ku=ue((e,t)=>{const n=oe("Switch",zL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,color:p,label:h,offLabel:m,onLabel:v,id:x,size:b,radius:w,wrapperProps:j,thumbIcon:T,checked:R,defaultChecked:E,onChange:C,labelPosition:P,description:D,error:A,disabled:O,variant:L,rootRef:V,mod:q,...G}=n,Q=$L(),Y=b||(Q==null?void 0:Q.size),X=Le({name:"Switch",props:n,classes:rT,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:VL}),{styleProps:B,rest:M}=Ii(G),N=fr(x),F=Q?{checked:Q.value.includes(M.value),onChange:Q.onChange}:{},[I,z]=Bn({value:F.checked??R,defaultValue:E,finalValue:!1});return s.jsxs(yp,{...X("root"),__staticSelector:"Switch",__stylesApiProps:n,id:N,size:Y,labelPosition:P,label:h,description:D,error:A,disabled:O,bodyElement:"label",labelElement:"span",classNames:r,styles:l,unstyled:u,"data-checked":F.checked||R||void 0,variant:L,ref:V,mod:q,...B,...j,children:[s.jsx("input",{...M,disabled:O,checked:I,"data-checked":F.checked||R||void 0,onChange:J=>{var ae;Q?(ae=F.onChange)==null||ae.call(F,J):C==null||C(J),z(J.currentTarget.checked)},id:N,ref:t,type:"checkbox",role:"switch",...X("input")}),s.jsxs(se,{"aria-hidden":"true",mod:{error:A,"label-position":P,"without-labels":!v&&!m},...X("track"),children:[s.jsx(se,{component:"span",mod:"reduce-motion",...X("thumb"),children:T}),s.jsx("span",{...X("trackLabel"),children:I?v:m})]})]})});ku.classes={...rT,...lk};ku.displayName="@mantine/core/Switch";ku.Group=ix;const[BL,UL]=dr("Table component was not found in the tree");var Tu={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 WL(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 ja(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ue((o,i)=>{const l=oe(n,{},o),{classNames:u,className:d,style:p,styles:h,...m}=l,v=UL();return s.jsx(se,{component:e,ref:i,...WL(v,t),...v.getStyles(e,{className:d,classNames:u,style:p,styles:h,props:l}),...m})});return r.displayName=`@mantine/core/${n}`,r.classes=Tu,r}const Zg=ja("th",{columnBorder:!0}),oT=ja("td",{columnBorder:!0}),yf=ja("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),iT=ja("thead",{stickyHeader:!0}),sT=ja("tbody"),aT=ja("tfoot"),lT=ja("caption",{captionSide:!0});function sx({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(lT,{children:e.caption}),e.head&&s.jsx(iT,{children:s.jsx(yf,{children:e.head.map((t,n)=>s.jsx(Zg,{children:t},n))})}),e.body&&s.jsx(sT,{children:e.body.map((t,n)=>s.jsx(yf,{children:t.map((r,o)=>s.jsx(oT,{children:r},o))},n))}),e.foot&&s.jsx(aT,{children:s.jsx(yf,{children:e.foot.map((t,n)=>s.jsx(Zg,{children:t},n))})})]})}sx.displayName="@mantine/core/TableDataRenderer";const HL={type:"scrollarea"},qL=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":ie(t),"--table-overflow":n==="native"?"auto":void 0}}),ax=ue((e,t)=>{const n=oe("TableScrollContainer",HL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,children:p,minWidth:h,type:m,...v}=n,x=Le({name:"TableScrollContainer",classes:Tu,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:qL,rootSelector:"scrollContainer"});return s.jsx(se,{component:m==="scrollarea"?co:"div",...m==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...x("scrollContainer"),...v,children:s.jsx("div",{...x("scrollContainerInner"),children:p})})});ax.classes=Tu;ax.displayName="@mantine/core/TableScrollContainer";const GL={withRowBorders:!0,verticalSpacing:7},QL=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:p,stickyHeaderOffset:h,stickyHeader:m})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Rn(r),"--table-vertical-spacing":Rn(o),"--table-border-color":i?Lt(i,e):void 0,"--table-striped-color":d&&l?Lt(l,e):void 0,"--table-highlight-on-hover-color":p&&u?Lt(u,e):void 0,"--table-sticky-header-offset":m?ie(h):void 0}}),Me=ue((e,t)=>{const n=oe("Table",GL,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,horizontalSpacing:p,verticalSpacing:h,captionSide:m,stripedColor:v,highlightOnHoverColor:x,striped:b,highlightOnHover:w,withColumnBorders:j,withRowBorders:T,withTableBorder:R,borderColor:E,layout:C,variant:P,data:D,children:A,stickyHeader:O,stickyHeaderOffset:L,mod:V,tabularNums:q,...G}=n,Q=Le({name:"Table",props:n,className:o,style:i,classes:Tu,classNames:r,styles:l,unstyled:u,rootSelector:"table",vars:d,varsResolver:QL});return s.jsx(BL,{value:{getStyles:Q,stickyHeader:O,striped:b===!0?"odd":b||void 0,highlightOnHover:w,withColumnBorders:j,withRowBorders:T,captionSide:m||"bottom"},children:s.jsx(se,{component:"table",variant:P,ref:t,mod:[{"data-with-table-border":R,"data-tabular-nums":q},V],...Q("table"),...G,children:A||!!D&&s.jsx(sx,{data:D})})})});Me.classes=Tu;Me.displayName="@mantine/core/Table";Me.Td=oT;Me.Th=Zg;Me.Tr=yf;Me.Thead=iT;Me.Tbody=sT;Me.Tfoot=aT;Me.Caption=lT;Me.ScrollContainer=ax;Me.DataRenderer=sx;const[KL,lx]=dr("Tabs component was not found in the tree");var Pu={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 YL={},cx=ue((e,t)=>{const n=oe("TabsList",YL,e),{children:r,className:o,grow:i,justify:l,classNames:u,styles:d,style:p,mod:h,...m}=n,v=lx();return s.jsx(se,{...m,...v.getStyles("list",{className:o,style:p,classNames:u,styles:d,props:n,variant:v.variant}),ref:t,role:"tablist",variant:v.variant,mod:[{grow:i,orientation:v.orientation,placement:v.orientation==="vertical"&&v.placement,inverted:v.inverted},h],"aria-orientation":v.orientation,__vars:{"--tabs-justify":l},children:r})});cx.classes=Pu;cx.displayName="@mantine/core/TabsList";const XL={},ux=ue((e,t)=>{const n=oe("TabsPanel",XL,e),{children:r,className:o,value:i,classNames:l,styles:u,style:d,mod:p,keepMounted:h,...m}=n,v=lx(),x=v.value===i,b=v.keepMounted||h||x?r:null;return s.jsx(se,{...m,...v.getStyles("panel",{className:o,classNames:l,styles:u,style:[d,x?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:v.orientation},p],role:"tabpanel",id:v.getPanelId(i),"aria-labelledby":v.getTabId(i),children:b})});ux.classes=Pu;ux.displayName="@mantine/core/TabsPanel";const JL={},dx=ue((e,t)=>{const n=oe("TabsTab",JL,e),{className:r,children:o,rightSection:i,leftSection:l,value:u,onClick:d,onKeyDown:p,disabled:h,color:m,style:v,classNames:x,styles:b,vars:w,mod:j,tabIndex:T,...R}=n,E=mn(),{dir:C}=ba(),P=lx(),D=u===P.value,A=L=>{P.onChange(P.allowTabDeactivation&&u===P.value?null:u),d==null||d(L)},O={classNames:x,styles:b,props:n};return s.jsxs(Qn,{...R,...P.getStyles("tab",{className:r,style:v,variant:P.variant,...O}),disabled:h,unstyled:P.unstyled,variant:P.variant,mod:[{active:D,disabled:h,orientation:P.orientation,inverted:P.inverted,placement:P.orientation==="vertical"&&P.placement},j],ref:t,role:"tab",id:P.getTabId(u),"aria-selected":D,tabIndex:T!==void 0?T:D||P.value===null?0:-1,"aria-controls":P.getPanelId(u),onClick:A,__vars:{"--tabs-color":m?Lt(m,E):void 0},onKeyDown:CC({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:P.activateTabWithKeyboard,loop:P.loop,orientation:P.orientation||"horizontal",dir:C,onKeyDown:p}),children:[l&&s.jsx("span",{...P.getStyles("tabSection",O),"data-position":"left",children:l}),o&&s.jsx("span",{...P.getStyles("tabLabel",O),children:o}),i&&s.jsx("span",{...P.getStyles("tabSection",O),"data-position":"right",children:i})]})});dx.classes=Pu;dx.displayName="@mantine/core/TabsTab";const fS="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",ZL={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},e5=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Mt(t),"--tabs-color":Lt(n,e),"--tabs-text-color":ya(r,e)?Di({color:n,theme:e,autoContrast:r}):void 0}}),_t=ue((e,t)=>{const n=oe("Tabs",ZL,e),{defaultValue:r,value:o,onChange:i,orientation:l,children:u,loop:d,id:p,activateTabWithKeyboard:h,allowTabDeactivation:m,variant:v,color:x,radius:b,inverted:w,placement:j,keepMounted:T,classNames:R,styles:E,unstyled:C,className:P,style:D,vars:A,autoContrast:O,mod:L,...V}=n,q=fr(p),[G,Q]=Bn({value:o,defaultValue:r,finalValue:null,onChange:i}),Y=Le({name:"Tabs",props:n,classes:Pu,className:P,style:D,classNames:R,styles:E,unstyled:C,vars:A,varsResolver:e5});return s.jsx(KL,{value:{placement:j,value:G,orientation:l,id:q,loop:d,activateTabWithKeyboard:h,getTabId:s1(`${q}-tab`,fS),getPanelId:s1(`${q}-panel`,fS),onChange:Q,allowTabDeactivation:m,variant:v,color:x,radius:b,inverted:w,keepMounted:T,unstyled:C,getStyles:Y},children:s.jsx(se,{ref:t,id:q,variant:v,mod:[{orientation:l,inverted:l==="horizontal"&&w,placement:l==="vertical"&&j},L],...Y("root"),...V,children:u})})});_t.classes=Pu;_t.displayName="@mantine/core/Tabs";_t.Tab=dx;_t.Panel=ux;_t.List=cx;const t5={},Ve=ue((e,t)=>{const n=oe("TextInput",t5,e);return s.jsx(kr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});Ve.classes=kr.classes;Ve.displayName="@mantine/core/TextInput";var cT={root:"m_7341320d"};const n5={},r5=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:l})=>{const u=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:l});return{root:{"--ti-size":ot(t,"ti-size"),"--ti-radius":n===void 0?void 0:Mt(n),"--ti-bg":i||r?u.background:void 0,"--ti-color":i||r?u.color:void 0,"--ti-bd":i||r?u.border:void 0}}},fx=ue((e,t)=>{const n=oe("ThemeIcon",n5,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,autoContrast:p,...h}=n,m=Le({name:"ThemeIcon",classes:cT,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:r5});return s.jsx(se,{ref:t,...m("root"),...h})});fx.classes=cT;fx.displayName="@mantine/core/ThemeIcon";const o5=["h1","h2","h3","h4","h5","h6"],i5=["xs","sm","md","lg","xl"];function s5(e,t){const n=t!==void 0?t:`h${e}`;return o5.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:i5.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:ie(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var uT={root:"m_8a5d1357"};const a5={order:1},l5=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=s5(t,n);return{root:{"--title-fw":i.fontWeight,"--title-lh":i.lineHeight,"--title-fz":i.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},Fe=ue((e,t)=>{const n=oe("Title",a5,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,order:d,vars:p,size:h,variant:m,lineClamp:v,textWrap:x,mod:b,...w}=n,j=Le({name:"Title",props:n,classes:uT,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:l5});return[1,2,3,4,5,6].includes(d)?s.jsx(se,{...j("root"),component:`h${d}`,variant:m,ref:t,mod:[{order:d,"data-line-clamp":typeof v=="number"},b],size:h,...w}):null});Fe.classes=uT;Fe.displayName="@mantine/core/Title";function c5(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(i=>i(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function u5(e){return g.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function d5(e,t,n){const r=[],o=[],i={};for(const l of e){const u=l.position||t;i[u]=i[u]||0,i[u]+=1,i[u]<=n?o.push(l):r.push(l)}return{notifications:o,queue:r}}const f5=()=>c5({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Ca=f5(),p5=(e=Ca)=>u5(e);function Ql(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=d5(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function De(e,t=Ca){const n=e.id||Tf();return Ql(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function dT(e,t=Ca){return Ql(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function Zs(e,t=Ca){return Ql(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function h5(e=Ca){Ql(e,()=>[])}function m5(e=Ca){Ql(e,t=>t.slice(0,e.getState().limit))}const Fr={show:De,hide:dT,update:Zs,clean:h5,cleanQueue:m5,updateState:Ql};function ev(e,t){return ev=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ev(e,t)}function fT(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ev(e,t)}var fg={exports:{}},pg,pS;function g5(){if(pS)return pg;pS=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return pg=e,pg}var hg,hS;function v5(){if(hS)return hg;hS=1;var e=g5();function t(){}function n(){}return n.resetWarningCache=t,hg=function(){function r(l,u,d,p,h,m){if(m!==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 o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},hg}var mS;function y5(){return mS||(mS=1,fg.exports=v5()()),fg.exports}var x5=y5();const Yt=Tv(x5),gS={disabled:!1},Of=xn.createContext(null);var b5=function(t){return t.scrollTop},qc="unmounted",qs="exited",Gs="entering",yl="entered",tv="exiting",Mi=function(e){fT(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var l=o,u=l&&!l.isMounting?r.enter:r.appear,d;return i.appearStatus=null,r.in?u?(d=qs,i.appearStatus=Gs):d=yl:r.unmountOnExit||r.mountOnEnter?d=qc:d=qs,i.state={status:d},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var l=o.in;return l&&i.status===qc?{status:qs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var l=this.state.status;this.props.in?l!==Gs&&l!==yl&&(i=Gs):(l===Gs||l===yl)&&(i=tv)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,l,u;return i=l=u=o,o!=null&&typeof o!="number"&&(i=o.exit,l=o.enter,u=o.appear!==void 0?o.appear:l),{exit:i,enter:l,appear:u}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===Gs){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:Hc.findDOMNode(this);l&&b5(l)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===qs&&this.setState({status:qc})},n.performEnter=function(o){var i=this,l=this.props.enter,u=this.context?this.context.isMounting:o,d=this.props.nodeRef?[u]:[Hc.findDOMNode(this),u],p=d[0],h=d[1],m=this.getTimeouts(),v=u?m.appear:m.enter;if(!o&&!l||gS.disabled){this.safeSetState({status:yl},function(){i.props.onEntered(p)});return}this.props.onEnter(p,h),this.safeSetState({status:Gs},function(){i.props.onEntering(p,h),i.onTransitionEnd(v,function(){i.safeSetState({status:yl},function(){i.props.onEntered(p,h)})})})},n.performExit=function(){var o=this,i=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:Hc.findDOMNode(this);if(!i||gS.disabled){this.safeSetState({status:qs},function(){o.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:tv},function(){o.props.onExiting(u),o.onTransitionEnd(l.exit,function(){o.safeSetState({status:qs},function(){o.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,i.nextCallback=null,o(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var l=this.props.nodeRef?this.props.nodeRef.current:Hc.findDOMNode(this),u=o==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],p=d[0],h=d[1];this.props.addEndListener(p,h)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===qc)return null;var i=this.props,l=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var u=Oy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return xn.createElement(Of.Provider,{value:null},typeof l=="function"?l(o,u):xn.cloneElement(xn.Children.only(l),u))},t}(xn.Component);Mi.contextType=Of;Mi.propTypes={};function cl(){}Mi.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:cl,onEntering:cl,onEntered:cl,onExit:cl,onExiting:cl,onExited:cl};Mi.UNMOUNTED=qc;Mi.EXITED=qs;Mi.ENTERING=Gs;Mi.ENTERED=yl;Mi.EXITING=tv;function w5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function px(e,t){var n=function(i){return t&&g.isValidElement(i)?t(i):i},r=Object.create(null);return e&&g.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function S5(e,t){e=e||{},t=t||{};function n(h){return h in t?t[h]:e[h]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var l,u={};for(var d in t){if(r[d])for(l=0;l<r[d].length;l++){var p=r[d][l];u[r[d][l]]=n(p)}u[d]=n(d)}for(l=0;l<o.length;l++)u[o[l]]=n(o[l]);return u}function ea(e,t,n){return n[t]!=null?n[t]:e.props[t]}function j5(e,t){return px(e.children,function(n){return g.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:ea(n,"appear",e),enter:ea(n,"enter",e),exit:ea(n,"exit",e)})})}function C5(e,t,n){var r=px(e.children),o=S5(t,r);return Object.keys(o).forEach(function(i){var l=o[i];if(g.isValidElement(l)){var u=i in t,d=i in r,p=t[i],h=g.isValidElement(p)&&!p.props.in;d&&(!u||h)?o[i]=g.cloneElement(l,{onExited:n.bind(null,l),in:!0,exit:ea(l,"exit",e),enter:ea(l,"enter",e)}):!d&&u&&!h?o[i]=g.cloneElement(l,{in:!1}):d&&u&&g.isValidElement(p)&&(o[i]=g.cloneElement(l,{onExited:n.bind(null,l),in:p.props.in,exit:ea(l,"exit",e),enter:ea(l,"enter",e)}))}}),o}var E5=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},k5={component:"div",childFactory:function(t){return t}},cs=function(e){fT(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var l=i.handleExited.bind(w5(i));return i.state={contextValue:{isMounting:!0},handleExited:l,firstRender:!0},i}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,i){var l=i.children,u=i.handleExited,d=i.firstRender;return{children:d?j5(o,u):C5(o,l,u),firstRender:!1}},n.handleExited=function(o,i){var l=px(this.props.children);o.key in l||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(u){var d=Af({},u.children);return delete d[o.key],{children:d}}))},n.render=function(){var o=this.props,i=o.component,l=o.childFactory,u=Oy(o,["component","childFactory"]),d=this.state.contextValue,p=E5(this.state.children).map(l);return delete u.appear,delete u.enter,delete u.exit,i===null?xn.createElement(Of.Provider,{value:d},p):xn.createElement(Of.Provider,{value:d},xn.createElement(i,u,p))},t}(xn.Component);cs.propTypes={};cs.defaultProps=k5;const pT=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function T5(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),pT.reduce((n,r)=>(n[r]=[],n),{}))}const vS={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},P5={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function R5({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),l=i==="center"?`${o}-center`:i,u={opacity:0,maxHeight:t,transform:vS[l],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"},d={opacity:1,transform:P5[l]},p={opacity:0,maxHeight:0,transform:vS[l]};return{...u,...{entering:d,entered:d,exiting:p,exited:p}[e]}}function _5(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const hT=g.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:l,...u}=e,d=_5(n,e.autoClose),p=g.useRef(-1),h=()=>window.clearTimeout(p.current),m=()=>{t(e.id),h()},v=()=>{typeof d=="number"&&(p.current=window.setTimeout(m,d))};return g.useEffect(()=>{var x;(x=e.onOpen)==null||x.call(e,e)},[]),g.useEffect(()=>(v(),h),[d]),s.jsx(Qy,{...r,...u,onClose:m,ref:o,onMouseEnter:h,onMouseLeave:v,children:l})});hT.displayName="@mantine/notifications/NotificationContainer";var mT={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const D5=Mi,I5={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Br("overlay"),store:Ca,withinPortal:!0},A5=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":ie(n)}}),Li=ue((e,t)=>{const n=oe("Notifications",I5,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,position:p,autoClose:h,transitionDuration:m,containerWidth:v,notificationMaxHeight:x,limit:b,zIndex:w,store:j,portalProps:T,withinPortal:R,...E}=n,C=mn(),P=p5(j),D=sI(),A=Iv(),O=g.useRef({}),L=g.useRef(0),q=(C.respectReducedMotion?A:!1)?1:m,G=Le({name:"Notifications",classes:mT,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:A5});g.useEffect(()=>{j==null||j.updateState(X=>({...X,limit:b||5,defaultPosition:p}))},[b,p]),wi(()=>{P.notifications.length>L.current&&setTimeout(()=>D(),0),L.current=P.notifications.length},[P.notifications]);const Q=T5(P.notifications,p),Y=pT.reduce((X,B)=>(X[B]=Q[B].map(({style:M,...N})=>s.jsx(D5,{timeout:q,onEnter:()=>O.current[N.id].offsetHeight,nodeRef:{current:O.current[N.id]},children:F=>s.jsx(hT,{ref:I=>{O.current[N.id]=I},data:N,onHide:I=>dT(I,j),autoClose:h,...G("notification",{style:{...R5({state:F,position:B,transitionDuration:q,maxHeight:x}),...M}})})},N.id)),X),{});return s.jsxs(ws,{withinPortal:R,...T,children:[s.jsx(se,{...G("root"),"data-position":"top-center",ref:t,...E,children:s.jsx(cs,{children:Y["top-center"]})}),s.jsx(se,{...G("root"),"data-position":"top-left",...E,children:s.jsx(cs,{children:Y["top-left"]})}),s.jsx(se,{...G("root",{className:kl.classNames.fullWidth}),"data-position":"top-right",...E,children:s.jsx(cs,{children:Y["top-right"]})}),s.jsx(se,{...G("root",{className:kl.classNames.fullWidth}),"data-position":"bottom-right",...E,children:s.jsx(cs,{children:Y["bottom-right"]})}),s.jsx(se,{...G("root"),"data-position":"bottom-left",...E,children:s.jsx(cs,{children:Y["bottom-left"]})}),s.jsx(se,{...G("root"),"data-position":"bottom-center",...E,children:s.jsx(cs,{children:Y["bottom-center"]})})]})});Li.classes=mT;Li.displayName="@mantine/notifications/Notifications";Li.show=Fr.show;Li.hide=Fr.hide;Li.update=Fr.update;Li.clean=Fr.clean;Li.cleanQueue=Fr.cleanQueue;Li.updateState=Fr.updateState;class N5{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Ru{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class O5{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(o,i){const l=o.consumeAndParse(n);return r(i,l)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,l){const u=o.consumeAndParse(n);return r(i,l,u)},precedence:n})}construct(t){return new M5(t,this.prefixParselets,this.infixParselets)}}class M5{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let o=r.parse(this,n);for(;t>this.getPrecedence();){const i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" (${i.value}) at line ${i.line} column ${i.column}.`)}if(n&&((o=this.peek())==null?void 0:o.value)!==n){const i=this.peek();throw Error(`Expected "${n}" but got "${i.value}" at line ${i.line} column ${i.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}const zp="http://hl7.org",gT="ok",L5="created",$5="gone",F5="not-modified",z5="not-found",V5="unauthorized",B5="forbidden",U5="accepted",W5={resourceType:"OperationOutcome",id:gT,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},H5={resourceType:"OperationOutcome",id:z5,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},iu={resourceType:"OperationOutcome",id:V5,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},q5={...iu,issue:[...iu.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},yS={...iu,issue:[...iu.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},vT={resourceType:"OperationOutcome",id:B5,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Qo(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function fn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function G5(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Vp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function yT(e){return e.id===gT||e.id===L5||e.id===F5||e.id===U5}function Q5(e){return e.id===$5}class ft extends Error{constructor(t,n){super(xT(t)),this.outcome=t,this.cause=n}}function Gt(e){return e instanceof ft?e.outcome:Vp(e)?e:Qo(tt(e))}function tt(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Vp(e)?xT(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function xT(e){var n;const t=((n=e.issue)==null?void 0:n.map(bT))??[];return t.length>0?t.join("; "):"Unknown error"}function bT(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 K5(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 Y5(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(([o,i])=>[o,K5(o,i)])),constraints:[],innerTypes:[]};return t}const X5={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},J5={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Z5={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"}]}}},e$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},t$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"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"}]}}},n$={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"}]}}},r$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},o$={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"}]}}},i$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},s$={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"}]}}},a$={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"}]}}},l$={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"}]}}},c$={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"}]}}},u$={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"}]}}},d$={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"}]}}},f$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},p$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},h$={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"]}]}}},m$={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"]}]}}},g$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},v$={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"}]}}},y$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},x$={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"}]}}},b$={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"}]}}},w$={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"}]}}},S$={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"}]}}},j$={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"]}]}}},C$={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"]}]}}},E$={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"}]}}},k$={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"}]}}},T$={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"}]}}},P$={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"}]}}},R$={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"]}]}}},_$={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"}]}}},D$={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"}]}}},I$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},A$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},N$={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"]}]}}},O$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},M$={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"}]}}},L$={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"}]}}},$$={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"}]}}},F$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},z$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},V$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},B$={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"}]}}},U$={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"]}]}}},W$={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"}]}}},H$={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"}]}}},q$={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"}]}}},G$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},Q$={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"}]}}},K$={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"}]}}},Y$={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"}]}}},X$={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"]}]}}},J$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Z$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},e7={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},t7={Element:X5,BackboneElement:J5,Address:Z5,Age:e$,Annotation:t$,Attachment:n$,CodeableConcept:r$,Coding:o$,ContactDetail:i$,ContactPoint:s$,Contributor:a$,Count:l$,DataRequirement:c$,DataRequirementCodeFilter:u$,DataRequirementDateFilter:d$,DataRequirementSort:f$,Distance:p$,Dosage:h$,DosageDoseAndRate:m$,Duration:g$,ElementDefinition:v$,ElementDefinitionSlicingDiscriminator:y$,ElementDefinitionSlicing:x$,ElementDefinitionBase:b$,ElementDefinitionType:w$,ElementDefinitionExample:S$,ElementDefinitionConstraint:j$,ElementDefinitionBinding:C$,ElementDefinitionMapping:E$,Expression:k$,Extension:T$,HumanName:P$,Identifier:R$,MarketingStatus:_$,Meta:D$,Money:I$,Narrative:A$,ParameterDefinition:N$,Period:O$,Population:M$,ProdCharacteristic:L$,ProductShelfLife:$$,Quantity:F$,Range:z$,Ratio:V$,Reference:B$,RelatedArtifact:U$,SampledData:W$,Signature:H$,SubstanceAmount:q$,SubstanceAmountReferenceRange:G$,Timing:Q$,TimingRepeat:K$,TriggerDefinition:Y$,UsageContext:X$,MoneyQuantity:J$,SimpleQuantity:Z$,IdentityProvider:e7};function n7(e){return new o7(e).parse()}const Mf=Y5(t7),hx=Object.create(null),xS=Object.create(null),r7={"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 wT(e){let t;return t=xS[e],t||(t=xS[e]=Object.create(null)),t}function bS(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(o=>o.resource))??[]).filter(o=>(o==null?void 0:o.resourceType)==="StructureDefinition");K7(n);for(const o of n)ST(o)}function ST(e){var i,l;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=n7(e),n=r7[e.url];let r,o;n?(r=Mf,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(i=e.type)!=null&&i.startsWith("http://")||(l=e.type)!=null&&l.startsWith("https://")?(r=Mf,o=e.type):(r=wT(e.url),o=e.type),r[o]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;hx[e.url]=t}function jT(e){return!!Mf[e]}function Bp(e,t){if(t){const n=wT(t)[e];if(n)return n}return Mf[e]}function CT(e,t){const n=Bp(e,t);if(!n)throw new ft(Qo("Unknown data type: "+e));return n}function mx(e){return!!hx[e]}function Kl(e){return hx[e]}class o7{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:a7(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,l;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=mg(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let d=this.backboneContext;for(;d;){if((o=t.path)!=null&&o.startsWith(d.path+".")){d.type.elements[mg(t,d.path)]=u;break}d=d.parent}if(!d){const p=mg(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(p.replace("[x]",""))),u.min>0&&((l=this.resourceSchema.mandatoryProperties)==null||l.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&&!ul(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,o,i;for(;this.backboneContext&&!ul((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=RS(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:ul((o=this.backboneContext)==null?void 0:o.path,t.path)?this.backboneContext:(i=this.backboneContext)==null?void 0:i.parent}}enterSlice(t,n){var r,o,i,l;s7(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((o=t.slicing)==null?void 0:o.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:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(l=t.slicing)==null?void 0:l.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!ul(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&&!ul(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,o,i,l;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),d=this.elementIndex[u];return d?{...d,id:t.id,path:t.path,min:t.min??d.min,max:t.max??d.max,base:{path:((n=d.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((o=d.base)==null?void 0:o.min)??d.min,max:((i=t.base)==null?void 0:i.max)??((l=d.base)==null?void 0:l.max)??d.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(ul(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(o=>["BackboneElement","Element"].includes(o.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.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 o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=RS(t)),r||(r=(o=Cs(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:o.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var i,l;const n=wS(t.max),r=(i=t.base)!=null&&i.max?wS(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((l=t.base)==null?void 0:l.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:SS(Nl(o,"fixed[x]")),pattern:SS(Nl(o,"pattern[x]")),binding:t.binding}}}function wS(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function mg(e,t=""){return i7(e.path,t)}function i7(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function ul(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function SS(e){return Array.isArray(e)&&e.length>0?e[0]:wn(e)?void 0:e}function s7(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function a7(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 l7(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?c7:Nl,[o,...i]=t.split(".");let l=[r(e,o,n)];for(const u of i){const d=[];for(const p of l)if(Array.isArray(p))for(const h of p)d.push(r(h,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&d.push(r(p,u,n));l=d}return l}function c7(e,t,n){const r=e.path;return u7(Nl(e,t,n),r,t)}function u7(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,i)=>({...o,path:`${r}${n}[${i}]`})):{...e,path:`${r}${n}`}}class ET{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 kT={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 d7(e,t,n,r){var l;if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return yx(e,o.pattern);if(o.fixed)return vs(e,o.fixed);if(((l=o.binding)==null?void 0:l.strength)==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(u=>u.code===e.type)}return!1}function Je(e){return[{type:re.boolean,value:e}]}function io(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:re.integer,value:e}:typeof e=="number"?{type:re.decimal,value:e}:typeof e=="boolean"?{type:re.boolean,value:e}:typeof e=="string"?{type:re.string,value:e}:no(e)?{type:re.Quantity,value:e}:ni(e)?{type:e.resourceType,value:e}:OT(e)?{type:re.CodeableConcept,value:e}:NT(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function Ho(e){return e.length===0?!1:!!e[0].value}function Ei(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 Nl(e,t,n){if(!e.value)return;const r=Ea(e.type,t,n==null?void 0:n.profileUrl);return r?TT(e,t,r):_u(e,t)}function TT(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,l="undefined",u;const d=n.path.lastIndexOf("."),p=n.path.substring(d+1);for(const h of o){const m=p.replace("[x]",Ln(h.code));if(i=r[m],u=r["_"+m],i!==void 0||u!==void 0){l=h.code;break}}if(u)if(Array.isArray(i)){i=i.slice();for(let h=0;h<Math.max(i.length,u.length);h++)i[h]=kS(i[h],u[h])}else i=kS(i,u);if(!wn(i))return(l==="Element"||l==="BackboneElement")&&(l=n.type[0].code),Array.isArray(i)?i.map(h=>jS(h,l)):jS(i,l)}function jS(e,t){return t==="Resource"&&ni(e)&&(t=e.resourceType),{type:t,value:e}}function _u(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(io):r=io(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const i of Object.values(re)){const l=o+Ln(i);if(l in n){const u=n[l];Array.isArray(u)?r=u.map(d=>({type:i,value:d})):r={type:i,value:u};break}}}if(Array.isArray(r)){if(r.length===0||wn(r[0]))return}else if(wn(r))return;return r}function PT(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Ho(Up(n,o))){r=!0;break}r||t.push(n)}return t}function f7(e){return Je(!Ho(e))}function p7(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Je(!1):Je(e.every((n,r)=>Ho(Up(n,t[r]))))}function h7(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Je(!0):Je(e.some((n,r)=>!Ho(Up(n,t[r]))))}function Up(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?Je(Math.abs(n-r)<1e-8):no(n)&&no(r)?Je(DT(n,r)):Je(typeof n=="object"&&typeof r=="object"?gx(e,t):n===r)}function RT(e,t){return e.length===0&&t.length===0?Je(!0):e.length!==t.length?Je(!1):(e.sort(CS),t.sort(CS),Je(e.every((n,r)=>Ho(m7(n,t[r])))))}function m7(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,l=r==null?void 0:r.valueOf(),u=i==null?void 0:i.valueOf();return typeof l=="number"&&typeof u=="number"?Je(Math.abs(l-u)<.01):no(l)&&no(u)?Je(DT(l,u)):Je(n==="Coding"&&o==="Coding"?typeof l!="object"||typeof u!="object"?!1:l.code===u.code&&l.system===u.system:typeof l=="object"&&typeof u=="object"?gx({...l,id:void 0},{...u,id:void 0}):typeof l=="string"&&typeof u=="string"?l.toLowerCase()===u.toLowerCase():l===u)}function CS(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function _T(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 g7(n);case"DateTime":return Lf(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return v7(n);case"Quantity":return no(n);default:return e.type===r||typeof n=="object"&&(n==null?void 0:n.resourceType)===r}}function g7(e){return typeof e=="string"&&!!kT.date.exec(e)}function Lf(e){return typeof e=="string"&&!!kT.dateTime.exec(e)}function v7(e){return!!(e&&typeof e=="object"&&("start"in e&&Lf(e.start)||"end"in e&&Lf(e.end)))}function no(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function DT(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 gx(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o],l=t[o];if(ES(i)&&ES(l)){if(!gx(i,l))return!1}else if(i!==l)return!1}return!0}function ES(e){return e!==null&&typeof e=="object"}function kS(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return y7(e??{},t)}return e}function y7(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function x7(e,t){return ni(e,t)&&"id"in e&&typeof e.id=="string"}function rn(e){const t=Dt(e)??"undefined/undefined",n=ki(e);return n===t?{reference:t}:{reference:t,display:n}}function Dt(e){if(Es(e))return e.reference;if(x7(e))return`${e.resourceType}/${e.id}`}function ca(e){if(e)return Es(e)?e.reference.split("/")[1]:e.id}function b7(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function ki(e){if(b7(e)){const t=w7(e);if(t)return t}if(e.resourceType==="Device"){const t=S7(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return ys(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]),OT(t))return ys(t);if(D7(t))return t.text}return Dt(e)??""}function w7(e){const t=e.name;if(t&&t.length>0)return Yl(t[0])}function S7(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function j7(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=TS(n);if(r)return r}else return TS(t)}function TS(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function IT(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),i=n.getUTCMonth(),l=n.getUTCDate(),u=r.getUTCFullYear(),d=r.getUTCMonth(),p=r.getUTCDate();let h=u-o;(d<i||d===i&&p<l)&&h--;let m=u*12+d-(o*12+i);p<l&&m--;const v=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:h,months:m,days:v}}function C7(e,t){const{years:n,months:r,days:o}=IT(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Cs(e,...t){var r;let n=e;for(let o=0;o<t.length&&n;o++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(i=>i.url===t[o]);return n}function Po(e,t){const n=vx(e);return JSON.stringify(n,null,t?2:void 0)??""}function vx(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?E7(e):k7(e):e}function E7(e){const t=e.length;if(t===0)return;let n,r=0;for(let o=0;o<t;o++){const i=e[o],l=vx(i);l!==i&&!n&&(n=Array.from(e)),l===void 0?n&&(n[o]=null):(n&&(n[o]=l),r++)}if(r!==0)return n??e}function k7(e){let t,n=0;for(const r in e){const o=e[r],i=vx(o);i!==o&&!t&&(t={...e}),i===void 0?t&&delete t[r]:(t&&(t[r]=i),n++)}if(n!==0)return t??e}function wn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!bn(e):!1}function bn(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 vs(e,t,n){return e===t||wn(e)&&wn(t)?!0:wn(e)||wn(t)?!1:Array.isArray(e)&&Array.isArray(t)?T7(e,t):Array.isArray(e)||Array.isArray(t)?!1:tr(e)&&tr(t)?P7(e,t,n):(tr(e)||tr(t),!1)}function T7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!vs(e[n],t[n]))return!1;return!0}function P7(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const i=e[o],l=t[o];if(!vs(i,l,o))return!1}return!0}function yx(e,t){return wn(e)?!0:wn(t)?!1:Array.isArray(e)&&Array.isArray(t)?R7(e,t):Array.isArray(e)||Array.isArray(t)?!1:tr(e)&&tr(t)?_7(e,t):tr(e)||tr(t)?!1:e===t}function R7(e,t){return t.every(n=>e.some(r=>yx(r,n)))}function _7(e,t){return Object.entries(t).every(([n,r])=>n in e&&yx(e[n],r))}function Vr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function AT(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 tr(e){return e!==null&&typeof e=="object"}function NT(e){return tr(e)&&"code"in e&&typeof e.code=="string"}function OT(e){return tr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(NT)}function D7(e){return tr(e)&&"text"in e&&typeof e.text=="string"}const MT=[];for(let e=0;e<256;e++)MT.push(e.toString(16).padStart(2,"0"));function I7(e){const t=LT(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=MT[n[o]];return r.join("")}function A7(e){const t=LT(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function LT(e){return ArrayBuffer.isView(e)?e.buffer:e}function Ln(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function xx(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ta(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function N7(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(o=>o.system===t))==null?void 0:r.code}function O7(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const PS=e=>new Promise(t=>{setTimeout(t,e)});function nv(e,t,n){const r=[];for(let o=0;o<n-1;o++){const i=e.indexOf(t);if(i<0)break;r.push(e.slice(0,i)),e=e.slice(i+t.length)}return r.push(e),r}function M7(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Fc(e,t){return e?(e.push(t),e):[t]}function su(e){return e.sort((t,n)=>t.localeCompare(n))}function bx(e){return e.endsWith("/")?e:e+"/"}function L7(e){return e.startsWith("/")?e.slice(1):e}function Bo(e,t){return new URL(L7(t),bx(e.toString())).toString()}function $7(e,t){return Bo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function F7(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 $T(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 z7(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const o=e.meta.profile.indexOf(t);e.meta.profile.splice(o,1)}return e}function au(e){if(!e)return"";switch(e.type){case"Address":return FT(e.value);case"CodeableConcept":return ys(e.value);case"Coding":return Du(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Yl(e.value);case"Quantity":return na(e.value);case"Reference":return V7(e.value);default:return e.value.toString()}}function V7(e){return e?e.display??e.reference??Po(e):""}function FT(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.join(", ").trim()}function Yl(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=cu(e.text);if(r)return r}return n.join(" ").trim()}function Wp(e){return e instanceof Date&&!isNaN(e.getTime())}function B7(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Wp(r)?r.toLocaleTimeString(t,n):""}function ur(e,t,n){if(!e)return"";const r=new Date(e);return Wp(r)?r.toLocaleString(t,n):""}function U7(e,t,n){return!e||!e.start&&!e.end?"":ur(e.start,t,n)+" - "+ur(e.end,t,n)}const W7={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},H7={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},q7={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function zT(e){if(!e)return"";const t=[];return G7(t,e.repeat),e.event&&t.push(e.event.map(n=>ur(n)).join(", ")),Ln(t.join(" ").trim())}function G7(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(W7[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+H7[o]):e.push("per "+r+" "+q7[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Ln).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>B7(i)).join(", "))}function lu(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(o==null?void 0:o.value)===void 0?`>= ${na(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?`<= ${na(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${na(r)} - ${na(o)}`)}function na(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 Q7(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ys(e){if(!e)return"";const t=cu(e.text);return t||(e.coding?e.coding.map(n=>Du(n)).join(", "):"")}function Du(e,t){const n=cu(e==null?void 0:e.display);return n?`${n}`:cu(e==null?void 0:e.code)??""}function VT(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(na(e.valueQuantity));else if(e.valueCodeableConcept)t.push(ys(e.valueCodeableConcept));else{const n=cu(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>VT(n)).join(" / ")),t.join(" / ").trim()}function cu(e){return typeof e=="string"?e:void 0}const re={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 K7(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"&&BT(r.type)}function BT(e){let t=Jo.types[e];return t||(t={searchParamsDetails:{}},Jo.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 Y7(e){for(const t of e.base??[]){const n=BT(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function RS(e){var n,r,o,i;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?X7((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function X7(e){return e.length===1?e[0]:e.map(Ln).join("")}function wx(e){var t;return(t=Jo.types[e])==null?void 0:t.searchParams}function J7(e,t){var n,r;return(r=(n=Jo.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function ua(e){const t=e.replaceAll("[x]","").split(".").pop();return UT(t)}function UT(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(eF).join(" ").replace("_"," ").replace(/\s+/g," ")}const Z7=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function eF(e){const t=e.toUpperCase();return e===t?e:Z7.has(t)?t:t.charAt(0)+e.slice(1)}function Ea(e,t,n){const r=Bp(e,n);if(r)return tF(r.elements,t)}function tF(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const i=t.slice(0,r)+"[x]",l=e[i];if(l)return l}}}function ni(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Es(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Jo={types:{}};function xf(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 mi=()=>[],br={empty:(e,t)=>Je(t.length===0||t.every(n=>wn(n.value))),hasValue:(e,t)=>Je(t.length!==0),exists:(e,t,n)=>Je(n?t.filter(r=>Ho(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!wn(r.value))),all:(e,t,n)=>Je(t.every(r=>Ho(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Je(!1);return Je(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Je(!0);return Je(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Je(!1);return Je(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Je(!0);return Je(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Je(!0);const r=n.eval(e,Us(e));return r.length===0?Je(!1):Je(t.every(o=>r.some(i=>i.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Us(e));return r.length===0?Je(!0):t.length===0?Je(!1):Je(r.every(o=>t.some(i=>i.value===o.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Je(t.length===br.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Ho(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:mi,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e)),o=[];for(const i of t)!o.some(l=>l.value===i.value)&&r.some(l=>l.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e)),o=[];for(const i of t)r.some(l=>l.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e));return PT([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Us(e));return[...t,...r]},htmlChecks:(e,t,n)=>[io(!0)],iif:(e,t,n,r,o)=>{const i=n.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Ho(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Je(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Je(!0);if(["false","f","no","n","0","0.0"].includes(r))return Je(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Je(br.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="number"?[{type:re.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:re.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:re.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Je(br.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:xf(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Je(br.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:xf(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Je(br.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return typeof n=="number"?[{type:re.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:re.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:re.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Je(br.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return no(n)?[{type:re.Quantity,value:n}]:typeof n=="number"?[{type:re.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:re.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:re.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Je(br.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);return n==null?[]:no(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Je(br.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Uo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:xf("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Je(br.toTime(e,t).length===1),indexOf:(e,t,n)=>Zr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Zr((o,i,l)=>{const u=i,d=l?u+l:o.length;return u<0||u>=o.length?void 0:o.substring(u,d)},e,t,n,r),startsWith:(e,t,n)=>Zr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Zr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Zr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Zr(n=>n.toUpperCase(),e,t),lower:(e,t)=>Zr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Zr((o,i,l)=>o.replaceAll(i,l),e,t,n,r),matches:(e,t,n)=>Zr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Zr((o,i,l)=>o.replaceAll(i,l),e,t,n,r),length:(e,t)=>Zr(n=>n.length,e,t),toChars:(e,t)=>Zr(n=>n?n.split(""):void 0,e,t),encode:mi,decode:mi,escape:mi,unescape:mi,trim:mi,split:mi,join:(e,t,n)=>{var o;const r=((o=n==null?void 0:n.eval(e,Us(e))[0])==null?void 0:o.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(i=>{var l;return((l=i.value)==null?void 0:l.toString())??""}).join(r)}]},abs:(e,t)=>zo(Math.abs,e,t),ceiling:(e,t)=>zo(Math.ceil,e,t),exp:(e,t)=>zo(Math.exp,e,t),floor:(e,t)=>zo(Math.floor,e,t),ln:(e,t)=>zo(Math.log,e,t),log:(e,t,n)=>zo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>zo(Math.pow,e,t,n),round:(e,t)=>zo(Math.round,e,t),sqrt:(e,t)=>zo(Math.sqrt,e,t),truncate:(e,t)=>zo(n=>n|0,e,t),children:mi,descendants:mi,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var p;const i=br.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const l=br.toDateTime(e,r.eval(e,t));if(l.length===0)throw new Error("Invalid end date");const u=(p=o.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const d=IT(i[0].value,l[0].value);return[{type:re.Quantity,value:{value:d[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof $f?r=n.name:n instanceof Sx&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:re.boolean,value:_T(o,r)})):[]},not:(e,t)=>br.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const i=r;if(i.resource)return io(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,l]=o.split("/");return{type:i,value:{resourceType:i,id:l}}}return{type:re.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:re.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:re.BackboneElement,value:{namespace:"System",name:"Integer"}}:ni(n)?{type:re.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:re.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(i=>{var l;return{type:re.boolean,value:((l=i.value)==null?void 0:l.resourceType)===o}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let o="";return n instanceof $f&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:re.id,value:ca(r)}]},extension:(e,t,n)=>{var i;const r=n.eval(e,t)[0].value,o=(i=t==null?void 0:t[0])==null?void 0:i.value;if(o){const l=Cs(o,r);if(l)return[{type:re.Extension,value:l}]}return[]}};function Zr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Uo(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(l=>{var u;return(u=l==null?void 0:l.eval(t,n)[0])==null?void 0:u.value}));return i===void 0?[]:Array.isArray(i)?i.map(io):[io(i)]}function zo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=Uo(n,1),i=no(o),l=i?o.value:o;if(typeof l!="number")throw new Error("Math function cannot be called with non-number");const u=e(l,...r.map(h=>{var m;return(m=h.eval(t,n)[0])==null?void 0:m.value})),d=i?re.Quantity:n[0].type,p=i?{...o,value:u}:u;return[{type:d,value:p}]}function Uo(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const n of e)if(n==null)throw new Error("Expected non-null argument");return e}function Us(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class WT{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class dl{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class $f{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>(o==null?void 0:o.value)!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return ni(n,this.name)?t:Nl(t,this.name)}toString(){return this.name}}class nF{eval(){return[]}toString(){return"{}"}}class rF extends N5{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 Ff extends Ru{constructor(t,n){super("as",t,n)}eval(t,n){return br.ofType(t,this.left.eval(t,n),this.right)}}class Tr extends Ru{}class bo extends Tr{constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const i=r[0].value,l=o[0].value,u=no(i)?i.value:i,d=no(l)?l.value:l,p=this.impl(u,d);return typeof p=="boolean"?Je(p):no(i)?[{type:re.Quantity,value:{...i,value:p}}]:[io(p)]}}class oF extends Ru{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),i=[...r,...o];return i.length>0&&i.every(l=>typeof l.value=="string")?[{type:re.string,value:i.map(l=>l.value).join("")}]:i}}class iF extends Tr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Je(r.some(i=>i.value===o[0].value))}}class sF extends Tr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ei(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Je(o.some(i=>Up(r,i)[0].value)):[]}}class Sx extends Ru{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 jx extends Ru{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return PT([...r,...o])}}class aF extends Tr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return p7(r,o)}}class lF extends Tr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return h7(r,o)}}class cF extends Tr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return RT(r,o)}}class uF extends Tr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return f7(RT(r,o))}}class Cx extends Tr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return Je(_T(r[0],o))}}class dF extends Tr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ei(this.left.eval(t,n),"boolean"),o=Ei(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?Je(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?Je(!1):[]}}class fF extends Tr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ei(this.left.eval(t,n),"boolean"),o=Ei(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?Je(!1):r!=null&&r.value||o!=null&&o.value?Je(!0):[]}}class pF extends Tr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ei(this.left.eval(t,n),"boolean"),o=Ei(this.right.eval(t,n),"boolean");return!r||!o?[]:Je(r.value!==o.value)}}class hF extends Tr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ei(this.left.eval(t,n),"boolean"),o=Ei(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?Je(!0):!r||!o?[]:Je(!1)}}class Ex{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=br[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 kx{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const i=this.left.eval(t,n);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const mF=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class gF{constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0:o.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||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()!==`
|
|
92
|
+
`))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(i,l)=>String.fromCodePoint(parseInt(l,16))),o=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),o}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 o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&vF(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
|
|
93
|
+
`?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function vF(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&mF.includes(e.value)))}const yF=["true","false"],xF=["!=","!~","<=",">=","{}","->"];function bF(e){return new gF(e,yF,xF).tokenize()}const qt={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},wF={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}},SF={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new kx(t,n)},precedence:qt.Indexer},jF={parse(e,t){if(!(t instanceof $f))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Ex(t.name,n)},precedence:qt.FunctionCall};function CF(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 EF(){return new O5().registerPrefix("String",{parse:(e,t)=>new dl({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new dl({type:re.dateTime,value:xf(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new dl({type:re.Quantity,value:CF(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new dl({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new dl({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new dl({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new $f(t.value)}).registerPrefix("{}",{parse:()=>new nF}).registerPrefix("(",wF).registerInfix("[",SF).registerInfix("(",jF).prefix("+",qt.UnaryAdd,(e,t)=>new rF("+",t,n=>n)).prefix("-",qt.UnarySubtract,(e,t)=>new bo("-",t,t,(n,r)=>-r)).infixLeft(".",qt.Dot,(e,t,n)=>new Sx(e,n)).infixLeft("/",qt.Divide,(e,t,n)=>new bo("/",e,n,(r,o)=>r/o)).infixLeft("*",qt.Multiply,(e,t,n)=>new bo("*",e,n,(r,o)=>r*o)).infixLeft("+",qt.Add,(e,t,n)=>new bo("+",e,n,(r,o)=>r+o)).infixLeft("-",qt.Subtract,(e,t,n)=>new bo("-",e,n,(r,o)=>r-o)).infixLeft("|",qt.Union,(e,t,n)=>new jx(e,n)).infixLeft("=",qt.Equals,(e,t,n)=>new aF(e,n)).infixLeft("!=",qt.NotEquals,(e,t,n)=>new lF(e,n)).infixLeft("~",qt.Equivalent,(e,t,n)=>new cF(e,n)).infixLeft("!~",qt.NotEquivalent,(e,t,n)=>new uF(e,n)).infixLeft("<",qt.LessThan,(e,t,n)=>new bo("<",e,n,(r,o)=>r<o)).infixLeft("<=",qt.LessThanOrEquals,(e,t,n)=>new bo("<=",e,n,(r,o)=>r<=o)).infixLeft(">",qt.GreaterThan,(e,t,n)=>new bo(">",e,n,(r,o)=>r>o)).infixLeft(">=",qt.GreaterThanOrEquals,(e,t,n)=>new bo(">=",e,n,(r,o)=>r>=o)).infixLeft("&",qt.Ampersand,(e,t,n)=>new oF(e,n)).infixLeft("and",qt.And,(e,t,n)=>new dF(e,n)).infixLeft("as",qt.As,(e,t,n)=>new Ff(e,n)).infixLeft("contains",qt.Contains,(e,t,n)=>new iF(e,n)).infixLeft("div",qt.Divide,(e,t,n)=>new bo("div",e,n,(r,o)=>r/o|0)).infixLeft("in",qt.In,(e,t,n)=>new sF(e,n)).infixLeft("is",qt.Is,(e,t,n)=>new Cx(e,n)).infixLeft("mod",qt.Modulo,(e,t,n)=>new bo("mod",e,n,(r,o)=>r%o)).infixLeft("or",qt.Or,(e,t,n)=>new fF(e,n)).infixLeft("xor",qt.Xor,(e,t,n)=>new pF(e,n)).infixLeft("implies",qt.Implies,(e,t,n)=>new hF(e,n))}const kF=EF();function Tx(e){return new WT(e,kF.construct(bF(e)).consumeAndParse())}function Xl(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=io(n[r]))}return da(e,n).map(r=>r.value)}function da(e,t,n={},r=void 0){let o;if(typeof e=="string"){const i=r==null?void 0:r.get(e);o=i??Tx(e),r&&!i&&r.set(e,o)}else o=e;return o.eval({variables:n},t).map(i=>{var l;return{type:i.type,value:(l=i.value)==null?void 0:l.valueOf()}})}const qn={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Jl(e,t){var r,o;let n=(o=(r=Jo.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=PF(e,t)),n}function TF(e,t,n){let r=Jo.types[e];r||(r={},Jo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function PF(e,t){const n=t.code,r=IF(e,t.expression),o={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of r){const u=bf(l),d=M7(()=>u.join("."));u.length===1&&u[0]instanceof Tr?o.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?o.propertyTypes.add("Identifier"):d().endsWith("extension.value.code")||d().endsWith("extension.value.coding.code")?(o.array=!0,o.propertyTypes.add("code")):HT(o,u,e,1),d().endsWith("extension.valueDateTime")&&(o.array=!1)}const i={type:DF(t,o.propertyTypes),elementDefinitions:o.elementDefinitions,parsedExpression:AF(e,t.expression),array:o.array};return TF(e,n,i),i}function HT(e,t,n,r){const o=t[r];if(o instanceof Ff){e.propertyTypes.add(o.right.toString());return}if(o instanceof Ex){RF(e,o);return}const i=o.toString(),l=Ea(n,i);if(!l)throw new Error(`Element definition not found for ${n} ${i}`);let u=!1,d=r+1;d<t.length&&t[d]instanceof kx&&(u=!0,d++);const p=t[d];if(l.isArray&&!u&&(e.array=!0),d===t.length-1&&p instanceof Ff){e.elementDefinitions.push(l),e.propertyTypes.add(p.right.toString());return}if(d>=t.length){e.elementDefinitions.push(l);for(const h of l.type)e.propertyTypes.add(h.code);return}for(const h of l.type){let m=h.code;_F(m)&&(m=l.type[0].code),HT(e,t,m,d)}}function RF(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 Cx){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function _F(e){return e==="Element"||e==="BackboneElement"}function DF(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?qn.DATE:qn.DATETIME;case"number":return qn.NUMBER;case"quantity":return qn.QUANTITY;case"reference":return t.has(re.canonical)?qn.CANONICAL:qn.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?qn.BOOLEAN:qn.TEXT;default:return qn.TEXT}}function IF(e,t){const n=[],r=Tx(t);return zf(e,r.child,n),n}function AF(e,t){const n=[],r=Tx(t);if(zf(e,r.child,n),n.length===0)return r;let o=n[0];for(let i=1;i<n.length;i++)o=new jx(o,n[i]);return new WT("<original-not-available>",o)}function zf(e,t,n){t instanceof jx?(zf(e,t.left,n),zf(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function bf(e){if(e instanceof Ff||e instanceof kx)return[bf(e.left),e].flat();if(e instanceof Tr)return[e];if(e instanceof Sx)return[bf(e.left),bf(e.right)].flat();if(e instanceof Ex){if(e.name==="where"&&!(e.args[0]instanceof Cx))return[];if(e.name==="last")return[]}return[e]}const Hp=20,le={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"},qT={contains:le.CONTAINS,exact:le.EXACT,above:le.ABOVE,below:le.BELOW,text:le.TEXT,not:le.NOT,in:le.IN,"not-in":le.NOT_IN,"of-type":le.OF_TYPE,missing:le.MISSING,identifier:le.IDENTIFIER,iterate:le.ITERATE},Px={eq:le.EQUALS,ne:le.NOT_EQUALS,lt:le.LESS_THAN,le:le.LESS_THAN_OR_EQUALS,gt:le.GREATER_THAN,ge:le.GREATER_THAN_OR_EQUALS,sa:le.STARTS_AFTER,eb:le.ENDS_BEFORE,ap:le.APPROXIMATELY,sw:le.STARTS_WITH};function GT(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[l,u]=e.split("?");n=l,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const i=[];return r&&i.push(...r.entries()),NF(o,i)}function NF(e,t){const n={resourceType:e};for(const[r,o]of t)OF(n,r,o);return n}function OF(e,t,n){var l,u;let r,o;const i=t.indexOf(":");if(i>=0?(r=t.substring(0,i),o=t.substring(i+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Fc(e.filters,{code:t,operator:le.EQUALS,value:n});return}switch(r){case"_sort":MF(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 d=_S(n);o==="iterate"&&(d.modifier=le.ITERATE),e.include=Fc(e.include,d);break}case"_revinclude":{const d=_S(n);o==="iterate"&&(d.modifier=le.ITERATE),e.revInclude=Fc(e.revInclude,d);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 d=(u=(l=Jo.types[e.resourceType])==null?void 0:l.searchParams)==null?void 0:u[r];d?e.filters=Fc(e.filters,$F(d,o,n)):e.filters=Fc(e.filters,FF(r,o,n))}}}}function MF(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}const LF=[le.MISSING,le.PRESENT];function $F(e,t,n){if(LF.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=zF(n);if(!DS(e,o))throw new ft(Qo(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!DS(e,n))throw new ft(Qo(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:VF(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function FF(e,t,n){var o;let r=le.EQUALS;if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in Px&&(n.length===2||(o=n.at(2))!=null&&o.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function zF(e){const t=e.substring(0,2),n=Px[t];return n?{operator:n,value:e.substring(2)}:{operator:le.EQUALS,value:e}}function VF(e){return qT[e]??le.EQUALS}function _S(e){const t=e.split(":");if(t.includes("*"))throw new ft(Qo("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ft(Qo(`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 ft(Qo(`Invalid include value '${e}'`))}function DS(e,t){switch(e.type){case"date":return Lf(t);default:return!0}}function xl(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(BF(n))),e.sortRules&&e.sortRules.length>0&&t.push(UF(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(IS("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(IS("_revinclude",n))),t.length===0?"":(su(t),"?"+t.join("&"))}function BF(e){const t=e.operator in qT?":"+e.operator:"",n=e.operator!==le.EQUALS&&e.operator in Px?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function UF(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function IS(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Rx(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function WF(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!HF(e,t,n))return!1}return!0}function HF(e,t,n){var o,i;const r=(i=(o=Jo.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:i[n.code];if(!r)return!1;if(n.operator===le.MISSING||n.operator===le.PRESENT)return qF(e,n,r);switch(r.type){case"reference":return GF(e,n,r);case"string":case"uri":return QT(e,n,r);case"token":return QF(e,n,r);case"date":return JF(e,n,r);default:return!1}}function qF(e,t,n){const o=Xl(n.expression,e).length>0;return(t.operator===le.MISSING&&t.value==="false"||t.operator===le.PRESENT&&t.value==="true")===o}function GF(e,t,n){const r=Xl(n.expression,e),o=qp(t.operator);if(t.value===""&&r.length===0)return t.operator===le.EQUALS;const i=r.map(l=>typeof l=="string"?l:l.reference);for(const l of Rx(t.value)){let u=i.includes(l);if(!u&&t.code==="_compartment"&&(u=i.some(d=>d==null?void 0:d.endsWith("/"+l))),u)return!o}return o}function QF(e,t,n){return Jl(e.resourceType,n).type===qn.BOOLEAN?KF(e,t,n):QT(e,t,n,!0)}function KF(e,t,n){const r=Xl(n.expression,e),o=t.value==="true",i=r.includes(o);return qp(t.operator)?!i:i}function QT(e,t,n,r){var p,h,m,v;const i=(v=(m=(h=(p=Jl(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:h.type)==null?void 0:m[0])==null?void 0:v.code,l=Xl(n.expression,e),u=Rx(t.value),d=qp(t.operator);for(const x of l)for(const b of u){let w;if(i===re.Identifier?w=YF(x,t.operator,b):i===re.CodeableConcept?w=XF(x,t.operator,b):w=rv(x,t.operator,b,r),w)return!d}return d}function rv(e,t,n,r){if(r&&n.includes("|")){const[i,l]=n.split("|");return rv(e,t,i,!1)&&(!l||rv(e,t,l,!1))}let o="";return e&&(typeof e=="string"?o=e:typeof e=="object"&&(o=JSON.stringify(e))),o.toLowerCase().includes(n.toLowerCase())}function YF(e,t,n){var r,o,i,l;if(n.includes("|")){const[u,d]=n.split("|").map(p=>p.toLowerCase());return!u&&!d?!1:u?((o=e.system)==null?void 0:o.toLowerCase())===u&&(!d||((i=e.value)==null?void 0:i.toLowerCase())===d):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===d}return((l=e.value)==null?void 0:l.toLowerCase())===n.toLowerCase()}function XF(e,t,n){var r,o,i,l;if(n.includes("|")){const[u,d]=n.split("|").map(p=>p.toLowerCase());return!u&&!d?!1:u?((o=e.coding)==null?void 0:o.some(p=>{var h,m;return((h=p.system)==null?void 0:h.toLowerCase())===u&&(!d||((m=p.code)==null?void 0:m.toLowerCase())===d)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var h;return!p.system&&((h=p.code)==null?void 0:h.toLowerCase())===d}))??!1}return((i=e.text)==null?void 0:i.toLowerCase())===n.toLowerCase()||(((l=e.coding)==null?void 0:l.some(u=>{var d;return((d=u.code)==null?void 0:d.toLowerCase())===n.toLowerCase()}))??!1)}function JF(e,t,n){const r=Xl(n.expression,e),o=Rx(t.value),i=qp(t.operator);for(const l of r)for(const u of o)if(ZF(l,t.operator,u))return!i;return i}function ZF(e,t,n){switch(t){case le.STARTS_AFTER:case le.GREATER_THAN:return e>n;case le.GREATER_THAN_OR_EQUALS:return e>=n;case le.ENDS_BEFORE:case le.LESS_THAN:return e<n;case le.LESS_THAN_OR_EQUALS:return e<=n;case le.EQUALS:case le.NOT_EQUALS:return e===n;default:return!1}}function qp(e){return e===le.NOT_EQUALS||e===le.NOT}const e6={resourceType:"*"},t6=["DomainConfiguration","JsonWebKey","Login"],n6=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],bl={READ:"read",VREAD:"vread",HISTORY:"history",HISTORY_INSTANCE:"history-instance"},r6=[bl.READ,bl.VREAD,bl.HISTORY,bl.HISTORY_INSTANCE];function o6(e,t){if(t6.includes(t))return!1;if(e.resource){for(const n of e.resource)if(YT(n.resourceType,t)&&!n.readonly)return!0}return!1}function KT(e,t,n){if(!n)return e6;if(n.resource){for(const r of n.resource)if(i6(e,t,r))return r}}function i6(e,t,n){var o,i;const r=e.resourceType;return!(!YT(n.resourceType,r)||n.readonly&&!r6.includes(t)||n.compartment&&!((i=(o=e.meta)==null?void 0:o.compartment)!=null&&i.find(l=>{var u;return l.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!WF(e,GT(n.criteria)))}function YT(e,t){return e===t||e==="*"&&!n6.includes(t)}function s6(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 AS(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 NS(){const e=new Uint32Array(28);return crypto.getRandomValues(e),I7(e.buffer)}async function a6(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function XT(){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 JT(e){var o;const t={};e=Vr(e);for(const i of e.entry||[]){const l=i.resource;if(!l)continue;l.meta!==void 0&&(delete l.meta.author,delete l.meta.compartment,delete l.meta.lastUpdated,delete l.meta.project,delete l.meta.versionId,Object.keys(l.meta).length===0&&delete l.meta);const u=l==null?void 0:l.id;u&&(t[u]=XT(),i.fullUrl="urn:uuid:"+t[u],(o=i.resource)==null||delete o.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(i=>{var l;return{fullUrl:i.fullUrl,request:{method:"POST",url:(l=i.resource)==null?void 0:l.resourceType},resource:i.resource}})},(i,l)=>l6(i,l,t),2);return c6(JSON.parse(r))}function l6(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function c6(e){const t=d6(e),{sorted:n,cycles:r}=u6(t),o={};for(const l of e.entry??[])l.fullUrl&&(o[l.fullUrl]=l);const i=n.map(l=>o[l]);for(const l of r)for(const u of l){const d=o[u],p={...d,request:{...d.request,method:"PUT"}};i.push(p)}return{...e,entry:i}}const fl={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function u6(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=fl.NotVisited;function o(i,l){if(n[i]===fl.Visited)return!0;if(n[i]===fl.Visiting){const d=l.lastIndexOf(i);return d!==-1&&r.push(l.slice(d)),!0}n[i]=fl.Visiting,l.push(i);let u=!1;for(const d of e[i])o(d,l)||(u=!0);return n[i]=fl.Visited,l.pop(),t.unshift(i),!u}for(const i in e)n[i]===fl.NotVisited&&o(i,[]);return{sorted:t,cycles:r}}function ZT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Es(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else ZT(r,t)}}function d6(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&&ZT(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const nn={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 f6{constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}}class Gp{constructor(){this.emitter=new f6}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 ov={"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"},p6=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],_x=["DiagnosticReport-update"];function h6(e){return _x.includes(e)}function m6(e){if(_x.includes(e))throw new ft(fn(`'context.version' is required for '${e}'.`))}const g6={"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 v6(e){return p6.includes(e)}function eP(e){return!!e.endpoint}function OS(e){if(!Dx(e))throw new ft(fn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,i={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return eP(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function Dx(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const i of o)if(!ov[i])return!1;return!(eP(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function y6(e,t,n,r){if(typeof t!="object")throw new ft(fn(`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 ft(fn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ft(fn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!v6(t.resourceType))throw new ft(fn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new ft(fn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function x6(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!Es(t.reference))throw new ft(fn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else y6(e,t.resource,n,r)}function b6(e,t){const n=new Map,r=g6[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new ft(fn(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));x6(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new ft(fn(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)??0)>1)throw new ft(fn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function MS(e,t,n,r){if(!(e&&typeof e=="string"))throw new ft(fn("Must provide a topic."));if(!ov[t])throw new ft(fn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(ov).join(", ")}`));if(typeof n!="object")throw new ft(fn("context must be a context object or array of context objects."));if(_x.includes(t)&&!r)throw new ft(fn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return b6(t,o),{timestamp:new Date().toISOString(),id:XT(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class w6 extends Gp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ft(fn("Subscription request should contain an endpoint."));if(!Dx(t))throw new ft(fn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const i=o;i.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:i}),n.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function S6(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=s6(t),r=Array.from(n).reduce((i,l)=>{const u=("00"+l.charCodeAt(0).toString(16)).slice(-2);return`${i}%${u}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function j6(e){return e.split(".").length===3}function Ix(e){const[t,n,r]=e.split(".");return S6(n)}function C6(e){try{return typeof Ix(e).login_id=="string"}catch{return!1}}function E6(e){try{const n=Ix(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class k6{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,nn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var tP;tP=Symbol.toStringTag;class wo{constructor(t){this[tP]="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 T6{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new P6)}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?Po(n):void 0)}}class P6{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]}}/*!
|
|
94
|
+
* Reconnecting WebSocket
|
|
95
|
+
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
96
|
+
* https://github.com/pladaria/reconnecting-websocket
|
|
97
|
+
* License MIT
|
|
98
|
+
*
|
|
99
|
+
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
100
|
+
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
101
|
+
*/const Cl={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let LS=!1;function R6(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Cl.Event=globalThis.Event,Cl.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Cl.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function _6(e,t){if(!e)throw new Error(t)}function sf(e){return new e.constructor(e.type,e)}const Ws={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let $S=!1;class us extends Gp{constructor(t,n,r={}){LS||(R6(),LS=!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=o=>{this._debug("open event");const{minUptime:i=Ws.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),i),_6(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(l=>{var u;return(u=this._ws)==null?void 0:u.send(l)}),this._messageQueue=[],this.onopen&&this.onopen(o),this.dispatchEvent(sf(o))},this._handleMessage=o=>{this._debug("message event"),this.onmessage&&this.onmessage(o),this.dispatchEvent(sf(o))},this._handleError=o=>{this._debug("error event",o.message),this._disconnect(void 0,o.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(o),this._debug("exec error listeners"),this.dispatchEvent(sf(o)),this._connect()},this._handleClose=o=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(o),this.dispatchEvent(sf(o))},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 us.CONNECTING}get OPEN(){return us.OPEN}get CLOSING(){return us.CLOSING}get CLOSED(){return us.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,o)=>(typeof o=="string"?r+=o.length:o instanceof Blob?r+=o.size:r+=o.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?us.CLOSED:us.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=Ws.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=Ws.reconnectionDelayGrowFactor,minReconnectionDelay:n=Ws.minReconnectionDelay,maxReconnectionDelay:r=Ws.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Ws.maxRetries,connectionTimeout:n=Ws.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"&&!$S&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),$S=!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 Cl.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Cl.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Cl.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 D6=5e3;class iv extends Gp{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 I6{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new iv(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class A6{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof rP))throw new ft(fn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new ft(fn("Not a valid URL"))}const i=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new us(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=i,this.masterSubEmitter=new iv,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??D6,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,i,l,u,d;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const h=p,m=(o=(r=h==null?void 0:h.entry)==null?void 0:r[0])==null?void 0:o.resource;if(m.type==="heartbeat"){(i=this.masterSubEmitter)==null||i.dispatchEvent({type:"heartbeat",payload:h});return}if(m.type==="handshake"){const x=ca(m.subscription),b={type:"connect",payload:{subscriptionId:x}};(l=this.masterSubEmitter)==null||l.dispatchEvent(b);const w=this.criteriaEntriesBySubscriptionId.get(x);if(!w){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}w.connecting=!1,w.emitter.dispatchEvent({...b});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:h});const v=this.criteriaEntriesBySubscriptionId.get(ca(m.subscription));if(!v){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}v.emitter.dispatchEvent({type:"message",payload:h})}catch(p){console.error(p);const h={type:"error",payload:p};(d=this.masterSubEmitter)==null||d.dispatchEvent(h);for(const m of this.getAllCriteriaEmitters())m.dispatchEvent({...h})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new ft(G5(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,o;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(o=this.masterSubEmitter)==null||o.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.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 o;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const o={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(o),t.emitter.dispatchEvent({...o})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var l,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 ${Dt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=(l=r==null?void 0:r.find(d=>d.name==="token"))==null?void 0:l.valueString,i=(u=r==null?void 0:r.find(d=>d.name==="websocket-url"))==null?void 0:u.valueUrl;if(!o)throw new ft(fn("Failed to get token"));if(!i)throw new ft(fn("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(vs(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:o,token:i}=t;if(!this.criteriaEntries.has(n))return;const l=this.criteriaEntries.get(n);r?l.criteriaWithProps=l.criteriaWithProps.filter(d=>{const p=d.subscriptionProps;return!vs(r,p)}):l.bareCriteria=void 0,!l.bareCriteria&&l.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),i&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:i}}))}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(tt(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 o=new I6(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}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 iv(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const nP="4.1.0-48218c80e",N6=nn.FHIR_JSON+", */*; q=0.1",O6="https://api.medplum.com/",M6=1e3,L6=6e4,$6=0,F6=3e5,z6="Binary/",FS={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},pl={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"},V6={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},B6={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class rP extends Gp{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)??U6(),this.storage=(t==null?void 0:t.storage)??new T6,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=bx((t==null?void 0:t.baseUrl)??O6),this.fhirBaseUrl=Bo(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Bo(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Bo(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Bo(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=Bo(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)??F6,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?$6:L6),this.cacheTime>0?this.requestCache=new ET((t==null?void 0:t.resourceCacheSize)??M6):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=Bo(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?o=new Promise((l,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:l,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new wo(o);return this.setCacheEntry(t,i),i}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,nn.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,i=!0){let l=o;i&&(l=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,l,i))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:pl.TokenExchange,subject_token_type:V6.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,o,i=!0){const l=new URL(t);if(l.searchParams.set("response_type","code"),l.searchParams.set("client_id",n),l.searchParams.set("redirect_uri",r),l.searchParams.set("scope",o.scope??"openid profile email"),l.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:u,codeChallengeMethod:d}=o;if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");l.searchParams.set("code_challenge_method",d),l.searchParams.set("code_challenge",u)}return l.toString()}fhirUrl(...t){return new URL(Bo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=F7(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),l=this.getCacheEntry(i,r);if(l)return l.value;const u=this.getBundle(o,r);return this.setCacheEntry(i,u),u}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const i="searchOne-"+o.toString(),l=this.getCacheEntry(i,r);if(l)return l.value;const u=new wo(this.search(t,o.searchParams,r).then(d=>{var p,h;return(h=(p=d.entry)==null?void 0:p[0])==null?void 0:h.resource}));return this.setCacheEntry(i,u),u}searchResources(t,n,r){const i="searchResources-"+this.fhirSearchUrl(t,n).toString(),l=this.getCacheEntry(i,r);if(l)return l.value;const u=new wo(this.search(t,n,r).then(BS));return this.setCacheEntry(i,u),u}async*searchResourcePages(t,n,r){var i,l;let o=this.fhirSearchUrl(t,n);for(;o;){const u=new URL(o).searchParams,d=await this.search(t,u,r),p=(i=d.link)==null?void 0:i.find(h=>h.relation==="next");if(!((l=d.entry)!=null&&l.length)&&!p)break;yield BS(d),o=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 o,i;const r=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,n).toString()))==null?void 0:i.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return FS;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}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 wo(Promise.reject(new Error("Missing reference")));if(r==="system")return new wo(Promise.resolve(FS));const[o,i]=r.split("/");return!o||!i?new wo(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(jT(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new wo((async()=>{const i=`{
|
|
102
|
+
StructureDefinitionList(name: "${t}") {
|
|
103
|
+
resourceType,
|
|
104
|
+
name,
|
|
105
|
+
kind,
|
|
106
|
+
description,
|
|
107
|
+
type,
|
|
108
|
+
url,
|
|
109
|
+
snapshot {
|
|
110
|
+
element {
|
|
111
|
+
id,
|
|
112
|
+
path,
|
|
113
|
+
definition,
|
|
114
|
+
min,
|
|
115
|
+
max,
|
|
116
|
+
base {
|
|
117
|
+
path,
|
|
118
|
+
min,
|
|
119
|
+
max
|
|
120
|
+
},
|
|
121
|
+
contentReference,
|
|
122
|
+
type {
|
|
123
|
+
code,
|
|
124
|
+
profile,
|
|
125
|
+
targetProfile
|
|
126
|
+
},
|
|
127
|
+
binding {
|
|
128
|
+
strength,
|
|
129
|
+
valueSet
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
135
|
+
base,
|
|
136
|
+
code,
|
|
137
|
+
type,
|
|
138
|
+
expression,
|
|
139
|
+
target
|
|
140
|
+
}
|
|
141
|
+
}`.replace(/\s+/g," "),l=await this.graphql(i);bS(l.data.StructureDefinitionList.filter(u=>u.name===t));for(const u of l.data.SearchParameterList)Y7(u)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&mx(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const i=new wo((async()=>{if(n!=null&&n.expandProfile){const l=this.fhirUrl("StructureDefinition","$expand-profile");l.search=new URLSearchParams({url:t}).toString();const u=await this.post(l.toString(),{});bS(u)}else{const l=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!l){console.warn(`No StructureDefinition found for ${t}!`);return}ST(l)}})());return this.setCacheEntry(r,i),i}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.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 o=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 i=await this.post(o,t,void 0,r);return this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),i}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let i=await this.put(o,t,void 0,r);return i||(i=t),this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),i}async createAttachment(t,n,r,o,i){let l=US(t,n,r,o);if(l.contentType===nn.XML){const p=l.data;let h;p instanceof Blob?h=await new Promise((m,v)=>{const x=new FileReader;x.onload=()=>{if(!x.result){v(new Error("Failed to load file"));return}m(x.result)},x.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?h=new TextDecoder().decode(p):h=p,h.includes("<ClinicalDocument")&&h.includes("urn:hl7-org:v3")&&(l={...l,contentType:nn.CDA_XML})}const u=i??(typeof n=="object"?n:{}),d=await this.createBinary(l,u);return{contentType:l.contentType,url:d.url,title:l.filename}}createBinary(t,n,r,o,i){const l=US(t,n,r,o),u=i??(typeof n=="object"?n:{}),{data:d,contentType:p,filename:h,securityContext:m,onProgress:v}=l,x=this.fhirUrl("Binary");return h&&x.searchParams.set("_filename",h),m!=null&&m.reference&&this.setRequestHeader(u,"X-Security-Context",m.reference),v?this.uploadwithProgress(x,d,p,v,u):this.post(x,d,p,u)}uploadwithProgress(t,n,r,o,i){return new Promise((l,u)=>{var m;const d=new XMLHttpRequest,p=()=>d.abort();(m=i==null?void 0:i.signal)==null||m.addEventListener("abort",p);const h=v=>{var x;(x=i==null?void 0:i.signal)==null||x.removeEventListener("abort",p),v instanceof Error?u(v):l(v)};if(d.responseType="json",d.onabort=()=>h(new DOMException("Request aborted","AbortError")),d.onerror=()=>h(new Error("Request error")),o&&(d.upload.onprogress=v=>o(v),d.upload.onload=v=>o(v)),d.onload=()=>{d.status>=200&&d.status<300?h(d.response):h(new ft(Gt(d.response||d.statusText)))},d.open("POST",t),d.withCredentials=!0,d.setRequestHeader("Authorization","Bearer "+this.accessToken),d.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),d.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&d.setRequestHeader("X-Medplum","extended"),i!=null&&i.headers){const v=i.headers;for(const[x,b]of Object.entries(v))d.setRequestHeader(x,b)}d.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=q6(t,n,r,o),l=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:d,fonts:p,...h}=i,m=await this.createPdfImpl(u,d,p),v={...h,data:m,contentType:"application/pdf"};return this.createBinary(v,l)}createComment(t,n,r){const o=this.getProfile();let i,l;return t.resourceType==="Encounter"&&(i=rn(t),l=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,l=t.subject),t.resourceType==="Patient"&&(l=rn(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[rn(t)],encounter:i,subject:l,sender:o?rn(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const i=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),i}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,o){let i;if(typeof t=="string"){const l=t;i=this.fhirUrl("Bot",l,"$execute")}else{const l=t;i=this.fhirUrl("Bot","$execute"),i.searchParams.set("identifier",l.system+"|"+l.value)}return this.post(i,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,nn.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},nn.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,l){return this.post(this.fhirUrl("Agent",ca(t),"$push"),{destination:typeof n=="string"?n:Dt(n),body:r,contentType:o,waitForResponse:i},nn.FHIR_JSON,l)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||Dt(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=E6(t),this.medplumServer=C6(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var o,i;return((o=r.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var i,l;this.profilePromise=void 0;const o=((l=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:l.id)!==r.profile.id;this.sessionDetails=r,o&&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(z6)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,i=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=rn(i));const l=await this.createAttachment(o,n);return this.updateResource({...i,status:"completed",content:l})}async uploadMedia(t,n,r,o,i){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},i)}async bulkExport(t="",n,r,o){const i=t&&`${t}/`,l=this.fhirUrl(`${i}$export`);return n&&l.searchParams.set("_type",n),r&&l.searchParams.set("_since",r),this.startAsyncRequest(l.toString(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new k6(this)),this.keyValueClient}getBundle(t,n){return new wo((async()=>{const r=await this.get(t,n);if(r.entry)for(const o of r.entry)this.cacheResource(o.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(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new wo(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const i=await this.fetchWithRetry(n,r);if(i.status===401)return this.handleUnauthenticated(t,n,r);if(i.status===204||i.status===304)return;const l=i.headers.get("content-type"),u=l==null?void 0:l.includes("json");if(i.status===404&&!u)throw new ft(H5);const d=await this.parseBody(i,u);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const p=await VS(i,d);if(p)return this.request("GET",p,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const h=await VS(i,d)??o.statusUrl;if(h)return this.pollStatus(h,r,o)}if(i.status>=400)throw new ft(Gt(d));return d}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Bo(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,o=200;for(let i=0;i<=r;i++){try{this.options.verbose&&this.logRequest(t,n);const l=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(l),l.status<500||i===r)return l}catch(l){if(l.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),l.name==="AbortError"||i===r)throw l}await PS(o)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of su(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const i=n.pollStatusPeriod??1e3;await PS(i),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){var o,i;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const l=t[0];try{l.resolve(await this.request(l.method,Bo(this.fhirBaseUrl,l.url),l.options))}catch(u){l.reject(new ft(Gt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(l=>({request:{method:l.method,url:l.url},resource:l.options.body?JSON.parse(l.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let l=0;l<t.length;l++){const u=t[l],d=(o=r.entry)==null?void 0:o[l];(i=d==null?void 0:d.response)!=null&&i.outcome&&!yT(d.response.outcome)?u.reject(new ft(d.response.outcome)):u.resolve(d==null?void 0:d.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",N6,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",nn.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){t.headers||(t.headers={});const i=t.headers;o&&i[n]||(i[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==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 ft(iu)))}async startPkce(){const t=NS();sessionStorage.setItem("pkceState",t);const n=NS().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await a6(n),o=A7(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??zS()),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:pl.AuthorizationCode,code:t,client_id:(n==null?void 0:n.clientId)??this.clientId??"",redirect_uri:(n==null?void 0:n.redirectUri)??zS()};if(typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&(r.code_verifier=o)}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:pl.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:pl.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:pl.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:pl.ClientCredentials,client_assertion_type:B6.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=AS(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ft(fn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ft(fn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},i=(await this.post(this.fhircastHubUrl,OS(r),nn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!Dx(t))throw new ft(fn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ft(fn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,OS(t),nn.FORM_URL_ENCODED)}fhircastConnect(t){return new w6(t)}async fhircastPublish(t,n,r,o){return h6(n)?this.post(this.fhircastHubUrl,MS(t,n,r,o),nn.JSON):(m6(n),this.post(this.fhircastHubUrl,MS(t,n,r),nn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`)}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":nn.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 ${AS(t.client_id+":"+t.client_secret)}`));const o={method:"POST",headers:r,body:n.toString(),credentials:"include"};let i;try{i=await this.fetchWithRetry(this.tokenUrl,o)}catch(u){throw this.refreshPromise=void 0,u}if(!i.ok){this.clearActiveLogin();try{const u=await i.json();throw new ft(Qo(u.error_description))}catch(u){throw new ft(Qo("Failed to fetch tokens"),u)}}const l=await i.json();return await this.verifyTokens(l),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(j6(n)){const r=Ix(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ft(q5);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ft(yS)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ft(yS)}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 A6(this,$7(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 U6(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function zS(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function VS(e,t){var o,i;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Vp(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function BS(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function W6(e){return tr(e)&&"data"in e&&"contentType"in e}function US(e,t,n,r){return W6(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function H6(e){return tr(e)&&"docDefinition"in e}function q6(e,t,n,r){return H6(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Ol({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:i}){if(t===(e==null?void 0:e.path))return;o??(o=(e==null?void 0:e.debugMode)??!1),i??(i=e==null?void 0:e.accessPolicyResource);let l=G6(t,n,e,!!o);const u=nv(t,".",2)[1];l=Q6(l,i,u),l=K6(l,i,u);const d=Object.create(null);for(const[h,m]of Object.entries(l))d[t+"."+h]=m;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const h=Object.create(null);p=m=>{const v=nv(m,".",2)[1];if(v){if(!h[v]){const x=Vf(v,i==null?void 0:i.hiddenFields);h[v]={hidden:x,readonly:x||Vf(v,i==null?void 0:i.readonlyFields)}}return h[v]}}}return{path:t,elements:l,elementsByPath:d,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o,getExtendedProps:p,accessPolicyResource:i}}function G6(e,t,n,r){const o=Object.create(null);if(n)for(const[l,u]of Object.entries(n.elementsByPath)){const d=ta(e,l);d!==void 0&&(o[d]=u)}let i=!1;if(t)for(const[l,u]of Object.entries(t))l in o||(o[l]=u,i=!0);return r&&console.assert(i,"Unnecessary ElementsContext; not using any newly provided elements"),o}function Q6(e,t,n){var o;if(!((o=t==null?void 0:t.hiddenFields)!=null&&o.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([i])=>!Vf(r+i,t.hiddenFields)))}function K6(e,t,n){var i;if(!((i=t==null?void 0:t.readonlyFields)!=null&&i.length))return e;const r=Object.create(null),o=n?n+".":"";for(const[l,u]of Object.entries(e))Vf(o+l,t.readonlyFields)?r[l]={...u,readonly:!0}:r[l]=u;return r}function Vf(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function oP(e){return e.type!==void 0&&e.type.length>0}function Y6(e,t,n,r){var i;const o=l7(e,t.path,{profileUrl:r});if(o){const l=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(u=>d7(u,t,n,l))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function iP(e,t,n,r){var o,i;if(e)for(const l of t){const u={value:e,type:((o=l.typeSchema)==null?void 0:o.type)??((i=l.type)==null?void 0:i[0].code)};if(n.every(d=>{var p;return Y6(u,d,l,((p=l.typeSchema)==null?void 0:p.url)??r)}))return l.name}}class X6{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Ol({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([i])=>i.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!bn(o.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(o.slices[0],n.path,o),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=J6(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){var o,i;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const l of t.children)this.crawlElementNode(l,n);bn((i=(o=t.element)==null?void 0:o.slicing)==null?void 0:i.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var i,l;const r=[];for(const u of t){if(!oP(u))continue;const d=(l=(i=u.type.find(p=>bn(p.profile)))==null?void 0:i.profile)==null?void 0:l[0];if(bn(d)){const p=Kl(d);p&&(u.typeSchema=p)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let i;const l=(o==null?void 0:o.elements)??t.elements;bn(l)&&(i=Ol({path:n,parentContext:this.elementsContext,elements:l})),i&&this.elementsContextStack.push(i),this.crawlElementsImpl(l,n),i&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function J6(e){const t=[];function n(i,l){return l.startsWith(i+".")}function r(i,l){for(const u of i.children)if(n(u.key,l.key)){r(u,l);return}i.children.push(l)}const o=Object.entries(e);o.sort((i,l)=>i[0].localeCompare(l[0]));for(const[i,l]of o){const u={key:i,element:l,children:[]};let d=!1;for(const p of t)if(n(p.key,i)){r(p,u),d=!0;break}d||t.push(u)}return t}const gg="__sliceName";function Z6(e,t){const n=new ez(e,e.resourceType,"resource");return new X6(t,n).crawlResource(),n.getDefaultValue()}function WS(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Bf(e,r,o,t);continue}const i=ta(n,r);i!==void 0&&Bf(e,i,o,t)}return e}class ez{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Vr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,i=this.value.path,l=ta(i,t);if(l===void 0)throw new Error(`Expected ${t} to be prefixed by ${i}`);const u=[];for(const d of o){if(d===void 0)continue;const p=ta(r.path,i),h=Array.isArray(d)?d:[d];for(const m of h){tz(m,l,n,r.elements,p),Bf(m,l,n,r.elements);const v=av(m,l,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 i=ta(this.value.path,t);if(i===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const l=ta(r.path,this.value.path);for(const u of this.value.values){const d=av(u,i,r.elements,l);if(Array.isArray(d))for(let p=d.length-1;p>=0;p--){const h=d[p];bn(h)||d.splice(p,1)}wn(d)&&sv(u,void 0,i,n)}}onEnterSlice(t,n,r){const o=this.value.values,i=[];for(const l of o)if(l!==void 0){const u=Array.isArray(l)?l:[l],d=this.getMatchingSliceValues(u,n,r);i.push(d)}this.valueStack.push({type:"slice",path:t,values:i})}getMatchingSliceValues(t,n,r){const o=[];for(const i of t)(i[gg]??iP(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(xx(n.type[0].code)){const l=Object.create(null);o.push(l),t.push(l)}return o}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const o=n[r];gg in o&&delete o[gg]}}getDefaultValue(){return this.rootValue}}function tz(e,t,n,r,o){const i=av(e,t,r,o);n.min>0&&i===void 0&&xx(n.type[0].code)&&(n.isArray?sv(e,[Object.create(null)],t,n):sv(e,Object.create(null),t,n))}function sv(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const i=r.type[0].code;o=n.replace("[x]",Ln(i))}t===void 0?delete e[o]:e[o]=t}function av(e,t,n,r){const o=t.split(".");let i=e,l;for(let u=0;u<o.length;u++){let d=o[u];if(d.includes("[x]")){const p=(r?r+".":"")+o.slice(0,u+1).join("."),m=n[p].type[0].code;d=d.replace("[x]",Ln(m))}if(u===o.length-1){Array.isArray(i)?l=i.map(p=>p[d]):l=i[d];continue}if(Array.isArray(i))i=i.map(p=>p[d]);else if(tr(i)){if(i[d]===void 0)return;i=i[d]}else return}return l}function Bf(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Bf(u,t,n,r));e==null&&(e=Object.create(null));const o=e,i=t.split(".");let l=o;for(let u=0;u<i.length;u++){let d=i[u];if(d.includes("[x]")){const h=r[i.slice(0,u+1).join(".")].type[0].code;d=d.replace("[x]",Ln(h))}if(u===i.length-1){const p=Array.isArray(l)?l:[l];for(const h of p)n.fixed?h[d]??(h[d]=n.fixed.value):n.pattern&&(h[d]=sP(h[d],n.pattern.value))}else{if(!(d in l)){const p=i.slice(0,u+1).join(".");l[d]=r[p].isArray?[Object.create(null)]:Object.create(null)}l=l[d]}}return o}function sP(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Vr(t);if(tr(t)&&(tr(e)&&!Array.isArray(e)||e===void 0)){const n=Vr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=sP(n[r],t[r]);return n}return e}const nz="https://meta.medplum.com/releases",vg=new Map;function rz(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 oz(e,t,n){let r=vg.get("latest");if(!r){const o="latest",i=new URL(`${nz}/${o}.json`);i.searchParams.set("a",e),i.searchParams.set("c",nP);const l=await fetch(i.toString());if(l.status!==200){let d;try{d=(await l.json()).message}catch(p){console.error(`Failed to parse message from body: ${tt(p)}`)}throw new Error(`Received status code ${l.status} while fetching manifest for version 'latest'. Message: ${d}`)}const u=await l.json();rz(u),r=u,vg.set("latest",r),vg.set(r.tag_name.slice(1),r)}return r}async function iz(e){const t=await oz(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 aP=g.createContext(void 0);function Qp(){return g.useContext(aP)}function Te(){return Qp().medplum}function Kp(){return Qp().navigate}function Yp(){return Qp().profile}const HS=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function sz(e){const t=e.medplum,n=e.navigate??az,[r,o]=g.useState({profile:t.getProfile(),loading:t.isLoading()});g.useEffect(()=>{function l(){o(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of HS)t.addEventListener(u,l);return()=>{for(const u of HS)t.removeEventListener(u,l)}},[t]);const i=g.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(aP.Provider,{value:i,children:e.children})}function az(e){window.location.assign(e)}const qS=new Map,lP=e=>g.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const o=qS.get(t);if(o){const l=new URLSearchParams(new URL(o).search).get("Expires");if(l&&parseInt(l,10)*1e3-5e3>Date.now())return o}return qS.set(t,e),e},[e]);function lz(e){const t=g.useRef();return g.useEffect(()=>{t.current=e}),t.current}function Vt(e,t){const n=Te(),[r,o]=g.useState(()=>GS(n,e)),i=g.useCallback(l=>{vs(l,r)||o(l)},[r]);return g.useEffect(()=>{let l=!0;const u=GS(n,e);return!u&&Es(e)?n.readReference(e).then(d=>{l&&i(d)}).catch(d=>{l&&(i(void 0),t&&t(Gt(d)))}):i(u),()=>l=!1},[n,e,i,t]),r}function GS(e,t){if(t){if(ni(t))return t;if(Es(t))return e.getCachedReference(t)}}function cz(e,t,n={leading:!1}){const[r,o]=g.useState(e),i=g.useRef(!1),l=g.useRef(),u=g.useRef(!1),d=g.useCallback(()=>window.clearTimeout(l.current),[]);return g.useEffect(()=>{i.current&&(!u.current&&n.leading?(u.current=!0,o(e)):(d(),l.current=setTimeout(()=>{u.current=!1,o(e)},t)))},[e,n.leading,t,d]),g.useEffect(()=>(i.current=!0,d),[d]),[r,d]}const uz=250;function dz(e,t,n){return cP("searchOne",e,t)}function Ml(e,t,n){return cP("searchResources",e,t)}function cP(e,t,n,r){const o=Te(),[i,l]=g.useState(),[u,d]=g.useState(!0),[p,h]=g.useState(),[m,v]=g.useState(),x=o.fhirSearchUrl(t,n).toString(),[b]=cz(x,uz,{leading:!0});return g.useEffect(()=>{b!==i&&(l(b),o[e](t,n).then(w=>{d(!1),h(w),v(W5)}).catch(w=>{d(!1),h(void 0),v(Gt(w))}))},[o,e,t,n,i,b]),[p,u,m]}function fz(e){const t=e.value;return t?s.jsx(s.Fragment,{children:FT(t)}):null}const uP=["meta","implicitRules","contained","extension","modifierExtension"],dP=["language","text"],Zt=g.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});Zt.displayName="ElementsContext";const Ax=["extension","modifierExtension"],pz=["id",...uP].filter(e=>!Ax.includes(e));function hz(e){return Object.entries(e).filter(([n,r])=>{var o;return!bn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Ax.includes(n)&&!bn((o=r.slicing)==null?void 0:o.slices)||pz.includes(n)?!1:!(dP.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function QS(e,t){return e.line&&e.line.length>t?e.line[t]:""}function KS(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function mz(e){const[t,n]=g.useState(e.defaultValue||{}),r=g.useRef();r.current=t;const{getExtendedProps:o}=g.useContext(Zt),[i,l,u,d,p,h,m]=g.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(C=>o(e.path+"."+C)),[o,e.path]);function v(C){n(C),e.onChange&&e.onChange(C)}function x(C){v({...r.current,use:C})}function b(C){v({...r.current,type:C})}function w(C){v(KS(r.current||{},0,C))}function j(C){v(KS(r.current||{},1,C))}function T(C){v({...r.current,city:C})}function R(C){v({...r.current,state:C})}function E(C){v({...r.current,postalCode:C})}return s.jsxs(xe,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(Jt,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:C=>x(C.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(Jt,{disabled:e.disabled||(l==null?void 0:l.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:C=>b(C.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(Ve,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:QS(t,0),onChange:C=>w(C.currentTarget.value)}),s.jsx(Ve,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Line 2",defaultValue:QS(t,1),onChange:C=>j(C.currentTarget.value)}),s.jsx(Ve,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:C=>T(C.currentTarget.value)}),s.jsx(Ve,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"State",defaultValue:t.state,onChange:C=>R(C.currentTarget.value)}),s.jsx(Ve,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:C=>E(C.currentTarget.value)})]})}function gz(e){const t=Yp(),[n,r]=g.useState(e.defaultValue||{});function o(i){const l=i?{text:i,authorReference:t&&rn(t),time:new Date().toISOString()}:{};r(l),e.onChange&&e.onChange(l)}return s.jsx(Ve,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
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 vz={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"}};/**
|
|
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
|
+
*/const qe=(e,t,n,r)=>{const o=g.forwardRef(({color:i="currentColor",size:l=24,stroke:u=2,title:d,className:p,children:h,...m},v)=>g.createElement("svg",{ref:v,...vz[e],width:l,height:l,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:i}:{strokeWidth:u,stroke:i},...m},[d&&g.createElement("title",{key:"svg-title"},d),...r.map(([x,b])=>g.createElement(x,b)),...Array.isArray(h)?h:[h]]));return o.displayName=`${n}`,o};/**
|
|
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 yz=qe("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"}]]);/**
|
|
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 ka=qe("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"}]]);/**
|
|
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 xz=qe("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"}]]);/**
|
|
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 bz=qe("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"}]]);/**
|
|
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 wz=qe("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"}]]);/**
|
|
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 Sz=qe("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"}]]);/**
|
|
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 jz=qe("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"}]]);/**
|
|
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 Cz=qe("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"}]]);/**
|
|
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 Ez=qe("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"}]]);/**
|
|
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 kz=qe("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"}]]);/**
|
|
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 Tz=qe("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"}]]);/**
|
|
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 Pz=qe("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"}]]);/**
|
|
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 Hs=qe("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"}]]);/**
|
|
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 $i=qe("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
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 Rz=qe("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"}]]);/**
|
|
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 Nx=qe("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
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 _z=qe("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"}]]);/**
|
|
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 Uf=qe("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"}]]);/**
|
|
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 Wf=qe("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"}]]);/**
|
|
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 Ox=qe("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"}]]);/**
|
|
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 Dz=qe("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"}]]);/**
|
|
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 fP=qe("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"}]]);/**
|
|
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 Iz=qe("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"}]]);/**
|
|
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 Az=qe("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"}]]);/**
|
|
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 Nz=qe("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"}]]);/**
|
|
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 pP=qe("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"}]]);/**
|
|
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 Iu=qe("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"}]]);/**
|
|
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 Au=qe("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
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 YS=qe("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"}]]);/**
|
|
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 Oz=qe("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"}]]);/**
|
|
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 Mz=qe("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"}]]);/**
|
|
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 Lz=qe("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"}]]);/**
|
|
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 $z=qe("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"}]]);/**
|
|
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 XS=qe("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"}]]);/**
|
|
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 Fz=qe("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"}]]);/**
|
|
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 zz=qe("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"}]]);/**
|
|
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 Vz=qe("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"}]]);/**
|
|
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 hP=qe("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
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 mP=qe("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
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 Bz=qe("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"}]]);/**
|
|
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 Uz=qe("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"}]]);/**
|
|
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 Wz=qe("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"}]]);/**
|
|
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 Hz=qe("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"}]]);/**
|
|
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 qz=qe("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"}]]);/**
|
|
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 Gz=qe("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
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 Qz=qe("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",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 Kz=qe("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"}]]);/**
|
|
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 Yz=qe("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"}]]);/**
|
|
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 Xz=qe("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"}]]);/**
|
|
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 Jz=qe("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"}]]);/**
|
|
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 Zz=qe("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"}]]);/**
|
|
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 e8=qe("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"}]]);/**
|
|
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 lv=qe("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"}]]);/**
|
|
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 Mx=qe("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"}]]);/**
|
|
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 Lx=qe("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"}]]);/**
|
|
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 t8=qe("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"}]]);/**
|
|
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 n8=qe("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"}]]);/**
|
|
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 r8=qe("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"}]]);/**
|
|
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 o8=qe("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"}]]);/**
|
|
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 i8=qe("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"}]]);/**
|
|
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 $x=qe("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"}]]);/**
|
|
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 JS=qe("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"}]]);/**
|
|
462
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
463
|
+
*
|
|
464
|
+
* This source code is licensed under the MIT license.
|
|
465
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
+
*/var s8=qe("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"}]]);/**
|
|
467
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the MIT license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/var fa=qe("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
472
|
+
* @license @tabler/icons-react v3.17.0 - MIT
|
|
473
|
+
*
|
|
474
|
+
* This source code is licensed under the MIT license.
|
|
475
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
+
*/var a8=qe("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 gP extends g.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(Ni,{icon:s.jsx(ka,{size:16}),title:"Something went wrong",color:"red",children:tt(this.state.error)}):this.props.children}}function so(){return s.jsx(Gn,{style:{width:"100%",height:"100vh"},children:s.jsx(Cr,{})})}const l8="_main_6f7o5_1",c8={main:l8};function on(e){e.preventDefault(),e.stopPropagation()}function vP(e){return e.button===1||e.ctrlKey||e.metaKey}function yP(e){if(ZS(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&ZS(t[0]))return!0}return!1}function ZS(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Yc(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:l})=>{o.port1.close(),l.error?r(l.error):n(l.result)},(i=e.contentWindow)==null||i.postMessage(t,new URL(e.src).origin,[o.port2])})}function xP(e,t){const n=new Blob([e],{type:nn.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const i=t??new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function xt(e){const t=Kp(),{to:n,suffix:r,label:o,onClick:i,children:l,...u}=e;let d=u8(n);return r&&(d+="/"+r),s.jsx(Et,{href:d,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),i?(p.preventDefault(),i(p)):n&&(vP(p)||(p.preventDefault(),t(d)))},...u,children:l})}function u8(e){if(e){if(typeof e=="string")return d8(e);if(ni(e))return f8(e);if(Es(e))return p8(e)}return"#"}function d8(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function f8(e){return`/${e.resourceType}/${e.id}`}function p8(e){return`/${e.reference}`}function h8(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 ks(e){const t=Vt(e.value),n=t?ki(t):e.alt??"",r=h8(n),o=(t&&j7(t))??e.src,i=lP(o??void 0),l=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?s.jsx(xt,{to:t,children:s.jsx(sa,{src:i,alt:n,radius:l,...u,children:r})}):s.jsx(sa,{src:i,alt:n,radius:l,...u,children:r})}const m8="_logoButton_189g3_1",g8="_user_189g3_11",v8="_userName_189g3_21",y8="_userActive_189g3_31",af={logoButton:m8,user:g8,userName:v8,userActive:y8};function Fx(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Yl(t,e.options)}):null}function x8(e){var d,p,h;const t=Qp(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:l,setColorScheme:u}=aA();return s.jsxs(s.Fragment,{children:[s.jsxs(et,{align:"center",p:"xl",children:[s.jsx(ks,{size:"xl",radius:100,value:t.profile}),s.jsx(Fx,{value:(p=(d=t.profile)==null?void 0:d.name)==null?void 0:p[0]}),s.jsx(Pe,{c:"dimmed",size:"xs",children:(h=n.getActiveLogin())==null?void 0:h.project.display})]}),i.length>1&&s.jsx(ve.Divider,{}),i.map(m=>m.profile.reference!==Dt(t.profile)&&s.jsx(ve.Item,{onClick:()=>{n.setActiveLogin(m).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(xe,{children:[s.jsx(sa,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Pe,{size:"sm",fw:500,children:m.profile.display}),s.jsx(Pe,{c:"dimmed",size:"xs",children:m.project.display})]})]})},m.profile.reference)),s.jsx(ve.Divider,{}),s.jsx(xe,{justify:"center",children:s.jsx($p,{size:"xs",value:l,onChange:m=>u(m),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(r8,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(ve.Item,{leftSection:s.jsx(lv,{size:14,stroke:1.5}),onClick:()=>o(`/${Dt(r)}`),children:"Account settings"}),s.jsx(ve.Item,{leftSection:s.jsx(Vz,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),s.jsx(Pe,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const ej={selectedItems:"selected-items",options:"options"};function zx(e){const t=bu({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:l,toOption:u,loadOptions:d,itemComponent:p,pillComponent:h,emptyComponent:m,onChange:v,onCreate:x,creatable:b,clearable:w,required:j,placeholder:T,leftSection:R,maxValues:E,optionsDropdownMaxHeight:C=320,minInputLength:P=0,...D}=e,A=D.disabled,O=b8(l),[L,V]=g.useState(""),[q,G]=g.useState(),[Q,Y]=g.useState(),[X,B]=g.useState(),[M,N]=g.useState(O.map(u)),[F,I]=g.useState([]),z=p??w8,J=h??S8,ae=m??j8,je=g.useRef();je.current=L;const ge=g.useRef(),Ce=g.useRef(),Re=g.useRef();Re.current=q;const ke=g.useRef();ke.current=Q;const _e=g.useRef();_e.current=X;const $e=g.useRef();$e.current=F;const yt=g.useCallback(()=>{var ce;if(G(void 0),je.current===Ce.current&&d===ge.current||(((ce=je.current)==null?void 0:ce.length)??0)<P)return;Ce.current=je.current,ge.current=d;const Se=new AbortController;Y(Se),d(je.current??"",Se.signal).then(me=>{Se.signal.aborted||(I(me.map(u)),_e.current?(me.length>0&&v(me.slice(0,1)),B(!1)):me.length>0&&t.openDropdown())}).catch(me=>{Se.signal.aborted||me.message.includes("aborted")||De({color:"red",message:tt(me)})}).finally(()=>{Se.signal.aborted||Y(void 0)})},[t,d,v,u,P]),Ft=g.useCallback(Se=>{(F&&F.length>0||b)&&t.openDropdown(),t.updateSelectedOptionIndex(),V(Se.currentTarget.value),ke.current&&(ke.current.abort(),Y(void 0)),Re.current!==void 0&&window.clearTimeout(Re.current);const ce=window.setTimeout(()=>yt(),100);G(ce)},[t,F,b,yt]),gt=g.useCallback(Se=>{const ce=M.some(de=>de.value===Se),me=ce?M.filter(de=>de.value!==Se):[...M];let Ue=F==null?void 0:F.find(de=>de.value===Se);if(!Ue&&b!==!1&&x){const de=x(Se);Ue=u(de)}if(Ue){if(E===0){v([Ue.resource]),M.length>0&&N([]);return}ce||me.push(Ue)}if(E!==void 0)for(;me.length>E;)me.shift();v(me.map(de=>de.resource)),N(me)},[b,F,M,E,v,x,u]),Tt=g.useMemo(()=>{if(!A)return Se=>{A||(E===1&&(V(""),I([]),t.closeDropdown()),Ce.current=void 0,Se==="$create"?(V(""),gt(L)):gt(Se))}},[gt,t,A,E,L]),Nt=g.useCallback(Se=>{const ce=M.filter(me=>me.value!==Se.value);v(ce.map(me=>me.resource)),N(ce)},[M,v]),Pt=g.useCallback(Se=>{Se.key==="Enter"?(q||Q)&&B(!0):Se.key==="Backspace"&&L.length===0&&(on(Se),Nt(M[M.length-1]))},[Q,Nt,L.length,M,q]);g.useEffect(()=>()=>{ke.current&&ke.current.abort()},[]);const be=!A&&w&&M.length>0&&s.jsx(ut.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{V(""),N([]),v([]),t.closeDropdown()}}),Ie=b&&L.trim().length>0,Be=F.length>0||Ie;return s.jsxs(ut,{store:t,onOptionSubmit:Tt,withinPortal:!0,shadow:"xl",...D,children:[s.jsx(ut.DropdownTarget,{children:s.jsx(Il,{label:r,description:o,error:i,className:e.className,leftSection:R,rightSection:Q?s.jsx(Cr,{size:16}):be,required:j,disabled:A,children:s.jsxs(aa.Group,{"data-testid":ej.selectedItems,children:[M.map(Se=>s.jsx(J,{item:Se,disabled:A,onRemove:()=>Nt(Se)},Se.value)),!A&&(E===void 0||E===0||M.length<E)&&s.jsx(ut.EventsTarget,{children:s.jsx(Il.Field,{role:"searchbox",name:n,value:L,placeholder:T,onFocus:Ft,onBlur:()=>{t.closeDropdown(),V("")},onKeyDown:Pt,onChange:Ft})})]})})}),s.jsx(ut.Dropdown,{hidden:!Be,"data-testid":ej.options,children:s.jsx(ut.Options,{children:s.jsxs(pp,{type:"scroll",mah:C,children:[F.map(Se=>{const ce=M.some(me=>me.value===Se.value);return s.jsx(ut.Option,{value:Se.value,active:ce,children:s.jsx(z,{...Se,active:ce})},Se.value)}),Ie&&s.jsxs(ut.Option,{value:"$create",children:["+ Create ",L]}),!b&&L.trim().length>0&&F.length===0&&s.jsx(ae,{search:L})]})})})]})}function b8(e){return e?Array.isArray(e)?e:[e]:[]}function w8(e){return s.jsxs(xe,{gap:"xs",children:[e.active&&s.jsx($i,{size:12}),s.jsx("span",{children:e.label})]})}function S8({item:e,disabled:t,onRemove:n}){return s.jsx(aa,{withRemoveButton:!t,onRemove:n,children:e.label})}function j8(){return s.jsx(ut.Empty,{children:"Nothing found"})}const C8="_searchInput_dick8_1",E8={searchInput:C8};function k8(e){return{value:e.id,label:ki(e),resource:e}}function T8(e){const t=Kp(),n=Te(),r=g.useCallback(async(i,l)=>{const u=R8(i),d={signal:l},p=await n.graphql(u,void 0,void 0,d);return _8(p,i)},[n]),o=g.useCallback(i=>{i.length>0&&t(`/${Dt(i[0])}`)},[t]);return s.jsx(zx,{size:"sm",radius:"md",className:E8.searchInput,leftSection:s.jsx(e8,{size:16}),placeholder:"Search",itemComponent:P8,toOption:k8,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const P8=g.forwardRef(({resource:e,active:t,...n},r)=>{var i;let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=(i=e.subject)==null?void 0:i.display),s.jsx("div",{ref:r,...n,children:s.jsxs(xe,{wrap:"nowrap",children:[s.jsx(ks,{value:e}),s.jsxs("div",{children:[s.jsx(Pe,{children:ki(e)}),s.jsx(Pe,{size:"xs",c:"dimmed",children:o})]})]})})});function R8(e){const t=JSON.stringify(e);return AT(e)?`{
|
|
477
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
478
|
+
resourceType
|
|
479
|
+
id
|
|
480
|
+
identifier {
|
|
481
|
+
system
|
|
482
|
+
value
|
|
483
|
+
}
|
|
484
|
+
name {
|
|
485
|
+
given
|
|
486
|
+
family
|
|
487
|
+
}
|
|
488
|
+
birthDate
|
|
489
|
+
}
|
|
490
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
491
|
+
resourceType
|
|
492
|
+
id
|
|
493
|
+
identifier {
|
|
494
|
+
system
|
|
495
|
+
value
|
|
496
|
+
}
|
|
497
|
+
subject {
|
|
498
|
+
display
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
}`.replace(/\s+/g," "):`{
|
|
502
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
503
|
+
resourceType
|
|
504
|
+
id
|
|
505
|
+
identifier {
|
|
506
|
+
system
|
|
507
|
+
value
|
|
508
|
+
}
|
|
509
|
+
name {
|
|
510
|
+
given
|
|
511
|
+
family
|
|
512
|
+
}
|
|
513
|
+
birthDate
|
|
514
|
+
}
|
|
515
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
516
|
+
resourceType
|
|
517
|
+
id
|
|
518
|
+
identifier {
|
|
519
|
+
system
|
|
520
|
+
value
|
|
521
|
+
}
|
|
522
|
+
name {
|
|
523
|
+
given
|
|
524
|
+
family
|
|
525
|
+
}
|
|
526
|
+
birthDate
|
|
527
|
+
}
|
|
528
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
529
|
+
resourceType
|
|
530
|
+
id
|
|
531
|
+
identifier {
|
|
532
|
+
system
|
|
533
|
+
value
|
|
534
|
+
}
|
|
535
|
+
subject {
|
|
536
|
+
display
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}`.replace(/\s+/g," ")}function _8(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),I8(D8(n),t).slice(0,5)}function D8(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 I8(e,t){return e.sort((n,r)=>tj(r,t)-tj(n,t))}function tj(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,nj(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,nj(Yl(r),t));return n}function nj(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function A8(e){var o;const t=Yp(),[n,r]=g.useState(!1);return s.jsx(jr.Header,{p:8,style:{zIndex:101},children:s.jsxs(xe,{justify:"space-between",children:[s.jsxs(xe,{gap:"xs",children:[s.jsx(Qn,{className:af.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(T8,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(xe,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(ve,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(ve.Target,{children:s.jsx(Qn,{className:At(af.user,{[af.userActive]:n}),onClick:()=>r(i=>!i),children:s.jsxs(xe,{gap:7,children:[s.jsx(ks,{value:t,radius:"xl",size:24}),s.jsx(Pe,{size:"sm",className:af.userName,children:Yl((o=t==null?void 0:t.name)==null?void 0:o[0])}),s.jsx(Nx,{size:12,stroke:1.5})]})})}),s.jsx(ve.Dropdown,{children:s.jsx(x8,{version:e.version})})]})]})]})})}const Vx=g.createContext({submitting:!1});Vx.displayName="FormContext";function N8(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?O8(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&M8(t,n);return t}function O8(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function M8(e,t){e[t.name]=t.value}function mt(e){const[t,n]=g.useState(!1);return s.jsx(Vx.Provider,{value:{submitting:t},children:s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=N8(r.target);if(e.onSubmit){n(!0);const i=e.onSubmit(o);i!=null&&i.then?i.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function Ur(e){const{children:t,...n}=e,{submitting:r}=g.useContext(Vx);return s.jsx(Oe,{type:"submit",loading:r,...n,children:t})}function L8(e){const t=Te(),n=t.getUserConfiguration();function r(o){var h,m;const{menuname:i,bookmarkname:l}=o,u=`${e.pathname}?${e.searchParams.toString()}`,d=Vr(n),p=(h=d.menu)==null?void 0:h.find(({title:v})=>v===i);(m=p==null?void 0:p.link)==null||m.push({name:l,target:u}),t.updateResource(d).then(v=>{n.menu=v.menu,t.dispatchEvent({type:"change"}),De({color:"green",message:"Success"}),e.onOk()}).catch(v=>{De({color:"red",message:tt(v)})})}return s.jsx(Nn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs(et,{children:[s.jsx($8,{config:n}),s.jsx(Ve,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Ur,{mt:"sm",children:"OK"})})]})})})}function $8(e){function t(r){var o;return(o=r==null?void 0:r.menu)==null?void 0:o.map(i=>i.title)}const n=t(e.config);return s.jsx(Jt,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function bP(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function F8(e){return typeof e.display=="string"?e.display:bP(e)}function z8(e){return{value:bP(e),label:F8(e),resource:e}}function V8(e){return{code:e,display:e}}function Bx(e){const t=Te(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:l,...u}=e,d=g.useCallback(async(p,h)=>{var b;if(!n)return[];const v=((b=(await t.valueSetExpand({...i,url:n,filter:p,count:10},{signal:h})).expansion)==null?void 0:b.contains)??[],x=[];for(const w of v)w.code&&!x.some(j=>j.code===w.code)&&x.push(w);return x},[t,i,n]);return s.jsx(zx,{...u,creatable:r??!0,clearable:o??!0,toOption:z8,loadOptions:d,onCreate:V8,itemComponent:l?B8:void 0})}const B8=g.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(xe,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx($i,{size:12}),s.jsxs("div",{children:[s.jsx(Pe,{children:e}),s.jsx(Pe,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function wP(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,l]=g.useState(t);function u(d){const p=d[0],h=W8(p);l(h),n&&n(h)}return s.jsx(Bx,{defaultValue:U8(i),onChange:u,withHelpText:r??!0,...o})}function U8(e){return e?{code:e}:void 0}function W8(e){return e==null?void 0:e.code}function Ux(e){const[t,n]=g.useState(e.defaultValue),r=e.onChange,o=g.useCallback(i=>{n(i),r&&r(i)},[r]);return s.jsx(wP,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const H8="_menuTitle_9g6l5_1",q8="_link_9g6l5_9",G8="_linkActive_9g6l5_38",cv={menuTitle:H8,link:q8,linkActive:G8};function Q8(e){var u;const t=Kp(),n=X8(e.pathname,e.searchParams,e.menus),[r,o]=g.useState(!1);function i(d,p){d.stopPropagation(),d.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function l(d){d&&t(`/${d}`)}return s.jsxs(s.Fragment,{children:[s.jsx(jr.Navbar,{children:s.jsxs(co,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(jr.Section,{mb:"sm",children:s.jsx(Ux,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>l(d)},window.location.pathname)}),s.jsxs(jr.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(d=>{var p;return s.jsxs(g.Fragment,{children:[s.jsx(Pe,{className:cv.menuTitle,children:d.title}),(p=d.links)==null?void 0:p.map(h=>s.jsxs(K8,{to:h.href,active:h.href===(n==null?void 0:n.href),onClick:m=>i(m,h.href),children:[s.jsx(Y8,{icon:h.icon}),s.jsx("span",{children:h.label})]},h.href))]},`menu-${d.title}`)}),e.displayAddBookmark&&s.jsx(Oe,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(Qz,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(L8,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function K8(e){return s.jsx(xt,{onClick:e.onClick,to:e.to,className:At(cv.link,{[cv.linkActive]:e.active}),children:e.children})}function Y8(e){return e.icon?e.icon:s.jsx(Fp,{w:30})}function X8(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const l of i.links){const u=J8(e,t,l.href);u>o&&(o=u,r=l)}return r}function J8(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[l,u]of r.searchParams.entries())if(!o.includes(l)&&t.get(l)!==u)return 0;let i=1;for(const[l,u]of t.entries())o.includes(l)||r.searchParams.get(l)===u&&i++;return i}function Z8(e){const[t,n]=g.useState(localStorage.navbarOpen==="true"),r=Te(),o=Yp();g.useEffect(()=>{function d(){De({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",d),()=>r.removeEventListener("offline",d)},[r]);function i(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){i(!1)}function u(){i(!t)}return r.isLoading()?s.jsx(so,{}):s.jsxs(jr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&s.jsx(A8,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),o&&t?s.jsx(Q8,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(jr.Main,{className:c8.main,children:s.jsx(gP,{children:s.jsx(g.Suspense,{fallback:s.jsx(so,{}),children:e.children})})})]})}const eV="https://ccda.medplum.com",tV="https://ccda-validator.medplum.com/";function nV(e){const{url:t}=e,[n,r]=g.useState(!1),o=g.useRef(null),[i,l]=g.useState(),[u,d]=g.useState(!1);g.useEffect(()=>{t&&n&&o.current&&(Yc(o.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{d(!0);const x=await(await fetch(t)).text(),b=new FormData;b.append("ccdaFile",new Blob([x],{type:"text/xml"}),"ccda.xml");const w=`${tV}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,j=await fetch(w,{method:"POST",body:b,credentials:"omit",redirect:"manual"});if(!j.ok)throw new Error(`Validation failed: ${j.status} ${j.statusText}`);const T=await j.json();l(T)}catch(v){l(void 0),console.error("CCDA validation error:",v)}finally{d(!1)}},h=()=>{if(!i)return;const v=JSON.stringify(i,null,2);xP(v,"ccda-validation-results")},m=()=>i?i.resultsMetaData.resultMetaData.filter(v=>v==null?void 0:v.type.includes("Error")).reduce((v,x)=>v+(x.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:o,src:eV,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),s.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[s.jsx(Oe,{type:"button",onClick:p,disabled:u,children:u?"Validating...":"Validate"}),i&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{marginLeft:"15px"},children:[s.jsx("strong",{children:"Validation Results:"})," ",m()," errors found"]}),s.jsx(Oe,{type:"button",onClick:h,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Nu(e){const{contentType:t,url:n,title:r}=e.value??{},o=lP(n);return o?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:o})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===nn.CDA_XML&&s.jsx(nV,{url:o}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Et,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:rV(r),children:r||"Download"})})]}):null}function rV(e){return e!=null&&e.includes(".")?e:void 0}const oV="_root_17n8t_1",iV="_compact_17n8t_25",rj={root:oV,compact:iV};function Wx(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:At(rj.root,{[rj.compact]:n}),children:t})}function bi(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function sV(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>s.jsx("div",{children:s.jsx(Nu,{value:o,maxWidth:e.maxWidth})},"attatchment-"+i));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!bn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=s.jsx(bi,{term:ua(o),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function Hx(e){const t=Te(),n=g.useRef(null);function r(l){var u;on(l),(u=n.current)==null||u.click()}function o(l){on(l);const u=l.target.files;u&&Array.from(u).forEach(i)}function i(l){!l||!l.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:l,contentType:l.type||"application/octet-stream",filename:l.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(d=>e.onUpload(d)).catch(d=>{e.onUploadError&&e.onUploadError(Gt(d))}))}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:l=>o(l)}),e.children({onClick:r,disabled:e.disabled})]})}function aV(e){const[t,n]=g.useState(e.defaultValue??[]),r=g.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,l)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Nu,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(En,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{on(u);const d=t.slice();d.splice(l,1),o(d)},children:s.jsx(Uf,{})})})]},`${l}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(Hx,{disabled:e.disabled,onUpload:i=>{o([...r.current,i])},children:i=>s.jsx(En,{...i,title:"Add",variant:"subtle",size:"sm",color:i.disabled?"gray":"green",children:s.jsx(Ox,{})})})})]})]})]})}function SP(e){const[t,n]=g.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(Nu,{value:t,maxWidth:200}),s.jsx(Oe,{disabled:e.disabled,onClick:o=>{on(o),r(void 0)},children:"Remove"})]}):s.jsx(Hx,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>s.jsx(Oe,{...o,children:"Upload..."})})}const lV="_root_1vii2_1",cV={root:lV};function Ou(e){const{children:t,...n}=e;return s.jsx(Iy,{className:cV.root,...n,children:t})}const uV="_paper_1igaj_1",dV="_fill_1igaj_20",oj={paper:uV,fill:dV};function qx(e){const{width:t,fill:n,className:r,children:o,...i}=e,l=t?{maxWidth:t}:void 0;return s.jsx(cr,{className:At(oj.paper,n&&oj.fill,r),style:l,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}function lt(e){const{children:t,...n}=e;return s.jsx(Ou,{children:s.jsx(qx,{...n,children:t})})}function Do(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 kt(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var l;return jP((l=i.expression)==null?void 0:l[0],t)}))==null?void 0:r.map(i=>{var l;return(l=i.details)==null?void 0:l.text}))==null?void 0:o.join(`
|
|
540
|
+
`)}function Mu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return jP((o=r.expression)==null?void 0:o[0],t)})}const lf=/\[\d+\]/;function jP(e,t){const n=typeof e=="string"&&lf.test(e),r=typeof t=="string"&&lf.test(t);if(n!==r&&(e=e==null?void 0:e.replace(lf,""),t=t==null?void 0:t.replace(lf,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const i=t.indexOf(".");return i>=0&&t.substring(i+1)===e}function CP(e){const t=Te(),[n,r]=g.useState();return s.jsxs(mt,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(Gt(i))}},children:[s.jsxs(Gn,{style:{flexDirection:"column"},children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Create project"})]}),s.jsxs(et,{gap:"xl",children:[s.jsx(Ve,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:kt(n,"projectName")}),s.jsxs(Pe,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Et,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Et,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Ur,{children:"Create project"})})]})}function EP(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 kP(e){const t=Te(),{googleClientId:n,handleGoogleCredential:r}=e,o=g.useRef(null),[i,l]=g.useState(typeof google<"u"),[u,d]=g.useState(!1),[p,h]=g.useState(!1);return g.useEffect(()=>{if(typeof google>"u"){EP("https://accounts.google.com/gsi/client",()=>l(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),d(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),h(!0))},[t,n,u,i,o,p,r]),n?s.jsx("div",{ref:o}):null}function TP(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 po(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Ni,{icon:s.jsx(ka,{size:16}),color:"red",children:t.map(r=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:bT(r)},(o=r.details)==null?void 0:o.text)})})}function PP(e){typeof grecaptcha>"u"&&EP("https://www.google.com/recaptcha/api.js?render="+e)}function RP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function fV(e){const t=TP(e.googleClientId),n=e.recaptchaSiteKey,r=Te(),[o,i]=g.useState(),l=Mu(o,void 0);return g.useEffect(()=>{n&&PP(n)},[n]),s.jsxs(mt,{onSubmit:async u=>{i(void 0);try{let d="";n&&(d=await RP(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:d}))}catch(d){i(Gt(d))}},children:[s.jsx(Gn,{style:{flexDirection:"column"},children:e.children}),s.jsx(po,{issues:l}),t&&s.jsxs(s.Fragment,{children:[s.jsx(xe,{justify:"center",p:"xl",style:{height:70},children:s.jsx(kP,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(d){i(Gt(d))}}})}),s.jsx(yn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(et,{gap:"xl",children:[s.jsx(Ve,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:kt(o,"firstName")}),s.jsx(Ve,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:kt(o,"lastName")}),s.jsx(Ve,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:kt(o,"email")}),s.jsx(Eo,{name:"password",label:"Password",autoComplete:"off",required:!0,error:kt(o,"password")}),s.jsxs(Pe,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Et,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Et,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(Pe,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Et,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Et,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(xe,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Kn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(Ur,{children:"Create account"})]})]})}function pV(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:l}=e,u=Te(),[d,p]=g.useState(),[h,m]=g.useState();g.useEffect(()=>{t==="patient"&&d&&u.startNewPatient({login:d,projectId:n}).then(x=>u.processCode(x.code)).then(()=>l()).catch(x=>m(Gt(x)))},[u,t,n,d,l]);function v(x){x.code?u.processCode(x.code).then(()=>l()).catch(console.log):x.login&&p(x.login)}return s.jsxs(lt,{width:450,children:[h&&s.jsx("pre",{children:JSON.stringify(h,null,2)}),!d&&s.jsx(fV,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:v,children:e.children}),d&&t==="project"&&s.jsx(CP,{login:d,handleAuthResponse:v})]})}function hV(e){const[t,n]=g.useState();return t?s.jsx(gV,{email:t,...e}):s.jsx(mV,{setEmail:n,...e})}function mV(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...l}=e,u=Te(),d=!e.disableGoogleAuth&&TP(e.googleClientId),[p,h]=g.useState(),m=Mu(p,void 0),v=g.useCallback(async w=>{if(!w.authorizeUrl)return!1;const j=JSON.stringify({...await u.ensureCodeChallenge(l),domain:w.domain}),T=new URL(w.authorizeUrl);return T.searchParams.set("state",j),window.location.assign(T.toString()),!0},[u,l]),x=g.useCallback(async w=>{const j=await u.post("auth/method",{email:w.email});await v(j)||t(w.email)},[u,v,t]),b=g.useCallback(async w=>{try{const j=await u.startGoogleLogin({...l,googleCredential:w.credential});await v(j)||r(j)}catch(j){h(Gt(j))}},[u,l,v,r]);return s.jsxs(mt,{onSubmit:x,children:[s.jsx(Gn,{style:{flexDirection:"column"},children:o}),s.jsx(po,{issues:m}),d&&s.jsxs(s.Fragment,{children:[s.jsx(xe,{justify:"center",p:"xl",style:{height:70},children:s.jsx(kP,{googleClientId:d,handleGoogleCredential:b})}),!i&&s.jsx(yn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(Ve,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:kt(p,"email")}),s.jsxs(xe,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Et,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&s.jsx(Ur,{children:"Next"})]})]})}function gV(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=Te(),[l,u]=g.useState(),d=Mu(l,void 0),p=g.useCallback(h=>{i.startLogin({...o,password:h.password,remember:h.remember==="on"}).then(n).catch(m=>u(Gt(m)))},[i,o,n]);return s.jsxs(mt,{onSubmit:p,children:[s.jsx(Gn,{style:{flexDirection:"column"},children:r}),s.jsx(po,{issues:d}),s.jsx(et,{gap:"xl",children:s.jsx(Eo,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:kt(l,"password")})}),s.jsxs(xe,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Et,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Kn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(Ur,{children:"Sign in"})]})]})}function vV(e){const t=Te(),n=bu(),[r,o]=g.useState(""),[i,l]=g.useState();function u(m){var v;return!!((v=m==null?void 0:m.toLowerCase())!=null&&v.includes(r.toLowerCase()))}function d(m){var v,x;return u((v=m.profile)==null?void 0:v.display)||u((x=m.project)==null?void 0:x.display)}function p(m){t.post("auth/profile",{login:e.login,profile:m}).then(e.handleAuthResponse).catch(v=>l(Gt(v)))}const h=e.memberships.filter(d).slice(0,10).map(m=>s.jsx(ut.Option,{value:m.id,children:s.jsx(yV,{...m})},m.id));return s.jsxs(et,{children:[s.jsxs(gs,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(Do,{size:32}),s.jsx(Fe,{order:3,children:"Choose profile"})]}),s.jsx(po,{outcome:i}),s.jsxs(ut,{store:n,onOptionSubmit:p,children:[s.jsx(ut.EventsTarget,{children:s.jsx(Ve,{placeholder:"Search",value:r,onChange:m=>{o(m.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(ut.Options,{children:h.length>0?h:s.jsx(ut.Empty,{children:"Nothing found..."})})})]})]})}function yV(e){var t,n;return s.jsxs(xe,{children:[s.jsx(sa,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(Pe,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(Pe,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const xV=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,bV="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",wV="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",SV="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",jV=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,CV="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",EV="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",kV="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",TV="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",PV="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",RV="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function _V(e){const t=Te();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(et,{children:[s.jsxs(Gn,{style:{flexDirection:"column"},children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Choose scope"})]}),s.jsx(et,{children:(e.scope??"openid").split(" ").map(n=>{let r;return xV.test(n)?r=[n+bV,n+wV,n+SV]:jV.test(n)&&(r=[n+CV,n+EV,n+kV,n+TV,n+PV,n+RV]),s.jsxs(s.Fragment,{children:[s.jsx(Kn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(o=>s.jsx(Kn,{id:o,name:o,label:o},o))]},n+"_group")})}),s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Ur,{children:"Set scope"})})]})})}function _P(e){const[t,n]=g.useState();return s.jsx(mt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(o=>n(tt(o)))},children:s.jsxs(et,{children:[s.jsxs(Gn,{style:{flexDirection:"column"},children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Enter MFA code"})]}),t&&s.jsx(Ni,{icon:s.jsx(ka,{size:16}),title:"Error",color:"red",children:t}),s.jsx(et,{children:s.jsx(Ve,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Ur,{children:"Submit code"})})]})})}function DP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:l,...u}=e,d=Te(),[p,h]=g.useState(),m=g.useRef(!1),[v,x]=g.useState(!1),[b,w]=g.useState(),j=g.useCallback(E=>{l?l(E):d.processCode(E).then(()=>{r&&r()}).catch(C=>De({color:"red",message:tt(C)}))},[d,l,r]),T=g.useCallback(E=>{x(!!E.mfaRequired),E.login&&h(E.login),E.memberships&&w(E.memberships),E.code&&(n?w(void 0):j(E.code))},[n,j]),R=g.useCallback(E=>{j(E.code)},[j]);return g.useEffect(()=>{t&&!m.current&&!p&&(m.current=!0,d.get("auth/login/"+t).then(T).catch(E=>De({color:"red",message:tt(E)})))},[d,t,m,p,T]),s.jsx(lt,{width:450,px:"sm",py:"md",children:p?v?s.jsx(_P,{onSubmit:async E=>{const C=await d.post("auth/mfa/verify",{login:p,token:E.token});T(C)}}):b?s.jsx(vV,{login:p,memberships:b,handleAuthResponse:T}):e.projectId==="new"?s.jsx(CP,{login:p,handleAuthResponse:T}):e.chooseScopes?s.jsx(_V,{login:p,scope:e.scope,handleAuthResponse:R}):s.jsx("div",{children:"Success"}):s.jsx(hV,{onForgotPassword:o,onRegister:i,handleAuthResponse:T,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function Ko(e){return s.jsx(s.Fragment,{children:ys(e.value)})}function DV(e){return s.jsx(s.Fragment,{children:Du(e.value)})}function IP(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 IV(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(IP,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function AV(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 NV(e){return s.jsx(s.Fragment,{children:Q7(e.value)})}function uu(e){return s.jsx(s.Fragment,{children:na(e.value)})}function Gx(e){return s.jsx(s.Fragment,{children:lu(e.value)})}function OV(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(uu,{value:t.numerator})," / ",s.jsx(uu,{value:t.denominator})]}):null}function uv(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Po(e.value);return e.link!==!1&&e.value.reference?s.jsx(xt,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function AP(e,t,n,r){if(!bn(n==null?void 0:n.slices))return[e];const o=new Array(t.length+1);for(let i=0;i<o.length;i++)o[i]=[];for(const i of e){const l=iP(i,t,n.discriminator,r);let u=l?t.findIndex(d=>d.name===l):-1;u===-1&&(u=t.length),o[u].push(i)}return o}async function NP({medplum:e,property:t}){return new Promise((n,r)=>{var u,d;if(!t.slicing){n([]);return}const o=[],i=[],l=[];for(const p of t.slicing.slices){if(!oP(p)){console.debug("Unsupported slice definition",p);continue}let h;bn(p.elements)||(h=(d=(u=p.type[0])==null?void 0:u.profile)==null?void 0:d[0]),o.push(p),i.push(h),h&&l.push(e.requestProfileSchema(h))}Promise.all(l).then(()=>{for(let p=0;p<o.length;p++){const h=o[p],m=i[p];if(m){const v=Kl(m);h.typeSchema=v}}n(o)}).catch(r)})}function Xp(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function MV(e){var l,u;const{slice:t,property:n}=e,r=((l=t.typeSchema)==null?void 0:l.elements)??t.elements,o=g.useContext(Zt),i=g.useMemo(()=>{var d;if(bn(r))return Ol({parentContext:o,elements:r,path:e.path,profileUrl:(d=t.typeSchema)==null?void 0:d.url})},[o,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return Xp(Zt.Provider,i,s.jsx(s.Fragment,{children:e.value.map((d,p)=>s.jsx("div",{children:s.jsx(Zo,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:d,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}function LV(e){var b;const{property:t,propertyType:n}=e,r=Te(),o=g.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,l]=g.useState(!0),[u,d]=g.useState([]),[p,h]=g.useState(()=>[o]),m=g.useContext(Zt);if(g.useEffect(()=>{NP({medplum:r,property:t}).then(w=>{d(w);const j=AP(o,w,t.slicing,m.profileUrl);h(j),l(!1)}).catch(w=>{console.error(w),l(!1)})},[r,t,m.profileUrl,h,o]),i)return s.jsx("div",{children:"Loading..."});let v;if(((b=t.type[0])==null?void 0:b.code)!=="Extension"){const w=p[u.length],j=w.map((T,R)=>s.jsx("div",{children:s.jsx(Zo,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:T,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${R}-${w.length}`));if(e.includeDescriptionListEntry){if(!bn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const T=e.path.split(".").pop();v=s.jsx(bi,{term:ua(T),children:j})}else v=s.jsx(s.Fragment,{children:j})}return s.jsxs(s.Fragment,{children:[u.map((w,j)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let T=s.jsx(MV,{path:e.path,slice:w,property:t,value:p[j],ignoreMissingValues:e.ignoreMissingValues,link:e.link},w.name);return e.includeDescriptionListEntry&&(T=s.jsx(bi,{term:ua(w.name),children:T},w.name)),T}),v]})}function Jp(e,t,n){const r=Nl(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function $V(e,t,n){const r=TT(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function FV(e){const{elementDefinitionType:t}=e,n=Te(),r=g.useContext(Zt),[o,i]=g.useState(CT("Extension")),l=g.useMemo(()=>{if(bn(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,d]=g.useState(l!==void 0);if(g.useEffect(()=>{l&&(d(!0),n.requestProfileSchema(l).then(()=>{const m=Kl(l);d(!1),m&&i(m)}).catch(m=>{d(!1),console.warn(m)}))},[n,l]),l&&(u||!mx(l)))return s.jsx("div",{children:"Loading..."});const p=o.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[m,v]=Jp({type:"Extension",value:e.value},"value[x]",l??r.profileUrl);return s.jsx(Zo,{propertyType:v,value:m})}return s.jsx(Hf,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:l})}function Zo(e){var i;const{property:t,propertyType:n,value:r}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(se,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!wn(r)&&s.jsx(kk,{value:r,timeout:2e3,children:({copied:l,copy:u})=>s.jsx(Sa,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(En,{variant:"subtle",color:l?"teal":"gray",onClick:u,children:l?s.jsx($i,{size:"1rem"}):s.jsx(fP,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?s.jsx(sV,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(LV,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case re.code:case re.date:case re.decimal:case re.id:case re.integer:case re.positiveInt:case re.unsignedInt:case re.uri:case re.url:return s.jsx(s.Fragment,{children:r});case re.canonical:return s.jsx(uv,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return s.jsx(s.Fragment,{children:ur(r)});case re.markdown:return s.jsx("pre",{children:r});case re.Address:return s.jsx(fz,{value:r});case re.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case re.Attachment:return s.jsx(Nu,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return s.jsx(Ko,{value:r});case re.Coding:return s.jsx(DV,{value:r});case re.ContactDetail:return s.jsx(IV,{value:r});case re.ContactPoint:return s.jsx(IP,{value:r});case re.HumanName:return s.jsx(Fx,{value:r});case re.Identifier:return s.jsx(AV,{value:r});case re.Money:return s.jsx(NV,{value:r});case re.Period:return s.jsx(s.Fragment,{children:U7(r)});case re.Quantity:case re.Duration:return s.jsx(uu,{value:r});case re.Range:return s.jsx(Gx,{value:r});case re.Ratio:return s.jsx(OV,{value:r});case re.Reference:return s.jsx(uv,{value:r,link:e.link});case re.Timing:return s.jsx(s.Fragment,{children:zT(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Hf,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case re.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(FV,{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(Hf,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const OP=["extension","modifierExtension"],zV=uP.filter(e=>!OP.includes(e));function Hf(e){const t=e.value,{value:n,type:r}=t,o=g.useContext(Zt),i=e.profileUrl??(o==null?void 0:o.profileUrl),l=g.useMemo(()=>Bp(r,i),[i,r]),u=g.useMemo(()=>{if(l)return Ol({parentContext:o,elements:l.elements,path:e.path,profileUrl:l.url,accessPolicyResource:e.accessPolicyResource})},[l,o,e.path,e.accessPolicyResource]);if(wn(n))return null;if(!l)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 d=u??o;return Xp(Zt.Provider,u,s.jsx(Wx,{compact:e.compact,children:Object.entries(d.elements).map(([p,h])=>{var w;if(OP.includes(p)&&wn((w=h.slicing)==null?void 0:w.slices))return null;if(zV.includes(p))return null;if(dP.includes(p)&&h.path.split(".").length===2||p.includes("."))return null;const[m,v]=Jp(t,p,d.profileUrl);if((e.ignoreMissingValues||h.max===0)&&wn(m)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const x=h.max>1||h.isArray,b=s.jsx(Zo,{property:h,propertyType:v,path:e.path+"."+p,value:m,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:x,link:e.link},p);return x?b:s.jsx(bi,{term:ua(p),children:b},p)})}))}const MP="Read Only";function LP(e,t){return e?s.jsx(Sa.Floating,{label:e,children:t}):t}const VV="_dimmed_t0nld_1",BV="_preserveBreaks_t0nld_5",dv={dimmed:VV,preserveBreaks:BV};function $P(e){const{debugMode:t}=g.useContext(Zt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,LP(e!=null&&e.readonly?MP:void 0,s.jsxs(xe,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(sn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?dv.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function It(e){const{debugMode:t}=g.useContext(Zt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,LP(e!=null&&e.readonly?MP:void 0,s.jsx(sn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:At({[dv.dimmed]:e==null?void 0:e.readonly},dv.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:kt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function UV(e,t,n,r,o){const i=r.type;if(i.length>1)for(const l of i){const u=t.replace("[x]",Ln(l.code));u in e&&delete e[u]}return wn(o)?e[n]=void 0:e[n]=o,e}function WV(e){return!!e&&!wn(e.url)&&!wn(e.name)}function HV(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:i,valuePath:l,...u}=e,[d,p]=g.useState(t);function h(m){const v=GV(m);p(v),n&&n(v)}return s.jsx(Bx,{defaultValue:d&&qV(d),onChange:h,withHelpText:r??!0,...u})}function qV(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function GV(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function FP(e){var p,h;const{defaultValue:t,onChange:n,withHelpText:r,response:o,...i}=e,[l,u]=g.useState(((h=(p=o==null?void 0:o.answer)==null?void 0:p[0])==null?void 0:h.valueCoding)??t);function d(m){const v=m[0],x=v&&KV(v);u(x),n&&n(x)}return s.jsx(Bx,{defaultValue:l?QV(l):void 0,maxValues:1,onChange:d,withHelpText:r??!0,...i})}function QV(e){return{system:e.system,code:e.code,display:e.display}}function KV(e){return{system:e.system,code:e.code,display:e.display}}function zP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=g.useContext(Zt),[i,l]=g.useState(e.defaultValue),u=g.useRef();u.current=i;const[d,p,h]=g.useMemo(()=>["system","use","value"].map(E=>r[t+"."+E]),[r,t]),[m,v,x]=g.useMemo(()=>["system","use","value"].map(E=>o(t+"."+E)),[o,t]);function b(E){E&&Object.keys(E).length===0&&(E=void 0),l(E),e.onChange&&e.onChange(E)}function w(E){const C={...u.current,system:E};E||delete C.system,b(C)}function j(E){const C={...u.current,use:E};E||delete C.use,b(C)}function T(E){const C={...u.current,value:E};E||delete C.value,b(C)}const R=e.valuePath??t;return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Jt,{disabled:e.disabled||(m==null?void 0:m.readonly),"data-testid":"system",defaultValue:i==null?void 0:i.system,required:((d==null?void 0:d.min)??0)>0,onChange:E=>w(E.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:kt(n,R+".system")}),s.jsx(Jt,{disabled:e.disabled||(v==null?void 0:v.readonly),"data-testid":"use",defaultValue:i==null?void 0:i.use,required:((p==null?void 0:p.min)??0)>0,onChange:E=>j(E.currentTarget.value),data:["","home","work","temp","old","mobile"],error:kt(n,R+".use")}),s.jsx(Ve,{disabled:e.disabled||(x==null?void 0:x.readonly),placeholder:"Value",defaultValue:i==null?void 0:i.value,required:((h==null?void 0:h.min)??0)>0,onChange:E=>T(E.currentTarget.value),error:kt(n,R+".value")})]})}function YV(e){var h;const[t,n]=g.useState(e.defaultValue),r=g.useRef();r.current=t;const{getExtendedProps:o}=g.useContext(Zt),[i,l]=g.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,e.path]);function u(m){n(m),e.onChange&&e.onChange(m)}function d(m){const v={...r.current,name:m};m||delete v.name,u(v)}function p(m){const v={...r.current,telecom:m&&[m]};m||delete v.telecom,u(v)}return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ve,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:m=>d(m.currentTarget.value)}),s.jsx(zP,{disabled:e.disabled||(l==null?void 0:l.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(h=t==null?void 0:t.telecom)==null?void 0:h[0],onChange:p,outcome:e.outcome})]})}function XV(e){if(!e)return"";const t=new Date(e);return Wp(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Qx(e){if(!e)return"";const t=new Date(e);return Wp(t)?t.toISOString():""}function Yo(e){return s.jsx(Ve,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:JV(),defaultValue:XV(e.defaultValue),autoFocus:e.autoFocus,error:kt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Qx(n))}}})}function JV(){return"datetime-local"}function ZV(e){const{propertyType:t}=e,n=Te(),r=g.useMemo(()=>{if(bn(t.profile))return t.profile[0]},[t]),[o,i]=g.useState(r!==void 0);return g.useEffect(()=>{r&&(i(!0),n.requestProfileSchema(r).then(()=>i(!1)).catch(l=>{i(!1),console.warn(l)}))},[n,r]),r&&(o||!mx(r))?s.jsx("div",{children:"Loading..."}):s.jsx(Jx,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function eB(e){var R,E,C;const{outcome:t,path:n}=e,[r,o]=g.useState(e.defaultValue),{getExtendedProps:i}=g.useContext(Zt),[l,u,d,p,h]=g.useMemo(()=>["use","prefix","given","family","suffix"].map(P=>i(e.path+"."+P)),[i,e.path]);function m(P){o(P),e.onChange&&e.onChange(P)}function v(P){m({...r,use:P||void 0})}function x(P){m({...r,prefix:P?P.split(" "):void 0})}function b(P){m({...r,given:P?P.split(" "):void 0})}function w(P){m({...r,family:P||void 0})}function j(P){m({...r,suffix:P?P.split(" "):void 0})}const T=e.valuePath??n;return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Jt,{disabled:e.disabled||(l==null?void 0:l.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:P=>v(P.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:kt(t,T+".use")}),s.jsx(Ve,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(R=r==null?void 0:r.prefix)==null?void 0:R.join(" "),onChange:P=>x(P.currentTarget.value),error:kt(t,T+".prefix")}),s.jsx(Ve,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(E=r==null?void 0:r.given)==null?void 0:E.join(" "),onChange:P=>b(P.currentTarget.value),error:kt(t,T+".given")}),s.jsx(Ve,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:P=>w(P.currentTarget.value),error:kt(t,T+".family")}),s.jsx(Ve,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(C=r==null?void 0:r.suffix)==null?void 0:C.join(" "),onChange:P=>j(P.currentTarget.value),error:kt(t,T+".suffix")})]})}function tB(e){const[t,n]=g.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=g.useContext(Zt),[i,l]=g.useMemo(()=>["system","value"].map(m=>r[e.path+"."+m]),[r,e.path]),[u,d]=g.useMemo(()=>["system","value"].map(m=>o(e.path+"."+m)),[o,e.path]);function p(m){n(m),e.onChange&&e.onChange(m)}const h=e.valuePath??e.path;return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Ve,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:m=>p({...t,system:m.currentTarget.value}),error:kt(e.outcome,h+".system")}),s.jsx(Ve,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Value",required:((l==null?void 0:l.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:m=>p({...t,value:m.currentTarget.value}),error:kt(e.outcome,h+".value")})]})}const nB=["USD","EUR","CAD","GBP","AUD"];function rB(e){var m;const{onChange:t}=e,[n,r]=g.useState(e.defaultValue),{getExtendedProps:o}=g.useContext(Zt),[i,l]=g.useMemo(()=>["currency","value"].map(v=>o(e.path+"."+v)),[o,e.path]),u=g.useCallback(v=>{r(v),t&&t(v)},[t]),d=g.useCallback(v=>{u({...n,currency:v.currentTarget.value})},[n,u]),p=g.useCallback(v=>{u({...n,value:v.currentTarget.valueAsNumber})},[n,u]),h=s.jsx(Jt,{disabled:e.disabled||(i==null?void 0:i.readonly),defaultValue:n==null?void 0:n.currency,data:nB,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:d});return s.jsx(Ve,{disabled:e.disabled||(l==null?void 0:l.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((m=n==null?void 0:n.value)==null?void 0:m.toString())??"USD",leftSection:s.jsx(Iz,{size:14}),rightSection:h,rightSectionWidth:92,onChange:p})}function oB(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Zt),[o,i]=g.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Yo,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>l({...t,start:u})}),s.jsx(Yo,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>l({...t,end:u})})]})}function pa(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Zt),[o,i,l]=g.useMemo(()=>["comparator","value","unit"].map(d=>r(e.path+"."+d)),[r,e.path]);function u(d){n(d),e.onChange&&e.onChange(d)}return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Jt,{disabled:e.disabled||(o==null?void 0:o.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:d=>u({...t,comparator:d.currentTarget.value})}),s.jsx(Ve,{disabled:e.disabled||(i==null?void 0:i.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:d=>{e.disableWheel&&d.currentTarget.blur()},onChange:d=>{u({...t,value:iB(d.currentTarget.value)})}}),s.jsx(Ve,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:d=>u({...t,unit:d.currentTarget.value})})]})}function iB(e){if(e)return parseFloat(e)}function Kx(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Zt),[o,i]=g.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(pa,{path:e.path+".low",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>l({...t,low:u})}),s.jsx(pa,{path:e.path+".high",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>l({...t,high:u})})]})}function sB(e){const[t,n]=g.useState(e.defaultValue),{getExtendedProps:r}=g.useContext(Zt),[o,i]=g.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(pa,{path:e.path+".numerator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>l({...t,numerator:u})}),s.jsx(pa,{path:e.path+".denominator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>l({...t,denominator:u})})]})}const aB={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},lB=["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 cB(e){return{value:Dt(e)??"",label:ki(e),resource:e}}function Ta(e){const t=Te(),{resourceType:n,searchCriteria:r}=e,[o,i]=g.useState(),l=Vt(e.defaultValue,i),u=e.itemComponent??uB,d=e.onChange,p=g.useCallback(async(m,v)=>{const x=dB(n),b=new URLSearchParams({[x]:m??"",_count:"10",...r});return await t.searchResources(n,b,{signal:v})},[t,n,r]),h=g.useCallback(m=>{d&&d(m[0])},[d]);return bn(e.defaultValue)&&!o&&!l?null:s.jsx(zx,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:l,placeholder:e.placeholder,maxValues:1,toOption:cB,loadOptions:p,onChange:h,clearable:!0})}const uB=g.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(xe,{wrap:"nowrap",children:[s.jsx(ks,{value:t}),s.jsxs("div",{children:[s.jsx(Pe,{children:e}),s.jsx(Pe,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function dB(e){return aB[e]??(lB.includes(e)?"name":"_id")}function Lu(e){const{onChange:t}=e,n=Te(),[r,o]=g.useState(e.defaultValue),[i,l]=g.useState(()=>fB(e.targetTypes)),[u,d]=g.useState(()=>pB(e.defaultValue,i)),p=g.useRef(new ET),h=g.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);g.useEffect(()=>{let x=!1;const b=i==null?void 0:i.map(w=>{if(!mB(w))return Promise.resolve(w);x=!0;const j=w.value,T=p.current.get(j);if(T)return T;const R=hB(n,w.value).then(C=>{const P={...w};return C?bn(C.type)?(P.resourceType=C.type,P.name=C.name,P.title=C.title):(console.error(`StructureDefinition.type missing for ${w.value}`),P.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${w.value}`),P.error="StructureDefinition not found"),P}).catch(C=>(console.error(C),{...w,error:C})),E=new wo(R);return p.current.set(j,E),E});!b||!x||Promise.all(b).then(w=>{if(l(w),!u)return;const j=w.findIndex(T=>T.value===u.value||T.resourceType===u.resourceType);if(j===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}d(w[j])}).catch(console.error)},[n,u,i]);const m=g.useCallback(x=>{const b=x?rn(x):void 0;o(b),t&&t(b)},[t]),v=g.useMemo(()=>i?i.map(x=>({value:x.value,label:x.type==="profile"?x.title??x.name??x.resourceType??x.value:x.value})):[],[i]);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(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&s.jsx(Jt,{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:x=>{const b=x.currentTarget.value,w=i.find(j=>j.value===b);d(w)},data:v}),!i&&s.jsx(Ux,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:x=>{d(x?{type:"resourceType",value:x,resourceType:x}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Ta,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:h,onChange:m,disabled:e.disabled})]})]})}function fB(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 pB(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const o=t==null?void 0:t.find(i=>i.resourceType===n);return o||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function hB(e,t){const n=Kl(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
541
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
542
|
+
type,
|
|
543
|
+
name,
|
|
544
|
+
title,
|
|
545
|
+
}
|
|
546
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function mB(e){return e.type==="profile"&&!(e!=null&&e.error)&&wn(e.resourceType)}const gB="_indented_ldk1d_1",VP={indented:gB};function Yx({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(Oe,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Wf,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(En,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Wf,{size:"1.25rem"})})}function BP({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(En,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(Uf,{size:"1.25rem"})})}function vB(e){var x,b;const{slice:t,property:n}=e,[r,o]=g.useState(e.defaultValue),i=((x=t.typeSchema)==null?void 0:x.elements)??t.elements,l=g.useContext(Zt),u=g.useMemo(()=>{var w;if(bn(i))return Ol({parentContext:l,elements:i,path:e.path,profileUrl:(w=t.typeSchema)==null?void 0:w.url})},[l,e.path,(b=t.typeSchema)==null?void 0:b.url,i]);function d(w){o(w),e.onChange&&e.onChange(w)}const p=t.min>0,h=wn(t.elements),m=UT(t.name),v=e.property.readonly&&r.length===0;return Xp(Zt.Provider,u,s.jsx(It,{title:m,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:v?s.jsx(Pe,{c:"dimmed",children:"(empty)"}):s.jsxs(et,{className:h?VP.indented:void 0,children:[r.map((w,j)=>s.jsxs(xe,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${j}`,children:s.jsx(Xx,{elementDefinitionType:t.type[0],name:t.name,defaultValue:w,onChange:T=>{const R=[...r];R[j]=T,d(R)},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(BP,{propertyDisplayName:m,testId:e.testId&&`${e.testId}-remove-${j}`,onClick:T=>{on(T);const R=[...r];R.splice(j,1),d(R)}})]},`${j}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Yx,{propertyDisplayName:m,onClick:w=>{on(w);const j=[...r,void 0];d(j)},testId:e.testId&&`${e.testId}-add`})})]})}))}function yB(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function xB(e){var R;const{property:t}=e,n=Te(),[r,o]=g.useState(!0),[i,l]=g.useState([]),[u]=g.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[d,p]=g.useState(()=>[u]),h=g.useContext(Zt),m=(R=t.type[0])==null?void 0:R.code;g.useEffect(()=>{NP({medplum:n,property:t}).then(E=>{l(E);const C=AP(u,E,t.slicing,h.profileUrl);bB(C,E),p(C),o(!1)}).catch(E=>{console.error(E),o(!1)})},[n,t,u,h.profileUrl,p]);function v(E,C){const P=[...d];if(P[C]=E,p(P),e.onChange){const D=P.flat().filter(A=>A!==void 0);e.onChange(D)}}if(r)return s.jsx("div",{children:"Loading..."});const x=i.length,b=d[x],w=!(e.hideNonSliceValues??(m==="Extension"&&i.length>0)),j=ua(t.path),T=e.property.readonly&&i.length===0&&u.length===0;return s.jsxs(et,{className:e.indent?VP.indented:void 0,children:[T&&s.jsx(Pe,{c:"dimmed",children:"(empty)"}),i.map((E,C)=>s.jsx(vB,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:d[C],onChange:P=>{v(P,C)},testId:`slice-${E.name}`},E.name)),w&&b.map((E,C)=>s.jsxs(xe,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx($u,{arrayElement:!0,property:e.property,name:e.name+"."+C,path:e.path,valuePath:yB(e.path,e.valuePath,C),defaultValue:E,onChange:P=>{const D=[...b];D[C]=P,v(D,x)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(BP,{propertyDisplayName:j,testId:`nonsliced-remove-${C}`,onClick:P=>{on(P);const D=[...b];D.splice(C,1),v(D,x)}})]},`${C}-${b.length}`)),!e.property.readonly&&w&&d.flat().length<t.max&&s.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(Yx,{propertyDisplayName:j,onClick:E=>{on(E);const C=[...b];C.push(void 0),v(C,x)},testId:"nonsliced-add"})})]})}function bB(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function wB(e){const[t,n]=g.useState(!1),r=kC(),o=g.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),s.jsxs(gs,{gap:"xs",children:[s.jsx(wa,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(En,{title:"Copy secret",onClick:()=>{var l;r.copy((l=o.current)==null?void 0:l.value),De({color:"green",message:"Copied"})},children:s.jsx(fP,{})})]})}const SB=["sun","mon","tue","wed","thu","fri","sat"];function jB(e){const[t,n]=g.useState(e.defaultValue),[r,o]=g.useState(!e.disabled&&(e.defaultModalOpen??!1)),i=g.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:zT(i.current)||"No repeat"}),s.jsx(Oe,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&s.jsx(CB,{path:e.path,visible:r,defaultValue:i.current,onOk:l=>{e.onChange&&e.onChange(l),n(l),o(!1)},onCancel:()=>o(!1)})]})}const ij={repeat:{period:1,periodUnit:"d"}};function CB(e){const[t,n]=g.useState(e.defaultValue||ij),{getExtendedProps:r}=g.useContext(Zt),[o,i,l,u,d]=g.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(w=>r(e.path+"."+w)),[r,e.path]),p=g.useRef();p.current=t;function h(w){n({...p.current,event:[w]})}function m(w){n({...p.current,repeat:w})}function v(w){var j;m({...(j=p.current)==null?void 0:j.repeat,period:w})}function x(w){var j;m({...(j=p.current)==null?void 0:j.repeat,periodUnit:w})}function b(w){var j;m({...(j=p.current)==null?void 0:j.repeat,dayOfWeek:w})}return s.jsx(Nn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(et,{children:[s.jsx(It,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(Yo,{disabled:o==null?void 0:o.readonly,name:"timing-dialog-start",onChange:w=>h(w)})}),s.jsx(ku,{disabled:i==null?void 0:i.readonly,label:"Repeat",checked:!!t.repeat,onChange:w=>m(w.currentTarget.checked?ij.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(It,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ve,{disabled:l==null?void 0:l.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:w=>v(parseInt(w.currentTarget.value,10)||1)}),s.jsx(Jt,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:w=>x(w.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(It,{title:"Repeat on",children:s.jsx(nu.Group,{multiple:!0,onChange:b,children:s.jsx(xe,{justify:"space-between",mt:"md",gap:"xs",children:SB.map(w=>s.jsx(nu,{value:w,size:"xs",radius:"xl",disabled:d==null?void 0:d.readonly,children:w.charAt(0).toUpperCase()},w))})})})]}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Oe,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function $u(e){var u;const{property:t,name:n,onChange:r,defaultValue:o}=e,i=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,l=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===re.Attachment)return s.jsx(aV,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=((u=l[0])==null?void 0:u.code)!==re.Extension;return s.jsx(xB,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return l.length>1?s.jsx(EB,{elementDefinitionTypes:l,...e}):s.jsx(Xx,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const p=e.name.replace("[x]",Ln(l[0].code));e.onChange(d,p)}},outcome:e.outcome,elementDefinitionType:l[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function EB(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=g.useState(n);return s.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Jt,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:i=>{o(t.find(l=>l.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(Xx,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",Ln(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 Xx(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:l,readOnly:u}=e,d=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,h=g.useContext(Zt),m=g.useMemo(()=>{if(!xx(p)||!wn(e.defaultValue))return e.defaultValue;const b=Object.create(null);if(h.path===e.path)WS(b,h.elements);else{const w=ta(h.path,e.path);if(w===void 0)return e.defaultValue;WS(b,h.elements,w)}return bn(b)?b:e.defaultValue},[p,h.path,h.elements,e.path,e.defaultValue]);if(!p)return s.jsx("div",{children:"Property type not specified "});function v(){return{name:t,defaultValue:m,onChange:n,outcome:r,path:i,valuePath:l,disabled:u}}function x(){const b=kt(e.outcome,l??i);return{id:t,name:t,"data-testid":t,defaultValue:m,required:d,error:b,disabled:u}}switch(p){case re.SystemString:case re.canonical:case re.string:case re.time:case re.uri:case re.url:return e.path==="Project.secret.value[x]"?s.jsx(wB,{...x(),onChange:b=>{e.onChange&&e.onChange(b.currentTarget.value)}}):s.jsx(Ve,{...x(),onChange:b=>{n&&n(b.currentTarget.value)}});case re.date:return s.jsx(Ve,{...x(),type:"date",onChange:b=>{n&&n(b.currentTarget.value)}});case re.dateTime:case re.instant:return s.jsx(Yo,{...x(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return s.jsx(Ve,{...x(),type:"number",step:p===re.decimal?"any":"1",onChange:b=>{if(n){const w=b.currentTarget.valueAsNumber;n(Number.isNaN(w)?void 0:w)}}});case re.code:return s.jsx(wP,{...x(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet,creatable:!0,maxValues:1});case re.boolean:return s.jsx(Kn,{...x(),defaultChecked:!!m,onChange:b=>{n&&n(b.currentTarget.checked)}});case re.base64Binary:case re.markdown:return s.jsx(wa,{...x(),spellCheck:p!==re.base64Binary,onChange:b=>{n&&n(b.currentTarget.value)}});case re.Address:return s.jsx(mz,{...v()});case re.Annotation:return s.jsx(gz,{...v()});case re.Attachment:return s.jsx(SP,{...v()});case re.CodeableConcept:return s.jsx(HV,{binding:o==null?void 0:o.valueSet,...v()});case re.Coding:return s.jsx(FP,{binding:o==null?void 0:o.valueSet,...v()});case re.ContactDetail:return s.jsx(YV,{...v()});case re.ContactPoint:return s.jsx(zP,{...v()});case re.Extension:return s.jsx(ZV,{...v(),propertyType:e.elementDefinitionType});case re.HumanName:return s.jsx(eB,{...v()});case re.Identifier:return s.jsx(tB,{...v()});case re.Money:return s.jsx(rB,{...v()});case re.Period:return s.jsx(oB,{...v()});case re.Duration:case re.Quantity:return s.jsx(pa,{...v()});case re.Range:return s.jsx(Kx,{...v()});case re.Ratio:return s.jsx(sB,{...v()});case re.Reference:return s.jsx(Lu,{...v(),targetTypes:TB(e.elementDefinitionType)});case re.Timing:return s.jsx(jB,{...v()});case re.Dosage:case re.UsageContext:default:return s.jsx(Jx,{...v(),typeName:p})}}const kB=[`${zp}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function TB(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=kB.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function PB(e){const[t,n]=g.useState(e.defaultValue??{}),r=g.useContext(Zt),o=g.useMemo(()=>hz(r.elements),[r.elements]);function i(u){n(u),e.onChange&&e.onChange(u)}const l={type:e.type,value:t};return s.jsx(et,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([u,d])=>{const[p,h]=$V(l,u,d),m=d.min!==void 0&&d.min>0,v=e.valuePath?e.valuePath+"."+u:void 0,x=s.jsx($u,{property:d,name:u,path:e.path+"."+u,valuePath:v,defaultValue:p,defaultPropertyType:h,onChange:(b,w)=>{i(UV({...t},u,w??u,d,b))},outcome:e.outcome},u);return e.type==="Extension"||Ax.includes(u)?x:d.type.length===1&&d.type[0].code==="boolean"?s.jsx($P,{title:ua(u),description:d.description,htmlFor:u,fhirPath:d.path,withAsterisk:m,readonly:d.readonly,children:x},u):s.jsx(It,{title:ua(u),description:d.description,withAsterisk:m,htmlFor:u,outcome:e.outcome,fhirPath:d.path,errorExpression:v,readonly:d.readonly,children:x},u)})})}function Jx(e){const[t]=g.useState(()=>e.defaultValue??{}),n=g.useContext(Zt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=g.useMemo(()=>Bp(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,l=g.useMemo(()=>{if(o)return Ol({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?Xp(Zt.Provider,l,s.jsx(PB,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[i," not implemented"]})}const RB="_noteCite_10swh_5",_B="_noteRoot_10swh_10",sj={noteCite:RB,noteRoot:_B};function UP({value:e}){return e?s.jsx(et,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(Py,{classNames:{cite:sj.noteCite,root:sj.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Zl(e){const{value:t,link:n,...r}=e,[o,i]=g.useState(),l=Vt(t,i);let u;if(o&&!yT(o))u=`[${tt(o)}]`;else if(l)u=ki(l);else return null;return n?s.jsx(xt,{to:t,...r,children:u}):s.jsx(Pe,{component:"span",...r,children:u})}function El(e){return s.jsxs(xe,{gap:"xs",children:[s.jsx(ks,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Zl,{value:e.value,link:e.link})]})}const DB={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 Zx(e){return s.jsx(wp,{color:DB[e.status],children:e.status.replace(/-/g," ")})}const IB="_table_pe9td_1",AB="_criticalRow_pe9td_12",WP={table:IB,criticalRow:AB};e0.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function e0(e){var l;const t=Te(),n=Vt(e.value),[r,o]=g.useState();if(g.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(o).catch(console.error)},[t,n]),!n)return null;const i=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(l=u.contentType)!=null&&l.startsWith("text/plain")&&u.data&&i.push({text:window.atob(u.data)})}return s.jsxs(et,{children:[s.jsx(Fe,{children:"Diagnostic Report"}),s.jsx(NB,{value:n}),r&&!e.hideSpecimenInfo&&OB(r),n.result&&s.jsx(MB,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&s.jsx(UP,{value:i})]})}function NB({value:e}){var t,n;return s.jsxs(xe,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(El,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(El,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(El,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(Pe,{children:ur(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(Pe,{children:Ln(e.status)})]})]})}function OB(e){return s.jsxs(et,{gap:"xs",children:[s.jsx(Fe,{order:2,size:"h6",children:"Specimens"}),s.jsx(lr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(lr.Item,{ml:"sm",children:s.jsxs(xe,{gap:20,children:[s.jsxs(xe,{gap:5,children:[s.jsx(Pe,{fw:500,children:"Collected:"})," ",ur((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(xe,{gap:5,children:[s.jsx(Pe,{fw:500,children:"Received:"})," ",ur(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function MB(e){return s.jsxs("table",{className:WP.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(HP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function HP(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(LB,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Es(n)?n.reference:n.id}`))})}function LB(e){var o,i;const t=Vt(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=zB(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:At({[WP.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(xt,{to:t,children:s.jsx(Ko,{value:t.code})})}),s.jsx("td",{children:s.jsx($B,{value:t})}),s.jsx("td",{children:s.jsx(FB,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(Ko,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(l=>s.jsx("div",{children:s.jsx(Ko,{value:l})},`category-${ys(l)}`))})}),s.jsx("td",{children:(i=t.performer)==null?void 0:i.map(l=>s.jsx(uv,{value:l},l.reference))}),s.jsx("td",{children:t.status&&s.jsx(Zx,{status:t.status})})]}),t.hasMember&&s.jsx(HP,{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(UP,{value:t.note})})})]})}function $B(e){const t=e.value;return s.jsx(s.Fragment,{children:VT(t)})}function FB(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(Gx,{value:t}):null}function zB(e){var n,r,o,i;const t=(i=(o=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var yg={},gi={},aj;function qP(){if(aj)return gi;aj=1,Object.defineProperty(gi,"__esModule",{value:!0}),gi.Pointer=gi.escapeToken=gi.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}gi.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}gi.escapeToken=t;var n=function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var i=o.split("/").map(e);if(i[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(i)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var i=null,l="",u=o,d=1,p=this.tokens.length;d<p;d++)i=u,l=this.tokens[d],!(l=="__proto__"||l=="constructor"||l=="prototype")&&(u=(i||{})[l]);return{parent:i,key:l,value:u}},r.prototype.get=function(o){return this.evaluate(o).value},r.prototype.set=function(o,i){var l=this.evaluate(o);l.parent&&(l.parent[l.key]=i)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var i=this.tokens.concat(String(o));return new r(i)},r}();return gi.Pointer=n,gi}var un={},xg={},lj;function GP(){return lj||(lj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var i=o.length,l=new Array(i),u=0;u<i;u++)l[u]=r(o[u]);return l}if(o.constructor==Date){var d=new Date(+o);return d}var p={};for(var h in o)e.hasOwnProperty.call(o,h)&&(p[h]=r(o[h]));return p}e.clone=r}(xg)),xg}var sr={},cj;function QP(){if(cj)return sr;cj=1,Object.defineProperty(sr,"__esModule",{value:!0}),sr.diffAny=sr.diffObjects=sr.diffArrays=sr.intersection=sr.subtract=sr.isDestructive=void 0;var e=GP();function t(h){var m=h.op;return m==="remove"||m==="replace"||m==="copy"||m==="move"}sr.isDestructive=t;function n(h,m){var v={};for(var x in h)e.hasOwnProperty.call(h,x)&&h[x]!==void 0&&(v[x]=1);for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&delete v[b];return Object.keys(v)}sr.subtract=n;function r(h){for(var m=h.length,v={},x=0;x<m;x++){var b=h[x];for(var w in b)e.hasOwnProperty.call(b,w)&&b[w]!==void 0&&(v[w]=(v[w]||0)+1)}for(var w in v)v[w]<m&&delete v[w];return Object.keys(v)}sr.intersection=r;function o(h){return h.op==="add"}function i(h){return h.op==="remove"}function l(h,m){return{operations:h.operations.concat(m),cost:h.cost+1}}function u(h,m,v,x){x===void 0&&(x=p);var b={"0,0":{operations:[],cost:0}};function w(C,P){var D="".concat(C,",").concat(P),A=b[D];if(A===void 0){if(C>0&&P>0&&!x(h[C-1],m[P-1],v.add(String(C-1))).length)A=w(C-1,P-1);else{var O=[];if(C>0){var L=w(C-1,P),V={op:"remove",index:C-1};O.push(l(L,V))}if(P>0){var q=w(C,P-1),G={op:"add",index:C-1,value:m[P-1]};O.push(l(q,G))}if(C>0&&P>0){var Q=w(C-1,P-1),Y={op:"replace",index:C-1,original:h[C-1],value:m[P-1]};O.push(l(Q,Y))}var X=O.sort(function(B,M){return B.cost-M.cost})[0];A=X}b[D]=A}return A}var j=isNaN(h.length)||h.length<=0?0:h.length,T=isNaN(m.length)||m.length<=0?0:m.length,R=w(j,T).operations,E=R.reduce(function(C,P){var D=C[0],A=C[1];if(o(P)){var O=P.index+1+A,L=O<j+A?String(O):"-",V={op:P.op,path:v.add(L).toString(),value:P.value};return[D.concat(V),A+1]}else if(i(P)){var V={op:P.op,path:v.add(String(P.index+A)).toString()};return[D.concat(V),A-1]}else{var q=v.add(String(P.index+A)),G=x(P.original,P.value,q);return[D.concat.apply(D,G),A]}},[[],0])[0];return E}sr.diffArrays=u;function d(h,m,v,x){x===void 0&&(x=p);var b=[];return n(h,m).forEach(function(w){b.push({op:"remove",path:v.add(w).toString()})}),n(m,h).forEach(function(w){b.push({op:"add",path:v.add(w).toString(),value:m[w]})}),r([h,m]).forEach(function(w){b.push.apply(b,x(h[w],m[w],v.add(w)))}),b}sr.diffObjects=d;function p(h,m,v,x){if(x===void 0&&(x=p),h===m)return[];var b=(0,e.objectType)(h),w=(0,e.objectType)(m);return b=="array"&&w=="array"?u(h,m,v,x):b=="object"&&w=="object"?d(h,m,v,x):[{op:"replace",path:v.toString(),value:m}]}return sr.diffAny=p,sr}var uj;function VB(){if(uj)return un;uj=1;var e=un&&un.__extends||function(){var j=function(T,R){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,C){E.__proto__=C}||function(E,C){for(var P in C)Object.prototype.hasOwnProperty.call(C,P)&&(E[P]=C[P])},j(T,R)};return function(T,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");j(T,R);function E(){this.constructor=T}T.prototype=R===null?Object.create(R):(E.prototype=R.prototype,new E)}}();Object.defineProperty(un,"__esModule",{value:!0}),un.apply=un.InvalidOperationError=un.test=un.copy=un.move=un.replace=un.remove=un.add=un.TestError=un.MissingError=void 0;var t=qP(),n=GP(),r=QP(),o=function(j){e(T,j);function T(R){var E=j.call(this,"Value required at path: ".concat(R))||this;return E.path=R,E.name="MissingError",E}return T}(Error);un.MissingError=o;var i=function(j){e(T,j);function T(R,E){var C=j.call(this,"Test failed: ".concat(R," != ").concat(E))||this;return C.actual=R,C.expected=E,C.name="TestError",C}return T}(Error);un.TestError=i;function l(j,T,R){if(Array.isArray(j))if(T=="-")j.push(R);else{var E=parseInt(T,10);j.splice(E,0,R)}else j[T]=R}function u(j,T){if(Array.isArray(j)){var R=parseInt(T,10);j.splice(R,1)}else delete j[T]}function d(j,T){var R=t.Pointer.fromJSON(T.path).evaluate(j);return R.parent===void 0?new o(T.path):(l(R.parent,R.key,(0,n.clone)(T.value)),null)}un.add=d;function p(j,T){var R=t.Pointer.fromJSON(T.path).evaluate(j);return R.value===void 0?new o(T.path):(u(R.parent,R.key),null)}un.remove=p;function h(j,T){var R=t.Pointer.fromJSON(T.path).evaluate(j);if(R.parent===null)return new o(T.path);if(Array.isArray(R.parent)){if(parseInt(R.key,10)>=R.parent.length)return new o(T.path)}else if(R.value===void 0)return new o(T.path);return R.parent[R.key]=(0,n.clone)(T.value),null}un.replace=h;function m(j,T){var R=t.Pointer.fromJSON(T.from).evaluate(j);if(R.value===void 0)return new o(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(j);return E.parent===void 0?new o(T.path):(u(R.parent,R.key),l(E.parent,E.key,R.value),null)}un.move=m;function v(j,T){var R=t.Pointer.fromJSON(T.from).evaluate(j);if(R.value===void 0)return new o(T.from);var E=t.Pointer.fromJSON(T.path).evaluate(j);return E.parent===void 0?new o(T.path):(l(E.parent,E.key,(0,n.clone)(R.value)),null)}un.copy=v;function x(j,T){var R=t.Pointer.fromJSON(T.path).evaluate(j);return(0,r.diffAny)(R.value,T.value,new t.Pointer).length?new i(R.value,T.value):null}un.test=x;var b=function(j){e(T,j);function T(R){var E=j.call(this,"Invalid operation: ".concat(R.op))||this;return E.operation=R,E.name="InvalidOperationError",E}return T}(Error);un.InvalidOperationError=b;function w(j,T){switch(T.op){case"add":return d(j,T);case"remove":return p(j,T);case"replace":return h(j,T);case"move":return m(j,T);case"copy":return v(j,T);case"test":return x(j,T)}return new b(T)}return un.apply=w,un}var dj;function BB(){return dj||(dj=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=qP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=VB(),r=QP();function o(p,h){return h.map(function(m){return(0,n.apply)(p,m)})}e.applyPatch=o;function i(p){function h(m,v,x){var b=p(m,v,x);return Array.isArray(b)?b:(0,r.diffAny)(m,v,x,h)}return h}function l(p,h,m){var v=new t.Pointer;return(m?i(m):r.diffAny)(p,h,v)}e.createPatch=l;function u(p,h){var m=t.Pointer.fromJSON(h).evaluate(p);if(m!==void 0)return{op:"test",path:h,value:m.value}}function d(p,h){var m=new Array;return h.filter(r.isDestructive).forEach(function(v){var x=u(p,v.path);if(x&&m.push(x),"from"in v){var b=u(p,v.from);b&&m.push(b)}}),m}e.createTests=d}(yg)),yg}var KP=BB();const UB="_removed_el5zk_1",WB="_added_el5zk_6",fj={removed:UB,added:WB};function HB(e){var h;const{name:t,path:n,property:r,originalValue:o,revisedValue:i}=e,l=!!((h=r==null?void 0:r.type)!=null&&h.find(m=>m.code==="Attachment")),[u,d]=g.useState(l),p=()=>d(m=>!m);return s.jsx(s.Fragment,{children:l&&!u||!l?s.jsx(s.Fragment,{children:s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:t}),s.jsx(Me.Td,{className:fj.removed,children:o&&s.jsx(Zo,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),s.jsx(Me.Td,{className:fj.added,children:i&&s.jsx(Zo,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})})]})}):s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:t}),s.jsx(Me.Td,{colSpan:2,style:{textAlign:"right"},children:s.jsx(Oe,{onClick:p,variant:"light",children:"Expand"})})]})})}const qB="_root_x463w_1",GB={root:qB};function QB(e){const t=Te(),{original:n,revised:r}=e,[o,i]=g.useState(!1);g.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const l=g.useMemo(()=>{if(!o)return null;const u=[io(n)],d=[io(r)],p=[],h=KB(KP.createPatch(n,r));for(const m of h){const v=m.path,x=YB(v),b=XB(n.resourceType,x),w=m.op==="add"?void 0:da(x,u),j=m.op==="remove"?void 0:da(x,d);p.push({key:`op-${m.op}-${m.path}`,name:`${Ln(m.op)} ${x}`,path:(b==null?void 0:b.path)??n.resourceType+"."+x,property:b,originalValue:pj(b,w),revisedValue:pj(b,j)})}return p},[o,n,r]);return l?s.jsxs(Me,{className:GB.root,children:[s.jsx(Me.Thead,{children:s.jsxs(Me.Tr,{children:[s.jsx(Me.Th,{}),s.jsx(Me.Th,{children:"Before"}),s.jsx(Me.Th,{children:"After"})]})}),s.jsx(Me.Tbody,{children:l.map(u=>s.jsx(HB,{...u}))})]}):null}function KB(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const i=e.filter(u=>u.op===r&&u.path===o).length,l={op:r,path:o};i>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(l.op="replace",l.path=o.replace(/\/[^/]+$/,"")),t.some(u=>u.op===l.op&&u.path===l.path)||t.push(l)}return t}function YB(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function XB(e,t){var r;const n=Jl(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function pj(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:JB(t,!!(e!=null&&e.isArray))}}function JB(e,t){const n=O7(e).flatMap(r=>r.value);return t?n:n[0]}function t0(e){const{profileUrl:t}=e,n=Te(),r=n.getAccessPolicy(),o=Vt(e.value),[i,l]=g.useState(!1);g.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Kl(t)?l(!0):console.error(`Schema not found for ${t}`)}).catch(d=>{console.error("Error in requestProfileSchema",d)});else{const d=o.resourceType;n.requestSchema(d).then(()=>{l(!0)}).catch(console.error)}},[n,t,o]);const u=g.useMemo(()=>o&&KT(o,bl.READ,r),[r,o]);return!i||!o?null:s.jsx(Hf,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const ZB="_item_5q6yx_1",eU="_itemPadding_5q6yx_5",hj={item:ZB,itemPadding:eU};function tU(e){return s.jsx(Ou,{children:e.children})}function ha(e){var d,p;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,l=n??((d=t.meta)==null?void 0:d.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return s.jsxs(qx,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(xe,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(ks,{value:l,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(Pe,{size:"sm",children:s.jsx(Zl,{c:"dark",fw:500,value:l,link:!0})}),s.jsxs(Pe,{size:"xs",children:[s.jsx(xt,{c:"dimmed",to:e.resource,children:ur(u)}),s.jsx(Pe,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(xt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(ve,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(ve.Target,{children:s.jsx(En,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Dt(e.resource)}`,children:s.jsx(Nz,{})})}),o]})]}),s.jsx(gP,{children:s.jsx("div",{className:At(hj.item,{[hj.itemPadding]:r}),children:e.children})})]})}function YP(e,t){e.sort((n,r)=>{const o=mj(n,t),i=mj(r,t);return o>i?1:o<i?-1:gj(n,t)-gj(r,t)})}function mj(e,t){if(!XP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function gj(e,t){var r;if(!XP(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 XP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const nU="_pinnedComment_5uxzi_2",rU={pinnedComment:nU};function Zp(e){const t=Te(),n=t.getProfile(),r=g.useRef(null),o=Vt(e.value),[i,l]=g.useState(),[u,d]=g.useState([]),p=e.loadTimelineResources,h=g.useRef(u);h.current=u;const m=g.useCallback(C=>{YP(C,o),C.reverse(),d(C)},[o]),v=g.useCallback(C=>{const P=[];for(const D of C){if(D.status!=="fulfilled")continue;const A=D.value;if(A.type==="history"&&l(A),A.entry)for(const O of A.entry)P.push(O.resource)}m(P)},[m]),x=g.useCallback(C=>m([...h.current,C]),[m]),b=g.useCallback(()=>{var D;let C,P;"resourceType"in e.value?(C=e.value.resourceType,P=e.value.id):[C,P]=(D=e.value.reference)==null?void 0:D.split("/"),p(t,C,P).then(v).catch(console.error)},[t,e.value,p,v]);g.useEffect(()=>b(),[b]);function w(C){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,C)).then(P=>x(P)).catch(console.error)}function j(C){!o||!e.createMedia||t.createResource(e.createMedia(o,n,C)).then(P=>x(P)).then(()=>Zs({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx($i,{size:16}),autoClose:2e3})).catch(P=>Zs({id:"upload-notification",color:"red",title:"Upload error",message:tt(P),icon:s.jsx(YS,{size:16}),autoClose:2e3}))}function T(){De({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function R(C){Zs({id:"upload-notification",loading:!0,title:"Uploading...",message:uU(C),autoClose:!1,withCloseButton:!1})}function E(C){Zs({id:"upload-notification",color:"red",title:"Upload error",message:tt(C),icon:s.jsx(YS,{size:16}),autoClose:2e3})}return o?s.jsxs(tU,{children:[e.createCommunication&&s.jsx(qx,{children:s.jsx(mt,{testid:"timeline-form",onSubmit:C=>{w(C.text);const P=r.current;P&&(P.value="",P.focus())},children:s.jsxs(xe,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(ks,{value:n}),s.jsx(Ve,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(En,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(Bz,{size:16})}),s.jsx(Hx,{securityContext:rn(o),onUpload:j,onUploadStart:T,onUploadProgress:R,onUploadError:E,children:C=>s.jsx(En,{...C,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Ox,{size:16})})})]})})}),u.map(C=>{var A;if(!C)return null;const P=`${C.resourceType}/${C.id}/${(A=C.meta)==null?void 0:A.versionId}`,D=e.getMenu?e.getMenu({primaryResource:o,currentResource:C,reloadTimeline:b}):void 0;if(C.resourceType===o.resourceType&&C.id===o.id)return s.jsx(oU,{history:i,resource:C,popupMenuItems:D},P);switch(C.resourceType){case"AuditEvent":return s.jsx(lU,{resource:C,popupMenuItems:D},P);case"Communication":return s.jsx(sU,{resource:C,popupMenuItems:D},P);case"DiagnosticReport":return s.jsx(cU,{resource:C,popupMenuItems:D},P);case"Media":return s.jsx(aU,{resource:C,popupMenuItems:D},P);default:return s.jsx(ha,{resource:C,padding:!0,children:s.jsx(t0,{value:C,ignoreMissingValues:!0})},P)}})]}):s.jsx(Gn,{style:{width:"100%",height:"100%"},children:s.jsx(Cr,{})})}function oU(e){const{history:t,resource:n,...r}=e,o=iU(t,n);return o?s.jsx(ha,{resource:n,padding:!0,...r,children:s.jsx(QB,{original:o,revised:e.resource})}):s.jsxs(ha,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(t0,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function iU(e,t){const n=e.entry??[],r=n.findIndex(o=>{var i,l,u;return((l=(i=o.resource)==null?void 0:i.meta)==null?void 0:l.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function sU(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:rU.pinnedComment;return s.jsx(ha,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function aU(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(ha,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(Nu,{value:e.resource.content})})}function lU(e){return s.jsx(ha,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(co,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function cU(e){return s.jsx(ha,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(e0,{value:e.resource})})}function uU(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${bg(e.loaded)} / ${bg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${bg(e.loaded)}`}function bg(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 dU(e){const{resource:t,...n}=e;return s.jsx(Zp,{value:t,loadTimelineResources:async(r,o,i)=>{const l=`${o}/${i}`;return Promise.allSettled([r.readHistory(o,i),r.search("Task",{_filter:`based-on eq ${l} or focus eq ${l} or subject eq ${l}`,_count:100})])},...n})}function fU(e){const{encounter:t,...n}=e;return s.jsx(Zp,{value:t,loadTimelineResources:async(r,o,i)=>Promise.allSettled([r.readHistory("Encounter",i),r.search("Communication","encounter=Encounter/"+i),r.search("Media","encounter=Encounter/"+i)]),createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",encounter:rn(r),subject:r.subject,sender:rn(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",encounter:rn(r),subject:r.subject,operator:rn(o),issued:new Date().toISOString(),content:i}),...n})}function pU(e){let t;try{t=Xl(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(Zo,{value:t[0]||"",propertyType:e.propertyType})}function hU(e){return s.jsxs(Nn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(se,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(vj,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(vj,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(Pe,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function vj(e){return s.jsx(Oe,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const mU={string:[le.EQUALS,le.NOT,le.CONTAINS,le.EXACT],fulltext:[le.EQUALS,le.NOT,le.CONTAINS,le.EXACT],token:[le.EQUALS,le.NOT],reference:[le.EQUALS,le.NOT],numeric:[le.EQUALS,le.NOT_EQUALS,le.GREATER_THAN,le.LESS_THAN,le.GREATER_THAN_OR_EQUALS,le.LESS_THAN_OR_EQUALS],quantity:[le.EQUALS,le.NOT_EQUALS,le.GREATER_THAN,le.LESS_THAN,le.GREATER_THAN_OR_EQUALS,le.LESS_THAN_OR_EQUALS],date:[le.EQUALS,le.NOT_EQUALS,le.GREATER_THAN,le.LESS_THAN,le.GREATER_THAN_OR_EQUALS,le.LESS_THAN_OR_EQUALS,le.STARTS_AFTER,le.ENDS_BEFORE,le.APPROXIMATELY],datetime:[le.EQUALS,le.NOT_EQUALS,le.GREATER_THAN,le.LESS_THAN,le.GREATER_THAN_OR_EQUALS,le.LESS_THAN_OR_EQUALS,le.STARTS_AFTER,le.ENDS_BEFORE,le.APPROXIMATELY],uri:[le.EQUALS,le.NOT,le.ABOVE,le.BELOW]},gU={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 n0(e,t){return{...e,filters:t,offset:0,name:void 0}}function JP(e,t){return n0(e,(e.filters??[]).filter(n=>n.code!==t))}function eh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),n0(e,i)}function vU(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function yU(e,t){return r0(e,t,-1)}function xU(e,t){return r0(e,t,0)}function bU(e,t){return r0(e,t,1)}function r0(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),i0(e,t,r,o)}function wU(e,t){return o0(e,t,-1)}function SU(e,t){return o0(e,t,0)}function jU(e,t){return o0(e,t,1)}function o0(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),i0(e,t,r,o)}function CU(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),i0(e,t,n,new Date)}function i0(e,t,n,r){return e=JP(e,t),e=yj(e,t,le.GREATER_THAN_OR_EQUALS,n),e=yj(e,t,le.LESS_THAN_OR_EQUALS,r),e}function yj(e,t,n,r){return eh(e,t,n,r.toISOString())}function xj(e,t,n=!0){return eh(e,t,le.MISSING,n.toString())}function EU(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function kU(e,t){const n=e.count??Hp,r=(t-1)*n;return EU(e,r)}function TU(e,t,n){return t===PU(e)&&n!==void 0&&n===RU(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function PU(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function RU(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function _U(e){return mU[e.type]}function ZP(e){return gU[e]??""}function ma(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(Ln).join(" "))}function DU(e,t){var r,o;const n=t.name;return n==="id"?s.jsx(xt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?ur((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?IU(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?AU(e,t.searchParams[0]):null}function IU(e,t){var i,l,u;const n=((u=(l=(i=t.path)==null?void 0:i.split("."))==null?void 0:l.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,o]=Jp({type:e.resourceType,value:e},n);return r?s.jsx(Zo,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function AU(e,t){const n=da(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,o)=>s.jsx(Zo,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function NU(e){const t=g.useRef(!1),[n,r]=g.useState({search:JSON.parse(Po(e.search))}),[o,i]=g.useState(!1);g.useEffect(()=>{r({search:e.search})},[e.search]);const l=g.useMemo(()=>{if(!e.visible)return[];const d=e.search.resourceType,p=CT(d),h=wx(d);return su(OU(p,h)).map(m=>({value:m,label:ma(m)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function u(d){r({search:{...n.search,fields:d}})}return s.jsx(Nn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(et,{children:[s.jsx(Su,{style:{width:550},placeholder:"Select fields to display",data:l,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Oe,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function OU(e,t){const n=[],r=new Set,o=new Set;for(const i of Object.keys(e.elements))n.push(i),r.add(i.toLowerCase()),o.add(ma(i));if(t)for(const i of Object.keys(t)){const l=ma(i);!r.has(i)&&!o.has(l)&&(n.push(i),r.add(i),o.add(l))}return n}function eR(e){const t=Jl(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case qn.REFERENCE:return s.jsx(Lu,{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 qn.BOOLEAN:return s.jsx(Kn,{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 qn.DATE:return s.jsx(Ve,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case qn.DATETIME:return s.jsx(Yo,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case qn.NUMBER:return s.jsx(Ve,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case qn.QUANTITY:return s.jsx(pa,{name:n,path:"",defaultValue:MU(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(Ve,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function MU(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function LU(e){const[t,n]=g.useState(Vr(e.search)),r=g.useRef(t);r.current=t,g.useEffect(()=>{n(Vr(e.search))},[e.search]);function o(d){n(eh(r.current,d.code,d.operator,d.value))}if(!e.visible)return null;const i=e.search.resourceType,l=wx(i)??{},u=t.filters||[];return s.jsx(Nn,{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((d,p)=>s.jsx($U,{id:`filter-${p}-row`,resourceType:i,searchParams:l,value:d,onChange:h=>{const m=[...u];m[p]=h,n(n0(r.current,m))},onDelete:()=>n(vU(r.current,p))},`filter-${p}-row`))})]}),s.jsx(Yx,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Ur,{children:"OK"})})]})})}function $U(e){const t=e.value,n=g.useRef(t);n.current=t;function r(d){n.current.code=d,n.current.operator=le.EQUALS,n.current.value="",e.onChange(n.current)}function o(d){n.current.operator=d,n.current.value="",e.onChange(n.current)}function i(d){n.current.value=d,e.onChange(n.current)}const l=e.searchParams[t.code],u=l&&_U(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Jt,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:d=>r(d.currentTarget.value),data:["",...Object.keys(e.searchParams).map(d=>({value:d,label:ma(d)}))]})}),s.jsx("td",{children:u&&s.jsx(Jt,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:d=>o(d.currentTarget.value),data:["",...u.map(d=>({value:d,label:ZP(d)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(eR,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:i})}),s.jsx("td",{children:e.onDelete&&s.jsx(En,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:s.jsx(fa,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function FU(e){const[t,n]=g.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(Nn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(mt,{onSubmit:r,children:s.jsxs($r,{children:[s.jsx($r.Col,{span:10,children:s.jsx(eR,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx($r.Col,{span:2,children:s.jsx(Oe,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function zU(e){var o;const{resourceType:t,filter:n}=e,r=(o=Jo.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===le.EQUALS||n.operator===le.NOT_EQUALS))return s.jsx(Zl,{value:{reference:n.value}});const i=Jl(t,r);if(n.code==="_lastUpdated"||i.type===qn.DATETIME)return s.jsx(s.Fragment,{children:ur(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function VU(e){if(!e.searchParams)return null;function t(i,l){o(TU(e.search,i.code,l))}function n(i){o(JP(e.search,i.code))}function r(i,l){e.onPrompt(i,{code:i.code,operator:l,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(BU,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):s.jsx(ve.Dropdown,{children:e.searchParams.map(i=>s.jsx(ve.Item,{children:ma(i.code)},i.code))})}function BU(e){switch(e.searchParam.type){case"date":return s.jsx(UU,{...e});case"number":case"quantity":return s.jsx(WU,{...e});case"reference":return s.jsx(HU,{...e});case"string":return s.jsx(qU,{...e});case"token":case"uri":return s.jsx(GU,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function UU(e){const{searchParam:t}=e,n=t.code;return s.jsxs(ve.Dropdown,{children:[s.jsx(ve.Item,{leftSection:s.jsx(Mx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(ve.Item,{leftSection:s.jsx(Lx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Au,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Equals..."}),s.jsx(ve.Item,{leftSection:s.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,le.NOT_EQUALS),children:"Does not equal..."}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(mP,{size:14}),onClick:()=>e.onPrompt(t,le.ENDS_BEFORE),children:"Before..."}),s.jsx(ve.Item,{leftSection:s.jsx(hP,{size:14}),onClick:()=>e.onPrompt(t,le.STARTS_AFTER),children:"After..."}),s.jsx(ve.Item,{leftSection:s.jsx(Cz,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Between..."}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(bU(e.search,n)),children:"Tomorrow"}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(xU(e.search,n)),children:"Today"}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(yU(e.search,n)),children:"Yesterday"}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(jU(e.search,n)),children:"Next Month"}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(SU(e.search,n)),children:"This Month"}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(wU(e.search,n)),children:"Last Month"}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Hs,{size:14}),onClick:()=>e.onChange(CU(e.search,n)),children:"Year to date"}),s.jsx(Fu,{...e})]})}function WU(e){const{searchParam:t}=e;return s.jsxs(ve.Dropdown,{children:[s.jsx(ve.Item,{leftSection:s.jsx(Mx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(ve.Item,{leftSection:s.jsx(Lx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Au,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Equals..."}),s.jsx(ve.Item,{leftSection:s.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,le.NOT_EQUALS),children:"Does not equal..."}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(hP,{size:14}),onClick:()=>e.onPrompt(t,le.GREATER_THAN),children:"Greater than..."}),s.jsx(ve.Item,{leftSection:s.jsx(lv,{size:14}),onClick:()=>e.onPrompt(t,le.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(ve.Item,{leftSection:s.jsx(mP,{size:14}),onClick:()=>e.onPrompt(t,le.LESS_THAN),children:"Less than..."}),s.jsx(ve.Item,{leftSection:s.jsx(lv,{size:14}),onClick:()=>e.onPrompt(t,le.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Fu,{...e})]})}function HU(e){const{searchParam:t}=e;return s.jsxs(ve.Dropdown,{children:[s.jsx(ve.Item,{leftSection:s.jsx(Au,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Equals..."}),s.jsx(ve.Item,{leftSection:s.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,le.NOT),children:"Does not equal..."}),s.jsx(Fu,{...e})]})}function qU(e){const{searchParam:t}=e;return s.jsxs(ve.Dropdown,{children:[s.jsx(ve.Item,{leftSection:s.jsx(Mx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(ve.Item,{leftSection:s.jsx(Lx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Au,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Equals..."}),s.jsx(ve.Item,{leftSection:s.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,le.NOT),children:"Does not equal..."}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Tz,{size:14}),onClick:()=>e.onPrompt(t,le.CONTAINS),children:"Contains..."}),s.jsx(ve.Item,{leftSection:s.jsx(kz,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Does not contain..."}),s.jsx(Fu,{...e})]})}function GU(e){const{searchParam:t}=e;return s.jsxs(ve.Dropdown,{children:[s.jsx(ve.Item,{leftSection:s.jsx(Au,{size:14}),onClick:()=>e.onPrompt(t,le.EQUALS),children:"Equals..."}),s.jsx(ve.Item,{leftSection:s.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,le.NOT),children:"Does not equal..."}),s.jsx(Fu,{...e})]})}function Fu(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(Sz,{size:14}),onClick:()=>e.onChange(xj(e.search,n)),children:"Missing"}),s.jsx(ve.Item,{leftSection:s.jsx(wz,{size:14}),onClick:()=>e.onChange(xj(e.search,n,!1)),children:"Not missing"}),s.jsx(ve.Divider,{}),s.jsx(ve.Item,{leftSection:s.jsx(fa,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const QU="_root_vlout_1",KU="_table_vlout_8",YU="_tr_vlout_12",XU="_control_vlout_22",JU="_icon_vlout_31",zc={root:QU,table:KU,tr:YU,control:XU,icon:JU};function ZU(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(eW(t,r));return n}function eW(e,t){var o;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const n=Ea(e,t),r=J7(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=wx(e);let l;if(i){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);l=Object.values(i).filter(d=>!!d.expression&&u.test(d==null?void 0:d.expression)),l.length===0&&(l=void 0)}return{name:t,elementDefinition:n,searchParams:l}}if(r){const i=Jl(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class tW extends Event{constructor(t){super("change"),this.definition=t}}class nW extends Event{constructor(t){super("load"),this.response=t}}class qf extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function zu(e){var Y,X,B;const t=Te(),[n,r]=g.useState(),{search:o,onLoad:i}=e,[l,u]=g.useState(o);vs(o,l)||u(o);const[d,p]=g.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),h=g.useRef(d);h.current=d;const m=l.total??"accurate",v=g.useCallback(M=>{r(void 0),t.requestSchema(l.resourceType).then(()=>t.search(l.resourceType,xl({...l,total:m,fields:void 0}),M)).then(N=>{p({...h.current,searchResponse:N}),i&&i(new nW(N))}).catch(N=>{p({...h.current,searchResponse:void 0}),r(Gt(N))})},[t,l,m,i]),x=g.useCallback(()=>{p({...h.current,searchResponse:void 0}),v({cache:"reload"})},[v]);g.useEffect(()=>{v()},[v]);function b(M,N){M.stopPropagation();const I=M.target.checked,z={...h.current.selected};I?z[N]=!0:delete z[N],p({...h.current,selected:z})}function w(M){M.stopPropagation();const F=M.target.checked,I={},z=h.current.searchResponse;F&&(z!=null&&z.entry)&&z.entry.forEach(J=>{var ae;(ae=J.resource)!=null&&ae.id&&(I[J.resource.id]=!0)}),p({...h.current,selected:I})}function j(){var N,F;const M=h.current;if(!((N=M.searchResponse)!=null&&N.entry)||M.searchResponse.entry.length===0)return!1;for(const I of M.searchResponse.entry)if((F=I.resource)!=null&&F.id&&!M.selected[I.resource.id])return!1;return!0}function T(M){e.onChange&&e.onChange(new tW(M))}function R(M,N){if(yP(M.target)||M.button===2)return;on(M);const F=vP(M);!F&&e.onClick&&e.onClick(new qf(N,M)),F&&e.onAuxClick&&e.onAuxClick(new qf(N,M))}function E(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(po,{outcome:n});if(!jT(l.resourceType))return s.jsx(Gn,{style:{width:"100%",height:"100%"},children:s.jsx(Cr,{})});const C=e.checkboxesEnabled,P=ZU(l),D=l.resourceType,A=d.searchResponse,O=A==null?void 0:A.entry,L=O==null?void 0:O.map(M=>M.resource),V="subtle",q="gray",G=16,Q=window.innerWidth<768;return s.jsxs("div",{className:zc.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(xe,{justify:"space-between",mb:"xl",children:[s.jsxs(xe,{gap:2,children:[s.jsx(Oe,{size:"compact-md",variant:V,color:q,leftSection:s.jsx(Dz,{size:G}),onClick:()=>p({...h.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(Oe,{size:"compact-md",variant:V,color:q,leftSection:s.jsx(Mz,{size:G}),onClick:()=>p({...h.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(Oe,{size:"compact-md",variant:V,color:q,leftSection:s.jsx(Oz,{size:G}),onClick:e.onNew,children:"New..."}),!Q&&E()&&s.jsx(Oe,{size:"compact-md",variant:V,color:q,leftSection:s.jsx(o8,{size:G}),onClick:e.onExport?e.onExport:()=>p({...h.current,exportDialogVisible:!0}),children:"Export..."}),!Q&&e.onDelete&&s.jsx(Oe,{size:"compact-md",variant:V,color:q,leftSection:s.jsx($x,{size:G}),onClick:()=>e.onDelete(Object.keys(d.selected)),children:"Delete..."}),!Q&&e.onBulk&&s.jsx(Oe,{size:"compact-md",variant:V,color:q,leftSection:s.jsx(jz,{size:G}),onClick:()=>e.onBulk(Object.keys(d.selected)),children:"Bulk..."})]}),s.jsxs(xe,{gap:2,children:[A&&s.jsxs(Pe,{size:"xs",c:"dimmed","data-testid":"count-display",children:[tR(l,A).toLocaleString(),"-",aW(l,A).toLocaleString(),A.total!==void 0&&` of ${l.total==="estimate"?"~":""}${(Y=A.total)==null?void 0:Y.toLocaleString()}`]}),s.jsx(En,{variant:V,color:q,title:"Refresh",onClick:x,children:s.jsx(Yz,{size:G})})]})]}),s.jsxs(Me,{className:zc.table,children:[s.jsxs(Me.Thead,{children:[s.jsxs(Me.Tr,{children:[C&&s.jsx(Me.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:j(),onChange:M=>w(M)})}),P.map(M=>s.jsx(Me.Th,{children:s.jsxs(ve,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(ve.Target,{children:s.jsx(Qn,{className:zc.control,p:2,children:s.jsxs(xe,{justify:"space-between",wrap:"nowrap",children:[s.jsx(Pe,{fw:500,children:ma(M.name)}),s.jsx(Gn,{className:zc.icon,children:s.jsx(yz,{size:14,stroke:1.5})})]})})}),s.jsx(VU,{search:l,searchParams:M.searchParams,onPrompt:(N,F)=>{p({...h.current,filterDialogVisible:!0,filterDialogSearchParam:N,filterDialogFilter:F})},onChange:N=>{T(N)}})]})},M.name))]}),!e.hideFilters&&s.jsxs(Me.Tr,{children:[C&&s.jsx(Me.Th,{}),P.map(M=>s.jsx(Me.Th,{children:M.searchParams&&s.jsx(oW,{resourceType:D,searchParams:M.searchParams,filters:l.filters})},M.name))]})]}),s.jsx(Me.Tbody,{children:L==null?void 0:L.map(M=>M&&s.jsxs(Me.Tr,{className:zc.tr,"data-testid":"search-control-row",onClick:N=>R(N,M),onAuxClick:N=>R(N,M),children:[C&&s.jsx(Me.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${M.id}`,checked:!!d.selected[M.id],onChange:N=>b(N,M.id)})}),P.map(N=>s.jsx(Me.Td,{children:DU(M,N)},N.name))]},M.id))})]}),!(L!=null&&L.length)&&s.jsx(Ou,{children:s.jsx(Gn,{style:{height:150},children:s.jsx(Pe,{size:"xl",c:"dimmed",children:"No results"})})}),A&&s.jsx(Gn,{m:"md",p:"md",children:s.jsx(_o,{value:iW(l),total:sW(l,A),onChange:M=>T(kU(l,M)),getControlProps:M=>{switch(M){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(NU,{search:l,visible:h.current.fieldEditorVisible,onOk:M=>{T(M),p({...h.current,fieldEditorVisible:!1})},onCancel:()=>{p({...h.current,fieldEditorVisible:!1})}}),s.jsx(LU,{search:l,visible:h.current.filterEditorVisible,onOk:M=>{T(M),p({...h.current,filterEditorVisible:!1})},onCancel:()=>{p({...h.current,filterEditorVisible:!1})}}),s.jsx(hU,{visible:h.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...h.current,exportDialogVisible:!1})}}),s.jsx(FU,{visible:h.current.filterDialogVisible,title:(X=d.filterDialogSearchParam)!=null&&X.code?ma(d.filterDialogSearchParam.code):"",resourceType:D,searchParam:d.filterDialogSearchParam,filter:d.filterDialogFilter,defaultValue:"",onOk:M=>{T(eh(l,M.code,M.operator,M.value)),p({...h.current,filterDialogVisible:!1})},onCancel:()=>{p({...h.current,filterDialogVisible:!1})}},(B=d.filterDialogSearchParam)==null?void 0:B.code)]})}const rW=zu;function oW(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:[ZP(n.operator)," ",s.jsx(zU,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function iW(e){return Math.floor((e.offset??0)/(e.count??Hp))+1}function sW(e,t){const n=e.count??Hp,r=nR(e,t);return Math.ceil(r/n)}function tR(e,t){return Math.min(nR(e,t),(e.offset??0)+1)}function aW(e,t){var n;return Math.max(tR(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function nR(e,t){var r,o;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((o=t.link)!=null&&o.some(i=>i.relation==="next")?1:0)),n}function lW(e){const t=Te(),[n,r]=g.useState(!1),[o,i]=g.useState(),{query:l,fields:u}=e,[d,p]=g.useState(),[h,m]=g.useState({}),v=g.useRef();v.current=d;const x=g.useRef({});x.current=h,g.useEffect(()=>{i(void 0),t.graphql(l).then(p).catch(E=>i(Gt(E)))},[t,l]);function b(E,C){E.stopPropagation();const D=E.target.checked,A={...x.current};D?A[C]=!0:delete A[C],m(A)}function w(E){var O;E.stopPropagation();const P=E.target.checked,D={},A=(O=v.current)==null?void 0:O.data.ResourceList;P&&A&&A.forEach(L=>{L.id&&(D[L.id]=!0)}),m(D)}function j(){var C;const E=(C=v.current)==null?void 0:C.data.ResourceList;if(!E||E.length===0)return!1;for(const P of E)if(P.id&&!x.current[P.id])return!1;return!0}function T(E,C){yP(E.target)||(on(E),E.button!==1&&e.onClick&&e.onClick(new qf(C,E)),E.button===1&&e.onAuxClick&&e.onAuxClick(new qf(C,E)))}if(g.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(Cr,{});const R=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:E=>on(E),"data-testid":"search-control",children:[s.jsxs(Me,{children:[s.jsx(Me.Thead,{children:s.jsxs(Me.Tr,{children:[R&&s.jsx(Me.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:j(),onChange:E=>w(E)})}),u.map(E=>s.jsx(Me.Th,{children:E.name},E.name))]})}),s.jsx(Me.Tbody,{children:d==null?void 0:d.data.ResourceList.map(E=>E&&s.jsxs(Me.Tr,{"data-testid":"search-control-row",onClick:C=>T(C,E),onAuxClick:C=>T(C,E),children:[R&&s.jsx(Me.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${E.id}`,checked:!!h[E.id],onChange:C=>b(C,E.id)})}),u.map(C=>s.jsx(Me.Td,{children:s.jsx(pU,{propertyType:C.propertyType,path:C.fhirPath,resource:E})},C.name))]},E.id))})]}),(d==null?void 0:d.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(Oe,{onClick:()=>e.onBulk(Object.keys(x.current)),children:"Bulk..."})]})}const cW=g.memo(lW),uW="_root_1fbwr_1",dW="_entry_1fbwr_8",fW="_key_1fbwr_13",pW="_value_1fbwr_20",th={root:uW,entry:dW,key:fW,value:pW};function ht(e){return s.jsx(co,{children:s.jsx("div",{className:th.root,children:e.children})})}ht.Entry=function(t){return s.jsx("div",{className:th.entry,children:t.children})};ht.Key=function(t){return s.jsx("div",{className:th.key,children:t.children})};ht.Value=function(t){return s.jsx("div",{className:th.value,children:t.children})};function hW(e){const{group:t}=e;return s.jsx(cr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(xe,{children:[t.measureScore&&s.jsx(vW,{group:t}),!t.measureScore&&s.jsx(gW,{group:t})]})})}function mW(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(Pe,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(Pe,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function gW(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(d=>ys(d.code)==="numerator"),o=n==null?void 0:n.find(d=>ys(d.code)==="denominator"),i=r==null?void 0:r.count,l=o==null?void 0:o.count;if(l===0)return s.jsxs(se,{children:[s.jsx(Fe,{order:3,children:"Not Applicable"}),s.jsx(Pe,{children:`Denominator: ${l}`})]});if(i===void 0||l===void 0)return s.jsxs(se,{children:[s.jsx(Fe,{order:3,children:"Insufficient Data"}),s.jsx(Pe,{children:`Numerator: ${i}`}),s.jsx(Pe,{children:`Denominator: ${l}`})]});const u=i/l*100;return s.jsx(Lp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:rR(u)}],label:s.jsx(gs,{justify:"center",children:s.jsxs(Pe,{fw:700,fz:18,children:[i," / ",l]})})})}function vW(e){var r,o,i;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Lp,{size:120,thickness:12,roundCaps:!0,sections:[{value:yW(t),color:rR(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(gs,{justify:"center",children:s.jsx(Pe,{fw:700,fz:18,children:s.jsx(uu,{value:t.measureScore})})})}):s.jsx(gs,{h:120,align:"center",children:s.jsx(Fe,{order:3,children:s.jsx(uu,{value:t.measureScore})})})})}function yW(e){var r,o;const t=(r=e.measureScore)==null?void 0:r.value,n=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&n==="%"?t*100:t:0}function rR(e){return e<=33?"red":e<=67?"yellow":"green"}function xW(e){var r;const t=Vt(e.measureReport),[n]=dz("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(se,{children:[n&&s.jsx(mW,{measure:n}),s.jsx(nx,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>s.jsx(hW,{group:o},o.id??i))})]}):null}const wg="patient-export",Sg="Patient Export",bW={everything:{operation:"$everything",extension:"json",contentType:nn.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:nn.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:nn.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:nn.CDA_XML}};function wW(e){const t=Te(),{patient:n}=e,r=g.useCallback(async o=>{const i=ca(n),l=o.format,{operation:u,type:d,contentType:p,extension:h}=bW[l],m=t.fhirUrl("Patient",i,u),v={};d&&(v.type=d),o.author&&(v.author={reference:o.author}),o.authoredOn&&(v.authoredOn=Qx(o.authoredOn)),o.startDate&&(v.start=o.startDate),o.endDate&&(v.end=o.endDate),Fr.show({id:wg,title:Sg,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const x=await t.post(m,v,void 0,{cache:"no-cache",headers:{Accept:p}}),b=`Patient-export-${i}-${new Date().toISOString().replaceAll(":","-")}.${h}`;SW(x,b,p),Fr.update({id:wg,title:Sg,color:"green",message:"Done",icon:s.jsx($i,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(x){Fr.update({id:wg,title:Sg,color:"red",message:tt(x),icon:s.jsx(fa,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return s.jsx(mt,{onSubmit:r,children:s.jsxs(et,{children:[s.jsx(It,{title:"Export Format",description:"Required",withAsterisk:!0,children:s.jsx($p,{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(It,{title:"Author",description:"Optional author for composition. Default value is current user.",children:s.jsx(Lu,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),s.jsx(It,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:s.jsx(Yo,{name:"authoredOn",placeholder:"Authored on"})}),s.jsx(It,{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(Yo,{name:"startDate",placeholder:"Start date"})}),s.jsx(It,{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(Yo,{name:"endDate",placeholder:"End date"})}),s.jsx(xe,{justify:"right",children:s.jsx(Ur,{children:"Request Export"})})]})})}function SW(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),o=new Blob([r],{type:n}),i=window.URL.createObjectURL(o),l=document.createElement("a");document.body.appendChild(l),l.style.display="none",l.href=i,l.download=t,l.click(),window.URL.revokeObjectURL(i)}function jW(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function oR(e){var n,r;const t=Vt(e.patient);return t?s.jsxs(ht,{children:[s.jsx(ks,{value:t,size:"lg",color:jW(t)}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Name"}),s.jsx(ht.Value,{children:s.jsx(xt,{to:t,fw:500,children:t.name?s.jsx(Fx,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"DoB"}),s.jsx(ht.Value,{children:t.birthDate})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Age"}),s.jsx(ht.Value,{children:C7(t.birthDate)})]})]}),t.gender&&s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Gender"}),s.jsx(ht.Value,{children:t.gender})]}),t.address&&s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"State"}),s.jsx(ht.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:o==null?void 0:o.system}),s.jsx(ht.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function CW(e){const{patient:t,...n}=e,r=g.useCallback((o,i,l)=>{const u=`${i}/${l}`,d=100;return Promise.allSettled([o.readHistory("Patient",l),o.search("Communication",{subject:u,_count:d}),o.search("Device",{patient:u,_count:d}),o.search("DeviceRequest",{patient:u,_count:d}),o.search("DiagnosticReport",{subject:u,_count:d}),o.search("Media",{subject:u,_count:d}),o.search("ServiceRequest",{subject:u,_count:d}),o.search("Task",{subject:u,_count:d})])},[]);return s.jsx(Zp,{value:t,loadTimelineResources:r,createCommunication:(o,i,l)=>({resourceType:"Communication",status:"completed",subject:rn(o),sender:rn(i),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(o,i,l)=>({resourceType:"Media",status:"completed",subject:rn(o),operator:rn(i),issued:new Date().toISOString(),content:l}),...n})}const EW="_section_1w5ib_2",kW="_hovering_1w5ib_8",fv={section:EW,hovering:kW};function TW(e){const t=Te(),n=Vt(e.value),[r,o]=g.useState(!1),[i,l]=g.useState(),[u,d]=g.useState(),[p,h]=g.useState();function m(){d(void 0)}function v(){l(void 0)}const x=g.useRef();if(x.current=p,g.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),g.useEffect(()=>(h(IW(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",m),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("click",v)}),[n]),!r||!p)return null;function b(w,j){h({...x.current,[w]:j})}return s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[s.jsx(Ve,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:w=>b("title",w.currentTarget.value)}),s.jsx(PW,{actions:p.action||[],selectedKey:i,setSelectedKey:l,hoverKey:u,setHoverKey:d,onChange:w=>b("action",w)}),s.jsx(Ur,{children:"Save"})]})})}function PW(e){const t=g.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(l=>l.id===i.id?i:l))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(l=>l!==i))}return s.jsxs(et,{gap:"md",className:fv.section,children:[e.actions.map(i=>s.jsx(RW,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)},i.id)),s.jsx("div",{children:s.jsx(Oe,{variant:"outline",onClick:i=>{on(i),r({id:iR()})},children:"Add action"})})]})}function RW(e){const{action:t}=e,n=DW(t);function r(i){i.stopPropagation(),e.setSelectedKey(e.action.id)}function o(i){on(i),e.setHoverKey(e.action.id)}return s.jsx("div",{onClick:r,onMouseOver:o,onFocus:o,children:s.jsx(_W,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function _W(e){const{action:t}=e,[n,r]=g.useState(e.actionType),o=e.selectedKey===e.action.id,i=e.hoverKey===e.action.id;function l(d,p){e.onChange({...t,[d]:p})}const u=At(fv.section,{[fv.hovering]:i&&!o});return s.jsxs(cr,{"data-testid":t.id,className:u,p:0,radius:"sm",withBorder:!0,children:[s.jsxs(gs,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[s.jsx(Ve,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:d=>l("title",d.currentTarget.value)}),s.jsx(Ss,{"data-testid":"close-button",onClick:e.onRemove})]}),o&&s.jsxs(et,{gap:"xl",p:"md",children:[s.jsx(se,{children:s.jsx(Ve,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:d=>l("description",d.currentTarget.value)})}),s.jsx(se,{children:s.jsx(Jt,{label:"Type of Action",value:n,onChange:d=>{const p=d.currentTarget.value==="standard"?void 0:d.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(et,{gap:0,children:[s.jsxs(xe,{gap:0,mb:"xs",children:[s.jsx(Pe,{fw:600,children:"Select questionnaire"}),s.jsx(Pe,{c:"red",children:"*"})]}),s.jsxs(Pe,{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(Et,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),s.jsx(bj,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&s.jsxs(et,{gap:0,children:[s.jsxs(xe,{gap:0,mb:"xs",children:[s.jsx(Pe,{fw:600,children:"Select activity definition"}),s.jsx(Pe,{c:"red",children:"*"})]}),s.jsxs(Pe,{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(Et,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),s.jsx(bj,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function bj(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(Ta,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:Dt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function DW(e){var t,n;return(t=e.definitionCanonical)!=null&&t.startsWith("Questionnaire")?"questionnaire":(n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let jg=1;function iR(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(jg=Math.max(jg,t+1))}return e}return"id-"+jg++}function IW(e){return{...e,action:sR(e.action)}}function sR(e){if(e)return e.map(t=>({...t,id:iR(t.id),action:sR(t.action)}))}const jt={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 AW(e){return e.type==="choice"||e.type==="open-choice"}function NW(e,t){var o;const n=Cs(e,zp+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const i=(o=n.valueExpression)==null?void 0:o.expression;if(i){const l=io(t),u=da(i,[l],{"%resource":l});return Ho(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const i of e.enableWhen){const l=lR(t==null?void 0:t.item,i.question);if(i.operator==="exists"&&!i.answerBoolean&&!(l!=null&&l.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:d}=$W(i,l,r);if(r==="any"&&u)return!0;if(r==="all"&&!d)return!1}return r!=="any"}function s0(e,t){return e.map(n=>{if(n.item)return{...n,item:s0(n.item,t)};{const r=MW(n,t);if(!r)return null;const o=OW(n,r);return o?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[o]}:null}}).filter(n=>n!==null)}function OW(e,t){if(e.type)switch(e.type){case jt.boolean:return t.type===re.boolean?{valueBoolean:t.value}:void 0;case jt.date:return t.type===re.date?{valueDate:t.value}:void 0;case jt.dateTime:return t.type===re.dateTime?{valueDateTime:t.value}:void 0;case jt.time:return t.type===re.time?{valueTime:t.value}:void 0;case jt.url:return t.type===re.url?{valueString:t.value}:void 0;case jt.text:return t.type===re.string?{valueString:t.value}:void 0;case jt.attachment:return t.type===re.Attachment?{valueAttachment:t.value}:void 0;case jt.reference:return t.type===re.Reference?{valueReference:t.value}:void 0;case jt.quantity:return{valueQuantity:t.value};case jt.decimal:return{valueDecimal:t.value};case jt.integer:return{valueInteger:t.value};case jt.string:return{valueString:t.value};default:return}}function MW(e,t){var r;if(!t)return;const n=Cs(e,zp+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const o=(r=n.valueExpression)==null?void 0:r.expression;if(o){const i=io(t),l=da(o,[i],{"%resource":i});return l.length!==0?l[0]:void 0}}}function a0(e,t){return e.map(n=>{const r=t.find(o=>o.linkId===n.linkId);return r?{...n,item:r.item?a0(n.item||[],r.item):n.item,answer:r.answer||n.answer}:n})}function aR(e,t,n){var o;const r=[];for(const i of e){const l=(o=n.answerOption)==null?void 0:o.find(u=>au(Ti(u))===i);if(l){const u=Ti(l);u&&r.push({[t]:u.value})}}return r}function lR(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=lR(n.item,t);if(r)return r}}}function LW(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:o}]=da(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function $W(e,t,n){const r=t||[],o=WW(e);let i=!1,l=!0;for(const u of r){const d=HW(u),{operator:p}=e;if(LW(d,o,p)?i=!0:l=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:l}}function cR(e){var n,r;const t=Cs(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(o=>o.code)}}function Cg(e,t){var o;const n=Vr(e);let r=Cs(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(o=n.extension)==null?void 0:o.filter(i=>i!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete r.valueCode),n)}function FW(e,t,n){const r=Cs(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let o=r.valueString;t!=null&&t.reference&&(o=o.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(o=o.replaceAll("$encounter",n.reference));const i={},l=o.split("&");for(const u of l){const[d,p]=nv(u,"=",2);i[d]=p}return i}function wj(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Dt(e),item:uR(e.item,t==null?void 0:t.item),status:"in-progress"}}function uR(e,t){return(e==null?void 0:e.map(n=>dR(n,t)))??[]}function dR(e,t){var r;const n=t==null?void 0:t.find(o=>o.linkId===e.linkId);return{id:n?n.id:VW(),linkId:e.linkId,text:e.text,item:uR(e.item,n==null?void 0:n.item),answer:n?n.answer:((r=e.initial)==null?void 0:r.map(BW))??[]}}let zW=1;function VW(){return"id-"+zW++}function BW(e){return{...e}}function UW(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const l=Cs(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=l==null?void 0:l.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}function nh(e){return _u({value:e},"value")}function Ti(e){return _u({value:e},"value")}function WW(e){return _u({value:e},"answer")}function HW(e){return _u({value:e},"value")}const fR=g.createContext({});function pv(e){const t=g.useContext(fR),n=e.item,r=e.response;function o(p){var m,v,x,b;let h;Array.isArray(p)?h=p:e.index>=(((v=(m=e.response)==null?void 0:m.answer)==null?void 0:v.length)??0)?h=(((x=e.response)==null?void 0:x.answer)??[]).concat([p]):h=(((b=e.response)==null?void 0:b.answer)??[]).map((j,T)=>T===e.index?p:j)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:h})}const i=n.type;if(!i)return null;const l=n.linkId;if(!l)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,d=c0(r,e.index)??nh(u);switch(i){case jt.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case jt.boolean:return s.jsx($P,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Kn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:d==null?void 0:d.value,onChange:p=>o({valueBoolean:p.currentTarget.checked})})},e.item.linkId);case jt.decimal:return s.jsx(Ve,{type:"number",step:"any",id:l,name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueDecimal:p.currentTarget.valueAsNumber})});case jt.integer:return s.jsx(Ve,{type:"number",step:1,id:l,name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueInteger:p.currentTarget.valueAsNumber})});case jt.date:return s.jsx(Ve,{type:"date",id:l,name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueDate:p.currentTarget.value})});case jt.dateTime:return s.jsx(Yo,{name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueDateTime:p})});case jt.time:return s.jsx(Ve,{type:"time",id:l,name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueTime:p.currentTarget.value})});case jt.string:case jt.url:return s.jsx(Ve,{id:l,name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>{const h=p.currentTarget.value;o({valueString:h===""?void 0:h})}});case jt.text:return s.jsx(wa,{id:l,name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>{const h=p.currentTarget.value;o({valueString:h===""?void 0:h})}});case jt.attachment:return s.jsx(xe,{py:4,children:s.jsx(SP,{path:"",name:l,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueAttachment:p})})});case jt.reference:return s.jsx(Lu,{name:l,required:e.required??n.required,targetTypes:cR(n),searchCriteria:FW(n,t.subject,t.encounter),defaultValue:d==null?void 0:d.value,onChange:p=>o({valueReference:p})});case jt.quantity:return s.jsx(pa,{path:"",name:l,required:e.required??n.required,defaultValue:d==null?void 0:d.value,onChange:p=>o({valueQuantity:p}),disableWheel:!0});case jt.choice:case jt.openChoice:return XW(n)&&!n.answerValueSet?s.jsx(qW,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>o(p)}):JW(n)&&!n.answerValueSet?s.jsx(GW,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>o(p)}):s.jsx(QW,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>o(p)});default:return null}}function qW(e){var d;const{name:t,item:n,initial:r,response:o}=e;if(!((d=n.answerOption)!=null&&d.length))return s.jsx(l0,{});const i=nh(r),l=[""];for(const p of n.answerOption){const h=Ti(p);l.push(au(h))}const u=c0(o)??i;if(n.repeats){const{propertyName:p,data:h}=hR(e.item),m=pR(o);return s.jsx(Su,{data:h,placeholder:"Select items",searchable:!0,defaultValue:m||[au(i)],onChange:v=>{const x=aR(v,p,n);e.onChangeAnswer(x)}})}return s.jsx(Jt,{id:t,name:t,onChange:p=>{const h=p.currentTarget.selectedIndex;if(h===0){e.onChangeAnswer({});return}const m=n.answerOption[h-1],v=Ti(m),x="value"+Ln(v.type);e.onChangeAnswer({[x]:v.value})},defaultValue:Du(u==null?void 0:u.value)||(u==null?void 0:u.value),data:l})}function GW(e){var d;const{item:t,initial:n,response:r}=e;if(!((d=t.answerOption)!=null&&d.length))return s.jsx(l0,{});const o=nh(n),{propertyName:i,data:l}=hR(e.item),u=pR(r);return s.jsx(Su,{data:l,placeholder:"Select items",searchable:!0,defaultValue:u||[au(o)],onChange:p=>{const h=aR(p,i,t);e.onChangeAnswer(h)}})}function QW(e){var l;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((l=n.answerOption)!=null&&l.length)&&!n.answerValueSet?s.jsx(l0,{}):n.answerValueSet?s.jsx(FP,{path:"",name:t,binding:n.answerValueSet,response:i,onChange:u=>o({valueCoding:u}),creatable:n.type===jt.openChoice}):s.jsx(KW,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function KW(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,l=Ea("QuestionnaireItemAnswerOption","value[x]"),u=nh(r),d=[];let p;if(n.answerOption)for(let v=0;v<n.answerOption.length;v++){const x=n.answerOption[v],b=`${t}-option-${v}`,w=Ti(x);w!=null&&w.value&&(u&&Po(w)===Po(u)&&(p=b),d.push([b,w]))}const h=c0(i),m=YW(d,h);return s.jsx(la.Group,{name:t,value:m??p,onChange:v=>{const x=d.find(b=>b[0]===v);if(x){const b=x[1],w="value"+Ln(b.type);o({[w]:b.value})}},children:d.map(([v,x])=>s.jsx(la,{id:v,value:v,py:4,label:s.jsx(Zo,{property:l,propertyType:x.type,value:x.value})},v))})}function l0(){return s.jsx(Ve,{disabled:!0,placeholder:"No Answers Defined"})}function c0(e,t=0){const n=e.answer;return Ti((n==null?void 0:n[t])??{})}function pR(e){const t=e.answer;return t?t.map(r=>Ti(r)).map(r=>Du(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function YW(e,t){var n;return(n=e.find(r=>vs(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function XW(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,i;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function JW(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,i;return n.url===zp+"/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="multi-select"}))}function hR(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=Ti(t),r="value"+Ln(n.type),o=(e.answerOption??[]).map(l=>{const u=Ti(l),d=au(u);return{value:d,label:d}});return{propertyName:r,data:o}}const ZW="_section_1rlfy_1",eH="_hovering_1rlfy_10",tH="_editing_1rlfy_14",nH="_questionBody_1rlfy_20",rH="_topActions_1rlfy_24",oH="_bottomActions_1rlfy_33",iH="_movementActions_1rlfy_44",sH="_movementIcons_1rlfy_56",aH="_columnAlignment_1rlfy_60",lH="_linkIdInput_1rlfy_65",cH="_typeSelect_1rlfy_70",uH="_preserveBreaks_1rlfy_74",Mr={section:ZW,hovering:eH,editing:tH,questionBody:nH,topActions:rH,bottomActions:oH,movementActions:iH,movementIcons:sH,columnAlignment:aH,linkIdInput:lH,typeSelect:cH,preserveBreaks:uH};function dH(e){const t=Te(),n=Vt(e.questionnaire),[r,o]=g.useState(!1),[i,l]=g.useState(),[u,d]=g.useState(),[p,h]=g.useState();function m(){h(void 0)}function v(){d(void 0)}g.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),g.useEffect(()=>(l(mH(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",m),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("click",v)}),[n]);const x=(b,w)=>{l(b),e.autoSave&&!w&&e.onSubmit&&e.onSubmit(b)};return!r||!i?null:s.jsx("div",{children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(mR,{item:i,selectedKey:u,setSelectedKey:d,hoverKey:p,setHoverKey:h,onChange:x}),s.jsx(Ur,{children:"Save"})]})})}function mR(e){var E;const t=e.item,n=e.item,r=ni(e.item),o=r||n.type===jt.group,i=n.linkId??"[untitled]",l=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=g.useRef();d.current=e.item;function p(C){on(C),e.setSelectedKey(e.item.id)}function h(C){on(C),e.setHoverKey(e.item.id)}function m(C){var D;const P=d.current;e.onChange({...P,item:(D=P.item)==null?void 0:D.map(A=>A.id===C.id?C:A)})}function v(C,P){e.onChange({...e.item,item:[...e.item.item??[],C]},P)}function x(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.filter(D=>D!==C)})}function b(C,P){e.onChange({...d.current,[C]:P})}function w(C){e.onChange({...e.item,...C})}function j(C){var P;e.onChange({...e.item,item:(P=e.item.item)==null?void 0:P.map(D=>D===C?{...D,repeats:!D.repeats}:D)})}function T(C,P){const D=yH(e.item.item,C,P);e.onChange({...e.item,item:D})}const R=At(Mr.section,{[Mr.editing]:l,[Mr.hovering]:u&&!l});return s.jsxs("div",{"data-testid":n.linkId,className:R,onClick:p,onMouseOver:h,onFocus:h,children:[s.jsx("div",{className:Mr.questionBody,children:l?s.jsxs(s.Fragment,{children:[r&&s.jsx(Ve,{size:"xl",defaultValue:t.title,onBlur:C=>b("title",C.currentTarget.value)}),!r&&s.jsx(wa,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:C=>b("text",C.currentTarget.value)}),n.type==="reference"&&s.jsx(hH,{item:n,onChange:w}),AW(n)&&s.jsx(fH,{item:n,onChange:C=>w(C)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(Fe,{children:t.title}),n.text&&s.jsx("div",{className:Mr.preserveBreaks,children:n.text}),!o&&s.jsx(pv,{item:n,index:0,required:!1,onChange:()=>{},response:{linkId:n.linkId}})]})}),(E=n.item)==null?void 0:E.map((C,P)=>s.jsx("div",{children:s.jsx(mR,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:P===0,isLast:P===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>x(C),onRepeatable:j,onMoveUp:()=>T(P,-1),onMoveDown:()=>T(P,1)})},C.id)),!o&&s.jsx("div",{className:Mr.topActions,children:l?s.jsxs(s.Fragment,{children:[s.jsx(Ve,{size:"xs",className:Mr.linkIdInput,defaultValue:n.linkId,onBlur:C=>b("linkId",C.currentTarget.value)}),!o&&s.jsx(Jt,{size:"xs",className:Mr.typeSelect,defaultValue:n.type,onChange:C=>b("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:i})}),!r&&s.jsx(se,{className:Mr.movementActions,children:s.jsxs(se,{className:Mr.columnAlignment,children:[!e.isFirst&&s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(bz,{"data-testid":"up-button",size:15,className:Mr.movementIcons})}),!e.isLast&&s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(xz,{"data-testid":"down-button",size:15,className:Mr.movementIcons})})]})}),s.jsxs("div",{className:Mr.bottomActions,children:[o&&s.jsxs(s.Fragment,{children:[s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),v({id:ga(),linkId:gv("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),v({id:ga(),linkId:gv("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),v(vH(),!0)},children:"Add Page"}),l&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Et,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function fH(e){const t=Ea("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(Ve,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(pH,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(se,{display:"flex",children:[s.jsx(Et,{href:"#",onClick:r=>{on(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:ga()}]})},children:"Add choice"}),s.jsx(Fp,{w:"lg"}),s.jsx(Et,{href:"#",onClick:r=>{on(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function pH(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=Jp({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($u,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const l=[...e.options],u=l.findIndex(d=>d.id===t.id);l[u]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:l})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Et,{href:"#",onClick:o=>{on(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function hH(e){const t=cR(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(xe,{children:[s.jsx(Ux,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Cg(e.item,t.map(i=>i===n?o:i)))}}),s.jsx(Et,{href:"#",onClick:o=>{on(o),e.onChange(Cg(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Et,{href:"#",onClick:n=>{on(n),e.onChange(Cg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let hv=1,mv=1;function gv(e){return e+hv++}function ga(){return"id-"+mv++}function mH(e){return{...e,id:e.id||ga(),item:gR(e.item)}}function gR(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(mv=Math.max(mv,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(hv=Math.max(hv,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ga(),item:gR(t.item),answerOption:gH(t.answerOption)}))}function gH(e){if(e)return e.map(t=>({...t,id:t.id||ga()}))}function vH(){return{id:ga(),linkId:gv("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 yH(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const i=[...r];return[i[t],i[o]]=[i[o],i[t]],i}function vR(e){const{item:t,response:n,onChange:r}=e,[o,i]=g.useState(xH(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===jt.display)return s.jsx("p",{children:t.text},t.linkId);const l=(t==null?void 0:t.repeats)&&t.type!==jt.choice&&t.type!==jt.openChoice;return t.type===jt.boolean?s.jsx(pv,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):s.jsxs(It,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((u,d)=>s.jsx(pv,{item:t,response:n,onChange:p=>r([p]),index:d},`${t.linkId}-${d}`)),l&&s.jsx(Et,{onClick:()=>i(u=>u+1),children:"Add Item"})]},e.item.linkId)}function xH(e,t){if(e.type===jt.choice||e.type===jt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function yR(e){const[t,n]=g.useState(e.response);if(g.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(i,l){const u=t.map((d,p)=>p===l?i[0]:d);n(u),e.onChange(u)}function o(){const i=dR(e.item,void 0);n([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,l)=>s.jsx(xR,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,l)},i.id)),e.item.repeats&&s.jsx(Et,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function xR(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(l){var h;const u=(h=t.item)==null?void 0:h.map(m=>l.find(x=>x.id===m.id)??m),d=u==null?void 0:u.concat(l.slice(1)),p={...t,item:d};r([p])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(Fe,{order:3,mb:"md",children:e.item.text}),s.jsx(et,{children:(i=e.item.item)==null?void 0:i.map(l=>{var u,d,p;return l.type===jt.group?l.repeats?s.jsx(yR,{item:l,response:((u=t.item)==null?void 0:u.filter(h=>h.linkId===l.linkId))??[],checkForQuestionEnabled:n,onChange:o},l.linkId):s.jsx(xR,{item:l,checkForQuestionEnabled:n,response:((d=t.item)==null?void 0:d.find(h=>h.linkId===l.linkId))??{linkId:l.linkId},onChange:o},l.linkId):s.jsx(vR,{item:l,response:(p=t.item)==null?void 0:p.find(h=>h.linkId===l.linkId),onChange:o,checkForQuestionEnabled:n},l.linkId)})})]},e.item.linkId):null}function bH(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:l,numberOfPages:u,renderPages:d,submitButtonText:p,excludeButtons:h,checkForQuestionEnabled:m}=e,v=t.map(x=>{var j;const b=((j=n==null?void 0:n.item)==null?void 0:j.filter(T=>T.linkId===x.linkId))??[],w=x.type===jt.group?s.jsx(yR,{item:x,response:b,onChange:o,checkForQuestionEnabled:m},x.linkId):s.jsx(vR,{item:x,response:b==null?void 0:b[0],onChange:o,checkForQuestionEnabled:m},x.linkId);return d?s.jsx(Al.Step,{label:x.text,children:w},x.linkId):w});return s.jsxs(s.Fragment,{children:[d&&s.jsx(Al,{active:r??0,allowNextStepsSelect:!1,p:6,children:v}),!d&&s.jsx(et,{children:v}),!h&&s.jsx(wH,{activePage:r??0,numberOfPages:u,nextStep:d?i:void 0,prevStep:d?l:void 0,renderPages:d,submitButtonText:p})]})}function wH(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(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(Oe,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(Oe,{onClick:o=>{const i=o.currentTarget.closest("form");e.nextStep&&i.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(Ur,{children:e.submitButtonText??"Submit"})]})}function bR(e){const t=Te(),{subject:n,source:r}=e,o=Vt(e.questionnaire),i=lz(o),l=Vt(e.questionnaireResponse),[u,d]=g.useState(l),[p,h]=g.useState(0),m=g.useRef(e.onChange);m.current=e.onChange;const v=g.useRef(e.onSubmit);v.current=e.onSubmit,g.useEffect(()=>{if(l!=null&&l.item&&o){const E=wj(o,l),C=SR(E,o);d(C)}else{if(o&&Sj(i)===Sj(o))return;d(o?wj(o):void 0)}},[l,o,i]),g.useEffect(()=>{if(u&&m.current)try{m.current(u)}catch(E){console.error("Error invoking QuestionnaireForm.onChange callback",E)}},[u]);const x=g.useCallback(E=>{d(C=>jH(C,E,o))},[o]),b=g.useCallback(()=>{const E=v.current;if(E&&o&&u){let C=r;if(!C){const P=t.getProfile();P&&(C=rn(P))}E({...u,questionnaire:o.url??Dt(o),subject:n,source:C,authored:new Date().toISOString(),status:"completed"})}},[t,o,u,n,r]);function w(E){return NW(E,u)}if(!o||!u)return null;const j=UW(o),T=()=>h(E=>E+1),R=()=>h(E=>E-1);return s.jsx(fR.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(mt,{testid:"questionnaire-form",onSubmit:b,children:[o.title&&s.jsx(Fe,{children:o.title}),s.jsx(bH,{items:o.item??[],response:u,onChange:x,renderPages:!e.disablePagination&&j>1,activePage:p,numberOfPages:j,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:w,nextStep:T,prevStep:R})]})})}function SH(e,t){const n=wR(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 wR(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,l=t.find(u=>u.id===i);l?(n.push(SH(o,l)),r.add(l.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}function Sj(e){return(e==null?void 0:e.id)||e}function jH(e,t,n){if(!t)return{resourceType:"QuestionnaireResponse",status:"in-progress"};const r=(e==null?void 0:e.item)??[],o=wR(r,Array.isArray(t)?t:[t]),i={resourceType:"QuestionnaireResponse",status:"in-progress",item:o},l=s0((n==null?void 0:n.item)??[],i);return i.item=a0(o,l),SR(i,n)}function SR(e,t){const n=s0((t==null?void 0:t.item)??[],e);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:a0(e.item??[],n)}}const CH="_section_4m5it_1",EH={section:CH},kH=["gender","age","gestationalAge","context","appliesTo","category"],TH={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function PH(e){e=Object.assign(TH,e);const t=e.definition,[n,r]=g.useState([]),[o,i]=g.useState(1),[l,u]=g.useState(1);return g.useEffect(()=>{const b=DH(t,u);r(IH(b.qualifiedInterval||[],i))},[t]),s.jsxs(mt,{testid:"reference-range-editor",onSubmit:d,children:[s.jsx(et,{children:n.map(b=>{var w;return s.jsx(RH,{unit:NH((w=t.quantitativeDetails)==null?void 0:w.unit),onChange:m,onAdd:v,onRemove:x,onRemoveGroup:h,intervalGroup:b},`group-${b.id}`)})}),s.jsx(En,{title:"Add Group",variant:"subtle",size:"sm",onClick:b=>{on(b),p({id:`group-id-${o}`,filters:{},intervals:[]}),i(w=>w+1)},children:s.jsx(Wf,{})}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Ur,{children:"Save"})})]});function d(){const b=n.flatMap(w=>w.intervals).filter(w=>!OH(w));e.onSubmit({...t,qualifiedInterval:b})}function p(b){r(w=>[...w,b])}function h(b){r(w=>w.filter(j=>j.id!==b.id))}function m(b,w){r(j=>{j=[...j];const T=j.find(E=>E.id===b),R=T==null?void 0:T.intervals.findIndex(E=>E.id===w.id);return R!==void 0&&(T!=null&&T.intervals[R])&&(T.intervals[R]=w),j})}function v(b,w){w.id===void 0&&(w.id=`id-${l}`,u(j=>j+1)),r(j=>{j=[...j];const T=j.findIndex(R=>R.id===b);if(T!==-1){const R={...j[T]};w={...w,...R.filters},R.intervals=[...R.intervals,w],j[T]=R}return j})}function x(b,w){r(j=>{j=[...j];const T=j.find(R=>R.id===b);return T&&(T.intervals=T.intervals.filter(R=>R.id!==w.id)),j})}}function RH(e){const{intervalGroup:t,unit:n}=e;return s.jsx(Ou,{"data-testid":t.id,className:EH.section,children:s.jsxs(et,{gap:"lg",children:[s.jsx(xe,{justify:"flex-end",children:s.jsx(En,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{on(r),e.onRemoveGroup(t)},children:s.jsx(Uf,{})},`remove-group-button-${t.id}`)}),s.jsx(_H,{intervalGroup:t,onChange:e.onChange}),s.jsx(yn,{}),t.intervals.map(r=>s.jsxs(et,{gap:"xs",children:[s.jsxs(xe,{children:[s.jsx(Ve,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{on(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(En,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{on(o),e.onRemove(t.id,r)},children:s.jsx(Uf,{})},`remove-interval-${r.id}`)]}),s.jsx(Kx,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(En,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{on(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Wf,{})})]})})}function _H(e){var r,o;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(r=t.filters.age[i])!=null&&r.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(et,{style:{maxWidth:"50%"},children:[s.jsx(xe,{children:s.jsx(Jt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const l of t.intervals){let u=i.currentTarget.value;u===""&&(u=void 0),n(t.id,{...l,gender:u})}}})}),s.jsxs(xe,{gap:"xs",children:[s.jsx(Pe,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(Kx,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const l of t.intervals)n(t.id,{...l,age:i})}},`age-${t.id}`)})]}),s.jsx(Jt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const l of t.intervals){let u=i.currentTarget.value;u===""?(u=void 0,n(t.id,{...l,context:void 0})):n(t.id,{...l,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(Jt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const l of t.intervals){const u=i.currentTarget.value;u===""?n(t.id,{...l,category:void 0}):n(t.id,{...l,category:u})}}})]})}function DH(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var l;const i=parseInt(((l=o.id)==null?void 0:l.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function IH(e,t){let n=1;const r={};for(const o of e){const i=AH(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(kH.map(l=>[l,o[l]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function AH(e){var n,r;return[`gender=${e.gender}`,`age=${lu(e.age)}`,`gestationalAge=${lu(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function NH(e){return e&&(N7(e,"http://unitsofmeasure.org")||e.text)}function OH(e){var t,n,r,o;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((o=(r=e.range)==null?void 0:r.high)==null?void 0:o.value)===void 0}function MH(e){var p;const t=Te(),n=Vt(e.value),[r,o]=g.useState(!1),[i,l]=g.useState();if(g.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(l).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return s.jsx($r,{children:(p=n.action)==null?void 0:p.map((h,m)=>{var w,j,T,R,E,C;const v=h.resource&&d(h.resource),x=(j=(w=v==null?void 0:v.input)==null?void 0:w[0])==null?void 0:j.valueReference,b=(R=(T=v==null?void 0:v.output)==null?void 0:T[0])==null?void 0:R.valueReference;return s.jsxs(g.Fragment,{children:[s.jsx($r.Col,{span:1,p:"md",children:(v==null?void 0:v.status)==="completed"?s.jsx(Rz,{}):s.jsx(t8,{color:"gray"})}),s.jsxs($r.Col,{span:9,p:"xs",children:[s.jsx(Pe,{fw:500,children:h.title}),h.description&&s.jsx("div",{children:h.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Zl,{value:(E=v==null?void 0:v.meta)==null?void 0:E.author})," on ",ur((C=v==null?void 0:v.meta)==null?void 0:C.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(Zx,{status:(v==null?void 0:v.status)||"unknown"})]})]}),s.jsxs($r.Col,{span:2,p:"md",children:[x&&!b&&s.jsx(Oe,{onClick:()=>e.onStart(v,x),children:"Start"}),x&&b&&s.jsx(Oe,{onClick:()=>e.onEdit(v,x,b),children:"Edit"})]})]},`action-${m}`)})});function u(h){var v;const m=[];if(h.action)for(const x of h.action)(v=x.resource)!=null&&v.reference&&m.push({request:{method:"GET",url:x.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function d(h){for(const m of(i==null?void 0:i.entry)??[])if(m.resource&&h.reference===Dt(m.resource))return m.resource}}function jR(e,t){const n=LH(e,t);return $H(n,e,t)}function LH(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,l=i/2|0,u=new Array(i);u[l+1]={i:0,j:-1,prev:void 0,snake:!0};for(let d=0;d<o;d++){for(let p=-d;p<=d;p+=2){const h=l+p,m=h+1,v=h-1,x=u[m],b=u[v];let w,j=0;p===-d||p!==d&&b.i<x.i?(j=x.i,w=x):(j=b.i+1,w=b),u[v]=void 0;let T=j-p,R={i:j,j:T,prev:FH(w),snake:!1};for(;j<n&&T<r&&e[j]===t[T];)j++,T++;if(j>R.i&&(R={i:j,j:T,prev:R,snake:!0}),u[h]=R,j>=n&&T>=r)return u[h]}u[l+d-1]=void 0}}function $H(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,l=o.j;o=o.prev;const u=o.i,d=o.j,p={position:u,lines:t.slice(u,i)},h={position:d,lines:n.slice(d,l)};let m;p.lines.length===0&&h.lines.length>0?m="insert":p.lines.length>0&&h.lines.length===0?m="delete":m="change",r.push({original:p,revised:h,type:m}),o.snake&&(o=o.prev)}return r}function FH(e){return e&&!e.snake&&e.prev?e.prev:e}function zH(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:Po(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.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 VH(n,t),BH(n),n}function VH(e,t){for(let n=1;n<t.length;n++){const r=jR(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,l=o.original.lines,u=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,l.length),o.type==="insert"||o.type==="change")for(let d=0;d<o.revised.lines.length;d++)e.splice(i+d,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[d],span:1})}}}function BH(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 UH="_container_1oj0p_1",WH="_root_1oj0p_5",HH="_startRow_1oj0p_20",qH="_normalRow_1oj0p_24",GH="_author_1oj0p_28",QH="_dateTime_1oj0p_32",KH="_lineNumber_1oj0p_37",YH="_line_1oj0p_37",XH="_pre_1oj0p_52",vi={container:UH,root:WH,startRow:HH,normalRow:qH,author:GH,dateTime:QH,lineNumber:KH,line:YH,pre:XH};function JH(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function ZH(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return hl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return hl(r,"month");const o=Math.floor(t/86400);if(o>0)return hl(o,"day");const i=Math.floor(t/3600);if(i>0)return hl(i,"hour");const l=Math.floor(t/60);return l>0?hl(l,"minute"):hl(t,"second")}function hl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function eq(e){var l,u;const t=Te(),[n,r]=g.useState(e.history);if(g.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const o=(u=(l=n.entry)==null?void 0:l[0])==null?void 0:u.resource;if(!o)return null;const i=zH(n);return s.jsx("div",{className:vi.container,children:s.jsx("table",{className:vi.root,children:s.jsx("tbody",{children:i.map((d,p)=>s.jsxs("tr",{className:d.span>0?vi.startRow:vi.normalRow,children:[d.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:vi.author,rowSpan:d.span,children:s.jsx(El,{value:d.meta.author,link:!0})}),s.jsx("td",{className:vi.dateTime,rowSpan:d.span,children:s.jsx(xt,{to:JH(o,d.meta.versionId),children:ZH(d.meta.lastUpdated)})})]}),s.jsx("td",{className:vi.lineNumber,children:p+1}),s.jsx("td",{className:vi.line,children:s.jsx("pre",{className:vi.pre,children:d.value})})]},"row-"+p))})})})}const tq="_removed_mgz0k_2",nq="_added_mgz0k_7",jj={removed:tq,added:nq};function rq(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Po(t,!0).match(/[^\r\n]+/g),o=Po(n,!0).match(/[^\r\n]+/g),i=jR(r,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((l,u)=>s.jsx(oq,{delta:l},"delta"+u))})}function oq(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:jj.removed,children:e.delta.original.lines.join(`
|
|
547
|
+
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:jj.added,children:e.delta.revised.lines.join(`
|
|
548
|
+
`)}),"...",s.jsx("br",{})]})}const iq="_splitButton_1i0gi_1",sq="_menuControl_1i0gi_6",Cj={splitButton:iq,menuControl:sq};function Gf(e){const{outcome:t}=e,n=Te(),r=Vt(e.defaultValue),o=r==null?void 0:r.resourceType,[i,l]=g.useState(!1),[u,d]=g.useState(),p=n.getAccessPolicy(),h=mn();g.useEffect(()=>{if(r)if(e.profileUrl){const x=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const b=Kl(x);if(b){l(!0);const w=Z6(r,b);d(w)}else console.error(`Schema not found for ${x}`)}).catch(b=>{console.error("Error in requestProfileSchema",b)})}else n.requestSchema(o).then(()=>{d(r),l(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const m=g.useMemo(()=>r&&KT(r,bl.READ,p),[p,r]),v=g.useMemo(()=>n.isSuperAdmin()||!p||!bn(u==null?void 0:u.resourceType)?!0:o6(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!i||!u?s.jsx("div",{children:"Loading..."}):v?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:x=>{x.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[s.jsxs(et,{mb:"xl",children:[s.jsx(It,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(Ve,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),s.jsx(It,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(Ve,{name:"id",defaultValue:u.id,disabled:!0})})]}),s.jsx(Jx,{path:u.resourceType,valuePath:u.resourceType,typeName:o,defaultValue:u,outcome:t,onChange:d,profileUrl:e.profileUrl,accessPolicyResource:m}),s.jsxs(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(Oe,{type:"submit",className:At((e.onPatch||e.onDelete)&&Cj.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(ve,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(ve.Target,{children:s.jsx(En,{variant:"filled",color:h.primaryColor,size:36,className:Cj.menuControl,"aria-label":"More actions",children:s.jsx(Nx,{size:14,stroke:1.5})})}),s.jsxs(ve.Dropdown,{children:[e.onPatch&&s.jsx(ve.Item,{leftSection:s.jsx(pP,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&s.jsx(ve.Item,{color:"red",leftSection:s.jsx($x,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):s.jsxs(Ni,{color:"red",title:"Permission denied",icon:s.jsx(ka,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function aq(e){var o;const t=Te(),[n,r]=g.useState(e.history);return g.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(Me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(Me.Thead,{children:s.jsxs(Me.Tr,{children:[s.jsx(Me.Th,{children:"Author"}),s.jsx(Me.Th,{children:"Date"}),s.jsx(Me.Th,{children:"Version"})]})}),s.jsx(Me.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,l)=>s.jsx(lq,{entry:i},"entry-"+l))})]}):s.jsx("div",{children:"Loading..."})}function lq(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:s.jsx(El,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(Me.Td,{children:ur((o=n.meta)==null?void 0:o.lastUpdated)}),s.jsx(Me.Td,{children:s.jsx(xt,{to:cq(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):s.jsx(Me.Tr,{children:s.jsx(Me.Td,{colSpan:3,children:tt(t==null?void 0:t.outcome)})})}function cq(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function uq(e){const{serviceRequest:t,...n}=e;return s.jsx(Zp,{value:t,loadTimelineResources:async(r,o,i)=>{const l=`${o}/${i}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",i),r.search("Communication",{"based-on":l,_count:u}),r.search("DiagnosticReport",{"based-on":l,_count:u}),r.search("Media",{"based-on":l,_count:u}),r.search("DocumentReference",{related:l,_count:u}),r.search("Task",{_filter:`based-on eq ${l} or focus eq ${l} or subject eq ${l}`,_count:u})])},createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",basedOn:[rn(r)],subject:r.subject,sender:rn(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",basedOn:[rn(r)],subject:r.subject,operator:rn(o),issued:new Date().toISOString(),content:i}),...n})}function dq(e){const t=Te(),{client:n,patient:r,encounter:o,children:i,...l}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(d=>{const p=new URL(n.launchUri);p.searchParams.set("iss",bx(t.fhirUrl().toString())),p.searchParams.set("launch",d.id),window.location.assign(p.toString())}).catch(d=>De({color:"red",message:tt(d),autoClose:!1}))}return s.jsx(Et,{onClick:()=>u(),...l,children:i})}var cf={},Ej;function fq(){if(Ej)return cf;Ej=1;var e=qC();return cf.createRoot=e.createRoot,cf.hydrateRoot=e.hydrateRoot,cf}var pq=fq(),Vc={},kj;function hq(){if(kj)return Vc;kj=1,Object.defineProperty(Vc,"__esModule",{value:!0}),Vc.parse=l,Vc.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]*$/,o=Object.prototype.toString,i=(()=>{const v=function(){};return v.prototype=Object.create(null),v})();function l(v,x){const b=new i,w=v.length;if(w<2)return b;const j=(x==null?void 0:x.decode)||h;let T=0;do{const R=v.indexOf("=",T);if(R===-1)break;const E=v.indexOf(";",T),C=E===-1?w:E;if(R>C){T=v.lastIndexOf(";",R-1)+1;continue}const P=u(v,T,R),D=d(v,R,P),A=v.slice(P,D);if(b[A]===void 0){let O=u(v,R+1,C),L=d(v,C,O);const V=j(v.slice(O,L));b[A]=V}T=C+1}while(T<w);return b}function u(v,x,b){do{const w=v.charCodeAt(x);if(w!==32&&w!==9)return x}while(++x<b);return b}function d(v,x,b){for(;x>b;){const w=v.charCodeAt(--x);if(w!==32&&w!==9)return x+1}return b}function p(v,x,b){const w=(b==null?void 0:b.encode)||encodeURIComponent;if(!e.test(v))throw new TypeError(`argument name is invalid: ${v}`);const j=w(x);if(!t.test(j))throw new TypeError(`argument val is invalid: ${x}`);let T=v+"="+j;if(!b)return T;if(b.maxAge!==void 0){if(!Number.isInteger(b.maxAge))throw new TypeError(`option maxAge is invalid: ${b.maxAge}`);T+="; Max-Age="+b.maxAge}if(b.domain){if(!n.test(b.domain))throw new TypeError(`option domain is invalid: ${b.domain}`);T+="; Domain="+b.domain}if(b.path){if(!r.test(b.path))throw new TypeError(`option path is invalid: ${b.path}`);T+="; Path="+b.path}if(b.expires){if(!m(b.expires)||!Number.isFinite(b.expires.valueOf()))throw new TypeError(`option expires is invalid: ${b.expires}`);T+="; Expires="+b.expires.toUTCString()}if(b.httpOnly&&(T+="; HttpOnly"),b.secure&&(T+="; Secure"),b.partitioned&&(T+="; Partitioned"),b.priority)switch(typeof b.priority=="string"?b.priority.toLowerCase():void 0){case"low":T+="; Priority=Low";break;case"medium":T+="; Priority=Medium";break;case"high":T+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${b.priority}`)}if(b.sameSite)switch(typeof b.sameSite=="string"?b.sameSite.toLowerCase():b.sameSite){case!0:case"strict":T+="; SameSite=Strict";break;case"lax":T+="; SameSite=Lax";break;case"none":T+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${b.sameSite}`)}return T}function h(v){if(v.indexOf("%")===-1)return v;try{return decodeURIComponent(v)}catch{return v}}function m(v){return o.call(v)==="[object Date]"}return Vc}hq();/**
|
|
549
|
+
* react-router v7.5.0
|
|
550
|
+
*
|
|
551
|
+
* Copyright (c) Remix Software Inc.
|
|
552
|
+
*
|
|
553
|
+
* This source code is licensed under the MIT license found in the
|
|
554
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
555
|
+
*
|
|
556
|
+
* @license MIT
|
|
557
|
+
*/var CR=e=>{throw TypeError(e)},mq=(e,t,n)=>t.has(e)||CR("Cannot "+n),Eg=(e,t,n)=>(mq(e,t,"read from private field"),n?n.call(e):t.get(e)),gq=(e,t,n)=>t.has(e)?CR("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Tj="popstate";function vq(e={}){function t(r,o){let{pathname:i,search:l,hash:u}=r.location;return du("",{pathname:i,search:l,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:xs(o)}return xq(t,n,null,e)}function vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Dn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function yq(){return Math.random().toString(36).substring(2,10)}function Pj(e,t){return{usr:e.state,key:e.key,idx:t}}function du(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Fi(t):t,state:n,key:t&&t.key||r||yq()}}function xs({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 Fi(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 xq(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:i=!1}=r,l=o.history,u="POP",d=null,p=h();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function h(){return(l.state||{idx:null}).idx}function m(){u="POP";let j=h(),T=j==null?null:j-p;p=j,d&&d({action:u,location:w.location,delta:T})}function v(j,T){u="PUSH";let R=du(w.location,j,T);p=h()+1;let E=Pj(R,p),C=w.createHref(R);try{l.pushState(E,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(C)}i&&d&&d({action:u,location:w.location,delta:1})}function x(j,T){u="REPLACE";let R=du(w.location,j,T);p=h();let E=Pj(R,p),C=w.createHref(R);l.replaceState(E,"",C),i&&d&&d({action:u,location:w.location,delta:0})}function b(j){let T=o.location.origin!=="null"?o.location.origin:o.location.href,R=typeof j=="string"?j:xs(j);return R=R.replace(/ $/,"%20"),vt(T,`No window.location.(origin|href) available to create URL for href: ${R}`),new URL(R,T)}let w={get action(){return u},get location(){return e(o,l)},listen(j){if(d)throw new Error("A history only accepts one active listener");return o.addEventListener(Tj,m),d=j,()=>{o.removeEventListener(Tj,m),d=null}},createHref(j){return t(o,j)},createURL:b,encodeLocation(j){let T=b(j);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:v,replace:x,go(j){return l.go(j)}};return w}var Gc,Rj=class{constructor(e){if(gq(this,Gc,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Eg(this,Gc).has(e))return Eg(this,Gc).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Eg(this,Gc).set(e,t)}};Gc=new WeakMap;var bq=new Set(["lazy","caseSensitive","path","id","index","children"]);function wq(e){return bq.has(e)}var Sq=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function jq(e){return Sq.has(e)}function Cq(e){return e.index===!0}function Qf(e,t,n=[],r={}){return e.map((o,i)=>{let l=[...n,String(i)],u=typeof o.id=="string"?o.id:l.join("-");if(vt(o.index!==!0||!o.children,"Cannot specify children on an index route"),vt(!r[u],`Found a route id collision on id "${u}". Route id's must be globally unique within Data Router usages`),Cq(o)){let d={...o,...t(o),id:u};return r[u]=d,d}else{let d={...o,...t(o),id:u,children:void 0};return r[u]=d,o.children&&(d.children=Qf(o.children,t,l,r)),d}})}function ps(e,t,n="/"){return wf(e,t,n,!1)}function wf(e,t,n,r){let o=typeof t=="string"?Fi(t):t,i=ao(o.pathname||"/",n);if(i==null)return null;let l=ER(e);kq(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let p=Lq(i);u=Oq(l[d],p,r)}return u}function Eq(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function ER(e,t=[],n=[],r=""){let o=(i,l,u)=>{let d={relativePath:u===void 0?i.path||"":u,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};d.relativePath.startsWith("/")&&(vt(d.relativePath.startsWith(r),`Absolute route path "${d.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),d.relativePath=d.relativePath.slice(r.length));let p=Xo([r,d.relativePath]),h=n.concat(d);i.children&&i.children.length>0&&(vt(i.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),ER(i.children,t,h,p)),!(i.path==null&&!i.index)&&t.push({path:p,score:Aq(p,i.index),routesMeta:h})};return e.forEach((i,l)=>{var u;if(i.path===""||!((u=i.path)!=null&&u.includes("?")))o(i,l);else for(let d of kR(i.path))o(i,l,d)}),t}function kR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let l=kR(r.join("/")),u=[];return u.push(...l.map(d=>d===""?i:[i,d].join("/"))),o&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function kq(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Nq(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var Tq=/^:[\w-]+$/,Pq=3,Rq=2,_q=1,Dq=10,Iq=-2,_j=e=>e==="*";function Aq(e,t){let n=e.split("/"),r=n.length;return n.some(_j)&&(r+=Iq),t&&(r+=Rq),n.filter(o=>!_j(o)).reduce((o,i)=>o+(Tq.test(i)?Pq:i===""?_q:Dq),r)}function Nq(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function Oq(e,t,n=!1){let{routesMeta:r}=e,o={},i="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],p=u===r.length-1,h=i==="/"?t:t.slice(i.length)||"/",m=Kf({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},h),v=d.route;if(!m&&p&&n&&!r[r.length-1].route.index&&(m=Kf({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},h)),!m)return null;Object.assign(o,m.params),l.push({params:o,pathname:Xo([i,m.pathname]),pathnameBase:zq(Xo([i,m.pathnameBase])),route:v}),m.pathnameBase!=="/"&&(i=Xo([i,m.pathnameBase]))}return l}function Kf(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Mq(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],l=i.replace(/(.)\/+$/,"$1"),u=o.slice(1);return{params:r.reduce((p,{paramName:h,isOptional:m},v)=>{if(h==="*"){let b=u[v]||"";l=i.slice(0,i.length-b.length).replace(/(.)\/+$/,"$1")}const x=u[v];return m&&!x?p[h]=void 0:p[h]=(x||"").replace(/%2F/g,"/"),p},{}),pathname:i,pathnameBase:l,pattern:e}}function Mq(e,t=!1,n=!0){Dn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Lq(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Dn(!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 ao(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 $q(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Fi(e):e;return{pathname:n?n.startsWith("/")?n:Fq(n,t):t,search:Vq(r),hash:Bq(o)}}function Fq(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function kg(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 TR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function u0(e){let t=TR(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function d0(e,t,n,r=!1){let o;typeof e=="string"?o=Fi(e):(o={...e},vt(!o.pathname||!o.pathname.includes("?"),kg("?","pathname","search",o)),vt(!o.pathname||!o.pathname.includes("#"),kg("#","pathname","hash",o)),vt(!o.search||!o.search.includes("#"),kg("#","search","hash",o)));let i=e===""||o.pathname==="",l=i?"/":o.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),m-=1;o.pathname=v.join("/")}u=m>=0?t[m]:"/"}let d=$q(o,u),p=l&&l!=="/"&&l.endsWith("/"),h=(i||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||h)&&(d.pathname+="/"),d}var Xo=e=>e.join("/").replace(/\/\/+/g,"/"),zq=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Vq=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Bq=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Yf=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 fu(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var PR=["POST","PUT","PATCH","DELETE"],Uq=new Set(PR),Wq=["GET",...PR],Hq=new Set(Wq),qq=new Set([301,302,303,307,308]),Gq=new Set([307,308]),Tg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Qq={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Bc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},f0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Kq=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),RR="remix-router-transitions",_R=Symbol("ResetLoaderData");function Yq(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";vt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.mapRouteProperties||Kq,o={},i=Qf(e.routes,r,void 0,o),l,u=e.basename||"/",d=e.dataStrategy||nG,p={unstable_middleware:!1,...e.future},h=null,m=new Set,v=null,x=null,b=null,w=e.hydrationData!=null,j=ps(i,e.history.location,u),T=!1,R=null;if(j==null&&!e.patchRoutesOnNavigation){let W=to(404,{pathname:e.history.location.pathname}),{matches:K,route:ee}=Wj(i);j=K,R={[ee.id]:W}}j&&!e.hydrationData&&pr(j,i,e.history.location.pathname).active&&(j=null);let E;if(j)if(j.some(W=>W.route.lazy))E=!1;else if(!j.some(W=>W.route.loader))E=!0;else{let W=e.hydrationData?e.hydrationData.loaderData:null,K=e.hydrationData?e.hydrationData.errors:null;if(K){let ee=j.findIndex(fe=>K[fe.route.id]!==void 0);E=j.slice(0,ee+1).every(fe=>!yv(fe.route,W,K))}else E=j.every(ee=>!yv(ee.route,W,K))}else{E=!1,j=[];let W=pr(null,i,e.history.location.pathname);W.active&&W.matches&&(T=!0,j=W.matches)}let C,P={historyAction:e.history.action,location:e.history.location,matches:j,initialized:E,navigation:Tg,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||R,fetchers:new Map,blockers:new Map},D="POP",A=!1,O,L=!1,V=new Map,q=null,G=!1,Q=!1,Y=new Set,X=new Map,B=0,M=-1,N=new Map,F=new Set,I=new Map,z=new Map,J=new Set,ae=new Map,je,ge=null;function Ce(){if(h=e.history.listen(({action:W,location:K,delta:ee})=>{if(je){je(),je=void 0;return}Dn(ae.size===0||ee!=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 fe=No({currentLocation:P.location,nextLocation:K,historyAction:W});if(fe&&ee!=null){let Ee=new Promise(rt=>{je=rt});e.history.go(ee*-1),$n(fe,{state:"blocked",location:K,proceed(){$n(fe,{state:"proceeding",proceed:void 0,reset:void 0,location:K}),Ee.then(()=>e.history.go(ee))},reset(){let rt=new Map(P.blockers);rt.set(fe,Bc),_e({blockers:rt})}});return}return gt(W,K)}),n){hG(t,V);let W=()=>mG(t,V);t.addEventListener("pagehide",W),q=()=>t.removeEventListener("pagehide",W)}return P.initialized||gt("POP",P.location,{initialHydration:!0}),C}function Re(){h&&h(),q&&q(),m.clear(),O&&O.abort(),P.fetchers.forEach((W,K)=>Qt(K)),P.blockers.forEach((W,K)=>Ia(K))}function ke(W){return m.add(W),()=>m.delete(W)}function _e(W,K={}){P={...P,...W};let ee=[],fe=[];P.fetchers.forEach((Ee,rt)=>{Ee.state==="idle"&&(J.has(rt)?ee.push(rt):fe.push(rt))}),J.forEach(Ee=>{!P.fetchers.has(Ee)&&!X.has(Ee)&&ee.push(Ee)}),[...m].forEach(Ee=>Ee(P,{deletedFetchers:ee,viewTransitionOpts:K.viewTransitionOpts,flushSync:K.flushSync===!0})),ee.forEach(Ee=>Qt(Ee)),fe.forEach(Ee=>P.fetchers.delete(Ee))}function $e(W,K,{flushSync:ee}={}){var Ne,Xe;let fe=P.actionData!=null&&P.navigation.formMethod!=null&&So(P.navigation.formMethod)&&P.navigation.state==="loading"&&((Ne=W.state)==null?void 0:Ne._isRedirect)!==!0,Ee;K.actionData?Object.keys(K.actionData).length>0?Ee=K.actionData:Ee=null:fe?Ee=P.actionData:Ee=null;let rt=K.loaderData?Bj(P.loaderData,K.loaderData,K.matches||[],K.errors):P.loaderData,nt=P.blockers;nt.size>0&&(nt=new Map(nt),nt.forEach((at,wt)=>nt.set(wt,Bc)));let We=A===!0||P.navigation.formMethod!=null&&So(P.navigation.formMethod)&&((Xe=W.state)==null?void 0:Xe._isRedirect)!==!0;l&&(i=l,l=void 0),G||D==="POP"||(D==="PUSH"?e.history.push(W,W.state):D==="REPLACE"&&e.history.replace(W,W.state));let Ke;if(D==="POP"){let at=V.get(P.location.pathname);at&&at.has(W.pathname)?Ke={currentLocation:P.location,nextLocation:W}:V.has(W.pathname)&&(Ke={currentLocation:W,nextLocation:P.location})}else if(L){let at=V.get(P.location.pathname);at?at.add(W.pathname):(at=new Set([W.pathname]),V.set(P.location.pathname,at)),Ke={currentLocation:P.location,nextLocation:W}}_e({...K,actionData:Ee,loaderData:rt,historyAction:D,location:W,initialized:!0,navigation:Tg,revalidation:"idle",restoreScrollPosition:Rr(W,K.matches||P.matches),preventScrollReset:We,blockers:nt},{viewTransitionOpts:Ke,flushSync:ee===!0}),D="POP",A=!1,L=!1,G=!1,Q=!1,ge==null||ge.resolve(),ge=null}async function yt(W,K){if(typeof W=="number"){e.history.go(W);return}let ee=vv(P.location,P.matches,u,W,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:fe,submission:Ee,error:rt}=Dj(!1,ee,K),nt=P.location,We=du(P.location,fe,K&&K.state);We={...We,...e.history.encodeLocation(We)};let Ke=K&&K.replace!=null?K.replace:void 0,Ne="PUSH";Ke===!0?Ne="REPLACE":Ke===!1||Ee!=null&&So(Ee.formMethod)&&Ee.formAction===P.location.pathname+P.location.search&&(Ne="REPLACE");let Xe=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,at=(K&&K.flushSync)===!0,wt=No({currentLocation:nt,nextLocation:We,historyAction:Ne});if(wt){$n(wt,{state:"blocked",location:We,proceed(){$n(wt,{state:"proceeding",proceed:void 0,reset:void 0,location:We}),yt(W,K)},reset(){let en=new Map(P.blockers);en.set(wt,Bc),_e({blockers:en})}});return}await gt(Ne,We,{submission:Ee,pendingError:rt,preventScrollReset:Xe,replace:K&&K.replace,enableViewTransition:K&&K.viewTransition,flushSync:at})}function Ft(){ge||(ge=gG()),de(),_e({revalidation:"loading"});let W=ge.promise;return P.navigation.state==="submitting"?W:P.navigation.state==="idle"?(gt(P.historyAction,P.location,{startUninterruptedRevalidation:!0}),W):(gt(D||P.historyAction,P.navigation.location,{overrideNavigation:P.navigation,enableViewTransition:L===!0}),W)}async function gt(W,K,ee){O&&O.abort(),O=null,D=W,G=(ee&&ee.startUninterruptedRevalidation)===!0,Wr(P.location,P.matches),A=(ee&&ee.preventScrollReset)===!0,L=(ee&&ee.enableViewTransition)===!0;let fe=l||i,Ee=ee&&ee.overrideNavigation,rt=ee!=null&&ee.initialHydration&&P.matches&&P.matches.length>0&&!T?P.matches:ps(fe,K,u),nt=(ee&&ee.flushSync)===!0;if(rt&&P.initialized&&!Q&&cG(P.location,K)&&!(ee&&ee.submission&&So(ee.submission.formMethod))){$e(K,{matches:rt},{flushSync:nt});return}let We=pr(rt,fe,K.pathname);if(We.active&&We.matches&&(rt=We.matches),!rt){let{error:ct,notFoundMatches:Bt,route:pn}=ii(K.pathname);$e(K,{matches:Bt,loaderData:{},errors:{[pn.id]:ct}},{flushSync:nt});return}O=new AbortController;let Ke=ml(e.history,K,O.signal,ee&&ee.submission),Ne=new Rj(e.unstable_getContext?await e.unstable_getContext():void 0),Xe;if(ee&&ee.pendingError)Xe=[Ys(rt).route.id,{type:"error",error:ee.pendingError}];else if(ee&&ee.submission&&So(ee.submission.formMethod)){let ct=await Tt(Ke,K,ee.submission,rt,Ne,We.active,{replace:ee.replace,flushSync:nt});if(ct.shortCircuited)return;if(ct.pendingActionResult){let[Bt,pn]=ct.pendingActionResult;if(Lr(pn)&&fu(pn.error)&&pn.error.status===404){O=null,$e(K,{matches:ct.matches,loaderData:{},errors:{[Bt]:pn.error}});return}}rt=ct.matches||rt,Xe=ct.pendingActionResult,Ee=Pg(K,ee.submission),nt=!1,We.active=!1,Ke=ml(e.history,Ke.url,Ke.signal)}let{shortCircuited:at,matches:wt,loaderData:en,errors:Kt}=await Nt(Ke,K,rt,Ne,We.active,Ee,ee&&ee.submission,ee&&ee.fetcherSubmission,ee&&ee.replace,ee&&ee.initialHydration===!0,nt,Xe);at||(O=null,$e(K,{matches:wt||rt,...Uj(Xe),loaderData:en,errors:Kt}))}async function Tt(W,K,ee,fe,Ee,rt,nt={}){de();let We=fG(K,ee);if(_e({navigation:We},{flushSync:nt.flushSync===!0}),rt){let Xe=await kn(fe,K.pathname,W.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){let at=Ys(Xe.partialMatches).route.id;return{matches:Xe.partialMatches,pendingActionResult:[at,{type:"error",error:Xe.error}]}}else if(Xe.matches)fe=Xe.matches;else{let{notFoundMatches:at,error:wt,route:en}=ii(K.pathname);return{matches:at,pendingActionResult:[en.id,{type:"error",error:wt}]}}}let Ke,Ne=Qc(fe,K);if(!Ne.route.action&&!Ne.route.lazy)Ke={type:"error",error:to(405,{method:W.method,pathname:K.pathname,routeId:Ne.route.id})};else{let Xe=await me("action",W,[Ne],fe,Ee,null);if(Ke=Xe[Ne.route.id],!Ke){for(let at of fe)if(Xe[at.route.id]){Ke=Xe[at.route.id];break}}if(W.signal.aborted)return{shortCircuited:!0}}if(ra(Ke)){let Xe;return nt&&nt.replace!=null?Xe=nt.replace:Xe=Fj(Ke.response.headers.get("Location"),new URL(W.url),u)===P.location.pathname+P.location.search,await ce(W,Ke,!0,{submission:ee,replace:Xe}),{shortCircuited:!0}}if(Lr(Ke)){let Xe=Ys(fe,Ne.route.id);return(nt&&nt.replace)!==!0&&(D="PUSH"),{matches:fe,pendingActionResult:[Xe.route.id,Ke]}}return{matches:fe,pendingActionResult:[Ne.route.id,Ke]}}async function Nt(W,K,ee,fe,Ee,rt,nt,We,Ke,Ne,Xe,at){let wt=rt||Pg(K,nt),en=nt||We||qj(wt),Kt=!G&&!Ne;if(Ee){if(Kt){let Tn=Pt(at);_e({navigation:wt,...Tn!==void 0?{actionData:Tn}:{}},{flushSync:Xe})}let Wt=await kn(ee,K.pathname,W.signal);if(Wt.type==="aborted")return{shortCircuited:!0};if(Wt.type==="error"){let Tn=Ys(Wt.partialMatches).route.id;return{matches:Wt.partialMatches,loaderData:{},errors:{[Tn]:Wt.error}}}else if(Wt.matches)ee=Wt.matches;else{let{error:Tn,notFoundMatches:Oa,route:Vi}=ii(K.pathname);return{matches:Oa,loaderData:{},errors:{[Vi.id]:Tn}}}}let ct=l||i,[Bt,pn]=Aj(e.history,P,ee,en,K,Ne===!0,Q,Y,J,I,F,ct,u,at);if(M=++B,Bt.length===0&&pn.length===0){let Wt=Ao();return $e(K,{matches:ee,loaderData:{},errors:at&&Lr(at[1])?{[at[0]]:at[1].error}:null,...Uj(at),...Wt?{fetchers:new Map(P.fetchers)}:{}},{flushSync:Xe}),{shortCircuited:!0}}if(Kt){let Wt={};if(!Ee){Wt.navigation=wt;let Tn=Pt(at);Tn!==void 0&&(Wt.actionData=Tn)}pn.length>0&&(Wt.fetchers=be(pn)),_e(Wt,{flushSync:Xe})}pn.forEach(Wt=>{Ct(Wt.key),Wt.controller&&X.set(Wt.key,Wt.controller)});let Hr=()=>pn.forEach(Wt=>Ct(Wt.key));O&&O.signal.addEventListener("abort",Hr);let{loaderResults:Oo,fetcherResults:qr}=await Ue(ee,Bt,pn,W,fe);if(W.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Hr),pn.forEach(Wt=>X.delete(Wt.key));let _r=uf(Oo);if(_r)return await ce(W,_r.result,!0,{replace:Ke}),{shortCircuited:!0};if(_r=uf(qr),_r)return F.add(_r.key),await ce(W,_r.result,!0,{replace:Ke}),{shortCircuited:!0};let{loaderData:tc,errors:_s}=Vj(P,ee,Oo,at,pn,qr);Ne&&P.errors&&(_s={...P.errors,..._s});let Ut=Ao(),Na=oi(M),zi=Ut||Na||pn.length>0;return{matches:ee,loaderData:tc,errors:_s,...zi?{fetchers:new Map(P.fetchers)}:{}}}function Pt(W){if(W&&!Lr(W[1]))return{[W[0]]:W[1].data};if(P.actionData)return Object.keys(P.actionData).length===0?null:P.actionData}function be(W){return W.forEach(K=>{let ee=P.fetchers.get(K.key),fe=Uc(void 0,ee?ee.data:void 0);P.fetchers.set(K.key,fe)}),new Map(P.fetchers)}async function Ie(W,K,ee,fe){Ct(W);let Ee=(fe&&fe.flushSync)===!0,rt=l||i,nt=vv(P.location,P.matches,u,ee,K,fe==null?void 0:fe.relative),We=ps(rt,nt,u),Ke=pr(We,rt,nt);if(Ke.active&&Ke.matches&&(We=Ke.matches),!We){pt(W,K,to(404,{pathname:nt}),{flushSync:Ee});return}let{path:Ne,submission:Xe,error:at}=Dj(!0,nt,fe);if(at){pt(W,K,at,{flushSync:Ee});return}let wt=Qc(We,Ne),en=new Rj(e.unstable_getContext?await e.unstable_getContext():void 0),Kt=(fe&&fe.preventScrollReset)===!0;if(Xe&&So(Xe.formMethod)){await Be(W,K,Ne,wt,We,en,Ke.active,Ee,Kt,Xe);return}I.set(W,{routeId:K,path:Ne}),await Se(W,K,Ne,wt,We,en,Ke.active,Ee,Kt,Xe)}async function Be(W,K,ee,fe,Ee,rt,nt,We,Ke,Ne){de(),I.delete(W);function Xe(an){if(!an.route.action&&!an.route.lazy){let Un=to(405,{method:Ne.formMethod,pathname:ee,routeId:K});return pt(W,K,Un,{flushSync:We}),!0}return!1}if(!nt&&Xe(fe))return;let at=P.fetchers.get(W);Ae(W,pG(Ne,at),{flushSync:We});let wt=new AbortController,en=ml(e.history,ee,wt.signal,Ne);if(nt){let an=await kn(Ee,ee,en.signal,W);if(an.type==="aborted")return;if(an.type==="error"){pt(W,K,an.error,{flushSync:We});return}else if(an.matches){if(Ee=an.matches,fe=Qc(Ee,ee),Xe(fe))return}else{pt(W,K,to(404,{pathname:ee}),{flushSync:We});return}}X.set(W,wt);let Kt=B,Bt=(await me("action",en,[fe],Ee,rt,W))[fe.route.id];if(en.signal.aborted){X.get(W)===wt&&X.delete(W);return}if(J.has(W)){if(ra(Bt)||Lr(Bt)){Ae(W,ls(void 0));return}}else{if(ra(Bt))if(X.delete(W),M>Kt){Ae(W,ls(void 0));return}else return F.add(W),Ae(W,Uc(Ne)),ce(en,Bt,!1,{fetcherSubmission:Ne,preventScrollReset:Ke});if(Lr(Bt)){pt(W,K,Bt.error);return}}let pn=P.navigation.location||P.location,Hr=ml(e.history,pn,wt.signal),Oo=l||i,qr=P.navigation.state!=="idle"?ps(Oo,P.navigation.location,u):P.matches;vt(qr,"Didn't find any matches after fetcher action");let _r=++B;N.set(W,_r);let tc=Uc(Ne,Bt.data);P.fetchers.set(W,tc);let[_s,Ut]=Aj(e.history,P,qr,Ne,pn,!1,Q,Y,J,I,F,Oo,u,[fe.route.id,Bt]);Ut.filter(an=>an.key!==W).forEach(an=>{let Un=an.key,qu=P.fetchers.get(Un),Dr=Uc(void 0,qu?qu.data:void 0);P.fetchers.set(Un,Dr),Ct(Un),an.controller&&X.set(Un,an.controller)}),_e({fetchers:new Map(P.fetchers)});let Na=()=>Ut.forEach(an=>Ct(an.key));wt.signal.addEventListener("abort",Na);let{loaderResults:zi,fetcherResults:Wt}=await Ue(qr,_s,Ut,Hr,rt);if(wt.signal.aborted)return;wt.signal.removeEventListener("abort",Na),N.delete(W),X.delete(W),Ut.forEach(an=>X.delete(an.key));let Tn=uf(zi);if(Tn)return ce(Hr,Tn.result,!1,{preventScrollReset:Ke});if(Tn=uf(Wt),Tn)return F.add(Tn.key),ce(Hr,Tn.result,!1,{preventScrollReset:Ke});let{loaderData:Oa,errors:Vi}=Vj(P,qr,zi,void 0,Ut,Wt);if(P.fetchers.has(W)){let an=ls(Bt.data);P.fetchers.set(W,an)}oi(_r),P.navigation.state==="loading"&&_r>M?(vt(D,"Expected pending action"),O&&O.abort(),$e(P.navigation.location,{matches:qr,loaderData:Oa,errors:Vi,fetchers:new Map(P.fetchers)})):(_e({errors:Vi,loaderData:Bj(P.loaderData,Oa,qr,Vi),fetchers:new Map(P.fetchers)}),Q=!1)}async function Se(W,K,ee,fe,Ee,rt,nt,We,Ke,Ne){let Xe=P.fetchers.get(W);Ae(W,Uc(Ne,Xe?Xe.data:void 0),{flushSync:We});let at=new AbortController,wt=ml(e.history,ee,at.signal);if(nt){let Bt=await kn(Ee,ee,wt.signal,W);if(Bt.type==="aborted")return;if(Bt.type==="error"){pt(W,K,Bt.error,{flushSync:We});return}else if(Bt.matches)Ee=Bt.matches,fe=Qc(Ee,ee);else{pt(W,K,to(404,{pathname:ee}),{flushSync:We});return}}X.set(W,at);let en=B,ct=(await me("loader",wt,[fe],Ee,rt,W))[fe.route.id];if(X.get(W)===at&&X.delete(W),!wt.signal.aborted){if(J.has(W)){Ae(W,ls(void 0));return}if(ra(ct))if(M>en){Ae(W,ls(void 0));return}else{F.add(W),await ce(wt,ct,!1,{preventScrollReset:Ke});return}if(Lr(ct)){pt(W,K,ct.error);return}Ae(W,ls(ct.data))}}async function ce(W,K,ee,{submission:fe,fetcherSubmission:Ee,preventScrollReset:rt,replace:nt}={}){K.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let We=K.response.headers.get("Location");vt(We,"Expected a Location header on the redirect Response"),We=Fj(We,new URL(W.url),u);let Ke=du(P.location,We,{_isRedirect:!0});if(n){let Kt=!1;if(K.response.headers.has("X-Remix-Reload-Document"))Kt=!0;else if(f0.test(We)){const ct=e.history.createURL(We);Kt=ct.origin!==t.location.origin||ao(ct.pathname,u)==null}if(Kt){nt?t.location.replace(We):t.location.assign(We);return}}O=null;let Ne=nt===!0||K.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Xe,formAction:at,formEncType:wt}=P.navigation;!fe&&!Ee&&Xe&&at&&wt&&(fe=qj(P.navigation));let en=fe||Ee;if(Gq.has(K.response.status)&&en&&So(en.formMethod))await gt(Ne,Ke,{submission:{...en,formAction:We},preventScrollReset:rt||A,enableViewTransition:ee?L:void 0});else{let Kt=Pg(Ke,fe);await gt(Ne,Ke,{overrideNavigation:Kt,fetcherSubmission:Ee,preventScrollReset:rt||A,enableViewTransition:ee?L:void 0})}}async function me(W,K,ee,fe,Ee,rt){let nt,We={};try{nt=await oG(d,W,K,ee,fe,rt,o,r,Ee)}catch(Ke){return ee.forEach(Ne=>{We[Ne.route.id]={type:"error",error:Ke}}),We}for(let[Ke,Ne]of Object.entries(nt))if(uG(Ne)){let Xe=Ne.result;We[Ke]={type:"redirect",response:aG(Xe,K,Ke,fe,u)}}else We[Ke]=await sG(Ne);return We}async function Ue(W,K,ee,fe,Ee){let rt=me("loader",fe,K,W,Ee,null),nt=Promise.all(ee.map(async Ne=>{if(Ne.matches&&Ne.match&&Ne.controller){let at=(await me("loader",ml(e.history,Ne.path,Ne.controller.signal),[Ne.match],Ne.matches,Ee,Ne.key))[Ne.match.route.id];return{[Ne.key]:at}}else return Promise.resolve({[Ne.key]:{type:"error",error:to(404,{pathname:Ne.path})}})})),We=await rt,Ke=(await nt).reduce((Ne,Xe)=>Object.assign(Ne,Xe),{});return{loaderResults:We,fetcherResults:Ke}}function de(){Q=!0,I.forEach((W,K)=>{X.has(K)&&Y.add(K),Ct(K)})}function Ae(W,K,ee={}){P.fetchers.set(W,K),_e({fetchers:new Map(P.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function pt(W,K,ee,fe={}){let Ee=Ys(P.matches,K);Qt(W),_e({errors:{[Ee.route.id]:ee},fetchers:new Map(P.fetchers)},{flushSync:(fe&&fe.flushSync)===!0})}function zt(W){return z.set(W,(z.get(W)||0)+1),J.has(W)&&J.delete(W),P.fetchers.get(W)||Qq}function Qt(W){let K=P.fetchers.get(W);X.has(W)&&!(K&&K.state==="loading"&&N.has(W))&&Ct(W),I.delete(W),N.delete(W),F.delete(W),J.delete(W),Y.delete(W),P.fetchers.delete(W)}function jn(W){let K=(z.get(W)||0)-1;K<=0?(z.delete(W),J.add(W)):z.set(W,K),_e({fetchers:new Map(P.fetchers)})}function Ct(W){let K=X.get(W);K&&(K.abort(),X.delete(W))}function bt(W){for(let K of W){let ee=zt(K),fe=ls(ee.data);P.fetchers.set(K,fe)}}function Ao(){let W=[],K=!1;for(let ee of F){let fe=P.fetchers.get(ee);vt(fe,`Expected fetcher: ${ee}`),fe.state==="loading"&&(F.delete(ee),W.push(ee),K=!0)}return bt(W),K}function oi(W){let K=[];for(let[ee,fe]of N)if(fe<W){let Ee=P.fetchers.get(ee);vt(Ee,`Expected fetcher: ${ee}`),Ee.state==="loading"&&(Ct(ee),N.delete(ee),K.push(ee))}return bt(K),K.length>0}function Da(W,K){let ee=P.blockers.get(W)||Bc;return ae.get(W)!==K&&ae.set(W,K),ee}function Ia(W){P.blockers.delete(W),ae.delete(W)}function $n(W,K){let ee=P.blockers.get(W)||Bc;vt(ee.state==="unblocked"&&K.state==="blocked"||ee.state==="blocked"&&K.state==="blocked"||ee.state==="blocked"&&K.state==="proceeding"||ee.state==="blocked"&&K.state==="unblocked"||ee.state==="proceeding"&&K.state==="unblocked",`Invalid blocker state transition: ${ee.state} -> ${K.state}`);let fe=new Map(P.blockers);fe.set(W,K),_e({blockers:fe})}function No({currentLocation:W,nextLocation:K,historyAction:ee}){if(ae.size===0)return;ae.size>1&&Dn(!1,"A router only supports one blocker at a time");let fe=Array.from(ae.entries()),[Ee,rt]=fe[fe.length-1],nt=P.blockers.get(Ee);if(!(nt&&nt.state==="proceeding")&&rt({currentLocation:W,nextLocation:K,historyAction:ee}))return Ee}function ii(W){let K=to(404,{pathname:W}),ee=l||i,{matches:fe,route:Ee}=Wj(ee);return{notFoundMatches:fe,route:Ee,error:K}}function Rs(W,K,ee){if(v=W,b=K,x=ee||null,!w&&P.navigation===Tg){w=!0;let fe=Rr(P.location,P.matches);fe!=null&&_e({restoreScrollPosition:fe})}return()=>{v=null,b=null,x=null}}function si(W,K){return x&&x(W,K.map(fe=>Eq(fe,P.loaderData)))||W.key}function Wr(W,K){if(v&&b){let ee=si(W,K);v[ee]=b()}}function Rr(W,K){if(v){let ee=si(W,K),fe=v[ee];if(typeof fe=="number")return fe}return null}function pr(W,K,ee){if(e.patchRoutesOnNavigation)if(W){if(Object.keys(W[0].params).length>0)return{active:!0,matches:wf(K,ee,u,!0)}}else return{active:!0,matches:wf(K,ee,u,!0)||[]};return{active:!1,matches:null}}async function kn(W,K,ee,fe){if(!e.patchRoutesOnNavigation)return{type:"success",matches:W};let Ee=W;for(;;){let rt=l==null,nt=l||i,We=o;try{await e.patchRoutesOnNavigation({signal:ee,path:K,matches:Ee,fetcherKey:fe,patch:(Xe,at)=>{ee.aborted||Oj(Xe,at,nt,We,r)}})}catch(Xe){return{type:"error",error:Xe,partialMatches:Ee}}finally{rt&&!ee.aborted&&(i=[...i])}if(ee.aborted)return{type:"aborted"};let Ke=ps(nt,K,u);if(Ke)return{type:"success",matches:Ke};let Ne=wf(nt,K,u,!0);if(!Ne||Ee.length===Ne.length&&Ee.every((Xe,at)=>Xe.route.id===Ne[at].route.id))return{type:"success",matches:null};Ee=Ne}}function Aa(W){o={},l=Qf(W,r,void 0,o)}function ec(W,K){let ee=l==null;Oj(W,K,l||i,o,r),ee&&(i=[...i],_e({}))}return C={get basename(){return u},get future(){return p},get state(){return P},get routes(){return i},get window(){return t},initialize:Ce,subscribe:ke,enableScrollRestoration:Rs,navigate:yt,fetch:Ie,revalidate:Ft,createHref:W=>e.history.createHref(W),encodeLocation:W=>e.history.encodeLocation(W),getFetcher:zt,deleteFetcher:jn,dispose:Re,getBlocker:Da,deleteBlocker:Ia,patchRoutes:ec,_internalFetchControllers:X,_internalSetRoutes:Aa},C}function Xq(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function vv(e,t,n,r,o,i){let l,u;if(o){l=[];for(let p of t)if(l.push(p),p.route.id===o){u=p;break}}else l=t,u=t[t.length-1];let d=d0(r||".",u0(l),ao(e.pathname,n)||e.pathname,i==="path");if(r==null&&(d.search=e.search,d.hash=e.hash),(r==null||r===""||r===".")&&u){let p=p0(d.search);if(u.route.index&&!p)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&p){let h=new URLSearchParams(d.search),m=h.getAll("index");h.delete("index"),m.filter(x=>x).forEach(x=>h.append("index",x));let v=h.toString();d.search=v?`?${v}`:""}}return n!=="/"&&(d.pathname=d.pathname==="/"?n:Xo([n,d.pathname])),xs(d)}function Dj(e,t,n){if(!n||!Xq(n))return{path:t};if(n.formMethod&&!dG(n.formMethod))return{path:t,error:to(405,{method:n.formMethod})};let r=()=>({path:t,error:to(400,{type:"invalid-body"})}),i=(n.formMethod||"get").toUpperCase(),l=OR(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!So(i))return r();let m=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((v,[x,b])=>`${v}${x}=${b}
|
|
558
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:m}}}else if(n.formEncType==="application/json"){if(!So(i))return r();try{let m=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:m,text:void 0}}}catch{return r()}}}vt(typeof FormData=="function","FormData is not available in this environment");let u,d;if(n.formData)u=xv(n.formData),d=n.formData;else if(n.body instanceof FormData)u=xv(n.body),d=n.body;else if(n.body instanceof URLSearchParams)u=n.body,d=zj(u);else if(n.body==null)u=new URLSearchParams,d=new FormData;else try{u=new URLSearchParams(n.body),d=zj(u)}catch{return r()}let p={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:d,json:void 0,text:void 0};if(So(p.formMethod))return{path:t,submission:p};let h=Fi(t);return e&&h.search&&p0(h.search)&&u.append("index",""),h.search=`?${u}`,{path:xs(h),submission:p}}function Ij(e,t,n=!1){let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Aj(e,t,n,r,o,i,l,u,d,p,h,m,v,x){let b=x?Lr(x[1])?x[1].error:x[1].data:void 0,w=e.createURL(t.location),j=e.createURL(o),T=n;i&&t.errors?T=Ij(n,Object.keys(t.errors)[0],!0):x&&Lr(x[1])&&(T=Ij(n,x[0]));let R=x?x[1].statusCode:void 0,E=R&&R>=400,C=T.filter((D,A)=>{let{route:O}=D;if(O.lazy)return!0;if(O.loader==null)return!1;if(i)return yv(O,t.loaderData,t.errors);if(Jq(t.loaderData,t.matches[A],D))return!0;let L=t.matches[A],V=D;return Nj(D,{currentUrl:w,currentParams:L.params,nextUrl:j,nextParams:V.params,...r,actionResult:b,actionStatus:R,defaultShouldRevalidate:E?!1:l||w.pathname+w.search===j.pathname+j.search||w.search!==j.search||Zq(L,V)})}),P=[];return p.forEach((D,A)=>{if(i||!n.some(G=>G.route.id===D.routeId)||d.has(A))return;let O=ps(m,D.path,v);if(!O){P.push({key:A,routeId:D.routeId,path:D.path,matches:null,match:null,controller:null});return}let L=t.fetchers.get(A),V=Qc(O,D.path),q=!1;h.has(A)?q=!1:u.has(A)?(u.delete(A),q=!0):L&&L.state!=="idle"&&L.data===void 0?q=l:q=Nj(V,{currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:j,nextParams:n[n.length-1].params,...r,actionResult:b,actionStatus:R,defaultShouldRevalidate:E?!1:l}),q&&P.push({key:A,routeId:D.routeId,path:D.path,matches:O,match:V,controller:new AbortController})}),[C,P]}function yv(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function Jq(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function Zq(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Nj(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Oj(e,t,n,r,o){let i;if(e){let d=r[e];vt(d,`No route found to patch children into: routeId = ${e}`),d.children||(d.children=[]),i=d.children}else i=n;let l=t.filter(d=>!i.some(p=>DR(d,p))),u=Qf(l,o,[e||"_","patch",String((i==null?void 0:i.length)||"0")],r);i.push(...u)}function DR(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 o;return(o=t.children)==null?void 0:o.some(i=>DR(n,i))}):!1}var Mj=new WeakMap,IR=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(vt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let i=o.lazy[e];if(!i)return;let l=Mj.get(o);l||(l={},Mj.set(o,l));let u=l[e];if(u)return u;let d=(async()=>{let p=wq(e),m=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)Dn(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),l[e]=Promise.resolve();else if(m)Dn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let v=await i();v!=null&&(Object.assign(o,{[e]:v}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(v=>v===void 0)&&(o.lazy=void 0))})();return l[e]=d,d},Lj=new WeakMap;function eG(e,t,n,r){let o=n[e.id];if(vt(o,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let p=Lj.get(o);if(p)return{lazyRoutePromise:p,lazyHandlerPromise:p};let h=(async()=>{vt(typeof e.lazy=="function","No lazy route function found");let m=await e.lazy(),v={};for(let x in m){let b=m[x];if(b===void 0)continue;let w=jq(x),T=o[x]!==void 0&&x!=="hasErrorBoundary";w?Dn(!w,"Route property "+x+" is not a supported property to be returned from a lazy route function. This property will be ignored."):T?Dn(!T,`Route "${o.id}" has a static property "${x}" defined but its lazy function is also returning a value for this property. The lazy route property "${x}" will be ignored.`):v[x]=b}Object.assign(o,v),Object.assign(o,{...r(o),lazy:void 0})})();return Lj.set(o,h),{lazyRoutePromise:h,lazyHandlerPromise:h}}let i=Object.keys(e.lazy),l=[],u;for(let p of i){let h=IR({key:p,route:e,manifest:n,mapRouteProperties:r});h&&(l.push(h),p===t&&(u=h))}return{lazyRoutePromise:Promise.all(l).then(()=>{}),lazyHandlerPromise:u}}function AR(e){return e!==void 0}function tG(e,t,n){let r=e.map(({route:o})=>{if(!(typeof o.lazy!="object"||!o.lazy.unstable_middleware))return IR({key:"unstable_middleware",route:o,manifest:t,mapRouteProperties:n})}).filter(AR);return r.length>0?Promise.all(r):void 0}async function $j(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,i)=>{n[t[i].route.id]=o}),n}async function nG(e){return e.matches.some(t=>t.route.unstable_middleware)?rG(e,!1,()=>$j(e),(t,n)=>({[n]:{type:"error",result:t}})):$j(e)}async function rG(e,t,n,r){let{matches:o,request:i,params:l,context:u}=e,d={handlerResult:void 0};try{let p=o.flatMap(m=>m.route.unstable_middleware?m.route.unstable_middleware.map(v=>[m.route.id,v]):[]),h=await NR({request:i,params:l,context:u},p,t,d,n);return t?h:d.handlerResult}catch(p){if(!d.middlewareError)throw p;let h=await r(d.middlewareError.error,d.middlewareError.routeId);return d.handlerResult?Object.assign(d.handlerResult,h):h}}async function NR(e,t,n,r,o,i=0){let{request:l}=e;if(l.signal.aborted)throw l.signal.reason?l.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${l.method} ${l.url}`);let u=t[i];if(!u)return r.handlerResult=await o(),r.handlerResult;let[d,p]=u,h=!1,m,v=async()=>{if(h)throw new Error("You may only call `next()` once per middleware");h=!0,await NR(e,t,n,r,o,i+1)};try{let x=await p({request:e.request,params:e.params,context:e.context},v);return h?x===void 0?m:x:v()}catch(x){throw r.middlewareError?r.middlewareError.error!==x&&(r.middlewareError={routeId:d,error:x}):r.middlewareError={routeId:d,error:x},x}}async function oG(e,t,n,r,o,i,l,u,d){let p=tG(o,l,u),h=o.map(b=>eG(b.route,t,l,u));p&&await p;let m=o.map((b,w)=>{let{lazyRoutePromise:j,lazyHandlerPromise:T}=h[w],R=r.some(C=>C.route.id===b.route.id);return{...b,shouldLoad:R,resolve:async C=>(C&&n.method==="GET"&&(b.route.lazy||b.route.loader)&&(R=!0),R?iG({type:t,request:n,match:b,lazyHandlerPromise:T,lazyRoutePromise:j,handlerOverride:C,scopedContext:d}):Promise.resolve({type:"data",result:void 0}))}}),v=await e({matches:m,request:n,params:o[0].params,fetcherKey:i,context:d}),x=h.flatMap(b=>Object.values(b).filter(AR));try{await Promise.all(x)}catch{}return v}async function iG({type:e,request:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:i,scopedContext:l}){let u,d,p=h=>{let m,v=new Promise((w,j)=>m=j);d=()=>m(),t.signal.addEventListener("abort",d);let x=w=>typeof h!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${e}" [routeId: ${n.route.id}]`)):h({request:t,params:n.params,context:l},...w!==void 0?[w]:[]),b=(async()=>{try{return{type:"data",result:await(i?i(j=>x(j)):x())}}catch(w){return{type:"error",result:w}}})();return Promise.race([b,v])};try{let h=n.route[e];if(r||o)if(h){let m,[v]=await Promise.all([p(h).catch(x=>{m=x}),r,o]);if(m!==void 0)throw m;u=v}else if(await r,h=n.route[e],h)[u]=await Promise.all([p(h),o]);else if(e==="action"){let m=new URL(t.url),v=m.pathname+m.search;throw to(405,{method:t.method,pathname:v,routeId:n.route.id})}else return{type:"data",result:void 0};else if(h)u=await p(h);else{let m=new URL(t.url),v=m.pathname+m.search;throw to(404,{pathname:v})}}catch(h){return{type:"error",result:h}}finally{d&&t.signal.removeEventListener("abort",d)}return u}async function sG(e){var r,o,i,l,u,d;let{result:t,type:n}=e;if(MR(t)){let p;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(h){return{type:"error",error:h}}return n==="error"?{type:"error",error:new Yf(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:"data",data:p,statusCode:t.status,headers:t.headers}}return n==="error"?Hj(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:(r=t.init)==null?void 0:r.status,headers:(o=t.init)!=null&&o.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new Yf(((i=t.init)==null?void 0:i.status)||500,void 0,t.data),statusCode:fu(t)?t.status:void 0,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:fu(t)?t.status:void 0}:Hj(t)?{type:"data",data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function aG(e,t,n,r,o){let i=e.headers.get("Location");if(vt(i,"Redirects returned/thrown from loaders/actions must have a Location header"),!f0.test(i)){let l=r.slice(0,r.findIndex(u=>u.route.id===n)+1);i=vv(new URL(t.url),l,o,i),e.headers.set("Location",i)}return e}function Fj(e,t,n){if(f0.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ao(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function ml(e,t,n,r){let o=e.createURL(OR(t)).toString(),i={signal:n};if(r&&So(r.formMethod)){let{formMethod:l,formEncType:u}=r;i.method=l.toUpperCase(),u==="application/json"?(i.headers=new Headers({"Content-Type":u}),i.body=JSON.stringify(r.json)):u==="text/plain"?i.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?i.body=xv(r.formData):i.body=r.formData}return new Request(o,i)}function xv(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function zj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function lG(e,t,n,r=!1,o=!1){let i={},l=null,u,d=!1,p={},h=n&&Lr(n[1])?n[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let v=m.route.id,x=t[v];if(vt(!ra(x),"Cannot handle redirect results in processLoaderData"),Lr(x)){let b=x.error;if(h!==void 0&&(b=h,h=void 0),l=l||{},o)l[v]=b;else{let w=Ys(e,v);l[w.route.id]==null&&(l[w.route.id]=b)}r||(i[v]=_R),d||(d=!0,u=fu(x.error)?x.error.status:500),x.headers&&(p[v]=x.headers)}else i[v]=x.data,x.statusCode&&x.statusCode!==200&&!d&&(u=x.statusCode),x.headers&&(p[v]=x.headers)}),h!==void 0&&n&&(l={[n[0]]:h},i[n[0]]=void 0),{loaderData:i,errors:l,statusCode:u||200,loaderHeaders:p}}function Vj(e,t,n,r,o,i){let{loaderData:l,errors:u}=lG(t,n,r);return o.forEach(d=>{let{key:p,match:h,controller:m}=d,v=i[p];if(vt(v,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(Lr(v)){let x=Ys(e.matches,h==null?void 0:h.route.id);u&&u[x.route.id]||(u={...u,[x.route.id]:v.error}),e.fetchers.delete(p)}else if(ra(v))vt(!1,"Unhandled fetcher revalidation redirect");else{let x=ls(v.data);e.fetchers.set(p,x)}}),{loaderData:l,errors:u}}function Bj(e,t,n,r){let o=Object.entries(t).filter(([,i])=>i!==_R).reduce((i,[l,u])=>(i[l]=u,i),{});for(let i of n){let l=i.route.id;if(!t.hasOwnProperty(l)&&e.hasOwnProperty(l)&&i.route.loader&&(o[l]=e[l]),r&&r.hasOwnProperty(l))break}return o}function Uj(e){return e?Lr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ys(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 Wj(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 to(e,{pathname:t,routeId:n,method:r,type:o,message:i}={}){let l="Unknown Server Error",u="Unknown @remix-run/router error";return e===400?(l="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.`:o==="invalid-body"&&(u="Unable to encode submission body")):e===403?(l="Forbidden",u=`Route "${n}" does not match URL "${t}"`):e===404?(l="Not Found",u=`No route matches URL "${t}"`):e===405&&(l="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 Yf(e||500,l,new Error(u),!0)}function uf(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(ra(o))return{key:r,result:o}}}function OR(e){let t=typeof e=="string"?Fi(e):e;return xs({...t,hash:""})}function cG(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uG(e){return MR(e.result)&&qq.has(e.result.status)}function Lr(e){return e.type==="error"}function ra(e){return(e&&e.type)==="redirect"}function Hj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function MR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function dG(e){return Hq.has(e.toUpperCase())}function So(e){return Uq.has(e.toUpperCase())}function p0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Qc(e,t){let n=typeof t=="string"?Fi(t).search:t.search;if(e[e.length-1].route.index&&p0(n||""))return e[e.length-1];let r=TR(e);return r[r.length-1]}function qj(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:l}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function Pg(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 fG(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 Uc(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 pG(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 ls(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 hG(e,t){try{let n=e.sessionStorage.getItem(RR);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function mG(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(RR,JSON.stringify(n))}catch(r){Dn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function gG(){let e,t,n=new Promise((r,o)=>{e=async i=>{r(i);try{await n}catch{}},t=async i=>{o(i);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Pa=g.createContext(null);Pa.displayName="DataRouter";var Vu=g.createContext(null);Vu.displayName="DataRouterState";var h0=g.createContext({isTransitioning:!1});h0.displayName="ViewTransition";var LR=g.createContext(new Map);LR.displayName="Fetchers";var vG=g.createContext(null);vG.displayName="Await";var ri=g.createContext(null);ri.displayName="Navigation";var Bu=g.createContext(null);Bu.displayName="Location";var Io=g.createContext({outlet:null,matches:[],isDataRoute:!1});Io.displayName="Route";var m0=g.createContext(null);m0.displayName="RouteError";function yG(e,{relative:t}={}){vt(Uu(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=g.useContext(ri),{hash:o,pathname:i,search:l}=Wu(e,{relative:t}),u=i;return n!=="/"&&(u=i==="/"?n:Xo([n,i])),r.createHref({pathname:u,search:l,hash:o})}function Uu(){return g.useContext(Bu)!=null}function Pr(){return vt(Uu(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(Bu).location}var $R="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function FR(e){g.useContext(ri).static||g.useLayoutEffect(e)}function Sn(){let{isDataRoute:e}=g.useContext(Io);return e?AG():xG()}function xG(){vt(Uu(),"useNavigate() may be used only in the context of a <Router> component.");let e=g.useContext(Pa),{basename:t,navigator:n}=g.useContext(ri),{matches:r}=g.useContext(Io),{pathname:o}=Pr(),i=JSON.stringify(u0(r)),l=g.useRef(!1);return FR(()=>{l.current=!0}),g.useCallback((d,p={})=>{if(Dn(l.current,$R),!l.current)return;if(typeof d=="number"){n.go(d);return}let h=d0(d,JSON.parse(i),o,p.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:Xo([t,h.pathname])),(p.replace?n.replace:n.push)(h,p.state,p)},[t,n,i,o,e])}var bG=g.createContext(null);function wG(e){let t=g.useContext(Io).outlet;return t&&g.createElement(bG.Provider,{value:e},t)}function $t(){let{matches:e}=g.useContext(Io),t=e[e.length-1];return t?t.params:{}}function Wu(e,{relative:t}={}){let{matches:n}=g.useContext(Io),{pathname:r}=Pr(),o=JSON.stringify(u0(n));return g.useMemo(()=>d0(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function SG(e,t){return zR(e,t)}function zR(e,t,n,r){var R;vt(Uu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:o,static:i}=g.useContext(ri),{matches:l}=g.useContext(Io),u=l[l.length-1],d=u?u.params:{},p=u?u.pathname:"/",h=u?u.pathnameBase:"/",m=u&&u.route;{let E=m&&m.path||"";VR(p,!m||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) 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.
|
|
559
|
+
|
|
560
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let v=Pr(),x;if(t){let E=typeof t=="string"?Fi(t):t;vt(h==="/"||((R=E.pathname)==null?void 0:R.startsWith(h)),`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 "${h}" but pathname "${E.pathname}" was given in the \`location\` prop.`),x=E}else x=v;let b=x.pathname||"/",w=b;if(h!=="/"){let E=h.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let j=!i&&n&&n.matches&&n.matches.length>0?n.matches:ps(e,{pathname:w});Dn(m||j!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),Dn(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 "${x.pathname}${x.search}${x.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 T=TG(j&&j.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:Xo([h,o.encodeLocation?o.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?h:Xo([h,o.encodeLocation?o.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),l,n,r);return t&&T?g.createElement(Bu.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},T):T}function jG(){let e=IG(),t=fu(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)",o={padding:"0.5rem",backgroundColor:r},i={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),l=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:i},"ErrorBoundary")," or"," ",g.createElement("code",{style:i},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:o},n):null,l)}var CG=g.createElement(jG,null),EG=class extends g.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?g.createElement(Io.Provider,{value:this.props.routeContext},g.createElement(m0.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function kG({routeContext:e,match:t,children:n}){let r=g.useContext(Pa);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),g.createElement(Io.Provider,{value:e},n)}function TG(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 o=e,i=n==null?void 0:n.errors;if(i!=null){let d=o.findIndex(p=>p.route.id&&(i==null?void 0:i[p.route.id])!==void 0);vt(d>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n)for(let d=0;d<o.length;d++){let p=o[d];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(u=d),p.route.id){let{loaderData:h,errors:m}=n,v=p.route.loader&&!h.hasOwnProperty(p.route.id)&&(!m||m[p.route.id]===void 0);if(p.route.lazy||v){l=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,p,h)=>{let m,v=!1,x=null,b=null;n&&(m=i&&p.route.id?i[p.route.id]:void 0,x=p.route.errorElement||CG,l&&(u<0&&h===0?(VR("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),v=!0,b=null):u===h&&(v=!0,b=p.route.hydrateFallbackElement||null)));let w=t.concat(o.slice(0,h+1)),j=()=>{let T;return m?T=x:v?T=b:p.route.Component?T=g.createElement(p.route.Component,null):p.route.element?T=p.route.element:T=d,g.createElement(kG,{match:p,routeContext:{outlet:d,matches:w,isDataRoute:n!=null},children:T})};return n&&(p.route.ErrorBoundary||p.route.errorElement||h===0)?g.createElement(EG,{location:n.location,revalidation:n.revalidation,component:x,error:m,children:j(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):j()},null)}function g0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PG(e){let t=g.useContext(Pa);return vt(t,g0(e)),t}function RG(e){let t=g.useContext(Vu);return vt(t,g0(e)),t}function _G(e){let t=g.useContext(Io);return vt(t,g0(e)),t}function v0(e){let t=_G(e),n=t.matches[t.matches.length-1];return vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function DG(){return v0("useRouteId")}function IG(){var r;let e=g.useContext(m0),t=RG("useRouteError"),n=v0("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function AG(){let{router:e}=PG("useNavigate"),t=v0("useNavigate"),n=g.useRef(!1);return FR(()=>{n.current=!0}),g.useCallback(async(o,i={})=>{Dn(n.current,$R),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...i}))},[e,t])}var Gj={};function VR(e,t,n){!t&&!Gj[e]&&(Gj[e]=!0,Dn(!1,n))}var Qj={};function Kj(e,t){!e&&!Qj[t]&&(Qj[t]=!0,console.warn(t))}function NG(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Dn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:g.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Dn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:g.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Dn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:g.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var OG=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 MG({router:e,flushSync:t}){let[n,r]=g.useState(e.state),[o,i]=g.useState(),[l,u]=g.useState({isTransitioning:!1}),[d,p]=g.useState(),[h,m]=g.useState(),[v,x]=g.useState(),b=g.useRef(new Map),w=g.useCallback((E,{deletedFetchers:C,flushSync:P,viewTransitionOpts:D})=>{E.fetchers.forEach((O,L)=>{O.data!==void 0&&b.current.set(L,O.data)}),C.forEach(O=>b.current.delete(O)),Kj(P===!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 A=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(Kj(D==null||A,"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."),!D||!A){t&&P?t(()=>r(E)):g.startTransition(()=>r(E));return}if(t&&P){t(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:D.currentLocation,nextLocation:D.nextLocation})});let O=e.window.document.startViewTransition(()=>{t(()=>r(E))});O.finished.finally(()=>{t(()=>{p(void 0),m(void 0),i(void 0),u({isTransitioning:!1})})}),t(()=>m(O));return}h?(d&&d.resolve(),h.skipTransition(),x({state:E,currentLocation:D.currentLocation,nextLocation:D.nextLocation})):(i(E),u({isTransitioning:!0,flushSync:!1,currentLocation:D.currentLocation,nextLocation:D.nextLocation}))},[e.window,t,h,d]);g.useLayoutEffect(()=>e.subscribe(w),[e,w]),g.useEffect(()=>{l.isTransitioning&&!l.flushSync&&p(new OG)},[l]),g.useEffect(()=>{if(d&&o&&e.window){let E=o,C=d.promise,P=e.window.document.startViewTransition(async()=>{g.startTransition(()=>r(E)),await C});P.finished.finally(()=>{p(void 0),m(void 0),i(void 0),u({isTransitioning:!1})}),m(P)}},[o,d,e.window]),g.useEffect(()=>{d&&o&&n.location.key===o.location.key&&d.resolve()},[d,h,n.location,o]),g.useEffect(()=>{!l.isTransitioning&&v&&(i(v.state),u({isTransitioning:!0,flushSync:!1,currentLocation:v.currentLocation,nextLocation:v.nextLocation}),x(void 0))},[l.isTransitioning,v]);let j=g.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:E=>e.navigate(E),push:(E,C,P)=>e.navigate(E,{state:C,preventScrollReset:P==null?void 0:P.preventScrollReset}),replace:(E,C,P)=>e.navigate(E,{replace:!0,state:C,preventScrollReset:P==null?void 0:P.preventScrollReset})}),[e]),T=e.basename||"/",R=g.useMemo(()=>({router:e,navigator:j,static:!1,basename:T}),[e,j,T]);return g.createElement(g.Fragment,null,g.createElement(Pa.Provider,{value:R},g.createElement(Vu.Provider,{value:n},g.createElement(LR.Provider,{value:b.current},g.createElement(h0.Provider,{value:l},g.createElement(FG,{basename:T,location:n.location,navigationType:n.historyAction,navigator:j},g.createElement(LG,{routes:e.routes,future:e.future,state:n})))))),null)}var LG=g.memo($G);function $G({routes:e,future:t,state:n}){return zR(e,void 0,n,t)}function y0(e){return wG(e.context)}function Qe(e){vt(!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 FG({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:i=!1}){vt(!Uu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let l=e.replace(/^\/*/,"/"),u=g.useMemo(()=>({basename:l,navigator:o,static:i,future:{}}),[l,o,i]);typeof n=="string"&&(n=Fi(n));let{pathname:d="/",search:p="",hash:h="",state:m=null,key:v="default"}=n,x=g.useMemo(()=>{let b=ao(d,l);return b==null?null:{location:{pathname:b,search:p,hash:h,state:m,key:v},navigationType:r}},[l,d,p,h,m,v,r]);return Dn(x!=null,`<Router basename="${l}"> is not able to match the URL "${d}${p}${h}" because it does not start with the basename, so the <Router> won't render anything.`),x==null?null:g.createElement(ri.Provider,{value:u},g.createElement(Bu.Provider,{children:t,value:x}))}function zG({children:e,location:t}){return SG(bv(e),t)}function bv(e,t=[]){let n=[];return g.Children.forEach(e,(r,o)=>{if(!g.isValidElement(r))return;let i=[...t,o];if(r.type===g.Fragment){n.push.apply(n,bv(r.props.children,i));return}vt(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>`),vt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,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&&(l.children=bv(r.props.children,i)),n.push(l)}),n}var Sf="get",jf="application/x-www-form-urlencoded";function rh(e){return e!=null&&typeof e.tagName=="string"}function VG(e){return rh(e)&&e.tagName.toLowerCase()==="button"}function BG(e){return rh(e)&&e.tagName.toLowerCase()==="form"}function UG(e){return rh(e)&&e.tagName.toLowerCase()==="input"}function WG(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function HG(e,t){return e.button===0&&(!t||t==="_self")&&!WG(e)}function wv(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(o=>[n,o]):[[n,r]])},[]))}function qG(e,t){let n=wv(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}var df=null;function GG(){if(df===null)try{new FormData(document.createElement("form"),0),df=!1}catch{df=!0}return df}var QG=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rg(e){return e!=null&&!QG.has(e)?(Dn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jf}"`),null):e}function KG(e,t){let n,r,o,i,l;if(BG(e)){let u=e.getAttribute("action");r=u?ao(u,t):null,n=e.getAttribute("method")||Sf,o=Rg(e.getAttribute("enctype"))||jf,i=new FormData(e)}else if(VG(e)||UG(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 d=e.getAttribute("formaction")||u.getAttribute("action");if(r=d?ao(d,t):null,n=e.getAttribute("formmethod")||u.getAttribute("method")||Sf,o=Rg(e.getAttribute("formenctype"))||Rg(u.getAttribute("enctype"))||jf,i=new FormData(u,e),!GG()){let{name:p,type:h,value:m}=e;if(h==="image"){let v=p?`${p}.`:"";i.append(`${v}x`,"0"),i.append(`${v}y`,"0")}else p&&i.append(p,m)}}else{if(rh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sf,r=null,o=jf,l=e}return i&&o==="text/plain"&&(l=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:l}}function x0(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}async function YG(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 XG(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 JG(e,t,n){let r=await Promise.all(e.map(async o=>{let i=t.routes[o.route.id];if(i){let l=await YG(i,n);return l.links?l.links():[]}return[]}));return nQ(r.flat(1).filter(XG).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function Yj(e,t,n,r,o,i){let l=(d,p)=>n[p]?d.route.id!==n[p].route.id:!0,u=(d,p)=>{var h;return n[p].pathname!==d.pathname||((h=n[p].route.path)==null?void 0:h.endsWith("*"))&&n[p].params["*"]!==d.params["*"]};return i==="assets"?t.filter((d,p)=>l(d,p)||u(d,p)):i==="data"?t.filter((d,p)=>{var m;let h=r.routes[d.route.id];if(!h||!h.hasLoader)return!1;if(l(d,p)||u(d,p))return!0;if(d.route.shouldRevalidate){let v=d.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof v=="boolean")return v}return!0}):[]}function ZG(e,t,{includeHydrateFallback:n}={}){return eQ(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let i=[o.module];return o.clientActionModule&&(i=i.concat(o.clientActionModule)),o.clientLoaderModule&&(i=i.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(i=i.concat(o.hydrateFallbackModule)),o.imports&&(i=i.concat(o.imports)),i}).flat(1))}function eQ(e){return[...new Set(e)]}function tQ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function nQ(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let i=JSON.stringify(tQ(o));return n.has(i)||(n.add(i),r.push({key:i,link:o})),r},[])}function rQ(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&&ao(n.pathname,t)==="/"?n.pathname=`${t.replace(/\/$/,"")}/_root.data`:n.pathname=`${n.pathname.replace(/\/$/,"")}.data`,n}function BR(){let e=g.useContext(Pa);return x0(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function oQ(){let e=g.useContext(Vu);return x0(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var b0=g.createContext(void 0);b0.displayName="FrameworkContext";function UR(){let e=g.useContext(b0);return x0(e,"You must render this element inside a <HydratedRouter> element"),e}function iQ(e,t){let n=g.useContext(b0),[r,o]=g.useState(!1),[i,l]=g.useState(!1),{onFocus:u,onBlur:d,onMouseEnter:p,onMouseLeave:h,onTouchStart:m}=t,v=g.useRef(null);g.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let w=T=>{T.forEach(R=>{l(R.isIntersecting)})},j=new IntersectionObserver(w,{threshold:.5});return v.current&&j.observe(v.current),()=>{j.disconnect()}}},[e]),g.useEffect(()=>{if(r){let w=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(w)}}},[r]);let x=()=>{o(!0)},b=()=>{o(!1),l(!1)};return n?e!=="intent"?[i,v,{}]:[i,v,{onFocus:Wc(u,x),onBlur:Wc(d,b),onMouseEnter:Wc(p,x),onMouseLeave:Wc(h,b),onTouchStart:Wc(m,x)}]:[!1,v,{}]}function Wc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function sQ({page:e,...t}){let{router:n}=BR(),r=g.useMemo(()=>ps(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?g.createElement(lQ,{page:e,matches:r,...t}):null}function aQ(e){let{manifest:t,routeModules:n}=UR(),[r,o]=g.useState([]);return g.useEffect(()=>{let i=!1;return JG(e,t,n).then(l=>{i||o(l)}),()=>{i=!0}},[e,t,n]),r}function lQ({page:e,matches:t,...n}){let r=Pr(),{manifest:o,routeModules:i}=UR(),{basename:l}=BR(),{loaderData:u,matches:d}=oQ(),p=g.useMemo(()=>Yj(e,t,d,o,r,"data"),[e,t,d,o,r]),h=g.useMemo(()=>Yj(e,t,d,o,r,"assets"),[e,t,d,o,r]),m=g.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let b=new Set,w=!1;if(t.forEach(T=>{var E;let R=o.routes[T.route.id];!R||!R.hasLoader||(!p.some(C=>C.route.id===T.route.id)&&T.route.id in u&&((E=i[T.route.id])!=null&&E.shouldRevalidate)||R.hasClientLoader?w=!0:b.add(T.route.id))}),b.size===0)return[];let j=rQ(e,l);return w&&b.size>0&&j.searchParams.set("_routes",t.filter(T=>b.has(T.route.id)).map(T=>T.route.id).join(",")),[j.pathname+j.search]},[l,u,r,o,p,t,e,i]),v=g.useMemo(()=>ZG(h,o),[h,o]),x=aQ(h);return g.createElement(g.Fragment,null,m.map(b=>g.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),v.map(b=>g.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),x.map(({key:b,link:w})=>g.createElement("link",{key:b,...w})))}function cQ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var WR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{WR&&(window.__reactRouterVersion="7.5.0")}catch{}function uQ(e,t){return Yq({basename:t==null?void 0:t.basename,unstable_getContext:t==null?void 0:t.unstable_getContext,future:t==null?void 0:t.future,history:vq({window:t==null?void 0:t.window}),hydrationData:dQ(),routes:e,mapRouteProperties:NG,dataStrategy:t==null?void 0:t.dataStrategy,patchRoutesOnNavigation:t==null?void 0:t.patchRoutesOnNavigation,window:t==null?void 0:t.window}).initialize()}function dQ(){let e=window==null?void 0:window.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:fQ(e.errors)}),e}function fQ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Yf(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let l=new i(o.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}var HR=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,qR=g.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:i,replace:l,state:u,target:d,to:p,preventScrollReset:h,viewTransition:m,...v},x){let{basename:b}=g.useContext(ri),w=typeof p=="string"&&HR.test(p),j,T=!1;if(typeof p=="string"&&w&&(j=p,WR))try{let L=new URL(window.location.href),V=p.startsWith("//")?new URL(L.protocol+p):new URL(p),q=ao(V.pathname,b);V.origin===L.origin&&q!=null?p=q+V.search+V.hash:T=!0}catch{Dn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let R=yG(p,{relative:o}),[E,C,P]=iQ(r,v),D=gQ(p,{replace:l,state:u,target:d,preventScrollReset:h,relative:o,viewTransition:m});function A(L){t&&t(L),L.defaultPrevented||D(L)}let O=g.createElement("a",{...v,...P,href:j||R,onClick:T||i?t:A,ref:cQ(x,C),target:d,"data-discover":!w&&n==="render"?"true":void 0});return E&&!w?g.createElement(g.Fragment,null,O,g.createElement(sQ,{page:R})):O});qR.displayName="Link";var pQ=g.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:i,to:l,viewTransition:u,children:d,...p},h){let m=Wu(l,{relative:p.relative}),v=Pr(),x=g.useContext(Vu),{navigator:b,basename:w}=g.useContext(ri),j=x!=null&&wQ(m)&&u===!0,T=b.encodeLocation?b.encodeLocation(m).pathname:m.pathname,R=v.pathname,E=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;n||(R=R.toLowerCase(),E=E?E.toLowerCase():null,T=T.toLowerCase()),E&&w&&(E=ao(E,w)||E);const C=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let P=R===T||!o&&R.startsWith(T)&&R.charAt(C)==="/",D=E!=null&&(E===T||!o&&E.startsWith(T)&&E.charAt(T.length)==="/"),A={isActive:P,isPending:D,isTransitioning:j},O=P?t:void 0,L;typeof r=="function"?L=r(A):L=[r,P?"active":null,D?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let V=typeof i=="function"?i(A):i;return g.createElement(qR,{...p,"aria-current":O,className:L,ref:h,style:V,to:l,viewTransition:u},typeof d=="function"?d(A):d)});pQ.displayName="NavLink";var hQ=g.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:i,method:l=Sf,action:u,onSubmit:d,relative:p,preventScrollReset:h,viewTransition:m,...v},x)=>{let b=xQ(),w=bQ(u,{relative:p}),j=l.toLowerCase()==="get"?"get":"post",T=typeof u=="string"&&HR.test(u),R=E=>{if(d&&d(E),E.defaultPrevented)return;E.preventDefault();let C=E.nativeEvent.submitter,P=(C==null?void 0:C.getAttribute("formmethod"))||l;b(C||E.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:o,state:i,relative:p,preventScrollReset:h,viewTransition:m})};return g.createElement("form",{ref:x,method:j,action:w,onSubmit:r?d:R,...v,"data-discover":!T&&e==="render"?"true":void 0})});hQ.displayName="Form";function mQ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GR(e){let t=g.useContext(Pa);return vt(t,mQ(e)),t}function gQ(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:i,viewTransition:l}={}){let u=Sn(),d=Pr(),p=Wu(e,{relative:i});return g.useCallback(h=>{if(HG(h,t)){h.preventDefault();let m=n!==void 0?n:xs(d)===xs(p);u(e,{replace:m,state:r,preventScrollReset:o,relative:i,viewTransition:l})}},[d,u,p,n,r,t,e,o,i,l])}function w0(e){Dn(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=g.useRef(wv(e)),n=g.useRef(!1),r=Pr(),o=g.useMemo(()=>qG(r.search,n.current?null:t.current),[r.search]),i=Sn(),l=g.useCallback((u,d)=>{const p=wv(typeof u=="function"?u(o):u);n.current=!0,i("?"+p,d)},[i,o]);return[o,l]}var vQ=0,yQ=()=>`__${String(++vQ)}__`;function xQ(){let{router:e}=GR("useSubmit"),{basename:t}=g.useContext(ri),n=DG();return g.useCallback(async(r,o={})=>{let{action:i,method:l,encType:u,formData:d,body:p}=KG(r,t);if(o.navigate===!1){let h=o.fetcherKey||yQ();await e.fetch(h,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:d,body:p,formMethod:o.method||l,formEncType:o.encType||u,flushSync:o.flushSync})}else await e.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:d,body:p,formMethod:o.method||l,formEncType:o.encType||u,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function bQ(e,{relative:t}={}){let{basename:n}=g.useContext(ri),r=g.useContext(Io);vt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),i={...Wu(e||".",{relative:t})},l=Pr();if(e==null){i.search=l.search;let u=new URLSearchParams(i.search),d=u.getAll("index");if(d.some(h=>h==="")){u.delete("index"),d.filter(m=>m).forEach(m=>u.append("index",m));let h=u.toString();i.search=h?`?${h}`:""}}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(i.pathname=i.pathname==="/"?n:Xo([n,i.pathname])),xs(i)}function wQ(e,t={}){let n=g.useContext(h0);vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=GR("useViewTransitionState"),o=Wu(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=ao(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ao(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Kf(o.pathname,l)!=null||Kf(o.pathname,i)!=null}new TextEncoder;const SQ=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 Ll(e,t,n){const r=jQ(e),{webkitRelativePath:o}=e,i=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&Xj(r,"path",i),Xj(r,"relativePath",i),r}function jQ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=SQ.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function Xj(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var Ra=(e,t,n)=>new Promise((r,o)=>{var i=d=>{try{u(n.next(d))}catch(p){o(p)}},l=d=>{try{u(n.throw(d))}catch(p){o(p)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(i,l);u((n=n.apply(e,t)).next())});const CQ=[".DS_Store","Thumbs.db"];function EQ(e){return Ra(this,null,function*(){return Xf(e)&&kQ(e.dataTransfer)?_Q(e.dataTransfer,e.type):TQ(e)?PQ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?RQ(e):[]})}function kQ(e){return Xf(e)}function TQ(e){return Xf(e)&&Xf(e.target)}function Xf(e){return typeof e=="object"&&e!==null}function PQ(e){return Sv(e.target.files).map(t=>Ll(t))}function RQ(e){return Ra(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Ll(n))})}function _Q(e,t){return Ra(this,null,function*(){if(e.items){const n=Sv(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(DQ));return Jj(QR(r))}return Jj(Sv(e.files).map(n=>Ll(n)))})}function Jj(e){return e.filter(t=>CQ.indexOf(t.name)===-1)}function Sv(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 DQ(e){if(typeof e.webkitGetAsEntry!="function")return Zj(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?KR(t):Zj(e,t)}function QR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?QR(n):[n]],[])}function Zj(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(i=>Ra(this,null,function*(){const l=yield i.getFile();return l.handle=i,Ll(l)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const o=Ll(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(o)}function IQ(e){return Ra(this,null,function*(){return e.isDirectory?KR(e):AQ(e)})}function KR(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(l=>Ra(this,null,function*(){if(l.length){const u=Promise.all(l.map(IQ));o.push(u),i()}else try{const u=yield Promise.all(o);n(u)}catch(u){r(u)}}),l=>{r(l)})}i()})}function AQ(e){return Ra(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Ll(r,e.fullPath);t(o)},r=>{n(r)})})})}function _g(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(l=>{const u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?i===u.replace(/\/.*$/,""):o===u})}return!0}var NQ=Object.defineProperty,OQ=Object.defineProperties,MQ=Object.getOwnPropertyDescriptors,eC=Object.getOwnPropertySymbols,LQ=Object.prototype.hasOwnProperty,$Q=Object.prototype.propertyIsEnumerable,tC=(e,t,n)=>t in e?NQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,FQ=(e,t)=>{for(var n in t||(t={}))LQ.call(t,n)&&tC(e,n,t[n]);if(eC)for(var n of eC(t))$Q.call(t,n)&&tC(e,n,t[n]);return e},zQ=(e,t)=>OQ(e,MQ(t));const VQ=typeof _g=="function"?_g:_g.default,BQ="file-invalid-type",UQ="file-too-large",WQ="file-too-small",HQ="too-many-files",qQ=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:BQ,message:`File type must be ${n}`}},nC=e=>({code:UQ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),rC=e=>({code:WQ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),GQ={code:HQ,message:"Too many files"};function YR(e,t){const n=e.type==="application/x-moz-file"||VQ(e,t);return[n,n?null:qQ(t)]}function XR(e,t,n){if(Xs(e.size))if(Xs(t)&&Xs(n)){if(e.size>n)return[!1,nC(n)];if(e.size<t)return[!1,rC(t)]}else{if(Xs(t)&&e.size<t)return[!1,rC(t)];if(Xs(n)&&e.size>n)return[!1,nC(n)]}return[!0,null]}function Xs(e){return e!=null}function QQ({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:l}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(u=>{const[d]=YR(u,t),[p]=XR(u,n,r),h=l?l(u):null;return d&&p&&!h})}function Jf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ff(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 oC(e){e.preventDefault()}function KQ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function YQ(e){return e.indexOf("Edge/")!==-1}function XQ(e=window.navigator.userAgent){return KQ(e)||YQ(e)}function Vo(...e){return(t,...n)=>e.some(r=>(!Jf(t)&&r&&r(t,...n),Jf(t)))}function JQ(){return"showOpenFilePicker"in window}function ZQ(e){return Xs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return JR(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),o=!1),(!Array.isArray(r)||!r.every(ZR))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>zQ(FQ({},n),{[r]:o}),{})}]:e}function eK(e){if(Xs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>JR(t)||ZR(t)).join(",")}function tK(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function nK(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function JR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function ZR(e){return/^.*\.[\w]+$/.test(e)}var rK=Object.defineProperty,oK=Object.defineProperties,iK=Object.getOwnPropertyDescriptors,Zf=Object.getOwnPropertySymbols,e2=Object.prototype.hasOwnProperty,t2=Object.prototype.propertyIsEnumerable,iC=(e,t,n)=>t in e?rK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ar=(e,t)=>{for(var n in t||(t={}))e2.call(t,n)&&iC(e,n,t[n]);if(Zf)for(var n of Zf(t))t2.call(t,n)&&iC(e,n,t[n]);return e},ds=(e,t)=>oK(e,iK(t)),ep=(e,t)=>{var n={};for(var r in e)e2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Zf)for(var r of Zf(e))t.indexOf(r)<0&&t2.call(e,r)&&(n[r]=e[r]);return n};const S0=g.forwardRef((e,t)=>{var n=e,{children:r}=n,o=ep(n,["children"]);const i=r2(o),{open:l}=i,u=ep(i,["open"]);return g.useImperativeHandle(t,()=>({open:l}),[l]),xn.createElement(g.Fragment,null,r(ds(ar({},u),{open:l})))});S0.displayName="Dropzone";const n2={disabled:!1,getFilesFromEvent:EQ,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};S0.defaultProps=n2;S0.propTypes={children:Yt.func,accept:Yt.objectOf(Yt.arrayOf(Yt.string)),multiple:Yt.bool,preventDropOnDocument:Yt.bool,noClick:Yt.bool,noKeyboard:Yt.bool,noDrag:Yt.bool,noDragEventsBubbling:Yt.bool,minSize:Yt.number,maxSize:Yt.number,maxFiles:Yt.number,disabled:Yt.bool,getFilesFromEvent:Yt.func,onFileDialogCancel:Yt.func,onFileDialogOpen:Yt.func,useFsAccessApi:Yt.bool,autoFocus:Yt.bool,onDragEnter:Yt.func,onDragLeave:Yt.func,onDragOver:Yt.func,onDrop:Yt.func,onDropAccepted:Yt.func,onDropRejected:Yt.func,onError:Yt.func,validator:Yt.func};const jv={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function r2(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:l,maxFiles:u,onDragEnter:d,onDragLeave:p,onDragOver:h,onDrop:m,onDropAccepted:v,onDropRejected:x,onFileDialogCancel:b,onFileDialogOpen:w,useFsAccessApi:j,autoFocus:T,preventDropOnDocument:R,noClick:E,noKeyboard:C,noDrag:P,noDragEventsBubbling:D,onError:A,validator:O}=ar(ar({},n2),e),L=g.useMemo(()=>eK(t),[t]),V=g.useMemo(()=>ZQ(t),[t]),q=g.useMemo(()=>typeof w=="function"?w:sC,[w]),G=g.useMemo(()=>typeof b=="function"?b:sC,[b]),Q=g.useRef(null),Y=g.useRef(null),[X,B]=g.useReducer(sK,jv),{isFocused:M,isFileDialogActive:N}=X,F=g.useRef(typeof window<"u"&&window.isSecureContext&&j&&JQ()),I=()=>{!F.current&&N&&setTimeout(()=>{if(Y.current){const{files:ce}=Y.current;ce.length||(B({type:"closeDialog"}),G())}},300)};g.useEffect(()=>(window.addEventListener("focus",I,!1),()=>{window.removeEventListener("focus",I,!1)}),[Y,N,G,F]);const z=g.useRef([]),J=ce=>{Q.current&&Q.current.contains(ce.target)||(ce.preventDefault(),z.current=[])};g.useEffect(()=>(R&&(document.addEventListener("dragover",oC,!1),document.addEventListener("drop",J,!1)),()=>{R&&(document.removeEventListener("dragover",oC),document.removeEventListener("drop",J))}),[Q,R]),g.useEffect(()=>(!n&&T&&Q.current&&Q.current.focus(),()=>{}),[Q,T,n]);const ae=g.useCallback(ce=>{A?A(ce):console.error(ce)},[A]),je=g.useCallback(ce=>{ce.preventDefault(),ce.persist(),be(ce),z.current=[...z.current,ce.target],ff(ce)&&Promise.resolve(r(ce)).then(me=>{if(Jf(ce)&&!D)return;const Ue=me.length,de=Ue>0&&QQ({files:me,accept:L,minSize:i,maxSize:o,multiple:l,maxFiles:u,validator:O}),Ae=Ue>0&&!de;B({isDragAccept:de,isDragReject:Ae,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ce)}).catch(me=>ae(me))},[r,d,ae,D,L,i,o,l,u,O]),ge=g.useCallback(ce=>{ce.preventDefault(),ce.persist(),be(ce);const me=ff(ce);if(me&&ce.dataTransfer)try{ce.dataTransfer.dropEffect="copy"}catch{}return me&&h&&h(ce),!1},[h,D]),Ce=g.useCallback(ce=>{ce.preventDefault(),ce.persist(),be(ce);const me=z.current.filter(de=>Q.current&&Q.current.contains(de)),Ue=me.indexOf(ce.target);Ue!==-1&&me.splice(Ue,1),z.current=me,!(me.length>0)&&(B({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ff(ce)&&p&&p(ce))},[Q,p,D]),Re=g.useCallback((ce,me)=>{const Ue=[],de=[];ce.forEach(Ae=>{const[pt,zt]=YR(Ae,L),[Qt,jn]=XR(Ae,i,o),Ct=O?O(Ae):null;if(pt&&Qt&&!Ct)Ue.push(Ae);else{let bt=[zt,jn];Ct&&(bt=bt.concat(Ct)),de.push({file:Ae,errors:bt.filter(Ao=>Ao)})}}),(!l&&Ue.length>1||l&&u>=1&&Ue.length>u)&&(Ue.forEach(Ae=>{de.push({file:Ae,errors:[GQ]})}),Ue.splice(0)),B({acceptedFiles:Ue,fileRejections:de,isDragReject:de.length>0,type:"setFiles"}),m&&m(Ue,de,me),de.length>0&&x&&x(de,me),Ue.length>0&&v&&v(Ue,me)},[B,l,L,i,o,u,m,v,x,O]),ke=g.useCallback(ce=>{ce.preventDefault(),ce.persist(),be(ce),z.current=[],ff(ce)&&Promise.resolve(r(ce)).then(me=>{Jf(ce)&&!D||Re(me,ce)}).catch(me=>ae(me)),B({type:"reset"})},[r,Re,ae,D]),_e=g.useCallback(()=>{if(F.current){B({type:"openDialog"}),q();const ce={multiple:l,types:V};window.showOpenFilePicker(ce).then(me=>r(me)).then(me=>{Re(me,null),B({type:"closeDialog"})}).catch(me=>{tK(me)?(G(me),B({type:"closeDialog"})):nK(me)?(F.current=!1,Y.current?(Y.current.value=null,Y.current.click()):ae(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."))):ae(me)});return}Y.current&&(B({type:"openDialog"}),q(),Y.current.value=null,Y.current.click())},[B,q,G,j,Re,ae,V,l]),$e=g.useCallback(ce=>{!Q.current||!Q.current.isEqualNode(ce.target)||(ce.key===" "||ce.key==="Enter"||ce.keyCode===32||ce.keyCode===13)&&(ce.preventDefault(),_e())},[Q,_e]),yt=g.useCallback(()=>{B({type:"focus"})},[]),Ft=g.useCallback(()=>{B({type:"blur"})},[]),gt=g.useCallback(()=>{E||(XQ()?setTimeout(_e,0):_e())},[E,_e]),Tt=ce=>n?null:ce,Nt=ce=>C?null:Tt(ce),Pt=ce=>P?null:Tt(ce),be=ce=>{D&&ce.stopPropagation()},Ie=g.useMemo(()=>(ce={})=>{var me=ce,{refKey:Ue="ref",role:de,onKeyDown:Ae,onFocus:pt,onBlur:zt,onClick:Qt,onDragEnter:jn,onDragOver:Ct,onDragLeave:bt,onDrop:Ao}=me,oi=ep(me,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return ar(ar({onKeyDown:Nt(Vo(Ae,$e)),onFocus:Nt(Vo(pt,yt)),onBlur:Nt(Vo(zt,Ft)),onClick:Tt(Vo(Qt,gt)),onDragEnter:Pt(Vo(jn,je)),onDragOver:Pt(Vo(Ct,ge)),onDragLeave:Pt(Vo(bt,Ce)),onDrop:Pt(Vo(Ao,ke)),role:typeof de=="string"&&de!==""?de:"presentation",[Ue]:Q},!n&&!C?{tabIndex:0}:{}),oi)},[Q,$e,yt,Ft,gt,je,ge,Ce,ke,C,P,n]),Be=g.useCallback(ce=>{ce.stopPropagation()},[]),Se=g.useMemo(()=>(ce={})=>{var me=ce,{refKey:Ue="ref",onChange:de,onClick:Ae}=me,pt=ep(me,["refKey","onChange","onClick"]);const zt={accept:L,multiple:l,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:Tt(Vo(de,ke)),onClick:Tt(Vo(Ae,Be)),tabIndex:-1,[Ue]:Y};return ar(ar({},zt),pt)},[Y,t,l,ke,n]);return ds(ar({},X),{isFocused:M&&!n,getRootProps:Ie,getInputProps:Se,rootRef:Q,inputRef:Y,open:Tt(_e)})}function sK(e,t){switch(t.type){case"focus":return ds(ar({},e),{isFocused:!0});case"blur":return ds(ar({},e),{isFocused:!1});case"openDialog":return ds(ar({},jv),{isFileDialogActive:!0});case"closeDialog":return ds(ar({},e),{isFileDialogActive:!1});case"setDraggedFiles":return ds(ar({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ds(ar({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return ar({},jv);default:return e}}function sC(){}const[aK,lK]=dr("Dropzone component was not found in tree");function j0(e){const t=n=>{const{children:r,...o}=oe(`Dropzone${a1(e)}`,{},n),i=lK(),l=Pi(r)?r:s.jsx("span",{children:r});return i[e]?g.cloneElement(l,o):null};return t.displayName=`@mantine/dropzone/${a1(e)}`,t}const cK=j0("accept"),uK=j0("reject"),dK=j0("idle");var pu={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const fK={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},pK=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),l=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Mt(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":l.color,"--dropzone-reject-bg":l.background}}},Ts=ue((e,t)=>{const n=oe("Dropzone",fK,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,radius:p,disabled:h,loading:m,multiple:v,maxSize:x,accept:b,children:w,onDropAny:j,onDrop:T,onReject:R,openRef:E,name:C,maxFiles:P,autoFocus:D,activateOnClick:A,activateOnDrag:O,dragEventsBubbling:L,activateOnKeyboard:V,onDragEnter:q,onDragLeave:G,onDragOver:Q,onFileDialogCancel:Y,onFileDialogOpen:X,preventDropOnDocument:B,useFsAccessApi:M,getFilesFromEvent:N,validator:F,rejectColor:I,acceptColor:z,enablePointerEvents:J,loaderProps:ae,inputProps:je,mod:ge,...Ce}=n,Re=Le({name:"Dropzone",classes:pu,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:pK}),{getRootProps:ke,getInputProps:_e,isDragAccept:$e,isDragReject:yt,open:Ft}=r2({onDrop:j,onDropAccepted:T,onDropRejected:R,disabled:h||m,accept:Array.isArray(b)?b.reduce((Tt,Nt)=>({...Tt,[Nt]:[]}),{}):b,multiple:v,maxSize:x,maxFiles:P,autoFocus:D,noClick:!A,noDrag:!O,noDragEventsBubbling:!L,noKeyboard:!V,onDragEnter:q,onDragLeave:G,onDragOver:Q,onFileDialogCancel:Y,onFileDialogOpen:X,preventDropOnDocument:B,useFsAccessApi:M,validator:F,...N?{getFilesFromEvent:N}:null});Zc(E,Ft);const gt=!$e&&!yt;return s.jsx(aK,{value:{accept:$e,reject:yt,idle:gt},children:s.jsxs(se,{...ke(),...Re("root",{focusable:!0}),...Ce,mod:[{accept:$e,reject:yt,idle:gt,disabled:h,loading:m,"activate-on-click":A},ge],children:[s.jsx(Fy,{visible:m,overlayProps:{radius:p},unstyled:u,loaderProps:ae}),s.jsx("input",{..._e(je),name:C}),s.jsx("div",{...Re("inner"),ref:t,"data-enable-pointer-events":J||void 0,children:w})]})})});Ts.classes=pu;Ts.displayName="@mantine/dropzone/Dropzone";Ts.Accept=cK;Ts.Idle=dK;Ts.Reject=uK;const hK={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Br("max"),withinPortal:!0},C0=ue((e,t)=>{const n=oe("DropzoneFullScreen",hK,e),{classNames:r,className:o,style:i,styles:l,unstyled:u,vars:d,active:p,onDrop:h,onReject:m,zIndex:v,withinPortal:x,portalProps:b,...w}=n,j=Le({name:"DropzoneFullScreen",classes:pu,props:n,className:o,style:i,classNames:r,styles:l,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:T,resolvedStyles:R}=va({classNames:r,styles:l,props:n}),[E,C]=g.useState(0),[P,{open:D,close:A}]=rp(!1),O=V=>{var q;(q=V.dataTransfer)!=null&&q.types.includes("Files")&&(C(G=>G+1),D())},L=()=>{C(V=>V-1)};return g.useEffect(()=>{E===0&&A()},[E]),g.useEffect(()=>{if(p)return document.addEventListener("dragenter",O,!1),document.addEventListener("dragleave",L,!1),()=>{document.removeEventListener("dragenter",O,!1),document.removeEventListener("dragleave",L,!1)}},[p]),s.jsx(ws,{...b,withinPortal:x,children:s.jsx(se,{...j("fullScreen",{style:{opacity:P?1:0,pointerEvents:P?"all":"none",zIndex:v}}),ref:t,children:s.jsx(Ts,{...w,classNames:T,styles:R,unstyled:u,className:pu.dropzone,onDrop:V=>{h==null||h(V),A(),C(0)},onReject:V=>{m==null||m(V),A(),C(0)}})})})});C0.classes=pu;C0.displayName="@mantine/dropzone/DropzoneFullScreen";Ts.FullScreen=C0;const pf=Ts,mK='{"resourceType": "Bundle"}';function Dg({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:l="show",loading:u}){Fr[l]({id:e,loading:u,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function gK(){const e=mn(),t=Te(),[n,r]=g.useState({}),o=g.useCallback(async(u,d)=>{const p="batch-upload";Dg({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 h=JSON.parse(u);h.type!=="batch"&&h.type!=="transaction"&&(h=JT(h));const m=await t.executeBatch(h);r(v=>({...v,[d]:m})),Dg({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx($i,{size:"1rem"}),withCloseButton:!0})}catch(h){Dg({id:p,title:"Batch Upload Failed",color:"red",message:tt(h),method:"update",icon:s.jsx(fa,{size:"1rem"}),withCloseButton:!0})}},[t]),i=g.useCallback(async u=>{for(const d of u){const p=new FileReader;p.onload=h=>{var m;return o((m=h.target)==null?void 0:m.result,d.name)},p.readAsText(d)}},[o]),l=g.useCallback(async u=>{await o(u.input,"JSON Data")},[o]);return s.jsxs(lt,{children:[s.jsx(Fe,{children:"Batch Create"}),s.jsxs(Pe,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",s.jsx(Et,{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(_t,{defaultValue:"upload",children:[s.jsxs(_t.List,{children:[s.jsx(_t.Tab,{value:"upload",children:"File Upload"}),s.jsx(_t.Tab,{value:"json",children:"JSON"})]}),s.jsx(_t.Panel,{value:"upload",pt:"xs",children:s.jsx(pf,{onDrop:i,accept:["application/json"],children:s.jsxs(xe,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(pf.Accept,{children:s.jsx(JS,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(pf.Reject,{children:s.jsx(fa,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(pf.Idle,{children:s.jsx(JS,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(Pe,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(Pe,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(_t.Panel,{value:"json",pt:"xs",children:s.jsxs(mt,{onSubmit:l,children:[s.jsx(Hl,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:mK,deserialize:JSON.parse}),s.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(_t,{defaultValue:Object.keys(n)[0],children:[s.jsx(_t.List,{children:Object.keys(n).map(u=>s.jsx(_t.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>s.jsx(_t.Panel,{value:u,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),s.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{onClick:()=>r({}),children:"Start over"})})]})]})}function vK(){const{resourceType:e}=$t(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Ml("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(lt,{children:[s.jsxs(Fe,{children:["No apps for ",e]}),s.jsx(xt,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(lt,{children:s.jsx("div",{children:r.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(xt,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(so,{})}function yK(){const e=Te(),[t,n]=g.useState(),[r,o]=g.useState(!1);return s.jsx(lt,{width:450,children:s.jsxs(mt,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(l=>n(Gt(l)))},children:[s.jsxs(Gn,{style:{flexDirection:"column"},children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Change password"})]}),!r&&s.jsxs(et,{gap:"xl",mt:"xl",children:[s.jsx(Eo,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:kt(t,"oldPassword")}),s.jsx(Eo,{name:"newPassword",label:"New password",required:!0,error:kt(t,"newPassword")}),s.jsx(Eo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:kt(t,"confirmPassword")}),s.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Cv=["Form","JSON","Profiles"],xK=["Profiles"],Ig=Cv[0].toLowerCase();function bK(){const e=Sn(),t=mn(),{resourceType:n}=$t(),[r,o]=g.useState(()=>{const l=window.location.pathname.split("/").pop();return l&&Cv.map(u=>u.toLowerCase()).includes(l)?l:Ig});function i(l){var u;l||(l=Ig),o(l),(u=e(`/${n}/new/${l}`))==null||u.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(cr,{children:[s.jsxs(Pe,{p:"md",fw:500,children:["New ",n]}),s.jsx(co,{children:s.jsx(_t,{defaultValue:Ig,value:r,onChange:i,children:s.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Cv.map(l=>s.jsx(_t.Tab,{value:l.toLowerCase(),px:"md",children:xK.includes(l)?s.jsxs(xe,{gap:"xs",wrap:"nowrap",children:[l,s.jsx(wp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):l},l))})})})]}),s.jsx(y0,{})]})}function wK(){return s.jsx(lt,{children:s.jsxs(et,{children:[s.jsx(Fe,{order:1,children:"Unexpected Error"}),s.jsx(Pe,{children:"We're sorry, something went wrong."}),s.jsxs(Pe,{children:["Please contact ",s.jsx(Et,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function o2(e){const t=Vt(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(xt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(l,u){l&&u&&n.push({key:l,value:u})}function o(l){l&&r(l.system,l.value)}function i(l,u){Array.isArray(u)?u.forEach(d=>i(l,d)):typeof u=="string"?r(l,u):u&&(Array.isArray(u.coding)?r(l,u.coding.map(d=>d.display||d.code).join(", ")):r(l,u.text))}if("name"in t){const l=ki(t);l!==Dt(t)&&r("Name",l)}return"category"in t&&i("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&i("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),s.jsx(ht,{children:n.map((l,u)=>s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:l.key}),s.jsx(ht.Value,{children:l.value})]},`${l.key}-${u}`))})}function E0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function SK(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 Ps(e){var t;return ca((t=e.getActiveLogin())==null?void 0:t.project)}function jK(){const{id:e}=$t(),t=Pr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=Te(),[i,l]=g.useState(!0),[u,d]=g.useState(),[p,h]=g.useState(),[m,v]=g.useState(),[x,b]=g.useState(),[w,j]=g.useState();if(g.useEffect(()=>{const E={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const C=r.split(",").filter(P=>!!P);C.length===1&&E.entry.push({request:{method:"GET",url:C[0]}}),h(C)}o.executeBatch(E).then(C=>{var P,D,A,O,L,V,q,G;((A=(D=(P=C.entry)==null?void 0:P[0])==null?void 0:D.response)==null?void 0:A.status)!=="200"?b((V=(L=(O=C.entry)==null?void 0:O[0])==null?void 0:L.response)==null?void 0:V.outcome):(d((q=C.entry[0])==null?void 0:q.resource),v((G=C.entry[1])==null?void 0:G.resource)),l(!1)}).catch(C=>{b(C),l(!1)})},[o,e,r]),x)return s.jsx(lt,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(x,void 0,2)})});if(w)return s.jsxs(lt,{children:[s.jsx(Fe,{children:u==null?void 0:u.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[w.length===1&&s.jsx("li",{children:s.jsx(xt,{to:w[0],children:"Review your answers"})}),w.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:w.map(E=>s.jsx("li",{children:s.jsx(xt,{to:E,children:Dt(E)})},E.id))})]}),m&&s.jsx("li",{children:s.jsxs(xt,{to:m,children:["Back to ",ki(m)]})}),s.jsx("li",{children:s.jsx(xt,{to:"/",children:"Go back home"})})]})]});if(i||!u)return s.jsx(so,{});const T=m&&E0(m);return s.jsxs(s.Fragment,{children:[s.jsxs(cr,{shadow:"xs",radius:0,children:[T&&s.jsx(oR,{patient:T}),m&&m.resourceType!=="Patient"&&s.jsx(o2,{resource:m}),s.jsx(se,{px:"xl",py:"md",children:s.jsxs(Pe,{children:[ki(u),p&&p.length>1&&s.jsxs(s.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),s.jsx(lt,{children:s.jsx(bR,{questionnaire:u,subject:m&&rn(m),onSubmit:R})})]});async function R(E){const C=[];if(!p||p.length===0)C.push(await o.createResource(E));else for(const P of p)C.push(await o.createResource({...E,subject:{reference:P}}));j(C)}}const CK="_paper_unw9o_1",EK={paper:CK},kK={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function i2(e,t){const n=e.resourceType||TK(t),r=e.fields??PK(n),o=e.filters??(e.resourceType?void 0:RK(n)),i=e.sortRules??_K(n),l=e.offset??0,u=e.count??Hp;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:l,count:u}}function TK(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 PK(e){const t=k0(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function RK(e){var t;return(t=k0(e))==null?void 0:t.filters}function _K(e){const t=k0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function k0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function DK(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function IK(e,t){const n={...e,count:1e3,offset:0},r=i2(n,t.getUserConfiguration()),o=await t.search(r.resourceType,xl({...r,total:"accurate",fields:void 0}));return JT(o)}function aC(){const e=Te(),t=Sn(),n=Pr(),[r,o]=g.useState();return g.useEffect(()=>{var u;const i=GT(n.pathname+n.search),l=i2(i,e.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===xl(l)?(DK(l),o(l)):(u=t(`/${l.resourceType}${xl(l)}`))==null||u.catch(console.error)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(so,{}):s.jsx(cr,{shadow:"xs",m:"md",p:"xs",className:EK.paper,children:s.jsx(zu,{checkboxesEnabled:!0,search:r,onClick:i=>{var l;return(l=t(`/${i.resource.resourceType}/${i.resource.id}`))==null?void 0:l.catch(console.error)},onAuxClick:i=>window.open(`/${i.resource.resourceType}/${i.resource.id}`,"_blank"),onChange:i=>{var l;(l=t(`/${r.resourceType}${xl(i.definition)}`))==null||l.catch(console.error)},onNew:()=>{var i;(i=t(kK[r.resourceType]??`/${r.resourceType}/new`))==null||i.catch(console.error)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+xl(r);e.download(i).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>De({color:"red",message:tt(l),autoClose:!1}))},onExportTransactionBundle:async()=>{IK(r,e).then(i=>xP(JSON.stringify(i,void 0,2))).catch(i=>De({color:"red",message:tt(i),autoClose:!1}))},onDelete:i=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:i.map(l=>({request:{method:"DELETE",url:`${r.resourceType}/${l}`}}))}).then(()=>o({...r})).catch(l=>De({color:"red",message:tt(l),autoClose:!1})))},onBulk:i=>{var l;(l=t(`/bulk/${r.resourceType}?ids=${i.join(",")}`))==null||l.catch(console.error)}})})}function AK(){const e=Te(),[t,n]=g.useState(),[r,o]=g.useState(void 0),[i,l]=g.useState(!1),u=g.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(h=>{n(h.enrollQrCode),o(h.enrolled)}).catch(h=>De({color:"red",message:tt(h),autoClose:!1}))},[e]);g.useEffect(()=>{u()},[u]);const d=g.useCallback(h=>{e.post("auth/mfa/enroll",h).then(()=>{o(!0),De({color:"green",message:"Success"})}).catch(m=>De({color:"red",message:tt(m),autoClose:!1}))},[e]),p=g.useCallback(async h=>e.post("auth/mfa/disable",{token:h.token}),[e]);return r===void 0?null:r?s.jsxs(lt,{children:[s.jsx(Nn,{title:"Disable MFA",opened:i,onClose:()=>l(!1),children:s.jsx(_P,{onSubmit:async h=>{await p(h),l(!1),o(!1),De({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:s.jsx(_z,{})}),u()}})}),s.jsxs(xe,{children:[s.jsx(Fe,{children:"MFA is enabled"}),s.jsx(Oe,{onClick:()=>l(!0),children:"Disable MFA"})]})]}):s.jsx(lt,{width:400,children:s.jsxs(mt,{onSubmit:d,children:[s.jsx(Fe,{children:"Multi Factor Auth Setup"}),s.jsx(Gn,{children:s.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),s.jsx(Ve,{name:"token",label:"Code"}),s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"Enroll"})})]})})}const Ag={},Ev={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:Ag==null?void 0:Ag.MEDPLUM_AWS_TEXTRACT_ENABLED};function Hu(){return Ev}function s2(){return a2("registerEnabled")}function NK(){return a2("awsTextractEnabled")}function a2(e){try{return Ev[e]!==!1&&Ev[e]!=="false"}catch{return!0}}function OK(){var m,v;const e=Sn(),[t]=w0(),n=Te(),r=t.get("scope")||"openid",[o,i]=g.useState(),[l,u]=g.useState(!0),d=t.get("client_id"),p=t.get("login");if(g.useEffect(()=>{if(!d||d==="medplum-cli")return;async function x(){try{const b=await n.get(`/auth/clientinfo/${d}`);i(b)}catch(b){De({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:tt(b),withCloseButton:!0})}finally{u(!1)}}x().catch(console.error)},[n,d]),!d)return null;function h(x){const b=new URL(t.get("redirect_uri"));for(const w of["scope","state","nonce"])t.has(w)&&b.searchParams.set(w,t.get(w));b.searchParams.set("code",x),window.location.assign(b.toString())}return s.jsx(DP,{onCode:h,onForgotPassword:()=>{var x;return(x=e("/resetpassword"))==null?void 0:x.catch(console.error)},onRegister:()=>{var x;return(x=e("/register"))==null?void 0:x.catch(console.error)},googleClientId:Hu().googleClientId,clientId:d||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:!l&&s.jsxs(s.Fragment,{children:[(m=o==null?void 0:o.logo)!=null&&m.url?s.jsx("img",{src:(v=o==null?void 0:o.logo)==null?void 0:v.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):s.jsx(Do,{size:32}),s.jsx(Fe,{children:(o==null?void 0:o.welcomeString)??"Sign in to Medplum"})]})})}function MK(){const e=Te(),t=Sn(),n=Hu();return g.useEffect(()=>{var r;e.getProfile()&&((r=t("/signin?project=new"))==null||r.catch(console.error))},[e,t]),s2()?s.jsxs(pV,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Create a new account"})]}):s.jsx(lt,{width:450,children:s.jsx(Ni,{icon:s.jsx(ka,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function LK(){const e=Sn(),t=Te(),[n,r]=g.useState(),[o,i]=g.useState(!1),l=Hu().recaptchaSiteKey;return g.useEffect(()=>{PP(l)},[l]),s.jsx(lt,{width:450,children:s.jsxs(mt,{onSubmit:async u=>{let d="";d=await RP(l),t.post("auth/resetpassword",{...u,recaptchaToken:d}).then(()=>i(!0)).catch(p=>r(Gt(p)))},children:[s.jsxs(et,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Medplum Password Reset"})]}),s.jsxs(et,{gap:"xl",children:[s.jsx(po,{issues:Mu(n,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(Ve,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:kt(n,"email")}),s.jsxs(xe,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Et,{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(Oe,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function $K(){var i;const e=Sn(),t=Te(),[n,r]=g.useState();g.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(l=>De({color:"red",message:tt(l),autoClose:!1}))},[t]);function o(l){t.post("auth/revoke",{loginId:l}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>De({color:"green",message:"Login revoked"})).catch(u=>De({color:"red",message:tt(u),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(lt,{children:[s.jsx(Fe,{children:"Security"}),s.jsxs(Wx,{children:[s.jsx(bi,{term:"ID",children:s.jsx(Et,{href:`/${Dt(n.profile)}`,children:n.profile.id})}),s.jsx(bi,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(bi,{term:"Name",children:Yl((i=n.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(lt,{children:[s.jsx(Fe,{children:"Sessions"}),s.jsxs(Me,{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(l=>s.jsxs("tr",{children:[s.jsx("td",{children:l.os}),s.jsx("td",{children:l.browser}),s.jsx("td",{children:l.remoteAddress}),s.jsx("td",{children:l.authMethod}),s.jsx("td",{children:ur(l.lastUpdated)}),s.jsx("td",{children:s.jsx(Et,{href:"#",onClick:()=>o(l.id),children:"Revoke"})})]},l.id))})]})]}),s.jsxs(lt,{children:[s.jsx(Fe,{children:"Password"}),s.jsx(Oe,{onClick:()=>{var l;return(l=e("/changepassword"))==null?void 0:l.catch(console.error)},children:"Change password"})]}),s.jsxs(lt,{children:[s.jsx(Fe,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(Oe,{onClick:()=>{var l;return(l=e("/mfa"))==null?void 0:l.catch(console.error)},children:"Enroll"})]})]}):null}function FK(){const{id:e,secret:t}=$t(),n=Te(),[r,o]=g.useState(),[i,l]=g.useState(!1),u=Mu(r,void 0);return s.jsxs(lt,{width:450,children:[s.jsx(po,{issues:u}),s.jsxs(mt,{onSubmit:d=>{if(d.password!==d.confirmPassword){o(Qo("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:d.password};n.post("auth/setpassword",p).then(()=>l(!0)).catch(h=>o(Gt(h)))},children:[s.jsxs(Gn,{style:{flexDirection:"column"},children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Set password"})]}),!i&&s.jsxs(et,{children:[s.jsx(Eo,{name:"password",label:"New password",required:!0,error:kt(r,"password")}),s.jsx(Eo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:kt(r,"confirmPassword")}),s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"Set password"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(xt,{to:"/signin",children:"sign in"}),"."]})]})]})}function zK(){const e=Yp(),t=Sn(),[n]=w0(),r=Hu(),o=g.useCallback(()=>{var l;const i=n.get("next");(l=t(i!=null&&i.startsWith("/")?i:"/"))==null||l.catch(console.error)},[n,t]);return g.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),s.jsxs(DP,{onSuccess:()=>o(),onForgotPassword:()=>{var i;return(i=t("/resetpassword"))==null?void 0:i.catch(console.error)},onRegister:s2()?()=>{var i;return(i=t("/register"))==null?void 0:i.catch(console.error)}:void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(Do,{size:32}),s.jsx(Fe,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function VK(){const e=Sn(),t=Pr(),[n,r]=g.useState(),[o,i]=g.useState(),[l,u]=g.useState();return g.useEffect(()=>{const d=Object.fromEntries(new URLSearchParams(t.search).entries());r(d.resourceType),i(d.query),u(JSON.parse(d.fields))},[t]),!n||!o||!l?null:s.jsx(cW,{resourceType:n,checkboxesEnabled:!0,query:o,fields:l,onClick:d=>{var p;return(p=e(`/${n}/${d.resource.id}`))==null?void 0:p.catch(console.error)},onAuxClick:d=>window.open(`/${n}/${d.resource.id}`,"_blank"),onBulk:d=>{var p;(p=e(`/bulk/${n}?ids=${d.join(",")}`))==null||p.catch(console.error)}})}function oh(e){const t=Te(),n=Ps(t),r=Sn(),[o,i]=g.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:le.EQUALS,value:"Project/"+n},{code:"profile-type",operator:le.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(zu,{search:o,onClick:l=>{var u;return(u=r(`/admin/members/${l.resource.id}`))==null?void 0:u.catch(console.error)},onChange:l=>i(l.definition),hideFilters:!0,hideToolbar:!0})}function BK(){return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Bots"}),s.jsx(oh,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(xe,{justify:"flex-end",children:s.jsx(xt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function UK(){return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Clients"}),s.jsx(oh,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(xe,{justify:"flex-end",children:s.jsx(xt,{to:"/admin/clients/new",children:"Create new client"})})]})}function ih(e){return s.jsx(Ta,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{ni(t)?e.onChange(rn(t)):e.onChange(void 0)}})}function WK(){const e=Te(),t=Ps(e),[n,r]=g.useState(""),[o,i]=g.useState(""),[l,u]=g.useState(),[d,p]=g.useState(),[h,m]=g.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Create new Bot"}),s.jsxs(mt,{onSubmit:()=>{const v={name:n,description:o,accessPolicy:l};e.post("admin/projects/"+t+"/bot",v).then(x=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),m(x),De({color:"green",message:"Bot created"})}).catch(x=>{De({color:"red",message:tt(x),autoClose:!1}),p(Gt(x))})},children:[!h&&s.jsxs(et,{children:[s.jsx(It,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(Ve,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>r(v.currentTarget.value),error:kt(d,"name")})}),s.jsx(It,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(Ve,{id:"description",name:"description",onChange:v=>i(v.currentTarget.value),error:kt(d,"description")})}),s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(ih,{name:"accessPolicy",onChange:u})}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Create Bot"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(Pe,{children:"Bot created"}),s.jsxs(lr,{children:[s.jsx(lr.Item,{children:s.jsx(xt,{to:h,children:"Go to new bot"})}),s.jsx(lr.Item,{children:s.jsx(xt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function HK(){const e=Te(),t=Ps(e),[n,r]=g.useState(""),[o,i]=g.useState(""),[l,u]=g.useState(""),[d,p]=g.useState(),[h,m]=g.useState(),[v,x]=g.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Create new Client"}),s.jsxs(mt,{onSubmit:()=>{const b={name:n,description:o,redirectUri:l,accessPolicy:d};e.post("admin/projects/"+t+"/client",b).then(w=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),x(w),De({color:"green",message:"Client created"})}).catch(w=>{De({color:"red",message:tt(w),autoClose:!1}),m(Gt(w))})},children:[!v&&s.jsxs(et,{children:[s.jsx(It,{title:"Name",htmlFor:"name",outcome:h,children:s.jsx(Ve,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:b=>r(b.currentTarget.value),error:kt(h,"name")})}),s.jsx(It,{title:"Description",htmlFor:"description",outcome:h,children:s.jsx(Ve,{id:"description",name:"description",onChange:b=>i(b.currentTarget.value),error:kt(h,"description")})}),s.jsx(It,{title:"Redirect URI",htmlFor:"redirectUri",outcome:h,children:s.jsx(Ve,{id:"redirectUri",name:"redirectUri",onChange:b=>u(b.currentTarget.value),error:kt(h,"redirectUri")})}),s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:h,children:s.jsx(ih,{name:"accessPolicy",onChange:p})}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Create Client"})})]}),v&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(Pe,{children:"Client created"}),s.jsxs(lr,{children:[s.jsx(lr.Item,{children:s.jsx(xt,{to:v,children:"Go to new client"})}),s.jsx(lr.Item,{children:s.jsx(xt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function qK(e){return s.jsx(Ta,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{ni(t)?e.onChange(rn(t)):e.onChange(void 0)}})}function GK(){const{membershipId:e}=$t(),t=Te(),n=Ps(t),r=Sn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,l]=g.useState(o.accessPolicy),[u,d]=g.useState(o.userConfiguration),[p,h]=g.useState(o.admin),[m,v]=g.useState(),[x,b]=g.useState(!1);function w(){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(j=>v(Gt(j)))}return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(El,{value:o.profile,link:!0})}),s.jsxs(mt,{onSubmit:()=>{const j={...o,accessPolicy:i,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,j).then(()=>b(!0)).catch(T=>v(Gt(T)))},children:[!x&&s.jsxs(et,{children:[s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:s.jsx(ih,{name:"accessPolicy",defaultValue:i,onChange:l})}),s.jsx(It,{title:"User Configuration",htmlFor:"userConfiguration",outcome:m,children:s.jsx(qK,{name:"userConfiguration",defaultValue:u,onChange:d})}),s.jsx(It,{title:"Admin",htmlFor:"admin",outcome:m,children:s.jsx(Kn,{id:"admin",name:"admin",defaultChecked:p,onChange:j=>h(j.currentTarget.checked)})}),s.jsxs(xe,{justify:"flex-end",mt:"xl",children:[s.jsx(Oe,{type:"submit",children:"Save"}),s.jsx(Oe,{type:"button",color:"red",variant:"outline",onClick:w,children:"Remove user"})]})]}),x&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(m,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(xt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function QK(){const e=Te(),[t,n]=g.useState(e.getProject()),[r,o]=g.useState(),[i,l]=g.useState(),[u,d]=g.useState(!1),[p,h]=g.useState(void 0),m=g.useCallback(v=>{const x={resourceType:v.resourceType,firstName:v.firstName,lastName:v.lastName,email:v.email,sendEmail:v.sendEmail==="on",accessPolicy:r,admin:v.isAdmin==="on"};e.invite(t==null?void 0:t.id,x).then(b=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Vp(b)?l(b):h(b),d(x.sendEmail??!1),De({color:"green",message:"Invite success"})}).catch(b=>{De({color:"red",message:tt(b),autoClose:!1}),l(Gt(b))})},[e,t,r]);return s.jsxs(mt,{onSubmit:m,children:[!p&&!i&&s.jsxs(et,{children:[s.jsx(Fe,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(It,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(Ta,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(Jt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:kt(i,"resourceType")}),s.jsx(Ve,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:kt(i,"firstName")}),s.jsx(Ve,{name:"lastName",label:"Last Name",required:!0,error:kt(i,"lastName")}),s.jsx(Ve,{name:"email",type:"email",label:"Email",required:!0,error:kt(i,"email")}),s.jsx(It,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(ih,{name:"accessPolicy",onChange:o})}),s.jsx(Kn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Kn,{name:"isAdmin",label:"Admin"}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Invite"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(xt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(Pe,{children:"User created"}),u&&s.jsx(Pe,{children:"Email sent"}),s.jsxs(lr,{children:[s.jsx(lr.Item,{children:s.jsx(xt,{to:p,children:"Go to new membership"})}),s.jsx(lr.Item,{children:s.jsx(xt,{to:p.profile,children:"Go to new profile"})}),s.jsx(lr.Item,{children:s.jsx(xt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function KK(){return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Patients"}),s.jsx(oh,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(xe,{justify:"flex-end",children:s.jsx(xt,{to:"/admin/invite",children:"Invite new patient"})})]})}function YK(){const e=Te();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(po,{outcome:vT});function t(n){e.post("admin/projects/setpassword",n).then(()=>De({color:"green",message:"Done"})).catch(r=>De({color:"red",message:tt(r),autoClose:!1}))}return s.jsxs(lt,{width:600,children:[s.jsx(Fe,{order:1,children:"Project Admin"}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Force Set Password"}),s.jsx(Pe,{children:"Sets the password for the specified user in this project."}),s.jsx(Pe,{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(et,{children:[s.jsx(Ve,{name:"email",label:"Email",required:!0}),s.jsx(Eo,{name:"password",label:"Password",required:!0}),s.jsx(Oe,{type:"submit",children:"Force Set Password"})]})})]})}function lC(){const e=Te(),t=Ps(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Details"}),s.jsxs(Wx,{children:[s.jsx(bi,{term:"ID",children:n.project.id}),s.jsx(bi,{term:"Name",children:n.project.name})]})]})}const cC=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function XK(){const e=Sn(),n=Pr().pathname.replace("/admin/","")||cC[0],r=Te(),o=Ps(r),i=g.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function l(u){var d;(d=e(`/admin/${u}`))==null||d.catch(console.error)}return s.jsxs(s.Fragment,{children:[s.jsxs(cr,{children:[s.jsx(ht,{children:s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Project"}),s.jsx(ht.Value,{children:i.project.name})]})}),s.jsx(co,{children:s.jsx(_t,{value:n.toLowerCase(),onChange:l,children:s.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:cC.map(u=>s.jsx(_t.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),s.jsx(lt,{children:s.jsx(y0,{})})]})}function JK(){const e=Te(),t=Ps(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=g.useState(!1),[i,l]=g.useState();return g.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),g.useEffect(()=>{n&&l(Vr(n.project.secret||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>De({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(Fe,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx($u,{property:Ea("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:l,outcome:void 0}),s.jsx(Oe,{type:"submit",children:"Save"})]})}function ZK(){const e=Te(),t=Ps(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=g.useState(!1),[i,l]=g.useState();return g.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),g.useEffect(()=>{n&&l(Vr(n.project.site||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>De({color:"green",message:"Saved"})).catch(d=>{var h,m,v,x;const p=Gt(d);De({color:"red",message:`Error ${(m=(h=p.issue)==null?void 0:h[0].details)==null?void 0:m.text} ${(x=(v=p.issue)==null?void 0:v[0].expression)==null?void 0:x[0]}`,autoClose:!1})})},children:[s.jsx(Fe,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx($u,{property:Ea("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:l,outcome:void 0}),s.jsx(Oe,{type:"submit",children:"Save"})]})}function eY(){const e=Te(),[t,{open:n,close:r}]=rp(!1),[o,i]=g.useState(""),[l,u]=g.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(po,{outcome:vT});function d(){gl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){gl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function h(){gl(e,"Rebuilding Value Sets","admin/super/valuesets")}function m(C){gl(e,"Reindexing Resources","admin/super/reindex",C)}function v(){gl(e,"Reload Cron Resources","admin/super/reloadcron")}function x(){gl(e,"Run Pending Data Migration","admin/super/migrate")}function b(C){e.post("admin/super/removebotidjobsfromqueue",C).then(()=>De({color:"green",message:"Done"})).catch(P=>De({color:"red",message:tt(P),autoClose:!1}))}function w(C){e.post("admin/super/purge",{...C,before:Qx(C.before)}).then(()=>De({color:"green",message:"Done"})).catch(P=>De({color:"red",message:tt(P),autoClose:!1}))}function j(C){e.post("admin/super/setpassword",C).then(()=>De({color:"green",message:"Done"})).catch(P=>De({color:"red",message:tt(P),autoClose:!1}))}function T(C){e.post("fhir/R4/$db-stats",C.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:C.tableNames}]}:void 0).then(P=>{var D,A;i("Database Stats"),u(s.jsx("pre",{children:(A=(D=P.parameter)==null?void 0:D.find(O=>O.name==="tableString"))==null?void 0:A.valueString})),n()}).catch(P=>De({color:"red",message:tt(P),autoClose:!1}))}function R(){e.post("fhir/R4/$db-invalid-indexes").then(C=>{var P;i("Database Invalid Indexes"),u(s.jsx("pre",{children:(P=C.parameter)==null?void 0:P.filter(D=>D.name==="invalidIndex").map(D=>D.valueString).join(`
|
|
561
|
+
`)})),n()}).catch(C=>De({color:"red",message:tt(C),autoClose:!1}))}function E(){e.post("fhir/R4/$db-schema-diff").then(C=>{var P,D;i("Schema Diff"),u(s.jsx("pre",{children:(D=(P=C.parameter)==null?void 0:P.find(A=>A.name==="migrationString"))==null?void 0:D.valueString})),n()}).catch(C=>De({color:"red",message:tt(C),autoClose:!1}))}return s.jsxs(lt,{width:600,children:[s.jsx(Fe,{order:1,children:"Super Admin"}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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(Oe,{onClick:d,children:"Rebuild StructureDefinitions"})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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(Oe,{onClick:p,children:"Rebuild SearchParameters"})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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(Oe,{onClick:h,children:"Rebuild ValueSets"})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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:x,children:s.jsx(et,{children:s.jsx(Oe,{type:"submit",children:"Start Migration"})})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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:m,children:s.jsxs(et,{children:[s.jsx(It,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(Ve,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(It,{title:"Search Filter",htmlFor:"filter",children:s.jsx(Ve,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(It,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:s.jsx(tY,{})}),s.jsx(Oe,{type:"submit",children:"Reindex"})]})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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:w,children:s.jsxs(et,{children:[s.jsx(It,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(Jt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(It,{title:"Purge Before",htmlFor:"before",children:s.jsx(Yo,{name:"before",placeholder:"Before Date"})}),s.jsx(Oe,{type:"submit",children:"Purge"})]})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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:b,children:s.jsxs(et,{children:[s.jsx(It,{title:"Bot ID",children:s.jsx(Ve,{name:"botId",placeholder:"Bot Id"})}),s.jsx(Oe,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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:j,children:s.jsxs(et,{children:[s.jsx(Ve,{name:"email",label:"Email",required:!0}),s.jsx(Eo,{name:"password",label:"Password",required:!0}),s.jsx(Ve,{name:"projectId",label:"Project ID"}),s.jsx(Oe,{type:"submit",children:"Force Set Password"})]})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(mt,{onSubmit:T,children:s.jsxs(et,{children:[s.jsx(It,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:s.jsx(Ve,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),s.jsx(Oe,{type:"submit",children:"Get Database Stats"})]})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Database Invalid Indexes"}),s.jsx("p",{children:"Query invalid indexes from the database."}),s.jsx(mt,{onSubmit:R,children:s.jsx(et,{children:s.jsx(Oe,{type:"submit",children:"Get Database Invalid Indexes"})})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Database Schema Drift"}),s.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),s.jsx(mt,{onSubmit:E,children:s.jsx(et,{children:s.jsx(Oe,{type:"submit",children:"Get Database Schema Drift"})})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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(et,{children:s.jsx(Oe,{type:"submit",children:"Reload Cron Resources"})})}),s.jsx(Nn,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:l})]})}function tY(){const[e,t]=g.useState("outdated");return s.jsxs(s.Fragment,{children:[s.jsx(Jt,{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(Dp,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function gl(e,t,n,r){Fr.show({id:n,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(()=>{Fr.update({id:n,color:"green",title:t,message:"Done",icon:s.jsx($i,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{Fr.update({id:n,color:"red",title:t,message:tt(i),icon:s.jsx(fa,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function nY(){return s.jsxs(s.Fragment,{children:[s.jsx(Fe,{children:"Users"}),s.jsx(oh,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(xe,{justify:"flex-end",children:s.jsx(xt,{to:"/admin/invite",children:"Invite new user"})})]})}function rY(){const[e]=Ml("ObservationDefinition","_count=100");return e?s.jsxs(Me,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Ko,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(Ko,{value:t.code})}),s.jsx("td",{children:s.jsx(Ko,{value:t.method})}),s.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),s.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),s.jsx("td",{children:s.jsx(kv,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(so,{})}function kv(e){const{ranges:t}=e;if(!t)return null;const n=uC(t.map(o=>o.gender));if(n.length>1)return su(n),s.jsx(s.Fragment,{children:n.map(o=>{var i;return s.jsxs(g.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Ln(o)})}),s.jsx(kv,{ranges:(i=e.ranges)==null?void 0:i.filter(l=>l.gender===o)})]},o)})});const r=uC(t.map(o=>o.age&&lu(o.age)));return r.length>1?(su(r),s.jsx(s.Fragment,{children:r.map(o=>{var i;return s.jsxs(g.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:Ln(o)})}),s.jsx(kv,{ranges:(i=e.ranges)==null?void 0:i.filter(l=>lu(l.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(Gx,{value:o.range})})]})})},`range-${o.condition}`))})}function uC(e){return[...new Set(e.filter(t=>!!t))]}function oY(){const[e]=Ml("ActivityDefinition","_count=100"),[t]=Ml("ObservationDefinition","_count=100");return!e||!t?s.jsx(so,{}):s.jsxs(Me,{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(Ko,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(Ko,{value:n.code})}),e.map(o=>{var i;return s.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(l=>{var u;return(u=l.reference)==null?void 0:u.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function iY(e){var l;const t=Te(),[n,r]=g.useState(),[o,i]=g.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(xt,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(xt,{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(i).catch(console.log)},children:s.jsxs(et,{children:[s.jsxs(Fe,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(Pe,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(Pe,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(l=e.planDefinition.action)==null?void 0:l.map((u,d)=>{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(Ko,{value:u.code[0]})]},`action-${d}`)})}),s.jsx(It,{title:"Subject",children:s.jsx(Lu,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"Go"})})]})})}function sY(){const{resourceType:e,id:t}=$t(),n=Vt({reference:e+"/"+t});return n?s.jsx(lt,{children:s.jsx(iY,{planDefinition:n})}):null}function aY(){const{resourceType:e,id:t}=$t(),n=Vt({reference:e+"/"+t}),[r,o]=Ml("Questionnaire","subject-type="+e),[i,l]=Ml("ClientApplication",{_count:1e3});if(!n||o||l)return s.jsx(so,{});const u=i==null?void 0:i.filter(h=>lY(e)&&!!h.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return s.jsxs(lt,{children:[s.jsx(Fe,{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 d,p;return n.resourceType==="Patient"?d=rn(n):n.resourceType==="Encounter"&&(d=n.subject,p=rn(n)),s.jsxs(lt,{children:[r==null?void 0:r.map(h=>s.jsxs("div",{children:[s.jsx(Fe,{order:3,children:s.jsx(xt,{to:`/forms/${h.id}?subject=${Dt(n)}`,children:h.title||h.name})}),s.jsx(Pe,{children:h.description})]},h.id)),u==null?void 0:u.map(h=>s.jsxs("div",{children:[s.jsx(Fe,{order:3,children:s.jsx(dq,{client:h,patient:d,encounter:p,children:h.name})}),s.jsx(Pe,{children:h.description})]},h.id))]})}function lY(e){return e==="Patient"||e==="Encounter"}function cY(){const{resourceType:e,id:t}=$t(),n=Sn(),[r,o]=g.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:le.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(lt,{children:s.jsx(zu,{search:r,onClick:i=>{var l;return(l=n(`/${i.resource.resourceType}/${i.resource.id}`))==null?void 0:l.catch(console.error)},onChange:i=>o(i.definition),hideFilters:!0})})}function uY(){const e=Te(),{resourceType:t,id:n}=$t(),r=e.readHistory(t,n).read();return s.jsx(lt,{children:s.jsx(eq,{history:r})})}const dY="_hl7Input_k5xm3_1",fY={hl7Input:dY};function pY(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 hY(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=>{Yc(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const mY=`{
|
|
562
|
+
"resourceType": "Patient",
|
|
563
|
+
"name": [
|
|
564
|
+
{
|
|
565
|
+
"given": [
|
|
566
|
+
"Alice"
|
|
567
|
+
],
|
|
568
|
+
"family": "Smith"
|
|
569
|
+
}
|
|
570
|
+
]
|
|
571
|
+
}`,gY="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 vY(){const e=Te(),{id:t}=$t(),[n,r]=g.useState(),[o,i]=g.useState(),[l,u]=g.useState(mY),[d,p]=g.useState(gY),[h,m]=g.useState(nn.FHIR_JSON),v=g.useRef(null),x=g.useRef(null),[b,w]=g.useState(!1);g.useEffect(()=>{e.readResource("Bot",t).then(async D=>{r(D),i(await yY(e,D))}).catch(D=>De({color:"red",message:tt(D),autoClose:!1}))},[e,t]);const j=g.useCallback(async()=>Yc(v.current,{command:"getValue"}),[]),T=g.useCallback(async()=>Yc(v.current,{command:"getOutput"}),[]),R=g.useCallback(async()=>h===nn.FHIR_JSON?JSON.parse(l):d,[h,l,d]),E=g.useCallback(async D=>{D.preventDefault(),D.stopPropagation(),w(!0);try{const A=await j(),O=await T(),L=await e.createAttachment({data:A,filename:"index.ts",contentType:"text/typescript"}),V=await e.createAttachment({data:O,filename:"index.js",contentType:"text/typescript"}),q=[{op:"add",path:"/sourceCode",value:L},{op:"add",path:"/executableCode",value:V}];await e.patchResource("Bot",t,q),De({color:"green",message:"Saved"})}catch(A){De({color:"red",message:tt(A),autoClose:!1})}finally{w(!1)}},[e,t,j,T]),C=g.useCallback(async D=>{D.preventDefault(),D.stopPropagation(),w(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),De({color:"green",message:"Deployed"})}catch(A){De({color:"red",message:tt(A),autoClose:!1})}finally{w(!1)}},[e,t]),P=g.useCallback(async D=>{D.preventDefault(),D.stopPropagation(),w(!0);try{const A=await R(),O=await e.post(e.fhirUrl("Bot",t,"$execute"),A,h);await Yc(x.current,{command:"setValue",value:O}),De({color:"green",message:"Success"})}catch(A){De({color:"red",message:tt(A),autoClose:!1})}finally{w(!1)}},[e,t,R,h]);return!n||o===void 0?null:s.jsxs($r,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx($r.Col,{span:8,children:s.jsxs(cr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(hY,{iframeRef:v,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(xe,{justify:"flex-end",gap:"xs",children:[s.jsx(Oe,{type:"button",onClick:E,loading:b,leftSection:s.jsx(Az,{size:"1rem"}),children:"Save"}),s.jsx(Oe,{type:"button",onClick:C,loading:b,leftSection:s.jsx(Ox,{size:"1rem"}),children:"Deploy"}),s.jsx(Oe,{type:"button",onClick:P,loading:b,leftSection:s.jsx(Gz,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs($r.Col,{span:4,children:[s.jsxs(cr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(Jt,{data:[{label:"FHIR",value:nn.FHIR_JSON},{label:"HL7",value:nn.HL7_V2}],onChange:D=>m(D.currentTarget.value)}),h===nn.FHIR_JSON?s.jsx(Hl,{value:l,onChange:D=>u(D),autosize:!0,minRows:15}):s.jsx("textarea",{className:fY.hl7Input,value:d,onChange:D=>p(D.currentTarget.value),rows:15})]}),s.jsx(cr,{m:2,p:"xs",shadow:"md",children:s.jsx(pY,{iframeRef:x,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function yY(e,t){var n,r,o;if((n=t.sourceCode)!=null&&n.url){const i=(o=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:o.find(AT);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function _a(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function xY(){const e=Te(),{resourceType:t,id:n}=$t(),r={reference:t+"/"+n},o=g.useCallback(i=>{e.updateResource(_a(i)).then(()=>{De({color:"green",message:"Success"})}).catch(l=>{De({color:"red",message:tt(l),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(lt,{children:s.jsx(TW,{value:r,onSubmit:o})});case"Questionnaire":return s.jsx(lt,{children:s.jsx(dH,{questionnaire:r,onSubmit:o})});default:return null}}function bY(){const{resourceType:e,id:t}=$t(),n=Vt({reference:e+"/"+t}),r=Sn();return n?s.jsx(lt,{children:s.jsx(MH,{value:n,onStart:(o,i)=>{var l;return(l=r(`/forms/${ca(i)}`))==null?void 0:l.catch(console.error)},onEdit:(o,i,l)=>{var u;return(u=r(`/${l.reference}}`))==null?void 0:u.catch(console.error)}})}):null}function wY(){const e=Te(),{resourceType:t,id:n}=$t(),r=Sn();return s.jsxs(lt,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(Oe,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>{var o;return(o=r(`/${t}`))==null?void 0:o.catch(console.error)}).catch(o=>De({color:"red",message:tt(o),autoClose:!1}))},children:"Delete"})]})}const SY="_selectProfileBtn_tbaz6_1",jY="_chevron_tbaz6_13",dC={selectProfileBtn:SY,chevron:jY};function CY(){var d,p;const{resourceType:e,id:t}=$t(),n=Vt({reference:e+"/"+t}),[r,o]=g.useState(),i=bu({onDropdownClose:()=>i.resetSelectedOption()}),l=g.useMemo(()=>{var h;if(bn((h=n==null?void 0:n.meta)==null?void 0:h.profile))return[s.jsx(ut.Option,{value:"",children:"None"},""),...n.meta.profile.map(m=>s.jsx(ut.Option,{value:m,children:m},m))]},[(d=n==null?void 0:n.meta)==null?void 0:d.profile]);if(g.useEffect(()=>{var h,m;((m=(h=n==null?void 0:n.meta)==null?void 0:h.profile)==null?void 0:m.length)===1&&o(n.meta.profile[0])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return bn(l)&&(u=s.jsx(xe,{justify:"flex-end",children:s.jsxs(et,{align:"flex-end",gap:"xs",children:[s.jsxs(ut,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:h=>{o(h),i.closeDropdown()},children:[s.jsx(ut.Target,{children:s.jsx(Qn,{onClick:()=>i.toggleDropdown(),children:s.jsxs(Dy,{fw:"bold",fs:"sm",className:dC.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(Nx,{stroke:1.5,className:dC.chevron})]})})}),s.jsx(ut.Dropdown,{w:"max-content",children:s.jsx(ut.Options,{children:l})})]}),s.jsx(se,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(Pe,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(Pe,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(Pe,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(lt,{children:s.jsxs(et,{gap:"xl",children:[u,s.jsx(t0,{value:n,profileUrl:r})]})})}function EY(){const e=Te(),{resourceType:t,id:n}=$t(),[r,o]=g.useState(),[i,l]=g.useState(),u=Sn(),[d,p]=g.useState();g.useEffect(()=>{e.readResource(t,n).then(x=>{o(Vr(x)),l(Vr(x))}).catch(x=>{p(Gt(x)),De({color:"red",message:tt(x),autoClose:!1})})},[e,t,n]);const h=g.useCallback(x=>{p(void 0),e.updateResource(_a(x)).then(()=>{var b;(b=u(`/${t}/${n}/details`))==null||b.catch(console.error),De({id:"succes",color:"green",message:"Success"})}).catch(b=>{p(Gt(b)),De({color:"red",message:tt(b),autoClose:!1})})},[e,t,n,u]),m=g.useCallback(x=>{p(void 0);const b=KP.createPatch(r,x);e.patchResource(t,n,b).then(()=>{var w;(w=u(`/${t}/${n}/details`))==null||w.catch(console.error),De({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(Gt(w)),De({color:"red",message:tt(w),autoClose:!1})})},[e,t,n,r,u]),v=g.useCallback(()=>{var x;return(x=u(`/${t}/${n}/delete`))==null?void 0:x.catch(console.error)},[u,t,n]);return i?s.jsx(lt,{children:s.jsx(Gf,{defaultValue:i,onSubmit:h,onPatch:m,onDelete:v,outcome:d})}):null}function kY(){const{resourceType:e,id:t}=$t(),n=Vt({reference:e+"/"+t});return n?s.jsx(lt,{maw:700,children:n.resourceType==="Patient"?s.jsx(wW,{patient:n}):s.jsx(Ni,{icon:s.jsx(ka,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function l2({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=Te(),[i,l]=g.useState();return g.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{l(u.filter(WV))}).catch(console.error)},[o,n,r]),s.jsx(_t,{value:t==null?void 0:t.url,onChange:u=>{const d=i==null?void 0:i.find(p=>p.url===u);d&&n(d)},children:s.jsx(_t.List,{children:i==null?void 0:i.map(u=>{var h,m;const d=(m=(h=e.meta)==null?void 0:h.profile)==null?void 0:m.includes(u.url),p=d?"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(_t.Tab,{value:u.url,title:p,rightSection:d&&s.jsx(fx,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(a8,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function c2(e,t){const n=Te(),r=Sn();return{defaultValue:{resourceType:e},handleSubmit:l=>{t&&t(void 0),n.createResource(l).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Gt(u)),De({color:"red",message:tt(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Ng(){const{resourceType:e}=$t(),t=Pr(),[n,r]=g.useState(),{defaultValue:o,handleSubmit:i}=c2(e,r),[l,u]=g.useState(),d=t.pathname.toLowerCase().endsWith("profiles"),p=g.useCallback(h=>{const m=_a(h);l&&$T(m,l.url),i(m)},[l,i]);return d?s.jsx(lt,{children:s.jsxs(et,{children:[s.jsx(l2,{resource:o,currentProfile:l,onChange:u}),l?s.jsx(Gf,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:l.url},l.url):s.jsx(Pe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(lt,{children:s.jsx(Gf,{defaultValue:o,onSubmit:i,outcome:n})})}function TY(){const e=Te(),{resourceType:t,id:n}=$t(),r=e.readHistory(t,n).read();return s.jsx(lt,{children:s.jsx(aq,{history:r})})}function PY(){const{resourceType:e}=$t(),[t,n]=g.useState(),{defaultValue:r,handleSubmit:o}=c2(e,n),i=g.useCallback(l=>{o(JSON.parse(l["new-resource"]))},[o]);return s.jsxs(lt,{children:[t&&s.jsx(po,{outcome:t}),s.jsxs(mt,{onSubmit:i,children:[s.jsx(Hl,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Po(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"OK"})})]})]})}function RY(){const e=Te(),{resourceType:t,id:n}=$t(),r=Vt({reference:t+"/"+n}),o=Sn(),[i,l]=g.useState(),u=g.useCallback(d=>{e.updateResource(_a(JSON.parse(d.resource))).then(()=>{var p;l(void 0),(p=o(`/${t}/${n}/details`))==null||p.catch(console.error),De({color:"green",message:"Success"})}).catch(p=>{De({color:"red",message:tt(p),autoClose:!1})})},[e,t,n,o]);return r?s.jsxs(lt,{children:[i&&s.jsx(po,{outcome:i}),s.jsxs(mt,{onSubmit:u,children:[s.jsx(Hl,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Po(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(Oe,{type:"submit",children:"OK"})})]})]}):null}function _Y(){const{resourceType:e,id:t}=$t();return Vt({reference:e+"/"+t})?s.jsxs(lt,{children:[s.jsxs(Ni,{icon:s.jsx(ka,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Et,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(bR,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function DY(){const e=Te(),{resourceType:t,id:n}=$t(),[r,o]=g.useState(),[i,l]=g.useState();return g.useEffect(()=>{e.readResource(t,n).then(u=>o(Vr(u))).catch(u=>{De({color:"red",message:tt(u)})})},[e,t,n]),r?s.jsxs(lt,{children:[s.jsxs(Fe,{order:2,children:["Available ",t," profiles"]}),s.jsx(et,{children:s.jsxs(s.Fragment,{children:[s.jsx(l2,{resource:r,currentProfile:i,onChange:l}),i?s.jsx(IY,{profile:i,resource:r,onResourceUpdated:u=>o(u)},i.url):s.jsx(Pe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const IY=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Te(),[o,i]=g.useState(),[l,u]=g.useState(()=>{var p,h;return(h=(p=t.meta)==null?void 0:p.profile)==null?void 0:h.includes(e.url)}),d=g.useCallback(p=>{i(void 0);const h=_a(p);l?$T(h,e.url):z7(h,e.url),r.updateResource(h).then(m=>{n(m),De({color:"green",message:"Success"})}).catch(m=>{i(Gt(m)),De({color:"red",message:tt(m),autoClose:!1})})},[r,e.url,n,l]);return s.jsxs(et,{children:[s.jsx(ku,{size:"md",checked:l,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),l?s.jsx(Gf,{profileUrl:e.url,defaultValue:t,onSubmit:d,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),d(t)},children:s.jsx(xe,{justify:"flex-end",mt:"xl",children:s.jsx(Oe,{type:"submit",children:"OK"})})})]})},u2={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},AY=Object.keys(u2);function NY(){const e=Te(),{id:t}=$t(),n=Vt({reference:`Questionnaire/${t}`}),[r,o]=g.useState(),[i,l]=g.useState("create"),[u,d]=g.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(m=>OY(m,n));function h(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Dt(n)}`:Dt(n)}`,channel:{type:"rest-hook",endpoint:Dt(r)},...i?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:i}]}:void 0}).then(()=>{o(void 0),d(Date.now()),e.invalidateSearches("Subscription"),De({color:"green",message:"Success"})}).catch(m=>De({color:"red",message:tt(m),autoClose:!1}))}return s.jsxs(lt,{children:[s.jsx(Fe,{children:"Bots"}),s.jsxs(et,{children:[p.length===0&&s.jsx("p",{children:"No bots found."}),p.map(m=>{var v;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Zl,{value:{reference:(v=m.channel)==null?void 0:v.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",m.criteria]})]},m.id)})]}),s.jsx(yn,{}),s.jsxs(et,{mt:10,children:[s.jsx(gu,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),s.jsxs(xe,{children:[s.jsx(Ta,{name:"bot",resourceType:"Bot",onChange:m=>o(m)}),s.jsx(Oe,{onClick:h,children:"Connect"})]}),s.jsx(xe,{children:s.jsx(Jt,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:AY,onChange:m=>l(u2[m.target.value])})})]}),s.jsx("div",{style:{display:"none"},children:u})]})}function OY(e,t){var o;if(!t)return!1;const n=e.criteria||"",r=((o=e.channel)==null?void 0:o.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Dt(t))||(t.url?n.includes(t.url):!1))}function MY(){const{id:e}=$t(),t=Sn(),r=Te().readReference({reference:`Questionnaire/${e}`}).read(),[o,i]=g.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:le.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return s.jsx(lt,{children:s.jsx(zu,{search:o,onClick:l=>{var u;return(u=t(`/${l.resource.resourceType}/${l.resource.id}`))==null?void 0:u.catch(console.error)},onChange:l=>i(l.definition),hideFilters:!0,hideToolbar:!0})})}function LY(){const e=Te(),{resourceType:t,id:n}=$t(),r=Vt({reference:t+"/"+n}),o=g.useCallback(i=>{e.updateResource(_a(i)).then(()=>{De({color:"green",message:"Success"})}).catch(l=>{De({color:"red",message:tt(l),autoClose:!1})})},[e]);return r?s.jsx(lt,{children:s.jsx(PH,{onSubmit:o,definition:r})}):null}function $Y(){const{resourceType:e,id:t}=$t(),n=Vt({reference:e+"/"+t});return n?s.jsx(lt,{children:e==="MeasureReport"?s.jsx(xW,{measureReport:n}):s.jsx(e0,{value:n})}):null}const FY="_container_1ue98_1",zY="_entry_1ue98_14",VY="_active_1ue98_21",Og={container:FY,entry:zY,active:VY};function BY(e){const t=Te(),n=Vt(e.value),[r,o]=g.useState();return g.useEffect(()=>{if(!n)return;const i=E0(n);if(!i)return;const l="reference"in i?i.reference:Dt(i);t.search("ServiceRequest","subject="+l).then(u=>{const p=(u.entry??[]).map(h=>h.resource);YP(p),p.reverse(),o(p)}).catch(u=>De({color:"red",message:tt(u),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:Og.container,children:r.map(i=>{var l,u,d,p,h,m,v;return s.jsxs("div",{className:At(Og.entry,{[Og.active]:i.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(xt,{to:i,children:UY(i)})}),((u=(l=i.category)==null?void 0:l[0])==null?void 0:u.text)&&s.jsx("p",{children:(d=i.category[0])==null?void 0:d.text}),((m=(h=(p=i.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&s.jsx("p",{children:(v=i.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:WY(i)})]},i.id)})}):null}function UY(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function WY(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const HY="_container_1l2dh_1",qY={container:HY};function GY(e){var o,i,l,u;const t=Vt(e.valueSet);if(!t)return null;const n=[""],r=(u=(l=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:l.concept)==null?void 0:u.map(d=>d.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:qY.container,children:s.jsx(Jt,{defaultValue:e.defaultValue,onChange:d=>e.onChange(d.currentTarget.value),data:n})})}function QY(e){var n,r;const t=Vt(e.specimen);return t?s.jsxs(ht,{children:[s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Type"}),s.jsx(ht.Value,{children:"Specimen"})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Collected"}),s.jsx(ht.Value,{children:ur((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Specimen Age"}),s.jsx(ht.Value,{children:KY(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(ht.Entry,{children:[s.jsx(ht.Key,{children:"Specimen Stability"}),s.jsx(ht.Value,{children:YY(t)})]}):s.jsx(s.Fragment,{})]}):null}function KY(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return d2(f2(n,new Date))}function YY(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return d2(f2(t,n))}function d2(e){return e.toString().padStart(3,"0")+"D"}function f2(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function XY(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 JY(){var R,E,C,P,D,A,O;const e=Te(),{resourceType:t,id:n}=$t(),r={reference:t+"/"+n},o=Sn(),[i,l]=g.useState(),u=Vt(r,l),d=XY(t),[p,h]=g.useState(()=>{const L=window.location.pathname.split("/").pop();return L&&d.map(V=>V.toLowerCase()).includes(L)?L:d[0].toLowerCase()});async function m(){var q,G;const V=(G=(q=(await e.readHistory(t,n)).entry)==null?void 0:q.find(Q=>!!Q.resource))==null?void 0:G.resource;V?v(V):De({color:"red",message:"No history to restore",autoClose:!1})}function v(L){e.updateResource(_a(L)).then(()=>{l(void 0),De({color:"green",message:"Success"})}).catch(V=>{De({color:"red",message:tt(V),autoClose:!1})})}if(i)return Q5(i)?s.jsxs(lt,{children:[s.jsx(Fe,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(Oe,{color:"red",onClick:m,children:"Restore"})]}):s.jsx(po,{outcome:i});function x(L){var V;L||(L=d[0].toLowerCase()),h(L),(V=o(`/${t}/${n}/${L}`))==null||V.catch(console.error)}function b(L){const V=u,q=V.orderDetail||[];q.length===0&&q.push({}),q[0].text!==L&&(q[0].text=L,v({...V,orderDetail:q}))}const w=u&&E0(u),j=u&&SK(u),T=(C=(E=(R=e.getUserConfiguration())==null?void 0:R.option)==null?void 0:E.find(L=>L.id==="statusValueSet"))==null?void 0:C.valueString;return s.jsxs(s.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&T&&s.jsx(GY,{valueSet:{reference:T},defaultValue:(D=(P=u.orderDetail)==null?void 0:P[0])==null?void 0:D.text,onChange:b},Dt(u)+"-"+((O=(A=u.orderDetail)==null?void 0:A[0])==null?void 0:O.text)),u&&s.jsx(BY,{value:u}),u&&s.jsxs(cr,{children:[w&&s.jsx(oR,{patient:w}),j&&s.jsx(QY,{specimen:j}),t!=="Patient"&&s.jsx(o2,{resource:r}),s.jsx(co,{children:s.jsx(_t,{value:p.toLowerCase(),onChange:x,children:s.jsx(_t.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:d.map(L=>s.jsx(_t.Tab,{value:L.toLowerCase(),children:L},L))})})})]}),s.jsx(y0,{})]})}function fC(){var T,R,E,C;const e=Sn(),{resourceType:t,id:n,versionId:r,tab:o}=$t(),i=Te(),[l,u]=g.useState(!0),[d,p]=g.useState(),[h,m]=g.useState();if(g.useEffect(()=>{m(void 0),u(!0),i.readHistory(t,n).then(P=>p(P)).then(()=>u(!1)).catch(P=>{m(P),u(!1)})},[i,t,n]),l)return s.jsx(so,{});if(!d)return s.jsxs(lt,{children:[s.jsx(Fe,{children:"Resource not found"}),s.jsx(xt,{to:`/${t}`,children:"Return to search page"})]});const v=d.entry??[],x=v.findIndex(P=>{var D,A;return((A=(D=P.resource)==null?void 0:D.meta)==null?void 0:A.versionId)===r});if(x===-1)return s.jsxs(lt,{children:[s.jsx(Fe,{children:"Version not found"}),s.jsx(xt,{to:`/${t}/${n}`,children:"Return to resource"})]});const b=v[x].resource,w=x<v.length-1?v[x+1].resource:void 0,j="diff";return s.jsxs(_t,{value:o||j,onChange:P=>{var D;return(D=e(`/${t}/${n}/_history/${r}/${P||j}`))==null?void 0:D.catch(console.error)},children:[s.jsxs(cr,{children:[s.jsx(Ou,{fluid:!0,p:"md",children:s.jsx(Pe,{children:`${t} ${n}`})}),s.jsxs(_t.List,{children:[s.jsx(_t.Tab,{value:"diff",children:"Diff"}),s.jsx(_t.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(lt,{children:[h&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(h,void 0,2)}),s.jsx(_t.Panel,{value:"diff",children:w?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(T=b.meta)==null?void 0:T.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(xt,{to:`/${t}/${n}/_history/${(R=w.meta)==null?void 0:R.versionId}`,children:(E=w.meta)==null?void 0:E.versionId})]})]}),s.jsx(rq,{original:w,revised:b})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(C=b.meta)==null?void 0:C.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(b,void 0,2)})]})}),s.jsx(_t.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(b,void 0,2)})})]})]})}function ZY(){const{resourceType:e,id:t}=$t(),n=Sn(),[r,o]=g.useState({resourceType:"Subscription",filters:[{code:"url",operator:le.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(lt,{children:s.jsx(rW,{search:r,onClick:i=>{var l;return(l=n(`/${i.resource.resourceType}/${i.resource.id}`))==null?void 0:l.catch(console.error)},onChange:i=>o(i.definition),hideFilters:!0})})}function eX(e){const t=Te(),{resource:n,opened:r,onClose:o}=e,[i,l]=g.useState(!1),[u,d]=g.useState(),[p,h]=g.useState(!1),m=g.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:i&&u?Dt(u):void 0,verbose:p}),De({color:"green",message:"Done"}),o()}catch(v){De({color:"red",message:tt(v),autoClose:!1})}},[t,n,o,i,u,p]);return s.jsx(Nn,{opened:r,onClose:o,title:"Resend Subscriptions",children:s.jsx(mt,{onSubmit:m,children:s.jsxs(et,{children:[s.jsx(Kn,{label:"Choose subscription (all subscriptions by default)",onChange:v=>l(v.currentTarget.checked)}),i&&s.jsx(Ta,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:d}),s.jsx(Kn,{label:"Verbose mode",onChange:v=>h(v.currentTarget.checked)}),s.jsx(xe,{justify:"flex-end",children:s.jsx(Oe,{type:"submit",children:"Resend"})})]})})})}function pC(){const e=Te(),t=Kp(),{resourceType:n,id:r}=$t(),o={reference:n+"/"+r},[i,l]=g.useState(),u=rp(!1);function d(R,E){return e.updateResource({...R,priority:E})}function p(R,E){d(R,"stat").then(E).catch(console.error)}function h(R,E){d(R,"routine").then(E).catch(console.error)}function m(R){t(`/${R.resourceType}/${R.id}`)}function v(R){t(`/${R.resourceType}/${R.id}/edit`)}function x(R){t(`/${R.resourceType}/${R.id}/delete`)}function b(R){l(R),u[1].open()}function w(R){var E;t(`/${R.resourceType}/${R.id}/_history/${(E=R.meta)==null?void 0:E.versionId}`)}function j(R,E){const C="aws-textract";De({id:C,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(R.resourceType,R.id,"$aws-textract"),{}).then(()=>{E(),Zs({id:C,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:s.jsx($i,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(P=>Zs({id:C,title:"AWS Textract Error",color:"red",message:tt(P),icon:s.jsx(fa,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(R){var B;const{primaryResource:E,currentResource:C,reloadTimeline:P}=R,D=C.resourceType===E.resourceType&&C.id===E.id,A=C.resourceType==="Communication"&&C.priority!=="stat",O=C.resourceType==="Communication"&&C.priority==="stat",L=D,V=!D,q=!D,G=!D,Q=(B=e.getProjectMembership())==null?void 0:B.admin,Y=Q,X=NK()&&(C.resourceType==="DocumentReference"||C.resourceType==="Media");return s.jsxs(ve.Dropdown,{children:[s.jsx(ve.Label,{children:"Resource"}),A&&s.jsx(ve.Item,{leftSection:s.jsx(Hz,{size:14}),onClick:()=>p(C,P),"aria-label":`Pin ${Dt(C)}`,children:"Pin"}),O&&s.jsx(ve.Item,{leftSection:s.jsx(qz,{size:14}),onClick:()=>h(C,P),"aria-label":`Unpin ${Dt(C)}`,children:"Unpin"}),V&&s.jsx(ve.Item,{leftSection:s.jsx(XS,{size:14}),onClick:()=>m(C),"aria-label":`Details ${Dt(C)}`,children:"Details"}),L&&s.jsx(ve.Item,{leftSection:s.jsx(XS,{size:14}),onClick:()=>w(C),"aria-label":`Details ${Dt(C)}`,children:"Details"}),q&&s.jsx(ve.Item,{leftSection:s.jsx(pP,{size:14}),onClick:()=>v(C),"aria-label":`Edit ${Dt(C)}`,children:"Edit"}),Q&&s.jsxs(s.Fragment,{children:[s.jsx(ve.Divider,{}),s.jsx(ve.Label,{children:"Admin"}),Y&&s.jsx(ve.Item,{leftSection:s.jsx(Xz,{size:14}),onClick:()=>b(C),"aria-label":`Resend Subscriptions ${Dt(C)}`,children:"Resend Subscriptions"})]}),X&&s.jsxs(s.Fragment,{children:[s.jsx(ve.Divider,{}),s.jsx(ve.Label,{children:"AWS AI"}),s.jsx(ve.Item,{leftSection:s.jsx(i8,{size:14}),onClick:()=>j(C,P),"aria-label":`AWS Textract ${Dt(C)}`,children:"AWS Textract"})]}),G&&s.jsxs(s.Fragment,{children:[s.jsx(ve.Divider,{}),s.jsx(ve.Label,{children:"Danger zone"}),s.jsx(ve.Item,{color:"red",leftSection:s.jsx($x,{size:14}),onClick:()=>x(C),"aria-label":`Delete ${Dt(C)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(fU,{encounter:o,getMenu:T}),n==="Patient"&&s.jsx(CW,{patient:o,getMenu:T}),n==="ServiceRequest"&&s.jsx(uq,{serviceRequest:o,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(dU,{resource:o,getMenu:T}),s.jsx(eX,{resource:i,opened:u[0],onClose:u[1].close},`resend-subscriptions-${i==null?void 0:i.id}`)]})}function tX(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:i,handleUpgrade:l}=e,[u,d]=g.useState();return g.useEffect(()=>{t&&(u||iz("app-tools-page").then(d).catch(console.error),i())},[t,u,i]),u&&r&&!o?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(Oe,{onClick:()=>{l(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):s.jsx(so,{})}function nX(){const e=Te(),{id:t}=$t(),n=g.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=g.useState(!1),[i,l]=g.useState(!1),[u,d]=g.useState(!1),[p,h]=g.useState(),[m,v]=g.useState(),[x,b]=g.useState(),[w,j]=g.useState(),[T,R]=g.useState(!1),[E,C]=g.useState(!1),[P,{open:D,close:A}]=rp(!1);g.useEffect(()=>{if(r||i||u||T){C(!0);return}C(!1)},[r,i,u,T]);const O=g.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(Y=>{var X,B,M,N,F,I;h((B=(X=Y.parameter)==null?void 0:X.find(z=>z.name==="status"))==null?void 0:B.valueCode),v((N=(M=Y.parameter)==null?void 0:M.find(z=>z.name==="version"))==null?void 0:N.valueString),b((I=(F=Y.parameter)==null?void 0:F.find(z=>z.name==="lastUpdated"))==null?void 0:I.valueInstant)}).catch(Y=>Q(tt(Y))).finally(()=>o(!1))},[e,t]),L=g.useCallback(Y=>{const X=Y.host,B=Y.pingCount||1;X&&(R(!0),e.pushToAgent(n,X,`PING ${B}`,nn.PING,!0).then(M=>j(M)).catch(M=>Q(tt(M))).finally(()=>R(!1)))},[e,n]),V=g.useCallback(()=>{l(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(Y=>{G("Agent config reloaded successfully.")}).catch(Y=>Q(tt(Y))).finally(()=>l(!1))},[e,t]),q=g.useCallback(()=>{d(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(Y=>{G("Agent upgraded successfully.")}).catch(Y=>Q(tt(Y))).finally(()=>d(!1))},[e,t]);function G(Y){De({color:"green",title:"Success",icon:s.jsx($i,{size:"1rem"}),message:Y})}function Q(Y){De({color:"red",title:"Error",message:Y,autoClose:!1})}return s.jsxs(lt,{children:[s.jsx(Nn,{opened:P,onClose:A,title:"Upgrade Agent",centered:!0,children:s.jsx(tX,{opened:P,close:A,version:m,loadingStatus:r,handleStatus:O,handleUpgrade:q})}),s.jsx(Fe,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Zl,{value:n,link:!0})]}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Agent Status"}),s.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),s.jsx(Oe,{onClick:O,loading:r,disabled:E&&!r,children:"Get Status"}),!r&&p&&s.jsx(Me,{children:s.jsxs(Me.Tbody,{children:[s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:"Status"}),s.jsx(Me.Td,{children:s.jsx(Zx,{status:p})})]}),s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:"Version"}),s.jsx(Me.Td,{children:m})]}),s.jsxs(Me.Tr,{children:[s.jsx(Me.Td,{children:"Last Updated"}),s.jsx(Me.Td,{children:ur(x,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(Oe,{onClick:V,loading:i,disabled:E&&!i,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(Oe,{onClick:D,loading:u,disabled:E&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(yn,{my:"lg"}),s.jsx(Fe,{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:L,children:s.jsxs(xe,{children:[s.jsx(Ve,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(En,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:T,disabled:E&&!T,children:s.jsx(Zz,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Dp,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!T&&w&&s.jsxs(s.Fragment,{children:[s.jsx(Fe,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:w})]})]})}function rX(){return s.jsx(zG,{children:s.jsxs(Qe,{errorElement:s.jsx(wK,{}),children:[s.jsx(Qe,{path:"/signin",element:s.jsx(zK,{})}),s.jsx(Qe,{path:"/oauth",element:s.jsx(OK,{})}),s.jsx(Qe,{path:"/resetpassword",element:s.jsx(LK,{})}),s.jsx(Qe,{path:"/setpassword/:id/:secret",element:s.jsx(FK,{})}),s.jsx(Qe,{path:"/register",element:s.jsx(MK,{})}),s.jsx(Qe,{path:"/changepassword",element:s.jsx(yK,{})}),s.jsx(Qe,{path:"/security",element:s.jsx($K,{})}),s.jsx(Qe,{path:"/mfa",element:s.jsx(AK,{})}),s.jsx(Qe,{path:"/batch",element:s.jsx(gK,{})}),s.jsx(Qe,{path:"/bulk/:resourceType",element:s.jsx(vK,{})}),s.jsx(Qe,{path:"/smart",element:s.jsx(VK,{})}),s.jsx(Qe,{path:"/forms/:id",element:s.jsx(jK,{})}),s.jsx(Qe,{path:"/admin/super",element:s.jsx(eY,{})}),s.jsx(Qe,{path:"/admin/config",element:s.jsx(YK,{})}),s.jsxs(Qe,{path:"/admin",element:s.jsx(XK,{}),children:[s.jsx(Qe,{path:"patients",element:s.jsx(KK,{})}),s.jsx(Qe,{path:"bots/new",element:s.jsx(WK,{})}),s.jsx(Qe,{path:"bots",element:s.jsx(BK,{})}),s.jsx(Qe,{path:"clients/new",element:s.jsx(HK,{})}),s.jsx(Qe,{path:"clients",element:s.jsx(UK,{})}),s.jsx(Qe,{path:"details",element:s.jsx(lC,{})}),s.jsx(Qe,{path:"invite",element:s.jsx(QK,{})}),s.jsx(Qe,{path:"users",element:s.jsx(nY,{})}),s.jsx(Qe,{path:"project",element:s.jsx(lC,{})}),s.jsx(Qe,{path:"secrets",element:s.jsx(JK,{})}),s.jsx(Qe,{path:"sites",element:s.jsx(ZK,{})}),s.jsx(Qe,{path:"members/:membershipId",element:s.jsx(GK,{})})]}),s.jsx(Qe,{path:"/lab/assays",element:s.jsx(rY,{})}),s.jsx(Qe,{path:"/lab/panels",element:s.jsx(oY,{})}),s.jsx(Qe,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(fC,{})}),s.jsx(Qe,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(fC,{})}),s.jsxs(Qe,{path:"/:resourceType/new",element:s.jsx(bK,{}),children:[s.jsx(Qe,{index:!0,element:s.jsx(Ng,{})}),s.jsx(Qe,{path:"form",element:s.jsx(Ng,{})}),s.jsx(Qe,{path:"json",element:s.jsx(PY,{})}),s.jsx(Qe,{path:"profiles",element:s.jsx(Ng,{})})]}),s.jsxs(Qe,{path:"/:resourceType/:id",element:s.jsx(JY,{}),children:[s.jsx(Qe,{index:!0,element:s.jsx(pC,{})}),s.jsx(Qe,{path:"apply",element:s.jsx(sY,{})}),s.jsx(Qe,{path:"apps",element:s.jsx(aY,{})}),s.jsx(Qe,{path:"event",element:s.jsx(cY,{})}),s.jsx(Qe,{path:"blame",element:s.jsx(uY,{})}),s.jsx(Qe,{path:"bots",element:s.jsx(NY,{})}),s.jsx(Qe,{path:"builder",element:s.jsx(xY,{})}),s.jsx(Qe,{path:"checklist",element:s.jsx(bY,{})}),s.jsx(Qe,{path:"delete",element:s.jsx(wY,{})}),s.jsx(Qe,{path:"details",element:s.jsx(CY,{})}),s.jsx(Qe,{path:"edit",element:s.jsx(EY,{})}),s.jsx(Qe,{path:"editor",element:s.jsx(vY,{})}),s.jsx(Qe,{path:"history",element:s.jsx(TY,{})}),s.jsx(Qe,{path:"json",element:s.jsx(RY,{})}),s.jsx(Qe,{path:"preview",element:s.jsx(_Y,{})}),s.jsx(Qe,{path:"responses",element:s.jsx(MY,{})}),s.jsx(Qe,{path:"report",element:s.jsx($Y,{})}),s.jsx(Qe,{path:"ranges",element:s.jsx(LY,{})}),s.jsx(Qe,{path:"subscriptions",element:s.jsx(ZY,{})}),s.jsx(Qe,{path:"timeline",element:s.jsx(pC,{})}),s.jsx(Qe,{path:"tools",element:s.jsx(nX,{})}),s.jsx(Qe,{path:"profiles",element:s.jsx(DY,{})}),s.jsx(Qe,{path:"export",element:s.jsx(kY,{})})]}),s.jsx(Qe,{path:"/:resourceType",element:s.jsx(aC,{})}),s.jsx(Qe,{path:"/",element:s.jsx(aC,{})})]})})}function oX(){const e=Te(),t=e.getUserConfiguration(),n=Pr(),[r]=w0();return e.isLoading()?s.jsx(so,{}):s.jsx(Z8,{logo:s.jsx(Do,{size:24}),pathname:n.pathname,searchParams:r,version:nP,menus:iX(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(g.Suspense,{fallback:s.jsx(so,{}),children:s.jsx(rX,{})})})}function iX(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var o;return{title:r.title,links:((o=r.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:sX(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(zz,{})}]}),t}const hC={Patient:n8,Practitioner:$z,Organization:Pz,ServiceRequest:Kz,DiagnosticReport:Jz,Questionnaire:Lz,admin:Ez,AccessPolicy:Fz,Subscription:s8,batch:Wz,Observation:Uz};function sX(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in hC){const n=hC[t];return s.jsx(n,{})}}catch{}return s.jsx(Fp,{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 aX(){const e=Hu(),t=new rP({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=uQ([{path:"*",element:s.jsx(oX,{})}]),o=l=>r.navigate(l);pq.createRoot(document.getElementById("root")).render(s.jsx(g.StrictMode,{children:s.jsx(sz,{medplum:t,navigate:o,children:s.jsxs(FC,{theme:n,children:[s.jsx(Li,{position:"bottom-right"}),s.jsx(MG,{router:r})]})})}))}aX().catch(console.error);
|
|
572
|
+
//# sourceMappingURL=index-B8-TyGj_.js.map
|