@medplum/app 4.3.9 → 4.3.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,589 @@
1
+ function y4(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}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 i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function mx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Tv={exports:{}},ku={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var zj;function x4(){if(zj)return ku;zj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,i,s){var c=null;if(s!==void 0&&(c=""+s),i.key!==void 0&&(c=""+i.key),"key"in i){s={};for(var d in i)d!=="key"&&(s[d]=i[d])}else s=i;return i=s.ref,{$$typeof:e,type:r,key:c,ref:i!==void 0?i:null,props:s}}return ku.Fragment=t,ku.jsx=n,ku.jsxs=n,ku}var Uj;function b4(){return Uj||(Uj=1,Tv.exports=x4()),Tv.exports}var a=b4(),ei=function(){return ei=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},ei.apply(this,arguments)};function iR(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function S4(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var Rv={exports:{}},vt={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Bj;function w4(){if(Bj)return vt;Bj=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function x(O){return O===null||typeof O!="object"?null:(O=g&&O[g]||O["@@iterator"],typeof O=="function"?O:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,j={};function C(O,F,te){this.props=O,this.context=F,this.refs=j,this.updater=te||b}C.prototype.isReactComponent={},C.prototype.setState=function(O,F){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,F,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=C.prototype;function R(O,F,te){this.props=O,this.context=F,this.refs=j,this.updater=te||b}var T=R.prototype=new E;T.constructor=R,w(T,C.prototype),T.isPureReactComponent=!0;var _=Array.isArray,P={H:null,A:null,T:null,S:null,V:null},A=Object.prototype.hasOwnProperty;function M(O,F,te,ae,je,xe){return te=xe.ref,{$$typeof:e,type:O,key:F,ref:te!==void 0?te:null,props:xe}}function I(O,F){return M(O.type,F,void 0,void 0,void 0,O.props)}function V(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function H(O){var F={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(te){return F[te]})}var Z=/\/+/g;function K(O,F){return typeof O=="object"&&O!==null&&O.key!=null?H(""+O.key):F.toString(36)}function Q(){}function B(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(Q,Q):(O.status="pending",O.then(function(F){O.status==="pending"&&(O.status="fulfilled",O.value=F)},function(F){O.status==="pending"&&(O.status="rejected",O.reason=F)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function W(O,F,te,ae,je){var xe=typeof O;(xe==="undefined"||xe==="boolean")&&(O=null);var we=!1;if(O===null)we=!0;else switch(xe){case"bigint":case"string":case"number":we=!0;break;case"object":switch(O.$$typeof){case e:case t:we=!0;break;case m:return we=O._init,W(we(O._payload),F,te,ae,je)}}if(we)return je=je(O),we=ae===""?"."+K(O,0):ae,_(je)?(te="",we!=null&&(te=we.replace(Z,"$&/")+"/"),W(je,F,te,"",function(ot){return ot})):je!=null&&(V(je)&&(je=I(je,te+(je.key==null||O&&O.key===je.key?"":(""+je.key).replace(Z,"$&/")+"/")+we)),F.push(je)),1;we=0;var Ge=ae===""?".":ae+":";if(_(O))for(var Ee=0;Ee<O.length;Ee++)ae=O[Ee],xe=Ge+K(ae,Ee),we+=W(ae,F,te,xe,je);else if(Ee=x(O),typeof Ee=="function")for(O=Ee.call(O),Ee=0;!(ae=O.next()).done;)ae=ae.value,xe=Ge+K(ae,Ee++),we+=W(ae,F,te,xe,je);else if(xe==="object"){if(typeof O.then=="function")return W(B(O),F,te,ae,je);throw F=String(O),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return we}function N(O,F,te){if(O==null)return O;var ae=[],je=0;return W(O,ae,"","",function(xe){return F.call(te,xe,je++)}),ae}function L(O){if(O._status===-1){var F=O._result;F=F(),F.then(function(te){(O._status===0||O._status===-1)&&(O._status=1,O._result=te)},function(te){(O._status===0||O._status===-1)&&(O._status=2,O._result=te)}),O._status===-1&&(O._status=0,O._result=F)}if(O._status===1)return O._result.default;throw O._result}var $=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)};function q(){}return vt.Children={map:N,forEach:function(O,F,te){N(O,function(){F.apply(this,arguments)},te)},count:function(O){var F=0;return N(O,function(){F++}),F},toArray:function(O){return N(O,function(F){return F})||[]},only:function(O){if(!V(O))throw Error("React.Children.only expected to receive a single React element child.");return O}},vt.Component=C,vt.Fragment=n,vt.Profiler=i,vt.PureComponent=R,vt.StrictMode=r,vt.Suspense=f,vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=P,vt.__COMPILER_RUNTIME={__proto__:null,c:function(O){return P.H.useMemoCache(O)}},vt.cache=function(O){return function(){return O.apply(null,arguments)}},vt.cloneElement=function(O,F,te){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ae=w({},O.props),je=O.key,xe=void 0;if(F!=null)for(we in F.ref!==void 0&&(xe=void 0),F.key!==void 0&&(je=""+F.key),F)!A.call(F,we)||we==="key"||we==="__self"||we==="__source"||we==="ref"&&F.ref===void 0||(ae[we]=F[we]);var we=arguments.length-2;if(we===1)ae.children=te;else if(1<we){for(var Ge=Array(we),Ee=0;Ee<we;Ee++)Ge[Ee]=arguments[Ee+2];ae.children=Ge}return M(O.type,je,void 0,void 0,xe,ae)},vt.createContext=function(O){return O={$$typeof:c,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:s,_context:O},O},vt.createElement=function(O,F,te){var ae,je={},xe=null;if(F!=null)for(ae in F.key!==void 0&&(xe=""+F.key),F)A.call(F,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(je[ae]=F[ae]);var we=arguments.length-2;if(we===1)je.children=te;else if(1<we){for(var Ge=Array(we),Ee=0;Ee<we;Ee++)Ge[Ee]=arguments[Ee+2];je.children=Ge}if(O&&O.defaultProps)for(ae in we=O.defaultProps,we)je[ae]===void 0&&(je[ae]=we[ae]);return M(O,xe,void 0,void 0,null,je)},vt.createRef=function(){return{current:null}},vt.forwardRef=function(O){return{$$typeof:d,render:O}},vt.isValidElement=V,vt.lazy=function(O){return{$$typeof:m,_payload:{_status:-1,_result:O},_init:L}},vt.memo=function(O,F){return{$$typeof:p,type:O,compare:F===void 0?null:F}},vt.startTransition=function(O){var F=P.T,te={};P.T=te;try{var ae=O(),je=P.S;je!==null&&je(te,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(q,$)}catch(xe){$(xe)}finally{P.T=F}},vt.unstable_useCacheRefresh=function(){return P.H.useCacheRefresh()},vt.use=function(O){return P.H.use(O)},vt.useActionState=function(O,F,te){return P.H.useActionState(O,F,te)},vt.useCallback=function(O,F){return P.H.useCallback(O,F)},vt.useContext=function(O){return P.H.useContext(O)},vt.useDebugValue=function(){},vt.useDeferredValue=function(O,F){return P.H.useDeferredValue(O,F)},vt.useEffect=function(O,F,te){var ae=P.H;if(typeof te=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ae.useEffect(O,F)},vt.useId=function(){return P.H.useId()},vt.useImperativeHandle=function(O,F,te){return P.H.useImperativeHandle(O,F,te)},vt.useInsertionEffect=function(O,F){return P.H.useInsertionEffect(O,F)},vt.useLayoutEffect=function(O,F){return P.H.useLayoutEffect(O,F)},vt.useMemo=function(O,F){return P.H.useMemo(O,F)},vt.useOptimistic=function(O,F){return P.H.useOptimistic(O,F)},vt.useReducer=function(O,F,te){return P.H.useReducer(O,F,te)},vt.useRef=function(O){return P.H.useRef(O)},vt.useState=function(O){return P.H.useState(O)},vt.useSyncExternalStore=function(O,F,te){return P.H.useSyncExternalStore(O,F,te)},vt.useTransition=function(){return P.H.useTransition()},vt.version="19.1.1",vt}var Vj;function gx(){return Vj||(Vj=1,Rv.exports=w4()),Rv.exports}var v=gx();const jn=mx(v),j4=y4({__proto__:null,default:jn},[v]);var vh="right-scroll-bar-position",yh="width-before-scroll-bar",C4="with-scroll-bars-hidden",E4="--removed-body-scroll-bar-size";function _v(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function T4(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var R4=typeof window<"u"?v.useLayoutEffect:v.useEffect,Fj=new WeakMap;function _4(e,t){var n=T4(null,function(r){return e.forEach(function(i){return _v(i,r)})});return R4(function(){var r=Fj.get(n);if(r){var i=new Set(r),s=new Set(e),c=n.current;i.forEach(function(d){s.has(d)||_v(d,null)}),s.forEach(function(d){i.has(d)||_v(d,c)})}Fj.set(n,e)},[e]),n}function D4(e){return e}function A4(e,t){t===void 0&&(t=D4);var n=[],r=!1,i={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(s){var c=t(s,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(s){for(r=!0;n.length;){var c=n;n=[],c.forEach(s)}n={push:function(d){return s(d)},filter:function(){return n}}},assignMedium:function(s){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(s),c=n}var f=function(){var m=c;c=[],m.forEach(s)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return i}function P4(e){e===void 0&&(e={});var t=A4(null);return t.options=ei({async:!0,ssr:!1},e),t}var aR=function(e){var t=e.sideCar,n=iR(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 v.createElement(r,ei({},n))};aR.isSideCarExport=!0;function k4(e,t){return e.useMedium(t),aR}var sR=P4(),Dv=function(){},up=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Dv,onWheelCapture:Dv,onTouchMoveCapture:Dv}),i=r[0],s=r[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,x=e.sideCar,b=e.noRelative,w=e.noIsolation,j=e.inert,C=e.allowPinchZoom,E=e.as,R=E===void 0?"div":E,T=e.gapMode,_=iR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,A=_4([n,t]),M=ei(ei({},_),i);return v.createElement(v.Fragment,null,m&&v.createElement(P,{sideCar:sR,removeScrollBar:p,shards:g,noRelative:b,noIsolation:w,inert:j,setCallbacks:s,allowPinchZoom:!!C,lockRef:n,gapMode:T}),c?v.cloneElement(v.Children.only(d),ei(ei({},M),{ref:A})):v.createElement(R,ei({},M,{className:f,ref:A}),d))});up.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};up.classNames={fullWidth:yh,zeroRight:vh};var N4=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function O4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=N4();return t&&e.setAttribute("nonce",t),e}function M4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function I4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var L4=function(){var e=0,t=null;return{add:function(n){e==0&&(t=O4())&&(M4(t,n),I4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$4=function(){var e=L4();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},lR=function(){var e=$4(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},z4={left:0,top:0,right:0,gap:0},Av=function(e){return parseInt(e||"",10)||0},U4=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[Av(n),Av(r),Av(i)]},B4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return z4;var t=U4(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])}},V4=lR(),ac="data-scroll-locked",F4=function(e,t,n,r){var i=e.left,s=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
18
+ .`.concat(C4,` {
19
+ overflow: hidden `).concat(r,`;
20
+ padding-right: `).concat(d,"px ").concat(r,`;
21
+ }
22
+ body[`).concat(ac,`] {
23
+ overflow: hidden `).concat(r,`;
24
+ overscroll-behavior: contain;
25
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
+ padding-left: `.concat(i,`px;
27
+ padding-top: `).concat(s,`px;
28
+ padding-right: `).concat(c,`px;
29
+ margin-left:0;
30
+ margin-top:0;
31
+ margin-right: `).concat(d,"px ").concat(r,`;
32
+ `),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
33
+ }
34
+
35
+ .`).concat(vh,` {
36
+ right: `).concat(d,"px ").concat(r,`;
37
+ }
38
+
39
+ .`).concat(yh,` {
40
+ margin-right: `).concat(d,"px ").concat(r,`;
41
+ }
42
+
43
+ .`).concat(vh," .").concat(vh,` {
44
+ right: 0 `).concat(r,`;
45
+ }
46
+
47
+ .`).concat(yh," .").concat(yh,` {
48
+ margin-right: 0 `).concat(r,`;
49
+ }
50
+
51
+ body[`).concat(ac,`] {
52
+ `).concat(E4,": ").concat(d,`px;
53
+ }
54
+ `)},Hj=function(){var e=parseInt(document.body.getAttribute(ac)||"0",10);return isFinite(e)?e:0},H4=function(){v.useEffect(function(){return document.body.setAttribute(ac,(Hj()+1).toString()),function(){var e=Hj()-1;e<=0?document.body.removeAttribute(ac):document.body.setAttribute(ac,e.toString())}},[])},q4=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;H4();var s=v.useMemo(function(){return B4(i)},[i]);return v.createElement(V4,{styles:F4(s,!t,i,n?"":"!important")})},jy=!1;if(typeof window<"u")try{var Jf=Object.defineProperty({},"passive",{get:function(){return jy=!0,!0}});window.addEventListener("test",Jf,Jf),window.removeEventListener("test",Jf,Jf)}catch{jy=!1}var Gl=jy?{passive:!1}:!1,G4=function(e){return e.tagName==="TEXTAREA"},cR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!G4(e)&&n[t]==="visible")},W4=function(e){return cR(e,"overflowY")},Q4=function(e){return cR(e,"overflowX")},qj=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=uR(e,r);if(i){var s=dR(e,r),c=s[1],d=s[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Y4=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},K4=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},uR=function(e,t){return e==="v"?W4(t):Q4(t)},dR=function(e,t){return e==="v"?Y4(t):K4(t)},X4=function(e,t){return e==="h"&&t==="rtl"?-1:1},Z4=function(e,t,n,r,i){var s=X4(e,window.getComputedStyle(t).direction),c=s*r,d=n.target,f=t.contains(d),p=!1,m=c>0,g=0,x=0;do{if(!d)break;var b=dR(e,d),w=b[0],j=b[1],C=b[2],E=j-C-s*w;(w||E)&&uR(e,d)&&(g+=E,x+=w);var R=d.parentNode;d=R&&R.nodeType===Node.DOCUMENT_FRAGMENT_NODE?R.host:R}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(m&&Math.abs(g)<1||!m&&Math.abs(x)<1)&&(p=!0),p},eh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Gj=function(e){return[e.deltaX,e.deltaY]},Wj=function(e){return e&&"current"in e?e.current:e},J4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},e3=function(e){return`
55
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
56
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
+ `)},t3=0,Wl=[];function n3(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(t3++)[0],s=v.useState(lR)[0],c=v.useRef(e);v.useEffect(function(){c.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var j=S4([e.lockRef.current],(e.shards||[]).map(Wj),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var d=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var E=eh(j),R=n.current,T="deltaX"in j?j.deltaX:R[0]-E[0],_="deltaY"in j?j.deltaY:R[1]-E[1],P,A=j.target,M=Math.abs(T)>Math.abs(_)?"h":"v";if("touches"in j&&M==="h"&&A.type==="range")return!1;var I=qj(M,A);if(!I)return!0;if(I?P=M:(P=M==="v"?"h":"v",I=qj(M,A)),!I)return!1;if(!r.current&&"changedTouches"in j&&(T||_)&&(r.current=P),!P)return!0;var V=r.current||P;return Z4(V,C,j,V==="h"?T:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!Wl.length||Wl[Wl.length-1]!==s)){var E="deltaY"in C?Gj(C):eh(C),R=t.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&J4(P.delta,E)})[0];if(R&&R.should){C.cancelable&&C.preventDefault();return}if(!R){var T=(c.current.shards||[]).map(Wj).filter(Boolean).filter(function(P){return P.contains(C.target)}),_=T.length>0?d(C,T[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,E,R){var T={name:j,delta:C,target:E,should:R,shadowParent:r3(E)};t.current.push(T),setTimeout(function(){t.current=t.current.filter(function(_){return _!==T})},1)},[]),m=v.useCallback(function(j){n.current=eh(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,Gj(j),j.target,d(j,e.lockRef.current))},[]),x=v.useCallback(function(j){p(j.type,eh(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return Wl.push(s),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,Gl),document.addEventListener("touchmove",f,Gl),document.addEventListener("touchstart",m,Gl),function(){Wl=Wl.filter(function(j){return j!==s}),document.removeEventListener("wheel",f,Gl),document.removeEventListener("touchmove",f,Gl),document.removeEventListener("touchstart",m,Gl)}},[]);var b=e.removeScrollBar,w=e.inert;return v.createElement(v.Fragment,null,w?v.createElement(s,{styles:e3(i)}):null,b?v.createElement(q4,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function r3(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const o3=k4(sR,n3);var fc=v.forwardRef(function(e,t){return v.createElement(up,ei({},e,{ref:t,sideCar:o3}))});fc.classNames=up.classNames;function on(e){return Object.keys(e)}function Pv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function vx(e,t){const n={...e},r=t;return Pv(e)&&Pv(t)&&Object.keys(t).forEach(i=>{Pv(r[i])&&i in e?n[i]=vx(n[i],r[i]):n[i]=r[i]}),n}function i3(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function a3(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function Wu(e){const t=a3(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 kv(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function fR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?kv(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");if(r.includes(e))return t?kv(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const s=`${Number(i)/16}${e}`;return t?kv(s):s}}return r}return n}const le=fR("rem",{shouldScale:!0}),Ah=fR("em");function Qa(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function hR(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 Wi(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function gr(e){const t=v.createContext(null);return[({children:i,value:s})=>a.jsx(t.Provider,{value:s,children:i}),()=>{const i=v.useContext(t);if(i===null)throw new Error(e);return i}]}function Qi(e=null){const t=v.createContext(e);return[({children:i,value:s})=>a.jsx(t.Provider,{value:s,children:i}),()=>v.useContext(t)]}function Qj(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Ph(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function s3(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 l3(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 c3(e,t,n){return Ph(e,n)===Ph(t,n)}function pR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from(Ph(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(w=>c3(d.currentTarget,w,e)),p=f.findIndex(w=>d.currentTarget===w),m=l3(p,f,r),g=s3(p,f,r),x=s==="rtl"?g:m,b=s==="rtl"?m:g;switch(d.key){case"ArrowRight":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[x].focus(),i&&f[x].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[b].focus(),i&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),i&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),i&&f[m].click());break}case"Home":{d.stopPropagation(),d.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{d.stopPropagation(),d.preventDefault();const w=f.length-1;!f[w].disabled&&f[w].focus();break}}}}const u3={app:100,modal:200,popover:300,overlay:400,max:9999};function Yr(e){return u3[e]}const kh=()=>{};function d3(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||kh:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function nt(e,t="size",n=!0){if(e!==void 0)return hR(e)?n?le(e):e:`var(--${t}-${e})`}function kn(e){return nt(e,"mantine-spacing")}function Ut(e){return e===void 0?"var(--mantine-radius-default)":nt(e,"mantine-radius")}function Nn(e){return nt(e,"mantine-font-size")}function mR(e){return nt(e,"mantine-line-height",!1)}function yx(e){if(e)return nt(e,"mantine-shadow",!1)}function Tr(e,t){return n=>{e?.(n),t?.(n)}}function xx(e,t){return e in t?Wu(t[e]):Wu(e)}function Qu(e,t){const n=e.map(r=>({value:r,px:xx(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function Po(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function f3(e,t,n){return n?Array.from(Ph(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function h3(){const[e,t]=v.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function xh(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 Nh(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function p3(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(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 i=0;i<r;i+=1){const s=n[i];if(!(s in t)||e[s]!==t[s]&&!(Number.isNaN(e[s])&&Number.isNaN(t[s])))return!1}return!0}function Yj(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ts(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function dp(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,i=Ts(e),s=v.useRef(0),c=v.useRef(()=>{}),d=Object.assign(v.useCallback((...f)=>{window.clearTimeout(s.current);const p=()=>{s.current!==0&&(s.current=0,i(...f))};c.current=p,d.flush=p,s.current=window.setTimeout(p,n)},[i,n]),{flush:c.current});return v.useEffect(()=>()=>{window.clearTimeout(s.current),r&&d.flush()},[d,r]),d}const Kj=["mousedown","touchstart"];function m3(e,t,n){const r=v.useRef(null);return v.useEffect(()=>{const i=s=>{const{target:c}=s??{};if(Array.isArray(n)){const d=c?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(c)&&c.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!d&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||Kj).forEach(s=>document.addEventListener(s,i)),()=>{(t||Kj).forEach(s=>document.removeEventListener(s,i))}},[r,e,n]),r}function gR({timeout:e=2e3}={}){const[t,n]=v.useState(null),[r,i]=v.useState(!1),[s,c]=v.useState(null),d=m=>{window.clearTimeout(s),c(window.setTimeout(()=>i(!1),e)),i(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>d(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function g3(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function v3(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function vR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=v.useState(n?t:v3(e)),s=v.useRef(null);return v.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),i(s.current.matches),g3(s.current,c=>i(c.matches))},[e]),r}function y3(e,t){return vR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Cc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function Vi(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function yR({opened:e,shouldReturnFocus:t=!0}){const n=v.useRef(null),r=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return Vi(()=>{let i=-1;const s=c=>{c.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[e,t]),r}const x3=/input|select|textarea|button|object/,xR="a, input, select, textarea, button, object, [tabindex]";function b3(e){return e.style.display==="none"}function S3(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(b3(n))return!1;n=n.parentNode}return!0}function bR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Cy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(bR(e));return(x3.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&S3(e)}function SR(e){const t=bR(e);return(Number.isNaN(t)||t>=0)&&Cy(e)}function w3(e){return Array.from(e.querySelectorAll(xR)).filter(SR)}function j3(e,t){const n=w3(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],i=e.getRootNode();let s=r===i.activeElement||e===i.activeElement;const c=i.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(s=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!s)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function C3(e=!0){const t=v.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const c=Array.from(i.querySelectorAll(xR));s=c.find(SR)||c.find(Cy)||null,!s&&Cy(i)&&(s=i)}s&&s.focus({preventScroll:!0})},r=v.useCallback(i=>{e&&i!==null&&t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=s=>{s.key==="Tab"&&t.current&&j3(t.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),r}const E3=e=>(e+1)%1e6;function T3(){const[,e]=v.useReducer(E3,0);return e}const R3=jn.useId||(()=>{});function _3(){const e=R3();return e?`mantine-${e.replace(/:/g,"")}`:""}function vr(e){const t=_3(),[n,r]=v.useState(t);return Cc(()=>{r(Nh())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function wR(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Yu(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function D3(...e){const t=new Map;return n=>{if(e.forEach(r=>{const i=Yu(r,n);i&&t.set(r,i)}),t.size>0)return()=>{e.forEach(r=>{const i=t.get(r);i?i():Yu(r,null)}),t.clear()}}}function Bn(...e){return v.useCallback(D3(...e),e)}function Kn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,s]=v.useState(t!==void 0?t:n),c=(d,...f)=>{s(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[i,c,!1]}function ka(e,t){const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)}const th="dots";function A3({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i=1,onChange:s}){const c=Math.max(Math.trunc(e),0),[d,f]=Kn({value:r,onChange:s,defaultValue:i,finalValue:i}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(d+1),g=()=>p(d-1),x=()=>p(1),b=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return ka(1,c);const C=Math.max(d-t,n),E=Math.min(d+t,c-n),R=C>n+2,T=E<c-(n+1);if(!R&&T){const _=t*2+n+2;return[...ka(1,_),th,...ka(c-(n-1),c)]}if(R&&!T){const _=n+1+2*t;return[...ka(1,n),th,...ka(c-_,c)]}return[...ka(1,n),th,...ka(C,E),th,...ka(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:x,last:b}}function bx(e,t){return vR("(prefers-reduced-motion: reduce)",e,t)}function P3(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(!p3(e[n],t[n]))return!1;return!0}function k3(e){const t=v.useRef([]),n=v.useRef(0);return P3(t.current,e)||(t.current=e,n.current+=1),[n.current]}function N3(e,t){v.useEffect(e,k3(t))}function fp(e=!1,t){const{onOpen:n,onClose:r}={},[i,s]=v.useState(e),c=v.useCallback(()=>{s(p=>p||(n?.(),!0))},[n]),d=v.useCallback(()=>{s(p=>p&&(r?.(),!1))},[r]),f=v.useCallback(()=>{i?d():c()},[d,c,i]);return[i,{open:c,close:d,toggle:f}]}function O3(e,t,n={autoInvoke:!1}){const r=v.useRef(null),i=v.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),s=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&i(),s),[s,i]),{start:i,clear:s}}function M3(e,t,n){const r=v.useRef(null),i=v.useRef(null);return v.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||i.current)&&(r.current=new MutationObserver(e),r.current.observe(s||i.current,t)),()=>{r.current?.disconnect()}},[e,t]),i}function I3(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var L3={};function jR(){return typeof process<"u"&&L3?"production":"development"}function hp(e){const t=jn.version;return typeof jn.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function CR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=CR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function It(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=CR(e))&&(r&&(r+=" "),r+=t);return r}const $3={};function z3(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=It(t[r],i):t[r]=i})}),t}function pp({theme:e,classNames:t,props:n,stylesCtx:r}){const s=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||$3);return z3(s)}function Oh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((s,c)=>typeof c=="function"?{...s,...c(e,n,r)}:{...s,...c},{})}const Sx=v.createContext(null);function Yi(){const e=v.useContext(Sx);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function U3(){return Yi().cssVariablesResolver}function B3(){return Yi().classNamesPrefix}function mp(){return Yi().getStyleNonce}function V3(){return Yi().withStaticClasses}function F3(){return Yi().headless}function H3(){return Yi().stylesTransform?.sx}function q3(){return Yi().stylesTransform?.styles}function ER(){return Yi().env||"default"}function G3(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function W3(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:c}}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function Q3(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function Y3(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),i=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,d=(1-Math.abs(2*s-1))*i,f=r/60,p=d*(1-Math.abs(f%2-1)),m=s-d/2;let g,x,b;return f>=0&&f<1?(g=d,x=p,b=0):f>=1&&f<2?(g=p,x=d,b=0):f>=2&&f<3?(g=0,x=d,b=p):f>=3&&f<4?(g=0,x=p,b=d):f>=4&&f<5?(g=p,x=0,b=d):(g=d,x=0,b=p),{r:Math.round((g+m)*255),g:Math.round((x+m)*255),b:Math.round((b+m)*255),a:c||1}}function wx(e){return G3(e)?W3(e):e.startsWith("rgb")?Q3(e):e.startsWith("hsl")?Y3(e):{r:0,g:0,b:0,a:1}}function nh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:s}=wx(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(i)}, ${s})`}function Ku(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Nv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function K3(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function X3(e){if(e.startsWith("oklch("))return(K3(e)||0)/100;const{r:t,g:n,b:r}=wx(e),i=t/255,s=n/255,c=r/255,d=Nv(i),f=Nv(s),p=Nv(c);return .2126*d+.7152*f+.0722*p}function Nu(e,t=.179){return e.startsWith("var(")?!1:X3(e)>t}function go({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:Nu(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:Nu(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:Nu(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),s=i?Number(i):void 0,c=r in t.colors;if(c){const d=s!==void 0?t.colors[r][s]:t.colors[r][Ku(t,n||"light")];return{color:r,value:d,shade:s,isThemeColor:c,isLight:Nu(d,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Nu(e,t.luminanceThreshold),shade:s,variable:void 0}}function Ft(e,t){const n=go({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Ey(e,t){const n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=Ft(n.from,t),i=Ft(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function uo(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=wx(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const Ql=uo,Z3=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const s=go({color:e,theme:t}),c=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const d=c&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:d,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:d,border:`${le(1)} solid transparent`}:{background:e,hover:nh(e,.1),color:d,border:`${le(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:uo(d,.1),hover:uo(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:uo(e,.1),hover:uo(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:uo(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:uo(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const d=t.colors[s.color][s.shade];return{background:"transparent",hover:uo(d,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:uo(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:nh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:nh(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:nh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:Ey(r,t),hover:Ey(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},J3={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"]},Xj="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",jx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:J3,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:Z3,autoContrast:!1,luminanceThreshold:.3,fontFamily:Xj,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:Xj,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function Zj(e){return e==="auto"||e==="dark"||e==="light"}function eO({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 Zj(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&&Zj(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const tO="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",Jj="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Ov(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function eC(e){if(!(e.primaryColor in e.colors))throw new Error(tO);if(typeof e.primaryShade=="object"&&(!Ov(e.primaryShade.dark)||!Ov(e.primaryShade.light)))throw new Error(Jj);if(typeof e.primaryShade=="number"&&!Ov(e.primaryShade))throw new Error(Jj)}function nO(e,t){if(!t)return eC(e),e;const n=vx(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),eC(n),n}const Cx=v.createContext(null),rO=()=>v.useContext(Cx)||jx;function yn(){const e=v.useContext(Cx);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 TR({theme:e,children:t,inherit:n=!0}){const r=rO(),i=v.useMemo(()=>nO(n?r:jx,e),[e,r,n]);return a.jsx(Cx.Provider,{value:i,children:t})}TR.displayName="@mantine/core/MantineThemeProvider";function oO(){const e=yn(),t=mp(),n=on(e.breakpoints).reduce((r,i)=>{const s=e.breakpoints[i].includes("px"),c=Wu(e.breakpoints[i]),d=s?`${c-.1}px`:Ah(c-.1),f=s?`${c}px`:Ah(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Mv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Ou(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function iO(e,t){const n=Mv(e.variables),r=n?Ou(t,n):"",i=Mv(e.dark),s=Mv(e.light),c=i?Ou(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",d=s?Ou(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${c}${d}`}function Ki({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&go({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function tC(e,t){return Ki({color:e.colors[e.primaryColor][Ku(e,t)],theme:e,autoContrast:null})}function rh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const d=Ku(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${d===9?8:d+1})`,[`--mantine-color-${r}-light`]:Ql(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:Ql(e.colors[t][d],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline-hover`]:Ql(e.colors[t][d],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const s=Ku(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:Ql(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:Ql(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:Ql(e.colors[t][Math.max(s-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function aO(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Yl(e,t,n){on(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const RR=e=>{const t=Ku(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-primary-color-contrast":tC(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":tC(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)"}};Yl(r.variables,e.breakpoints,"breakpoint"),Yl(r.variables,e.spacing,"spacing"),Yl(r.variables,e.fontSizes,"font-size"),Yl(r.variables,e.lineHeights,"line-height"),Yl(r.variables,e.shadows,"shadow"),Yl(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),on(e.colors).forEach(s=>{const c=e.colors[s];if(aO(c)){Object.assign(r.light,rh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,rh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((d,f)=>{r.variables[`--mantine-color-${s}-${f}`]=d}),Object.assign(r.light,rh({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,rh({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return on(i).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=i[s].fontSize,r.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||e.headings.fontWeight}),r};function sO({theme:e,generator:t}){const n=RR(e),r=t?.(e);return r?vx(n,r):n}const Iv=RR(jx);function lO(e){const t={variables:{},light:{},dark:{}};return on(e.variables).forEach(n=>{Iv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),on(e.light).forEach(n=>{Iv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),on(e.dark).forEach(n=>{Iv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function cO(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 _R({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=yn(),r=mp(),i=U3(),s=sO({theme:n,generator:i}),c=e===":root"&&t,d=c?lO(s):s,f=iO(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":cO(e)}`}}):null}_R.displayName="@mantine/CssVariables";function uO(){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 Kl(e,t){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,r=e!=="auto"?e:n?"dark":"light";t()?.setAttribute("data-mantine-color-scheme",r)}function dO({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=v.useRef(null),[s,c]=v.useState(()=>e.get(t)),d=r||s,f=v.useCallback(m=>{r||(Kl(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),Kl(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Cc(()=>{Kl(e.get(t),n)},[]),v.useEffect(()=>{if(r)return Kl(r,n),()=>{};r===void 0&&Kl(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{s==="auto"&&Kl(g.matches?"dark":"light",n)};return i.current?.addEventListener("change",m),()=>i.current?.removeEventListener("change",m)},[s,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function fO({respectReducedMotion:e,getRootElement:t}){Cc(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}uO();function DR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=eO(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:b,stylesTransform:w,env:j}){const{colorScheme:C,setColorScheme:E,clearColorScheme:R}=dO({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return fO({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(Sx.Provider,{value:{colorScheme:C,setColorScheme:E,clearColorScheme:R,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:x,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:w,env:j},children:a.jsxs(TR,{theme:e,children:[c&&a.jsx(_R,{cssVariablesSelector:d,deduplicateCssVariables:s}),i&&a.jsx(oO,{}),t]})})}DR.displayName="@mantine/core/MantineProvider";function Xs({classNames:e,styles:t,props:n,stylesCtx:r}){const i=yn();return{resolvedClassNames:pp({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Oh({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}const hO={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function pO({theme:e,options:t,unstyled:n}){return It(t?.focusable&&!n&&(e.focusClassName||hO[e.focusRing]),t?.active&&!n&&e.activeClassName)}function mO({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return pp({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function nC({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return pp({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function gO({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function vO({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function yO({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function xO({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(s=>pp({theme:t,classNames:t.components[s]?.classNames,props:r,stylesCtx:i})?.[n])}function bO({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function SO({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:s,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:x,headless:b,transformedStyles:w}){return It(pO({theme:e,options:t,unstyled:d||b}),xO({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),bO({options:t,classes:c,selector:r,unstyled:d}),nC({selector:r,stylesCtx:g,theme:e,classNames:s,props:m}),nC({selector:r,stylesCtx:g,theme:e,classNames:w,props:m}),mO({selector:r,stylesCtx:g,options:t,props:m,theme:e}),gO({rootSelector:p,selector:r,className:f}),vO({selector:r,classes:c,unstyled:d||b}),x&&!b&&yO({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function wO({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(s=>Oh({theme:e,styles:e.components[s]?.styles,props:n,stylesCtx:r})[i]).reduce((s,c)=>({...s,...c}),{})}function Ty({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Ty({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function jO(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Qa(n[r])}}),t),{})}function CO({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:s,themeName:c,headless:d}){return jO([d?{}:t?.(n,r,i),...c.map(f=>n.components?.[f]?.vars?.(n,r,i)),e?.(n,r,i)])?.[s]}function EO({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:s,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:x}){return{...!x&&wO({theme:e,themeName:t,props:i,stylesCtx:s,selector:n}),...!x&&Oh({theme:e,styles:d,props:i,stylesCtx:s})[n],...!x&&Oh({theme:e,styles:r?.styles,props:r?.props||i,stylesCtx:s})[n],...CO({theme:e,props:i,stylesCtx:s,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?Ty({style:f,theme:e}):null,...Ty({style:r?.style,theme:e})}}function TO({props:e,stylesCtx:t,themeName:n}){const r=yn(),i=q3()?.();return{getTransformedStyles:c=>i?[...c.map(f=>i(f,{props:e,theme:r,ctx:t})),...n.map(f=>i(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function Me({name:e,classes:t,props:n,stylesCtx:r,className:i,style:s,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g}){const x=yn(),b=B3(),w=V3(),j=F3(),C=(Array.isArray(e)?e:[e]).filter(T=>T),{withStylesTransform:E,getTransformedStyles:R}=TO({props:n,stylesCtx:r,themeName:C});return(T,_)=>({className:SO({theme:x,options:_,themeName:C,selector:T,classNamesPrefix:b,classNames:f,classes:t,unstyled:d,className:i,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:w,headless:j,transformedStyles:R([_?.styles,p])}),style:EO({theme:x,themeName:C,selector:T,options:_,props:n,stylesCtx:r,rootSelector:c,styles:p,style:s,vars:m,varsResolver:g,headless:j,withStylesTransform:E})})}function Zs(e,t){return typeof e=="boolean"?e:t.autoContrast}function rC(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 RO({keepTransitions:e}={}){const t=v.useRef(kh),n=v.useRef(-1),r=v.useContext(Sx),i=mp(),s=v.useRef(i?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:rC(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:rC(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=y3("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return v.useEffect(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:d,toggleColorScheme:m}}function se(e,t,n){const r=yn(),i=r.components[e]?.defaultProps,s=typeof i=="function"?i(r):i;return{...t,...s,...Qa(n)}}function Lv(e){return on(e).reduce((t,n)=>e[n]!==void 0?`${t}${i3(n)}:${e[n]};`:t,"").trim()}function _O({selector:e,styles:t,media:n,container:r}){const i=t?Lv(t):"",s=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${Lv(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${Lv(d.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${s.join("")}${c.join("")}`.trim()}function Js(e){const t=mp();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:_O(e)}})}function Xi(e){const{m:t,mx:n,my:r,mt:i,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:w,pl:j,pr:C,pe:E,ps:R,bd:T,bg:_,c:P,opacity:A,ff:M,fz:I,fw:V,lts:H,ta:Z,lh:K,fs:Q,tt:B,td:W,w:N,miw:L,maw:$,h:q,mih:O,mah:F,bgsz:te,bgp:ae,bgr:je,bga:xe,pos:we,top:Ge,left:Ee,bottom:ot,right:et,inset:Ct,display:Ot,flex:Mt,hiddenFrom:pt,visibleFrom:Rt,lightHidden:en,darkHidden:Re,sx:Ae,...Qe}=e;return{styleProps:Qa({m:t,mx:n,my:r,mt:i,mb:s,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:w,pl:j,pr:C,pe:E,ps:R,bd:T,bg:_,c:P,opacity:A,ff:M,fz:I,fw:V,lts:H,ta:Z,lh:K,fs:Q,tt:B,td:W,w:N,miw:L,maw:$,h:q,mih:O,mah:F,bgsz:te,bgp:ae,bgr:je,bga:xe,pos:we,top:Ge,left:Ee,bottom:ot,right:et,inset:Ct,display:Ot,flex:Mt,hiddenFrom:pt,visibleFrom:Rt,lightHidden:en,darkHidden:Re,sx:Ae}),rest:Qe}}const DO={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 Ex(e,t){const n=go({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 AO(e,t){const n=go({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Ex(e,t)}function PO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(c=>c.trim()!=="");let s=`${le(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${Ex(i.join(" "),t)}`),s.trim()}return e}const oC={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 kO(e){return typeof e=="string"&&e in oC?oC[e]:e}const NO=["h1","h2","h3","h4","h5","h6"];function OO(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&NO.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function MO(e){return e}const IO=["h1","h2","h3","h4","h5","h6"];function LO(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&IO.includes(e)?`var(--mantine-${e}-line-height)`:e}function $O(e){return typeof e=="number"?le(e):e}function zO(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const $v={color:Ex,textColor:AO,fontSize:OO,spacing:zO,identity:MO,size:$O,lineHeight:LO,fontFamily:kO,border:PO};function iC(e){return e.replace("(min-width: ","").replace("em)","")}function UO({media:e,...t}){const r=Object.keys(e).sort((i,s)=>Number(iC(i))-Number(iC(s))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function BO(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function VO(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function FO(e){return typeof e=="object"&&e!==null?on(e).filter(t=>t!=="base"):[]}function HO(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function AR({styleProps:e,data:t,theme:n}){return UO(on(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const s=t[i],c=Array.isArray(s.property)?s.property:[s.property],d=VO(e[i]);if(!BO(e[i]))return c.forEach(p=>{r.inlineStyles[p]=$v[s.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=FO(e[i]);return c.forEach(p=>{d&&(r.styles[p]=$v[s.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:$v[s.type](HO(e[i],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function dd(){return`__m__-${v.useId().replace(/:/g,"")}`}function PR(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...PR(r,t)}),{}):typeof e=="function"?e(t):e??{}}function kR(e){return e.startsWith("data-")?e:`data-${e}`}function qO(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[kR(n)]=e[n]),t},{})}function NR(e){return e?typeof e=="string"?{[kR(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...NR(n)}),{}):qO(e):null}function Ry(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Ry(r,t)}),{}):typeof e=="function"?e(t):e??{}}function GO({theme:e,style:t,vars:n,styleProps:r}){const i=Ry(t,e),s=Ry(n,e);return{...i,...s,...r}}const OR=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:s,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:x,...b},w)=>{const j=yn(),C=e||"div",{styleProps:E,rest:R}=Xi(b),_=H3()?.()?.(E.sx),P=dd(),A=AR({styleProps:E,theme:j,data:DO}),M={ref:w,style:GO({theme:j,style:t,vars:n,styleProps:A.inlineStyles}),className:It(r,_,{[P]:A.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${d}`]:d,[`mantine-visible-from-${f}`]:f}),"data-variant":i,"data-size":hR(c)?void 0:c||void 0,size:x,...NR(s),...R};return a.jsxs(a.Fragment,{children:[A.hasResponsiveStyles&&a.jsx(Js,{selector:`.${P}`,styles:A.styles,media:A.media}),typeof g=="function"?g(M):a.jsx(C,{...M})]})});OR.displayName="@mantine/core/Box";const ce=OR;function MR(e){return e}function WO(e){const t=e;return n=>{const r=v.forwardRef((i,s)=>a.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function ge(e){const t=v.forwardRef(e);return t.extend=MR,t.withProps=n=>{const r=v.forwardRef((i,s)=>a.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function lr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((i,s)=>a.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=MR,t}const QO=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function el(){return v.useContext(QO)}var zv={exports:{}},nr={};/**
61
+ * @license React
62
+ * react-dom.production.js
63
+ *
64
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
65
+ *
66
+ * This source code is licensed under the MIT license found in the
67
+ * LICENSE file in the root directory of this source tree.
68
+ */var aC;function YO(){if(aC)return nr;aC=1;var e=gx();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function s(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return nr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,nr.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return s(f,p,null,m)},nr.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},nr.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},nr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},nr.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},nr.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},nr.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},nr.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=d(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},nr.requestFormReset=function(f){r.d.r(f)},nr.unstable_batchedUpdates=function(f,p){return f(p)},nr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},nr.useFormStatus=function(){return c.H.useHostTransitionStatus()},nr.version="19.1.1",nr}var sC;function IR(){if(sC)return zv.exports;sC=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(),zv.exports=YO(),zv.exports}var Tx=IR();const Vu=mx(Tx);function gp(){return typeof window<"u"}function Ec(e){return LR(e)?(e.nodeName||"").toLowerCase():"#document"}function Rr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function di(e){var t;return(t=(LR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function LR(e){return gp()?e instanceof Node||e instanceof Rr(e).Node:!1}function pn(e){return gp()?e instanceof Element||e instanceof Rr(e).Element:!1}function Gr(e){return gp()?e instanceof HTMLElement||e instanceof Rr(e).HTMLElement:!1}function _y(e){return!gp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Rr(e).ShadowRoot}const KO=new Set(["inline","contents"]);function fd(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=vo(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!KO.has(i)}const XO=new Set(["table","td","th"]);function ZO(e){return XO.has(Ec(e))}const JO=[":popover-open",":modal"];function vp(e){return JO.some(t=>{try{return e.matches(t)}catch{return!1}})}const eM=["transform","translate","scale","rotate","perspective"],tM=["transform","translate","scale","rotate","perspective","filter"],nM=["paint","layout","strict","content"];function Rx(e){const t=yp(),n=pn(e)?vo(e):e;return eM.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)||tM.some(r=>(n.willChange||"").includes(r))||nM.some(r=>(n.contain||"").includes(r))}function rM(e){let t=Fi(e);for(;Gr(t)&&!Fa(t);){if(Rx(t))return t;if(vp(t))return null;t=Fi(t)}return null}function yp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const oM=new Set(["html","body","#document"]);function Fa(e){return oM.has(Ec(e))}function vo(e){return Rr(e).getComputedStyle(e)}function xp(e){return pn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fi(e){if(Ec(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_y(e)&&e.host||di(e);return _y(t)?t.host:t}function $R(e){const t=Fi(e);return Fa(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gr(t)&&fd(t)?t:$R(t)}function Bi(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=$R(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),c=Rr(i);if(s){const d=Dy(c);return t.concat(c,c.visualViewport||[],fd(i)?i:[],d&&n?Bi(d):[])}return t.concat(i,Bi(i,[],n))}function Dy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function lC(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 Xu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_y(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function zR(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function UR(){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 iM(e){return lM()?!1:!cC()&&e.width===0&&e.height===0||cC()&&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 aM(){return/apple/i.test(navigator.vendor)}function cC(){const e=/android/i;return e.test(zR())||e.test(UR())}function sM(){return zR().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function lM(){return UR().includes("jsdom/")}function Ay(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function cM(e){return"nativeEvent"in e}function uM(e){return e.matches("html,body")}function Ds(e){return e?.ownerDocument||document}function Uv(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 rc(e){return"composedPath"in e?e.composedPath()[0]:e.target}const dM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function fM(e){return Gr(e)&&e.matches(dM)}const Mo=Math.min,or=Math.max,Mh=Math.round,oh=Math.floor,ni=e=>({x:e,y:e}),hM={left:"right",right:"left",bottom:"top",top:"bottom"},pM={start:"end",end:"start"};function Py(e,t,n){return or(e,Mo(t,n))}function Hi(e,t){return typeof e=="function"?e(t):e}function Io(e){return e.split("-")[0]}function Tc(e){return e.split("-")[1]}function _x(e){return e==="x"?"y":"x"}function Dx(e){return e==="y"?"height":"width"}const mM=new Set(["top","bottom"]);function ko(e){return mM.has(Io(e))?"y":"x"}function Ax(e){return _x(ko(e))}function gM(e,t,n){n===void 0&&(n=!1);const r=Tc(e),i=Ax(e),s=Dx(i);let c=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(c=Ih(c)),[c,Ih(c)]}function vM(e){const t=Ih(e);return[ky(e),t,ky(t)]}function ky(e){return e.replace(/start|end/g,t=>pM[t])}const uC=["left","right"],dC=["right","left"],yM=["top","bottom"],xM=["bottom","top"];function bM(e,t,n){switch(e){case"top":case"bottom":return n?t?dC:uC:t?uC:dC;case"left":case"right":return t?yM:xM;default:return[]}}function SM(e,t,n,r){const i=Tc(e);let s=bM(Io(e),n==="start",r);return i&&(s=s.map(c=>c+"-"+i),t&&(s=s.concat(s.map(ky)))),s}function Ih(e){return e.replace(/left|right|bottom|top/g,t=>hM[t])}function wM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Px(e){return typeof e!="number"?wM(e):{top:e,right:e,bottom:e,left:e}}function hc(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function fC(e,t,n){let{reference:r,floating:i}=e;const s=ko(t),c=Ax(t),d=Dx(c),f=Io(t),p=s==="y",m=r.x+r.width/2-i.width/2,g=r.y+r.height/2-i.height/2,x=r[d]/2-i[d]/2;let b;switch(f){case"top":b={x:m,y:r.y-i.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-i.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Tc(t)){case"start":b[c]-=x*(n&&p?-1:1);break;case"end":b[c]+=x*(n&&p?-1:1);break}return b}const jM=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:c}=n,d=s.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:g}=fC(p,r,f),x=r,b={},w=0;for(let j=0;j<d.length;j++){const{name:C,fn:E}=d[j],{x:R,y:T,data:_,reset:P}=await E({x:m,y:g,initialPlacement:r,placement:x,strategy:i,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=R??m,g=T??g,b={...b,[C]:{...b[C],..._}},P&&w<=50&&(w++,typeof P=="object"&&(P.placement&&(x=P.placement),P.rects&&(p=P.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:i}):P.rects),{x:m,y:g}=fC(p,x,f)),j=-1)}return{x:m,y:g,placement:x,strategy:i,middlewareData:b}};async function kx(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:x=!1,padding:b=0}=Hi(t,e),w=Px(b),C=d[x?g==="floating"?"reference":"floating":g],E=hc(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(C)))==null||n?C:C.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(d.floating)),boundary:p,rootBoundary:m,strategy:f})),R=g==="floating"?{x:r,y:i,width:c.floating.width,height:c.floating.height}:c.reference,T=await(s.getOffsetParent==null?void 0:s.getOffsetParent(d.floating)),_=await(s.isElement==null?void 0:s.isElement(T))?await(s.getScale==null?void 0:s.getScale(T))||{x:1,y:1}:{x:1,y:1},P=hc(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:R,offsetParent:T,strategy:f}):R);return{top:(E.top-P.top+w.top)/_.y,bottom:(P.bottom-E.bottom+w.bottom)/_.y,left:(E.left-P.left+w.left)/_.x,right:(P.right-E.right+w.right)/_.x}}const CM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=Hi(e,t)||{};if(p==null)return{};const g=Px(m),x={x:n,y:r},b=Ax(i),w=Dx(b),j=await c.getDimensions(p),C=b==="y",E=C?"top":"left",R=C?"bottom":"right",T=C?"clientHeight":"clientWidth",_=s.reference[w]+s.reference[b]-x[b]-s.floating[w],P=x[b]-s.reference[b],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let M=A?A[T]:0;(!M||!await(c.isElement==null?void 0:c.isElement(A)))&&(M=d.floating[T]||s.floating[w]);const I=_/2-P/2,V=M/2-j[w]/2-1,H=Mo(g[E],V),Z=Mo(g[R],V),K=H,Q=M-j[w]-Z,B=M/2-j[w]/2+I,W=Py(K,B,Q),N=!f.arrow&&Tc(i)!=null&&B!==W&&s.reference[w]/2-(B<K?H:Z)-j[w]/2<0,L=N?B<K?B-K:B-Q:0;return{[b]:x[b]+L,data:{[b]:W,centerOffset:B-W-L,...N&&{alignmentOffset:L}},reset:N}}}),EM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:c,initialPlacement:d,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:x,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:j=!0,...C}=Hi(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const E=Io(i),R=ko(d),T=Io(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),P=x||(T||!j?[Ih(d)]:vM(d)),A=w!=="none";!x&&A&&P.push(...SM(d,j,w,_));const M=[d,...P],I=await kx(t,C),V=[];let H=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&V.push(I[E]),g){const B=gM(i,c,_);V.push(I[B[0]],I[B[1]])}if(H=[...H,{placement:i,overflows:V}],!V.every(B=>B<=0)){var Z,K;const B=(((Z=s.flip)==null?void 0:Z.index)||0)+1,W=M[B];if(W&&(!(g==="alignment"?R!==ko(W):!1)||H.every($=>ko($.placement)===R?$.overflows[0]>0:!0)))return{data:{index:B,overflows:H},reset:{placement:W}};let N=(K=H.filter(L=>L.overflows[0]<=0).sort((L,$)=>L.overflows[1]-$.overflows[1])[0])==null?void 0:K.placement;if(!N)switch(b){case"bestFit":{var Q;const L=(Q=H.filter($=>{if(A){const q=ko($.placement);return q===R||q==="y"}return!0}).map($=>[$.placement,$.overflows.filter(q=>q>0).reduce((q,O)=>q+O,0)]).sort(($,q)=>$[1]-q[1])[0])==null?void 0:Q[0];L&&(N=L);break}case"initialPlacement":N=d;break}if(i!==N)return{reset:{placement:N}}}return{}}}};function BR(e){const t=Mo(...e.map(s=>s.left)),n=Mo(...e.map(s=>s.top)),r=or(...e.map(s=>s.right)),i=or(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:i-n}}function TM(e){const t=e.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<t.length;i++){const s=t[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>hc(BR(i)))}const RM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:s,strategy:c}=t,{padding:d=2,x:f,y:p}=Hi(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),g=TM(m),x=hc(BR(m)),b=Px(d);function w(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||x;if(g.length>=2){if(ko(n)==="y"){const H=g[0],Z=g[g.length-1],K=Io(n)==="top",Q=H.top,B=Z.bottom,W=K?H.left:Z.left,N=K?H.right:Z.right,L=N-W,$=B-Q;return{top:Q,bottom:B,left:W,right:N,width:L,height:$,x:W,y:Q}}const C=Io(n)==="left",E=or(...g.map(H=>H.right)),R=Mo(...g.map(H=>H.left)),T=g.filter(H=>C?H.left===R:H.right===E),_=T[0].top,P=T[T.length-1].bottom,A=R,M=E,I=M-A,V=P-_;return{top:_,bottom:P,left:A,right:M,width:I,height:V,x:A,y:_}}return x}const j=await s.getElementRects({reference:{getBoundingClientRect:w},floating:r.floating,strategy:c});return i.reference.x!==j.reference.x||i.reference.y!==j.reference.y||i.reference.width!==j.reference.width||i.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},VR=new Set(["left","top"]);async function _M(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),c=Io(n),d=Tc(n),f=ko(n)==="y",p=VR.has(c)?-1:1,m=s&&f?-1:1,g=Hi(t,e);let{mainAxis:x,crossAxis:b,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),f?{x:b*m,y:x*p}:{x:x*p,y:b*m}}const DM=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:c,middlewareData:d}=t,f=await _M(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:c}}}}},AM=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:E,y:R}=C;return{x:E,y:R}}},...f}=Hi(e,t),p={x:n,y:r},m=await kx(t,f),g=ko(Io(i)),x=_x(g);let b=p[x],w=p[g];if(s){const C=x==="y"?"top":"left",E=x==="y"?"bottom":"right",R=b+m[C],T=b-m[E];b=Py(R,b,T)}if(c){const C=g==="y"?"top":"left",E=g==="y"?"bottom":"right",R=w+m[C],T=w-m[E];w=Py(R,w,T)}const j=d.fn({...t,[x]:b,[g]:w});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[x]:s,[g]:c}}}}}},PM=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Hi(e,t),m={x:n,y:r},g=ko(i),x=_x(g);let b=m[x],w=m[g];const j=Hi(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const T=x==="y"?"height":"width",_=s.reference[x]-s.floating[T]+C.mainAxis,P=s.reference[x]+s.reference[T]-C.mainAxis;b<_?b=_:b>P&&(b=P)}if(p){var E,R;const T=x==="y"?"width":"height",_=VR.has(Io(i)),P=s.reference[g]-s.floating[T]+(_&&((E=c.offset)==null?void 0:E[g])||0)+(_?0:C.crossAxis),A=s.reference[g]+s.reference[T]+(_?0:((R=c.offset)==null?void 0:R[g])||0)-(_?C.crossAxis:0);w<P?w=P:w>A&&(w=A)}return{[x]:b,[g]:w}}}},kM=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:c,elements:d}=t,{apply:f=()=>{},...p}=Hi(e,t),m=await kx(t,p),g=Io(i),x=Tc(i),b=ko(i)==="y",{width:w,height:j}=s.floating;let C,E;g==="top"||g==="bottom"?(C=g,E=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(E=g,C=x==="end"?"top":"bottom");const R=j-m.top-m.bottom,T=w-m.left-m.right,_=Mo(j-m[C],R),P=Mo(w-m[E],T),A=!t.middlewareData.shift;let M=_,I=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(I=T),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=R),A&&!x){const H=or(m.left,0),Z=or(m.right,0),K=or(m.top,0),Q=or(m.bottom,0);b?I=w-2*(H!==0||Z!==0?H+Z:or(m.left,m.right)):M=j-2*(K!==0||Q!==0?K+Q:or(m.top,m.bottom))}await f({...t,availableWidth:I,availableHeight:M});const V=await c.getDimensions(d.floating);return w!==V.width||j!==V.height?{reset:{rects:!0}}:{}}}};function FR(e){const t=vo(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Gr(e),s=i?e.offsetWidth:n,c=i?e.offsetHeight:r,d=Mh(n)!==s||Mh(r)!==c;return d&&(n=s,r=c),{width:n,height:r,$:d}}function Nx(e){return pn(e)?e:e.contextElement}function sc(e){const t=Nx(e);if(!Gr(t))return ni(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=FR(t);let c=(s?Mh(n.width):n.width)/r,d=(s?Mh(n.height):n.height)/i;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const NM=ni(0);function HR(e){const t=Rr(e);return!yp()||!t.visualViewport?NM:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function OM(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Rr(e)?!1:t}function $s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Nx(e);let c=ni(1);t&&(r?pn(r)&&(c=sc(r)):c=sc(e));const d=OM(s,n,r)?HR(s):ni(0);let f=(i.left+d.x)/c.x,p=(i.top+d.y)/c.y,m=i.width/c.x,g=i.height/c.y;if(s){const x=Rr(s),b=r&&pn(r)?Rr(r):r;let w=x,j=Dy(w);for(;j&&r&&b!==w;){const C=sc(j),E=j.getBoundingClientRect(),R=vo(j),T=E.left+(j.clientLeft+parseFloat(R.paddingLeft))*C.x,_=E.top+(j.clientTop+parseFloat(R.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=T,p+=_,w=Rr(j),j=Dy(w)}}return hc({width:m,height:g,x:f,y:p})}function Ox(e,t){const n=xp(e).scrollLeft;return t?t.left+n:$s(di(e)).left+n}function qR(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:Ox(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function MM(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",c=di(r),d=t?vp(t.floating):!1;if(r===c||d&&s)return n;let f={scrollLeft:0,scrollTop:0},p=ni(1);const m=ni(0),g=Gr(r);if((g||!g&&!s)&&((Ec(r)!=="body"||fd(c))&&(f=xp(r)),Gr(r))){const b=$s(r);p=sc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const x=c&&!g&&!s?qR(c,f,!0):ni(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+x.x,y:n.y*p.y-f.scrollTop*p.y+m.y+x.y}}function IM(e){return Array.from(e.getClientRects())}function LM(e){const t=di(e),n=xp(e),r=e.ownerDocument.body,i=or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Ox(e);const d=-n.scrollTop;return vo(r).direction==="rtl"&&(c+=or(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:c,y:d}}function $M(e,t){const n=Rr(e),r=di(e),i=n.visualViewport;let s=r.clientWidth,c=r.clientHeight,d=0,f=0;if(i){s=i.width,c=i.height;const p=yp();(!p||p&&t==="fixed")&&(d=i.offsetLeft,f=i.offsetTop)}return{width:s,height:c,x:d,y:f}}const zM=new Set(["absolute","fixed"]);function UM(e,t){const n=$s(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Gr(e)?sc(e):ni(1),c=e.clientWidth*s.x,d=e.clientHeight*s.y,f=i*s.x,p=r*s.y;return{width:c,height:d,x:f,y:p}}function hC(e,t,n){let r;if(t==="viewport")r=$M(e,n);else if(t==="document")r=LM(di(e));else if(pn(t))r=UM(t,n);else{const i=HR(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return hc(r)}function GR(e,t){const n=Fi(e);return n===t||!pn(n)||Fa(n)?!1:vo(n).position==="fixed"||GR(n,t)}function BM(e,t){const n=t.get(e);if(n)return n;let r=Bi(e,[],!1).filter(d=>pn(d)&&Ec(d)!=="body"),i=null;const s=vo(e).position==="fixed";let c=s?Fi(e):e;for(;pn(c)&&!Fa(c);){const d=vo(c),f=Rx(c);!f&&d.position==="fixed"&&(i=null),(s?!f&&!i:!f&&d.position==="static"&&!!i&&zM.has(i.position)||fd(c)&&!f&&GR(e,c))?r=r.filter(m=>m!==c):i=d,c=Fi(c)}return t.set(e,r),r}function VM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const c=[...n==="clippingAncestors"?vp(t)?[]:BM(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=hC(t,m,i);return p.top=or(g.top,p.top),p.right=Mo(g.right,p.right),p.bottom=Mo(g.bottom,p.bottom),p.left=or(g.left,p.left),p},hC(t,d,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function FM(e){const{width:t,height:n}=FR(e);return{width:t,height:n}}function HM(e,t,n){const r=Gr(t),i=di(t),s=n==="fixed",c=$s(e,!0,s,t);let d={scrollLeft:0,scrollTop:0};const f=ni(0);function p(){f.x=Ox(i)}if(r||!r&&!s)if((Ec(t)!=="body"||fd(i))&&(d=xp(t)),r){const b=$s(t,!0,s,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else i&&p();s&&!r&&i&&p();const m=i&&!r&&!s?qR(i,d):ni(0),g=c.left+d.scrollLeft-f.x-m.x,x=c.top+d.scrollTop-f.y-m.y;return{x:g,y:x,width:c.width,height:c.height}}function Bv(e){return vo(e).position==="static"}function pC(e,t){if(!Gr(e)||vo(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return di(e)===n&&(n=n.ownerDocument.body),n}function WR(e,t){const n=Rr(e);if(vp(e))return n;if(!Gr(e)){let i=Fi(e);for(;i&&!Fa(i);){if(pn(i)&&!Bv(i))return i;i=Fi(i)}return n}let r=pC(e,t);for(;r&&ZO(r)&&Bv(r);)r=pC(r,t);return r&&Fa(r)&&Bv(r)&&!Rx(r)?n:r||rM(e)||n}const qM=async function(e){const t=this.getOffsetParent||WR,n=this.getDimensions,r=await n(e.floating);return{reference:HM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function GM(e){return vo(e).direction==="rtl"}const WM={convertOffsetParentRelativeRectToViewportRelativeRect:MM,getDocumentElement:di,getClippingRect:VM,getOffsetParent:WR,getElementRects:qM,getClientRects:IM,getDimensions:FM,getScale:sc,isElement:pn,isRTL:GM};function QR(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function QM(e,t){let n=null,r;const i=di(e);function s(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),s();const p=e.getBoundingClientRect(),{left:m,top:g,width:x,height:b}=p;if(d||t(),!x||!b)return;const w=oh(g),j=oh(i.clientWidth-(m+x)),C=oh(i.clientHeight-(g+b)),E=oh(m),T={rootMargin:-w+"px "+-j+"px "+-C+"px "+-E+"px",threshold:or(0,Mo(1,f))||1};let _=!0;function P(A){const M=A[0].intersectionRatio;if(M!==f){if(!_)return c();M?c(!1,M):r=setTimeout(()=>{c(!1,1e-7)},1e3)}M===1&&!QR(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(P,{...T,root:i.ownerDocument})}catch{n=new IntersectionObserver(P,T)}n.observe(e)}return c(!0),s}function YM(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Nx(e),m=i||s?[...p?Bi(p):[],...Bi(t)]:[];m.forEach(E=>{i&&E.addEventListener("scroll",n,{passive:!0}),s&&E.addEventListener("resize",n)});const g=p&&d?QM(p,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(E=>{let[R]=E;R&&R.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var T;(T=b)==null||T.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let w,j=f?$s(e):null;f&&C();function C(){const E=$s(e);j&&!QR(j,E)&&n(),j=E,w=requestAnimationFrame(C)}return n(),()=>{var E;m.forEach(R=>{i&&R.removeEventListener("scroll",n),s&&R.removeEventListener("resize",n)}),g?.(),(E=b)==null||E.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const KM=DM,XM=AM,ZM=EM,JM=kM,mC=CM,e9=RM,t9=PM,n9=(e,t,n)=>{const r=new Map,i={platform:WM,...n},s={...i.platform,_c:r};return jM(e,t,{...i,platform:s})};var r9=typeof document<"u",o9=function(){},bh=r9?v.useLayoutEffect:o9;function Lh(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,i;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(!Lh(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Lh(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function YR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function gC(e,t){const n=YR(e);return Math.round(t*n)/n}function Vv(e){const t=v.useRef(e);return bh(()=>{t.current=e}),t}function i9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:c}={},transform:d=!0,whileElementsMounted:f,open:p}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[x,b]=v.useState(r);Lh(x,r)||b(r);const[w,j]=v.useState(null),[C,E]=v.useState(null),R=v.useCallback($=>{$!==A.current&&(A.current=$,j($))},[]),T=v.useCallback($=>{$!==M.current&&(M.current=$,E($))},[]),_=s||w,P=c||C,A=v.useRef(null),M=v.useRef(null),I=v.useRef(m),V=f!=null,H=Vv(f),Z=Vv(i),K=Vv(p),Q=v.useCallback(()=>{if(!A.current||!M.current)return;const $={placement:t,strategy:n,middleware:x};Z.current&&($.platform=Z.current),n9(A.current,M.current,$).then(q=>{const O={...q,isPositioned:K.current!==!1};B.current&&!Lh(I.current,O)&&(I.current=O,Tx.flushSync(()=>{g(O)}))})},[x,t,n,Z,K]);bh(()=>{p===!1&&I.current.isPositioned&&(I.current.isPositioned=!1,g($=>({...$,isPositioned:!1})))},[p]);const B=v.useRef(!1);bh(()=>(B.current=!0,()=>{B.current=!1}),[]),bh(()=>{if(_&&(A.current=_),P&&(M.current=P),_&&P){if(H.current)return H.current(_,P,Q);Q()}},[_,P,Q,H,V]);const W=v.useMemo(()=>({reference:A,floating:M,setReference:R,setFloating:T}),[R,T]),N=v.useMemo(()=>({reference:_,floating:P}),[_,P]),L=v.useMemo(()=>{const $={position:n,left:0,top:0};if(!N.floating)return $;const q=gC(N.floating,m.x),O=gC(N.floating,m.y);return d?{...$,transform:"translate("+q+"px, "+O+"px)",...YR(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:q,top:O}},[n,d,N.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Q,refs:W,elements:N,floatingStyles:L}),[m,Q,W,N,L])}const a9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?mC({element:r.current,padding:i}).fn(n):{}:r?mC({element:r,padding:i}).fn(n):{}}}},KR=(e,t)=>({...KM(e),options:[e,t]}),Mx=(e,t)=>({...XM(e),options:[e,t]}),vC=(e,t)=>({...t9(e),options:[e,t]}),$h=(e,t)=>({...ZM(e),options:[e,t]}),s9=(e,t)=>({...JM(e),options:[e,t]}),qu=(e,t)=>({...e9(e),options:[e,t]}),XR=(e,t)=>({...a9(e),options:[e,t]});function l9(e){return v.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const ZR={...j4},c9=ZR.useInsertionEffect,u9=c9||(e=>e());function Ui(e){const t=v.useRef(()=>{});return u9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var ri=typeof document<"u"?v.useLayoutEffect:v.useEffect;let yC=!1,d9=0;const xC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+d9++;function f9(){const[e,t]=v.useState(()=>yC?xC():void 0);return ri(()=>{e==null&&t(xC())},[]),v.useEffect(()=>{yC=!0},[]),e}const h9=ZR.useId,JR=h9||f9;function p9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(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(i=>i!==n))||[])}}}const m9=v.createContext(null),g9=v.createContext(null),Ix=()=>{var e;return((e=v.useContext(m9))==null?void 0:e.id)||null},Lx=()=>v.useContext(g9);function $x(e){return"data-floating-ui-"+e}function Fv(e){const t=v.useRef(e);return ri(()=>{t.current=e}),t}const bC=$x("safe-polygon");function Sh(e,t,n){return n&&!Ay(n)?0:typeof e=="number"?e:e?.[t]}function v9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:x=!0}=t,b=Lx(),w=Ix(),j=Fv(p),C=Fv(f),E=Fv(n),R=v.useRef(),T=v.useRef(-1),_=v.useRef(),P=v.useRef(-1),A=v.useRef(!0),M=v.useRef(!1),I=v.useRef(()=>{}),V=v.useRef(!1),H=v.useCallback(()=>{var L;const $=(L=i.current.openEvent)==null?void 0:L.type;return $?.includes("mouse")&&$!=="mousedown"},[i]);v.useEffect(()=>{if(!d)return;function L($){let{open:q}=$;q||(clearTimeout(T.current),clearTimeout(P.current),A.current=!0,V.current=!1)}return s.on("openchange",L),()=>{s.off("openchange",L)}},[d,s]),v.useEffect(()=>{if(!d||!j.current||!n)return;function L(q){H()&&r(!1,q,"hover")}const $=Ds(c.floating).documentElement;return $.addEventListener("mouseleave",L),()=>{$.removeEventListener("mouseleave",L)}},[c.floating,n,r,d,j,H]);const Z=v.useCallback(function(L,$,q){$===void 0&&($=!0),q===void 0&&(q="hover");const O=Sh(C.current,"close",R.current);O&&!_.current?(clearTimeout(T.current),T.current=window.setTimeout(()=>r(!1,L,q),O)):$&&(clearTimeout(T.current),r(!1,L,q))},[C,r]),K=Ui(()=>{I.current(),_.current=void 0}),Q=Ui(()=>{if(M.current){const L=Ds(c.floating).body;L.style.pointerEvents="",L.removeAttribute(bC),M.current=!1}}),B=Ui(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function L(F){if(clearTimeout(T.current),A.current=!1,m&&!Ay(R.current)||g>0&&!Sh(C.current,"open"))return;const te=Sh(C.current,"open",R.current);te?T.current=window.setTimeout(()=>{E.current||r(!0,F,"hover")},te):n||r(!0,F,"hover")}function $(F){if(B())return;I.current();const te=Ds(c.floating);if(clearTimeout(P.current),V.current=!1,j.current&&i.current.floatingContext){n||clearTimeout(T.current),_.current=j.current({...i.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){Q(),K(),B()||Z(F,!0,"safe-polygon")}});const je=_.current;te.addEventListener("mousemove",je),I.current=()=>{te.removeEventListener("mousemove",je)};return}(R.current==="touch"?!Xu(c.floating,F.relatedTarget):!0)&&Z(F)}function q(F){B()||i.current.floatingContext&&(j.current==null||j.current({...i.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){Q(),K(),B()||Z(F)}})(F))}if(pn(c.domReference)){var O;const F=c.domReference;return n&&F.addEventListener("mouseleave",q),(O=c.floating)==null||O.addEventListener("mouseleave",q),x&&F.addEventListener("mousemove",L,{once:!0}),F.addEventListener("mouseenter",L),F.addEventListener("mouseleave",$),()=>{var te;n&&F.removeEventListener("mouseleave",q),(te=c.floating)==null||te.removeEventListener("mouseleave",q),x&&F.removeEventListener("mousemove",L),F.removeEventListener("mouseenter",L),F.removeEventListener("mouseleave",$)}}},[c,d,e,m,g,x,Z,K,Q,r,n,E,b,C,j,i,B]),ri(()=>{var L;if(d&&n&&(L=j.current)!=null&&L.__options.blockPointerEvents&&H()){M.current=!0;const q=c.floating;if(pn(c.domReference)&&q){var $;const O=Ds(c.floating).body;O.setAttribute(bC,"");const F=c.domReference,te=b==null||($=b.nodesRef.current.find(ae=>ae.id===w))==null||($=$.context)==null?void 0:$.elements.floating;return te&&(te.style.pointerEvents=""),O.style.pointerEvents="none",F.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{O.style.pointerEvents="",F.style.pointerEvents="",q.style.pointerEvents=""}}}},[d,n,w,c,b,j,H]),ri(()=>{n||(R.current=void 0,V.current=!1,K(),Q())},[n,K,Q]),v.useEffect(()=>()=>{K(),clearTimeout(T.current),clearTimeout(P.current),Q()},[d,c.domReference,K,Q]);const W=v.useMemo(()=>{function L($){R.current=$.pointerType}return{onPointerDown:L,onPointerEnter:L,onMouseMove($){const{nativeEvent:q}=$;function O(){!A.current&&!E.current&&r(!0,q,"hover")}m&&!Ay(R.current)||n||g===0||V.current&&$.movementX**2+$.movementY**2<2||(clearTimeout(P.current),R.current==="touch"?O():(V.current=!0,P.current=window.setTimeout(O,g)))}}},[m,r,n,E,g]),N=v.useMemo(()=>({onMouseEnter(){clearTimeout(T.current)},onMouseLeave(L){B()||Z(L.nativeEvent,!1)}}),[Z,B]);return v.useMemo(()=>d?{reference:W,floating:N}:{},[d,W,N])}const Ny=()=>{},e2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Ny,setState:Ny,isInstantPhase:!1}),y9=()=>v.useContext(e2);function x9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,s]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),d=v.useCallback(f=>{s({currentId:f})},[]);return ri(()=>{i.currentId?c.current===null?c.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),c.current=null)},[i.currentId,i.isInstantPhase]),v.createElement(e2.Provider,{value:v.useMemo(()=>({...i,setState:s,setCurrentId:d}),[i,d])},t)}function b9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{id:s,enabled:c=!0}=t,d=s??i,f=y9(),{currentId:p,setCurrentId:m,initialDelay:g,setState:x,timeoutMs:b}=f;return ri(()=>{c&&p&&(x({delay:{open:1,close:Sh(g,"close")}}),p!==d&&r(!1))},[c,d,r,x,p,g]),ri(()=>{function w(){r(!1),x({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(b){const j=window.setTimeout(w,b);return()=>{clearTimeout(j)}}w()}},[c,n,x,p,d,r,g,b]),ri(()=>{c&&(m===Ny||!n||m(d))},[c,n,m,d]),f}function Hv(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(c=>{var d;return i.parentId===c.id&&((d=i.context)==null?void 0:d.open)})}),n=n.concat(r);return n}const S9="data-floating-ui-focusable",w9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},j9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},SC=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function C9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:x=!1,bubbles:b,capture:w}=t,j=Lx(),C=Ui(typeof f=="function"?f:()=>!1),E=typeof f=="function"?C:f,R=v.useRef(!1),T=v.useRef(!1),{escapeKey:_,outsidePress:P}=SC(b),{escapeKey:A,outsidePress:M}=SC(w),I=v.useRef(!1),V=Ui(W=>{var N;if(!n||!c||!d||W.key!=="Escape"||I.current)return;const L=(N=s.current.floatingContext)==null?void 0:N.nodeId,$=j?Hv(j.nodesRef.current,L):[];if(!_&&(W.stopPropagation(),$.length>0)){let q=!0;if($.forEach(O=>{var F;if((F=O.context)!=null&&F.open&&!O.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}r(!1,cM(W)?W.nativeEvent:W,"escape-key")}),H=Ui(W=>{var N;const L=()=>{var $;V(W),($=rc(W))==null||$.removeEventListener("keydown",L)};(N=rc(W))==null||N.addEventListener("keydown",L)}),Z=Ui(W=>{var N;const L=R.current;R.current=!1;const $=T.current;if(T.current=!1,p==="click"&&$||L||typeof E=="function"&&!E(W))return;const q=rc(W),O="["+$x("inert")+"]",F=Ds(i.floating).querySelectorAll(O);let te=pn(q)?q:null;for(;te&&!Fa(te);){const we=Fi(te);if(Fa(we)||!pn(we))break;te=we}if(F.length&&pn(q)&&!uM(q)&&!Xu(q,i.floating)&&Array.from(F).every(we=>!Xu(te,we)))return;if(Gr(q)&&B){const we=q.clientWidth>0&&q.scrollWidth>q.clientWidth,Ge=q.clientHeight>0&&q.scrollHeight>q.clientHeight;let Ee=Ge&&W.offsetX>q.clientWidth;if(Ge&&vo(q).direction==="rtl"&&(Ee=W.offsetX<=q.offsetWidth-q.clientWidth),Ee||we&&W.offsetY>q.clientHeight)return}const ae=(N=s.current.floatingContext)==null?void 0:N.nodeId,je=j&&Hv(j.nodesRef.current,ae).some(we=>{var Ge;return Uv(W,(Ge=we.context)==null?void 0:Ge.elements.floating)});if(Uv(W,i.floating)||Uv(W,i.domReference)||je)return;const xe=j?Hv(j.nodesRef.current,ae):[];if(xe.length>0){let we=!0;if(xe.forEach(Ge=>{var Ee;if((Ee=Ge.context)!=null&&Ee.open&&!Ge.context.dataRef.current.__outsidePressBubbles){we=!1;return}}),!we)return}r(!1,W,"outside-press")}),K=Ui(W=>{var N;const L=()=>{var $;Z(W),($=rc(W))==null||$.removeEventListener(p,L)};(N=rc(W))==null||N.addEventListener(p,L)});v.useEffect(()=>{if(!n||!c)return;s.current.__escapeKeyBubbles=_,s.current.__outsidePressBubbles=P;let W=-1;function N(F){r(!1,F,"ancestor-scroll")}function L(){window.clearTimeout(W),I.current=!0}function $(){W=window.setTimeout(()=>{I.current=!1},yp()?5:0)}const q=Ds(i.floating);d&&(q.addEventListener("keydown",A?H:V,A),q.addEventListener("compositionstart",L),q.addEventListener("compositionend",$)),E&&q.addEventListener(p,M?K:Z,M);let O=[];return x&&(pn(i.domReference)&&(O=Bi(i.domReference)),pn(i.floating)&&(O=O.concat(Bi(i.floating))),!pn(i.reference)&&i.reference&&i.reference.contextElement&&(O=O.concat(Bi(i.reference.contextElement)))),O=O.filter(F=>{var te;return F!==((te=q.defaultView)==null?void 0:te.visualViewport)}),O.forEach(F=>{F.addEventListener("scroll",N,{passive:!0})}),()=>{d&&(q.removeEventListener("keydown",A?H:V,A),q.removeEventListener("compositionstart",L),q.removeEventListener("compositionend",$)),E&&q.removeEventListener(p,M?K:Z,M),O.forEach(F=>{F.removeEventListener("scroll",N)}),window.clearTimeout(W)}},[s,i,d,E,p,n,r,x,c,_,P,V,A,H,Z,M,K]),v.useEffect(()=>{R.current=!1},[E,p]);const Q=v.useMemo(()=>({onKeyDown:V,[w9[g]]:W=>{m&&r(!1,W.nativeEvent,"reference-press")}}),[V,r,m,g]),B=v.useMemo(()=>({onKeyDown:V,onMouseDown(){T.current=!0},onMouseUp(){T.current=!0},[j9[p]]:()=>{R.current=!0}}),[V,p]);return v.useMemo(()=>c?{reference:Q,floating:B}:{},[c,Q,B])}function E9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=JR(),s=v.useRef({}),[c]=v.useState(()=>p9()),d=Ix()!=null,[f,p]=v.useState(r.reference),m=Ui((b,w,j)=>{s.current.openEvent=b?w:void 0,c.emit("openchange",{open:b,event:w,reason:j,nested:d}),n?.(b,w,j)}),g=v.useMemo(()=>({setPositionReference:p}),[]),x=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:s,open:t,onOpenChange:m,elements:x,events:c,floatingId:i,refs:g}),[t,m,x,c,i,g])}function zx(e){e===void 0&&(e={});const{nodeId:t}=e,n=E9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,c]=v.useState(null),[d,f]=v.useState(null),m=i?.domReference||s,g=v.useRef(null),x=Lx();ri(()=>{m&&(g.current=m)},[m]);const b=i9({...e,elements:{...i,...d&&{reference:d}}}),w=v.useCallback(T=>{const _=pn(T)?{getBoundingClientRect:()=>T.getBoundingClientRect(),contextElement:T}:T;f(_),b.refs.setReference(_)},[b.refs]),j=v.useCallback(T=>{(pn(T)||T===null)&&(g.current=T,c(T)),(pn(b.refs.reference.current)||b.refs.reference.current===null||T!==null&&!pn(T))&&b.refs.setReference(T)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:w,domReference:g}),[b.refs,j,w]),E=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),R=v.useMemo(()=>({...b,...r,refs:C,elements:E,nodeId:t}),[b,C,E,t,r]);return ri(()=>{r.dataRef.current.floatingContext=R;const T=x?.nodesRef.current.find(_=>_.id===t);T&&(T.context=R)}),v.useMemo(()=>({...b,context:R,refs:C,elements:E}),[b,C,E,R])}function T9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:c}=e,{enabled:d=!0,visibleOnly:f=!0}=t,p=v.useRef(!1),m=v.useRef(),g=v.useRef(!0);v.useEffect(()=>{if(!d)return;const b=Rr(c.domReference);function w(){!n&&Gr(c.domReference)&&c.domReference===lC(Ds(c.domReference))&&(p.current=!0)}function j(){g.current=!0}return b.addEventListener("blur",w),b.addEventListener("keydown",j,!0),()=>{b.removeEventListener("blur",w),b.removeEventListener("keydown",j,!0)}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function b(w){let{reason:j}=w;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return i.on("openchange",b),()=>{i.off("openchange",b)}},[i,d]),v.useEffect(()=>()=>{clearTimeout(m.current)},[]);const x=v.useMemo(()=>({onPointerDown(b){iM(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const w=rc(b.nativeEvent);if(f&&pn(w))try{if(aM()&&sM())throw Error();if(!w.matches(":focus-visible"))return}catch{if(!g.current&&!fM(w))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const w=b.relatedTarget,j=b.nativeEvent,C=pn(w)&&w.hasAttribute($x("focus-guard"))&&w.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var E;const R=lC(c.domReference?c.domReference.ownerDocument:document);!w&&R===c.domReference||Xu((E=s.current.floatingContext)==null?void 0:E.refs.floating.current,R)||Xu(c.domReference,R)||C||r(!1,j,"focus")})}}),[s,c.domReference,r,f]);return v.useMemo(()=>d?{reference:x}:{},[d,x])}const wC="active",jC="selected";function qv(e,t,n){const r=new Map,i=n==="item";let s=e;if(i&&e){const{[wC]:c,[jC]:d,...f}=e;s=f}return{...n==="floating"&&{tabIndex:-1,[S9]:""},...s,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(f=>{let[p,m]=f;if(!(i&&[wC,jC].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var x,b=arguments.length,w=new Array(b),j=0;j<b;j++)w[j]=arguments[j];return(x=r.get(p))==null?void 0:x.map(C=>C(...w)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function R9(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),i=v.useCallback(d=>qv(d,e,"reference"),t),s=v.useCallback(d=>qv(d,e,"floating"),n),c=v.useCallback(d=>qv(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:c}),[i,s,c])}const _9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function D9(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:c="dialog"}=t,d=(n=_9.get(c))!=null?n:c,f=JR(),m=Ix()!=null,g=v.useMemo(()=>d==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":r?i:void 0,...d==="listbox"&&{role:"combobox"},...d==="menu"&&{id:f},...d==="menu"&&m&&{role:"menuitem"},...c==="select"&&{"aria-autocomplete":"none"},...c==="combobox"&&{"aria-autocomplete":"list"}},[d,i,m,r,f,c]),x=v.useMemo(()=>{const w={id:i,...d&&{role:d}};return d==="tooltip"||c==="label"?w:{...w,...d==="menu"&&{"aria-labelledby":f}}},[d,i,f,c]),b=v.useCallback(w=>{let{active:j,selected:C}=w;const E={role:"option",...j&&{id:i+"-option"}};switch(c){case"select":return{...E,"aria-selected":j&&C};case"combobox":return{...E,...j&&{"aria-selected":!0}}}return{}},[i,c]);return v.useMemo(()=>s?{reference:g,floating:x,item:b}:{},[s,g,x,b])}const[A9,bo]=gr("ScrollArea.Root component was not found in tree");function pc(e,t){const n=Ts(t);Cc(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const P9=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=bo(),[s,c]=v.useState(0),[d,f]=v.useState(0),p=!!(s&&d);return pc(i.scrollbarX,()=>{const m=i.scrollbarX?.offsetHeight||0;i.onCornerHeightChange(m),f(m)}),pc(i.scrollbarY,()=>{const m=i.scrollbarY?.offsetWidth||0;i.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:s,height:d}}):null}),k9=v.forwardRef((e,t)=>{const n=bo(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(P9,{...e,ref:t}):null}),N9={scrollHideDelay:1e3,type:"hover"},t2=v.forwardRef((e,t)=>{const n=se("ScrollAreaRoot",N9,e),{type:r,scrollHideDelay:i,scrollbars:s,...c}=n,[d,f]=v.useState(null),[p,m]=v.useState(null),[g,x]=v.useState(null),[b,w]=v.useState(null),[j,C]=v.useState(null),[E,R]=v.useState(0),[T,_]=v.useState(0),[P,A]=v.useState(!1),[M,I]=v.useState(!1),V=Bn(t,H=>f(H));return a.jsx(A9,{value:{type:r,scrollHideDelay:i,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:x,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:P,onScrollbarXEnabledChange:A,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:M,onScrollbarYEnabledChange:I,onCornerWidthChange:R,onCornerHeightChange:_},children:a.jsx(ce,{...c,ref:V,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${E}px`,"--sa-corner-height":s!=="xy"?"0px":`${T}px`}})})});t2.displayName="@mantine/core/ScrollAreaRoot";function n2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function bp(e){const t=n2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function r2(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 O9(e,[t,n]){return Math.min(n,Math.max(t,e))}function CC(e,t,n="ltr"){const r=bp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,c=t.content-t.viewport,d=s-r,f=n==="ltr"?[0,c]:[c*-1,0],p=O9(e,f);return r2([0,c],[0,d])(p)}function M9(e,t,n,r="ltr"){const i=bp(n),s=i/2,c=t||s,d=i-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-d,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return r2([f,p],g)(e)}function o2(e,t){return e>0&&e<t}function Ba(e){return e?parseInt(e,10):0}function Is(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[I9,i2]=gr("ScrollAreaScrollbar was not found in tree"),a2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,x=bo(),[b,w]=v.useState(null),j=Bn(t,I=>w(I)),C=v.useRef(null),E=v.useRef(""),{viewport:R}=x,T=n.content-n.viewport,_=Ts(p),P=Ts(d),A=dp(m,10),M=I=>{if(C.current){const V=I.clientX-C.current.left,H=I.clientY-C.current.top;f({x:V,y:H})}};return v.useEffect(()=>{const I=V=>{const H=V.target;b?.contains(H)&&_(V,T)};return document.addEventListener("wheel",I,{passive:!1}),()=>document.removeEventListener("wheel",I,{passive:!1})},[R,b,T,_]),v.useEffect(P,[n,P]),pc(b,A),pc(x.content,A),a.jsx(I9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Ts(i),onThumbPointerUp:Ts(s),onThumbPositionChange:P,onThumbPointerDown:Ts(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Is(e.onPointerDown,I=>{I.preventDefault(),I.button===0&&(I.target.setPointerCapture(I.pointerId),C.current=b.getBoundingClientRect(),E.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(I))}),onPointerMove:Is(e.onPointerMove,M),onPointerUp:Is(e.onPointerUp,I=>{const V=I.target;V.hasPointerCapture(I.pointerId)&&(I.preventDefault(),V.releasePointerCapture(I.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=E.current,C.current=null}})})}),s2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,c=bo(),[d,f]=v.useState(),p=v.useRef(null),m=Bn(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(a2,{"data-orientation":"horizontal",...s,ref:m,sizes:n,style:{...i,"--sa-thumb-width":`${bp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,x)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),o2(b,x)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Ba(d.paddingLeft),paddingEnd:Ba(d.paddingRight)}})}})});s2.displayName="@mantine/core/ScrollAreaScrollbarX";const l2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,c=bo(),[d,f]=v.useState(),p=v.useRef(null),m=Bn(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(a2,{...s,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${bp(n)}px`,...i},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,x)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),o2(b,x)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Ba(d.paddingTop),paddingEnd:Ba(d.paddingBottom)}})}})});l2.displayName="@mantine/core/ScrollAreaScrollbarY";const Sp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:i}=el(),s=bo(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=n2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{d.current=0},onThumbPointerDown:b=>{d.current=b}},x=(b,w)=>M9(b,d.current,f,w);return n==="horizontal"?a.jsx(s2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollLeft,w=CC(b,f,i);c.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=x(b,i))}}):n==="vertical"?a.jsx(l2,{...g,ref:t,onThumbPositionChange:()=>{if(s.viewport&&c.current){const b=s.viewport.scrollTop,w=CC(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=x(b))}}):null});Sp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Ux=v.forwardRef((e,t)=>{const n=bo(),{forceMount:r,...i}=e,[s,c]=v.useState(!1),d=e.orientation==="horizontal",f=dp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return pc(n.viewport,f),pc(n.content,f),r||s?a.jsx(Sp,{"data-state":s?"visible":"hidden",...i,ref:t}):null});Ux.displayName="@mantine/core/ScrollAreaScrollbarAuto";const c2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(),[s,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=i;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),i.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[i.scrollArea,i.scrollHideDelay]),n||s?a.jsx(Ux,{"data-state":s?"visible":"hidden",...r,ref:t}):null});c2.displayName="@mantine/core/ScrollAreaScrollbarHover";const L9=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(),s=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=dp(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,i.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=i,m=s?"scrollLeft":"scrollTop";if(p){let g=p[m];const x=()=>{const b=p[m];g!==b&&(d("scrolling"),f()),g=b};return p.addEventListener("scroll",x),()=>p.removeEventListener("scroll",x)}},[i.viewport,s,f]),n||c!=="hidden"?a.jsx(Sp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Is(e.onPointerEnter,()=>d("interacting")),onPointerLeave:Is(e.onPointerLeave,()=>d("idle"))}):null}),Oy=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=bo(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:c}=i,d=e.orientation==="horizontal";return v.useEffect(()=>(d?s(!0):c(!0),()=>{d?s(!1):c(!1)}),[d,s,c]),i.type==="hover"?a.jsx(c2,{...r,ref:t,forceMount:n}):i.type==="scroll"?a.jsx(L9,{...r,ref:t,forceMount:n}):i.type==="auto"?a.jsx(Ux,{...r,ref:t,forceMount:n}):i.type==="always"?a.jsx(Sp,{...r,ref:t}):null});Oy.displayName="@mantine/core/ScrollAreaScrollbar";function $9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){const s={left:e.scrollLeft,top:e.scrollTop},c=n.left!==s.left,d=n.top!==s.top;(c||d)&&t(),n=s,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}const u2=v.forwardRef((e,t)=>{const{style:n,...r}=e,i=bo(),s=i2(),{onThumbPositionChange:c}=s,d=Bn(t,m=>s.onThumbChange(m)),f=v.useRef(void 0),p=dp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=i;if(m){const g=()=>{if(p(),!f.current){const x=$9(m,c);f.current=x,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[i.viewport,p,c]),a.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Is(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),b=m.clientX-x.left,w=m.clientY-x.top;s.onThumbPointerDown({x:b,y:w})}),onPointerUp:Is(e.onPointerUp,s.onThumbPointerUp)})});u2.displayName="@mantine/core/ScrollAreaThumb";const My=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=i2();return n||i.hasThumb?a.jsx(u2,{ref:t,...r}):null});My.displayName="@mantine/core/ScrollAreaThumb";const d2=v.forwardRef(({children:e,style:t,...n},r)=>{const i=bo(),s=Bn(r,i.onViewportChange);return a.jsx(ce,{...n,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{style:{minWidth:"100%"},ref:i.onContentChange,children:e})})});d2.displayName="@mantine/core/ScrollAreaViewport";var Bx={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const f2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},z9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),Kr=ge((e,t)=>{const n=se("ScrollArea",f2,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:x,viewportRef:b,onScrollPositionChange:w,children:j,offsetScrollbars:C,scrollbars:E,onBottomReached:R,onTopReached:T,overscrollBehavior:_,...P}=n,[A,M]=v.useState(!1),[I,V]=v.useState(!1),[H,Z]=v.useState(!1),K=Me({name:"ScrollArea",props:n,classes:Bx,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:z9}),Q=v.useRef(null),B=l9([b,Q]);return v.useEffect(()=>{if(!Q.current||C!=="present")return;const W=Q.current,N=new ResizeObserver(()=>{const{scrollHeight:L,clientHeight:$,scrollWidth:q,clientWidth:O}=W;V(L>$),Z(q>O)});return N.observe(W),()=>N.disconnect()},[Q,C]),a.jsxs(t2,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:E,...K("root"),...P,children:[a.jsx(d2,{...x,...K("viewport",{style:x?.style}),ref:B,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":E||void 0,"data-horizontal-hidden":C==="present"&&!H?"true":void 0,"data-vertical-hidden":C==="present"&&!I?"true":void 0,onScroll:W=>{x?.onScroll?.(W),w?.({x:W.currentTarget.scrollLeft,y:W.currentTarget.scrollTop});const{scrollTop:N,scrollHeight:L,clientHeight:$}=W.currentTarget;N-(L-$)>=-.6&&R?.(),N===0&&T?.()},children:j}),(E==="xy"||E==="x")&&a.jsx(Oy,{...K("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!H?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:a.jsx(My,{...K("thumb")})}),(E==="xy"||E==="y")&&a.jsx(Oy,{...K("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!I?!0:void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:a.jsx(My,{...K("thumb")})}),a.jsx(k9,{...K("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});Kr.displayName="@mantine/core/ScrollArea";const wp=ge((e,t)=>{const{children:n,classNames:r,styles:i,scrollbarSize:s,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w,scrollbars:j,style:C,vars:E,onBottomReached:R,onTopReached:T,..._}=se("ScrollAreaAutosize",f2,e);return a.jsx(ce,{..._,ref:t,style:[{display:"flex",overflow:"auto"},C],children:a.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:a.jsx(Kr,{classNames:r,styles:i,scrollHideDelay:c,scrollbarSize:s,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w,vars:E,scrollbars:j,onBottomReached:R,onTopReached:T,children:n})})})});Kr.classes=Bx;wp.displayName="@mantine/core/ScrollAreaAutosize";wp.classes=Bx;Kr.Autosize=wp;var h2={root:"m_87cf2631"};const U9={__staticSelector:"UnstyledButton"},er=lr((e,t)=>{const n=se("UnstyledButton",U9,e),{className:r,component:i="button",__staticSelector:s,unstyled:c,classNames:d,styles:f,style:p,...m}=n,g=Me({name:s,props:n,classes:h2,className:r,style:p,classNames:d,styles:f,unstyled:c});return a.jsx(ce,{...g("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...m})});er.classes=h2;er.displayName="@mantine/core/UnstyledButton";var p2={root:"m_515a97f8"};const B9={},Vx=ge((e,t)=>{const n=se("VisuallyHidden",B9,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,...p}=n,m=Me({name:"VisuallyHidden",classes:p2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d});return a.jsx(ce,{component:"span",ref:t,...m("root"),...p})});Vx.classes=p2;Vx.displayName="@mantine/core/VisuallyHidden";var m2={root:"m_1b7284a3"};const V9={},F9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ut(t),"--paper-shadow":yx(n)}}),mr=lr((e,t)=>{const n=se("Paper",V9,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:x,mod:b,...w}=n,j=Me({name:"Paper",props:n,classes:m2,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:F9});return a.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:x,...w})});mr.classes=m2;mr.displayName="@mantine/core/Paper";function g2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}function EC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function TC(e,t,n,r,i){return e==="center"||r==="center"?{left:t}:e==="end"?{[i==="ltr"?"right":"left"]:n}:e==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const H9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function q9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[H9[f]]:r},g=-t/2;return f==="left"?{...m,...EC(p,c,n,i),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...EC(p,c,n,i),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...TC(p,s,n,i,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...TC(p,s,n,i,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Fx=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=el();return s?a.jsx("div",{...p,ref:m,style:{...f,...q9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:g,arrowX:c,arrowY:d})}}):null});Fx.displayName="@mantine/core/FloatingArrow";var v2={root:"m_9814e45f"};const G9={zIndex:Yr("modal")},W9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&uo(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${le(i)})`:void 0,"--overlay-radius":s===void 0?void 0:Ut(s),"--overlay-z-index":c?.toString()}}),mc=lr((e,t)=>{const n=se("Overlay",G9,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:x,zIndex:b,gradient:w,blur:j,color:C,backgroundOpacity:E,mod:R,...T}=n,_=Me({name:"Overlay",props:n,classes:v2,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:W9});return a.jsx(ce,{ref:t,..._("root"),mod:[{center:m,fixed:p},R],...T,children:g})});mc.classes=v2;mc.displayName="@mantine/core/Overlay";function Gv(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 Q9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||Gv(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const i=Gv(n);return i.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(i),i}return Gv(n)}const Y9={},y2=ge((e,t)=>{const{children:n,target:r,reuseTargetNode:i,...s}=se("Portal",Y9,e),[c,d]=v.useState(!1),f=v.useRef(null);return Cc(()=>(d(!0),f.current=Q9({target:r,reuseTargetNode:i,...s}),Yu(t,f.current),!r&&!i&&f.current&&document.body.appendChild(f.current),()=>{!r&&!i&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:Tx.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});y2.displayName="@mantine/core/Portal";const Ya=ge(({withinPortal:e=!0,children:t,...n},r)=>ER()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(y2,{ref:r,...n,children:t}));Ya.displayName="@mantine/core/OptionalPortal";const Mu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),ih={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:{...Mu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Mu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Mu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Mu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Mu("top"),common:{transformOrigin:"top right"}}},RC={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function K9({transition:e,state:t,duration:n,timingFunction:r}){const i={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ih?{transitionProperty:ih[e].transitionProperty,...i,...ih[e].common,...ih[e][RC[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[RC[t]]}}function X9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=yn(),g=bx(),x=m.respectReducedMotion?g:!1,[b,w]=v.useState(x?0:e),[j,C]=v.useState(r?"entered":"exited"),E=v.useRef(-1),R=v.useRef(-1),T=v.useRef(-1);function _(){window.clearTimeout(E.current),window.clearTimeout(R.current),cancelAnimationFrame(T.current)}const P=M=>{_();const I=M?i:s,V=M?c:d,H=x?0:M?e:t;w(H),H===0?(typeof I=="function"&&I(),typeof V=="function"&&V(),C(M?"entered":"exited")):T.current=requestAnimationFrame(()=>{Vu.flushSync(()=>{C(M?"pre-entering":"pre-exiting")}),T.current=requestAnimationFrame(()=>{typeof I=="function"&&I(),C(M?"entering":"exiting"),E.current=window.setTimeout(()=>{typeof V=="function"&&V(),C(M?"entered":"exited")},H)})})},A=M=>{if(_(),typeof(M?f:p)!="number"){P(M);return}R.current=window.setTimeout(()=>{P(M)},M?f:p)};return Vi(()=>{A(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function fi({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:i,children:s,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x}){const b=ER(),{transitionDuration:w,transitionStatus:j,transitionTimingFunction:C}=X9({mounted:i,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x});return w===0||b==="test"?i?a.jsx(a.Fragment,{children:s({})}):e?s({display:"none"}):null:j==="exited"?e?s({display:"none"}):null:a.jsx(a.Fragment,{children:s(K9({transition:t,duration:w,state:j,timingFunction:C}))})}fi.displayName="@mantine/core/Transition";const[Z9,x2]=gr("Popover component was not found in the tree");function jp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const i=C3(t),s=Bn(i,r);return Wi(e)?v.cloneElement(e,{[n]:s}):e}function b2(e){return a.jsx(Vx,{tabIndex:-1,"data-autofocus":!0,...e})}jp.displayName="@mantine/core/FocusTrap";b2.displayName="@mantine/core/FocusTrapInitialFocus";jp.InitialFocus=b2;var S2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const J9={},Hx=ge((e,t)=>{const n=se("PopoverDropdown",J9,e),{className:r,style:i,vars:s,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,x=x2(),b=yR({opened:x.opened,shouldReturnFocus:x.returnFocus}),w=x.withRoles?{"aria-labelledby":x.getTargetId(),id:x.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=Bn(t,x.floating);return x.disabled?null:a.jsx(Ya,{...x.portalProps,withinPortal:x.withinPortal,children:a.jsx(fi,{mounted:x.opened,...x.transitionProps,transition:x.transitionProps?.transition||"fade",duration:x.transitionProps?.duration??150,keepMounted:x.keepMounted,exitDuration:typeof x.transitionProps?.exitDuration=="number"?x.transitionProps.exitDuration:x.transitionProps?.duration,children:C=>a.jsx(jp,{active:x.trapFocus&&x.opened,innerRef:j,children:a.jsxs(ce,{...w,...g,variant:f,onKeyDownCapture:d3(()=>{x.onClose?.(),x.onDismiss?.()},{active:x.closeOnEscape,onTrigger:b,onKeyDown:d}),"data-position":x.placement,"data-fixed":x.floatingStrategy==="fixed"||void 0,...x.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...C,zIndex:x.zIndex,top:x.y??0,left:x.x??0,width:x.width==="target"?void 0:le(x.width)},x.resolvedStyles.dropdown,m?.dropdown,i]}),children:[c,a.jsx(Fx,{ref:x.arrowRef,arrowX:x.arrowX,arrowY:x.arrowY,visible:x.withArrow,position:x.placement,arrowSize:x.arrowSize,arrowRadius:x.arrowRadius,arrowOffset:x.arrowOffset,arrowPosition:x.arrowPosition,...x.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Hx.classes=S2;Hx.displayName="@mantine/core/PopoverDropdown";const e5={refProp:"ref",popupType:"dialog"},w2=ge((e,t)=>{const{children:n,refProp:r,popupType:i,...s}=se("PopoverTarget",e5,e);if(!Wi(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=s,d=x2(),f=Bn(d.reference,hp(n),t),p=d.withRoles?{"aria-haspopup":i,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...d.targetProps,className:It(d.targetProps.className,c.className,n.props.className),[r]:f,...d.controlled?null:{onClick:d.onToggle}})});w2.displayName="@mantine/core/PopoverTarget";function j2({opened:e,floating:t,position:n,positionDependencies:r}){const[i,s]=v.useState(0);v.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return YM(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,i,n]),Vi(()=>{t.update()},r),Vi(()=>{s(c=>c+1)},[e])}function t5(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 n5(e,t){const n=t5(e.middlewares),r=[KR(e.offset)];return n.shift&&r.push(Mx(typeof n.shift=="boolean"?{limiter:vC(),padding:5}:{limiter:vC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?$h():$h(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?qu():qu(n.inline)),r.push(XR({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(s9({...typeof n.size=="boolean"?{}:n.size,apply({rects:i,availableWidth:s,availableHeight:c,...d}){const p=t().refs.floating.current?.style??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:i,availableWidth:s,availableHeight:c,...d}):Object.assign(p,{maxWidth:`${s}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${i.reference.width}px`})}})),r}function r5(e){const[t,n]=Kn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=v.useRef(t),i=()=>{t&&!e.disabled&&n(!1)},s=()=>!e.disabled&&n(!t),c=zx({strategy:e.strategy,placement:e.position,middleware:n5(e,()=>c)});return j2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),Vi(()=>{e.onPositionChange?.(c.placement)},[c.placement]),Vi(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:c,controlled:typeof e.opened=="boolean",opened:t,onClose:i,onToggle:s}}const o5={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:Yr("popover"),__staticSelector:"Popover",width:"max-content"},i5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ut(t),"--popover-shadow":yx(n)}});function zo(e){const t=se("Popover",o5,e),{children:n,position:r,offset:i,onPositionChange:s,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:x,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:E,unstyled:R,classNames:T,styles:_,closeOnClickOutside:P,withinPortal:A,portalProps:M,closeOnEscape:I,clickOutsideEvents:V,trapFocus:H,onClose:Z,onDismiss:K,onOpen:Q,onChange:B,zIndex:W,radius:N,shadow:L,id:$,defaultOpened:q,__staticSelector:O,withRoles:F,disabled:te,returnFocus:ae,variant:je,keepMounted:xe,vars:we,floatingStrategy:Ge,withOverlay:Ee,overlayProps:ot,...et}=t,Ct=Me({name:O,props:t,classes:S2,classNames:T,styles:_,unstyled:R,rootSelector:"dropdown",vars:we,varsResolver:i5}),{resolvedStyles:Ot}=Xs({classNames:T,styles:_,props:t}),Mt=v.useRef(null),[pt,Rt]=v.useState(null),[en,Re]=v.useState(null),{dir:Ae}=el(),Qe=vr($),_e=r5({middlewares:x,width:g,position:g2(Ae,r),offset:typeof i=="number"?i+(b?w/2:0):i,arrowRef:Mt,arrowOffset:j,onPositionChange:s,positionDependencies:c,opened:d,defaultOpened:q,onChange:B,onOpen:Q,onClose:Z,onDismiss:K,strategy:Ge,disabled:te});m3(()=>{P&&(_e.onClose(),K?.())},V,[pt,en]);const he=v.useCallback(Oe=>{Rt(Oe),_e.floating.refs.setReference(Oe)},[_e.floating.refs.setReference]),Se=v.useCallback(Oe=>{Re(Oe),_e.floating.refs.setFloating(Oe)},[_e.floating.refs.setFloating]),$e=v.useCallback(()=>{f?.onExited?.(),p?.()},[f?.onExited,p]),be=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(Z9,{value:{returnFocus:ae,disabled:te,controlled:_e.controlled,reference:he,floating:Se,x:_e.floating.x,y:_e.floating.y,arrowX:_e.floating?.middlewareData?.arrow?.x,arrowY:_e.floating?.middlewareData?.arrow?.y,opened:_e.opened,arrowRef:Mt,transitionProps:{...f,onExited:$e,onEntered:be},width:g,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:E,placement:_e.floating.placement,trapFocus:H,withinPortal:A,portalProps:M,zIndex:W,radius:N,shadow:L,closeOnEscape:I,onDismiss:K,onClose:_e.onClose,onToggle:_e.onToggle,getTargetId:()=>`${Qe}-target`,getDropdownId:()=>`${Qe}-dropdown`,withRoles:F,targetProps:et,__staticSelector:O,classNames:T,styles:_,unstyled:R,variant:je,keepMounted:xe,getStyles:Ct,resolvedStyles:Ot,floatingStrategy:Ge},children:[n,Ee&&a.jsx(fi,{transition:"fade",mounted:_e.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:Oe=>a.jsx(Ya,{withinPortal:A,children:a.jsx(mc,{...ot,...Ct("overlay",{className:ot?.className,style:[Oe,ot?.style]})})})})]})}zo.Target=w2;zo.Dropdown=Hx;zo.displayName="@mantine/core/Popover";zo.extend=e=>e;var No={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 C2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:It(No.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:No.bar}),a.jsx("span",{className:No.bar}),a.jsx("span",{className:No.bar})]}));C2.displayName="@mantine/core/Bars";const E2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:It(No.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:No.dot}),a.jsx("span",{className:No.dot}),a.jsx("span",{className:No.dot})]}));E2.displayName="@mantine/core/Dots";const T2=v.forwardRef(({className:e,...t},n)=>a.jsx(ce,{component:"span",className:It(No.ovalLoader,e),...t,ref:n}));T2.displayName="@mantine/core/Oval";const R2={bars:C2,oval:T2,dots:E2},a5={loaders:R2,type:"oval"},s5=(e,{size:t,color:n})=>({root:{"--loader-size":nt(t,"loader-size"),"--loader-color":n?Ft(n,e):void 0}}),Dr=ge((e,t)=>{const n=se("Loader",a5,e),{size:r,color:i,type:s,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:x,variant:b,children:w,...j}=n,C=Me({name:"Loader",props:n,classes:No,className:d,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:s5});return w?a.jsx(ce,{...C("root"),ref:t,...j,children:w}):a.jsx(ce,{...C("root"),ref:t,component:x[s],variant:b,size:r,...j})});Dr.defaultLoaders=R2;Dr.classes=No;Dr.displayName="@mantine/core/Loader";var Rc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const _C={orientation:"horizontal"},l5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),qx=ge((e,t)=>{const n=se("ActionIconGroup",_C,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=se("ActionIconGroup",_C,e),w=Me({name:"ActionIconGroup",props:n,classes:Rc,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:p,varsResolver:l5,rootSelector:"group"});return a.jsx(ce,{...w("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});qx.classes=Rc;qx.displayName="@mantine/core/ActionIconGroup";const DC={},c5=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":Nn(c),"--section-radius":t===void 0?void 0:Ut(t),"--section-bg":n||i?d.background:void 0,"--section-color":d.color,"--section-bd":n||i?d.border:void 0}}},Gx=ge((e,t)=>{const n=se("ActionIconGroupSection",DC,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=se("ActionIconGroupSection",DC,e),w=Me({name:"ActionIconGroupSection",props:n,classes:Rc,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,varsResolver:c5,rootSelector:"groupSection"});return a.jsx(ce,{...w("groupSection"),ref:t,variant:p,...b})});Gx.classes=Rc;Gx.displayName="@mantine/core/ActionIconGroupSection";const u5={},d5=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":nt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ut(n),"--ai-bg":s||r?d.background:void 0,"--ai-hover":s||r?d.hover:void 0,"--ai-hover-color":s||r?d.hoverColor:void 0,"--ai-color":d.color,"--ai-bd":s||r?d.border:void 0}}},_n=lr((e,t)=>{const n=se("ActionIcon",u5,e),{className:r,unstyled:i,variant:s,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:x,radius:b,__staticSelector:w,gradient:j,vars:C,children:E,disabled:R,"data-disabled":T,autoContrast:_,mod:P,...A}=n,M=Me({name:["ActionIcon",w],props:n,className:r,style:f,classes:Rc,classNames:c,styles:d,unstyled:i,vars:C,varsResolver:d5});return a.jsxs(er,{...M("root",{active:!R&&!p&&!T}),...A,unstyled:i,variant:s,size:g,disabled:R||p,ref:t,mod:[{loading:p,disabled:R||T},P],children:[a.jsx(fi,{mounted:!!p,transition:"slide-down",duration:150,children:I=>a.jsx(ce,{component:"span",...M("loader",{style:I}),"aria-hidden":!0,children:a.jsx(Dr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ce,{component:"span",mod:{loading:p},...M("icon"),children:E})]})});_n.classes=Rc;_n.displayName="@mantine/core/ActionIcon";_n.Group=qx;_n.GroupSection=Gx;const _2=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>a.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:a.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"})}));_2.displayName="@mantine/core/CloseIcon";var D2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const f5={variant:"subtle"},h5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":nt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ut(n),"--cb-icon-size":le(r)}}),Ka=lr((e,t)=>{const n=se("CloseButton",f5,e),{iconSize:r,children:i,vars:s,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":x,disabled:b,variant:w,icon:j,mod:C,__staticSelector:E,...R}=n,T=Me({name:E||"CloseButton",props:n,className:d,style:p,classes:D2,classNames:f,styles:m,unstyled:g,vars:s,varsResolver:h5});return a.jsxs(er,{ref:t,...R,unstyled:g,variant:w,disabled:b,mod:[{disabled:b||x},C],...T("root",{variant:w,active:!b&&!x}),children:[j||a.jsx(_2,{}),i]})});Ka.classes=D2;Ka.displayName="@mantine/core/CloseButton";function p5(e){return v.Children.toArray(e).filter(Boolean)}var A2={root:"m_4081bf90"};const m5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},g5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:s,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":kn(r),"--group-align":i,"--group-justify":s,"--group-wrap":c}}),ye=ge((e,t)=>{const n=se("Group",m5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:x,grow:b,preventGrowOverflow:w,vars:j,variant:C,__size:E,mod:R,...T}=n,_=p5(f),P=_.length,A=kn(p??"md"),I={childWidth:`calc(${100/P}% - (${A} - ${A} / ${P}))`},V=Me({name:"Group",props:n,stylesCtx:I,className:i,style:s,classes:A2,classNames:r,styles:c,unstyled:d,vars:j,varsResolver:g5});return a.jsx(ce,{...V("root"),ref:t,variant:C,mod:[{grow:b},R],size:E,...T,children:_})});ye.classes=A2;ye.displayName="@mantine/core/Group";const[v5,Zi]=gr("ModalBase component was not found in tree");function y5({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),i=v.useRef(-1),c=bx()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(i.current)):c===0?r(!1):i.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(i.current)),[e,c]),n}function x5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:s,returnFocus:c}){const d=vr(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),x=typeof t?.duration=="number"?t?.duration:200,b=y5({opened:n,transitionDuration:x});return wR("keydown",w=>{w.key==="Escape"&&i&&!w.isComposing&&n&&w.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&s()},{capture:!0}),yR({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const P2=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:s,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:x,lockScroll:b,children:w,zIndex:j,shadow:C,padding:E,__vars:R,unstyled:T,removeScrollProps:_,...P},A)=>{const{_id:M,titleMounted:I,bodyMounted:V,shouldLockScroll:H,setTitleMounted:Z,setBodyMounted:K}=x5({id:r,transitionProps:i,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:Q,...B}=_||{};return a.jsx(Ya,{...x,withinPortal:g,children:a.jsx(v5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:s,onEnterTransitionEnd:c,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:I,bodyMounted:V,setTitleMounted:Z,setBodyMounted:K,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:T},children:a.jsx(fc,{enabled:H&&b,...B,children:a.jsx(ce,{ref:A,...P,__vars:{...R,"--mb-z-index":(j||Yr("modal")).toString(),"--mb-shadow":yx(C),"--mb-padding":kn(E)},children:w})},Q)})})});P2.displayName="@mantine/core/ModalBase";function b5(){const e=Zi();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var gc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const k2=v.forwardRef(({className:e,...t},n)=>{const r=b5(),i=Zi();return a.jsx(ce,{ref:n,...t,id:r,className:It({[gc.body]:!i.unstyled},e)})});k2.displayName="@mantine/core/ModalBaseBody";const N2=v.forwardRef(({className:e,onClick:t,...n},r)=>{const i=Zi();return a.jsx(Ka,{ref:r,...n,onClick:s=>{i.onClose(),t?.(s)},className:It({[gc.close]:!i.unstyled},e),unstyled:i.unstyled})});N2.displayName="@mantine/core/ModalBaseCloseButton";const O2=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...s},c)=>{const d=Zi();return a.jsx(fi,{mounted:d.opened,transition:"pop",...d.transitionProps,onExited:()=>{d.onExitTransitionEnd?.(),d.transitionProps?.onExited?.()},onEntered:()=>{d.onEnterTransitionEnd?.(),d.transitionProps?.onEntered?.()},...e,children:f=>a.jsx("div",{...n,className:It({[gc.inner]:!d.unstyled},n.className),children:a.jsx(jp,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(mr,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":d.bodyMounted?d.getBodyId():void 0,"aria-labelledby":d.titleMounted?d.getTitleId():void 0,style:[i,f],className:It({[gc.content]:!d.unstyled},t),unstyled:d.unstyled,children:s.children})})})})});O2.displayName="@mantine/core/ModalBaseContent";const M2=v.forwardRef(({className:e,...t},n)=>{const r=Zi();return a.jsx(ce,{component:"header",ref:n,className:It({[gc.header]:!r.unstyled},e),...t})});M2.displayName="@mantine/core/ModalBaseHeader";const S5={duration:200,timingFunction:"ease",transition:"fade"};function w5(e){const t=Zi();return{...S5,...t.transitionProps,...e}}const I2=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...i},s)=>{const c=Zi(),d=w5(t);return a.jsx(fi,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(mc,{ref:s,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...i})})});I2.displayName="@mantine/core/ModalBaseOverlay";function j5(){const e=Zi();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const L2=v.forwardRef(({className:e,...t},n)=>{const r=j5(),i=Zi();return a.jsx(ce,{component:"h2",ref:n,className:It({[gc.title]:!i.unstyled},e),...t,id:r})});L2.displayName="@mantine/core/ModalBaseTitle";function C5({children:e}){return a.jsx(a.Fragment,{children:e})}const[E5,T5]=Qi({size:"sm"}),R5={},$2=ge((e,t)=>{const n=se("InputClearButton",R5,e),{size:r,variant:i,vars:s,classNames:c,styles:d,...f}=n,p=T5(),{resolvedClassNames:m,resolvedStyles:g}=Xs({classNames:c,styles:d,props:n});return a.jsx(Ka,{variant:i||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});$2.displayName="@mantine/core/InputClearButton";const[_5,_c]=Qi({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var So={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 AC={},D5=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Nn(t)} - ${le(2)})`}}),Cp=ge((e,t)=>{const n=se("InputDescription",AC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=se("InputDescription",AC,n),w=_c(),j=Me({name:["InputWrapper",m],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"description",vars:f,varsResolver:D5}),C=g&&w?.getStyles||j;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("description",w?.getStyles?{className:i,style:s}:void 0),...b})});Cp.classes=So;Cp.displayName="@mantine/core/InputDescription";const A5={},P5=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Nn(t)} - ${le(2)})`}}),Ep=ge((e,t)=>{const n=se("InputError",A5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=n,w=Me({name:["InputWrapper",m],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"error",vars:f,varsResolver:P5}),j=_c(),C=g&&j?.getStyles||w;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("error",j?.getStyles?{className:i,style:s}:void 0),...b})});Ep.classes=So;Ep.displayName="@mantine/core/InputError";const PC={labelElement:"label"},k5=(e,{size:t})=>({label:{"--input-label-size":Nn(t),"--input-asterisk-color":void 0}}),hd=ge((e,t)=>{const n=se("InputLabel",PC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:x,onMouseDown:b,children:w,__staticSelector:j,variant:C,mod:E,...R}=se("InputLabel",PC,n),T=Me({name:["InputWrapper",j],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"label",vars:f,varsResolver:k5}),_=_c(),P=_?.getStyles||T;return a.jsxs(ce,{...P("label",_?.getStyles?{className:i,style:s}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?x:void 0,mod:[{required:g},E],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...R,children:[w,g&&a.jsx("span",{...P("required"),"aria-hidden":!0,children:" *"})]})});hd.classes=So;hd.displayName="@mantine/core/InputLabel";const kC={},Wx=ge((e,t)=>{const n=se("InputPlaceholder",kC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:x,...b}=se("InputPlaceholder",kC,n),w=Me({name:["InputPlaceholder",p],props:n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"placeholder"});return a.jsx(ce,{...w("placeholder"),mod:[{error:!!g},x],component:"span",variant:m,ref:t,...b})});Wx.classes=So;Wx.displayName="@mantine/core/InputPlaceholder";function N5(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),i=e.slice(0,r),s=e.slice(r+1),c=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:c}}const O5={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},M5=(e,{size:t})=>({label:{"--input-label-size":Nn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Nn(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Nn(t)} - ${le(2)})`}}),Qx=ge((e,t)=>{const n=se("InputWrapper",O5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:x,inputWrapperOrder:b,label:w,error:j,description:C,labelProps:E,descriptionProps:R,errorProps:T,labelElement:_,children:P,withAsterisk:A,id:M,required:I,__stylesApiProps:V,mod:H,...Z}=n,K=Me({name:["InputWrapper",g],props:V||n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:M5}),Q={size:p,variant:m,__staticSelector:g},B=vr(M),W=typeof A=="boolean"?A:I,N=T?.id||`${B}-error`,L=R?.id||`${B}-description`,$=B,q=!!j&&typeof j!="boolean",O=!!C,F=`${q?N:""} ${O?L:""}`,te=F.trim().length>0?F.trim():void 0,ae=E?.id||`${B}-label`,je=w&&a.jsx(hd,{labelElement:_,id:ae,htmlFor:$,required:W,...Q,...E,children:w},"label"),xe=O&&a.jsx(Cp,{...R,...Q,size:R?.size||Q.size,id:R?.id||L,children:C},"description"),we=a.jsx(v.Fragment,{children:x(P)},"input"),Ge=q&&v.createElement(Ep,{...T,...Q,size:T?.size||Q.size,key:"error",id:T?.id||N},j),Ee=b.map(ot=>{switch(ot){case"label":return je;case"input":return we;case"description":return xe;case"error":return Ge;default:return null}});return a.jsx(_5,{value:{getStyles:K,describedBy:te,inputId:$,labelId:ae,...N5(b,{hasDescription:O,hasError:q})},children:a.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},H],...K("root"),...Z,children:Ee})})});Qx.classes=So;Qx.displayName="@mantine/core/InputWrapper";const I5={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},L5=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":nt(t.size,"input-height"),"--input-fz":Nn(t.size),"--input-radius":t.radius===void 0?void 0:Ut(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?nt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),fn=lr((e,t)=>{const n=se("Input",I5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:x,error:b,disabled:w,leftSection:j,leftSectionProps:C,leftSectionWidth:E,rightSection:R,rightSectionProps:T,rightSectionWidth:_,rightSectionPointerEvents:P,leftSectionPointerEvents:A,variant:M,vars:I,pointer:V,multiline:H,radius:Z,id:K,withAria:Q,withErrorStyles:B,mod:W,inputSize:N,__clearSection:L,__clearable:$,__defaultRightSection:q,...O}=n,{styleProps:F,rest:te}=Xi(O),ae=_c(),je={offsetBottom:ae?.offsetBottom,offsetTop:ae?.offsetTop},xe=Me({name:["Input",p],props:m||n,classes:So,className:i,style:s,classNames:r,styles:c,unstyled:d,stylesCtx:je,rootSelector:"wrapper",vars:I,varsResolver:L5}),we=Q?{required:f,disabled:w,"aria-invalid":!!b,"aria-describedby":ae?.describedBy,id:ae?.inputId||K}:{},Ge=R||$&&L||q;return a.jsx(E5,{value:{size:g||"sm"},children:a.jsxs(ce,{...xe("wrapper"),...F,...x,mod:[{error:!!b&&B,pointer:V,disabled:w,multiline:H,"data-with-right-section":!!Ge,"data-with-left-section":!!j},W],variant:M,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...xe("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(ce,{component:"input",...te,...we,ref:t,required:f,mod:{disabled:w,error:!!b&&B},variant:M,__size:N,...xe("input")}),Ge&&a.jsx("div",{...T,"data-position":"right",...xe("section",{className:T?.className,style:T?.style}),children:Ge})]})})});fn.classes=So;fn.Wrapper=Qx;fn.Label=hd;fn.Error=Ep;fn.Description=Cp;fn.Placeholder=Wx;fn.ClearButton=$2;fn.displayName="@mantine/core/Input";function $5(e,t,n){const r=se(e,t,n),{label:i,description:s,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:x,__stylesApiProps:b,errorProps:w,labelProps:j,descriptionProps:C,wrapperProps:E,id:R,size:T,style:_,inputContainer:P,inputWrapperOrder:A,withAsterisk:M,variant:I,vars:V,mod:H,...Z}=r,{styleProps:K,rest:Q}=Xi(Z),B={label:i,description:s,error:c,required:d,classNames:f,className:m,__staticSelector:x,__stylesApiProps:b||r,errorProps:w,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:T,style:_,inputContainer:P,inputWrapperOrder:A,withAsterisk:M,variant:I,id:R,mod:H,...E};return{...Q,classNames:f,styles:p,unstyled:g,wrapperProps:{...B,...K},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:T,__staticSelector:x,__stylesApiProps:b||r,error:c,variant:I,id:R}}}const z5={__staticSelector:"InputBase",withAria:!0},Pr=lr((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=$5("InputBase",z5,e);return a.jsx(fn.Wrapper,{...r,children:a.jsx(fn,{...n,...i,ref:t})})});Pr.classes={...fn.classes,...fn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const U5={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 z2={root:"m_8bffd616"};const B5={},Ha=lr((e,t)=>{const n=se("Flex",B5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:w,direction:j,...C}=n,E=Me({name:"Flex",classes:z2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f}),R=yn(),T=dd(),_=AR({styleProps:{gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:w,direction:j},theme:R,data:U5});return a.jsxs(a.Fragment,{children:[_.hasResponsiveStyles&&a.jsx(Js,{selector:`.${T}`,styles:_.styles,media:_.media}),a.jsx(ce,{ref:t,...E("root",{className:T,style:Qa(_.inlineStyles)}),...C})]})});Ha.classes=z2;Ha.displayName="@mantine/core/Flex";function V5(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 F5({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const i=v.useRef(-1),[s,c]=v.useState(!1),[d,f]=v.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),w=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),E=Ba(j.borderTopWidth)+Ba(C.borderTopWidth),R=Ba(j.borderLeftWidth)+Ba(C.borderLeftWidth),T={top:b.top-w.top-E,left:b.left-w.left-R,width:b.width,height:b.height};n.current.style.transform=`translateY(${T.top}px) translateX(${T.left}px)`,n.current.style.width=`${T.width}px`,n.current.style.height=`${T.height}px`},m=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),x=v.useRef(null);return v.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(x.current=new ResizeObserver(m),x.current.observe(t)),()=>{g.current?.disconnect(),x.current?.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const b=w=>{V5(w.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),O3(()=>{jR()!=="test"&&c(!0)},20,{autoInvoke:!0}),M3(b=>{b.forEach(w=>{w.type==="attributes"&&w.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:d}}var U2={root:"m_96b553a6"};const H5={},q5=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Yx=ge((e,t)=>{const n=se("FloatingIndicator",H5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:x,displayAfterTransitionEnd:b,...w}=n,j=Me({name:"FloatingIndicator",classes:U2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:q5}),C=v.useRef(null),{initialized:E,hidden:R}=F5({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),T=Bn(t,C);return!p||!m?null:a.jsx(ce,{ref:T,mod:[{initialized:E,hidden:R},x],...j("root"),...w})});Yx.displayName="@mantine/core/FloatingIndicator";Yx.classes=U2;var B2={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 G5={},W5=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Ut(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},Ji=ge((e,t)=>{const n=se("Alert",G5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:x,id:b,icon:w,withCloseButton:j,onClose:C,closeButtonLabel:E,variant:R,autoContrast:T,..._}=n,P=Me({name:"Alert",classes:B2,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:W5}),A=vr(b),M=g&&`${A}-title`||void 0,I=`${A}-body`;return a.jsx(ce,{id:A,...P("root",{variant:R}),variant:R,ref:t,..._,role:"alert","aria-describedby":I,"aria-labelledby":M,children:a.jsxs("div",{...P("wrapper"),children:[w&&a.jsx("div",{...P("icon"),children:w}),a.jsxs("div",{...P("body"),children:[g&&a.jsx("div",{...P("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:M,...P("label"),children:g})}),x&&a.jsx("div",{id:I,...P("message"),"data-variant":R,children:x})]}),j&&a.jsx(Ka,{...P("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":E,unstyled:d})]})})});Ji.classes=B2;Ji.displayName="@mantine/core/Alert";var V2={root:"m_b6d8b162"};function Q5(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const Y5={inherit:!1},K5=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:s})=>({root:{"--text-fz":Nn(i),"--text-lh":mR(i),"--text-gradient":t==="gradient"?Ey(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?Ft(s,e):void 0}}),Pe=lr((e,t)=>{const n=se("Text",Y5,e),{lineClamp:r,truncate:i,inline:s,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:x,classNames:b,styles:w,unstyled:j,variant:C,mod:E,size:R,...T}=n,_=Me({name:["Text",p],props:n,classes:V2,className:g,style:x,classNames:b,styles:w,unstyled:j,vars:m,varsResolver:K5});return a.jsx(ce,{..._("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":Q5(i),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":c},E],size:R,...T})});Pe.classes=V2;Pe.displayName="@mantine/core/Text";var F2={root:"m_849cf0da"};const X5={underline:"hover"},Dt=lr((e,t)=>{const{underline:n,className:r,unstyled:i,mod:s,...c}=se("Anchor",X5,e);return a.jsx(Pe,{component:"a",ref:t,className:It({[F2.root]:!i},r),...c,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:i})});Dt.classes=F2;Dt.displayName="@mantine/core/Anchor";const[Z5,Dc]=gr("AppShell was not found in tree");var Xa={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const J5={},Kx=ge((e,t)=>{const n=se("AppShellAside",J5,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Dc();return b.disabled?null:a.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:i,classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});Kx.classes=Xa;Kx.displayName="@mantine/core/AppShellAside";const e7={},Xx=ge((e,t)=>{const n=se("AppShellFooter",e7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Dc();return b.disabled?null:a.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:It({[fc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-footer-z-index":(m??b.zIndex)?.toString()}})});Xx.classes=Xa;Xx.displayName="@mantine/core/AppShellFooter";const t7={},Zx=ge((e,t)=>{const n=se("AppShellHeader",t7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Dc();return b.disabled?null:a.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:It({[fc.classNames.zeroRight]:b.offsetScrollbars},i),classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-header-z-index":(m??b.zIndex)?.toString()}})});Zx.classes=Xa;Zx.displayName="@mantine/core/AppShellHeader";const n7={},Jx=ge((e,t)=>{const n=se("AppShellMain",n7,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Dc();return a.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:i,style:s,classNames:r,styles:c}),...f})});Jx.classes=Xa;Jx.displayName="@mantine/core/AppShellMain";function pd(e){return typeof e=="object"?e.base:e}function md(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 gd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function r7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i}){const s=r?.width,c="translateX(var(--app-shell-aside-width))",d="translateX(calc(var(--app-shell-aside-width) * -1))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-aside-width"]="100%",n[r?.breakpoint]["--app-shell-aside-offset"]="0px"),md(s)){const f=le(pd(s));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(gd(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=le(s.base),e["--app-shell-aside-offset"]=le(s.base)),on(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=le(s[f]),t[f]["--app-shell-aside-offset"]=le(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=c,t[f]["--app-shell-aside-transform-rtl"]=d,t[f]["--app-shell-aside-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=xx(r.breakpoint,i.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=c,n[f]["--app-shell-aside-transform-rtl"]=d}}function o7({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,i="translateY(var(--app-shell-footer-height))",s=n?.offset??!0;if(md(r)){const c=le(pd(r));e["--app-shell-footer-height"]=c,s&&(e["--app-shell-footer-offset"]=c)}gd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),s&&(e["--app-shell-footer-offset"]=le(r.base))),on(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),s&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=i,e["--app-shell-footer-offset"]="0px !important")}function i7({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,i="translateY(calc(var(--app-shell-header-height) * -1))",s=n?.offset??!0;if(md(r)){const c=le(pd(r));e["--app-shell-header-height"]=c,s&&(e["--app-shell-header-offset"]=c)}gd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),s&&(e["--app-shell-header-offset"]=le(r.base))),on(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),s&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-header-transform"]=i,e["--app-shell-header-offset"]="0px !important")}function a7({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i}){const s=r?.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",d="translateX(var(--app-shell-navbar-width))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-navbar-width"]="100%",n[r?.breakpoint]["--app-shell-navbar-offset"]="0px"),md(s)){const f=le(pd(s));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(gd(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=le(s.base),e["--app-shell-navbar-offset"]=le(s.base)),on(s).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=le(s[f]),t[f]["--app-shell-navbar-offset"]=le(s[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=c,t[f]["--app-shell-navbar-transform-rtl"]=d,t[f]["--app-shell-navbar-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=xx(r.breakpoint,i.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=c,n[f]["--app-shell-navbar-transform-rtl"]=d}}function Wv(e){return Number(e)===0?"0px":kn(e)}function s7({padding:e,baseStyles:t,minMediaStyles:n}){md(e)&&(t["--app-shell-padding"]=Wv(pd(e))),gd(e)&&(e.base&&(t["--app-shell-padding"]=Wv(e.base)),on(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Wv(e[r]))}))}function l7({navbar:e,header:t,footer:n,aside:r,padding:i,theme:s}){const c={},d={},f={};a7({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:s}),r7({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:s}),i7({baseStyles:f,minMediaStyles:c,header:t}),o7({baseStyles:f,minMediaStyles:c,footer:n}),s7({baseStyles:f,minMediaStyles:c,padding:i});const p=Qu(on(c),s.breakpoints).map(x=>({query:`(min-width: ${Ah(x.px)})`,styles:c[x.value]})),m=Qu(on(d),s.breakpoints).map(x=>({query:`(max-width: ${Ah(x.px)})`,styles:d[x.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function c7({navbar:e,header:t,aside:n,footer:r,padding:i}){const s=yn(),c=Yi(),{media:d,baseStyles:f}=l7({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s});return a.jsx(Js,{media:d,styles:f,selector:c.cssVariablesSelector})}const u7={},e0=ge((e,t)=>{const n=se("AppShellNavbar",u7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Dc();return b.disabled?null:a.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:i,classNames:r,styles:c,style:s}),...x,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});e0.classes=Xa;e0.displayName="@mantine/core/AppShellNavbar";const d7={},t0=lr((e,t)=>{const n=se("AppShellSection",d7,e),{classNames:r,className:i,style:s,styles:c,vars:d,grow:f,mod:p,...m}=n,g=Dc();return a.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:i,style:s,classNames:r,styles:c}),...m})});t0.classes=Xa;t0.displayName="@mantine/core/AppShellSection";function f7({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),i=v.useRef(-1),s=v.useRef(-1);return wR("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Cc(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const h7={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Yr("app")},p7=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),_r=ge((e,t)=>{const n=se("AppShell",h7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:x,transitionTimingFunction:b,header:w,zIndex:j,layout:C,disabled:E,aside:R,footer:T,offsetScrollbars:_=C!=="alt",mod:P,...A}=n,M=Me({name:"AppShell",classes:Xa,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:p7}),I=f7({disabled:E,transitionDuration:x});return a.jsxs(Z5,{value:{getStyles:M,withBorder:m,zIndex:j,disabled:E,offsetScrollbars:_},children:[a.jsx(c7,{navbar:p,header:w,aside:R,footer:T,padding:g}),a.jsx(ce,{ref:t,...M("root"),mod:[{resizing:I,layout:C,disabled:E},P],...A})]})});_r.classes=Xa;_r.displayName="@mantine/core/AppShell";_r.Navbar=e0;_r.Header=Zx;_r.Main=Jx;_r.Aside=Kx;_r.Footer=Xx;_r.Section=t0;function H2(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=>H2(t))}:e}function q2(e){return e?e.map(t=>H2(t)):[]}function G2(e){return e.reduce((t,n)=>"group"in n?{...t,...G2(n.items)}:(t[n.value]=n,t),{})}var Ar={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 m7={error:null},g7=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":nt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ft(n,e):void 0}}),Tp=ge((e,t)=>{const n=se("ComboboxChevron",m7,e),{size:r,error:i,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...x}=n,b=Me({name:"ComboboxChevron",classes:Ar,props:n,style:s,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:g7,rootSelector:"chevron"});return a.jsx(ce,{component:"svg",...x,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},g],ref:t,children:a.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"})})});Tp.classes=Ar;Tp.displayName="@mantine/core/ComboboxChevron";const[v7,wo]=gr("Combobox component was not found in tree"),W2=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},s)=>a.jsx(fn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));W2.displayName="@mantine/core/ComboboxClearButton";const y7={},n0=ge((e,t)=>{const{classNames:n,styles:r,className:i,style:s,hidden:c,...d}=se("ComboboxDropdown",y7,e),f=wo();return a.jsx(zo.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:i,style:s,classNames:n,styles:r})})});n0.classes=Ar;n0.displayName="@mantine/core/ComboboxDropdown";const x7={refProp:"ref"},Q2=ge((e,t)=>{const{children:n,refProp:r}=se("ComboboxDropdownTarget",x7,e);if(wo(),!Wi(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 a.jsx(zo.Target,{ref:t,refProp:r,children:n})});Q2.displayName="@mantine/core/ComboboxDropdownTarget";const b7={},r0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("ComboboxEmpty",b7,e),f=wo();return a.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:s,style:i}),...d})});r0.classes=Ar;r0.displayName="@mantine/core/ComboboxEmpty";function o0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:s}){const c=wo(),[d,f]=v.useState(null),p=g=>{if(e?.(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const x=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&x!==-1?(g.preventDefault(),c.store.clickSelectedOption()):i==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&i==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(c.store.listId&&c.store.dropdownOpened)||void 0,"aria-controls":c.store.dropdownOpened?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&d||void 0,autoComplete:s,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const S7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},Y2=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=se("ComboboxEventsTarget",S7,e);if(!Wi(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=wo(),g=o0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:Bn(t,m.store.targetRef,hp(n))})});Y2.displayName="@mantine/core/ComboboxEventsTarget";const w7={},i0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("ComboboxFooter",w7,e),f=wo();return a.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:i,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});i0.classes=Ar;i0.displayName="@mantine/core/ComboboxFooter";const j7={},a0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,children:d,label:f,...p}=se("ComboboxGroup",j7,e),m=wo();return a.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:i,styles:s}),...p,children:[f&&a.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:s}),children:f}),d]})});a0.classes=Ar;a0.displayName="@mantine/core/ComboboxGroup";const C7={},s0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("ComboboxHeader",C7,e),f=wo();return a.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:i,styles:s}),...d,onMouseDown:p=>{p.preventDefault()}})});s0.classes=Ar;s0.displayName="@mantine/core/ComboboxHeader";function K2({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}K2.displayName="@mantine/core/ComboboxHiddenInput";const E7={},l0=ge((e,t)=>{const n=se("ComboboxOption",E7,e),{classNames:r,className:i,style:s,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:x,disabled:b,selected:w,mod:j,...C}=n,E=wo(),R=v.useId(),T=p||R;return a.jsx(ce,{...E.getStyles("option",{className:i,classNames:r,styles:c,style:s}),...C,ref:t,id:T,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":w},j],role:"option",onClick:_=>{b?_.preventDefault():(E.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{E.resetSelectionOnOptionHover&&E.store.resetSelectedOption(),x?.(_)}})});l0.classes=Ar;l0.displayName="@mantine/core/ComboboxOption";const T7={},c0=ge((e,t)=>{const n=se("ComboboxOptions",T7,e),{classNames:r,className:i,style:s,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=wo(),x=vr(d);return v.useEffect(()=>{g.store.setListId(x)},[x]),a.jsx(ce,{ref:t,...g.getStyles("options",{className:i,style:s,classNames:r,styles:c}),...m,id:x,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});c0.classes=Ar;c0.displayName="@mantine/core/ComboboxOptions";const R7={withAriaAttributes:!0,withKeyboardNavigation:!0},u0=ge((e,t)=>{const n=se("ComboboxSearch",R7,e),{classNames:r,styles:i,unstyled:s,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,x=wo(),b=x.getStyles("search"),w=o0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(fn,{ref:Bn(t,x.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},i],size:m||x.size,...w,...g,__staticSelector:"Combobox"})});u0.classes=Ar;u0.displayName="@mantine/core/ComboboxSearch";const _7={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},X2=ge((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=se("ComboboxTarget",_7,e);if(!Wi(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=wo(),g=o0({targetType:d,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),x=v.cloneElement(n,{...g,...p});return a.jsx(zo.Target,{ref:Bn(t,m.store.targetRef),children:x})});X2.displayName="@mantine/core/ComboboxTarget";function D7(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 A7(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 P7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function vd({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:s=!0,scrollBehavior:c="instant"}={}){const[d,f]=Kn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),x=v.useRef(null),b=v.useRef(-1),w=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((N="unknown")=>{d||(f(!0),i?.(N))},[f,i,d]),E=v.useCallback((N="unknown")=>{d&&(f(!1),r?.(N))},[f,r,d]),R=v.useCallback((N="unknown")=>{d?E(N):C(N)},[E,C,d]),T=v.useCallback(()=>{const N=document.querySelector(`#${p.current} [data-combobox-selected]`);N?.removeAttribute("data-combobox-selected"),N?.removeAttribute("aria-selected")},[]),_=v.useCallback(N=>{const $=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!$)return null;const q=N>=$.length?0:N<0?$.length-1:N;return m.current=q,$?.[q]&&!$[q].hasAttribute("data-combobox-disabled")?(T(),$[q].setAttribute("data-combobox-selected","true"),$[q].setAttribute("aria-selected","true"),$[q].scrollIntoView({block:"nearest",behavior:c}),$[q].id):null},[c,T]),P=v.useCallback(()=>{const N=document.querySelector(`#${p.current} [data-combobox-active]`);if(N){const L=document.querySelectorAll(`#${p.current} [data-combobox-option]`),$=Array.from(L).findIndex(q=>q===N);return _($)}return _(0)},[_]),A=v.useCallback(()=>_(A7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[_,s]),M=v.useCallback(()=>_(D7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[_,s]),I=v.useCallback(()=>_(P7(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[_]),V=v.useCallback((N="selected",L)=>{j.current=window.setTimeout(()=>{const $=document.querySelectorAll(`#${p.current} [data-combobox-option]`),q=Array.from($).findIndex(O=>O.hasAttribute(`data-combobox-${N}`));m.current=q,L?.scrollIntoView&&$[q]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),H=v.useCallback(()=>{m.current=-1,T()},[T]),Z=v.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[m.current]?.click()},[]),K=v.useCallback(N=>{p.current=N},[]),Q=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),B=v.useCallback(()=>{w.current=window.setTimeout(()=>x.current.focus(),0)},[]),W=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(w.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:E,toggleDropdown:R,selectedOptionIndex:m.current,getSelectedOptionIndex:W,selectOption:_,selectFirstOption:I,selectActiveOption:P,selectNextOption:A,selectPreviousOption:M,resetSelectedOption:H,updateSelectedOptionIndex:V,listId:p.current,setListId:K,clickSelectedOption:Z,searchRef:g,focusSearchInput:Q,targetRef:x,focusTarget:B}}const k7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},N7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Nn(t),"--combobox-option-padding":nt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":Nn(t),"--combobox-option-padding":nt(t,"combobox-option-padding")}});function st(e){const t=se("Combobox",k7,e),{classNames:n,styles:r,unstyled:i,children:s,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:x,__staticSelector:b,readOnly:w,...j}=t,C=vd(),E=c||C,R=Me({name:b||"Combobox",classes:Ar,props:t,classNames:n,styles:r,unstyled:i,vars:d,varsResolver:N7}),T=()=>{p?.(),E.closeDropdown()};return a.jsx(v7,{value:{getStyles:R,store:E,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:x,readOnly:w},children:a.jsx(zo,{opened:E.dropdownOpened,...j,onChange:_=>!_&&T(),withRoles:!1,unstyled:i,children:s})})}const O7=e=>e;st.extend=O7;st.classes=Ar;st.displayName="@mantine/core/Combobox";st.Target=X2;st.Dropdown=n0;st.Options=c0;st.Option=l0;st.Search=u0;st.Empty=r0;st.Chevron=Tp;st.Footer=i0;st.Header=s0;st.EventsTarget=Y2;st.DropdownTarget=Q2;st.Group=a0;st.ClearButton=W2;st.HiddenInput=K2;var Z2={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const J2=Z2,Rp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:s,children:c,label:d,description:f,id:p,disabled:m,error:g,size:x,labelPosition:b="left",bodyElement:w="div",labelElement:j="label",variant:C,style:E,vars:R,mod:T,..._},P)=>{const A=Me({name:e,props:t,className:n,style:E,classes:Z2,classNames:r,styles:i,unstyled:s});return a.jsx(ce,{...A("root"),ref:P,__vars:{"--label-fz":Nn(x),"--label-lh":nt(x,"label-lh")},mod:[{"label-position":b},T],variant:C,size:x,..._,children:a.jsxs(ce,{component:w,htmlFor:w==="label"?p:void 0,...A("body"),children:[c,a.jsxs("div",{...A("labelWrapper"),"data-disabled":m||void 0,children:[d&&a.jsx(ce,{component:j,htmlFor:j==="label"?p:void 0,...A("label"),"data-disabled":m||void 0,children:d}),f&&a.jsx(fn.Description,{size:x,__inheritStyles:!1,...A("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(fn.Error,{size:x,__inheritStyles:!1,...A("error"),children:g})]})]})})});Rp.displayName="@mantine/core/InlineInput";const e_=v.createContext(null),M7=e_.Provider,t_=()=>v.useContext(e_),[I7,L7]=Qi();var n_={card:"m_26775b0a"};const $7={withBorder:!0},z7=(e,{radius:t})=>({card:{"--card-radius":Ut(t)}}),d0=ge((e,t)=>{const n=se("CheckboxCard",$7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,defaultChecked:w,onChange:j,...C}=n,E=Me({name:"CheckboxCard",classes:n_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:z7,rootSelector:"card"}),R=t_(),T=typeof p=="boolean"?p:R?R.value.includes(x||""):void 0,[_,P]=Kn({value:T,defaultValue:w,finalValue:!1,onChange:j});return a.jsx(I7,{value:{checked:_},children:a.jsx(er,{ref:t,mod:[{"with-border":g,checked:_},m],...E("card"),...C,role:"checkbox","aria-checked":_,onClick:A=>{b?.(A),R?.onChange(x||""),P(!_)}})})});d0.displayName="@mantine/core/CheckboxCard";d0.classes=n_;function f0({children:e,role:t}){const n=_c();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const U7={},h0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:d,readOnly:f,...p}=se("CheckboxGroup",U7,e),[m,g]=Kn({value:n,defaultValue:r,finalValue:[],onChange:i}),x=b=>{const w=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(M7,{value:{value:m,onChange:x,size:s},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(f0,{role:"group",children:d})})})});h0.classes=fn.Wrapper.classes;h0.displayName="@mantine/core/CheckboxGroup";function _p({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:a.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 r_({indeterminate:e,...t}){return e?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:a.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):a.jsx(_p,{...t})}var o_={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const B7={icon:r_},V7=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ut(t),"--checkbox-color":s==="outline"?f:Ft(n,e),"--checkbox-icon-color":i?Ft(i,e):Zs(c,e)?Ki({color:n,theme:e,autoContrast:c}):void 0}}},p0=ge((e,t)=>{const n=se("CheckboxIndicator",B7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:x,iconColor:b,autoContrast:w,checked:j,mod:C,variant:E,disabled:R,...T}=n,_=p,P=Me({name:"CheckboxIndicator",classes:o_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:V7,rootSelector:"indicator"}),A=L7(),M=typeof j=="boolean"||typeof m=="boolean"?j||m:A?.checked||!1;return a.jsx(ce,{ref:t,...P("indicator",{variant:E}),variant:E,mod:[{checked:M,disabled:R},C],...T,children:a.jsx(_,{indeterminate:m,...P("icon")})})});p0.displayName="@mantine/core/CheckboxIndicator";p0.classes=o_;var i_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const F7={labelPosition:"right",icon:r_},H7=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--checkbox-size":nt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ut(t),"--checkbox-color":s==="outline"?f:Ft(n,e),"--checkbox-icon-color":i?Ft(i,e):Zs(c,e)?Ki({color:n,theme:e,autoContrast:c}):void 0}}},Un=ge((e,t)=>{const n=se("Checkbox",F7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:x,radius:b,wrapperProps:w,checked:j,labelPosition:C,description:E,error:R,disabled:T,variant:_,indeterminate:P,icon:A,rootRef:M,iconColor:I,onChange:V,autoContrast:H,mod:Z,...K}=n,Q=t_(),B=x||Q?.size,W=A,N=Me({name:"Checkbox",props:n,classes:i_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:H7}),{styleProps:L,rest:$}=Xi(K),q=vr(g),O=Q?{checked:Q.value.includes($.value),onChange:ae=>{Q.onChange(ae),V?.(ae)}}:{},F=v.useRef(null),te=t||F;return v.useEffect(()=>{te&&"current"in te&&te.current&&(te.current.indeterminate=P||!1)},[P,te]),a.jsx(Rp,{...N("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:q,size:B,labelPosition:C,label:m,description:E,error:R,disabled:T,classNames:r,styles:c,unstyled:d,"data-checked":O.checked||j||void 0,variant:_,ref:M,mod:Z,...L,...w,children:a.jsxs(ce,{...N("inner"),mod:{"data-label-position":C},children:[a.jsx(ce,{component:"input",id:q,ref:te,checked:j,disabled:T,mod:{error:!!R,indeterminate:P},...N("input",{focusable:!0,variant:_}),onChange:V,...$,...O,type:"checkbox"}),a.jsx(W,{indeterminate:P,...N("icon")})]})})});Un.classes={...i_,...J2};Un.displayName="@mantine/core/Checkbox";Un.Group=h0;Un.Indicator=p0;Un.Card=d0;function vc(e){return"group"in e}function a_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),i=[];for(let s=0;s<e.length;s+=1){const c=e[s];if(i.length===n)return i;vc(c)&&i.push({group:c.group,items:a_({options:c.items,search:t,limit:n-i.length})}),vc(c)||c.label.toLowerCase().includes(r)&&i.push(c)}return i}function q7(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 s_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(vc(n))s_(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 G7(e,t){return Array.isArray(e)?e.includes(t):e===t}function l_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:i,renderOption:s}){if(!vc(e)){const d=G7(n,e.value),f=t&&d&&a.jsx(_p,{className:Ar.optionsDropdownCheckIcon}),p=a.jsxs(a.Fragment,{children:[r==="left"&&f,a.jsx("span",{children:e.label}),r==="right"&&f]});return a.jsx(st.Option,{value:e.value,disabled:e.disabled,className:It({[Ar.optionsDropdownOption]:!i}),"data-reverse":r==="right"||void 0,"data-checked":d||void 0,"aria-selected":d,active:d,children:typeof s=="function"?s({option:e,checked:d}):p})}const c=e.items.map(d=>a.jsx(l_,{data:d,value:n,unstyled:i,withCheckIcon:t,checkIconPosition:r,renderOption:s},d.value));return a.jsx(st.Group,{label:e.group,children:c})}function W7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:s,maxDropdownHeight:c,withScrollArea:d=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:x,unstyled:b,labelId:w,renderOption:j,scrollAreaProps:C,"aria-label":E}){s_(e);const T=typeof i=="string"?(r||a_)({options:e,search:f?i:"",limit:s??1/0}):e,_=q7(T),P=T.map(A=>a.jsx(l_,{data:A,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},vc(A)?A.group:A.value));return a.jsx(st.Dropdown,{hidden:t||n&&_,"data-composed":!0,children:a.jsxs(st.Options,{labelledBy:w,"aria-label":E,children:[d?a.jsx(Kr.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:P}):P,_&&x&&a.jsx(st.Empty,{children:x})]})})}const c_=v.createContext(null),Q7=c_.Provider;function Y7(){return{withinGroup:!!v.useContext(c_)}}var Dp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const K7={},X7=(e,{spacing:t})=>({group:{"--ag-spacing":kn(t)}}),m0=ge((e,t)=>{const n=se("AvatarGroup",K7,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,spacing:p,...m}=n,g=Me({name:"AvatarGroup",classes:Dp,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:X7,rootSelector:"group"});return a.jsx(Q7,{value:!0,children:a.jsx(ce,{ref:t,...g("group"),...m})})});m0.classes=Dp;m0.displayName="@mantine/core/AvatarGroup";function Z7(e){return a.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.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 J7(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 eI=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function tI(e,t=eI){const n=J7(e),r=Math.abs(n)%t.length;return t[r]}function nI(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 rI={},oI=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=s==="initials"&&typeof d=="string"?tI(d,f):s,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:i,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":nt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ut(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},zs=lr((e,t)=>{const n=se("Avatar",rI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:x,gradient:b,imageProps:w,children:j,autoContrast:C,mod:E,name:R,allowedInitialsColors:T,..._}=n,P=Y7(),[A,M]=v.useState(!p),I=Me({name:"Avatar",props:n,classes:Dp,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:oI});return v.useEffect(()=>M(!p),[p]),a.jsx(ce,{...I("root"),mod:[{"within-group":P.withinGroup},E],ref:t,..._,children:A?a.jsx("span",{...I("placeholder"),title:m,children:j||typeof R=="string"&&nI(R)||a.jsx(Z7,{})}):a.jsx("img",{...w,...I("image"),src:p,alt:m,onError:V=>{M(!0),w?.onError?.(V)}})})});zs.classes=Dp;zs.displayName="@mantine/core/Avatar";zs.Group=m0;var u_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const iI={},aI=(e,{radius:t,color:n,gradient:r,variant:i,size:s,autoContrast:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:c});return{root:{"--badge-height":nt(s,"badge-height"),"--badge-padding-x":nt(s,"badge-padding-x"),"--badge-fz":nt(s,"badge-fz"),"--badge-radius":t===void 0?void 0:Ut(t),"--badge-bg":n||i?d.background:void 0,"--badge-color":n||i?d.color:void 0,"--badge-bd":n||i?d.border:void 0,"--badge-dot-color":i==="dot"?Ft(n,e):void 0}}},Ap=lr((e,t)=>{const n=se("Badge",iI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:x,rightSection:b,children:w,variant:j,fullWidth:C,autoContrast:E,circle:R,mod:T,..._}=n,P=Me({name:"Badge",props:n,classes:u_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:aI});return a.jsxs(ce,{variant:j,mod:[{block:C,circle:R,"with-right-section":!!b,"with-left-section":!!x},T],...P("root",{variant:j}),ref:t,..._,children:[x&&a.jsx("span",{...P("section"),"data-position":"left",children:x}),a.jsx("span",{...P("label"),children:w}),b&&a.jsx("span",{...P("section"),"data-position":"right",children:b})]})});Ap.classes=u_;Ap.displayName="@mantine/core/Badge";var d_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const sI={iconSize:48},lI=(e,{color:t,iconSize:n,radius:r})=>{const i=go({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=go({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":uo(s.value,.07),"--bq-bg-dark":uo(i.value,.06),"--bq-bd":Ft(t,e),"--bq-icon-size":le(n),"--bq-radius":Ut(r)}}},g0=ge((e,t)=>{const n=se("Blockquote",sI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:x,...b}=n,w=Me({name:"Blockquote",classes:d_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:lI});return a.jsxs(ce,{component:"blockquote",ref:t,...w("root"),...b,children:[m&&a.jsx("span",{...w("icon"),children:m}),p,x&&a.jsx("cite",{...w("cite"),children:x})]})});g0.classes=d_;g0.displayName="@mantine/core/Blockquote";var Ac={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const NC={orientation:"horizontal"},cI=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),v0=ge((e,t)=>{const n=se("ButtonGroup",NC,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=se("ButtonGroup",NC,e),w=Me({name:"ButtonGroup",props:n,classes:Ac,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:p,varsResolver:cI,rootSelector:"group"});return a.jsx(ce,{...w("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});v0.classes=Ac;v0.displayName="@mantine/core/ButtonGroup";const OC={},uI=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":nt(c,"section-height"),"--section-padding-x":nt(c,"section-padding-x"),"--section-fz":c?.includes("compact")?Nn(c.replace("compact-","")):Nn(c),"--section-radius":t===void 0?void 0:Ut(t),"--section-bg":n||i?d.background:void 0,"--section-color":d.color,"--section-bd":n||i?d.border:void 0}}},y0=ge((e,t)=>{const n=se("ButtonGroupSection",OC,e),{className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=se("ButtonGroupSection",OC,e),w=Me({name:"ButtonGroupSection",props:n,classes:Ac,className:r,style:i,classNames:s,styles:c,unstyled:d,vars:f,varsResolver:uI,rootSelector:"groupSection"});return a.jsx(ce,{...w("groupSection"),ref:t,variant:p,...b})});y0.classes=Ac;y0.displayName="@mantine/core/ButtonGroupSection";const dI={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},fI={},hI=(e,{radius:t,color:n,gradient:r,variant:i,size:s,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":nt(s,"button-height"),"--button-padding-x":nt(s,"button-padding-x"),"--button-fz":s?.includes("compact")?Nn(s.replace("compact-","")):Nn(s),"--button-radius":t===void 0?void 0:Ut(t),"--button-bg":n||i?f.background:void 0,"--button-hover":n||i?f.hover:void 0,"--button-color":f.color,"--button-bd":n||i?f.border:void 0,"--button-hover-color":n||i?f.hoverColor:void 0}}},ke=lr((e,t)=>{const n=se("Button",fI,e),{style:r,vars:i,className:s,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:x,radius:b,loading:w,loaderProps:j,gradient:C,classNames:E,styles:R,unstyled:T,"data-disabled":_,autoContrast:P,mod:A,...M}=n,I=Me({name:"Button",props:n,classes:Ac,className:s,style:r,classNames:E,styles:R,unstyled:T,vars:i,varsResolver:hI}),V=!!p,H=!!m;return a.jsxs(er,{ref:t,...I("root",{active:!d&&!w&&!_}),unstyled:T,variant:x,disabled:d||w,mod:[{disabled:d||_,loading:w,block:g,"with-left-section":V,"with-right-section":H},A],...M,children:[a.jsx(fi,{mounted:!!w,transition:dI,duration:150,children:Z=>a.jsx(ce,{component:"span",...I("loader",{style:Z}),"aria-hidden":!0,children:a.jsx(Dr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...I("inner"),children:[p&&a.jsx(ce,{component:"span",...I("section"),mod:{position:"left"},children:p}),a.jsx(ce,{component:"span",mod:{loading:w},...I("label"),children:f}),m&&a.jsx(ce,{component:"span",...I("section"),mod:{position:"right"},children:m})]})]})});ke.classes=Ac;ke.displayName="@mantine/core/Button";ke.Group=v0;ke.GroupSection=y0;var f_={root:"m_4451eb3a"};const pI={},Yn=lr((e,t)=>{const n=se("Center",pI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,inline:p,mod:m,...g}=n,x=Me({name:"Center",props:n,classes:f_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f});return a.jsx(ce,{ref:t,mod:[{inline:p},m],...x("root"),...g})});Yn.classes=f_;Yn.displayName="@mantine/core/Center";const[mI,gI]=Qi(),vI={};function h_(e){const{value:t,defaultValue:n,onChange:r,multiple:i,children:s}=se("ChipGroup",vI,e),[c,d]=Kn({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?d(c.includes(g)?c.filter(x=>x!==g):[...c,g]):d(g)};return a.jsx(mI,{value:{isChipSelected:f,onChange:p,multiple:i},children:s})}h_.displayName="@mantine/core/ChipGroup";var p_={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 yI={type:"checkbox"},xI=(e,{size:t,radius:n,variant:r,color:i,autoContrast:s})=>{const c=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":Nn(t),"--chip-size":nt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ut(n),"--chip-checked-padding":nt(t,"chip-checked-padding"),"--chip-padding":nt(t,"chip-padding"),"--chip-icon-size":nt(t,"chip-icon-size"),"--chip-bg":i||r?c.background:void 0,"--chip-hover":i||r?c.hover:void 0,"--chip-color":i||r?c.color:void 0,"--chip-bd":i||r?c.border:void 0,"--chip-spacing":nt(t,"chip-spacing")}}},Zu=ge((e,t)=>{const n=se("Chip",yI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:x,value:b,wrapperProps:w,type:j,disabled:C,children:E,size:R,variant:T,icon:_,rootRef:P,autoContrast:A,mod:M,...I}=n,V=Me({name:"Chip",classes:p_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:xI}),H=gI(),Z=vr(p),{styleProps:K,rest:Q}=Xi(I),[B,W]=Kn({value:m,defaultValue:g,finalValue:!1,onChange:x}),N=H?{checked:H.isChipSelected(b),onChange:$=>{H.onChange($),x?.($.currentTarget.checked)},type:H.multiple?"checkbox":"radio"}:{},L=N.checked||B;return a.jsxs(ce,{size:R,variant:T,ref:P,mod:M,...V("root"),...K,...w,children:[a.jsx("input",{type:j,...V("input"),checked:L,onChange:$=>W($.currentTarget.checked),id:Z,disabled:C,ref:t,value:b,...N,...Q}),a.jsxs("label",{htmlFor:Z,"data-checked":L||void 0,"data-disabled":C||void 0,...V("label",{variant:T||"filled"}),children:[L&&a.jsx("span",{...V("iconWrapper"),children:_||a.jsx(_p,{...V("checkIcon")})}),a.jsx("span",{children:E})]})]})});Zu.classes=p_;Zu.displayName="@mantine/core/Chip";Zu.Group=h_;var m_={root:"m_b183c0a2"};const bI={},SI=(e,{color:t})=>({root:{"--code-bg":t?Ft(t,e):void 0}}),x0=ge((e,t)=>{const n=se("Code",bI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:x,...b}=n,w=Me({name:"Code",props:n,classes:m_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:SI});return a.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},x],...w("root"),...b,dir:"ltr"})});x0.classes=m_;x0.displayName="@mantine/core/Code";var g_={root:"m_7485cace"};const wI={},jI=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:nt(t,"container-size")}}),yd=ge((e,t)=>{const n=se("Container",wI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,fluid:p,mod:m,...g}=n,x=Me({name:"Container",classes:g_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:jI});return a.jsx(ce,{ref:t,mod:[{fluid:p},m],...x("root"),...g})});yd.classes=g_;yd.displayName="@mantine/core/Container";const CI={timeout:1e3};function v_(e){const{children:t,timeout:n,value:r,...i}=se("CopyButton",CI,e),s=gR({timeout:n}),c=()=>s.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:s.copied,...i})})}v_.displayName="@mantine/core/CopyButton";var y_={root:"m_3eebeb36",label:"m_9e365f20"};const EI={orientation:"horizontal"},TI=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ft(t,e):void 0,"--divider-border-style":n,"--divider-size":nt(r,"divider-size")}}),wn=ge((e,t)=>{const n=se("Divider",EI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:x,mod:b,...w}=n,j=Me({name:"Divider",classes:y_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:TI});return a.jsx(ce,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...j("root"),...w,role:"separator",children:g&&a.jsx(ce,{component:"span",mod:{position:x},...j("label"),children:g})})});wn.classes=y_;wn.displayName="@mantine/core/Divider";function RI({open:e,close:t,openDelay:n,closeDelay:r}){const i=v.useRef(-1),s=v.useRef(-1),c=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},d=()=>{c(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:d,closeDropdown:f}}const[MC,x_]=gr("Grid component was not found in tree"),Iy=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,IC=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Iy(e,t),LC=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},$C=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function _I({span:e,order:t,offset:n,selector:r}){const i=yn(),s=x_(),c=s.breakpoints||i.breakpoints,f=Po(e)===void 0?12:Po(e),p=Qa({"--col-order":Po(t)?.toString(),"--col-flex-grow":LC(f,s.grow),"--col-flex-basis":Iy(f,s.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":IC(f,s.columns,s.grow),"--col-offset":$C(Po(n),s.columns)}),m=on(c).reduce((b,w)=>(b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=t[w]?.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=LC(e[w],s.grow),b[w]["--col-flex-basis"]=Iy(e[w],s.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=IC(e[w],s.columns,s.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=$C(n[w],s.columns)),b),{}),x=Qu(on(m),c).filter(b=>on(m[b.value]).length>0).map(b=>({query:s.type==="container"?`mantine-grid (min-width: ${c[b.value]})`:`(min-width: ${c[b.value]})`,styles:m[b.value]}));return a.jsx(Js,{styles:p,media:s.type==="container"?void 0:x,container:s.type==="container"?x:void 0,selector:r})}var b0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const DI={span:12},S0=ge((e,t)=>{const n=se("GridCol",DI,e),{classNames:r,className:i,style:s,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,x=x_(),b=dd();return a.jsxs(a.Fragment,{children:[a.jsx(_I,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ce,{ref:t,...x.getStyles("col",{className:It(i,b),style:s,classNames:r,styles:c}),...g})]})});S0.classes=b0;S0.displayName="@mantine/core/GridCol";function zC({gutter:e,selector:t,breakpoints:n,type:r}){const i=yn(),s=n||i.breakpoints,c=Qa({"--grid-gutter":kn(Po(e))}),d=on(s).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=kn(e[g])),m),{}),p=Qu(on(d),s).filter(m=>on(d[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${s[m.value]})`:`(min-width: ${s[m.value]})`,styles:d[m.value]}));return a.jsx(Js,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const AI={gutter:"md",grow:!1,columns:12},PI=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),ir=ge((e,t)=>{const n=se("Grid",AI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:x,justify:b,children:w,breakpoints:j,type:C,...E}=n,R=Me({name:"Grid",classes:b0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:PI}),T=dd();return C==="container"&&j?a.jsxs(MC,{value:{getStyles:R,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(zC,{selector:`.${T}`,...n}),a.jsx("div",{...R("container"),children:a.jsx(ce,{ref:t,...R("root",{className:T}),...E,children:a.jsx("div",{...R("inner"),children:w})})})]}):a.jsxs(MC,{value:{getStyles:R,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(zC,{selector:`.${T}`,...n}),a.jsx(ce,{ref:t,...R("root",{className:T}),...E,children:a.jsx("div",{...R("inner"),children:w})})]})});ir.classes=b0;ir.displayName="@mantine/core/Grid";ir.Col=S0;function zh(){return zh=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},zh.apply(null,arguments)}function w0(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 kI=v.useLayoutEffect,NI=function(t){var n=jn.useRef(t);return kI(function(){n.current=t}),n},UC=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},OI=function(t,n){var r=jn.useRef();return jn.useCallback(function(i){t.current=i,r.current&&UC(r.current,null),r.current=n,n&&UC(n,i)},[n])},BC={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},MI=function(t){Object.keys(BC).forEach(function(n){t.style.setProperty(n,BC[n],"important")})},VC=MI,dr=null,FC=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function II(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),dr||(dr=document.createElement("textarea"),dr.setAttribute("tabindex","-1"),dr.setAttribute("aria-hidden","true"),VC(dr)),dr.parentNode===null&&document.body.appendChild(dr);var i=e.paddingSize,s=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(x){var b=x;dr.style[b]=c[b]}),VC(dr),dr.value=t;var f=FC(dr,e);dr.value=t,f=FC(dr,e),dr.value="x";var p=dr.scrollHeight-i,m=p*n;d==="border-box"&&(m=m+i+s),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+i+s),f=Math.min(g,f),[f,p]}var HC=function(){},LI=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},$I=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],zI=!!document.documentElement.currentStyle,UI=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=LI($I,n),i=r.boxSizing;if(i==="")return null;zI&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:c}},BI=UI;function j0(e,t,n){var r=NI(n);v.useLayoutEffect(function(){var i=function(c){return r.current(c)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var VI=function(t,n){j0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},FI=function(t){j0(window,"resize",t)},HI=function(t){j0(document.fonts,"loadingdone",t)},qI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],GI=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,c=t.onChange,d=c===void 0?HC:c,f=t.onHeightChange,p=f===void 0?HC:f,m=w0(t,qI),g=m.value!==void 0,x=v.useRef(null),b=OI(x,n),w=v.useRef(0),j=v.useRef(),C=function(){var T=x.current,_=r&&j.current?j.current:BI(T);if(_){j.current=_;var P=II(_,T.value||T.placeholder||"x",s,i),A=P[0],M=P[1];w.current!==A&&(w.current=A,T.style.setProperty("height",A+"px","important"),p(A,{rowHeight:M}))}},E=function(T){g||C(),d(T)};return v.useLayoutEffect(C),VI(x,function(){if(!g){var R=x.current.value;requestAnimationFrame(function(){var T=x.current;T&&R!==T.value&&C()})}}),FI(C),HI(C),v.createElement("textarea",zh({},m,{onChange:E,ref:b}))},WI=v.forwardRef(GI);const QI={},tl=ge((e,t)=>{const{autosize:n,maxRows:r,minRows:i,__staticSelector:s,resize:c,...d}=se("Textarea",QI,e),f=n&&jR()!=="test",p=f?{maxRows:r,minRows:i}:{};return a.jsx(Pr,{component:f?WI:"textarea",ref:t,...d,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});tl.classes=Pr.classes;tl.displayName="@mantine/core/Textarea";function qC(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const YI={serialize:JSON.stringify,deserialize:JSON.parse},Pc=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,formatOnBlur:s,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:x,...b}=se("JsonInput",YI,e),[w,j]=Kn({value:n,defaultValue:r,finalValue:"",onChange:i}),[C,E]=v.useState(qC(w,f)),R=_=>{p?.(_),E(!0)},T=_=>{typeof m=="function"&&m(_);const P=qC(_.currentTarget.value,f);s&&!g&&P&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),E(P)};return a.jsx(tl,{value:w,onChange:_=>j(_.currentTarget.value),onFocus:R,onBlur:T,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?x:c||!0,"data-monospace":!0})});Pc.classes=Pr.classes;Pc.displayName="@mantine/core/JsonInput";const[KI,XI]=gr("List component was not found in tree");var C0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const ZI={},E0=ge((e,t)=>{const n=se("ListItem",ZI,e),{classNames:r,className:i,style:s,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,x=XI(),b=f||x.icon,w={classNames:r,styles:c};return a.jsx(ce,{...x.getStyles("item",{...w,className:i,style:s}),component:"li",mod:[{"with-icon":!!b,centered:x.center},m],ref:t,...g,children:a.jsxs("div",{...x.getStyles("itemWrapper",w),children:[b&&a.jsx("span",{...x.getStyles("itemIcon",w),children:b}),a.jsx("span",{...x.getStyles("itemLabel",w),children:p})]})})});E0.classes=C0;E0.displayName="@mantine/core/ListItem";const JI={type:"unordered"},eL=(e,{size:t,spacing:n})=>({root:{"--list-fz":Nn(t),"--list-lh":mR(t),"--list-spacing":kn(n)}}),pr=ge((e,t)=>{const n=se("List",JI,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:x,spacing:b,center:w,listStyleType:j,mod:C,...E}=n,R=Me({name:"List",classes:C0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:eL});return a.jsx(KI,{value:{center:w,icon:x,getStyles:R},children:a.jsx(ce,{...R("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...E,children:p})})});pr.classes=C0;pr.displayName="@mantine/core/List";pr.Item=E0;var b_={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const GC={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Yr("overlay")},tL=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),Pp=ge((e,t)=>{const n=se("LoadingOverlay",GC,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:x,zIndex:b,...w}=n,j=yn(),C=Me({name:"LoadingOverlay",classes:b_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:tL}),E={...GC.overlayProps,...g};return a.jsx(fi,{transition:"fade",...p,mounted:!!x,children:R=>a.jsxs(ce,{...C("root",{style:R}),ref:t,...w,children:[a.jsx(Dr,{...C("loader"),unstyled:d,...m}),a.jsx(mc,{...E,...C("overlay"),darkHidden:!0,unstyled:d,color:g?.color||j.white}),a.jsx(mc,{...E,...C("overlay"),lightHidden:!0,unstyled:d,color:g?.color||j.colors.dark[5]})]})})});Pp.classes=b_;Pp.displayName="@mantine/core/LoadingOverlay";const[nL,xd]=gr("Menu component was not found in the tree");var kc={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const rL={},T0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("MenuDivider",rL,e),f=xd();return a.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:i,styles:s,classNames:n}),...d})});T0.classes=kc;T0.displayName="@mantine/core/MenuDivider";const oL={},R0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=se("MenuDropdown",oL,e),x=v.useRef(null),b=xd(),w=Tr(p,E=>{(E.key==="ArrowUp"||E.key==="ArrowDown")&&(E.preventDefault(),x.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=Tr(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Tr(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(zo.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:Bn(t,x),...b.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:w,children:[b.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});R0.classes=kc;R0.displayName="@mantine/core/MenuDropdown";const iL={},_0=lr((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:x,"data-disabled":b,...w}=se("MenuItem",iL,e),j=xd(),C=yn(),{dir:E}=el(),R=v.useRef(null),T=j.getItemIndex(R.current),_=w,P=Tr(_.onMouseLeave,()=>j.setHovered(-1)),A=Tr(_.onMouseEnter,()=>j.setHovered(j.getItemIndex(R.current))),M=Tr(_.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),I=Tr(_.onFocus,()=>j.setHovered(j.getItemIndex(R.current))),V=d?C.variantColorResolver({color:d,theme:C,variant:"light"}):void 0,H=d?go({color:d,theme:C}):null;return a.jsxs(er,{...w,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:I,...j.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:Bn(R,t),role:"menuitem",disabled:x,"data-menu-item":!0,"data-disabled":x||b||void 0,"data-hovered":j.hovered===T?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:A,onMouseLeave:P,onClick:M,onKeyDown:pR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:E,orientation:"vertical",onKeyDown:_.onKeyDown}),__vars:{"--menu-item-color":H?.isThemeColor&&H?.shade===void 0?`var(--mantine-color-${H.color}-6)`:V?.color,"--menu-item-hover":V?.hover},children:[p&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),g&&a.jsx("div",{...j.getStyles("itemLabel",{styles:s,classNames:n}),children:g}),m&&a.jsx("div",{...j.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:m})]})});_0.classes=kc;_0.displayName="@mantine/core/MenuItem";const aL={},D0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,...d}=se("MenuLabel",aL,e),f=xd();return a.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:i,styles:s,classNames:n}),...d})});D0.classes=kc;D0.displayName="@mantine/core/MenuLabel";const sL={refProp:"ref"},S_=v.forwardRef((e,t)=>{const{children:n,refProp:r,...i}=se("MenuTarget",sL,e);if(!Wi(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 s=xd(),c=n.props,d=Tr(c.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),f=Tr(c.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=Tr(c.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return a.jsx(zo.Target,{refProp:r,popupType:"menu",ref:t,...i,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});S_.displayName="@mantine/core/MenuTarget";const lL={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Ce(e){const t=se("Menu",lL,e),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:x,openDelay:b,closeDelay:w,classNames:j,styles:C,unstyled:E,variant:R,vars:T,menuItemTabIndex:_,keepMounted:P,withInitialFocusPlaceholder:A,...M}=t,I=Me({name:"Menu",classes:kc,props:t,classNames:j,styles:C,unstyled:E}),[V,{setHovered:H,resetHovered:Z}]=h3(),[K,Q]=Kn({value:s,defaultValue:c,finalValue:!1,onChange:f}),[B,W]=v.useState(!1),N=()=>{Q(!1),W(!1),K&&i?.()},L=()=>{Q(!0),!K&&r?.()},$=()=>{K?N():L()},{openDropdown:q,closeDropdown:O}=RI({open:L,close:N,closeDelay:w,openDelay:b}),F=je=>f3("[data-menu-item]","[data-menu-dropdown]",je),{resolvedClassNames:te,resolvedStyles:ae}=Xs({classNames:j,styles:C,props:t});return Vi(()=>{Z()},[K]),a.jsx(nL,{value:{getStyles:I,opened:K,toggleDropdown:$,getItemIndex:F,hovered:V,setHovered:H,openedViaClick:B,setOpenedViaClick:W,closeOnItemClick:p,closeDropdown:x==="click"?N:O,openDropdown:x==="click"?L:q,closeDropdownImmediately:N,loop:m,trigger:x,unstyled:E,menuItemTabIndex:_,withInitialFocusPlaceholder:A},children:a.jsx(zo,{...M,opened:K,onChange:$,defaultOpened:c,trapFocus:P?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:te,styles:ae,unstyled:E,variant:R,keepMounted:P,children:n})})}Ce.extend=e=>e;Ce.withProps=WO(Ce);Ce.classes=kc;Ce.displayName="@mantine/core/Menu";Ce.Item=_0;Ce.Label=D0;Ce.Dropdown=R0;Ce.Target=S_;Ce.Divider=T0;const[cL,Nc]=gr("Modal component was not found in tree");var ea={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const uL={},kp=ge((e,t)=>{const n=se("ModalBody",uL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Nc();return a.jsx(k2,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:c,className:i}),...f})});kp.classes=ea;kp.displayName="@mantine/core/ModalBody";const dL={},Np=ge((e,t)=>{const n=se("ModalCloseButton",dL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Nc();return a.jsx(N2,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:c,className:i}),...f})});Np.classes=ea;Np.displayName="@mantine/core/ModalCloseButton";const fL={},Op=ge((e,t)=>{const n=se("ModalContent",fL,e),{classNames:r,className:i,style:s,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=Nc(),x=g.scrollAreaComponent||C5;return a.jsx(O2,{...g.getStyles("content",{className:i,style:s,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:i,style:s,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:a.jsx(x,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});Op.classes=ea;Op.displayName="@mantine/core/ModalContent";const hL={},Mp=ge((e,t)=>{const n=se("ModalHeader",hL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Nc();return a.jsx(M2,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:c,className:i}),...f})});Mp.classes=ea;Mp.displayName="@mantine/core/ModalHeader";const pL={},Ip=ge((e,t)=>{const n=se("ModalOverlay",pL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Nc();return a.jsx(I2,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:c,className:i}),...f})});Ip.classes=ea;Ip.displayName="@mantine/core/ModalOverlay";const mL={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Yr("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},gL=(e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Ut(t),"--modal-size":nt(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(i)}}),Lp=ge((e,t)=>{const n=se("ModalRoot",mL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:x,centered:b,xOffset:w,__staticSelector:j,...C}=n,E=Me({name:j,classes:ea,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:gL});return a.jsx(cL,{value:{yOffset:p,scrollAreaComponent:m,getStyles:E,fullScreen:x},children:a.jsx(P2,{ref:t,...E("root"),"data-full-screen":x||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===Kr.Autosize||void 0,unstyled:d,...C})})});Lp.classes=ea;Lp.displayName="@mantine/core/ModalRoot";const[vL,yL]=Qi();function w_({children:e}){const[t,n]=v.useState([]),[r,i]=v.useState(Yr("modal"));return a.jsx(vL,{value:{stack:t,addModal:(s,c)=>{n(d=>[...new Set([...d,s])]),i(d=>typeof c=="number"&&typeof d=="number"?Math.max(d,c):d)},removeModal:s=>n(c=>c.filter(d=>d!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}w_.displayName="@mantine/core/ModalStack";const xL={},$p=ge((e,t)=>{const n=se("ModalTitle",xL,e),{classNames:r,className:i,style:s,styles:c,vars:d,...f}=n,p=Nc();return a.jsx(L2,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:c,className:i}),...f})});$p.classes=ea;$p.displayName="@mantine/core/ModalTitle";const bL={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Yr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Vn=ge((e,t)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:s,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...x}=se("Modal",bL,e),b=yL(),w=!!n||s,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return v.useEffect(()=>{b&&m&&(p?b.addModal(m,g||Yr("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(Lp,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...x,...j,children:[r&&a.jsx(Ip,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...i}),a.jsxs(Op,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[w&&a.jsxs(Mp,{children:[n&&a.jsx($p,{children:n}),s&&a.jsx(Np,{...c})]}),a.jsx(kp,{children:d})]})]})});Vn.classes=ea;Vn.displayName="@mantine/core/Modal";Vn.Root=Lp;Vn.Overlay=Ip;Vn.Content=Op;Vn.Body=kp;Vn.Header=Mp;Vn.Title=$p;Vn.CloseButton=Np;Vn.Stack=w_;const[SL,A0]=Qi(),[wL,jL]=Qi();var zp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const CL={},EL=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?nt(t):nt(n,"pg-gap")}}),P0=ge((e,t)=>{const n=se("PillGroup",CL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,disabled:m,...g}=n,b=A0()?.size||p||void 0,w=Me({name:"PillGroup",classes:zp,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:EL,stylesCtx:{size:b},rootSelector:"group"});return a.jsx(wL,{value:{size:b,disabled:m},children:a.jsx(ce,{ref:t,size:b,...w("group"),...g})})});P0.classes=zp;P0.displayName="@mantine/core/PillGroup";const TL={variant:"default"},RL=(e,{radius:t},{size:n})=>({root:{"--pill-fz":nt(n,"pill-fz"),"--pill-height":nt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ut(t)}}),Us=ge((e,t)=>{const n=se("Pill",TL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:x,removeButtonProps:b,radius:w,size:j,disabled:C,mod:E,...R}=n,T=jL(),_=A0(),P=j||T?.size||void 0,A=_?.variant==="filled"?"contrast":p||"default",M=Me({name:"Pill",classes:zp,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:RL,stylesCtx:{size:P}});return a.jsxs(ce,{component:"span",ref:t,variant:A,size:P,...M("root",{variant:A}),mod:[{"with-remove":g&&!C,disabled:C||T?.disabled},E],...R,children:[a.jsx("span",{...M("label"),children:m}),g&&a.jsx(Ka,{variant:"transparent",radius:w,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...M("remove",{className:b?.className,style:b?.style}),onMouseDown:I=>{I.preventDefault(),I.stopPropagation(),b?.onMouseDown?.(I)},onClick:I=>{I.stopPropagation(),x?.(),b?.onClick?.(I)}})]})});Us.classes=zp;Us.displayName="@mantine/core/Pill";Us.Group=P0;var j_={field:"m_45c4369d"};const _L={type:"visible"},k0=ge((e,t)=>{const n=se("PillsInputField",_L,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:x,mod:b,...w}=n,j=A0(),C=_c(),E=Me({name:"PillsInputField",classes:j_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"field"}),R=m||j?.disabled;return a.jsx(ce,{component:"input",ref:Bn(t,j?.fieldRef),"data-type":p,disabled:R,mod:[{disabled:R,pointer:x},b],...E("field"),...w,id:C?.inputId||g,"aria-invalid":j?.hasError,"aria-describedby":C?.describedBy,type:"text",onMouseDown:T=>!x&&T.stopPropagation()})});k0.classes=j_;k0.displayName="@mantine/core/PillsInputField";const DL={},yc=ge((e,t)=>{const n=se("PillsInput",DL,e),{children:r,onMouseDown:i,onClick:s,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,x=v.useRef(null);return a.jsx(SL,{value:{fieldRef:x,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx(Pr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{b.preventDefault(),i?.(b),x.current?.focus()},onClick:b=>{b.preventDefault(),b.currentTarget.closest("fieldset")?.disabled||(x.current?.focus(),s?.(b))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});yc.displayName="@mantine/core/PillsInput";yc.Field=k0;function AL({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,s)=>(vc(s)?i.push({group:s.group,items:s.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&i.push(s),i),[])}const PL={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Up=ge((e,t)=>{const n=se("MultiSelect",PL,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:x,onKeyDown:b,variant:w,data:j,dropdownOpened:C,defaultDropdownOpened:E,onDropdownOpen:R,onDropdownClose:T,selectFirstOptionOnChange:_,onOptionSubmit:P,comboboxProps:A,filter:M,limit:I,withScrollArea:V,maxDropdownHeight:H,searchValue:Z,defaultSearchValue:K,onSearchChange:Q,readOnly:B,disabled:W,onFocus:N,onBlur:L,radius:$,rightSection:q,rightSectionWidth:O,rightSectionPointerEvents:F,rightSectionProps:te,leftSection:ae,leftSectionWidth:je,leftSectionPointerEvents:xe,leftSectionProps:we,inputContainer:Ge,inputWrapperOrder:Ee,withAsterisk:ot,labelProps:et,descriptionProps:Ct,errorProps:Ot,wrapperProps:Mt,description:pt,label:Rt,error:en,maxValues:Re,searchable:Ae,nothingFoundMessage:Qe,withCheckIcon:_e,checkIconPosition:he,hidePickedOptions:Se,withErrorStyles:$e,name:be,form:Oe,id:_t,clearable:xt,clearButtonProps:tn,hiddenInputProps:Lt,placeholder:In,hiddenInputValuesDivider:Dn,required:Vo,mod:Eo,renderOption:gi,onRemove:Mr,onClear:vi,scrollAreaProps:Xr,chevronColor:dl,...yi}=n,aa=vr(_t),Fo=q2(j),xr=G2(Fo),qn=vd({opened:C,defaultOpened:E,onDropdownOpen:R,onDropdownClose:()=>{T?.(),qn.resetSelectedOption()}}),{styleProps:xi,rest:{type:sa,autoComplete:ns,...rs}}=Xi(yi),[U,X]=Kn({value:m,defaultValue:g,finalValue:[],onChange:x}),[oe,me]=Kn({value:Z,defaultValue:K,finalValue:"",onChange:Q}),Te=tt=>{me(tt),qn.resetSelectedOption()},Ue=Me({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d}),{resolvedClassNames:We,resolvedStyles:Fe}=Xs({props:n,styles:c,classNames:r}),Ze=tt=>{b?.(tt),tt.key===" "&&!Ae&&(tt.preventDefault(),qn.toggleDropdown()),tt.key==="Backspace"&&oe.length===0&&U.length>0&&(Mr?.(U[U.length-1]),X(U.slice(0,U.length-1)))},rt=U.map((tt,ln)=>a.jsx(Us,{withRemoveButton:!B&&!xr[tt]?.disabled,onRemove:()=>{X(U.filter(gn=>tt!==gn)),Mr?.(tt)},unstyled:d,disabled:W,...Ue("pill"),children:xr[tt]?.label||tt},`${tt}-${ln}`));v.useEffect(()=>{_&&qn.selectFirstOption()},[_,oe]);const He=a.jsx(st.ClearButton,{...tn,onClear:()=>{vi?.(),X([]),Te("")}}),Xe=AL({data:Fo,value:U}),ft=xt&&U.length>0&&!W&&!B;return a.jsxs(a.Fragment,{children:[a.jsxs(st,{store:qn,classNames:We,styles:Fe,unstyled:d,size:p,readOnly:B,__staticSelector:"MultiSelect",onOptionSubmit:tt=>{P?.(tt),Te(""),qn.updateSelectedOptionIndex("selected"),U.includes(xr[tt].value)?(X(U.filter(ln=>ln!==xr[tt].value)),Mr?.(xr[tt].value)):U.length<Re&&X([...U,xr[tt].value])},...A,children:[a.jsx(st.DropdownTarget,{children:a.jsx(yc,{...xi,__staticSelector:"MultiSelect",classNames:We,styles:Fe,unstyled:d,size:p,className:i,style:s,variant:w,disabled:W,radius:$,__defaultRightSection:a.jsx(st.Chevron,{size:p,error:en,unstyled:d,color:dl}),__clearSection:He,__clearable:ft,rightSection:q,rightSectionPointerEvents:F||(He?"all":"none"),rightSectionWidth:O,rightSectionProps:te,leftSection:ae,leftSectionWidth:je,leftSectionPointerEvents:xe,leftSectionProps:we,inputContainer:Ge,inputWrapperOrder:Ee,withAsterisk:ot,labelProps:et,descriptionProps:Ct,errorProps:Ot,wrapperProps:Mt,description:pt,label:Rt,error:en,withErrorStyles:$e,__stylesApiProps:{...n,rightSectionPointerEvents:F||(ft?"all":"none"),multiline:!0},pointer:!Ae,onClick:()=>Ae?qn.openDropdown():qn.toggleDropdown(),"data-expanded":qn.dropdownOpened||void 0,id:aa,required:Vo,mod:Eo,children:a.jsxs(Us.Group,{disabled:W,unstyled:d,...Ue("pillsList"),children:[rt,a.jsx(st.EventsTarget,{autoComplete:ns,children:a.jsx(yc.Field,{...rs,ref:t,id:aa,placeholder:In,type:!Ae&&!In?"hidden":"visible",...Ue("inputField"),unstyled:d,onFocus:tt=>{N?.(tt),Ae&&qn.openDropdown()},onBlur:tt=>{L?.(tt),qn.closeDropdown(),Te("")},onKeyDown:Ze,value:oe,onChange:tt=>{Te(tt.currentTarget.value),Ae&&qn.openDropdown(),_&&qn.selectFirstOption()},disabled:W,readOnly:B||!Ae,pointer:!Ae})})]})})}),a.jsx(W7,{data:Se?Xe:Fo,hidden:B||W,filter:M,search:oe,limit:I,hiddenWhenEmpty:!Qe,withScrollArea:V,maxDropdownHeight:H,filterOptions:Ae,value:U,checkIconPosition:he,withCheckIcon:_e,nothingFoundMessage:Qe,unstyled:d,labelId:Rt?`${aa}-label`:void 0,"aria-label":Rt?void 0:yi["aria-label"],renderOption:gi,scrollAreaProps:Xr})]}),a.jsx(st.HiddenInput,{name:be,valuesDivider:Dn,value:U,form:Oe,disabled:W,...Lt})]})});Up.classes={...Pr.classes,...st.classes};Up.displayName="@mantine/core/MultiSelect";function kL(e){return"group"in e}function N0({data:e}){if(kL(e)){const i=e.items.map(s=>a.jsx(N0,{data:s},s.value));return a.jsx("optgroup",{label:e.group,children:i})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}N0.displayName="@mantine/core/NativeSelectOption";const NL={rightSectionPointerEvents:"none"},an=ge((e,t)=>{const{data:n,children:r,size:i,error:s,rightSection:c,unstyled:d,...f}=se("NativeSelect",NL,e),p=q2(n).map((m,g)=>a.jsx(N0,{data:m},g));return a.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:i,pointer:!0,error:s,unstyled:d,rightSection:c||a.jsx(Tp,{size:i,error:s,unstyled:d}),children:r||p})});an.classes=Pr.classes;an.displayName="@mantine/core/NativeSelect";var C_={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const OL={withCloseButton:!0},ML=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ut(t),"--notification-color":n?Ft(n,e):void 0}}),O0=ge((e,t)=>{const n=se("Notification",OL,e),{className:r,color:i,radius:s,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:x,closeButtonProps:b,classNames:w,style:j,styles:C,unstyled:E,variant:R,vars:T,mod:_,loaderProps:P,role:A,...M}=n,I=Me({name:"Notification",classes:C_,props:n,className:r,style:j,classNames:w,styles:C,unstyled:E,vars:T,varsResolver:ML});return a.jsxs(ce,{...I("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},_],ref:t,variant:R,role:A||"alert",...M,children:[m&&!c&&a.jsx("div",{...I("icon"),children:m}),c&&a.jsx(Dr,{size:28,color:i,...P,...I("loader")}),a.jsxs("div",{...I("body"),children:[p&&a.jsx("div",{...I("title"),children:p}),a.jsx(ce,{...I("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(Ka,{iconSize:16,color:"gray",...b,unstyled:E,onClick:x,...I("closeButton")})]})});O0.classes=C_;O0.displayName="@mantine/core/Notification";function E_(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 i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var Ju;(function(e){e.event="event",e.props="prop"})(Ju||(Ju={}));function $a(){}function IL(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(s,c){return s===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function ed(e){return!!(e||"").match(/\d/)}function lc(e){return e==null}function LL(e){return typeof e=="number"&&isNaN(e)}function T_(e){return lc(e)||LL(e)||typeof e=="number"&&!isFinite(e)}function R_(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function $L(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 zL(e,t,n){var r=$L(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function UL(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function M0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),s=i[0],c=i[1]||"";return{beforeDecimal:s,afterDecimal:c,hasNegation:n,addNegation:r}}function BL(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",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function __(e,t,n){for(var r="",i=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||i;return r}function WC(e,t){return Array(t+1).join(e)}function D_(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],s=r[1];if(s=Number(s),!s)return n+i;i=i.replace(".","");var c=1+s,d=i.length;return c<0?i="0."+WC("0",Math.abs(c))+i:c>=d?i=i+WC("0",c-d):i=(i.substring(0,c)||"0")+"."+i.substring(c),n+i}function QC(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=M0(e),s=i.beforeDecimal,c=i.afterDecimal,d=i.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=s;s&&Number(m[0])&&(g=s.split("").reverse().reduce(function(j,C,E){return j.length>E?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var x=__(m[1]||"",t,n),b=d?"-":"",w=r?".":"";return""+b+g+w+x}function Rs(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var A_=IL(function(e,t){for(var n=0,r=0,i=e.length,s=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[s-1-r]&&s-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:s-r}}}),VL=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function FL(e,t,n){return Math.min(Math.max(e,t),n)}function Qv(e){return Math.max(e.selectionStart,e.selectionEnd)}function HL(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function qL(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function GL(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function WL(e,t,n,r,i,s,c){c===void 0&&(c=GL);var d=i.findIndex(function(_){return _}),f=e.slice(0,d);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},x=new Array(p),b=0;b<p;b++){x[b]=-1;for(var w=0,j=m;w<j;w++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:w});if(C&&g[w]!==!0){x[b]=w,g[w]=!0;break}}}for(var E=r;E<p&&(x[E]===-1||!s(n[E]));)E++;var R=E===p||x[E]===-1?m:x[E];for(E=r-1;E>0&&x[E]===-1;)E--;var T=E===-1||x[E]===-1?0:x[E]+1;return T>R?R:r-T<R-r?T:R}function YC(e,t,n,r){var i=e.length;if(t=FL(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function QL(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(ed(e[n])||ed(e[n-1]));return t}function P_(e,t,n,r,i,s){s===void 0&&(s=$a);var c=UL(function(w,j){var C,E;return T_(w)?(E="",C=""):typeof w=="number"||j?(E=typeof w=="number"?D_(w):w,C=r(E)):(E=i(w,void 0),C=r(E)),{formattedValue:C,numAsString:E}}),d=v.useState(function(){return c(lc(e)?t:e,n)}),f=d[0],p=d[1],m=function(w,j){w.formattedValue!==f.formattedValue&&p({formattedValue:w.formattedValue,numAsString:w.value}),s(w,j)},g=e,x=n;lc(e)&&(g=f.numAsString,x=!0);var b=c(g,x);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function YL(e){return e.replace(/[^0-9]/g,"")}function KL(e){return e}function XL(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,s=e.getInputRef,c=e.format;c===void 0&&(c=KL);var d=e.removeFormatting;d===void 0&&(d=YL);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,x=e.onChange;x===void 0&&(x=$a);var b=e.onKeyDown;b===void 0&&(b=$a);var w=e.onMouseUp;w===void 0&&(w=$a);var j=e.onFocus;j===void 0&&(j=$a);var C=e.onBlur;C===void 0&&(C=$a);var E=e.value,R=e.getCaretBoundary;R===void 0&&(R=QL);var T=e.isValidInputCharacter;T===void 0&&(T=ed);var _=e.isCharacterSame,P=E_(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=P_(E,f,!!p,c,d,m),M=A[0],I=M.formattedValue,V=M.numAsString,H=A[1],Z=v.useRef(),K=v.useRef({formattedValue:I,numAsString:V}),Q=function(Re,Ae){K.current={formattedValue:Re.formattedValue,numAsString:Re.value},H(Re,Ae)},B=v.useState(!1),W=B[0],N=B[1],L=v.useRef(null),$=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return N(!0),function(){clearTimeout($.current.setCaretTimeout),clearTimeout($.current.focusTimeout)}},[]);var q=c,O=function(Re,Ae){var Qe=parseFloat(Ae);return{formattedValue:Re,value:Ae,floatValue:isNaN(Qe)?void 0:Qe}},F=function(Re,Ae,Qe){Re.selectionStart===0&&Re.selectionEnd===Re.value.length||(Rs(Re,Ae),$.current.setCaretTimeout=setTimeout(function(){Re.value===Qe&&Re.selectionStart!==Ae&&Rs(Re,Ae)},0))},te=function(Re,Ae,Qe){return YC(Re,Ae,R(Re),Qe)},ae=function(Re,Ae,Qe){var _e=R(Ae),he=WL(Ae,I,Re,Qe,_e,T,_);return he=YC(Ae,he,_e),he},je=function(Re){var Ae=Re.formattedValue;Ae===void 0&&(Ae="");var Qe=Re.input,_e=Re.source,he=Re.event,Se=Re.numAsString,$e;if(Qe){var be=Re.inputValue||Qe.value,Oe=Qv(Qe);Qe.value=Ae,$e=ae(be,Ae,Oe),$e!==void 0&&F(Qe,$e,Ae)}Ae!==I&&Q(O(Ae,Se),{event:he,source:_e})};v.useEffect(function(){var Re=K.current,Ae=Re.formattedValue,Qe=Re.numAsString;(I!==Ae||V!==Qe)&&Q(O(I,V),{event:void 0,source:Ju.props})},[I,V]);var xe=L.current?Qv(L.current):void 0,we=typeof window<"u"?v.useLayoutEffect:v.useEffect;we(function(){var Re=L.current;if(I!==K.current.formattedValue&&Re){var Ae=ae(K.current.formattedValue,I,xe);Re.value=I,F(Re,Ae,I)}},[I]);var Ge=function(Re,Ae,Qe){var _e=Ae.target,he=Z.current?VL(Z.current,_e.selectionEnd):A_(I,Re),Se=Object.assign(Object.assign({},he),{lastValue:I}),$e=d(Re,Se),be=q($e);if($e=d(be,void 0),g&&!g(O(be,$e))){var Oe=Ae.target,_t=Qv(Oe),xt=ae(Re,I,_t);return Oe.value=I,F(Oe,xt,I),!1}return je({formattedValue:be,numAsString:$e,inputValue:Re,event:Ae,source:Qe,input:Ae.target}),!0},Ee=function(Re,Ae){Ae===void 0&&(Ae=0);var Qe=Re.selectionStart,_e=Re.selectionEnd;Z.current={selectionStart:Qe,selectionEnd:_e+Ae}},ot=function(Re){var Ae=Re.target,Qe=Ae.value,_e=Ge(Qe,Re,Ju.event);_e&&x(Re),Z.current=void 0},et=function(Re){var Ae=Re.target,Qe=Re.key,_e=Ae.selectionStart,he=Ae.selectionEnd,Se=Ae.value;Se===void 0&&(Se="");var $e;Qe==="ArrowLeft"||Qe==="Backspace"?$e=Math.max(_e-1,0):Qe==="ArrowRight"?$e=Math.min(_e+1,Se.length):Qe==="Delete"&&($e=_e);var be=0;Qe==="Delete"&&_e===he&&(be=1);var Oe=Qe==="ArrowLeft"||Qe==="ArrowRight";if($e===void 0||_e!==he&&!Oe){b(Re),Ee(Ae,be);return}var _t=$e;if(Oe){var xt=Qe==="ArrowLeft"?"left":"right";_t=te(Se,$e,xt),_t!==$e&&Re.preventDefault()}else Qe==="Delete"&&!T(Se[$e])?_t=te(Se,$e,"right"):Qe==="Backspace"&&!T(Se[$e])&&(_t=te(Se,$e,"left"));_t!==$e&&F(Ae,_t,Se),b(Re),Ee(Ae,be)},Ct=function(Re){var Ae=Re.target,Qe=function(){var _e=Ae.selectionStart,he=Ae.selectionEnd,Se=Ae.value;if(Se===void 0&&(Se=""),_e===he){var $e=te(Se,_e);$e!==_e&&F(Ae,$e,Se)}};Qe(),requestAnimationFrame(function(){Qe()}),w(Re),Ee(Ae)},Ot=function(Re){Re.persist&&Re.persist();var Ae=Re.target,Qe=Re.currentTarget;L.current=Ae,$.current.focusTimeout=setTimeout(function(){var _e=Ae.selectionStart,he=Ae.selectionEnd,Se=Ae.value;Se===void 0&&(Se="");var $e=te(Se,_e);$e!==_e&&!(_e===0&&he===Se.length)&&F(Ae,$e,Se),j(Object.assign(Object.assign({},Re),{currentTarget:Qe}))},0)},Mt=function(Re){L.current=null,clearTimeout($.current.focusTimeout),clearTimeout($.current.setCaretTimeout),C(Re)},pt=W&&HL()?"numeric":void 0,Rt=Object.assign({inputMode:pt},P,{type:t,value:I,onChange:ot,onKeyDown:et,onMouseUp:Ct,onFocus:Ot,onBlur:Mt});if(n==="text")return i?jn.createElement(jn.Fragment,null,i(I,P)||null):jn.createElement("span",Object.assign({},P,{ref:s}),I);if(r){var en=r;return jn.createElement(en,Object.assign({},Rt,{ref:s}))}return jn.createElement("input",Object.assign({},Rt,{ref:s}))}function KC(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var s=t.suffix;s===void 0&&(s="");var c=t.allowNegative,d=t.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var f=Bp(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,x=M0(e,c),b=x.beforeDecimal,w=x.afterDecimal,j=x.addNegation;return n!==void 0&&(w=__(w,n,!!r)),p&&(b=zL(b,p,d)),i&&(b=i+b),s&&(w=w+s),j&&(b="-"+b),e=b+(g&&m||"")+w,e}function Bp(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 ZL(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),i&&!s&&t&&(e="-"+e),e}function JL(e,t){return new RegExp("(^-)|[0-9]|"+R_(e),"g")}function e6(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function t6(e,t,n){var r;t===void 0&&(t=qL(e));var i=n.allowNegative,s=n.prefix;s===void 0&&(s="");var c=n.suffix;c===void 0&&(c="");var d=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,x=Bp(n),b=x.allowedDecimalSeparators,w=x.decimalSeparator,j=e[g]===w;if(ed(e)&&(e===s||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=d===0?"":w;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var E=function(L,$,q){var O=!1,F=!1;s.startsWith("-")?O=!1:L.startsWith("--")?(O=!1,F=!0):c.startsWith("-")&&L.length===c.length?O=!1:L[0]==="-"&&(O=!0);var te=O?1:0;return F&&(te=2),te&&(L=L.substring(te),$-=te,q-=te),{value:L,start:$,end:q,hasNegation:O}},R=E(e,m,g),T=R.hasNegation;r=R,e=r.value,m=r.start,g=r.end;var _=E(t.lastValue,f.start,f.end),P=_.start,A=_.end,M=_.value,I=e.substring(m,g);e.length&&M.length&&(P>M.length-c.length||A<s.length)&&!(I&&c.startsWith(I))&&(e=M);var V=0;e.startsWith(s)?V+=s.length:m<s.length&&(V=m),e=e.substring(V),g-=V;var H=e.length,Z=e.length-c.length;e.endsWith(c)?H=Z:(g>Z||g>e.length-c.length)&&(H=g),e=e.substring(0,H),e=ZL(T?"-"+e:e,i),e=(e.match(JL(w))||[]).join("");var K=e.indexOf(w);e=e.replace(new RegExp(R_(w),"g"),function(L,$){return $===K?".":""});var Q=M0(e,i),B=Q.beforeDecimal,W=Q.afterDecimal,N=Q.addNegation;return p.end-p.start<f.end-f.start&&B===""&&j&&!parseFloat(W)&&(e=N?"-":""),e}function n6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";i.fill(!1,0,n.length+(s?1:0));var c=e.length;return i.fill(!1,c-r.length+1,c+1),i}function r6(e){var t=Bp(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var s=e.allowNegative;if(s===void 0&&(s=!0),n===r)throw new Error(`
69
+ Decimal separator can't be same as thousand separator.
70
+ thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
71
+ decimalSeparator: `+r+` (default value for decimalSeparator is .)
72
+ `);return i.startsWith("-")&&s&&(console.error(`
73
+ Prefix can't start with '-' when allowNegative is true.
74
+ prefix: `+i+`
75
+ allowNegative: `+s+`
76
+ `),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function o6(e){e=r6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=$a);var s=e.onBlur;s===void 0&&(s=$a);var c=e.thousandSeparator,d=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,x=e.valueIsNumericString,b=e.onValueChange,w=E_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=Bp(e),C=j.decimalSeparator,E=j.allowedDecimalSeparators,R=function(N){return KC(N,e)},T=function(N,L){return t6(N,L,e)},_=lc(g)?m:g,P=x??e6(_,p,t);lc(g)?lc(m)||(P=P||typeof m=="number"):P=P||typeof g=="number";var A=function(N){return T_(N)?N:(typeof N=="number"&&(N=D_(N)),P&&typeof d=="number"?QC(N,d,!!f):N)},M=P_(A(g),A(m),!!P,R,T,b),I=M[0],V=I.numAsString,H=I.formattedValue,Z=M[1],K=function(N){var L=N.target,$=N.key,q=L.selectionStart,O=L.selectionEnd,F=L.value;if(F===void 0&&(F=""),($==="Backspace"||$==="Delete")&&O<p.length){N.preventDefault();return}if(q!==O){i(N);return}$==="Backspace"&&F[0]==="-"&&q===p.length+1&&n&&Rs(L,1),d&&f&&($==="Backspace"&&F[q-1]===C?(Rs(L,q-1),N.preventDefault()):$==="Delete"&&F[q]===C&&N.preventDefault()),E?.includes($)&&F[q]===C&&Rs(L,q+1);var te=c===!0?",":c;$==="Backspace"&&F[q-1]===te&&Rs(L,q-1),$==="Delete"&&F[q]===te&&Rs(L,q+1),i(N)},Q=function(N){var L=V;if(L.match(/\d/g)||(L=""),r||(L=BL(L)),f&&d&&(L=QC(L,d,f)),L!==V){var $=KC(L,e);Z({formattedValue:$,value:L,floatValue:parseFloat(L)},{event:N,source:Ju.event})}s(N)},B=function(N){return N===C?!0:ed(N)},W=function(N){var L=N.currentValue,$=N.lastValue,q=N.formattedValue,O=N.currentValueIndex,F=N.formattedValueIndex,te=L[O],ae=q[F],je=A_($,L),xe=je.to,we=function(Ge){return T(Ge).indexOf(".")+p.length};return g===0&&f&&d&&L[xe.start]===C&&we(L)<O&&we(q)>F?!1:O>=xe.start&&O<xe.end&&E&&E.includes(te)&&ae===C?!0:te===ae};return Object.assign(Object.assign({},w),{value:H,valueIsNumericString:!1,isValidInputCharacter:B,isCharacterSame:W,onValueChange:Z,format:R,removeFormatting:T,getCaretBoundary:function(N){return n6(N,e)},onKeyDown:K,onBlur:Q})}function i6(e){var t=o6(e);return jn.createElement(XL,Object.assign({},t))}function XC({direction:e,style:t,...n}){return a.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:a.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 Ly={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const a6=/^(0\.0*|-0(\.0*)?)$/,s6=/^-?0\d+(\.\d+)?\.?$/;function $y(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function Yv(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||$y(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function l6(e){return e.toString().replace(".","").length}function c6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&l6(t)<14&&t!==""}function ZC(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,i=n===void 0||e<=n;return r&&i}const u6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},d6=(e,{size:t})=>({controls:{"--ni-chevron-size":nt(t,"ni-chevron-size")}});function f6(e,t,n){const r=e.toString().replace(/^0+/,""),i=parseFloat(r);return Number.isNaN(i)?r:i>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:xh(i,n,t)}const Vp=ge((e,t)=>{const n=se("NumberInput",u6,e),{className:r,classNames:i,styles:s,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:x,min:b,step:w,hideControls:j,rightSection:C,isAllowed:E,clampBehavior:R,onBlur:T,allowDecimal:_,decimalScale:P,onKeyDown:A,onKeyDownCapture:M,handlersRef:I,startValue:V,disabled:H,rightSectionPointerEvents:Z,allowNegative:K,readOnly:Q,size:B,rightSectionWidth:W,stepHoldInterval:N,stepHoldDelay:L,allowLeadingZeros:$,withKeyboardEvents:q,trimLeadingZeroesOnBlur:O,...F}=n,te=Me({name:"NumberInput",classes:Ly,props:n,classNames:i,styles:s,unstyled:c,vars:d,varsResolver:d6}),{resolvedClassNames:ae,resolvedStyles:je}=Xs({classNames:i,styles:s,props:n}),[xe,we]=Kn({value:m,defaultValue:g,finalValue:"",onChange:f}),Ge=L!==void 0&&N!==void 0,Ee=v.useRef(null),ot=v.useRef(null),et=v.useRef(0),Ct=(be,Oe)=>{Oe.source==="event"&&we(c6(be.floatValue,be.value)&&!a6.test(be.value)&&!($&&s6.test(be.value))?be.floatValue:be.value),p?.(be,Oe)},Ot=be=>{const Oe=String(be).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Oe?Math.max(0,(Oe[1]?Oe[1].length:0)-(Oe[2]?+Oe[2]:0)):0},Mt=be=>{Ee.current&&typeof be<"u"&&Ee.current.setSelectionRange(be,be)},pt=v.useRef(kh);pt.current=()=>{if(!Yv(xe))return;let be;const Oe=Ot(xe),_t=Ot(w),xt=Math.max(Oe,_t),tn=10**xt;if(!$y(xe)&&(typeof xe!="number"||Number.isNaN(xe)))be=xh(V,b,x);else if(x!==void 0){const In=(Math.round(Number(xe)*tn)+Math.round(w*tn))/tn;be=In<=x?In:x}else be=(Math.round(Number(xe)*tn)+Math.round(w*tn))/tn;const Lt=be.toFixed(xt);we(parseFloat(Lt)),p?.({floatValue:parseFloat(Lt),formattedValue:Lt,value:Lt},{source:"increment"}),setTimeout(()=>Mt(Ee.current?.value.length),0)};const Rt=v.useRef(kh);Rt.current=()=>{if(!Yv(xe))return;let be;const Oe=b!==void 0?b:K?Number.MIN_SAFE_INTEGER:0,_t=Ot(xe),xt=Ot(w),tn=Math.max(_t,xt),Lt=10**tn;if(!$y(xe)&&typeof xe!="number"||Number.isNaN(xe))be=xh(V,Oe,x);else{const Dn=(Math.round(Number(xe)*Lt)-Math.round(w*Lt))/Lt;be=Oe!==void 0&&Dn<Oe?Oe:Dn}const In=be.toFixed(tn);we(parseFloat(In)),p?.({floatValue:parseFloat(In),formattedValue:In,value:In},{source:"decrement"}),setTimeout(()=>Mt(Ee.current?.value.length),0)};const en=be=>{A?.(be),!(Q||!q)&&(be.key==="ArrowUp"&&(be.preventDefault(),pt.current()),be.key==="ArrowDown"&&(be.preventDefault(),Rt.current()))},Re=be=>{if(M?.(be),be.key==="Backspace"){const Oe=Ee.current;Oe.selectionStart===0&&Oe.selectionStart===Oe.selectionEnd&&(be.preventDefault(),window.setTimeout(()=>Mt(0),0))}},Ae=be=>{let Oe=xe;R==="blur"&&typeof Oe=="number"&&(Oe=xh(Oe,b,x)),O&&typeof Oe=="string"&&Ot(Oe)<15&&(Oe=f6(Oe,x,b)),xe!==Oe&&we(Oe),T?.(be)};Yu(I,{increment:pt.current,decrement:Rt.current});const Qe=be=>{be?pt.current():Rt.current(),et.current+=1},_e=be=>{if(Qe(be),Ge){const Oe=typeof N=="number"?N:N(et.current);ot.current=window.setTimeout(()=>_e(be),Oe)}},he=(be,Oe)=>{be.preventDefault(),Ee.current?.focus(),Qe(Oe),Ge&&(ot.current=window.setTimeout(()=>_e(Oe),L))},Se=()=>{ot.current&&window.clearTimeout(ot.current),ot.current=null,et.current=0},$e=a.jsxs("div",{...te("controls"),children:[a.jsx(er,{...te("control"),tabIndex:-1,"aria-hidden":!0,disabled:H||typeof xe=="number"&&x!==void 0&&xe>=x,mod:{direction:"up"},onMouseDown:be=>be.preventDefault(),onPointerDown:be=>{he(be,!0)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(XC,{direction:"up"})}),a.jsx(er,{...te("control"),tabIndex:-1,"aria-hidden":!0,disabled:H||typeof xe=="number"&&b!==void 0&&xe<=b,mod:{direction:"down"},onMouseDown:be=>be.preventDefault(),onPointerDown:be=>{he(be,!1)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(XC,{direction:"down"})})]});return a.jsx(Pr,{component:i6,allowNegative:K,className:It(Ly.root,r),size:B,...F,readOnly:Q,disabled:H,value:xe,getInputRef:Bn(t,Ee),onValueChange:Ct,rightSection:j||Q||!Yv(xe)?C:C||$e,classNames:ae,styles:je,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?P:0,onKeyDown:en,onKeyDownCapture:Re,rightSectionPointerEvents:Z??(H?"none":void 0),rightSectionWidth:W??`var(--ni-right-section-width-${B||"sm"})`,allowLeadingZeros:$,onBlur:Ae,isAllowed:be=>R==="strict"?E?E(be)&&ZC(be.floatValue,b,x):ZC(be.floatValue,b,x):E?E(be):!0})});Vp.classes={...Pr.classes,...Ly};Vp.displayName="@mantine/core/NumberInput";const[h6,Fp]=gr("Pagination.Root component was not found in tree");var bd={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const p6={withPadding:!0},Sd=ge((e,t)=>{const n=se("PaginationControl",p6,e),{classNames:r,className:i,style:s,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...x}=n,b=Fp(),w=p||b.disabled;return a.jsx(er,{ref:t,disabled:w,mod:[{active:f,disabled:w,"with-padding":m},g],...b.getStyles("control",{className:i,style:s,classNames:r,styles:c,active:!w}),...x})});Sd.classes=bd;Sd.displayName="@mantine/core/PaginationControl";function wd({style:e,children:t,path:n,...r}){return a.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:a.jsx("path",{d:n,fill:"currentColor"})})}const m6=e=>a.jsx(wd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),g6=e=>a.jsx(wd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),v6=e=>a.jsx(wd,{...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"}),y6=e=>a.jsx(wd,{...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"}),x6=e=>a.jsx(wd,{...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"}),b6={icon:x6},Hp=ge((e,t)=>{const n=se("PaginationDots",b6,e),{classNames:r,className:i,style:s,styles:c,vars:d,icon:f,...p}=n,m=Fp(),g=f;return a.jsx(ce,{ref:t,...m.getStyles("dots",{className:i,style:s,styles:c,classNames:r}),...p,children:a.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Hp.classes=bd;Hp.displayName="@mantine/core/PaginationDots";function qp({icon:e,name:t,action:n,type:r}){const i={icon:e},s=v.forwardRef((c,d)=>{const{icon:f,...p}=se(t,i,c),m=f,g=Fp(),x=r==="next"?g.active===g.total:g.active===1;return a.jsx(Sd,{disabled:g.disabled||x,ref:d,onClick:g[n],withPadding:!1,...p,children:a.jsx(m,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${t}`,s}const k_=qp({icon:m6,name:"PaginationNext",action:"onNext",type:"next"}),N_=qp({icon:g6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),O_=qp({icon:v6,name:"PaginationFirst",action:"onFirst",type:"previous"}),M_=qp({icon:y6,name:"PaginationLast",action:"onLast",type:"next"});function I0({dotsIcon:e}){const t=Fp(),n=t.range.map((r,i)=>r==="dots"?a.jsx(Hp,{icon:e},i):a.jsx(Sd,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},i));return a.jsx(a.Fragment,{children:n})}I0.displayName="@mantine/core/PaginationItems";const S6={siblings:1,boundaries:1},w6=(e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ut(n),"--pagination-control-size":nt(t,"pagination-control-size"),"--pagination-control-fz":Nn(t),"--pagination-active-bg":r?Ft(r,e):void 0,"--pagination-active-color":Zs(i,e)?Ki({color:r,theme:e,autoContrast:i}):void 0}}),Gp=ge((e,t)=>{const n=se("PaginationRoot",S6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:x,disabled:b,siblings:w,boundaries:j,color:C,radius:E,onNextPage:R,onPreviousPage:T,onFirstPage:_,onLastPage:P,getItemProps:A,autoContrast:M,...I}=n,V=Me({name:"Pagination",classes:bd,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:w6}),{range:H,setPage:Z,next:K,previous:Q,active:B,first:W,last:N}=A3({page:m,initialPage:g,onChange:x,total:p,siblings:w,boundaries:j}),L=Tr(R,K),$=Tr(T,Q),q=Tr(_,W),O=Tr(P,N);return a.jsx(h6,{value:{total:p,range:H,active:B,disabled:b,getItemProps:A,onChange:Z,onNext:L,onPrevious:$,onFirst:q,onLast:O,getStyles:V},children:a.jsx(ce,{ref:t,...V("root"),...I})})});Gp.classes=bd;Gp.displayName="@mantine/core/PaginationRoot";const j6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},jo=ge((e,t)=>{const n=se("Pagination",j6,e),{withEdges:r,withControls:i,getControlProps:s,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:x,hideWithOnePage:b,withPages:w,...j}=n;return g<=0||b&&g===1?null:a.jsx(Gp,{ref:t,total:g,...j,children:a.jsxs(ye,{gap:x,children:[r&&a.jsx(O_,{icon:p,...s?.("first")}),i&&a.jsx(N_,{icon:d,...s?.("previous")}),w&&a.jsx(I0,{dotsIcon:m}),i&&a.jsx(k_,{icon:c,...s?.("next")}),r&&a.jsx(M_,{icon:f,...s?.("last")})]})})});jo.classes=bd;jo.displayName="@mantine/core/Pagination";jo.Root=Gp;jo.Control=Sd;jo.Dots=Hp;jo.First=O_;jo.Last=M_;jo.Next=k_;jo.Previous=N_;jo.Items=I0;const C6=({reveal:e})=>a.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:a.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 zy={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const E6={visibilityToggleIcon:C6},T6=(e,{size:t})=>({root:{"--psi-icon-size":nt(t,"psi-icon-size"),"--psi-button-size":nt(t,"psi-button-size")}}),Oo=ge((e,t)=>{const n=se("PasswordInput",E6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:x,id:b,variant:w,inputContainer:j,description:C,label:E,size:R,errorProps:T,descriptionProps:_,labelProps:P,withAsterisk:A,inputWrapperOrder:M,wrapperProps:I,radius:V,rightSection:H,rightSectionWidth:Z,rightSectionPointerEvents:K,leftSectionWidth:Q,visible:B,defaultVisible:W,onVisibilityChange:N,visibilityToggleIcon:L,visibilityToggleButtonProps:$,rightSectionProps:q,leftSectionProps:O,leftSectionPointerEvents:F,withErrorStyles:te,mod:ae,...je}=n,xe=vr(b),[we,Ge]=Kn({value:B,defaultValue:W,finalValue:!1,onChange:N}),Ee=()=>Ge(!we),ot=Me({name:"PasswordInput",classes:zy,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:T6}),{resolvedClassNames:et,resolvedStyles:Ct}=Xs({classNames:r,styles:c,props:n}),{styleProps:Ot,rest:Mt}=Xi(je),pt=L,Rt=T?.id||`${xe}-error`,en=_?.id||`${xe}-description`,Qe=`${!!m&&typeof m!="boolean"?Rt:""} ${!!C?en:""}`,_e=Qe.trim().length>0?Qe.trim():void 0,he=a.jsx(_n,{...ot("visibilityToggle"),disabled:x,radius:V,"aria-hidden":!$,tabIndex:-1,...$,variant:$?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:Se=>{Se.preventDefault(),$?.onTouchEnd?.(Se),Ee()},onMouseDown:Se=>{Se.preventDefault(),$?.onMouseDown?.(Se),Ee()},onKeyDown:Se=>{$?.onKeyDown?.(Se),Se.key===" "&&(Se.preventDefault(),Ee())},children:a.jsx(pt,{reveal:we})});return a.jsx(fn.Wrapper,{required:p,id:xe,label:E,error:m,description:C,size:R,classNames:et,styles:Ct,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:A,inputWrapperOrder:M,inputContainer:j,variant:w,labelProps:{...P,htmlFor:xe},descriptionProps:{..._,id:en},errorProps:{...T,id:Rt},mod:ae,...ot("root"),...Ot,...I,children:a.jsx(fn,{component:"div",error:m,leftSection:g,size:R,classNames:{...et,input:It(zy.input,et.input)},styles:Ct,radius:V,disabled:x,__staticSelector:"PasswordInput",rightSectionWidth:Z,rightSection:H??he,variant:w,unstyled:d,leftSectionWidth:Q,rightSectionPointerEvents:K||"all",rightSectionProps:q,leftSectionProps:O,leftSectionPointerEvents:F,withAria:!1,withErrorStyles:te,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...ot("innerInput"),disabled:x,id:xe,ref:t,...Mt,"aria-describedby":_e,autoComplete:Mt.autoComplete||"off",type:we?"text":"password"})})})});Oo.classes={...Pr.classes,...zy};Oo.displayName="@mantine/core/PasswordInput";const[R6,I_]=Qi(),[_6,D6]=Qi();var L_={card:"m_9dc8ae12"};const A6={withBorder:!0},P6=(e,{radius:t})=>({card:{"--card-radius":Ut(t)}}),L0=ge((e,t)=>{const n=se("RadioCard",A6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,name:w,onKeyDown:j,...C}=n,E=Me({name:"RadioCard",classes:L_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:P6,rootSelector:"card"}),{dir:R}=el(),T=I_(),_=typeof p=="boolean"?p:T?.value===x||!1,P=w||T?.name,A=M=>{if(j?.(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const I=Array.from(document.querySelectorAll(`[role="radio"][name="${P||"__mantine"}"]`)),V=I.findIndex(K=>K===M.target),H=V+1>=I.length?0:V+1,Z=V-1<0?I.length-1:V-1;M.nativeEvent.code==="ArrowDown"&&(I[H].focus(),I[H].click()),M.nativeEvent.code==="ArrowUp"&&(I[Z].focus(),I[Z].click()),M.nativeEvent.code==="ArrowLeft"&&(I[R==="ltr"?Z:H].focus(),I[R==="ltr"?Z:H].click()),M.nativeEvent.code==="ArrowRight"&&(I[R==="ltr"?H:Z].focus(),I[R==="ltr"?H:Z].click())}};return a.jsx(_6,{value:{checked:_},children:a.jsx(er,{ref:t,mod:[{"with-border":g,checked:_},m],...E("card"),...C,role:"radio","aria-checked":_,name:P,onClick:M=>{b?.(M),T?.onChange(x||"")},onKeyDown:A})})});L0.displayName="@mantine/core/RadioCard";L0.classes=L_;const k6={},$0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:d,name:f,readOnly:p,...m}=se("RadioGroup",k6,e),g=vr(f),[x,b]=Kn({value:n,defaultValue:r,finalValue:"",onChange:i}),w=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return a.jsx(R6,{value:{value:x,onChange:w,size:s,name:g},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(f0,{role:"radiogroup",children:d})})})});$0.classes=fn.Wrapper.classes;$0.displayName="@mantine/core/RadioGroup";function $_({size:e,style:t,...n}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var z_={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const N6={icon:$_},O6=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--radio-size":nt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ut(t),"--radio-color":s==="outline"?f:Ft(n,e),"--radio-icon-size":nt(r,"radio-icon-size"),"--radio-icon-color":i?Ft(i,e):Zs(c,e)?Ki({color:n,theme:e,autoContrast:c}):void 0}}},z0=ge((e,t)=>{const n=se("RadioIndicator",N6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:x,autoContrast:b,checked:w,mod:j,variant:C,disabled:E,...R}=n,T=p,_=Me({name:"RadioIndicator",classes:z_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:O6,rootSelector:"indicator"}),P=D6(),A=typeof w=="boolean"?w:P?.checked||!1;return a.jsx(ce,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:A,disabled:E},j],...R,children:a.jsx(T,{..._("icon")})})});z0.displayName="@mantine/core/RadioIndicator";z0.classes=z_;var U_={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const M6={labelPosition:"right"},I6=(e,{size:t,radius:n,color:r,iconColor:i,variant:s,autoContrast:c})=>{const d=go({color:r||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--radio-size":nt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ut(n),"--radio-color":s==="outline"?f:Ft(r,e),"--radio-icon-color":i?Ft(i,e):Zs(c,e)?Ki({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":nt(t,"radio-icon-size")}}},Bs=ge((e,t)=>{const n=se("Radio",M6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:x,description:b,error:w,radius:j,color:C,variant:E,disabled:R,wrapperProps:T,icon:_=$_,rootRef:P,iconColor:A,onChange:M,mod:I,...V}=n,H=Me({name:"Radio",classes:U_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:I6}),Z=I_(),K=Z?.size??m,Q=n.size?m:K,{styleProps:B,rest:W}=Xi(V),N=vr(p),L=Z?{checked:Z.value===W.value,name:W.name??Z.name,onChange:$=>{Z.onChange($),M?.($)}}:{};return a.jsx(Rp,{...H("root"),__staticSelector:"Radio",__stylesApiProps:n,id:N,size:Q,labelPosition:x,label:g,description:b,error:w,disabled:R,classNames:r,styles:c,unstyled:d,"data-checked":L.checked||void 0,variant:E,ref:P,mod:I,...B,...T,children:a.jsxs(ce,{...H("inner"),mod:{"label-position":x},children:[a.jsx(ce,{...H("radio",{focusable:!0,variant:E}),onChange:M,...W,...L,component:"input",mod:{error:!!w},ref:t,id:N,disabled:R,type:"radio"}),a.jsx(_,{...H("icon"),"aria-hidden":!0})]})})});Bs.classes=U_;Bs.displayName="@mantine/core/Radio";Bs.Group=$0;Bs.Card=L0;Bs.Indicator=z0;const L6={duration:100,transition:"fade"};function $6(e,t){return{...L6,...t,...e}}function z6({offset:e,position:t,defaultOpened:n}){const[r,i]=v.useState(n),s=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=zx({placement:t,middleware:[Mx({crossAxis:!0,padding:5,rootBoundary:"document"})]}),x=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,w=v.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+x,top:C+b,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(p.floating.current){const j=s.current;j.addEventListener("mousemove",w);const C=Bi(p.floating.current);return C.forEach(E=>{E.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",w),C.forEach(E=>{E.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,w,r]),{handleMouseMove:w,x:c,y:d,opened:r,setOpened:i,boundaryRef:s,floating:p.setFloating}}var Wp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const U6={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Yr("popover")},B6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ut(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),U0=ge((e,t)=>{const n=se("TooltipFloating",U6,e),{children:r,refProp:i,withinPortal:s,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:x,label:b,offset:w,position:j,multiline:C,zIndex:E,disabled:R,defaultOpened:T,variant:_,vars:P,portalProps:A,...M}=n,I=yn(),V=Me({name:"TooltipFloating",props:n,classes:Wp,className:d,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:P,varsResolver:B6}),{handleMouseMove:H,x:Z,y:K,opened:Q,boundaryRef:B,floating:W,setOpened:N}=z6({offset:w,position:j,defaultOpened:T});if(!Wi(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 L=Bn(B,hp(r),t),$=r.props,q=F=>{$.onMouseEnter?.(F),H(F),N(!0)},O=F=>{$.onMouseLeave?.(F),N(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(Ya,{...A,withinPortal:s,children:a.jsx(ce,{...M,...V("tooltip",{style:{...PR(c,I),zIndex:E,display:!R&&Q?"block":"none",top:(K&&Math.round(K))??"",left:(Z&&Math.round(Z))??""}}),variant:_,ref:W,mod:{multiline:C},children:b})}),v.cloneElement(r,{...$,[i]:L,onMouseEnter:q,onMouseLeave:O})]})});U0.classes=Wp;U0.displayName="@mantine/core/TooltipFloating";const B_=v.createContext(!1),V6=B_.Provider,F6=()=>v.useContext(B_),H6={openDelay:0,closeDelay:0};function B0(e){const{openDelay:t,closeDelay:n,children:r}=se("TooltipGroup",H6,e);return a.jsx(V6,{value:!0,children:a.jsx(x9,{delay:{open:t,close:n},children:r})})}B0.displayName="@mantine/core/TooltipGroup";B0.extend=e=>e;function q6(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 G6(e){const t=q6(e.middlewares),n=[KR(e.offset)];return t.shift&&n.push(Mx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?$h():$h(t.flip)),n.push(XR({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?qu():qu(t.inline)):e.inline&&n.push(qu()),n}function W6(e){const[t,n]=v.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,s=F6(),c=vr(),d=v.useCallback(A=>{n(A),A&&R(c)},[c]),{x:f,y:p,context:m,refs:g,update:x,placement:b,middlewareData:{arrow:{x:w,y:j}={}}}=zx({strategy:e.strategy,placement:e.position,open:i,onOpenChange:d,middleware:G6(e)}),{delay:C,currentId:E,setCurrentId:R}=b9(m,{id:c}),{getReferenceProps:T,getFloatingProps:_}=R9([v9(m,{enabled:e.events?.hover,delay:s?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),T9(m,{enabled:e.events?.focus,visibleOnly:!0}),D9(m,{role:"tooltip"}),C9(m,{enabled:typeof e.opened>"u"})]);j2({opened:i,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:x}}),Vi(()=>{e.onPositionChange?.(b)},[b]);const P=i&&E&&E!==c;return{x:f,y:p,arrowX:w,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:_,getReferenceProps:T,isGroupPhase:P,opened:i,placement:b}}const JC={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:Yr("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},Q6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ut(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),nl=ge((e,t)=>{const n=se("Tooltip",JC,e),{children:r,position:i,refProp:s,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:x,radius:b,color:w,classNames:j,styles:C,unstyled:E,style:R,className:T,withArrow:_,arrowSize:P,arrowOffset:A,arrowRadius:M,arrowPosition:I,offset:V,transitionProps:H,multiline:Z,events:K,zIndex:Q,disabled:B,positionDependencies:W,onClick:N,onMouseEnter:L,onMouseLeave:$,inline:q,variant:O,keepMounted:F,vars:te,portalProps:ae,mod:je,floatingStrategy:xe,middlewares:we,...Ge}=se("Tooltip",JC,n),{dir:Ee}=el(),ot=v.useRef(null),et=W6({position:g2(Ee,i),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:K,arrowRef:ot,arrowOffset:A,offset:typeof V=="number"?V+(_?P/2:0):V,positionDependencies:[...W,r],inline:q,strategy:xe,middlewares:we}),Ct=Me({name:"Tooltip",props:n,classes:Wp,className:T,style:R,classNames:j,styles:C,unstyled:E,rootSelector:"tooltip",vars:te,varsResolver:Q6});if(!Wi(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 Ot=Bn(et.reference,hp(r),t),Mt=$6(H,{duration:100,transition:"fade"}),pt=r.props;return a.jsxs(a.Fragment,{children:[a.jsx(Ya,{...ae,withinPortal:x,children:a.jsx(fi,{...Mt,keepMounted:F,mounted:!B&&!!et.opened,duration:et.isGroupPhase?10:Mt.duration,children:Rt=>a.jsxs(ce,{...Ge,"data-fixed":xe==="fixed"||void 0,variant:O,mod:[{multiline:Z},je],...et.getFloatingProps({ref:et.floating,className:Ct("tooltip").className,style:{...Ct("tooltip").style,...Rt,zIndex:Q,top:et.y??0,left:et.x??0}}),children:[c,a.jsx(Fx,{ref:ot,arrowX:et.arrowX,arrowY:et.arrowY,visible:_,position:et.placement,arrowSize:P,arrowOffset:A,arrowRadius:M,arrowPosition:I,...Ct("arrow")})]})})}),v.cloneElement(r,et.getReferenceProps({onClick:N,onMouseEnter:L,onMouseLeave:$,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:It(T,pt.className),...pt,[s]:Ot}))]})});nl.classes=Wp;nl.displayName="@mantine/core/Tooltip";nl.Floating=U0;nl.Group=B0;function Y6({size:e,thickness:t,sum:n,value:r,root:i,offset:s}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=i||r===void 0?`${(100-n)*d}, ${n*d}`:`${r*d}, ${(100-r)*d}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:i?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:i?0:s||0}}function V_({size:e,value:t,offset:n,sum:r,thickness:i,root:s,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const x=yn();return a.jsx(nl.Floating,{disabled:!f,label:f,children:a.jsx(ce,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Ft(c,x):void 0},fill:"none",strokeLinecap:d?"round":"butt",...Y6({sum:r,size:e,thickness:i,value:t,offset:n,root:s})})})}V_.displayName="@mantine/core/Curve";function K6({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i}){const s=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let d=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:s,offset:d,data:n[m],root:!1}),d-=n[m].value/100*c;if(f.push({sum:s,offset:d,data:{color:i},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var F_={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function X6(e,t){return Math.min(e||12,(t||120)/4)}const Z6={size:120,thickness:12},J6=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Qp=ge((e,t)=>{const n=se("RingProgress",Z6,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:x,roundCaps:b,rootColor:w,transitionDuration:j,...C}=n,E=Me({name:"RingProgress",classes:F_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:J6}),R=X6(x,g),T=K6({size:g,thickness:R,sections:m,renderRoundedLineCaps:b,rootColor:w}).map(({data:_,sum:P,root:A,lineRoundCaps:M,offset:I},V)=>v.createElement(V_,{..._,key:V,size:g,thickness:R,sum:P,offset:I,color:_?.color,root:A,lineRoundCaps:M,getStyles:E}));return a.jsxs(ce,{...E("root"),size:g,ref:t,...C,children:[a.jsx("svg",{...E("svg"),children:T}),p&&a.jsx("div",{...E("label"),children:p})]})});Qp.classes=F_;Qp.displayName="@mantine/core/RingProgress";var H_={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const e$={withItemsBorders:!0},t$=(e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Ut(t),"--sc-color":n?Ft(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":s,"--sc-padding":nt(i,"sc-padding"),"--sc-font-size":Nn(i)}}),jd=ge((e,t)=>{const n=se("SegmentedControl",e$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:x,size:b,name:w,disabled:j,readOnly:C,fullWidth:E,orientation:R,radius:T,color:_,transitionDuration:P,transitionTimingFunction:A,variant:M,autoContrast:I,withItemsBorders:V,mod:H,...Z}=n,K=Me({name:"SegmentedControl",props:n,classes:H_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:t$}),Q=yn(),B=p.map(Ee=>typeof Ee=="string"?{label:Ee,value:Ee}:Ee),W=I3(),[N,L]=v.useState(Nh()),[$,q]=v.useState(null),[O,F]=v.useState({}),te=(Ee,ot)=>{O[ot]=Ee,F(O)},[ae,je]=Kn({value:m,defaultValue:g,finalValue:Array.isArray(p)?B.find(Ee=>!Ee.disabled)?.value??p[0]?.value??null:null,onChange:x}),xe=vr(w),we=B.map(Ee=>v.createElement(ce,{...K("control"),mod:{active:ae===Ee.value,orientation:R},key:Ee.value},v.createElement("input",{...K("input"),disabled:j||Ee.disabled,type:"radio",name:xe,value:Ee.value,id:`${xe}-${Ee.value}`,checked:ae===Ee.value,onChange:()=>!C&&je(Ee.value),"data-focus-ring":Q.focusRing,key:`${Ee.value}-input`}),v.createElement(ce,{component:"label",...K("label"),mod:{active:ae===Ee.value&&!(j||Ee.disabled),disabled:j||Ee.disabled,"read-only":C},htmlFor:`${xe}-${Ee.value}`,ref:ot=>te(ot,Ee.value),__vars:{"--sc-label-color":_!==void 0?Ki({color:_,theme:Q,autoContrast:I}):void 0},key:`${Ee.value}-label`},a.jsx("span",{...K("innerLabel"),children:Ee.label})))),Ge=Bn(t,Ee=>q(Ee));return N3(()=>{L(Nh())},[p.length]),p.length===0?null:a.jsxs(ce,{...K("root"),variant:M,size:b,ref:Ge,mod:[{"full-width":E,orientation:R,initialized:W,"with-items-borders":V},H],...Z,role:"radiogroup","data-disabled":j,children:[typeof ae=="string"&&a.jsx(Yx,{target:O[ae],parent:$,component:"span",transitionDuration:"var(--sc-transition-duration)",...K("indicator")},N),we]})});jd.classes=H_;jd.displayName="@mantine/core/SegmentedControl";function n$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const i=yn(),s=t===void 0?e:t,c=Qa({"--sg-spacing-x":kn(Po(e)),"--sg-spacing-y":kn(Po(s)),"--sg-cols":Po(n)?.toString()}),d=on(i.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=kn(e[g])),typeof s=="object"&&s[g]!==void 0&&(m[g]["--sg-spacing-y"]=kn(s[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),p=Qu(on(d),i.breakpoints).filter(m=>on(d[m.value]).length>0).map(m=>({query:`(min-width: ${i.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(Js,{styles:c,media:p,selector:r})}function Kv(e){return typeof e=="object"&&e!==null?on(e):[]}function r$(e){return e.sort((t,n)=>Wu(t)-Wu(n))}function o$({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Kv(e),...Kv(t),...Kv(n)]));return r$(r)}function i$({spacing:e,verticalSpacing:t,cols:n,selector:r}){const i=t===void 0?e:t,s=Qa({"--sg-spacing-x":kn(Po(e)),"--sg-spacing-y":kn(Po(i)),"--sg-cols":Po(n)?.toString()}),c=o$({spacing:e,verticalSpacing:t,cols:n}),d=c.reduce((p,m)=>(p[m]||(p[m]={}),typeof e=="object"&&e[m]!==void 0&&(p[m]["--sg-spacing-x"]=kn(e[m])),typeof i=="object"&&i[m]!==void 0&&(p[m]["--sg-spacing-y"]=kn(i[m])),typeof n=="object"&&n[m]!==void 0&&(p[m]["--sg-cols"]=n[m]),p),{}),f=c.map(p=>({query:`simple-grid (min-width: ${p})`,styles:d[p]}));return a.jsx(Js,{styles:s,container:f,selector:r})}var q_={container:"m_925c2d2c",root:"m_2415a157"};const a$={cols:1,spacing:"md",type:"media"},Yp=ge((e,t)=>{const n=se("SimpleGrid",a$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:x,...b}=n,w=Me({name:"SimpleGrid",classes:q_,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f}),j=dd();return x==="container"?a.jsxs(a.Fragment,{children:[a.jsx(i$,{...n,selector:`.${j}`}),a.jsx("div",{...w("container"),children:a.jsx(ce,{ref:t,...w("root",{className:j}),...b})})]}):a.jsxs(a.Fragment,{children:[a.jsx(n$,{...n,selector:`.${j}`}),a.jsx(ce,{ref:t,...w("root",{className:j}),...b})]})});Yp.classes=q_;Yp.displayName="@mantine/core/SimpleGrid";const s$={},Kp=ge((e,t)=>{const{w:n,h:r,miw:i,mih:s,...c}=se("Space",s$,e);return a.jsx(ce,{ref:t,...c,w:n,miw:i??n,h:r,mih:s??r})});Kp.displayName="@mantine/core/Space";var G_={root:"m_6d731127"};const l$={gap:"md",align:"stretch",justify:"flex-start"},c$=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":kn(t),"--stack-align":n,"--stack-justify":r}}),Ve=ge((e,t)=>{const n=se("Stack",l$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:x,...b}=n,w=Me({name:"Stack",props:n,classes:G_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:c$});return a.jsx(ce,{ref:t,...w("root"),variant:x,...b})});Ve.classes=G_;Ve.displayName="@mantine/core/Stack";const[u$,d$]=gr("Stepper component was not found in tree"),Uh=()=>null;Uh.displayName="@mantine/core/StepperCompleted";var V0={root:"m_cbb4ea7e",steps:"m_aaf89d0b",separator:"m_2a371ac9",content:"m_78da155d",step:"m_cbb57068","step--horizontal":"m_f56b1e2c","step--vertical":"m_833edb7e",verticalSeparator:"m_6496b3f3",stepWrapper:"m_818e70b",stepIcon:"m_1959ad01",stepCompletedIcon:"m_a79331dc",stepBody:"m_1956aa2a",stepLabel:"m_12051f6c",stepDescription:"m_164eea74"};const ah=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,f$={withIcon:!0,allowStepClick:!0,iconPosition:"left"},F0=ge((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:x,label:b,description:w,withIcon:j,iconSize:C,loading:E,allowStepClick:R,allowStepSelect:T,iconPosition:_,orientation:P,mod:A,...M}=se("StepperStep",f$,e),I=d$(),V=yn(),H={classNames:n,styles:s},Z=f==="stepCompleted"?null:f==="stepProgress"?x:m,K={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(er,{...I.getStyles("step",{className:r,style:i,variant:I.orientation,...H}),mod:[{"icon-position":_||I.iconPosition,"allow-click":R},A],ref:t,...K,...M,__vars:{"--step-color":p?Ft(p,V):void 0},tabIndex:R?0:-1,children:[j&&a.jsxs("span",{...I.getStyles("stepWrapper",H),children:[a.jsxs("span",{...I.getStyles("stepIcon",H),...K,children:[a.jsx(fi,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Q=>a.jsx("span",{...I.getStyles("stepCompletedIcon",{style:Q,...H}),children:E?a.jsx(Dr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...I.getStyles("stepLoader",H)}):ah(g,d)||a.jsx(_p,{size:"60%"})})}),f!=="stepCompleted"?E?a.jsx(Dr,{...I.getStyles("stepLoader",H),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ah(Z||m,d):null]}),P==="vertical"&&a.jsx("span",{...I.getStyles("verticalSeparator",H),"data-active":f==="stepCompleted"||void 0})]}),(b||w)&&a.jsxs("span",{...I.getStyles("stepBody",H),"data-orientation":I.orientation,"data-icon-position":_||I.iconPosition,children:[b&&a.jsx("span",{...I.getStyles("stepLabel",H),children:ah(b,d)}),w&&a.jsx("span",{...I.getStyles("stepDescription",H),children:ah(w,d)})]})]})});F0.classes=V0;F0.displayName="@mantine/core/StepperStep";const h$={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},p$=(e,{color:t,iconSize:n,size:r,contentPadding:i,radius:s,autoContrast:c})=>({root:{"--stepper-color":t?Ft(t,e):void 0,"--stepper-icon-color":Zs(c,e)?Ki({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?nt(r,"stepper-icon-size"):le(n),"--stepper-content-padding":kn(i),"--stepper-radius":s===void 0?void 0:Ut(s),"--stepper-fz":Nn(r),"--stepper-spacing":kn(r)}}),xc=ge((e,t)=>{const n=se("Stepper",h$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:x,completedIcon:b,progressIcon:w,color:j,iconSize:C,contentPadding:E,orientation:R,iconPosition:T,size:_,radius:P,allowNextStepsSelect:A,wrap:M,autoContrast:I,...V}=n,H=Me({name:"Stepper",classes:V0,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:p$}),Z=v.Children.toArray(p),K=Z.filter($=>$.type!==Uh),Q=Z.find($=>$.type===Uh),B=K.reduce(($,q,O)=>{const F=g===O?"stepProgress":g>O?"stepCompleted":"stepInactive",ae=typeof m!="function"?!1:typeof q.props.allowStepSelect=="boolean"?q.props.allowStepSelect:F==="stepCompleted"||A;return $.push(v.cloneElement(q,{icon:q.props.icon||x||O+1,key:O,step:O,state:F,onClick:()=>ae&&m?.(O),allowStepClick:ae,completedIcon:q.props.completedIcon||b,progressIcon:q.props.progressIcon||w,color:q.props.color||j,iconSize:C,iconPosition:q.props.iconPosition||T,orientation:R})),R==="horizontal"&&O!==K.length-1&&$.push(v.createElement("div",{...H("separator"),"data-active":O<g||void 0,"data-orientation":R,key:`separator-${O}`})),$},[]),W=K[g]?.props?.children,N=Q?.props?.children,L=g>K.length-1?N:W;return a.jsx(u$,{value:{getStyles:H,orientation:R,iconPosition:T},children:a.jsxs(ce,{...H("root"),ref:t,size:_,...V,children:[a.jsx(ce,{...H("steps"),mod:{orientation:R,"icon-position":T,wrap:M&&R!=="vertical"},children:B}),L&&a.jsx("div",{...H("content"),children:L})]})})});xc.classes=V0;xc.displayName="@mantine/core/Stepper";xc.Completed=Uh;xc.Step=F0;const W_=v.createContext(null),m$=W_.Provider,g$=()=>v.useContext(W_),v$={},H0=ge((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:c,children:d,readOnly:f,...p}=se("SwitchGroup",v$,e),[m,g]=Kn({value:n,defaultValue:r,finalValue:[],onChange:i}),x=b=>{const w=b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(m$,{value:{value:m,onChange:x,size:s},children:a.jsx(fn.Wrapper,{size:s,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(f0,{role:"group",children:d})})})});H0.classes=fn.Wrapper.classes;H0.displayName="@mantine/core/SwitchGroup";var Q_={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const y$={labelPosition:"right"},x$=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ut(t),"--switch-height":nt(r,"switch-height"),"--switch-width":nt(r,"switch-width"),"--switch-thumb-size":nt(r,"switch-thumb-size"),"--switch-label-font-size":nt(r,"switch-label-font-size"),"--switch-track-label-padding":nt(r,"switch-track-label-padding"),"--switch-color":n?Ft(n,e):void 0}}),Cd=ge((e,t)=>{const n=se("Switch",y$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:x,id:b,size:w,radius:j,wrapperProps:C,thumbIcon:E,checked:R,defaultChecked:T,onChange:_,labelPosition:P,description:A,error:M,disabled:I,variant:V,rootRef:H,mod:Z,...K}=n,Q=g$(),B=w||Q?.size,W=Me({name:"Switch",props:n,classes:Q_,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:x$}),{styleProps:N,rest:L}=Xi(K),$=vr(b),q=Q?{checked:Q.value.includes(L.value),onChange:Q.onChange}:{},[O,F]=Kn({value:q.checked??R,defaultValue:T,finalValue:!1});return a.jsxs(Rp,{...W("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:B,labelPosition:P,label:m,description:A,error:M,disabled:I,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":q.checked||R||void 0,variant:V,ref:H,mod:Z,...N,...C,children:[a.jsx("input",{...L,disabled:I,checked:O,"data-checked":q.checked||R||void 0,onChange:te=>{Q?q.onChange?.(te):_?.(te),F(te.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...W("input")}),a.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:M,"label-position":P,"without-labels":!x&&!g},...W("track"),children:[a.jsx(ce,{component:"span",mod:"reduce-motion",...W("thumb"),children:E}),a.jsx("span",{...W("trackLabel"),children:O?x:g})]})]})});Cd.classes={...Q_,...J2};Cd.displayName="@mantine/core/Switch";Cd.Group=H0;const[b$,S$]=gr("Table component was not found in the tree");var Ed={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 w$(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 rl(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=ge((i,s)=>{const c=se(n,{},i),{classNames:d,className:f,style:p,styles:m,...g}=c,x=S$();return a.jsx(ce,{component:e,ref:s,...w$(x,t),...x.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=Ed,r}const Uy=rl("th",{columnBorder:!0}),Y_=rl("td",{columnBorder:!0}),wh=rl("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),K_=rl("thead",{stickyHeader:!0}),X_=rl("tbody"),Z_=rl("tfoot"),J_=rl("caption",{captionSide:!0});function q0({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(J_,{children:e.caption}),e.head&&a.jsx(K_,{children:a.jsx(wh,{children:e.head.map((t,n)=>a.jsx(Uy,{children:t},n))})}),e.body&&a.jsx(X_,{children:e.body.map((t,n)=>a.jsx(wh,{children:t.map((r,i)=>a.jsx(Y_,{children:r},i))},n))}),e.foot&&a.jsx(Z_,{children:a.jsx(wh,{children:e.foot.map((t,n)=>a.jsx(Uy,{children:t},n))})})]})}q0.displayName="@mantine/core/TableDataRenderer";const j$={type:"scrollarea"},C$=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),G0=ge((e,t)=>{const n=se("TableScrollContainer",j$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:x,scrollAreaProps:b,...w}=n,j=Me({name:"TableScrollContainer",classes:Ed,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:C$,rootSelector:"scrollContainer"});return a.jsx(ce,{component:x==="scrollarea"?Kr:"div",...x==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...w,children:a.jsx("div",{...j("scrollContainerInner"),children:p})})});G0.classes=Ed;G0.displayName="@mantine/core/TableScrollContainer";const E$={withRowBorders:!0,verticalSpacing:7},T$=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:s,stripedColor:c,highlightOnHoverColor:d,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":kn(r),"--table-vertical-spacing":kn(i),"--table-border-color":s?Ft(s,e):void 0,"--table-striped-color":f&&c?Ft(c,e):void 0,"--table-highlight-on-hover-color":p&&d?Ft(d,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),ve=ge((e,t)=>{const n=se("Table",E$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:x,highlightOnHoverColor:b,striped:w,highlightOnHover:j,withColumnBorders:C,withRowBorders:E,withTableBorder:R,borderColor:T,layout:_,variant:P,data:A,children:M,stickyHeader:I,stickyHeaderOffset:V,mod:H,tabularNums:Z,...K}=n,Q=Me({name:"Table",props:n,className:i,style:s,classes:Ed,classNames:r,styles:c,unstyled:d,rootSelector:"table",vars:f,varsResolver:T$});return a.jsx(b$,{value:{getStyles:Q,stickyHeader:I,striped:w===!0?"odd":w||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:E,captionSide:g||"bottom"},children:a.jsx(ce,{component:"table",variant:P,ref:t,mod:[{"data-with-table-border":R,"data-tabular-nums":Z},H],...Q("table"),...K,children:M||!!A&&a.jsx(q0,{data:A})})})});ve.classes=Ed;ve.displayName="@mantine/core/Table";ve.Td=Y_;ve.Th=Uy;ve.Tr=wh;ve.Thead=K_;ve.Tbody=X_;ve.Tfoot=Z_;ve.Caption=J_;ve.ScrollContainer=G0;ve.DataRenderer=q0;const[R$,W0]=gr("Tabs component was not found in the tree");var Td={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 _$={},Q0=ge((e,t)=>{const n=se("TabsList",_$,e),{children:r,className:i,grow:s,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,x=W0();return a.jsx(ce,{...g,...x.getStyles("list",{className:i,style:p,classNames:d,styles:f,props:n,variant:x.variant}),ref:t,role:"tablist",variant:x.variant,mod:[{grow:s,orientation:x.orientation,placement:x.orientation==="vertical"&&x.placement,inverted:x.inverted},m],"aria-orientation":x.orientation,__vars:{"--tabs-justify":c},children:r})});Q0.classes=Td;Q0.displayName="@mantine/core/TabsList";const D$={},Y0=ge((e,t)=>{const n=se("TabsPanel",D$,e),{children:r,className:i,value:s,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,x=W0(),b=x.value===s,w=x.keepMounted||m||b?r:null;return a.jsx(ce,{...g,...x.getStyles("panel",{className:i,classNames:c,styles:d,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:x.orientation},p],role:"tabpanel",id:x.getPanelId(s),"aria-labelledby":x.getTabId(s),children:w})});Y0.classes=Td;Y0.displayName="@mantine/core/TabsPanel";const A$={},K0=ge((e,t)=>{const n=se("TabsTab",A$,e),{className:r,children:i,rightSection:s,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:x,classNames:b,styles:w,vars:j,mod:C,tabIndex:E,...R}=n,T=yn(),{dir:_}=el(),P=W0(),A=d===P.value,M=V=>{P.onChange(P.allowTabDeactivation&&d===P.value?null:d),f?.(V)},I={classNames:b,styles:w,props:n};return a.jsxs(er,{...R,...P.getStyles("tab",{className:r,style:x,variant:P.variant,...I}),disabled:m,unstyled:P.unstyled,variant:P.variant,mod:[{active:A,disabled:m,orientation:P.orientation,inverted:P.inverted,placement:P.orientation==="vertical"&&P.placement},C],ref:t,role:"tab",id:P.getTabId(d),"aria-selected":A,tabIndex:E!==void 0?E:A||P.value===null?0:-1,"aria-controls":P.getPanelId(d),onClick:M,__vars:{"--tabs-color":g?Ft(g,T):void 0},onKeyDown:pR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:P.activateTabWithKeyboard,loop:P.loop,orientation:P.orientation||"horizontal",dir:_,onKeyDown:p}),children:[c&&a.jsx("span",{...P.getStyles("tabSection",I),"data-position":"left",children:c}),i&&a.jsx("span",{...P.getStyles("tabLabel",I),children:i}),s&&a.jsx("span",{...P.getStyles("tabSection",I),"data-position":"right",children:s})]})});K0.classes=Td;K0.displayName="@mantine/core/TabsTab";const eE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",P$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},k$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ut(t),"--tabs-color":Ft(n,e),"--tabs-text-color":Zs(r,e)?Ki({color:n,theme:e,autoContrast:r}):void 0}}),zt=ge((e,t)=>{const n=se("Tabs",P$,e),{defaultValue:r,value:i,onChange:s,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:x,color:b,radius:w,inverted:j,placement:C,keepMounted:E,classNames:R,styles:T,unstyled:_,className:P,style:A,vars:M,autoContrast:I,mod:V,...H}=n,Z=vr(p),[K,Q]=Kn({value:i,defaultValue:r,finalValue:null,onChange:s}),B=Me({name:"Tabs",props:n,classes:Td,className:P,style:A,classNames:R,styles:T,unstyled:_,vars:M,varsResolver:k$});return a.jsx(R$,{value:{placement:C,value:K,orientation:c,id:Z,loop:f,activateTabWithKeyboard:m,getTabId:Qj(`${Z}-tab`,eE),getPanelId:Qj(`${Z}-panel`,eE),onChange:Q,allowTabDeactivation:g,variant:x,color:b,radius:w,inverted:j,keepMounted:E,unstyled:_,getStyles:B},children:a.jsx(ce,{ref:t,id:Z,variant:x,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},V],...B("root"),...H,children:d})})});zt.classes=Td;zt.displayName="@mantine/core/Tabs";zt.Tab=K0;zt.Panel=Y0;zt.List=Q0;const N$={},ze=ge((e,t)=>{const n=se("TextInput",N$,e);return a.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ze.classes=Pr.classes;ze.displayName="@mantine/core/TextInput";var eD={root:"m_7341320d"};const O$={},M$=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:c})=>{const d=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":nt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ut(n),"--ti-bg":s||r?d.background:void 0,"--ti-color":s||r?d.color:void 0,"--ti-bd":s||r?d.border:void 0}}},X0=ge((e,t)=>{const n=se("ThemeIcon",O$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,autoContrast:p,...m}=n,g=Me({name:"ThemeIcon",classes:eD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:M$});return a.jsx(ce,{ref:t,...g("root"),...m})});X0.classes=eD;X0.displayName="@mantine/core/ThemeIcon";const I$=["h1","h2","h3","h4","h5","h6"],L$=["xs","sm","md","lg","xl"];function $$(e,t){const n=t!==void 0?t:`h${e}`;return I$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:L$.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var tD={root:"m_8a5d1357"};const z$={order:1},U$=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const s=$$(t,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},Ie=ge((e,t)=>{const n=se("Title",z$,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:x,textWrap:b,mod:w,...j}=n,C=Me({name:"Title",props:n,classes:tD,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:U$});return[1,2,3,4,5,6].includes(f)?a.jsx(ce,{...C("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof x=="number"},w],size:m,...j}):null});Ie.classes=tD;Ie.displayName="@mantine/core/Title";function B$(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(i){t=typeof i=="function"?i(t):i},setState(i){this.updateState(i),r.forEach(s=>s(t))},initialize(i){n||(t=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function V$(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function F$(e,t,n){const r=[],i=[],s={};for(const c of e){const d=c.position||t;s[d]=s[d]||0,s[d]+=1,s[d]<=n?i.push(c):r.push(c)}return{notifications:i,queue:r}}const H$=()=>B$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),ol=H$(),q$=(e=ol)=>V$(e);function Oc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),i=F$(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ne(e,t=ol){const n=e.id||Nh();return Oc(t,r=>e.id&&r.some(i=>i.id===e.id)?r:[...r,{...e,id:n}]),n}function nD(e,t=ol){return Oc(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function As(e,t=ol){return Oc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function G$(e=ol){Oc(e,()=>[])}function W$(e=ol){Oc(e,t=>t.slice(0,e.getState().limit))}const ho={show:Ne,hide:nD,update:As,clean:G$,cleanQueue:W$,updateState:Oc};function By(e,t){return By=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},By(e,t)}function rD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,By(e,t)}var Xv={exports:{}},Zv,tE;function Q$(){if(tE)return Zv;tE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Zv=e,Zv}var Jv,nE;function Y$(){if(nE)return Jv;nE=1;var e=Q$();function t(){}function n(){}return n.resetWarningCache=t,Jv=function(){function r(c,d,f,p,m,g){if(g!==e){var x=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 x.name="Invariant Violation",x}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},Jv}var rE;function K$(){return rE||(rE=1,Xv.exports=Y$()()),Xv.exports}var X$=K$();const rn=mx(X$),oE={disabled:!1},Bh=jn.createContext(null);var Z$=function(t){return t.scrollTop},Fu="unmounted",Cs="exited",Es="entering",oc="entered",Vy="exiting",ta=(function(e){rD(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=i,d=c&&!c.isMounting?r.enter:r.appear,f;return s.appearStatus=null,r.in?d?(f=Cs,s.appearStatus=Es):f=oc:r.unmountOnExit||r.mountOnEnter?f=Fu:f=Cs,s.state={status:f},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var c=i.in;return c&&s.status===Fu?{status:Cs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var c=this.state.status;this.props.in?c!==Es&&c!==oc&&(s=Es):(c===Es||c===oc)&&(s=Vy)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,c,d;return s=c=d=i,i!=null&&typeof i!="number"&&(s=i.exit,c=i.enter,d=i.appear!==void 0?i.appear:c),{exit:s,enter:c,appear:d}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Es){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:Vu.findDOMNode(this);c&&Z$(c)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Cs&&this.setState({status:Fu})},n.performEnter=function(i){var s=this,c=this.props.enter,d=this.context?this.context.isMounting:i,f=this.props.nodeRef?[d]:[Vu.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),x=d?g.appear:g.enter;if(!i&&!c||oE.disabled){this.safeSetState({status:oc},function(){s.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Es},function(){s.props.onEntering(p,m),s.onTransitionEnd(x,function(){s.safeSetState({status:oc},function(){s.props.onEntered(p,m)})})})},n.performExit=function(){var i=this,s=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:Vu.findDOMNode(this);if(!s||oE.disabled){this.safeSetState({status:Cs},function(){i.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:Vy},function(){i.props.onExiting(d),i.onTransitionEnd(c.exit,function(){i.safeSetState({status:Cs},function(){i.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,s.nextCallback=null,i(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var c=this.props.nodeRef?this.props.nodeRef.current:Vu.findDOMNode(this),d=i==null&&!this.props.addEndListener;if(!c||d){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Fu)return null;var s=this.props,c=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var d=w0(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return jn.createElement(Bh.Provider,{value:null},typeof c=="function"?c(i,d):jn.cloneElement(jn.Children.only(c),d))},t})(jn.Component);ta.contextType=Bh;ta.propTypes={};function Xl(){}ta.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Xl,onEntering:Xl,onEntered:Xl,onExit:Xl,onExiting:Xl,onExited:Xl};ta.UNMOUNTED=Fu;ta.EXITED=Cs;ta.ENTERING=Es;ta.ENTERED=oc;ta.EXITING=Vy;function J$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z0(e,t){var n=function(s){return t&&v.isValidElement(s)?t(s):s},r=Object.create(null);return e&&v.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function ez(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),i=[];for(var s in e)s in t?i.length&&(r[s]=i,i=[]):i.push(s);var c,d={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];d[r[f][c]]=n(p)}d[f]=n(f)}for(c=0;c<i.length;c++)d[i[c]]=n(i[c]);return d}function Ps(e,t,n){return n[t]!=null?n[t]:e.props[t]}function tz(e,t){return Z0(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ps(n,"appear",e),enter:Ps(n,"enter",e),exit:Ps(n,"exit",e)})})}function nz(e,t,n){var r=Z0(e.children),i=ez(t,r);return Object.keys(i).forEach(function(s){var c=i[s];if(v.isValidElement(c)){var d=s in t,f=s in r,p=t[s],m=v.isValidElement(p)&&!p.props.in;f&&(!d||m)?i[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Ps(c,"exit",e),enter:Ps(c,"enter",e)}):!f&&d&&!m?i[s]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(i[s]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Ps(c,"exit",e),enter:Ps(c,"enter",e)}))}}),i}var rz=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},oz={component:"div",childFactory:function(t){return t}},Ma=(function(e){rD(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var c=s.handleExited.bind(J$(s));return s.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},s}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(i,s){var c=s.children,d=s.handleExited,f=s.firstRender;return{children:f?tz(i,d):nz(i,c,d),firstRender:!1}},n.handleExited=function(i,s){var c=Z0(this.props.children);i.key in c||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(d){var f=zh({},d.children);return delete f[i.key],{children:f}}))},n.render=function(){var i=this.props,s=i.component,c=i.childFactory,d=w0(i,["component","childFactory"]),f=this.state.contextValue,p=rz(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,s===null?jn.createElement(Bh.Provider,{value:f},p):jn.createElement(Bh.Provider,{value:f},jn.createElement(s,d,p))},t})(jn.Component);Ma.propTypes={};Ma.defaultProps=oz;const oD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function iz(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),oD.reduce((n,r)=>(n[r]=[],n),{}))}const iE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},az={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function sz({state:e,maxHeight:t,position:n,transitionDuration:r}){const[i,s]=n.split("-"),c=s==="center"?`${i}-center`:s,d={opacity:0,maxHeight:t,transform:iE[c],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},f={opacity:1,transform:az[c]},p={opacity:0,maxHeight:0,transform:iE[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function lz(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const iD=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},i)=>{const{autoClose:s,message:c,...d}=e,f=lz(n,e.autoClose),p=v.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},x=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return v.useEffect(()=>{e.onOpen?.(e)},[]),v.useEffect(()=>(x(),m),[f]),a.jsx(O0,{...r,...d,onClose:g,ref:i,onMouseEnter:m,onMouseLeave:x,children:c})});iD.displayName="@mantine/notifications/NotificationContainer";var aD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const cz=ta,uz={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Yr("overlay"),store:ol,withinPortal:!0},dz=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),na=ge((e,t)=>{const n=se("Notifications",uz,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:x,notificationMaxHeight:b,limit:w,zIndex:j,store:C,portalProps:E,withinPortal:R,...T}=n,_=yn(),P=q$(C),A=T3(),M=bx(),I=v.useRef({}),V=v.useRef(0),Z=(_.respectReducedMotion?M:!1)?1:g,K=Me({name:"Notifications",classes:aD,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:dz});v.useEffect(()=>{C?.updateState(W=>({...W,limit:w||5,defaultPosition:p}))},[w,p]),Vi(()=>{P.notifications.length>V.current&&setTimeout(()=>A(),0),V.current=P.notifications.length},[P.notifications]);const Q=iz(P.notifications,p),B=oD.reduce((W,N)=>(W[N]=Q[N].map(({style:L,...$})=>a.jsx(cz,{timeout:Z,onEnter:()=>I.current[$.id].offsetHeight,nodeRef:{current:I.current[$.id]},children:q=>a.jsx(iD,{ref:O=>{I.current[$.id]=O},data:$,onHide:O=>nD(O,C),autoClose:m,...K("notification",{style:{...sz({state:q,position:N,transitionDuration:Z,maxHeight:b}),...L}})})},$.id)),W),{});return a.jsxs(Ya,{withinPortal:R,...E,children:[a.jsx(ce,{...K("root"),"data-position":"top-center",ref:t,...T,children:a.jsx(Ma,{children:B["top-center"]})}),a.jsx(ce,{...K("root"),"data-position":"top-left",...T,children:a.jsx(Ma,{children:B["top-left"]})}),a.jsx(ce,{...K("root",{className:fc.classNames.fullWidth}),"data-position":"top-right",...T,children:a.jsx(Ma,{children:B["top-right"]})}),a.jsx(ce,{...K("root",{className:fc.classNames.fullWidth}),"data-position":"bottom-right",...T,children:a.jsx(Ma,{children:B["bottom-right"]})}),a.jsx(ce,{...K("root"),"data-position":"bottom-left",...T,children:a.jsx(Ma,{children:B["bottom-left"]})}),a.jsx(ce,{...K("root"),"data-position":"bottom-center",...T,children:a.jsx(Ma,{children:B["bottom-center"]})})]})});na.classes=aD;na.displayName="@mantine/notifications/Notifications";na.show=ho.show;na.hide=ho.hide;na.update=ho.update;na.clean=ho.clean;na.cleanQueue=ho.cleanQueue;na.updateState=ho.updateState;class fz{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Rd{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class hz{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(i,s){const c=i.consumeAndParse(n);return r(s,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(i,s,c){const d=i.consumeAndParse(n);return r(s,c,d)},precedence:n})}construct(t){return new pz(t,this.prefixParselets,this.infixParselets)}}class pz{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){return this.peek()?.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 i=r.parse(this,n);for(;t>this.getPrecedence();){const s=this.consume();i=this.getInfixParselet(s).parse(this,i,s)}return i}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw Error(`Expected ${t} but got "${r.id}" (${r.value}) at line ${r.line} column ${r.column}.`)}if(n&&this.peek()?.value!==n){const r=this.peek();throw Error(`Expected "${n}" but got "${r.value}" at line ${r.line} column ${r.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class sD{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 Uo="http://hl7.org",lD="ok",mz="created",gz="gone",vz="not-modified",yz="not-found",xz="unauthorized",bz="forbidden",Sz="accepted",wz={resourceType:"OperationOutcome",id:lD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},jz={resourceType:"OperationOutcome",id:yz,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},td={resourceType:"OperationOutcome",id:xz,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Cz={...td,issue:[...td.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},aE={...td,issue:[...td.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},J0={resourceType:"OperationOutcome",id:bz,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function oi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function mn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Ez(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Tz(e){return!e||typeof e!="object"?!1:e instanceof Error||typeof DOMException<"u"&&e instanceof DOMException?!0:Object.prototype.toString.call(e)==="[object Error]"}function Xp(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function cD(e){return e.id===lD||e.id===mz||e.id===vz||e.id===Sz}function Rz(e){return e.id===gz}class ut extends Error{constructor(t,n){super(uD(t)),this.outcome=t,this.cause=n}}function Ht(e){return e instanceof ut?e.outcome:Xp(e)?e:oi(Ke(e))}function Ke(e){return e?typeof e=="string"?e:Tz(e)?e.message:Xp(e)?uD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function uD(e){const t=e.issue?.map(dD)??[];return t.length>0?t.join("; "):"Unknown error"}function dD(e){let t;return e.details?.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",e.expression?.length&&(t+=` (${e.expression.join(", ")})`),t}function _z(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 Dz(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(([i,s])=>[i,_z(i,s)])),constraints:[],innerTypes:[]};return t}const Az={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},Pz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},kz={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"}]}}},Nz={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"}]}}},Oz={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"}]}}},Mz={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"}]}}},Iz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Lz={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"}]}}},$z={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},zz={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"}]}}},Uz={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"}]}}},Bz={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"}]}}},Vz={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"}]}}},Fz={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"}]}}},Hz={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"}]}}},qz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Gz={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"}]}}},Wz={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"]}]}}},Qz={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"]}]}}},Yz={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"}]}}},Kz={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"}]}}},Xz={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},Zz={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"}]}}},Jz={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"}]}}},e8={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"}]}}},t8={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"}]}}},n8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},r8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},o8={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"}]}}},i8={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"}]}}},a8={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"}]}}},s8={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"}]}}},l8={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"]}]}}},c8={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"}]}}},u8={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"}]}}},d8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},f8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},h8={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"]}]}}},p8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},m8={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"}]}}},g8={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"}]}}},v8={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"}]}}},y8={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"}]}}},x8={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"]}]}}},b8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},S8={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"}]}}},w8={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"]}]}}},j8={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"}]}}},C8={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"}]}}},E8={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"}]}}},T8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},R8={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"}]}}},_8={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"}]}}},D8={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"}]}}},A8={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"]}]}}},P8={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"}]}}},k8={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"}]}}},N8={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"}]}}},O8={Element:Az,BackboneElement:Pz,Address:kz,Age:Nz,Annotation:Oz,Attachment:Mz,CodeableConcept:Iz,Coding:Lz,ContactDetail:$z,ContactPoint:zz,Contributor:Uz,Count:Bz,DataRequirement:Vz,DataRequirementCodeFilter:Fz,DataRequirementDateFilter:Hz,DataRequirementSort:qz,Distance:Gz,Dosage:Wz,DosageDoseAndRate:Qz,Duration:Yz,ElementDefinition:Kz,ElementDefinitionSlicingDiscriminator:Xz,ElementDefinitionSlicing:Zz,ElementDefinitionBase:Jz,ElementDefinitionType:e8,ElementDefinitionExample:t8,ElementDefinitionConstraint:n8,ElementDefinitionBinding:r8,ElementDefinitionMapping:o8,Expression:i8,Extension:a8,HumanName:s8,Identifier:l8,MarketingStatus:c8,Meta:u8,Money:d8,Narrative:f8,ParameterDefinition:h8,Period:p8,Population:m8,ProdCharacteristic:g8,ProductShelfLife:v8,Quantity:y8,Range:x8,Ratio:b8,Reference:S8,RelatedArtifact:w8,SampledData:j8,Signature:C8,SubstanceAmount:E8,SubstanceAmountReferenceRange:T8,Timing:R8,TimingRepeat:_8,TriggerDefinition:D8,UsageContext:A8,MoneyQuantity:P8,SimpleQuantity:k8,IdentityProvider:N8};function M8(e){return new L8(e).parse()}const Vh=Dz(O8),eb=Object.create(null),sE=Object.create(null),I8={"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 fD(e){let t;return t=sE[e],t||(t=sE[e]=Object.create(null)),t}function lE(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");TU(n);for(const r of n)hD(r)}function hD(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=M8(e),n=I8[e.url];let r,i;n?(r=Vh,i=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||e.type?.startsWith("http://")||e.type?.startsWith("https://")?(r=Vh,i=e.type):(r=fD(e.url),i=e.type),r[i]=t;for(const s of t.innerTypes)s.parentType=t,r[s.name]=s;eb[e.url]=t}function pD(e){return!!Vh[e]}function Zp(e,t){if(t){const n=fD(t)[e];if(n)return n}return Vh[e]}function mD(e,t){const n=Zp(e,t);if(!n)throw new ut(oi("Unknown data type: "+e));return n}function tb(e){return!!eb[e]}function Mc(e){return eb[e]}class L8{constructor(t){if(!t.snapshot?.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:U8(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if(t.id?.includes(":")){if(this.slicingContext?.current){const n=ey(t,this.slicingContext.path);this.slicingContext.current.elements[n]=this.parseElementDefinition(t)}}else{const n=this.parseElementDefinition(t);this.checkFieldEnter(t,n);let r=this.backboneContext;for(;r;){if(t.path?.startsWith(r.path+".")){r.type.elements[ey(t,r.path)]=n;break}r=r.parent}if(!r){const i=ey(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(i.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(i.replace("[x]","")),this.resourceSchema.elements[i]=n}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&&!Zl(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!Zl(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=vE(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:Zl(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){z8(t)&&!this.peek()?.sliceName||(n.slicing={discriminator:(t.slicing?.discriminator??[]).map(r=>{if(r.type!=="value"&&r.type!=="pattern"&&r.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${r.type}`);return{path:r.path,type:r.type}}),slices:[],ordered:t.slicing?.ordered??!1,rule:t.slicing?.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!Zl(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Zl(this.backboneContext.path,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(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=t.contentReference.slice(t.contentReference.indexOf("#")+1),r=this.elementIndex[n];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,base:{path:r.base?.path??n,min:t.base?.min??r.base?.min??r.min,max:t.base?.max??r.base?.max??r.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){const n=this.peek();return!!(Zl(t?.path,n?.path)&&t.type?.some(r=>["BackboneElement","Element"].includes(r.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=>{let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=vE(t)),r||(r=hi(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){const n=cE(t.max),r=t.base?.max?cE(t.base.max):n,i={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||t.base?.path||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(s=>({key:s.key??"",severity:s.severity??"error",expression:s.expression??"",description:s.human??""})),type:this.parseElementDefinitionType(t),fixed:uE(bc(i,"fixed[x]")),pattern:uE(bc(i,"pattern[x]")),binding:t.binding}}}function cE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function ey(e,t=""){return $8(e.path,t)}function $8(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Zl(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function uE(e){return Array.isArray(e)&&e.length>0?e[0]:En(e)?void 0:e}function z8(e){const t=e.slicing?.discriminator;return!!(e.type?.some(n=>n.code==="Extension")&&t?.length===1&&t[0].type==="value"&&t[0].path==="url")}function U8(e){let t=e.description;return t?.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function B8(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?V8:bc,[i,...s]=t.split(".");let c=[r(e,i,n)];for(const d of s){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,d,n));else(n?.withPath&&p&&p.value!==void 0||!n?.withPath&&p!==void 0)&&f.push(r(p,d,n));c=f}return c}function V8(e,t,n){const r=e.path;return F8(bc(e,t,n),r,t)}function F8(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((i,s)=>({...i,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const gD={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 H8(e,t,n,r){if(Array.isArray(e))return!1;let i;t.path==="$this"?i=n:i=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!i)return!1;if(i.pattern)return ob(e,i.pattern);if(i.fixed)return li(e,i.fixed);if(i.binding?.strength==="required"&&i.binding.valueSet)return!0;break;case"type":return!e||!s?.length?!1:s.some(c=>c.code===e.type)}return!1}function Ye(e){return[{type:re.boolean,value:e}]}function Wr(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}:po(e)?{type:re.Quantity,value:e}:pi(e)?{type:e.resourceType,value:e}:DD(e)?{type:re.CodeableConcept,value:e}:_D(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function ti(e){return e.length===0?!1:!!e[0].value}function qi(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 bc(e,t,n){if(!e.value)return;const r=Za(e.type,t,n?.profileUrl);return r?vD(e,t,r):_d(e,t)}function vD(e,t,n){const r=e.value,i=n.type;if(!i||i.length===0)return;let s,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of i){const g=p.replace("[x]",Mn(m.code));if(s=r[g],d=r["_"+g],s!==void 0||d!==void 0){c=m.code;break}}if(d)if(Array.isArray(s)){s=s.slice();for(let m=0;m<Math.max(s.length,d.length);m++)s[m]=pE(s[m],d[m])}else s=pE(s,d);if(!En(s))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(s)?s.map(m=>dE(m,c)):dE(s,c)}function dE(e,t){return t==="Resource"&&pi(e)&&(t=e.resourceType),{type:t,value:e}}function _d(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const i=n[t];Array.isArray(i)?r=i.map(Wr):r=Wr(i)}else{const i=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(re)){const c=i+Mn(s);if(c in n){const d=n[c];Array.isArray(d)?r=d.map(f=>({type:s,value:f})):r={type:s,value:d};break}}}if(Array.isArray(r)){if(r.length===0||En(r[0]))return}else if(En(r))return;return r}function yD(e){const t=[];for(const n of e){let r=!1;for(const i of t)if(ti(Jp(n,i))){r=!0;break}r||t.push(n)}return t}function q8(e){return Ye(!ti(e))}function G8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ye(!1):Ye(e.every((n,r)=>ti(Jp(n,t[r]))))}function W8(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ye(!0):Ye(e.some((n,r)=>!ti(Jp(n,t[r]))))}function Jp(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?Ye(Math.abs(n-r)<1e-8):po(n)&&po(r)?Ye(CD(n,r)):Ye(typeof n=="object"&&typeof r=="object"?nb(e,t):n===r)}function xD(e,t){return e.length===0&&t.length===0?Ye(!0):e.length!==t.length?Ye(!1):(e.sort(fE),t.sort(fE),Ye(e.every((n,r)=>ti(Q8(n,t[r])))))}function Q8(e,t){const{type:n,value:r}=e,{type:i,value:s}=t,c=r?.valueOf(),d=s?.valueOf();return typeof c=="number"&&typeof d=="number"?Ye(Math.abs(c-d)<.01):po(c)&&po(d)?Ye(CD(c,d)):Ye(n==="Coding"&&i==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?nb({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function fE(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function bD(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 SD(n);case"DateTime":return nd(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return wD(n);case"Quantity":return po(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function SD(e){return typeof e=="string"&&!!gD.date.exec(e)}function nd(e){return typeof e=="string"&&!!gD.dateTime.exec(e)}function wD(e){return!!(e&&typeof e=="object"&&("start"in e&&nd(e.start)||"end"in e&&nd(e.end)))}function jD(e){if(e){if(SD(e)||nd(e))return{start:sh(e,"0000-01-01T00:00:00.000"),end:sh(e,"xxxx-12-31T23:59:59.999")};if(wD(e))return{start:e.start?sh(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?sh(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function sh(e,t){let n="Z";const r=Math.max(e.indexOf("+",10),e.indexOf("-",10));r>-1?(n=e.substring(r),e=e.substring(0,r)):e.endsWith("Z")&&(e=e.substring(0,e.length-1));const i=e+t.substring(e.length)+n;return new Date(i).toISOString()}function po(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function CD(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 nb(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i],c=t[i];if(hE(s)&&hE(c)){if(!nb(s,c))return!1}else if(s!==c)return!1}return!0}function hE(e){return e!==null&&typeof e=="object"}function pE(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return Y8(e??{},t)}return e}function Y8(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function ED(e,t){return pi(e,t)&&"id"in e&&typeof e.id=="string"}function Jt(e){const t=kt(e)??"undefined/undefined",n=Gi(e);return n===t?{reference:t}:{reference:t,display:n}}function kt(e){if(ra(e))return e.reference;if(ED(e))return`${e.resourceType}/${e.id}`}function Vs(e){if(e)return ra(e)?e.reference.split("/")[1]:e.id}function K8(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Gi(e){if(K8(e)){const t=X8(e);if(t)return t}if(e.resourceType==="Device"){const t=Z8(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return qa(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]),DD(t))return qa(t);if(lU(t))return t.text}return kt(e)??""}function X8(e){const t=e.name;if(t&&t.length>0)return Ic(t[0])}function Z8(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function J8(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=mE(n);if(r)return r}else return mE(t)}function mE(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function TD(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 i=n.getUTCFullYear(),s=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-i;(f<s||f===s&&p<c)&&m--;let g=d*12+f-(i*12+s);p<c&&g--;const x=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:x}}function eU(e,t){const{years:n,months:r,days:i}=TD(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":i.toString().padStart(3,"0")+"D"}function hi(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(i=>i.url===t[r]);return n}function Lo(e,t){const n=rb(e);return JSON.stringify(n,null,t?2:void 0)??""}function rb(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?tU(e):nU(e):e}function tU(e){const t=e.length;if(t===0)return;let n,r=0;for(let i=0;i<t;i++){const s=e[i],c=rb(s);c!==s&&!n&&(n=Array.from(e)),c===void 0?n&&(n[i]=null):(n&&(n[i]=c),r++)}if(r!==0)return n??e}function nU(e){let t,n=0;for(const r in e){const i=e[r],s=rb(i);s!==i&&!t&&(t={...e}),s===void 0?t&&delete t[r]:(t&&(t[r]=s),n++)}if(n!==0)return t??e}function En(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Cn(e):!1}function Cn(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 li(e,t,n){return e===t||En(e)&&En(t)?!0:En(e)||En(t)?!1:Array.isArray(e)&&Array.isArray(t)?rU(e,t):Array.isArray(e)||Array.isArray(t)?!1:ar(e)&&ar(t)?oU(e,t,n):(ar(e)||ar(t),!1)}function rU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!li(e[n],t[n]))return!1;return!0}function oU(e,t,n){const r=new Set;Object.keys(e).forEach(i=>r.add(i)),Object.keys(t).forEach(i=>r.add(i)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const i of r){const s=e[i],c=t[i];if(!li(s,c,i))return!1}return!0}function ob(e,t){return En(e)?!0:En(t)?!1:Array.isArray(e)&&Array.isArray(t)?iU(e,t):Array.isArray(e)||Array.isArray(t)?!1:ar(e)&&ar(t)?aU(e,t):ar(e)||ar(t)?!1:e===t}function iU(e,t){return t.every(n=>e.some(r=>ob(r,n)))}function aU(e,t){return Object.entries(t).every(([n,r])=>n in e&&ob(e[n],r))}function Qr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function RD(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 ar(e){return e!==null&&typeof e=="object"}function sU(e){return typeof e=="string"}function _D(e){return ar(e)&&"code"in e&&typeof e.code=="string"}function DD(e){return ar(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(_D)}function lU(e){return ar(e)&&"text"in e&&typeof e.text=="string"}const AD=[];for(let e=0;e<256;e++)AD.push(e.toString(16).padStart(2,"0"));function cU(e){const t=PD(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=AD[n[i]];return r.join("")}function uU(e){const t=PD(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return window.btoa(r.join(""))}function PD(e){return ArrayBuffer.isView(e)?e.buffer:e}function Mn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function ib(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ks(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function dU(e,t){return e.coding?.find(n=>n.system===t)?.code}function fU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const gE=e=>new Promise(t=>{setTimeout(t,e)});function Fy(e,t,n){const r=[];for(let i=0;i<n-1;i++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function hU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Iu(e,t){return e?(e.push(t),e):[t]}function rd(e){return e.sort((t,n)=>t.localeCompare(n))}function ab(e){return e.endsWith("/")?e:e+"/"}function pU(e){return e.startsWith("/")?e.slice(1):e}function Zo(e,t){return new URL(pU(t),ab(e.toString())).toString()}function mU(e,t){return Zo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function gU(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 kD(e,t){return e?.meta?.profile?.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function vU(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function Fs(e){if(!e)return"";switch(e.type){case"Address":return ND(e.value);case"CodeableConcept":return qa(e.value);case"Coding":return Dd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Ic(e.value);case"Quantity":return Ns(e.value);case"Reference":return yU(e.value);default:return e.value?.toString()??""}}function yU(e){return e?e.display??e.reference??Lo(e):""}function ND(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?.use,n.join(", ").trim()}function Ic(e,t){if(!e)return"";const n=[];if(e.prefix&&t?.prefix!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&t?.suffix!==!1&&n.push(...e.suffix),e.use&&(t?.all||t?.use)&&n.push("["+e.use+"]"),n.length===0){const r=id(e.text);if(r)return r}return n.join(" ").trim()}function em(e){return e instanceof Date&&!isNaN(e.getTime())}function xU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return em(r)?r.toLocaleTimeString(t,n):""}function sr(e,t,n){if(!e)return"";const r=new Date(e);return em(r)?r.toLocaleString(t,n):""}function bU(e,t,n){return!e||!e.start&&!e.end?"":sr(e.start,t,n)+" - "+sr(e.end,t,n)}const SU={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},wU={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},jU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function OD(e){if(!e)return"";const t=[];return CU(t,e.repeat),e.event&&t.push(e.event.map(n=>sr(n)).join(", ")),Mn(t.join(" ").trim())}function CU(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,i=t.periodUnit;n===1&&r===1?e.push(SU[i]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+wU[i]):e.push("per "+r+" "+jU[i])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Mn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>xU(s)).join(", "))}function od(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=e?.low&&{...e.low,comparator:void 0},i=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&i?.value===void 0?"":r?.value!==void 0&&i?.value===void 0?`>= ${Ns(r)}`:r?.value===void 0&&i?.value!==void 0?`<= ${Ns(i)}`:(r?.unit===i?.unit&&delete r?.unit,`${Ns(r)} - ${Ns(i)}`)}function Ns(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 EU(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function qa(e){if(!e)return"";const t=id(e.text);return t||(e.coding?e.coding.map(n=>Dd(n)).join(", "):"")}function Dd(e,t){const n=id(e?.display);return n?`${n}`:id(e?.code)??""}function MD(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Ns(e.valueQuantity));else if(e.valueCodeableConcept)t.push(qa(e.valueCodeableConcept));else{const n=id(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>MD(n)).join(" / ")),t.join(" / ").trim()}function id(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 TU(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&ID(n.type)}function ID(e){let t=ci.types[e];return t||(t={searchParamsDetails:{}},ci.types[e]=t),!t.searchParams&&e!=="Binary"&&(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 RU(e){for(const t of e.base??[]){const n=ID(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function vE(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?_U((e.base?.path??e.path)?.split(".")):t}function _U(e){return e.length===1?e[0]:e.map(Mn).join("")}function sb(e){return ci.types[e]?.searchParams}function DU(e,t){return ci.types[e]?.searchParams?.[t]}function Hs(e){const t=e.replaceAll("[x]","").split(".").pop();return LD(t)}function LD(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(PU).join(" ").replace("_"," ").replace(/\s+/g," ")}const AU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function PU(e){const t=e.toUpperCase();return e===t?e:AU.has(t)?t:t.charAt(0)+e.slice(1)}function Za(e,t,n){const r=Zp(e,n);if(r)return kU(r.elements,t)}function kU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const i=t[r];if(i>="A"&&i<="Z"){const s=t.slice(0,r)+"[x]",c=e[s];if(c)return c}}}function pi(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function ra(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const ci={types:{}};function jh(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 Li=()=>[],Cr={empty:(e,t)=>Ye(t.length===0||t.every(n=>En(n.value))),hasValue:(e,t)=>Ye(t.length!==0),exists:(e,t,n)=>Ye(n?t.filter(r=>ti(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!En(r.value))),all:(e,t,n)=>Ye(t.every(r=>ti(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ye(!1);return Ye(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ye(!0);return Ye(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ye(!1);return Ye(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ye(!0);return Ye(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ye(!0);const r=n.eval(e,Ss(e));return r.length===0?Ye(!1):Ye(t.every(i=>r.some(s=>s.value===i.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Ss(e));return r.length===0?Ye(!0):t.length===0?Ye(!1):Ye(r.every(i=>t.some(s=>s.value===i.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(i=>i.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Ye(t.length===Cr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>ti(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Li,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)=>{const r=n.eval(e,t)[0]?.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)=>{const r=n.eval(e,t)[0]?.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,Ss(e)),i=[];for(const s of t)!i.some(c=>c.value===s.value)&&r.some(c=>c.value===s.value)&&i.push(s);return i},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ss(e)),i=[];for(const s of t)r.some(c=>c.value===s.value)||i.push(s);return i},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ss(e));return yD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ss(e));return[...t,...r]},htmlChecks:(e,t,n)=>[Wr(!0)],iif:(e,t,n,r,i)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return ti(s)?r.eval(e,t):i?i.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ye(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ye(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ye(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ye(Cr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(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?[]:Ye(Cr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:jh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ye(Cr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:jh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ye(Cr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(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?[]:Ye(Cr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return po(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?[]:Ye(Cr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);return n==null?[]:po(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ye(Cr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Jo(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:jh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ye(Cr.toTime(e,t).length===1),indexOf:(e,t,n)=>co((r,i)=>r.indexOf(i),e,t,n),substring:(e,t,n,r)=>co((i,s,c)=>{const d=s,f=c?d+c:i.length;return d<0||d>=i.length?void 0:i.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>co((r,i)=>r.startsWith(i),e,t,n),endsWith:(e,t,n)=>co((r,i)=>r.endsWith(i),e,t,n),contains:(e,t,n)=>co((r,i)=>r.includes(i),e,t,n),upper:(e,t)=>co(n=>n.toUpperCase(),e,t),lower:(e,t)=>co(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>co((i,s,c)=>i.replaceAll(s,c),e,t,n,r),matches:(e,t,n)=>co((r,i)=>!!new RegExp(i).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>co((i,s,c)=>i.replaceAll(new RegExp(s,"g"),c),e,t,n,r),length:(e,t)=>co(n=>n.length,e,t),toChars:(e,t)=>co(n=>n?n.split(""):void 0,e,t),encode:Li,decode:Li,escape:Li,unescape:Li,trim:Li,split:Li,join:(e,t,n)=>{const r=n?.eval(e,Ss(e))[0]?.value??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(i=>i.value?.toString()??"").join(r)}]},abs:(e,t)=>Ko(Math.abs,e,t),ceiling:(e,t)=>Ko(Math.ceil,e,t),exp:(e,t)=>Ko(Math.exp,e,t),floor:(e,t)=>Ko(Math.floor,e,t),ln:(e,t)=>Ko(Math.log,e,t),log:(e,t,n)=>Ko((r,i)=>Math.log(r)/Math.log(i),e,t,n),power:(e,t,n)=>Ko(Math.pow,e,t,n),round:(e,t)=>Ko(Math.round,e,t),sqrt:(e,t)=>Ko(Math.sqrt,e,t),truncate:(e,t)=>Ko(n=>n|0,e,t),children:Li,descendants:Li,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,i)=>{const s=Cr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const c=Cr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=i.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=TD(s[0].value,c[0].value);return[{type:re.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof Fh?r=n.name:n instanceof lb&&(r=n.left.name+"."+n.right.name),r?t.map(i=>({type:re.boolean,value:bD(i,r)})):[]},not:(e,t)=>Cr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let i;if(typeof r=="string")i=r;else if(typeof r=="object"){const s=r;if(s.resource)return Wr(s.resource);s.reference?i=s.reference:s.type&&s.identifier&&(i=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(i?.includes("?")){const[s]=i.split("?");return{type:s,value:{resourceType:s}}}if(i?.includes("/")){const[s,c]=i.split("/");return{type:s,value:{resourceType:s,id:c}}}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"}}:pi(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 i=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>({type:re.boolean,value:s.value?.resourceType===i}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let i="";return n instanceof Fh&&(i=n.name),i&&!r.reference.startsWith(i+"/")?[]:[{type:re.id,value:Vs(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,i=t?.[0]?.value;if(i){const s=hi(i,r);if(s)return[{type:re.Extension,value:s}]}return[]}};function co(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Jo(n,1);if(typeof i!="string")throw new Error("String function cannot be called with non-string");const s=e(i,...r.map(c=>c?.eval(t,n)[0]?.value));return s===void 0?[]:Array.isArray(s)?s.map(Wr):[Wr(s)]}function Ko(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Jo(n,1),s=po(i),c=s?i.value:i;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const d=e(c,...r.map(m=>m.eval(t,n)[0]?.value)),f=s?re.Quantity:n[0].type,p=s?{...i,value:d}:d;return[{type:f,value:p}]}function Jo(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 Ss(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class $D{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const i of n)r.push(this.child.eval({parent:t,variables:{$this:i}},[i]));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 Jl{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Fh{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(i=>this.evalValue(i)).filter(i=>i?.value!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return pi(n,this.name)?t:bc(t,this.name)}toString(){return this.name}}class NU{eval(){return[]}toString(){return"{}"}}class OU extends fz{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 Hh extends Rd{constructor(t,n){super("as",t,n)}eval(t,n){return Cr.ofType(t,this.left.eval(t,n),this.right)}}class kr extends Rd{}class Do extends kr{constructor(t,n,r,i){super(t,n,r),this.impl=i}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.eval(t,n);if(i.length!==1)return[];const s=r[0].value,c=i[0].value,d=po(s)?s.value:s,f=po(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?Ye(p):po(s)?[{type:re.Quantity,value:{...s,value:p}}]:[Wr(p)]}}class MU extends Rd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n),s=[...r,...i];return s.length>0&&s.every(c=>typeof c.value=="string")?[{type:re.string,value:s.map(c=>c.value).join("")}]:s}}class IU extends kr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return Ye(r.some(s=>s.value===i[0].value))}}class LU extends kr{constructor(t,n){super("in",t,n)}eval(t,n){const r=qi(this.left.eval(t,n)),i=this.right.eval(t,n);return r?Ye(i.some(s=>Jp(r,s)[0].value)):[]}}class lb extends Rd{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 cb extends Rd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return yD([...r,...i])}}class $U extends kr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return G8(r,i)}}class zU extends kr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return W8(r,i)}}class UU extends kr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return xD(r,i)}}class BU extends kr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return q8(xD(r,i))}}class ub extends kr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.name;return Ye(bD(r[0],i))}}class VU extends kr{constructor(t,n){super("and",t,n)}eval(t,n){const r=qi(this.left.eval(t,n),"boolean"),i=qi(this.right.eval(t,n),"boolean");return r?.value===!0&&i?.value===!0?Ye(!0):r?.value===!1||i?.value===!1?Ye(!1):[]}}class FU extends kr{constructor(t,n){super("or",t,n)}eval(t,n){const r=qi(this.left.eval(t,n),"boolean"),i=qi(this.right.eval(t,n),"boolean");return r?.value===!1&&i?.value===!1?Ye(!1):r?.value||i?.value?Ye(!0):[]}}class HU extends kr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=qi(this.left.eval(t,n),"boolean"),i=qi(this.right.eval(t,n),"boolean");return!r||!i?[]:Ye(r.value!==i.value)}}class qU extends kr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=qi(this.left.eval(t,n),"boolean"),i=qi(this.right.eval(t,n),"boolean");return i?.value===!0||r?.value===!1?Ye(!0):!r||!i?[]:Ye(!1)}}class db{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Cr[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 fb{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 i=r[0].value;if(typeof i!="number")throw new Error("Invalid indexer expression: should return integer}");const s=this.left.eval(t,n);return i in s?[s[i]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const GU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class WU{constructor(t,n,r,i){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!i?.dateTimeLiterals,this.symbolRegex=i?.symbolRegex??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
77
+ `))}consumeString(t){this.advance();const r=this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t).replace(/\\u([0-9a-fA-F]{4})/g,(s,c)=>String.fromCodePoint(parseInt(c,16))),i=this.buildToken(t==="`"?"Symbol":"String",r);return this.advance(),i}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 i=this.str.substring(t,this.pos.index);return i.endsWith("T")?i=i.substring(0,i.length-1):!i.startsWith("T")&&n&&!r&&(i+="Z"),this.buildToken("DateTime",i)}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()===" "&&QU(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return this.prevToken()?.value!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
78
+ `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function QU(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&GU.includes(e.value)))}const YU=["true","false"],KU=["!=","!~","<=",">=","{}","->"];function XU(e){return new WU(e,YU,KU).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},ZU={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},JU={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new fb(t,n)},precedence:Qt.Indexer},eB={parse(e,t){if(!(t instanceof Fh))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new db(t.name,n)},precedence:Qt.FunctionCall};function tB(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r?.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function nB(){return new hz().registerPrefix("String",{parse:(e,t)=>new Jl({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Jl({type:re.dateTime,value:jh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Jl({type:re.Quantity,value:tB(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Jl({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Jl({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Jl({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Fh(t.value)}).registerPrefix("{}",{parse:()=>new NU}).registerPrefix("(",ZU).registerInfix("[",JU).registerInfix("(",eB).prefix("+",Qt.UnaryAdd,(e,t)=>new OU("+",t,n=>n)).prefix("-",Qt.UnarySubtract,(e,t)=>new Do("-",t,t,(n,r)=>-r)).infixLeft(".",Qt.Dot,(e,t,n)=>new lb(e,n)).infixLeft("/",Qt.Divide,(e,t,n)=>new Do("/",e,n,(r,i)=>r/i)).infixLeft("*",Qt.Multiply,(e,t,n)=>new Do("*",e,n,(r,i)=>r*i)).infixLeft("+",Qt.Add,(e,t,n)=>new Do("+",e,n,(r,i)=>r+i)).infixLeft("-",Qt.Subtract,(e,t,n)=>new Do("-",e,n,(r,i)=>r-i)).infixLeft("|",Qt.Union,(e,t,n)=>new cb(e,n)).infixLeft("=",Qt.Equals,(e,t,n)=>new $U(e,n)).infixLeft("!=",Qt.NotEquals,(e,t,n)=>new zU(e,n)).infixLeft("~",Qt.Equivalent,(e,t,n)=>new UU(e,n)).infixLeft("!~",Qt.NotEquivalent,(e,t,n)=>new BU(e,n)).infixLeft("<",Qt.LessThan,(e,t,n)=>new Do("<",e,n,(r,i)=>r<i)).infixLeft("<=",Qt.LessThanOrEquals,(e,t,n)=>new Do("<=",e,n,(r,i)=>r<=i)).infixLeft(">",Qt.GreaterThan,(e,t,n)=>new Do(">",e,n,(r,i)=>r>i)).infixLeft(">=",Qt.GreaterThanOrEquals,(e,t,n)=>new Do(">=",e,n,(r,i)=>r>=i)).infixLeft("&",Qt.Ampersand,(e,t,n)=>new MU(e,n)).infixLeft("and",Qt.And,(e,t,n)=>new VU(e,n)).infixLeft("as",Qt.As,(e,t,n)=>new Hh(e,n)).infixLeft("contains",Qt.Contains,(e,t,n)=>new IU(e,n)).infixLeft("div",Qt.Divide,(e,t,n)=>new Do("div",e,n,(r,i)=>r/i|0)).infixLeft("in",Qt.In,(e,t,n)=>new LU(e,n)).infixLeft("is",Qt.Is,(e,t,n)=>new ub(e,n)).infixLeft("mod",Qt.Modulo,(e,t,n)=>new Do("mod",e,n,(r,i)=>r%i)).infixLeft("or",Qt.Or,(e,t,n)=>new FU(e,n)).infixLeft("xor",Qt.Xor,(e,t,n)=>new HU(e,n)).infixLeft("implies",Qt.Implies,(e,t,n)=>new qU(e,n))}const rB=nB();function hb(e){return new $D(e,rB.construct(XU(e)).consumeAndParse())}function oB(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const i=n[r];typeof i=="object"&&"type"in i&&"value"in i||(n[r]=Wr(n[r]))}return Ga(e,n).map(r=>r.value)}function Ga(e,t,n={},r=void 0){let i;if(typeof e=="string"){const s=r?.get(e);i=s??hb(e),r&&!s&&r.set(e,i)}else i=e;return i.eval({variables:n},t).map(s=>({type:s.type,value:s.value?.valueOf()}))}function iB(e){const t=[];for(const n of e){const r=jD(n.value);r&&t.push(r)}return t}function aB(e){const t=[];for(const n of e){const r=Fs(n);r&&t.push(r)}return t}function sB(e){const t=[];for(const n of e){const{value:r}=n;r&&(sU(r)?t.push(r):ra(r)?t.push(r.reference):ED(r)?t.push(kt(r)):typeof r.identifier=="object"&&t.push(`identifier:${r.identifier.system}|${r.identifier.value}`))}return t}function lB(e,t={}){const n=[];for(const r of e)cB(t,n,r);return n}function cB(e,t,n){const{type:r,value:i}=n;switch(r){case re.Identifier:uB(t,e,i);break;case re.CodeableConcept:dB(t,e,i);break;case re.Coding:zD(t,e,i);break;case re.ContactPoint:fB(t,e,i);break;default:qs(t,e,void 0,i?.toString())}}function uB(e,t,n){n?.type?.text&&qs(e,t,t.textSearchSystem,n.type.text),qs(e,t,n?.system,n?.value)}function dB(e,t,n){if(n?.text&&qs(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)zD(e,t,r)}function zD(e,t,n){n&&(n.display&&qs(e,t,t.textSearchSystem,n.display),qs(e,t,n.system,n.code))}function fB(e,t,n){n&&qs(e,t,n.system,n.value?.toLocaleLowerCase())}function qs(e,t,n,r){(n||r)&&!e.some(i=>i.system===n&&i.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const tm=20,ue={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"},UD={contains:ue.CONTAINS,exact:ue.EXACT,above:ue.ABOVE,below:ue.BELOW,text:ue.TEXT,not:ue.NOT,in:ue.IN,"not-in":ue.NOT_IN,"of-type":ue.OF_TYPE,missing:ue.MISSING,identifier:ue.IDENTIFIER,iterate:ue.ITERATE},pb={eq:ue.EQUALS,ne:ue.NOT_EQUALS,lt:ue.LESS_THAN,le:ue.LESS_THAN_OR_EQUALS,gt:ue.GREATER_THAN,ge:ue.GREATER_THAN_OR_EQUALS,sa:ue.STARTS_AFTER,eb:ue.ENDS_BEFORE,ap:ue.APPROXIMATELY,sw:ue.STARTS_WITH};function BD(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,d]=e.split("?");n=c,r=new URLSearchParams(d)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let i;n.includes("/")?i=n.split("/").filter(Boolean).pop():i=n;const s=[];return r&&s.push(...r.entries()),hB(i,s)}function hB(e,t){const n={resourceType:e};for(const[r,i]of t)pB(n,r,i);return n}function pB(e,t,n){let r,i;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),i=t.substring(s+1)):(r=t,i=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Iu(e.filters,{code:t,operator:ue.EQUALS,value:n});return}switch(r){case"_sort":mB(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 c=yE(n);i==="iterate"&&(c.modifier=ue.ITERATE),e.include=Iu(e.include,c);break}case"_revinclude":{const c=yE(n);i==="iterate"&&(c.modifier=ue.ITERATE),e.revInclude=Iu(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const c=ci.types[e.resourceType]?.searchParams?.[r];c?e.filters=Iu(e.filters,vB(c,i,n)):e.filters=Iu(e.filters,yB(r,i,n))}}}}function mB(e,t){for(const n of t.split(",")){let r,i=!1;n.startsWith("-")?(r=n.substring(1),i=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:i})}}const gB=[ue.MISSING,ue.PRESENT];function vB(e,t,n){if(gB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:i}=xB(n);if(!xE(e,i))throw new ut(oi(`Invalid format for ${e.type} search parameter: ${i}`));return{code:e.code,operator:r,value:i}}case"reference":case"string":case"token":case"uri":if(!xE(e,n))throw new ut(oi(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:bB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function yB(e,t,n){let r=ue.EQUALS;if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in pb&&(n.length===2||n.at(2)?.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function xB(e){const t=e.substring(0,2),n=pb[t];return n?{operator:n,value:e.substring(2)}:{operator:ue.EQUALS,value:e}}function bB(e){return UD[e]??ue.EQUALS}function yE(e){const t=e.split(":");if(t.includes("*"))throw new ut(oi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ut(oi(`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 ut(oi(`Invalid include value '${e}'`))}function xE(e,t){switch(e.type){case"date":return nd(t);default:return!0}}function Va(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(SB(n))),e.sortRules&&e.sortRules.length>0&&t.push(wB(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(bE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(bE("_revinclude",n))),t.length===0?"":(rd(t),"?"+t.join("&"))}function SB(e){const t=e.operator in UD?":"+e.operator:"",n=e.operator!==ue.EQUALS&&e.operator in pb?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function wB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function bE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function nm(e){const t=[];let n="",r=!1;for(const i of e)r?(n+=i,r=!1):i==="\\"?r=!0:i===","?(t.push(n),n=""):n+=i;return t.push(n),t}function jB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!CB(e,t,n))return!1}return!0}function CB(e,t,n){const r=ci.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const i=Ga(r.expression,[Wr(e)]);if(n.operator===ue.MISSING||n.operator===ue.PRESENT)return EB(i,n);switch(r.type){case"reference":return TB(i,n);case"string":case"uri":return DB(i,n);case"token":return RB(i,n);case"date":return PB(i,n);default:return!1}}function EB(e,t){const n=e.length>0;return(t.operator===ue.MISSING&&t.value==="false"||t.operator===ue.PRESENT&&t.value==="true")===n}function TB(e,t){const n=rm(t.operator);if(t.value===""&&e.length===0)return t.operator===ue.EQUALS;const r=sB(e);for(const i of nm(t.value)){let s=r.includes(i);if(!s&&t.code==="_compartment"&&(s=r.some(c=>c?.endsWith("/"+i))),s)return!n}return n}function RB(e,t){const n=lB(e),r=nm(t.value),i=rm(t.operator);for(const s of n)for(const c of r)if(_B(s,c))return!i;return i}function _B(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(i=>i.toLowerCase());return!n&&!r?!1:n?e.system?.toLowerCase()===n&&(!r||e.value?.toLowerCase()===r):!e.system&&e.value?.toLowerCase()===r}return e.value?.toLowerCase()===t.toLowerCase()}function DB(e,t){const n=aB(e),r=nm(t.value),i=rm(t.operator);for(const s of n)for(const c of r)if(AB(s,c))return!i;return i}function AB(e,t){return e.toLowerCase().includes(t.toLowerCase())}function PB(e,t){const n=iB(e),r=nm(t.value),i=rm(t.operator);for(const s of n)for(const c of r)if(kB(s,t.operator,c))return!i;return i}function kB(e,t,n){if(!e)return!1;const r=jD(n);if(!r)return!1;const i=e.start??"0000",s=e.end??"9999",c=r.start,d=r.end;switch(t){case ue.APPROXIMATELY:case ue.EQUALS:case ue.NOT_EQUALS:return i<d&&s>c;case ue.LESS_THAN:return i<c;case ue.GREATER_THAN:return s>d;case ue.LESS_THAN_OR_EQUALS:return i<=d;case ue.GREATER_THAN_OR_EQUALS:return s>=c;case ue.STARTS_AFTER:return i>d;case ue.ENDS_BEFORE:return s<c;default:return!1}}function rm(e){return e===ue.NOT_EQUALS||e===ue.NOT}const NB={resourceType:"*"},OB=["DomainConfiguration","JsonWebKey","Login"],MB=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Os={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},IB=[Os.READ,Os.VREAD,Os.HISTORY,Os.SEARCH];function LB(e,t){return OB.includes(t)?!1:$B(e,Os.UPDATE,t)}function $B(e,t,n){return!!e.resource?.some(r=>FD(r,n,t))}function VD(e,t,n){return n?n.resource?.find(r=>zB(e,t,r)):NB}function zB(e,t,n){const r=e.resourceType;return FD(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(i=>i.reference===n.compartment?.reference)||n.criteria&&!jB(e,BD(n.criteria))):!1}function FD(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||MB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||IB.includes(n)}function UB(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 SE(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 BB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return UB(t)}function wE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),cU(e.buffer)}async function VB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function HD(){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 qD(e){const t={};e=Qr(e);for(const i of e.entry||[]){const s=i.resource;if(!s)continue;s.meta!==void 0&&(delete s.meta.author,delete s.meta.compartment,delete s.meta.lastUpdated,delete s.meta.project,delete s.meta.versionId,Object.keys(s.meta).length===0&&delete s.meta);const c=s?.id;c&&(t[c]=HD(),i.fullUrl="urn:uuid:"+t[c],delete i.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(i=>({fullUrl:i.fullUrl,request:{method:"POST",url:i.resource?.resourceType},resource:i.resource}))},(i,s)=>FB(i,s,t),2);return HB(JSON.parse(r))}function FB(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 i=n[r];if(i)return"urn:uuid:"+i}}return t}function HB(e){const t=GB(e),{sorted:n,cycles:r}=qB(t),i={};for(const c of e.entry??[])c.fullUrl&&(i[c.fullUrl]=c);const s=n.map(c=>i[c]);for(const c of r)for(const d of c){const f=i[d],p={...f,request:{...f.request,method:"PUT"}};s.push(p)}return{...e,entry:s}}const ec={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function qB(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=ec.NotVisited;function i(s,c){if(n[s]===ec.Visited)return!0;if(n[s]===ec.Visiting){const f=c.lastIndexOf(s);return f!==-1&&r.push(c.slice(f)),!0}n[s]=ec.Visiting,c.push(s);let d=!1;for(const f of e[s])i(f,c)||(d=!0);return n[s]=ec.Visited,c.pop(),t.unshift(s),!d}for(const s in e)n[s]===ec.NotVisited&&i(s,[]);return{sorted:t,cycles:r}}function GD(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(ra(r)){const i=r.reference;i.startsWith("urn:uuid:")&&t(i)}else GD(r,t)}}function GB(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&&GD(n.resource,i=>{t[i]&&t[i].push(r)})}return t}const un={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"};let WB=class{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 i=0;i<r.length;i++)if(r[i]===n){r.splice(i,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 om{constructor(){this.emitter=new WB}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 Hy={"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"},QB=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],mb=["DiagnosticReport-update"];function YB(e){return mb.includes(e)}function KB(e){if(mb.includes(e))throw new ut(mn(`'context.version' is required for '${e}'.`))}const XB={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},select:{resourceType:"*",reference:!0,manyAllowed:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function ZB(e){return QB.includes(e)}function WD(e){return!!e.endpoint}function jE(e){if(!gb(e))throw new ut(mn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:i}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":i.join(",")};return WD(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function gb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:i}=e;if(!(t&&n&&r&&i)||typeof r!="string"||typeof i!="object"||!Array.isArray(i)||i.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const s of i)if(!Hy[s])return!1;return!(WD(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function JB(e,t,n,r){if(typeof t!="object")throw new ut(mn(`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 ut(mn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ut(mn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const i=r.resourceType;if(i!=="*"){if(!ZB(t.resourceType))throw new ut(mn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(i&&t.resourceType!==i)throw new ut(mn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${i}.`))}}function eV(e,t,n,r,i){if(i.set(t.key,(i.get(t.key)??0)+1),r.reference){if(!ra(t.reference))throw new ut(mn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else JB(e,t.resource,n,r)}function tV(e,t){const n=new Map,r=XB[e];for(let i=0;i<t.length;i++){const s=t[i].key;if(!r[s])throw new ut(mn(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));eV(e,t[i],i,r[s],n)}for(const[i,s]of Object.entries(r)){if(!(s.optional||n.has(i)))throw new ut(mn(`Missing required key '${i}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(i)??0)>1)throw new ut(mn(`${n.get(i)} context entries with key '${i}' found for the '${e}' event when schema only allows for 1.`))}}function CE(e,t,n,r){if(!(e&&typeof e=="string"))throw new ut(mn("Must provide a topic."));if(!Hy[t])throw new ut(mn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Hy).join(", ")}`));if(typeof n!="object")throw new ut(mn("context must be a context object or array of context objects."));if(mb.includes(t)&&!r)throw new ut(mn(`The '${t}' event must contain a 'context.versionId'.`));const i=Array.isArray(n)?n:[n];return tV(t,i),{timestamp:new Date().toISOString(),id:HD(),event:{"hub.topic":e,"hub.event":t,context:i,...r?{"context.versionId":r}:{}}}}class nV extends om{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ut(mn("Subscription request should contain an endpoint."));if(!gb(t))throw new ut(mn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const i=JSON.parse(r.data);if(i["hub.topic"])return;const s=i;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),n.send(JSON.stringify({id:i?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function rV(e){return JSON.parse(BB(e))}function oV(e){return e.split(".").length===3}function vb(e){const[t,n,r]=e.split(".");return rV(n)}function iV(e){try{return typeof vb(e).login_id=="string"}catch{return!1}}function aV(e){try{const n=vb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class sV{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,un.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var QD;QD=Symbol.toStringTag;class Ao{constructor(t){this[QD]="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 lV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new cV)}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?Lo(n):void 0)}}class cV{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
79
+ * Reconnecting WebSocket
80
+ * by Pedro Ladaria <pedro.ladaria@gmail.com>
81
+ * https://github.com/pladaria/reconnecting-websocket
82
+ * License MIT
83
+ *
84
+ * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
85
+ * https://github.com/partykit/partykit/blob/main/packages/partysocket
86
+ */const cc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let EE=!1;function uV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");cc.Event=globalThis.Event,cc.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},cc.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function dV(e,t){if(!e)throw new Error(t)}function lh(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 TE=!1;class Ia extends om{constructor(t,n,r={}){EE||(uV(),EE=!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=i=>{this._debug("open event");const{minUptime:s=ws.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),dV(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(c=>this._ws?.send(c)),this._messageQueue=[],this.onopen&&this.onopen(i),this.dispatchEvent(lh(i))},this._handleMessage=i=>{this._debug("message event"),this.onmessage&&this.onmessage(i),this.dispatchEvent(lh(i))},this._handleError=i=>{this._debug("error event",i.message),this._disconnect(void 0,i.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(i),this._debug("exec error listeners"),this.dispatchEvent(lh(i)),this._connect()},this._handleClose=i=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(i),this.dispatchEvent(lh(i))},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 Ia.CONNECTING}get OPEN(){return Ia.OPEN}get CLOSING(){return Ia.CLOSING}get CLOSED(){return Ia.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(){return this._messageQueue.reduce((n,r)=>(typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n),0)+(this._ws?.bufferedAmount??0)}get extensions(){return this._ws?.extensions??""}get protocol(){return this._ws?.protocol??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?Ia.CLOSED:Ia.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 i=0;return this._retryCount>0&&(i=n*Math.pow(t,this._retryCount-1),i>r&&(i=r)),this._debug("next delay",i),i}_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"&&!TE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),TE=!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 cc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new cc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new cc.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 fV=5e3;class qy extends om{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 hV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new qy(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class pV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof KD))throw new ut(mn("First arg of constructor should be a `MedplumClient`"));let i;try{i=new URL(n).toString()}catch{throw new ut(mn("Not a valid URL"))}const s=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(i,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new Ia(i,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new qy,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??fV,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{try{const r=JSON.parse(n.data);if(r.type==="pong"){this.waitingForPong=!1;return}const i=r,s=i?.entry?.[0]?.resource;if(s.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:i});return}if(s.type==="handshake"){const d=Vs(s.subscription),f={type:"connect",payload:{subscriptionId:d}};this.masterSubEmitter?.dispatchEvent(f);const p=this.criteriaEntriesBySubscriptionId.get(d);if(!p){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}p.connecting=!1,p.emitter.dispatchEvent({...f});return}this.masterSubEmitter?.dispatchEvent({type:"message",payload:i});const c=this.criteriaEntriesBySubscriptionId.get(Vs(s.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:i})}catch(r){console.error(r);const i={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(i);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...i})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new ut(Ez(new Error("WebSocket error")))};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n})}),t.addEventListener("close",()=>{const n={type:"close"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),this.masterSubEmitter?.removeAllListeners())}),t.addEventListener("open",()=>{const n={type:"open"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.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",()=>{const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&this.currentProfile?.id!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){const r={type:"error",payload:n};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){const{subscriptionId:n}=t;if(n){const r={type:"disconnect",payload:{subscriptionId:n}};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){let n=t?.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${kt(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`),i=r?.find(c=>c.name==="token")?.valueString,s=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!i)throw new ut(mn("Failed to get token"));if(!s)throw new ut(mn("Failed to get URL from $get-ws-binding-token"));return[n,i]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const i of r.criteriaWithProps)if(li(n,i.subscriptionProps))return i}}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 i;this.criteriaEntries.has(n)?i=this.criteriaEntries.get(n):(i={criteriaWithProps:[]},this.criteriaEntries.set(n,i)),r?i.criteriaWithProps.push(t):i.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:i,token:s}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(d=>{const f=d.subscriptionProps;return!li(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),i&&this.criteriaEntriesBySubscriptionId.delete(i),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ke(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const i=new hV(t,n);return this.addCriteriaEntry(i),this.subscribeToCriteria(i).catch(console.error),i.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 qy(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const YD="4.3.11-558184a29",mV=un.FHIR_JSON+", */*; q=0.1",gV="https://api.medplum.com/",vV=1e3,yV=6e4,xV=0,bV=3e5,SV="Binary/",RE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},tc={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"},wV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},jV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class KD extends om{constructor(t){if(super(),this.initComplete=!0,t?.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=t?.fetch??CV(),this.storage=t?.storage??new lV,this.createPdfImpl=t?.createPdf,this.baseUrl=ab(t?.baseUrl??gV),this.fhirBaseUrl=Zo(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=Zo(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=Zo(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=Zo(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=Zo(this.baseUrl,t?.fhircastHubUrl??"fhircast/STU3"),this.clientId=t?.clientId??"",this.clientSecret=t?.clientSecret??"",this.credentialsInHeader=t?.authCredentialsMethod==="header",this.defaultHeaders=t?.defaultHeaders??{},this.onUnauthenticated=t?.onUnauthenticated,this.refreshGracePeriod=t?.refreshGracePeriod??bV,this.cacheTime=t?.cacheTime??(typeof window>"u"?xV:yV),this.cacheTime>0?this.requestCache=new sD(t?.resourceCacheSize??vV):this.requestCache=void 0,t?.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t?.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(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?.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(){this.storage.setString("activeLogin",void 0),this.requestCache?.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){t=t.toString(),this.requestCache?.delete(t)}invalidateAll(){this.requestCache?.clear()}invalidateSearches(t){const n=Zo(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 i;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?i=new Promise((c,d)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:d}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):i=this.request("GET",t,n);const s=new Ao(i);return this.setCacheEntry(t,s),s}post(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("POST",t,i)}put(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("PUT",t,i)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,un.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:i}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:i},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,i,s=!0){let c=i;s&&(c=await this.ensureCodeChallenge(i)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,c,s))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:tc.TokenExchange,subject_token_type:wV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,i,s=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",i.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(i)),s){const{codeChallenge:d,codeChallengeMethod:f}=i;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",d)}return c.toString()}fhirUrl(...t){return new URL(Zo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=gU(n)),r}search(t,n,r){const i=this.fhirSearchUrl(t,n),s="search-"+i.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=this.getBundle(i,r);return this.setCacheEntry(s,d),d}searchOne(t,n,r){const i=this.fhirSearchUrl(t,n);i.searchParams.set("_count","1"),i.searchParams.sort();const s="searchOne-"+i.toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ao(this.search(t,i.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(s,d),d}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(s,r);if(c)return c.value;const d=new Ao(this.search(t,n,r).then(AE));return this.setCacheEntry(s,d),d}async*searchResourcePages(t,n,r){let i=this.fhirSearchUrl(t,n);for(;i;){const s=new URL(i).searchParams;s.has("_count")||s.set("_count","1000");const c=await this.search(t,s,r),d=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!d)break;yield AE(c),i=d?.url?new URL(d.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){const r=this.requestCache?.get(this.fhirUrl(t,n).toString())?.value;return r?.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return RE;const[r,i]=n.split("/");if(!(!r||!i))return this.getCached(r,i)}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 Ao(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ao(Promise.resolve(RE));const[i,s]=r.split("/");return!i||!s?new Ao(Promise.reject(new Error("Invalid reference"))):this.readResource(i,s,n)}requestSchema(t){if(pD(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const i=new Ao((async()=>{const s=`{
87
+ StructureDefinitionList(_filter: "name eq ${t}") {
88
+ resourceType,
89
+ name,
90
+ kind,
91
+ description,
92
+ type,
93
+ url,
94
+ snapshot {
95
+ element {
96
+ id,
97
+ path,
98
+ definition,
99
+ min,
100
+ max,
101
+ base {
102
+ path,
103
+ min,
104
+ max
105
+ },
106
+ contentReference,
107
+ type {
108
+ code,
109
+ profile,
110
+ targetProfile
111
+ },
112
+ binding {
113
+ strength,
114
+ valueSet
115
+ }
116
+ }
117
+ }
118
+ }
119
+ SearchParameterList(base: "${t}", _count: 100) {
120
+ base,
121
+ code,
122
+ type,
123
+ expression,
124
+ target
125
+ }
126
+ }`.replace(/\s+/g," "),c=await this.graphql(s);lE(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)RU(d)})());return this.setCacheEntry(n,i),i}requestProfileSchema(t,n){if(!n?.expandProfile&&tb(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),i=this.getCacheEntry(r,void 0);if(i)return i.value;const s=new Ao((async()=>{if(n?.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const d=await this.post(c.toString(),{});lE(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}hD(c)}})());return this.setCacheEntry(r,s),s}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,i){return this.get(this.fhirUrl(t,n,"_history",r),i)}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 i=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 s=await this.post(i,t,void 0,r);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const i=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(i,t,void 0,r);return s||(s=t),this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,i,s){let c=PE(t,n,r,i);if(c.contentType===un.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,x)=>{const b=new FileReader;b.onload=()=>{if(!b.result){x(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:un.CDA_XML})}const d=s??(typeof n=="object"?n:{}),f=await this.createBinary(c,d);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,i,s){const c=PE(t,n,r,i),d=s??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:x}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g?.reference&&this.setRequestHeader(d,"X-Security-Context",g.reference),x?this.uploadwithProgress(b,f,p,x,d):this.post(b,f,p,d)}uploadwithProgress(t,n,r,i,s){return new Promise((c,d)=>{const f=new XMLHttpRequest,p=()=>f.abort();s?.signal?.addEventListener("abort",p);const m=g=>{s?.signal?.removeEventListener("abort",p),g instanceof Error?d(g):c(g)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),i&&(f.upload.onprogress=g=>i(g),f.upload.onload=g=>i(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new ut(Ht(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),s?.headers){const g=s.headers;for(const[x,b]of Object.entries(g))f.setRequestHeader(x,b)}f.send(n)})}async createPdf(t,n,r,i){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=RV(t,n,r,i),c=typeof n=="object"?n:{},{docDefinition:d,tableLayouts:f,fonts:p,...m}=s,g=await this.createPdfImpl(d,f,p),x={...m,data:g,contentType:"application/pdf"};return this.createBinary(x,c)}createComment(t,n,r){const i=this.getProfile();let s,c;return t.resourceType==="Encounter"&&(s=Jt(t),c=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=Jt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Jt(t)],encounter:s,subject:c,sender:i?Jt(i):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,i){const s=await this.patch(this.fhirUrl(t,n),r,i);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}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,i){let s;if(typeof t=="string"){const c=t;s=this.fhirUrl("Bot",c,"$execute")}else{const c=t;s=this.fhirUrl("Bot","$execute"),s.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(s,n,r,i)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,un.JSON,n)}graphql(t,n,r,i){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},un.JSON,i)}readResourceGraph(t,n,r,i){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,i)}pushToAgent(t,n,r,i,s,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",Vs(t),"$push"),{destination:typeof n=="string"?n:kt(n),body:r,contentType:i,waitForResponse:s,...d!==void 0?{waitTimeout:d}:void 0},un.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||kt(this.sessionDetails.profile)!==t.profile?.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=aV(t),this.medplumServer=iV(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>r.profile?.reference!==t.profile?.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=>{this.profilePromise=void 0;const i=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,i&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!this.isInitialized||!!this.profilePromise&&!this.sessionDetails?.profile}isSuperAdmin(){return!!this.sessionDetails?.project.superAdmin}isProjectAdmin(){return!!this.sessionDetails?.membership.admin}getProject(){return this.sessionDetails?.project}getProjectMembership(){return this.sessionDetails?.membership}getProfile(){return this.sessionDetails?.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){return this.sessionDetails?.config}getAccessPolicy(){return this.sessionDetails?.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(SV)&&(t=this.fhirUrl(r));let i=n.headers;return i||(i={},n.headers=i),i.Accept||(i.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...i}=t,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});i.securityContext||(i.securityContext=Jt(s));const c=await this.createAttachment(i,n);return this.updateResource({...s,status:"completed",content:c})}async uploadMedia(t,n,r,i,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:i},s)}async createDocumentReference(t,n){const{additionalFields:r,...i}=t,s=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});i.securityContext||(i.securityContext=Jt(s));const c=await this.createAttachment(i,n);return this.updateResource({...s,content:[{attachment:c}]})}async bulkExport(t="",n,r,i){const s=t&&`${t}/`,c=this.fhirUrl(`${s}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),i)}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 sV(this)),this.keyValueClient}getBundle(t,n){return new Ao((async()=>{const r=await this.get(t,n);if(r.entry)for(const i of r.entry)this.cacheResource(i.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||n?.cache==="no-cache"||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){t?.id&&!t.meta?.tag?.some(n=>n.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Ao(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},i={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const d=s.headers.get("content-type")?.includes("json");if(s.status===404&&!d)throw new ut(jz);const f=await this.parseBody(s,d);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await DE(s,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const m=await DE(s,f)??i.statusUrl;if(m)return this.pollStatus(m,r,i)}if(s.status>=400)throw new ut(Ht(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(i){throw console.error("Error parsing response",t.status,i),i}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=Zo(this.baseUrl,t));const r=n?.maxRetries??2;for(let i=0;i<=r;i++)try{this.options.verbose&&this.logRequest(t,n);const s=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(s),this.setCurrentRateLimit(s),i>=r||!_V(s))return s;const c=this.getRetryDelay(i),d=n.maxRetryTime??2e3;if(c>d)return s;await gE(c)}catch(s){if(s.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),s.name==="AbortError"||i===r)throw s}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const i of rd(Object.keys(r)))console.log(`> ${i}: ${r[i]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){const n=t.headers?.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const i=r[0].substring(1,r[0].length-1),s=r.find(p=>p.startsWith("r=")),c=s?parseInt(s.substring(2),10):NaN,d=r.find(p=>p.startsWith("t=")),f=d?parseInt(d.substring(2),10):NaN;if(!i||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:i,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const i of n)i.remainingUnits||(r=Math.max(r,i.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const i={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(i.headers={...n.headers},delete i.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const s=n.pollStatusPeriod??1e3;await gE(s),r.pollCount++}return this.request("GET",t,i,r)}async executeAutoBatch(){if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const i=t[0];try{i.resolve(await this.request(i.method,Zo(this.fhirBaseUrl,i.url),i.options))}catch(s){i.reject(new ut(Ht(s)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(i=>({request:{method:i.method,url:i.url},resource:i.options.body?JSON.parse(i.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let i=0;i<t.length;i++){const s=t[i],c=r.entry?.[i];c?.response?.outcome&&!cD(c.response.outcome)?s.reject(new ut(c.response.outcome)):s.resolve(c?.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",mV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",un.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,i=!1){t.headers||(t.headers={});const s=t.headers;i&&s[n]||(s[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n?.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n?.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n?.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new ut(td)))}async startPkce(){const t=wE();sessionStorage.setItem("pkceState",t);const n=wE().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await VB(n);return{codeChallengeMethod:"S256",codeChallenge:uU(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}catch(r){return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method",r),{codeChallengeMethod:"plain",codeChallenge:n}}}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??_E()),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:tc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??_E()};if(typeof sessionStorage<"u"){const i=sessionStorage.getItem("codeVerifier");i&&(r.code_verifier=i)}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:tc.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:tc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:tc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:tc.ClientCredentials,client_assertion_type:jV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=SE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ut(mn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ut(mn("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},s=(await this.post(this.fhircastHubUrl,jE(r),un.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!gb(t))throw new ut(mn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ut(mn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,jE(t),un.FORM_URL_ENCODED)}fhircastConnect(t){return new nV(t)}async fhircastPublish(t,n,r,i){return YB(n)?this.post(this.fhircastHubUrl,CE(t,n,r,i),un.JSON):(KB(n),this.post(this.fhircastHubUrl,CE(t,n,r),un.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":un.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 ${SE(t.client_id+":"+t.client_secret)}`));const i={method:"POST",headers:r,body:n.toString(),credentials:"include"};let s;try{s=await this.fetchWithRetry(this.tokenUrl,i)}catch(d){throw this.refreshPromise=void 0,d}if(!s.ok){this.clearActiveLogin();try{const d=await s.json();throw new ut(oi(d.error_description))}catch(d){throw new ut(oi("Failed to fetch tokens"),d)}}const c=await s.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(oV(n)){const r=vb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ut(Cz);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ut(aE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ut(aE)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){return this.sessionDetails&&t?t.profile?.reference?.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?.profile.reference!==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 pV(this,mU(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 CV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function _E(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function DE(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Xp(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function AE(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function EV(e){return ar(e)&&"data"in e&&"contentType"in e}function PE(e,t,n,r){return EV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function TV(e){return ar(e)&&"docDefinition"in e}function RV(e,t,n,r){return TV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function _V(e){return e.status===429||e.status>=500}function Sc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:i,accessPolicyResource:s}){if(t===e?.path)return;i??=e?.debugMode??!1,s??=e?.accessPolicyResource;let c=DV(t,n,e,!!i);const d=Fy(t,".",2)[1];c=AV(c,s,d),c=PV(c,s,d);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const x=Fy(g,".",2)[1];if(x){if(!m[x]){const b=qh(x,s?.hiddenFields);m[x]={hidden:b,readonly:b||qh(x,s?.readonlyFields)}}return m[x]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:i,getExtendedProps:p,accessPolicyResource:s}}function DV(e,t,n,r){const i=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=ks(e,c);f!==void 0&&(i[f]=d)}let s=!1;if(t)for(const[c,d]of Object.entries(t))c in i||(i[c]=d,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),i}function AV(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([i])=>!qh(r+i,t.hiddenFields)))}function PV(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),i=n?n+".":"";for(const[s,c]of Object.entries(e))qh(i+s,t.readonlyFields)?r[s]={...c,readonly:!0}:r[s]=c;return r}function qh(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");if(t.includes(i))return!0}return!1}function XD(e){return e.type!==void 0&&e.type.length>0}function kV(e,t,n,r){const i=B8(e,t.path,{profileUrl:r});if(i){const s=n.typeSchema?.elements??n.elements;return i.some(c=>H8(c,t,n,s))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function ZD(e,t,n,r){if(e)for(const i of t){const s={value:e,type:i.typeSchema?.type??i.type?.[0].code};if(n.every(c=>kV(s,c,i,i.typeSchema?.url??r)))return i.name}}class NV{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const i=Sc({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(i===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[i],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 i=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([s])=>s.startsWith(n)));this.crawlElementsImpl(i,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const i=this.prepareSlices(r.slices,r);if(!Cn(i.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(i.slices[0],n.path,i),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=OV(t);for(const i of r)this.crawlElementNode(i,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const i of t.children)this.crawlElementNode(i,n);Cn(t.element?.slicing?.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){const r=[];for(const s of t){if(!XD(s))continue;const c=s.type.find(d=>Cn(d.profile))?.profile?.[0];if(Cn(c)){const d=Mc(c);d&&(s.typeSchema=d)}r.push(s)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const i of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(i))&&this.crawlSliceImpl(i,n,r)}crawlSliceImpl(t,n,r){const i=t.typeSchema;i&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(i),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let s;const c=i?.elements??t.elements;Cn(c)&&(s=Sc({path:n,parentContext:this.elementsContext,elements:c})),s&&this.elementsContextStack.push(s),this.crawlElementsImpl(c,n),s&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),i&&this.visitor.onExitSchema&&this.visitor.onExitSchema(i)}}function OV(e){const t=[];function n(s,c){return c.startsWith(s+".")}function r(s,c){for(const d of s.children)if(n(d.key,c.key)){r(d,c);return}s.children.push(c)}const i=Object.entries(e);i.sort((s,c)=>s[0].localeCompare(c[0]));for(const[s,c]of i){const d={key:s,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,s)){r(p,d),f=!0;break}f||t.push(d)}return t}const ty="__sliceName";function MV(e,t){const n=new IV(e,e.resourceType,"resource");return new NV(t,n).crawlResource(),n.getDefaultValue()}function kE(e,t,n){for(const[r,i]of Object.entries(t)){if(n===void 0||n===r){Gh(e,r,i,t);continue}const s=ks(n,r);s!==void 0&&Gh(e,s,i,t)}return e}class IV{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Qr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const i=this.value.values,s=this.value.path,c=ks(s,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const d=[];for(const f of i){if(f===void 0)continue;const p=ks(r.path,s),m=Array.isArray(f)?f:[f];for(const g of m){LV(g,c,n,r.elements,p),Gh(g,c,n,r.elements);const x=Wy(g,c,r.elements,p);x!==void 0&&d.push(x)}}this.valueStack.push({type:"element",path:t,values:d})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=ks(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=ks(r.path,this.value.path);for(const d of this.value.values){const f=Wy(d,s,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Cn(m)||f.splice(p,1)}En(f)&&Gy(d,void 0,s,n)}}onEnterSlice(t,n,r){const i=this.value.values,s=[];for(const c of i)if(c!==void 0){const d=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(d,n,r);s.push(f)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const i=[];for(const s of t)(s[ty]??ZD(s,[n],r.discriminator,this.schema.url))===n.name&&i.push(s);for(let s=i.length;s<n.min;s++)if(ib(n.type[0].code)){const c=Object.create(null);i.push(c),t.push(c)}return i}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 i=n[r];ty in i&&delete i[ty]}}getDefaultValue(){return this.rootValue}}function LV(e,t,n,r,i){const s=Wy(e,t,r,i);n.min>0&&s===void 0&&ib(n.type[0].code)&&(n.isArray?Gy(e,[Object.create(null)],t,n):Gy(e,Object.create(null),t,n))}function Gy(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let i=n;if(n.includes("[x]")){const s=r.type[0].code;i=n.replace("[x]",Mn(s))}t===void 0?delete e[i]:e[i]=t}function Wy(e,t,n,r){const i=t.split(".");let s=e,c;for(let d=0;d<i.length;d++){let f=i[d];if(f.includes("[x]")){const p=(r?r+".":"")+i.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",Mn(g))}if(d===i.length-1){Array.isArray(s)?c=s.map(p=>p[f]):c=s[f];continue}if(Array.isArray(s))s=s.map(p=>p[f]);else if(ar(s)){if(s[f]===void 0)return;s=s[f]}else return}return c}function Gh(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>Gh(d,t,n,r));e==null&&(e=Object.create(null));const i=e,s=t.split(".");let c=i;for(let d=0;d<s.length;d++){let f=s[d];if(f.includes("[x]")){const m=r[s.slice(0,d+1).join(".")].type[0].code;f=f.replace("[x]",Mn(m))}if(d===s.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??=n.fixed.value:n.pattern&&(m[f]=JD(m[f],n.pattern.value))}else{if(!(f in c)){const p=s.slice(0,d+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return i}function JD(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:Qr(t);if(ar(t)&&(ar(e)&&!Array.isArray(e)||e===void 0)){const n=Qr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=JD(n[r],t[r]);return n}return e}const rr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function im(e,t){let n=ci.types[e]?.searchParamsDetails?.[t.code];return n||(n=zV(e,t)),n}function $V(e,t,n){let r=ci.types[e];r||(r={},ci.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function zV(e,t){const n=t.code,r=FV(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const d=Ch(c),f=hU(()=>d.join("."));d.length===1&&d[0]instanceof kr?i.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?i.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.clear(),i.propertyTypes.add("code")):eA(i,d,e,1),f().endsWith("extension.valueDateTime")&&(i.array=!1,i.propertyTypes.clear(),i.propertyTypes.add("dateTime"))}const s={type:VV(t,i.propertyTypes),elementDefinitions:i.elementDefinitions.map(c=>({...c,type:c.type?.filter(d=>i.propertyTypes.has(d.code))})).filter(c=>c.type&&c.type.length>0),parsedExpression:HV(e,t.expression),array:i.array};return $V(e,n,s),s}function eA(e,t,n,r){const i=t[r];if(i instanceof Hh){e.propertyTypes.add(i.right.toString());return}if(i instanceof db){UV(e,i);return}const s=i.toString(),c=Za(n,s);if(!c)throw new Error(`Element definition not found for ${n} ${s}`);let d=!1,f=r+1;f<t.length&&t[f]instanceof fb&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof Hh){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;BV(g)&&(g=c.type[0].code),eA(e,t,g,f)}}function UV(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 ub){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function BV(e){return e==="Element"||e==="BackboneElement"}function VV(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?rr.DATE:rr.DATETIME;case"number":return rr.NUMBER;case"quantity":return rr.QUANTITY;case"reference":return t.has(re.canonical)?rr.CANONICAL:rr.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?rr.BOOLEAN:rr.TEXT;default:return rr.TEXT}}function FV(e,t){const n=[],r=hb(t);return Wh(e,r.child,n),n}function HV(e,t){const n=[],r=hb(t);if(Wh(e,r.child,n),n.length===0)return r;let i=n[0];for(let s=1;s<n.length;s++)i=new cb(i,n[s]);return new $D("<original-not-available>",i)}function Wh(e,t,n){t instanceof cb?(Wh(e,t.left,n),Wh(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function Ch(e){if(e instanceof Hh||e instanceof fb)return[Ch(e.left),e].flat();if(e instanceof kr)return[e];if(e instanceof lb)return[Ch(e.left),Ch(e.right)].flat();if(e instanceof db){if(e.name==="where"&&!(e.args[0]instanceof ub))return[];if(e.name==="last")return[]}return[e]}const qV="https://meta.medplum.com/releases",ny=new Map;function GV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!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 WV(e,t,n){let r=ny.get("latest");if(!r){const i="latest",s=new URL(`${qV}/${i}.json`);s.searchParams.set("a",e),s.searchParams.set("c",YD);const c=await fetch(s.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ke(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const d=await c.json();GV(d),r=d,ny.set("latest",r),ny.set(r.tag_name.slice(1),r)}return r}async function QV(e){const t=await WV(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 tA=v.createContext(void 0);function am(){return v.useContext(tA)}function De(){return am().medplum}function sm(){return am().navigate}function lm(){return am().profile}const NE=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function YV(e){const t=e.medplum,n=e.navigate??KV,[r,i]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){i(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of NE)t.addEventListener(d,c);return()=>{for(const d of NE)t.removeEventListener(d,c)}},[t]);const s=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(tA.Provider,{value:s,children:e.children})}function KV(e){window.location.assign(e)}const OE=new Map,nA=e=>v.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 i=OE.get(t);if(i){const c=new URLSearchParams(new URL(i).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return i}return OE.set(t,e),e},[e]);function qt(e,t){const n=De(),[r,i]=v.useState(()=>ME(n,e)),s=v.useCallback(c=>{li(c,r)||i(c)},[r]);return v.useEffect(()=>{let c=!0;const d=ME(n,e);return!d&&ra(e)?n.readReference(e).then(f=>{c&&s(f)}).catch(f=>{c&&(s(void 0),t&&t(Ht(f)))}):s(d),(()=>c=!1)},[n,e,s,t]),r}function ME(e,t){if(t){if(pi(t))return t;if(ra(t))return e.getCachedReference(t)}}const wt={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"},yb=`${Uo}/fhir/StructureDefinition/questionnaire-itemControl`,XV=`${Uo}/fhir/StructureDefinition/questionnaire-referenceFilter`,Qy=`${Uo}/fhir/StructureDefinition/questionnaire-referenceResource`,ZV=`${Uo}/fhir/StructureDefinition/questionnaire-validationError`,JV=`${Uo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,eF=`${Uo}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,tF=`${Uo}/fhir/StructureDefinition/questionnaire-signatureRequired`,Eh=`${Uo}/fhir/StructureDefinition/questionnaireresponse-signature`;function nF(e){return e.type==="choice"||e.type==="open-choice"}function rF(e,t){const n=oF(e,t);return n!==void 0?n:iF(e,t)}function oF(e,t){const n=hi(e,JV);if(t&&n){const r=n.valueExpression?.expression;if(r){const i=Wr(t),s=Ga(r,[i],{"%resource":i});return ti(s)}}}function iF(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const i=iA(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!i?.length){if(n==="any")return!0;continue}const{anyMatch:s,allMatch:c}=dF(r,i,n);if(n==="any"&&s)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function rA(e,t,n=t.item){for(const r of e){const i=n?.find(s=>s.linkId===r.linkId);i&&(aF(t,r,i),r.item&&i.item&&rA(r.item,t,i.item))}}function aF(e,t,n){try{const r=cF(t,e);if(!r)return;const i=lF(t,r);if(!i)return;n.answer=[i]}catch(r){n.extension=[{url:ZV,valueString:`Expression evaluation failed: ${Ke(r)}`}]}}const sF={[wt.boolean]:[re.boolean],[wt.date]:[re.date],[wt.dateTime]:[re.dateTime],[wt.time]:[re.time],[wt.url]:[re.string,re.uri,re.url],[wt.attachment]:[re.Attachment],[wt.reference]:[re.Reference],[wt.quantity]:[re.Quantity],[wt.decimal]:[re.decimal,re.integer],[wt.integer]:[re.decimal,re.integer]};function lF(e,t){if(!e.type)return;if(e.type===wt.choice||e.type===wt.openChoice)return{[`value${Mn(t.type)}`]:t.value};if(e.type===wt.string||e.type===wt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(sF[e.type]?.includes(t.type))return{[`value${Mn(e.type)}`]:t.value}}function cF(e,t){if(!t)return;const n=hi(e,eF);if(n){const r=n.valueExpression?.expression;if(r){const i=Wr(t),s=Ga(r,[i],{"%resource":i});return s.length!==0?s[0]:void 0}}}function oA(e,t,n){const r=[];for(const i of e){const s=n.answerOption?.find(c=>Fs(ui(c))===i);if(s){const c=ui(s);c&&r.push({[t]:c.value})}}return r}function iA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=iA(n.item,t);if(r)return r}}}function uF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:i}]=Ga(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return i}else return!1}function dF(e,t,n){const r=t||[],i=pF(e);let s=!1,c=!0;for(const d of r){const f=mF(d),{operator:p}=e;if(uF(f,i,p)?s=!0:c=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:c}}function aA(e){const t=hi(e,Qy);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function ry(e,t){const n=Qr(e);let r=hi(n,Qy);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(i=>i!==r)),n):(r||(n.extension??=[],r={url:Qy},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 fF(e,t,n){const r=hi(e,XV);if(!r?.valueString)return;let i=r.valueString;t?.reference&&(i=i.replaceAll("$subj",t.reference)),n?.reference&&(i=i.replaceAll("$encounter",n.reference));const s={},c=i.split("&");for(const d of c){const[f,p]=Fy(d,"=",2);s[f]=p}return s}function IE(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??kt(e),item:xb(e.item,t?.item),status:"in-progress"}}function xb(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===wt.display)continue;const i=t?.filter(s=>s.linkId===r.linkId);if(i&&i?.length>0)for(const s of i)s.id=s.id??lA(),s.text=s.text??r.text,s.item=xb(r.item,s.item),s.answer=cA(r,s),n.push(s);else n.push(sA(r))}return n}function sA(e){return{id:lA(),linkId:e.linkId,text:e.text,item:xb(e.item,void 0),answer:cA(e)}}let hF=1;function lA(){return"id-"+hF++}function cA(e,t){if(!(e.type===wt.display||e.type===wt.group)){if(t?.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}));if(e.answerOption)return e.answerOption.filter(n=>n.initialSelected).map(n=>({...n,initialSelected:void 0}))}}function bb(e){return _d({value:e},"value")}function ui(e){return _d({value:e},"value")}function pF(e){return _d({value:e},"answer")}function mF(e){return _d({value:e},"value")}function gF(e){const t=qt(e.questionnaire),n=qt(e.defaultValue),[,r]=v.useReducer(w=>w+1,0),i=v.useRef({activePage:0});if(!i.current.questionnaire&&t&&(i.current.questionnaire=t,i.current.pages=e.disablePagination?void 0:vF(t)),t&&e.defaultValue&&n&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=IE(t,n),b()),t&&!e.defaultValue&&!i.current.questionnaireResponse&&(i.current.questionnaireResponse=IE(t),b()),!i.current.questionnaire||!i.current.questionnaireResponse)return{loading:!0};function s(w,j){let C=i.current.questionnaireResponse;for(const E of w)C=C?.item?.find(R=>R.linkId===E.linkId);return j&&(C=C?.item?.find(E=>E.linkId===j.linkId)),C}function c(){i.current.activePage=(i.current.activePage??0)+1,r()}function d(){i.current.activePage=(i.current.activePage??0)-1,r()}function f(w,j){const C=s(w);C&&(C.item??=[],C.item.push(sA(j)),b())}function p(w,j){const C=s(w,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(w,j,C){const E=s(w,j);E&&(E.answer=C,b())}function g(w){const j=i.current.questionnaireResponse;j&&(w?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==Eh),j.extension.push({url:Eh,valueSignature:w})):j.extension=j.extension?.filter(C=>C.url!==Eh),b())}function x(){const w=i.current.questionnaire;if(w?.item){const j=i.current.questionnaireResponse;rA(w.item,j)}}function b(){const w=i.current.questionnaireResponse;w&&(x(),r(),e.onChange?.(w))}return{loading:!1,pagination:!!i.current.pages,questionnaire:i.current.questionnaire,questionnaireResponse:i.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:i.current.activePage,pages:i.current.pages,items:yF(i.current.questionnaire,i.current.pages,i.current.activePage),responseItems:xF(i.current.questionnaireResponse,i.current.pages,i.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function vF(e){if(!(!e?.item||hi(e?.item?.[0],yb)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function yF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function xF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function bF(e,t,n={leading:!1}){const[r,i]=v.useState(e),s=v.useRef(!1),c=v.useRef(void 0),d=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{s.current&&(!d.current&&n.leading?(d.current=!0,i(e)):(f(),c.current=setTimeout(()=>{d.current=!1,i(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(s.current=!0,f),[f]),[r,f]}const SF=250;function wF(e,t,n){return uA("searchOne",e,t)}function wc(e,t,n){return uA("searchResources",e,t)}function uA(e,t,n,r){const i=De(),[s,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,x]=v.useState(),b=i.fhirSearchUrl(t,n).toString(),[w]=bF(b,SF,{leading:!0});return v.useEffect(()=>{w!==s&&(c(w),i[e](t,n).then(j=>{f(!1),m(j),x(wz)}).catch(j=>{f(!1),m(void 0),x(Ht(j))}))},[i,e,t,n,s,w]),[p,d,g]}function jF(e){const t=e.value;return t?a.jsx(a.Fragment,{children:ND(t)}):null}const dA=["meta","implicitRules","contained","extension","modifierExtension"],fA=["language","text"],sn=v.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});sn.displayName="ElementsContext";const Sb=["extension","modifierExtension"],CF=["id",...dA].filter(e=>!Sb.includes(e));function EF(e){return Object.entries(e).filter(([n,r])=>!Cn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Sb.includes(n)&&!Cn(r.slicing?.slices)||CF.includes(n)?!1:!(fA.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function LE(e,t){return e.line&&e.line.length>t?e.line[t]:""}function $E(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function TF(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(sn),[s,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(_=>i(e.path+"."+_)),[i,e.path]);function x(_){n(_),e.onChange&&e.onChange(_)}function b(_){x({...r.current,use:_})}function w(_){x({...r.current,type:_})}function j(_){x($E(r.current||{},0,_))}function C(_){x($E(r.current||{},1,_))}function E(_){x({...r.current,city:_})}function R(_){x({...r.current,state:_})}function T(_){x({...r.current,postalCode:_})}return a.jsxs(ye,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(an,{disabled:e.disabled||s?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>b(_.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(an,{disabled:e.disabled||c?.readonly,"data-testid":"address-type",defaultValue:t.type,onChange:_=>w(_.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(ze,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:LE(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:LE(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>E(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>R(_.currentTarget.value)}),a.jsx(ze,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>T(_.currentTarget.value)})]})}function RF(e){const t=lm(),[n,r]=v.useState(e.defaultValue||{});function i(s){const c=s?{text:s,authorReference:t&&Jt(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(ze,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>i(s.currentTarget.value)})}/**
127
+ * @license @tabler/icons-react v3.34.1 - MIT
128
+ *
129
+ * This source code is licensed under the MIT license.
130
+ * See the LICENSE file in the root directory of this source tree.
131
+ */var _F={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
132
+ * @license @tabler/icons-react v3.34.1 - MIT
133
+ *
134
+ * This source code is licensed under the MIT license.
135
+ * See the LICENSE file in the root directory of this source tree.
136
+ */const Be=(e,t,n,r)=>{const i=v.forwardRef(({color:s="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},x)=>v.createElement("svg",{ref:x,..._F[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:d,stroke:s},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([b,w])=>v.createElement(b,w)),...Array.isArray(m)?m:[m]]));return i.displayName=`${n}`,i};/**
137
+ * @license @tabler/icons-react v3.34.1 - MIT
138
+ *
139
+ * This source code is licensed under the MIT license.
140
+ * See the LICENSE file in the root directory of this source tree.
141
+ */const DF=[["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"}]],AF=Be("outline","adjustments-horizontal","AdjustmentsHorizontal",DF);/**
142
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const PF=[["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"}]],il=Be("outline","alert-circle","AlertCircle",PF);/**
147
+ * @license @tabler/icons-react v3.34.1 - 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 kF=[["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"}]],NF=Be("outline","arrow-down","ArrowDown",kF);/**
152
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const OF=[["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"}]],MF=Be("outline","arrow-up","ArrowUp",OF);/**
157
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const IF=[["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"}]],LF=Be("outline","bleach-off","BleachOff",IF);/**
162
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const $F=[["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"}]],zF=Be("outline","bleach","Bleach",$F);/**
167
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const UF=[["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"}]],BF=Be("outline","box-multiple","BoxMultiple",UF);/**
172
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const VF=[["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"}]],FF=Be("outline","brackets-contain","BracketsContain",VF);/**
177
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const HF=[["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"}]],qF=Be("outline","brand-asana","BrandAsana",HF);/**
182
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const GF=[["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"}]],WF=Be("outline","bucket-off","BucketOff",GF);/**
187
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const QF=[["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"}]],YF=Be("outline","bucket","Bucket",QF);/**
192
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const KF=[["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"}]],XF=Be("outline","building","Building",KF);/**
197
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const ZF=[["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"}]],Na=Be("outline","calendar","Calendar",ZF);/**
202
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const JF=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],oa=Be("outline","check","Check",JF);/**
207
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const eH=[["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"}]],tH=Be("outline","checkbox","Checkbox",eH);/**
212
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const nH=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],wb=Be("outline","chevron-down","ChevronDown",nH);/**
217
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const rH=[["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"}]],oH=Be("outline","circle-check","CircleCheck",rH);/**
222
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const iH=[["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"}]],Qh=Be("outline","circle-minus","CircleMinus",iH);/**
227
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const aH=[["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"}]],Yh=Be("outline","circle-plus","CirclePlus",aH);/**
232
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const sH=[["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"}]],jb=Be("outline","cloud-upload","CloudUpload",sH);/**
237
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const lH=[["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"}]],cH=Be("outline","columns","Columns",lH);/**
242
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const uH=[["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"}]],hA=Be("outline","copy","Copy",uH);/**
247
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const dH=[["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"}]],fH=Be("outline","currency-dollar","CurrencyDollar",dH);/**
252
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const hH=[["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"}]],pH=Be("outline","device-floppy","DeviceFloppy",hH);/**
257
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const mH=[["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"}]],gH=Be("outline","dots","Dots",mH);/**
262
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const vH=[["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"}]],pA=Be("outline","edit","Edit",vH);/**
267
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const yH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],Ad=Be("outline","equal-not","EqualNot",yH);/**
272
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const xH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],Pd=Be("outline","equal","Equal",xH);/**
277
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const bH=[["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"}]],zE=Be("outline","file-alert","FileAlert",bH);/**
282
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const SH=[["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"}]],wH=Be("outline","file-plus","FilePlus",SH);/**
287
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const jH=[["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"}]],CH=Be("outline","filter","Filter",jH);/**
292
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const EH=[["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"}]],TH=Be("outline","forms","Forms",EH);/**
297
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const RH=[["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"}]],_H=Be("outline","id","Id",RH);/**
302
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const DH=[["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"}]],UE=Be("outline","list-details","ListDetails",DH);/**
307
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const AH=[["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"}]],PH=Be("outline","lock-access","LockAccess",AH);/**
312
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const kH=[["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"}]],NH=Be("outline","lock","Lock",kH);/**
317
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const OH=[["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"}]],MH=Be("outline","logout","Logout",OH);/**
322
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const IH=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],mA=Be("outline","math-greater","MathGreater",IH);/**
327
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const LH=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],gA=Be("outline","math-lower","MathLower",LH);/**
332
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const $H=[["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"}]],zH=Be("outline","message","Message",$H);/**
337
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const UH=[["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"}]],BH=Be("outline","microscope","Microscope",UH);/**
342
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const VH=[["path",{d:"M5 12l14 0",key:"svg-0"}]],FH=Be("outline","minus","Minus",VH);/**
347
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const HH=[["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"}]],qH=Be("outline","packages","Packages",HH);/**
352
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const GH=[["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"}]],WH=Be("outline","pin","Pin",GH);/**
357
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const QH=[["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"}]],YH=Be("outline","pinned-off","PinnedOff",QH);/**
362
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const KH=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],XH=Be("outline","player-play","PlayerPlay",KH);/**
367
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const ZH=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],vA=Be("outline","plus","Plus",ZH);/**
372
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const JH=[["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"}]],eq=Be("outline","receipt","Receipt",JH);/**
377
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const tq=[["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"}]],yA=Be("outline","refresh","Refresh",tq);/**
382
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const nq=[["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"}]],rq=Be("outline","repeat","Repeat",nq);/**
387
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const oq=[["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"}]],iq=Be("outline","report-medical","ReportMedical",oq);/**
392
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const aq=[["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"}]],sq=Be("outline","router","Router",aq);/**
397
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const lq=[["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"}]],cq=Be("outline","search","Search",lq);/**
402
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const uq=[["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"}]],Yy=Be("outline","settings","Settings",uq);/**
407
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const dq=[["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"}]],Cb=Be("outline","sort-ascending","SortAscending",dq);/**
412
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const fq=[["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"}]],Eb=Be("outline","sort-descending","SortDescending",fq);/**
417
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const hq=[["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"}]],pq=Be("outline","square","Square",hq);/**
422
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const mq=[["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"}]],gq=Be("outline","star","Star",mq);/**
427
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const vq=[["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"}]],yq=Be("outline","switch-horizontal","SwitchHorizontal",vq);/**
432
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const xq=[["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"}]],bq=Be("outline","table-export","TableExport",xq);/**
437
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const Sq=[["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"}]],wq=Be("outline","text-recognition","TextRecognition",Sq);/**
442
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const jq=[["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"}]],cm=Be("outline","trash","Trash",jq);/**
447
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const Cq=[["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"}]],BE=Be("outline","upload","Upload",Cq);/**
452
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const Eq=[["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"}]],Tq=Be("outline","webhook","Webhook",Eq);/**
457
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const Rq=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],Gs=Be("outline","x","X",Rq);/**
462
+ * @license @tabler/icons-react v3.34.1 - 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
+ */const _q=[["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"}]],Dq=Be("filled","circle-filled","CircleFilled",_q);class xA extends v.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(Ji,{icon:a.jsx(il,{size:16}),title:"Something went wrong",color:"red",children:Ke(this.state.error)}):this.props.children}}function yo(){return a.jsx(Yn,{style:{width:"100%",height:"100vh"},children:a.jsx(Dr,{})})}const Aq="_main_6f7o5_1",Pq={main:Aq};function dn(e){e.preventDefault(),e.stopPropagation()}function bA(e){return e.button===1||e.ctrlKey||e.metaKey}function SA(e){if(VE(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&VE(t[0]))return!0}return!1}function VE(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Gu(e,t){return new Promise((n,r)=>{const i=new MessageChannel;i.port1.onmessage=({data:s})=>{i.port1.close(),s.error?r(s.error):n(s.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[i.port2])})}function wA(e,t){const n=new Blob([e],{type:un.JSON}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r;const s=t??new Date().toISOString().replace(/\D/g,"");i.download=`${s}.json`,document.body.appendChild(i),i.click(),URL.revokeObjectURL(r)}function gt(e){const t=sm(),{to:n,suffix:r,label:i,onClick:s,children:c,...d}=e;let f=kq(n);return r&&(f+="/"+r),a.jsx(Dt,{href:f,"aria-label":i,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),s?(p.preventDefault(),s(p)):n&&(bA(p)||(p.preventDefault(),t(f)))},...d,children:c})}function kq(e){if(e){if(typeof e=="string")return Nq(e);if(pi(e))return Oq(e);if(ra(e))return Mq(e)}return"#"}function Nq(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Oq(e){return`/${e.resourceType}/${e.id}`}function Mq(e){return`/${e.reference}`}function Iq(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 Ja(e){const t=qt(e.value),n=t?Gi(t):e.alt??"",r=Iq(n),i=(t&&J8(t))??e.src,s=nA(i??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(gt,{to:t,children:a.jsx(zs,{src:s,alt:n,radius:c,...d,children:r})}):a.jsx(zs,{src:s,alt:n,radius:c,...d,children:r})}const Lq="_logoButton_189g3_1",$q="_user_189g3_11",zq="_userName_189g3_21",Uq="_userActive_189g3_31",ch={logoButton:Lq,user:$q,userName:zq,userActive:Uq};function Tb(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Ic(t,e.options)}):null}function Bq(e){const t=am(),{medplum:n,profile:r,navigate:i}=t,s=n.getLogins(),{colorScheme:c,setColorScheme:d}=RO();return a.jsxs(a.Fragment,{children:[a.jsxs(Ve,{align:"center",p:"xl",children:[a.jsx(Ja,{size:"xl",radius:100,value:t.profile}),a.jsx(Tb,{value:t.profile?.name?.[0]}),a.jsx(Pe,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),s.length>1&&a.jsx(Ce.Divider,{}),s.map(f=>f.profile.reference!==kt(t.profile)&&a.jsx(Ce.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:a.jsxs(ye,{children:[a.jsx(zs,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Pe,{size:"sm",fw:500,children:f.profile.display}),a.jsx(Pe,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(Ce.Divider,{}),a.jsx(ye,{justify:"center",children:a.jsx(jd,{size:"xs",value:c,onChange:f=>d(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(yq,{size:14,stroke:1.5}),onClick:()=>i("/signin"),children:"Add another account"}),a.jsx(Ce.Item,{leftSection:a.jsx(Yy,{size:14,stroke:1.5}),onClick:()=>i(`/${kt(r)}`),children:"Account settings"}),a.jsx(Ce.Item,{leftSection:a.jsx(MH,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),i("/signin")},children:"Sign out"}),a.jsx(Pe,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const FE={selectedItems:"selected-items",options:"options"};function Rb(e){const t=vd({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:i,error:s,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:x,onCreate:b,creatable:w,clearable:j,required:C,placeholder:E,leftSection:R,maxValues:T,optionsDropdownMaxHeight:_=320,minInputLength:P=0,...A}=e,M=A.disabled,I=Vq(c),[V,H]=v.useState(""),[Z,K]=v.useState(),[Q,B]=v.useState(),[W,N]=v.useState(),[L,$]=v.useState(I.map(d)),[q,O]=v.useState([]),F=p??Fq,te=m??Hq,ae=g??qq,je=v.useRef(V);je.current=V;const xe=v.useRef(void 0),we=v.useRef(void 0),Ge=v.useRef(Z);Ge.current=Z;const Ee=v.useRef(Q);Ee.current=Q;const ot=v.useRef(W);ot.current=W;const et=v.useRef(q);et.current=q;const Ct=v.useCallback(()=>{if(K(void 0),je.current===we.current&&f===xe.current||(je.current?.length??0)<P)return;we.current=je.current,xe.current=f;const _e=new AbortController;B(_e),f(je.current??"",_e.signal).then(he=>{_e.signal.aborted||(O(he.map(d)),ot.current?(he.length>0&&x(he.slice(0,1)),N(!1)):he.length>0&&t.openDropdown())}).catch(he=>{_e.signal.aborted||he.message.includes("aborted")||Ne({color:"red",message:Ke(he)})}).finally(()=>{_e.signal.aborted||B(void 0)})},[t,f,x,d,P]),Ot=v.useCallback(_e=>{(q&&q.length>0||w)&&t.openDropdown(),t.updateSelectedOptionIndex(),H(_e.currentTarget.value),Ee.current&&(Ee.current.abort(),B(void 0)),Ge.current!==void 0&&window.clearTimeout(Ge.current);const he=window.setTimeout(()=>Ct(),100);K(he)},[t,q,w,Ct]),Mt=v.useCallback(_e=>{const he=L.some(be=>be.value===_e),Se=he?L.filter(be=>be.value!==_e):[...L];let $e=q?.find(be=>be.value===_e);if(!$e&&w!==!1&&b){const be=b(_e);$e=d(be)}if($e){if(T===0){x([$e.resource]),L.length>0&&$([]);return}he||Se.push($e)}if(T!==void 0)for(;Se.length>T;)Se.shift();x(Se.map(be=>be.resource)),$(Se)},[w,q,L,T,x,b,d]),pt=v.useMemo(()=>{if(!M)return _e=>{M||(T===1&&(H(""),O([]),t.closeDropdown()),we.current=void 0,_e==="$create"?(H(""),Mt(V)):Mt(_e))}},[Mt,t,M,T,V]),Rt=v.useCallback(_e=>{const he=L.filter(Se=>Se.value!==_e.value);x(he.map(Se=>Se.resource)),$(he)},[L,x]),en=v.useCallback(_e=>{_e.key==="Enter"?(Z||Q)&&N(!0):_e.key==="Backspace"&&V.length===0&&(dn(_e),Rt(L[L.length-1]))},[Q,Rt,V.length,L,Z]);v.useEffect(()=>()=>{Ee.current&&Ee.current.abort()},[]);const Re=!M&&j&&L.length>0&&a.jsx(st.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{H(""),$([]),x([]),t.closeDropdown()}}),Ae=w&&V.trim().length>0,Qe=q.length>0||Ae;return a.jsxs(st,{store:t,onOptionSubmit:pt,withinPortal:!0,shadow:"xl",...A,children:[a.jsx(st.DropdownTarget,{children:a.jsx(yc,{label:r,description:i,error:s,className:e.className,leftSection:R,rightSection:Q?a.jsx(Dr,{size:16}):Re,required:C,disabled:M,children:a.jsxs(Us.Group,{"data-testid":FE.selectedItems,children:[L.map(_e=>a.jsx(te,{item:_e,disabled:M,onRemove:()=>Rt(_e)},_e.value)),!M&&(T===void 0||T===0||L.length<T)&&a.jsx(st.EventsTarget,{children:a.jsx(yc.Field,{role:"searchbox",name:n,value:V,placeholder:E,onFocus:Ot,onBlur:()=>{t.closeDropdown(),H("")},onKeyDown:en,onChange:Ot})})]})})}),a.jsx(st.Dropdown,{hidden:!Qe,"data-testid":FE.options,children:a.jsx(st.Options,{children:a.jsxs(wp,{type:"scroll",mah:_,children:[q.map(_e=>{const he=L.some(Se=>Se.value===_e.value);return a.jsx(st.Option,{value:_e.value,active:he,children:a.jsx(F,{..._e,active:he})},_e.value)}),Ae&&a.jsxs(st.Option,{value:"$create",children:["+ Create ",V]}),!w&&V.trim().length>0&&q.length===0&&a.jsx(ae,{search:V})]})})})]})}function Vq(e){return e?Array.isArray(e)?e:[e]:[]}function Fq(e){return a.jsxs(ye,{gap:"xs",children:[e.active&&a.jsx(oa,{size:12}),a.jsx("span",{children:e.label})]})}function Hq({item:e,disabled:t,onRemove:n}){return a.jsx(Us,{withRemoveButton:!t,onRemove:n,children:e.label})}function qq(){return a.jsx(st.Empty,{children:"Nothing found"})}const Gq="_searchInput_dick8_1",Wq={searchInput:Gq};function Qq(e){return{value:e.id,label:Gi(e),resource:e}}function Yq(e){const t=sm(),n=De(),r=v.useCallback(async(s,c)=>{const d=Xq(s),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return Zq(p,s)},[n]),i=v.useCallback(s=>{s.length>0&&t(`/${kt(s[0])}`)},[t]);return a.jsx(Rb,{size:"sm",radius:"md",className:Wq.searchInput,leftSection:a.jsx(cq,{size:16}),placeholder:"Search",itemComponent:Kq,toOption:Qq,onChange:i,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const Kq=v.forwardRef(({resource:e,active:t,...n},r)=>{let i;return e.resourceType==="Patient"?i=e.birthDate:e.resourceType==="ServiceRequest"&&(i=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(Ja,{value:e}),a.jsxs("div",{children:[a.jsx(Pe,{children:Gi(e)}),a.jsx(Pe,{size:"xs",c:"dimmed",children:i})]})]})})});function Xq(e){const t=JSON.stringify(e);return RD(e)?`{
467
+ Patients1: PatientList(_id: ${t}, _count: 1) {
468
+ resourceType
469
+ id
470
+ identifier {
471
+ system
472
+ value
473
+ }
474
+ name {
475
+ given
476
+ family
477
+ }
478
+ birthDate
479
+ }
480
+ ServiceRequestList(_id: ${t}, _count: 1) {
481
+ resourceType
482
+ id
483
+ identifier {
484
+ system
485
+ value
486
+ }
487
+ subject {
488
+ display
489
+ }
490
+ }
491
+ }`.replace(/\s+/g," "):`{
492
+ Patients1: PatientList(name: ${t}, _count: 5) {
493
+ resourceType
494
+ id
495
+ identifier {
496
+ system
497
+ value
498
+ }
499
+ name {
500
+ given
501
+ family
502
+ }
503
+ birthDate
504
+ }
505
+ Patients2: PatientList(identifier: ${t}, _count: 5) {
506
+ resourceType
507
+ id
508
+ identifier {
509
+ system
510
+ value
511
+ }
512
+ name {
513
+ given
514
+ family
515
+ }
516
+ birthDate
517
+ }
518
+ ServiceRequestList(identifier: ${t}, _count: 5) {
519
+ resourceType
520
+ id
521
+ identifier {
522
+ system
523
+ value
524
+ }
525
+ subject {
526
+ display
527
+ }
528
+ }
529
+ }`.replace(/\s+/g," ")}function Zq(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),eG(Jq(n),t).slice(0,5)}function Jq(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 eG(e,t){return e.sort((n,r)=>HE(r,t)-HE(n,t))}function HE(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,qE(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,qE(Ic(r),t));return n}function qE(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function tG(e){const t=lm(),[n,r]=v.useState(!1);return a.jsx(_r.Header,{p:8,style:{zIndex:101},children:a.jsxs(ye,{justify:"space-between",children:[a.jsxs(ye,{gap:"xs",children:[a.jsx(er,{className:ch.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(Yq,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(ye,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(Ce,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(Ce.Target,{children:a.jsx(er,{className:It(ch.user,{[ch.userActive]:n}),onClick:()=>r(i=>!i),children:a.jsxs(ye,{gap:7,children:[a.jsx(Ja,{value:t,radius:"xl",size:24}),a.jsx(Pe,{size:"sm",className:ch.userName,children:Ic(t?.name?.[0])}),a.jsx(wb,{size:12,stroke:1.5})]})})}),a.jsx(Ce.Dropdown,{children:a.jsx(Bq,{version:e.version})})]})]})]})})}const _b=v.createContext({submitting:!1});_b.displayName="FormContext";function nG(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?rG(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&oG(t,n);return t}function rG(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function oG(e,t){e[t.name]=t.value}function dt(e){const[t,n]=v.useState(!1);return a.jsx(_b.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const i=nG(r.target);if(e.onSubmit){n(!0);const s=e.onSubmit(i);s?.then?s.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function yr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(_b);return a.jsx(ke,{type:"submit",loading:r,...n,children:t})}function iG(e){const t=De(),n=t.getUserConfiguration();function r(i){const{menuname:s,bookmarkname:c}=i,d=`${e.pathname}?${e.searchParams.toString()}`,f=Qr(n);f.menu?.find(({title:m})=>m===s)?.link?.push({name:c,target:d}),t.updateResource(f).then(m=>{n.menu=m.menu,t.dispatchEvent({type:"change"}),Ne({color:"green",message:"Success"}),e.onOk()}).catch(m=>{Ne({color:"red",message:Ke(m)})})}return a.jsx(Vn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(dt,{onSubmit:r,children:a.jsxs(Ve,{children:[a.jsx(aG,{config:n}),a.jsx(ze,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yr,{mt:"sm",children:"OK"})})]})})})}function aG(e){function t(r){return r?.menu?.map(i=>i.title)}const n=t(e.config);return a.jsx(an,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function jA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function sG(e){return typeof e.display=="string"?e.display:jA(e)}function lG(e){return{value:jA(e),label:sG(e),resource:e}}function cG(e){return{code:e,display:e}}function um(e){const t=De(),{binding:n,creatable:r,clearable:i,expandParams:s,withHelpText:c,...d}=e,f=v.useCallback(async(p,m)=>{if(!n)return[];const x=(await t.valueSetExpand({...s,url:n,filter:p,count:10},{signal:m})).expansion?.contains??[],b=[];for(const w of x)w.code&&!b.some(j=>j.code===w.code)&&b.push(w);return b},[t,s,n]);return a.jsx(Rb,{...d,creatable:r??!0,clearable:i??!0,toOption:lG,loadOptions:f,onCreate:cG,itemComponent:c?uG:void 0})}const uG=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>a.jsx("div",{ref:i,...r,children:a.jsxs(ye,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(oa,{size:12}),a.jsxs("div",{children:[a.jsx(Pe,{children:e}),a.jsx(Pe,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function CA(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[s,c]=v.useState(t);function d(f){const p=f[0],m=fG(p);c(m),n&&n(m)}return a.jsx(um,{defaultValue:dG(s),onChange:d,withHelpText:r??!0,...i})}function dG(e){return e?{code:e}:void 0}function fG(e){return e?.code}function Db(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,i=v.useCallback(s=>{n(s),r&&r(s)},[r]);return a.jsx(CA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:i,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 hG="_menuTitle_9g6l5_1",pG="_link_9g6l5_9",mG="_linkActive_9g6l5_38",Ky={menuTitle:hG,link:pG,linkActive:mG};function gG(e){const t=sm(),n=xG(e.pathname,e.searchParams,e.menus),[r,i]=v.useState(!1);function s(d,f){d.stopPropagation(),d.preventDefault(),t(f),window.innerWidth<768&&e.closeNavbar()}function c(d){d&&t(`/${d}`)}return a.jsxs(a.Fragment,{children:[a.jsx(_r.Navbar,{children:a.jsxs(Kr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(_r.Section,{mb:"sm",children:a.jsx(Db,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>c(d)},window.location.pathname)}),a.jsxs(_r.Section,{grow:!0,children:[e.menus?.map(d=>a.jsxs(v.Fragment,{children:[a.jsx(Pe,{className:Ky.menuTitle,children:d.title}),d.links?.map(f=>a.jsxs(vG,{to:f.href,active:f.href===n?.href,onClick:p=>s(p,f.href),children:[a.jsx(yG,{icon:f.icon}),a.jsx("span",{children:f.label})]},f.href))]},`menu-${d.title}`)),e.displayAddBookmark&&a.jsx(ke,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(vA,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(iG,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function vG(e){return a.jsx(gt,{onClick:e.onClick,to:e.to,className:It(Ky.link,{[Ky.linkActive]:e.active}),children:e.children})}function yG(e){return e.icon?e.icon:a.jsx(Kp,{w:30})}function xG(e,t,n){if(!e||!t||!n)return;let r,i=0;for(const s of n)if(s.links)for(const c of s.links){const d=bG(e,t,c.href);d>i&&(i=d,r=c)}return r}function bG(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const i=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!i.includes(c)&&t.get(c)!==d)return 0;let s=1;for(const[c,d]of t.entries())i.includes(c)||r.searchParams.get(c)===d&&s++;return s}function SG(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=De(),i=lm();v.useEffect(()=>{function f(){Ne({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function s(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){s(!1)}function d(){s(!t)}return r.isLoading()?a.jsx(yo,{}):a.jsxs(_r,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!i||!t,mobile:!i||!t}},padding:0,children:[i&&a.jsx(tG,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:d,notifications:e.notifications}),i&&t?a.jsx(gG,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(_r.Main,{className:Pq.main,children:a.jsx(xA,{children:a.jsx(v.Suspense,{fallback:a.jsx(yo,{}),children:e.children})})})]})}const wG="https://ccda.medplum.com",jG="https://ccda-validator.medplum.com/";function CG(e){const{url:t}=e,[n,r]=v.useState(!1),i=v.useRef(null),[s,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&i.current&&(Gu(i.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),w=new FormData;w.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${jG}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:w,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const E=await C.json();c(E)}catch(x){c(void 0),console.error("CCDA validation error:",x)}finally{f(!1)}},m=()=>{if(!s)return;const x=JSON.stringify(s,null,2);wA(x,"ccda-validation-results")},g=()=>s?s.resultsMetaData.resultMetaData.filter(x=>x?.type.includes("Error")).reduce((x,b)=>x+(b.count||0),0):0;return t?a.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[a.jsx("div",{style:{minHeight:400},children:a.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:i,src:wG,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(ke,{type:"button",onClick:p,disabled:d,children:d?"Validating...":"Validate"}),s&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginLeft:"15px"},children:[a.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),a.jsx(ke,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function kd(e){const{contentType:t,url:n,title:r}=e.value??{},i=nA(n);return i?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:i,alt:r}),t?.startsWith("video/")&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:i})}),(t?.startsWith("text/")||t==="application/json"||t==="application/pdf")&&a.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:i+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===un.CDA_XML&&a.jsx(CG,{url:i}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Dt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:EG(r),children:r||"Download"})})]}):null}function EG(e){return e?.includes(".")?e:void 0}const TG="_root_17n8t_1",RG="_compact_17n8t_25",GE={root:TG,compact:RG};function dm(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:It(GE.root,{[GE.compact]:n}),children:t})}function mo(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function _G(e){const t=e.values?.map((r,i)=>a.jsx("div",{children:a.jsx(kd,{value:r,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(!Cn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(mo,{term:Hs(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function Ab(e){const t=De(),n=v.useRef(null);function r(c){dn(c),n.current?.click()}function i(c){dn(c);const d=c.target.files;d&&Array.from(d).forEach(s)}function s(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Ht(f))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>i(c)}),e.children({onClick:r,disabled:e.disabled})]})}function DG(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function i(s){n(s),e.onChange&&e.onChange(s)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((s,c)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(kd,{value:s,maxWidth:200})}),a.jsx("td",{children:a.jsx(_n,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{dn(d);const f=t.slice();f.splice(c,1),i(f)},children:a.jsx(Qh,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(Ab,{disabled:e.disabled,onUpload:s=>{i([...r.current,s])},children:s=>a.jsx(_n,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:a.jsx(jb,{})})})})]})]})]})}function EA(e){const[t,n]=v.useState(e.defaultValue);function r(i){n(i),e.onChange&&e.onChange(i)}return t?a.jsxs(a.Fragment,{children:[a.jsx(kd,{value:t,maxWidth:200}),a.jsx(ke,{disabled:e.disabled,onClick:i=>{dn(i),r(void 0)},children:"Remove"})]}):a.jsx(Ab,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:i=>a.jsx(ke,{...i,children:"Upload..."})})}const AG="_root_1vii2_1",PG={root:AG};function Nd(e){const{children:t,...n}=e;return a.jsx(yd,{className:PG.root,...n,children:t})}const kG="_paper_1igaj_1",NG="_fill_1igaj_20",WE={paper:kG,fill:NG};function Lc(e){const{width:t,fill:n,className:r,children:i,...s}=e,c=t?{maxWidth:t}:void 0;return a.jsx(mr,{className:It(WE.paper,n&&WE.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...s,children:i})}function lt(e){const{children:t,...n}=e;return a.jsx(Nd,{children:a.jsx(Lc,{...n,children:t})})}function Co(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),a.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),a.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),a.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),a.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function At(e,t){return e?.issue?.filter(n=>TA(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
530
+ `)}function $c(e,t){return e?.issue?.filter(n=>TA(n.expression?.[0],t))}const uh=/\[\d+\]/;function TA(e,t){const n=typeof e=="string"&&uh.test(e),r=typeof t=="string"&&uh.test(t);if(n!==r&&(e=e?.replace(uh,""),t=t?.replace(uh,"")),e===t)return!0;if(!e||!t)return!1;const i=e.indexOf(".");if(i>=0&&e.substring(i+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function RA(e){const t=De(),[n,r]=v.useState();return a.jsxs(dt,{onSubmit:async i=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:i.projectName}))}catch(s){r(Ht(s))}},children:[a.jsxs(Yn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Create project"})]}),a.jsxs(Ve,{gap:"xl",children:[a.jsx(ze,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:At(n,"projectName")}),a.jsxs(Pe,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Dt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Dt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(yr,{children:"Create project"})})]})}function _A(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 DA(e){const t=De(),{googleClientId:n,handleGoogleCredential:r}=e,i=v.useRef(null),[s,c]=v.useState(typeof google<"u"),[d,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){_A("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),i.current&&!p&&(google.accounts.id.renderButton(i.current,{}),m(!0))},[t,n,d,s,i,p,r]),n?a.jsx("div",{ref:i}):null}function AA(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 Nr(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx(Ji,{icon:a.jsx(il,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:dD(n)},n.details?.text))})}function PA(e){typeof grecaptcha>"u"&&_A("https://www.google.com/recaptcha/api.js?render="+e)}function kA(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function OG(e){const t=AA(e.googleClientId),n=e.recaptchaSiteKey,r=De(),[i,s]=v.useState(),c=$c(i,void 0);return v.useEffect(()=>{n&&PA(n)},[n]),a.jsxs(dt,{onSubmit:async d=>{s(void 0);try{let f="";n&&(f=await kA(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:d.firstName,lastName:d.lastName,email:d.email,password:d.password,remember:d.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){s(Ht(f))}},children:[a.jsx(Yn,{style:{flexDirection:"column"},children:e.children}),a.jsx(Nr,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(DA,{googleClientId:t,handleGoogleCredential:async d=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:d.clientId,googleCredential:d.credential,projectId:e.projectId,createUser:!0}))}catch(f){s(Ht(f))}}})}),a.jsx(wn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Ve,{gap:"xl",children:[a.jsx(ze,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:At(i,"firstName")}),a.jsx(ze,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:At(i,"lastName")}),a.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:At(i,"email")}),a.jsx(Oo,{name:"password",label:"Password",autoComplete:"off",required:!0,error:At(i,"password")}),a.jsxs(Pe,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Dt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Dt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(Pe,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Dt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Dt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Un,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(yr,{children:"Create account"})]})]})}function MG(e){const{type:t,projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,onSuccess:c}=e,d=De(),[f,p]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&d.startNewPatient({login:f,projectId:n}).then(b=>d.processCode(b.code)).then(()=>c()).catch(b=>g(Ht(b)))},[d,t,n,f,c]);function x(b){b.code?d.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return a.jsxs(lt,{width:450,children:[m&&a.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&a.jsx(OG,{projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,handleAuthResponse:x,children:e.children}),f&&t==="project"&&a.jsx(RA,{login:f,handleAuthResponse:x})]})}function IG(e){const[t,n]=v.useState();return t?a.jsx($G,{email:t,...e}):a.jsx(LG,{setEmail:n,...e})}function LG(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:i,disableEmailAuth:s,...c}=e,d=De(),f=!e.disableGoogleAuth&&AA(e.googleClientId),[p,m]=v.useState(),g=$c(p,void 0),x=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),E=new URL(j.authorizeUrl);return E.searchParams.set("state",C),window.location.assign(E.toString()),!0},[d,c]),b=v.useCallback(async j=>{const C=await d.post("auth/method",{email:j.email});await x(C)||t(j.email)},[d,x,t]),w=v.useCallback(async j=>{try{const C=await d.startGoogleLogin({...c,googleCredential:j.credential});await x(C)||r(C)}catch(C){m(Ht(C))}},[d,c,x,r]);return a.jsxs(dt,{onSubmit:b,children:[a.jsx(Yn,{style:{flexDirection:"column"},children:i}),a.jsx(Nr,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(DA,{googleClientId:f,handleGoogleCredential:w})}),!s&&a.jsx(wn,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&a.jsx(ze,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:At(p,"email")}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Dt,{component:"button",type:"button",c:"dimmed",onClick:n,size:"xs","data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:"Register"})}),!s&&a.jsx(yr,{children:"Next"})]})]})}function $G(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...i}=e,s=De(),[c,d]=v.useState(),f=$c(c,void 0),p=v.useCallback(m=>{s.startLogin({...i,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Ht(g)))},[s,i,n]);return a.jsxs(dt,{onSubmit:p,children:[a.jsx(Yn,{style:{flexDirection:"column"},children:r}),a.jsx(Nr,{issues:f}),a.jsx(Ve,{gap:"xl",children:a.jsx(Oo,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:At(c,"password")})}),a.jsxs(ye,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Dt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(Un,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(yr,{children:"Sign in"})]})]})}function zG(e){const t=De(),n=vd(),[r,i]=v.useState(""),[s,c]=v.useState();function d(g){return!!g?.toLowerCase()?.includes(r.toLowerCase())}function f(g){return d(g.profile?.display)||d(g.project?.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(x=>c(Ht(x)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(st.Option,{value:g.id,children:a.jsx(UG,{...g})},g.id));return a.jsxs(Ve,{children:[a.jsxs(Ha,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Co,{size:32}),a.jsx(Ie,{order:3,children:"Choose profile"})]}),a.jsx(Nr,{outcome:s}),a.jsxs(st,{store:n,onOptionSubmit:p,children:[a.jsx(st.EventsTarget,{children:a.jsx(ze,{placeholder:"Search",value:r,onChange:g=>{i(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(st.Options,{children:m.length>0?m:a.jsx(st.Empty,{children:"Nothing found..."})})})]})]})}function UG(e){return a.jsxs(ye,{children:[a.jsx(zs,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(Pe,{fz:"sm",fw:500,children:e.profile?.display}),a.jsx(Pe,{fz:"xs",opacity:.6,children:e.project?.display})]})]})}const BG=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,VG="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",FG="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",HG="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",qG=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,GG="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",WG="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",QG="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",YG="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",KG="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",XG="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function ZG(e){const t=De();return a.jsx(dt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Ve,{children:[a.jsxs(Yn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Choose scope"})]}),a.jsx(Ve,{children:(e.scope??"openid").split(" ").map(n=>{let r;return BG.test(n)?r=[n+VG,n+FG,n+HG]:qG.test(n)&&(r=[n+GG,n+WG,n+QG,n+YG,n+KG,n+XG]),a.jsxs(a.Fragment,{children:[a.jsx(Un,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(i=>a.jsx(Un,{id:i,name:i,label:i},i))]},n+"_group")})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(yr,{children:"Set scope"})})]})})}function NA(e){const[t,n]=v.useState();return a.jsx(dt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(i=>n(Ke(i)))},children:a.jsxs(Ve,{children:[a.jsxs(Yn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Enter MFA code"})]}),t&&a.jsx(Ji,{icon:a.jsx(il,{size:16}),title:"Error",color:"red",children:t}),a.jsx(Ve,{children:a.jsx(ze,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(yr,{children:"Submit code"})})]})})}function OA(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:i,onRegister:s,onCode:c,...d}=e,f=De(),[p,m]=v.useState(),g=v.useRef(!1),[x,b]=v.useState(!1),[w,j]=v.useState(),C=v.useCallback(T=>{c?c(T):f.processCode(T).then(()=>{r&&r()}).catch(_=>Ne({color:"red",message:Ke(_)}))},[f,c,r]),E=v.useCallback(T=>{b(!!T.mfaRequired),T.login&&m(T.login),T.memberships&&j(T.memberships),T.code&&(n?j(void 0):C(T.code))},[n,C]),R=v.useCallback(T=>{C(T.code)},[C]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(E).catch(T=>Ne({color:"red",message:Ke(T)})))},[f,t,g,p,E]),a.jsx(lt,{width:450,px:"sm",py:"md",children:p?x?a.jsx(NA,{onSubmit:async T=>{const _=await f.post("auth/mfa/verify",{login:p,token:T.token});E(_)}}):w?a.jsx(zG,{login:p,memberships:w,handleAuthResponse:E}):e.projectId==="new"?a.jsx(RA,{login:p,handleAuthResponse:E}):e.chooseScopes?a.jsx(ZG,{login:p,scope:e.scope,handleAuthResponse:R}):a.jsx("div",{children:"Success"}):a.jsx(IG,{onForgotPassword:i,onRegister:s,handleAuthResponse:E,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function ii(e){return a.jsx(a.Fragment,{children:qa(e.value)})}function JG(e){return a.jsx(a.Fragment,{children:Dd(e.value)})}function MA(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function eW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(MA,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function fm(e,t,n){const r=bc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function tW(e,t,n){const r=vD(e,t,n);return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function nW(e){const{elementDefinitionType:t}=e,n=De(),r=v.useContext(sn),[i,s]=v.useState(mD("Extension")),c=v.useMemo(()=>{if(Cn(t?.profile))return t.profile[0]},[t]),[d,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=Mc(c);f(!1),g&&s(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!tb(c)))return a.jsx("div",{children:"Loading..."});if(i.elements["value[x]"]?.max!==0){const[g,x]=fm({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx($o,{propertyType:x,value:g})}return a.jsx(Kh,{path:e.path,value:{type:i.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function rW(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function oW(e){return a.jsx(a.Fragment,{children:EU(e.value)})}function ad(e){return a.jsx(a.Fragment,{children:Ns(e.value)})}function Pb(e){return a.jsx(a.Fragment,{children:od(e.value)})}function iW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(ad,{value:t.numerator})," / ",a.jsx(ad,{value:t.denominator})]}):null}function Xy(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Lo(e.value);return e.link!==!1&&e.value.reference?a.jsx(gt,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function IA(e,t,n,r){if(!Cn(n?.slices))return[e];const i=new Array(t.length+1);for(let s=0;s<i.length;s++)i[s]=[];for(const s of e){const c=ZD(s,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),i[d].push(s)}return i}async function LA({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const i=[],s=[],c=[];for(const d of t.slicing.slices){if(!XD(d)){console.debug("Unsupported slice definition",d);continue}let f;Cn(d.elements)||(f=d.type[0]?.profile?.[0]),i.push(d),s.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<i.length;d++){const f=i[d],p=s[d];if(p){const m=Mc(p);f.typeSchema=m}}n(i)}).catch(r)})}function hm(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function aW(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,i=v.useContext(sn),s=v.useMemo(()=>{if(Cn(r))return Sc({parentContext:i,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[i,e.path,t.typeSchema?.url,r]);return hm(sn.Provider,s,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx($o,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${d}-${e.value.length}`))}))}const QE=50;function sW(e){const{property:t,propertyType:n}=e,r=De(),i=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[i]),[g,x]=v.useState(0),b=v.useContext(sn);if(v.useEffect(()=>{LA({medplum:r,property:t}).then(C=>{x(i.length),f(C);const E=i.slice(0,QE),R=IA(E,C,t.slicing,b.profileUrl);m(R),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,i]),s)return a.jsx("div",{children:"Loading..."});let w;if(t.type[0]?.code!=="Extension"){const C=p[d.length],E=C.map((R,T)=>a.jsx("div",{children:a.jsx($o,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:R,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${T}-${C.length}`));if(e.includeDescriptionListEntry){if(!Cn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const R=e.path.split(".").pop();w=a.jsx(mo,{term:Hs(R),children:E})}else w=a.jsx(a.Fragment,{children:E})}return a.jsxs(a.Fragment,{children:[d.map((C,E)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let R=a.jsx(aW,{path:e.path,slice:C,property:t,value:p[E],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(R=a.jsx(mo,{term:Hs(C.name),children:R},C.name)),R}),w,g>QE&&a.jsx(ye,{justify:"right",children:a.jsxs(Pe,{children:["... ",g," total values"]})})]})}function $o(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(ce,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!En(r)&&a.jsx(v_,{value:r,timeout:2e3,children:({copied:s,copy:c})=>a.jsx(nl,{label:s?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(_n,{variant:"subtle",color:s?"teal":"gray",onClick:c,children:s?a.jsx(oa,{size:"1rem"}):a.jsx(hA,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?a.jsx(_G,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(sW,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return a.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 a.jsx(a.Fragment,{children:r});case re.canonical:return a.jsx(Xy,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return a.jsx(a.Fragment,{children:sr(r)});case re.markdown:return a.jsx("pre",{children:r});case re.Address:return a.jsx(jF,{value:r});case re.Annotation:return a.jsx(a.Fragment,{children:r?.text});case re.Attachment:return a.jsx(kd,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return a.jsx(ii,{value:r});case re.Coding:return a.jsx(JG,{value:r});case re.ContactDetail:return a.jsx(eW,{value:r});case re.ContactPoint:return a.jsx(MA,{value:r});case re.HumanName:return a.jsx(Tb,{value:r});case re.Identifier:return a.jsx(rW,{value:r});case re.Money:return a.jsx(oW,{value:r});case re.Period:return a.jsx(a.Fragment,{children:bU(r)});case re.Quantity:case re.Duration:return a.jsx(ad,{value:r});case re.Range:return a.jsx(Pb,{value:r});case re.Ratio:return a.jsx(iW,{value:r});case re.Reference:return a.jsx(Xy,{value:r,link:e.link});case re.Timing:return a.jsx(a.Fragment,{children:OD(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Kh,{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 a.jsx(nW,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Kh,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const $A=["extension","modifierExtension"],lW=dA.filter(e=>!$A.includes(e));function Kh(e){const t=e.value,{value:n,type:r}=t,i=v.useContext(sn),s=e.profileUrl??i?.profileUrl,c=v.useMemo(()=>Zp(r,s),[s,r]),d=v.useMemo(()=>{if(c)return Sc({parentContext:i,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,i,e.path,e.accessPolicyResource]);if(En(n))return null;if(!c)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const f=d??i;return hm(sn.Provider,d,a.jsx(dm,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if($A.includes(p)&&En(m.slicing?.slices))return null;if(lW.includes(p))return null;if(fA.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,x]=fm(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&En(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,w=a.jsx($o,{property:m,propertyType:x,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?w:a.jsx(mo,{term:Hs(p),children:w},p)})}))}const cW="_dimmed_11me5_1",uW="_preserveBreaks_11me5_5",Zy={dimmed:cW,preserveBreaks:uW},zA="Read Only";function UA(e,t){return e?a.jsx(nl.Floating,{label:e,children:t}):t}function BA(e){const{debugMode:t}=v.useContext(sn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e?.readonly?zA:void 0,a.jsxs(ye,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?Zy.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Nt(e){const{debugMode:t}=v.useContext(sn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,UA(e?.readonly?zA:void 0,a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:It({[Zy.dimmed]:e?.readonly},Zy.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:At(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function dW(e,t,n,r,i){const s=r.type;if(s.length>1)for(const c of s){const d=t.replace("[x]",Mn(c.code));d in e&&delete e[d]}return En(i)?e[n]=void 0:e[n]=i,e}function fW(e){return!!e&&!En(e.url)&&!En(e.name)}function hW(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:i,path:s,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const x=mW(g);p(x),n&&n(x)}return a.jsx(um,{defaultValue:f&&pW(f),onChange:m,withHelpText:r??!0,...d})}function pW(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function mW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function gW(e){const{defaultValue:t,onChange:n,withHelpText:r,response:i,...s}=e,[c,d]=v.useState(i?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&yW(m);d(g),n&&n(g)}return a.jsx(um,{defaultValue:c?vW(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...s})}function vW(e){return{system:e.system,code:e.code,display:e.display}}function yW(e){return{system:e.system,code:e.code,display:e.display}}function VA(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:i}=v.useContext(sn),[s,c]=v.useState(e.defaultValue),d=v.useRef(s);d.current=s;const[f,p,m]=v.useMemo(()=>["system","use","value"].map(T=>r[t+"."+T]),[r,t]),[g,x,b]=v.useMemo(()=>["system","use","value"].map(T=>i(t+"."+T)),[i,t]);function w(T){T&&Object.keys(T).length===0&&(T=void 0),c(T),e.onChange&&e.onChange(T)}function j(T){const _={...d.current,system:T};T||delete _.system,w(_)}function C(T){const _={...d.current,use:T};T||delete _.use,w(_)}function E(T){const _={...d.current,value:T};T||delete _.value,w(_)}const R=e.valuePath??t;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(an,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:s?.system,required:(f?.min??0)>0,onChange:T=>j(T.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:At(n,R+".system")}),a.jsx(an,{disabled:e.disabled||x?.readonly,"data-testid":"use",defaultValue:s?.use,required:(p?.min??0)>0,onChange:T=>C(T.currentTarget.value),data:["","home","work","temp","old","mobile"],error:At(n,R+".use")}),a.jsx(ze,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:s?.value,required:(m?.min??0)>0,onChange:T=>E(T.currentTarget.value),error:At(n,R+".value")})]})}function xW(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:i}=v.useContext(sn),[s,c]=v.useMemo(()=>["name","telecom"].map(m=>i(e.path+"."+m)),[i,e.path]);function d(m){n(m),e.onChange&&e.onChange(m)}function f(m){const g={...r.current,name:m};m||delete g.name,d(g)}function p(m){const g={...r.current,telecom:m&&[m]};m||delete g.telecom,d(g)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ze,{disabled:e.disabled||s?.readonly,"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t?.name,onChange:m=>f(m.currentTarget.value)}),a.jsx(VA,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function bW(e){if(!e)return"";const t=new Date(e);return em(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function kb(e){if(!e)return"";const t=new Date(e);return em(t)?t.toISOString():""}function ai(e){return a.jsx(ze,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:SW(),step:1,defaultValue:bW(e.defaultValue),autoFocus:e.autoFocus,error:At(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(kb(n))}}})}function SW(){return"datetime-local"}function wW(e){const{propertyType:t}=e,n=De(),r=v.useMemo(()=>{if(Cn(t.profile))return t.profile[0]},[t]),[i,s]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(s(!0),n.requestProfileSchema(r).then(()=>s(!1)).catch(c=>{s(!1),console.warn(c)}))},[n,r]),r&&(i||!tb(r))?a.jsx("div",{children:"Loading..."}):a.jsx(Ib,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function jW(e){const{outcome:t,path:n}=e,[r,i]=v.useState(e.defaultValue),{getExtendedProps:s}=v.useContext(sn),[c,d,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(R=>s(e.path+"."+R)),[s,e.path]);function g(R){i(R),e.onChange&&e.onChange(R)}function x(R){g({...r,use:R||void 0})}function b(R){g({...r,prefix:R?R.split(" "):void 0})}function w(R){g({...r,given:R?R.split(" "):void 0})}function j(R){g({...r,family:R||void 0})}function C(R){g({...r,suffix:R?R.split(" "):void 0})}const E=e.valuePath??n;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(an,{disabled:e.disabled||c?.readonly,defaultValue:r?.use,name:e.name+"-use","data-testid":"use",onChange:R=>x(R.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:At(t,E+".use")}),a.jsx(ze,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:R=>b(R.currentTarget.value),error:At(t,E+".prefix")}),a.jsx(ze,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:R=>w(R.currentTarget.value),error:At(t,E+".given")}),a.jsx(ze,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:R=>j(R.currentTarget.value),error:At(t,E+".family")}),a.jsx(ze,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:R=>C(R.currentTarget.value),error:At(t,E+".suffix")})]})}function CW(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:i}=v.useContext(sn),[s,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[d,f]=v.useMemo(()=>["system","value"].map(g=>i(e.path+"."+g)),[i,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(ze,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(s?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:At(e.outcome,m+".system")}),a.jsx(ze,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:At(e.outcome,m+".value")})]})}const EW=["USD","EUR","CAD","GBP","AUD"];function TW(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:i}=v.useContext(sn),[s,c]=v.useMemo(()=>["currency","value"].map(g=>i(e.path+"."+g)),[i,e.path]),d=v.useCallback(g=>{r(g),t&&t(g)},[t]),f=v.useCallback(g=>{d({...n,currency:g.currentTarget.value})},[n,d]),p=v.useCallback(g=>{d({...n,value:g.currentTarget.valueAsNumber})},[n,d]),m=a.jsx(an,{disabled:e.disabled||s?.readonly,defaultValue:n?.currency,data:EW,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(ze,{disabled:e.disabled||c?.readonly,type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:n?.value?.toString()??"USD",leftSection:a.jsx(fH,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function RW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(sn),[i,s]=v.useMemo(()=>["start","end"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ai,{disabled:e.disabled||i?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(ai,{disabled:e.disabled||s?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function Ws(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(sn),[i,s,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function d(f){n(f),e.onChange&&e.onChange(f)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(an,{disabled:e.disabled||i?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(ze,{disabled:e.disabled||s?.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?.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{d({...t,value:_W(f.currentTarget.value)})}}),a.jsx(ze,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function _W(e){if(e)return parseFloat(e)}function Nb(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(sn),[i,s]=v.useMemo(()=>["low","high"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ws,{path:e.path+".low",disabled:e.disabled||i?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(Ws,{path:e.path+".high",disabled:e.disabled||s?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function DW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(sn),[i,s]=v.useMemo(()=>["numerator","denominator"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ws,{path:e.path+".numerator",disabled:e.disabled||i?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(Ws,{path:e.path+".denominator",disabled:e.disabled||s?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const AW={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},PW=["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 kW(e){return{value:kt(e)??"",label:Gi(e),resource:e}}function al(e){const t=De(),{resourceType:n,searchCriteria:r}=e,[i,s]=v.useState(),c=qt(e.defaultValue,s),d=e.itemComponent??NW,f=e.onChange,p=v.useCallback(async(g,x)=>{const b=OW(n),w=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,w,{signal:x})},[t,n,r]),m=v.useCallback(g=>{f&&f(g[0])},[f]);return Cn(e.defaultValue)&&!i&&!c?null:a.jsx(Rb,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:d,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:kW,loadOptions:p,onChange:m,clearable:!0})}const NW=v.forwardRef(({label:e,resource:t,active:n,...r},i)=>a.jsx("div",{ref:i,...r,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(Ja,{value:t}),a.jsxs("div",{children:[a.jsx(Pe,{children:e}),a.jsx(Pe,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function OW(e){return AW[e]??(PW.includes(e)?"name":"_id")}function Od(e){const{onChange:t}=e,n=De(),[r,i]=v.useState(e.defaultValue),[s,c]=v.useState(()=>MW(e.targetTypes)),[d,f]=v.useState(()=>IW(e.defaultValue,s)),p=v.useRef(new sD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const w=s?.map(j=>{if(!$W(j))return Promise.resolve(j);b=!0;const C=j.value,E=p.current.get(C);if(E)return E;const R=LW(n,j.value).then(_=>{const P={...j};return _?Cn(_.type)?(P.resourceType=_.type,P.name=_.name,P.title=_.title):(console.error(`StructureDefinition.type missing for ${j.value}`),P.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),P.error="StructureDefinition not found"),P}).catch(_=>(console.error(_),{...j,error:_})),T=new Ao(R);return p.current.set(C,T),T});!w||!b||Promise.all(w).then(j=>{if(c(j),!d)return;const C=j.findIndex(E=>E.value===d.value||E.resourceType===d.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${d.resourceType}`);return}f(j[C])}).catch(console.error)},[n,d,s]);const g=v.useCallback(b=>{const w=b?Jt(b):void 0;i(w),t&&t(w)},[t]),x=v.useMemo(()=>s?s.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[s]);return a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&a.jsx(an,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:d?.resourceType,autoFocus:e.autoFocus,onChange:b=>{const w=b.currentTarget.value,j=s.find(C=>C.value===w);f(j)},data:x}),!s&&a.jsx(Db,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:d?.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(al,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function MW(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 IW(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(i=>i.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function LW(e,t){const n=Mc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
531
+ StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
532
+ type,
533
+ name,
534
+ title,
535
+ }
536
+ }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function $W(e){return e.type==="profile"&&!e?.error&&En(e.resourceType)}function zW(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const UW="_indented_ldk1d_1",FA={indented:UW};function Ob({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(ke,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(Yh,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(_n,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(Yh,{size:"1.25rem"})})}function HA({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(_n,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(Qh,{size:"1.25rem"})})}function BW(e){const{slice:t,property:n}=e,[r,i]=v.useState(e.defaultValue),s=t.typeSchema?.elements??t.elements,c=v.useContext(sn),d=v.useMemo(()=>{if(Cn(s))return Sc({parentContext:c,elements:s,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,s]);function f(b){i(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=En(t.elements),g=LD(t.name),x=e.property.readonly&&r.length===0;return hm(sn.Provider,d,a.jsx(Nt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:x?a.jsx(Pe,{c:"dimmed",children:"(empty)"}):a.jsxs(Ve,{className:m?FA.indented:void 0,children:[r.map((b,w)=>a.jsxs(ye,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${w}`,children:a.jsx(Mb,{elementDefinitionType:t.type[0],name:t.name,defaultValue:b,onChange:j=>{const C=[...r];C[w]=j,f(C)},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&&a.jsx(HA,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${w}`,onClick:j=>{dn(j);const C=[...r];C.splice(w,1),f(C)}})]},`${w}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(Ob,{propertyDisplayName:g,onClick:b=>{dn(b);const w=[...r,void 0];f(w)},testId:e.testId&&`${e.testId}-add`})})]})}))}function VW(e){const{property:t}=e,n=De(),[r,i]=v.useState(!0),[s,c]=v.useState([]),[d]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[d]),m=v.useContext(sn),g=t.type[0]?.code;v.useEffect(()=>{LA({medplum:n,property:t}).then(R=>{c(R);const T=IA(d,R,t.slicing,m.profileUrl);FW(T,R),p(T),i(!1)}).catch(R=>{console.error(R),i(!1)})},[n,t,d,m.profileUrl,p]);function x(R,T){const _=[...f];if(_[T]=R,p(_),e.onChange){const P=_.flat().filter(A=>A!==void 0);e.onChange(P)}}if(r)return a.jsx("div",{children:"Loading..."});const b=s.length,w=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&s.length>0)),C=Hs(t.path),E=e.property.readonly&&s.length===0&&d.length===0;return a.jsxs(Ve,{className:e.indent?FA.indented:void 0,children:[E&&a.jsx(Pe,{c:"dimmed",children:"(empty)"}),s.map((R,T)=>a.jsx(BW,{slice:R,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[T],onChange:_=>{x(_,T)},testId:`slice-${R.name}`},R.name)),j&&w.map((R,T)=>a.jsxs(ye,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Md,{arrayElement:!0,property:e.property,name:e.name+"."+T,path:e.path,valuePath:zW(e.path,e.valuePath,T),defaultValue:R,onChange:_=>{const P=[...w];P[T]=_,x(P,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(HA,{propertyDisplayName:C,testId:`nonsliced-remove-${T}`,onClick:_=>{dn(_);const P=[...w];P.splice(T,1),x(P,b)}})]},`${T}-${w.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(Ob,{propertyDisplayName:C,onClick:R=>{dn(R);const T=[...w];T.push(void 0),x(T,b)},testId:"nonsliced-add"})})]})}function FW(e,t){for(let n=0;n<t.length;n++){const r=t[n],i=e[n];for(;i.length<r.min;)i.push(void 0)}}function HW(e){const[t,n]=v.useState(!1),r=gR(),i=v.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),a.jsxs(Ha,{gap:"xs",children:[a.jsx(tl,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:i,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(_n,{title:"Copy secret",onClick:()=>{r.copy(i.current?.value),Ne({color:"green",message:"Copied"})},children:a.jsx(hA,{})})]})}const qW=["sun","mon","tue","wed","thu","fri","sat"];function GW(e){const[t,n]=v.useState(e.defaultValue),[r,i]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=v.useRef(t);return s.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:OD(s.current)||"No repeat"}),a.jsx(ke,{disabled:e.disabled,onClick:()=>i(!0),children:"Edit"})]}),!e.disabled&&a.jsx(WW,{path:e.path,visible:r,defaultValue:s.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),i(!1)},onCancel:()=>i(!1)})]})}const YE={repeat:{period:1,periodUnit:"d"}};function WW(e){const[t,n]=v.useState(e.defaultValue||YE),{getExtendedProps:r}=v.useContext(sn),[i,s,c,d,f]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=v.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function x(j){g({...p.current?.repeat,period:j})}function b(j){g({...p.current?.repeat,periodUnit:j})}function w(j){g({...p.current?.repeat,dayOfWeek:j})}return a.jsx(Vn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(ai,{disabled:i?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(Cd,{disabled:s?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?YE.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(Nt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(ze,{disabled:c?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>x(parseInt(j.currentTarget.value,10)||1)}),a.jsx(an,{disabled:d?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&a.jsx(Nt,{title:"Repeat on",children:a.jsx(Zu.Group,{multiple:!0,onChange:w,children:a.jsx(ye,{justify:"space-between",mt:"md",gap:"xs",children:qW.map(j=>a.jsx(Zu,{value:j,size:"xs",radius:"xl",disabled:f?.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Md(e){const{property:t,name:n,onChange:r,defaultValue:i}=e,s=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(s===re.Attachment)return a.jsx(DG,{name:n,defaultValue:i,onChange:r,disabled:t.readonly});const d=c[0]?.code!==re.Extension;return a.jsx(VW,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:i,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(QW,{elementDefinitionTypes:c,...e}):a.jsx(Mb,{name:n,defaultValue:i,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",Mn(c[0].code));e.onChange(d,f)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function QW(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,i]=v.useState(n);return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(an,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{i(t.find(c=>c.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),a.jsx(Mb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,e.name.replace("[x]",Mn(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 Mb(e){const{name:t,onChange:n,outcome:r,binding:i,path:s,valuePath:c,readOnly:d}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(sn),g=v.useMemo(()=>{if(!ib(p)||!En(e.defaultValue))return e.defaultValue;const w=Object.create(null);if(m.path===e.path)kE(w,m.elements);else{const j=ks(m.path,e.path);if(j===void 0)return e.defaultValue;kE(w,m.elements,j)}return Cn(w)?w:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return a.jsx("div",{children:"Property type not specified "});function x(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:s,valuePath:c,disabled:d}}function b(){const w=At(e.outcome,c??s);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:w,disabled:d}}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]"?a.jsx(HW,{...b(),onChange:w=>{e.onChange&&e.onChange(w.currentTarget.value)}}):a.jsx(ze,{...b(),onChange:w=>{n&&n(w.currentTarget.value)}});case re.date:return a.jsx(ze,{...b(),type:"date",onChange:w=>{n&&n(w.currentTarget.value)}});case re.dateTime:case re.instant:return a.jsx(ai,{...b(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return a.jsx(ze,{...b(),type:"number",step:p===re.decimal?"any":"1",onChange:w=>{if(n){const j=w.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case re.code:return a.jsx(CA,{...b(),error:void 0,onChange:n,binding:i?.valueSet,creatable:!0,maxValues:1});case re.boolean:return a.jsx(Un,{...b(),defaultChecked:!!g,onChange:w=>{n&&n(w.currentTarget.checked)}});case re.base64Binary:case re.markdown:return a.jsx(tl,{...b(),spellCheck:p!==re.base64Binary,onChange:w=>{n&&n(w.currentTarget.value)}});case re.Address:return a.jsx(TF,{...x()});case re.Annotation:return a.jsx(RF,{...x()});case re.Attachment:return a.jsx(EA,{...x()});case re.CodeableConcept:return a.jsx(hW,{binding:i?.valueSet,...x()});case re.Coding:return a.jsx(gW,{binding:i?.valueSet,...x()});case re.ContactDetail:return a.jsx(xW,{...x()});case re.ContactPoint:return a.jsx(VA,{...x()});case re.Extension:return a.jsx(wW,{...x(),propertyType:e.elementDefinitionType});case re.HumanName:return a.jsx(jW,{...x()});case re.Identifier:return a.jsx(CW,{...x()});case re.Money:return a.jsx(TW,{...x()});case re.Period:return a.jsx(RW,{...x()});case re.Duration:case re.Quantity:return a.jsx(Ws,{...x()});case re.Range:return a.jsx(Nb,{...x()});case re.Ratio:return a.jsx(DW,{...x()});case re.Reference:return a.jsx(Od,{...x(),targetTypes:KW(e.elementDefinitionType)});case re.Timing:return a.jsx(GW,{...x()});case re.Dosage:case re.UsageContext:default:return a.jsx(Ib,{...x(),typeName:p})}}const YW=[`${Uo}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function KW(e){return e?.targetProfile?.map(t=>{const n=YW.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function XW(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(sn),i=v.useMemo(()=>EF(r.elements),[r.elements]);function s(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Ve,{style:{flexGrow:1},"data-testid":e.testId,children:i.map(([d,f])=>{const[p,m]=tW(c,d,f),g=f.min!==void 0&&f.min>0,x=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(Md,{property:f,name:d,path:e.path+"."+d,valuePath:x,defaultValue:p,defaultPropertyType:m,onChange:(w,j)=>{s(dW({...t},d,j??d,f,w))},outcome:e.outcome},d);return e.type==="Extension"||Sb.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(BA,{title:Hs(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx(Nt,{title:Hs(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:x,readonly:f.readonly,children:b},d)})})}function Ib(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(sn),r=e.profileUrl??n?.profileUrl,i=v.useMemo(()=>Zp(e.typeName,r),[e.typeName,r]),s=i?.type??e.typeName,c=v.useMemo(()=>{if(i)return Sc({parentContext:n,elements:i.elements,path:e.path,profileUrl:i.url,accessPolicyResource:e.accessPolicyResource})},[i,n,e.path,e.accessPolicyResource]);return i?hm(sn.Provider,c,a.jsx(XW,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[s," not implemented"]})}const ZW="_noteCite_10swh_5",JW="_noteRoot_10swh_10",KE={noteCite:ZW,noteRoot:JW};function qA({value:e}){return e?a.jsx(Ve,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(g0,{classNames:{cite:KE.noteCite,root:KE.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function sl(e){const{value:t,link:n,...r}=e,[i,s]=v.useState(),c=qt(t,s);let d;if(i&&!cD(i))d=`[${Ke(i)}]`;else if(c)d=Gi(c);else return null;return n?a.jsx(gt,{to:t,...r,children:d}):a.jsx(Pe,{component:"span",...r,children:d})}function uc(e){return a.jsxs(ye,{gap:"xs",children:[a.jsx(Ja,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(sl,{value:e.value,link:e.link})]})}const eQ={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 pm(e){const{status:t,...n}=e;return a.jsx(Ap,{color:e.color||eQ[t],...n,children:t.replace(/-/g," ")})}const tQ="_table_pe9td_1",nQ="_criticalRow_pe9td_12",GA={table:tQ,criticalRow:nQ};Lb.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function Lb(e){const t=De(),n=qt(e.value),[r,i]=v.useState();if(v.useEffect(()=>{n?.specimen&&Promise.allSettled(n.specimen.map(c=>t.readReference(c))).then(c=>c.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(i).catch(console.error)},[t,n]),!n)return null;const s=r?.flatMap(c=>c.note||[])||[];if(n.presentedForm&&n.presentedForm.length>0){const c=n.presentedForm[0];c.contentType?.startsWith("text/plain")&&c.data&&s.push({text:window.atob(c.data)})}return a.jsxs(Ve,{children:[a.jsx(Ie,{children:"Diagnostic Report"}),a.jsx(rQ,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&oQ(r),n.result&&a.jsx(iQ,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&a.jsx(qA,{value:s})]})}function rQ({value:e,hideSubject:t=!1}){return a.jsxs(ye,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(uc,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(uc,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(uc,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(Pe,{children:sr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(Pe,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(pm,{status:e.status})]})]})}function oQ(e){return a.jsxs(Ve,{gap:"xs",children:[a.jsx(Ie,{order:2,size:"h6",children:"Specimens"}),a.jsx(pr,{type:"ordered",children:e?.map(t=>a.jsx(pr.Item,{ml:"sm",children:a.jsxs(ye,{gap:20,children:[a.jsxs(ye,{gap:5,children:[a.jsx(Pe,{fw:500,children:"Collected:"})," ",sr(t.collection?.collectedDateTime)]}),a.jsxs(ye,{gap:5,children:[a.jsx(Pe,{fw:500,children:"Received:"})," ",sr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function iQ(e){return a.jsxs("table",{className:GA.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(WA,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function WA(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(aQ,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${ra(t)?t.reference:t.id}`))})}function aQ(e){const t=qt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=cQ(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:It({[GA.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(gt,{to:t,children:a.jsx(ii,{value:t.code})})}),a.jsx("td",{children:a.jsx(sQ,{value:t})}),a.jsx("td",{children:a.jsx(lQ,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(ii,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(i=>a.jsx("div",{children:a.jsx(ii,{value:i})},`category-${qa(i)}`))})}),a.jsx("td",{children:t.performer?.map(i=>a.jsx(Xy,{value:i},i.reference))}),a.jsx("td",{children:t.status&&a.jsx(pm,{status:t.status})})]}),t.hasMember&&a.jsx(WA,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(qA,{value:t.note})})})]})}function sQ(e){const t=e.value;return a.jsx(a.Fragment,{children:MD(t)})}function lQ(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(Pb,{value:t}):null}function cQ(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var oy={},$i={},XE;function QA(){if(XE)return $i;XE=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.Pointer=$i.escapeToken=$i.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}$i.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}$i.escapeToken=t;var n=(function(){function r(i){i===void 0&&(i=[""]),this.tokens=i}return r.fromJSON=function(i){var s=i.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(i));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(i){for(var s=null,c="",d=i,f=1,p=this.tokens.length;f<p;f++)s=d,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(d=(s||{})[c]);return{parent:s,key:c,value:d}},r.prototype.get=function(i){return this.evaluate(i).value},r.prototype.set=function(i,s){var c=this.evaluate(i);c.parent&&(c.parent[c.key]=s)},r.prototype.push=function(i){this.tokens.push(i)},r.prototype.add=function(i){var s=this.tokens.concat(String(i));return new r(s)},r})();return $i.Pointer=n,$i}var hn={},iy={},ZE;function YA(){return ZE||(ZE=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(i){return i===void 0?"undefined":i===null?"null":Array.isArray(i)?"array":typeof i}e.objectType=t;function n(i){return i!=null&&typeof i=="object"}function r(i){if(!n(i))return i;if(i.constructor==Array){for(var s=i.length,c=new Array(s),d=0;d<s;d++)c[d]=r(i[d]);return c}if(i.constructor==Date){var f=new Date(+i);return f}var p={};for(var m in i)e.hasOwnProperty.call(i,m)&&(p[m]=r(i[m]));return p}e.clone=r})(iy)),iy}var fr={},JE;function KA(){if(JE)return fr;JE=1,Object.defineProperty(fr,"__esModule",{value:!0}),fr.diffAny=fr.diffObjects=fr.diffArrays=fr.intersection=fr.subtract=fr.isDestructive=void 0;var e=YA();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}fr.isDestructive=t;function n(m,g){var x={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(x[b]=1);for(var w in g)e.hasOwnProperty.call(g,w)&&g[w]!==void 0&&delete x[w];return Object.keys(x)}fr.subtract=n;function r(m){for(var g=m.length,x={},b=0;b<g;b++){var w=m[b];for(var j in w)e.hasOwnProperty.call(w,j)&&w[j]!==void 0&&(x[j]=(x[j]||0)+1)}for(var j in x)x[j]<g&&delete x[j];return Object.keys(x)}fr.intersection=r;function i(m){return m.op==="add"}function s(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function d(m,g,x,b){b===void 0&&(b=p);var w={"0,0":{operations:[],cost:0}};function j(_,P){var A="".concat(_,",").concat(P),M=w[A];if(M===void 0){if(_>0&&P>0&&!b(m[_-1],g[P-1],x.add(String(_-1))).length)M=j(_-1,P-1);else{var I=[];if(_>0){var V=j(_-1,P),H={op:"remove",index:_-1};I.push(c(V,H))}if(P>0){var Z=j(_,P-1),K={op:"add",index:_-1,value:g[P-1]};I.push(c(Z,K))}if(_>0&&P>0){var Q=j(_-1,P-1),B={op:"replace",index:_-1,original:m[_-1],value:g[P-1]};I.push(c(Q,B))}var W=I.sort(function(N,L){return N.cost-L.cost})[0];M=W}w[A]=M}return M}var C=isNaN(m.length)||m.length<=0?0:m.length,E=isNaN(g.length)||g.length<=0?0:g.length,R=j(C,E).operations,T=R.reduce(function(_,P){var A=_[0],M=_[1];if(i(P)){var I=P.index+1+M,V=I<C+M?String(I):"-",H={op:P.op,path:x.add(V).toString(),value:P.value};return[A.concat(H),M+1]}else if(s(P)){var H={op:P.op,path:x.add(String(P.index+M)).toString()};return[A.concat(H),M-1]}else{var Z=x.add(String(P.index+M)),K=b(P.original,P.value,Z);return[A.concat.apply(A,K),M]}},[[],0])[0];return T}fr.diffArrays=d;function f(m,g,x,b){b===void 0&&(b=p);var w=[];return n(m,g).forEach(function(j){w.push({op:"remove",path:x.add(j).toString()})}),n(g,m).forEach(function(j){w.push({op:"add",path:x.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){w.push.apply(w,b(m[j],g[j],x.add(j)))}),w}fr.diffObjects=f;function p(m,g,x,b){if(b===void 0&&(b=p),m===g)return[];var w=(0,e.objectType)(m),j=(0,e.objectType)(g);return w=="array"&&j=="array"?d(m,g,x,b):w=="object"&&j=="object"?f(m,g,x,b):[{op:"replace",path:x.toString(),value:g}]}return fr.diffAny=p,fr}var eT;function uQ(){if(eT)return hn;eT=1;var e=hn&&hn.__extends||(function(){var C=function(E,R){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,_){T.__proto__=_}||function(T,_){for(var P in _)Object.prototype.hasOwnProperty.call(_,P)&&(T[P]=_[P])},C(E,R)};return function(E,R){if(typeof R!="function"&&R!==null)throw new TypeError("Class extends value "+String(R)+" is not a constructor or null");C(E,R);function T(){this.constructor=E}E.prototype=R===null?Object.create(R):(T.prototype=R.prototype,new T)}})();Object.defineProperty(hn,"__esModule",{value:!0}),hn.apply=hn.InvalidOperationError=hn.test=hn.copy=hn.move=hn.replace=hn.remove=hn.add=hn.TestError=hn.MissingError=void 0;var t=QA(),n=YA(),r=KA(),i=(function(C){e(E,C);function E(R){var T=C.call(this,"Value required at path: ".concat(R))||this;return T.path=R,T.name="MissingError",T}return E})(Error);hn.MissingError=i;var s=(function(C){e(E,C);function E(R,T){var _=C.call(this,"Test failed: ".concat(R," != ").concat(T))||this;return _.actual=R,_.expected=T,_.name="TestError",_}return E})(Error);hn.TestError=s;function c(C,E,R){if(Array.isArray(C))if(E=="-")C.push(R);else{var T=parseInt(E,10);C.splice(T,0,R)}else C[E]=R}function d(C,E){if(Array.isArray(C)){var R=parseInt(E,10);C.splice(R,1)}else delete C[E]}function f(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);return R.parent===void 0?new i(E.path):(c(R.parent,R.key,(0,n.clone)(E.value)),null)}hn.add=f;function p(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);return R.value===void 0?new i(E.path):(d(R.parent,R.key),null)}hn.remove=p;function m(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);if(R.parent===null)return new i(E.path);if(Array.isArray(R.parent)){if(parseInt(R.key,10)>=R.parent.length)return new i(E.path)}else if(R.value===void 0)return new i(E.path);return R.parent[R.key]=(0,n.clone)(E.value),null}hn.replace=m;function g(C,E){var R=t.Pointer.fromJSON(E.from).evaluate(C);if(R.value===void 0)return new i(E.from);var T=t.Pointer.fromJSON(E.path).evaluate(C);return T.parent===void 0?new i(E.path):(d(R.parent,R.key),c(T.parent,T.key,R.value),null)}hn.move=g;function x(C,E){var R=t.Pointer.fromJSON(E.from).evaluate(C);if(R.value===void 0)return new i(E.from);var T=t.Pointer.fromJSON(E.path).evaluate(C);return T.parent===void 0?new i(E.path):(c(T.parent,T.key,(0,n.clone)(R.value)),null)}hn.copy=x;function b(C,E){var R=t.Pointer.fromJSON(E.path).evaluate(C);return(0,r.diffAny)(R.value,E.value,new t.Pointer).length?new s(R.value,E.value):null}hn.test=b;var w=(function(C){e(E,C);function E(R){var T=C.call(this,"Invalid operation: ".concat(R.op))||this;return T.operation=R,T.name="InvalidOperationError",T}return E})(Error);hn.InvalidOperationError=w;function j(C,E){switch(E.op){case"add":return f(C,E);case"remove":return p(C,E);case"replace":return m(C,E);case"move":return g(C,E);case"copy":return x(C,E);case"test":return b(C,E)}return new w(E)}return hn.apply=j,hn}var tT;function dQ(){return tT||(tT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=QA();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=uQ(),r=KA();function i(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=i;function s(p){function m(g,x,b){var w=p(g,x,b);return Array.isArray(w)?w:(0,r.diffAny)(g,x,b,m)}return m}function c(p,m,g){var x=new t.Pointer;return(g?s(g):r.diffAny)(p,m,x)}e.createPatch=c;function d(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(x){var b=d(p,x.path);if(b&&g.push(b),"from"in x){var w=d(p,x.from);w&&g.push(w)}}),g}e.createTests=f})(oy)),oy}var XA=dQ();const fQ="_removed_el5zk_1",hQ="_added_el5zk_6",nT={removed:fQ,added:hQ};function pQ(e){const{name:t,path:n,property:r,originalValue:i,revisedValue:s}=e,c=!!r?.type?.find(m=>m.code==="Attachment"),[d,f]=v.useState(c),p=()=>f(m=>!m);return a.jsx(a.Fragment,{children:c&&!d||!c?a.jsx(a.Fragment,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:t}),a.jsx(ve.Td,{className:nT.removed,children:i&&a.jsx($o,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})}),a.jsx(ve.Td,{className:nT.added,children:s&&a.jsx($o,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:t}),a.jsx(ve.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(ke,{onClick:p,variant:"light",children:"Expand"})})]})})}const mQ="_root_15xvr_1",gQ={root:mQ};function vQ(e){const t=De(),{original:n,revised:r}=e,[i,s]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>s(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!i)return null;const d=[Wr(n)],f=[Wr(r)],p=[],m=yQ(XA.createPatch(n,r));for(const g of m){const x=g.path,b=xQ(x),w=bQ(n.resourceType,b),j=g.op==="add"?void 0:Ga(b,d),C=g.op==="remove"?void 0:Ga(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${Mn(g.op)} ${b}`,path:w?.path??n.resourceType+"."+b,property:w,originalValue:rT(w,j),revisedValue:rT(w,C)})}return p},[i,n,r]);return c?a.jsxs(ve,{className:gQ.root,children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Th,{}),a.jsx(ve.Th,{children:"Before"}),a.jsx(ve.Th,{children:"After"})]})}),a.jsx(ve.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(pQ,{...p},f)})})]}):null}function yQ(e){const t=[];for(const n of e){const{op:r,path:i}=n;if(i.startsWith("/meta/author")||i.startsWith("/meta/compartment")||i.startsWith("/meta/lastUpdated")||i.startsWith("/meta/versionId"))continue;const s=e.filter(d=>d.op===r&&d.path===i).length,c={op:r,path:i};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(i)&&(c.op="replace",c.path=i.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function xQ(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const i=t[r];i==="-"?n+=".last()":/^\d+$/.test(i)?n+=`[${i}]`:(r>0&&(n+="."),n+=i)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function bQ(e,t){return im(e,{code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}function rT(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:SQ(t,!!e?.isArray)}}function SQ(e,t){const n=fU(e).flatMap(r=>r.value);return t?n:n[0]}function $b(e){const{profileUrl:t}=e,n=De(),r=n.getAccessPolicy(),i=qt(e.value),[s,c]=v.useState(!1);v.useEffect(()=>{if(i)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Mc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=i.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,i]);const d=v.useMemo(()=>i&&VD(i,Os.READ,r),[r,i]);return!s||!i?null:a.jsx(Kh,{path:i.resourceType,value:{type:i.resourceType,value:e.forceUseInput?e.value:i},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const wQ="_item_5q6yx_1",jQ="_itemPadding_5q6yx_5",oT={item:wQ,itemPadding:jQ};function CQ(e){return a.jsx(Nd,{children:e.children})}function Qs(e){const{resource:t,profile:n,padding:r,popupMenuItems:i,...s}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs(Lc,{"data-testid":"timeline-item",fill:!0,...s,children:[a.jsxs(ye,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(Ja,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Pe,{size:"sm",children:a.jsx(sl,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(Pe,{size:"xs",children:[a.jsx(gt,{c:"dimmed",to:e.resource,children:sr(d)}),a.jsx(Pe,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(gt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),i&&a.jsxs(Ce,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(Ce.Target,{children:a.jsx(_n,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${kt(e.resource)}`,children:a.jsx(gH,{})})}),i]})]}),a.jsx(xA,{children:a.jsx("div",{className:It(oT.item,{[oT.itemPadding]:r}),children:e.children})})]})}function ZA(e,t){e.sort((n,r)=>{const i=iT(n,t),s=iT(r,t);return i>s?1:i<s?-1:aT(n,t)-aT(r,t)})}function iT(e,t){if(!JA(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function aT(e,t){if(!JA(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=e.meta?.lastUpdated;return n?new Date(n).getTime():0}function JA(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const EQ="_pinnedComment_u08s5_1",TQ={pinnedComment:EQ};function mm(e){const t=De(),n=t.getProfile(),r=v.useRef(null),i=qt(e.value),[s,c]=v.useState(),[d,f]=v.useState([]),[p,m]=v.useState(10),g=e.loadTimelineResources,x=v.useRef(d);x.current=d;const b=v.useCallback(M=>{ZA(M,i),M.reverse(),f(M)},[i]),w=v.useCallback(M=>{const I=[];for(const V of M){if(V.status!=="fulfilled")continue;const H=V.value;if(H.type==="history"&&c(H),H.entry)for(const Z of H.entry)I.push(Z.resource)}b(I)},[b]),j=v.useCallback(M=>b([...x.current,M]),[b]),C=v.useCallback(()=>{let M,I;"resourceType"in e.value?(M=e.value.resourceType,I=e.value.id):[M,I]=e.value.reference?.split("/"),g(t,M,I).then(w).catch(console.error)},[t,e.value,g,w]);v.useEffect(()=>C(),[C]);function E(M){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,M)).then(I=>j(I)).catch(console.error)}function R(M){!i||!e.createMedia||t.createResource(e.createMedia(i,n,M)).then(I=>j(I)).then(()=>As({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(oa,{size:16}),autoClose:2e3})).catch(I=>As({id:"upload-notification",color:"red",title:"Upload error",message:Ke(I),icon:a.jsx(zE,{size:16}),autoClose:2e3}))}function T(){Ne({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(M){As({id:"upload-notification",loading:!0,title:"Uploading...",message:NQ(M),autoClose:!1,withCloseButton:!1})}function P(M){As({id:"upload-notification",color:"red",title:"Upload error",message:Ke(M),icon:a.jsx(zE,{size:16}),autoClose:2e3})}if(!i)return a.jsx(Yn,{style:{width:"100%",height:"100%"},children:a.jsx(Dr,{})});const A=d.filter(M=>M).slice(0,p);return a.jsxs(CQ,{children:[e.createCommunication&&a.jsx(Lc,{children:a.jsx(dt,{testid:"timeline-form",onSubmit:M=>{E(M.text);const I=r.current;I&&(I.value="",I.focus())},children:a.jsxs(ye,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(Ja,{value:n}),a.jsx(ze,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(_n,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(zH,{size:16})}),a.jsx(Ab,{securityContext:Jt(i),onUpload:R,onUploadStart:T,onUploadProgress:_,onUploadError:P,children:M=>a.jsx(_n,{...M,radius:"xl",color:"blue",variant:"filled",children:a.jsx(jb,{size:16})})})]})})}),A.map(M=>{const I=`${M.resourceType}/${M.id}/${M.meta?.versionId}`,V=e.getMenu?e.getMenu({primaryResource:i,currentResource:M,reloadTimeline:C}):void 0;if(M.resourceType===i.resourceType&&M.id===i.id)return a.jsx(RQ,{history:s,resource:M,popupMenuItems:V},I);switch(M.resourceType){case"AuditEvent":return a.jsx(PQ,{resource:M,popupMenuItems:V},I);case"Communication":return a.jsx(DQ,{resource:M,popupMenuItems:V},I);case"DiagnosticReport":return a.jsx(kQ,{resource:M,popupMenuItems:V},I);case"Media":return a.jsx(AQ,{resource:M,popupMenuItems:V},I);default:return a.jsx(Qs,{resource:M,padding:!0,children:a.jsx($b,{value:M,ignoreMissingValues:!0})},I)}}),p<d.length&&a.jsx(ye,{justify:"center",pb:"lg",children:a.jsx(ke,{onClick:()=>m(p+10),children:"Show More"})})]})}function RQ(e){const{history:t,resource:n,...r}=e,i=_Q(t,n);return i?a.jsx(Qs,{resource:n,padding:!0,...r,children:a.jsx(vQ,{original:i,revised:e.resource})}):a.jsxs(Qs,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx($b,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function _Q(e,t){const n=e.entry??[],r=n.findIndex(i=>i.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function DQ(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:TQ.pinnedComment;return a.jsx(Qs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:a.jsx("p",{children:e.resource.payload?.[0]?.contentString})})}function AQ(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(Qs,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(kd,{value:e.resource.content})})}function PQ(e){return a.jsx(Qs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Kr,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function kQ(e){return a.jsx(Qs,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(Lb,{value:e.resource})})}function NQ(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${ay(e.loaded)} / ${ay(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${ay(e.loaded)}`}function ay(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 OQ(e){const{resource:t,...n}=e;return a.jsx(mm,{value:t,loadTimelineResources:async(r,i,s)=>{const c=`${i}/${s}`;return Promise.allSettled([r.readHistory(i,s),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function MQ(e){const{encounter:t,...n}=e;return a.jsx(mm,{value:t,loadTimelineResources:async(r,i,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",encounter:Jt(r),subject:r.subject,sender:Jt(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",encounter:Jt(r),subject:r.subject,operator:Jt(i),issued:new Date().toISOString(),content:s}),...n})}function IQ(e){let t;try{t=oB(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx($o,{value:t[0]||"",propertyType:e.propertyType})}function LQ(e){return a.jsxs(Vn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(ce,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(sT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(sT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(Pe,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function sT(e){return a.jsx(ke,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const $Q={string:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],fulltext:[ue.EQUALS,ue.NOT,ue.CONTAINS,ue.EXACT],token:[ue.EQUALS,ue.NOT],reference:[ue.EQUALS,ue.NOT],numeric:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],quantity:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS],date:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],datetime:[ue.EQUALS,ue.NOT_EQUALS,ue.GREATER_THAN,ue.LESS_THAN,ue.GREATER_THAN_OR_EQUALS,ue.LESS_THAN_OR_EQUALS,ue.STARTS_AFTER,ue.ENDS_BEFORE,ue.APPROXIMATELY],uri:[ue.EQUALS,ue.NOT,ue.ABOVE,ue.BELOW]},zQ={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 zb(e,t){return{...e,filters:t,offset:0,name:void 0}}function eP(e,t){return zb(e,(e.filters??[]).filter(n=>n.code!==t))}function gm(e,t,n,r,i){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),zb(e,s)}function UQ(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function BQ(e,t){return Ub(e,t,-1)}function VQ(e,t){return Ub(e,t,0)}function FQ(e,t){return Ub(e,t,1)}function Ub(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setDate(i.getDate()+1),i.setTime(i.getTime()-1),vm(e,t,r,i)}function HQ(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return vm(e,t,n,r)}function qQ(e,t){return Bb(e,t,-1)}function GQ(e,t){return Bb(e,t,0)}function WQ(e,t){return Bb(e,t,1)}function Bb(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setMonth(i.getMonth()+1),i.setDate(1),i.setHours(0,0,0,0),i.setTime(i.getTime()-1),vm(e,t,r,i)}function QQ(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),vm(e,t,n,new Date)}function vm(e,t,n,r){return e=eP(e,t),e=lT(e,t,ue.GREATER_THAN_OR_EQUALS,n),e=lT(e,t,ue.LESS_THAN_OR_EQUALS,r),e}function lT(e,t,n,r){return gm(e,t,n,r.toISOString())}function cT(e,t,n=!0){return gm(e,t,ue.MISSING,n.toString())}function YQ(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function KQ(e,t){const n=e.count??tm,r=(t-1)*n;return YQ(e,r)}function XQ(e,t,n){return t===ZQ(e)&&n!==void 0&&n===JQ(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function ZQ(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function JQ(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function eY(e){return $Q[e.type]}function tP(e){return zQ[e]??""}function Ys(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(Mn).join(" "))}function tY(e,t){const n=t.name;return n==="id"?a.jsx(gt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?sr(e.meta?.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?nY(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?rY(e,t.searchParams[0]):null}function nY(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,i]=fm({type:e.resourceType,value:e},n);return r?a.jsx($o,{path:t.path,property:t,propertyType:i,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function rY(e,t){const n=Ga(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,i)=>a.jsx($o,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${i}-${n.length}`))})}function oY(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(Lo(e.search))}),[i,s]=v.useState(!1);v.useEffect(()=>{r({search:e.search})},[e.search]);const c=v.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=mD(f),m=sb(f);return rd(iY(p,m)).map(g=>({value:g,label:Ys(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Vn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=i},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Ve,{children:[a.jsx(Up,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:d,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function iY(e,t){const n=[],r=new Set,i=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),i.add(Ys(s));if(t)for(const s of Object.keys(t)){const c=Ys(s);!r.has(s)&&!i.has(c)&&(n.push(s),r.add(s),i.add(c))}return n}function nP(e){const t=im(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case rr.REFERENCE:return a.jsx(Od,{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 rr.BOOLEAN:return a.jsx(Un,{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 rr.DATE:return a.jsx(ze,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case rr.DATETIME:return a.jsx(ai,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case rr.NUMBER:return a.jsx(ze,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case rr.QUANTITY:return a.jsx(Ws,{name:n,path:"",defaultValue:aY(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(ze,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function aY(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function sY(e){const[t,n]=v.useState(Qr(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(Qr(e.search))},[e.search]);function i(f){n(gm(r.current,f.code,f.operator,f.value))}const s=e.search.resourceType,c=sb(s)??{},d=t.filters||[];return a.jsx(Vn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(dt,{onSubmit:()=>e.onOk(r.current),children:[a.jsxs("div",{children:[a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:40}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:d.map((f,p)=>a.jsx(lY,{id:`filter-${p}-row`,resourceType:s,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(zb(r.current,g))},onDelete:()=>n(UQ(r.current,p))},`filter-${p}-row`))})]}),a.jsx(Ob,{propertyDisplayName:"Filter",onClick:()=>i({})})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(yr,{children:"OK"})})]})})}function lY(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=ue.EQUALS,n.current.value="",e.onChange(n.current)}function i(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function s(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],d=c&&eY(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(an,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:Ys(f)}))]})}),a.jsx("td",{children:d&&a.jsx(an,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>i(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:tP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(nP,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:s},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),a.jsx("td",{children:e.onDelete&&a.jsx(_n,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(Gs,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function cY(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Vn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(dt,{onSubmit:r,children:a.jsxs(ir,{children:[a.jsx(ir.Col,{span:10,children:a.jsx(nP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(ir.Col,{span:2,children:a.jsx(ke,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function uY(e){const{resourceType:t,filter:n}=e,r=ci.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===ue.EQUALS||n.operator===ue.NOT_EQUALS))return a.jsx(sl,{value:{reference:n.value}});const i=im(t,r);if(n.code==="_lastUpdated"||i.type===rr.DATETIME)return a.jsx(a.Fragment,{children:sr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function dY(e){if(!e.searchParams)return null;function t(s,c){i(XQ(e.search,s.code,c))}function n(s){i(eP(e.search,s.code))}function r(s,c){e.onPrompt(s,{code:s.code,operator:c,value:""})}function i(s){e.onChange(s)}return e.searchParams.length===1?a.jsx(fY,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:i,onClear:n}):a.jsx(Ce.Dropdown,{children:e.searchParams.map(s=>a.jsx(Ce.Item,{children:Ys(s.code)},s.code))})}function fY(e){switch(e.searchParam.type){case"date":return a.jsx(hY,{...e});case"number":case"quantity":return a.jsx(pY,{...e});case"reference":return a.jsx(mY,{...e});case"string":return a.jsx(gY,{...e});case"token":case"uri":return a.jsx(vY,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function hY(e){const{searchParam:t}=e,n=t.code;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Cb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(Ce.Item,{leftSection:a.jsx(Eb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.ENDS_BEFORE),children:"Before..."}),a.jsx(Ce.Item,{leftSection:a.jsx(mA,{size:14}),onClick:()=>e.onPrompt(t,ue.STARTS_AFTER),children:"After..."}),a.jsx(Ce.Item,{leftSection:a.jsx(FF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Between..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(FQ(e.search,n)),children:"Tomorrow"}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(VQ(e.search,n)),children:"Today"}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(BQ(e.search,n)),children:"Yesterday"}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(HQ(e.search,n)),children:"Next 24 Hours"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(WQ(e.search,n)),children:"Next Month"}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(GQ(e.search,n)),children:"This Month"}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(qQ(e.search,n)),children:"Last Month"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Na,{size:14}),onClick:()=>e.onChange(QQ(e.search,n)),children:"Year to date"}),a.jsx(Id,{...e})]})}function pY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Cb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(Ce.Item,{leftSection:a.jsx(Eb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT_EQUALS),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(mA,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN),children:"Greater than..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Yy,{size:14}),onClick:()=>e.onPrompt(t,ue.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(Ce.Item,{leftSection:a.jsx(gA,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN),children:"Less than..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Yy,{size:14}),onClick:()=>e.onPrompt(t,ue.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Id,{...e})]})}function mY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Id,{...e})]})}function gY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Cb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(Ce.Item,{leftSection:a.jsx(Eb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(YF,{size:14}),onClick:()=>e.onPrompt(t,ue.CONTAINS),children:"Contains..."}),a.jsx(Ce.Item,{leftSection:a.jsx(WF,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Does not contain..."}),a.jsx(Id,{...e})]})}function vY(e){const{searchParam:t}=e;return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Item,{leftSection:a.jsx(Pd,{size:14}),onClick:()=>e.onPrompt(t,ue.EQUALS),children:"Equals..."}),a.jsx(Ce.Item,{leftSection:a.jsx(Ad,{size:14}),onClick:()=>e.onPrompt(t,ue.NOT),children:"Does not equal..."}),a.jsx(Id,{...e})]})}function Id(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(zF,{size:14}),onClick:()=>e.onChange(cT(e.search,n)),children:"Missing"}),a.jsx(Ce.Item,{leftSection:a.jsx(LF,{size:14}),onClick:()=>e.onChange(cT(e.search,n,!1)),children:"Not missing"}),a.jsx(Ce.Divider,{}),a.jsx(Ce.Item,{leftSection:a.jsx(Gs,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function rP(e){switch(e){case"next":return{"aria-label":"Next page"};case"previous":return{"aria-label":"Previous page"};case"first":return{"aria-label":"First page"};case"last":return{"aria-label":"Last page"};default:return{}}}const yY="_root_vlout_1",xY="_table_vlout_8",bY="_tr_vlout_12",SY="_control_vlout_22",wY="_icon_vlout_31",Lu={root:yY,table:xY,tr:bY,control:SY,icon:wY};function jY(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(CY(t,r));return n}function CY(e,t){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=Za(e,t),r=DU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=sb(e);let s;if(i){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);s=Object.values(i).filter(d=>!!d.expression&&c.test(d?.expression)),s.length===0&&(s=void 0)}return{name:t,elementDefinition:n,searchParams:s}}if(r){const i=im(e,r);return{name:t,elementDefinition:i.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class EY extends Event{constructor(t){super("change"),this.definition=t}}class TY extends Event{constructor(t){super("load"),this.response=t}}class Xh extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function zc(e){const t=De(),[n,r]=v.useState(),{search:i,onLoad:s}=e,[c,d]=v.useState(i);li(i,c)||d(i);const[f,p]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",x=v.useCallback(B=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,Va({...c,total:g,fields:void 0}),B)).then(W=>{p({...m.current,searchResponse:W}),s&&s(new TY(W))}).catch(W=>{p({...m.current,searchResponse:void 0}),r(Ht(W))})},[t,c,g,s]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),x({cache:"reload"})},[x]);v.useEffect(()=>{x()},[x]);function w(B,W){B.stopPropagation();const L=B.target.checked,$={...m.current.selected};L?$[W]=!0:delete $[W],p({...m.current,selected:$})}function j(B){B.stopPropagation();const N=B.target.checked,L={},$=m.current.searchResponse;N&&$?.entry&&$.entry.forEach(q=>{q.resource?.id&&(L[q.resource.id]=!0)}),p({...m.current,selected:L})}function C(){const B=m.current;if(!B.searchResponse?.entry||B.searchResponse.entry.length===0)return!1;for(const W of B.searchResponse.entry)if(W.resource?.id&&!B.selected[W.resource.id])return!1;return!0}function E(B){e.onChange&&e.onChange(new EY(B))}function R(B,W){if(SA(B.target)||B.button===2)return;dn(B);const N=bA(B);!N&&e.onClick&&e.onClick(new Xh(W,B)),N&&e.onAuxClick&&e.onAuxClick(new Xh(W,B))}function T(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(Nr,{outcome:n});if(!pD(c.resourceType))return a.jsx(Yn,{style:{width:"100%",height:"100%"},children:a.jsx(Dr,{})});const _=e.checkboxesEnabled,P=jY(c),A=c.resourceType,M=f.searchResponse,V=M?.entry?.map(B=>B.resource),H="subtle",Z="gray",K=16,Q=window.innerWidth<768;return a.jsxs("div",{className:Lu.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(ye,{justify:"space-between",mb:"xl",children:[a.jsxs(ye,{gap:2,children:[a.jsx(ke,{size:"compact-md",variant:H,color:Z,leftSection:a.jsx(cH,{size:K}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(ke,{size:"compact-md",variant:H,color:Z,leftSection:a.jsx(CH,{size:K}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(ke,{size:"compact-md",variant:H,color:Z,leftSection:a.jsx(wH,{size:K}),onClick:e.onNew,children:"New..."}),!Q&&T()&&a.jsx(ke,{size:"compact-md",variant:H,color:Z,leftSection:a.jsx(bq,{size:K}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Q&&e.onDelete&&a.jsx(ke,{size:"compact-md",variant:H,color:Z,leftSection:a.jsx(cm,{size:K}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Q&&e.onBulk&&a.jsx(ke,{size:"compact-md",variant:H,color:Z,leftSection:a.jsx(BF,{size:K}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(ye,{gap:2,children:[M&&a.jsxs(Pe,{size:"xs",c:"dimmed","data-testid":"count-display",children:[oP(c,M).toLocaleString(),"-",PY(c,M).toLocaleString(),M.total!==void 0&&` of ${c.total==="estimate"?"~":""}${M.total?.toLocaleString()}`]}),a.jsx(_n,{variant:H,color:Z,title:"Refresh",onClick:b,children:a.jsx(yA,{size:K})})]})]}),a.jsxs(ve,{className:Lu.table,children:[a.jsxs(ve.Thead,{children:[a.jsxs(ve.Tr,{children:[_&&a.jsx(ve.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:B=>j(B)})}),P.map(B=>a.jsx(ve.Th,{children:a.jsxs(Ce,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(Ce.Target,{children:a.jsx(er,{className:Lu.control,p:2,children:a.jsxs(ye,{justify:"space-between",wrap:"nowrap",children:[a.jsx(Pe,{fw:500,children:Ys(B.name)}),a.jsx(Yn,{className:Lu.icon,children:a.jsx(AF,{size:14,stroke:1.5})})]})})}),a.jsx(dY,{search:c,searchParams:B.searchParams,onPrompt:(W,N)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:W,filterDialogFilter:N,dialogOpenTime:Date.now()})},onChange:W=>{E(W)}})]})},B.name))]}),!e.hideFilters&&a.jsxs(ve.Tr,{children:[_&&a.jsx(ve.Th,{}),P.map(B=>a.jsx(ve.Th,{children:B.searchParams&&a.jsx(_Y,{resourceType:A,searchParams:B.searchParams,filters:c.filters})},B.name))]})]}),a.jsx(ve.Tbody,{children:V?.map(B=>B&&a.jsxs(ve.Tr,{className:Lu.tr,"data-testid":"search-control-row",onClick:W=>R(W,B),onAuxClick:W=>R(W,B),children:[_&&a.jsx(ve.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${B.id}`,checked:!!f.selected[B.id],onChange:W=>w(W,B.id)})}),P.map(W=>a.jsx(ve.Td,{children:tY(B,W)},W.name))]},B.id))})]}),!V?.length&&a.jsx(Nd,{children:a.jsx(Yn,{style:{height:150},children:a.jsx(Pe,{size:"xl",c:"dimmed",children:"No results"})})}),M&&a.jsx(Yn,{m:"md",p:"md",children:a.jsx(jo,{value:DY(c),total:AY(c,M),onChange:B=>E(KQ(c,B)),getControlProps:rP})}),a.jsx(oY,{search:c,visible:m.current.fieldEditorVisible,onOk:B=>{E(B),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(sY,{search:c,visible:m.current.filterEditorVisible,onOk:B=>{E(B),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(LQ,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(cY,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?Ys(f.filterDialogSearchParam.code):"",resourceType:A,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:B=>{E(gm(c,B.code,B.operator,B.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const RY=zc;function _Y(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[tP(n.operator)," ",a.jsx(uY,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function DY(e){return Math.floor((e.offset??0)/(e.count??tm))+1}function AY(e,t){const n=e.count??tm,r=iP(e,t);return Math.ceil(r/n)}function oP(e,t){return Math.min(iP(e,t),(e.offset??0)+1)}function PY(e,t){return Math.max(oP(e,t)+(t.entry?.length??0)-1,0)}function iP(e,t){let n=t.total;return n===void 0&&(n=(e.offset??0)+(t.entry?.length??0)+(t.link?.some(r=>r.relation==="next")?1:0)),n}function kY(e){const t=De(),[n,r]=v.useState(!1),[i,s]=v.useState(),{query:c,fields:d}=e,[f,p]=v.useState(),[m,g]=v.useState({}),x=v.useRef(f);x.current=f;const b=v.useRef({});b.current=m,v.useEffect(()=>{s(void 0),t.graphql(c).then(p).catch(T=>s(Ht(T)))},[t,c]);function w(T,_){T.stopPropagation();const A=T.target.checked,M={...b.current};A?M[_]=!0:delete M[_],g(M)}function j(T){T.stopPropagation();const P=T.target.checked,A={},M=x.current?.data.ResourceList;P&&M&&M.forEach(I=>{I.id&&(A[I.id]=!0)}),g(A)}function C(){const T=x.current?.data.ResourceList;if(!T||T.length===0)return!1;for(const _ of T)if(_.id&&!b.current[_.id])return!1;return!0}function E(T,_){SA(T.target)||(dn(T),T.button!==1&&e.onClick&&e.onClick(new Xh(_,T)),T.button===1&&e.onAuxClick&&e.onAuxClick(new Xh(_,T)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Dr,{});const R=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:T=>dn(T),"data-testid":"search-control",children:[a.jsxs(ve,{children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[R&&a.jsx(ve.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:T=>j(T)})}),d.map(T=>a.jsx(ve.Th,{children:T.name},T.name))]})}),a.jsx(ve.Tbody,{children:f?.data.ResourceList.map(T=>T&&a.jsxs(ve.Tr,{"data-testid":"search-control-row",onClick:_=>E(_,T),onAuxClick:_=>E(_,T),children:[R&&a.jsx(ve.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${T.id}`,checked:!!m[T.id],onChange:_=>w(_,T.id)})}),d.map(_=>a.jsx(ve.Td,{children:a.jsx(IQ,{propertyType:_.propertyType,path:_.fhirPath,resource:T})},_.name))]},T.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),i&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),e.onBulk&&a.jsx(ke,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const NY=v.memo(kY),OY="_root_1fbwr_1",MY="_entry_1fbwr_8",IY="_key_1fbwr_13",LY="_value_1fbwr_20",ym={root:OY,entry:MY,key:IY,value:LY};function ht(e){return a.jsx(Kr,{children:a.jsx("div",{className:ym.root,children:e.children})})}ht.Entry=function(t){return a.jsx("div",{className:ym.entry,children:t.children})};ht.Key=function(t){return a.jsx("div",{className:ym.key,children:t.children})};ht.Value=function(t){return a.jsx("div",{className:ym.value,children:t.children})};function $Y(e){const{group:t}=e;return a.jsx(mr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ye,{children:[t.measureScore&&a.jsx(BY,{group:t}),!t.measureScore&&a.jsx(UY,{group:t})]})})}function zY(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(Pe,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(Pe,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function UY(e){const{group:t}=e,n=t.population,r=n?.find(f=>qa(f.code)==="numerator"),i=n?.find(f=>qa(f.code)==="denominator"),s=r?.count,c=i?.count;if(c===0)return a.jsxs(ce,{children:[a.jsx(Ie,{order:3,children:"Not Applicable"}),a.jsx(Pe,{children:`Denominator: ${c}`})]});if(s===void 0||c===void 0)return a.jsxs(ce,{children:[a.jsx(Ie,{order:3,children:"Insufficient Data"}),a.jsx(Pe,{children:`Numerator: ${s}`}),a.jsx(Pe,{children:`Denominator: ${c}`})]});const d=s/c*100;return a.jsx(Qp,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:aP(d)}],label:a.jsx(Ha,{justify:"center",children:a.jsxs(Pe,{fw:700,fz:18,children:[s," / ",c]})})})}function BY(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(Qp,{size:120,thickness:12,roundCaps:!0,sections:[{value:VY(t),color:aP(t?.measureScore?.value??0)}],label:a.jsx(Ha,{justify:"center",children:a.jsx(Pe,{fw:700,fz:18,children:a.jsx(ad,{value:t.measureScore})})})}):a.jsx(Ha,{h:120,align:"center",children:a.jsx(Ie,{order:3,children:a.jsx(ad,{value:t.measureScore})})})})}function VY(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function aP(e){return e<=33?"red":e<=67?"yellow":"green"}function FY(e){const t=qt(e.measureReport),[n]=wF("Measure",{url:t?.measure});return t?a.jsxs(ce,{children:[n&&a.jsx(zY,{measure:n}),a.jsx(Yp,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,i)=>a.jsx($Y,{group:r},r.id??i))})]}):null}const sy="patient-export",ly="Patient Export",HY={everything:{operation:"$everything",extension:"json",contentType:un.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:un.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:un.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:un.CDA_XML}};function qY(e){const t=De(),{patient:n}=e,r=v.useCallback(async i=>{const s=Vs(n),c=i.format,{operation:d,type:f,contentType:p,extension:m}=HY[c],g=t.fhirUrl("Patient",s,d),x={};f&&(x.type=f),i.author&&(x.author={reference:i.author}),i.authoredOn&&(x.authoredOn=kb(i.authoredOn)),i.startDate&&(x.start=i.startDate),i.endDate&&(x.end=i.endDate),ho.show({id:sy,title:ly,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,x,void 0,{cache:"no-cache",headers:{Accept:p}}),w=`Patient-export-${s}-${new Date().toISOString().replaceAll(":","-")}.${m}`;GY(b,w,p),ho.update({id:sy,title:ly,color:"green",message:"Done",icon:a.jsx(oa,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){ho.update({id:sy,title:ly,color:"red",message:Ke(b),icon:a.jsx(Gs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(dt,{onSubmit:r,children:a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(jd,{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})}),a.jsx(Nt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(Od,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(Nt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(ai,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(Nt,{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:a.jsx(ai,{name:"startDate",placeholder:"Start date"})}),a.jsx(Nt,{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:a.jsx(ai,{name:"endDate",placeholder:"End date"})}),a.jsx(ye,{justify:"right",children:a.jsx(yr,{children:"Request Export"})})]})})}function GY(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),i=new Blob([r],{type:n}),s=window.URL.createObjectURL(i),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=s,c.download=t,c.click(),window.URL.revokeObjectURL(s)}function WY(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function sP(e){const t=qt(e.patient);return t?a.jsxs(ht,{children:[a.jsx(Ja,{value:t,size:"lg",color:WY(t)}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Name"}),a.jsx(ht.Value,{children:a.jsx(gt,{to:t,fw:500,children:t.name?a.jsx(Tb,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"DoB"}),a.jsx(ht.Value,{children:t.birthDate})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Age"}),a.jsx(ht.Value,{children:eU(t.birthDate)})]})]}),t.gender&&a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Gender"}),a.jsx(ht.Value,{children:t.gender})]}),t.address&&a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"State"}),a.jsx(ht.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:n?.system}),a.jsx(ht.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function QY(e){const{patient:t,...n}=e,r=v.useCallback((i,s,c)=>{const d=`${s}/${c}`,f=100;return Promise.allSettled([i.readHistory("Patient",c),i.search("Communication",{subject:d,_count:f}),i.search("Device",{patient:d,_count:f}),i.search("DeviceRequest",{patient:d,_count:f}),i.search("DiagnosticReport",{subject:d,_count:f}),i.search("Media",{subject:d,_count:f}),i.search("ServiceRequest",{subject:d,_count:f}),i.search("Task",{subject:d,_count:f})])},[]);return a.jsx(mm,{value:t,loadTimelineResources:r,createCommunication:(i,s,c)=>({resourceType:"Communication",status:"completed",subject:Jt(i),sender:Jt(s),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(i,s,c)=>({resourceType:"Media",status:"completed",subject:Jt(i),operator:Jt(s),issued:new Date().toISOString(),content:c}),...n})}const YY="_section_pqpwm_1",KY="_hovering_pqpwm_7",Jy={section:YY,hovering:KY};function XY(e){const t=De(),n=qt(e.value),[r,i]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){f(void 0)}function x(){c(void 0)}const b=v.useRef(p);if(b.current=p,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(nK(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",x),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",x)}),[n]),!r||!p)return null;function w(j,C){m({...b.current,[j]:C})}return a.jsx("div",{children:a.jsxs(dt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(ze,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>w("title",j.currentTarget.value)}),a.jsx(ZY,{actions:p.action||[],selectedKey:s,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>w("action",j)}),a.jsx(yr,{children:"Save"})]})})}function ZY(e){const t=v.useRef(e.actions);t.current=e.actions;function n(s){e.onChange(t.current.map(c=>c.id===s.id?s:c))}function r(s){e.onChange([...t.current,s]),e.setSelectedKey(s.id)}function i(s){e.onChange(t.current.filter(c=>c!==s))}return a.jsxs(Ve,{gap:"md",className:Jy.section,children:[e.actions.map(s=>a.jsx(JY,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(s)},s.id)),a.jsx("div",{children:a.jsx(ke,{variant:"outline",onClick:s=>{dn(s),r({id:lP()})},children:"Add action"})})]})}function JY(e){const{action:t}=e,n=tK(t);function r(s){s.stopPropagation(),e.setSelectedKey(e.action.id)}function i(s){dn(s),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:r,onMouseOver:i,onFocus:i,children:a.jsx(eK,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function eK(e){const{action:t}=e,[n,r]=v.useState(e.actionType),i=e.selectedKey===e.action.id,s=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const d=It(Jy.section,{[Jy.hovering]:s&&!i});return a.jsxs(mr,{"data-testid":t.id,className:d,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(Ha,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(ze,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),a.jsx(Ka,{"data-testid":"close-button",onClick:e.onRemove})]}),i&&a.jsxs(Ve,{gap:"xl",p:"md",children:[a.jsx(ce,{children:a.jsx(ze,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),a.jsx(ce,{children:a.jsx(an,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&a.jsxs(Ve,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Pe,{fw:600,children:"Select questionnaire"}),a.jsx(Pe,{c:"red",children:"*"})]}),a.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"," ",a.jsx(Dt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(uT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&a.jsxs(Ve,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Pe,{fw:600,children:"Select activity definition"}),a.jsx(Pe,{c:"red",children:"*"})]}),a.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"," ",a.jsx(Dt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(uT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function uT(e){const{id:t,definitionCanonical:n}=e.action,r=n?.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(al,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:i=>{i?e.onChange({...e.action,definitionCanonical:kt(i)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function tK(e){return e.definitionCanonical?.startsWith("Questionnaire")?"questionnaire":e.definitionCanonical?.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let cy=1;function lP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(cy=Math.max(cy,t+1))}return e}return"id-"+cy++}function nK(e){return{...e,action:cP(e.action)}}function cP(e){if(e)return e.map(t=>({...t,id:lP(t.id),action:cP(t.action)}))}const Ls=30,Zh=50;function Jh(e){const t=e.formState,n=e.item,r=e.responseItem;function i(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const s=n.type;if(!s)return null;const c=n.linkId;if(!c)return null;let d;n.initial&&n.initial.length>0?d=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(d=n.answerOption.find(g=>g.initialSelected));const f=Fb(r,e.index)??bb(d),p=hi(r,`${Uo}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(s){case wt.display:m=a.jsx("p",{children:e.item.text},e.item.linkId);break;case wt.boolean:m=a.jsx(BA,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(Un,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f?.value,onChange:g=>i([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case wt.decimal:m=a.jsx(ze,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case wt.integer:m=a.jsx(ze,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case wt.date:m=a.jsx(ze,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueDate:g.currentTarget.value}])});break;case wt.dateTime:m=a.jsx(ai,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueDateTime:g}])});break;case wt.time:m=a.jsx(ze,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueTime:g.currentTarget.value}])});break;case wt.string:case wt.url:m=a.jsx(ze,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;i(x===""?[]:[{valueString:x}])}});break;case wt.text:m=a.jsx(tl,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;i(x===""?[]:[{valueString:x}])}});break;case wt.attachment:m=a.jsx(ye,{py:4,children:a.jsx(EA,{path:"",name:c,defaultValue:f?.value,onChange:g=>i([{valueAttachment:g}])})});break;case wt.reference:m=a.jsx(Od,{name:c,required:e.required??n.required,targetTypes:aA(n),searchCriteria:fF(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>i([{valueReference:g}])});break;case wt.quantity:m=a.jsx(Ws,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>i([{valueQuantity:g}]),disableWheel:!0});break;case wt.choice:case wt.openChoice:cK(n)?m=a.jsx(aK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>i(g)}):lK(n)||n.answerValueSet&&!uK(n)?m=a.jsx(rK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>i(g)}):m=a.jsx(iK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>i(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(Pe,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function rK(e){const{name:t,item:n,required:r,initial:i,onChangeAnswer:s,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(Vb,{});const d=bb(i),f=Fb(c)??d,p=fP(c),m=n.repeats||dK(n);if(n.answerValueSet)return a.jsx(um,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:g=>{m?g.length===0?s([{}]):s(g.map(x=>({valueCoding:x}))):s([{valueCoding:g[0]}])},defaultValue:f?.value});if(m){const{propertyName:g,data:x}=fK(n);return a.jsx(Up,{data:x,placeholder:"Select items",searchable:!0,defaultValue:p||[Fs(d)],required:r,onChange:b=>{if(b.length===0)s([{}]);else{const w=oA(b,g,n);s(w)}}})}else{const g=[""];if(n.answerOption)for(const x of n.answerOption){const b=ui(x);g.push(Fs(b))}return a.jsx(an,{id:t,name:t,required:r,onChange:x=>{const b=x.currentTarget.selectedIndex;if(b===0){s([{}]);return}const w=n.answerOption[b-1],j=ui(w),C="value"+Mn(j.type);s([{[C]:j.value}])},defaultValue:Dd(f?.value)||f?.value,data:g})}}function oK(e,t){return e?t.valueSetExpand({url:e,count:Ls+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function uP(e){const t=De(),[n,r]=v.useState([]),[i,s]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){s(!0);try{const d=await oK(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{s(!1)}}}c().catch(console.error)},[e,t]),[n,i]}function dP(e,t){return e.map((n,r)=>{const i=`${t}-valueset-${r}`,s={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[i,s]})}function iK(e){const{name:t,item:n,required:r,initial:i,onChangeAnswer:s,response:c}=e,d=Za("QuestionnaireItemAnswerOption","value[x]"),f=bb(i),[p,m]=uP(n.answerValueSet),g=[];let x;if(n.answerValueSet)g.push(...dP(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,Zh).map((E,R)=>{const T=`${t}-option-${R}`,_=ui(E);return _?.value?(f&&Lo(_)===Lo(f)&&(x=T),[T,_]):null}).filter(E=>E!==null);g.push(...C)}const b=Fb(c),w=sK(g,b);if(m)return a.jsx(Pe,{children:"Loading options..."});if(g.length===0)return a.jsx(Vb,{});const j=g.slice(0,Ls);return a.jsxs(a.Fragment,{children:[a.jsx(Bs.Group,{name:t,value:w??x,required:r,onChange:C=>{const E=g.find(R=>R[0]===C);if(E){const R=E[1],T="value"+Mn(R.type);s([{[T]:R.value}])}},children:j.map(([C,E])=>a.jsx(Bs,{id:C,value:C,py:4,required:r,label:a.jsx($o,{property:d,propertyType:E.type,value:E.value})},C))}),(n.answerValueSet&&g.length>Ls||n.answerOption&&g.length>Zh)&&a.jsxs(Pe,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",Ls," options"]})]})}function aK(e){const{name:t,item:n,onChangeAnswer:r,response:i}=e,s=Za("QuestionnaireItemAnswerOption","value[x]"),[c,d]=uP(n.answerValueSet),f=n.answerValueSet?(i?.answer?.map(w=>w.valueCoding)||[]).filter(w=>w!==void 0):fP(i),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...dP(c,t));else if(n.answerOption){const w=n.answerOption.slice(0,Zh).map((j,C)=>{const E=`${t}-option-${C}`,R=ui(j);return R?.value?[E,R]:null}).filter(j=>j!==null);g.push(...w)}if(d)return a.jsx(Pe,{children:"Loading options..."});if(g.length===0)return a.jsx(Vb,{});const x=g.slice(0,Ls),b=(w,j)=>{if(n.answerValueSet){const C=p;let E;j?E=[...C,w.value]:E=C.filter(R=>!li(R,w.value)),m(E),E.length===0?r([{}]):r(E.map(R=>({valueCoding:R})))}else{const C=p,E=Fs(w);let R;if(j?R=[...C,E]:R=C.filter(T=>T!==E),m(R),R.length===0)r([{}]);else{const T=oA(R,"value"+Mn(w.type),n);r(T)}}};return a.jsxs(ye,{style:{flexDirection:"column",alignItems:"flex-start"},children:[x.map(([w,j])=>{const C=Fs(j),E=n.answerValueSet?p.some(R=>li(R,j.value)):p.includes(C);return a.jsx(Un,{id:w,label:a.jsx($o,{property:s,propertyType:j.type,value:j.value}),checked:E,onChange:R=>b(j,R.currentTarget.checked)},w)}),(n.answerValueSet&&g.length>Ls||n.answerOption&&g.length>Zh)&&a.jsxs(Pe,{size:"sm",c:"dimmed",children:["Showing first ",Ls," options"]})]})}function Vb(){return a.jsx(ze,{disabled:!0,placeholder:"No Answers Defined"})}function Fb(e,t=0){return ui(e?.answer?.[t]??{})}function fP(e){const t=e?.answer;return t?t.map(r=>ui(r)).map(r=>Dd(r?.value)||r?.value).filter(Boolean):[]}function sK(e,t){return e.find(n=>li(n[1].value,t?.value))?.[0]}function xm(e,t){return!!e.extension?.some(n=>n.url===yb&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function lK(e){return xm(e,"drop-down")}function cK(e){return xm(e,"check-box")}function uK(e){return xm(e,"radio-button")}function dK(e){return xm(e,"multi-select")}function fK(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ui(t),r="value"+Mn(n.type),i=(e.answerOption??[]).map(s=>{const c=ui(s),d=Fs(c);return{value:d,label:d}});return{propertyName:r,data:i}}const hK="_section_my8o4_1",pK="_hovering_my8o4_10",mK="_editing_my8o4_14",gK="_questionBody_my8o4_20",vK="_topActions_my8o4_24",yK="_bottomActions_my8o4_33",xK="_movementActions_my8o4_44",bK="_movementIcons_my8o4_56",SK="_columnAlignment_my8o4_60",wK="_linkIdInput_my8o4_65",jK="_typeSelect_my8o4_70",CK="_preserveBreaks_my8o4_74",Hr={section:hK,hovering:pK,editing:mK,questionBody:gK,topActions:vK,bottomActions:yK,movementActions:xK,movementIcons:bK,columnAlignment:SK,linkIdInput:wK,typeSelect:jK,preserveBreaks:CK};function EK(e){const t=De(),n=qt(e.questionnaire),[r,i]=v.useState(!1),[s,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){m(void 0)}function x(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>i(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(DK(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",x),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",x)}),[n]);const b=(w,j)=>{c(w),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(w)};return!r||!s?null:a.jsx("div",{children:a.jsxs(dt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[a.jsx(hP,{item:s,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(yr,{children:"Save"})]})})}function hP(e){const t=e.item,n=e.item,r=pi(e.item),i=r||n.type===wt.group,s=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,d=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function p(T){dn(T),e.setSelectedKey(e.item.id)}function m(T){dn(T),e.setHoverKey(e.item.id)}function g(T){const _=f.current;e.onChange({..._,item:_.item?.map(P=>P.id===T.id?T:P)})}function x(T,_){e.onChange({...e.item,item:[...e.item.item??[],T]},_)}function b(T){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==T)})}function w(T,_){e.onChange({...f.current,[T]:_})}function j(T){e.onChange({...e.item,...T})}function C(T){e.onChange({...e.item,item:e.item.item?.map(_=>_===T?{..._,repeats:!_.repeats}:_)})}function E(T,_){const P=kK(e.item.item,T,_);e.onChange({...e.item,item:P})}const R=It(Hr.section,{[Hr.editing]:c,[Hr.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:R,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:Hr.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(ze,{size:"xl",defaultValue:t.title,onBlur:T=>w("title",T.currentTarget.value)}),!r&&a.jsx(tl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:T=>w("text",T.currentTarget.value)}),n.type==="reference"&&a.jsx(_K,{item:n,onChange:j}),nF(n)&&a.jsx(TK,{item:n,onChange:T=>j(T)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Ie,{children:t.title}),n.text&&a.jsx("div",{className:Hr.preserveBreaks,children:n.text}),!i&&a.jsx(Jh,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((T,_)=>a.jsx("div",{children:a.jsx(hP,{item:T,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(T),onRepeatable:C,onMoveUp:()=>E(_,-1),onMoveDown:()=>E(_,1)})},T.id)),!i&&a.jsx("div",{className:Hr.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(ze,{size:"xs",className:Hr.linkIdInput,defaultValue:n.linkId,onBlur:T=>w("linkId",T.currentTarget.value)}),!i&&a.jsx(an,{size:"xs",className:Hr.typeSelect,defaultValue:n.type,onChange:T=>w("type",T.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:s})}),!r&&a.jsx(ce,{className:Hr.movementActions,children:a.jsxs(ce,{className:Hr.columnAlignment,children:[!e.isFirst&&a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(MF,{"data-testid":"up-button",size:15,className:Hr.movementIcons})}),!e.isLast&&a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(NF,{"data-testid":"down-button",size:15,className:Hr.movementIcons})})]})}),a.jsxs("div",{className:Hr.bottomActions,children:[i&&a.jsxs(a.Fragment,{children:[a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),x({id:Ks(),linkId:nx("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),x({id:Ks(),linkId:nx("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),x(PK(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Dt,{href:"#",onClick:T=>{T.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function TK(e){const t=Za("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(ze,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(RK,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ce,{display:"flex",children:[a.jsx(Dt,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Ks()}]})},children:"Add choice"}),a.jsx(Kp,{w:"lg"}),a.jsx(Dt,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function RK(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=fm({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(Md,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(i,s)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[s]:i},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Dt,{href:"#",onClick:i=>{dn(i),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function _K(e){const t=aA(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ye,{children:[a.jsx(Db,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:i=>{e.onChange(ry(e.item,t.map(s=>s===n?i:s)))}}),a.jsx(Dt,{href:"#",onClick:i=>{dn(i),e.onChange(ry(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Dt,{href:"#",onClick:n=>{dn(n),e.onChange(ry(e.item,[...t,""]))},children:"Add Resource Type"})]})}let ex=1,tx=1;function nx(e){return e+ex++}function Ks(){return"id-"+tx++}function DK(e){return{...e,id:e.id||Ks(),item:pP(e.item)}}function pP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(tx=Math.max(tx,parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(ex=Math.max(ex,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Ks(),item:pP(t.item),answerOption:AK(t.answerOption)}))}function AK(e){if(e)return e.map(t=>({...t,id:t.id||Ks()}))}function PK(){return{id:Ks(),linkId:nx("s"),type:"group",text:"New Page",extension:[{url:yb,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function kK(e,t,n){const r=e??[],i=t+n;if(i<0||i>=r.length)return r;const s=[...r];return[s[t],s[i]]=[s[i],s[t]],s}/*!
537
+ * Signature Pad v5.0.10 | https://github.com/szimek/signature_pad
538
+ * (c) 2025 Szymon Nowak | Released under the MIT license
539
+ */class ep{constructor(t,n,r,i){if(isNaN(t)||isNaN(n))throw new Error(`Point is invalid: (${t}, ${n})`);this.x=+t,this.y=+n,this.pressure=r||0,this.time=i||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class Hb{static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,i=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new Hb(t[1],r,i,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const i=t.x-n.x,s=t.y-n.y,c=n.x-r.x,d=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},p={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(i*i+s*s),g=Math.sqrt(c*c+d*d),x=f.x-p.x,b=f.y-p.y,w=m+g==0?0:g/(m+g),j={x:p.x+x*w,y:p.y+b*w},C=n.x-j.x,E=n.y-j.y;return{c1:new ep(f.x+C,f.y+E),c2:new ep(p.x+C,p.y+E)}}constructor(t,n,r,i,s,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=i,this.startWidth=s,this.endWidth=c}length(){let n=0,r,i;for(let s=0;s<=10;s+=1){const c=s/10,d=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(s>0){const p=d-r,m=f-i;n+=Math.sqrt(p*p+m*m)}r=d,i=f}return n}point(t,n,r,i,s){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*i*(1-t)*t*t+s*t*t*t}}class NK{constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(t,n,r){this._et.addEventListener(t,n,r)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,n,r){this._et.removeEventListener(t,n,r)}}function OK(e,t=250){let n=0,r=null,i,s,c;const d=()=>{n=Date.now(),r=null,i=e.apply(s,c),r||(s=null,c=[])};return function(...p){const m=Date.now(),g=t-(m-n);return s=this,c=p,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,i=e.apply(s,c),r||(s=null,c=[])):r||(r=window.setTimeout(d,g)),i}}class tp extends NK{constructor(t,n={}){var r,i,s;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=(r=n.throttle)!==null&&r!==void 0?r:16,this.minDistance=(i=n.minDistance)!==null&&i!==void 0?i:5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=(s=n.canvasContextOptions)!==null&&s!==void 0?s:{},this._strokeMoveUpdate=this.throttle?OK(tp.prototype._strokeUpdate,this.throttle):tp.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:n}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,n.width,n.height),t.fillRect(0,0,n.width,n.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._strokePointerId=void 0}fromDataURL(t,n={}){return new Promise((r,i)=>{const s=new Image,c=n.ratio||window.devicePixelRatio||1,d=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,p=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),s.onload=()=>{this._ctx.drawImage(s,p,m,d,f),r()},s.onerror=g=>{i(g)},s.crossOrigin="anonymous",s.src=t,this._isEmpty=!1})}toDataURL(t="image/png",n){switch(t){case"image/svg+xml":return typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`;default:return typeof n!="number"&&(n=void 0),this.canvas.toDataURL(t,n)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const n=window.document===this.canvas.ownerDocument?window:(t=this.canvas.ownerDocument.defaultView)!==null&&t!==void 0?t:this.canvas.ownerDocument;return{addEventListener:n.addEventListener.bind(n),removeEventListener:n.removeEventListener.bind(n)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:n=!0}={}){n&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,n){return n?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const n=t.changedTouches[0];return{event:t,type:t.type,x:n.clientX,y:n.clientY,pressure:n.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,n=!1){return typeof this._strokePointerId>"u"?n:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const i=this._getPointGroupOptions(),s=Object.assign(Object.assign({},i),{points:[]});this._data.push(s),this._reset(i),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const n=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],i=r.points,s=i.length>0&&i[i.length-1],c=s?n.distanceTo(s)<=this.minDistance:!1,d=this._getPointGroupOptions(r);if(!s||!(s&&c)){const f=this._addPoint(n,d);s?f&&this._drawCurve(f,d):this._drawDot(n,d),i.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,n=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(n&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,n,r){const i=this.canvas.getBoundingClientRect();return new ep(t-i.left,n-i.top,r,new Date().getTime())}_addPoint(t,n){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const i=this._calculateCurveWidths(r[1],r[2],n),s=Hb.fromPoints(r,i);return r.shift(),s}return null}_calculateCurveWidths(t,n,r){const i=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,s=this._strokeWidth(i,r),c={end:s,start:this._lastWidth};return this._lastVelocity=i,this._lastWidth=s,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const i=this._ctx;i.moveTo(t,n),i.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,i=t.endWidth-t.startWidth,s=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<s;c+=1){const d=c/s,f=d*d,p=f*d,m=1-d,g=m*m,x=g*m;let b=x*t.startPoint.x;b+=3*g*d*t.control1.x,b+=3*m*f*t.control2.x,b+=p*t.endPoint.x;let w=x*t.startPoint.y;w+=3*g*d*t.control1.y,w+=3*m*f*t.control2.y,w+=p*t.endPoint.y;const j=Math.min(t.startWidth+p*i,n.maxWidth);this._drawCurveSegment(b,w,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,i=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,i),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const i of t){const{points:s}=i,c=this._getPointGroupOptions(i);if(s.length>1)for(let d=0;d<s.length;d+=1){const f=s[d],p=new ep(f.x,f.y,f.pressure,f.time);d===0&&this._reset(c);const m=this._addPoint(p,c);m&&n(m,c)}else this._reset(c),r(s[0],c)}}toSVG({includeBackgroundColor:t=!1}={}){const n=this._data,r=Math.max(window.devicePixelRatio||1,1),i=0,s=0,c=this.canvas.width/r,d=this.canvas.height/r,f=document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.setAttribute("xmlns","http://www.w3.org/2000/svg"),f.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),f.setAttribute("viewBox",`${i} ${s} ${c} ${d}`),f.setAttribute("width",c.toString()),f.setAttribute("height",d.toString()),t&&this.backgroundColor){const p=document.createElement("rect");p.setAttribute("width","100%"),p.setAttribute("height","100%"),p.setAttribute("fill",this.backgroundColor),f.appendChild(p)}return this._fromData(n,(p,{penColor:m})=>{const g=document.createElement("path");if(!isNaN(p.control1.x)&&!isNaN(p.control1.y)&&!isNaN(p.control2.x)&&!isNaN(p.control2.y)){const x=`M ${p.startPoint.x.toFixed(3)},${p.startPoint.y.toFixed(3)} C ${p.control1.x.toFixed(3)},${p.control1.y.toFixed(3)} ${p.control2.x.toFixed(3)},${p.control2.y.toFixed(3)} ${p.endPoint.x.toFixed(3)},${p.endPoint.y.toFixed(3)}`;g.setAttribute("d",x),g.setAttribute("stroke-width",(p.endWidth*2.25).toFixed(3)),g.setAttribute("stroke",m),g.setAttribute("fill","none"),g.setAttribute("stroke-linecap","round"),f.appendChild(g)}},(p,{penColor:m,dotSize:g,minWidth:x,maxWidth:b})=>{const w=document.createElement("circle"),j=g>0?g:(x+b)/2;w.setAttribute("r",j.toString()),w.setAttribute("cx",p.x.toString()),w.setAttribute("cy",p.y.toString()),w.setAttribute("fill",m),f.appendChild(w)}),f.outerHTML}}function MK(e){const t=De(),{width:n=500,height:r=200,defaultValue:i,who:s,onChange:c,...d}=e,f=v.useRef(null),p=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function x(){m.current?.({type:[{system:Uo+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:s??Jt(t.getProfile()),data:p.current?.toDataURL()})}if(f.current){const b=new tp(f.current);i?.data&&b.fromDataURL(i.data).catch(console.error),b.addEventListener("endStroke",x),p.current=b}return()=>{p.current&&p.current.removeEventListener("beginStroke",x)}},[t,i,s]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(mr,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...d,children:[a.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),a.jsx(ke,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(cm,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function mP(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(Ie,{order:3,mb:"md",children:e.item.text}),a.jsx(rx,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function IK(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(mP,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Dt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function LK(e){const{formState:t,context:n,item:r,responseItem:i}=e,s=r.type!==wt.choice&&r.type!==wt.openChoice,c=i.answer&&i.answer.length>0?i.answer:[{}];return a.jsxs(Nt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Ve,{gap:"xs",children:c?.map((d,f)=>a.jsx(Jh,{formState:t,context:n,item:r,responseItem:i,index:f},`${r.linkId}-${f}`))}),s&&a.jsx(Dt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function rx(e){const{formState:t,context:n,items:r,responseItems:i}=e;return a.jsx(Ve,{children:r.map((s,c)=>{if(!rF(s,t.questionnaireResponse))return null;if(s.type===wt.display)return a.jsx("p",{children:s.text},`display-${s.id}-${c}`);const d=i.filter(f=>f.linkId===s.linkId);return s.type===wt.group&&s.repeats?a.jsx(IK,{formState:t,context:n,item:s,responseItems:d},`repeating-group-${s.id}-${c}`):s.type===wt.group?a.jsx(mP,{formState:t,context:n,item:s,responseItem:d[0]},`group-${s.id}-${c}`):s.type===wt.boolean?a.jsx(Jh,{formState:t,context:n,item:s,responseItem:d[0],index:0},`boolean-item-${s.id}-${c}`):s.repeats?a.jsx(LK,{formState:t,context:n,item:s,responseItem:d[0]},`repeating-item-${s.id}-${c}`):a.jsx(Nt,{htmlFor:s.linkId,title:s.text,withAsterisk:s.required,children:a.jsx(Jh,{formState:t,context:n,item:s,responseItem:d[0],index:0})},`repeating-item-${s.id}-${c}`)})})}function $K(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:i}=e,s=t.pages,c=t.activePage,d=c>0,f=c<s.length-1,p=c===s.length-1;return a.jsxs(a.Fragment,{children:[a.jsx(xc,{active:c,allowNextStepsSelect:!1,p:6,children:s.map((m,g)=>a.jsx(xc.Step,{label:m.title,children:g===c&&i},m.linkId))}),!r&&a.jsxs(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:[d&&a.jsx(ke,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(ke,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),p&&a.jsx(yr,{children:n??"Submit"})]})]})}function gP(e){const t=De(),[n,r]=v.useState(!1),i=v.useRef(e);i.current=e;const s=v.useCallback(g=>{r(!1),i.current.onChange?.(g)},[]),c=gF({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:s}),d=v.useRef(c);d.current=c;const f=v.useMemo(()=>c.loading?!1:!!hi(c.questionnaire,tF),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===Eh),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const x=i.current.onSubmit;if(!x)return;if(f&&!p){r(!0);return}const b=g.questionnaire,w=g.questionnaireResponse,j=i.current.subject;let C=i.current.source;if(!C){const E=t.getProfile();E&&(C=Jt(E))}x({...w,questionnaire:b.url??kt(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(dt,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Ie,{children:c.questionnaire.title}),c.pagination?a.jsx($K,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(rx,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(rx,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Ve,{mt:"md",gap:0,children:[a.jsx(Pe,{size:"sm",fw:500,children:"Signature"}),a.jsx(MK,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(Pe,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(yr,{children:e.submitButtonText??"Submit"})})]})]})}const zK="_section_4m5it_1",UK={section:zK},BK=["gender","age","gestationalAge","context","appliesTo","category"],VK={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function FK(e){e=Object.assign(VK,e);const t=e.definition,[n,r]=v.useState([]),[i,s]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const w=GK(t,d);r(WK(w.qualifiedInterval||[],s))},[t]),a.jsxs(dt,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Ve,{children:n.map(w=>a.jsx(HK,{unit:YK(t.quantitativeDetails?.unit),onChange:g,onAdd:x,onRemove:b,onRemoveGroup:m,intervalGroup:w},`group-${w.id}`))}),a.jsx(_n,{title:"Add Group",variant:"subtle",size:"sm",onClick:w=>{dn(w),p({id:`group-id-${i}`,filters:{},intervals:[]}),s(j=>j+1)},children:a.jsx(Yh,{})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yr,{children:"Save"})})]});function f(){const w=n.flatMap(j=>j.intervals).filter(j=>!KK(j));e.onSubmit({...t,qualifiedInterval:w})}function p(w){r(j=>[...j,w])}function m(w){r(j=>j.filter(C=>C.id!==w.id))}function g(w,j){r(C=>{C=[...C];const E=C.find(T=>T.id===w),R=E?.intervals.findIndex(T=>T.id===j.id);return R!==void 0&&E?.intervals[R]&&(E.intervals[R]=j),C})}function x(w,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const E=C.findIndex(R=>R.id===w);if(E!==-1){const R={...C[E]};j={...j,...R.filters},R.intervals=[...R.intervals,j],C[E]=R}return C})}function b(w,j){r(C=>{C=[...C];const E=C.find(R=>R.id===w);return E&&(E.intervals=E.intervals.filter(R=>R.id!==j.id)),C})}}function HK(e){const{intervalGroup:t,unit:n}=e;return a.jsx(Nd,{"data-testid":t.id,className:UK.section,children:a.jsxs(Ve,{gap:"lg",children:[a.jsx(ye,{justify:"flex-end",children:a.jsx(_n,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{dn(r),e.onRemoveGroup(t)},children:a.jsx(Qh,{})},`remove-group-button-${t.id}`)}),a.jsx(qK,{intervalGroup:t,onChange:e.onChange}),a.jsx(wn,{}),t.intervals.map(r=>a.jsxs(Ve,{gap:"xs",children:[a.jsxs(ye,{children:[a.jsx(ze,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:i=>{dn(i),e.onChange(t.id,{...r,condition:i.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(_n,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:i=>{dn(i),e.onRemove(t.id,r)},children:a.jsx(Qh,{})},`remove-interval-${r.id}`)]}),a.jsx(Nb,{path:"",onChange:i=>{e.onChange(t.id,{...r,range:i})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(_n,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{dn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(Yh,{})})]})})}function qK(e){const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const r of["low","high"])t.filters.age[r]?.unit||(t.filters.age[r]={...t.filters.age[r],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(Ve,{style:{maxWidth:"50%"},children:[a.jsx(ye,{children:a.jsx(an,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const i of t.intervals){let s=r.currentTarget.value;s===""&&(s=void 0),n(t.id,{...i,gender:s})}}})}),a.jsxs(ye,{gap:"xs",children:[a.jsx(Pe,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(Nb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const i of t.intervals)n(t.id,{...i,age:r})}},`age-${t.id}`)})]}),a.jsx(an,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:t.filters.context?.text||"",onChange:r=>{for(const i of t.intervals){let s=r.currentTarget.value;s===""?(s=void 0,n(t.id,{...i,context:void 0})):n(t.id,{...i,context:{text:s,coding:[{code:s,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(an,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:r=>{for(const i of t.intervals){const s=r.currentTarget.value;s===""?n(t.id,{...i,category:void 0}):n(t.id,{...i,category:s})}}})]})}function GK(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(i=>{const s=parseInt(i.id?.substring(3)||"",10);return isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(i=>({...i,id:i.id||`id-${r++}`}))},t(r),e}function WK(e,t){let n=1;const r={};for(const i of e){const s=QK(i);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(BK.map(c=>[c,i[c]])),intervals:[]}),r[s].intervals.push(i)}return t(n),Object.values(r)}function QK(e){return[`gender=${e.gender}`,`age=${od(e.age)}`,`gestationalAge=${od(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function YK(e){return e&&(dU(e,"http://unitsofmeasure.org")||e.text)}function KK(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function XK(e){const t=De(),n=qt(e.value),[r,i]=v.useState(!1),[s,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),i(!0))},[t,n,r]),!n||!s)return null;return a.jsx(ir,{children:n.action?.map((p,m)=>{const g=p.resource&&f(p.resource),x=g?.input?.[0]?.valueReference,b=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(ir.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(tH,{}):a.jsx(pq,{color:"gray"})}),a.jsxs(ir.Col,{span:9,p:"xs",children:[a.jsx(Pe,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(sl,{value:g?.meta?.author})," on ",sr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(pm,{status:g?.status||"unknown"})]})]}),a.jsxs(ir.Col,{span:2,p:"md",children:[x&&!b&&a.jsx(ke,{onClick:()=>e.onStart(g,x),children:"Start"}),x&&b&&a.jsx(ke,{onClick:()=>e.onEdit(g,x,b),children:"Edit"})]})]},`action-${m}`)})});function d(p){const m=[];if(p.action)for(const g of p.action)g.resource?.reference&&m.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function f(p){for(const m of s?.entry??[])if(m.resource&&p.reference===kt(m.resource))return m.resource}}function vP(e,t){const n=ZK(e,t);return JK(n,e,t)}function ZK(e,t){const n=e.length,r=t.length,i=n+r+1,s=1+2*i,c=s/2|0,d=new Array(s);d[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<i;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,x=m-1,b=d[g],w=d[x];let j,C=0;p===-f||p!==f&&w.i<b.i?(C=b.i,j=b):(C=w.i+1,j=w),d[x]=void 0;let E=C-p,R={i:C,j:E,prev:eX(j),snake:!1};for(;C<n&&E<r&&e[C]===t[E];)C++,E++;if(C>R.i&&(R={i:C,j:E,prev:R,snake:!0}),d[m]=R,C>=n&&E>=r)return d[m]}d[c+f-1]=void 0}}function JK(e,t,n){const r=[];let i=e;for(i.snake&&(i=i.prev);i?.prev&&i.prev.j>=0;){const s=i.i,c=i.j;i=i.prev;const d=i.i,f=i.j,p={position:d,lines:t.slice(d,s)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),i.snake&&(i=i.prev)}return r}function eX(e){return e&&!e.snake&&e.prev?e.prev:e}function tX(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:Lo(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,i)=>r.meta.lastUpdated.localeCompare(i.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 nX(n,t),rX(n),n}function nX(e,t){for(let n=1;n<t.length;n++){const r=vP(t[n-1].lines,t[n].lines);for(const i of r){const s=i.original.position,c=i.original.lines,d=i.revised.lines;if((i.type==="delete"||i.type==="change")&&e.splice(s,c.length),i.type==="insert"||i.type==="change")for(let f=0;f<i.revised.lines.length;f++)e.splice(s+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function rX(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 oX="_container_1tyf3_1",iX="_root_1tyf3_5",aX="_startRow_1tyf3_20",sX="_normalRow_1tyf3_25",lX="_author_1tyf3_30",cX="_dateTime_1tyf3_34",uX="_lineNumber_1tyf3_40",dX="_line_1tyf3_40",fX="_pre_1tyf3_55",zi={container:oX,root:iX,startRow:aX,normalRow:sX,author:lX,dateTime:cX,lineNumber:uX,line:dX,pre:fX};function hX(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function pX(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return nc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return nc(r,"month");const i=Math.floor(t/86400);if(i>0)return nc(i,"day");const s=Math.floor(t/3600);if(s>0)return nc(s,"hour");const c=Math.floor(t/60);return c>0?nc(c,"minute"):nc(t,"second")}function nc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function mX(e){const t=De(),[n,r]=v.useState(e.history);if(v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const i=n.entry?.[0]?.resource;if(!i)return null;const s=tX(n);return a.jsx("div",{className:zi.container,children:a.jsx("table",{className:zi.root,children:a.jsx("tbody",{children:s.map((c,d)=>a.jsxs("tr",{className:c.span>0?zi.startRow:zi.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:zi.author,rowSpan:c.span,children:a.jsx(sl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:zi.dateTime,rowSpan:c.span,children:a.jsx(gt,{to:hX(i,c.meta.versionId),fz:"xs",children:pX(c.meta.lastUpdated)})})]}),a.jsx("td",{className:zi.lineNumber,children:d+1}),a.jsx("td",{className:zi.line,children:a.jsx("pre",{className:zi.pre,children:c.value})})]},"row-"+d))})})})}const gX="_removed_el5zk_1",vX="_added_el5zk_6",dT={removed:gX,added:vX};function yX(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Lo(t,!0).match(/[^\r\n]+/g),i=Lo(n,!0).match(/[^\r\n]+/g),s=vP(r,i);return a.jsx("pre",{style:{color:"gray"},children:s.map((c,d)=>a.jsx(xX,{delta:c},"delta"+d))})}function xX(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:dT.removed,children:e.delta.original.lines.join(`
540
+ `)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:dT.added,children:e.delta.revised.lines.join(`
541
+ `)}),"...",a.jsx("br",{})]})}const bX="_splitButton_1i0gi_1",SX="_menuControl_1i0gi_6",fT={splitButton:bX,menuControl:SX};function np(e){const{outcome:t}=e,n=De(),r=qt(e.defaultValue),i=r?.resourceType,[s,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=yn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const w=Mc(b);if(w){c(!0);const j=MV(r,w);f(j)}else console.error(`Schema not found for ${b}`)}).catch(w=>{console.error("Error in requestProfileSchema",w)})}else n.requestSchema(i).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,i,e.profileUrl]);const g=v.useMemo(()=>r&&VD(r,Os.READ,p),[p,r]),x=v.useMemo(()=>n.isSuperAdmin()||!p||!Cn(d?.resourceType)?!0:LB(p,d?.resourceType),[n,p,d?.resourceType]);return!s||!d?a.jsx("div",{children:"Loading..."}):x?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(d)},children:[a.jsxs(Ve,{mb:"xl",children:[a.jsx(Nt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(ze,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(Nt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(ze,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(Ib,{path:d.resourceType,valuePath:d.resourceType,typeName:i,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(ke,{type:"submit",className:It((e.onPatch||e.onDelete)&&fT.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(Ce,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(Ce.Target,{children:a.jsx(_n,{variant:"filled",color:m.primaryColor,size:36,className:fT.menuControl,"aria-label":"More actions",children:a.jsx(wb,{size:14,stroke:1.5})})}),a.jsxs(Ce.Dropdown,{children:[e.onPatch&&a.jsx(Ce.Item,{leftSection:a.jsx(pA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(Ce.Item,{color:"red",leftSection:a.jsx(cm,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs(Ji,{color:"red",title:"Permission denied",icon:a.jsx(il,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function wX(e){const t=De(),[n,r]=v.useState(e.history);return v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(ve,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Th,{children:"Author"}),a.jsx(ve.Th,{children:"Date"}),a.jsx(ve.Th,{children:"Version"})]})}),a.jsx(ve.Tbody,{children:n.entry?.map((i,s)=>a.jsx(jX,{entry:i},"entry-"+s))})]}):a.jsx("div",{children:"Loading..."})}function jX(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:a.jsx(uc,{value:n.meta?.author,link:!0})}),a.jsx(ve.Td,{children:sr(n.meta?.lastUpdated)}),a.jsx(ve.Td,{children:a.jsx(gt,{to:CX(n),children:n.meta?.versionId})})]}):a.jsx(ve.Tr,{children:a.jsx(ve.Td,{colSpan:3,children:Ke(t?.outcome)})})}function CX(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function EX(e){const{serviceRequest:t,...n}=e;return a.jsx(mm,{value:t,loadTimelineResources:async(r,i,s)=>{const c=`${i}/${s}`,d=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":c,_count:d}),r.search("DiagnosticReport",{"based-on":c,_count:d}),r.search("Media",{"based-on":c,_count:d}),r.search("DocumentReference",{related:c,_count:d}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:d})])},createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",basedOn:[Jt(r)],subject:r.subject,sender:Jt(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",basedOn:[Jt(r)],subject:r.subject,operator:Jt(i),issued:new Date().toISOString(),content:s}),...n})}function TX(e){const t=De(),{client:n,patient:r,encounter:i,children:s,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:i}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",ab(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),window.location.assign(p.toString())}).catch(f=>Ne({color:"red",message:Ke(f),autoClose:!1}))}return a.jsx(Dt,{onClick:()=>d(),...c,children:s})}var uy={exports:{}},$u={},dy={exports:{}},fy={};/**
542
+ * @license React
543
+ * scheduler.production.js
544
+ *
545
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
546
+ *
547
+ * This source code is licensed under the MIT license found in the
548
+ * LICENSE file in the root directory of this source tree.
549
+ */var hT;function RX(){return hT||(hT=1,(function(e){function t(N,L){var $=N.length;N.push(L);e:for(;0<$;){var q=$-1>>>1,O=N[q];if(0<i(O,L))N[q]=L,N[$]=O,$=q;else break e}}function n(N){return N.length===0?null:N[0]}function r(N){if(N.length===0)return null;var L=N[0],$=N.pop();if($!==L){N[0]=$;e:for(var q=0,O=N.length,F=O>>>1;q<F;){var te=2*(q+1)-1,ae=N[te],je=te+1,xe=N[je];if(0>i(ae,$))je<O&&0>i(xe,ae)?(N[q]=xe,N[je]=$,q=je):(N[q]=ae,N[te]=$,q=te);else if(je<O&&0>i(xe,$))N[q]=xe,N[je]=$,q=je;else break e}}return L}function i(N,L){var $=N.sortIndex-L.sortIndex;return $!==0?$:N.id-L.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],p=[],m=1,g=null,x=3,b=!1,w=!1,j=!1,C=!1,E=typeof setTimeout=="function"?setTimeout:null,R=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function _(N){for(var L=n(p);L!==null;){if(L.callback===null)r(p);else if(L.startTime<=N)r(p),L.sortIndex=L.expirationTime,t(f,L);else break;L=n(p)}}function P(N){if(j=!1,_(N),!w)if(n(f)!==null)w=!0,A||(A=!0,K());else{var L=n(p);L!==null&&W(P,L.startTime-N)}}var A=!1,M=-1,I=5,V=-1;function H(){return C?!0:!(e.unstable_now()-V<I)}function Z(){if(C=!1,A){var N=e.unstable_now();V=N;var L=!0;try{e:{w=!1,j&&(j=!1,R(M),M=-1),b=!0;var $=x;try{t:{for(_(N),g=n(f);g!==null&&!(g.expirationTime>N&&H());){var q=g.callback;if(typeof q=="function"){g.callback=null,x=g.priorityLevel;var O=q(g.expirationTime<=N);if(N=e.unstable_now(),typeof O=="function"){g.callback=O,_(N),L=!0;break t}g===n(f)&&r(f),_(N)}else r(f);g=n(f)}if(g!==null)L=!0;else{var F=n(p);F!==null&&W(P,F.startTime-N),L=!1}}break e}finally{g=null,x=$,b=!1}L=void 0}}finally{L?K():A=!1}}}var K;if(typeof T=="function")K=function(){T(Z)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,B=Q.port2;Q.port1.onmessage=Z,K=function(){B.postMessage(null)}}else K=function(){E(Z,0)};function W(N,L){M=E(function(){N(e.unstable_now())},L)}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_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"):I=0<N?Math.floor(1e3/N):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(N){switch(x){case 1:case 2:case 3:var L=3;break;default:L=x}var $=x;x=L;try{return N()}finally{x=$}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(N,L){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var $=x;x=N;try{return L()}finally{x=$}},e.unstable_scheduleCallback=function(N,L,$){var q=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?q+$:q):$=q,N){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=$+O,N={id:m++,callback:L,priorityLevel:N,startTime:$,expirationTime:O,sortIndex:-1},$>q?(N.sortIndex=$,t(p,N),n(f)===null&&N===n(p)&&(j?(R(M),M=-1):j=!0,W(P,$-q))):(N.sortIndex=O,t(f,N),w||b||(w=!0,A||(A=!0,K()))),N},e.unstable_shouldYield=H,e.unstable_wrapCallback=function(N){var L=x;return function(){var $=x;x=L;try{return N.apply(this,arguments)}finally{x=$}}}})(fy)),fy}var pT;function _X(){return pT||(pT=1,dy.exports=RX()),dy.exports}/**
550
+ * @license React
551
+ * react-dom-client.production.js
552
+ *
553
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
554
+ *
555
+ * This source code is licensed under the MIT license found in the
556
+ * LICENSE file in the root directory of this source tree.
557
+ */var mT;function DX(){if(mT)return $u;mT=1;var e=_X(),t=gx(),n=IR();function r(o){var l="https://react.dev/errors/"+o;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)l+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+o+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(o){return!(!o||o.nodeType!==1&&o.nodeType!==9&&o.nodeType!==11)}function s(o){var l=o,u=o;if(o.alternate)for(;l.return;)l=l.return;else{o=l;do l=o,(l.flags&4098)!==0&&(u=l.return),o=l.return;while(o)}return l.tag===3?u:null}function c(o){if(o.tag===13){var l=o.memoizedState;if(l===null&&(o=o.alternate,o!==null&&(l=o.memoizedState)),l!==null)return l.dehydrated}return null}function d(o){if(s(o)!==o)throw Error(r(188))}function f(o){var l=o.alternate;if(!l){if(l=s(o),l===null)throw Error(r(188));return l!==o?null:o}for(var u=o,h=l;;){var y=u.return;if(y===null)break;var S=y.alternate;if(S===null){if(h=y.return,h!==null){u=h;continue}break}if(y.child===S.child){for(S=y.child;S;){if(S===u)return d(y),o;if(S===h)return d(y),l;S=S.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=S;else{for(var D=!1,k=y.child;k;){if(k===u){D=!0,u=y,h=S;break}if(k===h){D=!0,h=y,u=S;break}k=k.sibling}if(!D){for(k=S.child;k;){if(k===u){D=!0,u=S,h=y;break}if(k===h){D=!0,h=S,u=y;break}k=k.sibling}if(!D)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?o:l}function p(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o;for(o=o.child;o!==null;){if(l=p(o),l!==null)return l;o=o.sibling}return null}var m=Object.assign,g=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.provider"),R=Symbol.for("react.consumer"),T=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),H=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function K(o){return o===null||typeof o!="object"?null:(o=Z&&o[Z]||o["@@iterator"],typeof o=="function"?o:null)}var Q=Symbol.for("react.client.reference");function B(o){if(o==null)return null;if(typeof o=="function")return o.$$typeof===Q?null:o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case w:return"Fragment";case C:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case V:return"Activity"}if(typeof o=="object")switch(o.$$typeof){case b:return"Portal";case T:return(o.displayName||"Context")+".Provider";case R:return(o._context.displayName||"Context")+".Consumer";case _:var l=o.render;return o=o.displayName,o||(o=l.displayName||l.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case M:return l=o.displayName||null,l!==null?l:B(o.type)||"Memo";case I:l=o._payload,o=o._init;try{return B(o(l))}catch{}}return null}var W=Array.isArray,N=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},q=[],O=-1;function F(o){return{current:o}}function te(o){0>O||(o.current=q[O],q[O]=null,O--)}function ae(o,l){O++,q[O]=o.current,o.current=l}var je=F(null),xe=F(null),we=F(null),Ge=F(null);function Ee(o,l){switch(ae(we,l),ae(xe,o),ae(je,null),l.nodeType){case 9:case 11:o=(o=l.documentElement)&&(o=o.namespaceURI)?hj(o):0;break;default:if(o=l.tagName,l=l.namespaceURI)l=hj(l),o=pj(l,o);else switch(o){case"svg":o=1;break;case"math":o=2;break;default:o=0}}te(je),ae(je,o)}function ot(){te(je),te(xe),te(we)}function et(o){o.memoizedState!==null&&ae(Ge,o);var l=je.current,u=pj(l,o.type);l!==u&&(ae(xe,o),ae(je,u))}function Ct(o){xe.current===o&&(te(je),te(xe)),Ge.current===o&&(te(Ge),Ru._currentValue=$)}var Ot=Object.prototype.hasOwnProperty,Mt=e.unstable_scheduleCallback,pt=e.unstable_cancelCallback,Rt=e.unstable_shouldYield,en=e.unstable_requestPaint,Re=e.unstable_now,Ae=e.unstable_getCurrentPriorityLevel,Qe=e.unstable_ImmediatePriority,_e=e.unstable_UserBlockingPriority,he=e.unstable_NormalPriority,Se=e.unstable_LowPriority,$e=e.unstable_IdlePriority,be=e.log,Oe=e.unstable_setDisableYieldValue,_t=null,xt=null;function tn(o){if(typeof be=="function"&&Oe(o),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(_t,o)}catch{}}var Lt=Math.clz32?Math.clz32:Vo,In=Math.log,Dn=Math.LN2;function Vo(o){return o>>>=0,o===0?32:31-(In(o)/Dn|0)|0}var Eo=256,gi=4194304;function Mr(o){var l=o&42;if(l!==0)return l;switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return o&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return o}}function vi(o,l,u){var h=o.pendingLanes;if(h===0)return 0;var y=0,S=o.suspendedLanes,D=o.pingedLanes;o=o.warmLanes;var k=h&134217727;return k!==0?(h=k&~S,h!==0?y=Mr(h):(D&=k,D!==0?y=Mr(D):u||(u=k&~o,u!==0&&(y=Mr(u))))):(k=h&~S,k!==0?y=Mr(k):D!==0?y=Mr(D):u||(u=h&~o,u!==0&&(y=Mr(u)))),y===0?0:l!==0&&l!==y&&(l&S)===0&&(S=y&-y,u=l&-l,S>=u||S===32&&(u&4194048)!==0)?l:y}function Xr(o,l){return(o.pendingLanes&~(o.suspendedLanes&~o.pingedLanes)&l)===0}function dl(o,l){switch(o){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yi(){var o=Eo;return Eo<<=1,(Eo&4194048)===0&&(Eo=256),o}function aa(){var o=gi;return gi<<=1,(gi&62914560)===0&&(gi=4194304),o}function Fo(o){for(var l=[],u=0;31>u;u++)l.push(o);return l}function xr(o,l){o.pendingLanes|=l,l!==268435456&&(o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0)}function qn(o,l,u,h,y,S){var D=o.pendingLanes;o.pendingLanes=u,o.suspendedLanes=0,o.pingedLanes=0,o.warmLanes=0,o.expiredLanes&=u,o.entangledLanes&=u,o.errorRecoveryDisabledLanes&=u,o.shellSuspendCounter=0;var k=o.entanglements,z=o.expirationTimes,ee=o.hiddenUpdates;for(u=D&~u;0<u;){var de=31-Lt(u),pe=1<<de;k[de]=0,z[de]=-1;var ne=ee[de];if(ne!==null)for(ee[de]=null,de=0;de<ne.length;de++){var ie=ne[de];ie!==null&&(ie.lane&=-536870913)}u&=~pe}h!==0&&xi(o,h,0),S!==0&&y===0&&o.tag!==0&&(o.suspendedLanes|=S&~(D&~l))}function xi(o,l,u){o.pendingLanes|=l,o.suspendedLanes&=~l;var h=31-Lt(l);o.entangledLanes|=l,o.entanglements[h]=o.entanglements[h]|1073741824|u&4194090}function sa(o,l){var u=o.entangledLanes|=l;for(o=o.entanglements;u;){var h=31-Lt(u),y=1<<h;y&l|o[h]&l&&(o[h]|=l),u&=~y}}function ns(o){switch(o){case 2:o=1;break;case 8:o=4;break;case 32:o=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:o=128;break;case 268435456:o=134217728;break;default:o=0}return o}function rs(o){return o&=-o,2<o?8<o?(o&134217727)!==0?32:268435456:8:2}function U(){var o=L.p;return o!==0?o:(o=window.event,o===void 0?32:Nj(o.type))}function X(o,l){var u=L.p;try{return L.p=o,l()}finally{L.p=u}}var oe=Math.random().toString(36).slice(2),me="__reactFiber$"+oe,Te="__reactProps$"+oe,Ue="__reactContainer$"+oe,We="__reactEvents$"+oe,Fe="__reactListeners$"+oe,Ze="__reactHandles$"+oe,rt="__reactResources$"+oe,He="__reactMarker$"+oe;function Xe(o){delete o[me],delete o[Te],delete o[We],delete o[Fe],delete o[Ze]}function ft(o){var l=o[me];if(l)return l;for(var u=o.parentNode;u;){if(l=u[Ue]||u[me]){if(u=l.alternate,l.child!==null||u!==null&&u.child!==null)for(o=yj(o);o!==null;){if(u=o[me])return u;o=yj(o)}return l}o=u,u=o.parentNode}return null}function tt(o){if(o=o[me]||o[Ue]){var l=o.tag;if(l===5||l===6||l===13||l===26||l===27||l===3)return o}return null}function ln(o){var l=o.tag;if(l===5||l===26||l===27||l===6)return o.stateNode;throw Error(r(33))}function gn(o){var l=o[rt];return l||(l=o[rt]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function mt(o){o[He]=!0}var Yt=new Set,Ho={};function Ir(o,l){cr(o,l),cr(o+"Capture",l)}function cr(o,l){for(Ho[o]=l,o=0;o<l.length;o++)Yt.add(l[o])}var Zr=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),fl={},la={};function bi(o){return Ot.call(la,o)?!0:Ot.call(fl,o)?!1:Zr.test(o)?la[o]=!0:(fl[o]=!0,!1)}function Si(o,l,u){if(bi(l))if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":o.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){o.removeAttribute(l);return}}o.setAttribute(l,""+u)}}function wi(o,l,u){if(u===null)o.removeAttribute(l);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(l);return}o.setAttribute(l,""+u)}}function bt(o,l,u,h){if(h===null)o.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":o.removeAttribute(u);return}o.setAttributeNS(l,u,""+h)}}var Ln,os;function Jr(o){if(Ln===void 0)try{throw Error()}catch(u){var l=u.stack.trim().match(/\n( *(at )?)/);Ln=l&&l[1]||"",os=-1<u.stack.indexOf(`
558
+ at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
559
+ `+Ln+o+os}var bn=!1;function ca(o,l){if(!o||bn)return"";bn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ie){var ne=ie}Reflect.construct(o,[],pe)}else{try{pe.call()}catch(ie){ne=ie}o.call(pe.prototype)}}else{try{throw Error()}catch(ie){ne=ie}(pe=o())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ie){if(ie&&ne&&typeof ie.stack=="string")return[ie.stack,ne.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=h.DetermineComponentFrameRoot(),D=S[0],k=S[1];if(D&&k){var z=D.split(`
560
+ `),ee=k.split(`
561
+ `);for(y=h=0;h<z.length&&!z[h].includes("DetermineComponentFrameRoot");)h++;for(;y<ee.length&&!ee[y].includes("DetermineComponentFrameRoot");)y++;if(h===z.length||y===ee.length)for(h=z.length-1,y=ee.length-1;1<=h&&0<=y&&z[h]!==ee[y];)y--;for(;1<=h&&0<=y;h--,y--)if(z[h]!==ee[y]){if(h!==1||y!==1)do if(h--,y--,0>y||z[h]!==ee[y]){var de=`
562
+ `+z[h].replace(" at new "," at ");return o.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",o.displayName)),de}while(1<=h&&0<=y);break}}}finally{bn=!1,Error.prepareStackTrace=u}return(u=o?o.displayName||o.name:"")?Jr(u):""}function Vd(o){switch(o.tag){case 26:case 27:case 5:return Jr(o.type);case 16:return Jr("Lazy");case 13:return Jr("Suspense");case 19:return Jr("SuspenseList");case 0:case 15:return ca(o.type,!1);case 11:return ca(o.type.render,!1);case 1:return ca(o.type,!0);case 31:return Jr("Activity");default:return""}}function Fd(o){try{var l="";do l+=Vd(o),o=o.return;while(o);return l}catch(u){return`
563
+ Error generating stack: `+u.message+`
564
+ `+u.stack}}function eo(o){switch(typeof o){case"bigint":case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function l1(o){var l=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function hk(o){var l=l1(o)?"checked":"value",u=Object.getOwnPropertyDescriptor(o.constructor.prototype,l),h=""+o[l];if(!o.hasOwnProperty(l)&&typeof u<"u"&&typeof u.get=="function"&&typeof u.set=="function"){var y=u.get,S=u.set;return Object.defineProperty(o,l,{configurable:!0,get:function(){return y.call(this)},set:function(D){h=""+D,S.call(this,D)}}),Object.defineProperty(o,l,{enumerable:u.enumerable}),{getValue:function(){return h},setValue:function(D){h=""+D},stopTracking:function(){o._valueTracker=null,delete o[l]}}}}function Hd(o){o._valueTracker||(o._valueTracker=hk(o))}function c1(o){if(!o)return!1;var l=o._valueTracker;if(!l)return!0;var u=l.getValue(),h="";return o&&(h=l1(o)?o.checked?"true":"false":o.value),o=h,o!==u?(l.setValue(o),!0):!1}function qd(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}var pk=/[\n"\\]/g;function to(o){return o.replace(pk,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function jm(o,l,u,h,y,S,D,k){o.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?o.type=D:o.removeAttribute("type"),l!=null?D==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+eo(l)):o.value!==""+eo(l)&&(o.value=""+eo(l)):D!=="submit"&&D!=="reset"||o.removeAttribute("value"),l!=null?Cm(o,D,eo(l)):u!=null?Cm(o,D,eo(u)):h!=null&&o.removeAttribute("value"),y==null&&S!=null&&(o.defaultChecked=!!S),y!=null&&(o.checked=y&&typeof y!="function"&&typeof y!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?o.name=""+eo(k):o.removeAttribute("name")}function u1(o,l,u,h,y,S,D,k){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(o.type=S),l!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||l!=null))return;u=u!=null?""+eo(u):"",l=l!=null?""+eo(l):u,k||l===o.value||(o.value=l),o.defaultValue=l}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,o.checked=k?o.checked:!!h,o.defaultChecked=!!h,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(o.name=D)}function Cm(o,l,u){l==="number"&&qd(o.ownerDocument)===o||o.defaultValue===""+u||(o.defaultValue=""+u)}function hl(o,l,u,h){if(o=o.options,l){l={};for(var y=0;y<u.length;y++)l["$"+u[y]]=!0;for(u=0;u<o.length;u++)y=l.hasOwnProperty("$"+o[u].value),o[u].selected!==y&&(o[u].selected=y),y&&h&&(o[u].defaultSelected=!0)}else{for(u=""+eo(u),l=null,y=0;y<o.length;y++){if(o[y].value===u){o[y].selected=!0,h&&(o[y].defaultSelected=!0);return}l!==null||o[y].disabled||(l=o[y])}l!==null&&(l.selected=!0)}}function d1(o,l,u){if(l!=null&&(l=""+eo(l),l!==o.value&&(o.value=l),u==null)){o.defaultValue!==l&&(o.defaultValue=l);return}o.defaultValue=u!=null?""+eo(u):""}function f1(o,l,u,h){if(l==null){if(h!=null){if(u!=null)throw Error(r(92));if(W(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),l=u}u=eo(l),o.defaultValue=u,h=o.textContent,h===u&&h!==""&&h!==null&&(o.value=h)}function pl(o,l){if(l){var u=o.firstChild;if(u&&u===o.lastChild&&u.nodeType===3){u.nodeValue=l;return}}o.textContent=l}var mk=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function h1(o,l,u){var h=l.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?o.setProperty(l,""):l==="float"?o.cssFloat="":o[l]="":h?o.setProperty(l,u):typeof u!="number"||u===0||mk.has(l)?l==="float"?o.cssFloat=u:o[l]=(""+u).trim():o[l]=u+"px"}function p1(o,l,u){if(l!=null&&typeof l!="object")throw Error(r(62));if(o=o.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?o.setProperty(h,""):h==="float"?o.cssFloat="":o[h]="");for(var y in l)h=l[y],l.hasOwnProperty(y)&&u[y]!==h&&h1(o,y,h)}else for(var S in l)l.hasOwnProperty(S)&&h1(o,S,l[S])}function Em(o){if(o.indexOf("-")===-1)return!1;switch(o){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 gk=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vk=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Gd(o){return vk.test(""+o)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":o}var Tm=null;function Rm(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var ml=null,gl=null;function m1(o){var l=tt(o);if(l&&(o=l.stateNode)){var u=o[Te]||null;e:switch(o=l.stateNode,l.type){case"input":if(jm(o,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),l=u.name,u.type==="radio"&&l!=null){for(u=o;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+to(""+l)+'"][type="radio"]'),l=0;l<u.length;l++){var h=u[l];if(h!==o&&h.form===o.form){var y=h[Te]||null;if(!y)throw Error(r(90));jm(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(l=0;l<u.length;l++)h=u[l],h.form===o.form&&c1(h)}break e;case"textarea":d1(o,u.value,u.defaultValue);break e;case"select":l=u.value,l!=null&&hl(o,!!u.multiple,l,!1)}}}var _m=!1;function g1(o,l,u){if(_m)return o(l,u);_m=!0;try{var h=o(l);return h}finally{if(_m=!1,(ml!==null||gl!==null)&&(kf(),ml&&(l=ml,o=gl,gl=ml=null,m1(l),o)))for(l=0;l<o.length;l++)m1(o[l])}}function Uc(o,l){var u=o.stateNode;if(u===null)return null;var h=u[Te]||null;if(h===null)return null;u=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(o=o.type,h=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!h;break e;default:o=!1}if(o)return null;if(u&&typeof u!="function")throw Error(r(231,l,typeof u));return u}var ji=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Dm=!1;if(ji)try{var Bc={};Object.defineProperty(Bc,"passive",{get:function(){Dm=!0}}),window.addEventListener("test",Bc,Bc),window.removeEventListener("test",Bc,Bc)}catch{Dm=!1}var ua=null,Am=null,Wd=null;function v1(){if(Wd)return Wd;var o,l=Am,u=l.length,h,y="value"in ua?ua.value:ua.textContent,S=y.length;for(o=0;o<u&&l[o]===y[o];o++);var D=u-o;for(h=1;h<=D&&l[u-h]===y[S-h];h++);return Wd=y.slice(o,1<h?1-h:void 0)}function Qd(o){var l=o.keyCode;return"charCode"in o?(o=o.charCode,o===0&&l===13&&(o=13)):o=l,o===10&&(o=13),32<=o||o===13?o:0}function Yd(){return!0}function y1(){return!1}function br(o){function l(u,h,y,S,D){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=S,this.target=D,this.currentTarget=null;for(var k in o)o.hasOwnProperty(k)&&(u=o[k],this[k]=u?u(S):S[k]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Yd:y1,this.isPropagationStopped=y1,this}return m(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Yd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Yd)},persist:function(){},isPersistent:Yd}),l}var is={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(o){return o.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Kd=br(is),Vc=m({},is,{view:0,detail:0}),yk=br(Vc),Pm,km,Fc,Xd=m({},Vc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Om,button:0,buttons:0,relatedTarget:function(o){return o.relatedTarget===void 0?o.fromElement===o.srcElement?o.toElement:o.fromElement:o.relatedTarget},movementX:function(o){return"movementX"in o?o.movementX:(o!==Fc&&(Fc&&o.type==="mousemove"?(Pm=o.screenX-Fc.screenX,km=o.screenY-Fc.screenY):km=Pm=0,Fc=o),Pm)},movementY:function(o){return"movementY"in o?o.movementY:km}}),x1=br(Xd),xk=m({},Xd,{dataTransfer:0}),bk=br(xk),Sk=m({},Vc,{relatedTarget:0}),Nm=br(Sk),wk=m({},is,{animationName:0,elapsedTime:0,pseudoElement:0}),jk=br(wk),Ck=m({},is,{clipboardData:function(o){return"clipboardData"in o?o.clipboardData:window.clipboardData}}),Ek=br(Ck),Tk=m({},is,{data:0}),b1=br(Tk),Rk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_k={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"},Dk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ak(o){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(o):(o=Dk[o])?!!l[o]:!1}function Om(){return Ak}var Pk=m({},Vc,{key:function(o){if(o.key){var l=Rk[o.key]||o.key;if(l!=="Unidentified")return l}return o.type==="keypress"?(o=Qd(o),o===13?"Enter":String.fromCharCode(o)):o.type==="keydown"||o.type==="keyup"?_k[o.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Om,charCode:function(o){return o.type==="keypress"?Qd(o):0},keyCode:function(o){return o.type==="keydown"||o.type==="keyup"?o.keyCode:0},which:function(o){return o.type==="keypress"?Qd(o):o.type==="keydown"||o.type==="keyup"?o.keyCode:0}}),kk=br(Pk),Nk=m({},Xd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),S1=br(Nk),Ok=m({},Vc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Om}),Mk=br(Ok),Ik=m({},is,{propertyName:0,elapsedTime:0,pseudoElement:0}),Lk=br(Ik),$k=m({},Xd,{deltaX:function(o){return"deltaX"in o?o.deltaX:"wheelDeltaX"in o?-o.wheelDeltaX:0},deltaY:function(o){return"deltaY"in o?o.deltaY:"wheelDeltaY"in o?-o.wheelDeltaY:"wheelDelta"in o?-o.wheelDelta:0},deltaZ:0,deltaMode:0}),zk=br($k),Uk=m({},is,{newState:0,oldState:0}),Bk=br(Uk),Vk=[9,13,27,32],Mm=ji&&"CompositionEvent"in window,Hc=null;ji&&"documentMode"in document&&(Hc=document.documentMode);var Fk=ji&&"TextEvent"in window&&!Hc,w1=ji&&(!Mm||Hc&&8<Hc&&11>=Hc),j1=" ",C1=!1;function E1(o,l){switch(o){case"keyup":return Vk.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T1(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var vl=!1;function Hk(o,l){switch(o){case"compositionend":return T1(l);case"keypress":return l.which!==32?null:(C1=!0,j1);case"textInput":return o=l.data,o===j1&&C1?null:o;default:return null}}function qk(o,l){if(vl)return o==="compositionend"||!Mm&&E1(o,l)?(o=v1(),Wd=Am=ua=null,vl=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return w1&&l.locale!=="ko"?null:l.data;default:return null}}var Gk={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 R1(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l==="input"?!!Gk[o.type]:l==="textarea"}function _1(o,l,u,h){ml?gl?gl.push(h):gl=[h]:ml=h,l=$f(l,"onChange"),0<l.length&&(u=new Kd("onChange","change",null,u,h),o.push({event:u,listeners:l}))}var qc=null,Gc=null;function Wk(o){lj(o,0)}function Zd(o){var l=ln(o);if(c1(l))return o}function D1(o,l){if(o==="change")return l}var A1=!1;if(ji){var Im;if(ji){var Lm="oninput"in document;if(!Lm){var P1=document.createElement("div");P1.setAttribute("oninput","return;"),Lm=typeof P1.oninput=="function"}Im=Lm}else Im=!1;A1=Im&&(!document.documentMode||9<document.documentMode)}function k1(){qc&&(qc.detachEvent("onpropertychange",N1),Gc=qc=null)}function N1(o){if(o.propertyName==="value"&&Zd(Gc)){var l=[];_1(l,Gc,o,Rm(o)),g1(Wk,l)}}function Qk(o,l,u){o==="focusin"?(k1(),qc=l,Gc=u,qc.attachEvent("onpropertychange",N1)):o==="focusout"&&k1()}function Yk(o){if(o==="selectionchange"||o==="keyup"||o==="keydown")return Zd(Gc)}function Kk(o,l){if(o==="click")return Zd(l)}function Xk(o,l){if(o==="input"||o==="change")return Zd(l)}function Zk(o,l){return o===l&&(o!==0||1/o===1/l)||o!==o&&l!==l}var Lr=typeof Object.is=="function"?Object.is:Zk;function Wc(o,l){if(Lr(o,l))return!0;if(typeof o!="object"||o===null||typeof l!="object"||l===null)return!1;var u=Object.keys(o),h=Object.keys(l);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Ot.call(l,y)||!Lr(o[y],l[y]))return!1}return!0}function O1(o){for(;o&&o.firstChild;)o=o.firstChild;return o}function M1(o,l){var u=O1(o);o=0;for(var h;u;){if(u.nodeType===3){if(h=o+u.textContent.length,o<=l&&h>=l)return{node:u,offset:l-o};o=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=O1(u)}}function I1(o,l){return o&&l?o===l?!0:o&&o.nodeType===3?!1:l&&l.nodeType===3?I1(o,l.parentNode):"contains"in o?o.contains(l):o.compareDocumentPosition?!!(o.compareDocumentPosition(l)&16):!1:!1}function L1(o){o=o!=null&&o.ownerDocument!=null&&o.ownerDocument.defaultView!=null?o.ownerDocument.defaultView:window;for(var l=qd(o.document);l instanceof o.HTMLIFrameElement;){try{var u=typeof l.contentWindow.location.href=="string"}catch{u=!1}if(u)o=l.contentWindow;else break;l=qd(o.document)}return l}function $m(o){var l=o&&o.nodeName&&o.nodeName.toLowerCase();return l&&(l==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||l==="textarea"||o.contentEditable==="true")}var Jk=ji&&"documentMode"in document&&11>=document.documentMode,yl=null,zm=null,Qc=null,Um=!1;function $1(o,l,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Um||yl==null||yl!==qd(h)||(h=yl,"selectionStart"in h&&$m(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Qc&&Wc(Qc,h)||(Qc=h,h=$f(zm,"onSelect"),0<h.length&&(l=new Kd("onSelect","select",null,l,u),o.push({event:l,listeners:h}),l.target=yl)))}function as(o,l){var u={};return u[o.toLowerCase()]=l.toLowerCase(),u["Webkit"+o]="webkit"+l,u["Moz"+o]="moz"+l,u}var xl={animationend:as("Animation","AnimationEnd"),animationiteration:as("Animation","AnimationIteration"),animationstart:as("Animation","AnimationStart"),transitionrun:as("Transition","TransitionRun"),transitionstart:as("Transition","TransitionStart"),transitioncancel:as("Transition","TransitionCancel"),transitionend:as("Transition","TransitionEnd")},Bm={},z1={};ji&&(z1=document.createElement("div").style,"AnimationEvent"in window||(delete xl.animationend.animation,delete xl.animationiteration.animation,delete xl.animationstart.animation),"TransitionEvent"in window||delete xl.transitionend.transition);function ss(o){if(Bm[o])return Bm[o];if(!xl[o])return o;var l=xl[o],u;for(u in l)if(l.hasOwnProperty(u)&&u in z1)return Bm[o]=l[u];return o}var U1=ss("animationend"),B1=ss("animationiteration"),V1=ss("animationstart"),eN=ss("transitionrun"),tN=ss("transitionstart"),nN=ss("transitioncancel"),F1=ss("transitionend"),H1=new Map,Vm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Vm.push("scrollEnd");function To(o,l){H1.set(o,l),Ir(l,[o])}var q1=new WeakMap;function no(o,l){if(typeof o=="object"&&o!==null){var u=q1.get(o);return u!==void 0?u:(l={value:o,source:l,stack:Fd(l)},q1.set(o,l),l)}return{value:o,source:l,stack:Fd(l)}}var ro=[],bl=0,Fm=0;function Jd(){for(var o=bl,l=Fm=bl=0;l<o;){var u=ro[l];ro[l++]=null;var h=ro[l];ro[l++]=null;var y=ro[l];ro[l++]=null;var S=ro[l];if(ro[l++]=null,h!==null&&y!==null){var D=h.pending;D===null?y.next=y:(y.next=D.next,D.next=y),h.pending=y}S!==0&&G1(u,y,S)}}function ef(o,l,u,h){ro[bl++]=o,ro[bl++]=l,ro[bl++]=u,ro[bl++]=h,Fm|=h,o.lanes|=h,o=o.alternate,o!==null&&(o.lanes|=h)}function Hm(o,l,u,h){return ef(o,l,u,h),tf(o)}function Sl(o,l){return ef(o,null,null,l),tf(o)}function G1(o,l,u){o.lanes|=u;var h=o.alternate;h!==null&&(h.lanes|=u);for(var y=!1,S=o.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.childLanes|=u),S.tag===22&&(o=S.stateNode,o===null||o._visibility&1||(y=!0)),o=S,S=S.return;return o.tag===3?(S=o.stateNode,y&&l!==null&&(y=31-Lt(u),o=S.hiddenUpdates,h=o[y],h===null?o[y]=[l]:h.push(l),l.lane=u|536870912),S):null}function tf(o){if(50<xu)throw xu=0,Kg=null,Error(r(185));for(var l=o.return;l!==null;)o=l,l=o.return;return o.tag===3?o.stateNode:null}var wl={};function rN(o,l,u,h){this.tag=o,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $r(o,l,u,h){return new rN(o,l,u,h)}function qm(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Ci(o,l){var u=o.alternate;return u===null?(u=$r(o.tag,l,o.key,o.mode),u.elementType=o.elementType,u.type=o.type,u.stateNode=o.stateNode,u.alternate=o,o.alternate=u):(u.pendingProps=l,u.type=o.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=o.flags&65011712,u.childLanes=o.childLanes,u.lanes=o.lanes,u.child=o.child,u.memoizedProps=o.memoizedProps,u.memoizedState=o.memoizedState,u.updateQueue=o.updateQueue,l=o.dependencies,u.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},u.sibling=o.sibling,u.index=o.index,u.ref=o.ref,u.refCleanup=o.refCleanup,u}function W1(o,l){o.flags&=65011714;var u=o.alternate;return u===null?(o.childLanes=0,o.lanes=l,o.child=null,o.subtreeFlags=0,o.memoizedProps=null,o.memoizedState=null,o.updateQueue=null,o.dependencies=null,o.stateNode=null):(o.childLanes=u.childLanes,o.lanes=u.lanes,o.child=u.child,o.subtreeFlags=0,o.deletions=null,o.memoizedProps=u.memoizedProps,o.memoizedState=u.memoizedState,o.updateQueue=u.updateQueue,o.type=u.type,l=u.dependencies,o.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),o}function nf(o,l,u,h,y,S){var D=0;if(h=o,typeof o=="function")qm(o)&&(D=1);else if(typeof o=="string")D=i4(o,u,je.current)?26:o==="html"||o==="head"||o==="body"?27:5;else e:switch(o){case V:return o=$r(31,u,l,y),o.elementType=V,o.lanes=S,o;case w:return ls(u.children,y,S,l);case j:D=8,y|=24;break;case C:return o=$r(12,u,l,y|2),o.elementType=C,o.lanes=S,o;case P:return o=$r(13,u,l,y),o.elementType=P,o.lanes=S,o;case A:return o=$r(19,u,l,y),o.elementType=A,o.lanes=S,o;default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case E:case T:D=10;break e;case R:D=9;break e;case _:D=11;break e;case M:D=14;break e;case I:D=16,h=null;break e}D=29,u=Error(r(130,o===null?"null":typeof o,"")),h=null}return l=$r(D,u,l,y),l.elementType=o,l.type=h,l.lanes=S,l}function ls(o,l,u,h){return o=$r(7,o,h,l),o.lanes=u,o}function Gm(o,l,u){return o=$r(6,o,null,l),o.lanes=u,o}function Wm(o,l,u){return l=$r(4,o.children!==null?o.children:[],o.key,l),l.lanes=u,l.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},l}var jl=[],Cl=0,rf=null,of=0,oo=[],io=0,cs=null,Ei=1,Ti="";function us(o,l){jl[Cl++]=of,jl[Cl++]=rf,rf=o,of=l}function Q1(o,l,u){oo[io++]=Ei,oo[io++]=Ti,oo[io++]=cs,cs=o;var h=Ei;o=Ti;var y=32-Lt(h)-1;h&=~(1<<y),u+=1;var S=32-Lt(l)+y;if(30<S){var D=y-y%5;S=(h&(1<<D)-1).toString(32),h>>=D,y-=D,Ei=1<<32-Lt(l)+y|u<<y|h,Ti=S+o}else Ei=1<<S|u<<y|h,Ti=o}function Qm(o){o.return!==null&&(us(o,1),Q1(o,1,0))}function Ym(o){for(;o===rf;)rf=jl[--Cl],jl[Cl]=null,of=jl[--Cl],jl[Cl]=null;for(;o===cs;)cs=oo[--io],oo[io]=null,Ti=oo[--io],oo[io]=null,Ei=oo[--io],oo[io]=null}var ur=null,Tn=null,Vt=!1,ds=null,qo=!1,Km=Error(r(519));function fs(o){var l=Error(r(418,""));throw Xc(no(l,o)),Km}function Y1(o){var l=o.stateNode,u=o.type,h=o.memoizedProps;switch(l[me]=o,l[Te]=h,u){case"dialog":Tt("cancel",l),Tt("close",l);break;case"iframe":case"object":case"embed":Tt("load",l);break;case"video":case"audio":for(u=0;u<Su.length;u++)Tt(Su[u],l);break;case"source":Tt("error",l);break;case"img":case"image":case"link":Tt("error",l),Tt("load",l);break;case"details":Tt("toggle",l);break;case"input":Tt("invalid",l),u1(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0),Hd(l);break;case"select":Tt("invalid",l);break;case"textarea":Tt("invalid",l),f1(l,h.value,h.defaultValue,h.children),Hd(l)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||l.textContent===""+u||h.suppressHydrationWarning===!0||fj(l.textContent,u)?(h.popover!=null&&(Tt("beforetoggle",l),Tt("toggle",l)),h.onScroll!=null&&Tt("scroll",l),h.onScrollEnd!=null&&Tt("scrollend",l),h.onClick!=null&&(l.onclick=zf),l=!0):l=!1,l||fs(o)}function K1(o){for(ur=o.return;ur;)switch(ur.tag){case 5:case 13:qo=!1;return;case 27:case 3:qo=!0;return;default:ur=ur.return}}function Yc(o){if(o!==ur)return!1;if(!Vt)return K1(o),Vt=!0,!1;var l=o.tag,u;if((u=l!==3&&l!==27)&&((u=l===5)&&(u=o.type,u=!(u!=="form"&&u!=="button")||fv(o.type,o.memoizedProps)),u=!u),u&&Tn&&fs(o),K1(o),l===13){if(o=o.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(r(317));e:{for(o=o.nextSibling,l=0;o;){if(o.nodeType===8)if(u=o.data,u==="/$"){if(l===0){Tn=_o(o.nextSibling);break e}l--}else u!=="$"&&u!=="$!"&&u!=="$?"||l++;o=o.nextSibling}Tn=null}}else l===27?(l=Tn,Ta(o.type)?(o=gv,gv=null,Tn=o):Tn=l):Tn=ur?_o(o.stateNode.nextSibling):null;return!0}function Kc(){Tn=ur=null,Vt=!1}function X1(){var o=ds;return o!==null&&(jr===null?jr=o:jr.push.apply(jr,o),ds=null),o}function Xc(o){ds===null?ds=[o]:ds.push(o)}var Xm=F(null),hs=null,Ri=null;function da(o,l,u){ae(Xm,l._currentValue),l._currentValue=u}function _i(o){o._currentValue=Xm.current,te(Xm)}function Zm(o,l,u){for(;o!==null;){var h=o.alternate;if((o.childLanes&l)!==l?(o.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),o===u)break;o=o.return}}function Jm(o,l,u,h){var y=o.child;for(y!==null&&(y.return=o);y!==null;){var S=y.dependencies;if(S!==null){var D=y.child;S=S.firstContext;e:for(;S!==null;){var k=S;S=y;for(var z=0;z<l.length;z++)if(k.context===l[z]){S.lanes|=u,k=S.alternate,k!==null&&(k.lanes|=u),Zm(S.return,u,o),h||(D=null);break e}S=k.next}}else if(y.tag===18){if(D=y.return,D===null)throw Error(r(341));D.lanes|=u,S=D.alternate,S!==null&&(S.lanes|=u),Zm(D,u,o),D=null}else D=y.child;if(D!==null)D.return=y;else for(D=y;D!==null;){if(D===o){D=null;break}if(y=D.sibling,y!==null){y.return=D.return,D=y;break}D=D.return}y=D}}function Zc(o,l,u,h){o=null;for(var y=l,S=!1;y!==null;){if(!S){if((y.flags&524288)!==0)S=!0;else if((y.flags&262144)!==0)break}if(y.tag===10){var D=y.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var k=y.type;Lr(y.pendingProps.value,D.value)||(o!==null?o.push(k):o=[k])}}else if(y===Ge.current){if(D=y.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(o!==null?o.push(Ru):o=[Ru])}y=y.return}o!==null&&Jm(l,o,u,h),l.flags|=262144}function af(o){for(o=o.firstContext;o!==null;){if(!Lr(o.context._currentValue,o.memoizedValue))return!0;o=o.next}return!1}function ps(o){hs=o,Ri=null,o=o.dependencies,o!==null&&(o.firstContext=null)}function tr(o){return Z1(hs,o)}function sf(o,l){return hs===null&&ps(o),Z1(o,l)}function Z1(o,l){var u=l._currentValue;if(l={context:l,memoizedValue:u,next:null},Ri===null){if(o===null)throw Error(r(308));Ri=l,o.dependencies={lanes:0,firstContext:l},o.flags|=524288}else Ri=Ri.next=l;return u}var oN=typeof AbortController<"u"?AbortController:function(){var o=[],l=this.signal={aborted:!1,addEventListener:function(u,h){o.push(h)}};this.abort=function(){l.aborted=!0,o.forEach(function(u){return u()})}},iN=e.unstable_scheduleCallback,aN=e.unstable_NormalPriority,Fn={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function eg(){return{controller:new oN,data:new Map,refCount:0}}function Jc(o){o.refCount--,o.refCount===0&&iN(aN,function(){o.controller.abort()})}var eu=null,tg=0,El=0,Tl=null;function sN(o,l){if(eu===null){var u=eu=[];tg=0,El=rv(),Tl={status:"pending",value:void 0,then:function(h){u.push(h)}}}return tg++,l.then(J1,J1),l}function J1(){if(--tg===0&&eu!==null){Tl!==null&&(Tl.status="fulfilled");var o=eu;eu=null,El=0,Tl=null;for(var l=0;l<o.length;l++)(0,o[l])()}}function lN(o,l){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return o.then(function(){h.status="fulfilled",h.value=l;for(var y=0;y<u.length;y++)(0,u[y])(l)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var eS=N.S;N.S=function(o,l){typeof l=="object"&&l!==null&&typeof l.then=="function"&&sN(o,l),eS!==null&&eS(o,l)};var ms=F(null);function ng(){var o=ms.current;return o!==null?o:cn.pooledCache}function lf(o,l){l===null?ae(ms,ms.current):ae(ms,l.pool)}function tS(){var o=ng();return o===null?null:{parent:Fn._currentValue,pool:o}}var tu=Error(r(460)),nS=Error(r(474)),cf=Error(r(542)),rg={then:function(){}};function rS(o){return o=o.status,o==="fulfilled"||o==="rejected"}function uf(){}function oS(o,l,u){switch(u=o[u],u===void 0?o.push(l):u!==l&&(l.then(uf,uf),l=u),l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,aS(o),o;default:if(typeof l.status=="string")l.then(uf,uf);else{if(o=cn,o!==null&&100<o.shellSuspendCounter)throw Error(r(482));o=l,o.status="pending",o.then(function(h){if(l.status==="pending"){var y=l;y.status="fulfilled",y.value=h}},function(h){if(l.status==="pending"){var y=l;y.status="rejected",y.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw o=l.reason,aS(o),o}throw nu=l,tu}}var nu=null;function iS(){if(nu===null)throw Error(r(459));var o=nu;return nu=null,o}function aS(o){if(o===tu||o===cf)throw Error(r(483))}var fa=!1;function og(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ig(o,l){o=o.updateQueue,l.updateQueue===o&&(l.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,callbacks:null})}function ha(o){return{lane:o,tag:0,payload:null,callback:null,next:null}}function pa(o,l,u){var h=o.updateQueue;if(h===null)return null;if(h=h.shared,(Gt&2)!==0){var y=h.pending;return y===null?l.next=l:(l.next=y.next,y.next=l),h.pending=l,l=tf(o),G1(o,null,u),l}return ef(o,h,l,u),tf(o)}function ru(o,l,u){if(l=l.updateQueue,l!==null&&(l=l.shared,(u&4194048)!==0)){var h=l.lanes;h&=o.pendingLanes,u|=h,l.lanes=u,sa(o,u)}}function ag(o,l){var u=o.updateQueue,h=o.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=D:S=S.next=D,u=u.next}while(u!==null);S===null?y=S=l:S=S.next=l}else y=S=l;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},o.updateQueue=u;return}o=u.lastBaseUpdate,o===null?u.firstBaseUpdate=l:o.next=l,u.lastBaseUpdate=l}var sg=!1;function ou(){if(sg){var o=Tl;if(o!==null)throw o}}function iu(o,l,u,h){sg=!1;var y=o.updateQueue;fa=!1;var S=y.firstBaseUpdate,D=y.lastBaseUpdate,k=y.shared.pending;if(k!==null){y.shared.pending=null;var z=k,ee=z.next;z.next=null,D===null?S=ee:D.next=ee,D=z;var de=o.alternate;de!==null&&(de=de.updateQueue,k=de.lastBaseUpdate,k!==D&&(k===null?de.firstBaseUpdate=ee:k.next=ee,de.lastBaseUpdate=z))}if(S!==null){var pe=y.baseState;D=0,de=ee=z=null,k=S;do{var ne=k.lane&-536870913,ie=ne!==k.lane;if(ie?(Pt&ne)===ne:(h&ne)===ne){ne!==0&&ne===El&&(sg=!0),de!==null&&(de=de.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ct=o,it=k;ne=l;var Zt=u;switch(it.tag){case 1:if(ct=it.payload,typeof ct=="function"){pe=ct.call(Zt,pe,ne);break e}pe=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=it.payload,ne=typeof ct=="function"?ct.call(Zt,pe,ne):ct,ne==null)break e;pe=m({},pe,ne);break e;case 2:fa=!0}}ne=k.callback,ne!==null&&(o.flags|=64,ie&&(o.flags|=8192),ie=y.callbacks,ie===null?y.callbacks=[ne]:ie.push(ne))}else ie={lane:ne,tag:k.tag,payload:k.payload,callback:k.callback,next:null},de===null?(ee=de=ie,z=pe):de=de.next=ie,D|=ne;if(k=k.next,k===null){if(k=y.shared.pending,k===null)break;ie=k,k=ie.next,ie.next=null,y.lastBaseUpdate=ie,y.shared.pending=null}}while(!0);de===null&&(z=pe),y.baseState=z,y.firstBaseUpdate=ee,y.lastBaseUpdate=de,S===null&&(y.shared.lanes=0),wa|=D,o.lanes=D,o.memoizedState=pe}}function sS(o,l){if(typeof o!="function")throw Error(r(191,o));o.call(l)}function lS(o,l){var u=o.callbacks;if(u!==null)for(o.callbacks=null,o=0;o<u.length;o++)sS(u[o],l)}var Rl=F(null),df=F(0);function cS(o,l){o=Mi,ae(df,o),ae(Rl,l),Mi=o|l.baseLanes}function lg(){ae(df,Mi),ae(Rl,Rl.current)}function cg(){Mi=df.current,te(Rl),te(df)}var ma=0,St=null,Kt=null,$n=null,ff=!1,_l=!1,gs=!1,hf=0,au=0,Dl=null,cN=0;function An(){throw Error(r(321))}function ug(o,l){if(l===null)return!1;for(var u=0;u<l.length&&u<o.length;u++)if(!Lr(o[u],l[u]))return!1;return!0}function dg(o,l,u,h,y,S){return ma=S,St=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,N.H=o===null||o.memoizedState===null?GS:WS,gs=!1,S=u(h,y),gs=!1,_l&&(S=dS(l,u,h,y)),uS(o),S}function uS(o){N.H=xf;var l=Kt!==null&&Kt.next!==null;if(ma=0,$n=Kt=St=null,ff=!1,au=0,Dl=null,l)throw Error(r(300));o===null||Gn||(o=o.dependencies,o!==null&&af(o)&&(Gn=!0))}function dS(o,l,u,h){St=o;var y=0;do{if(_l&&(Dl=null),au=0,_l=!1,25<=y)throw Error(r(301));if(y+=1,$n=Kt=null,o.updateQueue!=null){var S=o.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}N.H=gN,S=l(u,h)}while(_l);return S}function uN(){var o=N.H,l=o.useState()[0];return l=typeof l.then=="function"?su(l):l,o=o.useState()[0],(Kt!==null?Kt.memoizedState:null)!==o&&(St.flags|=1024),l}function fg(){var o=hf!==0;return hf=0,o}function hg(o,l,u){l.updateQueue=o.updateQueue,l.flags&=-2053,o.lanes&=~u}function pg(o){if(ff){for(o=o.memoizedState;o!==null;){var l=o.queue;l!==null&&(l.pending=null),o=o.next}ff=!1}ma=0,$n=Kt=St=null,_l=!1,au=hf=0,Dl=null}function Sr(){var o={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return $n===null?St.memoizedState=$n=o:$n=$n.next=o,$n}function zn(){if(Kt===null){var o=St.alternate;o=o!==null?o.memoizedState:null}else o=Kt.next;var l=$n===null?St.memoizedState:$n.next;if(l!==null)$n=l,Kt=o;else{if(o===null)throw St.alternate===null?Error(r(467)):Error(r(310));Kt=o,o={memoizedState:Kt.memoizedState,baseState:Kt.baseState,baseQueue:Kt.baseQueue,queue:Kt.queue,next:null},$n===null?St.memoizedState=$n=o:$n=$n.next=o}return $n}function mg(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function su(o){var l=au;return au+=1,Dl===null&&(Dl=[]),o=oS(Dl,o,l),l=St,($n===null?l.memoizedState:$n.next)===null&&(l=l.alternate,N.H=l===null||l.memoizedState===null?GS:WS),o}function pf(o){if(o!==null&&typeof o=="object"){if(typeof o.then=="function")return su(o);if(o.$$typeof===T)return tr(o)}throw Error(r(438,String(o)))}function gg(o){var l=null,u=St.updateQueue;if(u!==null&&(l=u.memoCache),l==null){var h=St.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(y){return y.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),u===null&&(u=mg(),St.updateQueue=u),u.memoCache=l,u=l.data[l.index],u===void 0)for(u=l.data[l.index]=Array(o),h=0;h<o;h++)u[h]=H;return l.index++,u}function Di(o,l){return typeof l=="function"?l(o):l}function mf(o){var l=zn();return vg(l,Kt,o)}function vg(o,l,u){var h=o.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=o.baseQueue,S=h.pending;if(S!==null){if(y!==null){var D=y.next;y.next=S.next,S.next=D}l.baseQueue=y=S,h.pending=null}if(S=o.baseState,y===null)o.memoizedState=S;else{l=y.next;var k=D=null,z=null,ee=l,de=!1;do{var pe=ee.lane&-536870913;if(pe!==ee.lane?(Pt&pe)===pe:(ma&pe)===pe){var ne=ee.revertLane;if(ne===0)z!==null&&(z=z.next={lane:0,revertLane:0,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),pe===El&&(de=!0);else if((ma&ne)===ne){ee=ee.next,ne===El&&(de=!0);continue}else pe={lane:0,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(k=z=pe,D=S):z=z.next=pe,St.lanes|=ne,wa|=ne;pe=ee.action,gs&&u(S,pe),S=ee.hasEagerState?ee.eagerState:u(S,pe)}else ne={lane:pe,revertLane:ee.revertLane,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(k=z=ne,D=S):z=z.next=ne,St.lanes|=pe,wa|=pe;ee=ee.next}while(ee!==null&&ee!==l);if(z===null?D=S:z.next=k,!Lr(S,o.memoizedState)&&(Gn=!0,de&&(u=Tl,u!==null)))throw u;o.memoizedState=S,o.baseState=D,o.baseQueue=z,h.lastRenderedState=S}return y===null&&(h.lanes=0),[o.memoizedState,h.dispatch]}function yg(o){var l=zn(),u=l.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=o;var h=u.dispatch,y=u.pending,S=l.memoizedState;if(y!==null){u.pending=null;var D=y=y.next;do S=o(S,D.action),D=D.next;while(D!==y);Lr(S,l.memoizedState)||(Gn=!0),l.memoizedState=S,l.baseQueue===null&&(l.baseState=S),u.lastRenderedState=S}return[S,h]}function fS(o,l,u){var h=St,y=zn(),S=Vt;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=l();var D=!Lr((Kt||y).memoizedState,u);D&&(y.memoizedState=u,Gn=!0),y=y.queue;var k=mS.bind(null,h,y,o);if(lu(2048,8,k,[o]),y.getSnapshot!==l||D||$n!==null&&$n.memoizedState.tag&1){if(h.flags|=2048,Al(9,gf(),pS.bind(null,h,y,u,l),null),cn===null)throw Error(r(349));S||(ma&124)!==0||hS(h,l,u)}return u}function hS(o,l,u){o.flags|=16384,o={getSnapshot:l,value:u},l=St.updateQueue,l===null?(l=mg(),St.updateQueue=l,l.stores=[o]):(u=l.stores,u===null?l.stores=[o]:u.push(o))}function pS(o,l,u,h){l.value=u,l.getSnapshot=h,gS(l)&&vS(o)}function mS(o,l,u){return u(function(){gS(l)&&vS(o)})}function gS(o){var l=o.getSnapshot;o=o.value;try{var u=l();return!Lr(o,u)}catch{return!0}}function vS(o){var l=Sl(o,2);l!==null&&Fr(l,o,2)}function xg(o){var l=Sr();if(typeof o=="function"){var u=o;if(o=u(),gs){tn(!0);try{u()}finally{tn(!1)}}}return l.memoizedState=l.baseState=o,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:o},l}function yS(o,l,u,h){return o.baseState=u,vg(o,Kt,typeof h=="function"?h:Di)}function dN(o,l,u,h,y){if(yf(o))throw Error(r(485));if(o=l.action,o!==null){var S={payload:y,action:o,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){S.listeners.push(D)}};N.T!==null?u(!0):S.isTransition=!1,h(S),u=l.pending,u===null?(S.next=l.pending=S,xS(l,S)):(S.next=u.next,l.pending=u.next=S)}}function xS(o,l){var u=l.action,h=l.payload,y=o.state;if(l.isTransition){var S=N.T,D={};N.T=D;try{var k=u(y,h),z=N.S;z!==null&&z(D,k),bS(o,l,k)}catch(ee){bg(o,l,ee)}finally{N.T=S}}else try{S=u(y,h),bS(o,l,S)}catch(ee){bg(o,l,ee)}}function bS(o,l,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){SS(o,l,h)},function(h){return bg(o,l,h)}):SS(o,l,u)}function SS(o,l,u){l.status="fulfilled",l.value=u,wS(l),o.state=u,l=o.pending,l!==null&&(u=l.next,u===l?o.pending=null:(u=u.next,l.next=u,xS(o,u)))}function bg(o,l,u){var h=o.pending;if(o.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=u,wS(l),l=l.next;while(l!==h)}o.action=null}function wS(o){o=o.listeners;for(var l=0;l<o.length;l++)(0,o[l])()}function jS(o,l){return l}function CS(o,l){if(Vt){var u=cn.formState;if(u!==null){e:{var h=St;if(Vt){if(Tn){t:{for(var y=Tn,S=qo;y.nodeType!==8;){if(!S){y=null;break t}if(y=_o(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){Tn=_o(y.nextSibling),h=y.data==="F!";break e}}fs(h)}h=!1}h&&(l=u[0])}}return u=Sr(),u.memoizedState=u.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jS,lastRenderedState:l},u.queue=h,u=FS.bind(null,St,h),h.dispatch=u,h=xg(!1),S=Eg.bind(null,St,!1,h.queue),h=Sr(),y={state:l,dispatch:null,action:o,pending:null},h.queue=y,u=dN.bind(null,St,y,S,u),y.dispatch=u,h.memoizedState=o,[l,u,!1]}function ES(o){var l=zn();return TS(l,Kt,o)}function TS(o,l,u){if(l=vg(o,l,jS)[0],o=mf(Di)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=su(l)}catch(D){throw D===tu?cf:D}else h=l;l=zn();var y=l.queue,S=y.dispatch;return u!==l.memoizedState&&(St.flags|=2048,Al(9,gf(),fN.bind(null,y,u),null)),[h,S,o]}function fN(o,l){o.action=l}function RS(o){var l=zn(),u=Kt;if(u!==null)return TS(l,u,o);zn(),l=l.memoizedState,u=zn();var h=u.queue.dispatch;return u.memoizedState=o,[l,h,!1]}function Al(o,l,u,h){return o={tag:o,create:u,deps:h,inst:l,next:null},l=St.updateQueue,l===null&&(l=mg(),St.updateQueue=l),u=l.lastEffect,u===null?l.lastEffect=o.next=o:(h=u.next,u.next=o,o.next=h,l.lastEffect=o),o}function gf(){return{destroy:void 0,resource:void 0}}function _S(){return zn().memoizedState}function vf(o,l,u,h){var y=Sr();h=h===void 0?null:h,St.flags|=o,y.memoizedState=Al(1|l,gf(),u,h)}function lu(o,l,u,h){var y=zn();h=h===void 0?null:h;var S=y.memoizedState.inst;Kt!==null&&h!==null&&ug(h,Kt.memoizedState.deps)?y.memoizedState=Al(l,S,u,h):(St.flags|=o,y.memoizedState=Al(1|l,S,u,h))}function DS(o,l){vf(8390656,8,o,l)}function AS(o,l){lu(2048,8,o,l)}function PS(o,l){return lu(4,2,o,l)}function kS(o,l){return lu(4,4,o,l)}function NS(o,l){if(typeof l=="function"){o=o();var u=l(o);return function(){typeof u=="function"?u():l(null)}}if(l!=null)return o=o(),l.current=o,function(){l.current=null}}function OS(o,l,u){u=u!=null?u.concat([o]):null,lu(4,4,NS.bind(null,l,o),u)}function Sg(){}function MS(o,l){var u=zn();l=l===void 0?null:l;var h=u.memoizedState;return l!==null&&ug(l,h[1])?h[0]:(u.memoizedState=[o,l],o)}function IS(o,l){var u=zn();l=l===void 0?null:l;var h=u.memoizedState;if(l!==null&&ug(l,h[1]))return h[0];if(h=o(),gs){tn(!0);try{o()}finally{tn(!1)}}return u.memoizedState=[h,l],h}function wg(o,l,u){return u===void 0||(ma&1073741824)!==0?o.memoizedState=l:(o.memoizedState=u,o=zw(),St.lanes|=o,wa|=o,u)}function LS(o,l,u,h){return Lr(u,l)?u:Rl.current!==null?(o=wg(o,u,h),Lr(o,l)||(Gn=!0),o):(ma&42)===0?(Gn=!0,o.memoizedState=u):(o=zw(),St.lanes|=o,wa|=o,l)}function $S(o,l,u,h,y){var S=L.p;L.p=S!==0&&8>S?S:8;var D=N.T,k={};N.T=k,Eg(o,!1,l,u);try{var z=y(),ee=N.S;if(ee!==null&&ee(k,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var de=lN(z,h);cu(o,l,de,Vr(o))}else cu(o,l,h,Vr(o))}catch(pe){cu(o,l,{then:function(){},status:"rejected",reason:pe},Vr())}finally{L.p=S,N.T=D}}function hN(){}function jg(o,l,u,h){if(o.tag!==5)throw Error(r(476));var y=zS(o).queue;$S(o,y,l,$,u===null?hN:function(){return US(o),u(h)})}function zS(o){var l=o.memoizedState;if(l!==null)return l;l={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:$},next:null};var u={};return l.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Di,lastRenderedState:u},next:null},o.memoizedState=l,o=o.alternate,o!==null&&(o.memoizedState=l),l}function US(o){var l=zS(o).next.queue;cu(o,l,{},Vr())}function Cg(){return tr(Ru)}function BS(){return zn().memoizedState}function VS(){return zn().memoizedState}function pN(o){for(var l=o.return;l!==null;){switch(l.tag){case 24:case 3:var u=Vr();o=ha(u);var h=pa(l,o,u);h!==null&&(Fr(h,l,u),ru(h,l,u)),l={cache:eg()},o.payload=l;return}l=l.return}}function mN(o,l,u){var h=Vr();u={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null},yf(o)?HS(l,u):(u=Hm(o,l,u,h),u!==null&&(Fr(u,o,h),qS(u,l,h)))}function FS(o,l,u){var h=Vr();cu(o,l,u,h)}function cu(o,l,u,h){var y={lane:h,revertLane:0,action:u,hasEagerState:!1,eagerState:null,next:null};if(yf(o))HS(l,y);else{var S=o.alternate;if(o.lanes===0&&(S===null||S.lanes===0)&&(S=l.lastRenderedReducer,S!==null))try{var D=l.lastRenderedState,k=S(D,u);if(y.hasEagerState=!0,y.eagerState=k,Lr(k,D))return ef(o,l,y,0),cn===null&&Jd(),!1}catch{}finally{}if(u=Hm(o,l,y,h),u!==null)return Fr(u,o,h),qS(u,l,h),!0}return!1}function Eg(o,l,u,h){if(h={lane:2,revertLane:rv(),action:h,hasEagerState:!1,eagerState:null,next:null},yf(o)){if(l)throw Error(r(479))}else l=Hm(o,u,h,2),l!==null&&Fr(l,o,2)}function yf(o){var l=o.alternate;return o===St||l!==null&&l===St}function HS(o,l){_l=ff=!0;var u=o.pending;u===null?l.next=l:(l.next=u.next,u.next=l),o.pending=l}function qS(o,l,u){if((u&4194048)!==0){var h=l.lanes;h&=o.pendingLanes,u|=h,l.lanes=u,sa(o,u)}}var xf={readContext:tr,use:pf,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An},GS={readContext:tr,use:pf,useCallback:function(o,l){return Sr().memoizedState=[o,l===void 0?null:l],o},useContext:tr,useEffect:DS,useImperativeHandle:function(o,l,u){u=u!=null?u.concat([o]):null,vf(4194308,4,NS.bind(null,l,o),u)},useLayoutEffect:function(o,l){return vf(4194308,4,o,l)},useInsertionEffect:function(o,l){vf(4,2,o,l)},useMemo:function(o,l){var u=Sr();l=l===void 0?null:l;var h=o();if(gs){tn(!0);try{o()}finally{tn(!1)}}return u.memoizedState=[h,l],h},useReducer:function(o,l,u){var h=Sr();if(u!==void 0){var y=u(l);if(gs){tn(!0);try{u(l)}finally{tn(!1)}}}else y=l;return h.memoizedState=h.baseState=y,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:y},h.queue=o,o=o.dispatch=mN.bind(null,St,o),[h.memoizedState,o]},useRef:function(o){var l=Sr();return o={current:o},l.memoizedState=o},useState:function(o){o=xg(o);var l=o.queue,u=FS.bind(null,St,l);return l.dispatch=u,[o.memoizedState,u]},useDebugValue:Sg,useDeferredValue:function(o,l){var u=Sr();return wg(u,o,l)},useTransition:function(){var o=xg(!1);return o=$S.bind(null,St,o.queue,!0,!1),Sr().memoizedState=o,[!1,o]},useSyncExternalStore:function(o,l,u){var h=St,y=Sr();if(Vt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=l(),cn===null)throw Error(r(349));(Pt&124)!==0||hS(h,l,u)}y.memoizedState=u;var S={value:u,getSnapshot:l};return y.queue=S,DS(mS.bind(null,h,S,o),[o]),h.flags|=2048,Al(9,gf(),pS.bind(null,h,S,u,l),null),u},useId:function(){var o=Sr(),l=cn.identifierPrefix;if(Vt){var u=Ti,h=Ei;u=(h&~(1<<32-Lt(h)-1)).toString(32)+u,l="«"+l+"R"+u,u=hf++,0<u&&(l+="H"+u.toString(32)),l+="»"}else u=cN++,l="«"+l+"r"+u.toString(32)+"»";return o.memoizedState=l},useHostTransitionStatus:Cg,useFormState:CS,useActionState:CS,useOptimistic:function(o){var l=Sr();l.memoizedState=l.baseState=o;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=u,l=Eg.bind(null,St,!0,u),u.dispatch=l,[o,l]},useMemoCache:gg,useCacheRefresh:function(){return Sr().memoizedState=pN.bind(null,St)}},WS={readContext:tr,use:pf,useCallback:MS,useContext:tr,useEffect:AS,useImperativeHandle:OS,useInsertionEffect:PS,useLayoutEffect:kS,useMemo:IS,useReducer:mf,useRef:_S,useState:function(){return mf(Di)},useDebugValue:Sg,useDeferredValue:function(o,l){var u=zn();return LS(u,Kt.memoizedState,o,l)},useTransition:function(){var o=mf(Di)[0],l=zn().memoizedState;return[typeof o=="boolean"?o:su(o),l]},useSyncExternalStore:fS,useId:BS,useHostTransitionStatus:Cg,useFormState:ES,useActionState:ES,useOptimistic:function(o,l){var u=zn();return yS(u,Kt,o,l)},useMemoCache:gg,useCacheRefresh:VS},gN={readContext:tr,use:pf,useCallback:MS,useContext:tr,useEffect:AS,useImperativeHandle:OS,useInsertionEffect:PS,useLayoutEffect:kS,useMemo:IS,useReducer:yg,useRef:_S,useState:function(){return yg(Di)},useDebugValue:Sg,useDeferredValue:function(o,l){var u=zn();return Kt===null?wg(u,o,l):LS(u,Kt.memoizedState,o,l)},useTransition:function(){var o=yg(Di)[0],l=zn().memoizedState;return[typeof o=="boolean"?o:su(o),l]},useSyncExternalStore:fS,useId:BS,useHostTransitionStatus:Cg,useFormState:RS,useActionState:RS,useOptimistic:function(o,l){var u=zn();return Kt!==null?yS(u,Kt,o,l):(u.baseState=o,[o,u.queue.dispatch])},useMemoCache:gg,useCacheRefresh:VS},Pl=null,uu=0;function bf(o){var l=uu;return uu+=1,Pl===null&&(Pl=[]),oS(Pl,o,l)}function du(o,l){l=l.props.ref,o.ref=l!==void 0?l:null}function Sf(o,l){throw l.$$typeof===g?Error(r(525)):(o=Object.prototype.toString.call(l),Error(r(31,o==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":o)))}function QS(o){var l=o._init;return l(o._payload)}function YS(o){function l(Y,G){if(o){var J=Y.deletions;J===null?(Y.deletions=[G],Y.flags|=16):J.push(G)}}function u(Y,G){if(!o)return null;for(;G!==null;)l(Y,G),G=G.sibling;return null}function h(Y){for(var G=new Map;Y!==null;)Y.key!==null?G.set(Y.key,Y):G.set(Y.index,Y),Y=Y.sibling;return G}function y(Y,G){return Y=Ci(Y,G),Y.index=0,Y.sibling=null,Y}function S(Y,G,J){return Y.index=J,o?(J=Y.alternate,J!==null?(J=J.index,J<G?(Y.flags|=67108866,G):J):(Y.flags|=67108866,G)):(Y.flags|=1048576,G)}function D(Y){return o&&Y.alternate===null&&(Y.flags|=67108866),Y}function k(Y,G,J,fe){return G===null||G.tag!==6?(G=Gm(J,Y.mode,fe),G.return=Y,G):(G=y(G,J),G.return=Y,G)}function z(Y,G,J,fe){var qe=J.type;return qe===w?de(Y,G,J.props.children,fe,J.key):G!==null&&(G.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===I&&QS(qe)===G.type)?(G=y(G,J.props),du(G,J),G.return=Y,G):(G=nf(J.type,J.key,J.props,null,Y.mode,fe),du(G,J),G.return=Y,G)}function ee(Y,G,J,fe){return G===null||G.tag!==4||G.stateNode.containerInfo!==J.containerInfo||G.stateNode.implementation!==J.implementation?(G=Wm(J,Y.mode,fe),G.return=Y,G):(G=y(G,J.children||[]),G.return=Y,G)}function de(Y,G,J,fe,qe){return G===null||G.tag!==7?(G=ls(J,Y.mode,fe,qe),G.return=Y,G):(G=y(G,J),G.return=Y,G)}function pe(Y,G,J){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Gm(""+G,Y.mode,J),G.return=Y,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return J=nf(G.type,G.key,G.props,null,Y.mode,J),du(J,G),J.return=Y,J;case b:return G=Wm(G,Y.mode,J),G.return=Y,G;case I:var fe=G._init;return G=fe(G._payload),pe(Y,G,J)}if(W(G)||K(G))return G=ls(G,Y.mode,J,null),G.return=Y,G;if(typeof G.then=="function")return pe(Y,bf(G),J);if(G.$$typeof===T)return pe(Y,sf(Y,G),J);Sf(Y,G)}return null}function ne(Y,G,J,fe){var qe=G!==null?G.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return qe!==null?null:k(Y,G,""+J,fe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===qe?z(Y,G,J,fe):null;case b:return J.key===qe?ee(Y,G,J,fe):null;case I:return qe=J._init,J=qe(J._payload),ne(Y,G,J,fe)}if(W(J)||K(J))return qe!==null?null:de(Y,G,J,fe,null);if(typeof J.then=="function")return ne(Y,G,bf(J),fe);if(J.$$typeof===T)return ne(Y,G,sf(Y,J),fe);Sf(Y,J)}return null}function ie(Y,G,J,fe,qe){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return Y=Y.get(J)||null,k(G,Y,""+fe,qe);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return Y=Y.get(fe.key===null?J:fe.key)||null,z(G,Y,fe,qe);case b:return Y=Y.get(fe.key===null?J:fe.key)||null,ee(G,Y,fe,qe);case I:var jt=fe._init;return fe=jt(fe._payload),ie(Y,G,J,fe,qe)}if(W(fe)||K(fe))return Y=Y.get(J)||null,de(G,Y,fe,qe,null);if(typeof fe.then=="function")return ie(Y,G,J,bf(fe),qe);if(fe.$$typeof===T)return ie(Y,G,J,sf(G,fe),qe);Sf(G,fe)}return null}function ct(Y,G,J,fe){for(var qe=null,jt=null,Je=G,at=G=0,Qn=null;Je!==null&&at<J.length;at++){Je.index>at?(Qn=Je,Je=null):Qn=Je.sibling;var $t=ne(Y,Je,J[at],fe);if($t===null){Je===null&&(Je=Qn);break}o&&Je&&$t.alternate===null&&l(Y,Je),G=S($t,G,at),jt===null?qe=$t:jt.sibling=$t,jt=$t,Je=Qn}if(at===J.length)return u(Y,Je),Vt&&us(Y,at),qe;if(Je===null){for(;at<J.length;at++)Je=pe(Y,J[at],fe),Je!==null&&(G=S(Je,G,at),jt===null?qe=Je:jt.sibling=Je,jt=Je);return Vt&&us(Y,at),qe}for(Je=h(Je);at<J.length;at++)Qn=ie(Je,Y,at,J[at],fe),Qn!==null&&(o&&Qn.alternate!==null&&Je.delete(Qn.key===null?at:Qn.key),G=S(Qn,G,at),jt===null?qe=Qn:jt.sibling=Qn,jt=Qn);return o&&Je.forEach(function(Pa){return l(Y,Pa)}),Vt&&us(Y,at),qe}function it(Y,G,J,fe){if(J==null)throw Error(r(151));for(var qe=null,jt=null,Je=G,at=G=0,Qn=null,$t=J.next();Je!==null&&!$t.done;at++,$t=J.next()){Je.index>at?(Qn=Je,Je=null):Qn=Je.sibling;var Pa=ne(Y,Je,$t.value,fe);if(Pa===null){Je===null&&(Je=Qn);break}o&&Je&&Pa.alternate===null&&l(Y,Je),G=S(Pa,G,at),jt===null?qe=Pa:jt.sibling=Pa,jt=Pa,Je=Qn}if($t.done)return u(Y,Je),Vt&&us(Y,at),qe;if(Je===null){for(;!$t.done;at++,$t=J.next())$t=pe(Y,$t.value,fe),$t!==null&&(G=S($t,G,at),jt===null?qe=$t:jt.sibling=$t,jt=$t);return Vt&&us(Y,at),qe}for(Je=h(Je);!$t.done;at++,$t=J.next())$t=ie(Je,Y,at,$t.value,fe),$t!==null&&(o&&$t.alternate!==null&&Je.delete($t.key===null?at:$t.key),G=S($t,G,at),jt===null?qe=$t:jt.sibling=$t,jt=$t);return o&&Je.forEach(function(v4){return l(Y,v4)}),Vt&&us(Y,at),qe}function Zt(Y,G,J,fe){if(typeof J=="object"&&J!==null&&J.type===w&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var qe=J.key;G!==null;){if(G.key===qe){if(qe=J.type,qe===w){if(G.tag===7){u(Y,G.sibling),fe=y(G,J.props.children),fe.return=Y,Y=fe;break e}}else if(G.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===I&&QS(qe)===G.type){u(Y,G.sibling),fe=y(G,J.props),du(fe,J),fe.return=Y,Y=fe;break e}u(Y,G);break}else l(Y,G);G=G.sibling}J.type===w?(fe=ls(J.props.children,Y.mode,fe,J.key),fe.return=Y,Y=fe):(fe=nf(J.type,J.key,J.props,null,Y.mode,fe),du(fe,J),fe.return=Y,Y=fe)}return D(Y);case b:e:{for(qe=J.key;G!==null;){if(G.key===qe)if(G.tag===4&&G.stateNode.containerInfo===J.containerInfo&&G.stateNode.implementation===J.implementation){u(Y,G.sibling),fe=y(G,J.children||[]),fe.return=Y,Y=fe;break e}else{u(Y,G);break}else l(Y,G);G=G.sibling}fe=Wm(J,Y.mode,fe),fe.return=Y,Y=fe}return D(Y);case I:return qe=J._init,J=qe(J._payload),Zt(Y,G,J,fe)}if(W(J))return ct(Y,G,J,fe);if(K(J)){if(qe=K(J),typeof qe!="function")throw Error(r(150));return J=qe.call(J),it(Y,G,J,fe)}if(typeof J.then=="function")return Zt(Y,G,bf(J),fe);if(J.$$typeof===T)return Zt(Y,G,sf(Y,J),fe);Sf(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,G!==null&&G.tag===6?(u(Y,G.sibling),fe=y(G,J),fe.return=Y,Y=fe):(u(Y,G),fe=Gm(J,Y.mode,fe),fe.return=Y,Y=fe),D(Y)):u(Y,G)}return function(Y,G,J,fe){try{uu=0;var qe=Zt(Y,G,J,fe);return Pl=null,qe}catch(Je){if(Je===tu||Je===cf)throw Je;var jt=$r(29,Je,null,Y.mode);return jt.lanes=fe,jt.return=Y,jt}finally{}}}var kl=YS(!0),KS=YS(!1),ao=F(null),Go=null;function ga(o){var l=o.alternate;ae(Hn,Hn.current&1),ae(ao,o),Go===null&&(l===null||Rl.current!==null||l.memoizedState!==null)&&(Go=o)}function XS(o){if(o.tag===22){if(ae(Hn,Hn.current),ae(ao,o),Go===null){var l=o.alternate;l!==null&&l.memoizedState!==null&&(Go=o)}}else va()}function va(){ae(Hn,Hn.current),ae(ao,ao.current)}function Ai(o){te(ao),Go===o&&(Go=null),te(Hn)}var Hn=F(0);function wf(o){for(var l=o;l!==null;){if(l.tag===13){var u=l.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||u.data==="$?"||mv(u)))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}function Tg(o,l,u,h){l=o.memoizedState,u=u(h,l),u=u==null?l:m({},l,u),o.memoizedState=u,o.lanes===0&&(o.updateQueue.baseState=u)}var Rg={enqueueSetState:function(o,l,u){o=o._reactInternals;var h=Vr(),y=ha(h);y.payload=l,u!=null&&(y.callback=u),l=pa(o,y,h),l!==null&&(Fr(l,o,h),ru(l,o,h))},enqueueReplaceState:function(o,l,u){o=o._reactInternals;var h=Vr(),y=ha(h);y.tag=1,y.payload=l,u!=null&&(y.callback=u),l=pa(o,y,h),l!==null&&(Fr(l,o,h),ru(l,o,h))},enqueueForceUpdate:function(o,l){o=o._reactInternals;var u=Vr(),h=ha(u);h.tag=2,l!=null&&(h.callback=l),l=pa(o,h,u),l!==null&&(Fr(l,o,u),ru(l,o,u))}};function ZS(o,l,u,h,y,S,D){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(h,S,D):l.prototype&&l.prototype.isPureReactComponent?!Wc(u,h)||!Wc(y,S):!0}function JS(o,l,u,h){o=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(u,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(u,h),l.state!==o&&Rg.enqueueReplaceState(l,l.state,null)}function vs(o,l){var u=l;if("ref"in l){u={};for(var h in l)h!=="ref"&&(u[h]=l[h])}if(o=o.defaultProps){u===l&&(u=m({},u));for(var y in o)u[y]===void 0&&(u[y]=o[y])}return u}var jf=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)};function ew(o){jf(o)}function tw(o){console.error(o)}function nw(o){jf(o)}function Cf(o,l){try{var u=o.onUncaughtError;u(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function rw(o,l,u){try{var h=o.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function _g(o,l,u){return u=ha(u),u.tag=3,u.payload={element:null},u.callback=function(){Cf(o,l)},u}function ow(o){return o=ha(o),o.tag=3,o}function iw(o,l,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=h.value;o.payload=function(){return y(S)},o.callback=function(){rw(l,u,h)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(o.callback=function(){rw(l,u,h),typeof y!="function"&&(ja===null?ja=new Set([this]):ja.add(this));var k=h.stack;this.componentDidCatch(h.value,{componentStack:k!==null?k:""})})}function vN(o,l,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=u.alternate,l!==null&&Zc(l,u,y,!0),u=ao.current,u!==null){switch(u.tag){case 13:return Go===null?Zg():u.alternate===null&&Rn===0&&(Rn=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===rg?u.flags|=16384:(l=u.updateQueue,l===null?u.updateQueue=new Set([h]):l.add(h),ev(o,h,y)),!1;case 22:return u.flags|=65536,h===rg?u.flags|=16384:(l=u.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=l):(u=l.retryQueue,u===null?l.retryQueue=new Set([h]):u.add(h)),ev(o,h,y)),!1}throw Error(r(435,u.tag))}return ev(o,h,y),Zg(),!1}if(Vt)return l=ao.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=y,h!==Km&&(o=Error(r(422),{cause:h}),Xc(no(o,u)))):(h!==Km&&(l=Error(r(423),{cause:h}),Xc(no(l,u))),o=o.current.alternate,o.flags|=65536,y&=-y,o.lanes|=y,h=no(h,u),y=_g(o.stateNode,h,y),ag(o,y),Rn!==4&&(Rn=2)),!1;var S=Error(r(520),{cause:h});if(S=no(S,u),yu===null?yu=[S]:yu.push(S),Rn!==4&&(Rn=2),l===null)return!0;h=no(h,u),u=l;do{switch(u.tag){case 3:return u.flags|=65536,o=y&-y,u.lanes|=o,o=_g(u.stateNode,h,o),ag(u,o),!1;case 1:if(l=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(ja===null||!ja.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=ow(y),iw(y,o,u,h),ag(u,y),!1}u=u.return}while(u!==null);return!1}var aw=Error(r(461)),Gn=!1;function Xn(o,l,u,h){l.child=o===null?KS(l,null,u,h):kl(l,o.child,u,h)}function sw(o,l,u,h,y){u=u.render;var S=l.ref;if("ref"in h){var D={};for(var k in h)k!=="ref"&&(D[k]=h[k])}else D=h;return ps(l),h=dg(o,l,u,D,S,y),k=fg(),o!==null&&!Gn?(hg(o,l,y),Pi(o,l,y)):(Vt&&k&&Qm(l),l.flags|=1,Xn(o,l,h,y),l.child)}function lw(o,l,u,h,y){if(o===null){var S=u.type;return typeof S=="function"&&!qm(S)&&S.defaultProps===void 0&&u.compare===null?(l.tag=15,l.type=S,cw(o,l,S,h,y)):(o=nf(u.type,null,h,l,l.mode,y),o.ref=l.ref,o.return=l,l.child=o)}if(S=o.child,!Ig(o,y)){var D=S.memoizedProps;if(u=u.compare,u=u!==null?u:Wc,u(D,h)&&o.ref===l.ref)return Pi(o,l,y)}return l.flags|=1,o=Ci(S,h),o.ref=l.ref,o.return=l,l.child=o}function cw(o,l,u,h,y){if(o!==null){var S=o.memoizedProps;if(Wc(S,h)&&o.ref===l.ref)if(Gn=!1,l.pendingProps=h=S,Ig(o,y))(o.flags&131072)!==0&&(Gn=!0);else return l.lanes=o.lanes,Pi(o,l,y)}return Dg(o,l,u,h,y)}function uw(o,l,u){var h=l.pendingProps,y=h.children,S=o!==null?o.memoizedState:null;if(h.mode==="hidden"){if((l.flags&128)!==0){if(h=S!==null?S.baseLanes|u:u,o!==null){for(y=l.child=o.child,S=0;y!==null;)S=S|y.lanes|y.childLanes,y=y.sibling;l.childLanes=S&~h}else l.childLanes=0,l.child=null;return dw(o,l,h,u)}if((u&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},o!==null&&lf(l,S!==null?S.cachePool:null),S!==null?cS(l,S):lg(),XS(l);else return l.lanes=l.childLanes=536870912,dw(o,l,S!==null?S.baseLanes|u:u,u)}else S!==null?(lf(l,S.cachePool),cS(l,S),va(),l.memoizedState=null):(o!==null&&lf(l,null),lg(),va());return Xn(o,l,y,u),l.child}function dw(o,l,u,h){var y=ng();return y=y===null?null:{parent:Fn._currentValue,pool:y},l.memoizedState={baseLanes:u,cachePool:y},o!==null&&lf(l,null),lg(),XS(l),o!==null&&Zc(o,l,h,!0),null}function Ef(o,l){var u=l.ref;if(u===null)o!==null&&o.ref!==null&&(l.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(o===null||o.ref!==u)&&(l.flags|=4194816)}}function Dg(o,l,u,h,y){return ps(l),u=dg(o,l,u,h,void 0,y),h=fg(),o!==null&&!Gn?(hg(o,l,y),Pi(o,l,y)):(Vt&&h&&Qm(l),l.flags|=1,Xn(o,l,u,y),l.child)}function fw(o,l,u,h,y,S){return ps(l),l.updateQueue=null,u=dS(l,h,u,y),uS(o),h=fg(),o!==null&&!Gn?(hg(o,l,S),Pi(o,l,S)):(Vt&&h&&Qm(l),l.flags|=1,Xn(o,l,u,S),l.child)}function hw(o,l,u,h,y){if(ps(l),l.stateNode===null){var S=wl,D=u.contextType;typeof D=="object"&&D!==null&&(S=tr(D)),S=new u(h,S),l.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Rg,l.stateNode=S,S._reactInternals=l,S=l.stateNode,S.props=h,S.state=l.memoizedState,S.refs={},og(l),D=u.contextType,S.context=typeof D=="object"&&D!==null?tr(D):wl,S.state=l.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(Tg(l,u,D,h),S.state=l.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(D=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),D!==S.state&&Rg.enqueueReplaceState(S,S.state,null),iu(l,h,S,y),ou(),S.state=l.memoizedState),typeof S.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(o===null){S=l.stateNode;var k=l.memoizedProps,z=vs(u,k);S.props=z;var ee=S.context,de=u.contextType;D=wl,typeof de=="object"&&de!==null&&(D=tr(de));var pe=u.getDerivedStateFromProps;de=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",k=l.pendingProps!==k,de||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(k||ee!==D)&&JS(l,S,h,D),fa=!1;var ne=l.memoizedState;S.state=ne,iu(l,h,S,y),ou(),ee=l.memoizedState,k||ne!==ee||fa?(typeof pe=="function"&&(Tg(l,u,pe,h),ee=l.memoizedState),(z=fa||ZS(l,u,z,h,ne,ee,D))?(de||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(l.flags|=4194308)):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ee),S.props=h,S.state=ee,S.context=D,h=z):(typeof S.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{S=l.stateNode,ig(o,l),D=l.memoizedProps,de=vs(u,D),S.props=de,pe=l.pendingProps,ne=S.context,ee=u.contextType,z=wl,typeof ee=="object"&&ee!==null&&(z=tr(ee)),k=u.getDerivedStateFromProps,(ee=typeof k=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==pe||ne!==z)&&JS(l,S,h,z),fa=!1,ne=l.memoizedState,S.state=ne,iu(l,h,S,y),ou();var ie=l.memoizedState;D!==pe||ne!==ie||fa||o!==null&&o.dependencies!==null&&af(o.dependencies)?(typeof k=="function"&&(Tg(l,u,k,h),ie=l.memoizedState),(de=fa||ZS(l,u,de,h,ne,ie,z)||o!==null&&o.dependencies!==null&&af(o.dependencies))?(ee||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,ie,z),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,ie,z)),typeof S.componentDidUpdate=="function"&&(l.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof S.componentDidUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=ie),S.props=h,S.state=ie,S.context=z,h=de):(typeof S.componentDidUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===o.memoizedProps&&ne===o.memoizedState||(l.flags|=1024),h=!1)}return S=h,Ef(o,l),h=(l.flags&128)!==0,S||h?(S=l.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),l.flags|=1,o!==null&&h?(l.child=kl(l,o.child,null,y),l.child=kl(l,null,u,y)):Xn(o,l,u,y),l.memoizedState=S.state,o=l.child):o=Pi(o,l,y),o}function pw(o,l,u,h){return Kc(),l.flags|=256,Xn(o,l,u,h),l.child}var Ag={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Pg(o){return{baseLanes:o,cachePool:tS()}}function kg(o,l,u){return o=o!==null?o.childLanes&~u:0,l&&(o|=so),o}function mw(o,l,u){var h=l.pendingProps,y=!1,S=(l.flags&128)!==0,D;if((D=S)||(D=o!==null&&o.memoizedState===null?!1:(Hn.current&2)!==0),D&&(y=!0,l.flags&=-129),D=(l.flags&32)!==0,l.flags&=-33,o===null){if(Vt){if(y?ga(l):va(),Vt){var k=Tn,z;if(z=k){e:{for(z=k,k=qo;z.nodeType!==8;){if(!k){k=null;break e}if(z=_o(z.nextSibling),z===null){k=null;break e}}k=z}k!==null?(l.memoizedState={dehydrated:k,treeContext:cs!==null?{id:Ei,overflow:Ti}:null,retryLane:536870912,hydrationErrors:null},z=$r(18,null,null,0),z.stateNode=k,z.return=l,l.child=z,ur=l,Tn=null,z=!0):z=!1}z||fs(l)}if(k=l.memoizedState,k!==null&&(k=k.dehydrated,k!==null))return mv(k)?l.lanes=32:l.lanes=536870912,null;Ai(l)}return k=h.children,h=h.fallback,y?(va(),y=l.mode,k=Tf({mode:"hidden",children:k},y),h=ls(h,y,u,null),k.return=l,h.return=l,k.sibling=h,l.child=k,y=l.child,y.memoizedState=Pg(u),y.childLanes=kg(o,D,u),l.memoizedState=Ag,h):(ga(l),Ng(l,k))}if(z=o.memoizedState,z!==null&&(k=z.dehydrated,k!==null)){if(S)l.flags&256?(ga(l),l.flags&=-257,l=Og(o,l,u)):l.memoizedState!==null?(va(),l.child=o.child,l.flags|=128,l=null):(va(),y=h.fallback,k=l.mode,h=Tf({mode:"visible",children:h.children},k),y=ls(y,k,u,null),y.flags|=2,h.return=l,y.return=l,h.sibling=y,l.child=h,kl(l,o.child,null,u),h=l.child,h.memoizedState=Pg(u),h.childLanes=kg(o,D,u),l.memoizedState=Ag,l=y);else if(ga(l),mv(k)){if(D=k.nextSibling&&k.nextSibling.dataset,D)var ee=D.dgst;D=ee,h=Error(r(419)),h.stack="",h.digest=D,Xc({value:h,source:null,stack:null}),l=Og(o,l,u)}else if(Gn||Zc(o,l,u,!1),D=(u&o.childLanes)!==0,Gn||D){if(D=cn,D!==null&&(h=u&-u,h=(h&42)!==0?1:ns(h),h=(h&(D.suspendedLanes|u))!==0?0:h,h!==0&&h!==z.retryLane))throw z.retryLane=h,Sl(o,h),Fr(D,o,h),aw;k.data==="$?"||Zg(),l=Og(o,l,u)}else k.data==="$?"?(l.flags|=192,l.child=o.child,l=null):(o=z.treeContext,Tn=_o(k.nextSibling),ur=l,Vt=!0,ds=null,qo=!1,o!==null&&(oo[io++]=Ei,oo[io++]=Ti,oo[io++]=cs,Ei=o.id,Ti=o.overflow,cs=l),l=Ng(l,h.children),l.flags|=4096);return l}return y?(va(),y=h.fallback,k=l.mode,z=o.child,ee=z.sibling,h=Ci(z,{mode:"hidden",children:h.children}),h.subtreeFlags=z.subtreeFlags&65011712,ee!==null?y=Ci(ee,y):(y=ls(y,k,u,null),y.flags|=2),y.return=l,h.return=l,h.sibling=y,l.child=h,h=y,y=l.child,k=o.child.memoizedState,k===null?k=Pg(u):(z=k.cachePool,z!==null?(ee=Fn._currentValue,z=z.parent!==ee?{parent:ee,pool:ee}:z):z=tS(),k={baseLanes:k.baseLanes|u,cachePool:z}),y.memoizedState=k,y.childLanes=kg(o,D,u),l.memoizedState=Ag,h):(ga(l),u=o.child,o=u.sibling,u=Ci(u,{mode:"visible",children:h.children}),u.return=l,u.sibling=null,o!==null&&(D=l.deletions,D===null?(l.deletions=[o],l.flags|=16):D.push(o)),l.child=u,l.memoizedState=null,u)}function Ng(o,l){return l=Tf({mode:"visible",children:l},o.mode),l.return=o,o.child=l}function Tf(o,l){return o=$r(22,o,null,l),o.lanes=0,o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},o}function Og(o,l,u){return kl(l,o.child,null,u),o=Ng(l,l.pendingProps.children),o.flags|=2,l.memoizedState=null,o}function gw(o,l,u){o.lanes|=l;var h=o.alternate;h!==null&&(h.lanes|=l),Zm(o.return,l,u)}function Mg(o,l,u,h,y){var S=o.memoizedState;S===null?o.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y}:(S.isBackwards=l,S.rendering=null,S.renderingStartTime=0,S.last=h,S.tail=u,S.tailMode=y)}function vw(o,l,u){var h=l.pendingProps,y=h.revealOrder,S=h.tail;if(Xn(o,l,h.children,u),h=Hn.current,(h&2)!==0)h=h&1|2,l.flags|=128;else{if(o!==null&&(o.flags&128)!==0)e:for(o=l.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&gw(o,u,l);else if(o.tag===19)gw(o,u,l);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}h&=1}switch(ae(Hn,h),y){case"forwards":for(u=l.child,y=null;u!==null;)o=u.alternate,o!==null&&wf(o)===null&&(y=u),u=u.sibling;u=y,u===null?(y=l.child,l.child=null):(y=u.sibling,u.sibling=null),Mg(l,!1,y,u,S);break;case"backwards":for(u=null,y=l.child,l.child=null;y!==null;){if(o=y.alternate,o!==null&&wf(o)===null){l.child=y;break}o=y.sibling,y.sibling=u,u=y,y=o}Mg(l,!0,u,null,S);break;case"together":Mg(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function Pi(o,l,u){if(o!==null&&(l.dependencies=o.dependencies),wa|=l.lanes,(u&l.childLanes)===0)if(o!==null){if(Zc(o,l,u,!1),(u&l.childLanes)===0)return null}else return null;if(o!==null&&l.child!==o.child)throw Error(r(153));if(l.child!==null){for(o=l.child,u=Ci(o,o.pendingProps),l.child=u,u.return=l;o.sibling!==null;)o=o.sibling,u=u.sibling=Ci(o,o.pendingProps),u.return=l;u.sibling=null}return l.child}function Ig(o,l){return(o.lanes&l)!==0?!0:(o=o.dependencies,!!(o!==null&&af(o)))}function yN(o,l,u){switch(l.tag){case 3:Ee(l,l.stateNode.containerInfo),da(l,Fn,o.memoizedState.cache),Kc();break;case 27:case 5:et(l);break;case 4:Ee(l,l.stateNode.containerInfo);break;case 10:da(l,l.type,l.memoizedProps.value);break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(ga(l),l.flags|=128,null):(u&l.child.childLanes)!==0?mw(o,l,u):(ga(l),o=Pi(o,l,u),o!==null?o.sibling:null);ga(l);break;case 19:var y=(o.flags&128)!==0;if(h=(u&l.childLanes)!==0,h||(Zc(o,l,u,!1),h=(u&l.childLanes)!==0),y){if(h)return vw(o,l,u);l.flags|=128}if(y=l.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),ae(Hn,Hn.current),h)break;return null;case 22:case 23:return l.lanes=0,uw(o,l,u);case 24:da(l,Fn,o.memoizedState.cache)}return Pi(o,l,u)}function yw(o,l,u){if(o!==null)if(o.memoizedProps!==l.pendingProps)Gn=!0;else{if(!Ig(o,u)&&(l.flags&128)===0)return Gn=!1,yN(o,l,u);Gn=(o.flags&131072)!==0}else Gn=!1,Vt&&(l.flags&1048576)!==0&&Q1(l,of,l.index);switch(l.lanes=0,l.tag){case 16:e:{o=l.pendingProps;var h=l.elementType,y=h._init;if(h=y(h._payload),l.type=h,typeof h=="function")qm(h)?(o=vs(h,o),l.tag=1,l=hw(null,l,h,o,u)):(l.tag=0,l=Dg(null,l,h,o,u));else{if(h!=null){if(y=h.$$typeof,y===_){l.tag=11,l=sw(null,l,h,o,u);break e}else if(y===M){l.tag=14,l=lw(null,l,h,o,u);break e}}throw l=B(h)||h,Error(r(306,l,""))}}return l;case 0:return Dg(o,l,l.type,l.pendingProps,u);case 1:return h=l.type,y=vs(h,l.pendingProps),hw(o,l,h,y,u);case 3:e:{if(Ee(l,l.stateNode.containerInfo),o===null)throw Error(r(387));h=l.pendingProps;var S=l.memoizedState;y=S.element,ig(o,l),iu(l,h,null,u);var D=l.memoizedState;if(h=D.cache,da(l,Fn,h),h!==S.cache&&Jm(l,[Fn],u,!0),ou(),h=D.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:D.cache},l.updateQueue.baseState=S,l.memoizedState=S,l.flags&256){l=pw(o,l,h,u);break e}else if(h!==y){y=no(Error(r(424)),l),Xc(y),l=pw(o,l,h,u);break e}else{switch(o=l.stateNode.containerInfo,o.nodeType){case 9:o=o.body;break;default:o=o.nodeName==="HTML"?o.ownerDocument.body:o}for(Tn=_o(o.firstChild),ur=l,Vt=!0,ds=null,qo=!0,u=KS(l,null,h,u),l.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Kc(),h===y){l=Pi(o,l,u);break e}Xn(o,l,h,u)}l=l.child}return l;case 26:return Ef(o,l),o===null?(u=wj(l.type,null,l.pendingProps,null))?l.memoizedState=u:Vt||(u=l.type,o=l.pendingProps,h=Uf(we.current).createElement(u),h[me]=l,h[Te]=o,Jn(h,u,o),mt(h),l.stateNode=h):l.memoizedState=wj(l.type,o.memoizedProps,l.pendingProps,o.memoizedState),null;case 27:return et(l),o===null&&Vt&&(h=l.stateNode=xj(l.type,l.pendingProps,we.current),ur=l,qo=!0,y=Tn,Ta(l.type)?(gv=y,Tn=_o(h.firstChild)):Tn=y),Xn(o,l,l.pendingProps.children,u),Ef(o,l),o===null&&(l.flags|=4194304),l.child;case 5:return o===null&&Vt&&((y=h=Tn)&&(h=GN(h,l.type,l.pendingProps,qo),h!==null?(l.stateNode=h,ur=l,Tn=_o(h.firstChild),qo=!1,y=!0):y=!1),y||fs(l)),et(l),y=l.type,S=l.pendingProps,D=o!==null?o.memoizedProps:null,h=S.children,fv(y,S)?h=null:D!==null&&fv(y,D)&&(l.flags|=32),l.memoizedState!==null&&(y=dg(o,l,uN,null,null,u),Ru._currentValue=y),Ef(o,l),Xn(o,l,h,u),l.child;case 6:return o===null&&Vt&&((o=u=Tn)&&(u=WN(u,l.pendingProps,qo),u!==null?(l.stateNode=u,ur=l,Tn=null,o=!0):o=!1),o||fs(l)),null;case 13:return mw(o,l,u);case 4:return Ee(l,l.stateNode.containerInfo),h=l.pendingProps,o===null?l.child=kl(l,null,h,u):Xn(o,l,h,u),l.child;case 11:return sw(o,l,l.type,l.pendingProps,u);case 7:return Xn(o,l,l.pendingProps,u),l.child;case 8:return Xn(o,l,l.pendingProps.children,u),l.child;case 12:return Xn(o,l,l.pendingProps.children,u),l.child;case 10:return h=l.pendingProps,da(l,l.type,h.value),Xn(o,l,h.children,u),l.child;case 9:return y=l.type._context,h=l.pendingProps.children,ps(l),y=tr(y),h=h(y),l.flags|=1,Xn(o,l,h,u),l.child;case 14:return lw(o,l,l.type,l.pendingProps,u);case 15:return cw(o,l,l.type,l.pendingProps,u);case 19:return vw(o,l,u);case 31:return h=l.pendingProps,u=l.mode,h={mode:h.mode,children:h.children},o===null?(u=Tf(h,u),u.ref=l.ref,l.child=u,u.return=l,l=u):(u=Ci(o.child,h),u.ref=l.ref,l.child=u,u.return=l,l=u),l;case 22:return uw(o,l,u);case 24:return ps(l),h=tr(Fn),o===null?(y=ng(),y===null&&(y=cn,S=eg(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),l.memoizedState={parent:h,cache:y},og(l),da(l,Fn,y)):((o.lanes&u)!==0&&(ig(o,l),iu(l,null,null,u),ou()),y=o.memoizedState,S=l.memoizedState,y.parent!==h?(y={parent:h,cache:h},l.memoizedState=y,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=y),da(l,Fn,h)):(h=S.cache,da(l,Fn,h),h!==y.cache&&Jm(l,[Fn],u,!0))),Xn(o,l,l.pendingProps.children,u),l.child;case 29:throw l.pendingProps}throw Error(r(156,l.tag))}function ki(o){o.flags|=4}function xw(o,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)o.flags&=-16777217;else if(o.flags|=16777216,!Rj(l)){if(l=ao.current,l!==null&&((Pt&4194048)===Pt?Go!==null:(Pt&62914560)!==Pt&&(Pt&536870912)===0||l!==Go))throw nu=rg,nS;o.flags|=8192}}function Rf(o,l){l!==null&&(o.flags|=4),o.flags&16384&&(l=o.tag!==22?aa():536870912,o.lanes|=l,Il|=l)}function fu(o,l){if(!Vt)switch(o.tailMode){case"hidden":l=o.tail;for(var u=null;l!==null;)l.alternate!==null&&(u=l),l=l.sibling;u===null?o.tail=null:u.sibling=null;break;case"collapsed":u=o.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?l||o.tail===null?o.tail=null:o.tail.sibling=null:h.sibling=null}}function Sn(o){var l=o.alternate!==null&&o.alternate.child===o.child,u=0,h=0;if(l)for(var y=o.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=o,y=y.sibling;else for(y=o.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=o,y=y.sibling;return o.subtreeFlags|=h,o.childLanes=u,l}function xN(o,l,u){var h=l.pendingProps;switch(Ym(l),l.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Sn(l),null;case 1:return Sn(l),null;case 3:return u=l.stateNode,h=null,o!==null&&(h=o.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),_i(Fn),ot(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(o===null||o.child===null)&&(Yc(l)?ki(l):o===null||o.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,X1())),Sn(l),null;case 26:return u=l.memoizedState,o===null?(ki(l),u!==null?(Sn(l),xw(l,u)):(Sn(l),l.flags&=-16777217)):u?u!==o.memoizedState?(ki(l),Sn(l),xw(l,u)):(Sn(l),l.flags&=-16777217):(o.memoizedProps!==h&&ki(l),Sn(l),l.flags&=-16777217),null;case 27:Ct(l),u=we.current;var y=l.type;if(o!==null&&l.stateNode!=null)o.memoizedProps!==h&&ki(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Sn(l),null}o=je.current,Yc(l)?Y1(l):(o=xj(y,h,u),l.stateNode=o,ki(l))}return Sn(l),null;case 5:if(Ct(l),u=l.type,o!==null&&l.stateNode!=null)o.memoizedProps!==h&&ki(l);else{if(!h){if(l.stateNode===null)throw Error(r(166));return Sn(l),null}if(o=je.current,Yc(l))Y1(l);else{switch(y=Uf(we.current),o){case 1:o=y.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:o=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":o=y.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":o=y.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":o=y.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof h.is=="string"?y.createElement("select",{is:h.is}):y.createElement("select"),h.multiple?o.multiple=!0:h.size&&(o.size=h.size);break;default:o=typeof h.is=="string"?y.createElement(u,{is:h.is}):y.createElement(u)}}o[me]=l,o[Te]=h;e:for(y=l.child;y!==null;){if(y.tag===5||y.tag===6)o.appendChild(y.stateNode);else if(y.tag!==4&&y.tag!==27&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===l)break e;for(;y.sibling===null;){if(y.return===null||y.return===l)break e;y=y.return}y.sibling.return=y.return,y=y.sibling}l.stateNode=o;e:switch(Jn(o,u,h),u){case"button":case"input":case"select":case"textarea":o=!!h.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ki(l)}}return Sn(l),l.flags&=-16777217,null;case 6:if(o&&l.stateNode!=null)o.memoizedProps!==h&&ki(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(r(166));if(o=we.current,Yc(l)){if(o=l.stateNode,u=l.memoizedProps,h=null,y=ur,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}o[me]=l,o=!!(o.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||fj(o.nodeValue,u)),o||fs(l)}else o=Uf(o).createTextNode(h),o[me]=l,l.stateNode=o}return Sn(l),null;case 13:if(h=l.memoizedState,o===null||o.memoizedState!==null&&o.memoizedState.dehydrated!==null){if(y=Yc(l),h!==null&&h.dehydrated!==null){if(o===null){if(!y)throw Error(r(318));if(y=l.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[me]=l}else Kc(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Sn(l),y=!1}else y=X1(),o!==null&&o.memoizedState!==null&&(o.memoizedState.hydrationErrors=y),y=!0;if(!y)return l.flags&256?(Ai(l),l):(Ai(l),null)}if(Ai(l),(l.flags&128)!==0)return l.lanes=u,l;if(u=h!==null,o=o!==null&&o.memoizedState!==null,u){h=l.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool);var S=null;h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==y&&(h.flags|=2048)}return u!==o&&u&&(l.child.flags|=8192),Rf(l,l.updateQueue),Sn(l),null;case 4:return ot(),o===null&&sv(l.stateNode.containerInfo),Sn(l),null;case 10:return _i(l.type),Sn(l),null;case 19:if(te(Hn),y=l.memoizedState,y===null)return Sn(l),null;if(h=(l.flags&128)!==0,S=y.rendering,S===null)if(h)fu(y,!1);else{if(Rn!==0||o!==null&&(o.flags&128)!==0)for(o=l.child;o!==null;){if(S=wf(o),S!==null){for(l.flags|=128,fu(y,!1),o=S.updateQueue,l.updateQueue=o,Rf(l,o),l.subtreeFlags=0,o=u,u=l.child;u!==null;)W1(u,o),u=u.sibling;return ae(Hn,Hn.current&1|2),l.child}o=o.sibling}y.tail!==null&&Re()>Af&&(l.flags|=128,h=!0,fu(y,!1),l.lanes=4194304)}else{if(!h)if(o=wf(S),o!==null){if(l.flags|=128,h=!0,o=o.updateQueue,l.updateQueue=o,Rf(l,o),fu(y,!0),y.tail===null&&y.tailMode==="hidden"&&!S.alternate&&!Vt)return Sn(l),null}else 2*Re()-y.renderingStartTime>Af&&u!==536870912&&(l.flags|=128,h=!0,fu(y,!1),l.lanes=4194304);y.isBackwards?(S.sibling=l.child,l.child=S):(o=y.last,o!==null?o.sibling=S:l.child=S,y.last=S)}return y.tail!==null?(l=y.tail,y.rendering=l,y.tail=l.sibling,y.renderingStartTime=Re(),l.sibling=null,o=Hn.current,ae(Hn,h?o&1|2:o&1),l):(Sn(l),null);case 22:case 23:return Ai(l),cg(),h=l.memoizedState!==null,o!==null?o.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(u&536870912)!==0&&(l.flags&128)===0&&(Sn(l),l.subtreeFlags&6&&(l.flags|=8192)):Sn(l),u=l.updateQueue,u!==null&&Rf(l,u.retryQueue),u=null,o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==u&&(l.flags|=2048),o!==null&&te(ms),null;case 24:return u=null,o!==null&&(u=o.memoizedState.cache),l.memoizedState.cache!==u&&(l.flags|=2048),_i(Fn),Sn(l),null;case 25:return null;case 30:return null}throw Error(r(156,l.tag))}function bN(o,l){switch(Ym(l),l.tag){case 1:return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 3:return _i(Fn),ot(),o=l.flags,(o&65536)!==0&&(o&128)===0?(l.flags=o&-65537|128,l):null;case 26:case 27:case 5:return Ct(l),null;case 13:if(Ai(l),o=l.memoizedState,o!==null&&o.dehydrated!==null){if(l.alternate===null)throw Error(r(340));Kc()}return o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 19:return te(Hn),null;case 4:return ot(),null;case 10:return _i(l.type),null;case 22:case 23:return Ai(l),cg(),o!==null&&te(ms),o=l.flags,o&65536?(l.flags=o&-65537|128,l):null;case 24:return _i(Fn),null;case 25:return null;default:return null}}function bw(o,l){switch(Ym(l),l.tag){case 3:_i(Fn),ot();break;case 26:case 27:case 5:Ct(l);break;case 4:ot();break;case 13:Ai(l);break;case 19:te(Hn);break;case 10:_i(l.type);break;case 22:case 23:Ai(l),cg(),o!==null&&te(ms);break;case 24:_i(Fn)}}function hu(o,l){try{var u=l.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&o)===o){h=void 0;var S=u.create,D=u.inst;h=S(),D.destroy=h}u=u.next}while(u!==y)}}catch(k){nn(l,l.return,k)}}function ya(o,l,u){try{var h=l.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var S=y.next;h=S;do{if((h.tag&o)===o){var D=h.inst,k=D.destroy;if(k!==void 0){D.destroy=void 0,y=l;var z=u,ee=k;try{ee()}catch(de){nn(y,z,de)}}}h=h.next}while(h!==S)}}catch(de){nn(l,l.return,de)}}function Sw(o){var l=o.updateQueue;if(l!==null){var u=o.stateNode;try{lS(l,u)}catch(h){nn(o,o.return,h)}}}function ww(o,l,u){u.props=vs(o.type,o.memoizedProps),u.state=o.memoizedState;try{u.componentWillUnmount()}catch(h){nn(o,l,h)}}function pu(o,l){try{var u=o.ref;if(u!==null){switch(o.tag){case 26:case 27:case 5:var h=o.stateNode;break;case 30:h=o.stateNode;break;default:h=o.stateNode}typeof u=="function"?o.refCleanup=u(h):u.current=h}}catch(y){nn(o,l,y)}}function Wo(o,l){var u=o.ref,h=o.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){nn(o,l,y)}finally{o.refCleanup=null,o=o.alternate,o!=null&&(o.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){nn(o,l,y)}else u.current=null}function jw(o){var l=o.type,u=o.memoizedProps,h=o.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(y){nn(o,o.return,y)}}function Lg(o,l,u){try{var h=o.stateNode;BN(h,o.type,u,l),h[Te]=l}catch(y){nn(o,o.return,y)}}function Cw(o){return o.tag===5||o.tag===3||o.tag===26||o.tag===27&&Ta(o.type)||o.tag===4}function $g(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Cw(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.tag===27&&Ta(o.type)||o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function zg(o,l,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(o,l):(l=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,l.appendChild(o),u=u._reactRootContainer,u!=null||l.onclick!==null||(l.onclick=zf));else if(h!==4&&(h===27&&Ta(o.type)&&(u=o.stateNode,l=null),o=o.child,o!==null))for(zg(o,l,u),o=o.sibling;o!==null;)zg(o,l,u),o=o.sibling}function _f(o,l,u){var h=o.tag;if(h===5||h===6)o=o.stateNode,l?u.insertBefore(o,l):u.appendChild(o);else if(h!==4&&(h===27&&Ta(o.type)&&(u=o.stateNode),o=o.child,o!==null))for(_f(o,l,u),o=o.sibling;o!==null;)_f(o,l,u),o=o.sibling}function Ew(o){var l=o.stateNode,u=o.memoizedProps;try{for(var h=o.type,y=l.attributes;y.length;)l.removeAttributeNode(y[0]);Jn(l,h,u),l[me]=o,l[Te]=u}catch(S){nn(o,o.return,S)}}var Ni=!1,Pn=!1,Ug=!1,Tw=typeof WeakSet=="function"?WeakSet:Set,Wn=null;function SN(o,l){if(o=o.containerInfo,uv=Gf,o=L1(o),$m(o)){if("selectionStart"in o)var u={start:o.selectionStart,end:o.selectionEnd};else e:{u=(u=o.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var y=h.anchorOffset,S=h.focusNode;h=h.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var D=0,k=-1,z=-1,ee=0,de=0,pe=o,ne=null;t:for(;;){for(var ie;pe!==u||y!==0&&pe.nodeType!==3||(k=D+y),pe!==S||h!==0&&pe.nodeType!==3||(z=D+h),pe.nodeType===3&&(D+=pe.nodeValue.length),(ie=pe.firstChild)!==null;)ne=pe,pe=ie;for(;;){if(pe===o)break t;if(ne===u&&++ee===y&&(k=D),ne===S&&++de===h&&(z=D),(ie=pe.nextSibling)!==null)break;pe=ne,ne=pe.parentNode}pe=ie}u=k===-1||z===-1?null:{start:k,end:z}}else u=null}u=u||{start:0,end:0}}else u=null;for(dv={focusedElem:o,selectionRange:u},Gf=!1,Wn=l;Wn!==null;)if(l=Wn,o=l.child,(l.subtreeFlags&1024)!==0&&o!==null)o.return=l,Wn=o;else for(;Wn!==null;){switch(l=Wn,S=l.alternate,o=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&S!==null){o=void 0,u=l,y=S.memoizedProps,S=S.memoizedState,h=u.stateNode;try{var ct=vs(u.type,y,u.elementType===u.type);o=h.getSnapshotBeforeUpdate(ct,S),h.__reactInternalSnapshotBeforeUpdate=o}catch(it){nn(u,u.return,it)}}break;case 3:if((o&1024)!==0){if(o=l.stateNode.containerInfo,u=o.nodeType,u===9)pv(o);else if(u===1)switch(o.nodeName){case"HEAD":case"HTML":case"BODY":pv(o);break;default:o.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Wn=o;break}Wn=l.return}}function Rw(o,l,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:xa(o,u),h&4&&hu(5,u);break;case 1:if(xa(o,u),h&4)if(o=u.stateNode,l===null)try{o.componentDidMount()}catch(D){nn(u,u.return,D)}else{var y=vs(u.type,l.memoizedProps);l=l.memoizedState;try{o.componentDidUpdate(y,l,o.__reactInternalSnapshotBeforeUpdate)}catch(D){nn(u,u.return,D)}}h&64&&Sw(u),h&512&&pu(u,u.return);break;case 3:if(xa(o,u),h&64&&(o=u.updateQueue,o!==null)){if(l=null,u.child!==null)switch(u.child.tag){case 27:case 5:l=u.child.stateNode;break;case 1:l=u.child.stateNode}try{lS(o,l)}catch(D){nn(u,u.return,D)}}break;case 27:l===null&&h&4&&Ew(u);case 26:case 5:xa(o,u),l===null&&h&4&&jw(u),h&512&&pu(u,u.return);break;case 12:xa(o,u);break;case 13:xa(o,u),h&4&&Aw(o,u),h&64&&(o=u.memoizedState,o!==null&&(o=o.dehydrated,o!==null&&(u=AN.bind(null,u),QN(o,u))));break;case 22:if(h=u.memoizedState!==null||Ni,!h){l=l!==null&&l.memoizedState!==null||Pn,y=Ni;var S=Pn;Ni=h,(Pn=l)&&!S?ba(o,u,(u.subtreeFlags&8772)!==0):xa(o,u),Ni=y,Pn=S}break;case 30:break;default:xa(o,u)}}function _w(o){var l=o.alternate;l!==null&&(o.alternate=null,_w(l)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(l=o.stateNode,l!==null&&Xe(l)),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}var vn=null,wr=!1;function Oi(o,l,u){for(u=u.child;u!==null;)Dw(o,l,u),u=u.sibling}function Dw(o,l,u){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(_t,u)}catch{}switch(u.tag){case 26:Pn||Wo(u,l),Oi(o,l,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Pn||Wo(u,l);var h=vn,y=wr;Ta(u.type)&&(vn=u.stateNode,wr=!1),Oi(o,l,u),ju(u.stateNode),vn=h,wr=y;break;case 5:Pn||Wo(u,l);case 6:if(h=vn,y=wr,vn=null,Oi(o,l,u),vn=h,wr=y,vn!==null)if(wr)try{(vn.nodeType===9?vn.body:vn.nodeName==="HTML"?vn.ownerDocument.body:vn).removeChild(u.stateNode)}catch(S){nn(u,l,S)}else try{vn.removeChild(u.stateNode)}catch(S){nn(u,l,S)}break;case 18:vn!==null&&(wr?(o=vn,vj(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,u.stateNode),Pu(o)):vj(vn,u.stateNode));break;case 4:h=vn,y=wr,vn=u.stateNode.containerInfo,wr=!0,Oi(o,l,u),vn=h,wr=y;break;case 0:case 11:case 14:case 15:Pn||ya(2,u,l),Pn||ya(4,u,l),Oi(o,l,u);break;case 1:Pn||(Wo(u,l),h=u.stateNode,typeof h.componentWillUnmount=="function"&&ww(u,l,h)),Oi(o,l,u);break;case 21:Oi(o,l,u);break;case 22:Pn=(h=Pn)||u.memoizedState!==null,Oi(o,l,u),Pn=h;break;default:Oi(o,l,u)}}function Aw(o,l){if(l.memoizedState===null&&(o=l.alternate,o!==null&&(o=o.memoizedState,o!==null&&(o=o.dehydrated,o!==null))))try{Pu(o)}catch(u){nn(l,l.return,u)}}function wN(o){switch(o.tag){case 13:case 19:var l=o.stateNode;return l===null&&(l=o.stateNode=new Tw),l;case 22:return o=o.stateNode,l=o._retryCache,l===null&&(l=o._retryCache=new Tw),l;default:throw Error(r(435,o.tag))}}function Bg(o,l){var u=wN(o);l.forEach(function(h){var y=PN.bind(null,o,h);u.has(h)||(u.add(h),h.then(y,y))})}function zr(o,l){var u=l.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],S=o,D=l,k=D;e:for(;k!==null;){switch(k.tag){case 27:if(Ta(k.type)){vn=k.stateNode,wr=!1;break e}break;case 5:vn=k.stateNode,wr=!1;break e;case 3:case 4:vn=k.stateNode.containerInfo,wr=!0;break e}k=k.return}if(vn===null)throw Error(r(160));Dw(S,D,y),vn=null,wr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(l.subtreeFlags&13878)for(l=l.child;l!==null;)Pw(l,o),l=l.sibling}var Ro=null;function Pw(o,l){var u=o.alternate,h=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:zr(l,o),Ur(o),h&4&&(ya(3,o,o.return),hu(3,o),ya(5,o,o.return));break;case 1:zr(l,o),Ur(o),h&512&&(Pn||u===null||Wo(u,u.return)),h&64&&Ni&&(o=o.updateQueue,o!==null&&(h=o.callbacks,h!==null&&(u=o.shared.hiddenCallbacks,o.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Ro;if(zr(l,o),Ur(o),h&512&&(Pn||u===null||Wo(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=o.memoizedState,u===null)if(h===null)if(o.stateNode===null){e:{h=o.type,u=o.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":S=y.getElementsByTagName("title")[0],(!S||S[He]||S[me]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=y.createElement(h),y.head.insertBefore(S,y.querySelector("head > title"))),Jn(S,h,u),S[me]=o,mt(S),h=S;break e;case"link":var D=Ej("link","href",y).get(h+(u.href||""));if(D){for(var k=0;k<D.length;k++)if(S=D[k],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){D.splice(k,1);break t}}S=y.createElement(h),Jn(S,h,u),y.head.appendChild(S);break;case"meta":if(D=Ej("meta","content",y).get(h+(u.content||""))){for(k=0;k<D.length;k++)if(S=D[k],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){D.splice(k,1);break t}}S=y.createElement(h),Jn(S,h,u),y.head.appendChild(S);break;default:throw Error(r(468,h))}S[me]=o,mt(S),h=S}o.stateNode=h}else Tj(y,o.type,o.stateNode);else o.stateNode=Cj(y,h,o.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?Tj(y,o.type,o.stateNode):Cj(y,h,o.memoizedProps)):h===null&&o.stateNode!==null&&Lg(o,o.memoizedProps,u.memoizedProps)}break;case 27:zr(l,o),Ur(o),h&512&&(Pn||u===null||Wo(u,u.return)),u!==null&&h&4&&Lg(o,o.memoizedProps,u.memoizedProps);break;case 5:if(zr(l,o),Ur(o),h&512&&(Pn||u===null||Wo(u,u.return)),o.flags&32){y=o.stateNode;try{pl(y,"")}catch(ie){nn(o,o.return,ie)}}h&4&&o.stateNode!=null&&(y=o.memoizedProps,Lg(o,y,u!==null?u.memoizedProps:y)),h&1024&&(Ug=!0);break;case 6:if(zr(l,o),Ur(o),h&4){if(o.stateNode===null)throw Error(r(162));h=o.memoizedProps,u=o.stateNode;try{u.nodeValue=h}catch(ie){nn(o,o.return,ie)}}break;case 3:if(Ff=null,y=Ro,Ro=Bf(l.containerInfo),zr(l,o),Ro=y,Ur(o),h&4&&u!==null&&u.memoizedState.isDehydrated)try{Pu(l.containerInfo)}catch(ie){nn(o,o.return,ie)}Ug&&(Ug=!1,kw(o));break;case 4:h=Ro,Ro=Bf(o.stateNode.containerInfo),zr(l,o),Ur(o),Ro=h;break;case 12:zr(l,o),Ur(o);break;case 13:zr(l,o),Ur(o),o.child.flags&8192&&o.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Wg=Re()),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Bg(o,h)));break;case 22:y=o.memoizedState!==null;var z=u!==null&&u.memoizedState!==null,ee=Ni,de=Pn;if(Ni=ee||y,Pn=de||z,zr(l,o),Pn=de,Ni=ee,Ur(o),h&8192)e:for(l=o.stateNode,l._visibility=y?l._visibility&-2:l._visibility|1,y&&(u===null||z||Ni||Pn||ys(o)),u=null,l=o;;){if(l.tag===5||l.tag===26){if(u===null){z=u=l;try{if(S=z.stateNode,y)D=S.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{k=z.stateNode;var pe=z.memoizedProps.style,ne=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;k.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(ie){nn(z,z.return,ie)}}}else if(l.tag===6){if(u===null){z=l;try{z.stateNode.nodeValue=y?"":z.memoizedProps}catch(ie){nn(z,z.return,ie)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===o)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;u===l&&(u=null),l=l.return}u===l&&(u=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=o.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Bg(o,u))));break;case 19:zr(l,o),Ur(o),h&4&&(h=o.updateQueue,h!==null&&(o.updateQueue=null,Bg(o,h)));break;case 30:break;case 21:break;default:zr(l,o),Ur(o)}}function Ur(o){var l=o.flags;if(l&2){try{for(var u,h=o.return;h!==null;){if(Cw(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=$g(o);_f(o,S,y);break;case 5:var D=u.stateNode;u.flags&32&&(pl(D,""),u.flags&=-33);var k=$g(o);_f(o,k,D);break;case 3:case 4:var z=u.stateNode.containerInfo,ee=$g(o);zg(o,ee,z);break;default:throw Error(r(161))}}catch(de){nn(o,o.return,de)}o.flags&=-3}l&4096&&(o.flags&=-4097)}function kw(o){if(o.subtreeFlags&1024)for(o=o.child;o!==null;){var l=o;kw(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),o=o.sibling}}function xa(o,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)Rw(o,l.alternate,l),l=l.sibling}function ys(o){for(o=o.child;o!==null;){var l=o;switch(l.tag){case 0:case 11:case 14:case 15:ya(4,l,l.return),ys(l);break;case 1:Wo(l,l.return);var u=l.stateNode;typeof u.componentWillUnmount=="function"&&ww(l,l.return,u),ys(l);break;case 27:ju(l.stateNode);case 26:case 5:Wo(l,l.return),ys(l);break;case 22:l.memoizedState===null&&ys(l);break;case 30:ys(l);break;default:ys(l)}o=o.sibling}}function ba(o,l,u){for(u=u&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,y=o,S=l,D=S.flags;switch(S.tag){case 0:case 11:case 15:ba(y,S,u),hu(4,S);break;case 1:if(ba(y,S,u),h=S,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(ee){nn(h,h.return,ee)}if(h=S,y=h.updateQueue,y!==null){var k=h.stateNode;try{var z=y.shared.hiddenCallbacks;if(z!==null)for(y.shared.hiddenCallbacks=null,y=0;y<z.length;y++)sS(z[y],k)}catch(ee){nn(h,h.return,ee)}}u&&D&64&&Sw(S),pu(S,S.return);break;case 27:Ew(S);case 26:case 5:ba(y,S,u),u&&h===null&&D&4&&jw(S),pu(S,S.return);break;case 12:ba(y,S,u);break;case 13:ba(y,S,u),u&&D&4&&Aw(y,S);break;case 22:S.memoizedState===null&&ba(y,S,u),pu(S,S.return);break;case 30:break;default:ba(y,S,u)}l=l.sibling}}function Vg(o,l){var u=null;o!==null&&o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(u=o.memoizedState.cachePool.pool),o=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==u&&(o!=null&&o.refCount++,u!=null&&Jc(u))}function Fg(o,l){o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Jc(o))}function Qo(o,l,u,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Nw(o,l,u,h),l=l.sibling}function Nw(o,l,u,h){var y=l.flags;switch(l.tag){case 0:case 11:case 15:Qo(o,l,u,h),y&2048&&hu(9,l);break;case 1:Qo(o,l,u,h);break;case 3:Qo(o,l,u,h),y&2048&&(o=null,l.alternate!==null&&(o=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==o&&(l.refCount++,o!=null&&Jc(o)));break;case 12:if(y&2048){Qo(o,l,u,h),o=l.stateNode;try{var S=l.memoizedProps,D=S.id,k=S.onPostCommit;typeof k=="function"&&k(D,l.alternate===null?"mount":"update",o.passiveEffectDuration,-0)}catch(z){nn(l,l.return,z)}}else Qo(o,l,u,h);break;case 13:Qo(o,l,u,h);break;case 23:break;case 22:S=l.stateNode,D=l.alternate,l.memoizedState!==null?S._visibility&2?Qo(o,l,u,h):mu(o,l):S._visibility&2?Qo(o,l,u,h):(S._visibility|=2,Nl(o,l,u,h,(l.subtreeFlags&10256)!==0)),y&2048&&Vg(D,l);break;case 24:Qo(o,l,u,h),y&2048&&Fg(l.alternate,l);break;default:Qo(o,l,u,h)}}function Nl(o,l,u,h,y){for(y=y&&(l.subtreeFlags&10256)!==0,l=l.child;l!==null;){var S=o,D=l,k=u,z=h,ee=D.flags;switch(D.tag){case 0:case 11:case 15:Nl(S,D,k,z,y),hu(8,D);break;case 23:break;case 22:var de=D.stateNode;D.memoizedState!==null?de._visibility&2?Nl(S,D,k,z,y):mu(S,D):(de._visibility|=2,Nl(S,D,k,z,y)),y&&ee&2048&&Vg(D.alternate,D);break;case 24:Nl(S,D,k,z,y),y&&ee&2048&&Fg(D.alternate,D);break;default:Nl(S,D,k,z,y)}l=l.sibling}}function mu(o,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var u=o,h=l,y=h.flags;switch(h.tag){case 22:mu(u,h),y&2048&&Vg(h.alternate,h);break;case 24:mu(u,h),y&2048&&Fg(h.alternate,h);break;default:mu(u,h)}l=l.sibling}}var gu=8192;function Ol(o){if(o.subtreeFlags&gu)for(o=o.child;o!==null;)Ow(o),o=o.sibling}function Ow(o){switch(o.tag){case 26:Ol(o),o.flags&gu&&o.memoizedState!==null&&s4(Ro,o.memoizedState,o.memoizedProps);break;case 5:Ol(o);break;case 3:case 4:var l=Ro;Ro=Bf(o.stateNode.containerInfo),Ol(o),Ro=l;break;case 22:o.memoizedState===null&&(l=o.alternate,l!==null&&l.memoizedState!==null?(l=gu,gu=16777216,Ol(o),gu=l):Ol(o));break;default:Ol(o)}}function Mw(o){var l=o.alternate;if(l!==null&&(o=l.child,o!==null)){l.child=null;do l=o.sibling,o.sibling=null,o=l;while(o!==null)}}function vu(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wn=h,Lw(h,o)}Mw(o)}if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Iw(o),o=o.sibling}function Iw(o){switch(o.tag){case 0:case 11:case 15:vu(o),o.flags&2048&&ya(9,o,o.return);break;case 3:vu(o);break;case 12:vu(o);break;case 22:var l=o.stateNode;o.memoizedState!==null&&l._visibility&2&&(o.return===null||o.return.tag!==13)?(l._visibility&=-3,Df(o)):vu(o);break;default:vu(o)}}function Df(o){var l=o.deletions;if((o.flags&16)!==0){if(l!==null)for(var u=0;u<l.length;u++){var h=l[u];Wn=h,Lw(h,o)}Mw(o)}for(o=o.child;o!==null;){switch(l=o,l.tag){case 0:case 11:case 15:ya(8,l,l.return),Df(l);break;case 22:u=l.stateNode,u._visibility&2&&(u._visibility&=-3,Df(l));break;default:Df(l)}o=o.sibling}}function Lw(o,l){for(;Wn!==null;){var u=Wn;switch(u.tag){case 0:case 11:case 15:ya(8,u,l);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Jc(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Wn=h;else e:for(u=o;Wn!==null;){h=Wn;var y=h.sibling,S=h.return;if(_w(h),h===u){Wn=null;break e}if(y!==null){y.return=S,Wn=y;break e}Wn=S}}}var jN={getCacheForType:function(o){var l=tr(Fn),u=l.data.get(o);return u===void 0&&(u=o(),l.data.set(o,u)),u}},CN=typeof WeakMap=="function"?WeakMap:Map,Gt=0,cn=null,Et=null,Pt=0,Wt=0,Br=null,Sa=!1,Ml=!1,Hg=!1,Mi=0,Rn=0,wa=0,xs=0,qg=0,so=0,Il=0,yu=null,jr=null,Gg=!1,Wg=0,Af=1/0,Pf=null,ja=null,Zn=0,Ca=null,Ll=null,$l=0,Qg=0,Yg=null,$w=null,xu=0,Kg=null;function Vr(){if((Gt&2)!==0&&Pt!==0)return Pt&-Pt;if(N.T!==null){var o=El;return o!==0?o:rv()}return U()}function zw(){so===0&&(so=(Pt&536870912)===0||Vt?yi():536870912);var o=ao.current;return o!==null&&(o.flags|=32),so}function Fr(o,l,u){(o===cn&&(Wt===2||Wt===9)||o.cancelPendingCommit!==null)&&(zl(o,0),Ea(o,Pt,so,!1)),xr(o,u),((Gt&2)===0||o!==cn)&&(o===cn&&((Gt&2)===0&&(xs|=u),Rn===4&&Ea(o,Pt,so,!1)),Yo(o))}function Uw(o,l,u){if((Gt&6)!==0)throw Error(r(327));var h=!u&&(l&124)===0&&(l&o.expiredLanes)===0||Xr(o,l),y=h?RN(o,l):Jg(o,l,!0),S=h;do{if(y===0){Ml&&!h&&Ea(o,l,0,!1);break}else{if(u=o.current.alternate,S&&!EN(u)){y=Jg(o,l,!1),S=!1;continue}if(y===2){if(S=l,o.errorRecoveryDisabledLanes&S)var D=0;else D=o.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){l=D;e:{var k=o;y=yu;var z=k.current.memoizedState.isDehydrated;if(z&&(zl(k,D).flags|=256),D=Jg(k,D,!1),D!==2){if(Hg&&!z){k.errorRecoveryDisabledLanes|=S,xs|=S,y=4;break e}S=jr,jr=y,S!==null&&(jr===null?jr=S:jr.push.apply(jr,S))}y=D}if(S=!1,y!==2)continue}}if(y===1){zl(o,0),Ea(o,l,0,!0);break}e:{switch(h=o,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((l&4194048)!==l)break;case 6:Ea(h,l,so,!Sa);break e;case 2:jr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((l&62914560)===l&&(y=Wg+300-Re(),10<y)){if(Ea(h,l,so,!Sa),vi(h,0,!0)!==0)break e;h.timeoutHandle=mj(Bw.bind(null,h,u,jr,Pf,Gg,l,so,xs,Il,Sa,S,2,-0,0),y);break e}Bw(h,u,jr,Pf,Gg,l,so,xs,Il,Sa,S,0,-0,0)}}break}while(!0);Yo(o)}function Bw(o,l,u,h,y,S,D,k,z,ee,de,pe,ne,ie){if(o.timeoutHandle=-1,pe=l.subtreeFlags,(pe&8192||(pe&16785408)===16785408)&&(Tu={stylesheets:null,count:0,unsuspend:a4},Ow(l),pe=l4(),pe!==null)){o.cancelPendingCommit=pe(Qw.bind(null,o,l,S,u,h,y,D,k,z,de,1,ne,ie)),Ea(o,S,D,!ee);return}Qw(o,l,S,u,h,y,D,k,z)}function EN(o){for(var l=o;;){var u=l.tag;if((u===0||u===11||u===15)&&l.flags&16384&&(u=l.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var y=u[h],S=y.getSnapshot;y=y.value;try{if(!Lr(S(),y))return!1}catch{return!1}}if(u=l.child,l.subtreeFlags&16384&&u!==null)u.return=l,l=u;else{if(l===o)break;for(;l.sibling===null;){if(l.return===null||l.return===o)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Ea(o,l,u,h){l&=~qg,l&=~xs,o.suspendedLanes|=l,o.pingedLanes&=~l,h&&(o.warmLanes|=l),h=o.expirationTimes;for(var y=l;0<y;){var S=31-Lt(y),D=1<<S;h[S]=-1,y&=~D}u!==0&&xi(o,u,l)}function kf(){return(Gt&6)===0?(bu(0),!1):!0}function Xg(){if(Et!==null){if(Wt===0)var o=Et.return;else o=Et,Ri=hs=null,pg(o),Pl=null,uu=0,o=Et;for(;o!==null;)bw(o.alternate,o),o=o.return;Et=null}}function zl(o,l){var u=o.timeoutHandle;u!==-1&&(o.timeoutHandle=-1,FN(u)),u=o.cancelPendingCommit,u!==null&&(o.cancelPendingCommit=null,u()),Xg(),cn=o,Et=u=Ci(o.current,null),Pt=l,Wt=0,Br=null,Sa=!1,Ml=Xr(o,l),Hg=!1,Il=so=qg=xs=wa=Rn=0,jr=yu=null,Gg=!1,(l&8)!==0&&(l|=l&32);var h=o.entangledLanes;if(h!==0)for(o=o.entanglements,h&=l;0<h;){var y=31-Lt(h),S=1<<y;l|=o[y],h&=~S}return Mi=l,Jd(),u}function Vw(o,l){St=null,N.H=xf,l===tu||l===cf?(l=iS(),Wt=3):l===nS?(l=iS(),Wt=4):Wt=l===aw?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,Br=l,Et===null&&(Rn=1,Cf(o,no(l,o.current)))}function Fw(){var o=N.H;return N.H=xf,o===null?xf:o}function Hw(){var o=N.A;return N.A=jN,o}function Zg(){Rn=4,Sa||(Pt&4194048)!==Pt&&ao.current!==null||(Ml=!0),(wa&134217727)===0&&(xs&134217727)===0||cn===null||Ea(cn,Pt,so,!1)}function Jg(o,l,u){var h=Gt;Gt|=2;var y=Fw(),S=Hw();(cn!==o||Pt!==l)&&(Pf=null,zl(o,l)),l=!1;var D=Rn;e:do try{if(Wt!==0&&Et!==null){var k=Et,z=Br;switch(Wt){case 8:Xg(),D=6;break e;case 3:case 2:case 9:case 6:ao.current===null&&(l=!0);var ee=Wt;if(Wt=0,Br=null,Ul(o,k,z,ee),u&&Ml){D=0;break e}break;default:ee=Wt,Wt=0,Br=null,Ul(o,k,z,ee)}}TN(),D=Rn;break}catch(de){Vw(o,de)}while(!0);return l&&o.shellSuspendCounter++,Ri=hs=null,Gt=h,N.H=y,N.A=S,Et===null&&(cn=null,Pt=0,Jd()),D}function TN(){for(;Et!==null;)qw(Et)}function RN(o,l){var u=Gt;Gt|=2;var h=Fw(),y=Hw();cn!==o||Pt!==l?(Pf=null,Af=Re()+500,zl(o,l)):Ml=Xr(o,l);e:do try{if(Wt!==0&&Et!==null){l=Et;var S=Br;t:switch(Wt){case 1:Wt=0,Br=null,Ul(o,l,S,1);break;case 2:case 9:if(rS(S)){Wt=0,Br=null,Gw(l);break}l=function(){Wt!==2&&Wt!==9||cn!==o||(Wt=7),Yo(o)},S.then(l,l);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:rS(S)?(Wt=0,Br=null,Gw(l)):(Wt=0,Br=null,Ul(o,l,S,7));break;case 5:var D=null;switch(Et.tag){case 26:D=Et.memoizedState;case 5:case 27:var k=Et;if(!D||Rj(D)){Wt=0,Br=null;var z=k.sibling;if(z!==null)Et=z;else{var ee=k.return;ee!==null?(Et=ee,Nf(ee)):Et=null}break t}}Wt=0,Br=null,Ul(o,l,S,5);break;case 6:Wt=0,Br=null,Ul(o,l,S,6);break;case 8:Xg(),Rn=6;break e;default:throw Error(r(462))}}_N();break}catch(de){Vw(o,de)}while(!0);return Ri=hs=null,N.H=h,N.A=y,Gt=u,Et!==null?0:(cn=null,Pt=0,Jd(),Rn)}function _N(){for(;Et!==null&&!Rt();)qw(Et)}function qw(o){var l=yw(o.alternate,o,Mi);o.memoizedProps=o.pendingProps,l===null?Nf(o):Et=l}function Gw(o){var l=o,u=l.alternate;switch(l.tag){case 15:case 0:l=fw(u,l,l.pendingProps,l.type,void 0,Pt);break;case 11:l=fw(u,l,l.pendingProps,l.type.render,l.ref,Pt);break;case 5:pg(l);default:bw(u,l),l=Et=W1(l,Mi),l=yw(u,l,Mi)}o.memoizedProps=o.pendingProps,l===null?Nf(o):Et=l}function Ul(o,l,u,h){Ri=hs=null,pg(l),Pl=null,uu=0;var y=l.return;try{if(vN(o,y,l,u,Pt)){Rn=1,Cf(o,no(u,o.current)),Et=null;return}}catch(S){if(y!==null)throw Et=y,S;Rn=1,Cf(o,no(u,o.current)),Et=null;return}l.flags&32768?(Vt||h===1?o=!0:Ml||(Pt&536870912)!==0?o=!1:(Sa=o=!0,(h===2||h===9||h===3||h===6)&&(h=ao.current,h!==null&&h.tag===13&&(h.flags|=16384))),Ww(l,o)):Nf(l)}function Nf(o){var l=o;do{if((l.flags&32768)!==0){Ww(l,Sa);return}o=l.return;var u=xN(l.alternate,l,Mi);if(u!==null){Et=u;return}if(l=l.sibling,l!==null){Et=l;return}Et=l=o}while(l!==null);Rn===0&&(Rn=5)}function Ww(o,l){do{var u=bN(o.alternate,o);if(u!==null){u.flags&=32767,Et=u;return}if(u=o.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!l&&(o=o.sibling,o!==null)){Et=o;return}Et=o=u}while(o!==null);Rn=6,Et=null}function Qw(o,l,u,h,y,S,D,k,z){o.cancelPendingCommit=null;do Of();while(Zn!==0);if((Gt&6)!==0)throw Error(r(327));if(l!==null){if(l===o.current)throw Error(r(177));if(S=l.lanes|l.childLanes,S|=Fm,qn(o,u,S,D,k,z),o===cn&&(Et=cn=null,Pt=0),Ll=l,Ca=o,$l=u,Qg=S,Yg=y,$w=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(o.callbackNode=null,o.callbackPriority=0,kN(he,function(){return Jw(),null})):(o.callbackNode=null,o.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=N.T,N.T=null,y=L.p,L.p=2,D=Gt,Gt|=4;try{SN(o,l,u)}finally{Gt=D,L.p=y,N.T=h}}Zn=1,Yw(),Kw(),Xw()}}function Yw(){if(Zn===1){Zn=0;var o=Ca,l=Ll,u=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||u){u=N.T,N.T=null;var h=L.p;L.p=2;var y=Gt;Gt|=4;try{Pw(l,o);var S=dv,D=L1(o.containerInfo),k=S.focusedElem,z=S.selectionRange;if(D!==k&&k&&k.ownerDocument&&I1(k.ownerDocument.documentElement,k)){if(z!==null&&$m(k)){var ee=z.start,de=z.end;if(de===void 0&&(de=ee),"selectionStart"in k)k.selectionStart=ee,k.selectionEnd=Math.min(de,k.value.length);else{var pe=k.ownerDocument||document,ne=pe&&pe.defaultView||window;if(ne.getSelection){var ie=ne.getSelection(),ct=k.textContent.length,it=Math.min(z.start,ct),Zt=z.end===void 0?it:Math.min(z.end,ct);!ie.extend&&it>Zt&&(D=Zt,Zt=it,it=D);var Y=M1(k,it),G=M1(k,Zt);if(Y&&G&&(ie.rangeCount!==1||ie.anchorNode!==Y.node||ie.anchorOffset!==Y.offset||ie.focusNode!==G.node||ie.focusOffset!==G.offset)){var J=pe.createRange();J.setStart(Y.node,Y.offset),ie.removeAllRanges(),it>Zt?(ie.addRange(J),ie.extend(G.node,G.offset)):(J.setEnd(G.node,G.offset),ie.addRange(J))}}}}for(pe=[],ie=k;ie=ie.parentNode;)ie.nodeType===1&&pe.push({element:ie,left:ie.scrollLeft,top:ie.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<pe.length;k++){var fe=pe[k];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}Gf=!!uv,dv=uv=null}finally{Gt=y,L.p=h,N.T=u}}o.current=l,Zn=2}}function Kw(){if(Zn===2){Zn=0;var o=Ca,l=Ll,u=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||u){u=N.T,N.T=null;var h=L.p;L.p=2;var y=Gt;Gt|=4;try{Rw(o,l.alternate,l)}finally{Gt=y,L.p=h,N.T=u}}Zn=3}}function Xw(){if(Zn===4||Zn===3){Zn=0,en();var o=Ca,l=Ll,u=$l,h=$w;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?Zn=5:(Zn=0,Ll=Ca=null,Zw(o,o.pendingLanes));var y=o.pendingLanes;if(y===0&&(ja=null),rs(u),l=l.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(_t,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=N.T,y=L.p,L.p=2,N.T=null;try{for(var S=o.onRecoverableError,D=0;D<h.length;D++){var k=h[D];S(k.value,{componentStack:k.stack})}}finally{N.T=l,L.p=y}}($l&3)!==0&&Of(),Yo(o),y=o.pendingLanes,(u&4194090)!==0&&(y&42)!==0?o===Kg?xu++:(xu=0,Kg=o):xu=0,bu(0)}}function Zw(o,l){(o.pooledCacheLanes&=l)===0&&(l=o.pooledCache,l!=null&&(o.pooledCache=null,Jc(l)))}function Of(o){return Yw(),Kw(),Xw(),Jw()}function Jw(){if(Zn!==5)return!1;var o=Ca,l=Qg;Qg=0;var u=rs($l),h=N.T,y=L.p;try{L.p=32>u?32:u,N.T=null,u=Yg,Yg=null;var S=Ca,D=$l;if(Zn=0,Ll=Ca=null,$l=0,(Gt&6)!==0)throw Error(r(331));var k=Gt;if(Gt|=4,Iw(S.current),Nw(S,S.current,D,u),Gt=k,bu(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(_t,S)}catch{}return!0}finally{L.p=y,N.T=h,Zw(o,l)}}function ej(o,l,u){l=no(u,l),l=_g(o.stateNode,l,2),o=pa(o,l,2),o!==null&&(xr(o,2),Yo(o))}function nn(o,l,u){if(o.tag===3)ej(o,o,u);else for(;l!==null;){if(l.tag===3){ej(l,o,u);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(ja===null||!ja.has(h))){o=no(u,o),u=ow(2),h=pa(l,u,2),h!==null&&(iw(u,h,l,o),xr(h,2),Yo(h));break}}l=l.return}}function ev(o,l,u){var h=o.pingCache;if(h===null){h=o.pingCache=new CN;var y=new Set;h.set(l,y)}else y=h.get(l),y===void 0&&(y=new Set,h.set(l,y));y.has(u)||(Hg=!0,y.add(u),o=DN.bind(null,o,l,u),l.then(o,o))}function DN(o,l,u){var h=o.pingCache;h!==null&&h.delete(l),o.pingedLanes|=o.suspendedLanes&u,o.warmLanes&=~u,cn===o&&(Pt&u)===u&&(Rn===4||Rn===3&&(Pt&62914560)===Pt&&300>Re()-Wg?(Gt&2)===0&&zl(o,0):qg|=u,Il===Pt&&(Il=0)),Yo(o)}function tj(o,l){l===0&&(l=aa()),o=Sl(o,l),o!==null&&(xr(o,l),Yo(o))}function AN(o){var l=o.memoizedState,u=0;l!==null&&(u=l.retryLane),tj(o,u)}function PN(o,l){var u=0;switch(o.tag){case 13:var h=o.stateNode,y=o.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=o.stateNode;break;case 22:h=o.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(l),tj(o,u)}function kN(o,l){return Mt(o,l)}var Mf=null,Bl=null,tv=!1,If=!1,nv=!1,bs=0;function Yo(o){o!==Bl&&o.next===null&&(Bl===null?Mf=Bl=o:Bl=Bl.next=o),If=!0,tv||(tv=!0,ON())}function bu(o,l){if(!nv&&If){nv=!0;do for(var u=!1,h=Mf;h!==null;){if(o!==0){var y=h.pendingLanes;if(y===0)var S=0;else{var D=h.suspendedLanes,k=h.pingedLanes;S=(1<<31-Lt(42|o)+1)-1,S&=y&~(D&~k),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,ij(h,S))}else S=Pt,S=vi(h,h===cn?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||Xr(h,S)||(u=!0,ij(h,S));h=h.next}while(u);nv=!1}}function NN(){nj()}function nj(){If=tv=!1;var o=0;bs!==0&&(VN()&&(o=bs),bs=0);for(var l=Re(),u=null,h=Mf;h!==null;){var y=h.next,S=rj(h,l);S===0?(h.next=null,u===null?Mf=y:u.next=y,y===null&&(Bl=u)):(u=h,(o!==0||(S&3)!==0)&&(If=!0)),h=y}bu(o)}function rj(o,l){for(var u=o.suspendedLanes,h=o.pingedLanes,y=o.expirationTimes,S=o.pendingLanes&-62914561;0<S;){var D=31-Lt(S),k=1<<D,z=y[D];z===-1?((k&u)===0||(k&h)!==0)&&(y[D]=dl(k,l)):z<=l&&(o.expiredLanes|=k),S&=~k}if(l=cn,u=Pt,u=vi(o,o===l?u:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h=o.callbackNode,u===0||o===l&&(Wt===2||Wt===9)||o.cancelPendingCommit!==null)return h!==null&&h!==null&&pt(h),o.callbackNode=null,o.callbackPriority=0;if((u&3)===0||Xr(o,u)){if(l=u&-u,l===o.callbackPriority)return l;switch(h!==null&&pt(h),rs(u)){case 2:case 8:u=_e;break;case 32:u=he;break;case 268435456:u=$e;break;default:u=he}return h=oj.bind(null,o),u=Mt(u,h),o.callbackPriority=l,o.callbackNode=u,l}return h!==null&&h!==null&&pt(h),o.callbackPriority=2,o.callbackNode=null,2}function oj(o,l){if(Zn!==0&&Zn!==5)return o.callbackNode=null,o.callbackPriority=0,null;var u=o.callbackNode;if(Of()&&o.callbackNode!==u)return null;var h=Pt;return h=vi(o,o===cn?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),h===0?null:(Uw(o,h,l),rj(o,Re()),o.callbackNode!=null&&o.callbackNode===u?oj.bind(null,o):null)}function ij(o,l){if(Of())return null;Uw(o,l,!0)}function ON(){HN(function(){(Gt&6)!==0?Mt(Qe,NN):nj()})}function rv(){return bs===0&&(bs=yi()),bs}function aj(o){return o==null||typeof o=="symbol"||typeof o=="boolean"?null:typeof o=="function"?o:Gd(""+o)}function sj(o,l){var u=l.ownerDocument.createElement("input");return u.name=l.name,u.value=l.value,o.id&&u.setAttribute("form",o.id),l.parentNode.insertBefore(u,l),o=new FormData(o),u.parentNode.removeChild(u),o}function MN(o,l,u,h,y){if(l==="submit"&&u&&u.stateNode===y){var S=aj((y[Te]||null).action),D=h.submitter;D&&(l=(l=D[Te]||null)?aj(l.formAction):D.getAttribute("formAction"),l!==null&&(S=l,D=null));var k=new Kd("action","action",null,h,y);o.push({event:k,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(bs!==0){var z=D?sj(y,D):new FormData(y);jg(u,{pending:!0,data:z,method:y.method,action:S},null,z)}}else typeof S=="function"&&(k.preventDefault(),z=D?sj(y,D):new FormData(y),jg(u,{pending:!0,data:z,method:y.method,action:S},S,z))},currentTarget:y}]})}}for(var ov=0;ov<Vm.length;ov++){var iv=Vm[ov],IN=iv.toLowerCase(),LN=iv[0].toUpperCase()+iv.slice(1);To(IN,"on"+LN)}To(U1,"onAnimationEnd"),To(B1,"onAnimationIteration"),To(V1,"onAnimationStart"),To("dblclick","onDoubleClick"),To("focusin","onFocus"),To("focusout","onBlur"),To(eN,"onTransitionRun"),To(tN,"onTransitionStart"),To(nN,"onTransitionCancel"),To(F1,"onTransitionEnd"),cr("onMouseEnter",["mouseout","mouseover"]),cr("onMouseLeave",["mouseout","mouseover"]),cr("onPointerEnter",["pointerout","pointerover"]),cr("onPointerLeave",["pointerout","pointerover"]),Ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Su="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(" "),$N=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Su));function lj(o,l){l=(l&4)!==0;for(var u=0;u<o.length;u++){var h=o[u],y=h.event;h=h.listeners;e:{var S=void 0;if(l)for(var D=h.length-1;0<=D;D--){var k=h[D],z=k.instance,ee=k.currentTarget;if(k=k.listener,z!==S&&y.isPropagationStopped())break e;S=k,y.currentTarget=ee;try{S(y)}catch(de){jf(de)}y.currentTarget=null,S=z}else for(D=0;D<h.length;D++){if(k=h[D],z=k.instance,ee=k.currentTarget,k=k.listener,z!==S&&y.isPropagationStopped())break e;S=k,y.currentTarget=ee;try{S(y)}catch(de){jf(de)}y.currentTarget=null,S=z}}}}function Tt(o,l){var u=l[We];u===void 0&&(u=l[We]=new Set);var h=o+"__bubble";u.has(h)||(cj(l,o,2,!1),u.add(h))}function av(o,l,u){var h=0;l&&(h|=4),cj(u,o,h,l)}var Lf="_reactListening"+Math.random().toString(36).slice(2);function sv(o){if(!o[Lf]){o[Lf]=!0,Yt.forEach(function(u){u!=="selectionchange"&&($N.has(u)||av(u,!1,o),av(u,!0,o))});var l=o.nodeType===9?o:o.ownerDocument;l===null||l[Lf]||(l[Lf]=!0,av("selectionchange",!1,l))}}function cj(o,l,u,h){switch(Nj(l)){case 2:var y=d4;break;case 8:y=f4;break;default:y=Sv}u=y.bind(null,l,u,o),y=void 0,!Dm||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(y=!0),h?y!==void 0?o.addEventListener(l,u,{capture:!0,passive:y}):o.addEventListener(l,u,!0):y!==void 0?o.addEventListener(l,u,{passive:y}):o.addEventListener(l,u,!1)}function lv(o,l,u,h,y){var S=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var D=h.tag;if(D===3||D===4){var k=h.stateNode.containerInfo;if(k===y)break;if(D===4)for(D=h.return;D!==null;){var z=D.tag;if((z===3||z===4)&&D.stateNode.containerInfo===y)return;D=D.return}for(;k!==null;){if(D=ft(k),D===null)return;if(z=D.tag,z===5||z===6||z===26||z===27){h=S=D;continue e}k=k.parentNode}}h=h.return}g1(function(){var ee=S,de=Rm(u),pe=[];e:{var ne=H1.get(o);if(ne!==void 0){var ie=Kd,ct=o;switch(o){case"keypress":if(Qd(u)===0)break e;case"keydown":case"keyup":ie=kk;break;case"focusin":ct="focus",ie=Nm;break;case"focusout":ct="blur",ie=Nm;break;case"beforeblur":case"afterblur":ie=Nm;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ie=x1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ie=bk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ie=Mk;break;case U1:case B1:case V1:ie=jk;break;case F1:ie=Lk;break;case"scroll":case"scrollend":ie=yk;break;case"wheel":ie=zk;break;case"copy":case"cut":case"paste":ie=Ek;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ie=S1;break;case"toggle":case"beforetoggle":ie=Bk}var it=(l&4)!==0,Zt=!it&&(o==="scroll"||o==="scrollend"),Y=it?ne!==null?ne+"Capture":null:ne;it=[];for(var G=ee,J;G!==null;){var fe=G;if(J=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||J===null||Y===null||(fe=Uc(G,Y),fe!=null&&it.push(wu(G,fe,J))),Zt)break;G=G.return}0<it.length&&(ne=new ie(ne,ct,null,u,de),pe.push({event:ne,listeners:it}))}}if((l&7)===0){e:{if(ne=o==="mouseover"||o==="pointerover",ie=o==="mouseout"||o==="pointerout",ne&&u!==Tm&&(ct=u.relatedTarget||u.fromElement)&&(ft(ct)||ct[Ue]))break e;if((ie||ne)&&(ne=de.window===de?de:(ne=de.ownerDocument)?ne.defaultView||ne.parentWindow:window,ie?(ct=u.relatedTarget||u.toElement,ie=ee,ct=ct?ft(ct):null,ct!==null&&(Zt=s(ct),it=ct.tag,ct!==Zt||it!==5&&it!==27&&it!==6)&&(ct=null)):(ie=null,ct=ee),ie!==ct)){if(it=x1,fe="onMouseLeave",Y="onMouseEnter",G="mouse",(o==="pointerout"||o==="pointerover")&&(it=S1,fe="onPointerLeave",Y="onPointerEnter",G="pointer"),Zt=ie==null?ne:ln(ie),J=ct==null?ne:ln(ct),ne=new it(fe,G+"leave",ie,u,de),ne.target=Zt,ne.relatedTarget=J,fe=null,ft(de)===ee&&(it=new it(Y,G+"enter",ct,u,de),it.target=J,it.relatedTarget=Zt,fe=it),Zt=fe,ie&&ct)t:{for(it=ie,Y=ct,G=0,J=it;J;J=Vl(J))G++;for(J=0,fe=Y;fe;fe=Vl(fe))J++;for(;0<G-J;)it=Vl(it),G--;for(;0<J-G;)Y=Vl(Y),J--;for(;G--;){if(it===Y||Y!==null&&it===Y.alternate)break t;it=Vl(it),Y=Vl(Y)}it=null}else it=null;ie!==null&&uj(pe,ne,ie,it,!1),ct!==null&&Zt!==null&&uj(pe,Zt,ct,it,!0)}}e:{if(ne=ee?ln(ee):window,ie=ne.nodeName&&ne.nodeName.toLowerCase(),ie==="select"||ie==="input"&&ne.type==="file")var qe=D1;else if(R1(ne))if(A1)qe=Xk;else{qe=Yk;var jt=Qk}else ie=ne.nodeName,!ie||ie.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Em(ee.elementType)&&(qe=D1):qe=Kk;if(qe&&(qe=qe(o,ee))){_1(pe,qe,u,de);break e}jt&&jt(o,ne,ee),o==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Cm(ne,"number",ne.value)}switch(jt=ee?ln(ee):window,o){case"focusin":(R1(jt)||jt.contentEditable==="true")&&(yl=jt,zm=ee,Qc=null);break;case"focusout":Qc=zm=yl=null;break;case"mousedown":Um=!0;break;case"contextmenu":case"mouseup":case"dragend":Um=!1,$1(pe,u,de);break;case"selectionchange":if(Jk)break;case"keydown":case"keyup":$1(pe,u,de)}var Je;if(Mm)e:{switch(o){case"compositionstart":var at="onCompositionStart";break e;case"compositionend":at="onCompositionEnd";break e;case"compositionupdate":at="onCompositionUpdate";break e}at=void 0}else vl?E1(o,u)&&(at="onCompositionEnd"):o==="keydown"&&u.keyCode===229&&(at="onCompositionStart");at&&(w1&&u.locale!=="ko"&&(vl||at!=="onCompositionStart"?at==="onCompositionEnd"&&vl&&(Je=v1()):(ua=de,Am="value"in ua?ua.value:ua.textContent,vl=!0)),jt=$f(ee,at),0<jt.length&&(at=new b1(at,o,null,u,de),pe.push({event:at,listeners:jt}),Je?at.data=Je:(Je=T1(u),Je!==null&&(at.data=Je)))),(Je=Fk?Hk(o,u):qk(o,u))&&(at=$f(ee,"onBeforeInput"),0<at.length&&(jt=new b1("onBeforeInput","beforeinput",null,u,de),pe.push({event:jt,listeners:at}),jt.data=Je)),MN(pe,o,ee,u,de)}lj(pe,l)})}function wu(o,l,u){return{instance:o,listener:l,currentTarget:u}}function $f(o,l){for(var u=l+"Capture",h=[];o!==null;){var y=o,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=Uc(o,u),y!=null&&h.unshift(wu(o,y,S)),y=Uc(o,l),y!=null&&h.push(wu(o,y,S))),o.tag===3)return h;o=o.return}return[]}function Vl(o){if(o===null)return null;do o=o.return;while(o&&o.tag!==5&&o.tag!==27);return o||null}function uj(o,l,u,h,y){for(var S=l._reactName,D=[];u!==null&&u!==h;){var k=u,z=k.alternate,ee=k.stateNode;if(k=k.tag,z!==null&&z===h)break;k!==5&&k!==26&&k!==27||ee===null||(z=ee,y?(ee=Uc(u,S),ee!=null&&D.unshift(wu(u,ee,z))):y||(ee=Uc(u,S),ee!=null&&D.push(wu(u,ee,z)))),u=u.return}D.length!==0&&o.push({event:l,listeners:D})}var zN=/\r\n?/g,UN=/\u0000|\uFFFD/g;function dj(o){return(typeof o=="string"?o:""+o).replace(zN,`
565
+ `).replace(UN,"")}function fj(o,l){return l=dj(l),dj(o)===l}function zf(){}function Xt(o,l,u,h,y,S){switch(u){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||pl(o,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&pl(o,""+h);break;case"className":wi(o,"class",h);break;case"tabIndex":wi(o,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":wi(o,u,h);break;case"style":p1(o,h,S);break;case"data":if(l!=="object"){wi(o,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||u!=="href")){o.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(u);break}h=Gd(""+h),o.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){o.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(l!=="input"&&Xt(o,l,"name",y.name,y,null),Xt(o,l,"formEncType",y.formEncType,y,null),Xt(o,l,"formMethod",y.formMethod,y,null),Xt(o,l,"formTarget",y.formTarget,y,null)):(Xt(o,l,"encType",y.encType,y,null),Xt(o,l,"method",y.method,y,null),Xt(o,l,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){o.removeAttribute(u);break}h=Gd(""+h),o.setAttribute(u,h);break;case"onClick":h!=null&&(o.onclick=zf);break;case"onScroll":h!=null&&Tt("scroll",o);break;case"onScrollEnd":h!=null&&Tt("scrollend",o);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=u}}break;case"multiple":o.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":o.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){o.removeAttribute("xlink:href");break}u=Gd(""+h),o.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(u,""+h):o.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(u,""):o.removeAttribute(u);break;case"capture":case"download":h===!0?o.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?o.setAttribute(u,h):o.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?o.setAttribute(u,h):o.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?o.removeAttribute(u):o.setAttribute(u,h);break;case"popover":Tt("beforetoggle",o),Tt("toggle",o),Si(o,"popover",h);break;case"xlinkActuate":bt(o,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":bt(o,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":bt(o,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":bt(o,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":bt(o,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":bt(o,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":bt(o,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":bt(o,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":bt(o,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Si(o,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=gk.get(u)||u,Si(o,u,h))}}function cv(o,l,u,h,y,S){switch(u){case"style":p1(o,h,S);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(y.children!=null)throw Error(r(60));o.innerHTML=u}}break;case"children":typeof h=="string"?pl(o,h):(typeof h=="number"||typeof h=="bigint")&&pl(o,""+h);break;case"onScroll":h!=null&&Tt("scroll",o);break;case"onScrollEnd":h!=null&&Tt("scrollend",o);break;case"onClick":h!=null&&(o.onclick=zf);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ho.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),l=u.slice(2,y?u.length-7:void 0),S=o[Te]||null,S=S!=null?S[u]:null,typeof S=="function"&&o.removeEventListener(l,S,y),typeof h=="function")){typeof S!="function"&&S!==null&&(u in o?o[u]=null:o.hasAttribute(u)&&o.removeAttribute(u)),o.addEventListener(l,h,y);break e}u in o?o[u]=h:h===!0?o.setAttribute(u,""):Si(o,u,h)}}}function Jn(o,l,u){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Tt("error",o),Tt("load",o);var h=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var D=u[S];if(D!=null)switch(S){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Xt(o,l,S,D,u,null)}}y&&Xt(o,l,"srcSet",u.srcSet,u,null),h&&Xt(o,l,"src",u.src,u,null);return;case"input":Tt("invalid",o);var k=S=D=y=null,z=null,ee=null;for(h in u)if(u.hasOwnProperty(h)){var de=u[h];if(de!=null)switch(h){case"name":y=de;break;case"type":D=de;break;case"checked":z=de;break;case"defaultChecked":ee=de;break;case"value":S=de;break;case"defaultValue":k=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,l));break;default:Xt(o,l,h,de,u,null)}}u1(o,S,k,z,ee,D,y,!1),Hd(o);return;case"select":Tt("invalid",o),h=D=S=null;for(y in u)if(u.hasOwnProperty(y)&&(k=u[y],k!=null))switch(y){case"value":S=k;break;case"defaultValue":D=k;break;case"multiple":h=k;default:Xt(o,l,y,k,u,null)}l=S,u=D,o.multiple=!!h,l!=null?hl(o,!!h,l,!1):u!=null&&hl(o,!!h,u,!0);return;case"textarea":Tt("invalid",o),S=y=h=null;for(D in u)if(u.hasOwnProperty(D)&&(k=u[D],k!=null))switch(D){case"value":h=k;break;case"defaultValue":y=k;break;case"children":S=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(r(91));break;default:Xt(o,l,D,k,u,null)}f1(o,h,y,S),Hd(o);return;case"option":for(z in u)if(u.hasOwnProperty(z)&&(h=u[z],h!=null))switch(z){case"selected":o.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Xt(o,l,z,h,u,null)}return;case"dialog":Tt("beforetoggle",o),Tt("toggle",o),Tt("cancel",o),Tt("close",o);break;case"iframe":case"object":Tt("load",o);break;case"video":case"audio":for(h=0;h<Su.length;h++)Tt(Su[h],o);break;case"image":Tt("error",o),Tt("load",o);break;case"details":Tt("toggle",o);break;case"embed":case"source":case"link":Tt("error",o),Tt("load",o);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in u)if(u.hasOwnProperty(ee)&&(h=u[ee],h!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,l));default:Xt(o,l,ee,h,u,null)}return;default:if(Em(l)){for(de in u)u.hasOwnProperty(de)&&(h=u[de],h!==void 0&&cv(o,l,de,h,u,void 0));return}}for(k in u)u.hasOwnProperty(k)&&(h=u[k],h!=null&&Xt(o,l,k,h,u,null))}function BN(o,l,u,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,D=null,k=null,z=null,ee=null,de=null;for(ie in u){var pe=u[ie];if(u.hasOwnProperty(ie)&&pe!=null)switch(ie){case"checked":break;case"value":break;case"defaultValue":z=pe;default:h.hasOwnProperty(ie)||Xt(o,l,ie,null,h,pe)}}for(var ne in h){var ie=h[ne];if(pe=u[ne],h.hasOwnProperty(ne)&&(ie!=null||pe!=null))switch(ne){case"type":S=ie;break;case"name":y=ie;break;case"checked":ee=ie;break;case"defaultChecked":de=ie;break;case"value":D=ie;break;case"defaultValue":k=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(r(137,l));break;default:ie!==pe&&Xt(o,l,ne,ie,h,pe)}}jm(o,D,k,z,ee,de,S,y);return;case"select":ie=D=k=ne=null;for(S in u)if(z=u[S],u.hasOwnProperty(S)&&z!=null)switch(S){case"value":break;case"multiple":ie=z;default:h.hasOwnProperty(S)||Xt(o,l,S,null,h,z)}for(y in h)if(S=h[y],z=u[y],h.hasOwnProperty(y)&&(S!=null||z!=null))switch(y){case"value":ne=S;break;case"defaultValue":k=S;break;case"multiple":D=S;default:S!==z&&Xt(o,l,y,S,h,z)}l=k,u=D,h=ie,ne!=null?hl(o,!!u,ne,!1):!!h!=!!u&&(l!=null?hl(o,!!u,l,!0):hl(o,!!u,u?[]:"",!1));return;case"textarea":ie=ne=null;for(k in u)if(y=u[k],u.hasOwnProperty(k)&&y!=null&&!h.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:Xt(o,l,k,null,h,y)}for(D in h)if(y=h[D],S=u[D],h.hasOwnProperty(D)&&(y!=null||S!=null))switch(D){case"value":ne=y;break;case"defaultValue":ie=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&Xt(o,l,D,y,h,S)}d1(o,ne,ie);return;case"option":for(var ct in u)if(ne=u[ct],u.hasOwnProperty(ct)&&ne!=null&&!h.hasOwnProperty(ct))switch(ct){case"selected":o.selected=!1;break;default:Xt(o,l,ct,null,h,ne)}for(z in h)if(ne=h[z],ie=u[z],h.hasOwnProperty(z)&&ne!==ie&&(ne!=null||ie!=null))switch(z){case"selected":o.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Xt(o,l,z,ne,h,ie)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var it in u)ne=u[it],u.hasOwnProperty(it)&&ne!=null&&!h.hasOwnProperty(it)&&Xt(o,l,it,null,h,ne);for(ee in h)if(ne=h[ee],ie=u[ee],h.hasOwnProperty(ee)&&ne!==ie&&(ne!=null||ie!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,l));break;default:Xt(o,l,ee,ne,h,ie)}return;default:if(Em(l)){for(var Zt in u)ne=u[Zt],u.hasOwnProperty(Zt)&&ne!==void 0&&!h.hasOwnProperty(Zt)&&cv(o,l,Zt,void 0,h,ne);for(de in h)ne=h[de],ie=u[de],!h.hasOwnProperty(de)||ne===ie||ne===void 0&&ie===void 0||cv(o,l,de,ne,h,ie);return}}for(var Y in u)ne=u[Y],u.hasOwnProperty(Y)&&ne!=null&&!h.hasOwnProperty(Y)&&Xt(o,l,Y,null,h,ne);for(pe in h)ne=h[pe],ie=u[pe],!h.hasOwnProperty(pe)||ne===ie||ne==null&&ie==null||Xt(o,l,pe,ne,h,ie)}var uv=null,dv=null;function Uf(o){return o.nodeType===9?o:o.ownerDocument}function hj(o){switch(o){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function pj(o,l){if(o===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return o===1&&l==="foreignObject"?0:o}function fv(o,l){return o==="textarea"||o==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var hv=null;function VN(){var o=window.event;return o&&o.type==="popstate"?o===hv?!1:(hv=o,!0):(hv=null,!1)}var mj=typeof setTimeout=="function"?setTimeout:void 0,FN=typeof clearTimeout=="function"?clearTimeout:void 0,gj=typeof Promise=="function"?Promise:void 0,HN=typeof queueMicrotask=="function"?queueMicrotask:typeof gj<"u"?function(o){return gj.resolve(null).then(o).catch(qN)}:mj;function qN(o){setTimeout(function(){throw o})}function Ta(o){return o==="head"}function vj(o,l){var u=l,h=0,y=0;do{var S=u.nextSibling;if(o.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"){if(0<h&&8>h){u=h;var D=o.ownerDocument;if(u&1&&ju(D.documentElement),u&2&&ju(D.body),u&4)for(u=D.head,ju(u),D=u.firstChild;D;){var k=D.nextSibling,z=D.nodeName;D[He]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&D.rel.toLowerCase()==="stylesheet"||u.removeChild(D),D=k}}if(y===0){o.removeChild(S),Pu(l);return}y--}else u==="$"||u==="$?"||u==="$!"?y++:h=u.charCodeAt(0)-48;else h=0;u=S}while(u);Pu(l)}function pv(o){var l=o.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var u=l;switch(l=l.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":pv(u),Xe(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}o.removeChild(u)}}function GN(o,l,u,h){for(;o.nodeType===1;){var y=u;if(o.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(o.nodeName!=="INPUT"||o.type!=="hidden"))break}else if(h){if(!o[He])switch(l){case"meta":if(!o.hasAttribute("itemprop"))break;return o;case"link":if(S=o.getAttribute("rel"),S==="stylesheet"&&o.hasAttribute("data-precedence"))break;if(S!==y.rel||o.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||o.getAttribute("title")!==(y.title==null?null:y.title))break;return o;case"style":if(o.hasAttribute("data-precedence"))break;return o;case"script":if(S=o.getAttribute("src"),(S!==(y.src==null?null:y.src)||o.getAttribute("type")!==(y.type==null?null:y.type)||o.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&o.hasAttribute("async")&&!o.hasAttribute("itemprop"))break;return o;default:return o}}else if(l==="input"&&o.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&o.getAttribute("name")===S)return o}else return o;if(o=_o(o.nextSibling),o===null)break}return null}function WN(o,l,u){if(l==="")return null;for(;o.nodeType!==3;)if((o.nodeType!==1||o.nodeName!=="INPUT"||o.type!=="hidden")&&!u||(o=_o(o.nextSibling),o===null))return null;return o}function mv(o){return o.data==="$!"||o.data==="$?"&&o.ownerDocument.readyState==="complete"}function QN(o,l){var u=o.ownerDocument;if(o.data!=="$?"||u.readyState==="complete")l();else{var h=function(){l(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),o._reactRetry=h}}function _o(o){for(;o!=null;o=o.nextSibling){var l=o.nodeType;if(l===1||l===3)break;if(l===8){if(l=o.data,l==="$"||l==="$!"||l==="$?"||l==="F!"||l==="F")break;if(l==="/$")return null}}return o}var gv=null;function yj(o){o=o.previousSibling;for(var l=0;o;){if(o.nodeType===8){var u=o.data;if(u==="$"||u==="$!"||u==="$?"){if(l===0)return o;l--}else u==="/$"&&l++}o=o.previousSibling}return null}function xj(o,l,u){switch(l=Uf(u),o){case"html":if(o=l.documentElement,!o)throw Error(r(452));return o;case"head":if(o=l.head,!o)throw Error(r(453));return o;case"body":if(o=l.body,!o)throw Error(r(454));return o;default:throw Error(r(451))}}function ju(o){for(var l=o.attributes;l.length;)o.removeAttributeNode(l[0]);Xe(o)}var lo=new Map,bj=new Set;function Bf(o){return typeof o.getRootNode=="function"?o.getRootNode():o.nodeType===9?o:o.ownerDocument}var Ii=L.d;L.d={f:YN,r:KN,D:XN,C:ZN,L:JN,m:e4,X:n4,S:t4,M:r4};function YN(){var o=Ii.f(),l=kf();return o||l}function KN(o){var l=tt(o);l!==null&&l.tag===5&&l.type==="form"?US(l):Ii.r(o)}var Fl=typeof document>"u"?null:document;function Sj(o,l,u){var h=Fl;if(h&&typeof l=="string"&&l){var y=to(l);y='link[rel="'+o+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),bj.has(y)||(bj.add(y),o={rel:o,crossOrigin:u,href:l},h.querySelector(y)===null&&(l=h.createElement("link"),Jn(l,"link",o),mt(l),h.head.appendChild(l)))}}function XN(o){Ii.D(o),Sj("dns-prefetch",o,null)}function ZN(o,l){Ii.C(o,l),Sj("preconnect",o,l)}function JN(o,l,u){Ii.L(o,l,u);var h=Fl;if(h&&o&&l){var y='link[rel="preload"][as="'+to(l)+'"]';l==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+to(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+to(u.imageSizes)+'"]')):y+='[href="'+to(o)+'"]';var S=y;switch(l){case"style":S=Hl(o);break;case"script":S=ql(o)}lo.has(S)||(o=m({rel:"preload",href:l==="image"&&u&&u.imageSrcSet?void 0:o,as:l},u),lo.set(S,o),h.querySelector(y)!==null||l==="style"&&h.querySelector(Cu(S))||l==="script"&&h.querySelector(Eu(S))||(l=h.createElement("link"),Jn(l,"link",o),mt(l),h.head.appendChild(l)))}}function e4(o,l){Ii.m(o,l);var u=Fl;if(u&&o){var h=l&&typeof l.as=="string"?l.as:"script",y='link[rel="modulepreload"][as="'+to(h)+'"][href="'+to(o)+'"]',S=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=ql(o)}if(!lo.has(S)&&(o=m({rel:"modulepreload",href:o},l),lo.set(S,o),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Eu(S)))return}h=u.createElement("link"),Jn(h,"link",o),mt(h),u.head.appendChild(h)}}}function t4(o,l,u){Ii.S(o,l,u);var h=Fl;if(h&&o){var y=gn(h).hoistableStyles,S=Hl(o);l=l||"default";var D=y.get(S);if(!D){var k={loading:0,preload:null};if(D=h.querySelector(Cu(S)))k.loading=5;else{o=m({rel:"stylesheet",href:o,"data-precedence":l},u),(u=lo.get(S))&&vv(o,u);var z=D=h.createElement("link");mt(z),Jn(z,"link",o),z._p=new Promise(function(ee,de){z.onload=ee,z.onerror=de}),z.addEventListener("load",function(){k.loading|=1}),z.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Vf(D,l,h)}D={type:"stylesheet",instance:D,count:1,state:k},y.set(S,D)}}}function n4(o,l){Ii.X(o,l);var u=Fl;if(u&&o){var h=gn(u).hoistableScripts,y=ql(o),S=h.get(y);S||(S=u.querySelector(Eu(y)),S||(o=m({src:o,async:!0},l),(l=lo.get(y))&&yv(o,l),S=u.createElement("script"),mt(S),Jn(S,"link",o),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function r4(o,l){Ii.M(o,l);var u=Fl;if(u&&o){var h=gn(u).hoistableScripts,y=ql(o),S=h.get(y);S||(S=u.querySelector(Eu(y)),S||(o=m({src:o,async:!0,type:"module"},l),(l=lo.get(y))&&yv(o,l),S=u.createElement("script"),mt(S),Jn(S,"link",o),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function wj(o,l,u,h){var y=(y=we.current)?Bf(y):null;if(!y)throw Error(r(446));switch(o){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(l=Hl(u.href),u=gn(y).hoistableStyles,h=u.get(l),h||(h={type:"style",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){o=Hl(u.href);var S=gn(y).hoistableStyles,D=S.get(o);if(D||(y=y.ownerDocument||y,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(o,D),(S=y.querySelector(Cu(o)))&&!S._p&&(D.instance=S,D.state.loading=5),lo.has(o)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},lo.set(o,u),S||o4(y,o,u,D.state))),l&&h===null)throw Error(r(528,""));return D}if(l&&h!==null)throw Error(r(529,""));return null;case"script":return l=u.async,u=u.src,typeof u=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=ql(u),u=gn(y).hoistableScripts,h=u.get(l),h||(h={type:"script",instance:null,count:0,state:null},u.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,o))}}function Hl(o){return'href="'+to(o)+'"'}function Cu(o){return'link[rel="stylesheet"]['+o+"]"}function jj(o){return m({},o,{"data-precedence":o.precedence,precedence:null})}function o4(o,l,u,h){o.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=o.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Jn(l,"link",u),mt(l),o.head.appendChild(l))}function ql(o){return'[src="'+to(o)+'"]'}function Eu(o){return"script[async]"+o}function Cj(o,l,u){if(l.count++,l.instance===null)switch(l.type){case"style":var h=o.querySelector('style[data-href~="'+to(u.href)+'"]');if(h)return l.instance=h,mt(h),h;var y=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(o.ownerDocument||o).createElement("style"),mt(h),Jn(h,"style",y),Vf(h,u.precedence,o),l.instance=h;case"stylesheet":y=Hl(u.href);var S=o.querySelector(Cu(y));if(S)return l.state.loading|=4,l.instance=S,mt(S),S;h=jj(u),(y=lo.get(y))&&vv(h,y),S=(o.ownerDocument||o).createElement("link"),mt(S);var D=S;return D._p=new Promise(function(k,z){D.onload=k,D.onerror=z}),Jn(S,"link",h),l.state.loading|=4,Vf(S,u.precedence,o),l.instance=S;case"script":return S=ql(u.src),(y=o.querySelector(Eu(S)))?(l.instance=y,mt(y),y):(h=u,(y=lo.get(S))&&(h=m({},u),yv(h,y)),o=o.ownerDocument||o,y=o.createElement("script"),mt(y),Jn(y,"link",h),o.head.appendChild(y),l.instance=y);case"void":return null;default:throw Error(r(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Vf(h,u.precedence,o));return l.instance}function Vf(o,l,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,S=y,D=0;D<h.length;D++){var k=h[D];if(k.dataset.precedence===l)S=k;else if(S!==y)break}S?S.parentNode.insertBefore(o,S.nextSibling):(l=u.nodeType===9?u.head:u,l.insertBefore(o,l.firstChild))}function vv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.title==null&&(o.title=l.title)}function yv(o,l){o.crossOrigin==null&&(o.crossOrigin=l.crossOrigin),o.referrerPolicy==null&&(o.referrerPolicy=l.referrerPolicy),o.integrity==null&&(o.integrity=l.integrity)}var Ff=null;function Ej(o,l,u){if(Ff===null){var h=new Map,y=Ff=new Map;y.set(u,h)}else y=Ff,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(o))return h;for(h.set(o,null),u=u.getElementsByTagName(o),y=0;y<u.length;y++){var S=u[y];if(!(S[He]||S[me]||o==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var D=S.getAttribute(l)||"";D=o+D;var k=h.get(D);k?k.push(S):h.set(D,[S])}}return h}function Tj(o,l,u){o=o.ownerDocument||o,o.head.insertBefore(u,l==="title"?o.querySelector("head > title"):null)}function i4(o,l,u){if(u===1||l.itemProp!=null)return!1;switch(o){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return o=l.disabled,typeof l.precedence=="string"&&o==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function Rj(o){return!(o.type==="stylesheet"&&(o.state.loading&3)===0)}var Tu=null;function a4(){}function s4(o,l,u){if(Tu===null)throw Error(r(475));var h=Tu;if(l.type==="stylesheet"&&(typeof u.media!="string"||matchMedia(u.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var y=Hl(u.href),S=o.querySelector(Cu(y));if(S){o=S._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(h.count++,h=Hf.bind(h),o.then(h,h)),l.state.loading|=4,l.instance=S,mt(S);return}S=o.ownerDocument||o,u=jj(u),(y=lo.get(y))&&vv(u,y),S=S.createElement("link"),mt(S);var D=S;D._p=new Promise(function(k,z){D.onload=k,D.onerror=z}),Jn(S,"link",u),l.instance=S}h.stylesheets===null&&(h.stylesheets=new Map),h.stylesheets.set(l,o),(o=l.state.preload)&&(l.state.loading&3)===0&&(h.count++,l=Hf.bind(h),o.addEventListener("load",l),o.addEventListener("error",l))}}function l4(){if(Tu===null)throw Error(r(475));var o=Tu;return o.stylesheets&&o.count===0&&xv(o,o.stylesheets),0<o.count?function(l){var u=setTimeout(function(){if(o.stylesheets&&xv(o,o.stylesheets),o.unsuspend){var h=o.unsuspend;o.unsuspend=null,h()}},6e4);return o.unsuspend=l,function(){o.unsuspend=null,clearTimeout(u)}}:null}function Hf(){if(this.count--,this.count===0){if(this.stylesheets)xv(this,this.stylesheets);else if(this.unsuspend){var o=this.unsuspend;this.unsuspend=null,o()}}}var qf=null;function xv(o,l){o.stylesheets=null,o.unsuspend!==null&&(o.count++,qf=new Map,l.forEach(c4,o),qf=null,Hf.call(o))}function c4(o,l){if(!(l.state.loading&4)){var u=qf.get(o);if(u)var h=u.get(null);else{u=new Map,qf.set(o,u);for(var y=o.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var D=y[S];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),h=D)}h&&u.set(null,h)}y=l.instance,D=y.getAttribute("data-precedence"),S=u.get(D)||h,S===h&&u.set(null,y),u.set(D,y),this.count++,h=Hf.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),S?S.parentNode.insertBefore(y,S.nextSibling):(o=o.nodeType===9?o.head:o,o.insertBefore(y,o.firstChild)),l.state.loading|=4}}var Ru={$$typeof:T,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function u4(o,l,u,h,y,S,D,k){this.tag=1,this.containerInfo=o,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Fo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fo(0),this.hiddenUpdates=Fo(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function _j(o,l,u,h,y,S,D,k,z,ee,de,pe){return o=new u4(o,l,u,D,k,z,ee,pe),l=1,S===!0&&(l|=24),S=$r(3,null,null,l),o.current=S,S.stateNode=o,l=eg(),l.refCount++,o.pooledCache=l,l.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:l},og(S),o}function Dj(o){return o?(o=wl,o):wl}function Aj(o,l,u,h,y,S){y=Dj(y),h.context===null?h.context=y:h.pendingContext=y,h=ha(l),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=pa(o,h,l),u!==null&&(Fr(u,o,l),ru(u,o,l))}function Pj(o,l){if(o=o.memoizedState,o!==null&&o.dehydrated!==null){var u=o.retryLane;o.retryLane=u!==0&&u<l?u:l}}function bv(o,l){Pj(o,l),(o=o.alternate)&&Pj(o,l)}function kj(o){if(o.tag===13){var l=Sl(o,67108864);l!==null&&Fr(l,o,67108864),bv(o,67108864)}}var Gf=!0;function d4(o,l,u,h){var y=N.T;N.T=null;var S=L.p;try{L.p=2,Sv(o,l,u,h)}finally{L.p=S,N.T=y}}function f4(o,l,u,h){var y=N.T;N.T=null;var S=L.p;try{L.p=8,Sv(o,l,u,h)}finally{L.p=S,N.T=y}}function Sv(o,l,u,h){if(Gf){var y=wv(h);if(y===null)lv(o,l,h,Wf,u),Oj(o,h);else if(p4(y,o,l,u,h))h.stopPropagation();else if(Oj(o,h),l&4&&-1<h4.indexOf(o)){for(;y!==null;){var S=tt(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var D=Mr(S.pendingLanes);if(D!==0){var k=S;for(k.pendingLanes|=2,k.entangledLanes|=2;D;){var z=1<<31-Lt(D);k.entanglements[1]|=z,D&=~z}Yo(S),(Gt&6)===0&&(Af=Re()+500,bu(0))}}break;case 13:k=Sl(S,2),k!==null&&Fr(k,S,2),kf(),bv(S,2)}if(S=wv(h),S===null&&lv(o,l,h,Wf,u),S===y)break;y=S}y!==null&&h.stopPropagation()}else lv(o,l,h,null,u)}}function wv(o){return o=Rm(o),jv(o)}var Wf=null;function jv(o){if(Wf=null,o=ft(o),o!==null){var l=s(o);if(l===null)o=null;else{var u=l.tag;if(u===13){if(o=c(l),o!==null)return o;o=null}else if(u===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;o=null}else l!==o&&(o=null)}}return Wf=o,null}function Nj(o){switch(o){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ae()){case Qe:return 2;case _e:return 8;case he:case Se:return 32;case $e:return 268435456;default:return 32}default:return 32}}var Cv=!1,Ra=null,_a=null,Da=null,_u=new Map,Du=new Map,Aa=[],h4="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Oj(o,l){switch(o){case"focusin":case"focusout":Ra=null;break;case"dragenter":case"dragleave":_a=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":_u.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Du.delete(l.pointerId)}}function Au(o,l,u,h,y,S){return o===null||o.nativeEvent!==S?(o={blockedOn:l,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[y]},l!==null&&(l=tt(l),l!==null&&kj(l)),o):(o.eventSystemFlags|=h,l=o.targetContainers,y!==null&&l.indexOf(y)===-1&&l.push(y),o)}function p4(o,l,u,h,y){switch(l){case"focusin":return Ra=Au(Ra,o,l,u,h,y),!0;case"dragenter":return _a=Au(_a,o,l,u,h,y),!0;case"mouseover":return Da=Au(Da,o,l,u,h,y),!0;case"pointerover":var S=y.pointerId;return _u.set(S,Au(_u.get(S)||null,o,l,u,h,y)),!0;case"gotpointercapture":return S=y.pointerId,Du.set(S,Au(Du.get(S)||null,o,l,u,h,y)),!0}return!1}function Mj(o){var l=ft(o.target);if(l!==null){var u=s(l);if(u!==null){if(l=u.tag,l===13){if(l=c(u),l!==null){o.blockedOn=l,X(o.priority,function(){if(u.tag===13){var h=Vr();h=ns(h);var y=Sl(u,h);y!==null&&Fr(y,u,h),bv(u,h)}});return}}else if(l===3&&u.stateNode.current.memoizedState.isDehydrated){o.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}o.blockedOn=null}function Qf(o){if(o.blockedOn!==null)return!1;for(var l=o.targetContainers;0<l.length;){var u=wv(o.nativeEvent);if(u===null){u=o.nativeEvent;var h=new u.constructor(u.type,u);Tm=h,u.target.dispatchEvent(h),Tm=null}else return l=tt(u),l!==null&&kj(l),o.blockedOn=u,!1;l.shift()}return!0}function Ij(o,l,u){Qf(o)&&u.delete(l)}function m4(){Cv=!1,Ra!==null&&Qf(Ra)&&(Ra=null),_a!==null&&Qf(_a)&&(_a=null),Da!==null&&Qf(Da)&&(Da=null),_u.forEach(Ij),Du.forEach(Ij)}function Yf(o,l){o.blockedOn===l&&(o.blockedOn=null,Cv||(Cv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,m4)))}var Kf=null;function Lj(o){Kf!==o&&(Kf=o,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Kf===o&&(Kf=null);for(var l=0;l<o.length;l+=3){var u=o[l],h=o[l+1],y=o[l+2];if(typeof h!="function"){if(jv(h||u)===null)continue;break}var S=tt(u);S!==null&&(o.splice(l,3),l-=3,jg(S,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function Pu(o){function l(z){return Yf(z,o)}Ra!==null&&Yf(Ra,o),_a!==null&&Yf(_a,o),Da!==null&&Yf(Da,o),_u.forEach(l),Du.forEach(l);for(var u=0;u<Aa.length;u++){var h=Aa[u];h.blockedOn===o&&(h.blockedOn=null)}for(;0<Aa.length&&(u=Aa[0],u.blockedOn===null);)Mj(u),u.blockedOn===null&&Aa.shift();if(u=(o.ownerDocument||o).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],S=u[h+1],D=y[Te]||null;if(typeof S=="function")D||Lj(u);else if(D){var k=null;if(S&&S.hasAttribute("formAction")){if(y=S,D=S[Te]||null)k=D.formAction;else if(jv(y)!==null)continue}else k=D.action;typeof k=="function"?u[h+1]=k:(u.splice(h,3),h-=3),Lj(u)}}}function Ev(o){this._internalRoot=o}Xf.prototype.render=Ev.prototype.render=function(o){var l=this._internalRoot;if(l===null)throw Error(r(409));var u=l.current,h=Vr();Aj(u,h,o,l,null,null)},Xf.prototype.unmount=Ev.prototype.unmount=function(){var o=this._internalRoot;if(o!==null){this._internalRoot=null;var l=o.containerInfo;Aj(o.current,2,null,o,null,null),kf(),l[Ue]=null}};function Xf(o){this._internalRoot=o}Xf.prototype.unstable_scheduleHydration=function(o){if(o){var l=U();o={blockedOn:null,target:o,priority:l};for(var u=0;u<Aa.length&&l!==0&&l<Aa[u].priority;u++);Aa.splice(u,0,o),u===0&&Mj(o)}};var $j=t.version;if($j!=="19.1.1")throw Error(r(527,$j,"19.1.1"));L.findDOMNode=function(o){var l=o._reactInternals;if(l===void 0)throw typeof o.render=="function"?Error(r(188)):(o=Object.keys(o).join(","),Error(r(268,o)));return o=f(l),o=o!==null?p(o):null,o=o===null?null:o.stateNode,o};var g4={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Zf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zf.isDisabled&&Zf.supportsFiber)try{_t=Zf.inject(g4),xt=Zf}catch{}}return $u.createRoot=function(o,l){if(!i(o))throw Error(r(299));var u=!1,h="",y=ew,S=tw,D=nw,k=null;return l!=null&&(l.unstable_strictMode===!0&&(u=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(D=l.onRecoverableError),l.unstable_transitionCallbacks!==void 0&&(k=l.unstable_transitionCallbacks)),l=_j(o,1,!1,null,null,u,h,y,S,D,k,null),o[Ue]=l.current,sv(o),new Ev(l)},$u.hydrateRoot=function(o,l,u){if(!i(o))throw Error(r(299));var h=!1,y="",S=ew,D=tw,k=nw,z=null,ee=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(y=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(k=u.onRecoverableError),u.unstable_transitionCallbacks!==void 0&&(z=u.unstable_transitionCallbacks),u.formState!==void 0&&(ee=u.formState)),l=_j(o,1,!0,l,u??null,h,y,S,D,k,z,ee),l.context=Dj(null),u=l.current,h=Vr(),h=ns(h),y=ha(h),y.callback=null,pa(u,y,h),u=h,l.current.lanes=u,xr(l,u),Yo(l),o[Ue]=l.current,sv(o),new Xf(l)},$u.version="19.1.1",$u}var gT;function AX(){if(gT)return uy.exports;gT=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(),uy.exports=DX(),uy.exports}var PX=AX();/**
566
+ * react-router v7.8.1
567
+ *
568
+ * Copyright (c) Remix Software Inc.
569
+ *
570
+ * This source code is licensed under the MIT license found in the
571
+ * LICENSE.md file in the root directory of this source tree.
572
+ *
573
+ * @license MIT
574
+ */var yP=e=>{throw TypeError(e)},kX=(e,t,n)=>t.has(e)||yP("Cannot "+n),hy=(e,t,n)=>(kX(e,t,"read from private field"),n?n.call(e):t.get(e)),NX=(e,t,n)=>t.has(e)?yP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),vT="popstate";function OX(e={}){function t(r,i){let{pathname:s,search:c,hash:d}=r.location;return sd("",{pathname:s,search:c,hash:d},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Wa(i)}return IX(t,n,null,e)}function yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function On(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function MX(){return Math.random().toString(36).substring(2,10)}function yT(e,t){return{usr:e.state,key:e.key,idx:t}}function sd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ia(t):t,state:n,key:t&&t.key||r||MX()}}function Wa({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 ia(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 IX(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:s=!1}=r,c=i.history,d="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){d="POP";let C=m(),E=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:E})}function x(C,E){d="PUSH";let R=sd(j.location,C,E);p=m()+1;let T=yT(R,p),_=j.createHref(R);try{c.pushState(T,"",_)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(_)}s&&f&&f({action:d,location:j.location,delta:1})}function b(C,E){d="REPLACE";let R=sd(j.location,C,E);p=m();let T=yT(R,p),_=j.createHref(R);c.replaceState(T,"",_),s&&f&&f({action:d,location:j.location,delta:0})}function w(C){return xP(C)}let j={get action(){return d},get location(){return e(i,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return i.addEventListener(vT,g),f=C,()=>{i.removeEventListener(vT,g),f=null}},createHref(C){return t(i,C)},createURL:w,encodeLocation(C){let E=w(C);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:b,go(C){return c.go(C)}};return j}function xP(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),yt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Wa(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var Hu,xT=class{constructor(e){if(NX(this,Hu,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(hy(this,Hu).has(e))return hy(this,Hu).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){hy(this,Hu).set(e,t)}};Hu=new WeakMap;var LX=new Set(["lazy","caseSensitive","path","id","index","children"]);function $X(e){return LX.has(e)}var zX=new Set(["lazy","caseSensitive","path","id","index","unstable_middleware","children"]);function UX(e){return zX.has(e)}function BX(e){return e.index===!0}function ld(e,t,n=[],r={},i=!1){return e.map((s,c)=>{let d=[...n,String(c)],f=typeof s.id=="string"?s.id:d.join("-");if(yt(s.index!==!0||!s.children,"Cannot specify children on an index route"),yt(i||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),BX(s)){let p={...s,...t(s),id:f};return r[f]=p,p}else{let p={...s,...t(s),id:f,children:void 0};return r[f]=p,s.children&&(p.children=ld(s.children,t,d,r,i)),p}})}function za(e,t,n="/"){return Th(e,t,n,!1)}function Th(e,t,n,r){let i=typeof t=="string"?ia(t):t,s=xo(i.pathname||"/",n);if(s==null)return null;let c=bP(e);FX(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=eZ(s);d=ZX(c[f],p,r)}return d}function VX(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function bP(e,t=[],n=[],r="",i=!1){let s=(c,d,f=i,p)=>{let m={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;yt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=si([r,m.relativePath]),x=n.concat(m);c.children&&c.children.length>0&&(yt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),bP(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:KX(g,c.index),routesMeta:x})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))s(c,d);else for(let f of SP(c.path))s(c,d,!0,f)}),t}function SP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let c=SP(r.join("/")),d=[];return d.push(...c.map(f=>f===""?s:[s,f].join("/"))),i&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function FX(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:XX(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var HX=/^:[\w-]+$/,qX=3,GX=2,WX=1,QX=10,YX=-2,bT=e=>e==="*";function KX(e,t){let n=e.split("/"),r=n.length;return n.some(bT)&&(r+=YX),t&&(r+=GX),n.filter(i=>!bT(i)).reduce((i,s)=>i+(HX.test(s)?qX:s===""?WX:QX),r)}function XX(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function ZX(e,t,n=!1){let{routesMeta:r}=e,i={},s="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],p=d===r.length-1,m=s==="/"?t:t.slice(s.length)||"/",g=rp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),x=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=rp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(i,g.params),c.push({params:i,pathname:si([s,g.pathname]),pathnameBase:oZ(si([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=si([s,g.pathnameBase]))}return c}function rp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=JX(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],c=s.replace(/(.)\/+$/,"$1"),d=i.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},x)=>{if(m==="*"){let w=d[x]||"";c=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:c,pattern:e}}function JX(e,t=!1,n=!0){On(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=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function eZ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return On(!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 xo(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 tZ({basename:e,pathname:t}){return t==="/"?e:si([e,t])}function nZ(e,t="/"){let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?ia(e):e;return{pathname:n?n.startsWith("/")?n:rZ(n,t):t,search:iZ(r),hash:aZ(i)}}function rZ(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function py(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 wP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function qb(e){let t=wP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Gb(e,t,n,r=!1){let i;typeof e=="string"?i=ia(e):(i={...e},yt(!i.pathname||!i.pathname.includes("?"),py("?","pathname","search",i)),yt(!i.pathname||!i.pathname.includes("#"),py("#","pathname","hash",i)),yt(!i.search||!i.search.includes("#"),py("#","search","hash",i)));let s=e===""||i.pathname==="",c=s?"/":i.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let x=c.split("/");for(;x[0]==="..";)x.shift(),g-=1;i.pathname=x.join("/")}d=g>=0?t[g]:"/"}let f=nZ(i,d),p=c&&c!=="/"&&c.endsWith("/"),m=(s||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var si=e=>e.join("/").replace(/\/\/+/g,"/"),oZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),iZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,aZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,op=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 cd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var jP=["POST","PUT","PATCH","DELETE"],sZ=new Set(jP),lZ=["GET",...jP],cZ=new Set(lZ),uZ=new Set([301,302,303,307,308]),dZ=new Set([307,308]),my={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},fZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},hZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wb=e=>hZ.test(e),pZ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),CP="remix-router-transitions",EP=Symbol("ResetLoaderData");function mZ(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";yt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],i=e.mapRouteProperties||pZ,s={},c=ld(e.routes,i,void 0,s),d,f=e.basename||"/",p=e.dataStrategy||bZ,m={unstable_middleware:!1,...e.future},g=null,x=new Set,b=null,w=null,j=null,C=e.hydrationData!=null,E=za(c,e.history.location,f),R=!1,T=null,_;if(E==null&&!e.patchRoutesOnNavigation){let U=fo(404,{pathname:e.history.location.pathname}),{matches:X,route:oe}=kT(c);_=!0,E=X,T={[oe.id]:U}}else if(E&&!e.hydrationData&&xi(E,c,e.history.location.pathname).active&&(E=null),E)if(E.some(U=>U.route.lazy))_=!1;else if(!E.some(U=>U.route.loader))_=!0;else{let U=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let oe=E.findIndex(me=>X[me.route.id]!==void 0);_=E.slice(0,oe+1).every(me=>!ix(me.route,U,X))}else _=E.every(oe=>!ix(oe.route,U,X))}else{_=!1,E=[];let U=xi(null,c,e.history.location.pathname);U.active&&U.matches&&(R=!0,E=U.matches)}let P,A={historyAction:e.history.action,location:e.history.location,matches:E,initialized:_,navigation:my,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||T,fetchers:new Map,blockers:new Map},M="POP",I=!1,V,H=!1,Z=new Map,K=null,Q=!1,B=!1,W=new Set,N=new Map,L=0,$=-1,q=new Map,O=new Set,F=new Map,te=new Map,ae=new Set,je=new Map,xe,we=null;function Ge(){if(g=e.history.listen(({action:U,location:X,delta:oe})=>{if(xe){xe(),xe=void 0;return}On(je.size===0||oe!=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 me=dl({currentLocation:A.location,nextLocation:X,historyAction:U});if(me&&oe!=null){let Te=new Promise(Ue=>{xe=Ue});e.history.go(oe*-1),Xr(me,{state:"blocked",location:X,proceed(){Xr(me,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Te.then(()=>e.history.go(oe))},reset(){let Ue=new Map(A.blockers);Ue.set(me,zu),et({blockers:Ue})}});return}return pt(U,X)}),n){kZ(t,Z);let U=()=>NZ(t,Z);t.addEventListener("pagehide",U),K=()=>t.removeEventListener("pagehide",U)}return A.initialized||pt("POP",A.location,{initialHydration:!0}),P}function Ee(){g&&g(),K&&K(),x.clear(),V&&V.abort(),A.fetchers.forEach((U,X)=>Lt(X)),A.blockers.forEach((U,X)=>vi(X))}function ot(U){return x.add(U),()=>x.delete(U)}function et(U,X={}){U.matches&&(U.matches=U.matches.map(Te=>{let Ue=s[Te.route.id],We=Te.route;return We.element!==Ue.element||We.errorElement!==Ue.errorElement||We.hydrateFallbackElement!==Ue.hydrateFallbackElement?{...Te,route:Ue}:Te})),A={...A,...U};let oe=[],me=[];A.fetchers.forEach((Te,Ue)=>{Te.state==="idle"&&(ae.has(Ue)?oe.push(Ue):me.push(Ue))}),ae.forEach(Te=>{!A.fetchers.has(Te)&&!N.has(Te)&&oe.push(Te)}),[...x].forEach(Te=>Te(A,{deletedFetchers:oe,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),oe.forEach(Te=>Lt(Te)),me.forEach(Te=>A.fetchers.delete(Te))}function Ct(U,X,{flushSync:oe}={}){let me=A.actionData!=null&&A.navigation.formMethod!=null&&Er(A.navigation.formMethod)&&A.navigation.state==="loading"&&U.state?._isRedirect!==!0,Te;X.actionData?Object.keys(X.actionData).length>0?Te=X.actionData:Te=null:me?Te=A.actionData:Te=null;let Ue=X.loaderData?AT(A.loaderData,X.loaderData,X.matches||[],X.errors):A.loaderData,We=A.blockers;We.size>0&&(We=new Map(We),We.forEach((He,Xe)=>We.set(Xe,zu)));let Fe=Q?!1:qn(U,X.matches||A.matches),Ze=I===!0||A.navigation.formMethod!=null&&Er(A.navigation.formMethod)&&U.state?._isRedirect!==!0;d&&(c=d,d=void 0),Q||M==="POP"||(M==="PUSH"?e.history.push(U,U.state):M==="REPLACE"&&e.history.replace(U,U.state));let rt;if(M==="POP"){let He=Z.get(A.location.pathname);He&&He.has(U.pathname)?rt={currentLocation:A.location,nextLocation:U}:Z.has(U.pathname)&&(rt={currentLocation:U,nextLocation:A.location})}else if(H){let He=Z.get(A.location.pathname);He?He.add(U.pathname):(He=new Set([U.pathname]),Z.set(A.location.pathname,He)),rt={currentLocation:A.location,nextLocation:U}}et({...X,actionData:Te,loaderData:Ue,historyAction:M,location:U,initialized:!0,navigation:my,revalidation:"idle",restoreScrollPosition:Fe,preventScrollReset:Ze,blockers:We},{viewTransitionOpts:rt,flushSync:oe===!0}),M="POP",I=!1,H=!1,Q=!1,B=!1,we?.resolve(),we=null}async function Ot(U,X){if(typeof U=="number"){e.history.go(U);return}let oe=ox(A.location,A.matches,f,U,X?.fromRouteId,X?.relative),{path:me,submission:Te,error:Ue}=ST(!1,oe,X),We=A.location,Fe=sd(A.location,me,X&&X.state);Fe={...Fe,...e.history.encodeLocation(Fe)};let Ze=X&&X.replace!=null?X.replace:void 0,rt="PUSH";Ze===!0?rt="REPLACE":Ze===!1||Te!=null&&Er(Te.formMethod)&&Te.formAction===A.location.pathname+A.location.search&&(rt="REPLACE");let He=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Xe=(X&&X.flushSync)===!0,ft=dl({currentLocation:We,nextLocation:Fe,historyAction:rt});if(ft){Xr(ft,{state:"blocked",location:Fe,proceed(){Xr(ft,{state:"proceeding",proceed:void 0,reset:void 0,location:Fe}),Ot(U,X)},reset(){let tt=new Map(A.blockers);tt.set(ft,zu),et({blockers:tt})}});return}await pt(rt,Fe,{submission:Te,pendingError:Ue,preventScrollReset:He,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Xe})}function Mt(){we||(we=OZ()),Oe(),et({revalidation:"loading"});let U=we.promise;return A.navigation.state==="submitting"?U:A.navigation.state==="idle"?(pt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),U):(pt(M||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:H===!0}),U)}async function pt(U,X,oe){V&&V.abort(),V=null,M=U,Q=(oe&&oe.startUninterruptedRevalidation)===!0,xr(A.location,A.matches),I=(oe&&oe.preventScrollReset)===!0,H=(oe&&oe.enableViewTransition)===!0;let me=d||c,Te=oe&&oe.overrideNavigation,Ue=oe?.initialHydration&&A.matches&&A.matches.length>0&&!R?A.matches:za(me,X,f),We=(oe&&oe.flushSync)===!0;if(Ue&&A.initialized&&!B&&RZ(A.location,X)&&!(oe&&oe.submission&&Er(oe.submission.formMethod))){Ct(X,{matches:Ue},{flushSync:We});return}let Fe=xi(Ue,me,X.pathname);if(Fe.active&&Fe.matches&&(Ue=Fe.matches),!Ue){let{error:gn,notFoundMatches:mt,route:Yt}=yi(X.pathname);Ct(X,{matches:mt,loaderData:{},errors:{[Yt.id]:gn}},{flushSync:We});return}V=new AbortController;let Ze=ic(e.history,X,V.signal,oe&&oe.submission),rt=e.unstable_getContext?await e.unstable_getContext():new xT,He;if(oe&&oe.pendingError)He=[Ua(Ue).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&Er(oe.submission.formMethod)){let gn=await Rt(Ze,X,oe.submission,Ue,rt,Fe.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:We});if(gn.shortCircuited)return;if(gn.pendingActionResult){let[mt,Yt]=gn.pendingActionResult;if(qr(Yt)&&cd(Yt.error)&&Yt.error.status===404){V=null,Ct(X,{matches:gn.matches,loaderData:{},errors:{[mt]:Yt.error}});return}}Ue=gn.matches||Ue,He=gn.pendingActionResult,Te=gy(X,oe.submission),We=!1,Fe.active=!1,Ze=ic(e.history,Ze.url,Ze.signal)}let{shortCircuited:Xe,matches:ft,loaderData:tt,errors:ln}=await en(Ze,X,Ue,rt,Fe.active,Te,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,We,He);Xe||(V=null,Ct(X,{matches:ft||Ue,...PT(He),loaderData:tt,errors:ln}))}async function Rt(U,X,oe,me,Te,Ue,We,Fe={}){Oe();let Ze=AZ(X,oe);if(et({navigation:Ze},{flushSync:Fe.flushSync===!0}),Ue){let Xe=await sa(me,X.pathname,U.signal);if(Xe.type==="aborted")return{shortCircuited:!0};if(Xe.type==="error"){let ft=Ua(Xe.partialMatches).route.id;return{matches:Xe.partialMatches,pendingActionResult:[ft,{type:"error",error:Xe.error}]}}else if(Xe.matches)me=Xe.matches;else{let{notFoundMatches:ft,error:tt,route:ln}=yi(X.pathname);return{matches:ft,pendingActionResult:[ln.id,{type:"error",error:tt}]}}}let rt,He=Rh(me,X);if(!He.route.action&&!He.route.lazy)rt={type:"error",error:fo(405,{method:U.method,pathname:X.pathname,routeId:He.route.id})};else{let Xe=dc(i,s,U,me,He,We?[]:r,Te),ft=await $e(U,Xe,Te,null);if(rt=ft[He.route.id],!rt){for(let tt of me)if(ft[tt.route.id]){rt=ft[tt.route.id];break}}if(U.signal.aborted)return{shortCircuited:!0}}if(Ms(rt)){let Xe;return Fe&&Fe.replace!=null?Xe=Fe.replace:Xe=RT(rt.response.headers.get("Location"),new URL(U.url),f)===A.location.pathname+A.location.search,await Se(U,rt,!0,{submission:oe,replace:Xe}),{shortCircuited:!0}}if(qr(rt)){let Xe=Ua(me,He.route.id);return(Fe&&Fe.replace)!==!0&&(M="PUSH"),{matches:me,pendingActionResult:[Xe.route.id,rt,He.route.id]}}return{matches:me,pendingActionResult:[He.route.id,rt]}}async function en(U,X,oe,me,Te,Ue,We,Fe,Ze,rt,He,Xe){let ft=Ue||gy(X,We),tt=We||Fe||OT(ft),ln=!Q&&!rt;if(Te){if(ln){let Ln=Re(Xe);et({navigation:ft,...Ln!==void 0?{actionData:Ln}:{}},{flushSync:He})}let bt=await sa(oe,X.pathname,U.signal);if(bt.type==="aborted")return{shortCircuited:!0};if(bt.type==="error"){let Ln=Ua(bt.partialMatches).route.id;return{matches:bt.partialMatches,loaderData:{},errors:{[Ln]:bt.error}}}else if(bt.matches)oe=bt.matches;else{let{error:Ln,notFoundMatches:os,route:Jr}=yi(X.pathname);return{matches:os,loaderData:{},errors:{[Jr.id]:Ln}}}}let gn=d||c,{dsMatches:mt,revalidatingFetchers:Yt}=wT(U,me,i,s,e.history,A,oe,tt,X,rt?[]:r,rt===!0,B,W,ae,F,O,gn,f,e.patchRoutesOnNavigation!=null,Xe);if($=++L,!e.dataStrategy&&!mt.some(bt=>bt.shouldLoad)&&!mt.some(bt=>bt.route.unstable_middleware)&&Yt.length===0){let bt=Eo();return Ct(X,{matches:oe,loaderData:{},errors:Xe&&qr(Xe[1])?{[Xe[0]]:Xe[1].error}:null,...PT(Xe),...bt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:He}),{shortCircuited:!0}}if(ln){let bt={};if(!Te){bt.navigation=ft;let Ln=Re(Xe);Ln!==void 0&&(bt.actionData=Ln)}Yt.length>0&&(bt.fetchers=Ae(Yt)),et(bt,{flushSync:He})}Yt.forEach(bt=>{Dn(bt.key),bt.controller&&N.set(bt.key,bt.controller)});let Ho=()=>Yt.forEach(bt=>Dn(bt.key));V&&V.signal.addEventListener("abort",Ho);let{loaderResults:Ir,fetcherResults:cr}=await be(mt,Yt,U,me);if(U.signal.aborted)return{shortCircuited:!0};V&&V.signal.removeEventListener("abort",Ho),Yt.forEach(bt=>N.delete(bt.key));let Zr=dh(Ir);if(Zr)return await Se(U,Zr.result,!0,{replace:Ze}),{shortCircuited:!0};if(Zr=dh(cr),Zr)return O.add(Zr.key),await Se(U,Zr.result,!0,{replace:Ze}),{shortCircuited:!0};let{loaderData:fl,errors:la}=DT(A,oe,Ir,Xe,Yt,cr);rt&&A.errors&&(la={...A.errors,...la});let bi=Eo(),Si=gi($),wi=bi||Si||Yt.length>0;return{matches:oe,loaderData:fl,errors:la,...wi?{fetchers:new Map(A.fetchers)}:{}}}function Re(U){if(U&&!qr(U[1]))return{[U[0]]:U[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Ae(U){return U.forEach(X=>{let oe=A.fetchers.get(X.key),me=Uu(void 0,oe?oe.data:void 0);A.fetchers.set(X.key,me)}),new Map(A.fetchers)}async function Qe(U,X,oe,me){Dn(U);let Te=(me&&me.flushSync)===!0,Ue=d||c,We=ox(A.location,A.matches,f,oe,X,me?.relative),Fe=za(Ue,We,f),Ze=xi(Fe,Ue,We);if(Ze.active&&Ze.matches&&(Fe=Ze.matches),!Fe){xt(U,X,fo(404,{pathname:We}),{flushSync:Te});return}let{path:rt,submission:He,error:Xe}=ST(!0,We,me);if(Xe){xt(U,X,Xe,{flushSync:Te});return}let ft=e.unstable_getContext?await e.unstable_getContext():new xT,tt=(me&&me.preventScrollReset)===!0;if(He&&Er(He.formMethod)){await _e(U,X,rt,Fe,ft,Ze.active,Te,tt,He);return}F.set(U,{routeId:X,path:rt}),await he(U,X,rt,Fe,ft,Ze.active,Te,tt,He)}async function _e(U,X,oe,me,Te,Ue,We,Fe,Ze){Oe(),F.delete(U);let rt=A.fetchers.get(U);_t(U,PZ(Ze,rt),{flushSync:We});let He=new AbortController,Xe=ic(e.history,oe,He.signal,Ze);if(Ue){let bn=await sa(me,new URL(Xe.url).pathname,Xe.signal,U);if(bn.type==="aborted")return;if(bn.type==="error"){xt(U,X,bn.error,{flushSync:We});return}else if(bn.matches)me=bn.matches;else{xt(U,X,fo(404,{pathname:oe}),{flushSync:We});return}}let ft=Rh(me,oe);if(!ft.route.action&&!ft.route.lazy){let bn=fo(405,{method:Ze.formMethod,pathname:oe,routeId:X});xt(U,X,bn,{flushSync:We});return}N.set(U,He);let tt=L,ln=dc(i,s,Xe,me,ft,r,Te),mt=(await $e(Xe,ln,Te,U))[ft.route.id];if(Xe.signal.aborted){N.get(U)===He&&N.delete(U);return}if(ae.has(U)){if(Ms(mt)||qr(mt)){_t(U,Oa(void 0));return}}else{if(Ms(mt))if(N.delete(U),$>tt){_t(U,Oa(void 0));return}else return O.add(U),_t(U,Uu(Ze)),Se(Xe,mt,!1,{fetcherSubmission:Ze,preventScrollReset:Fe});if(qr(mt)){xt(U,X,mt.error);return}}let Yt=A.navigation.location||A.location,Ho=ic(e.history,Yt,He.signal),Ir=d||c,cr=A.navigation.state!=="idle"?za(Ir,A.navigation.location,f):A.matches;yt(cr,"Didn't find any matches after fetcher action");let Zr=++L;q.set(U,Zr);let fl=Uu(Ze,mt.data);A.fetchers.set(U,fl);let{dsMatches:la,revalidatingFetchers:bi}=wT(Ho,Te,i,s,e.history,A,cr,Ze,Yt,r,!1,B,W,ae,F,O,Ir,f,e.patchRoutesOnNavigation!=null,[ft.route.id,mt]);bi.filter(bn=>bn.key!==U).forEach(bn=>{let ca=bn.key,Vd=A.fetchers.get(ca),Fd=Uu(void 0,Vd?Vd.data:void 0);A.fetchers.set(ca,Fd),Dn(ca),bn.controller&&N.set(ca,bn.controller)}),et({fetchers:new Map(A.fetchers)});let Si=()=>bi.forEach(bn=>Dn(bn.key));He.signal.addEventListener("abort",Si);let{loaderResults:wi,fetcherResults:bt}=await be(la,bi,Ho,Te);if(He.signal.aborted)return;if(He.signal.removeEventListener("abort",Si),q.delete(U),N.delete(U),bi.forEach(bn=>N.delete(bn.key)),A.fetchers.has(U)){let bn=Oa(mt.data);A.fetchers.set(U,bn)}let Ln=dh(wi);if(Ln)return Se(Ho,Ln.result,!1,{preventScrollReset:Fe});if(Ln=dh(bt),Ln)return O.add(Ln.key),Se(Ho,Ln.result,!1,{preventScrollReset:Fe});let{loaderData:os,errors:Jr}=DT(A,cr,wi,void 0,bi,bt);gi(Zr),A.navigation.state==="loading"&&Zr>$?(yt(M,"Expected pending action"),V&&V.abort(),Ct(A.navigation.location,{matches:cr,loaderData:os,errors:Jr,fetchers:new Map(A.fetchers)})):(et({errors:Jr,loaderData:AT(A.loaderData,os,cr,Jr),fetchers:new Map(A.fetchers)}),B=!1)}async function he(U,X,oe,me,Te,Ue,We,Fe,Ze){let rt=A.fetchers.get(U);_t(U,Uu(Ze,rt?rt.data:void 0),{flushSync:We});let He=new AbortController,Xe=ic(e.history,oe,He.signal);if(Ue){let Yt=await sa(me,new URL(Xe.url).pathname,Xe.signal,U);if(Yt.type==="aborted")return;if(Yt.type==="error"){xt(U,X,Yt.error,{flushSync:We});return}else if(Yt.matches)me=Yt.matches;else{xt(U,X,fo(404,{pathname:oe}),{flushSync:We});return}}let ft=Rh(me,oe);N.set(U,He);let tt=L,ln=dc(i,s,Xe,me,ft,r,Te),mt=(await $e(Xe,ln,Te,U))[ft.route.id];if(N.get(U)===He&&N.delete(U),!Xe.signal.aborted){if(ae.has(U)){_t(U,Oa(void 0));return}if(Ms(mt))if($>tt){_t(U,Oa(void 0));return}else{O.add(U),await Se(Xe,mt,!1,{preventScrollReset:Fe});return}if(qr(mt)){xt(U,X,mt.error);return}_t(U,Oa(mt.data))}}async function Se(U,X,oe,{submission:me,fetcherSubmission:Te,preventScrollReset:Ue,replace:We}={}){X.response.headers.has("X-Remix-Revalidate")&&(B=!0);let Fe=X.response.headers.get("Location");yt(Fe,"Expected a Location header on the redirect Response"),Fe=RT(Fe,new URL(U.url),f);let Ze=sd(A.location,Fe,{_isRedirect:!0});if(n){let ln=!1;if(X.response.headers.has("X-Remix-Reload-Document"))ln=!0;else if(Wb(Fe)){const gn=xP(Fe,!0);ln=gn.origin!==t.location.origin||xo(gn.pathname,f)==null}if(ln){We?t.location.replace(Fe):t.location.assign(Fe);return}}V=null;let rt=We===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:He,formAction:Xe,formEncType:ft}=A.navigation;!me&&!Te&&He&&Xe&&ft&&(me=OT(A.navigation));let tt=me||Te;if(dZ.has(X.response.status)&&tt&&Er(tt.formMethod))await pt(rt,Ze,{submission:{...tt,formAction:Fe},preventScrollReset:Ue||I,enableViewTransition:oe?H:void 0});else{let ln=gy(Ze,me);await pt(rt,Ze,{overrideNavigation:ln,fetcherSubmission:Te,preventScrollReset:Ue||I,enableViewTransition:oe?H:void 0})}}async function $e(U,X,oe,me){let Te,Ue={};try{Te=await SZ(p,U,X,me,oe,!1)}catch(We){return X.filter(Fe=>Fe.shouldLoad).forEach(Fe=>{Ue[Fe.route.id]={type:"error",error:We}}),Ue}if(U.signal.aborted)return Ue;for(let[We,Fe]of Object.entries(Te))if(_Z(Fe)){let Ze=Fe.result;Ue[We]={type:"redirect",response:EZ(Ze,U,We,X,f)}}else Ue[We]=await CZ(Fe);return Ue}async function be(U,X,oe,me){let Te=$e(oe,U,me,null),Ue=Promise.all(X.map(async Ze=>{if(Ze.matches&&Ze.match&&Ze.request&&Ze.controller){let He=(await $e(Ze.request,Ze.matches,me,Ze.key))[Ze.match.route.id];return{[Ze.key]:He}}else return Promise.resolve({[Ze.key]:{type:"error",error:fo(404,{pathname:Ze.path})}})})),We=await Te,Fe=(await Ue).reduce((Ze,rt)=>Object.assign(Ze,rt),{});return{loaderResults:We,fetcherResults:Fe}}function Oe(){B=!0,F.forEach((U,X)=>{N.has(X)&&W.add(X),Dn(X)})}function _t(U,X,oe={}){A.fetchers.set(U,X),et({fetchers:new Map(A.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function xt(U,X,oe,me={}){let Te=Ua(A.matches,X);Lt(U),et({errors:{[Te.route.id]:oe},fetchers:new Map(A.fetchers)},{flushSync:(me&&me.flushSync)===!0})}function tn(U){return te.set(U,(te.get(U)||0)+1),ae.has(U)&&ae.delete(U),A.fetchers.get(U)||fZ}function Lt(U){let X=A.fetchers.get(U);N.has(U)&&!(X&&X.state==="loading"&&q.has(U))&&Dn(U),F.delete(U),q.delete(U),O.delete(U),ae.delete(U),W.delete(U),A.fetchers.delete(U)}function In(U){let X=(te.get(U)||0)-1;X<=0?(te.delete(U),ae.add(U)):te.set(U,X),et({fetchers:new Map(A.fetchers)})}function Dn(U){let X=N.get(U);X&&(X.abort(),N.delete(U))}function Vo(U){for(let X of U){let oe=tn(X),me=Oa(oe.data);A.fetchers.set(X,me)}}function Eo(){let U=[],X=!1;for(let oe of O){let me=A.fetchers.get(oe);yt(me,`Expected fetcher: ${oe}`),me.state==="loading"&&(O.delete(oe),U.push(oe),X=!0)}return Vo(U),X}function gi(U){let X=[];for(let[oe,me]of q)if(me<U){let Te=A.fetchers.get(oe);yt(Te,`Expected fetcher: ${oe}`),Te.state==="loading"&&(Dn(oe),q.delete(oe),X.push(oe))}return Vo(X),X.length>0}function Mr(U,X){let oe=A.blockers.get(U)||zu;return je.get(U)!==X&&je.set(U,X),oe}function vi(U){A.blockers.delete(U),je.delete(U)}function Xr(U,X){let oe=A.blockers.get(U)||zu;yt(oe.state==="unblocked"&&X.state==="blocked"||oe.state==="blocked"&&X.state==="blocked"||oe.state==="blocked"&&X.state==="proceeding"||oe.state==="blocked"&&X.state==="unblocked"||oe.state==="proceeding"&&X.state==="unblocked",`Invalid blocker state transition: ${oe.state} -> ${X.state}`);let me=new Map(A.blockers);me.set(U,X),et({blockers:me})}function dl({currentLocation:U,nextLocation:X,historyAction:oe}){if(je.size===0)return;je.size>1&&On(!1,"A router only supports one blocker at a time");let me=Array.from(je.entries()),[Te,Ue]=me[me.length-1],We=A.blockers.get(Te);if(!(We&&We.state==="proceeding")&&Ue({currentLocation:U,nextLocation:X,historyAction:oe}))return Te}function yi(U){let X=fo(404,{pathname:U}),oe=d||c,{matches:me,route:Te}=kT(oe);return{notFoundMatches:me,route:Te,error:X}}function aa(U,X,oe){if(b=U,j=X,w=oe||null,!C&&A.navigation===my){C=!0;let me=qn(A.location,A.matches);me!=null&&et({restoreScrollPosition:me})}return()=>{b=null,j=null,w=null}}function Fo(U,X){return w&&w(U,X.map(me=>VX(me,A.loaderData)))||U.key}function xr(U,X){if(b&&j){let oe=Fo(U,X);b[oe]=j()}}function qn(U,X){if(b){let oe=Fo(U,X),me=b[oe];if(typeof me=="number")return me}return null}function xi(U,X,oe){if(e.patchRoutesOnNavigation)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:Th(X,oe,f,!0)}}else return{active:!0,matches:Th(X,oe,f,!0)||[]};return{active:!1,matches:null}}async function sa(U,X,oe,me){if(!e.patchRoutesOnNavigation)return{type:"success",matches:U};let Te=U;for(;;){let Ue=d==null,We=d||c,Fe=s;try{await e.patchRoutesOnNavigation({signal:oe,path:X,matches:Te,fetcherKey:me,patch:(He,Xe)=>{oe.aborted||jT(He,Xe,We,Fe,i,!1)}})}catch(He){return{type:"error",error:He,partialMatches:Te}}finally{Ue&&!oe.aborted&&(c=[...c])}if(oe.aborted)return{type:"aborted"};let Ze=za(We,X,f);if(Ze)return{type:"success",matches:Ze};let rt=Th(We,X,f,!0);if(!rt||Te.length===rt.length&&Te.every((He,Xe)=>He.route.id===rt[Xe].route.id))return{type:"success",matches:null};Te=rt}}function ns(U){s={},d=ld(U,i,void 0,s)}function rs(U,X,oe=!1){let me=d==null;jT(U,X,d||c,s,i,oe),me&&(c=[...c],et({}))}return P={get basename(){return f},get future(){return m},get state(){return A},get routes(){return c},get window(){return t},initialize:Ge,subscribe:ot,enableScrollRestoration:aa,navigate:Ot,fetch:Qe,revalidate:Mt,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:tn,deleteFetcher:In,dispose:Ee,getBlocker:Mr,deleteBlocker:vi,patchRoutes:rs,_internalFetchControllers:N,_internalSetRoutes:ns,_internalSetStateDoNotUseOrYouWillBreakYourApp(U){et(U)}},P}function gZ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ox(e,t,n,r,i,s){let c,d;if(i){c=[];for(let p of t)if(c.push(p),p.route.id===i){d=p;break}}else c=t,d=t[t.length-1];let f=Gb(r||".",qb(c),xo(e.pathname,n)||e.pathname,s==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let p=Qb(f.search);if(d.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let x=m.toString();f.search=x?`?${x}`:""}}return n!=="/"&&(f.pathname=tZ({basename:n,pathname:f.pathname})),Wa(f)}function ST(e,t,n){if(!n||!gZ(n))return{path:t};if(n.formMethod&&!DZ(n.formMethod))return{path:t,error:fo(405,{method:n.formMethod})};let r=()=>({path:t,error:fo(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),c=kP(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!Er(s))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((x,[b,w])=>`${x}${b}=${w}
575
+ `,""):String(n.body);return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!Er(s))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:s,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}yt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=sx(n.formData),f=n.formData;else if(n.body instanceof FormData)d=sx(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=_T(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=_T(d)}catch{return r()}let p={formMethod:s,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(Er(p.formMethod))return{path:t,submission:p};let m=ia(t);return e&&m.search&&Qb(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Wa(m),submission:p}}function wT(e,t,n,r,i,s,c,d,f,p,m,g,x,b,w,j,C,E,R,T){let _=T?qr(T[1])?T[1].error:T[1].data:void 0,P=i.createURL(s.location),A=i.createURL(f),M;if(m&&s.errors){let Q=Object.keys(s.errors)[0];M=c.findIndex(B=>B.route.id===Q)}else if(T&&qr(T[1])){let Q=T[0];M=c.findIndex(B=>B.route.id===Q)-1}let I=T?T[1].statusCode:void 0,V=I&&I>=400,H={currentUrl:P,currentParams:s.matches[0]?.params||{},nextUrl:A,nextParams:c[0].params,...d,actionResult:_,actionStatus:I},Z=c.map((Q,B)=>{let{route:W}=Q,N=null;if(M!=null&&B>M?N=!1:W.lazy?N=!0:W.loader==null?N=!1:m?N=ix(W,s.loaderData,s.errors):vZ(s.loaderData,s.matches[B],Q)&&(N=!0),N!==null)return ax(n,r,e,Q,p,t,N);let L=V?!1:g||P.pathname+P.search===A.pathname+A.search||P.search!==A.search||yZ(s.matches[B],Q),$={...H,defaultShouldRevalidate:L},q=ip(Q,$);return ax(n,r,e,Q,p,t,q,$)}),K=[];return w.forEach((Q,B)=>{if(m||!c.some(te=>te.route.id===Q.routeId)||b.has(B))return;let W=s.fetchers.get(B),N=W&&W.state!=="idle"&&W.data===void 0,L=za(C,Q.path,E);if(!L){if(R&&N)return;K.push({key:B,routeId:Q.routeId,path:Q.path,matches:null,match:null,request:null,controller:null});return}if(j.has(B))return;let $=Rh(L,Q.path),q=new AbortController,O=ic(i,Q.path,q.signal),F=null;if(x.has(B))x.delete(B),F=dc(n,r,O,L,$,p,t);else if(N)g&&(F=dc(n,r,O,L,$,p,t));else{let te={...H,defaultShouldRevalidate:V?!1:g};ip($,te)&&(F=dc(n,r,O,L,$,p,t,te))}F&&K.push({key:B,routeId:Q.routeId,path:Q.path,matches:F,match:$,request:O,controller:q})}),{dsMatches:Z,revalidatingFetchers:K}}function ix(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&e.id in t,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function vZ(e,t,n){let r=!t||n.route.id!==t.route.id,i=!e.hasOwnProperty(n.route.id);return r||i}function yZ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function ip(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function jT(e,t,n,r,i,s){let c;if(e){let p=r[e];yt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=n;let d=[],f=[];if(t.forEach(p=>{let m=c.find(g=>TP(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=ld(d,i,[e||"_","patch",String(c?.length||"0")],r);c.push(...p)}if(s&&f.length>0)for(let p=0;p<f.length;p++){let{existingRoute:m,newRoute:g}=f[p],x=m,[b]=ld([g],i,[],{},!0);Object.assign(x,{element:b.element?b.element:x.element,errorElement:b.errorElement?b.errorElement:x.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:x.hydrateFallbackElement})}}function TP(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)=>t.children?.some(i=>TP(n,i))):!1}var CT=new WeakMap,RP=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let i=n[t.id];if(yt(i,"No route found in manifest"),!i.lazy||typeof i.lazy!="object")return;let s=i.lazy[e];if(!s)return;let c=CT.get(i);c||(c={},CT.set(i,c));let d=c[e];if(d)return d;let f=(async()=>{let p=$X(e),g=i[e]!==void 0&&e!=="hasErrorBoundary";if(p)On(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)On(!1,`Route "${i.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await s();x!=null&&(Object.assign(i,{[e]:x}),Object.assign(i,r(i)))}typeof i.lazy=="object"&&(i.lazy[e]=void 0,Object.values(i.lazy).every(x=>x===void 0)&&(i.lazy=void 0))})();return c[e]=f,f},ET=new WeakMap;function xZ(e,t,n,r,i){let s=n[e.id];if(yt(s,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=ET.get(s);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{yt(typeof e.lazy=="function","No lazy route function found");let x=await e.lazy(),b={};for(let w in x){let j=x[w];if(j===void 0)continue;let C=UX(w),R=s[w]!==void 0&&w!=="hasErrorBoundary";C?On(!C,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):R?On(!R,`Route "${s.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=j}Object.assign(s,b),Object.assign(s,{...r(s),lazy:void 0})})();return ET.set(s,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(i&&i.includes(m))continue;let g=RP({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(d.push(g),m===t&&(f=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function TT(e){let t=e.matches.filter(i=>i.shouldLoad),n={};return(await Promise.all(t.map(i=>i.resolve()))).forEach((i,s)=>{n[t[s].route.id]=i}),n}async function bZ(e){if(!e.matches.some(n=>n.route.unstable_middleware))return TT(e);let t=!1;return DP(e,()=>(t=!0,TT(e)),(n,r)=>_P(n,r,e.matches,t))}function _P(e,t,n,r){if(r)return{[t]:{type:"error",result:e}};{let i=Math.min(n.findIndex(c=>c.route.id===t)||0,n.findIndex(c=>c.unstable_shouldCallHandler())||0);return{[Ua(n,n[i].route.id).route.id]:{type:"error",result:e}}}}async function DP(e,t,n){let{matches:r,request:i,params:s,context:c}=e,d=r.flatMap(p=>p.route.unstable_middleware?p.route.unstable_middleware.map(m=>[p.route.id,m]):[]),f={};return await AP({request:i,params:s,context:c},d,t,n,f),f}async function AP(e,t,n,r,i={},s=0){let{request:c}=e;if(c.signal.aborted)throw c.signal.reason?c.signal.reason:new Error(`Request aborted without an \`AbortSignal.reason\`: ${c.method} ${c.url}`);let d=t[s];if(!d){let x=await n();Object.assign(i,x);return}let[f,p]=d,m=!1,g=async()=>{if(m)throw new Error("You may only call `next()` once per middleware");m=!0;try{let x=await AP(e,t,n,r,i,s+1);Object.assign(i,x)}catch(x){let b=await r(x,f);Object.assign(i,b)}};try{let x=await p({request:e.request,params:e.params,context:e.context},g);typeof x<"u"&&console.warn("client middlewares are not intended to return values, the value will be ignored",x),m||await g()}catch(x){let b=await r(x,f);Object.assign(i,b)}}function PP(e,t,n,r,i){let s=RP({key:"unstable_middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=xZ(r.route,Er(n.method)?"action":"loader",t,e,i);return{middleware:s,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function ax(e,t,n,r,i,s,c,d=null){let f=!1,p=PP(e,t,n,r,i);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(m){return f=!0,d?typeof m=="boolean"?ip(r,{...d,defaultShouldRevalidate:m}):ip(r,d):c},resolve(m){return f||c||m&&!Er(n.method)&&(r.route.lazy||r.route.loader)?wZ({request:n,match:r,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function dc(e,t,n,r,i,s,c,d=null){return r.map(f=>f.route.id!==i.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:PP(e,t,n,f,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:ax(e,t,n,f,s,c,!0,d))}async function SZ(e,t,n,r,i,s){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let c={request:t,params:n[0].params,context:i,matches:n},f=await e({...c,fetcherKey:r,unstable_runClientMiddleware:p=>{let m=c,g=!1;return DP(m,()=>(g=!0,p({...m,fetcherKey:r,unstable_runClientMiddleware:()=>{throw new Error("Cannot call `unstable_runClientMiddleware()` from within an `unstable_runClientMiddleware` handler")}})),(x,b)=>_P(x,b,n,g))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function wZ({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:i,scopedContext:s}){let c,d,f=Er(e.method),p=f?"action":"loader",m=g=>{let x,b=new Promise((C,E)=>x=E);d=()=>x(),e.signal.addEventListener("abort",d);let w=C=>typeof g!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${p}" [routeId: ${t.route.id}]`)):g({request:e,params:t.params,context:s},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(i?i(E=>w(E)):w())}}catch(C){return{type:"error",result:C}}})();return Promise.race([j,b])};try{let g=f?t.route.action:t.route.loader;if(n||r)if(g){let x,[b]=await Promise.all([m(g).catch(w=>{x=w}),n,r]);if(x!==void 0)throw x;c=b}else{await n;let x=f?t.route.action:t.route.loader;if(x)[c]=await Promise.all([m(x),r]);else if(p==="action"){let b=new URL(e.url),w=b.pathname+b.search;throw fo(405,{method:e.method,pathname:w,routeId:t.route.id})}else return{type:"data",result:void 0}}else if(g)c=await m(g);else{let x=new URL(e.url),b=x.pathname+x.search;throw fo(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function jZ(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function CZ(e){let{result:t,type:n}=e;if(NP(t)){let r;try{r=await jZ(t)}catch(i){return{type:"error",error:i}}return n==="error"?{type:"error",error:new op(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?NT(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new op(t.init?.status||500,void 0,t.data),statusCode:cd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:cd(t)?t.status:void 0}:NT(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function EZ(e,t,n,r,i){let s=e.headers.get("Location");if(yt(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Wb(s)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);s=ox(new URL(t.url),c,i,s),e.headers.set("Location",s)}return e}function RT(e,t,n){if(Wb(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=xo(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function ic(e,t,n,r){let i=e.createURL(kP(t)).toString(),s={signal:n};if(r&&Er(r.formMethod)){let{formMethod:c,formEncType:d}=r;s.method=c.toUpperCase(),d==="application/json"?(s.headers=new Headers({"Content-Type":d}),s.body=JSON.stringify(r.json)):d==="text/plain"?s.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?s.body=sx(r.formData):s.body=r.formData}return new Request(i,s)}function sx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function _T(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function TZ(e,t,n,r=!1,i=!1){let s={},c=null,d,f=!1,p={},m=n&&qr(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let x=g.route.id,b=t[x];if(yt(!Ms(b),"Cannot handle redirect results in processLoaderData"),qr(b)){let w=b.error;if(m!==void 0&&(w=m,m=void 0),c=c||{},i)c[x]=w;else{let j=Ua(e,x);c[j.route.id]==null&&(c[j.route.id]=w)}r||(s[x]=EP),f||(f=!0,d=cd(b.error)?b.error.status:500),b.headers&&(p[x]=b.headers)}else s[x]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(p[x]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:c,statusCode:d||200,loaderHeaders:p}}function DT(e,t,n,r,i,s){let{loaderData:c,errors:d}=TZ(t,n,r);return i.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f;if(g&&g.signal.aborted)return;let x=s[p];if(yt(x,"Did not find corresponding fetcher result"),qr(x)){let b=Ua(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(p)}else if(Ms(x))yt(!1,"Unhandled fetcher revalidation redirect");else{let b=Oa(x.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function AT(e,t,n,r){let i=Object.entries(t).filter(([,s])=>s!==EP).reduce((s,[c,d])=>(s[c]=d,s),{});for(let s of n){let c=s.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&s.route.loader&&(i[c]=e[c]),r&&r.hasOwnProperty(c))break}return i}function PT(e){return e?qr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Ua(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 kT(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 fo(e,{pathname:t,routeId:n,method:r,type:i,message:s}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`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.`:i==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`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&&(d=`Invalid request method "${r.toUpperCase()}"`)),new op(e||500,c,new Error(d),!0)}function dh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(Ms(i))return{key:r,result:i}}}function kP(e){let t=typeof e=="string"?ia(e):e;return Wa({...t,hash:""})}function RZ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function _Z(e){return NP(e.result)&&uZ.has(e.result.status)}function qr(e){return e.type==="error"}function Ms(e){return(e&&e.type)==="redirect"}function NT(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function NP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function DZ(e){return cZ.has(e.toUpperCase())}function Er(e){return sZ.has(e.toUpperCase())}function Qb(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Rh(e,t){let n=typeof t=="string"?ia(t).search:t.search;if(e[e.length-1].route.index&&Qb(n||""))return e[e.length-1];let r=wP(e);return r[r.length-1]}function OT(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:c}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function gy(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 AZ(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Uu(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function PZ(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 Oa(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 kZ(e,t){try{let n=e.sessionStorage.getItem(CP);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function NZ(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(CP,JSON.stringify(n))}catch(r){On(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function OZ(){let e,t,n=new Promise((r,i)=>{e=async s=>{r(s);try{await n}catch{}},t=async s=>{i(s);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var ll=v.createContext(null);ll.displayName="DataRouter";var Ld=v.createContext(null);Ld.displayName="DataRouterState";v.createContext(!1);var Yb=v.createContext({isTransitioning:!1});Yb.displayName="ViewTransition";var OP=v.createContext(new Map);OP.displayName="Fetchers";var MZ=v.createContext(null);MZ.displayName="Await";var mi=v.createContext(null);mi.displayName="Navigation";var $d=v.createContext(null);$d.displayName="Location";var Bo=v.createContext({outlet:null,matches:[],isDataRoute:!1});Bo.displayName="Route";var Kb=v.createContext(null);Kb.displayName="RouteError";function IZ(e,{relative:t}={}){yt(zd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(mi),{hash:i,pathname:s,search:c}=Ud(e,{relative:t}),d=s;return n!=="/"&&(d=s==="/"?n:si([n,s])),r.createHref({pathname:d,search:c,hash:i})}function zd(){return v.useContext($d)!=null}function Or(){return yt(zd(),"useLocation() may be used only in the context of a <Router> component."),v.useContext($d).location}var MP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function IP(e){v.useContext(mi).static||v.useLayoutEffect(e)}function xn(){let{isDataRoute:e}=v.useContext(Bo);return e?XZ():LZ()}function LZ(){yt(zd(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(ll),{basename:t,navigator:n}=v.useContext(mi),{matches:r}=v.useContext(Bo),{pathname:i}=Or(),s=JSON.stringify(qb(r)),c=v.useRef(!1);return IP(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(On(c.current,MP),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=Gb(f,JSON.parse(s),i,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:si([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,s,i,e])}var $Z=v.createContext(null);function zZ(e){let t=v.useContext(Bo).outlet;return t&&v.createElement($Z.Provider,{value:e},t)}function Bt(){let{matches:e}=v.useContext(Bo),t=e[e.length-1];return t?t.params:{}}function Ud(e,{relative:t}={}){let{matches:n}=v.useContext(Bo),{pathname:r}=Or(),i=JSON.stringify(qb(n));return v.useMemo(()=>Gb(e,JSON.parse(i),r,t==="path"),[e,i,r,t])}function UZ(e,t){return LP(e,t)}function LP(e,t,n,r){yt(zd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=v.useContext(mi),{matches:s}=v.useContext(Bo),c=s[s.length-1],d=c?c.params:{},f=c?c.pathname:"/",p=c?c.pathnameBase:"/",m=c&&c.route;{let E=m&&m.path||"";$P(f,!m||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (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.
576
+
577
+ Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let g=Or(),x;if(t){let E=typeof t=="string"?ia(t):t;yt(p==="/"||E.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),x=E}else x=g;let b=x.pathname||"/",w=b;if(p!=="/"){let E=p.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(E.length).join("/")}let j=za(e,{pathname:w});On(m||j!=null,`No routes matched location "${x.pathname}${x.search}${x.hash}" `),On(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 C=qZ(j&&j.map(E=>Object.assign({},E,{params:Object.assign({},d,E.params),pathname:si([p,i.encodeLocation?i.encodeLocation(E.pathname).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:si([p,i.encodeLocation?i.encodeLocation(E.pathnameBase).pathname:E.pathnameBase])})),s,n,r);return t&&C?v.createElement($d.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...x},navigationType:"POP"}},C):C}function BZ(){let e=KZ(),t=cd(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)",i={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:s},"ErrorBoundary")," or"," ",v.createElement("code",{style:s},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:i},n):null,c)}var VZ=v.createElement(BZ,null),FZ=class extends v.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?v.createElement(Bo.Provider,{value:this.props.routeContext},v.createElement(Kb.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function HZ({routeContext:e,match:t,children:n}){let r=v.useContext(ll);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Bo.Provider,{value:e},n)}function qZ(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 i=e,s=n?.errors;if(s!=null){let f=i.findIndex(p=>p.route.id&&s?.[p.route.id]!==void 0);yt(f>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),i=i.slice(0,Math.min(i.length,f+1))}let c=!1,d=-1;if(n)for(let f=0;f<i.length;f++){let p=i[f];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(d=f),p.route.id){let{loaderData:m,errors:g}=n,x=p.route.loader&&!m.hasOwnProperty(p.route.id)&&(!g||g[p.route.id]===void 0);if(p.route.lazy||x){c=!0,d>=0?i=i.slice(0,d+1):i=[i[0]];break}}}return i.reduceRight((f,p,m)=>{let g,x=!1,b=null,w=null;n&&(g=s&&p.route.id?s[p.route.id]:void 0,b=p.route.errorElement||VZ,c&&(d<0&&m===0?($P("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),x=!0,w=null):d===m&&(x=!0,w=p.route.hydrateFallbackElement||null)));let j=t.concat(i.slice(0,m+1)),C=()=>{let E;return g?E=b:x?E=w:p.route.Component?E=v.createElement(p.route.Component,null):p.route.element?E=p.route.element:E=f,v.createElement(HZ,{match:p,routeContext:{outlet:f,matches:j,isDataRoute:n!=null},children:E})};return n&&(p.route.ErrorBoundary||p.route.errorElement||m===0)?v.createElement(FZ,{location:n.location,revalidation:n.revalidation,component:b,error:g,children:C(),routeContext:{outlet:null,matches:j,isDataRoute:!0}}):C()},null)}function Xb(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function GZ(e){let t=v.useContext(ll);return yt(t,Xb(e)),t}function WZ(e){let t=v.useContext(Ld);return yt(t,Xb(e)),t}function QZ(e){let t=v.useContext(Bo);return yt(t,Xb(e)),t}function Zb(e){let t=QZ(e),n=t.matches[t.matches.length-1];return yt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function YZ(){return Zb("useRouteId")}function KZ(){let e=v.useContext(Kb),t=WZ("useRouteError"),n=Zb("useRouteError");return e!==void 0?e:t.errors?.[n]}function XZ(){let{router:e}=GZ("useNavigate"),t=Zb("useNavigate"),n=v.useRef(!1);return IP(()=>{n.current=!0}),v.useCallback(async(i,s={})=>{On(n.current,MP),n.current&&(typeof i=="number"?e.navigate(i):await e.navigate(i,{fromRouteId:t,...s}))},[e,t])}var MT={};function $P(e,t,n){!t&&!MT[e]&&(MT[e]=!0,On(!1,n))}var IT={};function LT(e,t){!e&&!IT[t]&&(IT[t]=!0,console.warn(t))}function ZZ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&On(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&On(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&On(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var JZ=["HydrateFallback","hydrateFallbackElement"],eJ=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 tJ({router:e,flushSync:t}){let[n,r]=v.useState(e.state),[i,s]=v.useState(),[c,d]=v.useState({isTransitioning:!1}),[f,p]=v.useState(),[m,g]=v.useState(),[x,b]=v.useState(),w=v.useRef(new Map),j=v.useCallback((T,{deletedFetchers:_,flushSync:P,viewTransitionOpts:A})=>{T.fetchers.forEach((I,V)=>{I.data!==void 0&&w.current.set(V,I.data)}),_.forEach(I=>w.current.delete(I)),LT(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 M=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(LT(A==null||M,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!A||!M){t&&P?t(()=>r(T)):v.startTransition(()=>r(T));return}if(t&&P){t(()=>{m&&(f&&f.resolve(),m.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:A.currentLocation,nextLocation:A.nextLocation})});let I=e.window.document.startViewTransition(()=>{t(()=>r(T))});I.finished.finally(()=>{t(()=>{p(void 0),g(void 0),s(void 0),d({isTransitioning:!1})})}),t(()=>g(I));return}m?(f&&f.resolve(),m.skipTransition(),b({state:T,currentLocation:A.currentLocation,nextLocation:A.nextLocation})):(s(T),d({isTransitioning:!0,flushSync:!1,currentLocation:A.currentLocation,nextLocation:A.nextLocation}))},[e.window,t,m,f]);v.useLayoutEffect(()=>e.subscribe(j),[e,j]),v.useEffect(()=>{c.isTransitioning&&!c.flushSync&&p(new eJ)},[c]),v.useEffect(()=>{if(f&&i&&e.window){let T=i,_=f.promise,P=e.window.document.startViewTransition(async()=>{v.startTransition(()=>r(T)),await _});P.finished.finally(()=>{p(void 0),g(void 0),s(void 0),d({isTransitioning:!1})}),g(P)}},[i,f,e.window]),v.useEffect(()=>{f&&i&&n.location.key===i.location.key&&f.resolve()},[f,m,n.location,i]),v.useEffect(()=>{!c.isTransitioning&&x&&(s(x.state),d({isTransitioning:!0,flushSync:!1,currentLocation:x.currentLocation,nextLocation:x.nextLocation}),b(void 0))},[c.isTransitioning,x]);let C=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:T=>e.navigate(T),push:(T,_,P)=>e.navigate(T,{state:_,preventScrollReset:P?.preventScrollReset}),replace:(T,_,P)=>e.navigate(T,{replace:!0,state:_,preventScrollReset:P?.preventScrollReset})}),[e]),E=e.basename||"/",R=v.useMemo(()=>({router:e,navigator:C,static:!1,basename:E}),[e,C,E]);return v.createElement(v.Fragment,null,v.createElement(ll.Provider,{value:R},v.createElement(Ld.Provider,{value:n},v.createElement(OP.Provider,{value:w.current},v.createElement(Yb.Provider,{value:c},v.createElement(oJ,{basename:E,location:n.location,navigationType:n.historyAction,navigator:C},v.createElement(nJ,{routes:e.routes,future:e.future,state:n})))))),null)}var nJ=v.memo(rJ);function rJ({routes:e,future:t,state:n}){return LP(e,void 0,n,t)}function Jb(e){return zZ(e.context)}function Le(e){yt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function oJ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:i,static:s=!1}){yt(!zd(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:c,navigator:i,static:s,future:{}}),[c,i,s]);typeof n=="string"&&(n=ia(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:x="default"}=n,b=v.useMemo(()=>{let w=xo(f,c);return w==null?null:{location:{pathname:w,search:p,hash:m,state:g,key:x},navigationType:r}},[c,f,p,m,g,x,r]);return On(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement(mi.Provider,{value:d},v.createElement($d.Provider,{children:t,value:b}))}function iJ({children:e,location:t}){return UZ(lx(e),t)}function lx(e,t=[]){let n=[];return v.Children.forEach(e,(r,i)=>{if(!v.isValidElement(r))return;let s=[...t,i];if(r.type===v.Fragment){n.push.apply(n,lx(r.props.children,s));return}yt(r.type===Le,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=lx(r.props.children,s)),n.push(c)}),n}var _h="get",Dh="application/x-www-form-urlencoded";function bm(e){return e!=null&&typeof e.tagName=="string"}function aJ(e){return bm(e)&&e.tagName.toLowerCase()==="button"}function sJ(e){return bm(e)&&e.tagName.toLowerCase()==="form"}function lJ(e){return bm(e)&&e.tagName.toLowerCase()==="input"}function cJ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uJ(e,t){return e.button===0&&(!t||t==="_self")&&!cJ(e)}function cx(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(i=>[n,i]):[[n,r]])},[]))}function dJ(e,t){let n=cx(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}var fh=null;function fJ(){if(fh===null)try{new FormData(document.createElement("form"),0),fh=!1}catch{fh=!0}return fh}var hJ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function vy(e){return e!=null&&!hJ.has(e)?(On(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Dh}"`),null):e}function pJ(e,t){let n,r,i,s,c;if(sJ(e)){let d=e.getAttribute("action");r=d?xo(d,t):null,n=e.getAttribute("method")||_h,i=vy(e.getAttribute("enctype"))||Dh,s=new FormData(e)}else if(aJ(e)||lJ(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?xo(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||_h,i=vy(e.getAttribute("formenctype"))||vy(d.getAttribute("enctype"))||Dh,s=new FormData(d,e),!fJ()){let{name:p,type:m,value:g}=e;if(m==="image"){let x=p?`${p}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else p&&s.append(p,g)}}else{if(bm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=_h,r=null,i=Dh,c=e}return s&&i==="text/plain"&&(c=s,s=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:s,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function e1(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mJ(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&xo(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function gJ(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 vJ(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 yJ(e,t,n){let r=await Promise.all(e.map(async i=>{let s=t.routes[i.route.id];if(s){let c=await gJ(s,n);return c.links?c.links():[]}return[]}));return wJ(r.flat(1).filter(vJ).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function $T(e,t,n,r,i,s){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,d=(f,p)=>n[p].pathname!==f.pathname||n[p].route.path?.endsWith("*")&&n[p].params["*"]!==f.params["*"];return s==="assets"?t.filter((f,p)=>c(f,p)||d(f,p)):s==="data"?t.filter((f,p)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||d(f,p))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function xJ(e,t,{includeHydrateFallback:n}={}){return bJ(e.map(r=>{let i=t.routes[r.route.id];if(!i)return[];let s=[i.module];return i.clientActionModule&&(s=s.concat(i.clientActionModule)),i.clientLoaderModule&&(s=s.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(s=s.concat(i.hydrateFallbackModule)),i.imports&&(s=s.concat(i.imports)),s}).flat(1))}function bJ(e){return[...new Set(e)]}function SJ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function wJ(e,t){let n=new Set;return new Set(t),e.reduce((r,i)=>{let s=JSON.stringify(SJ(i));return n.has(s)||(n.add(s),r.push({key:s,link:i})),r},[])}function zP(){let e=v.useContext(ll);return e1(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function jJ(){let e=v.useContext(Ld);return e1(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var t1=v.createContext(void 0);t1.displayName="FrameworkContext";function UP(){let e=v.useContext(t1);return e1(e,"You must render this element inside a <HydratedRouter> element"),e}function CJ(e,t){let n=v.useContext(t1),[r,i]=v.useState(!1),[s,c]=v.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,x=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=E=>{E.forEach(R=>{c(R.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return x.current&&C.observe(x.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{i(!0)},w=()=>{i(!1),c(!1)};return n?e!=="intent"?[s,x,{}]:[s,x,{onFocus:Bu(d,b),onBlur:Bu(f,w),onMouseEnter:Bu(p,b),onMouseLeave:Bu(m,w),onTouchStart:Bu(g,b)}]:[!1,x,{}]}function Bu(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function EJ({page:e,...t}){let{router:n}=zP(),r=v.useMemo(()=>za(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(RJ,{page:e,matches:r,...t}):null}function TJ(e){let{manifest:t,routeModules:n}=UP(),[r,i]=v.useState([]);return v.useEffect(()=>{let s=!1;return yJ(e,t,n).then(c=>{s||i(c)}),()=>{s=!0}},[e,t,n]),r}function RJ({page:e,matches:t,...n}){let r=Or(),{manifest:i,routeModules:s}=UP(),{basename:c}=zP(),{loaderData:d,matches:f}=jJ(),p=v.useMemo(()=>$T(e,t,f,i,r,"data"),[e,t,f,i,r]),m=v.useMemo(()=>$T(e,t,f,i,r,"assets"),[e,t,f,i,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,j=!1;if(t.forEach(E=>{let R=i.routes[E.route.id];!R||!R.hasLoader||(!p.some(T=>T.route.id===E.route.id)&&E.route.id in d&&s[E.route.id]?.shouldRevalidate||R.hasClientLoader?j=!0:w.add(E.route.id))}),w.size===0)return[];let C=mJ(e,c,"data");return j&&w.size>0&&C.searchParams.set("_routes",t.filter(E=>w.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[c,d,r,i,p,t,e,s]),x=v.useMemo(()=>xJ(m,i),[m,i]),b=TJ(m);return v.createElement(v.Fragment,null,g.map(w=>v.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),x.map(w=>v.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:j})=>v.createElement("link",{key:w,nonce:n.nonce,...j})))}function _J(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var BP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{BP&&(window.__reactRouterVersion="7.8.1")}catch{}function DJ(e,t){return mZ({basename:t?.basename,unstable_getContext:t?.unstable_getContext,future:t?.future,history:OX({window:t?.window}),hydrationData:AJ(),routes:e,mapRouteProperties:ZZ,hydrationRouteProperties:JZ,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function AJ(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:PJ(e.errors)}),e}function PJ(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new op(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let c=new s(i.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}var VP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FP=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:i,reloadDocument:s,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,...x},b){let{basename:w}=v.useContext(mi),j=typeof p=="string"&&VP.test(p),C,E=!1;if(typeof p=="string"&&j&&(C=p,BP))try{let V=new URL(window.location.href),H=p.startsWith("//")?new URL(V.protocol+p):new URL(p),Z=xo(H.pathname,w);H.origin===V.origin&&Z!=null?p=Z+H.search+H.hash:E=!0}catch{On(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let R=IZ(p,{relative:i}),[T,_,P]=CJ(r,x),A=MJ(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:i,viewTransition:g});function M(V){t&&t(V),V.defaultPrevented||A(V)}let I=v.createElement("a",{...x,...P,href:C||R,onClick:E||s?t:M,ref:_J(b,_),target:f,"data-discover":!j&&n==="render"?"true":void 0});return T&&!j?v.createElement(v.Fragment,null,I,v.createElement(EJ,{page:R})):I});FP.displayName="Link";var kJ=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:i=!1,style:s,to:c,viewTransition:d,children:f,...p},m){let g=Ud(c,{relative:p.relative}),x=Or(),b=v.useContext(Ld),{navigator:w,basename:j}=v.useContext(mi),C=b!=null&&UJ(g)&&d===!0,E=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,R=x.pathname,T=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(R=R.toLowerCase(),T=T?T.toLowerCase():null,E=E.toLowerCase()),T&&j&&(T=xo(T,j)||T);const _=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let P=R===E||!i&&R.startsWith(E)&&R.charAt(_)==="/",A=T!=null&&(T===E||!i&&T.startsWith(E)&&T.charAt(E.length)==="/"),M={isActive:P,isPending:A,isTransitioning:C},I=P?t:void 0,V;typeof r=="function"?V=r(M):V=[r,P?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let H=typeof s=="function"?s(M):s;return v.createElement(FP,{...p,"aria-current":I,className:V,ref:m,style:H,to:c,viewTransition:d},typeof f=="function"?f(M):f)});kJ.displayName="NavLink";var NJ=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:s,method:c=_h,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...x},b)=>{let w=$J(),j=zJ(d,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",E=typeof d=="string"&&VP.test(d),R=T=>{if(f&&f(T),T.defaultPrevented)return;T.preventDefault();let _=T.nativeEvent.submitter,P=_?.getAttribute("formmethod")||c;w(_||T.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:i,state:s,relative:p,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:R,...x,"data-discover":!E&&e==="render"?"true":void 0})});NJ.displayName="Form";function OJ(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function HP(e){let t=v.useContext(ll);return yt(t,OJ(e)),t}function MJ(e,{target:t,replace:n,state:r,preventScrollReset:i,relative:s,viewTransition:c}={}){let d=xn(),f=Or(),p=Ud(e,{relative:s});return v.useCallback(m=>{if(uJ(m,t)){m.preventDefault();let g=n!==void 0?n:Wa(f)===Wa(p);d(e,{replace:g,state:r,preventScrollReset:i,relative:s,viewTransition:c})}},[f,d,p,n,r,t,e,i,s,c])}function n1(e){On(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=v.useRef(cx(e)),n=v.useRef(!1),r=Or(),i=v.useMemo(()=>dJ(r.search,n.current?null:t.current),[r.search]),s=xn(),c=v.useCallback((d,f)=>{const p=cx(typeof d=="function"?d(new URLSearchParams(i)):d);n.current=!0,s("?"+p,f)},[s,i]);return[i,c]}var IJ=0,LJ=()=>`__${String(++IJ)}__`;function $J(){let{router:e}=HP("useSubmit"),{basename:t}=v.useContext(mi),n=YZ();return v.useCallback(async(r,i={})=>{let{action:s,method:c,encType:d,formData:f,body:p}=pJ(r,t);if(i.navigate===!1){let m=i.fetcherKey||LJ();await e.fetch(m,n,i.action||s,{preventScrollReset:i.preventScrollReset,formData:f,body:p,formMethod:i.method||c,formEncType:i.encType||d,flushSync:i.flushSync})}else await e.navigate(i.action||s,{preventScrollReset:i.preventScrollReset,formData:f,body:p,formMethod:i.method||c,formEncType:i.encType||d,replace:i.replace,state:i.state,fromRouteId:n,flushSync:i.flushSync,viewTransition:i.viewTransition})},[e,t,n])}function zJ(e,{relative:t}={}){let{basename:n}=v.useContext(mi),r=v.useContext(Bo);yt(r,"useFormAction must be used inside a RouteContext");let[i]=r.matches.slice(-1),s={...Ud(e||".",{relative:t})},c=Or();if(e==null){s.search=c.search;let d=new URLSearchParams(s.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();s.search=m?`?${m}`:""}}return(!e||e===".")&&i.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:si([n,s.pathname])),Wa(s)}function UJ(e,{relative:t}={}){let n=v.useContext(Yb);yt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=HP("useViewTransitionState"),i=Ud(e,{relative:t});if(!n.isTransitioning)return!1;let s=xo(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=xo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return rp(i.pathname,c)!=null||rp(i.pathname,s)!=null}function r1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function BJ(e){if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return e.specimen?.[0]}function es(e){return Vs(e.getActiveLogin()?.project)}function Sm(e){const t=De(),n=es(t),r=xn(),[i,s]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ue.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ue.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(zc,{search:i,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})}function VJ(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Bots"}),a.jsx(Sm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(gt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function FJ(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Clients"}),a.jsx(Sm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(gt,{to:"/admin/clients/new",children:"Create new client"})})]})}function wm(e){return a.jsx(al,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{pi(t)?e.onChange(Jt(t)):e.onChange(void 0)}})}function HJ(){const e=De(),t=es(e),[n,r]=v.useState(""),[i,s]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Create new Bot"}),a.jsxs(dt,{onSubmit:()=>{const x={name:n,description:i,accessPolicy:c};e.post("admin/projects/"+t+"/bot",x).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),Ne({color:"green",message:"Bot created"})}).catch(b=>{Ne({color:"red",message:Ke(b),autoClose:!1}),p(Ht(b))})},children:[!m&&a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:x=>r(x.currentTarget.value),error:At(f,"name")})}),a.jsx(Nt,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(ze,{id:"description",name:"description",onChange:x=>s(x.currentTarget.value),error:At(f,"description")})}),a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(wm,{name:"accessPolicy",onChange:d})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Pe,{children:"Bot created"}),a.jsxs(pr,{children:[a.jsx(pr.Item,{children:a.jsx(gt,{to:m,children:"Go to new bot"})}),a.jsx(pr.Item,{children:a.jsx(gt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function qJ(){const e=De(),t=es(e),[n,r]=v.useState(""),[i,s]=v.useState(""),[c,d]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[x,b]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Create new Client"}),a.jsxs(dt,{onSubmit:()=>{const w={name:n,description:i,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",w).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),Ne({color:"green",message:"Client created"})}).catch(j=>{Ne({color:"red",message:Ke(j),autoClose:!1}),g(Ht(j))})},children:[!x&&a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(ze,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:w=>r(w.currentTarget.value),error:At(m,"name")})}),a.jsx(Nt,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(ze,{id:"description",name:"description",onChange:w=>s(w.currentTarget.value),error:At(m,"description")})}),a.jsx(Nt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(ze,{id:"redirectUri",name:"redirectUri",onChange:w=>d(w.currentTarget.value),error:At(m,"redirectUri")})}),a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(wm,{name:"accessPolicy",onChange:p})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Create Client"})})]}),x&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Pe,{children:"Client created"}),a.jsxs(pr,{children:[a.jsx(pr.Item,{children:a.jsx(gt,{to:x,children:"Go to new client"})}),a.jsx(pr.Item,{children:a.jsx(gt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function GJ(e){return a.jsx(al,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{pi(t)?e.onChange(Jt(t)):e.onChange(void 0)}})}function WJ(){const{membershipId:e}=Bt(),t=De(),n=es(t),r=xn(),i=t.get(`admin/projects/${n}/members/${e}`).read(),[s,c]=v.useState(i.accessPolicy),[d,f]=v.useState(i.userConfiguration),[p,m]=v.useState(i.admin),[g,x]=v.useState(),[b,w]=v.useState(!1);function j(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>x(Ht(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(uc,{value:i.profile,link:!0})}),a.jsxs(dt,{onSubmit:()=>{const C={...i,accessPolicy:s,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>w(!0)).catch(E=>x(Ht(E)))},children:[!b&&a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(wm,{name:"accessPolicy",defaultValue:s,onChange:c})}),a.jsx(Nt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(GJ,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(Nt,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(Un,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(ye,{justify:"flex-end",mt:"xl",children:[a.jsx(ke,{type:"submit",children:"Save"}),a.jsx(ke,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(gt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function QJ(){const e=De(),[t,n]=v.useState(e.getProject()),[r,i]=v.useState(),[s,c]=v.useState(),[d,f]=v.useState(!1),[p,m]=v.useState(void 0),g=v.useCallback(x=>{const b={resourceType:x.resourceType,firstName:x.firstName,lastName:x.lastName,email:x.email,sendEmail:x.sendEmail==="on",accessPolicy:r,admin:x.isAdmin==="on",scope:x.isProjectScoped==="on"?"project":"server"};return e.invite(t?.id,b).then(w=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Xp(w)?c(w):m(w),f(b.sendEmail??!1),Ne({color:"green",message:"Invite success"})}).catch(w=>{Ne({color:"red",message:Ke(w),autoClose:!1}),c(Ht(w))})},[e,t,r]);return a.jsxs(dt,{onSubmit:g,children:[!p&&!s&&a.jsxs(Ve,{children:[a.jsx(Ie,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(Nt,{title:"Project",htmlFor:"project",outcome:s,children:a.jsx(al,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(an,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:At(s,"resourceType")}),a.jsx(ze,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:At(s,"firstName")}),a.jsx(ze,{name:"lastName",label:"Last Name",required:!0,error:At(s,"lastName")}),a.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,error:At(s,"email")}),a.jsx(Nt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:a.jsx(wm,{name:"accessPolicy",onChange:i})}),a.jsx(Un,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(Un,{name:"isAdmin",label:"Admin"}),a.jsx(Un,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(ye,{justify:"flex-end",children:a.jsx(yr,{children:"Invite"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(gt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Pe,{children:"User created"}),d&&a.jsx(Pe,{children:"Email sent"}),a.jsxs(pr,{children:[a.jsx(pr.Item,{children:a.jsx(gt,{to:p,children:"Go to new membership"})}),a.jsx(pr.Item,{children:a.jsx(gt,{to:p.profile,children:"Go to new profile"})}),a.jsx(pr.Item,{children:a.jsx(gt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function YJ(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Patients"}),a.jsx(Sm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(gt,{to:"/admin/invite",children:"Invite new patient"})})]})}function KJ(){const e=De();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Nr,{outcome:J0});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ne({color:"green",message:"Done"})).catch(r=>Ne({color:"red",message:Ke(r),autoClose:!1}))}return a.jsxs(lt,{width:600,children:[a.jsx(Ie,{order:1,children:"Project Admin"}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Force Set Password"}),a.jsx(Pe,{children:"Sets the password for the specified user in this project."}),a.jsx(Pe,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(dt,{onSubmit:t,children:a.jsxs(Ve,{children:[a.jsx(ze,{name:"email",label:"Email",required:!0}),a.jsx(Oo,{name:"password",label:"Password",required:!0}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})})]})}function zT(){const e=De(),t=es(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Details"}),a.jsxs(dm,{children:[a.jsx(mo,{term:"ID",children:n.project.id}),a.jsx(mo,{term:"Name",children:n.project.name})]})]})}const UT=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function XJ(){const e=xn(),n=Or().pathname.replace("/admin/","")||UT[0],r=De(),i=es(r),s=v.useMemo(()=>r.get("admin/projects/"+i).read(),[r,i]);function c(d){e(`/admin/${d}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(mr,{children:[a.jsx(ht,{children:a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Project"}),a.jsx(ht.Value,{children:s.project.name})]})}),a.jsx(Kr,{children:a.jsx(zt,{value:n.toLowerCase(),onChange:c,children:a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:UT.map(d=>a.jsx(zt.Tab,{value:d.toLowerCase(),children:d},d))})})})]}),a.jsx(lt,{children:a.jsx(Jb,{})})]})}function ZJ(){const e=De(),t=es(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Qr(n.project.secret||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(Ie,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(Md,{property:Za("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}function JJ(){const e=De(),t=es(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=v.useState(!1),[s,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(Qr(n.project.site||[]))},[e,n]),!r||!s?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(f=>{const p=Ht(f);Ne({color:"red",message:`Error ${p.issue?.[0].details?.text} ${p.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx(Ie,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(Md,{property:Za("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}function qP(e,t,n,r){const i=Date.now().toString();Ne({id:i,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const s={method:"POST",pollStatusOnAccepted:!0};return r&&(s.body=JSON.stringify(r)),e.startAsyncRequest(n,s).then(c=>{let d="Done";return c.resourceType==="AsyncJob"?d=a.jsx(gt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(Pe,{children:c.issue[0].details.text})),ho.update({id:i,color:"green",title:t,message:d,icon:a.jsx(oa,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw ho.update({id:i,color:"red",title:t,message:Ke(c),icon:a.jsx(Gs,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function js(e,t,n,r){qP(e,t,n,r).catch(()=>{})}const GP="System AsyncJob",WP="Post-deploy Migrations",hh=[WP,GP];function eee(){const e=De(),[t,n]=v.useState(hh[0]);function r(i){i||=hh[0],hh.includes(i)&&n(i)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Nr,{outcome:J0}):a.jsx(Nd,{miw:"1600",maw:"2000",children:a.jsxs(Lc,{children:[a.jsx(Ie,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(zt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:hh.map(i=>a.jsx(zt.Tab,{value:i,children:i},i))}),a.jsx(zt.Panel,{value:GP,pt:"md",children:a.jsx(nee,{})}),a.jsx(zt.Panel,{value:WP,pt:"md",children:a.jsx(oee,{})})]})]})})}const tee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function nee(){const e=xn(),[t]=v.useState(tee);return a.jsxs(Ve,{children:[a.jsx(gt,{to:`/${t.resourceType}/${Va(t)}`,children:"Show in search page"}),a.jsx(zc,{checkboxesEnabled:!1,search:t,onClick:n=>e(BT(n.resource))?.catch(console.error),onAuxClick:n=>window.open(BT(n.resource),"_blank")})]})}const ree={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:ue.MISSING,value:"true"},{code:"type",operator:ue.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function oee(){const e=De(),[t,n]=v.useState(),[r,i]=v.useState(),[s,c]=v.useState([]),[d,f]=v.useState(0),[p,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((E,R)=>R-E),n(C)}).catch(C=>{Ne({color:"red",message:Ke(C),autoClose:!1})}).finally(()=>m(C=>C.filter(E=>E!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",Va({...ree,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{i(C.entry?.map(E=>E.resource))})).catch(C=>{i(void 0),Ne({color:"red",message:Ke(C),autoClose:!1})}).finally(()=>m(C=>C.filter(E=>E!==j)))},[e,d]);function g(){f(j=>j+1)}function x(j){qP(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function w(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(Pp,{visible:C}),a.jsxs(ve,{children:[a.jsx(ve.Thead,{children:a.jsxs(ve.Tr,{children:[a.jsx(ve.Th,{children:"Version"}),a.jsx(ve.Th,{children:"Action"}),a.jsx(ve.Th,{children:"Status"}),a.jsx(ve.Th,{children:"AsyncJob"}),a.jsx(ve.Th,{children:"Last Updated"}),a.jsx(ve.Th,{children:"Request Time"}),a.jsx(ve.Th,{children:"Duration"}),a.jsx(ve.Th,{children:"Attempts"})]})}),a.jsx(ve.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(ke,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(yA,{size:14}),onClick:g,loading:b,children:"Refresh"}),w(()=>{if(!b){if(!t)return a.jsx(ve.Tr,{children:a.jsx(ve.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(ve.Tr,{children:a.jsx(ve.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:E,asyncJobs:R}=iee(j,r??[],t?.pendingPostDeployMigration),T=s.includes(j),_=j===t?.pendingPostDeployMigration&&(!E||E?.status==="error"),P=[a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:j}),a.jsx(ve.Td,{children:_&&a.jsx(ke,{color:"green",size:"xs",onClick:()=>x(j),children:"Start"})}),a.jsx(ve.Td,{children:C}),a.jsx(ve.Td,{children:E&&a.jsx(gt,{to:`/AsyncJob/${E?.id}`,children:E?.id})}),a.jsx(ve.Td,{children:E?.meta?.lastUpdated}),a.jsx(ve.Td,{children:E?.requestTime}),a.jsx(ve.Td,{children:VT(E)}),a.jsx(ve.Td,{display:"flex",children:a.jsxs(ye,{gap:"xs",children:[R.length?R.length:"",T&&R.length>1&&a.jsx(ke,{leftSection:a.jsx(FH,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A.filter(M=>M!==j):A),children:"Hide all"}),!T&&R.length>1&&a.jsx(ke,{leftSection:a.jsx(vA,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A:[...A,j]),children:"Show all"})]})})]},j)];return T&&P.push(...R.filter(A=>A.id!==E?.id).map(A=>a.jsxs(ve.Tr,{bg:"gray.1",children:[a.jsx(ve.Td,{children:j}),a.jsx(ve.Td,{}),a.jsx(ve.Td,{children:A.status}),a.jsx(ve.Td,{children:a.jsx(gt,{to:`/AsyncJob/${A.id}`,children:A.id})}),a.jsx(ve.Td,{children:A.meta?.lastUpdated}),a.jsx(ve.Td,{children:A.requestTime}),a.jsx(ve.Td,{children:VT(A)}),a.jsx(ve.Td,{})]},A.id))),P})},{isLoading:b})]})}function iee(e,t,n){const r=t.filter(c=>c.dataVersion===e),i=r.find(c=>c.status==="completed")??r[0];let s;return n===0?s=i?.status??"completed":e>n?s=i?.status??"pending":e===n?s=i?.status??"next":s=i?.status??"completed",{status:s,asyncJob:i,asyncJobs:r}}function BT(e){return`/${e.resourceType}/${e.id}`}function VT(e){const t=e?.requestTime,n=e?.transactionTime??e?.meta?.lastUpdated;if(!t||!n)return"";const r=new Date(t),s=new Date(n).getTime()-r.getTime();if(s<1e3)return`${s.toFixed(0)}ms`;const c=s/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function aee(){const e=De(),[t,{open:n,close:r}]=fp(!1),[i,s]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Nr,{outcome:J0});function f(){js(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){js(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){js(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(P){js(e,"Reindexing Resources","admin/super/reindex",P)}function x(){js(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){js(e,"Run Pending Data Migration","admin/super/migrate")}function w(P){e.post("admin/super/removebotidjobsfromqueue",P).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ke(A),autoClose:!1}))}function j(P){e.post("admin/super/purge",{...P,before:kb(P.before)}).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ke(A),autoClose:!1}))}function C(P){e.post("admin/super/setpassword",P).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ke(A),autoClose:!1}))}function E(P){e.post("fhir/R4/$db-stats",P.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:P.tableNames}]}:void 0).then(A=>{s("Database Stats"),d(a.jsx("pre",{children:A.parameter?.find(M=>M.name==="tableString")?.valueString})),n()}).catch(A=>Ne({color:"red",message:Ke(A),autoClose:!1}))}function R(){e.post("fhir/R4/$db-invalid-indexes").then(P=>{s("Database Invalid Indexes"),d(a.jsx("pre",{children:P.parameter?.filter(A=>A.name==="invalidIndex").map(A=>A.valueString).join(`
578
+ `)})),n()}).catch(P=>Ne({color:"red",message:Ke(P),autoClose:!1}))}function T(){e.post("fhir/R4/$db-schema-diff").then(P=>{s("Schema Diff"),d(a.jsx("pre",{children:P.parameter?.find(A=>A.name==="migrationString")?.valueString})),n()}).catch(P=>Ne({color:"red",message:Ke(P),autoClose:!1}))}function _(){js(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(lt,{width:600,children:[a.jsx(Ie,{order:1,children:"Super Admin"}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(dt,{children:a.jsx(ke,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(dt,{children:a.jsx(ke,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(dt,{children:a.jsx(ke,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Run Pending Data Migration"}),a.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."}),a.jsx(dt,{onSubmit:b,children:a.jsx(Ve,{children:a.jsx(ke,{type:"submit",children:"Start Migration"})})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(dt,{onSubmit:g,children:a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(ze,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(Nt,{title:"Search Filter",htmlFor:"filter",children:a.jsx(ze,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(Nt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(see,{})}),a.jsx(ke,{type:"submit",children:"Reindex"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(dt,{onSubmit:j,children:a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(an,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(Nt,{title:"Purge Before",htmlFor:"before",children:a.jsx(ai,{name:"before",placeholder:"Before Date"})}),a.jsx(ke,{type:"submit",children:"Purge"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(dt,{onSubmit:w,children:a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Bot ID",children:a.jsx(ze,{name:"botId",placeholder:"Bot Id"})}),a.jsx(ke,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(dt,{onSubmit:C,children:a.jsxs(Ve,{children:[a.jsx(ze,{name:"email",label:"Email",required:!0}),a.jsx(Oo,{name:"password",label:"Password",required:!0}),a.jsx(ze,{name:"projectId",label:"Project ID"}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(dt,{onSubmit:E,children:a.jsxs(Ve,{children:[a.jsx(Nt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(ze,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(ke,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(dt,{onSubmit:R,children:a.jsx(Ve,{children:a.jsx(ke,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(ir,{children:[a.jsx(ir.Col,{span:6,children:a.jsx(dt,{onSubmit:T,children:a.jsx(Ve,{children:a.jsx(ke,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(ir.Col,{span:6,children:a.jsx(dt,{onSubmit:_,children:a.jsx(Ve,{children:a.jsx(ke,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Reload Cron Resources"}),a.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),a.jsx(dt,{onSubmit:x,children:a.jsx(Ve,{children:a.jsx(ke,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(Vn,{opened:t,onClose:r,title:i,centered:!0,size:"auto",children:c})]})}function see(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(an,{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"&&a.jsx(Vp,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function lee(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Users"}),a.jsx(Sm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(gt,{to:"/admin/invite",children:"Invite new user"})})]})}const cee=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 jc(e,t,n){const r=uee(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&FT(r,"path",s),FT(r,"relativePath",s),r}function uee(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=cee.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function FT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var cl=(e,t,n)=>new Promise((r,i)=>{var s=f=>{try{d(n.next(f))}catch(p){i(p)}},c=f=>{try{d(n.throw(f))}catch(p){i(p)}},d=f=>f.done?r(f.value):Promise.resolve(f.value).then(s,c);d((n=n.apply(e,t)).next())});const dee=[".DS_Store","Thumbs.db"];function fee(e){return cl(this,null,function*(){return ap(e)&&hee(e.dataTransfer)?vee(e.dataTransfer,e.type):pee(e)?mee(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?gee(e):[]})}function hee(e){return ap(e)}function pee(e){return ap(e)&&ap(e.target)}function ap(e){return typeof e=="object"&&e!==null}function mee(e){return ux(e.target.files).map(t=>jc(t))}function gee(e){return cl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>jc(n))})}function vee(e,t){return cl(this,null,function*(){if(e.items){const n=ux(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(yee));return HT(QP(r))}return HT(ux(e.files).map(n=>jc(n)))})}function HT(e){return e.filter(t=>dee.indexOf(t.name)===-1)}function ux(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 yee(e){if(typeof e.webkitGetAsEntry!="function")return qT(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?YP(t):qT(e,t)}function QP(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?QP(n):[n]],[])}function qT(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(s=>cl(this,null,function*(){const c=yield s.getFile();return c.handle=s,jc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const i=jc(r,(n=t?.fullPath)!=null?n:void 0);return Promise.resolve(i)}function xee(e){return cl(this,null,function*(){return e.isDirectory?YP(e):bee(e)})}function YP(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(c=>cl(this,null,function*(){if(c.length){const d=Promise.all(c.map(xee));i.push(d),s()}else try{const d=yield Promise.all(i);n(d)}catch(d){r(d)}}),c=>{r(c)})}s()})}function bee(e){return cl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const i=jc(r,e.fullPath);t(i)},r=>{n(r)})})})}function yy(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(c=>{const d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):i===d})}return!0}var See=Object.defineProperty,wee=Object.defineProperties,jee=Object.getOwnPropertyDescriptors,GT=Object.getOwnPropertySymbols,Cee=Object.prototype.hasOwnProperty,Eee=Object.prototype.propertyIsEnumerable,WT=(e,t,n)=>t in e?See(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Tee=(e,t)=>{for(var n in t||(t={}))Cee.call(t,n)&&WT(e,n,t[n]);if(GT)for(var n of GT(t))Eee.call(t,n)&&WT(e,n,t[n]);return e},Ree=(e,t)=>wee(e,jee(t));const _ee=typeof yy=="function"?yy:yy.default,Dee="file-invalid-type",Aee="file-too-large",Pee="file-too-small",kee="too-many-files",Nee=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:Dee,message:`File type must be ${n}`}},QT=e=>({code:Aee,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),YT=e=>({code:Pee,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),Oee={code:kee,message:"Too many files"};function KP(e,t){const n=e.type==="application/x-moz-file"||_ee(e,t);return[n,n?null:Nee(t)]}function XP(e,t,n){if(_s(e.size))if(_s(t)&&_s(n)){if(e.size>n)return[!1,QT(n)];if(e.size<t)return[!1,YT(t)]}else{if(_s(t)&&e.size<t)return[!1,YT(t)];if(_s(n)&&e.size>n)return[!1,QT(n)]}return[!0,null]}function _s(e){return e!=null}function Mee({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:s,validator:c}){return!i&&e.length>1||i&&s>=1&&e.length>s?!1:e.every(d=>{const[f]=KP(d,t),[p]=XP(d,n,r),m=c?c(d):null;return f&&p&&!m})}function sp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function ph(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 KT(e){e.preventDefault()}function Iee(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Lee(e){return e.indexOf("Edge/")!==-1}function $ee(e=window.navigator.userAgent){return Iee(e)||Lee(e)}function Xo(...e){return(t,...n)=>e.some(r=>(!sp(t)&&r&&r(t,...n),sp(t)))}function zee(){return"showOpenFilePicker"in window}function Uee(e){return _s(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let i=!0;return ZP(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.`),i=!1),(!Array.isArray(r)||!r.every(JP))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce((n,[r,i])=>Ree(Tee({},n),{[r]:i}),{})}]:e}function Bee(e){if(_s(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>ZP(t)||JP(t)).join(",")}function Vee(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Fee(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ZP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function JP(e){return/^.*\.[\w]+$/.test(e)}var Hee=Object.defineProperty,qee=Object.defineProperties,Gee=Object.getOwnPropertyDescriptors,lp=Object.getOwnPropertySymbols,ek=Object.prototype.hasOwnProperty,tk=Object.prototype.propertyIsEnumerable,XT=(e,t,n)=>t in e?Hee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hr=(e,t)=>{for(var n in t||(t={}))ek.call(t,n)&&XT(e,n,t[n]);if(lp)for(var n of lp(t))tk.call(t,n)&&XT(e,n,t[n]);return e},La=(e,t)=>qee(e,Gee(t)),cp=(e,t)=>{var n={};for(var r in e)ek.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&lp)for(var r of lp(e))t.indexOf(r)<0&&tk.call(e,r)&&(n[r]=e[r]);return n};const o1=v.forwardRef((e,t)=>{var n=e,{children:r}=n,i=cp(n,["children"]);const s=rk(i),{open:c}=s,d=cp(s,["open"]);return v.useImperativeHandle(t,()=>({open:c}),[c]),jn.createElement(v.Fragment,null,r(La(hr({},d),{open:c})))});o1.displayName="Dropzone";const nk={disabled:!1,getFilesFromEvent:fee,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};o1.defaultProps=nk;o1.propTypes={children:rn.func,accept:rn.objectOf(rn.arrayOf(rn.string)),multiple:rn.bool,preventDropOnDocument:rn.bool,noClick:rn.bool,noKeyboard:rn.bool,noDrag:rn.bool,noDragEventsBubbling:rn.bool,minSize:rn.number,maxSize:rn.number,maxFiles:rn.number,disabled:rn.bool,getFilesFromEvent:rn.func,onFileDialogCancel:rn.func,onFileDialogOpen:rn.func,useFsAccessApi:rn.bool,autoFocus:rn.bool,onDragEnter:rn.func,onDragLeave:rn.func,onDragOver:rn.func,onDrop:rn.func,onDropAccepted:rn.func,onDropRejected:rn.func,onError:rn.func,validator:rn.func};const dx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function rk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:i,minSize:s,multiple:c,maxFiles:d,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:x,onDropRejected:b,onFileDialogCancel:w,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:E,preventDropOnDocument:R,noClick:T,noKeyboard:_,noDrag:P,noDragEventsBubbling:A,onError:M,validator:I}=hr(hr({},nk),e),V=v.useMemo(()=>Bee(t),[t]),H=v.useMemo(()=>Uee(t),[t]),Z=v.useMemo(()=>typeof j=="function"?j:ZT,[j]),K=v.useMemo(()=>typeof w=="function"?w:ZT,[w]),Q=v.useRef(null),B=v.useRef(null),[W,N]=v.useReducer(Wee,dx),{isFocused:L,isFileDialogActive:$}=W,q=v.useRef(typeof window<"u"&&window.isSecureContext&&C&&zee()),O=()=>{!q.current&&$&&setTimeout(()=>{if(B.current){const{files:he}=B.current;he.length||(N({type:"closeDialog"}),K())}},300)};v.useEffect(()=>(window.addEventListener("focus",O,!1),()=>{window.removeEventListener("focus",O,!1)}),[B,$,K,q]);const F=v.useRef([]),te=he=>{Q.current&&Q.current.contains(he.target)||(he.preventDefault(),F.current=[])};v.useEffect(()=>(R&&(document.addEventListener("dragover",KT,!1),document.addEventListener("drop",te,!1)),()=>{R&&(document.removeEventListener("dragover",KT),document.removeEventListener("drop",te))}),[Q,R]),v.useEffect(()=>(!n&&E&&Q.current&&Q.current.focus(),()=>{}),[Q,E,n]);const ae=v.useCallback(he=>{M?M(he):console.error(he)},[M]),je=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he),F.current=[...F.current,he.target],ph(he)&&Promise.resolve(r(he)).then(Se=>{if(sp(he)&&!A)return;const $e=Se.length,be=$e>0&&Mee({files:Se,accept:V,minSize:s,maxSize:i,multiple:c,maxFiles:d,validator:I}),Oe=$e>0&&!be;N({isDragAccept:be,isDragReject:Oe,isDragActive:!0,type:"setDraggedFiles"}),f&&f(he)}).catch(Se=>ae(Se))},[r,f,ae,A,V,s,i,c,d,I]),xe=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he);const Se=ph(he);if(Se&&he.dataTransfer)try{he.dataTransfer.dropEffect="copy"}catch{}return Se&&m&&m(he),!1},[m,A]),we=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he);const Se=F.current.filter(be=>Q.current&&Q.current.contains(be)),$e=Se.indexOf(he.target);$e!==-1&&Se.splice($e,1),F.current=Se,!(Se.length>0)&&(N({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),ph(he)&&p&&p(he))},[Q,p,A]),Ge=v.useCallback((he,Se)=>{const $e=[],be=[];he.forEach(Oe=>{const[_t,xt]=KP(Oe,V),[tn,Lt]=XP(Oe,s,i),In=I?I(Oe):null;if(_t&&tn&&!In)$e.push(Oe);else{let Dn=[xt,Lt];In&&(Dn=Dn.concat(In)),be.push({file:Oe,errors:Dn.filter(Vo=>Vo)})}}),(!c&&$e.length>1||c&&d>=1&&$e.length>d)&&($e.forEach(Oe=>{be.push({file:Oe,errors:[Oee]})}),$e.splice(0)),N({acceptedFiles:$e,fileRejections:be,isDragReject:be.length>0,type:"setFiles"}),g&&g($e,be,Se),be.length>0&&b&&b(be,Se),$e.length>0&&x&&x($e,Se)},[N,c,V,s,i,d,g,x,b,I]),Ee=v.useCallback(he=>{he.preventDefault(),he.persist(),Re(he),F.current=[],ph(he)&&Promise.resolve(r(he)).then(Se=>{sp(he)&&!A||Ge(Se,he)}).catch(Se=>ae(Se)),N({type:"reset"})},[r,Ge,ae,A]),ot=v.useCallback(()=>{if(q.current){N({type:"openDialog"}),Z();const he={multiple:c,types:H};window.showOpenFilePicker(he).then(Se=>r(Se)).then(Se=>{Ge(Se,null),N({type:"closeDialog"})}).catch(Se=>{Vee(Se)?(K(Se),N({type:"closeDialog"})):Fee(Se)?(q.current=!1,B.current?(B.current.value=null,B.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(Se)});return}B.current&&(N({type:"openDialog"}),Z(),B.current.value=null,B.current.click())},[N,Z,K,C,Ge,ae,H,c]),et=v.useCallback(he=>{!Q.current||!Q.current.isEqualNode(he.target)||(he.key===" "||he.key==="Enter"||he.keyCode===32||he.keyCode===13)&&(he.preventDefault(),ot())},[Q,ot]),Ct=v.useCallback(()=>{N({type:"focus"})},[]),Ot=v.useCallback(()=>{N({type:"blur"})},[]),Mt=v.useCallback(()=>{T||($ee()?setTimeout(ot,0):ot())},[T,ot]),pt=he=>n?null:he,Rt=he=>_?null:pt(he),en=he=>P?null:pt(he),Re=he=>{A&&he.stopPropagation()},Ae=v.useMemo(()=>(he={})=>{var Se=he,{refKey:$e="ref",role:be,onKeyDown:Oe,onFocus:_t,onBlur:xt,onClick:tn,onDragEnter:Lt,onDragOver:In,onDragLeave:Dn,onDrop:Vo}=Se,Eo=cp(Se,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return hr(hr({onKeyDown:Rt(Xo(Oe,et)),onFocus:Rt(Xo(_t,Ct)),onBlur:Rt(Xo(xt,Ot)),onClick:pt(Xo(tn,Mt)),onDragEnter:en(Xo(Lt,je)),onDragOver:en(Xo(In,xe)),onDragLeave:en(Xo(Dn,we)),onDrop:en(Xo(Vo,Ee)),role:typeof be=="string"&&be!==""?be:"presentation",[$e]:Q},!n&&!_?{tabIndex:0}:{}),Eo)},[Q,et,Ct,Ot,Mt,je,xe,we,Ee,_,P,n]),Qe=v.useCallback(he=>{he.stopPropagation()},[]),_e=v.useMemo(()=>(he={})=>{var Se=he,{refKey:$e="ref",onChange:be,onClick:Oe}=Se,_t=cp(Se,["refKey","onChange","onClick"]);const xt={accept:V,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:pt(Xo(be,Ee)),onClick:pt(Xo(Oe,Qe)),tabIndex:-1,[$e]:B};return hr(hr({},xt),_t)},[B,t,c,Ee,n]);return La(hr({},W),{isFocused:L&&!n,getRootProps:Ae,getInputProps:_e,rootRef:Q,inputRef:B,open:pt(ot)})}function Wee(e,t){switch(t.type){case"focus":return La(hr({},e),{isFocused:!0});case"blur":return La(hr({},e),{isFocused:!1});case"openDialog":return La(hr({},dx),{isFileDialogActive:!0});case"closeDialog":return La(hr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return La(hr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return La(hr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return hr({},dx);default:return e}}function ZT(){}const[Qee,Yee]=gr("Dropzone component was not found in tree");function i1(e){const t=n=>{const{children:r,...i}=se(`Dropzone${Yj(e)}`,{},n),s=Yee(),c=Wi(r)?r:a.jsx("span",{children:r});return s[e]?v.cloneElement(c,i):null};return t.displayName=`@mantine/dropzone/${Yj(e)}`,t}const Kee=i1("accept"),Xee=i1("reject"),Zee=i1("idle");var ud={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const Jee={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},ete=(e,{radius:t,variant:n,acceptColor:r,rejectColor:i})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:i||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Ut(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},ts=ge((e,t)=>{const n=se("Dropzone",Jee,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:x,maxSize:b,accept:w,children:j,onDropAny:C,onDrop:E,onReject:R,openRef:T,name:_,maxFiles:P,autoFocus:A,activateOnClick:M,activateOnDrag:I,dragEventsBubbling:V,activateOnKeyboard:H,onDragEnter:Z,onDragLeave:K,onDragOver:Q,onFileDialogCancel:B,onFileDialogOpen:W,preventDropOnDocument:N,useFsAccessApi:L,getFilesFromEvent:$,validator:q,rejectColor:O,acceptColor:F,enablePointerEvents:te,loaderProps:ae,inputProps:je,mod:xe,...we}=n,Ge=Me({name:"Dropzone",classes:ud,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:ete}),{getRootProps:Ee,getInputProps:ot,isDragAccept:et,isDragReject:Ct,isDragActive:Ot,open:Mt}=rk({onDrop:C,onDropAccepted:E,onDropRejected:R,disabled:m||g,accept:Array.isArray(w)?w.reduce((Re,Ae)=>({...Re,[Ae]:[]}),{}):w,multiple:x,maxSize:b,maxFiles:P,autoFocus:A,noClick:!M,noDrag:!I,noDragEventsBubbling:!V,noKeyboard:!H,onDragEnter:Z,onDragLeave:K,onDragOver:Q,onFileDialogCancel:B,onFileDialogOpen:W,preventDropOnDocument:N,useFsAccessApi:L,validator:q,...$?{getFilesFromEvent:$}:null});Yu(T,Mt);const pt=Ot&&et,Rt=Ot&&Ct,en=!pt&&!Rt;return a.jsx(Qee,{value:{accept:pt,reject:Rt,idle:en},children:a.jsxs(ce,{...Ee(),...Ge("root",{focusable:!0}),...we,mod:[{accept:pt,reject:Rt,idle:en,disabled:m,loading:g,"activate-on-click":M},xe],children:[a.jsx(Pp,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:ae}),a.jsx("input",{...ot(je),name:_}),a.jsx("div",{...Ge("inner"),ref:t,"data-enable-pointer-events":te||void 0,children:j})]})})});ts.classes=ud;ts.displayName="@mantine/dropzone/Dropzone";ts.Accept=Kee;ts.Idle=Zee;ts.Reject=Xee;const tte={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Yr("max"),withinPortal:!0},a1=ge((e,t)=>{const n=se("DropzoneFullScreen",tte,e),{classNames:r,className:i,style:s,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:x,withinPortal:b,portalProps:w,...j}=n,C=Me({name:"DropzoneFullScreen",classes:ud,props:n,className:i,style:s,classNames:r,styles:c,unstyled:d,rootSelector:"fullScreen"}),{resolvedClassNames:E,resolvedStyles:R}=Xs({classNames:r,styles:c,props:n}),[T,_]=v.useState(0),[P,{open:A,close:M}]=fp(!1),I=H=>{H.dataTransfer?.types.includes("Files")&&(_(Z=>Z+1),A())},V=()=>{_(H=>H-1)};return v.useEffect(()=>{T===0&&M()},[T]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",I,!1),document.addEventListener("dragleave",V,!1),()=>{document.removeEventListener("dragenter",I,!1),document.removeEventListener("dragleave",V,!1)}},[p]),a.jsx(Ya,{...w,withinPortal:b,children:a.jsx(ce,{...C("fullScreen",{style:{opacity:P?1:0,pointerEvents:P?"all":"none",zIndex:x}}),ref:t,children:a.jsx(ts,{...j,classNames:E,styles:R,unstyled:d,className:ud.dropzone,onDrop:H=>{m?.(H),M(),_(0)},onReject:H=>{g?.(H),M(),_(0)}})})})});a1.classes=ud;a1.displayName="@mantine/dropzone/DropzoneFullScreen";ts.FullScreen=a1;const mh=ts,nte='{"resourceType": "Bundle"}';function xy({id:e,title:t,message:n,color:r,icon:i,withCloseButton:s=!1,method:c="show",loading:d}){ho[c]({id:e,loading:d,title:t,message:n,color:r,icon:i,withCloseButton:s,autoClose:!1})}function rte(){const e=yn(),t=De(),[n,r]=v.useState({}),i=v.useCallback(async(d,f)=>{const p="batch-upload";xy({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(d);m.type!=="batch"&&m.type!=="transaction"&&(m=qD(m));const g=await t.executeBatch(m);r(x=>({...x,[f]:g})),xy({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(oa,{size:"1rem"}),withCloseButton:!0})}catch(m){xy({id:p,title:"Batch Upload Failed",color:"red",message:Ke(m),method:"update",icon:a.jsx(Gs,{size:"1rem"}),withCloseButton:!0})}},[t]),s=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>i(m.target?.result,f.name),p.readAsText(f)}},[i]),c=v.useCallback(async d=>{await i(d.input,"JSON Data")},[i]);return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Batch Create"}),a.jsxs(Pe,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Dt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(zt,{defaultValue:"upload",children:[a.jsxs(zt.List,{children:[a.jsx(zt.Tab,{value:"upload",children:"File Upload"}),a.jsx(zt.Tab,{value:"json",children:"JSON"})]}),a.jsx(zt.Panel,{value:"upload",pt:"xs",children:a.jsx(mh,{onDrop:s,accept:["application/json"],children:a.jsxs(ye,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(mh.Accept,{children:a.jsx(BE,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(mh.Reject,{children:a.jsx(Gs,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(mh.Idle,{children:a.jsx(BE,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(Pe,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(Pe,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(zt.Panel,{value:"json",pt:"xs",children:a.jsxs(dt,{onSubmit:c,children:[a.jsx(Pc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:nte,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(zt,{defaultValue:Object.keys(n)[0],children:[a.jsx(zt.List,{children:Object.keys(n).map(d=>a.jsx(zt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(zt.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{onClick:()=>r({}),children:"Start over"})})]})]})}function ote(){const{resourceType:e}=Bt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),[r]=wc("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(lt,{children:[a.jsxs(Ie,{children:["No apps for ",e]}),a.jsx(gt,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(lt,{children:a.jsx("div",{children:r.map(i=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(gt,{to:`/forms/${i.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:i.name})}),a.jsx("p",{children:i.description})]},i.id))})}):a.jsx(yo,{})}function ite(){const e=De(),[t,n]=v.useState(),[r,i]=v.useState(!1);return a.jsx(lt,{width:450,children:a.jsxs(dt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>i(!0)).catch(c=>n(Ht(c)))},children:[a.jsxs(Yn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Change password"})]}),!r&&a.jsxs(Ve,{gap:"xl",mt:"xl",children:[a.jsx(Oo,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:At(t,"oldPassword")}),a.jsx(Oo,{name:"newPassword",label:"New password",required:!0,error:At(t,"newPassword")}),a.jsx(Oo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:At(t,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const fx=["Form","JSON","Profiles"],ate=["Profiles"],by=fx[0].toLowerCase();function ste(){const e=xn(),t=yn(),{resourceType:n}=Bt(),[r,i]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&fx.map(d=>d.toLowerCase()).includes(c)?c:by});function s(c){c||(c=by),i(c),e(`/${n}/new/${c}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(mr,{children:[a.jsxs(Pe,{p:"md",fw:500,children:["New ",n]}),a.jsx(Kr,{children:a.jsx(zt,{defaultValue:by,value:r,onChange:s,children:a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:fx.map(c=>a.jsx(zt.Tab,{value:c.toLowerCase(),px:"md",children:ate.includes(c)?a.jsxs(ye,{gap:"xs",wrap:"nowrap",children:[c,a.jsx(Ap,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),a.jsx(Jb,{})]})}function lte(){return a.jsx(lt,{children:a.jsxs(Ve,{children:[a.jsx(Ie,{order:1,children:"Unexpected Error"}),a.jsx(Pe,{children:"We're sorry, something went wrong."}),a.jsxs(Pe,{children:["Please contact ",a.jsx(Dt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function ok(e){const t=qt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(gt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,d){c&&d&&n.push({key:c,value:d})}function i(c){c&&r(c.system,c.value)}function s(c,d){Array.isArray(d)?d.forEach(f=>s(c,f)):typeof d=="string"?r(c,d):d&&(Array.isArray(d.coding)?r(c,d.coding.map(f=>f.display||f.code).join(", ")):r(c,d.text))}if("name"in t){const c=Gi(t);c!==kt(t)&&r("Name",c)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(i):i(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(ht,{children:n.map((c,d)=>a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:c.key}),a.jsx(ht.Value,{children:c.value})]},`${c.key}-${d}`))})}function cte(){const{id:e}=Bt(),t=Or(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,i=De(),[s,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,x]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const T={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(P=>!!P);_.length===1&&T.entry.push({request:{method:"GET",url:_[0]}}),m(_)}i.executeBatch(T).then(_=>{_.entry?.[0]?.response?.status!=="200"?w(_.entry?.[0]?.response?.outcome):(f(_.entry[0]?.resource),x(_.entry[1]?.resource)),c(!1)}).catch(_=>{w(_),c(!1)})},[i,e,r]),b)return a.jsx(lt,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return a.jsxs(lt,{children:[a.jsx(Ie,{children:d?.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[j.length===1&&a.jsx("li",{children:a.jsx(gt,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(T=>a.jsx("li",{children:a.jsx(gt,{to:T,children:kt(T)})},T.id))})]}),g&&a.jsx("li",{children:a.jsxs(gt,{to:g,children:["Back to ",Gi(g)]})}),a.jsx("li",{children:a.jsx(gt,{to:"/",children:"Go back home"})})]})]});if(s||!d)return a.jsx(yo,{});const E=g&&r1(g);return a.jsxs(a.Fragment,{children:[a.jsxs(mr,{shadow:"xs",radius:0,children:[E&&a.jsx(sP,{patient:E}),g&&g.resourceType!=="Patient"&&a.jsx(ok,{resource:g}),a.jsx(ce,{px:"xl",py:"md",children:a.jsxs(Pe,{children:[Gi(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(lt,{children:a.jsx(gP,{questionnaire:d,subject:g&&Jt(g),onSubmit:R})})]});async function R(T){const _=[];if(!p||p.length===0)_.push(await i.createResource(T));else for(const P of p)_.push(await i.createResource({...T,subject:{reference:P}}));C(_)}}const ute="_paper_unw9o_1",dte={paper:ute},fte={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function ik(e,t){const n=e.resourceType||hte(t),r=e.fields??pte(n),i=e.filters??(e.resourceType?void 0:mte(n)),s=e.sortRules??gte(n),c=e.offset??0,d=e.count??tm;return{...e,resourceType:n,fields:r,filters:i,sortRules:s,offset:c,count:d}}function hte(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function pte(e){const t=s1(e);if(t?.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function mte(e){return s1(e)?.filters}function gte(e){const t=s1(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function s1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function vte(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function yte(e,t){const n={...e,count:1e3,offset:0},r=ik(n,t.getUserConfiguration()),i=await t.search(r.resourceType,Va({...r,total:"accurate",fields:void 0}));return qD(i)}function JT(){const e=De(),t=xn(),n=Or(),[r,i]=v.useState();return v.useEffect(()=>{const s=BD(n.pathname+n.search),c=ik(s,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===Va(c)?(vte(c),i(c)):t(`/${c.resourceType}${Va(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(yo,{}):a.jsx(mr,{shadow:"xs",m:"md",p:"xs",className:dte.paper,children:a.jsx(zc,{checkboxesEnabled:!0,search:r,onClick:s=>t(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{t(`/${r.resourceType}${Va(s.definition)}`)?.catch(console.error)},onNew:()=>{t(fte[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+Va(r);e.download(s).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Ne({color:"red",message:Ke(c),autoClose:!1}))},onExportTransactionBundle:async()=>{yte(r,e).then(s=>wA(JSON.stringify(s,void 0,2))).catch(s=>Ne({color:"red",message:Ke(s),autoClose:!1}))},onDelete:s=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:s.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>i({...r})).catch(c=>Ne({color:"red",message:Ke(c),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)?.catch(console.error)}})})}function xte(){const[e]=wc("ObservationDefinition","_count=100");return e?a.jsxs(ve,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(ii,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(ii,{value:t.code})}),a.jsx("td",{children:a.jsx(ii,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(hx,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(yo,{})}function hx(e){const{ranges:t}=e;if(!t)return null;const n=eR(t.map(i=>i.gender));if(n.length>1)return rd(n),a.jsx(a.Fragment,{children:n.map(i=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Mn(i)})}),a.jsx(hx,{ranges:e.ranges?.filter(s=>s.gender===i)})]},i))});const r=eR(t.map(i=>i.age&&od(i.age)));return r.length>1?(rd(r),a.jsx(a.Fragment,{children:r.map(i=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:Mn(i)})}),a.jsx(hx,{ranges:e.ranges?.filter(s=>od(s.age)===i)})]},i))})):a.jsx(a.Fragment,{children:t.map(i=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:i.condition}),a.jsx("td",{children:a.jsx(Pb,{value:i.range})})]})})},`range-${i.condition}`))})}function eR(e){return[...new Set(e.filter(t=>!!t))]}function bte(){const[e]=wc("ActivityDefinition","_count=100"),[t]=wc("ObservationDefinition","_count=100");return!e||!t?a.jsx(yo,{}):a.jsxs(ve,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(ii,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(ii,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(i=>i.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function Ste(){const e=De(),[t,n]=v.useState(),[r,i]=v.useState(void 0),[s,c]=v.useState(!1),d=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),i(m.enrolled)}).catch(m=>Ne({color:"red",message:Ke(m),autoClose:!1}))},[e]);v.useEffect(()=>{d()},[d]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{i(!0),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Ke(g),autoClose:!1}))},[e]),p=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?a.jsxs(lt,{children:[a.jsx(Vn,{title:"Disable MFA",opened:s,onClose:()=>c(!1),children:a.jsx(NA,{onSubmit:async m=>{await p(m),c(!1),i(!1),Ne({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(oH,{})}),d()}})}),a.jsxs(ye,{children:[a.jsx(Ie,{children:"MFA is enabled"}),a.jsx(ke,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(lt,{width:400,children:a.jsxs(dt,{onSubmit:f,children:[a.jsx(Ie,{children:"Multi Factor Auth Setup"}),a.jsx(Yn,{children:a.jsx("img",{src:t,alt:"Multi Factor Auth QR Code"})}),a.jsx(ze,{name:"token",label:"Code"}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Enroll"})})]})})}const wte={},px={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:wte?.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bd(){return px}function ak(){return sk("registerEnabled")}function jte(){return sk("awsTextractEnabled")}function sk(e){try{return px[e]!==!1&&px[e]!=="false"}catch{return!0}}function Cte(){const e=xn(),[t]=n1(),n=De(),r=t.get("scope")||"openid",[i,s]=v.useState(),[c,d]=v.useState(!0),f=t.get("client_id"),p=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function g(){try{const x=await n.get(`/auth/clientinfo/${f}`);s(x)}catch(x){Ne({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ke(x),withCloseButton:!0})}finally{d(!1)}}g().catch(console.error)},[n,f]),!f)return null;function m(g){const x=new URL(t.get("redirect_uri"));for(const b of["scope","state","nonce"])t.has(b)&&x.searchParams.set(b,t.get(b));x.searchParams.set("code",g),window.location.assign(x.toString())}return a.jsx(OA,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:Bd().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&a.jsxs(a.Fragment,{children:[i?.logo?.url?a.jsx("img",{src:i?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx(Co,{size:32}),a.jsx(Ie,{children:i?.welcomeString??"Sign in to Medplum"})]})})}function Ete(){const e=De(),t=xn(),n=Bd();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),ak()?a.jsxs(MG,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Create a new account"})]}):a.jsx(lt,{width:450,children:a.jsx(Ji,{icon:a.jsx(il,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function Tte(){const e=xn(),t=De(),[n,r]=v.useState(),[i,s]=v.useState(!1),c=Bd().recaptchaSiteKey;return v.useEffect(()=>{PA(c)},[c]),a.jsx(lt,{width:450,children:a.jsxs(dt,{onSubmit:async d=>{let f="";f=await kA(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>s(!0)).catch(p=>r(Ht(p)))},children:[a.jsxs(Ve,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Medplum Password Reset"})]}),a.jsxs(Ve,{gap:"xl",children:[a.jsx(Nr,{issues:$c(n,void 0)}),!i&&a.jsxs(a.Fragment,{children:[a.jsx(ze,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:At(n,"email")}),a.jsxs(ye,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Dt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register")?.catch(console.error),size:"xs",children:"Register"}),a.jsx(ke,{type:"submit",children:"Reset password"})]})]}),i&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function Rte(e){const t=De(),[n,r]=v.useState(),[i,s]=v.useState();return i?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(gt,{to:i,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(gt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(dt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n?.reference}]}).then(s).catch(console.log)},children:a.jsxs(Ve,{children:[a.jsxs(Ie,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(Pe,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(Pe,{children:"The following tasks will be created:"}),a.jsx("ul",{children:e.planDefinition.action?.map((c,d)=>a.jsxs("li",{children:[c.definitionCanonical?.startsWith("Questionnaire/")&&"Questionnaire request: ",c.title&&a.jsx(a.Fragment,{children:c.title}),c.code&&a.jsx(ii,{value:c.code[0]})]},`action-${d}`))}),a.jsx(Nt,{title:"Subject",children:a.jsx(Od,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Go"})})]})})}function _te(){const{resourceType:e,id:t}=Bt(),n=qt({reference:e+"/"+t});return n?a.jsx(lt,{children:a.jsx(Rte,{planDefinition:n})}):null}function Dte(){const{resourceType:e,id:t}=Bt(),n=qt({reference:e+"/"+t}),[r,i]=wc("Questionnaire","subject-type="+e),[s,c]=wc("ClientApplication",{_count:1e3});if(!n||i||c)return a.jsx(yo,{});const d=s?.filter(m=>Ate(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=Jt(n):n.resourceType==="Encounter"&&(f=n.subject,p=Jt(n)),a.jsxs(lt,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(Ie,{order:3,children:a.jsx(gt,{to:`/forms/${m.id}?subject=${kt(n)}`,children:m.title||m.name})}),a.jsx(Pe,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(Ie,{order:3,children:a.jsx(TX,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(Pe,{children:m.description})]},m.id))]})}function Ate(e){return e==="Patient"||e==="Encounter"}function Pte(){const{resourceType:e,id:t}=Bt(),n=xn(),[r,i]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(lt,{children:a.jsx(zc,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>i(s.definition),hideFilters:!0})})}function kte(){const e=De(),{resourceType:t,id:n}=Bt(),r=e.readHistory(t,n).read();return a.jsx(yd,{maw:1200,children:a.jsx(Lc,{children:a.jsx(mX,{history:r})})})}const Nte="_hl7Input_k5xm3_1",Ote={hl7Input:Nte};function Mte(e){return a.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 Ite(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{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=>{Gu(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Lte=`{
579
+ "resourceType": "Patient",
580
+ "name": [
581
+ {
582
+ "given": [
583
+ "Alice"
584
+ ],
585
+ "family": "Smith"
586
+ }
587
+ ]
588
+ }`,$te="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 zte(){const e=De(),{id:t}=Bt(),[n,r]=v.useState(),[i,s]=v.useState(),[c,d]=v.useState(Lte),[f,p]=v.useState($te),[m,g]=v.useState(un.FHIR_JSON),x=v.useRef(null),b=v.useRef(null),[w,j]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async A=>{r(A),s(await Ute(e,A))}).catch(A=>Ne({color:"red",message:Ke(A),autoClose:!1}))},[e,t]);const C=v.useCallback(async()=>Gu(x.current,{command:"getValue"}),[]),E=v.useCallback(async()=>Gu(x.current,{command:"getOutput"}),[]),R=v.useCallback(async()=>m===un.FHIR_JSON?JSON.parse(c):f,[m,c,f]),T=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const M=await C(),I=await E(),V=await e.createAttachment({data:M,filename:"index.ts",contentType:"text/typescript"}),H=await e.createAttachment({data:I,filename:"index.js",contentType:"text/typescript"}),Z=[{op:"add",path:"/sourceCode",value:V},{op:"add",path:"/executableCode",value:H}];await e.patchResource("Bot",t,Z),Ne({color:"green",message:"Saved"})}catch(M){Ne({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,C,E]),_=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ne({color:"green",message:"Deployed"})}catch(M){Ne({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t]),P=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const M=await R(),I=await e.post(e.fhirUrl("Bot",t,"$execute"),M,m);await Gu(b.current,{command:"setValue",value:I}),Ne({color:"green",message:"Success"})}catch(M){Ne({color:"red",message:Ke(M),autoClose:!1})}finally{j(!1)}},[e,t,R,m]);return!n||i===void 0?null:a.jsxs(ir,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(ir.Col,{span:8,children:a.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Ite,{iframeRef:x,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:i,minHeight:"528px"}),a.jsxs(ye,{justify:"flex-end",gap:"xs",children:[a.jsx(ke,{type:"button",onClick:T,loading:w,leftSection:a.jsx(pH,{size:"1rem"}),children:"Save"}),a.jsx(ke,{type:"button",onClick:_,loading:w,leftSection:a.jsx(jb,{size:"1rem"}),children:"Deploy"}),a.jsx(ke,{type:"button",onClick:P,loading:w,leftSection:a.jsx(XH,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(ir.Col,{span:4,children:[a.jsxs(mr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(an,{data:[{label:"FHIR",value:un.FHIR_JSON},{label:"HL7",value:un.HL7_V2}],onChange:A=>g(A.currentTarget.value)}),m===un.FHIR_JSON?a.jsx(Pc,{value:c,onChange:A=>d(A),autosize:!0,minRows:15}):a.jsx("textarea",{className:Ote.hl7Input,value:f,onChange:A=>p(A.currentTarget.value),rows:15})]}),a.jsx(mr,{m:2,p:"xs",shadow:"md",children:a.jsx(Mte,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Ute(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(RD);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function ul(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Bte(){const e=De(),{resourceType:t,id:n}=Bt(),r={reference:t+"/"+n},i=v.useCallback(s=>{e.updateResource(ul(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Ke(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(lt,{children:a.jsx(XY,{value:r,onSubmit:i})});case"Questionnaire":return a.jsx(lt,{children:a.jsx(EK,{questionnaire:r,onSubmit:i})});default:return null}}function Vte(){const{resourceType:e,id:t}=Bt(),n=qt({reference:e+"/"+t}),r=xn();return n?a.jsx(lt,{children:a.jsx(XK,{value:n,onStart:(i,s)=>r(`/forms/${Vs(s)}`)?.catch(console.error),onEdit:(i,s,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function Fte(){const e=De(),{resourceType:t,id:n}=Bt(),r=xn();return a.jsxs(lt,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(ke,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(i=>Ne({color:"red",message:Ke(i),autoClose:!1}))},children:"Delete"})]})}const Hte="_selectProfileBtn_tbaz6_1",qte="_chevron_tbaz6_13",tR={selectProfileBtn:Hte,chevron:qte};function Gte(){const{resourceType:e,id:t}=Bt(),n=qt({reference:e+"/"+t}),[r,i]=v.useState(),s=vd({onDropdownClose:()=>s.resetSelectedOption()}),c=v.useMemo(()=>{if(Cn(n?.meta?.profile))return[a.jsx(st.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(st.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&i(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return Cn(c)&&(d=a.jsx(ye,{justify:"flex-end",children:a.jsxs(Ve,{align:"flex-end",gap:"xs",children:[a.jsxs(st,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{i(f),s.closeDropdown()},children:[a.jsx(st.Target,{children:a.jsx(er,{onClick:()=>s.toggleDropdown(),children:a.jsxs(x0,{fw:"bold",fs:"sm",className:tR.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(wb,{stroke:1.5,className:tR.chevron})]})})}),a.jsx(st.Dropdown,{w:"max-content",children:a.jsx(st.Options,{children:c})})]}),a.jsx(ce,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(Pe,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(Pe,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(Pe,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(lt,{children:a.jsxs(Ve,{gap:"xl",children:[d,a.jsx($b,{value:n,profileUrl:r})]})})}function Wte(){const e=De(),{resourceType:t,id:n}=Bt(),[r,i]=v.useState(),[s,c]=v.useState(),d=xn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{i(Qr(b)),c(Qr(b))}).catch(b=>{p(Ht(b)),Ne({color:"red",message:Ke(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(ul(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(Ht(w)),Ne({color:"red",message:Ke(w),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const w=XA.createPatch(r,b);e.patchResource(t,n,w).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Ht(j)),Ne({color:"red",message:Ke(j),autoClose:!1})})},[e,t,n,r,d]),x=v.useCallback(()=>d(`/${t}/${n}/delete`)?.catch(console.error),[d,t,n]);return s?a.jsx(lt,{children:a.jsx(np,{defaultValue:s,onSubmit:m,onPatch:g,onDelete:x,outcome:f})}):null}function Qte(){const{resourceType:e,id:t}=Bt(),n=qt({reference:e+"/"+t});return n?a.jsx(lt,{maw:700,children:n.resourceType==="Patient"?a.jsx(qY,{patient:n}):a.jsx(Ji,{icon:a.jsx(il,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function lk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,i=De(),[s,c]=v.useState();return v.useEffect(()=>{i.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(fW))}).catch(console.error)},[i,n,r]),a.jsx(zt,{value:t?.url,onChange:d=>{const f=s?.find(p=>p.url===d);f&&n(f)},children:a.jsx(zt.List,{children:s?.map(d=>{const f=e.meta?.profile?.includes(d.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(zt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(X0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(Dq,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function ck(e,t){const n=De(),r=xn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(Ht(d)),Ne({color:"red",message:Ke(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Sy(){const{resourceType:e}=Bt(),t=Or(),[n,r]=v.useState(),{defaultValue:i,handleSubmit:s}=ck(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=ul(m);c&&kD(g,c.url),s(g)},[c,s]);return f?a.jsx(lt,{children:a.jsxs(Ve,{children:[a.jsx(lk,{resource:i,currentProfile:c,onChange:d}),c?a.jsx(np,{defaultValue:i,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(Pe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(lt,{children:a.jsx(np,{defaultValue:i,onSubmit:s,outcome:n})})}function nR(){const e=De(),{resourceType:t,id:n}=Bt(),r=e.readHistory(t,n).read();return a.jsx(lt,{children:a.jsx(wX,{history:r})})}function Yte(){const{resourceType:e}=Bt(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:i}=ck(e,n),s=v.useCallback(c=>{i(JSON.parse(c["new-resource"]))},[i]);return a.jsxs(lt,{children:[t&&a.jsx(Nr,{outcome:t}),a.jsxs(dt,{onSubmit:s,children:[a.jsx(Pc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Lo(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"OK"})})]})]})}function Kte(){const e=De(),{resourceType:t,id:n}=Bt(),r=qt({reference:t+"/"+n}),i=xn(),[s,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(ul(JSON.parse(f.resource))).then(()=>{c(void 0),i(`/${t}/${n}/details`)?.catch(console.error),Ne({color:"green",message:"Success"})}).catch(p=>{Ne({color:"red",message:Ke(p),autoClose:!1})})},[e,t,n,i]);return r?a.jsxs(lt,{children:[s&&a.jsx(Nr,{outcome:s}),a.jsxs(dt,{onSubmit:d,children:[a.jsx(Pc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Lo(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(ye,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(ke,{type:"submit",children:"OK"})})]})]}):null}function Xte(){const{resourceType:e,id:t}=Bt();return qt({reference:e+"/"+t})?a.jsxs(lt,{children:[a.jsxs(Ji,{icon:a.jsx(il,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Dt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(gP,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Zte(){const e=De(),{resourceType:t,id:n}=Bt(),[r,i]=v.useState(),[s,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>i(Qr(d))).catch(d=>{Ne({color:"red",message:Ke(d)})})},[e,t,n]),r?a.jsxs(lt,{children:[a.jsxs(Ie,{order:2,children:["Available ",t," profiles"]}),a.jsx(Ve,{children:a.jsxs(a.Fragment,{children:[a.jsx(lk,{resource:r,currentProfile:s,onChange:c}),s?a.jsx(Jte,{profile:s,resource:r,onResourceUpdated:d=>i(d)},s.url):a.jsx(Pe,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const Jte=({profile:e,resource:t,onResourceUpdated:n})=>{const r=De(),[i,s]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{s(void 0);const m=ul(p);c?kD(m,e.url):vU(m,e.url),r.updateResource(m).then(g=>{n(g),Ne({color:"green",message:"Success"})}).catch(g=>{s(Ht(g)),Ne({color:"red",message:Ke(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Ve,{children:[a.jsx(Cd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(np,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:i}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"OK"})})})]})},uk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},ene=Object.keys(uk);function tne(){const e=De(),{id:t}=Bt(),n=qt({reference:`Questionnaire/${t}`}),[r,i]=v.useState(),[s,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>nne(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${kt(n)}`:kt(n)}`,channel:{type:"rest-hook",endpoint:kt(r)},...s?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:s}]}:void 0}).then(()=>{i(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Ke(g),autoClose:!1}))}return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Bots"}),a.jsxs(Ve,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(sl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(wn,{}),a.jsxs(Ve,{mt:10,children:[a.jsx(hd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(ye,{children:[a.jsx(al,{name:"bot",resourceType:"Bot",onChange:g=>i(g)}),a.jsx(ke,{onClick:m,children:"Connect"})]}),a.jsx(ye,{children:a.jsx(an,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:ene,onChange:g=>c(uk[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function nne(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(kt(t))||(t.url?n.includes(t.url):!1))}function rne(){const{id:e}=Bt(),t=xn(),r=De().readReference({reference:`Questionnaire/${e}`}).read(),[i,s]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ue.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return a.jsx(lt,{children:a.jsx(zc,{search:i,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>s(c.definition),hideFilters:!0,hideToolbar:!0})})}function one(){const e=De(),{resourceType:t,id:n}=Bt(),r=qt({reference:t+"/"+n}),i=v.useCallback(s=>{e.updateResource(ul(s)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Ke(c),autoClose:!1})})},[e]);return r?a.jsx(lt,{children:a.jsx(FK,{onSubmit:i,definition:r})}):null}function ine(){const{resourceType:e,id:t}=Bt(),n=qt({reference:e+"/"+t});return n?a.jsx(lt,{children:e==="MeasureReport"?a.jsx(FY,{measureReport:n}):a.jsx(Lb,{value:n})}):null}const ane="_container_1ue98_1",sne="_entry_1ue98_14",lne="_active_1ue98_21",wy={container:ane,entry:sne,active:lne};function cne(e){const t=De(),n=qt(e.value),[r,i]=v.useState();return v.useEffect(()=>{if(!n)return;const s=r1(n);if(!s)return;const c="reference"in s?s.reference:kt(s);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);ZA(p),p.reverse(),i(p)}).catch(d=>Ne({color:"red",message:Ke(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:wy.container,children:r.map(s=>a.jsxs("div",{className:It(wy.entry,{[wy.active]:s.id===n?.id}),children:[a.jsx("p",{children:a.jsx(gt,{to:s,children:une(s)})}),s.category?.[0]?.text&&a.jsx("p",{children:s.category[0]?.text}),s.code?.coding?.[0]?.code&&a.jsx("p",{children:s.code.coding[0]?.code}),a.jsx("p",{children:dne(s)})]},s.id))}):null}function une(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function dne(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const fne="_container_1l2dh_1",hne={container:fne};function pne(e){const t=qt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(i=>i.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:hne.container,children:a.jsx(an,{defaultValue:e.defaultValue,onChange:i=>e.onChange(i.currentTarget.value),data:n})})}function mne(e){const t=qt(e.specimen);return t?a.jsxs(ht,{children:[a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Type"}),a.jsx(ht.Value,{children:"Specimen"})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Collected"}),a.jsx(ht.Value,{children:sr(t.collection?.collectedDateTime)})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Age"}),a.jsx(ht.Value,{children:gne(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Stability"}),a.jsx(ht.Value,{children:vne(t)})]}):a.jsx(a.Fragment,{})]}):null}function gne(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return dk(fk(n,new Date))}function vne(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return dk(fk(t,n))}function dk(e){return e.toString().padStart(3,"0")+"D"}function fk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function yne(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 xne(){const e=De(),{resourceType:t,id:n}=Bt(),r={reference:t+"/"+n},i=xn(),[s,c]=v.useState(),d=qt(r,c),f=yne(t),[p,m]=v.useState(()=>{const R=window.location.pathname.split("/").pop();return R&&f.map(T=>T.toLowerCase()).includes(R)?R:f[0].toLowerCase()});async function g(){const T=(await e.readHistory(t,n)).entry?.find(_=>!!_.resource)?.resource;T?x(T):Ne({color:"red",message:"No history to restore",autoClose:!1})}function x(R){e.updateResource(ul(R)).then(()=>{c(void 0),Ne({color:"green",message:"Success"})}).catch(T=>{Ne({color:"red",message:Ke(T),autoClose:!1})})}if(s)return Rz(s)?a.jsxs(lt,{children:[a.jsx(Ie,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(ke,{color:"red",onClick:g,children:"Restore"})]}):a.jsx(Nr,{outcome:s});function b(R){R||(R=f[0].toLowerCase()),m(R),i(`/${t}/${n}/${R}`)?.catch(console.error)}function w(R){const T=d,_=T.orderDetail||[];_.length===0&&_.push({}),_[0].text!==R&&(_[0].text=R,x({...T,orderDetail:_}))}const j=d&&r1(d),C=d&&BJ(d),E=e.getUserConfiguration()?.option?.find(R=>R.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[d?.resourceType==="ServiceRequest"&&E&&a.jsx(pne,{valueSet:{reference:E},defaultValue:d.orderDetail?.[0]?.text,onChange:w},kt(d)+"-"+d.orderDetail?.[0]?.text),d&&a.jsx(cne,{value:d}),d&&a.jsxs(mr,{children:[j&&a.jsx(sP,{patient:j}),C&&a.jsx(mne,{specimen:C}),t!=="Patient"&&a.jsx(ok,{resource:r}),a.jsx(Kr,{children:a.jsx(zt,{value:p.toLowerCase(),onChange:b,children:a.jsx(zt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(R=>a.jsx(zt.Tab,{value:R.toLowerCase(),children:R},R))})})})]}),a.jsx(Jb,{})]})}function gh(){const e=xn(),{resourceType:t,id:n,versionId:r,tab:i}=Bt(),s=De(),[c,d]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),d(!0),s.readHistory(t,n).then(T=>p(T)).then(()=>d(!1)).catch(T=>{g(T),d(!1)})},[s,t,n]),c)return a.jsx(yo,{});const x=f?.entry??[],b=x.findIndex(T=>T.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Version not found"}),a.jsx(gt,{to:`/${t}/${n}`,children:"Return to resource"})]});const w=x[b].resource,j=b<x.length-1?x[b+1].resource:void 0,C="diff",E=i||C,R=x.length-b;return a.jsx(yd,{maw:1200,children:a.jsx(Lc,{children:a.jsxs(Ve,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(Yp,{cols:2,mb:"lg",children:[a.jsx(jo,{total:x.length,value:R,getControlProps:rP,onChange:T=>e(`/${t}/${n}/_history/${x[x.length-T]?.resource?.meta?.versionId}/${E}`)?.catch(console.error)}),a.jsx(ye,{justify:"right",children:a.jsx(jd,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:E,onChange:T=>e(`/${t}/${n}/_history/${r}/${T||C}`)?.catch(console.error)})})]}),a.jsx(ce,{mb:"lg",children:a.jsxs(dm,{compact:!0,children:[a.jsx(mo,{term:"Version ID",children:w.meta?.versionId}),a.jsx(mo,{term:"Author",children:a.jsx(uc,{value:w.meta?.author,link:!0},w.meta?.author?.reference)}),a.jsx(mo,{term:"Date/Time",children:sr(w.meta?.lastUpdated)})]})}),E==="diff"&&a.jsx(yX,{original:j??{resourceType:t,id:n},revised:w}),E==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(w,void 0,2)})]})})})}function bne(){const{resourceType:e,id:t}=Bt(),n=xn(),[r,i]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:ue.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(lt,{children:a.jsx(RY,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`)?.catch(console.error),onChange:s=>i(s.definition),hideFilters:!0})})}function Sne(e){const t=De(),{resource:n,opened:r,onClose:i}=e,[s,c]=v.useState(!1),[d,f]=v.useState(),[p,m]=v.useState(!1),g=v.useCallback(async()=>{if(n?.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&d?kt(d):void 0,verbose:p}),Ne({color:"green",message:"Done"}),i()}catch(x){Ne({color:"red",message:Ke(x),autoClose:!1})}},[t,n,i,s,d,p]);return a.jsx(Vn,{opened:r,onClose:i,title:"Resend Subscriptions",children:a.jsx(dt,{onSubmit:g,children:a.jsxs(Ve,{children:[a.jsx(Un,{label:"Choose subscription (all subscriptions by default)",onChange:x=>c(x.currentTarget.checked)}),s&&a.jsx(al,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(Un,{label:"Verbose mode",onChange:x=>m(x.currentTarget.checked)}),a.jsx(ye,{justify:"flex-end",children:a.jsx(ke,{type:"submit",children:"Resend"})})]})})})}function rR(){const e=De(),t=sm(),{resourceType:n,id:r}=Bt(),i={reference:n+"/"+r},[s,c]=v.useState(),d=fp(!1);function f(R,T){return e.updateResource({...R,priority:T})}function p(R,T){f(R,"stat").then(T).catch(console.error)}function m(R,T){f(R,"routine").then(T).catch(console.error)}function g(R){t(`/${R.resourceType}/${R.id}`)}function x(R){t(`/${R.resourceType}/${R.id}/edit`)}function b(R){t(`/${R.resourceType}/${R.id}/delete`)}function w(R){c(R),d[1].open()}function j(R){t(`/${R.resourceType}/${R.id}/_history/${R.meta?.versionId}`)}function C(R,T){const _="aws-textract";Ne({id:_,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(()=>{T(),As({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(oa,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(P=>As({id:_,title:"AWS Textract Error",color:"red",message:Ke(P),icon:a.jsx(Gs,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function E(R){const{primaryResource:T,currentResource:_,reloadTimeline:P}=R,A=_.resourceType===T.resourceType&&_.id===T.id,M=_.resourceType==="Communication"&&_.priority!=="stat",I=_.resourceType==="Communication"&&_.priority==="stat",V=A,H=!A,Z=!A,K=!A,Q=e.getProjectMembership()?.admin,B=Q,W=jte()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(Ce.Dropdown,{children:[a.jsx(Ce.Label,{children:"Resource"}),M&&a.jsx(Ce.Item,{leftSection:a.jsx(WH,{size:14}),onClick:()=>p(_,P),"aria-label":`Pin ${kt(_)}`,children:"Pin"}),I&&a.jsx(Ce.Item,{leftSection:a.jsx(YH,{size:14}),onClick:()=>m(_,P),"aria-label":`Unpin ${kt(_)}`,children:"Unpin"}),H&&a.jsx(Ce.Item,{leftSection:a.jsx(UE,{size:14}),onClick:()=>g(_),"aria-label":`Details ${kt(_)}`,children:"Details"}),V&&a.jsx(Ce.Item,{leftSection:a.jsx(UE,{size:14}),onClick:()=>j(_),"aria-label":`Details ${kt(_)}`,children:"Details"}),Z&&a.jsx(Ce.Item,{leftSection:a.jsx(pA,{size:14}),onClick:()=>x(_),"aria-label":`Edit ${kt(_)}`,children:"Edit"}),Q&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"Admin"}),B&&a.jsx(Ce.Item,{leftSection:a.jsx(rq,{size:14}),onClick:()=>w(_),"aria-label":`Resend Subscriptions ${kt(_)}`,children:"Resend Subscriptions"})]}),W&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"AWS AI"}),a.jsx(Ce.Item,{leftSection:a.jsx(wq,{size:14}),onClick:()=>C(_,P),"aria-label":`AWS Textract ${kt(_)}`,children:"AWS Textract"})]}),K&&a.jsxs(a.Fragment,{children:[a.jsx(Ce.Divider,{}),a.jsx(Ce.Label,{children:"Danger zone"}),a.jsx(Ce.Item,{color:"red",leftSection:a.jsx(cm,{size:14}),onClick:()=>b(_),"aria-label":`Delete ${kt(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(MQ,{encounter:i,getMenu:E}),n==="Patient"&&a.jsx(QY,{patient:i,getMenu:E}),n==="ServiceRequest"&&a.jsx(EX,{serviceRequest:i,getMenu:E}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(OQ,{resource:i,getMenu:E}),a.jsx(Sne,{resource:s,opened:d[0],onClose:d[1].close},`resend-subscriptions-${s?.id}`)]})}function wne(e){const{opened:t,close:n,version:r,loadingStatus:i,handleStatus:s,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||QV("app-tools-page").then(f).catch(console.error),s())},[t,d,s]),d&&r&&!i?r==="unknown"?a.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(d)?a.jsxs("p",{children:["This agent is already on the latest version (",d,")."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",d,"?"]}),a.jsxs(ye,{children:[a.jsx(ke,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx(Un,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(yo,{})}function jne(){const e=De(),{id:t}=Bt(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,i]=v.useState(!1),[s,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(),[g,x]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState(),[E,R]=v.useState(!1),[T,_]=v.useState(!1),[P,{open:A,close:M}]=fp(!1);v.useEffect(()=>{if(r||s||d||E){_(!0);return}_(!1)},[r,s,d,E]);const I=v.useCallback(()=>{i(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(B=>{m(B.parameter?.find(W=>W.name==="status")?.valueCode),x(B.parameter?.find(W=>W.name==="version")?.valueString),w(B.parameter?.find(W=>W.name==="lastUpdated")?.valueInstant)}).catch(B=>Q(Ke(B))).finally(()=>i(!1))},[e,t]),V=v.useCallback(B=>{const W=B.host,N=B.pingCount||1;W&&(R(!0),e.pushToAgent(n,W,`PING ${N}`,un.PING,!0).then(L=>C(L)).catch(L=>Q(Ke(L))).finally(()=>R(!1)))},[e,n]),H=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(B=>{K("Agent config reloaded successfully.")}).catch(B=>Q(Ke(B))).finally(()=>c(!1))},[e,t]),Z=v.useCallback(B=>{f(!0),e.get(e.fhirUrl("Agent",t,"$upgrade",`?force=${B}`),{cache:"reload"}).then(W=>{K("Agent upgraded successfully.")}).catch(W=>Q(Ke(W))).finally(()=>f(!1))},[e,t]);function K(B){Ne({color:"green",title:"Success",icon:a.jsx(oa,{size:"1rem"}),message:B})}function Q(B){Ne({color:"red",title:"Error",message:B,autoClose:!1})}return a.jsxs(lt,{children:[a.jsx(Vn,{opened:P,onClose:M,title:"Upgrade Agent",centered:!0,children:a.jsx(wne,{opened:P,close:M,version:g,loadingStatus:r,handleStatus:I,handleUpgrade:Z})}),a.jsx(Ie,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(sl,{value:n,link:!0})]}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Agent Status"}),a.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),a.jsx(ke,{onClick:I,loading:r,disabled:T&&!r,children:"Get Status"}),!r&&p&&a.jsx(ve,{children:a.jsxs(ve.Tbody,{children:[a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:"Status"}),a.jsx(ve.Td,{children:a.jsx(pm,{status:p})})]}),a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:"Version"}),a.jsx(ve.Td,{children:g})]}),a.jsxs(ve.Tr,{children:[a.jsx(ve.Td,{children:"Last Updated"}),a.jsx(ve.Td,{children:sr(b,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Reload Config"}),a.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),a.jsx(ke,{onClick:H,loading:s,disabled:T&&!s,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Upgrade Agent"}),a.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),a.jsx(ke,{onClick:A,loading:d,disabled:T&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(wn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),a.jsx(dt,{onSubmit:V,children:a.jsxs(ye,{children:[a.jsx(ze,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(_n,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:E,disabled:T&&!E,children:a.jsx(sq,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Vp,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!E&&j&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:j})]})]})}function Cne(){const e=xn(),t=De(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(s=>Ne({color:"red",message:Ke(s),autoClose:!1}))},[t]);function i(s){t.post("auth/revoke",{loginId:s}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ne({color:"green",message:"Login revoked"})).catch(c=>Ne({color:"red",message:Ke(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(lt,{children:[a.jsx(Ie,{children:"Security"}),a.jsxs(dm,{children:[a.jsx(mo,{term:"ID",children:a.jsx(Dt,{href:`/${kt(n.profile)}`,children:n.profile.id})}),a.jsx(mo,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(mo,{term:"Name",children:Ic(n.profile.name?.[0])})]})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Sessions"}),a.jsxs(ve,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(s=>a.jsxs("tr",{children:[a.jsx("td",{children:s.os}),a.jsx("td",{children:s.browser}),a.jsx("td",{children:s.remoteAddress}),a.jsx("td",{children:s.authMethod}),a.jsx("td",{children:sr(s.lastUpdated)}),a.jsx("td",{children:a.jsx(Dt,{href:"#",onClick:()=>i(s.id),children:"Revoke"})})]},s.id))})]})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Password"}),a.jsx(ke,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(ke,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function Ene(){const{id:e,secret:t}=Bt(),n=De(),[r,i]=v.useState(),[s,c]=v.useState(!1),d=$c(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(Nr,{issues:d}),a.jsxs(dt,{onSubmit:f=>{if(f.password!==f.confirmPassword){i(oi("Passwords do not match","confirmPassword"));return}i(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>i(Ht(m)))},children:[a.jsxs(Yn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Set password"})]}),!s&&a.jsxs(Ve,{children:[a.jsx(Oo,{name:"password",label:"New password",required:!0,error:At(r,"password")}),a.jsx(Oo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:At(r,"confirmPassword")}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Set password"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(gt,{to:"/signin",children:"sign in"}),"."]})]})]})}function Tne(){const e=lm(),t=xn(),[n]=n1(),r=Bd(),i=v.useCallback(()=>{const s=n.get("next");t(s?.startsWith("/")?s:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&i()},[e,n,i]),a.jsxs(OA,{onSuccess:()=>i(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:ak()?()=>t("/register")?.catch(console.error):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Sign in to Medplum"}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function Rne(){const e=xn(),t=Or(),[n,r]=v.useState(),[i,s]=v.useState(),[c,d]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),s(f.query),d(JSON.parse(f.fields))},[t]),!n||!i||!c?null:a.jsx(NY,{resourceType:n,checkboxesEnabled:!0,query:i,fields:c,onClick:f=>e(`/${n}/${f.resource.id}`)?.catch(console.error),onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{e(`/bulk/${n}?ids=${f.join(",")}`)?.catch(console.error)}})}function _ne(){const{id:e,secret:t}=Bt(),n=De(),[r,i]=v.useState(),[s,c]=v.useState(!1),d=$c(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(Nr,{issues:d}),a.jsxs(dt,{onSubmit:()=>{i(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>i(Ht(p)))},children:[a.jsxs(Yn,{style:{flexDirection:"column"},children:[a.jsx(Co,{size:32}),a.jsx(Ie,{children:"Email address verification required"})]}),!s&&a.jsxs(Ve,{children:[a.jsx("p",{children:"In order to sign in, click the button below to verify your ability to receive email at the address this link was sent to."}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(ke,{type:"submit",children:"Verify email"})})]}),s&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(gt,{to:"/signin",children:"sign in"}),"."]})]})]})}function Dne(){return a.jsx(iJ,{children:a.jsxs(Le,{errorElement:a.jsx(lte,{}),children:[a.jsx(Le,{path:"/signin",element:a.jsx(Tne,{})}),a.jsx(Le,{path:"/oauth",element:a.jsx(Cte,{})}),a.jsx(Le,{path:"/resetpassword",element:a.jsx(Tte,{})}),a.jsx(Le,{path:"/setpassword/:id/:secret",element:a.jsx(Ene,{})}),a.jsx(Le,{path:"/verifyemail/:id/:secret",element:a.jsx(_ne,{})}),a.jsx(Le,{path:"/register",element:a.jsx(Ete,{})}),a.jsx(Le,{path:"/changepassword",element:a.jsx(ite,{})}),a.jsx(Le,{path:"/security",element:a.jsx(Cne,{})}),a.jsx(Le,{path:"/mfa",element:a.jsx(Ste,{})}),a.jsx(Le,{path:"/batch",element:a.jsx(rte,{})}),a.jsx(Le,{path:"/bulk/:resourceType",element:a.jsx(ote,{})}),a.jsx(Le,{path:"/smart",element:a.jsx(Rne,{})}),a.jsx(Le,{path:"/forms/:id",element:a.jsx(cte,{})}),a.jsx(Le,{path:"/admin/super",element:a.jsx(aee,{})}),a.jsx(Le,{path:"/admin/super/asyncjob",element:a.jsx(eee,{})}),a.jsx(Le,{path:"/admin/config",element:a.jsx(KJ,{})}),a.jsxs(Le,{path:"/admin",element:a.jsx(XJ,{}),children:[a.jsx(Le,{path:"patients",element:a.jsx(YJ,{})}),a.jsx(Le,{path:"bots/new",element:a.jsx(HJ,{})}),a.jsx(Le,{path:"bots",element:a.jsx(VJ,{})}),a.jsx(Le,{path:"clients/new",element:a.jsx(qJ,{})}),a.jsx(Le,{path:"clients",element:a.jsx(FJ,{})}),a.jsx(Le,{path:"details",element:a.jsx(zT,{})}),a.jsx(Le,{path:"invite",element:a.jsx(QJ,{})}),a.jsx(Le,{path:"users",element:a.jsx(lee,{})}),a.jsx(Le,{path:"project",element:a.jsx(zT,{})}),a.jsx(Le,{path:"secrets",element:a.jsx(ZJ,{})}),a.jsx(Le,{path:"sites",element:a.jsx(JJ,{})}),a.jsx(Le,{path:"members/:membershipId",element:a.jsx(WJ,{})})]}),a.jsx(Le,{path:"/lab/assays",element:a.jsx(xte,{})}),a.jsx(Le,{path:"/lab/panels",element:a.jsx(bte,{})}),a.jsxs(Le,{path:"/:resourceType/new",element:a.jsx(ste,{}),children:[a.jsx(Le,{index:!0,element:a.jsx(Sy,{})}),a.jsx(Le,{path:"form",element:a.jsx(Sy,{})}),a.jsx(Le,{path:"json",element:a.jsx(Yte,{})}),a.jsx(Le,{path:"profiles",element:a.jsx(Sy,{})})]}),a.jsxs(Le,{path:"/:resourceType/:id",element:a.jsx(xne,{}),children:[a.jsx(Le,{index:!0,element:a.jsx(rR,{})}),a.jsx(Le,{path:"apply",element:a.jsx(_te,{})}),a.jsx(Le,{path:"apps",element:a.jsx(Dte,{})}),a.jsx(Le,{path:"event",element:a.jsx(Pte,{})}),a.jsx(Le,{path:"blame",element:a.jsx(kte,{})}),a.jsx(Le,{path:"bots",element:a.jsx(tne,{})}),a.jsx(Le,{path:"builder",element:a.jsx(Bte,{})}),a.jsx(Le,{path:"checklist",element:a.jsx(Vte,{})}),a.jsx(Le,{path:"delete",element:a.jsx(Fte,{})}),a.jsx(Le,{path:"details",element:a.jsx(Gte,{})}),a.jsx(Le,{path:"edit",element:a.jsx(Wte,{})}),a.jsx(Le,{path:"editor",element:a.jsx(zte,{})}),a.jsxs(Le,{path:"history",children:[a.jsx(Le,{index:!0,element:a.jsx(nR,{})}),a.jsx(Le,{path:":versionId/:tab",element:a.jsx(gh,{})}),a.jsx(Le,{path:":versionId",element:a.jsx(gh,{})})]}),a.jsxs(Le,{path:"_history",children:[a.jsx(Le,{index:!0,element:a.jsx(nR,{})}),a.jsx(Le,{path:":versionId/:tab",element:a.jsx(gh,{})}),a.jsx(Le,{path:":versionId",element:a.jsx(gh,{})})]}),a.jsx(Le,{path:"json",element:a.jsx(Kte,{})}),a.jsx(Le,{path:"preview",element:a.jsx(Xte,{})}),a.jsx(Le,{path:"responses",element:a.jsx(rne,{})}),a.jsx(Le,{path:"report",element:a.jsx(ine,{})}),a.jsx(Le,{path:"ranges",element:a.jsx(one,{})}),a.jsx(Le,{path:"subscriptions",element:a.jsx(bne,{})}),a.jsx(Le,{path:"timeline",element:a.jsx(rR,{})}),a.jsx(Le,{path:"tools",element:a.jsx(jne,{})}),a.jsx(Le,{path:"profiles",element:a.jsx(Zte,{})}),a.jsx(Le,{path:"export",element:a.jsx(Qte,{})})]}),a.jsx(Le,{path:"/:resourceType",element:a.jsx(JT,{})}),a.jsx(Le,{path:"/",element:a.jsx(JT,{})})]})})}function Ane(){const e=De(),t=e.getUserConfiguration(),n=Or(),[r]=n1();return e.isLoading()?a.jsx(yo,{}):a.jsx(SG,{logo:a.jsx(Co,{size:24}),pathname:n.pathname,searchParams:r,version:YD,menus:Pne(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(yo,{}),children:a.jsx(Dne,{})})})}function Pne(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:kne(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(NH,{})}]}),t}const oR={Patient:gq,Practitioner:_H,Organization:XF,ServiceRequest:eq,DiagnosticReport:iq,Questionnaire:TH,admin:qF,AccessPolicy:PH,Subscription:Tq,batch:qH,Observation:BH};function kne(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in oR){const n=oR[t];return a.jsx(n,{})}}catch{}return a.jsx(Kp,{w:30})}async function Nne(){const e=Bd(),t=new KD({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=DJ([{path:"*",element:a.jsx(Ane,{})}]),i=c=>r.navigate(c);PX.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(YV,{medplum:t,navigate:i,children:a.jsxs(DR,{theme:n,children:[a.jsx(na,{position:"bottom-right"}),a.jsx(tJ,{router:r})]})})}))}Nne().catch(console.error);
589
+ //# sourceMappingURL=index-i6KQ4Bzn.js.map