@medplum/app 4.5.2 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,607 +0,0 @@
1
- function F3(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Ox(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fv={exports:{}},Hu={};/**
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 dC;function H3(){if(dC)return Hu;dC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:l}}return Hu.Fragment=t,Hu.jsx=n,Hu.jsxs=n,Hu}var fC;function q3(){return fC||(fC=1,Fv.exports=H3()),Fv.exports}var a=q3(),mo=function(){return mo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},mo.apply(this,arguments)};function DR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function G3(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,l;r<o;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var Hv={exports:{}},dt={};/**
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 hC;function Q3(){if(hC)return dt;hC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=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.for("react.activity"),x=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function T(L,q,ie){this.props=L,this.context=q,this.refs=C,this.updater=ie||w}T.prototype.isReactComponent={},T.prototype.setState=function(L,q){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,q,"setState")},T.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function E(){}E.prototype=T.prototype;function R(L,q,ie){this.props=L,this.context=q,this.refs=C,this.updater=ie||w}var D=R.prototype=new E;D.constructor=R,j(D,T.prototype),D.isPureReactComponent=!0;var P=Array.isArray;function A(){}var k={H:null,A:null,T:null,S:null},M=Object.prototype.hasOwnProperty;function $(L,q,ie){var xe=ie.ref;return{$$typeof:e,type:L,key:q,ref:xe!==void 0?xe:null,props:ie}}function U(L,q){return $(L.type,q,L.props)}function J(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function Z(L){var q={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(ie){return q[ie]})}var Y=/\/+/g;function H(L,q){return typeof L=="object"&&L!==null&&L.key!=null?Z(""+L.key):q.toString(36)}function Q(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(A,A):(L.status="pending",L.then(function(q){L.status==="pending"&&(L.status="fulfilled",L.value=q)},function(q){L.status==="pending"&&(L.status="rejected",L.reason=q)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function O(L,q,ie,xe,ve){var Ce=typeof L;(Ce==="undefined"||Ce==="boolean")&&(L=null);var Oe=!1;if(L===null)Oe=!0;else switch(Ce){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(L.$$typeof){case e:case t:Oe=!0;break;case m:return Oe=L._init,O(Oe(L._payload),q,ie,xe,ve)}}if(Oe)return ve=ve(L),Oe=xe===""?"."+H(L,0):xe,P(ve)?(ie="",Oe!=null&&(ie=Oe.replace(Y,"$&/")+"/"),O(ve,q,ie,"",function(it){return it})):ve!=null&&(J(ve)&&(ve=U(ve,ie+(ve.key==null||L&&L.key===ve.key?"":(""+ve.key).replace(Y,"$&/")+"/")+Oe)),q.push(ve)),1;Oe=0;var Ee=xe===""?".":xe+":";if(P(L))for(var Ge=0;Ge<L.length;Ge++)xe=L[Ge],Ce=Ee+H(xe,Ge),Oe+=O(xe,q,ie,Ce,ve);else if(Ge=b(L),typeof Ge=="function")for(L=Ge.call(L),Ge=0;!(xe=L.next()).done;)xe=xe.value,Ce=Ee+H(xe,Ge++),Oe+=O(xe,q,ie,Ce,ve);else if(Ce==="object"){if(typeof L.then=="function")return O(Q(L),q,ie,xe,ve);throw q=String(L),Error("Objects are not valid as a React child (found: "+(q==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":q)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function I(L,q,ie){if(L==null)return L;var xe=[],ve=0;return O(L,xe,"","",function(Ce){return q.call(ie,Ce,ve++)}),xe}function z(L){if(L._status===-1){var q=L._result;q=q(),q.then(function(ie){(L._status===0||L._status===-1)&&(L._status=1,L._result=ie)},function(ie){(L._status===0||L._status===-1)&&(L._status=2,L._result=ie)}),L._status===-1&&(L._status=0,L._result=q)}if(L._status===1)return L._result.default;throw L._result}var F=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},K={map:I,forEach:function(L,q,ie){I(L,function(){q.apply(this,arguments)},ie)},count:function(L){var q=0;return I(L,function(){q++}),q},toArray:function(L){return I(L,function(q){return q})||[]},only:function(L){if(!J(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return dt.Activity=g,dt.Children=K,dt.Component=T,dt.Fragment=n,dt.Profiler=o,dt.PureComponent=R,dt.StrictMode=r,dt.Suspense=f,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,dt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return k.H.useMemoCache(L)}},dt.cache=function(L){return function(){return L.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(L,q,ie){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var xe=j({},L.props),ve=L.key;if(q!=null)for(Ce in q.key!==void 0&&(ve=""+q.key),q)!M.call(q,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&q.ref===void 0||(xe[Ce]=q[Ce]);var Ce=arguments.length-2;if(Ce===1)xe.children=ie;else if(1<Ce){for(var Oe=Array(Ce),Ee=0;Ee<Ce;Ee++)Oe[Ee]=arguments[Ee+2];xe.children=Oe}return $(L.type,ve,xe)},dt.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:l,_context:L},L},dt.createElement=function(L,q,ie){var xe,ve={},Ce=null;if(q!=null)for(xe in q.key!==void 0&&(Ce=""+q.key),q)M.call(q,xe)&&xe!=="key"&&xe!=="__self"&&xe!=="__source"&&(ve[xe]=q[xe]);var Oe=arguments.length-2;if(Oe===1)ve.children=ie;else if(1<Oe){for(var Ee=Array(Oe),Ge=0;Ge<Oe;Ge++)Ee[Ge]=arguments[Ge+2];ve.children=Ee}if(L&&L.defaultProps)for(xe in Oe=L.defaultProps,Oe)ve[xe]===void 0&&(ve[xe]=Oe[xe]);return $(L,Ce,ve)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(L){return{$$typeof:d,render:L}},dt.isValidElement=J,dt.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:z}},dt.memo=function(L,q){return{$$typeof:p,type:L,compare:q===void 0?null:q}},dt.startTransition=function(L){var q=k.T,ie={};k.T=ie;try{var xe=L(),ve=k.S;ve!==null&&ve(ie,xe),typeof xe=="object"&&xe!==null&&typeof xe.then=="function"&&xe.then(A,F)}catch(Ce){F(Ce)}finally{q!==null&&ie.types!==null&&(q.types=ie.types),k.T=q}},dt.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},dt.use=function(L){return k.H.use(L)},dt.useActionState=function(L,q,ie){return k.H.useActionState(L,q,ie)},dt.useCallback=function(L,q){return k.H.useCallback(L,q)},dt.useContext=function(L){return k.H.useContext(L)},dt.useDebugValue=function(){},dt.useDeferredValue=function(L,q){return k.H.useDeferredValue(L,q)},dt.useEffect=function(L,q){return k.H.useEffect(L,q)},dt.useEffectEvent=function(L){return k.H.useEffectEvent(L)},dt.useId=function(){return k.H.useId()},dt.useImperativeHandle=function(L,q,ie){return k.H.useImperativeHandle(L,q,ie)},dt.useInsertionEffect=function(L,q){return k.H.useInsertionEffect(L,q)},dt.useLayoutEffect=function(L,q){return k.H.useLayoutEffect(L,q)},dt.useMemo=function(L,q){return k.H.useMemo(L,q)},dt.useOptimistic=function(L,q){return k.H.useOptimistic(L,q)},dt.useReducer=function(L,q,ie){return k.H.useReducer(L,q,ie)},dt.useRef=function(L){return k.H.useRef(L)},dt.useState=function(L){return k.H.useState(L)},dt.useSyncExternalStore=function(L,q,ie){return k.H.useSyncExternalStore(L,q,ie)},dt.useTransition=function(){return k.H.useTransition()},dt.version="19.2.0",dt}var pC;function Mx(){return pC||(pC=1,Hv.exports=Q3()),Hv.exports}var v=Mx();const Tn=Ox(v),W3=F3({__proto__:null,default:Tn},[v]);var Ph="right-scroll-bar-position",kh="width-before-scroll-bar",Y3="with-scroll-bars-hidden",K3="--removed-body-scroll-bar-size";function qv(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function X3(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Z3=typeof window<"u"?v.useLayoutEffect:v.useEffect,mC=new WeakMap;function J3(e,t){var n=X3(null,function(r){return e.forEach(function(o){return qv(o,r)})});return Z3(function(){var r=mC.get(n);if(r){var o=new Set(r),l=new Set(e),c=n.current;o.forEach(function(d){l.has(d)||qv(d,null)}),l.forEach(function(d){o.has(d)||qv(d,c)})}mC.set(n,e)},[e]),n}function eO(e){return e}function tO(e,t){t===void 0&&(t=eO);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var m=c;c=[],m.forEach(l)},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 o}function nO(e){e===void 0&&(e={});var t=tO(null);return t.options=mo({async:!0,ssr:!1},e),t}var AR=function(e){var t=e.sideCar,n=DR(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,mo({},n))};AR.isSideCarExport=!0;function rO(e,t){return e.useMedium(t),AR}var PR=nO(),Gv=function(){},Ep=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:Gv,onWheelCapture:Gv,onTouchMoveCapture:Gv}),o=r[0],l=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,T=e.as,E=T===void 0?"div":T,R=e.gapMode,D=DR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=x,A=J3([n,t]),k=mo(mo({},D),o);return v.createElement(v.Fragment,null,m&&v.createElement(P,{sideCar:PR,removeScrollBar:p,shards:g,noRelative:b,noIsolation:w,inert:j,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),c?v.cloneElement(v.Children.only(d),mo(mo({},k),{ref:A})):v.createElement(E,mo({},k,{className:f,ref:A}),d))});Ep.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ep.classNames={fullWidth:kh,zeroRight:Ph};var iO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function oO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=iO();return t&&e.setAttribute("nonce",t),e}function aO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function sO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var lO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=oO())&&(aO(t,n),sO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},cO=function(){var e=lO();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},kR=function(){var e=cO(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},uO={left:0,top:0,right:0,gap:0},Qv=function(e){return parseInt(e||"",10)||0},dO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Qv(n),Qv(r),Qv(o)]},fO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return uO;var t=dO(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])}},hO=kR(),wc="data-scroll-locked",pO=function(e,t,n,r){var o=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
18
- .`.concat(Y3,` {
19
- overflow: hidden `).concat(r,`;
20
- padding-right: `).concat(d,"px ").concat(r,`;
21
- }
22
- body[`).concat(wc,`] {
23
- overflow: hidden `).concat(r,`;
24
- overscroll-behavior: contain;
25
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
- padding-left: `.concat(o,`px;
27
- padding-top: `).concat(l,`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(Ph,` {
36
- right: `).concat(d,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(kh,` {
40
- margin-right: `).concat(d,"px ").concat(r,`;
41
- }
42
-
43
- .`).concat(Ph," .").concat(Ph,` {
44
- right: 0 `).concat(r,`;
45
- }
46
-
47
- .`).concat(kh," .").concat(kh,` {
48
- margin-right: 0 `).concat(r,`;
49
- }
50
-
51
- body[`).concat(wc,`] {
52
- `).concat(K3,": ").concat(d,`px;
53
- }
54
- `)},gC=function(){var e=parseInt(document.body.getAttribute(wc)||"0",10);return isFinite(e)?e:0},mO=function(){v.useEffect(function(){return document.body.setAttribute(wc,(gC()+1).toString()),function(){var e=gC()-1;e<=0?document.body.removeAttribute(wc):document.body.setAttribute(wc,e.toString())}},[])},gO=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;mO();var l=v.useMemo(function(){return fO(o)},[o]);return v.createElement(hO,{styles:pO(l,!t,o,n?"":"!important")})},Vy=!1;if(typeof window<"u")try{var fh=Object.defineProperty({},"passive",{get:function(){return Vy=!0,!0}});window.addEventListener("test",fh,fh),window.removeEventListener("test",fh,fh)}catch{Vy=!1}var lc=Vy?{passive:!1}:!1,vO=function(e){return e.tagName==="TEXTAREA"},NR=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!vO(e)&&n[t]==="visible")},yO=function(e){return NR(e,"overflowY")},xO=function(e){return NR(e,"overflowX")},vC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=OR(e,r);if(o){var l=MR(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bO=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},SO=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},OR=function(e,t){return e==="v"?yO(t):xO(t)},MR=function(e,t){return e==="v"?bO(t):SO(t)},wO=function(e,t){return e==="h"&&t==="rtl"?-1:1},jO=function(e,t,n,r,o){var l=wO(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),p=!1,m=c>0,g=0,x=0;do{if(!d)break;var b=MR(e,d),w=b[0],j=b[1],C=b[2],T=j-C-l*w;(w||T)&&OR(e,d)&&(g+=T,x+=w);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}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},hh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},yC=function(e){return[e.deltaX,e.deltaY]},xC=function(e){return e&&"current"in e?e.current:e},CO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},EO=function(e){return`
55
- .block-interactivity-`.concat(e,` {pointer-events: none;}
56
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},TO=0,cc=[];function RO(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(TO++)[0],l=v.useState(kR)[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(o));var j=G3([e.lockRef.current],(e.shards||[]).map(xC),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[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 T=hh(j),E=n.current,R="deltaX"in j?j.deltaX:E[0]-T[0],D="deltaY"in j?j.deltaY:E[1]-T[1],P,A=j.target,k=Math.abs(R)>Math.abs(D)?"h":"v";if("touches"in j&&k==="h"&&A.type==="range")return!1;var M=vC(k,A);if(!M)return!0;if(M?P=k:(P=k==="v"?"h":"v",M=vC(k,A)),!M)return!1;if(!r.current&&"changedTouches"in j&&(R||D)&&(r.current=P),!P)return!0;var $=r.current||P;return jO($,C,j,$==="h"?R:D)},[]),f=v.useCallback(function(j){var C=j;if(!(!cc.length||cc[cc.length-1]!==l)){var T="deltaY"in C?yC(C):hh(C),E=t.current.filter(function(P){return P.name===C.type&&(P.target===C.target||C.target===P.shadowParent)&&CO(P.delta,T)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(c.current.shards||[]).map(xC).filter(Boolean).filter(function(P){return P.contains(C.target)}),D=R.length>0?d(C,R[0]):!c.current.noIsolation;D&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,T,E){var R={name:j,delta:C,target:T,should:E,shadowParent:_O(T)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(D){return D!==R})},1)},[]),m=v.useCallback(function(j){n.current=hh(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,yC(j),j.target,d(j,e.lockRef.current))},[]),x=v.useCallback(function(j){p(j.type,hh(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return cc.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:x}),document.addEventListener("wheel",f,lc),document.addEventListener("touchmove",f,lc),document.addEventListener("touchstart",m,lc),function(){cc=cc.filter(function(j){return j!==l}),document.removeEventListener("wheel",f,lc),document.removeEventListener("touchmove",f,lc),document.removeEventListener("touchstart",m,lc)}},[]);var b=e.removeScrollBar,w=e.inert;return v.createElement(v.Fragment,null,w?v.createElement(l,{styles:EO(o)}):null,b?v.createElement(gO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _O(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DO=rO(PR,RO);var _c=v.forwardRef(function(e,t){return v.createElement(Ep,mo({},e,{ref:t,sideCar:DO}))});_c.classNames=Ep.classNames;function rn(e){return Object.keys(e)}function Wv(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Lx(e,t){const n={...e},r=t;return Wv(e)&&Wv(t)&&Object.keys(t).forEach(o=>{Wv(r[o])&&o in e?n[o]=Lx(n[o],r[o]):n[o]=r[o]}),n}function AO(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function PO(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function od(e){const t=PO(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 Yv(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function LR(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?Yv(o):o}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(l=>n(l)).join(",");if(r.includes(" "))return r.split(" ").map(l=>n(l)).join(" ");if(r.includes(e))return t?Yv(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const l=`${Number(o)/16}${e}`;return t?Yv(l):l}}return r}return n}const le=LR("rem",{shouldScale:!0}),Hh=LR("em");function ds(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function IR(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 fa(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function Rr(e){const t=v.createContext(null);return[({children:o,value:l})=>a.jsx(t.Provider,{value:l,children:o}),()=>{const o=v.useContext(t);if(o===null)throw new Error(e);return o}]}function ha(e=null){const t=v.createContext(e);return[({children:o,value:l})=>a.jsx(t.Provider,{value:l,children:o}),()=>v.useContext(t)]}function bC(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function qh(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function kO(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 NO(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 OO(e,t,n){return qh(e,n)===qh(t,n)}function zR({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:l="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from(qh(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(w=>OO(d.currentTarget,w,e)),p=f.findIndex(w=>d.currentTarget===w),m=NO(p,f,r),g=kO(p,f,r),x=l==="rtl"?g:m,b=l==="rtl"?m:g;switch(d.key){case"ArrowRight":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[x].focus(),o&&f[x].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[b].focus(),o&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),o&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),o&&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 MO={app:100,modal:200,popover:300,overlay:400,max:9999};function oi(e){return MO[e]}const Gh=()=>{};function LO(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Gh:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function at(e,t="size",n=!0){if(e!==void 0)return IR(e)?n?le(e):e:`var(--${t}-${e})`}function Ln(e){return at(e,"mantine-spacing")}function $t(e){return e===void 0?"var(--mantine-radius-default)":at(e,"mantine-radius")}function In(e){return at(e,"mantine-font-size")}function $R(e){return at(e,"mantine-line-height",!1)}function Ix(e){if(e)return at(e,"mantine-shadow",!1)}function Ur(e,t){return n=>{e?.(n),t?.(n)}}function zx(e,t){return e in t?od(t[e]):od(e)}function ad(e,t){const n=e.map(r=>({value:r,px:zx(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Hi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function IO(e,t,n){return n?Array.from(qh(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function zO(){const[e,t]=v.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Nh(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 Qh(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function $O(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 o=0;o<r;o+=1){const l=n[o];if(!(l in t)||e[l]!==t[l]&&!(Number.isNaN(e[l])&&Number.isNaN(t[l])))return!1}return!0}function SC(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Fs(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...n)=>t.current?.(...n),[])}function Tp(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,o=Fs(e),l=v.useRef(0),c=v.useRef(()=>{}),d=Object.assign(v.useCallback((...f)=>{window.clearTimeout(l.current);const p=()=>{l.current!==0&&(l.current=0,o(...f))};c.current=p,d.flush=p,l.current=window.setTimeout(p,n)},[o,n]),{flush:c.current});return v.useEffect(()=>()=>{window.clearTimeout(l.current),r&&d.flush()},[d,r]),d}const wC=["mousedown","touchstart"];function UO(e,t,n){const r=v.useRef(null);return v.useEffect(()=>{const o=l=>{const{target:c}=l??{};if(Array.isArray(n)){const d=c?.hasAttribute("data-ignore-outside-clicks")||!document.body.contains(c)&&c.tagName!=="HTML";n.every(p=>!!p&&!l.composedPath().includes(p))&&!d&&e()}else r.current&&!r.current.contains(c)&&e()};return(t||wC).forEach(l=>document.addEventListener(l,o)),()=>{(t||wC).forEach(l=>document.removeEventListener(l,o))}},[r,e,n]),r}function UR({timeout:e=2e3}={}){const[t,n]=v.useState(null),[r,o]=v.useState(!1),[l,c]=v.useState(null),d=m=>{window.clearTimeout(l),c(window.setTimeout(()=>o(!1),e)),o(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:()=>{o(!1),n(null),window.clearTimeout(l)},error:t,copied:r}}function BO(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function VO(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function BR(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=v.useState(n?t:VO(e)),l=v.useRef(null);return v.useEffect(()=>{if("matchMedia"in window)return l.current=window.matchMedia(e),o(l.current.matches),BO(l.current,c=>o(c.matches))},[e]),r}function FO(e,t){return BR("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Bc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function oa(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function VR({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 oa(()=>{let o=-1;const l=c=>{c.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",l),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",l)}},[e,t]),r}const HO=/input|select|textarea|button|object/,FR="a, input, select, textarea, button, object, [tabindex]";function qO(e){return e.style.display==="none"}function GO(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(qO(n))return!1;n=n.parentNode}return!0}function HR(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Fy(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(HR(e));return(HO.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&GO(e)}function qR(e){const t=HR(e);return(Number.isNaN(t)||t>=0)&&Fy(e)}function QO(e){return Array.from(e.querySelectorAll(FR)).filter(qR)}function WO(e,t){const n=QO(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let l=r===o.activeElement||e===o.activeElement;const c=o.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(l=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!l)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function YO(e=!0){const t=v.useRef(null),n=o=>{let l=o.querySelector("[data-autofocus]");if(!l){const c=Array.from(o.querySelectorAll(FR));l=c.find(qR)||c.find(Fy)||null,!l&&Fy(o)&&(l=o)}l&&l.focus({preventScroll:!0})},r=v.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=l=>{l.key==="Tab"&&t.current&&WO(t.current,l)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const KO=e=>(e+1)%1e6;function XO(){const[,e]=v.useReducer(KO,0);return e}const ZO=Tn.useId||(()=>{});function JO(){const e=ZO();return e?`mantine-${e.replace(/:/g,"")}`:""}function _r(e){const t=JO(),[n,r]=v.useState(t);return Bc(()=>{r(Qh())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function GR(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function sd(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function e4(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=sd(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o?o():sd(r,null)}),t.clear()}}}function qn(...e){return v.useCallback(e4(...e),e)}function Zn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,l]=v.useState(t!==void 0?t:n),c=(d,...f)=>{l(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[o,c,!1]}function Ya(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const ph="dots";function t4({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:l}){const c=Math.max(Math.trunc(e),0),[d,f]=Zn({value:r,onChange:l,defaultValue:o,finalValue:o}),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 Ya(1,c);const C=Math.max(d-t,n),T=Math.min(d+t,c-n),E=C>n+2,R=T<c-(n+1);if(!E&&R){const D=t*2+n+2;return[...Ya(1,D),ph,...Ya(c-(n-1),c)]}if(E&&!R){const D=n+1+2*t;return[...Ya(1,n),ph,...Ya(c-D,c)]}return[...Ya(1,n),ph,...Ya(C,T),ph,...Ya(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:x,last:b}}function $x(e,t){return BR("(prefers-reduced-motion: reduce)",e,t)}function n4(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(!$O(e[n],t[n]))return!1;return!0}function r4(e){const t=v.useRef([]),n=v.useRef(0);return n4(t.current,e)||(t.current=e,n.current+=1),[n.current]}function i4(e,t){v.useEffect(e,r4(t))}function wd(e=!1,t){const{onOpen:n,onClose:r}={},[o,l]=v.useState(e),c=v.useCallback(()=>{l(p=>p||(n?.(),!0))},[n]),d=v.useCallback(()=>{l(p=>p&&(r?.(),!1))},[r]),f=v.useCallback(()=>{o?d():c()},[d,c,o]);return[o,{open:c,close:d,toggle:f}]}function o4(e,t,n={autoInvoke:!1}){const r=v.useRef(null),o=v.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),l=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&o(),l),[l,o]),{start:o,clear:l}}function a4(e,t,n){const r=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{const l=typeof n=="function"?n():n;return(l||o.current)&&(r.current=new MutationObserver(e),r.current.observe(l||o.current,t)),()=>{r.current?.disconnect()}},[e,t]),o}function s4(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var l4={};function QR(){return typeof process<"u"&&l4?"production":"development"}function Rp(e){const t=Tn.version;return typeof Tn.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function WR(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=WR(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Ot(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=WR(e))&&(r&&(r+=" "),r+=t);return r}const c4={};function u4(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=Ot(t[r],o):t[r]=o})}),t}function _p({theme:e,classNames:t,props:n,stylesCtx:r}){const l=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||c4);return u4(l)}function Wh({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((l,c)=>typeof c=="function"?{...l,...c(e,n,r)}:{...l,...c},{})}const Ux=v.createContext(null);function pa(){const e=v.useContext(Ux);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function d4(){return pa().cssVariablesResolver}function f4(){return pa().classNamesPrefix}function Dp(){return pa().getStyleNonce}function h4(){return pa().withStaticClasses}function p4(){return pa().headless}function m4(){return pa().stylesTransform?.sx}function g4(){return pa().stylesTransform?.styles}function YR(){return pa().env||"default"}function v4(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function y4(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,o=n>>8&255,l=n&255;return{r,g:o,b:l,a:1}}function x4(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o===void 0?1:o}}function b4(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,d=(1-Math.abs(2*l-1))*o,f=r/60,p=d*(1-Math.abs(f%2-1)),m=l-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 Bx(e){return v4(e)?y4(e):e.startsWith("rgb")?x4(e):e.startsWith("hsl")?b4(e):{r:0,g:0,b:0,a:1}}function mh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:l}=Bx(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(o)}, ${l})`}function ld(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Kv(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function S4(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function w4(e){if(e.startsWith("oklch("))return(S4(e)||0)/100;const{r:t,g:n,b:r}=Bx(e),o=t/255,l=n/255,c=r/255,d=Kv(o),f=Kv(l),p=Kv(c);return .2126*d+.7152*f+.0722*p}function qu(e,t=.179){return e.startsWith("var(")?!1:w4(e)>t}function Ri({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:qu(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:qu(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:qu(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),l=o?Number(o):void 0,c=r in t.colors;if(c){const d=l!==void 0?t.colors[r][l]:t.colors[r][ld(t,n||"light")];return{color:r,value:d,shade:l,isThemeColor:c,isLight:qu(d,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${l}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:qu(e,t.luminanceThreshold),shade:l,variable:void 0}}function Ft(e,t){const n=Ri({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Hy(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),o=Ft(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function wi(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const l=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${l}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=Bx(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const uc=wi,j4=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const l=Ri({color:e,theme:t}),c=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const d=c&&l.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return l.isThemeColor?l.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-${l.color}-${l.shade})`,hover:`var(--mantine-color-${l.color}-${l.shade===9?8:l.shade+1})`,color:d,border:`${le(1)} solid transparent`}:{background:e,hover:mh(e,.1),color:d,border:`${le(1)} solid transparent`}}if(n==="light"){if(l.isThemeColor){if(l.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[l.color][l.shade];return{background:wi(d,.1),hover:wi(d,.12),color:`var(--mantine-color-${l.color}-${Math.min(l.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:wi(e,.1),hover:wi(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return l.isThemeColor?l.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:wi(t.colors[l.color][l.shade],.05),color:`var(--mantine-color-${l.color}-${l.shade})`,border:`${le(1)} solid var(--mantine-color-${l.color}-${l.shade})`}:{background:"transparent",hover:wi(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(l.isThemeColor){if(l.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[l.color][l.shade];return{background:"transparent",hover:wi(d,.12),color:`var(--mantine-color-${l.color}-${Math.min(l.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:wi(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?l.isThemeColor?l.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-${l.color}-${Math.min(l.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?l.isThemeColor?l.shade===void 0?{background:"var(--mantine-color-white)",hover:mh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:mh(t.white,.01),color:`var(--mantine-color-${l.color}-${l.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:mh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:Hy(r,t),hover:Hy(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},C4={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"]},jC="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Vx={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:C4,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:j4,autoContrast:!1,luminanceThreshold:.3,fontFamily:jC,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:jC,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 CC(e){return e==="auto"||e==="dark"||e==="light"}function E4({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 CC(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&&CC(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const T4="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",EC="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Xv(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function TC(e){if(!(e.primaryColor in e.colors))throw new Error(T4);if(typeof e.primaryShade=="object"&&(!Xv(e.primaryShade.dark)||!Xv(e.primaryShade.light)))throw new Error(EC);if(typeof e.primaryShade=="number"&&!Xv(e.primaryShade))throw new Error(EC)}function R4(e,t){if(!t)return TC(e),e;const n=Lx(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),TC(n),n}const Fx=v.createContext(null),_4=()=>v.useContext(Fx)||Vx;function Sn(){const e=v.useContext(Fx);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function KR({theme:e,children:t,inherit:n=!0}){const r=_4(),o=v.useMemo(()=>R4(n?r:Vx,e),[e,r,n]);return a.jsx(Fx.Provider,{value:o,children:t})}KR.displayName="@mantine/core/MantineThemeProvider";function D4(){const e=Sn(),t=Dp(),n=rn(e.breakpoints).reduce((r,o)=>{const l=e.breakpoints[o].includes("px"),c=od(e.breakpoints[o]),d=l?`${c-.1}px`:Hh(c-.1),f=l?`${c}px`:Hh(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Zv(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Gu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function A4(e,t){const n=Zv(e.variables),r=n?Gu(t,n):"",o=Zv(e.dark),l=Zv(e.light),c=o?Gu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",d=l?Gu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,l):"";return`${r}${c}${d}`}function ma({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Ri({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function RC(e,t){return ma({color:e.colors[e.primaryColor][ld(e,t)],theme:e,autoContrast:null})}function gh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const d=ld(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`]:uc(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:uc(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`]:uc(e.colors[t][d],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const l=ld(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:uc(e.colors[t][Math.max(0,l-2)],.15),[`--mantine-color-${r}-light-hover`]:uc(e.colors[t][Math.max(0,l-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(l-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(l-4,0)})`,[`--mantine-color-${r}-outline-hover`]:uc(e.colors[t][Math.max(l-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function P4(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function dc(e,t,n){rn(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const XR=e=>{const t=ld(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":RC(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":RC(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)"}};dc(r.variables,e.breakpoints,"breakpoint"),dc(r.variables,e.spacing,"spacing"),dc(r.variables,e.fontSizes,"font-size"),dc(r.variables,e.lineHeights,"line-height"),dc(r.variables,e.shadows,"shadow"),dc(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((l,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),rn(e.colors).forEach(l=>{const c=e.colors[l];if(P4(c)){Object.assign(r.light,gh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,gh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((d,f)=>{r.variables[`--mantine-color-${l}-${f}`]=d}),Object.assign(r.light,gh({theme:e,color:l,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,gh({theme:e,color:l,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return rn(o).forEach(l=>{r.variables[`--mantine-${l}-font-size`]=o[l].fontSize,r.variables[`--mantine-${l}-line-height`]=o[l].lineHeight,r.variables[`--mantine-${l}-font-weight`]=o[l].fontWeight||e.headings.fontWeight}),r};function k4({theme:e,generator:t}){const n=XR(e),r=t?.(e);return r?Lx(n,r):n}const Jv=XR(Vx);function N4(e){const t={variables:{},light:{},dark:{}};return rn(e.variables).forEach(n=>{Jv.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),rn(e.light).forEach(n=>{Jv.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),rn(e.dark).forEach(n=>{Jv.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function O4(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 ZR({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=Dp(),o=d4(),l=k4({theme:n,generator:o}),c=e===":root"&&t,d=c?N4(l):l,f=A4(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":O4(e)}`}}):null}ZR.displayName="@mantine/CssVariables";function M4(){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 fc(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 L4({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=v.useRef(null),[l,c]=v.useState(()=>e.get(t)),d=r||l,f=v.useCallback(m=>{r||(fc(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),fc(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),Bc(()=>{fc(e.get(t),n)},[]),v.useEffect(()=>{if(r)return fc(r,n),()=>{};r===void 0&&fc(l,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{l==="auto"&&fc(g.matches?"dark":"light",n)};return o.current?.addEventListener("change",m),()=>o.current?.removeEventListener("change",m)},[l,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function I4({respectReducedMotion:e,getRootElement:t}){Bc(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}M4();function JR({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:l=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=E4(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:x,forceColorScheme:b,stylesTransform:w,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:E}=L4({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return I4({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(Ux.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:E,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:x,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:w,env:j},children:a.jsxs(KR,{theme:e,children:[c&&a.jsx(ZR,{cssVariablesSelector:d,deduplicateCssVariables:l}),o&&a.jsx(D4,{}),t]})})}JR.displayName="@mantine/core/MantineProvider";function fl({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Sn();return{resolvedClassNames:_p({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:Wh({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const z4={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function $4({theme:e,options:t,unstyled:n}){return Ot(t?.focusable&&!n&&(e.focusClassName||z4[e.focusRing]),t?.active&&!n&&e.activeClassName)}function U4({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return _p({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function _C({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return _p({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function B4({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function V4({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function F4({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function H4({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(l=>_p({theme:t,classNames:t.components[l]?.classNames,props:r,stylesCtx:o})?.[n])}function q4({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function G4({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:l,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:x,headless:b,transformedStyles:w}){return Ot($4({theme:e,options:t,unstyled:d||b}),H4({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),q4({options:t,classes:c,selector:r,unstyled:d}),_C({selector:r,stylesCtx:g,theme:e,classNames:l,props:m}),_C({selector:r,stylesCtx:g,theme:e,classNames:w,props:m}),U4({selector:r,stylesCtx:g,options:t,props:m,theme:e}),B4({rootSelector:p,selector:r,className:f}),V4({selector:r,classes:c,unstyled:d||b}),x&&!b&&F4({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function Q4({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(l=>Wh({theme:e,styles:e.components[l]?.styles,props:n,stylesCtx:r})[o]).reduce((l,c)=>({...l,...c}),{})}function qy({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...qy({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function W4(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...ds(n[r])}}),t),{})}function Y4({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:l,themeName:c,headless:d}){return W4([d?{}:t?.(n,r,o),...c.map(f=>n.components?.[f]?.vars?.(n,r,o)),e?.(n,r,o)])?.[l]}function K4({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:l,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:x}){return{...!x&&Q4({theme:e,themeName:t,props:o,stylesCtx:l,selector:n}),...!x&&Wh({theme:e,styles:d,props:o,stylesCtx:l})[n],...!x&&Wh({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:l})[n],...Y4({theme:e,props:o,stylesCtx:l,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?qy({style:f,theme:e}):null,...qy({style:r?.style,theme:e})}}function X4({props:e,stylesCtx:t,themeName:n}){const r=Sn(),o=g4()?.();return{getTransformedStyles:c=>o?[...c.map(f=>o(f,{props:e,theme:r,ctx:t})),...n.map(f=>o(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!o}}function $e({name:e,classes:t,props:n,stylesCtx:r,className:o,style:l,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g}){const x=Sn(),b=f4(),w=h4(),j=p4(),C=(Array.isArray(e)?e:[e]).filter(R=>R),{withStylesTransform:T,getTransformedStyles:E}=X4({props:n,stylesCtx:r,themeName:C});return(R,D)=>({className:G4({theme:x,options:D,themeName:C,selector:R,classNamesPrefix:b,classNames:f,classes:t,unstyled:d,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:w,headless:j,transformedStyles:E([D?.styles,p])}),style:K4({theme:x,themeName:C,selector:R,options:D,props:n,stylesCtx:r,rootSelector:c,styles:p,style:l,vars:m,varsResolver:g,headless:j,withStylesTransform:T})})}function hl(e,t){return typeof e=="boolean"?e:t.autoContrast}function DC(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 Z4({keepTransitions:e}={}){const t=v.useRef(Gh),n=v.useRef(-1),r=v.useContext(Ux),o=Dp(),l=v.useRef(o?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:DC(l.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:DC(l.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=FO("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 ae(e,t,n){const r=Sn(),o=r.components[e]?.defaultProps,l=typeof o=="function"?o(r):o;return{...t,...l,...ds(n)}}function ey(e){return rn(e).reduce((t,n)=>e[n]!==void 0?`${t}${AO(n)}:${e[n]};`:t,"").trim()}function J4({selector:e,styles:t,media:n,container:r}){const o=t?ey(t):"",l=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${ey(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${ey(d.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${l.join("")}${c.join("")}`.trim()}function pl(e){const t=Dp();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:J4(e)}})}function ga(e){const{m:t,mx:n,my:r,mt:o,mb:l,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:w,pl:j,pr:C,pe:T,ps:E,bd:R,bg:D,c:P,opacity:A,ff:k,fz:M,fw:$,lts:U,ta:J,lh:Z,fs:Y,tt:H,td:Q,w:O,miw:I,maw:z,h:F,mih:K,mah:L,bgsz:q,bgp:ie,bgr:xe,bga:ve,pos:Ce,top:Oe,left:Ee,bottom:Ge,right:it,inset:St,display:kt,flex:Mt,hiddenFrom:ct,visibleFrom:bt,lightHidden:Qt,darkHidden:Ae,sx:De,...Ze}=e;return{styleProps:ds({m:t,mx:n,my:r,mt:o,mb:l,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:x,pt:b,pb:w,pl:j,pr:C,pe:T,ps:E,bd:R,bg:D,c:P,opacity:A,ff:k,fz:M,fw:$,lts:U,ta:J,lh:Z,fs:Y,tt:H,td:Q,w:O,miw:I,maw:z,h:F,mih:K,mah:L,bgsz:q,bgp:ie,bgr:xe,bga:ve,pos:Ce,top:Oe,left:Ee,bottom:Ge,right:it,inset:St,display:kt,flex:Mt,hiddenFrom:ct,visibleFrom:bt,lightHidden:Qt,darkHidden:Ae,sx:De}),rest:Ze}}const eM={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function Hx(e,t){const n=Ri({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 tM(e,t){const n=Ri({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Hx(e,t)}function nM(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let l=`${le(n)}`;return r&&(l+=` ${r}`),o.length>0&&(l+=` ${Hx(o.join(" "),t)}`),l.trim()}return e}const AC={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 rM(e){return typeof e=="string"&&e in AC?AC[e]:e}const iM=["h1","h2","h3","h4","h5","h6"];function oM(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&iM.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function aM(e){return e}const sM=["h1","h2","h3","h4","h5","h6"];function lM(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&sM.includes(e)?`var(--mantine-${e}-line-height)`:e}function cM(e){return typeof e=="number"?le(e):e}function uM(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 ty={color:Hx,textColor:tM,fontSize:oM,spacing:uM,identity:aM,size:cM,lineHeight:lM,fontFamily:rM,border:nM};function PC(e){return e.replace("(min-width: ","").replace("em)","")}function dM({media:e,...t}){const r=Object.keys(e).sort((o,l)=>Number(PC(o))-Number(PC(l))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function fM(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function hM(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function pM(e){return typeof e=="object"&&e!==null?rn(e).filter(t=>t!=="base"):[]}function mM(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function e2({styleProps:e,data:t,theme:n}){return dM(rn(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const l=t[o],c=Array.isArray(l.property)?l.property:[l.property],d=hM(e[o]);if(!fM(e[o]))return c.forEach(p=>{r.inlineStyles[p]=ty[l.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=pM(e[o]);return c.forEach(p=>{d&&(r.styles[p]=ty[l.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:ty[l.type](mM(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function jd(){return`__m__-${v.useId().replace(/:/g,"")}`}function t2(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...t2(r,t)}),{}):typeof e=="function"?e(t):e??{}}function n2(e){return e.startsWith("data-")?e:`data-${e}`}function gM(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[n2(n)]=e[n]),t},{})}function r2(e){return e?typeof e=="string"?{[n2(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...r2(n)}),{}):gM(e):null}function Gy(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Gy(r,t)}),{}):typeof e=="function"?e(t):e??{}}function vM({theme:e,style:t,vars:n,styleProps:r}){const o=Gy(t,e),l=Gy(n,e);return{...o,...l,...r}}const i2=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:l,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:x,...b},w)=>{const j=Sn(),C=e||"div",{styleProps:T,rest:E}=ga(b),D=m4()?.()?.(T.sx),P=jd(),A=e2({styleProps:T,theme:j,data:eM}),k={ref:w,style:vM({theme:j,style:t,vars:n,styleProps:A.inlineStyles}),className:Ot(r,D,{[P]:A.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${d}`]:d,[`mantine-visible-from-${f}`]:f}),"data-variant":o,"data-size":IR(c)?void 0:c||void 0,size:x,...r2(l),...E};return a.jsxs(a.Fragment,{children:[A.hasResponsiveStyles&&a.jsx(pl,{selector:`.${P}`,styles:A.styles,media:A.media}),typeof g=="function"?g(k):a.jsx(C,{...k})]})});i2.displayName="@mantine/core/Box";const ce=i2;function o2(e){return e}function yM(e){const t=e;return n=>{const r=v.forwardRef((o,l)=>a.jsx(t,{...n,...o,ref:l}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function be(e){const t=v.forwardRef(e);return t.extend=o2,t.withProps=n=>{const r=v.forwardRef((o,l)=>a.jsx(t,{...n,...o,ref:l}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function gr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((o,l)=>a.jsx(t,{...n,...o,ref:l}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=o2,t}const xM=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function ml(){return v.useContext(xM)}var ny={exports:{}},cr={};/**
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 kC;function bM(){if(kC)return cr;kC=1;var e=Mx();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},o=Symbol.for("react.portal");function l(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,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 cr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,cr.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 l(f,p,null,m)},cr.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()}},cr.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))},cr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},cr.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})}},cr.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)},cr.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})}},cr.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)},cr.requestFormReset=function(f){r.d.r(f)},cr.unstable_batchedUpdates=function(f,p){return f(p)},cr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},cr.useFormStatus=function(){return c.H.useHostTransitionStatus()},cr.version="19.2.0",cr}var NC;function a2(){if(NC)return ny.exports;NC=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(),ny.exports=bM(),ny.exports}var qx=a2();const ed=Ox(qx);function Ap(){return typeof window<"u"}function Vc(e){return s2(e)?(e.nodeName||"").toLowerCase():"#document"}function Br(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ro(e){var t;return(t=(s2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function s2(e){return Ap()?e instanceof Node||e instanceof Br(e).Node:!1}function mn(e){return Ap()?e instanceof Element||e instanceof Br(e).Element:!1}function ni(e){return Ap()?e instanceof HTMLElement||e instanceof Br(e).HTMLElement:!1}function Qy(e){return!Ap()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Br(e).ShadowRoot}const SM=new Set(["inline","contents"]);function Cd(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=_i(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!SM.has(o)}const wM=new Set(["table","td","th"]);function jM(e){return wM.has(Vc(e))}const CM=[":popover-open",":modal"];function Pp(e){return CM.some(t=>{try{return e.matches(t)}catch{return!1}})}const EM=["transform","translate","scale","rotate","perspective"],TM=["transform","translate","scale","rotate","perspective","filter"],RM=["paint","layout","strict","content"];function Gx(e){const t=kp(),n=mn(e)?_i(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))||RM.some(r=>(n.contain||"").includes(r))}function _M(e){let t=aa(e);for(;ni(t)&&!as(t);){if(Gx(t))return t;if(Pp(t))return null;t=aa(t)}return null}function kp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const DM=new Set(["html","body","#document"]);function as(e){return DM.has(Vc(e))}function _i(e){return Br(e).getComputedStyle(e)}function Np(e){return mn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function aa(e){if(Vc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Qy(e)&&e.host||Ro(e);return Qy(t)?t.host:t}function l2(e){const t=aa(e);return as(t)?e.ownerDocument?e.ownerDocument.body:e.body:ni(t)&&Cd(t)?t:l2(t)}function ia(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=l2(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),c=Br(o);if(l){const d=Wy(c);return t.concat(c,c.visualViewport||[],Cd(o)?o:[],d&&n?ia(d):[])}return t.concat(o,ia(o,[],n))}function Wy(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function OC(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 cd(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Qy(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function c2(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function u2(){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 AM(e){return NM()?!1:!MC()&&e.width===0&&e.height===0||MC()&&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 PM(){return/apple/i.test(navigator.vendor)}function MC(){const e=/android/i;return e.test(c2())||e.test(u2())}function kM(){return c2().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function NM(){return u2().includes("jsdom/")}function Yy(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function OM(e){return"nativeEvent"in e}function MM(e){return e.matches("html,body")}function Gs(e){return e?.ownerDocument||document}function ry(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 xc(e){return"composedPath"in e?e.composedPath()[0]:e.target}const LM="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function IM(e){return ni(e)&&e.matches(LM)}const Wi=Math.min,fr=Math.max,Yh=Math.round,vh=Math.floor,vo=e=>({x:e,y:e}),zM={left:"right",right:"left",bottom:"top",top:"bottom"},$M={start:"end",end:"start"};function Ky(e,t,n){return fr(e,Wi(t,n))}function sa(e,t){return typeof e=="function"?e(t):e}function Yi(e){return e.split("-")[0]}function Fc(e){return e.split("-")[1]}function Qx(e){return e==="x"?"y":"x"}function Wx(e){return e==="y"?"height":"width"}const UM=new Set(["top","bottom"]);function qi(e){return UM.has(Yi(e))?"y":"x"}function Yx(e){return Qx(qi(e))}function BM(e,t,n){n===void 0&&(n=!1);const r=Fc(e),o=Yx(e),l=Wx(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=Kh(c)),[c,Kh(c)]}function VM(e){const t=Kh(e);return[Xy(e),t,Xy(t)]}function Xy(e){return e.replace(/start|end/g,t=>$M[t])}const LC=["left","right"],IC=["right","left"],FM=["top","bottom"],HM=["bottom","top"];function qM(e,t,n){switch(e){case"top":case"bottom":return n?t?IC:LC:t?LC:IC;case"left":case"right":return t?FM:HM;default:return[]}}function GM(e,t,n,r){const o=Fc(e);let l=qM(Yi(e),n==="start",r);return o&&(l=l.map(c=>c+"-"+o),t&&(l=l.concat(l.map(Xy)))),l}function Kh(e){return e.replace(/left|right|bottom|top/g,t=>zM[t])}function QM(e){return{top:0,right:0,bottom:0,left:0,...e}}function Kx(e){return typeof e!="number"?QM(e):{top:e,right:e,bottom:e,left:e}}function Dc(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function zC(e,t,n){let{reference:r,floating:o}=e;const l=qi(t),c=Yx(t),d=Wx(c),f=Yi(t),p=l==="y",m=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,x=r[d]/2-o[d]/2;let b;switch(f){case"top":b={x:m,y:r.y-o.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-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Fc(t)){case"start":b[c]-=x*(n&&p?-1:1);break;case"end":b[c]+=x*(n&&p?-1:1);break}return b}const WM=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=zC(p,r,f),x=r,b={},w=0;for(let j=0;j<d.length;j++){const{name:C,fn:T}=d[j],{x:E,y:R,data:D,reset:P}=await T({x:m,y:g,initialPlacement:r,placement:x,strategy:o,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=E??m,g=R??g,b={...b,[C]:{...b[C],...D}},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:o}):P.rects),{x:m,y:g}=zC(p,x,f)),j=-1)}return{x:m,y:g,placement:x,strategy:o,middlewareData:b}};async function Xx(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:x=!1,padding:b=0}=sa(t,e),w=Kx(b),C=d[x?g==="floating"?"reference":"floating":g],T=Dc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:m,strategy:f})),E=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),D=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},P=Dc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:R,strategy:f}):E);return{top:(T.top-P.top+w.top)/D.y,bottom:(P.bottom-T.bottom+w.bottom)/D.y,left:(T.left-P.left+w.left)/D.x,right:(P.right-T.right+w.right)/D.x}}const YM=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=sa(e,t)||{};if(p==null)return{};const g=Kx(m),x={x:n,y:r},b=Yx(o),w=Wx(b),j=await c.getDimensions(p),C=b==="y",T=C?"top":"left",E=C?"bottom":"right",R=C?"clientHeight":"clientWidth",D=l.reference[w]+l.reference[b]-x[b]-l.floating[w],P=x[b]-l.reference[b],A=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let k=A?A[R]:0;(!k||!await(c.isElement==null?void 0:c.isElement(A)))&&(k=d.floating[R]||l.floating[w]);const M=D/2-P/2,$=k/2-j[w]/2-1,U=Wi(g[T],$),J=Wi(g[E],$),Z=U,Y=k-j[w]-J,H=k/2-j[w]/2+M,Q=Ky(Z,H,Y),O=!f.arrow&&Fc(o)!=null&&H!==Q&&l.reference[w]/2-(H<Z?U:J)-j[w]/2<0,I=O?H<Z?H-Z:H-Y:0;return{[b]:x[b]+I,data:{[b]:Q,centerOffset:H-Q-I,...O&&{alignmentOffset:I}},reset:O}}}),KM=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,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}=sa(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const T=Yi(o),E=qi(d),R=Yi(d)===d,D=await(f.isRTL==null?void 0:f.isRTL(p.floating)),P=x||(R||!j?[Kh(d)]:VM(d)),A=w!=="none";!x&&A&&P.push(...GM(d,j,w,D));const k=[d,...P],M=await Xx(t,C),$=[];let U=((r=l.flip)==null?void 0:r.overflows)||[];if(m&&$.push(M[T]),g){const H=BM(o,c,D);$.push(M[H[0]],M[H[1]])}if(U=[...U,{placement:o,overflows:$}],!$.every(H=>H<=0)){var J,Z;const H=(((J=l.flip)==null?void 0:J.index)||0)+1,Q=k[H];if(Q&&(!(g==="alignment"?E!==qi(Q):!1)||U.every(z=>qi(z.placement)===E?z.overflows[0]>0:!0)))return{data:{index:H,overflows:U},reset:{placement:Q}};let O=(Z=U.filter(I=>I.overflows[0]<=0).sort((I,z)=>I.overflows[1]-z.overflows[1])[0])==null?void 0:Z.placement;if(!O)switch(b){case"bestFit":{var Y;const I=(Y=U.filter(z=>{if(A){const F=qi(z.placement);return F===E||F==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(F=>F>0).reduce((F,K)=>F+K,0)]).sort((z,F)=>z[1]-F[1])[0])==null?void 0:Y[0];I&&(O=I);break}case"initialPlacement":O=d;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function d2(e){const t=Wi(...e.map(l=>l.left)),n=Wi(...e.map(l=>l.top)),r=fr(...e.map(l=>l.right)),o=fr(...e.map(l=>l.bottom));return{x:t,y:n,width:r-t,height:o-n}}function XM(e){const t=e.slice().sort((o,l)=>o.y-l.y),n=[];let r=null;for(let o=0;o<t.length;o++){const l=t[o];!r||l.y-r.y>r.height/2?n.push([l]):n[n.length-1].push(l),r=l}return n.map(o=>Dc(d2(o)))}const ZM=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:l,strategy:c}=t,{padding:d=2,x:f,y:p}=sa(e,t),m=Array.from(await(l.getClientRects==null?void 0:l.getClientRects(r.reference))||[]),g=XM(m),x=Dc(d2(m)),b=Kx(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(qi(n)==="y"){const U=g[0],J=g[g.length-1],Z=Yi(n)==="top",Y=U.top,H=J.bottom,Q=Z?U.left:J.left,O=Z?U.right:J.right,I=O-Q,z=H-Y;return{top:Y,bottom:H,left:Q,right:O,width:I,height:z,x:Q,y:Y}}const C=Yi(n)==="left",T=fr(...g.map(U=>U.right)),E=Wi(...g.map(U=>U.left)),R=g.filter(U=>C?U.left===E:U.right===T),D=R[0].top,P=R[R.length-1].bottom,A=E,k=T,M=k-A,$=P-D;return{top:D,bottom:P,left:A,right:k,width:M,height:$,x:A,y:D}}return x}const j=await l.getElementRects({reference:{getBoundingClientRect:w},floating:r.floating,strategy:c});return o.reference.x!==j.reference.x||o.reference.y!==j.reference.y||o.reference.width!==j.reference.width||o.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},f2=new Set(["left","top"]);async function JM(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Yi(n),d=Fc(n),f=qi(n)==="y",p=f2.has(c)?-1:1,m=l&&f?-1:1,g=sa(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 e9=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:c,middlewareData:d}=t,f=await JM(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:c}}}}},t9=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:T,y:E}=C;return{x:T,y:E}}},...f}=sa(e,t),p={x:n,y:r},m=await Xx(t,f),g=qi(Yi(o)),x=Qx(g);let b=p[x],w=p[g];if(l){const C=x==="y"?"top":"left",T=x==="y"?"bottom":"right",E=b+m[C],R=b-m[T];b=Ky(E,b,R)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",E=w+m[C],R=w-m[T];w=Ky(E,w,R)}const j=d.fn({...t,[x]:b,[g]:w});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[x]:l,[g]:c}}}}}},n9=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=sa(e,t),m={x:n,y:r},g=qi(o),x=Qx(g);let b=m[x],w=m[g];const j=sa(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const R=x==="y"?"height":"width",D=l.reference[x]-l.floating[R]+C.mainAxis,P=l.reference[x]+l.reference[R]-C.mainAxis;b<D?b=D:b>P&&(b=P)}if(p){var T,E;const R=x==="y"?"width":"height",D=f2.has(Yi(o)),P=l.reference[g]-l.floating[R]+(D&&((T=c.offset)==null?void 0:T[g])||0)+(D?0:C.crossAxis),A=l.reference[g]+l.reference[R]+(D?0:((E=c.offset)==null?void 0:E[g])||0)-(D?C.crossAxis:0);w<P?w=P:w>A&&(w=A)}return{[x]:b,[g]:w}}}},r9=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...p}=sa(e,t),m=await Xx(t,p),g=Yi(o),x=Fc(o),b=qi(o)==="y",{width:w,height:j}=l.floating;let C,T;g==="top"||g==="bottom"?(C=g,T=x===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=g,C=x==="end"?"top":"bottom");const E=j-m.top-m.bottom,R=w-m.left-m.right,D=Wi(j-m[C],E),P=Wi(w-m[T],R),A=!t.middlewareData.shift;let k=D,M=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(M=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(k=E),A&&!x){const U=fr(m.left,0),J=fr(m.right,0),Z=fr(m.top,0),Y=fr(m.bottom,0);b?M=w-2*(U!==0||J!==0?U+J:fr(m.left,m.right)):k=j-2*(Z!==0||Y!==0?Z+Y:fr(m.top,m.bottom))}await f({...t,availableWidth:M,availableHeight:k});const $=await c.getDimensions(d.floating);return w!==$.width||j!==$.height?{reset:{rects:!0}}:{}}}};function h2(e){const t=_i(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ni(e),l=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=Yh(n)!==l||Yh(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function Zx(e){return mn(e)?e:e.contextElement}function jc(e){const t=Zx(e);if(!ni(t))return vo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=h2(t);let c=(l?Yh(n.width):n.width)/r,d=(l?Yh(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const i9=vo(0);function p2(e){const t=Br(e);return!kp()||!t.visualViewport?i9:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function o9(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Br(e)?!1:t}function tl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=Zx(e);let c=vo(1);t&&(r?mn(r)&&(c=jc(r)):c=jc(e));const d=o9(l,n,r)?p2(l):vo(0);let f=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(l){const x=Br(l),b=r&&mn(r)?Br(r):r;let w=x,j=Wy(w);for(;j&&r&&b!==w;){const C=jc(j),T=j.getBoundingClientRect(),E=_i(j),R=T.left+(j.clientLeft+parseFloat(E.paddingLeft))*C.x,D=T.top+(j.clientTop+parseFloat(E.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=R,p+=D,w=Br(j),j=Wy(w)}}return Dc({width:m,height:g,x:f,y:p})}function Op(e,t){const n=Np(e).scrollLeft;return t?t.left+n:tl(Ro(e)).left+n}function m2(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Op(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function a9(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",c=Ro(r),d=t?Pp(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},p=vo(1);const m=vo(0),g=ni(r);if((g||!g&&!l)&&((Vc(r)!=="body"||Cd(c))&&(f=Np(r)),ni(r))){const b=tl(r);p=jc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const x=c&&!g&&!l?m2(c,f):vo(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 s9(e){return Array.from(e.getClientRects())}function l9(e){const t=Ro(e),n=Np(e),r=e.ownerDocument.body,o=fr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=fr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Op(e);const d=-n.scrollTop;return _i(r).direction==="rtl"&&(c+=fr(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:d}}const $C=25;function c9(e,t){const n=Br(e),r=Ro(e),o=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){l=o.width,c=o.height;const m=kp();(!m||m&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const p=Op(r);if(p<=0){const m=r.ownerDocument,g=m.body,x=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(x.marginLeft)+parseFloat(x.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-b);w<=$C&&(l-=w)}else p<=$C&&(l+=p);return{width:l,height:c,x:d,y:f}}const u9=new Set(["absolute","fixed"]);function d9(e,t){const n=tl(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=ni(e)?jc(e):vo(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,p=r*l.y;return{width:c,height:d,x:f,y:p}}function UC(e,t,n){let r;if(t==="viewport")r=c9(e,n);else if(t==="document")r=l9(Ro(e));else if(mn(t))r=d9(t,n);else{const o=p2(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Dc(r)}function g2(e,t){const n=aa(e);return n===t||!mn(n)||as(n)?!1:_i(n).position==="fixed"||g2(n,t)}function f9(e,t){const n=t.get(e);if(n)return n;let r=ia(e,[],!1).filter(d=>mn(d)&&Vc(d)!=="body"),o=null;const l=_i(e).position==="fixed";let c=l?aa(e):e;for(;mn(c)&&!as(c);){const d=_i(c),f=Gx(c);!f&&d.position==="fixed"&&(o=null),(l?!f&&!o:!f&&d.position==="static"&&!!o&&u9.has(o.position)||Cd(c)&&!f&&g2(e,c))?r=r.filter(m=>m!==c):o=d,c=aa(c)}return t.set(e,r),r}function h9(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?Pp(t)?[]:f9(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=UC(t,m,o);return p.top=fr(g.top,p.top),p.right=Wi(g.right,p.right),p.bottom=Wi(g.bottom,p.bottom),p.left=fr(g.left,p.left),p},UC(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function p9(e){const{width:t,height:n}=h2(e);return{width:t,height:n}}function m9(e,t,n){const r=ni(t),o=Ro(t),l=n==="fixed",c=tl(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=vo(0);function p(){f.x=Op(o)}if(r||!r&&!l)if((Vc(t)!=="body"||Cd(o))&&(d=Np(t)),r){const b=tl(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&p();l&&!r&&o&&p();const m=o&&!r&&!l?m2(o,d):vo(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 iy(e){return _i(e).position==="static"}function BC(e,t){if(!ni(e)||_i(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ro(e)===n&&(n=n.ownerDocument.body),n}function v2(e,t){const n=Br(e);if(Pp(e))return n;if(!ni(e)){let o=aa(e);for(;o&&!as(o);){if(mn(o)&&!iy(o))return o;o=aa(o)}return n}let r=BC(e,t);for(;r&&jM(r)&&iy(r);)r=BC(r,t);return r&&as(r)&&iy(r)&&!Gx(r)?n:r||_M(e)||n}const g9=async function(e){const t=this.getOffsetParent||v2,n=this.getDimensions,r=await n(e.floating);return{reference:m9(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function v9(e){return _i(e).direction==="rtl"}const y9={convertOffsetParentRelativeRectToViewportRelativeRect:a9,getDocumentElement:Ro,getClippingRect:h9,getOffsetParent:v2,getElementRects:g9,getClientRects:s9,getDimensions:p9,getScale:jc,isElement:mn,isRTL:v9};function y2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function x9(e,t){let n=null,r;const o=Ro(e);function l(){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),l();const p=e.getBoundingClientRect(),{left:m,top:g,width:x,height:b}=p;if(d||t(),!x||!b)return;const w=vh(g),j=vh(o.clientWidth-(m+x)),C=vh(o.clientHeight-(g+b)),T=vh(m),R={rootMargin:-w+"px "+-j+"px "+-C+"px "+-T+"px",threshold:fr(0,Wi(1,f))||1};let D=!0;function P(A){const k=A[0].intersectionRatio;if(k!==f){if(!D)return c();k?c(!1,k):r=setTimeout(()=>{c(!1,1e-7)},1e3)}k===1&&!y2(p,e.getBoundingClientRect())&&c(),D=!1}try{n=new IntersectionObserver(P,{...R,root:o.ownerDocument})}catch{n=new IntersectionObserver(P,R)}n.observe(e)}return c(!0),l}function b9(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=Zx(e),m=o||l?[...p?ia(p):[],...ia(t)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),l&&T.addEventListener("resize",n)});const g=p&&d?x9(p,n):null;let x=-1,b=null;c&&(b=new ResizeObserver(T=>{let[E]=T;E&&E.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(x),x=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let w,j=f?tl(e):null;f&&C();function C(){const T=tl(e);j&&!y2(j,T)&&n(),j=T,w=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(E=>{o&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),g?.(),(T=b)==null||T.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const S9=e9,w9=t9,j9=KM,C9=r9,VC=YM,E9=ZM,T9=n9,R9=(e,t,n)=>{const r=new Map,o={platform:y9,...n},l={...o.platform,_c:r};return WM(e,t,{...o,platform:l})};var _9=typeof document<"u",D9=function(){},Oh=_9?v.useLayoutEffect:D9;function Xh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Xh(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!Xh(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function x2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function FC(e,t){const n=x2(e);return Math.round(t*n)/n}function oy(e){const t=v.useRef(e);return Oh(()=>{t.current=e}),t}function A9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,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);Xh(x,r)||b(r);const[w,j]=v.useState(null),[C,T]=v.useState(null),E=v.useCallback(z=>{z!==A.current&&(A.current=z,j(z))},[]),R=v.useCallback(z=>{z!==k.current&&(k.current=z,T(z))},[]),D=l||w,P=c||C,A=v.useRef(null),k=v.useRef(null),M=v.useRef(m),$=f!=null,U=oy(f),J=oy(o),Z=oy(p),Y=v.useCallback(()=>{if(!A.current||!k.current)return;const z={placement:t,strategy:n,middleware:x};J.current&&(z.platform=J.current),R9(A.current,k.current,z).then(F=>{const K={...F,isPositioned:Z.current!==!1};H.current&&!Xh(M.current,K)&&(M.current=K,qx.flushSync(()=>{g(K)}))})},[x,t,n,J,Z]);Oh(()=>{p===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const H=v.useRef(!1);Oh(()=>(H.current=!0,()=>{H.current=!1}),[]),Oh(()=>{if(D&&(A.current=D),P&&(k.current=P),D&&P){if(U.current)return U.current(D,P,Y);Y()}},[D,P,Y,U,$]);const Q=v.useMemo(()=>({reference:A,floating:k,setReference:E,setFloating:R}),[E,R]),O=v.useMemo(()=>({reference:D,floating:P}),[D,P]),I=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!O.floating)return z;const F=FC(O.floating,m.x),K=FC(O.floating,m.y);return d?{...z,transform:"translate("+F+"px, "+K+"px)",...x2(O.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:K}},[n,d,O.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:Y,refs:Q,elements:O,floatingStyles:I}),[m,Y,Q,O,I])}const P9=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?VC({element:r.current,padding:o}).fn(n):{}:r?VC({element:r,padding:o}).fn(n):{}}}},b2=(e,t)=>({...S9(e),options:[e,t]}),Jx=(e,t)=>({...w9(e),options:[e,t]}),HC=(e,t)=>({...T9(e),options:[e,t]}),Zh=(e,t)=>({...j9(e),options:[e,t]}),k9=(e,t)=>({...C9(e),options:[e,t]}),rd=(e,t)=>({...E9(e),options:[e,t]}),S2=(e,t)=>({...P9(e),options:[e,t]});function N9(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 w2={...W3},O9=w2.useInsertionEffect,M9=O9||(e=>e());function ra(e){const t=v.useRef(()=>{});return M9(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var yo=typeof document<"u"?v.useLayoutEffect:v.useEffect;let qC=!1,L9=0;const GC=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+L9++;function I9(){const[e,t]=v.useState(()=>qC?GC():void 0);return yo(()=>{e==null&&t(GC())},[]),v.useEffect(()=>{qC=!0},[]),e}const z9=w2.useId,j2=z9||I9;function $9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const U9=v.createContext(null),B9=v.createContext(null),e0=()=>{var e;return((e=v.useContext(U9))==null?void 0:e.id)||null},t0=()=>v.useContext(B9);function n0(e){return"data-floating-ui-"+e}function ay(e){const t=v.useRef(e);return yo(()=>{t.current=e}),t}const QC=n0("safe-polygon");function Mh(e,t,n){return n&&!Yy(n)?0:typeof e=="number"?e:e?.[t]}function V9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:l,elements:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:x=!0}=t,b=t0(),w=e0(),j=ay(p),C=ay(f),T=ay(n),E=v.useRef(),R=v.useRef(-1),D=v.useRef(),P=v.useRef(-1),A=v.useRef(!0),k=v.useRef(!1),M=v.useRef(()=>{}),$=v.useRef(!1),U=v.useCallback(()=>{var I;const z=(I=o.current.openEvent)==null?void 0:I.type;return z?.includes("mouse")&&z!=="mousedown"},[o]);v.useEffect(()=>{if(!d)return;function I(z){let{open:F}=z;F||(clearTimeout(R.current),clearTimeout(P.current),A.current=!0,$.current=!1)}return l.on("openchange",I),()=>{l.off("openchange",I)}},[d,l]),v.useEffect(()=>{if(!d||!j.current||!n)return;function I(F){U()&&r(!1,F,"hover")}const z=Gs(c.floating).documentElement;return z.addEventListener("mouseleave",I),()=>{z.removeEventListener("mouseleave",I)}},[c.floating,n,r,d,j,U]);const J=v.useCallback(function(I,z,F){z===void 0&&(z=!0),F===void 0&&(F="hover");const K=Mh(C.current,"close",E.current);K&&!D.current?(clearTimeout(R.current),R.current=window.setTimeout(()=>r(!1,I,F),K)):z&&(clearTimeout(R.current),r(!1,I,F))},[C,r]),Z=ra(()=>{M.current(),D.current=void 0}),Y=ra(()=>{if(k.current){const I=Gs(c.floating).body;I.style.pointerEvents="",I.removeAttribute(QC),k.current=!1}}),H=ra(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function I(L){if(clearTimeout(R.current),A.current=!1,m&&!Yy(E.current)||g>0&&!Mh(C.current,"open"))return;const q=Mh(C.current,"open",E.current);q?R.current=window.setTimeout(()=>{T.current||r(!0,L,"hover")},q):n||r(!0,L,"hover")}function z(L){if(H())return;M.current();const q=Gs(c.floating);if(clearTimeout(P.current),$.current=!1,j.current&&o.current.floatingContext){n||clearTimeout(R.current),D.current=j.current({...o.current.floatingContext,tree:b,x:L.clientX,y:L.clientY,onClose(){Y(),Z(),H()||J(L,!0,"safe-polygon")}});const xe=D.current;q.addEventListener("mousemove",xe),M.current=()=>{q.removeEventListener("mousemove",xe)};return}(E.current==="touch"?!cd(c.floating,L.relatedTarget):!0)&&J(L)}function F(L){H()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:b,x:L.clientX,y:L.clientY,onClose(){Y(),Z(),H()||J(L)}})(L))}if(mn(c.domReference)){var K;const L=c.domReference;return n&&L.addEventListener("mouseleave",F),(K=c.floating)==null||K.addEventListener("mouseleave",F),x&&L.addEventListener("mousemove",I,{once:!0}),L.addEventListener("mouseenter",I),L.addEventListener("mouseleave",z),()=>{var q;n&&L.removeEventListener("mouseleave",F),(q=c.floating)==null||q.removeEventListener("mouseleave",F),x&&L.removeEventListener("mousemove",I),L.removeEventListener("mouseenter",I),L.removeEventListener("mouseleave",z)}}},[c,d,e,m,g,x,J,Z,Y,r,n,T,b,C,j,o,H]),yo(()=>{var I;if(d&&n&&(I=j.current)!=null&&I.__options.blockPointerEvents&&U()){k.current=!0;const F=c.floating;if(mn(c.domReference)&&F){var z;const K=Gs(c.floating).body;K.setAttribute(QC,"");const L=c.domReference,q=b==null||(z=b.nodesRef.current.find(ie=>ie.id===w))==null||(z=z.context)==null?void 0:z.elements.floating;return q&&(q.style.pointerEvents=""),K.style.pointerEvents="none",L.style.pointerEvents="auto",F.style.pointerEvents="auto",()=>{K.style.pointerEvents="",L.style.pointerEvents="",F.style.pointerEvents=""}}}},[d,n,w,c,b,j,U]),yo(()=>{n||(E.current=void 0,$.current=!1,Z(),Y())},[n,Z,Y]),v.useEffect(()=>()=>{Z(),clearTimeout(R.current),clearTimeout(P.current),Y()},[d,c.domReference,Z,Y]);const Q=v.useMemo(()=>{function I(z){E.current=z.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(z){const{nativeEvent:F}=z;function K(){!A.current&&!T.current&&r(!0,F,"hover")}m&&!Yy(E.current)||n||g===0||$.current&&z.movementX**2+z.movementY**2<2||(clearTimeout(P.current),E.current==="touch"?K():($.current=!0,P.current=window.setTimeout(K,g)))}}},[m,r,n,T,g]),O=v.useMemo(()=>({onMouseEnter(){clearTimeout(R.current)},onMouseLeave(I){H()||J(I.nativeEvent,!1)}}),[J,H]);return v.useMemo(()=>d?{reference:Q,floating:O}:{},[d,Q,O])}const Zy=()=>{},C2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Zy,setState:Zy,isInstantPhase:!1}),F9=()=>v.useContext(C2);function H9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,l]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),d=v.useCallback(f=>{l({currentId:f})},[]);return yo(()=>{o.currentId?c.current===null?c.current=o.currentId:o.isInstantPhase||l({isInstantPhase:!0}):(o.isInstantPhase&&l({isInstantPhase:!1}),c.current=null)},[o.currentId,o.isInstantPhase]),v.createElement(C2.Provider,{value:v.useMemo(()=>({...o,setState:l,setCurrentId:d}),[o,d])},t)}function q9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:l,enabled:c=!0}=t,d=l??o,f=F9(),{currentId:p,setCurrentId:m,initialDelay:g,setState:x,timeoutMs:b}=f;return yo(()=>{c&&p&&(x({delay:{open:1,close:Mh(g,"close")}}),p!==d&&r(!1))},[c,d,r,x,p,g]),yo(()=>{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]),yo(()=>{c&&(m===Zy||!n||m(d))},[c,n,m,d]),f}function sy(e,t){let n=e.filter(o=>{var l;return o.parentId===t&&((l=o.context)==null?void 0:l.open)}),r=n;for(;r.length;)r=e.filter(o=>{var l;return(l=r)==null?void 0:l.some(c=>{var d;return o.parentId===c.id&&((d=o.context)==null?void 0:d.open)})}),n=n.concat(r);return n}const G9="data-floating-ui-focusable",Q9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},W9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},WC=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 Y9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=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=t0(),C=ra(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,E=v.useRef(!1),R=v.useRef(!1),{escapeKey:D,outsidePress:P}=WC(b),{escapeKey:A,outsidePress:k}=WC(w),M=v.useRef(!1),$=ra(Q=>{var O;if(!n||!c||!d||Q.key!=="Escape"||M.current)return;const I=(O=l.current.floatingContext)==null?void 0:O.nodeId,z=j?sy(j.nodesRef.current,I):[];if(!D&&(Q.stopPropagation(),z.length>0)){let F=!0;if(z.forEach(K=>{var L;if((L=K.context)!=null&&L.open&&!K.context.dataRef.current.__escapeKeyBubbles){F=!1;return}}),!F)return}r(!1,OM(Q)?Q.nativeEvent:Q,"escape-key")}),U=ra(Q=>{var O;const I=()=>{var z;$(Q),(z=xc(Q))==null||z.removeEventListener("keydown",I)};(O=xc(Q))==null||O.addEventListener("keydown",I)}),J=ra(Q=>{var O;const I=E.current;E.current=!1;const z=R.current;if(R.current=!1,p==="click"&&z||I||typeof T=="function"&&!T(Q))return;const F=xc(Q),K="["+n0("inert")+"]",L=Gs(o.floating).querySelectorAll(K);let q=mn(F)?F:null;for(;q&&!as(q);){const Ce=aa(q);if(as(Ce)||!mn(Ce))break;q=Ce}if(L.length&&mn(F)&&!MM(F)&&!cd(F,o.floating)&&Array.from(L).every(Ce=>!cd(q,Ce)))return;if(ni(F)&&H){const Ce=F.clientWidth>0&&F.scrollWidth>F.clientWidth,Oe=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let Ee=Oe&&Q.offsetX>F.clientWidth;if(Oe&&_i(F).direction==="rtl"&&(Ee=Q.offsetX<=F.offsetWidth-F.clientWidth),Ee||Ce&&Q.offsetY>F.clientHeight)return}const ie=(O=l.current.floatingContext)==null?void 0:O.nodeId,xe=j&&sy(j.nodesRef.current,ie).some(Ce=>{var Oe;return ry(Q,(Oe=Ce.context)==null?void 0:Oe.elements.floating)});if(ry(Q,o.floating)||ry(Q,o.domReference)||xe)return;const ve=j?sy(j.nodesRef.current,ie):[];if(ve.length>0){let Ce=!0;if(ve.forEach(Oe=>{var Ee;if((Ee=Oe.context)!=null&&Ee.open&&!Oe.context.dataRef.current.__outsidePressBubbles){Ce=!1;return}}),!Ce)return}r(!1,Q,"outside-press")}),Z=ra(Q=>{var O;const I=()=>{var z;J(Q),(z=xc(Q))==null||z.removeEventListener(p,I)};(O=xc(Q))==null||O.addEventListener(p,I)});v.useEffect(()=>{if(!n||!c)return;l.current.__escapeKeyBubbles=D,l.current.__outsidePressBubbles=P;let Q=-1;function O(L){r(!1,L,"ancestor-scroll")}function I(){window.clearTimeout(Q),M.current=!0}function z(){Q=window.setTimeout(()=>{M.current=!1},kp()?5:0)}const F=Gs(o.floating);d&&(F.addEventListener("keydown",A?U:$,A),F.addEventListener("compositionstart",I),F.addEventListener("compositionend",z)),T&&F.addEventListener(p,k?Z:J,k);let K=[];return x&&(mn(o.domReference)&&(K=ia(o.domReference)),mn(o.floating)&&(K=K.concat(ia(o.floating))),!mn(o.reference)&&o.reference&&o.reference.contextElement&&(K=K.concat(ia(o.reference.contextElement)))),K=K.filter(L=>{var q;return L!==((q=F.defaultView)==null?void 0:q.visualViewport)}),K.forEach(L=>{L.addEventListener("scroll",O,{passive:!0})}),()=>{d&&(F.removeEventListener("keydown",A?U:$,A),F.removeEventListener("compositionstart",I),F.removeEventListener("compositionend",z)),T&&F.removeEventListener(p,k?Z:J,k),K.forEach(L=>{L.removeEventListener("scroll",O)}),window.clearTimeout(Q)}},[l,o,d,T,p,n,r,x,c,D,P,$,A,U,J,k,Z]),v.useEffect(()=>{E.current=!1},[T,p]);const Y=v.useMemo(()=>({onKeyDown:$,[Q9[g]]:Q=>{m&&r(!1,Q.nativeEvent,"reference-press")}}),[$,r,m,g]),H=v.useMemo(()=>({onKeyDown:$,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[W9[p]]:()=>{E.current=!0}}),[$,p]);return v.useMemo(()=>c?{reference:Y,floating:H}:{},[c,Y,H])}function K9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=j2(),l=v.useRef({}),[c]=v.useState(()=>$9()),d=e0()!=null,[f,p]=v.useState(r.reference),m=ra((b,w,j)=>{l.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:l,open:t,onOpenChange:m,elements:x,events:c,floatingId:o,refs:g}),[t,m,x,c,o,g])}function r0(e){e===void 0&&(e={});const{nodeId:t}=e,n=K9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,c]=v.useState(null),[d,f]=v.useState(null),m=o?.domReference||l,g=v.useRef(null),x=t0();yo(()=>{m&&(g.current=m)},[m]);const b=A9({...e,elements:{...o,...d&&{reference:d}}}),w=v.useCallback(R=>{const D=mn(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),contextElement:R}:R;f(D),b.refs.setReference(D)},[b.refs]),j=v.useCallback(R=>{(mn(R)||R===null)&&(g.current=R,c(R)),(mn(b.refs.reference.current)||b.refs.reference.current===null||R!==null&&!mn(R))&&b.refs.setReference(R)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:w,domReference:g}),[b.refs,j,w]),T=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),E=v.useMemo(()=>({...b,...r,refs:C,elements:T,nodeId:t}),[b,C,T,t,r]);return yo(()=>{r.dataRef.current.floatingContext=E;const R=x?.nodesRef.current.find(D=>D.id===t);R&&(R.context=E)}),v.useMemo(()=>({...b,context:E,refs:C,elements:T}),[b,C,T,E])}function X9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:l,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=Br(c.domReference);function w(){!n&&ni(c.domReference)&&c.domReference===OC(Gs(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 o.on("openchange",b),()=>{o.off("openchange",b)}},[o,d]),v.useEffect(()=>()=>{clearTimeout(m.current)},[]);const x=v.useMemo(()=>({onPointerDown(b){AM(b.nativeEvent)||(g.current=!1)},onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const w=xc(b.nativeEvent);if(f&&mn(w))try{if(PM()&&kM())throw Error();if(!w.matches(":focus-visible"))return}catch{if(!g.current&&!IM(w))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const w=b.relatedTarget,j=b.nativeEvent,C=mn(w)&&w.hasAttribute(n0("focus-guard"))&&w.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const E=OC(c.domReference?c.domReference.ownerDocument:document);!w&&E===c.domReference||cd((T=l.current.floatingContext)==null?void 0:T.refs.floating.current,E)||cd(c.domReference,E)||C||r(!1,j,"focus")})}}),[l,c.domReference,r,f]);return v.useMemo(()=>d?{reference:x}:{},[d,x])}const YC="active",KC="selected";function ly(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[YC]:c,[KC]:d,...f}=e;l=f}return{...n==="floating"&&{tabIndex:-1,[G9]:""},...l,...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(!(o&&[YC,KC].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 Z9(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),o=v.useCallback(d=>ly(d,e,"reference"),t),l=v.useCallback(d=>ly(d,e,"floating"),n),c=v.useCallback(d=>ly(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c}),[o,l,c])}const J9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function e5(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:l=!0,role:c="dialog"}=t,d=(n=J9.get(c))!=null?n:c,f=j2(),m=e0()!=null,g=v.useMemo(()=>d==="tooltip"||c==="label"?{["aria-"+(c==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":d==="alertdialog"?"dialog":d,"aria-controls":r?o: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,o,m,r,f,c]),x=v.useMemo(()=>{const w={id:o,...d&&{role:d}};return d==="tooltip"||c==="label"?w:{...w,...d==="menu"&&{"aria-labelledby":f}}},[d,o,f,c]),b=v.useCallback(w=>{let{active:j,selected:C}=w;const T={role:"option",...j&&{id:o+"-option"}};switch(c){case"select":return{...T,"aria-selected":j&&C};case"combobox":return{...T,...j&&{"aria-selected":!0}}}return{}},[o,c]);return v.useMemo(()=>l?{reference:g,floating:x,item:b}:{},[l,g,x,b])}const[t5,Pi]=Rr("ScrollArea.Root component was not found in tree");function Ac(e,t){const n=Fs(t);Bc(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const n5=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Pi(),[l,c]=v.useState(0),[d,f]=v.useState(0),p=!!(l&&d);return Ac(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),Ac(o.scrollbarY,()=>{const m=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:l,height:d}}):null}),r5=v.forwardRef((e,t)=>{const n=Pi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(n5,{...e,ref:t}):null}),i5={scrollHideDelay:1e3,type:"hover"},E2=v.forwardRef((e,t)=>{const n=ae("ScrollAreaRoot",i5,e),{type:r,scrollHideDelay:o,scrollbars:l,...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),[T,E]=v.useState(0),[R,D]=v.useState(0),[P,A]=v.useState(!1),[k,M]=v.useState(!1),$=qn(t,U=>f(U));return a.jsx(t5,{value:{type:r,scrollHideDelay:o,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:x,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:P,onScrollbarXEnabledChange:A,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:k,onScrollbarYEnabledChange:M,onCornerWidthChange:E,onCornerHeightChange:D},children:a.jsx(ce,{...c,ref:$,__vars:{"--sa-corner-width":l!=="xy"?"0px":`${T}px`,"--sa-corner-height":l!=="xy"?"0px":`${R}px`}})})});E2.displayName="@mantine/core/ScrollAreaRoot";function T2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function Mp(e){const t=T2(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 o5(e,[t,n]){return Math.min(n,Math.max(t,e))}function XC(e,t,n="ltr"){const r=Mp(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-o,c=t.content-t.viewport,d=l-r,f=n==="ltr"?[0,c]:[c*-1,0],p=o5(e,f);return R2([0,c],[0,d])(p)}function a5(e,t,n,r="ltr"){const o=Mp(n),l=o/2,c=t||l,d=o-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 _2(e,t){return e>0&&e<t}function rs(e){return e?parseInt(e,10):0}function Js(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[s5,D2]=Rr("ScrollAreaScrollbar was not found in tree"),A2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,x=Pi(),[b,w]=v.useState(null),j=qn(t,M=>w(M)),C=v.useRef(null),T=v.useRef(""),{viewport:E}=x,R=n.content-n.viewport,D=Fs(p),P=Fs(d),A=Tp(m,10),k=M=>{if(C.current){const $=M.clientX-C.current.left,U=M.clientY-C.current.top;f({x:$,y:U})}};return v.useEffect(()=>{const M=$=>{const U=$.target;b?.contains(U)&&D($,R)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[E,b,R,D]),v.useEffect(P,[n,P]),Ac(b,A),Ac(x.content,A),a.jsx(s5,{value:{scrollbar:b,hasThumb:r,onThumbChange:Fs(o),onThumbPointerUp:Fs(l),onThumbPositionChange:P,onThumbPointerDown:Fs(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:Js(e.onPointerDown,M=>{M.preventDefault(),M.button===0&&(M.target.setPointerCapture(M.pointerId),C.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k(M))}),onPointerMove:Js(e.onPointerMove,k),onPointerUp:Js(e.onPointerUp,M=>{const $=M.target;$.hasPointerCapture(M.pointerId)&&(M.preventDefault(),$.releasePointerCapture(M.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),P2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...l}=e,c=Pi(),[d,f]=v.useState(),p=v.useRef(null),m=qn(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(A2,{"data-orientation":"horizontal",...l,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${Mp(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),_2(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:rs(d.paddingLeft),paddingEnd:rs(d.paddingRight)}})}})});P2.displayName="@mantine/core/ScrollAreaScrollbarX";const k2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...l}=e,c=Pi(),[d,f]=v.useState(),p=v.useRef(null),m=qn(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(A2,{...l,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${Mp(n)}px`,...o},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),_2(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:rs(d.paddingTop),paddingEnd:rs(d.paddingBottom)}})}})});k2.displayName="@mantine/core/ScrollAreaScrollbarY";const Lp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=ml(),l=Pi(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=T2(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)=>a5(b,d.current,f,w);return n==="horizontal"?a.jsx(P2,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&c.current){const b=l.viewport.scrollLeft,w=XC(b,f,o);c.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollLeft=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollLeft=x(b,o))}}):n==="vertical"?a.jsx(k2,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&c.current){const b=l.viewport.scrollTop,w=XC(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=>{l.viewport&&(l.viewport.scrollTop=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollTop=x(b))}}):null});Lp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const i0=v.forwardRef((e,t)=>{const n=Pi(),{forceMount:r,...o}=e,[l,c]=v.useState(!1),d=e.orientation==="horizontal",f=Tp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return Ac(n.viewport,f),Ac(n.content,f),r||l?a.jsx(Lp,{"data-state":l?"visible":"hidden",...o,ref:t}):null});i0.displayName="@mantine/core/ScrollAreaScrollbarAuto";const N2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Pi(),[l,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=o;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),n||l?a.jsx(i0,{"data-state":l?"visible":"hidden",...r,ref:t}):null});N2.displayName="@mantine/core/ScrollAreaScrollbarHover";const l5=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Pi(),l=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=Tp(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=o,m=l?"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)}},[o.viewport,l,f]),n||c!=="hidden"?a.jsx(Lp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Js(e.onPointerEnter,()=>d("interacting")),onPointerLeave:Js(e.onPointerLeave,()=>d("idle"))}):null}),Jy=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Pi(),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=o,d=e.orientation==="horizontal";return v.useEffect(()=>(d?l(!0):c(!0),()=>{d?l(!1):c(!1)}),[d,l,c]),o.type==="hover"?a.jsx(N2,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(l5,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx(i0,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(Lp,{...r,ref:t}):null});Jy.displayName="@mantine/core/ScrollAreaScrollbar";function c5(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const l={left:e.scrollLeft,top:e.scrollTop},c=n.left!==l.left,d=n.top!==l.top;(c||d)&&t(),n=l,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)}const O2=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Pi(),l=D2(),{onThumbPositionChange:c}=l,d=qn(t,m=>l.onThumbChange(m)),f=v.useRef(void 0),p=Tp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=o;if(m){const g=()=>{if(p(),!f.current){const x=c5(m,c);f.current=x,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,p,c]),a.jsx("div",{"data-state":l.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:Js(e.onPointerDownCapture,m=>{const x=m.target.getBoundingClientRect(),b=m.clientX-x.left,w=m.clientY-x.top;l.onThumbPointerDown({x:b,y:w})}),onPointerUp:Js(e.onPointerUp,l.onThumbPointerUp)})});O2.displayName="@mantine/core/ScrollAreaThumb";const ex=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=D2();return n||o.hasThumb?a.jsx(O2,{ref:t,...r}):null});ex.displayName="@mantine/core/ScrollAreaThumb";const M2=v.forwardRef(({children:e,style:t,...n},r)=>{const o=Pi(),l=qn(r,o.onViewportChange);return a.jsx(ce,{...n,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{style:{minWidth:"100%"},ref:o.onContentChange,children:e})})});M2.displayName="@mantine/core/ScrollAreaViewport";var o0={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const L2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},u5=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),ai=be((e,t)=>{const n=ae("ScrollArea",L2,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:x,viewportRef:b,onScrollPositionChange:w,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:E,onTopReached:R,overscrollBehavior:D,...P}=n,[A,k]=v.useState(!1),[M,$]=v.useState(!1),[U,J]=v.useState(!1),Z=$e({name:"ScrollArea",props:n,classes:o0,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:u5}),Y=v.useRef(null),H=N9([b,Y]);return v.useEffect(()=>{if(!Y.current||C!=="present")return;const Q=Y.current,O=new ResizeObserver(()=>{const{scrollHeight:I,clientHeight:z,scrollWidth:F,clientWidth:K}=Q;$(I>z),J(F>K)});return O.observe(Q),()=>O.disconnect()},[Y,C]),a.jsxs(E2,{type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...Z("root"),...P,children:[a.jsx(M2,{...x,...Z("viewport",{style:x?.style}),ref:H,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":C==="present"&&!U?"true":void 0,"data-vertical-hidden":C==="present"&&!M?"true":void 0,onScroll:Q=>{x?.onScroll?.(Q),w?.({x:Q.currentTarget.scrollLeft,y:Q.currentTarget.scrollTop});const{scrollTop:O,scrollHeight:I,clientHeight:z}=Q.currentTarget;O-(I-z)>=-.6&&E?.(),O===0&&R?.()},children:j}),(T==="xy"||T==="x")&&a.jsx(Jy,{...Z("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!U?!0:void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:a.jsx(ex,{...Z("thumb")})}),(T==="xy"||T==="y")&&a.jsx(Jy,{...Z("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!M?!0:void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:a.jsx(ex,{...Z("thumb")})}),a.jsx(r5,{...Z("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});ai.displayName="@mantine/core/ScrollArea";const Ip=be((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:l,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w,scrollbars:j,style:C,vars:T,onBottomReached:E,onTopReached:R,...D}=ae("ScrollAreaAutosize",L2,e);return a.jsx(ce,{...D,ref:t,style:[{display:"flex",overflow:"auto"},C],children:a.jsx(ce,{style:{display:"flex",flexDirection:"column",flex:1},children:a.jsx(ai,{classNames:r,styles:o,scrollHideDelay:c,scrollbarSize:l,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:x,variant:b,viewportProps:w,vars:T,scrollbars:j,onBottomReached:E,onTopReached:R,children:n})})})});ai.classes=o0;Ip.displayName="@mantine/core/ScrollAreaAutosize";Ip.classes=o0;ai.Autosize=Ip;var I2={root:"m_87cf2631"};const d5={__staticSelector:"UnstyledButton"},sr=gr((e,t)=>{const n=ae("UnstyledButton",d5,e),{className:r,component:o="button",__staticSelector:l,unstyled:c,classNames:d,styles:f,style:p,...m}=n,g=$e({name:l,props:n,classes:I2,className:r,style:p,classNames:d,styles:f,unstyled:c});return a.jsx(ce,{...g("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...m})});sr.classes=I2;sr.displayName="@mantine/core/UnstyledButton";var z2={root:"m_515a97f8"};const f5={},a0=be((e,t)=>{const n=ae("VisuallyHidden",f5,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,...p}=n,m=$e({name:"VisuallyHidden",classes:z2,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d});return a.jsx(ce,{component:"span",ref:t,...m("root"),...p})});a0.classes=z2;a0.displayName="@mantine/core/VisuallyHidden";var $2={root:"m_1b7284a3"};const h5={},p5=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:$t(t),"--paper-shadow":Ix(n)}}),Tr=gr((e,t)=>{const n=ae("Paper",h5,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:x,mod:b,...w}=n,j=$e({name:"Paper",props:n,classes:$2,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:p5});return a.jsx(ce,{ref:t,mod:[{"data-with-border":f},b],...j("root"),variant:x,...w})});Tr.classes=$2;Tr.displayName="@mantine/core/Paper";function U2(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}function ZC(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function JC(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const m5={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function g5({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:l,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[m5[f]]:r},g=-t/2;return f==="left"?{...m,...ZC(p,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...ZC(p,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...JC(p,l,n,o,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...JC(p,l,n,o,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const s0=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:l,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=ml();return l?a.jsx("div",{...p,ref:m,style:{...f,...g5({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:d})}}):null});s0.displayName="@mantine/core/FloatingArrow";var B2={root:"m_9814e45f"};const v5={zIndex:oi("modal")},y5=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:l,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&wi(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${le(o)})`:void 0,"--overlay-radius":l===void 0?void 0:$t(l),"--overlay-z-index":c?.toString()}}),Pc=gr((e,t)=>{const n=ae("Overlay",v5,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:x,zIndex:b,gradient:w,blur:j,color:C,backgroundOpacity:T,mod:E,...R}=n,D=$e({name:"Overlay",props:n,classes:B2,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:y5});return a.jsx(ce,{ref:t,...D("root"),mod:[{center:m,fixed:p},E],...R,children:g})});Pc.classes=B2;Pc.displayName="@mantine/core/Overlay";function cy(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 x5({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||cy(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=cy(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return cy(n)}const b5={},V2=be((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...l}=ae("Portal",b5,e),[c,d]=v.useState(!1),f=v.useRef(null);return Bc(()=>(d(!0),f.current=x5({target:r,reuseTargetNode:o,...l}),sd(t,f.current),!r&&!o&&f.current&&document.body.appendChild(f.current),()=>{!r&&!o&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:qx.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});V2.displayName="@mantine/core/Portal";const fs=be(({withinPortal:e=!0,children:t,...n},r)=>YR()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(V2,{ref:r,...n,children:t}));fs.displayName="@mantine/core/OptionalPortal";const Qu=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),yh={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:{...Qu("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Qu("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Qu("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Qu("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Qu("top"),common:{transformOrigin:"top right"}}},eE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function S5({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",willChange:"transform, opacity",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in yh?{transitionProperty:yh[e].transitionProperty,...o,...yh[e].common,...yh[e][eE[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[eE[t]]}}function w5({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:l,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=Sn(),g=$x(),x=m.respectReducedMotion?g:!1,[b,w]=v.useState(x?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),E=v.useRef(-1),R=v.useRef(-1);function D(){window.clearTimeout(T.current),window.clearTimeout(E.current),cancelAnimationFrame(R.current)}const P=k=>{D();const M=k?o:l,$=k?c:d,U=x?0:k?e:t;w(U),U===0?(typeof M=="function"&&M(),typeof $=="function"&&$(),C(k?"entered":"exited")):R.current=requestAnimationFrame(()=>{ed.flushSync(()=>{C(k?"pre-entering":"pre-exiting")}),R.current=requestAnimationFrame(()=>{typeof M=="function"&&M(),C(k?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof $=="function"&&$(),C(k?"entered":"exited")},U)})})},A=k=>{if(D(),typeof(k?f:p)!="number"){P(k);return}E.current=window.setTimeout(()=>{P(k)},k?f:p)};return oa(()=>{A(r)},[r]),v.useEffect(()=>()=>{D()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function _o({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:l,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x}){const b=YR(),{transitionDuration:w,transitionStatus:j,transitionTimingFunction:C}=w5({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:x});return w===0||b==="test"?o?a.jsx(a.Fragment,{children:l({})}):e?l({display:"none"}):null:j==="exited"?e?l({display:"none"}):null:a.jsx(a.Fragment,{children:l(S5({transition:t,duration:w,state:j,timingFunction:C}))})}_o.displayName="@mantine/core/Transition";const[j5,F2]=Rr("Popover component was not found in the tree");function zp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=YO(t),l=qn(o,r);return fa(e)?v.cloneElement(e,{[n]:l}):e}function H2(e){return a.jsx(a0,{tabIndex:-1,"data-autofocus":!0,...e})}zp.displayName="@mantine/core/FocusTrap";H2.displayName="@mantine/core/FocusTrapInitialFocus";zp.InitialFocus=H2;var q2={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const C5={},l0=be((e,t)=>{const n=ae("PopoverDropdown",C5,e),{className:r,style:o,vars:l,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,x=F2(),b=VR({opened:x.opened,shouldReturnFocus:x.returnFocus}),w=x.withRoles?{"aria-labelledby":x.getTargetId(),id:x.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=qn(t,x.floating);return x.disabled?null:a.jsx(fs,{...x.portalProps,withinPortal:x.withinPortal,children:a.jsx(_o,{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(zp,{active:x.trapFocus&&x.opened,innerRef:j,children:a.jsxs(ce,{...w,...g,variant:f,onKeyDownCapture:LO(()=>{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,o]}),children:[c,a.jsx(s0,{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})})]})})})})});l0.classes=q2;l0.displayName="@mantine/core/PopoverDropdown";const E5={refProp:"ref",popupType:"dialog"},G2=be((e,t)=>{const{children:n,refProp:r,popupType:o,...l}=ae("PopoverTarget",E5,e);if(!fa(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=l,d=F2(),f=qn(d.reference,Rp(n),t),p=d.withRoles?{"aria-haspopup":o,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...d.targetProps,className:Ot(d.targetProps.className,c.className,n.props.className),[r]:f,...d.controlled?null:{onClick:d.onToggle}})});G2.displayName="@mantine/core/PopoverTarget";function Q2({opened:e,floating:t,position:n,positionDependencies:r}){const[o,l]=v.useState(0);v.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return b9(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),oa(()=>{t.update()},r),oa(()=>{l(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 R5(e,t){const n=T5(e.middlewares),r=[b2(e.offset)];return n.shift&&r.push(Jx(typeof n.shift=="boolean"?{limiter:HC(),padding:5}:{limiter:HC(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Zh():Zh(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?rd():rd(n.inline)),r.push(S2({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(k9({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:l,availableHeight:c,...d}){const p=t().refs.floating.current?.style??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:o,availableWidth:l,availableHeight:c,...d}):Object.assign(p,{maxWidth:`${l}px`,maxHeight:`${c}px`})),e.width==="target"&&Object.assign(p,{width:`${o.reference.width}px`})}})),r}function _5(e){const[t,n]=Zn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=v.useRef(t),o=()=>{t&&!e.disabled&&n(!1)},l=()=>!e.disabled&&n(!t),c=r0({strategy:e.strategy,placement:e.position,middleware:R5(e,()=>c)});return Q2({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:c}),oa(()=>{e.onPositionChange?.(c.placement)},[c.placement]),oa(()=>{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:o,onToggle:l}}const D5={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:oi("popover"),__staticSelector:"Popover",width:"max-content"},A5=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:$t(t),"--popover-shadow":Ix(n)}});function Zi(e){const t=ae("Popover",D5,e),{children:n,position:r,offset:o,onPositionChange:l,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:x,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:E,classNames:R,styles:D,closeOnClickOutside:P,withinPortal:A,portalProps:k,closeOnEscape:M,clickOutsideEvents:$,trapFocus:U,onClose:J,onDismiss:Z,onOpen:Y,onChange:H,zIndex:Q,radius:O,shadow:I,id:z,defaultOpened:F,__staticSelector:K,withRoles:L,disabled:q,returnFocus:ie,variant:xe,keepMounted:ve,vars:Ce,floatingStrategy:Oe,withOverlay:Ee,overlayProps:Ge,...it}=t,St=$e({name:K,props:t,classes:q2,classNames:R,styles:D,unstyled:E,rootSelector:"dropdown",vars:Ce,varsResolver:A5}),{resolvedStyles:kt}=fl({classNames:R,styles:D,props:t}),Mt=v.useRef(null),[ct,bt]=v.useState(null),[Qt,Ae]=v.useState(null),{dir:De}=ml(),Ze=_r(z),_e=_5({middlewares:x,width:g,position:U2(De,r),offset:typeof o=="number"?o+(b?w/2:0):o,arrowRef:Mt,arrowOffset:j,onPositionChange:l,positionDependencies:c,opened:d,defaultOpened:F,onChange:H,onOpen:Y,onClose:J,onDismiss:Z,strategy:Oe,disabled:q});UO(()=>{P&&(_e.onClose(),Z?.())},$,[ct,Qt]);const ge=v.useCallback(ze=>{bt(ze),_e.floating.refs.setReference(ze)},[_e.floating.refs.setReference]),Se=v.useCallback(ze=>{Ae(ze),_e.floating.refs.setFloating(ze)},[_e.floating.refs.setFloating]),He=v.useCallback(()=>{f?.onExited?.(),p?.()},[f?.onExited,p]),me=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(j5,{value:{returnFocus:ie,disabled:q,controlled:_e.controlled,reference:ge,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:He,onEntered:me},width:g,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:_e.floating.placement,trapFocus:U,withinPortal:A,portalProps:k,zIndex:Q,radius:O,shadow:I,closeOnEscape:M,onDismiss:Z,onClose:_e.onClose,onToggle:_e.onToggle,getTargetId:()=>`${Ze}-target`,getDropdownId:()=>`${Ze}-dropdown`,withRoles:L,targetProps:it,__staticSelector:K,classNames:R,styles:D,unstyled:E,variant:xe,keepMounted:ve,getStyles:St,resolvedStyles:kt,floatingStrategy:Oe},children:[n,Ee&&a.jsx(_o,{transition:"fade",mounted:_e.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:ze=>a.jsx(fs,{withinPortal:A,children:a.jsx(Pc,{...Ge,...St("overlay",{className:Ge?.className,style:[ze,Ge?.style]})})})})]})}Zi.Target=G2;Zi.Dropdown=l0;Zi.displayName="@mantine/core/Popover";Zi.extend=e=>e;var Gi={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 W2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:Ot(Gi.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Gi.bar}),a.jsx("span",{className:Gi.bar}),a.jsx("span",{className:Gi.bar})]}));W2.displayName="@mantine/core/Bars";const Y2=v.forwardRef(({className:e,...t},n)=>a.jsxs(ce,{component:"span",className:Ot(Gi.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Gi.dot}),a.jsx("span",{className:Gi.dot}),a.jsx("span",{className:Gi.dot})]}));Y2.displayName="@mantine/core/Dots";const K2=v.forwardRef(({className:e,...t},n)=>a.jsx(ce,{component:"span",className:Ot(Gi.ovalLoader,e),...t,ref:n}));K2.displayName="@mantine/core/Oval";const X2={bars:W2,oval:K2,dots:Y2},P5={loaders:X2,type:"oval"},k5=(e,{size:t,color:n})=>({root:{"--loader-size":at(t,"loader-size"),"--loader-color":n?Ft(n,e):void 0}}),Fr=be((e,t)=>{const n=ae("Loader",P5,e),{size:r,color:o,type:l,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:x,variant:b,children:w,...j}=n,C=$e({name:"Loader",props:n,classes:Gi,className:d,style:f,classNames:p,styles:m,unstyled:g,vars:c,varsResolver:k5});return w?a.jsx(ce,{...C("root"),ref:t,...j,children:w}):a.jsx(ce,{...C("root"),ref:t,component:x[l],variant:b,size:r,...j})});Fr.defaultLoaders=X2;Fr.classes=Gi;Fr.displayName="@mantine/core/Loader";var Hc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const tE={orientation:"horizontal"},N5=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),c0=be((e,t)=>{const n=ae("ActionIconGroup",tE,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=ae("ActionIconGroup",tE,e),w=$e({name:"ActionIconGroup",props:n,classes:Hc,className:r,style:o,classNames:l,styles:c,unstyled:d,vars:p,varsResolver:N5,rootSelector:"group"});return a.jsx(ce,{...w("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});c0.classes=Hc;c0.displayName="@mantine/core/ActionIconGroup";const nE={},O5=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:l,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{groupSection:{"--section-height":at(c,"section-height"),"--section-padding-x":at(c,"section-padding-x"),"--section-fz":In(c),"--section-radius":t===void 0?void 0:$t(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},u0=be((e,t)=>{const n=ae("ActionIconGroupSection",nE,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=ae("ActionIconGroupSection",nE,e),w=$e({name:"ActionIconGroupSection",props:n,classes:Hc,className:r,style:o,classNames:l,styles:c,unstyled:d,vars:f,varsResolver:O5,rootSelector:"groupSection"});return a.jsx(ce,{...w("groupSection"),ref:t,variant:p,...b})});u0.classes=Hc;u0.displayName="@mantine/core/ActionIconGroupSection";const M5={},L5=(e,{size:t,radius:n,variant:r,gradient:o,color:l,autoContrast:c})=>{const d=e.variantColorResolver({color:l||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":at(t,"ai-size"),"--ai-radius":n===void 0?void 0:$t(n),"--ai-bg":l||r?d.background:void 0,"--ai-hover":l||r?d.hover:void 0,"--ai-hover-color":l||r?d.hoverColor:void 0,"--ai-color":d.color,"--ai-bd":l||r?d.border:void 0}}},bn=gr((e,t)=>{const n=ae("ActionIcon",M5,e),{className:r,unstyled:o,variant:l,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:x,radius:b,__staticSelector:w,gradient:j,vars:C,children:T,disabled:E,"data-disabled":R,autoContrast:D,mod:P,...A}=n,k=$e({name:["ActionIcon",w],props:n,className:r,style:f,classes:Hc,classNames:c,styles:d,unstyled:o,vars:C,varsResolver:L5});return a.jsxs(sr,{...k("root",{active:!E&&!p&&!R}),...A,unstyled:o,variant:l,size:g,disabled:E||p,ref:t,mod:[{loading:p,disabled:E||R},P],children:[a.jsx(_o,{mounted:!!p,transition:"slide-down",duration:150,children:M=>a.jsx(ce,{component:"span",...k("loader",{style:M}),"aria-hidden":!0,children:a.jsx(Fr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ce,{component:"span",mod:{loading:p},...k("icon"),children:T})]})});bn.classes=Hc;bn.displayName="@mantine/core/ActionIcon";bn.Group=c0;bn.GroupSection=u0;const Z2=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"})}));Z2.displayName="@mantine/core/CloseIcon";var J2={root:"m_86a44da5","root--subtle":"m_220c80f2"};const I5={variant:"subtle"},z5=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":at(t,"cb-size"),"--cb-radius":n===void 0?void 0:$t(n),"--cb-icon-size":le(r)}}),hs=gr((e,t)=>{const n=ae("CloseButton",I5,e),{iconSize:r,children:o,vars:l,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":x,disabled:b,variant:w,icon:j,mod:C,__staticSelector:T,...E}=n,R=$e({name:T||"CloseButton",props:n,className:d,style:p,classes:J2,classNames:f,styles:m,unstyled:g,vars:l,varsResolver:z5});return a.jsxs(sr,{ref:t,...E,unstyled:g,variant:w,disabled:b,mod:[{disabled:b||x},C],...R("root",{variant:w,active:!b&&!x}),children:[j||a.jsx(Z2,{}),o]})});hs.classes=J2;hs.displayName="@mantine/core/CloseButton";function $5(e){return v.Children.toArray(e).filter(Boolean)}var e_={root:"m_4081bf90"};const U5={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},B5=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:l,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":Ln(r),"--group-align":o,"--group-justify":l,"--group-wrap":c}}),ye=be((e,t)=>{const n=ae("Group",U5,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:x,grow:b,preventGrowOverflow:w,vars:j,variant:C,__size:T,mod:E,...R}=n,D=$5(f),P=D.length,A=Ln(p??"md"),M={childWidth:`calc(${100/P}% - (${A} - ${A} / ${P}))`},$=$e({name:"Group",props:n,stylesCtx:M,className:o,style:l,classes:e_,classNames:r,styles:c,unstyled:d,vars:j,varsResolver:B5});return a.jsx(ce,{...$("root"),ref:t,variant:C,mod:[{grow:b},E],size:T,...R,children:D})});ye.classes=e_;ye.displayName="@mantine/core/Group";const[V5,va]=Rr("ModalBase component was not found in tree");function F5({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=$x()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):c===0?r(!1):o.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(o.current)),[e,c]),n}function H5({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:l,returnFocus:c}){const d=_r(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),x=typeof t?.duration=="number"?t?.duration:200,b=F5({opened:n,transitionDuration:x});return GR("keydown",w=>{w.key==="Escape"&&o&&!w.isComposing&&n&&w.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&l()},{capture:!0}),VR({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const t_=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:l,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:x,lockScroll:b,children:w,zIndex:j,shadow:C,padding:T,__vars:E,unstyled:R,removeScrollProps:D,...P},A)=>{const{_id:k,titleMounted:M,bodyMounted:$,shouldLockScroll:U,setTitleMounted:J,setBodyMounted:Z}=H5({id:r,transitionProps:o,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:Y,...H}=D||{};return a.jsx(fs,{...x,withinPortal:g,children:a.jsx(V5,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:l,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${k}-title`,getBodyId:()=>`${k}-body`,titleMounted:M,bodyMounted:$,setTitleMounted:J,setBodyMounted:Z,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:R},children:a.jsx(_c,{enabled:U&&b,...H,children:a.jsx(ce,{ref:A,...P,__vars:{...E,"--mb-z-index":(j||oi("modal")).toString(),"--mb-shadow":Ix(C),"--mb-padding":Ln(T)},children:w})},Y)})})});t_.displayName="@mantine/core/ModalBase";function q5(){const e=va();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var kc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const n_=v.forwardRef(({className:e,...t},n)=>{const r=q5(),o=va();return a.jsx(ce,{ref:n,...t,id:r,className:Ot({[kc.body]:!o.unstyled},e)})});n_.displayName="@mantine/core/ModalBaseBody";const r_=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=va();return a.jsx(hs,{ref:r,...n,onClick:l=>{o.onClose(),t?.(l)},className:Ot({[kc.close]:!o.unstyled},e),unstyled:o.unstyled})});r_.displayName="@mantine/core/ModalBaseCloseButton";const i_=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...l},c)=>{const d=va();return a.jsx(_o,{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:Ot({[kc.inner]:!d.unstyled},n.className),children:a.jsx(zp,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(Tr,{...l,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:[o,f],className:Ot({[kc.content]:!d.unstyled},t),unstyled:d.unstyled,children:l.children})})})})});i_.displayName="@mantine/core/ModalBaseContent";const o_=v.forwardRef(({className:e,...t},n)=>{const r=va();return a.jsx(ce,{component:"header",ref:n,className:Ot({[kc.header]:!r.unstyled},e),...t})});o_.displayName="@mantine/core/ModalBaseHeader";const G5={duration:200,timingFunction:"ease",transition:"fade"};function Q5(e){const t=va();return{...G5,...t.transitionProps,...e}}const a_=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},l)=>{const c=va(),d=Q5(t);return a.jsx(_o,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(Pc,{ref:l,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...o})})});a_.displayName="@mantine/core/ModalBaseOverlay";function W5(){const e=va();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const s_=v.forwardRef(({className:e,...t},n)=>{const r=W5(),o=va();return a.jsx(ce,{component:"h2",ref:n,className:Ot({[kc.title]:!o.unstyled},e),...t,id:r})});s_.displayName="@mantine/core/ModalBaseTitle";function Y5({children:e}){return a.jsx(a.Fragment,{children:e})}const[K5,X5]=ha({size:"sm"}),Z5={},l_=be((e,t)=>{const n=ae("InputClearButton",Z5,e),{size:r,variant:o,vars:l,classNames:c,styles:d,...f}=n,p=X5(),{resolvedClassNames:m,resolvedStyles:g}=fl({classNames:c,styles:d,props:n});return a.jsx(hs,{variant:o||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",...f})});l_.displayName="@mantine/core/InputClearButton";const[J5,qc]=ha({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var ki={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 rE={},eL=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${In(t)} - ${le(2)})`}}),$p=be((e,t)=>{const n=ae("InputDescription",rE,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=ae("InputDescription",rE,n),w=qc(),j=$e({name:["InputWrapper",m],props:n,classes:ki,className:o,style:l,classNames:r,styles:c,unstyled:d,rootSelector:"description",vars:f,varsResolver:eL}),C=g&&w?.getStyles||j;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("description",w?.getStyles?{className:o,style:l}:void 0),...b})});$p.classes=ki;$p.displayName="@mantine/core/InputDescription";const tL={},nL=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${In(t)} - ${le(2)})`}}),Up=be((e,t)=>{const n=ae("InputError",tL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,variant:x,...b}=n,w=$e({name:["InputWrapper",m],props:n,classes:ki,className:o,style:l,classNames:r,styles:c,unstyled:d,rootSelector:"error",vars:f,varsResolver:nL}),j=qc(),C=g&&j?.getStyles||w;return a.jsx(ce,{component:"p",ref:t,variant:x,size:p,...C("error",j?.getStyles?{className:o,style:l}:void 0),...b})});Up.classes=ki;Up.displayName="@mantine/core/InputError";const iE={labelElement:"label"},rL=(e,{size:t})=>({label:{"--input-label-size":In(t),"--input-asterisk-color":void 0}}),Ed=be((e,t)=>{const n=ae("InputLabel",iE,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:x,onMouseDown:b,children:w,__staticSelector:j,variant:C,mod:T,...E}=ae("InputLabel",iE,n),R=$e({name:["InputWrapper",j],props:n,classes:ki,className:o,style:l,classNames:r,styles:c,unstyled:d,rootSelector:"label",vars:f,varsResolver:rL}),D=qc(),P=D?.getStyles||R;return a.jsxs(ce,{...P("label",D?.getStyles?{className:o,style:l}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?x:void 0,mod:[{required:g},T],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...E,children:[w,g&&a.jsx("span",{...P("required"),"aria-hidden":!0,children:" *"})]})});Ed.classes=ki;Ed.displayName="@mantine/core/InputLabel";const oE={},d0=be((e,t)=>{const n=ae("InputPlaceholder",oE,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:x,...b}=ae("InputPlaceholder",oE,n),w=$e({name:["InputPlaceholder",p],props:n,classes:ki,className:o,style:l,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})});d0.classes=ki;d0.displayName="@mantine/core/InputPlaceholder";function iL(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),o=e.slice(0,r),l=e.slice(r+1),c=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&l.includes("description")||n&&l.includes("error"),offsetTop:c}}const oL={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},aL=(e,{size:t})=>({label:{"--input-label-size":In(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${In(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${In(t)} - ${le(2)})`}}),Td=be((e,t)=>{const n=ae("InputWrapper",oL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:x,inputWrapperOrder:b,label:w,error:j,description:C,labelProps:T,descriptionProps:E,errorProps:R,labelElement:D,children:P,withAsterisk:A,id:k,required:M,__stylesApiProps:$,mod:U,...J}=n,Z=$e({name:["InputWrapper",g],props:$||n,classes:ki,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:aL}),Y={size:p,variant:m,__staticSelector:g},H=_r(k),Q=typeof A=="boolean"?A:M,O=R?.id||`${H}-error`,I=E?.id||`${H}-description`,z=H,F=!!j&&typeof j!="boolean",K=!!C,L=`${F?O:""} ${K?I:""}`,q=L.trim().length>0?L.trim():void 0,ie=T?.id||`${H}-label`,xe=w&&a.jsx(Ed,{labelElement:D,id:ie,htmlFor:z,required:Q,...Y,...T,children:w},"label"),ve=K&&a.jsx($p,{...E,...Y,size:E?.size||Y.size,id:E?.id||I,children:C},"description"),Ce=a.jsx(v.Fragment,{children:x(P)},"input"),Oe=F&&v.createElement(Up,{...R,...Y,size:R?.size||Y.size,key:"error",id:R?.id||O},j),Ee=b.map(Ge=>{switch(Ge){case"label":return xe;case"input":return Ce;case"description":return ve;case"error":return Oe;default:return null}});return a.jsx(J5,{value:{getStyles:Z,describedBy:q,inputId:z,labelId:ie,...iL(b,{hasDescription:K,hasError:F})},children:a.jsx(ce,{ref:t,variant:m,size:p,mod:[{error:!!j},U],...Z("root"),...J,children:Ee})})});Td.classes=ki;Td.displayName="@mantine/core/InputWrapper";const sL={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},lL=(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":at(t.size,"input-height"),"--input-fz":In(t.size),"--input-radius":t.radius===void 0?void 0:$t(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?at(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),un=gr((e,t)=>{const n=ae("Input",sL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:x,error:b,disabled:w,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:E,rightSectionProps:R,rightSectionWidth:D,rightSectionPointerEvents:P,leftSectionPointerEvents:A,variant:k,vars:M,pointer:$,multiline:U,radius:J,id:Z,withAria:Y,withErrorStyles:H,mod:Q,inputSize:O,__clearSection:I,__clearable:z,__defaultRightSection:F,...K}=n,{styleProps:L,rest:q}=ga(K),ie=qc(),xe={offsetBottom:ie?.offsetBottom,offsetTop:ie?.offsetTop},ve=$e({name:["Input",p],props:m||n,classes:ki,className:o,style:l,classNames:r,styles:c,unstyled:d,stylesCtx:xe,rootSelector:"wrapper",vars:M,varsResolver:lL}),Ce=Y?{required:f,disabled:w,"aria-invalid":!!b,"aria-describedby":ie?.describedBy,id:ie?.inputId||Z}:{},Oe=E||z&&I||F;return a.jsx(K5,{value:{size:g||"sm"},children:a.jsxs(ce,{...ve("wrapper"),...L,...x,mod:[{error:!!b&&H,pointer:$,disabled:w,multiline:U,"data-with-right-section":!!Oe,"data-with-left-section":!!j},Q],variant:k,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...ve("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(ce,{component:"input",...q,...Ce,ref:t,required:f,mod:{disabled:w,error:!!b&&H},variant:k,__size:O,...ve("input")}),Oe&&a.jsx("div",{...R,"data-position":"right",...ve("section",{className:R?.className,style:R?.style}),children:Oe})]})})});un.classes=ki;un.Wrapper=Td;un.Label=Ed;un.Error=Up;un.Description=$p;un.Placeholder=d0;un.ClearButton=l_;un.displayName="@mantine/core/Input";function cL(e,t,n){const r=ae(e,t,n),{label:o,description:l,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:x,__stylesApiProps:b,errorProps:w,labelProps:j,descriptionProps:C,wrapperProps:T,id:E,size:R,style:D,inputContainer:P,inputWrapperOrder:A,withAsterisk:k,variant:M,vars:$,mod:U,...J}=r,{styleProps:Z,rest:Y}=ga(J),H={label:o,description:l,error:c,required:d,classNames:f,className:m,__staticSelector:x,__stylesApiProps:b||r,errorProps:w,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:R,style:D,inputContainer:P,inputWrapperOrder:A,withAsterisk:k,variant:M,id:E,mod:U,...T};return{...Y,classNames:f,styles:p,unstyled:g,wrapperProps:{...H,...Z},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:R,__staticSelector:x,__stylesApiProps:b||r,error:c,variant:M,id:E}}}const uL={__staticSelector:"InputBase",withAria:!0},Dr=gr((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=cL("InputBase",uL,e);return a.jsx(un.Wrapper,{...r,children:a.jsx(un,{...n,...o,ref:t})})});Dr.classes={...un.classes,...un.Wrapper.classes};Dr.displayName="@mantine/core/InputBase";const dL={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 c_={root:"m_8bffd616"};const fL={},jo=gr((e,t)=>{const n=ae("Flex",fL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:w,direction:j,...C}=n,T=$e({name:"Flex",classes:c_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f}),E=Sn(),R=jd(),D=e2({styleProps:{gap:p,rowGap:m,columnGap:g,align:x,justify:b,wrap:w,direction:j},theme:E,data:dL});return a.jsxs(a.Fragment,{children:[D.hasResponsiveStyles&&a.jsx(pl,{selector:`.${R}`,styles:D.styles,media:D.media}),a.jsx(ce,{ref:t,...T("root",{className:R,style:ds(D.inlineStyles)}),...C})]})});jo.classes=c_;jo.displayName="@mantine/core/Flex";function hL(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 pL({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=v.useRef(-1),[l,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),T=rs(j.borderTopWidth)+rs(C.borderTopWidth),E=rs(j.borderLeftWidth)+rs(C.borderLeftWidth),R={top:b.top-w.top-T,left:b.left-w.left-E,width:b.width,height:b.height};n.current.style.transform=`translateY(${R.top}px) translateX(${R.left}px)`,n.current.style.width=`${R.width}px`,n.current.style.height=`${R.height}px`},m=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.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=>{hL(w.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),o4(()=>{QR()!=="test"&&c(!0)},20,{autoInvoke:!0}),a4(b=>{b.forEach(w=>{w.type==="attributes"&&w.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:l,hidden:d}}var u_={root:"m_96b553a6"};const mL={},gL=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),f0=be((e,t)=>{const n=ae("FloatingIndicator",mL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:x,displayAfterTransitionEnd:b,...w}=n,j=$e({name:"FloatingIndicator",classes:u_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:gL}),C=v.useRef(null),{initialized:T,hidden:E}=pL({target:p,parent:m,ref:C,displayAfterTransitionEnd:b}),R=qn(t,C);return!p||!m?null:a.jsx(ce,{ref:R,mod:[{initialized:T,hidden:E},x],...j("root"),...w})});f0.displayName="@mantine/core/FloatingIndicator";f0.classes=u_;var d_={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 vL={},yL=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:$t(t),"--alert-bg":n||r?l.background:void 0,"--alert-color":l.color,"--alert-bd":n||r?l.border:void 0}}},ya=be((e,t)=>{const n=ae("Alert",vL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:x,id:b,icon:w,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:E,autoContrast:R,...D}=n,P=$e({name:"Alert",classes:d_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:yL}),A=_r(b),k=g&&`${A}-title`||void 0,M=`${A}-body`;return a.jsx(ce,{id:A,...P("root",{variant:E}),variant:E,ref:t,...D,role:"alert","aria-describedby":M,"aria-labelledby":k,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:k,...P("label"),children:g})}),x&&a.jsx("div",{id:M,...P("message"),"data-variant":E,children:x})]}),j&&a.jsx(hs,{...P("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:d})]})})});ya.classes=d_;ya.displayName="@mantine/core/Alert";var f_={root:"m_b6d8b162"};function xL(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const bL={inherit:!1},SL=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:l})=>({root:{"--text-fz":In(o),"--text-lh":$R(o),"--text-gradient":t==="gradient"?Hy(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":l?Ft(l,e):void 0}}),Te=gr((e,t)=>{const n=ae("Text",bL,e),{lineClamp:r,truncate:o,inline:l,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:x,classNames:b,styles:w,unstyled:j,variant:C,mod:T,size:E,...R}=n,D=$e({name:["Text",p],props:n,classes:f_,className:g,style:x,classNames:b,styles:w,unstyled:j,vars:m,varsResolver:SL});return a.jsx(ce,{...D("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":xL(o),"data-line-clamp":typeof r=="number","data-inline":l,"data-inherit":c},T],size:E,...R})});Te.classes=f_;Te.displayName="@mantine/core/Text";var h_={root:"m_849cf0da"};const wL={underline:"hover"},Dt=gr((e,t)=>{const{underline:n,className:r,unstyled:o,mod:l,...c}=ae("Anchor",wL,e);return a.jsx(Te,{component:"a",ref:t,className:Ot({[h_.root]:!o},r),...c,mod:[{underline:n},l],__staticSelector:"Anchor",unstyled:o})});Dt.classes=h_;Dt.displayName="@mantine/core/Anchor";const[jL,Gc]=Rr("AppShell was not found in tree");var ps={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const CL={},h0=be((e,t)=>{const n=ae("AppShellAside",CL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Gc();return b.disabled?null:a.jsx(ce,{component:"aside",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("aside",{className:o,classNames:r,styles:c,style:l}),...x,__vars:{"--app-shell-aside-z-index":`calc(${m??b.zIndex} + 1)`}})});h0.classes=ps;h0.displayName="@mantine/core/AppShellAside";const EL={},p0=be((e,t)=>{const n=ae("AppShellFooter",EL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Gc();return b.disabled?null:a.jsx(ce,{component:"footer",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("footer",{className:Ot({[_c.classNames.zeroRight]:b.offsetScrollbars},o),classNames:r,styles:c,style:l}),...x,__vars:{"--app-shell-footer-z-index":(m??b.zIndex)?.toString()}})});p0.classes=ps;p0.displayName="@mantine/core/AppShellFooter";const TL={},m0=be((e,t)=>{const n=ae("AppShellHeader",TL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Gc();return b.disabled?null:a.jsx(ce,{component:"header",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("header",{className:Ot({[_c.classNames.zeroRight]:b.offsetScrollbars},o),classNames:r,styles:c,style:l}),...x,__vars:{"--app-shell-header-z-index":(m??b.zIndex)?.toString()}})});m0.classes=ps;m0.displayName="@mantine/core/AppShellHeader";const RL={},g0=be((e,t)=>{const n=ae("AppShellMain",RL,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=Gc();return a.jsx(ce,{component:"main",ref:t,...p.getStyles("main",{className:o,style:l,classNames:r,styles:c}),...f})});g0.classes=ps;g0.displayName="@mantine/core/AppShellMain";function Rd(e){return typeof e=="object"?e.base:e}function _d(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 Dd(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function _L({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){const l=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"),_d(l)){const f=le(Rd(l));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Dd(l)&&(typeof l.base<"u"&&(e["--app-shell-aside-width"]=le(l.base),e["--app-shell-aside-offset"]=le(l.base)),rn(l).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=le(l[f]),t[f]["--app-shell-aside-offset"]=le(l[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=zx(r.breakpoint,o.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 DL({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,o="translateY(var(--app-shell-footer-height))",l=n?.offset??!0;if(_d(r)){const c=le(Rd(r));e["--app-shell-footer-height"]=c,l&&(e["--app-shell-footer-offset"]=c)}Dd(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),l&&(e["--app-shell-footer-offset"]=le(r.base))),rn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),l&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function AL({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,o="translateY(calc(var(--app-shell-header-height) * -1))",l=n?.offset??!0;if(_d(r)){const c=le(Rd(r));e["--app-shell-header-height"]=c,l&&(e["--app-shell-header-offset"]=c)}Dd(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),l&&(e["--app-shell-header-offset"]=le(r.base))),rn(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),l&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function PL({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){const l=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"),_d(l)){const f=le(Rd(l));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Dd(l)&&(typeof l.base<"u"&&(e["--app-shell-navbar-width"]=le(l.base),e["--app-shell-navbar-offset"]=le(l.base)),rn(l).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=le(l[f]),t[f]["--app-shell-navbar-offset"]=le(l[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=zx(r.breakpoint,o.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 uy(e){return Number(e)===0?"0px":Ln(e)}function kL({padding:e,baseStyles:t,minMediaStyles:n}){_d(e)&&(t["--app-shell-padding"]=uy(Rd(e))),Dd(e)&&(e.base&&(t["--app-shell-padding"]=uy(e.base)),rn(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=uy(e[r]))}))}function NL({navbar:e,header:t,footer:n,aside:r,padding:o,theme:l}){const c={},d={},f={};PL({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:l}),_L({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:l}),AL({baseStyles:f,minMediaStyles:c,header:t}),DL({baseStyles:f,minMediaStyles:c,footer:n}),kL({baseStyles:f,minMediaStyles:c,padding:o});const p=ad(rn(c),l.breakpoints).map(x=>({query:`(min-width: ${Hh(x.px)})`,styles:c[x.value]})),m=ad(rn(d),l.breakpoints).map(x=>({query:`(max-width: ${Hh(x.px)})`,styles:d[x.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function OL({navbar:e,header:t,aside:n,footer:r,padding:o}){const l=Sn(),c=pa(),{media:d,baseStyles:f}=NL({navbar:e,header:t,footer:r,aside:n,padding:o,theme:l});return a.jsx(pl,{media:d,styles:f,selector:c.cssVariablesSelector})}const ML={},v0=be((e,t)=>{const n=ae("AppShellNavbar",ML,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,withBorder:p,zIndex:m,mod:g,...x}=n,b=Gc();return b.disabled?null:a.jsx(ce,{component:"nav",ref:t,mod:[{"with-border":p??b.withBorder},g],...b.getStyles("navbar",{className:o,classNames:r,styles:c,style:l}),...x,__vars:{"--app-shell-navbar-z-index":`calc(${m??b.zIndex} + 1)`}})});v0.classes=ps;v0.displayName="@mantine/core/AppShellNavbar";const LL={},y0=gr((e,t)=>{const n=ae("AppShellSection",LL,e),{classNames:r,className:o,style:l,styles:c,vars:d,grow:f,mod:p,...m}=n,g=Gc();return a.jsx(ce,{ref:t,mod:[{grow:f},p],...g.getStyles("section",{className:o,style:l,classNames:r,styles:c}),...m})});y0.classes=ps;y0.displayName="@mantine/core/AppShellSection";function IL({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),l=v.useRef(-1);return GR("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),Bc(()=>{r(!0),clearTimeout(l.current),l.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const zL={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:oi("app")},$L=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Vr=be((e,t)=>{const n=ae("AppShell",zL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:x,transitionTimingFunction:b,header:w,zIndex:j,layout:C,disabled:T,aside:E,footer:R,offsetScrollbars:D=C!=="alt",mod:P,...A}=n,k=$e({name:"AppShell",classes:ps,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:$L}),M=IL({disabled:T,transitionDuration:x});return a.jsxs(jL,{value:{getStyles:k,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:D},children:[a.jsx(OL,{navbar:p,header:w,aside:E,footer:R,padding:g}),a.jsx(ce,{ref:t,...k("root"),mod:[{resizing:M,layout:C,disabled:T},P],...A})]})});Vr.classes=ps;Vr.displayName="@mantine/core/AppShell";Vr.Navbar=v0;Vr.Header=m0;Vr.Main=g0;Vr.Aside=h0;Vr.Footer=p0;Vr.Section=y0;function p_(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=>p_(t))}:e}function m_(e){return e?e.map(t=>p_(t)):[]}function g_(e){return e.reduce((t,n)=>"group"in n?{...t,...g_(n.items)}:(t[n.value]=n,t),{})}var Hr={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 UL={error:null},BL=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":at(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Ft(n,e):void 0}}),Bp=be((e,t)=>{const n=ae("ComboboxChevron",UL,e),{size:r,error:o,style:l,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...x}=n,b=$e({name:"ComboboxChevron",classes:Hr,props:n,style:l,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:BL,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:o},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"})})});Bp.classes=Hr;Bp.displayName="@mantine/core/ComboboxChevron";const[VL,Ni]=Rr("Combobox component was not found in tree"),v_=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},l)=>a.jsx(un.ClearButton,{ref:l,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));v_.displayName="@mantine/core/ComboboxClearButton";const FL={},x0=be((e,t)=>{const{classNames:n,styles:r,className:o,style:l,hidden:c,...d}=ae("ComboboxDropdown",FL,e),f=Ni();return a.jsx(Zi.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:o,style:l,classNames:n,styles:r})})});x0.classes=Hr;x0.displayName="@mantine/core/ComboboxDropdown";const HL={refProp:"ref"},y_=be((e,t)=>{const{children:n,refProp:r}=ae("ComboboxDropdownTarget",HL,e);if(Ni(),!fa(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(Zi.Target,{ref:t,refProp:r,children:n})});y_.displayName="@mantine/core/ComboboxDropdownTarget";const qL={},b0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("ComboboxEmpty",qL,e),f=Ni();return a.jsx(ce,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:l,style:o}),...d})});b0.classes=Hr;b0.displayName="@mantine/core/ComboboxEmpty";function S0({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:l}){const c=Ni(),[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()):o==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&o==="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:l,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const GL={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},x_=be((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:l,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=ae("ComboboxEventsTarget",GL,e);if(!fa(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=Ni(),g=S0({targetType:d,withAriaAttributes:l,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:qn(t,m.store.targetRef,Rp(n))})});x_.displayName="@mantine/core/ComboboxEventsTarget";const QL={},w0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("ComboboxFooter",QL,e),f=Ni();return a.jsx(ce,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:l}),...d,onMouseDown:p=>{p.preventDefault()}})});w0.classes=Hr;w0.displayName="@mantine/core/ComboboxFooter";const WL={},j0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,children:d,label:f,...p}=ae("ComboboxGroup",WL,e),m=Ni();return a.jsxs(ce,{ref:t,...m.getStyles("group",{className:r,classNames:n,style:o,styles:l}),...p,children:[f&&a.jsx("div",{...m.getStyles("groupLabel",{classNames:n,styles:l}),children:f}),d]})});j0.classes=Hr;j0.displayName="@mantine/core/ComboboxGroup";const YL={},C0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("ComboboxHeader",YL,e),f=Ni();return a.jsx(ce,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:l}),...d,onMouseDown:p=>{p.preventDefault()}})});C0.classes=Hr;C0.displayName="@mantine/core/ComboboxHeader";function b_({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}b_.displayName="@mantine/core/ComboboxHiddenInput";const KL={},E0=be((e,t)=>{const n=ae("ComboboxOption",KL,e),{classNames:r,className:o,style:l,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:x,disabled:b,selected:w,mod:j,...C}=n,T=Ni(),E=v.useId(),R=p||E;return a.jsx(ce,{...T.getStyles("option",{className:o,classNames:r,styles:c,style:l}),...C,ref:t,id:R,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":w},j],role:"option",onClick:D=>{b?D.preventDefault():(T.onOptionSubmit?.(n.value,n),f?.(D))},onMouseDown:D=>{D.preventDefault(),g?.(D)},onMouseOver:D=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),x?.(D)}})});E0.classes=Hr;E0.displayName="@mantine/core/ComboboxOption";const XL={},T0=be((e,t)=>{const n=ae("ComboboxOptions",XL,e),{classNames:r,className:o,style:l,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=Ni(),x=_r(d);return v.useEffect(()=>{g.store.setListId(x)},[x]),a.jsx(ce,{ref:t,...g.getStyles("options",{className:o,style:l,classNames:r,styles:c}),...m,id:x,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});T0.classes=Hr;T0.displayName="@mantine/core/ComboboxOptions";const ZL={withAriaAttributes:!0,withKeyboardNavigation:!0},R0=be((e,t)=>{const n=ae("ComboboxSearch",ZL,e),{classNames:r,styles:o,unstyled:l,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,x=Ni(),b=x.getStyles("search"),w=S0({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(un,{ref:qn(t,x.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},o],size:m||x.size,...w,...g,__staticSelector:"Combobox"})});R0.classes=Hr;R0.displayName="@mantine/core/ComboboxSearch";const JL={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},S_=be((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:l,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=ae("ComboboxTarget",JL,e);if(!fa(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=Ni(),g=S0({targetType:d,withAriaAttributes:l,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),x=v.cloneElement(n,{...g,...p});return a.jsx(Zi.Target,{ref:qn(t,m.store.targetRef),children:x})});S_.displayName="@mantine/core/ComboboxTarget";function e7(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function t7(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function n7(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function gl({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:l=!0,scrollBehavior:c="instant"}={}){const[d,f]=Zn({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((O="unknown")=>{d||(f(!0),o?.(O))},[f,o,d]),T=v.useCallback((O="unknown")=>{d&&(f(!1),r?.(O))},[f,r,d]),E=v.useCallback((O="unknown")=>{d?T(O):C(O)},[T,C,d]),R=v.useCallback(()=>{const O=document.querySelector(`#${p.current} [data-combobox-selected]`);O?.removeAttribute("data-combobox-selected"),O?.removeAttribute("aria-selected")},[]),D=v.useCallback(O=>{const z=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!z)return null;const F=O>=z.length?0:O<0?z.length-1:O;return m.current=F,z?.[F]&&!z[F].hasAttribute("data-combobox-disabled")?(R(),z[F].setAttribute("data-combobox-selected","true"),z[F].setAttribute("aria-selected","true"),z[F].scrollIntoView({block:"nearest",behavior:c}),z[F].id):null},[c,R]),P=v.useCallback(()=>{const O=document.querySelector(`#${p.current} [data-combobox-active]`);if(O){const I=document.querySelectorAll(`#${p.current} [data-combobox-option]`),z=Array.from(I).findIndex(F=>F===O);return D(z)}return D(0)},[D]),A=v.useCallback(()=>D(t7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),l)),[D,l]),k=v.useCallback(()=>D(e7(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),l)),[D,l]),M=v.useCallback(()=>D(n7(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[D]),$=v.useCallback((O="selected",I)=>{j.current=window.setTimeout(()=>{const z=document.querySelectorAll(`#${p.current} [data-combobox-option]`),F=Array.from(z).findIndex(K=>K.hasAttribute(`data-combobox-${O}`));m.current=F,I?.scrollIntoView&&z[F]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),U=v.useCallback(()=>{m.current=-1,R()},[R]),J=v.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[m.current]?.click()},[]),Z=v.useCallback(O=>{p.current=O},[]),Y=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current.focus(),0)},[]),H=v.useCallback(()=>{w.current=window.setTimeout(()=>x.current.focus(),0)},[]),Q=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(w.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:T,toggleDropdown:E,selectedOptionIndex:m.current,getSelectedOptionIndex:Q,selectOption:D,selectFirstOption:M,selectActiveOption:P,selectNextOption:A,selectPreviousOption:k,resetSelectedOption:U,updateSelectedOptionIndex:$,listId:p.current,setListId:Z,clickSelectedOption:J,searchRef:g,focusSearchInput:Y,targetRef:x,focusTarget:H}}const r7={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},i7=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":In(t),"--combobox-option-padding":at(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":In(t),"--combobox-option-padding":at(t,"combobox-option-padding")}});function Xe(e){const t=ae("Combobox",r7,e),{classNames:n,styles:r,unstyled:o,children:l,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:x,__staticSelector:b,readOnly:w,...j}=t,C=gl(),T=c||C,E=$e({name:b||"Combobox",classes:Hr,props:t,classNames:n,styles:r,unstyled:o,vars:d,varsResolver:i7}),R=()=>{p?.(),T.closeDropdown()};return a.jsx(VL,{value:{getStyles:E,store:T,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:x,readOnly:w},children:a.jsx(Zi,{opened:T.dropdownOpened,...j,onChange:D=>!D&&R(),withRoles:!1,unstyled:o,children:l})})}const o7=e=>e;Xe.extend=o7;Xe.classes=Hr;Xe.displayName="@mantine/core/Combobox";Xe.Target=S_;Xe.Dropdown=x0;Xe.Options=T0;Xe.Option=E0;Xe.Search=R0;Xe.Empty=b0;Xe.Chevron=Bp;Xe.Footer=w0;Xe.Header=C0;Xe.EventsTarget=x_;Xe.DropdownTarget=y_;Xe.Group=j0;Xe.ClearButton=v_;Xe.HiddenInput=b_;var w_={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const j_=w_,Vp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:l,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:T,vars:E,mod:R,...D},P)=>{const A=$e({name:e,props:t,className:n,style:T,classes:w_,classNames:r,styles:o,unstyled:l});return a.jsx(ce,{...A("root"),ref:P,__vars:{"--label-fz":In(x),"--label-lh":at(x,"label-lh")},mod:[{"label-position":b},R],variant:C,size:x,...D,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(un.Description,{size:x,__inheritStyles:!1,...A("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(un.Error,{size:x,__inheritStyles:!1,...A("error"),children:g})]})]})})});Vp.displayName="@mantine/core/InlineInput";const C_=v.createContext(null),a7=C_.Provider,E_=()=>v.useContext(C_),[s7,l7]=ha();var T_={card:"m_26775b0a"};const c7={withBorder:!0},u7=(e,{radius:t})=>({card:{"--card-radius":$t(t)}}),_0=be((e,t)=>{const n=ae("CheckboxCard",c7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,defaultChecked:w,onChange:j,...C}=n,T=$e({name:"CheckboxCard",classes:T_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:u7,rootSelector:"card"}),E=E_(),R=typeof p=="boolean"?p:E?E.value.includes(x||""):void 0,[D,P]=Zn({value:R,defaultValue:w,finalValue:!1,onChange:j});return a.jsx(s7,{value:{checked:D},children:a.jsx(sr,{ref:t,mod:[{"with-border":g,checked:D},m],...T("card"),...C,role:"checkbox","aria-checked":D,onClick:A=>{b?.(A),E?.onChange(x||""),P(!D)}})})});_0.displayName="@mantine/core/CheckboxCard";_0.classes=T_;function D0({children:e,role:t}){const n=qc();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const d7={},A0=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:l,wrapperProps:c,children:d,readOnly:f,...p}=ae("CheckboxGroup",d7,e),[m,g]=Zn({value:n,defaultValue:r,finalValue:[],onChange:o}),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(a7,{value:{value:m,onChange:x,size:l},children:a.jsx(un.Wrapper,{size:l,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(D0,{role:"group",children:d})})})});A0.classes=un.Wrapper.classes;A0.displayName="@mantine/core/CheckboxGroup";function Ad({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(Ad,{...t})}var __={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const f7={icon:R_},h7=(e,{radius:t,color:n,size:r,iconColor:o,variant:l,autoContrast:c})=>{const d=Ri({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":at(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:$t(t),"--checkbox-color":l==="outline"?f:Ft(n,e),"--checkbox-icon-color":o?Ft(o,e):hl(c,e)?ma({color:n,theme:e,autoContrast:c}):void 0}}},P0=be((e,t)=>{const n=ae("CheckboxIndicator",f7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:x,iconColor:b,autoContrast:w,checked:j,mod:C,variant:T,disabled:E,...R}=n,D=p,P=$e({name:"CheckboxIndicator",classes:__,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:h7,rootSelector:"indicator"}),A=l7(),k=typeof j=="boolean"||typeof m=="boolean"?j||m:A?.checked||!1;return a.jsx(ce,{ref:t,...P("indicator",{variant:T}),variant:T,mod:[{checked:k,disabled:E},C],...R,children:a.jsx(D,{indeterminate:m,...P("icon")})})});P0.displayName="@mantine/core/CheckboxIndicator";P0.classes=__;var D_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const p7={labelPosition:"right",icon:R_},m7=(e,{radius:t,color:n,size:r,iconColor:o,variant:l,autoContrast:c})=>{const d=Ri({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":at(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:$t(t),"--checkbox-color":l==="outline"?f:Ft(n,e),"--checkbox-icon-color":o?Ft(o,e):hl(c,e)?ma({color:n,theme:e,autoContrast:c}):void 0}}},Pn=be((e,t)=>{const n=ae("Checkbox",p7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:x,radius:b,wrapperProps:w,checked:j,labelPosition:C,description:T,error:E,disabled:R,variant:D,indeterminate:P,icon:A,rootRef:k,iconColor:M,onChange:$,autoContrast:U,mod:J,...Z}=n,Y=E_(),H=x||Y?.size,Q=A,O=$e({name:"Checkbox",props:n,classes:D_,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:m7}),{styleProps:I,rest:z}=ga(Z),F=_r(g),K=Y?{checked:Y.value.includes(z.value),onChange:ie=>{Y.onChange(ie),$?.(ie)}}:{},L=v.useRef(null),q=t||L;return v.useEffect(()=>{q&&"current"in q&&q.current&&(q.current.indeterminate=P||!1)},[P,q]),a.jsx(Vp,{...O("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:F,size:H,labelPosition:C,label:m,description:T,error:E,disabled:R,classNames:r,styles:c,unstyled:d,"data-checked":K.checked||j||void 0,variant:D,ref:k,mod:J,...I,...w,children:a.jsxs(ce,{...O("inner"),mod:{"data-label-position":C},children:[a.jsx(ce,{component:"input",id:F,ref:q,checked:j,disabled:R,mod:{error:!!E,indeterminate:P},...O("input",{focusable:!0,variant:D}),onChange:$,...z,...K,type:"checkbox"}),a.jsx(Q,{indeterminate:P,...O("icon")})]})})});Pn.classes={...D_,...j_};Pn.displayName="@mantine/core/Checkbox";Pn.Group=A0;Pn.Indicator=P0;Pn.Card=_0;function Nc(e){return"group"in e}function A_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let l=0;l<e.length;l+=1){const c=e[l];if(o.length===n)return o;Nc(c)&&o.push({group:c.group,items:A_({options:c.items,search:t,limit:n-o.length})}),Nc(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}function g7(e){if(e.length===0)return!0;for(const t of e)if(!("group"in t)||t.items.length>0)return!1;return!0}function P_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Nc(n))P_(n.items,t);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function v7(e,t){return Array.isArray(e)?e.includes(t):e===t}function k_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:l}){if(!Nc(e)){const d=v7(n,e.value),f=t&&d&&a.jsx(Ad,{className:Hr.optionsDropdownCheckIcon}),p=a.jsxs(a.Fragment,{children:[r==="left"&&f,a.jsx("span",{children:e.label}),r==="right"&&f]});return a.jsx(Xe.Option,{value:e.value,disabled:e.disabled,className:Ot({[Hr.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":d||void 0,"aria-selected":d,active:d,children:typeof l=="function"?l({option:e,checked:d}):p})}const c=e.items.map(d=>a.jsx(k_,{data:d,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:l},d.value));return a.jsx(Xe.Group,{label:e.group,children:c})}function y7({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:l,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":T}){P_(e);const R=typeof o=="string"?(r||A_)({options:e,search:f?o:"",limit:l??1/0}):e,D=g7(R),P=R.map(A=>a.jsx(k_,{data:A,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},Nc(A)?A.group:A.value));return a.jsx(Xe.Dropdown,{hidden:t||n&&D,"data-composed":!0,children:a.jsxs(Xe.Options,{labelledBy:w,"aria-label":T,children:[d?a.jsx(ai.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:P}):P,D&&x&&a.jsx(Xe.Empty,{children:x})]})})}const N_=v.createContext(null),x7=N_.Provider;function b7(){return{withinGroup:!!v.useContext(N_)}}var Fp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const S7={},w7=(e,{spacing:t})=>({group:{"--ag-spacing":Ln(t)}}),k0=be((e,t)=>{const n=ae("AvatarGroup",S7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,spacing:p,...m}=n,g=$e({name:"AvatarGroup",classes:Fp,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:w7,rootSelector:"group"});return a.jsx(x7,{value:!0,children:a.jsx(ce,{ref:t,...g("group"),...m})})});k0.classes=Fp;k0.displayName="@mantine/core/AvatarGroup";function j7(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 C7(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}const E7=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function T7(e,t=E7){const n=C7(e),r=Math.abs(n)%t.length;return t[r]}function R7(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}const _7={},D7=(e,{size:t,radius:n,variant:r,gradient:o,color:l,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=l==="initials"&&typeof d=="string"?T7(d,f):l,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":at(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:$t(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}}},nl=gr((e,t)=>{const n=ae("Avatar",_7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:x,gradient:b,imageProps:w,children:j,autoContrast:C,mod:T,name:E,allowedInitialsColors:R,...D}=n,P=b7(),[A,k]=v.useState(!p),M=$e({name:"Avatar",props:n,classes:Fp,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:D7});return v.useEffect(()=>k(!p),[p]),a.jsx(ce,{...M("root"),mod:[{"within-group":P.withinGroup},T],ref:t,...D,children:A?a.jsx("span",{...M("placeholder"),title:m,children:j||typeof E=="string"&&R7(E)||a.jsx(j7,{})}):a.jsx("img",{...w,...M("image"),src:p,alt:m,onError:$=>{k(!0),w?.onError?.($)}})})});nl.classes=Fp;nl.displayName="@mantine/core/Avatar";nl.Group=k0;var O_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const A7={},P7=(e,{radius:t,color:n,gradient:r,variant:o,size:l,autoContrast:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:c});return{root:{"--badge-height":at(l,"badge-height"),"--badge-padding-x":at(l,"badge-padding-x"),"--badge-fz":at(l,"badge-fz"),"--badge-radius":t===void 0?void 0:$t(t),"--badge-bg":n||o?d.background:void 0,"--badge-color":n||o?d.color:void 0,"--badge-bd":n||o?d.border:void 0,"--badge-dot-color":o==="dot"?Ft(n,e):void 0}}},Hp=gr((e,t)=>{const n=ae("Badge",A7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:x,rightSection:b,children:w,variant:j,fullWidth:C,autoContrast:T,circle:E,mod:R,...D}=n,P=$e({name:"Badge",props:n,classes:O_,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:P7});return a.jsxs(ce,{variant:j,mod:[{block:C,circle:E,"with-right-section":!!b,"with-left-section":!!x},R],...P("root",{variant:j}),ref:t,...D,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})]})});Hp.classes=O_;Hp.displayName="@mantine/core/Badge";var M_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const k7={iconSize:48},N7=(e,{color:t,iconSize:n,radius:r})=>{const o=Ri({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),l=Ri({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":wi(l.value,.07),"--bq-bg-dark":wi(o.value,.06),"--bq-bd":Ft(t,e),"--bq-icon-size":le(n),"--bq-radius":$t(r)}}},N0=be((e,t)=>{const n=ae("Blockquote",k7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:x,...b}=n,w=$e({name:"Blockquote",classes:M_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:N7});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})]})});N0.classes=M_;N0.displayName="@mantine/core/Blockquote";var Qc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const aE={orientation:"horizontal"},O7=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),O0=be((e,t)=>{const n=ae("ButtonGroup",aE,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:x,...b}=ae("ButtonGroup",aE,e),w=$e({name:"ButtonGroup",props:n,classes:Qc,className:r,style:o,classNames:l,styles:c,unstyled:d,vars:p,varsResolver:O7,rootSelector:"group"});return a.jsx(ce,{...w("group"),ref:t,variant:g,mod:[{"data-orientation":f},x],role:"group",...b})});O0.classes=Qc;O0.displayName="@mantine/core/ButtonGroup";const sE={},M7=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:l,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{groupSection:{"--section-height":at(c,"section-height"),"--section-padding-x":at(c,"section-padding-x"),"--section-fz":c?.includes("compact")?In(c.replace("compact-","")):In(c),"--section-radius":t===void 0?void 0:$t(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},M0=be((e,t)=>{const n=ae("ButtonGroupSection",sE,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:x,...b}=ae("ButtonGroupSection",sE,e),w=$e({name:"ButtonGroupSection",props:n,classes:Qc,className:r,style:o,classNames:l,styles:c,unstyled:d,vars:f,varsResolver:M7,rootSelector:"groupSection"});return a.jsx(ce,{...w("groupSection"),ref:t,variant:p,...b})});M0.classes=Qc;M0.displayName="@mantine/core/ButtonGroupSection";const L7={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},I7={},z7=(e,{radius:t,color:n,gradient:r,variant:o,size:l,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":at(l,"button-height"),"--button-padding-x":at(l,"button-padding-x"),"--button-fz":l?.includes("compact")?In(l.replace("compact-","")):In(l),"--button-radius":t===void 0?void 0:$t(t),"--button-bg":n||o?f.background:void 0,"--button-hover":n||o?f.hover:void 0,"--button-color":f.color,"--button-bd":n||o?f.border:void 0,"--button-hover-color":n||o?f.hoverColor:void 0}}},ke=gr((e,t)=>{const n=ae("Button",I7,e),{style:r,vars:o,className:l,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:x,radius:b,loading:w,loaderProps:j,gradient:C,classNames:T,styles:E,unstyled:R,"data-disabled":D,autoContrast:P,mod:A,...k}=n,M=$e({name:"Button",props:n,classes:Qc,className:l,style:r,classNames:T,styles:E,unstyled:R,vars:o,varsResolver:z7}),$=!!p,U=!!m;return a.jsxs(sr,{ref:t,...M("root",{active:!d&&!w&&!D}),unstyled:R,variant:x,disabled:d||w,mod:[{disabled:d||D,loading:w,block:g,"with-left-section":$,"with-right-section":U},A],...k,children:[a.jsx(_o,{mounted:!!w,transition:L7,duration:150,children:J=>a.jsx(ce,{component:"span",...M("loader",{style:J}),"aria-hidden":!0,children:a.jsx(Fr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...M("inner"),children:[p&&a.jsx(ce,{component:"span",...M("section"),mod:{position:"left"},children:p}),a.jsx(ce,{component:"span",mod:{loading:w},...M("label"),children:f}),m&&a.jsx(ce,{component:"span",...M("section"),mod:{position:"right"},children:m})]})]})});ke.classes=Qc;ke.displayName="@mantine/core/Button";ke.Group=O0;ke.GroupSection=M0;var L_={root:"m_4451eb3a"};const $7={},ar=gr((e,t)=>{const n=ae("Center",$7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,inline:p,mod:m,...g}=n,x=$e({name:"Center",props:n,classes:L_,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f});return a.jsx(ce,{ref:t,mod:[{inline:p},m],...x("root"),...g})});ar.classes=L_;ar.displayName="@mantine/core/Center";const[U7,B7]=ha(),V7={};function I_(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:l}=ae("ChipGroup",V7,e),[c,d]=Zn({value:t,defaultValue:n,finalValue:o?[]: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(U7,{value:{isChipSelected:f,onChange:p,multiple:o},children:l})}I_.displayName="@mantine/core/ChipGroup";var z_={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};const F7={type:"checkbox"},H7=(e,{size:t,radius:n,variant:r,color:o,autoContrast:l})=>{const c=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:l});return{root:{"--chip-fz":In(t),"--chip-size":at(t,"chip-size"),"--chip-radius":n===void 0?void 0:$t(n),"--chip-checked-padding":at(t,"chip-checked-padding"),"--chip-padding":at(t,"chip-padding"),"--chip-icon-size":at(t,"chip-icon-size"),"--chip-bg":o||r?c.background:void 0,"--chip-hover":o||r?c.hover:void 0,"--chip-color":o||r?c.color:void 0,"--chip-bd":o||r?c.border:void 0,"--chip-spacing":at(t,"chip-spacing")}}},ud=be((e,t)=>{const n=ae("Chip",F7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:x,value:b,wrapperProps:w,type:j,disabled:C,children:T,size:E,variant:R,icon:D,rootRef:P,autoContrast:A,mod:k,...M}=n,$=$e({name:"Chip",classes:z_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:H7}),U=B7(),J=_r(p),{styleProps:Z,rest:Y}=ga(M),[H,Q]=Zn({value:m,defaultValue:g,finalValue:!1,onChange:x}),O=U?{checked:U.isChipSelected(b),onChange:z=>{U.onChange(z),x?.(z.currentTarget.checked)},type:U.multiple?"checkbox":"radio"}:{},I=O.checked||H;return a.jsxs(ce,{size:E,variant:R,ref:P,mod:k,...$("root"),...Z,...w,children:[a.jsx("input",{type:j,...$("input"),checked:I,onChange:z=>Q(z.currentTarget.checked),id:J,disabled:C,ref:t,value:b,...O,...Y}),a.jsxs("label",{htmlFor:J,"data-checked":I||void 0,"data-disabled":C||void 0,...$("label",{variant:R||"filled"}),children:[I&&a.jsx("span",{...$("iconWrapper"),children:D||a.jsx(Ad,{...$("checkIcon")})}),a.jsx("span",{children:T})]})]})});ud.classes=z_;ud.displayName="@mantine/core/Chip";ud.Group=I_;var $_={root:"m_b183c0a2"};const q7={},G7=(e,{color:t})=>({root:{"--code-bg":t?Ft(t,e):void 0}}),Pd=be((e,t)=>{const n=ae("Code",q7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:x,...b}=n,w=$e({name:"Code",props:n,classes:$_,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:G7});return a.jsx(ce,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},x],...w("root"),...b,dir:"ltr"})});Pd.classes=$_;Pd.displayName="@mantine/core/Code";var U_={root:"m_7485cace"};const Q7={},W7=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:at(t,"container-size")}}),kd=be((e,t)=>{const n=ae("Container",Q7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,fluid:p,mod:m,...g}=n,x=$e({name:"Container",classes:U_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:W7});return a.jsx(ce,{ref:t,mod:[{fluid:p},m],...x("root"),...g})});kd.classes=U_;kd.displayName="@mantine/core/Container";const Y7={timeout:1e3};function L0(e){const{children:t,timeout:n,value:r,...o}=ae("CopyButton",Y7,e),l=UR({timeout:n}),c=()=>l.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:l.copied,...o})})}L0.displayName="@mantine/core/CopyButton";var B_={root:"m_3eebeb36",label:"m_9e365f20"};const K7={orientation:"horizontal"},X7=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Ft(t,e):void 0,"--divider-border-style":n,"--divider-size":at(r,"divider-size")}}),pn=be((e,t)=>{const n=ae("Divider",K7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:x,mod:b,...w}=n,j=$e({name:"Divider",classes:B_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:X7});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})})});pn.classes=B_;pn.displayName="@mantine/core/Divider";function Z7({open:e,close:t,openDelay:n,closeDelay:r}){const o=v.useRef(-1),l=v.useRef(-1),c=()=>{window.clearTimeout(o.current),window.clearTimeout(l.current)},d=()=>{c(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():l.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:d,closeDropdown:f}}const[lE,V_]=Rr("Grid component was not found in tree"),tx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,cE=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":tx(e,t),uE=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},dE=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function J7({span:e,order:t,offset:n,selector:r}){const o=Sn(),l=V_(),c=l.breakpoints||o.breakpoints,f=Hi(e)===void 0?12:Hi(e),p=ds({"--col-order":Hi(t)?.toString(),"--col-flex-grow":uE(f,l.grow),"--col-flex-basis":tx(f,l.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":cE(f,l.columns,l.grow),"--col-offset":dE(Hi(n),l.columns)}),m=rn(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"]=uE(e[w],l.grow),b[w]["--col-flex-basis"]=tx(e[w],l.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=cE(e[w],l.columns,l.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=dE(n[w],l.columns)),b),{}),x=ad(rn(m),c).filter(b=>rn(m[b.value]).length>0).map(b=>({query:l.type==="container"?`mantine-grid (min-width: ${c[b.value]})`:`(min-width: ${c[b.value]})`,styles:m[b.value]}));return a.jsx(pl,{styles:p,media:l.type==="container"?void 0:x,container:l.type==="container"?x:void 0,selector:r})}var I0={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const eI={span:12},z0=be((e,t)=>{const n=ae("GridCol",eI,e),{classNames:r,className:o,style:l,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,x=V_(),b=jd();return a.jsxs(a.Fragment,{children:[a.jsx(J7,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ce,{ref:t,...x.getStyles("col",{className:Ot(o,b),style:l,classNames:r,styles:c}),...g})]})});z0.classes=I0;z0.displayName="@mantine/core/GridCol";function fE({gutter:e,selector:t,breakpoints:n,type:r}){const o=Sn(),l=n||o.breakpoints,c=ds({"--grid-gutter":Ln(Hi(e))}),d=rn(l).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Ln(e[g])),m),{}),p=ad(rn(d),l).filter(m=>rn(d[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${l[m.value]})`:`(min-width: ${l[m.value]})`,styles:d[m.value]}));return a.jsx(pl,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const tI={gutter:"md",grow:!1,columns:12},nI=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),hr=be((e,t)=>{const n=ae("Grid",tI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:x,justify:b,children:w,breakpoints:j,type:C,...T}=n,E=$e({name:"Grid",classes:I0,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:nI}),R=jd();return C==="container"&&j?a.jsxs(lE,{value:{getStyles:E,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(fE,{selector:`.${R}`,...n}),a.jsx("div",{...E("container"),children:a.jsx(ce,{ref:t,...E("root",{className:R}),...T,children:a.jsx("div",{...E("inner"),children:w})})})]}):a.jsxs(lE,{value:{getStyles:E,grow:p,columns:g||12,breakpoints:j,type:C},children:[a.jsx(fE,{selector:`.${R}`,...n}),a.jsx(ce,{ref:t,...E("root",{className:R}),...T,children:a.jsx("div",{...E("inner"),children:w})})]})});hr.classes=I0;hr.displayName="@mantine/core/Grid";hr.Col=z0;function Jh(){return Jh=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},Jh.apply(null,arguments)}function $0(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var rI=v.useLayoutEffect,iI=function(t){var n=Tn.useRef(t);return rI(function(){n.current=t}),n},hE=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},oI=function(t,n){var r=Tn.useRef();return Tn.useCallback(function(o){t.current=o,r.current&&hE(r.current,null),r.current=n,n&&hE(n,o)},[n])},pE={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},aI=function(t){Object.keys(pE).forEach(function(n){t.style.setProperty(n,pE[n],"important")})},mE=aI,wr=null,gE=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function sI(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),wr||(wr=document.createElement("textarea"),wr.setAttribute("tabindex","-1"),wr.setAttribute("aria-hidden","true"),mE(wr)),wr.parentNode===null&&document.body.appendChild(wr);var o=e.paddingSize,l=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(x){var b=x;wr.style[b]=c[b]}),mE(wr),wr.value=t;var f=gE(wr,e);wr.value=t,f=gE(wr,e),wr.value="x";var p=wr.scrollHeight-o,m=p*n;d==="border-box"&&(m=m+o+l),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+o+l),f=Math.min(g,f),[f,p]}var vE=function(){},lI=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},cI=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],uI=!!document.documentElement.currentStyle,dI=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=lI(cI,n),o=r.boxSizing;if(o==="")return null;uI&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var l=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:l,borderSize:c}},fI=dI;function U0(e,t,n){var r=iI(n);v.useLayoutEffect(function(){var o=function(c){return r.current(c)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var hI=function(t,n){U0(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},pI=function(t){U0(window,"resize",t)},mI=function(t){U0(document.fonts,"loadingdone",t)},gI=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],vI=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,l=t.minRows,c=t.onChange,d=c===void 0?vE:c,f=t.onHeightChange,p=f===void 0?vE:f,m=$0(t,gI),g=m.value!==void 0,x=v.useRef(null),b=oI(x,n),w=v.useRef(0),j=v.useRef(),C=function(){var R=x.current,D=r&&j.current?j.current:fI(R);if(D){j.current=D;var P=sI(D,R.value||R.placeholder||"x",l,o),A=P[0],k=P[1];w.current!==A&&(w.current=A,R.style.setProperty("height",A+"px","important"),p(A,{rowHeight:k}))}},T=function(R){g||C(),d(R)};return v.useLayoutEffect(C),hI(x,function(){if(!g){var E=x.current.value;requestAnimationFrame(function(){var R=x.current;R&&E!==R.value&&C()})}}),pI(C),mI(C),v.createElement("textarea",Jh({},m,{onChange:T,ref:b}))},yI=v.forwardRef(vI);const xI={},vl=be((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:l,resize:c,...d}=ae("Textarea",xI,e),f=n&&QR()!=="test",p=f?{maxRows:r,minRows:o}:{};return a.jsx(Dr,{component:f?yI:"textarea",ref:t,...d,__staticSelector:l||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});vl.classes=Dr.classes;vl.displayName="@mantine/core/Textarea";function yE(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const bI={serialize:JSON.stringify,deserialize:JSON.parse},Wc=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:l,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:x,...b}=ae("JsonInput",bI,e),[w,j]=Zn({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,T]=v.useState(yE(w,f)),E=D=>{p?.(D),T(!0)},R=D=>{typeof m=="function"&&m(D);const P=yE(D.currentTarget.value,f);l&&!g&&P&&D.currentTarget.value.trim()!==""&&j(d(f(D.currentTarget.value),null,2)),T(P)};return a.jsx(vl,{value:w,onChange:D=>j(D.currentTarget.value),onFocus:E,onBlur:R,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?x:c||!0,"data-monospace":!0})});Wc.classes=Dr.classes;Wc.displayName="@mantine/core/JsonInput";const[SI,wI]=Rr("List component was not found in tree");var B0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const jI={},V0=be((e,t)=>{const n=ae("ListItem",jI,e),{classNames:r,className:o,style:l,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,x=wI(),b=f||x.icon,w={classNames:r,styles:c};return a.jsx(ce,{...x.getStyles("item",{...w,className:o,style:l}),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})]})})});V0.classes=B0;V0.displayName="@mantine/core/ListItem";const CI={type:"unordered"},EI=(e,{size:t,spacing:n})=>({root:{"--list-fz":In(t),"--list-lh":$R(t),"--list-spacing":Ln(n)}}),Er=be((e,t)=>{const n=ae("List",CI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:x,spacing:b,center:w,listStyleType:j,mod:C,...T}=n,E=$e({name:"List",classes:B0,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:EI});return a.jsx(SI,{value:{center:w,icon:x,getStyles:E},children:a.jsx(ce,{...E("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g},C],ref:t,...T,children:p})})});Er.classes=B0;Er.displayName="@mantine/core/List";Er.Item=V0;var F_={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const xE={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:oi("overlay")},TI=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),qp=be((e,t)=>{const n=ae("LoadingOverlay",xE,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:x,zIndex:b,...w}=n,j=Sn(),C=$e({name:"LoadingOverlay",classes:F_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:TI}),T={...xE.overlayProps,...g};return a.jsx(_o,{transition:"fade",...p,mounted:!!x,children:E=>a.jsxs(ce,{...C("root",{style:E}),ref:t,...w,children:[a.jsx(Fr,{...C("loader"),unstyled:d,...m}),a.jsx(Pc,{...T,...C("overlay"),darkHidden:!0,unstyled:d,color:g?.color||j.white}),a.jsx(Pc,{...T,...C("overlay"),lightHidden:!0,unstyled:d,color:g?.color||j.colors.dark[5]})]})})});qp.classes=F_;qp.displayName="@mantine/core/LoadingOverlay";const[RI,Nd]=Rr("Menu component was not found in the tree");var Yc={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const _I={},F0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("MenuDivider",_I,e),f=Nd();return a.jsx(ce,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:l,classNames:n}),...d})});F0.classes=Yc;F0.displayName="@mantine/core/MenuDivider";const DI={},H0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=ae("MenuDropdown",DI,e),x=v.useRef(null),b=Nd(),w=Ur(p,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),x.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=Ur(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=Ur(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(Zi.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:qn(t,x),...b.getStyles("dropdown",{className:r,style:o,styles:l,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]})});H0.classes=Yc;H0.displayName="@mantine/core/MenuDropdown";const AI={},q0=gr((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:x,"data-disabled":b,...w}=ae("MenuItem",AI,e),j=Nd(),C=Sn(),{dir:T}=ml(),E=v.useRef(null),R=j.getItemIndex(E.current),D=w,P=Ur(D.onMouseLeave,()=>j.setHovered(-1)),A=Ur(D.onMouseEnter,()=>j.setHovered(j.getItemIndex(E.current))),k=Ur(D.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),M=Ur(D.onFocus,()=>j.setHovered(j.getItemIndex(E.current))),$=d?C.variantColorResolver({color:d,theme:C,variant:"light"}):void 0,U=d?Ri({color:d,theme:C}):null;return a.jsxs(sr,{...w,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,onFocus:M,...j.getStyles("item",{className:r,style:o,styles:l,classNames:n}),ref:qn(E,t),role:"menuitem",disabled:x,"data-menu-item":!0,"data-disabled":x||b||void 0,"data-hovered":j.hovered===R?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:A,onMouseLeave:P,onClick:k,onKeyDown:zR({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:T,orientation:"vertical",onKeyDown:D.onKeyDown}),__vars:{"--menu-item-color":U?.isThemeColor&&U?.shade===void 0?`var(--mantine-color-${U.color}-6)`:$?.color,"--menu-item-hover":$?.hover},children:[p&&a.jsx("div",{...j.getStyles("itemSection",{styles:l,classNames:n}),"data-position":"left",children:p}),g&&a.jsx("div",{...j.getStyles("itemLabel",{styles:l,classNames:n}),children:g}),m&&a.jsx("div",{...j.getStyles("itemSection",{styles:l,classNames:n}),"data-position":"right",children:m})]})});q0.classes=Yc;q0.displayName="@mantine/core/MenuItem";const PI={},G0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("MenuLabel",PI,e),f=Nd();return a.jsx(ce,{ref:t,...f.getStyles("label",{className:r,style:o,styles:l,classNames:n}),...d})});G0.classes=Yc;G0.displayName="@mantine/core/MenuLabel";const kI={refProp:"ref"},H_=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=ae("MenuTarget",kI,e);if(!fa(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 l=Nd(),c=n.props,d=Ur(c.onClick,()=>{l.trigger==="click"?l.toggleDropdown():l.trigger==="click-hover"&&(l.setOpenedViaClick(!0),l.opened||l.openDropdown())}),f=Ur(c.onMouseEnter,()=>(l.trigger==="hover"||l.trigger==="click-hover")&&l.openDropdown()),p=Ur(c.onMouseLeave,()=>{(l.trigger==="hover"||l.trigger==="click-hover"&&!l.openedViaClick)&&l.closeDropdown()});return a.jsx(Zi.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":l.opened?!0:void 0})})});H_.displayName="@mantine/core/MenuTarget";const NI={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function je(e){const t=ae("Menu",NI,e),{children:n,onOpen:r,onClose:o,opened:l,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:x,openDelay:b,closeDelay:w,classNames:j,styles:C,unstyled:T,variant:E,vars:R,menuItemTabIndex:D,keepMounted:P,withInitialFocusPlaceholder:A,...k}=t,M=$e({name:"Menu",classes:Yc,props:t,classNames:j,styles:C,unstyled:T}),[$,{setHovered:U,resetHovered:J}]=zO(),[Z,Y]=Zn({value:l,defaultValue:c,finalValue:!1,onChange:f}),[H,Q]=v.useState(!1),O=()=>{Y(!1),Q(!1),Z&&o?.()},I=()=>{Y(!0),!Z&&r?.()},z=()=>{Z?O():I()},{openDropdown:F,closeDropdown:K}=Z7({open:I,close:O,closeDelay:w,openDelay:b}),L=xe=>IO("[data-menu-item]","[data-menu-dropdown]",xe),{resolvedClassNames:q,resolvedStyles:ie}=fl({classNames:j,styles:C,props:t});return oa(()=>{J()},[Z]),a.jsx(RI,{value:{getStyles:M,opened:Z,toggleDropdown:z,getItemIndex:L,hovered:$,setHovered:U,openedViaClick:H,setOpenedViaClick:Q,closeOnItemClick:p,closeDropdown:x==="click"?O:K,openDropdown:x==="click"?I:F,closeDropdownImmediately:O,loop:m,trigger:x,unstyled:T,menuItemTabIndex:D,withInitialFocusPlaceholder:A},children:a.jsx(Zi,{...k,opened:Z,onChange:z,defaultOpened:c,trapFocus:P?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:q,styles:ie,unstyled:T,variant:E,keepMounted:P,children:n})})}je.extend=e=>e;je.withProps=yM(je);je.classes=Yc;je.displayName="@mantine/core/Menu";je.Item=q0;je.Label=G0;je.Dropdown=H0;je.Target=H_;je.Divider=F0;const[OI,Kc]=Rr("Modal component was not found in tree");var xa={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const MI={},Gp=be((e,t)=>{const n=ae("ModalBody",MI,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=Kc();return a.jsx(n_,{ref:t,...p.getStyles("body",{classNames:r,style:l,styles:c,className:o}),...f})});Gp.classes=xa;Gp.displayName="@mantine/core/ModalBody";const LI={},Qp=be((e,t)=>{const n=ae("ModalCloseButton",LI,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=Kc();return a.jsx(r_,{ref:t,...p.getStyles("close",{classNames:r,style:l,styles:c,className:o}),...f})});Qp.classes=xa;Qp.displayName="@mantine/core/ModalCloseButton";const II={},Wp=be((e,t)=>{const n=ae("ModalContent",II,e),{classNames:r,className:o,style:l,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=Kc(),x=g.scrollAreaComponent||Y5;return a.jsx(i_,{...g.getStyles("content",{className:o,style:l,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:o,style:l,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})})});Wp.classes=xa;Wp.displayName="@mantine/core/ModalContent";const zI={},Yp=be((e,t)=>{const n=ae("ModalHeader",zI,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=Kc();return a.jsx(o_,{ref:t,...p.getStyles("header",{classNames:r,style:l,styles:c,className:o}),...f})});Yp.classes=xa;Yp.displayName="@mantine/core/ModalHeader";const $I={},Kp=be((e,t)=>{const n=ae("ModalOverlay",$I,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=Kc();return a.jsx(a_,{ref:t,...p.getStyles("overlay",{classNames:r,style:l,styles:c,className:o}),...f})});Kp.classes=xa;Kp.displayName="@mantine/core/ModalOverlay";const UI={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:oi("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},BI=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:$t(t),"--modal-size":at(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(o)}}),Xp=be((e,t)=>{const n=ae("ModalRoot",UI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:x,centered:b,xOffset:w,__staticSelector:j,...C}=n,T=$e({name:j,classes:xa,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:BI});return a.jsx(OI,{value:{yOffset:p,scrollAreaComponent:m,getStyles:T,fullScreen:x},children:a.jsx(t_,{ref:t,...T("root"),"data-full-screen":x||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===ai.Autosize||void 0,unstyled:d,...C})})});Xp.classes=xa;Xp.displayName="@mantine/core/ModalRoot";const[VI,FI]=ha();function q_({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(oi("modal"));return a.jsx(VI,{value:{stack:t,addModal:(l,c)=>{n(d=>[...new Set([...d,l])]),o(d=>typeof c=="number"&&typeof d=="number"?Math.max(d,c):d)},removeModal:l=>n(c=>c.filter(d=>d!==l)),getZIndex:l=>`calc(${r} + ${t.indexOf(l)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}q_.displayName="@mantine/core/ModalStack";const HI={},Zp=be((e,t)=>{const n=ae("ModalTitle",HI,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=Kc();return a.jsx(s_,{ref:t,...p.getStyles("title",{classNames:r,style:l,styles:c,className:o}),...f})});Zp.classes=xa;Zp.displayName="@mantine/core/ModalTitle";const qI={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:oi("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Un=be((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:l,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...x}=ae("Modal",qI,e),b=FI(),w=!!n||l,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||oi("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(Xp,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...x,...j,children:[r&&a.jsx(Kp,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...o}),a.jsxs(Wp,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[w&&a.jsxs(Yp,{children:[n&&a.jsx(Zp,{children:n}),l&&a.jsx(Qp,{...c})]}),a.jsx(Gp,{children:d})]})]})});Un.classes=xa;Un.displayName="@mantine/core/Modal";Un.Root=Xp;Un.Overlay=Kp;Un.Content=Wp;Un.Body=Gp;Un.Header=Yp;Un.Title=Zp;Un.CloseButton=Qp;Un.Stack=q_;const[GI,Q0]=ha(),[QI,WI]=ha();var Jp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const YI={},KI=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?at(t):at(n,"pg-gap")}}),W0=be((e,t)=>{const n=ae("PillGroup",YI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,disabled:m,...g}=n,b=Q0()?.size||p||void 0,w=$e({name:"PillGroup",classes:Jp,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:KI,stylesCtx:{size:b},rootSelector:"group"});return a.jsx(QI,{value:{size:b,disabled:m},children:a.jsx(ce,{ref:t,size:b,...w("group"),...g})})});W0.classes=Jp;W0.displayName="@mantine/core/PillGroup";const XI={variant:"default"},ZI=(e,{radius:t},{size:n})=>({root:{"--pill-fz":at(n,"pill-fz"),"--pill-height":at(n,"pill-height"),"--pill-radius":t===void 0?void 0:$t(t)}}),la=be((e,t)=>{const n=ae("Pill",XI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:x,removeButtonProps:b,radius:w,size:j,disabled:C,mod:T,...E}=n,R=WI(),D=Q0(),P=j||R?.size||void 0,A=D?.variant==="filled"?"contrast":p||"default",k=$e({name:"Pill",classes:Jp,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:ZI,stylesCtx:{size:P}});return a.jsxs(ce,{component:"span",ref:t,variant:A,size:P,...k("root",{variant:A}),mod:[{"with-remove":g&&!C,disabled:C||R?.disabled},T],...E,children:[a.jsx("span",{...k("label"),children:m}),g&&a.jsx(hs,{variant:"transparent",radius:w,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...k("remove",{className:b?.className,style:b?.style}),onMouseDown:M=>{M.preventDefault(),M.stopPropagation(),b?.onMouseDown?.(M)},onClick:M=>{M.stopPropagation(),x?.(),b?.onClick?.(M)}})]})});la.classes=Jp;la.displayName="@mantine/core/Pill";la.Group=W0;var G_={field:"m_45c4369d"};const JI={type:"visible"},Y0=be((e,t)=>{const n=ae("PillsInputField",JI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:x,mod:b,...w}=n,j=Q0(),C=qc(),T=$e({name:"PillsInputField",classes:G_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,rootSelector:"field"}),E=m||j?.disabled;return a.jsx(ce,{component:"input",ref:qn(t,j?.fieldRef),"data-type":p,disabled:E,mod:[{disabled:E,pointer:x},b],...T("field"),...w,id:C?.inputId||g,"aria-invalid":j?.hasError,"aria-describedby":C?.describedBy,type:"text",onMouseDown:R=>!x&&R.stopPropagation()})});Y0.classes=G_;Y0.displayName="@mantine/core/PillsInputField";const e6={},ss=be((e,t)=>{const n=ae("PillsInput",e6,e),{children:r,onMouseDown:o,onClick:l,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,x=v.useRef(null);return a.jsx(GI,{value:{fieldRef:x,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx(Dr,{size:c,error:p,variant:m,component:"div",ref:t,onMouseDown:b=>{b.preventDefault(),o?.(b),x.current?.focus()},onClick:b=>{b.preventDefault(),b.currentTarget.closest("fieldset")?.disabled||(x.current?.focus(),l?.(b))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});ss.displayName="@mantine/core/PillsInput";ss.Field=Y0;function t6({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,l)=>(Nc(l)?o.push({group:l.group,items:l.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(l.value.toLowerCase().trim())===-1&&o.push(l),o),[])}const n6={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},em=be((e,t)=>{const n=ae("MultiSelect",n6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:x,onKeyDown:b,variant:w,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:E,onDropdownClose:R,selectFirstOptionOnChange:D,onOptionSubmit:P,comboboxProps:A,filter:k,limit:M,withScrollArea:$,maxDropdownHeight:U,searchValue:J,defaultSearchValue:Z,onSearchChange:Y,readOnly:H,disabled:Q,onFocus:O,onBlur:I,radius:z,rightSection:F,rightSectionWidth:K,rightSectionPointerEvents:L,rightSectionProps:q,leftSection:ie,leftSectionWidth:xe,leftSectionPointerEvents:ve,leftSectionProps:Ce,inputContainer:Oe,inputWrapperOrder:Ee,withAsterisk:Ge,labelProps:it,descriptionProps:St,errorProps:kt,wrapperProps:Mt,description:ct,label:bt,error:Qt,maxValues:Ae,searchable:De,nothingFoundMessage:Ze,withCheckIcon:_e,checkIconPosition:ge,hidePickedOptions:Se,withErrorStyles:He,name:me,form:ze,id:Nt,clearable:Wt,clearButtonProps:jn,hiddenInputProps:Qn,placeholder:Cn,hiddenInputValuesDivider:Ar,required:Jn,mod:si,renderOption:Wn,onRemove:xr,onClear:er,scrollAreaProps:Rl,chevronColor:Ca,...xs}=n,li=_r(Nt),to=m_(j),Pr=g_(to),En=gl({opened:C,defaultOpened:T,onDropdownOpen:E,onDropdownClose:()=>{R?.(),En.resetSelectedOption()}}),{styleProps:No,rest:{type:Li,autoComplete:Ea,..._l}}=ga(xs),[kn,B]=Zn({value:m,defaultValue:g,finalValue:[],onChange:x}),[X,oe]=Zn({value:J,defaultValue:Z,finalValue:"",onChange:Y}),we=qe=>{oe(qe),En.resetSelectedOption()},Pe=$e({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d}),{resolvedClassNames:Ke,resolvedStyles:Je}=fl({props:n,styles:c,classNames:r}),We=qe=>{b?.(qe),qe.key===" "&&!De&&(qe.preventDefault(),En.toggleDropdown()),qe.key==="Backspace"&&X.length===0&&kn.length>0&&(xr?.(kn[kn.length-1]),B(kn.slice(0,kn.length-1)))},rt=kn.map((qe,Lt)=>a.jsx(la,{withRemoveButton:!H&&!Pr[qe]?.disabled,onRemove:()=>{B(kn.filter(_n=>qe!==_n)),xr?.(qe)},unstyled:d,disabled:Q,...Pe("pill"),children:Pr[qe]?.label||qe},`${qe}-${Lt}`));v.useEffect(()=>{D&&En.selectFirstOption()},[D,X]);const nt=a.jsx(Xe.ClearButton,{...jn,onClear:()=>{er?.(),B([]),we("")}}),Me=t6({data:to,value:kn}),Le=Wt&&kn.length>0&&!Q&&!H;return a.jsxs(a.Fragment,{children:[a.jsxs(Xe,{store:En,classNames:Ke,styles:Je,unstyled:d,size:p,readOnly:H,__staticSelector:"MultiSelect",onOptionSubmit:qe=>{P?.(qe),we(""),En.updateSelectedOptionIndex("selected"),kn.includes(Pr[qe].value)?(B(kn.filter(Lt=>Lt!==Pr[qe].value)),xr?.(Pr[qe].value)):kn.length<Ae&&B([...kn,Pr[qe].value])},...A,children:[a.jsx(Xe.DropdownTarget,{children:a.jsx(ss,{...No,__staticSelector:"MultiSelect",classNames:Ke,styles:Je,unstyled:d,size:p,className:o,style:l,variant:w,disabled:Q,radius:z,__defaultRightSection:a.jsx(Xe.Chevron,{size:p,error:Qt,unstyled:d,color:Ca}),__clearSection:nt,__clearable:Le,rightSection:F,rightSectionPointerEvents:L||(nt?"all":"none"),rightSectionWidth:K,rightSectionProps:q,leftSection:ie,leftSectionWidth:xe,leftSectionPointerEvents:ve,leftSectionProps:Ce,inputContainer:Oe,inputWrapperOrder:Ee,withAsterisk:Ge,labelProps:it,descriptionProps:St,errorProps:kt,wrapperProps:Mt,description:ct,label:bt,error:Qt,withErrorStyles:He,__stylesApiProps:{...n,rightSectionPointerEvents:L||(Le?"all":"none"),multiline:!0},pointer:!De,onClick:()=>De?En.openDropdown():En.toggleDropdown(),"data-expanded":En.dropdownOpened||void 0,id:li,required:Jn,mod:si,children:a.jsxs(la.Group,{disabled:Q,unstyled:d,...Pe("pillsList"),children:[rt,a.jsx(Xe.EventsTarget,{autoComplete:Ea,children:a.jsx(ss.Field,{..._l,ref:t,id:li,placeholder:Cn,type:!De&&!Cn?"hidden":"visible",...Pe("inputField"),unstyled:d,onFocus:qe=>{O?.(qe),De&&En.openDropdown()},onBlur:qe=>{I?.(qe),En.closeDropdown(),we("")},onKeyDown:We,value:X,onChange:qe=>{we(qe.currentTarget.value),De&&En.openDropdown(),D&&En.selectFirstOption()},disabled:Q,readOnly:H||!De,pointer:!De})})]})})}),a.jsx(y7,{data:Se?Me:to,hidden:H||Q,filter:k,search:X,limit:M,hiddenWhenEmpty:!Ze,withScrollArea:$,maxDropdownHeight:U,filterOptions:De,value:kn,checkIconPosition:ge,withCheckIcon:_e,nothingFoundMessage:Ze,unstyled:d,labelId:bt?`${li}-label`:void 0,"aria-label":bt?void 0:xs["aria-label"],renderOption:Wn,scrollAreaProps:Rl})]}),a.jsx(Xe.HiddenInput,{name:me,valuesDivider:Ar,value:kn,form:ze,disabled:Q,...Qn})]})});em.classes={...Dr.classes,...Xe.classes};em.displayName="@mantine/core/MultiSelect";function r6(e){return"group"in e}function K0({data:e}){if(r6(e)){const o=e.items.map(l=>a.jsx(K0,{data:l},l.value));return a.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}K0.displayName="@mantine/core/NativeSelectOption";const i6={rightSectionPointerEvents:"none"},on=be((e,t)=>{const{data:n,children:r,size:o,error:l,rightSection:c,unstyled:d,...f}=ae("NativeSelect",i6,e),p=m_(n).map((m,g)=>a.jsx(K0,{data:m},g));return a.jsx(Dr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:o,pointer:!0,error:l,unstyled:d,rightSection:c||a.jsx(Bp,{size:o,error:l,unstyled:d}),children:r||p})});on.classes=Dr.classes;on.displayName="@mantine/core/NativeSelect";var Q_={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const o6={withCloseButton:!0},a6=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:$t(t),"--notification-color":n?Ft(n,e):void 0}}),X0=be((e,t)=>{const n=ae("Notification",o6,e),{className:r,color:o,radius:l,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:x,closeButtonProps:b,classNames:w,style:j,styles:C,unstyled:T,variant:E,vars:R,mod:D,loaderProps:P,role:A,...k}=n,M=$e({name:"Notification",classes:Q_,props:n,className:r,style:j,classNames:w,styles:C,unstyled:T,vars:R,varsResolver:a6});return a.jsxs(ce,{...M("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},D],ref:t,variant:E,role:A||"alert",...k,children:[m&&!c&&a.jsx("div",{...M("icon"),children:m}),c&&a.jsx(Fr,{size:28,color:o,...P,...M("loader")}),a.jsxs("div",{...M("body"),children:[p&&a.jsx("div",{...M("title"),children:p}),a.jsx(ce,{...M("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(hs,{iconSize:16,color:"gray",...b,unstyled:T,onClick:x,...M("closeButton")})]})});X0.classes=Q_;X0.displayName="@mantine/core/Notification";function W_(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var dd;(function(e){e.event="event",e.props="prop"})(dd||(dd={}));function es(){}function s6(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t&&r.length===t.length&&r.every(function(l,c){return l===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function fd(e){return!!(e||"").match(/\d/)}function Cc(e){return e==null}function l6(e){return typeof e=="number"&&isNaN(e)}function Y_(e){return Cc(e)||l6(e)||typeof e=="number"&&!isFinite(e)}function K_(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function c6(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 u6(e,t,n){var r=c6(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function d6(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function Z0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),l=o[0],c=o[1]||"";return{beforeDecimal:l,afterDecimal:c,hasNegation:n,addNegation:r}}function f6(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function X_(e,t,n){for(var r="",o=n?"0":"",l=0;l<=t-1;l++)r+=e[l]||o;return r}function bE(e,t){return Array(t+1).join(e)}function Z_(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],l=r[1];if(l=Number(l),!l)return n+o;o=o.replace(".","");var c=1+l,d=o.length;return c<0?o="0."+bE("0",Math.abs(c))+o:c>=d?o=o+bE("0",c-d):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function SE(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=Z0(e),l=o.beforeDecimal,c=o.afterDecimal,d=o.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=l;l&&Number(m[0])&&(g=l.split("").reverse().reduce(function(j,C,T){return j.length>T?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var x=X_(m[1]||"",t,n),b=d?"-":"",w=r?".":"";return""+b+g+w+x}function Hs(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 J_=s6(function(e,t){for(var n=0,r=0,o=e.length,l=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[l-1-r]&&l-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:l-r}}}),h6=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function p6(e,t,n){return Math.min(Math.max(e,t),n)}function dy(e){return Math.max(e.selectionStart,e.selectionEnd)}function m6(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function g6(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function v6(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function y6(e,t,n,r,o,l,c){c===void 0&&(c=v6);var d=o.findIndex(function(D){return D}),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 T=r;T<p&&(x[T]===-1||!l(n[T]));)T++;var E=T===p||x[T]===-1?m:x[T];for(T=r-1;T>0&&x[T]===-1;)T--;var R=T===-1||x[T]===-1?0:x[T]+1;return R>E?E:r-R<E-r?R:E}function wE(e,t,n,r){var o=e.length;if(t=p6(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function x6(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(fd(e[n])||fd(e[n-1]));return t}function eD(e,t,n,r,o,l){l===void 0&&(l=es);var c=d6(function(w,j){var C,T;return Y_(w)?(T="",C=""):typeof w=="number"||j?(T=typeof w=="number"?Z_(w):w,C=r(T)):(T=o(w,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),d=v.useState(function(){return c(Cc(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}),l(w,j)},g=e,x=n;Cc(e)&&(g=f.numAsString,x=!0);var b=c(g,x);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function b6(e){return e.replace(/[^0-9]/g,"")}function S6(e){return e}function w6(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,l=e.getInputRef,c=e.format;c===void 0&&(c=S6);var d=e.removeFormatting;d===void 0&&(d=b6);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,x=e.onChange;x===void 0&&(x=es);var b=e.onKeyDown;b===void 0&&(b=es);var w=e.onMouseUp;w===void 0&&(w=es);var j=e.onFocus;j===void 0&&(j=es);var C=e.onBlur;C===void 0&&(C=es);var T=e.value,E=e.getCaretBoundary;E===void 0&&(E=x6);var R=e.isValidInputCharacter;R===void 0&&(R=fd);var D=e.isCharacterSame,P=W_(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=eD(T,f,!!p,c,d,m),k=A[0],M=k.formattedValue,$=k.numAsString,U=A[1],J=v.useRef(),Z=v.useRef({formattedValue:M,numAsString:$}),Y=function(Ae,De){Z.current={formattedValue:Ae.formattedValue,numAsString:Ae.value},U(Ae,De)},H=v.useState(!1),Q=H[0],O=H[1],I=v.useRef(null),z=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return O(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var F=c,K=function(Ae,De){var Ze=parseFloat(De);return{formattedValue:Ae,value:De,floatValue:isNaN(Ze)?void 0:Ze}},L=function(Ae,De,Ze){Ae.selectionStart===0&&Ae.selectionEnd===Ae.value.length||(Hs(Ae,De),z.current.setCaretTimeout=setTimeout(function(){Ae.value===Ze&&Ae.selectionStart!==De&&Hs(Ae,De)},0))},q=function(Ae,De,Ze){return wE(Ae,De,E(Ae),Ze)},ie=function(Ae,De,Ze){var _e=E(De),ge=y6(De,M,Ae,Ze,_e,R,D);return ge=wE(De,ge,_e),ge},xe=function(Ae){var De=Ae.formattedValue;De===void 0&&(De="");var Ze=Ae.input,_e=Ae.source,ge=Ae.event,Se=Ae.numAsString,He;if(Ze){var me=Ae.inputValue||Ze.value,ze=dy(Ze);Ze.value=De,He=ie(me,De,ze),He!==void 0&&L(Ze,He,De)}De!==M&&Y(K(De,Se),{event:ge,source:_e})};v.useEffect(function(){var Ae=Z.current,De=Ae.formattedValue,Ze=Ae.numAsString;(M!==De||$!==Ze)&&Y(K(M,$),{event:void 0,source:dd.props})},[M,$]);var ve=I.current?dy(I.current):void 0,Ce=typeof window<"u"?v.useLayoutEffect:v.useEffect;Ce(function(){var Ae=I.current;if(M!==Z.current.formattedValue&&Ae){var De=ie(Z.current.formattedValue,M,ve);Ae.value=M,L(Ae,De,M)}},[M]);var Oe=function(Ae,De,Ze){var _e=De.target,ge=J.current?h6(J.current,_e.selectionEnd):J_(M,Ae),Se=Object.assign(Object.assign({},ge),{lastValue:M}),He=d(Ae,Se),me=F(He);if(He=d(me,void 0),g&&!g(K(me,He))){var ze=De.target,Nt=dy(ze),Wt=ie(Ae,M,Nt);return ze.value=M,L(ze,Wt,M),!1}return xe({formattedValue:me,numAsString:He,inputValue:Ae,event:De,source:Ze,input:De.target}),!0},Ee=function(Ae,De){De===void 0&&(De=0);var Ze=Ae.selectionStart,_e=Ae.selectionEnd;J.current={selectionStart:Ze,selectionEnd:_e+De}},Ge=function(Ae){var De=Ae.target,Ze=De.value,_e=Oe(Ze,Ae,dd.event);_e&&x(Ae),J.current=void 0},it=function(Ae){var De=Ae.target,Ze=Ae.key,_e=De.selectionStart,ge=De.selectionEnd,Se=De.value;Se===void 0&&(Se="");var He;Ze==="ArrowLeft"||Ze==="Backspace"?He=Math.max(_e-1,0):Ze==="ArrowRight"?He=Math.min(_e+1,Se.length):Ze==="Delete"&&(He=_e);var me=0;Ze==="Delete"&&_e===ge&&(me=1);var ze=Ze==="ArrowLeft"||Ze==="ArrowRight";if(He===void 0||_e!==ge&&!ze){b(Ae),Ee(De,me);return}var Nt=He;if(ze){var Wt=Ze==="ArrowLeft"?"left":"right";Nt=q(Se,He,Wt),Nt!==He&&Ae.preventDefault()}else Ze==="Delete"&&!R(Se[He])?Nt=q(Se,He,"right"):Ze==="Backspace"&&!R(Se[He])&&(Nt=q(Se,He,"left"));Nt!==He&&L(De,Nt,Se),b(Ae),Ee(De,me)},St=function(Ae){var De=Ae.target,Ze=function(){var _e=De.selectionStart,ge=De.selectionEnd,Se=De.value;if(Se===void 0&&(Se=""),_e===ge){var He=q(Se,_e);He!==_e&&L(De,He,Se)}};Ze(),requestAnimationFrame(function(){Ze()}),w(Ae),Ee(De)},kt=function(Ae){Ae.persist&&Ae.persist();var De=Ae.target,Ze=Ae.currentTarget;I.current=De,z.current.focusTimeout=setTimeout(function(){var _e=De.selectionStart,ge=De.selectionEnd,Se=De.value;Se===void 0&&(Se="");var He=q(Se,_e);He!==_e&&!(_e===0&&ge===Se.length)&&L(De,He,Se),j(Object.assign(Object.assign({},Ae),{currentTarget:Ze}))},0)},Mt=function(Ae){I.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Ae)},ct=Q&&m6()?"numeric":void 0,bt=Object.assign({inputMode:ct},P,{type:t,value:M,onChange:Ge,onKeyDown:it,onMouseUp:St,onFocus:kt,onBlur:Mt});if(n==="text")return o?Tn.createElement(Tn.Fragment,null,o(M,P)||null):Tn.createElement("span",Object.assign({},P,{ref:l}),M);if(r){var Qt=r;return Tn.createElement(Qt,Object.assign({},bt,{ref:l}))}return Tn.createElement("input",Object.assign({},bt,{ref:l}))}function jE(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var l=t.suffix;l===void 0&&(l="");var c=t.allowNegative,d=t.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var f=tm(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,x=Z0(e,c),b=x.beforeDecimal,w=x.afterDecimal,j=x.addNegation;return n!==void 0&&(w=X_(w,n,!!r)),p&&(b=u6(b,p,d)),o&&(b=o+b),l&&(w=w+l),j&&(b="-"+b),e=b+(g&&m||"")+w,e}function tm(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 j6(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),l=r.test(e);return e=e.replace(/-/g,""),o&&!l&&t&&(e="-"+e),e}function C6(e,t){return new RegExp("(^-)|[0-9]|"+K_(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=g6(e));var o=n.allowNegative,l=n.prefix;l===void 0&&(l="");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=tm(n),b=x.allowedDecimalSeparators,w=x.decimalSeparator,j=e[g]===w;if(fd(e)&&(e===l||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 T=function(I,z,F){var K=!1,L=!1;l.startsWith("-")?K=!1:I.startsWith("--")?(K=!1,L=!0):c.startsWith("-")&&I.length===c.length?K=!1:I[0]==="-"&&(K=!0);var q=K?1:0;return L&&(q=2),q&&(I=I.substring(q),z-=q,F-=q),{value:I,start:z,end:F,hasNegation:K}},E=T(e,m,g),R=E.hasNegation;r=E,e=r.value,m=r.start,g=r.end;var D=T(t.lastValue,f.start,f.end),P=D.start,A=D.end,k=D.value,M=e.substring(m,g);e.length&&k.length&&(P>k.length-c.length||A<l.length)&&!(M&&c.startsWith(M))&&(e=k);var $=0;e.startsWith(l)?$+=l.length:m<l.length&&($=m),e=e.substring($),g-=$;var U=e.length,J=e.length-c.length;e.endsWith(c)?U=J:(g>J||g>e.length-c.length)&&(U=g),e=e.substring(0,U),e=j6(R?"-"+e:e,o),e=(e.match(C6(w))||[]).join("");var Z=e.indexOf(w);e=e.replace(new RegExp(K_(w),"g"),function(I,z){return z===Z?".":""});var Y=Z0(e,o),H=Y.beforeDecimal,Q=Y.afterDecimal,O=Y.addNegation;return p.end-p.start<f.end-f.start&&H===""&&j&&!parseFloat(Q)&&(e=O?"-":""),e}function R6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),l=e[0]==="-";o.fill(!1,0,n.length+(l?1:0));var c=e.length;return o.fill(!1,c-r.length+1,c+1),o}function _6(e){var t=tm(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var l=e.allowNegative;if(l===void 0&&(l=!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 o.startsWith("-")&&l&&(console.error(`
73
- Prefix can't start with '-' when allowNegative is true.
74
- prefix: `+o+`
75
- allowNegative: `+l+`
76
- `),l=!1),Object.assign(Object.assign({},e),{allowNegative:l})}function D6(e){e=_6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=es);var l=e.onBlur;l===void 0&&(l=es);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=W_(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=tm(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,E=function(O){return jE(O,e)},R=function(O,I){return T6(O,I,e)},D=Cc(g)?m:g,P=x??E6(D,p,t);Cc(g)?Cc(m)||(P=P||typeof m=="number"):P=P||typeof g=="number";var A=function(O){return Y_(O)?O:(typeof O=="number"&&(O=Z_(O)),P&&typeof d=="number"?SE(O,d,!!f):O)},k=eD(A(g),A(m),!!P,E,R,b),M=k[0],$=M.numAsString,U=M.formattedValue,J=k[1],Z=function(O){var I=O.target,z=O.key,F=I.selectionStart,K=I.selectionEnd,L=I.value;if(L===void 0&&(L=""),(z==="Backspace"||z==="Delete")&&K<p.length){O.preventDefault();return}if(F!==K){o(O);return}z==="Backspace"&&L[0]==="-"&&F===p.length+1&&n&&Hs(I,1),d&&f&&(z==="Backspace"&&L[F-1]===C?(Hs(I,F-1),O.preventDefault()):z==="Delete"&&L[F]===C&&O.preventDefault()),T?.includes(z)&&L[F]===C&&Hs(I,F+1);var q=c===!0?",":c;z==="Backspace"&&L[F-1]===q&&Hs(I,F-1),z==="Delete"&&L[F]===q&&Hs(I,F+1),o(O)},Y=function(O){var I=$;if(I.match(/\d/g)||(I=""),r||(I=f6(I)),f&&d&&(I=SE(I,d,f)),I!==$){var z=jE(I,e);J({formattedValue:z,value:I,floatValue:parseFloat(I)},{event:O,source:dd.event})}l(O)},H=function(O){return O===C?!0:fd(O)},Q=function(O){var I=O.currentValue,z=O.lastValue,F=O.formattedValue,K=O.currentValueIndex,L=O.formattedValueIndex,q=I[K],ie=F[L],xe=J_(z,I),ve=xe.to,Ce=function(Oe){return R(Oe).indexOf(".")+p.length};return g===0&&f&&d&&I[ve.start]===C&&Ce(I)<K&&Ce(F)>L?!1:K>=ve.start&&K<ve.end&&T&&T.includes(q)&&ie===C?!0:q===ie};return Object.assign(Object.assign({},w),{value:U,valueIsNumericString:!1,isValidInputCharacter:H,isCharacterSame:Q,onValueChange:J,format:E,removeFormatting:R,getCaretBoundary:function(O){return R6(O,e)},onKeyDown:Z,onBlur:Y})}function A6(e){var t=D6(e);return Tn.createElement(w6,Object.assign({},t))}function CE({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 nx={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const P6=/^(0\.0*|-0(\.0*)?)$/,k6=/^-?0\d+(\.\d+)?\.?$/;function rx(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function fy(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||rx(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function N6(e){return e.toString().replace(".","").length}function O6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&N6(t)<14&&t!==""}function EE(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const M6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},L6=(e,{size:t})=>({controls:{"--ni-chevron-size":at(t,"ni-chevron-size")}});function I6(e,t,n){const r=e.toString().replace(/^0+/,""),o=parseFloat(r);return Number.isNaN(o)?r:o>Number.MAX_SAFE_INTEGER?t!==void 0?String(t):r:Nh(o,n,t)}const Oc=be((e,t)=>{const n=ae("NumberInput",M6,e),{className:r,classNames:o,styles:l,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:x,min:b,step:w,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:E,onBlur:R,allowDecimal:D,decimalScale:P,onKeyDown:A,onKeyDownCapture:k,handlersRef:M,startValue:$,disabled:U,rightSectionPointerEvents:J,allowNegative:Z,readOnly:Y,size:H,rightSectionWidth:Q,stepHoldInterval:O,stepHoldDelay:I,allowLeadingZeros:z,withKeyboardEvents:F,trimLeadingZeroesOnBlur:K,...L}=n,q=$e({name:"NumberInput",classes:nx,props:n,classNames:o,styles:l,unstyled:c,vars:d,varsResolver:L6}),{resolvedClassNames:ie,resolvedStyles:xe}=fl({classNames:o,styles:l,props:n}),[ve,Ce]=Zn({value:m,defaultValue:g,finalValue:"",onChange:f}),Oe=I!==void 0&&O!==void 0,Ee=v.useRef(null),Ge=v.useRef(null),it=v.useRef(0),St=(me,ze)=>{ze.source==="event"&&Ce(O6(me.floatValue,me.value)&&!P6.test(me.value)&&!(z&&k6.test(me.value))?me.floatValue:me.value),p?.(me,ze)},kt=me=>{const ze=String(me).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return ze?Math.max(0,(ze[1]?ze[1].length:0)-(ze[2]?+ze[2]:0)):0},Mt=me=>{Ee.current&&typeof me<"u"&&Ee.current.setSelectionRange(me,me)},ct=v.useRef(Gh);ct.current=()=>{if(!fy(ve))return;let me;const ze=kt(ve),Nt=kt(w),Wt=Math.max(ze,Nt),jn=10**Wt;if(!rx(ve)&&(typeof ve!="number"||Number.isNaN(ve)))me=Nh($,b,x);else if(x!==void 0){const Cn=(Math.round(Number(ve)*jn)+Math.round(w*jn))/jn;me=Cn<=x?Cn:x}else me=(Math.round(Number(ve)*jn)+Math.round(w*jn))/jn;const Qn=me.toFixed(Wt);Ce(parseFloat(Qn)),p?.({floatValue:parseFloat(Qn),formattedValue:Qn,value:Qn},{source:"increment"}),setTimeout(()=>Mt(Ee.current?.value.length),0)};const bt=v.useRef(Gh);bt.current=()=>{if(!fy(ve))return;let me;const ze=b!==void 0?b:Z?Number.MIN_SAFE_INTEGER:0,Nt=kt(ve),Wt=kt(w),jn=Math.max(Nt,Wt),Qn=10**jn;if(!rx(ve)&&typeof ve!="number"||Number.isNaN(ve))me=Nh($,ze,x);else{const Ar=(Math.round(Number(ve)*Qn)-Math.round(w*Qn))/Qn;me=ze!==void 0&&Ar<ze?ze:Ar}const Cn=me.toFixed(jn);Ce(parseFloat(Cn)),p?.({floatValue:parseFloat(Cn),formattedValue:Cn,value:Cn},{source:"decrement"}),setTimeout(()=>Mt(Ee.current?.value.length),0)};const Qt=me=>{A?.(me),!(Y||!F)&&(me.key==="ArrowUp"&&(me.preventDefault(),ct.current()),me.key==="ArrowDown"&&(me.preventDefault(),bt.current()))},Ae=me=>{if(k?.(me),me.key==="Backspace"){const ze=Ee.current;ze.selectionStart===0&&ze.selectionStart===ze.selectionEnd&&(me.preventDefault(),window.setTimeout(()=>Mt(0),0))}},De=me=>{let ze=ve;E==="blur"&&typeof ze=="number"&&(ze=Nh(ze,b,x)),K&&typeof ze=="string"&&kt(ze)<15&&(ze=I6(ze,x,b)),ve!==ze&&Ce(ze),R?.(me)};sd(M,{increment:ct.current,decrement:bt.current});const Ze=me=>{me?ct.current():bt.current(),it.current+=1},_e=me=>{if(Ze(me),Oe){const ze=typeof O=="number"?O:O(it.current);Ge.current=window.setTimeout(()=>_e(me),ze)}},ge=(me,ze)=>{me.preventDefault(),Ee.current?.focus(),Ze(ze),Oe&&(Ge.current=window.setTimeout(()=>_e(ze),I))},Se=()=>{Ge.current&&window.clearTimeout(Ge.current),Ge.current=null,it.current=0},He=a.jsxs("div",{...q("controls"),children:[a.jsx(sr,{...q("control"),tabIndex:-1,"aria-hidden":!0,disabled:U||typeof ve=="number"&&x!==void 0&&ve>=x,mod:{direction:"up"},onMouseDown:me=>me.preventDefault(),onPointerDown:me=>{ge(me,!0)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(CE,{direction:"up"})}),a.jsx(sr,{...q("control"),tabIndex:-1,"aria-hidden":!0,disabled:U||typeof ve=="number"&&b!==void 0&&ve<=b,mod:{direction:"down"},onMouseDown:me=>me.preventDefault(),onPointerDown:me=>{ge(me,!1)},onPointerUp:Se,onPointerLeave:Se,children:a.jsx(CE,{direction:"down"})})]});return a.jsx(Dr,{component:A6,allowNegative:Z,className:Ot(nx.root,r),size:H,...L,readOnly:Y,disabled:U,value:ve,getInputRef:qn(t,Ee),onValueChange:St,rightSection:j||Y||!fy(ve)?C:C||He,classNames:ie,styles:xe,unstyled:c,__staticSelector:"NumberInput",decimalScale:D?P:0,onKeyDown:Qt,onKeyDownCapture:Ae,rightSectionPointerEvents:J??(U?"none":void 0),rightSectionWidth:Q??`var(--ni-right-section-width-${H||"sm"})`,allowLeadingZeros:z,onBlur:De,isAllowed:me=>E==="strict"?T?T(me)&&EE(me.floatValue,b,x):EE(me.floatValue,b,x):T?T(me):!0})});Oc.classes={...Dr.classes,...nx};Oc.displayName="@mantine/core/NumberInput";const[z6,nm]=Rr("Pagination.Root component was not found in tree");var Od={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const $6={withPadding:!0},Md=be((e,t)=>{const n=ae("PaginationControl",$6,e),{classNames:r,className:o,style:l,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...x}=n,b=nm(),w=p||b.disabled;return a.jsx(sr,{ref:t,disabled:w,mod:[{active:f,disabled:w,"with-padding":m},g],...b.getStyles("control",{className:o,style:l,classNames:r,styles:c,active:!w}),...x})});Md.classes=Od;Md.displayName="@mantine/core/PaginationControl";function Ld({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 U6=e=>a.jsx(Ld,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),B6=e=>a.jsx(Ld,{...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(Ld,{...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"}),F6=e=>a.jsx(Ld,{...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"}),H6=e=>a.jsx(Ld,{...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"}),q6={icon:H6},rm=be((e,t)=>{const n=ae("PaginationDots",q6,e),{classNames:r,className:o,style:l,styles:c,vars:d,icon:f,...p}=n,m=nm(),g=f;return a.jsx(ce,{ref:t,...m.getStyles("dots",{className:o,style:l,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)"}})})});rm.classes=Od;rm.displayName="@mantine/core/PaginationDots";function im({icon:e,name:t,action:n,type:r}){const o={icon:e},l=v.forwardRef((c,d)=>{const{icon:f,...p}=ae(t,o,c),m=f,g=nm(),x=r==="next"?g.active===g.total:g.active===1;return a.jsx(Md,{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 l.displayName=`@mantine/core/${t}`,l}const tD=im({icon:U6,name:"PaginationNext",action:"onNext",type:"next"}),nD=im({icon:B6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),rD=im({icon:V6,name:"PaginationFirst",action:"onFirst",type:"previous"}),iD=im({icon:F6,name:"PaginationLast",action:"onLast",type:"next"});function J0({dotsIcon:e}){const t=nm(),n=t.range.map((r,o)=>r==="dots"?a.jsx(rm,{icon:e},o):a.jsx(Md,{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},o));return a.jsx(a.Fragment,{children:n})}J0.displayName="@mantine/core/PaginationItems";const G6={siblings:1,boundaries:1},Q6=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:$t(n),"--pagination-control-size":at(t,"pagination-control-size"),"--pagination-control-fz":In(t),"--pagination-active-bg":r?Ft(r,e):void 0,"--pagination-active-color":hl(o,e)?ma({color:r,theme:e,autoContrast:o}):void 0}}),om=be((e,t)=>{const n=ae("PaginationRoot",G6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:x,disabled:b,siblings:w,boundaries:j,color:C,radius:T,onNextPage:E,onPreviousPage:R,onFirstPage:D,onLastPage:P,getItemProps:A,autoContrast:k,...M}=n,$=$e({name:"Pagination",classes:Od,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Q6}),{range:U,setPage:J,next:Z,previous:Y,active:H,first:Q,last:O}=t4({page:m,initialPage:g,onChange:x,total:p,siblings:w,boundaries:j}),I=Ur(E,Z),z=Ur(R,Y),F=Ur(D,Q),K=Ur(P,O);return a.jsx(z6,{value:{total:p,range:U,active:H,disabled:b,getItemProps:A,onChange:J,onNext:I,onPrevious:z,onFirst:F,onLast:K,getStyles:$},children:a.jsx(ce,{ref:t,...$("root"),...M})})});om.classes=Od;om.displayName="@mantine/core/PaginationRoot";const W6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},Oi=be((e,t)=>{const n=ae("Pagination",W6,e),{withEdges:r,withControls:o,getControlProps:l,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(om,{ref:t,total:g,...j,children:a.jsxs(ye,{gap:x,children:[r&&a.jsx(rD,{icon:p,...l?.("first")}),o&&a.jsx(nD,{icon:d,...l?.("previous")}),w&&a.jsx(J0,{dotsIcon:m}),o&&a.jsx(tD,{icon:c,...l?.("next")}),r&&a.jsx(iD,{icon:f,...l?.("last")})]})})});Oi.classes=Od;Oi.displayName="@mantine/core/Pagination";Oi.Root=om;Oi.Control=Md;Oi.Dots=rm;Oi.First=rD;Oi.Last=iD;Oi.Next=tD;Oi.Previous=nD;Oi.Items=J0;const Y6=({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 ix={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const K6={visibilityToggleIcon:Y6},X6=(e,{size:t})=>({root:{"--psi-icon-size":at(t,"psi-icon-size"),"--psi-button-size":at(t,"psi-button-size")}}),Qi=be((e,t)=>{const n=ae("PasswordInput",K6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:x,id:b,variant:w,inputContainer:j,description:C,label:T,size:E,errorProps:R,descriptionProps:D,labelProps:P,withAsterisk:A,inputWrapperOrder:k,wrapperProps:M,radius:$,rightSection:U,rightSectionWidth:J,rightSectionPointerEvents:Z,leftSectionWidth:Y,visible:H,defaultVisible:Q,onVisibilityChange:O,visibilityToggleIcon:I,visibilityToggleButtonProps:z,rightSectionProps:F,leftSectionProps:K,leftSectionPointerEvents:L,withErrorStyles:q,mod:ie,...xe}=n,ve=_r(b),[Ce,Oe]=Zn({value:H,defaultValue:Q,finalValue:!1,onChange:O}),Ee=()=>Oe(!Ce),Ge=$e({name:"PasswordInput",classes:ix,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:X6}),{resolvedClassNames:it,resolvedStyles:St}=fl({classNames:r,styles:c,props:n}),{styleProps:kt,rest:Mt}=ga(xe),ct=I,bt=R?.id||`${ve}-error`,Qt=D?.id||`${ve}-description`,Ze=`${!!m&&typeof m!="boolean"?bt:""} ${!!C?Qt:""}`,_e=Ze.trim().length>0?Ze.trim():void 0,ge=a.jsx(bn,{...Ge("visibilityToggle"),disabled:x,radius:$,"aria-hidden":!z,tabIndex:-1,...z,variant:z?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:Se=>{Se.preventDefault(),z?.onTouchEnd?.(Se),Ee()},onMouseDown:Se=>{Se.preventDefault(),z?.onMouseDown?.(Se),Ee()},onKeyDown:Se=>{z?.onKeyDown?.(Se),Se.key===" "&&(Se.preventDefault(),Ee())},children:a.jsx(ct,{reveal:Ce})});return a.jsx(un.Wrapper,{required:p,id:ve,label:T,error:m,description:C,size:E,classNames:it,styles:St,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:A,inputWrapperOrder:k,inputContainer:j,variant:w,labelProps:{...P,htmlFor:ve},descriptionProps:{...D,id:Qt},errorProps:{...R,id:bt},mod:ie,...Ge("root"),...kt,...M,children:a.jsx(un,{component:"div",error:m,leftSection:g,size:E,classNames:{...it,input:Ot(ix.input,it.input)},styles:St,radius:$,disabled:x,__staticSelector:"PasswordInput",rightSectionWidth:J,rightSection:U??ge,variant:w,unstyled:d,leftSectionWidth:Y,rightSectionPointerEvents:Z||"all",rightSectionProps:F,leftSectionProps:K,leftSectionPointerEvents:L,withAria:!1,withErrorStyles:q,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...Ge("innerInput"),disabled:x,id:ve,ref:t,...Mt,"aria-describedby":_e,autoComplete:Mt.autoComplete||"off",type:Ce?"text":"password"})})})});Qi.classes={...Dr.classes,...ix};Qi.displayName="@mantine/core/PasswordInput";const[Z6,oD]=ha(),[J6,ez]=ha();var aD={card:"m_9dc8ae12"};const tz={withBorder:!0},nz=(e,{radius:t})=>({card:{"--card-radius":$t(t)}}),eb=be((e,t)=>{const n=ae("RadioCard",tz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:x,onClick:b,name:w,onKeyDown:j,...C}=n,T=$e({name:"RadioCard",classes:aD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:nz,rootSelector:"card"}),{dir:E}=ml(),R=oD(),D=typeof p=="boolean"?p:R?.value===x||!1,P=w||R?.name,A=k=>{if(j?.(k),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(k.nativeEvent.code)){k.preventDefault();const M=Array.from(document.querySelectorAll(`[role="radio"][name="${P||"__mantine"}"]`)),$=M.findIndex(Z=>Z===k.target),U=$+1>=M.length?0:$+1,J=$-1<0?M.length-1:$-1;k.nativeEvent.code==="ArrowDown"&&(M[U].focus(),M[U].click()),k.nativeEvent.code==="ArrowUp"&&(M[J].focus(),M[J].click()),k.nativeEvent.code==="ArrowLeft"&&(M[E==="ltr"?J:U].focus(),M[E==="ltr"?J:U].click()),k.nativeEvent.code==="ArrowRight"&&(M[E==="ltr"?U:J].focus(),M[E==="ltr"?U:J].click())}};return a.jsx(J6,{value:{checked:D},children:a.jsx(sr,{ref:t,mod:[{"with-border":g,checked:D},m],...T("card"),...C,role:"radio","aria-checked":D,name:P,onClick:k=>{b?.(k),R?.onChange(x||"")},onKeyDown:A})})});eb.displayName="@mantine/core/RadioCard";eb.classes=aD;const rz={},tb=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:l,wrapperProps:c,children:d,name:f,readOnly:p,...m}=ae("RadioGroup",rz,e),g=_r(f),[x,b]=Zn({value:n,defaultValue:r,finalValue:"",onChange:o}),w=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return a.jsx(Z6,{value:{value:x,onChange:w,size:l,name:g},children:a.jsx(un.Wrapper,{size:l,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(D0,{role:"radiogroup",children:d})})})});tb.classes=un.Wrapper.classes;tb.displayName="@mantine/core/RadioGroup";function sD({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 lD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const iz={icon:sD},oz=(e,{radius:t,color:n,size:r,iconColor:o,variant:l,autoContrast:c})=>{const d=Ri({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":at(r,"radio-size"),"--radio-radius":t===void 0?void 0:$t(t),"--radio-color":l==="outline"?f:Ft(n,e),"--radio-icon-size":at(r,"radio-icon-size"),"--radio-icon-color":o?Ft(o,e):hl(c,e)?ma({color:n,theme:e,autoContrast:c}):void 0}}},nb=be((e,t)=>{const n=ae("RadioIndicator",iz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:x,autoContrast:b,checked:w,mod:j,variant:C,disabled:T,...E}=n,R=p,D=$e({name:"RadioIndicator",classes:lD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:oz,rootSelector:"indicator"}),P=ez(),A=typeof w=="boolean"?w:P?.checked||!1;return a.jsx(ce,{ref:t,...D("indicator",{variant:C}),variant:C,mod:[{checked:A,disabled:T},j],...E,children:a.jsx(R,{...D("icon")})})});nb.displayName="@mantine/core/RadioIndicator";nb.classes=lD;var cD={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const az={labelPosition:"right"},sz=(e,{size:t,radius:n,color:r,iconColor:o,variant:l,autoContrast:c})=>{const d=Ri({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":at(t,"radio-size"),"--radio-radius":n===void 0?void 0:$t(n),"--radio-color":l==="outline"?f:Ft(r,e),"--radio-icon-color":o?Ft(o,e):hl(c,e)?ma({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":at(t,"radio-icon-size")}}},ur=be((e,t)=>{const n=ae("Radio",az,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:x,description:b,error:w,radius:j,color:C,variant:T,disabled:E,wrapperProps:R,icon:D=sD,rootRef:P,iconColor:A,onChange:k,mod:M,...$}=n,U=$e({name:"Radio",classes:cD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:sz}),J=oD(),Z=J?.size??m,Y=n.size?m:Z,{styleProps:H,rest:Q}=ga($),O=_r(p),I=J?{checked:J.value===Q.value,name:Q.name??J.name,onChange:z=>{J.onChange(z),k?.(z)}}:{};return a.jsx(Vp,{...U("root"),__staticSelector:"Radio",__stylesApiProps:n,id:O,size:Y,labelPosition:x,label:g,description:b,error:w,disabled:E,classNames:r,styles:c,unstyled:d,"data-checked":I.checked||void 0,variant:T,ref:P,mod:M,...H,...R,children:a.jsxs(ce,{...U("inner"),mod:{"label-position":x},children:[a.jsx(ce,{...U("radio",{focusable:!0,variant:T}),onChange:k,...Q,...I,component:"input",mod:{error:!!w},ref:t,id:O,disabled:E,type:"radio"}),a.jsx(D,{...U("icon"),"aria-hidden":!0})]})})});ur.classes=cD;ur.displayName="@mantine/core/Radio";ur.Group=tb;ur.Card=eb;ur.Indicator=nb;const lz={duration:100,transition:"fade"};function cz(e,t){return{...lz,...t,...e}}function uz({offset:e,position:t,defaultOpened:n}){const[r,o]=v.useState(n),l=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=r0({placement:t,middleware:[Jx({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=l.current;j.addEventListener("mousemove",w);const C=ia(p.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",w),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,w,r]),{handleMouseMove:w,x:c,y:d,opened:r,setOpened:o,boundaryRef:l,floating:p.setFloating}}var am={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const dz={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:oi("popover")},fz=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:$t(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),rb=be((e,t)=>{const n=ae("TooltipFloating",dz,e),{children:r,refProp:o,withinPortal:l,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:x,label:b,offset:w,position:j,multiline:C,zIndex:T,disabled:E,defaultOpened:R,variant:D,vars:P,portalProps:A,...k}=n,M=Sn(),$=$e({name:"TooltipFloating",props:n,classes:am,className:d,style:c,classNames:f,styles:p,unstyled:m,rootSelector:"tooltip",vars:P,varsResolver:fz}),{handleMouseMove:U,x:J,y:Z,opened:Y,boundaryRef:H,floating:Q,setOpened:O}=uz({offset:w,position:j,defaultOpened:R});if(!fa(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const I=qn(H,Rp(r),t),z=r.props,F=L=>{z.onMouseEnter?.(L),U(L),O(!0)},K=L=>{z.onMouseLeave?.(L),O(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(fs,{...A,withinPortal:l,children:a.jsx(ce,{...k,...$("tooltip",{style:{...t2(c,M),zIndex:T,display:!E&&Y?"block":"none",top:(Z&&Math.round(Z))??"",left:(J&&Math.round(J))??""}}),variant:D,ref:Q,mod:{multiline:C},children:b})}),v.cloneElement(r,{...z,[o]:I,onMouseEnter:F,onMouseLeave:K})]})});rb.classes=am;rb.displayName="@mantine/core/TooltipFloating";const uD=v.createContext(!1),hz=uD.Provider,pz=()=>v.useContext(uD),mz={openDelay:0,closeDelay:0};function ib(e){const{openDelay:t,closeDelay:n,children:r}=ae("TooltipGroup",mz,e);return a.jsx(hz,{value:!0,children:a.jsx(H9,{delay:{open:t,close:n},children:r})})}ib.displayName="@mantine/core/TooltipGroup";ib.extend=e=>e;function gz(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 vz(e){const t=gz(e.middlewares),n=[b2(e.offset)];return t.shift&&n.push(Jx(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Zh():Zh(t.flip)),n.push(S2({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?rd():rd(t.inline)):e.inline&&n.push(rd()),n}function yz(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,l=pz(),c=_r(),d=v.useCallback(A=>{n(A),A&&E(c)},[c]),{x:f,y:p,context:m,refs:g,update:x,placement:b,middlewareData:{arrow:{x:w,y:j}={}}}=r0({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:vz(e)}),{delay:C,currentId:T,setCurrentId:E}=q9(m,{id:c}),{getReferenceProps:R,getFloatingProps:D}=Z9([V9(m,{enabled:e.events?.hover,delay:l?C:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),X9(m,{enabled:e.events?.focus,visibleOnly:!0}),e5(m,{role:"tooltip"}),Y9(m,{enabled:typeof e.opened>"u"})]);Q2({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:x}}),oa(()=>{e.onPositionChange?.(b)},[b]);const P=o&&T&&T!==c;return{x:f,y:p,arrowX:w,arrowY:j,reference:g.setReference,floating:g.setFloating,getFloatingProps:D,getReferenceProps:R,isGroupPhase:P,opened:o,placement:b}}const TE={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:oi("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},xz=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:$t(t),"--tooltip-bg":n?Ft(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),ca=be((e,t)=>{const n=ae("Tooltip",TE,e),{children:r,position:o,refProp:l,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:x,radius:b,color:w,classNames:j,styles:C,unstyled:T,style:E,className:R,withArrow:D,arrowSize:P,arrowOffset:A,arrowRadius:k,arrowPosition:M,offset:$,transitionProps:U,multiline:J,events:Z,zIndex:Y,disabled:H,positionDependencies:Q,onClick:O,onMouseEnter:I,onMouseLeave:z,inline:F,variant:K,keepMounted:L,vars:q,portalProps:ie,mod:xe,floatingStrategy:ve,middlewares:Ce,...Oe}=ae("Tooltip",TE,n),{dir:Ee}=ml(),Ge=v.useRef(null),it=yz({position:U2(Ee,o),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:Z,arrowRef:Ge,arrowOffset:A,offset:typeof $=="number"?$+(D?P/2:0):$,positionDependencies:[...Q,r],inline:F,strategy:ve,middlewares:Ce}),St=$e({name:"Tooltip",props:n,classes:am,className:R,style:E,classNames:j,styles:C,unstyled:T,rootSelector:"tooltip",vars:q,varsResolver:xz});if(!fa(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 kt=qn(it.reference,Rp(r),t),Mt=cz(U,{duration:100,transition:"fade"}),ct=r.props;return a.jsxs(a.Fragment,{children:[a.jsx(fs,{...ie,withinPortal:x,children:a.jsx(_o,{...Mt,keepMounted:L,mounted:!H&&!!it.opened,duration:it.isGroupPhase?10:Mt.duration,children:bt=>a.jsxs(ce,{...Oe,"data-fixed":ve==="fixed"||void 0,variant:K,mod:[{multiline:J},xe],...it.getFloatingProps({ref:it.floating,className:St("tooltip").className,style:{...St("tooltip").style,...bt,zIndex:Y,top:it.y??0,left:it.x??0}}),children:[c,a.jsx(s0,{ref:Ge,arrowX:it.arrowX,arrowY:it.arrowY,visible:D,position:it.placement,arrowSize:P,arrowOffset:A,arrowRadius:k,arrowPosition:M,...St("arrow")})]})})}),v.cloneElement(r,it.getReferenceProps({onClick:O,onMouseEnter:I,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:Ot(R,ct.className),...ct,[l]:kt}))]})});ca.classes=am;ca.displayName="@mantine/core/Tooltip";ca.Floating=rb;ca.Group=ib;function bz({size:e,thickness:t,sum:n,value:r,root:o,offset:l}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=o||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:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:o?0:l||0}}function dD({size:e,value:t,offset:n,sum:r,thickness:o,root:l,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const x=Sn();return a.jsx(ca.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",...bz({sum:r,size:e,thickness:o,value:t,offset:n,root:l})})})}dD.displayName="@mantine/core/Curve";function Sz({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const l=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:l,offset:d,data:n[m],root:!1}),d-=n[m].value/100*c;if(f.push({sum:l,offset:d,data:{color:o},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 fD={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function wz(e,t){return Math.min(e||12,(t||120)/4)}const jz={size:120,thickness:12},Cz=(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}}),sm=be((e,t)=>{const n=ae("RingProgress",jz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:x,roundCaps:b,rootColor:w,transitionDuration:j,...C}=n,T=$e({name:"RingProgress",classes:fD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Cz}),E=wz(x,g),R=Sz({size:g,thickness:E,sections:m,renderRoundedLineCaps:b,rootColor:w}).map(({data:D,sum:P,root:A,lineRoundCaps:k,offset:M},$)=>v.createElement(dD,{...D,key:$,size:g,thickness:E,sum:P,offset:M,color:D?.color,root:A,lineRoundCaps:k,getStyles:T}));return a.jsxs(ce,{...T("root"),size:g,ref:t,...C,children:[a.jsx("svg",{...T("svg"),children:R}),p&&a.jsx("div",{...T("label"),children:p})]})});sm.classes=fD;sm.displayName="@mantine/core/RingProgress";var hD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const Ez={withItemsBorders:!0},Tz=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:l})=>({root:{"--sc-radius":t===void 0?void 0:$t(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":l,"--sc-padding":at(o,"sc-padding"),"--sc-font-size":In(o)}}),Id=be((e,t)=>{const n=ae("SegmentedControl",Ez,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:x,size:b,name:w,disabled:j,readOnly:C,fullWidth:T,orientation:E,radius:R,color:D,transitionDuration:P,transitionTimingFunction:A,variant:k,autoContrast:M,withItemsBorders:$,mod:U,...J}=n,Z=$e({name:"SegmentedControl",props:n,classes:hD,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Tz}),Y=Sn(),H=p.map(Ee=>typeof Ee=="string"?{label:Ee,value:Ee}:Ee),Q=s4(),[O,I]=v.useState(Qh()),[z,F]=v.useState(null),[K,L]=v.useState({}),q=(Ee,Ge)=>{K[Ge]=Ee,L(K)},[ie,xe]=Zn({value:m,defaultValue:g,finalValue:Array.isArray(p)?H.find(Ee=>!Ee.disabled)?.value??p[0]?.value??null:null,onChange:x}),ve=_r(w),Ce=H.map(Ee=>v.createElement(ce,{...Z("control"),mod:{active:ie===Ee.value,orientation:E},key:Ee.value},v.createElement("input",{...Z("input"),disabled:j||Ee.disabled,type:"radio",name:ve,value:Ee.value,id:`${ve}-${Ee.value}`,checked:ie===Ee.value,onChange:()=>!C&&xe(Ee.value),"data-focus-ring":Y.focusRing,key:`${Ee.value}-input`}),v.createElement(ce,{component:"label",...Z("label"),mod:{active:ie===Ee.value&&!(j||Ee.disabled),disabled:j||Ee.disabled,"read-only":C},htmlFor:`${ve}-${Ee.value}`,ref:Ge=>q(Ge,Ee.value),__vars:{"--sc-label-color":D!==void 0?ma({color:D,theme:Y,autoContrast:M}):void 0},key:`${Ee.value}-label`},a.jsx("span",{...Z("innerLabel"),children:Ee.label})))),Oe=qn(t,Ee=>F(Ee));return i4(()=>{I(Qh())},[p.length]),p.length===0?null:a.jsxs(ce,{...Z("root"),variant:k,size:b,ref:Oe,mod:[{"full-width":T,orientation:E,initialized:Q,"with-items-borders":$},U],...J,role:"radiogroup","data-disabled":j,children:[typeof ie=="string"&&a.jsx(f0,{target:K[ie],parent:z,component:"span",transitionDuration:"var(--sc-transition-duration)",...Z("indicator")},O),Ce]})});Id.classes=hD;Id.displayName="@mantine/core/SegmentedControl";function Rz({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=Sn(),l=t===void 0?e:t,c=ds({"--sg-spacing-x":Ln(Hi(e)),"--sg-spacing-y":Ln(Hi(l)),"--sg-cols":Hi(n)?.toString()}),d=rn(o.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Ln(e[g])),typeof l=="object"&&l[g]!==void 0&&(m[g]["--sg-spacing-y"]=Ln(l[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),p=ad(rn(d),o.breakpoints).filter(m=>rn(d[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(pl,{styles:c,media:p,selector:r})}function hy(e){return typeof e=="object"&&e!==null?rn(e):[]}function _z(e){return e.sort((t,n)=>od(t)-od(n))}function Dz({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...hy(e),...hy(t),...hy(n)]));return _z(r)}function Az({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,l=ds({"--sg-spacing-x":Ln(Hi(e)),"--sg-spacing-y":Ln(Hi(o)),"--sg-cols":Hi(n)?.toString()}),c=Dz({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"]=Ln(e[m])),typeof o=="object"&&o[m]!==void 0&&(p[m]["--sg-spacing-y"]=Ln(o[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(pl,{styles:l,container:f,selector:r})}var pD={container:"m_925c2d2c",root:"m_2415a157"};const Pz={cols:1,spacing:"md",type:"media"},lm=be((e,t)=>{const n=ae("SimpleGrid",Pz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:x,...b}=n,w=$e({name:"SimpleGrid",classes:pD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f}),j=jd();return x==="container"?a.jsxs(a.Fragment,{children:[a.jsx(Az,{...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(Rz,{...n,selector:`.${j}`}),a.jsx(ce,{ref:t,...w("root",{className:j}),...b})]})});lm.classes=pD;lm.displayName="@mantine/core/SimpleGrid";const kz={},cm=be((e,t)=>{const{w:n,h:r,miw:o,mih:l,...c}=ae("Space",kz,e);return a.jsx(ce,{ref:t,...c,w:n,miw:o??n,h:r,mih:l??r})});cm.displayName="@mantine/core/Space";var mD={root:"m_6d731127"};const Nz={gap:"md",align:"stretch",justify:"flex-start"},Oz=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Ln(t),"--stack-align":n,"--stack-justify":r}}),Be=be((e,t)=>{const n=ae("Stack",Nz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:x,...b}=n,w=$e({name:"Stack",props:n,classes:mD,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Oz});return a.jsx(ce,{ref:t,...w("root"),variant:x,...b})});Be.classes=mD;Be.displayName="@mantine/core/Stack";const[Mz,Lz]=Rr("Stepper component was not found in tree"),ep=()=>null;ep.displayName="@mantine/core/StepperCompleted";var ob={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 xh=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,Iz={withIcon:!0,allowStepClick:!0,iconPosition:"left"},ab=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:x,label:b,description:w,withIcon:j,iconSize:C,loading:T,allowStepClick:E,allowStepSelect:R,iconPosition:D,orientation:P,mod:A,...k}=ae("StepperStep",Iz,e),M=Lz(),$=Sn(),U={classNames:n,styles:l},J=f==="stepCompleted"?null:f==="stepProgress"?x:m,Z={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(sr,{...M.getStyles("step",{className:r,style:o,variant:M.orientation,...U}),mod:[{"icon-position":D||M.iconPosition,"allow-click":E},A],ref:t,...Z,...k,__vars:{"--step-color":p?Ft(p,$):void 0},tabIndex:E?0:-1,children:[j&&a.jsxs("span",{...M.getStyles("stepWrapper",U),children:[a.jsxs("span",{...M.getStyles("stepIcon",U),...Z,children:[a.jsx(_o,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:Y=>a.jsx("span",{...M.getStyles("stepCompletedIcon",{style:Y,...U}),children:T?a.jsx(Fr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...M.getStyles("stepLoader",U)}):xh(g,d)||a.jsx(Ad,{size:"60%"})})}),f!=="stepCompleted"?T?a.jsx(Fr,{...M.getStyles("stepLoader",U),size:"calc(var(--stepper-icon-size) / 2)",color:p}):xh(J||m,d):null]}),P==="vertical"&&a.jsx("span",{...M.getStyles("verticalSeparator",U),"data-active":f==="stepCompleted"||void 0})]}),(b||w)&&a.jsxs("span",{...M.getStyles("stepBody",U),"data-orientation":M.orientation,"data-icon-position":D||M.iconPosition,children:[b&&a.jsx("span",{...M.getStyles("stepLabel",U),children:xh(b,d)}),w&&a.jsx("span",{...M.getStyles("stepDescription",U),children:xh(w,d)})]})]})});ab.classes=ob;ab.displayName="@mantine/core/StepperStep";const zz={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},$z=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:l,autoContrast:c})=>({root:{"--stepper-color":t?Ft(t,e):void 0,"--stepper-icon-color":hl(c,e)?ma({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?at(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Ln(o),"--stepper-radius":l===void 0?void 0:$t(l),"--stepper-fz":In(r),"--stepper-spacing":Ln(r)}}),Mc=be((e,t)=>{const n=ae("Stepper",zz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:x,completedIcon:b,progressIcon:w,color:j,iconSize:C,contentPadding:T,orientation:E,iconPosition:R,size:D,radius:P,allowNextStepsSelect:A,wrap:k,autoContrast:M,...$}=n,U=$e({name:"Stepper",classes:ob,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:$z}),J=v.Children.toArray(p),Z=J.filter(z=>z.type!==ep),Y=J.find(z=>z.type===ep),H=Z.reduce((z,F,K)=>{const L=g===K?"stepProgress":g>K?"stepCompleted":"stepInactive",ie=typeof m!="function"?!1:typeof F.props.allowStepSelect=="boolean"?F.props.allowStepSelect:L==="stepCompleted"||A;return z.push(v.cloneElement(F,{icon:F.props.icon||x||K+1,key:K,step:K,state:L,onClick:()=>ie&&m?.(K),allowStepClick:ie,completedIcon:F.props.completedIcon||b,progressIcon:F.props.progressIcon||w,color:F.props.color||j,iconSize:C,iconPosition:F.props.iconPosition||R,orientation:E})),E==="horizontal"&&K!==Z.length-1&&z.push(v.createElement("div",{...U("separator"),"data-active":K<g||void 0,"data-orientation":E,key:`separator-${K}`})),z},[]),Q=Z[g]?.props?.children,O=Y?.props?.children,I=g>Z.length-1?O:Q;return a.jsx(Mz,{value:{getStyles:U,orientation:E,iconPosition:R},children:a.jsxs(ce,{...U("root"),ref:t,size:D,...$,children:[a.jsx(ce,{...U("steps"),mod:{orientation:E,"icon-position":R,wrap:k&&E!=="vertical"},children:H}),I&&a.jsx("div",{...U("content"),children:I})]})})});Mc.classes=ob;Mc.displayName="@mantine/core/Stepper";Mc.Completed=ep;Mc.Step=ab;const gD=v.createContext(null),Uz=gD.Provider,Bz=()=>v.useContext(gD),Vz={},sb=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:l,wrapperProps:c,children:d,readOnly:f,...p}=ae("SwitchGroup",Vz,e),[m,g]=Zn({value:n,defaultValue:r,finalValue:[],onChange:o}),x=b=>{const w=b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(Uz,{value:{value:m,onChange:x,size:l},children:a.jsx(un.Wrapper,{size:l,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(D0,{role:"group",children:d})})})});sb.classes=un.Wrapper.classes;sb.displayName="@mantine/core/SwitchGroup";var vD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const Fz={labelPosition:"right"},Hz=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:$t(t),"--switch-height":at(r,"switch-height"),"--switch-width":at(r,"switch-width"),"--switch-thumb-size":at(r,"switch-thumb-size"),"--switch-label-font-size":at(r,"switch-label-font-size"),"--switch-track-label-padding":at(r,"switch-track-label-padding"),"--switch-color":n?Ft(n,e):void 0}}),zd=be((e,t)=>{const n=ae("Switch",Fz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:x,id:b,size:w,radius:j,wrapperProps:C,thumbIcon:T,checked:E,defaultChecked:R,onChange:D,labelPosition:P,description:A,error:k,disabled:M,variant:$,rootRef:U,mod:J,...Z}=n,Y=Bz(),H=w||Y?.size,Q=$e({name:"Switch",props:n,classes:vD,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Hz}),{styleProps:O,rest:I}=ga(Z),z=_r(b),F=Y?{checked:Y.value.includes(I.value),onChange:Y.onChange}:{},[K,L]=Zn({value:F.checked??E,defaultValue:R,finalValue:!1});return a.jsxs(Vp,{...Q("root"),__staticSelector:"Switch",__stylesApiProps:n,id:z,size:H,labelPosition:P,label:m,description:A,error:k,disabled:M,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":F.checked||E||void 0,variant:$,ref:U,mod:J,...O,...C,children:[a.jsx("input",{...I,disabled:M,checked:K,"data-checked":F.checked||E||void 0,onChange:q=>{Y?F.onChange?.(q):D?.(q),L(q.currentTarget.checked)},id:z,ref:t,type:"checkbox",role:"switch",...Q("input")}),a.jsxs(ce,{"aria-hidden":"true",component:"span",mod:{error:k,"label-position":P,"without-labels":!x&&!g},...Q("track"),children:[a.jsx(ce,{component:"span",mod:"reduce-motion",...Q("thumb"),children:T}),a.jsx("span",{...Q("trackLabel"),children:K?x:g})]})]})});zd.classes={...vD,...j_};zd.displayName="@mantine/core/Switch";zd.Group=sb;const[qz,Gz]=Rr("Table component was not found in the tree");var $d={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 Qz(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 yl(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=be((o,l)=>{const c=ae(n,{},o),{classNames:d,className:f,style:p,styles:m,...g}=c,x=Gz();return a.jsx(ce,{component:e,ref:l,...Qz(x,t),...x.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=$d,r}const ox=yl("th",{columnBorder:!0}),yD=yl("td",{columnBorder:!0}),Lh=yl("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),xD=yl("thead",{stickyHeader:!0}),bD=yl("tbody"),SD=yl("tfoot"),wD=yl("caption",{captionSide:!0});function lb({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(wD,{children:e.caption}),e.head&&a.jsx(xD,{children:a.jsx(Lh,{children:e.head.map((t,n)=>a.jsx(ox,{children:t},n))})}),e.body&&a.jsx(bD,{children:e.body.map((t,n)=>a.jsx(Lh,{children:t.map((r,o)=>a.jsx(yD,{children:r},o))},n))}),e.foot&&a.jsx(SD,{children:a.jsx(Lh,{children:e.foot.map((t,n)=>a.jsx(ox,{children:t},n))})})]})}lb.displayName="@mantine/core/TableDataRenderer";const Wz={type:"scrollarea"},Yz=(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}}),cb=be((e,t)=>{const n=ae("TableScrollContainer",Wz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:x,scrollAreaProps:b,...w}=n,j=$e({name:"TableScrollContainer",classes:$d,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Yz,rootSelector:"scrollContainer"});return a.jsx(ce,{component:x==="scrollarea"?ai:"div",...x==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...j("scrollContainer"),...w,children:a.jsx("div",{...j("scrollContainerInner"),children:p})})});cb.classes=$d;cb.displayName="@mantine/core/TableScrollContainer";const Kz={withRowBorders:!0,verticalSpacing:7},Xz=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:l,stripedColor:c,highlightOnHoverColor:d,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Ln(r),"--table-vertical-spacing":Ln(o),"--table-border-color":l?Ft(l,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}}),fe=be((e,t)=>{const n=ae("Table",Kz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:x,highlightOnHoverColor:b,striped:w,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:E,borderColor:R,layout:D,variant:P,data:A,children:k,stickyHeader:M,stickyHeaderOffset:$,mod:U,tabularNums:J,...Z}=n,Y=$e({name:"Table",props:n,className:o,style:l,classes:$d,classNames:r,styles:c,unstyled:d,rootSelector:"table",vars:f,varsResolver:Xz});return a.jsx(qz,{value:{getStyles:Y,stickyHeader:M,striped:w===!0?"odd":w||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:a.jsx(ce,{component:"table",variant:P,ref:t,mod:[{"data-with-table-border":E,"data-tabular-nums":J},U],...Y("table"),...Z,children:k||!!A&&a.jsx(lb,{data:A})})})});fe.classes=$d;fe.displayName="@mantine/core/Table";fe.Td=yD;fe.Th=ox;fe.Tr=Lh;fe.Thead=xD;fe.Tbody=bD;fe.Tfoot=SD;fe.Caption=wD;fe.ScrollContainer=cb;fe.DataRenderer=lb;const[Zz,ub]=Rr("Tabs component was not found in the tree");var Ud={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 Jz={},db=be((e,t)=>{const n=ae("TabsList",Jz,e),{children:r,className:o,grow:l,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,x=ub();return a.jsx(ce,{...g,...x.getStyles("list",{className:o,style:p,classNames:d,styles:f,props:n,variant:x.variant}),ref:t,role:"tablist",variant:x.variant,mod:[{grow:l,orientation:x.orientation,placement:x.orientation==="vertical"&&x.placement,inverted:x.inverted},m],"aria-orientation":x.orientation,__vars:{"--tabs-justify":c},children:r})});db.classes=Ud;db.displayName="@mantine/core/TabsList";const e$={},fb=be((e,t)=>{const n=ae("TabsPanel",e$,e),{children:r,className:o,value:l,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,x=ub(),b=x.value===l,w=x.keepMounted||m||b?r:null;return a.jsx(ce,{...g,...x.getStyles("panel",{className:o,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(l),"aria-labelledby":x.getTabId(l),children:w})});fb.classes=Ud;fb.displayName="@mantine/core/TabsPanel";const t$={},hb=be((e,t)=>{const n=ae("TabsTab",t$,e),{className:r,children:o,rightSection:l,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:x,classNames:b,styles:w,vars:j,mod:C,tabIndex:T,...E}=n,R=Sn(),{dir:D}=ml(),P=ub(),A=d===P.value,k=$=>{P.onChange(P.allowTabDeactivation&&d===P.value?null:d),f?.($)},M={classNames:b,styles:w,props:n};return a.jsxs(sr,{...E,...P.getStyles("tab",{className:r,style:x,variant:P.variant,...M}),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:T!==void 0?T:A||P.value===null?0:-1,"aria-controls":P.getPanelId(d),onClick:k,__vars:{"--tabs-color":g?Ft(g,R):void 0},onKeyDown:zR({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:P.activateTabWithKeyboard,loop:P.loop,orientation:P.orientation||"horizontal",dir:D,onKeyDown:p}),children:[c&&a.jsx("span",{...P.getStyles("tabSection",M),"data-position":"left",children:c}),o&&a.jsx("span",{...P.getStyles("tabLabel",M),children:o}),l&&a.jsx("span",{...P.getStyles("tabSection",M),"data-position":"right",children:l})]})});hb.classes=Ud;hb.displayName="@mantine/core/TabsTab";const RE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",n$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},r$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":$t(t),"--tabs-color":Ft(n,e),"--tabs-text-color":hl(r,e)?ma({color:n,theme:e,autoContrast:r}):void 0}}),Tt=be((e,t)=>{const n=ae("Tabs",n$,e),{defaultValue:r,value:o,onChange:l,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:x,color:b,radius:w,inverted:j,placement:C,keepMounted:T,classNames:E,styles:R,unstyled:D,className:P,style:A,vars:k,autoContrast:M,mod:$,...U}=n,J=_r(p),[Z,Y]=Zn({value:o,defaultValue:r,finalValue:null,onChange:l}),H=$e({name:"Tabs",props:n,classes:Ud,className:P,style:A,classNames:E,styles:R,unstyled:D,vars:k,varsResolver:r$});return a.jsx(Zz,{value:{placement:C,value:Z,orientation:c,id:J,loop:f,activateTabWithKeyboard:m,getTabId:bC(`${J}-tab`,RE),getPanelId:bC(`${J}-panel`,RE),onChange:Y,allowTabDeactivation:g,variant:x,color:b,radius:w,inverted:j,keepMounted:T,unstyled:D,getStyles:H},children:a.jsx(ce,{ref:t,id:J,variant:x,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},$],...H("root"),...U,children:d})})});Tt.classes=Ud;Tt.displayName="@mantine/core/Tabs";Tt.Tab=hb;Tt.Panel=fb;Tt.List=db;const i$={},Ve=be((e,t)=>{const n=ae("TextInput",i$,e);return a.jsx(Dr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});Ve.classes=Dr.classes;Ve.displayName="@mantine/core/TextInput";var jD={root:"m_7341320d"};const o$={},a$=(e,{size:t,radius:n,variant:r,gradient:o,color:l,autoContrast:c})=>{const d=e.variantColorResolver({color:l||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":at(t,"ti-size"),"--ti-radius":n===void 0?void 0:$t(n),"--ti-bg":l||r?d.background:void 0,"--ti-color":l||r?d.color:void 0,"--ti-bd":l||r?d.border:void 0}}},pb=be((e,t)=>{const n=ae("ThemeIcon",o$,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,autoContrast:p,...m}=n,g=$e({name:"ThemeIcon",classes:jD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:a$});return a.jsx(ce,{ref:t,...g("root"),...m})});pb.classes=jD;pb.displayName="@mantine/core/ThemeIcon";const s$=["h1","h2","h3","h4","h5","h6"],l$=["xs","sm","md","lg","xl"];function c$(e,t){const n=t!==void 0?t:`h${e}`;return s$.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 CD={root:"m_8a5d1357"};const u$={order:1},d$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const l=c$(t,n);return{root:{"--title-fw":l.fontWeight,"--title-lh":l.lineHeight,"--title-fz":l.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},Ie=be((e,t)=>{const n=ae("Title",u$,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:x,textWrap:b,mod:w,...j}=n,C=$e({name:"Title",props:n,classes:CD,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:p,varsResolver:d$});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=CD;Ie.displayName="@mantine/core/Title";function f$(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(l=>l(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function h$(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function p$(e,t,n){const r=[],o=[],l={};for(const c of e){const d=c.position||t;l[d]=l[d]||0,l[d]+=1,l[d]<=n?o.push(c):r.push(c)}return{notifications:o,queue:r}}const m$=()=>f$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),xl=m$(),g$=(e=xl)=>h$(e);function Xc(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=p$(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ne(e,t=xl){const n=e.id||Qh();return Xc(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function ED(e,t=xl){return Xc(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function Qs(e,t=xl){return Xc(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function v$(e=xl){Xc(e,()=>[])}function y$(e=xl){Xc(e,t=>t.slice(0,e.getState().limit))}const Ci={show:Ne,hide:ED,update:Qs,clean:v$,cleanQueue:y$,updateState:Xc};function ax(e,t){return ax=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},ax(e,t)}function TD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,ax(e,t)}var py={exports:{}},my,_E;function x$(){if(_E)return my;_E=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return my=e,my}var gy,DE;function b$(){if(DE)return gy;DE=1;var e=x$();function t(){}function n(){}return n.resetWarningCache=t,gy=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 o(){return r}var l={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return l.PropTypes=l,l},gy}var AE;function S$(){return AE||(AE=1,py.exports=b$()()),py.exports}var w$=S$();const nn=Ox(w$),PE={disabled:!1},tp=Tn.createContext(null);var j$=function(t){return t.scrollTop},td="unmounted",Bs="exited",Vs="entering",bc="entered",sx="exiting",ba=(function(e){TD(t,e);function t(r,o){var l;l=e.call(this,r,o)||this;var c=o,d=c&&!c.isMounting?r.enter:r.appear,f;return l.appearStatus=null,r.in?d?(f=Bs,l.appearStatus=Vs):f=bc:r.unmountOnExit||r.mountOnEnter?f=td:f=Bs,l.state={status:f},l.nextCallback=null,l}t.getDerivedStateFromProps=function(o,l){var c=o.in;return c&&l.status===td?{status:Bs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var l=null;if(o!==this.props){var c=this.state.status;this.props.in?c!==Vs&&c!==bc&&(l=Vs):(c===Vs||c===bc)&&(l=sx)}this.updateStatus(!1,l)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,l,c,d;return l=c=d=o,o!=null&&typeof o!="number"&&(l=o.exit,c=o.enter,d=o.appear!==void 0?o.appear:c),{exit:l,enter:c,appear:d}},n.updateStatus=function(o,l){if(o===void 0&&(o=!1),l!==null)if(this.cancelNextCallback(),l===Vs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:ed.findDOMNode(this);c&&j$(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Bs&&this.setState({status:td})},n.performEnter=function(o){var l=this,c=this.props.enter,d=this.context?this.context.isMounting:o,f=this.props.nodeRef?[d]:[ed.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),x=d?g.appear:g.enter;if(!o&&!c||PE.disabled){this.safeSetState({status:bc},function(){l.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Vs},function(){l.props.onEntering(p,m),l.onTransitionEnd(x,function(){l.safeSetState({status:bc},function(){l.props.onEntered(p,m)})})})},n.performExit=function(){var o=this,l=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:ed.findDOMNode(this);if(!l||PE.disabled){this.safeSetState({status:Bs},function(){o.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:sx},function(){o.props.onExiting(d),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:Bs},function(){o.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,l){l=this.setNextCallback(l),this.setState(o,l)},n.setNextCallback=function(o){var l=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,l.nextCallback=null,o(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(o,l){this.setNextCallback(l);var c=this.props.nodeRef?this.props.nodeRef.current:ed.findDOMNode(this),d=o==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)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===td)return null;var l=this.props,c=l.children;l.in,l.mountOnEnter,l.unmountOnExit,l.appear,l.enter,l.exit,l.timeout,l.addEndListener,l.onEnter,l.onEntering,l.onEntered,l.onExit,l.onExiting,l.onExited,l.nodeRef;var d=$0(l,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Tn.createElement(tp.Provider,{value:null},typeof c=="function"?c(o,d):Tn.cloneElement(Tn.Children.only(c),d))},t})(Tn.Component);ba.contextType=tp;ba.propTypes={};function hc(){}ba.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:hc,onEntering:hc,onEntered:hc,onExit:hc,onExiting:hc,onExited:hc};ba.UNMOUNTED=td;ba.EXITED=Bs;ba.ENTERING=Vs;ba.ENTERED=bc;ba.EXITING=sx;function C$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function mb(e,t){var n=function(l){return t&&v.isValidElement(l)?t(l):l},r=Object.create(null);return e&&v.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function E$(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),o=[];for(var l in e)l in t?o.length&&(r[l]=o,o=[]):o.push(l);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<o.length;c++)d[o[c]]=n(o[c]);return d}function Ws(e,t,n){return n[t]!=null?n[t]:e.props[t]}function T$(e,t){return mb(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ws(n,"appear",e),enter:Ws(n,"enter",e),exit:Ws(n,"exit",e)})})}function R$(e,t,n){var r=mb(e.children),o=E$(t,r);return Object.keys(o).forEach(function(l){var c=o[l];if(v.isValidElement(c)){var d=l in t,f=l in r,p=t[l],m=v.isValidElement(p)&&!p.props.in;f&&(!d||m)?o[l]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Ws(c,"exit",e),enter:Ws(c,"enter",e)}):!f&&d&&!m?o[l]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(o[l]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Ws(c,"exit",e),enter:Ws(c,"enter",e)}))}}),o}var _$=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},D$={component:"div",childFactory:function(t){return t}},Xa=(function(e){TD(t,e);function t(r,o){var l;l=e.call(this,r,o)||this;var c=l.handleExited.bind(C$(l));return l.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},l}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,l){var c=l.children,d=l.handleExited,f=l.firstRender;return{children:f?T$(o,d):R$(o,c,d),firstRender:!1}},n.handleExited=function(o,l){var c=mb(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(l),this.mounted&&this.setState(function(d){var f=Jh({},d.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,l=o.component,c=o.childFactory,d=$0(o,["component","childFactory"]),f=this.state.contextValue,p=_$(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,l===null?Tn.createElement(tp.Provider,{value:f},p):Tn.createElement(tp.Provider,{value:f},Tn.createElement(l,d,p))},t})(Tn.Component);Xa.propTypes={};Xa.defaultProps=D$;const RD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function A$(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),RD.reduce((n,r)=>(n[r]=[],n),{}))}const kE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},P$={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function k$({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,l]=n.split("-"),c=l==="center"?`${o}-center`:l,d={opacity:0,maxHeight:t,transform:kE[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:P$[c]},p={opacity:0,maxHeight:0,transform:kE[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function N$(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const _D=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:l,message:c,...d}=e,f=N$(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(X0,{...r,...d,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:x,children:c})});_D.displayName="@mantine/notifications/NotificationContainer";var DD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const O$=ba,M$={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:oi("overlay"),store:xl,withinPortal:!0},L$=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),Sa=be((e,t)=>{const n=ae("Notifications",M$,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:x,notificationMaxHeight:b,limit:w,zIndex:j,store:C,portalProps:T,withinPortal:E,...R}=n,D=Sn(),P=g$(C),A=XO(),k=$x(),M=v.useRef({}),$=v.useRef(0),J=(D.respectReducedMotion?k:!1)?1:g,Z=$e({name:"Notifications",classes:DD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:L$});v.useEffect(()=>{C?.updateState(Q=>({...Q,limit:w||5,defaultPosition:p}))},[w,p]),oa(()=>{P.notifications.length>$.current&&setTimeout(()=>A(),0),$.current=P.notifications.length},[P.notifications]);const Y=A$(P.notifications,p),H=RD.reduce((Q,O)=>(Q[O]=Y[O].map(({style:I,...z})=>a.jsx(O$,{timeout:J,onEnter:()=>M.current[z.id].offsetHeight,nodeRef:{current:M.current[z.id]},children:F=>a.jsx(_D,{ref:K=>{M.current[z.id]=K},data:z,onHide:K=>ED(K,C),autoClose:m,...Z("notification",{style:{...k$({state:F,position:O,transitionDuration:J,maxHeight:b}),...I}})})},z.id)),Q),{});return a.jsxs(fs,{withinPortal:E,...T,children:[a.jsx(ce,{...Z("root"),"data-position":"top-center",ref:t,...R,children:a.jsx(Xa,{children:H["top-center"]})}),a.jsx(ce,{...Z("root"),"data-position":"top-left",...R,children:a.jsx(Xa,{children:H["top-left"]})}),a.jsx(ce,{...Z("root",{className:_c.classNames.fullWidth}),"data-position":"top-right",...R,children:a.jsx(Xa,{children:H["top-right"]})}),a.jsx(ce,{...Z("root",{className:_c.classNames.fullWidth}),"data-position":"bottom-right",...R,children:a.jsx(Xa,{children:H["bottom-right"]})}),a.jsx(ce,{...Z("root"),"data-position":"bottom-left",...R,children:a.jsx(Xa,{children:H["bottom-left"]})}),a.jsx(ce,{...Z("root"),"data-position":"bottom-center",...R,children:a.jsx(Xa,{children:H["bottom-center"]})})]})});Sa.classes=DD;Sa.displayName="@mantine/notifications/Notifications";Sa.show=Ci.show;Sa.hide=Ci.hide;Sa.update=Ci.update;Sa.clean=Ci.clean;Sa.cleanQueue=Ci.cleanQueue;Sa.updateState=Ci.updateState;class I${constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Bd{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class z${constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(o,l){const c=o.consumeAndParse(n);return r(l,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,l,c){const d=o.consumeAndParse(n);return r(l,c,d)},precedence:n})}construct(t){return new $$(t,this.prefixParselets,this.infixParselets)}}class $${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 o=r.parse(this,n);for(;t>this.getPrecedence();){const l=this.consume();o=this.getInfixParselet(l).parse(this,o,l)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){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 AD{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 Ji="http://hl7.org",PD="ok",U$="created",B$="gone",V$="not-modified",F$="not-found",H$="unauthorized",q$="forbidden",G$="accepted",Q$={resourceType:"OperationOutcome",id:PD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},W$={resourceType:"OperationOutcome",id:F$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},hd={resourceType:"OperationOutcome",id:H$,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},Y$={...hd,issue:[...hd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},NE={...hd,issue:[...hd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Vd={resourceType:"OperationOutcome",id:q$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function xo(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function gn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function K$(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function X$(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 um(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function kD(e){return e.id===PD||e.id===U$||e.id===V$||e.id===G$}function Z$(e){return e.id===B$}class ft extends Error{constructor(t,n){super(ND(t)),this.outcome=t,this.cause=n}}function qt(e){return e instanceof ft?e.outcome:um(e)?e:xo(Ye(e))}function Ye(e){return e?typeof e=="string"?e:X$(e)?e.message:um(e)?ND(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function ND(e){const t=e.issue?.map(OD)??[];return t.length>0?t.join("; "):"Unknown error"}function OD(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 J$(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 e8(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,l])=>[o,J$(o,l)])),constraints:[],innerTypes:[]};return t}const t8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},n8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},r8={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"}]}}},i8={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"}]}}},o8={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"}]}}},a8={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"}]}}},s8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},l8={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"}]}}},c8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},u8={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"}]}}},d8={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"}]}}},f8={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"}]}}},h8={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"}]}}},p8={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"}]}}},m8={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"}]}}},g8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},v8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},y8={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"]}]}}},x8={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"]}]}}},b8={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"}]}}},S8={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"}]}}},w8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},j8={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"}]}}},C8={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"}]}}},R8={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"]}]}}},_8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},D8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},A8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},P8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"uri"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},k8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},N8={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"]}]}}},O8={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"}]}}},M8={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"}]}}},L8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},I8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},z8={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"]}]}}},$8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},U8={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"}]}}},B8={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"}]}}},F8={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"}]}}},H8={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"]}]}}},q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},G8={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"}]}}},Q8={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"]}]}}},W8={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"}]}}},Y8={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"}]}}},K8={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"}]}}},X8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},Z8={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"}]}}},J8={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"}]}}},eU={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"}]}}},tU={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"]}]}}},nU={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"}]}}},rU={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"}]}}},iU={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"}]}}},oU={Element:t8,BackboneElement:n8,Address:r8,Age:i8,Annotation:o8,Attachment:a8,CodeableConcept:s8,Coding:l8,ContactDetail:c8,ContactPoint:u8,Contributor:d8,Count:f8,DataRequirement:h8,DataRequirementCodeFilter:p8,DataRequirementDateFilter:m8,DataRequirementSort:g8,Distance:v8,Dosage:y8,DosageDoseAndRate:x8,Duration:b8,ElementDefinition:S8,ElementDefinitionSlicingDiscriminator:w8,ElementDefinitionSlicing:j8,ElementDefinitionBase:C8,ElementDefinitionType:E8,ElementDefinitionExample:T8,ElementDefinitionConstraint:R8,ElementDefinitionBinding:_8,ElementDefinitionMapping:D8,Expression:A8,Extension:P8,HumanName:k8,Identifier:N8,MarketingStatus:O8,Meta:M8,Money:L8,Narrative:I8,ParameterDefinition:z8,Period:$8,Population:U8,ProdCharacteristic:B8,ProductShelfLife:V8,Quantity:F8,Range:H8,Ratio:q8,Reference:G8,RelatedArtifact:Q8,SampledData:W8,Signature:Y8,SubstanceAmount:K8,SubstanceAmountReferenceRange:X8,Timing:Z8,TimingRepeat:J8,TriggerDefinition:eU,UsageContext:tU,MoneyQuantity:nU,SimpleQuantity:rU,IdentityProvider:iU};function aU(e){return new lU(e).parse()}const np=e8(oU),gb=Object.create(null),OE=Object.create(null),sU={"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 MD(e){let t;return t=OE[e],t||(t=OE[e]=Object.create(null)),t}function ME(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");ZU(n);for(const r of n)LD(r)}function LD(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=aU(e),n=sU[e.url];let r,o;n?(r=np,o=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=np,o=e.type):(r=MD(e.url),o=e.type),r[o]=t;for(const l of t.innerTypes)l.parentType=t,r[l.name]=l;gb[e.url]=t}function ID(e){return!!np[e]}function dm(e,t){if(t){const n=MD(t)[e];if(n)return n}return np[e]}function zD(e,t){const n=dm(e,t);if(!n)throw new ft(xo("Unknown data type: "+e));return n}function vb(e){return!!gb[e]}function Zc(e){return gb[e]}class lU{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:dU(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=vy(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[vy(t,r.path)]=n;break}r=r.parent}if(!r){const o=vy(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(o.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(o.replace("[x]","")),this.resourceSchema.elements[o]=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&&!pc(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!pc(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=FE(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:pc(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){uU(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&&!pc(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!pc(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!!(pc(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=FE(t)),r||(r=Do(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=LE(t.max),r=t.base?.max?LE(t.base.max):n,o={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(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:this.parseElementDefinitionType(t),fixed:IE(Lc(o,"fixed[x]")),pattern:IE(Lc(o,"pattern[x]")),binding:t.binding}}}function LE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function vy(e,t=""){return cU(e.path,t)}function cU(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function pc(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function IE(e){return Array.isArray(e)&&e.length>0?e[0]:vn(e)?void 0:e}function uU(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 dU(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 fU(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?hU:Lc,[o,...l]=t.split(".");let c=[r(e,o,n)];for(const d of l){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?.value!==void 0||!n?.withPath&&p!==void 0)&&f.push(r(p,d,n));c=f}return c}function hU(e,t,n){const r=e.path;return pU(Lc(e,t,n),r,t)}function pU(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,l)=>({...o,path:`${r}${n}[${l}]`})):{...e,path:`${r}${n}`}}const $D={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 mU(e,t,n,r){if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const l=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return bb(e,o.pattern);if(o.fixed)return Co(e,o.fixed);if(o.binding?.strength==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!l?.length?!1:l.some(c=>c.code===e.type)}return!1}function tt(e){return[{type:re.boolean,value:e}]}function ri(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}:Ei(e)?{type:re.Quantity,value:e}:Ao(e)?{type:e.resourceType,value:e}:ZD(e)?{type:re.CodeableConcept,value:e}:XD(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function go(e){return e.length===0?!1:!!e[0].value}function ua(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 Lc(e,t,n){if(!e.value)return;const r=ms(e.type,t,n?.profileUrl);return r?UD(e,t,r):Fd(e,t)}function UD(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let l,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of o){const g=p.replace("[x]",$n(m.code));if(l=r[g],d=r["_"+g],l!==void 0||d!==void 0){c=m.code;break}}if(d)if(Array.isArray(l)){l=l.slice();for(let m=0;m<Math.max(l.length,d.length);m++)l[m]=yy(l[m],d[m])}else if(!l&&Array.isArray(d)){l=d.slice();for(let m=0;m<d.length;m++)l[m]=yy(void 0,d[m])}else l=yy(l,d);if(!vn(l))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(l)?l.map(m=>zE(m,c)):zE(l,c)}function zE(e,t){return t==="Resource"&&Ao(e)&&(t=e.resourceType),{type:t,value:e}}function Fd(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(ri):r=ri(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const l of Object.values(re)){const c=o+$n(l);if(c in n){const d=n[c];Array.isArray(d)?r=d.map(f=>({type:l,value:f})):r={type:l,value:d};break}}}if(Array.isArray(r)){if(r.length===0||vn(r[0]))return}else if(vn(r))return;return r}function BD(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(go(fm(n,o))){r=!0;break}r||t.push(n)}return t}function gU(e){return tt(!go(e))}function vU(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?tt(!1):tt(e.every((n,r)=>go(fm(n,t[r]))))}function yU(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?tt(!0):tt(e.some((n,r)=>!go(fm(n,t[r]))))}function fm(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?tt(Math.abs(n-r)<1e-8):Ei(n)&&Ei(r)?tt(QD(n,r)):tt(typeof n=="object"&&typeof r=="object"?yb(e,t):n===r)}function VD(e,t){return e.length===0&&t.length===0?tt(!0):e.length!==t.length?tt(!1):(e.sort($E),t.sort($E),tt(e.every((n,r)=>go(xU(n,t[r])))))}function xU(e,t){const{type:n,value:r}=e,{type:o,value:l}=t,c=r?.valueOf(),d=l?.valueOf();return typeof c=="number"&&typeof d=="number"?tt(Math.abs(c-d)<.01):Ei(c)&&Ei(d)?tt(QD(c,d)):tt(n==="Coding"&&o==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?yb({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function $E(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 FD(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 HD(n);case"DateTime":return pd(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return qD(n);case"Quantity":return Ei(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function HD(e){return typeof e=="string"&&!!$D.date.exec(e)}function pd(e){return typeof e=="string"&&!!$D.dateTime.exec(e)}function qD(e){return!!(e&&typeof e=="object"&&("start"in e&&pd(e.start)||"end"in e&&pd(e.end)))}function GD(e){if(e){if(HD(e)||pd(e))return{start:bh(e,"0000-01-01T00:00:00.000"),end:bh(e,"xxxx-12-31T23:59:59.999")};if(qD(e))return{start:e.start?bh(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?bh(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function bh(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 o=e+t.substring(e.length)+n;return new Date(o).toISOString()}function Ei(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function QD(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 yb(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const l=e[o],c=t[o];if(UE(l)&&UE(c)){if(!yb(l,c))return!1}else if(l!==c)return!1}return!0}function UE(e){return e!==null&&typeof e=="object"}function yy(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return bU(e??{},t)}return e}function bU(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function WD(e,t){return Ao(e,t)&&"id"in e&&typeof e.id=="string"}function Ht(e){const t=_t(e)??"undefined/undefined",n=da(e);return n===t?{reference:t}:{reference:t,display:n}}function _t(e){if(wa(e))return e.reference;if(WD(e))return`${e.resourceType}/${e.id}`}function rl(e){if(e)return wa(e)?e.reference.split("/")[1]:e.id}function SU(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function da(e){if(SU(e)){const t=wU(e);if(t)return t}if(e.resourceType==="Device"){const t=jU(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return ls(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]),ZD(t))return ls(t);if(OU(t))return t.text}return _t(e)??""}function wU(e){const t=e.name;if(t&&t.length>0)return Jc(t[0])}function jU(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function CU(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=BE(n);if(r)return r}else return BE(t)}function BE(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function YD(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),l=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-o;(f<l||f===l&&p<c)&&m--;let g=d*12+f-(o*12+l);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:o}=YD(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Do(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(o=>o.url===t[r]);return n}function Ki(e,t){const n=xb(e);return JSON.stringify(n,null,t?2:void 0)??""}function xb(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?TU(e):RU(e):e}function TU(e){const t=e.length;if(t===0)return;let n,r=0;for(let o=0;o<t;o++){const l=e[o],c=xb(l);c!==l&&!n&&(n=Array.from(e)),c===void 0?n&&(n[o]=null):(n&&(n[o]=c),r++)}if(r!==0)return n??e}function RU(e){let t,n=0;for(const r in e){const o=e[r],l=xb(o);l!==o&&!t&&(t={...e}),l===void 0?t&&delete t[r]:(t&&(t[r]=l),n++)}if(n!==0)return t??e}function vn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Rn(e):!1}function Rn(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 _U(e){if(!e)return;let t=e.length-1;for(;t>=0&&vn(e[t]);)t--;return t>=0?e.slice(0,t+1):void 0}function Co(e,t,n){return e===t||vn(e)&&vn(t)?!0:vn(e)||vn(t)?!1:Array.isArray(e)&&Array.isArray(t)?DU(e,t):Array.isArray(e)||Array.isArray(t)?!1:pr(e)&&pr(t)?AU(e,t,n):(pr(e)||pr(t),!1)}function DU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Co(e[n],t[n]))return!1;return!0}function AU(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const l=e[o],c=t[o];if(!Co(l,c,o))return!1}return!0}function bb(e,t){return vn(e)?!0:vn(t)?!1:Array.isArray(e)&&Array.isArray(t)?PU(e,t):Array.isArray(e)||Array.isArray(t)?!1:pr(e)&&pr(t)?kU(e,t):pr(e)||pr(t)?!1:e===t}function PU(e,t){return t.every(n=>e.some(r=>bb(r,n)))}function kU(e,t){return Object.entries(t).every(([n,r])=>n in e&&bb(e[n],r))}function ii(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function KD(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 pr(e){return e!==null&&typeof e=="object"}function NU(e){return typeof e=="string"}function XD(e){return pr(e)&&"code"in e&&typeof e.code=="string"}function ZD(e){return pr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(XD)}function OU(e){return pr(e)&&"text"in e&&typeof e.text=="string"}const JD=[];for(let e=0;e<256;e++)JD.push(e.toString(16).padStart(2,"0"));function MU(e){const t=eA(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=JD[n[o]];return r.join("")}function LU(e){const t=eA(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function eA(e){return ArrayBuffer.isView(e)?e.buffer:e}function $n(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Sb(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Ys(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function IU(e,t){return e.coding?.find(n=>n.system===t)?.code}function zU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const VE=e=>new Promise(t=>{setTimeout(t,e)});function lx(e,t,n){const r=[];for(let o=0;o<n-1;o++){const l=e.indexOf(t);if(l<0)break;r.push(e.slice(0,l)),e=e.slice(l+t.length)}return r.push(e),r}function $U(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Wu(e,t){return e?(e.push(t),e):[t]}function Ic(e){return e.sort((t,n)=>t.localeCompare(n))}function wb(e){return e.endsWith("/")?e:e+"/"}function UU(e){return e.startsWith("/")?e.slice(1):e}function fo(e,t){return new URL(UU(t),wb(e.toString())).toString()}function BU(e,t){return fo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function VU(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 tA(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 FU(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function il(e){if(!e)return"";switch(e.type){case"Address":return nA(e.value);case"CodeableConcept":return ls(e.value);case"Coding":return Hd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Jc(e.value);case"Quantity":return Ks(e.value);case"Reference":return HU(e.value);default:return e.value?.toString()??""}}function HU(e){return e?e.display??e.reference??Ki(e):""}function nA(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 Jc(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=gd(e.text);if(r)return r}return n.join(" ").trim()}function hm(e){return e instanceof Date&&!isNaN(e.getTime())}function qU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return hm(r)?r.toLocaleTimeString(t,n):""}function mr(e,t,n){if(!e)return"";const r=new Date(e);return hm(r)?r.toLocaleString(t,n):""}function GU(e,t,n){return!e||!e.start&&!e.end?"":mr(e.start,t,n)+" - "+mr(e.end,t,n)}const QU={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"},YU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function rA(e){if(!e)return"";const t=[];return KU(t,e.repeat),e.event&&t.push(e.event.map(n=>mr(n)).join(", ")),$n(t.join(" ").trim())}function KU(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(QU[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+WU[o]):e.push("per "+r+" "+YU[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map($n).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(l=>qU(l)).join(", "))}function md(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},o=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&o?.value===void 0?"":r?.value!==void 0&&o?.value===void 0?`>= ${Ks(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${Ks(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${Ks(r)} - ${Ks(o)}`)}function Ks(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 XU(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ls(e){if(!e)return"";const t=gd(e.text);return t||(e.coding?e.coding.map(n=>Hd(n)).join(", "):"")}function Hd(e,t){const n=gd(e?.display);return n?`${n}`:gd(e?.code)??""}function iA(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(Ks(e.valueQuantity));else if(e.valueCodeableConcept)t.push(ls(e.valueCodeableConcept));else{const n=gd(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>iA(n)).join(" / ")),t.join(" / ").trim()}function gd(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 ZU(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&oA(n.type)}function oA(e){let t=Eo.types[e];return t||(t={searchParamsDetails:{}},Eo.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 JU(e){for(const t of e.base??[]){const n=oA(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function FE(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?eB((e.base?.path??e.path)?.split(".")):t}function eB(e){return e.length===1?e[0]:e.map($n).join("")}function jb(e){return Eo.types[e]?.searchParams}function tB(e,t){return Eo.types[e]?.searchParams?.[t]}function ol(e){const t=e.replaceAll("[x]","").split(".").pop();return aA(t)}function aA(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(rB).join(" ").replace("_"," ").replace(/\s+/g," ")}const nB=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function rB(e){const t=e.toUpperCase();return e===t?e:nB.has(t)?t:t.charAt(0)+e.slice(1)}function ms(e,t,n){const r=dm(e,n);if(r)return iB(r.elements,t)}function iB(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const l=t.slice(0,r)+"[x]",c=e[l];if(c)return c}}}function Ao(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function wa(e,t){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Eo={types:{}};function Ih(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const Jo=()=>[],zr={empty:(e,t)=>tt(t.length===0||t.every(n=>vn(n.value))),hasValue:(e,t)=>tt(t.length!==0),exists:(e,t,n)=>tt(n?t.filter(r=>go(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!vn(r.value))),all:(e,t,n)=>tt(t.every(r=>go(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return tt(!1);return tt(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return tt(!0);return tt(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return tt(!1);return tt(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return tt(!0);return tt(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return tt(!0);const r=n.eval(e,zs(e));return r.length===0?tt(!1):tt(t.every(o=>r.some(l=>l.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,zs(e));return r.length===0?tt(!0):t.length===0?tt(!1):tt(r.every(o=>t.some(l=>l.value===o.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>tt(t.length===zr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>go(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:Jo,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{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,zs(e)),o=[];for(const l of t)!o.some(c=>c.value===l.value)&&r.some(c=>c.value===l.value)&&o.push(l);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,zs(e)),o=[];for(const l of t)r.some(c=>c.value===l.value)||o.push(l);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,zs(e));return BD([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,zs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[ri(!0)],iif:(e,t,n,r,o)=>{const l=n.eval(e,t);if(l.length>1||l.length===1&&typeof l[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return go(l)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return tt(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return tt(!0);if(["false","f","no","n","0","0.0"].includes(r))return tt(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:tt(zr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(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?[]:tt(zr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:Ih(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:tt(zr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:Ih(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:tt(zr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(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?[]:tt(zr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(t,1);return Ei(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?[]:tt(zr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(t,1);return n==null?[]:Ei(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:tt(zr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ho(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:Ih("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:tt(zr.toTime(e,t).length===1),indexOf:(e,t,n)=>Si((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Si((o,l,c)=>{const d=l,f=c?d+c:o.length;return d<0||d>=o.length?void 0:o.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>Si((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Si((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Si((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Si(n=>n.toUpperCase(),e,t),lower:(e,t)=>Si(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Si((o,l,c)=>o.replaceAll(l,c),e,t,n,r),matches:(e,t,n)=>Si((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Si((o,l,c)=>o.replaceAll(new RegExp(l,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>Si(n=>n.length,e,t),toChars:(e,t)=>Si(n=>n?n.split(""):void 0,e,t),encode:Jo,decode:Jo,escape:Jo,unescape:Jo,trim:Jo,split:Jo,join:(e,t,n)=>{const r=n?.eval(e,zs(e))[0]?.value??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>co(Math.abs,e,t),ceiling:(e,t)=>co(Math.ceil,e,t),exp:(e,t)=>co(Math.exp,e,t),floor:(e,t)=>co(Math.floor,e,t),ln:(e,t)=>co(Math.log,e,t),log:(e,t,n)=>co((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>co(Math.pow,e,t,n),round:(e,t,...n)=>co((r,o=0)=>{if(typeof o!="number"||o<0)throw new Error("Invalid precision provided to round()");const l=Math.pow(10,o);return Math.round(r*l)/l},e,t,...n),sqrt:(e,t)=>co(Math.sqrt,e,t),truncate:(e,t)=>co(n=>n|0,e,t),children:Jo,descendants:Jo,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{const l=zr.toDateTime(e,n.eval(e,t));if(l.length===0)throw new Error("Invalid start date");const c=zr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=o.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=YD(l[0].value,c[0].value);return[{type:re.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof rp?r=n.name:n instanceof Cb&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:re.boolean,value:FD(o,r)})):[]},not:(e,t)=>zr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const l=r;if(l.resource)return ri(l.resource);l.reference?o=l.reference:l.type&&l.identifier&&(o=`${l.type}?identifier=${l.identifier.system}|${l.identifier.value}`)}if(o?.includes("?")){const[l]=o.split("?");return{type:l,value:{resourceType:l}}}if(o?.includes("/")){const[l,c]=o.split("/");return{type:l,value:{resourceType:l,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"}}:Ao(n)?{type:re.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:re.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(l=>({type:re.boolean,value:l.value?.resourceType===o}))},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 o="";return n instanceof rp&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:re.id,value:rl(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const l=Do(o,r);if(l)return[{type:re.Extension,value:l}]}return[]}};function Si(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=ho(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const l=r.map(d=>d?.eval(t,n)[0]?.value),c=e(o,...l);return c===void 0?[]:Array.isArray(c)?c.map(ri):[ri(c)]}function co(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=ho(n,1),l=Ei(o),c=l?o.value:o;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=l?re.Quantity:n[0].type,p=l?{...o,value:d}:d;return[{type:f,value:p}]}function ho(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 zs(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class sA{constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class mc{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class rp{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>o?.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 Ao(n,this.name)?t:Lc(t,this.name)}toString(){return this.name}}class oB{eval(){return[]}toString(){return"{}"}}class aB extends I${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 ip extends Bd{constructor(t,n){super("as",t,n)}eval(t,n){return zr.ofType(t,this.left.eval(t,n),this.right)}}class qr extends Bd{}class Vi extends qr{constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const l=r[0].value,c=o[0].value,d=Ei(l)?l.value:l,f=Ei(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?tt(p):Ei(l)?[{type:re.Quantity,value:{...l,value:p}}]:[ri(p)]}}class sB extends Bd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),l=[...r,...o];return l.length>0&&l.every(c=>typeof c.value=="string")?[{type:re.string,value:l.map(c=>c.value).join("")}]:l}}class lB extends qr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return tt(r.some(l=>l.value===o[0].value))}}class cB extends qr{constructor(t,n){super("in",t,n)}eval(t,n){const r=ua(this.left.eval(t,n)),o=this.right.eval(t,n);return r?tt(o.some(l=>fm(r,l)[0].value)):[]}}class Cb extends Bd{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 Eb extends Bd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return BD([...r,...o])}}class uB extends qr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return vU(r,o)}}class dB extends qr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return yU(r,o)}}class fB extends qr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return VD(r,o)}}class hB extends qr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return gU(VD(r,o))}}class Tb extends qr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return tt(FD(r[0],o))}}class pB extends qr{constructor(t,n){super("and",t,n)}eval(t,n){const r=ua(this.left.eval(t,n),"boolean"),o=ua(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?tt(!0):r?.value===!1||o?.value===!1?tt(!1):[]}}class mB extends qr{constructor(t,n){super("or",t,n)}eval(t,n){const r=ua(this.left.eval(t,n),"boolean"),o=ua(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?tt(!1):r?.value||o?.value?tt(!0):[]}}class gB extends qr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=ua(this.left.eval(t,n),"boolean"),o=ua(this.right.eval(t,n),"boolean");return!r||!o?[]:tt(r.value!==o.value)}}class vB extends qr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=ua(this.left.eval(t,n),"boolean"),o=ua(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?tt(!0):!r||!o?[]:tt(!1)}}class Rb{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=zr[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 _b{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const l=this.left.eval(t,n);return o in l?[l[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const yB=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],xB={"'":"'",'"':'"',"`":"`",r:"\r",n:`
77
- `,t:" ",f:"\f","\\":"\\"};class bB{constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!o?.dateTimeLiterals,this.symbolRegex=o?.symbolRegex??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
78
- `))}consumeString(t){this.advance();let n="",r;for(;r=this.consumeChar(t);)n+=r;const o=this.buildToken(t==="`"?"Symbol":"String",n);return this.advance(),o}consumeChar(t){const n=this.curr();if(n==="\\"){this.advance();const r=this.curr(),o=xB[r];if(o!==void 0)return this.advance(),o;if(r==="u"){this.advance();const l=/^[0-9a-fA-F]{4}$/.exec(this.str.substring(this.pos.index,this.pos.index+4))?.[0];return l?(this.advance(),this.advance(),this.advance(),this.advance(),String.fromCodePoint(parseInt(l,16))):"u"}return this.consumeChar(t)}return n===t||!n?"":(this.advance(),n)}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&SB(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]}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()===`
79
- `?(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 SB(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&yB.includes(e.value)))}const wB=["true","false"],jB=["!=","!~","<=",">=","{}","->"];function CB(e){return new bB(e,wB,jB).tokenize()}const Xt={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},EB={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},TB={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new _b(t,n)},precedence:Xt.Indexer},RB={parse(e,t){if(!(t instanceof rp))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Rb(t.name,n)},precedence:Xt.FunctionCall};function _B(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 DB(){return new z$().registerPrefix("String",{parse:(e,t)=>new mc({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new mc({type:re.dateTime,value:Ih(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new mc({type:re.Quantity,value:_B(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new mc({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new mc({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new mc({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new rp(t.value)}).registerPrefix("{}",{parse:()=>new oB}).registerPrefix("(",EB).registerInfix("[",TB).registerInfix("(",RB).prefix("+",Xt.UnaryAdd,(e,t)=>new aB("+",t,n=>n)).prefix("-",Xt.UnarySubtract,(e,t)=>new Vi("-",t,t,(n,r)=>-r)).infixLeft(".",Xt.Dot,(e,t,n)=>new Cb(e,n)).infixLeft("/",Xt.Divide,(e,t,n)=>new Vi("/",e,n,(r,o)=>r/o)).infixLeft("*",Xt.Multiply,(e,t,n)=>new Vi("*",e,n,(r,o)=>r*o)).infixLeft("+",Xt.Add,(e,t,n)=>new Vi("+",e,n,(r,o)=>r+o)).infixLeft("-",Xt.Subtract,(e,t,n)=>new Vi("-",e,n,(r,o)=>r-o)).infixLeft("|",Xt.Union,(e,t,n)=>new Eb(e,n)).infixLeft("=",Xt.Equals,(e,t,n)=>new uB(e,n)).infixLeft("!=",Xt.NotEquals,(e,t,n)=>new dB(e,n)).infixLeft("~",Xt.Equivalent,(e,t,n)=>new fB(e,n)).infixLeft("!~",Xt.NotEquivalent,(e,t,n)=>new hB(e,n)).infixLeft("<",Xt.LessThan,(e,t,n)=>new Vi("<",e,n,(r,o)=>r<o)).infixLeft("<=",Xt.LessThanOrEquals,(e,t,n)=>new Vi("<=",e,n,(r,o)=>r<=o)).infixLeft(">",Xt.GreaterThan,(e,t,n)=>new Vi(">",e,n,(r,o)=>r>o)).infixLeft(">=",Xt.GreaterThanOrEquals,(e,t,n)=>new Vi(">=",e,n,(r,o)=>r>=o)).infixLeft("&",Xt.Ampersand,(e,t,n)=>new sB(e,n)).infixLeft("and",Xt.And,(e,t,n)=>new pB(e,n)).infixLeft("as",Xt.As,(e,t,n)=>new ip(e,n)).infixLeft("contains",Xt.Contains,(e,t,n)=>new lB(e,n)).infixLeft("div",Xt.Divide,(e,t,n)=>new Vi("div",e,n,(r,o)=>r/o|0)).infixLeft("in",Xt.In,(e,t,n)=>new cB(e,n)).infixLeft("is",Xt.Is,(e,t,n)=>new Tb(e,n)).infixLeft("mod",Xt.Modulo,(e,t,n)=>new Vi("mod",e,n,(r,o)=>r%o)).infixLeft("or",Xt.Or,(e,t,n)=>new mB(e,n)).infixLeft("xor",Xt.Xor,(e,t,n)=>new gB(e,n)).infixLeft("implies",Xt.Implies,(e,t,n)=>new vB(e,n))}const AB=DB();function Db(e){return new sA(e,AB.construct(CB(e)).consumeAndParse())}function PB(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=ri(n[r]))}return cs(e,n).map(r=>r.value)}function cs(e,t,n={},r=void 0){let o;if(typeof e=="string"){const l=r?.get(e);o=l??Db(e),r&&!l&&r.set(e,o)}else o=e;return o.eval({variables:n},t).map(l=>({type:l.type,value:l.value?.valueOf()}))}function kB(e){const t=[];for(const n of e){const r=GD(n.value);r&&t.push(r)}return t}function NB(e){const t=new Set;for(const n of e){const r=il(n);r&&t.add(r)}return Array.from(t)}function OB(e){const t=new Set;for(const n of e){const{value:r}=n;r&&(NU(r)?t.add(r):wa(r)?t.add(r.reference):WD(r)?t.add(_t(r)):typeof r.identifier=="object"&&t.add(`identifier:${r.identifier.system}|${r.identifier.value}`))}return Array.from(t)}function MB(e,t={}){const n=[];for(const r of e)LB(t,n,r);return n}function LB(e,t,n){const{type:r,value:o}=n;switch(r){case re.Identifier:IB(t,e,o);break;case re.CodeableConcept:zB(t,e,o);break;case re.Coding:lA(t,e,o);break;case re.ContactPoint:$B(t,e,o);break;default:al(t,e,void 0,o?.toString())}}function IB(e,t,n){n?.type?.text&&al(e,t,t.textSearchSystem,n.type.text),al(e,t,n?.system,n?.value)}function zB(e,t,n){if(n?.text&&al(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)lA(e,t,r)}function lA(e,t,n){n&&(n.display&&al(e,t,t.textSearchSystem,n.display),al(e,t,n.system,n.code))}function $B(e,t,n){n&&al(e,t,n.system,n.value?.toLocaleLowerCase())}function al(e,t,n,r){(n||r)&&!e.some(o=>o.system===n&&o.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const pm=20,de={EQUALS:"eq",NOT_EQUALS:"ne",GREATER_THAN:"gt",LESS_THAN:"lt",GREATER_THAN_OR_EQUALS:"ge",LESS_THAN_OR_EQUALS:"le",STARTS_AFTER:"sa",ENDS_BEFORE:"eb",APPROXIMATELY:"ap",CONTAINS:"contains",STARTS_WITH:"sw",EXACT:"exact",TEXT:"text",NOT:"not",ABOVE:"above",BELOW:"below",IN:"in",NOT_IN:"not-in",OF_TYPE:"of-type",MISSING:"missing",PRESENT:"present",IDENTIFIER:"identifier",ITERATE:"iterate"},cA={contains:de.CONTAINS,exact:de.EXACT,above:de.ABOVE,below:de.BELOW,text:de.TEXT,not:de.NOT,in:de.IN,"not-in":de.NOT_IN,"of-type":de.OF_TYPE,missing:de.MISSING,identifier:de.IDENTIFIER,iterate:de.ITERATE},Ab={eq:de.EQUALS,ne:de.NOT_EQUALS,lt:de.LESS_THAN,le:de.LESS_THAN_OR_EQUALS,gt:de.GREATER_THAN,ge:de.GREATER_THAN_OR_EQUALS,sa:de.STARTS_AFTER,eb:de.ENDS_BEFORE,ap:de.APPROXIMATELY,sw:de.STARTS_WITH};function uA(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 o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const l=[];return r&&l.push(...r.entries()),UB(o,l)}function UB(e,t){const n={resourceType:e};for(const[r,o]of t)BB(n,r,o);return n}function BB(e,t,n){let r,o;const l=t.indexOf(":");if(l>=0?(r=t.substring(0,l),o=t.substring(l+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Wu(e.filters,{code:t,operator:de.EQUALS,value:n});return}switch(r){case"_sort":VB(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=HE(n);o==="iterate"&&(c.modifier=de.ITERATE),e.include=Wu(e.include,c);break}case"_revinclude":{const c=HE(n);o==="iterate"&&(c.modifier=de.ITERATE),e.revInclude=Wu(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=Eo.types[e.resourceType]?.searchParams?.[r];c?e.filters=Wu(e.filters,HB(c,o,n)):e.filters=Wu(e.filters,qB(r,o,n))}}}}function VB(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}const FB=[de.MISSING,de.PRESENT];function HB(e,t,n){if(FB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=GB(n);if(!qE(e,o))throw new ft(xo(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!qE(e,n))throw new ft(xo(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:QB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function qB(e,t,n){let r=de.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in Ab&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function GB(e){const t=e.substring(0,2),n=Ab[t];return n?{operator:n,value:e.substring(2)}:{operator:de.EQUALS,value:e}}function QB(e){return cA[e]??de.EQUALS}function HE(e){const t=e.split(":");if(t.includes("*"))throw new ft(xo("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new ft(xo(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new ft(xo(`Invalid include value '${e}'`))}function qE(e,t){switch(e.type){case"date":return pd(t);default:return!0}}function is(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(WB(n))),e.sortRules&&e.sortRules.length>0&&t.push(YB(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(GE("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(GE("_revinclude",n))),t.length===0?"":(Ic(t),"?"+t.join("&"))}function WB(e){const t=e.operator in cA?":"+e.operator:"",n=e.operator!==de.EQUALS&&e.operator in Ab?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function YB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function GE(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function mm(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function KB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!XB(e,t,n))return!1}return!0}function XB(e,t,n){const r=Eo.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=cs(r.expression,[ri(e)]);if(n.operator===de.MISSING||n.operator===de.PRESENT)return ZB(o,n);switch(r.type){case"reference":return JB(o,n);case"string":case"uri":return nV(o,n);case"token":return eV(o,n);case"date":return iV(o,n);default:return!1}}function ZB(e,t){const n=e.length>0;return(t.operator===de.MISSING&&t.value==="false"||t.operator===de.PRESENT&&t.value==="true")===n}function JB(e,t){const n=gm(t.operator);if(t.value===""&&e.length===0)return t.operator===de.EQUALS;const r=OB(e);for(const o of mm(t.value)){let l=r.includes(o);if(!l&&t.code==="_compartment"&&(l=r.some(c=>c?.endsWith("/"+o))),l)return!n}return n}function eV(e,t){const n=MB(e),r=mm(t.value),o=gm(t.operator);for(const l of n)for(const c of r)if(tV(l,c))return!o;return o}function tV(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(o=>o.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 nV(e,t){const n=NB(e),r=mm(t.value),o=gm(t.operator);for(const l of n)for(const c of r)if(rV(l,c))return!o;return o}function rV(e,t){return e.toLowerCase().includes(t.toLowerCase())}function iV(e,t){const n=kB(e),r=mm(t.value),o=gm(t.operator);for(const l of n)for(const c of r)if(oV(l,t.operator,c))return!o;return o}function oV(e,t,n){if(!e)return!1;const r=GD(n);if(!r)return!1;const o=e.start??"0000",l=e.end??"9999",c=r.start,d=r.end;switch(t){case de.APPROXIMATELY:case de.EQUALS:case de.NOT_EQUALS:return o<d&&l>c;case de.LESS_THAN:return o<c;case de.GREATER_THAN:return l>d;case de.LESS_THAN_OR_EQUALS:return o<=d;case de.GREATER_THAN_OR_EQUALS:return l>=c;case de.STARTS_AFTER:return o>d;case de.ENDS_BEFORE:return l<c;default:return!1}}function gm(e){return e===de.NOT_EQUALS||e===de.NOT}const aV={resourceType:"*"},sV=["DomainConfiguration","JsonWebKey","Login"],lV=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"],Xs={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},cV=[Xs.READ,Xs.VREAD,Xs.HISTORY,Xs.SEARCH];function uV(e,t){return sV.includes(t)?!1:dV(e,Xs.UPDATE,t)}function dV(e,t,n){return!!e.resource?.some(r=>fA(r,n,t))}function dA(e,t,n){return n?n.resource?.find(r=>fV(e,t,r)):aV}function fV(e,t,n){const r=e.resourceType;return fA(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!KB(e,uA(n.criteria))):!1}function fA(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||lV.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||cV.includes(n)}function po(){return typeof window<"u"}function hA(){return typeof Buffer<"u"?Buffer:void 0}const Xn={assign(e){po()&&globalThis.location.assign(e)},reload(){po()&&globalThis.location.reload()},getSearch(){return po()?globalThis.location.search:""},getPathname(){return po()?globalThis.location.pathname:""},getLocation(){return po()?globalThis.location.toString():""},getOrigin(){return po()?globalThis.location.protocol+"//"+globalThis.location.host+"/":""}};function hV(e){if(po()){const n=window.atob(e),r=Uint8Array.from(n,o=>o.charCodeAt(0));return new window.TextDecoder().decode(r)}const t=hA();if(t)return t.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function QE(e){if(po()){const n=new window.TextEncoder().encode(e),r=String.fromCharCode.apply(null,n);return window.btoa(r)}const t=hA();if(t)return t.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function pV(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return hV(t)}function WE(){const e=new Uint32Array(28);return crypto.getRandomValues(e),MU(e.buffer)}async function mV(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function pA(){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 mA(e){const t={};e=ii(e);for(const o of e.entry||[]){const l=o.resource;if(!l)continue;l.meta!==void 0&&(delete l.meta.author,delete l.meta.compartment,delete l.meta.lastUpdated,delete l.meta.project,delete l.meta.versionId,Object.keys(l.meta).length===0&&delete l.meta);const c=l?.id;c&&(t[c]=pA(),o.fullUrl="urn:uuid:"+t[c],delete o.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(o=>({fullUrl:o.fullUrl,request:{method:"POST",url:o.resource?.resourceType},resource:o.resource}))},(o,l)=>gV(o,l,t),2);return vV(JSON.parse(r))}function gV(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function vV(e){const t=xV(e),{sorted:n,cycles:r}=yV(t),o={};for(const c of e.entry??[])c.fullUrl&&(o[c.fullUrl]=c);const l=n.map(c=>o[c]);for(const c of r)for(const d of c){const f=o[d],p={...f,request:{...f.request,method:"PUT"}};l.push(p)}return{...e,entry:l}}const gc={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function yV(e){const t=[],n={},r=[];for(const l of Object.keys(e))n[l]=gc.NotVisited;function o(l,c){if(n[l]===gc.Visited)return!0;if(n[l]===gc.Visiting){const f=c.lastIndexOf(l);return f!==-1&&r.push(c.slice(f)),!0}n[l]=gc.Visiting,c.push(l);let d=!1;for(const f of e[l])o(f,c)||(d=!0);return n[l]=gc.Visited,c.pop(),t.unshift(l),!d}for(const l in e)n[l]===gc.NotVisited&&o(l,[]);return{sorted:t,cycles:r}}function gA(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(wa(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else gA(r,t)}}function xV(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&&gA(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const ln={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 bV=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 o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}};class vm{constructor(){this.emitter=new bV}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 cx={"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"},SV=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],Pb=["DiagnosticReport-update"];function wV(e){return Pb.includes(e)}function jV(e){if(Pb.includes(e))throw new ft(gn(`'context.version' is required for '${e}'.`))}const CV={"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 EV(e){return SV.includes(e)}function vA(e){return!!e.endpoint}function YE(e){if(!kb(e))throw new ft(gn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,l={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return vA(e)&&(l.endpoint=e.endpoint),new URLSearchParams(l).toString()}function kb(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const l of o)if(!cx[l])return!1;return!(vA(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function TV(e,t,n,r){if(typeof t!="object")throw new ft(gn(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new ft(gn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new ft(gn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!EV(t.resourceType))throw new ft(gn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new ft(gn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function RV(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!wa(t.reference))throw new ft(gn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else TV(e,t.resource,n,r)}function _V(e,t){const n=new Map,r=CV[e];for(let o=0;o<t.length;o++){const l=t[o].key;if(!r[l])throw new ft(gn(`Key '${l}' not found for event '${e}'. Make sure to add only valid keys.`));RV(e,t[o],o,r[l],n)}for(const[o,l]of Object.entries(r)){if(!(l.optional||n.has(o)))throw new ft(gn(`Missing required key '${o}' on context for '${e}' event.`));if(!l.manyAllowed&&(n.get(o)??0)>1)throw new ft(gn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function KE(e,t,n,r){if(!(e&&typeof e=="string"))throw new ft(gn("Must provide a topic."));if(!cx[t])throw new ft(gn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(cx).join(", ")}`));if(typeof n!="object")throw new ft(gn("context must be a context object or array of context objects."));if(Pb.includes(t)&&!r)throw new ft(gn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return _V(t,o),{timestamp:new Date().toISOString(),id:pA(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class DV extends vm{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new ft(gn("Subscription request should contain an endpoint."));if(!kb(t))throw new ft(gn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const l=o;l.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:l}),n.send(JSON.stringify({id:o?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function AV(e){return JSON.parse(pV(e))}function PV(e){return e.split(".").length===3}function Nb(e){const[t,n,r]=e.split(".");return AV(n)}function kV(e){try{return typeof Nb(e).login_id=="string"}catch{return!1}}function NV(e){try{const n=Nb(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class OV{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,ln.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var yA;yA=Symbol.toStringTag;class Fi{constructor(t){this[yA]="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 MV{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new LV)}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?Ki(n):void 0)}}class LV{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]}}/*!
80
- * Reconnecting WebSocket
81
- * by Pedro Ladaria <pedro.ladaria@gmail.com>
82
- * https://github.com/pladaria/reconnecting-websocket
83
- * License MIT
84
- *
85
- * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
86
- * https://github.com/partykit/partykit/blob/main/packages/partysocket
87
- */const Ec={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let XE=!1;function IV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Ec.Event=globalThis.Event,Ec.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Ec.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function zV(e,t){if(!e)throw new Error(t)}function Sh(e){return new e.constructor(e.type,e)}const $s={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let ZE=!1;class Za extends vm{constructor(t,n,r={}){XE||(IV(),XE=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=o=>{this._debug("open event");const{minUptime:l=$s.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),l),zV(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(o),this.dispatchEvent(Sh(o))},this._handleMessage=o=>{this._debug("message event"),this.onmessage&&this.onmessage(o),this.dispatchEvent(Sh(o))},this._handleError=o=>{this._debug("error event",o.message),this._disconnect(void 0,o.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(o),this._debug("exec error listeners"),this.dispatchEvent(Sh(o)),this._connect()},this._handleClose=o=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(o),this.dispatchEvent(Sh(o))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return Za.CONNECTING}get OPEN(){return Za.OPEN}get CLOSING(){return Za.CLOSING}get CLOSED(){return Za.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?Za.CLOSED:Za.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=$s.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=$s.reconnectionDelayGrowFactor,minReconnectionDelay:n=$s.minReconnectionDelay,maxReconnectionDelay:r=$s.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=$s.maxRetries,connectionTimeout:n=$s.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"&&!ZE&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),ZE=!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 Ec.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Ec.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Ec.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 $V=5e3;class ux extends vm{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 UV{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new ux(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class BV{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof bA))throw new ft(gn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new ft(gn("Not a valid URL"))}const l=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new Za(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=l,this.masterSubEmitter=new ux,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??$V,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 o=r,l=o?.entry?.[0]?.resource;if(l.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:o});return}if(l.type==="handshake"){const d=rl(l.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:o});const c=this.criteriaEntriesBySubscriptionId.get(rl(l.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:o})}catch(r){console.error(r);const o={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(o);for(const l of this.getAllCriteriaEmitters())l.dispatchEvent({...o})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new ft(K$(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 ${_t(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=r?.find(c=>c.name==="token")?.valueString,l=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!o)throw new ft(gn("Failed to get token"));if(!l)throw new ft(gn("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(Co(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:o,token:l}=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!Co(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),l&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:l}}))}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(Ye(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const o=new UV(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new ux(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const xA="4.5.2-515c26d74",VV=ln.FHIR_JSON+", */*; q=0.1",FV="https://api.medplum.com/",HV=1e3,qV=6e4,GV=0,QV=3e5,WV="Binary/",JE={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},vc={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"},YV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},KV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class bA extends vm{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??XV(),this.storage=t?.storage??new MV,this.createPdfImpl=t?.createPdf,this.baseUrl=wb(t?.baseUrl??FV),this.fhirBaseUrl=fo(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=fo(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=fo(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=fo(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=fo(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??QV,this.cacheTime=t?.cacheTime??(po()?qV:GV),this.cacheTime>0?this.requestCache=new AD(t?.resourceCacheSize??HV):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(),po()&&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=fo(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?o=new Promise((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))}):o=this.request("GET",t,n);const l=new Fi(o);return this.setCacheEntry(t,l),l}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,ln.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(Xn.getSearch()).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){Xn.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,l=!0){let c=o;l&&(c=await this.ensureCodeChallenge(o)),Xn.assign(this.getExternalAuthRedirectUri(t,n,r,c,l))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:vc.TokenExchange,subject_token_type:YV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,o,l=!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",o.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(o)),l){const{codeChallenge:d,codeChallengeMethod:f}=o;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(fo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=VU(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),l="search-"+o.toString(),c=this.getCacheEntry(l,r);if(c)return c.value;const d=this.getBundle(o,r);return this.setCacheEntry(l,d),d}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const l="searchOne-"+o.toString(),c=this.getCacheEntry(l,r);if(c)return c.value;const d=new Fi(this.search(t,o.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(l,d),d}searchResources(t,n,r){const l="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(l,r);if(c)return c.value;const d=new Fi(this.search(t,n,r).then(tT));return this.setCacheEntry(l,d),d}async*searchResourcePages(t,n,r){let o=this.fhirSearchUrl(t,n);for(;o;){const l=new URL(o).searchParams;l.has("_count")||l.set("_count","1000");const c=await this.search(t,l,r),d=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!d)break;yield tT(c),o=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 JE;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Fi(Promise.reject(new Error("Missing reference")));if(r==="system")return new Fi(Promise.resolve(JE));const[o,l]=r.split("/");return!o||!l?new Fi(Promise.reject(new Error("Invalid reference"))):this.readResource(o,l,n)}requestSchema(t){if(ID(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Fi((async()=>{const l=`{
88
- StructureDefinitionList(_filter: "name eq ${t}") {
89
- resourceType,
90
- name,
91
- kind,
92
- description,
93
- type,
94
- url,
95
- snapshot {
96
- element {
97
- id,
98
- path,
99
- definition,
100
- min,
101
- max,
102
- base {
103
- path,
104
- min,
105
- max
106
- },
107
- contentReference,
108
- type {
109
- code,
110
- profile,
111
- targetProfile
112
- },
113
- binding {
114
- strength,
115
- valueSet
116
- }
117
- }
118
- }
119
- }
120
- SearchParameterList(base: "${t}", _count: 100) {
121
- base,
122
- code,
123
- type,
124
- expression,
125
- target
126
- }
127
- }`.replace(/\s+/g," "),c=await this.graphql(l);ME(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)JU(d)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!n?.expandProfile&&vb(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const l=new Fi((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(),{});ME(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}LD(c)}})());return this.setCacheEntry(r,l),l}readHistory(t,n,r,o){const l=this.fhirUrl(t,n,"_history");return r?.count&&l.searchParams.set("_count",r.count.toString()),r?.offset&&l.searchParams.set("_offset",r.offset.toString()),this.get(l.toString(),o)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){const o=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const l=await this.post(o,t,void 0,r);return this.cacheResource(l),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),l}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let l=await this.put(o,t,void 0,r);return l||(l=t),this.cacheResource(l),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),l}async createAttachment(t,n,r,o,l){let c=nT(t,n,r,o);if(c.contentType===ln.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:ln.CDA_XML})}const d=l??(typeof n=="object"?n:{}),f=await this.createBinary(c,d);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,o,l){const c=nT(t,n,r,o),d=l??(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,o,l){return new Promise((c,d)=>{const f=new XMLHttpRequest,p=()=>f.abort();l?.signal?.addEventListener("abort",p);const m=g=>{l?.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")),o&&(f.upload.onprogress=g=>o(g),f.upload.onload=g=>o(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new ft(qt(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"),l?.headers){const g=l.headers;for(const[x,b]of Object.entries(g))f.setRequestHeader(x,b)}f.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const l=eF(t,n,r,o),c=typeof n=="object"?n:{},{docDefinition:d,tableLayouts:f,fonts:p,...m}=l,g=await this.createPdfImpl(d,f,p),x={...m,data:g,contentType:"application/pdf"};return this.createBinary(x,c)}createComment(t,n,r){const o=this.getProfile();let l,c;return t.resourceType==="Encounter"&&(l=Ht(t),c=t.subject),t.resourceType==="ServiceRequest"&&(l=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=Ht(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Ht(t)],encounter:l,subject:c,sender:o?Ht(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const l=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(l),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),l}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,o){let l;if(typeof t=="string"){const c=t;l=this.fhirUrl("Bot",c,"$execute")}else{const c=t;l=this.fhirUrl("Bot","$execute"),l.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(l,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,ln.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},ln.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,l,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",rl(t),"$push"),{destination:typeof n=="string"?n:_t(n),body:r,contentType:o,waitForResponse:l,...d!==void 0?{waitTimeout:d}:void 0},ln.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||_t(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=NV(t),this.medplumServer=kV(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 o=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){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(WV)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,l=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Ht(l));const c=await this.createAttachment(o,n);return this.updateResource({...l,status:"completed",content:c})}async uploadMedia(t,n,r,o,l){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},l)}async createDocumentReference(t,n){const{additionalFields:r,...o}=t,l=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});o.securityContext||(o.securityContext=Ht(l));const c=await this.createAttachment(o,n);return this.updateResource({...l,content:[{attachment:c}]})}async bulkExport(t="",n,r,o){const l=t&&`${t}/`,c=this.fhirUrl(`${l}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new OV(this)),this.keyValueClient}getBundle(t,n){return new Fi((async()=>{const r=await this.get(t,n);if(r.entry)for(const o of r.entry)this.cacheResource(o.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||n?.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 Fi(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const l=await this.fetchWithRetry(n,r);if(l.status===401)return this.handleUnauthenticated(t,n,r);if(l.status===204||l.status===304)return;const d=l.headers.get("content-type")?.includes("json");if(l.status===404&&!d)throw new ft(W$);const f=await this.parseBody(l,d);if(l.status===200&&r.followRedirectOnOk||l.status===201&&r.followRedirectOnCreated){const p=await eT(l,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(l.status===202&&r.pollStatusOnAccepted){const m=await eT(l,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(l.status>=400)throw new ft(qt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=fo(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)try{this.options.verbose&&this.logRequest(t,n);const l=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(l),this.setCurrentRateLimit(l),o>=r||!tF(l))return l;const c=this.getRetryDelay(o),d=n.maxRetryTime??2e3;if(c>d)return l;await VE(c)}catch(l){if(l.message==="Failed to fetch"&&o===0&&this.dispatchEvent({type:"offline"}),l.name==="AbortError"||o===r)throw l}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of Ic(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){if(!t?.headers||typeof t.headers.get!="function")return;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 o=r[0].substring(1,r[0].length-1),l=r.find(p=>p.startsWith("r=")),c=l?parseInt(l.substring(2),10):NaN,d=r.find(p=>p.startsWith("t=")),f=d?parseInt(d.substring(2),10):NaN;if(!o||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:o,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const o of n)o.remainingUnits||(r=Math.max(r,o.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const l=n.pollStatusPeriod??1e3;await VE(l),r.pollCount++}return this.request("GET",t,o,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 o=t[0];try{o.resolve(await this.request(o.method,fo(this.fhirBaseUrl,o.url),o.options))}catch(l){o.reject(new ft(qt(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(o=>({request:{method:o.method,url:o.url},resource:o.options.body?JSON.parse(o.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let o=0;o<t.length;o++){const l=t[o],c=r.entry?.[o];c?.response?.outcome&&!kD(c.response.outcome)?l.reject(new ft(c.response.outcome)):l.resolve(c?.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",VV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",ln.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){t.headers||(t.headers={});const l=t.headers;o&&l[n]||(l[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 ft(hd)))}async startPkce(){const t=WE();sessionStorage.setItem("pkceState",t);const n=WE().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await mV(n);return{codeChallengeMethod:"S256",codeChallenge:LU(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??Xn.getOrigin()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),Xn.assign(r.toString())}processCode(t,n){const r={grant_type:vc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??Xn.getOrigin()};if(typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&(r.code_verifier=o)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:vc.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:vc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:vc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:vc.ClientCredentials,client_assertion_type:KV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=QE(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new ft(gn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new ft(gn("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},l=(await this.post(this.fhircastHubUrl,YE(r),ln.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!l)throw new Error("Invalid response!");return r.endpoint=l,r}async fhircastUnsubscribe(t){if(!kb(t))throw new ft(gn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new ft(gn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,YE(t),ln.FORM_URL_ENCODED)}fhircastConnect(t){return new DV(t)}async fhircastPublish(t,n,r,o){return wV(n)?this.post(this.fhircastHubUrl,KE(t,n,r,o),ln.JSON):(jV(n),this.post(this.fhircastHubUrl,KE(t,n,r),ln.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":ln.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 ${QE(t.client_id+":"+t.client_secret)}`));const o={method:"POST",headers:r,body:n.toString(),credentials:"include"};let l;try{l=await this.fetchWithRetry(this.tokenUrl,o)}catch(d){throw this.refreshPromise=void 0,d}if(!l.ok){this.clearActiveLogin();try{const d=await l.json();throw new ft(xo(d.error_description))}catch(d){throw new ft(xo("Failed to fetch tokens"),d)}}const c=await l.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(PV(n)){const r=Nb(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new ft(Y$);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new ft(NE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new ft(NE)}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)Xn.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)?Xn.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new BV(this,BU(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 XV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}async function eT(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(um(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function tT(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function ZV(e){return pr(e)&&"data"in e&&"contentType"in e}function nT(e,t,n,r){return ZV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function JV(e){return pr(e)&&"docDefinition"in e}function eF(e,t,n,r){return JV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function tF(e){return e.status===429||e.status>=500}function zc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:l}){if(t===e?.path)return;o??=e?.debugMode??!1,l??=e?.accessPolicyResource;let c=nF(t,n,e,!!o);const d=lx(t,".",2)[1];c=rF(c,l,d),c=iF(c,l,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=lx(g,".",2)[1];if(x){if(!m[x]){const b=op(x,l?.hiddenFields);m[x]={hidden:b,readonly:b||op(x,l?.readonlyFields)}}return m[x]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:p,accessPolicyResource:l}}function nF(e,t,n,r){const o=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=Ys(e,c);f!==void 0&&(o[f]=d)}let l=!1;if(t)for(const[c,d]of Object.entries(t))c in o||(o[c]=d,l=!0);return r&&console.assert(l,"Unnecessary ElementsContext; not using any newly provided elements"),o}function rF(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!op(r+o,t.hiddenFields)))}function iF(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),o=n?n+".":"";for(const[l,c]of Object.entries(e))op(o+l,t.readonlyFields)?r[l]={...c,readonly:!0}:r[l]=c;return r}function op(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function SA(e){return e.type!==void 0&&e.type.length>0}function oF(e,t,n,r){const o=fU(e,t.path,{profileUrl:r});if(o){const l=n.typeSchema?.elements??n.elements;return o.some(c=>mU(c,t,n,l))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function wA(e,t,n,r){if(e)for(const o of t){const l={value:e,type:o.typeSchema?.type??o.type?.[0].code};if(n.every(c=>oF(l,c,o,o.typeSchema?.url??r)))return o.name}}class aF{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=zc({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([l])=>l.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!Rn(o.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(o.slices[0],n.path,o),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=sF(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const o of t.children)this.crawlElementNode(o,n);Rn(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 l of t){if(!SA(l))continue;const c=l.type.find(d=>Rn(d.profile))?.profile?.[0];if(Rn(c)){const d=Zc(c);d&&(l.typeSchema=d)}r.push(l)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let l;const c=o?.elements??t.elements;Rn(c)&&(l=zc({path:n,parentContext:this.elementsContext,elements:c})),l&&this.elementsContextStack.push(l),this.crawlElementsImpl(c,n),l&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function sF(e){const t=[];function n(l,c){return c.startsWith(l+".")}function r(l,c){for(const d of l.children)if(n(d.key,c.key)){r(d,c);return}l.children.push(c)}const o=Object.entries(e);o.sort((l,c)=>l[0].localeCompare(c[0]));for(const[l,c]of o){const d={key:l,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,l)){r(p,d),f=!0;break}f||t.push(d)}return t}const xy="__sliceName";function lF(e,t){const n=new cF(e,e.resourceType,"resource");return new aF(t,n).crawlResource(),n.getDefaultValue()}function rT(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){ap(e,r,o,t);continue}const l=Ys(n,r);l!==void 0&&ap(e,l,o,t)}return e}class cF{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=ii(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,l=this.value.path,c=Ys(l,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${l}`);const d=[];for(const f of o){if(f===void 0)continue;const p=Ys(r.path,l),m=Array.isArray(f)?f:[f];for(const g of m){uF(g,c,n,r.elements,p),ap(g,c,n,r.elements);const x=fx(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 l=Ys(this.value.path,t);if(l===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Ys(r.path,this.value.path);for(const d of this.value.values){const f=fx(d,l,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];Rn(m)||f.splice(p,1)}vn(f)&&dx(d,void 0,l,n)}}onEnterSlice(t,n,r){const o=this.value.values,l=[];for(const c of o)if(c!==void 0){const d=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(d,n,r);l.push(f)}this.valueStack.push({type:"slice",path:t,values:l})}getMatchingSliceValues(t,n,r){const o=[];for(const l of t)(l[xy]??wA(l,[n],r.discriminator,this.schema.url))===n.name&&o.push(l);for(let l=o.length;l<n.min;l++)if(Sb(n.type[0].code)){const c=Object.create(null);o.push(c),t.push(c)}return o}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const o=n[r];xy in o&&delete o[xy]}}getDefaultValue(){return this.rootValue}}function uF(e,t,n,r,o){const l=fx(e,t,r,o);n.min>0&&l===void 0&&Sb(n.type[0].code)&&(n.isArray?dx(e,[Object.create(null)],t,n):dx(e,Object.create(null),t,n))}function dx(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const l=r.type[0].code;o=n.replace("[x]",$n(l))}t===void 0?delete e[o]:e[o]=t}function fx(e,t,n,r){const o=t.split(".");let l=e,c;for(let d=0;d<o.length;d++){let f=o[d];if(f.includes("[x]")){const p=(r?r+".":"")+o.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",$n(g))}if(d===o.length-1){Array.isArray(l)?c=l.map(p=>p[f]):c=l[f];continue}if(Array.isArray(l))l=l.map(p=>p[f]);else if(pr(l)){if(l[f]===void 0)return;l=l[f]}else return}return c}function ap(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>ap(d,t,n,r));e==null&&(e=Object.create(null));const o=e,l=t.split(".");let c=o;for(let d=0;d<l.length;d++){let f=l[d];if(f.includes("[x]")){const m=r[l.slice(0,d+1).join(".")].type[0].code;f=f.replace("[x]",$n(m))}if(d===l.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]=jA(m[f],n.pattern.value))}else{if(!(f in c)){const p=l.slice(0,d+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return o}function jA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:ii(t);if(pr(t)&&(pr(e)&&!Array.isArray(e)||e===void 0)){const n=ii(e)??Object.create(null);for(const r of Object.keys(t))n[r]=jA(n[r],t[r]);return n}return e}const dr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function ym(e,t){let n=Eo.types[e]?.searchParamsDetails?.[t.code];return n||(n=fF(e,t)),n}function dF(e,t,n){let r=Eo.types[e];r||(r={},Eo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function fF(e,t){const n=t.code,r=gF(e,t.expression),o={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const d=zh(c),f=$U(()=>d.join("."));d.length===1&&d[0]instanceof qr?o.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?o.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(o.array=!0,o.propertyTypes.clear(),o.propertyTypes.add("code")):CA(o,d,e,1),f().endsWith("extension.valueDateTime")&&(o.array=!1,o.propertyTypes.clear(),o.propertyTypes.add("dateTime"))}const l={type:mF(t,o.propertyTypes),elementDefinitions:o.elementDefinitions.map(c=>({...c,type:c.type?.filter(d=>o.propertyTypes.has(d.code))})).filter(c=>c.type&&c.type.length>0),parsedExpression:vF(e,t.expression),array:o.array};return dF(e,n,l),l}function CA(e,t,n,r){const o=t[r];if(o instanceof ip){e.propertyTypes.add(o.right.toString());return}if(o instanceof Rb){hF(e,o);return}const l=o.toString(),c=ms(n,l);if(!c)throw new Error(`Element definition not found for ${n} ${l}`);let d=!1,f=r+1;f<t.length&&t[f]instanceof _b&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof ip){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;pF(g)&&(g=c.type[0].code),CA(e,t,g,f)}}function hF(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 Tb){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function pF(e){return e==="Element"||e==="BackboneElement"}function mF(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?dr.DATE:dr.DATETIME;case"number":return dr.NUMBER;case"quantity":return dr.QUANTITY;case"reference":return t.has(re.canonical)?dr.CANONICAL:dr.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?dr.BOOLEAN:dr.TEXT;default:return dr.TEXT}}function gF(e,t){const n=[],r=Db(t);return sp(e,r.child,n),n}function vF(e,t){const n=[],r=Db(t);if(sp(e,r.child,n),n.length===0)return r;let o=n[0];for(let l=1;l<n.length;l++)o=new Eb(o,n[l]);return new sA("<original-not-available>",o)}function sp(e,t,n){t instanceof Eb?(sp(e,t.left,n),sp(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function zh(e){if(e instanceof ip||e instanceof _b)return[zh(e.left),e].flat();if(e instanceof qr)return[e];if(e instanceof Cb)return[zh(e.left),zh(e.right)].flat();if(e instanceof Rb){if(e.name==="where"&&!(e.args[0]instanceof Tb))return[];if(e.name==="last")return[]}return[e]}const yF="https://meta.medplum.com/releases",by=new Map;function xF(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 bF(e,t,n){let r=by.get("latest");if(!r){const o="latest",l=new URL(`${yF}/${o}.json`);l.searchParams.set("a",e),l.searchParams.set("c",xA);const c=await fetch(l.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ye(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const d=await c.json();xF(d),r=d,by.set("latest",r),by.set(r.tag_name.slice(1),r)}return r}async function SF(e){const t=await bF(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 EA=v.createContext(void 0);function xm(){return v.useContext(EA)}function Re(){return xm().medplum}function bm(){return xm().navigate}function Sm(){return xm().profile}const iT=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function wF(e){const t=e.medplum,n=e.navigate??jF,[r,o]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){o(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of iT)t.addEventListener(d,c);return()=>{for(const d of iT)t.removeEventListener(d,c)}},[t]);const l=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(EA.Provider,{value:l,children:e.children})}function jF(e){window.location.assign(e)}const oT=new Map,TA=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 o=oT.get(t);if(o){const c=new URLSearchParams(new URL(o).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return o}return oT.set(t,e),e},[e]);function Gt(e,t){const n=Re(),[r,o]=v.useState(()=>aT(n,e)),l=v.useCallback(c=>{Co(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const d=aT(n,e);return!d&&wa(e)?n.readReference(e).then(f=>{c&&l(f)}).catch(f=>{c&&(l(void 0),t&&t(qt(f)))}):l(d),(()=>c=!1)},[n,e,l,t]),r}function aT(e,t){if(t){if(Ao(t))return t;if(wa(t))return e.getCachedReference(t)}}const xt={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"},Ob=`${Ji}/fhir/StructureDefinition/questionnaire-itemControl`,CF=`${Ji}/fhir/StructureDefinition/questionnaire-referenceFilter`,hx=`${Ji}/fhir/StructureDefinition/questionnaire-referenceResource`,EF=`${Ji}/fhir/StructureDefinition/questionnaire-validationError`,TF=`${Ji}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,RF=`${Ji}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,_F=`${Ji}/fhir/StructureDefinition/questionnaire-signatureRequired`,$h=`${Ji}/fhir/StructureDefinition/questionnaireresponse-signature`;function DF(e){return e.type==="choice"||e.type==="open-choice"}function AF(e,t){const n=PF(e,t);return n!==void 0?n:kF(e,t)}function PF(e,t){const n=Do(e,TF);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=ri(t),l=cs(r,[o],{"%resource":o});return go(l)}}}function kF(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=DA(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:l,allMatch:c}=zF(r,o,n);if(n==="any"&&l)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function RA(e,t,n=t.item){for(const r of e){const o=n?.find(l=>l.linkId===r.linkId);o&&(NF(t,r,o),r.item&&o.item&&RA(r.item,t,o.item))}}function NF(e,t,n){try{const r=LF(t,e);if(!r)return;const o=MF(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:EF,valueString:`Expression evaluation failed: ${Ye(r)}`}]}}const OF={[xt.boolean]:[re.boolean],[xt.date]:[re.date],[xt.dateTime]:[re.dateTime],[xt.time]:[re.time],[xt.url]:[re.string,re.uri,re.url],[xt.attachment]:[re.Attachment],[xt.reference]:[re.Reference],[xt.quantity]:[re.Quantity],[xt.decimal]:[re.decimal,re.integer],[xt.integer]:[re.decimal,re.integer]};function MF(e,t){if(!e.type)return;if(e.type===xt.choice||e.type===xt.openChoice)return{[`value${$n(t.type)}`]:t.value};if(e.type===xt.string||e.type===xt.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(OF[e.type]?.includes(t.type))return{[`value${$n(e.type)}`]:t.value}}function LF(e,t){if(!t)return;const n=Do(e,RF);if(n){const r=n.valueExpression?.expression;if(r){const o=ri(t),l=cs(r,[o],{"%resource":o});return l.length!==0?l[0]:void 0}}}function _A(e,t,n){const r=[];for(const o of e){const l=n.answerOption?.find(c=>il(To(c))===o);if(l){const c=To(l);c&&r.push({[t]:c.value})}}return r}function DA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=DA(n.item,t);if(r)return r}}}function IF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=cs(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function zF(e,t,n){const r=t||[],o=BF(e);let l=!1,c=!0;for(const d of r){const f=VF(d),{operator:p}=e;if(IF(f,o,p)?l=!0:c=!1,n==="any"&&l)break}return{anyMatch:l,allMatch:c}}function AA(e){const t=Do(e,hx);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function Sy(e,t){const n=ii(e);let r=Do(n,hx);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:hx},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function $F(e,t,n){const r=Do(e,CF);if(!r?.valueString)return;let o=r.valueString;t?.reference&&(o=o.replaceAll("$subj",t.reference)),n?.reference&&(o=o.replaceAll("$encounter",n.reference));const l={},c=o.split("&");for(const d of c){const[f,p]=lx(d,"=",2);l[f]=p}return l}function sT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??_t(e),item:Mb(e.item,t?.item),status:"in-progress"}}function Mb(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===xt.display)continue;const o=t?.filter(l=>l.linkId===r.linkId);if(o&&o?.length>0)for(const l of o)l.id=l.id??kA(),l.text=l.text??r.text,l.item=Mb(r.item,l.item),l.answer=NA(r,l),n.push(l);else n.push(PA(r))}return n}function PA(e){return{id:kA(),linkId:e.linkId,text:e.text,item:Mb(e.item,void 0),answer:NA(e)}}let UF=1;function kA(){return"id-"+UF++}function NA(e,t){if(!(e.type===xt.display||e.type===xt.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 Lb(e){return Fd({value:e},"value")}function To(e){return Fd({value:e},"value")}function BF(e){return Fd({value:e},"answer")}function VF(e){return Fd({value:e},"value")}function FF(e){const t=Gt(e.questionnaire),n=Gt(e.defaultValue),[,r]=v.useReducer(w=>w+1,0),o=v.useRef({activePage:0});if(!o.current.questionnaire&&t&&(o.current.questionnaire=t,o.current.pages=e.disablePagination?void 0:HF(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=sT(t,n),b()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=sT(t),b()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function l(w,j){let C=o.current.questionnaireResponse;for(const T of w)C=C?.item?.find(E=>T.id?E.id===T.id:E.linkId===T.linkId);return j&&(C=C?.item?.find(T=>T.linkId===j.linkId)),C}function c(){o.current.activePage=(o.current.activePage??0)+1,r()}function d(){o.current.activePage=(o.current.activePage??0)-1,r()}function f(w,j){const C=l(w);C&&(C.item??=[],C.item.push(PA(j)),b())}function p(w,j){const C=l(w,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(w,j,C){const T=l(w,j);T&&(T.answer=C,b())}function g(w){const j=o.current.questionnaireResponse;j&&(w?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==$h),j.extension.push({url:$h,valueSignature:w})):j.extension=j.extension?.filter(C=>C.url!==$h),b())}function x(){const w=o.current.questionnaire;if(w?.item){const j=o.current.questionnaireResponse;RA(w.item,j)}}function b(){const w=o.current.questionnaireResponse;w&&(x(),r(),e.onChange?.(w))}return{loading:!1,pagination:!!o.current.pages,questionnaire:o.current.questionnaire,questionnaireResponse:o.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:o.current.activePage,pages:o.current.pages,items:qF(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:GF(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function HF(e){if(!(!e?.item||Do(e?.item?.[0],Ob)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function qF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function GF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function QF(e,t,n={leading:!1}){const[r,o]=v.useState(e),l=v.useRef(!1),c=v.useRef(void 0),d=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{l.current&&(!d.current&&n.leading?(d.current=!0,o(e)):(f(),c.current=setTimeout(()=>{d.current=!1,o(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(l.current=!0,f),[f]),[r,f]}const WF=250;function YF(e,t,n){return OA("searchOne",e,t)}function $c(e,t,n){return OA("searchResources",e,t)}function OA(e,t,n,r){const o=Re(),[l,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,x]=v.useState(),b=o.fhirSearchUrl(t,n).toString(),[w]=QF(b,WF,{leading:!0});return v.useEffect(()=>{w!==l&&(c(w),o[e](t,n).then(j=>{f(!1),m(j),x(Q$)}).catch(j=>{f(!1),m(void 0),x(qt(j))}))},[o,e,t,n,l,w]),[p,d,g]}function KF(e){const t=e.value;return t?a.jsx(a.Fragment,{children:nA(t)}):null}const MA=["meta","implicitRules","contained","extension","modifierExtension"],LA=["language","text"],an=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});an.displayName="ElementsContext";const Ib=["extension","modifierExtension"],XF=["id",...MA].filter(e=>!Ib.includes(e));function ZF(e){return Object.entries(e).filter(([n,r])=>!Rn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Ib.includes(n)&&!Rn(r.slicing?.slices)||XF.includes(n)?!1:!(LA.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function lT(e,t){return e.line&&e.line.length>t?e.line[t]:""}function cT(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:_U(r)}}function JF(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(an),[l,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(D=>o(e.path+"."+D)),[o,e.path]);function x(D){n(D),e.onChange&&e.onChange(D)}function b(D){x({...r.current,use:D})}function w(D){x({...r.current,type:D})}function j(D){x(cT(r.current||{},0,D))}function C(D){x(cT(r.current||{},1,D))}function T(D){x({...r.current,city:D})}function E(D){x({...r.current,state:D})}function R(D){x({...r.current,postalCode:D})}return a.jsxs(ye,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(on,{disabled:e.disabled||l?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:D=>b(D.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(on,{disabled:e.disabled||c?.readonly,"data-testid":"address-type",defaultValue:t.type,onChange:D=>w(D.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(Ve,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:lT(t,0),onChange:D=>j(D.currentTarget.value)}),a.jsx(Ve,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:lT(t,1),onChange:D=>C(D.currentTarget.value)}),a.jsx(Ve,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:D=>T(D.currentTarget.value)}),a.jsx(Ve,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:D=>E(D.currentTarget.value)}),a.jsx(Ve,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:D=>R(D.currentTarget.value)})]})}function eH(e){const t=Sm(),[n,r]=v.useState(e.defaultValue||{});function o(l){const c=l?{text:l,authorReference:t&&Ht(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(Ve,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:l=>o(l.currentTarget.value)})}/**
128
- * @license @tabler/icons-react v3.35.0 - MIT
129
- *
130
- * This source code is licensed under the MIT license.
131
- * See the LICENSE file in the root directory of this source tree.
132
- */var tH={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"}};/**
133
- * @license @tabler/icons-react v3.35.0 - MIT
134
- *
135
- * This source code is licensed under the MIT license.
136
- * See the LICENSE file in the root directory of this source tree.
137
- */const Fe=(e,t,n,r)=>{const o=v.forwardRef(({color:l="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},x)=>v.createElement("svg",{ref:x,...tH[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:l}:{strokeWidth:d,stroke:l},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([b,w])=>v.createElement(b,w)),...Array.isArray(m)?m:[m]]));return o.displayName=`${n}`,o};/**
138
- * @license @tabler/icons-react v3.35.0 - MIT
139
- *
140
- * This source code is licensed under the MIT license.
141
- * See the LICENSE file in the root directory of this source tree.
142
- */const nH=[["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"}]],rH=Fe("outline","adjustments-horizontal","AdjustmentsHorizontal",nH);/**
143
- * @license @tabler/icons-react v3.35.0 - MIT
144
- *
145
- * This source code is licensed under the MIT license.
146
- * See the LICENSE file in the root directory of this source tree.
147
- */const iH=[["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"}]],bl=Fe("outline","alert-circle","AlertCircle",iH);/**
148
- * @license @tabler/icons-react v3.35.0 - MIT
149
- *
150
- * This source code is licensed under the MIT license.
151
- * See the LICENSE file in the root directory of this source tree.
152
- */const oH=[["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"}]],aH=Fe("outline","arrow-down","ArrowDown",oH);/**
153
- * @license @tabler/icons-react v3.35.0 - MIT
154
- *
155
- * This source code is licensed under the MIT license.
156
- * See the LICENSE file in the root directory of this source tree.
157
- */const sH=[["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"}]],lH=Fe("outline","arrow-up","ArrowUp",sH);/**
158
- * @license @tabler/icons-react v3.35.0 - MIT
159
- *
160
- * This source code is licensed under the MIT license.
161
- * See the LICENSE file in the root directory of this source tree.
162
- */const cH=[["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"}]],uH=Fe("outline","bleach-off","BleachOff",cH);/**
163
- * @license @tabler/icons-react v3.35.0 - MIT
164
- *
165
- * This source code is licensed under the MIT license.
166
- * See the LICENSE file in the root directory of this source tree.
167
- */const dH=[["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"}]],fH=Fe("outline","bleach","Bleach",dH);/**
168
- * @license @tabler/icons-react v3.35.0 - MIT
169
- *
170
- * This source code is licensed under the MIT license.
171
- * See the LICENSE file in the root directory of this source tree.
172
- */const hH=[["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"}]],pH=Fe("outline","box-multiple","BoxMultiple",hH);/**
173
- * @license @tabler/icons-react v3.35.0 - MIT
174
- *
175
- * This source code is licensed under the MIT license.
176
- * See the LICENSE file in the root directory of this source tree.
177
- */const mH=[["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"}]],gH=Fe("outline","brackets-contain","BracketsContain",mH);/**
178
- * @license @tabler/icons-react v3.35.0 - MIT
179
- *
180
- * This source code is licensed under the MIT license.
181
- * See the LICENSE file in the root directory of this source tree.
182
- */const vH=[["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"}]],yH=Fe("outline","brand-asana","BrandAsana",vH);/**
183
- * @license @tabler/icons-react v3.35.0 - MIT
184
- *
185
- * This source code is licensed under the MIT license.
186
- * See the LICENSE file in the root directory of this source tree.
187
- */const xH=[["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"}]],bH=Fe("outline","bucket-off","BucketOff",xH);/**
188
- * @license @tabler/icons-react v3.35.0 - MIT
189
- *
190
- * This source code is licensed under the MIT license.
191
- * See the LICENSE file in the root directory of this source tree.
192
- */const SH=[["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"}]],wH=Fe("outline","bucket","Bucket",SH);/**
193
- * @license @tabler/icons-react v3.35.0 - MIT
194
- *
195
- * This source code is licensed under the MIT license.
196
- * See the LICENSE file in the root directory of this source tree.
197
- */const jH=[["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"}]],CH=Fe("outline","building","Building",jH);/**
198
- * @license @tabler/icons-react v3.35.0 - MIT
199
- *
200
- * This source code is licensed under the MIT license.
201
- * See the LICENSE file in the root directory of this source tree.
202
- */const EH=[["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"}]],Ka=Fe("outline","calendar","Calendar",EH);/**
203
- * @license @tabler/icons-react v3.35.0 - MIT
204
- *
205
- * This source code is licensed under the MIT license.
206
- * See the LICENSE file in the root directory of this source tree.
207
- */const TH=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],Po=Fe("outline","check","Check",TH);/**
208
- * @license @tabler/icons-react v3.35.0 - MIT
209
- *
210
- * This source code is licensed under the MIT license.
211
- * See the LICENSE file in the root directory of this source tree.
212
- */const RH=[["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"}]],_H=Fe("outline","checkbox","Checkbox",RH);/**
213
- * @license @tabler/icons-react v3.35.0 - MIT
214
- *
215
- * This source code is licensed under the MIT license.
216
- * See the LICENSE file in the root directory of this source tree.
217
- */const DH=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],zb=Fe("outline","chevron-down","ChevronDown",DH);/**
218
- * @license @tabler/icons-react v3.35.0 - MIT
219
- *
220
- * This source code is licensed under the MIT license.
221
- * See the LICENSE file in the root directory of this source tree.
222
- */const AH=[["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"}]],PH=Fe("outline","circle-check","CircleCheck",AH);/**
223
- * @license @tabler/icons-react v3.35.0 - MIT
224
- *
225
- * This source code is licensed under the MIT license.
226
- * See the LICENSE file in the root directory of this source tree.
227
- */const kH=[["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"}]],lp=Fe("outline","circle-minus","CircleMinus",kH);/**
228
- * @license @tabler/icons-react v3.35.0 - MIT
229
- *
230
- * This source code is licensed under the MIT license.
231
- * See the LICENSE file in the root directory of this source tree.
232
- */const NH=[["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"}]],cp=Fe("outline","circle-plus","CirclePlus",NH);/**
233
- * @license @tabler/icons-react v3.35.0 - MIT
234
- *
235
- * This source code is licensed under the MIT license.
236
- * See the LICENSE file in the root directory of this source tree.
237
- */const OH=[["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"}]],$b=Fe("outline","cloud-upload","CloudUpload",OH);/**
238
- * @license @tabler/icons-react v3.35.0 - MIT
239
- *
240
- * This source code is licensed under the MIT license.
241
- * See the LICENSE file in the root directory of this source tree.
242
- */const MH=[["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"}]],LH=Fe("outline","columns","Columns",MH);/**
243
- * @license @tabler/icons-react v3.35.0 - MIT
244
- *
245
- * This source code is licensed under the MIT license.
246
- * See the LICENSE file in the root directory of this source tree.
247
- */const IH=[["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"}]],Ub=Fe("outline","copy","Copy",IH);/**
248
- * @license @tabler/icons-react v3.35.0 - MIT
249
- *
250
- * This source code is licensed under the MIT license.
251
- * See the LICENSE file in the root directory of this source tree.
252
- */const zH=[["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"}]],$H=Fe("outline","currency-dollar","CurrencyDollar",zH);/**
253
- * @license @tabler/icons-react v3.35.0 - MIT
254
- *
255
- * This source code is licensed under the MIT license.
256
- * See the LICENSE file in the root directory of this source tree.
257
- */const UH=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],BH=Fe("outline","database","Database",UH);/**
258
- * @license @tabler/icons-react v3.35.0 - MIT
259
- *
260
- * This source code is licensed under the MIT license.
261
- * See the LICENSE file in the root directory of this source tree.
262
- */const VH=[["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"}]],FH=Fe("outline","device-floppy","DeviceFloppy",VH);/**
263
- * @license @tabler/icons-react v3.35.0 - MIT
264
- *
265
- * This source code is licensed under the MIT license.
266
- * See the LICENSE file in the root directory of this source tree.
267
- */const HH=[["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"}]],qH=Fe("outline","dots","Dots",HH);/**
268
- * @license @tabler/icons-react v3.35.0 - MIT
269
- *
270
- * This source code is licensed under the MIT license.
271
- * See the LICENSE file in the root directory of this source tree.
272
- */const GH=[["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"}]],IA=Fe("outline","edit","Edit",GH);/**
273
- * @license @tabler/icons-react v3.35.0 - MIT
274
- *
275
- * This source code is licensed under the MIT license.
276
- * See the LICENSE file in the root directory of this source tree.
277
- */const QH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],qd=Fe("outline","equal-not","EqualNot",QH);/**
278
- * @license @tabler/icons-react v3.35.0 - MIT
279
- *
280
- * This source code is licensed under the MIT license.
281
- * See the LICENSE file in the root directory of this source tree.
282
- */const WH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],Gd=Fe("outline","equal","Equal",WH);/**
283
- * @license @tabler/icons-react v3.35.0 - MIT
284
- *
285
- * This source code is licensed under the MIT license.
286
- * See the LICENSE file in the root directory of this source tree.
287
- */const YH=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],KH=Fe("outline","eye-off","EyeOff",YH);/**
288
- * @license @tabler/icons-react v3.35.0 - MIT
289
- *
290
- * This source code is licensed under the MIT license.
291
- * See the LICENSE file in the root directory of this source tree.
292
- */const XH=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],ZH=Fe("outline","eye","Eye",XH);/**
293
- * @license @tabler/icons-react v3.35.0 - MIT
294
- *
295
- * This source code is licensed under the MIT license.
296
- * See the LICENSE file in the root directory of this source tree.
297
- */const JH=[["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"}]],uT=Fe("outline","file-alert","FileAlert",JH);/**
298
- * @license @tabler/icons-react v3.35.0 - MIT
299
- *
300
- * This source code is licensed under the MIT license.
301
- * See the LICENSE file in the root directory of this source tree.
302
- */const eq=[["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"}]],tq=Fe("outline","file-plus","FilePlus",eq);/**
303
- * @license @tabler/icons-react v3.35.0 - MIT
304
- *
305
- * This source code is licensed under the MIT license.
306
- * See the LICENSE file in the root directory of this source tree.
307
- */const nq=[["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"}]],rq=Fe("outline","filter","Filter",nq);/**
308
- * @license @tabler/icons-react v3.35.0 - MIT
309
- *
310
- * This source code is licensed under the MIT license.
311
- * See the LICENSE file in the root directory of this source tree.
312
- */const iq=[["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"}]],oq=Fe("outline","forms","Forms",iq);/**
313
- * @license @tabler/icons-react v3.35.0 - MIT
314
- *
315
- * This source code is licensed under the MIT license.
316
- * See the LICENSE file in the root directory of this source tree.
317
- */const aq=[["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"}]],sq=Fe("outline","id","Id",aq);/**
318
- * @license @tabler/icons-react v3.35.0 - MIT
319
- *
320
- * This source code is licensed under the MIT license.
321
- * See the LICENSE file in the root directory of this source tree.
322
- */const lq=[["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"}]],dT=Fe("outline","list-details","ListDetails",lq);/**
323
- * @license @tabler/icons-react v3.35.0 - MIT
324
- *
325
- * This source code is licensed under the MIT license.
326
- * See the LICENSE file in the root directory of this source tree.
327
- */const cq=[["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"}]],uq=Fe("outline","lock-access","LockAccess",cq);/**
328
- * @license @tabler/icons-react v3.35.0 - MIT
329
- *
330
- * This source code is licensed under the MIT license.
331
- * See the LICENSE file in the root directory of this source tree.
332
- */const dq=[["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"}]],fq=Fe("outline","lock","Lock",dq);/**
333
- * @license @tabler/icons-react v3.35.0 - MIT
334
- *
335
- * This source code is licensed under the MIT license.
336
- * See the LICENSE file in the root directory of this source tree.
337
- */const hq=[["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"}]],pq=Fe("outline","logout","Logout",hq);/**
338
- * @license @tabler/icons-react v3.35.0 - MIT
339
- *
340
- * This source code is licensed under the MIT license.
341
- * See the LICENSE file in the root directory of this source tree.
342
- */const mq=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],zA=Fe("outline","math-greater","MathGreater",mq);/**
343
- * @license @tabler/icons-react v3.35.0 - MIT
344
- *
345
- * This source code is licensed under the MIT license.
346
- * See the LICENSE file in the root directory of this source tree.
347
- */const gq=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],$A=Fe("outline","math-lower","MathLower",gq);/**
348
- * @license @tabler/icons-react v3.35.0 - MIT
349
- *
350
- * This source code is licensed under the MIT license.
351
- * See the LICENSE file in the root directory of this source tree.
352
- */const vq=[["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"}]],yq=Fe("outline","message","Message",vq);/**
353
- * @license @tabler/icons-react v3.35.0 - MIT
354
- *
355
- * This source code is licensed under the MIT license.
356
- * See the LICENSE file in the root directory of this source tree.
357
- */const xq=[["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"}]],bq=Fe("outline","microscope","Microscope",xq);/**
358
- * @license @tabler/icons-react v3.35.0 - MIT
359
- *
360
- * This source code is licensed under the MIT license.
361
- * See the LICENSE file in the root directory of this source tree.
362
- */const Sq=[["path",{d:"M5 12l14 0",key:"svg-0"}]],wq=Fe("outline","minus","Minus",Sq);/**
363
- * @license @tabler/icons-react v3.35.0 - MIT
364
- *
365
- * This source code is licensed under the MIT license.
366
- * See the LICENSE file in the root directory of this source tree.
367
- */const jq=[["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"}]],Cq=Fe("outline","packages","Packages",jq);/**
368
- * @license @tabler/icons-react v3.35.0 - MIT
369
- *
370
- * This source code is licensed under the MIT license.
371
- * See the LICENSE file in the root directory of this source tree.
372
- */const Eq=[["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"}]],Tq=Fe("outline","pin","Pin",Eq);/**
373
- * @license @tabler/icons-react v3.35.0 - MIT
374
- *
375
- * This source code is licensed under the MIT license.
376
- * See the LICENSE file in the root directory of this source tree.
377
- */const Rq=[["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"}]],_q=Fe("outline","pinned-off","PinnedOff",Rq);/**
378
- * @license @tabler/icons-react v3.35.0 - MIT
379
- *
380
- * This source code is licensed under the MIT license.
381
- * See the LICENSE file in the root directory of this source tree.
382
- */const Dq=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],Aq=Fe("outline","player-play","PlayerPlay",Dq);/**
383
- * @license @tabler/icons-react v3.35.0 - MIT
384
- *
385
- * This source code is licensed under the MIT license.
386
- * See the LICENSE file in the root directory of this source tree.
387
- */const Pq=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],UA=Fe("outline","plus","Plus",Pq);/**
388
- * @license @tabler/icons-react v3.35.0 - MIT
389
- *
390
- * This source code is licensed under the MIT license.
391
- * See the LICENSE file in the root directory of this source tree.
392
- */const kq=[["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"}]],Nq=Fe("outline","receipt","Receipt",kq);/**
393
- * @license @tabler/icons-react v3.35.0 - MIT
394
- *
395
- * This source code is licensed under the MIT license.
396
- * See the LICENSE file in the root directory of this source tree.
397
- */const Oq=[["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"}]],BA=Fe("outline","refresh","Refresh",Oq);/**
398
- * @license @tabler/icons-react v3.35.0 - MIT
399
- *
400
- * This source code is licensed under the MIT license.
401
- * See the LICENSE file in the root directory of this source tree.
402
- */const Mq=[["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"}]],Lq=Fe("outline","repeat","Repeat",Mq);/**
403
- * @license @tabler/icons-react v3.35.0 - MIT
404
- *
405
- * This source code is licensed under the MIT license.
406
- * See the LICENSE file in the root directory of this source tree.
407
- */const Iq=[["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"}]],zq=Fe("outline","report-medical","ReportMedical",Iq);/**
408
- * @license @tabler/icons-react v3.35.0 - MIT
409
- *
410
- * This source code is licensed under the MIT license.
411
- * See the LICENSE file in the root directory of this source tree.
412
- */const $q=[["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"}]],Uq=Fe("outline","router","Router",$q);/**
413
- * @license @tabler/icons-react v3.35.0 - MIT
414
- *
415
- * This source code is licensed under the MIT license.
416
- * See the LICENSE file in the root directory of this source tree.
417
- */const Bq=[["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"}]],Vq=Fe("outline","search","Search",Bq);/**
418
- * @license @tabler/icons-react v3.35.0 - MIT
419
- *
420
- * This source code is licensed under the MIT license.
421
- * See the LICENSE file in the root directory of this source tree.
422
- */const Fq=[["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"}]],px=Fe("outline","settings","Settings",Fq);/**
423
- * @license @tabler/icons-react v3.35.0 - MIT
424
- *
425
- * This source code is licensed under the MIT license.
426
- * See the LICENSE file in the root directory of this source tree.
427
- */const Hq=[["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"}]],Bb=Fe("outline","sort-ascending","SortAscending",Hq);/**
428
- * @license @tabler/icons-react v3.35.0 - MIT
429
- *
430
- * This source code is licensed under the MIT license.
431
- * See the LICENSE file in the root directory of this source tree.
432
- */const qq=[["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"}]],Vb=Fe("outline","sort-descending","SortDescending",qq);/**
433
- * @license @tabler/icons-react v3.35.0 - MIT
434
- *
435
- * This source code is licensed under the MIT license.
436
- * See the LICENSE file in the root directory of this source tree.
437
- */const Gq=[["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"}]],Qq=Fe("outline","square","Square",Gq);/**
438
- * @license @tabler/icons-react v3.35.0 - MIT
439
- *
440
- * This source code is licensed under the MIT license.
441
- * See the LICENSE file in the root directory of this source tree.
442
- */const Wq=[["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"}]],Yq=Fe("outline","star","Star",Wq);/**
443
- * @license @tabler/icons-react v3.35.0 - MIT
444
- *
445
- * This source code is licensed under the MIT license.
446
- * See the LICENSE file in the root directory of this source tree.
447
- */const Kq=[["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"}]],Xq=Fe("outline","switch-horizontal","SwitchHorizontal",Kq);/**
448
- * @license @tabler/icons-react v3.35.0 - MIT
449
- *
450
- * This source code is licensed under the MIT license.
451
- * See the LICENSE file in the root directory of this source tree.
452
- */const Zq=[["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"}]],Jq=Fe("outline","table-export","TableExport",Zq);/**
453
- * @license @tabler/icons-react v3.35.0 - MIT
454
- *
455
- * This source code is licensed under the MIT license.
456
- * See the LICENSE file in the root directory of this source tree.
457
- */const eG=[["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"}]],tG=Fe("outline","text-recognition","TextRecognition",eG);/**
458
- * @license @tabler/icons-react v3.35.0 - MIT
459
- *
460
- * This source code is licensed under the MIT license.
461
- * See the LICENSE file in the root directory of this source tree.
462
- */const nG=[["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"}]],wm=Fe("outline","trash","Trash",nG);/**
463
- * @license @tabler/icons-react v3.35.0 - MIT
464
- *
465
- * This source code is licensed under the MIT license.
466
- * See the LICENSE file in the root directory of this source tree.
467
- */const rG=[["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"}]],fT=Fe("outline","upload","Upload",rG);/**
468
- * @license @tabler/icons-react v3.35.0 - MIT
469
- *
470
- * This source code is licensed under the MIT license.
471
- * See the LICENSE file in the root directory of this source tree.
472
- */const iG=[["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"}]],oG=Fe("outline","webhook","Webhook",iG);/**
473
- * @license @tabler/icons-react v3.35.0 - MIT
474
- *
475
- * This source code is licensed under the MIT license.
476
- * See the LICENSE file in the root directory of this source tree.
477
- */const aG=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],sl=Fe("outline","x","X",aG);/**
478
- * @license @tabler/icons-react v3.35.0 - MIT
479
- *
480
- * This source code is licensed under the MIT license.
481
- * See the LICENSE file in the root directory of this source tree.
482
- */const sG=[["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"}]],lG=Fe("filled","circle-filled","CircleFilled",sG);class VA extends v.Component{constructor(t){super(t),this.state={lastLocation:Xn.getLocation()}}static getDerivedStateFromError(t){return{error:t,lastLocation:Xn.getLocation()}}componentDidUpdate(t,n){Xn.getLocation()!==this.state.lastLocation&&this.setState({lastLocation:Xn.getLocation(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==Xn.getLocation())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(ya,{icon:a.jsx(bl,{size:16}),title:"Something went wrong",color:"red",children:Ye(this.state.error)}):this.props.children}}function Di(){return a.jsx(ar,{style:{width:"100%",height:"100vh"},children:a.jsx(Fr,{})})}const cG="_main_6f7o5_1",uG={main:cG};function cn(e){e.preventDefault(),e.stopPropagation()}function FA(e){return e.button===1||e.ctrlKey||e.metaKey}function HA(e){if(hT(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&hT(t[0]))return!0}return!1}function hT(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function id(e,t){return new Promise((n,r)=>{const o=new MessageChannel;o.port1.onmessage=({data:l})=>{o.port1.close(),l.error?r(l.error):n(l.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[o.port2])})}function qA(e,t){const n=new Blob([e],{type:ln.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const l=t??new Date().toISOString().replace(/\D/g,"");o.download=`${l}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function mt(e){const t=bm(),{to:n,suffix:r,label:o,onClick:l,children:c,...d}=e;let f=dG(n);return r&&(f+="/"+r),a.jsx(Dt,{href:f,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),l?(p.preventDefault(),l(p)):n&&(FA(p)||(p.preventDefault(),t(f)))},...d,children:c})}function dG(e){if(e){if(typeof e=="string")return fG(e);if(Ao(e))return hG(e);if(wa(e))return pG(e)}return"#"}function fG(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function hG(e){return`/${e.resourceType}/${e.id}`}function pG(e){return`/${e.reference}`}function mG(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 gs(e){const t=Gt(e.value),n=t?da(t):e.alt??"",r=mG(n),o=(t&&CU(t))??e.src,l=TA(o??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(mt,{to:t,children:a.jsx(nl,{src:l,alt:n,radius:c,...d,children:r})}):a.jsx(nl,{src:l,alt:n,radius:c,...d,children:r})}const gG="_logoButton_189g3_1",vG="_user_189g3_11",yG="_userName_189g3_21",xG="_userActive_189g3_31",wh={logoButton:gG,user:vG,userName:yG,userActive:xG};function Fb(e){const t=e.value;return t?a.jsx(a.Fragment,{children:Jc(t,e.options)}):null}function GA(){return"Medplum"}function bG(e){const t=xm(),{medplum:n,profile:r,navigate:o}=t,l=n.getLogins(),{colorScheme:c,setColorScheme:d}=Z4();return a.jsxs(a.Fragment,{children:[a.jsxs(Be,{align:"center",p:"xl",children:[a.jsx(gs,{size:"xl",radius:100,value:t.profile}),a.jsx(Fb,{value:t.profile?.name?.[0]}),a.jsx(Te,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),l.length>1&&a.jsx(je.Divider,{}),l.map(f=>f.profile.reference!==_t(t.profile)&&a.jsx(je.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>Xn.reload()).catch(console.log)},children:a.jsxs(ye,{children:[a.jsx(nl,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Te,{size:"sm",fw:500,children:f.profile.display}),a.jsx(Te,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(je.Divider,{}),a.jsx(ye,{justify:"center",children:a.jsx(Id,{size:"xs",value:c,onChange:f=>d(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Xq,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(je.Item,{leftSection:a.jsx(px,{size:14,stroke:1.5}),onClick:()=>o(`/${_t(r)}`),children:"Account settings"}),a.jsx(je.Item,{leftSection:a.jsx(pq,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsxs(Te,{size:"xs",c:"dimmed",my:"sm",ta:"center",children:[GA()," ",e.version]})]})}const pT={selectedItems:"selected-items",options:"options"};function Hb(e){const t=gl({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:l,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:x,onCreate:b,creatable:w,clearable:j,required:C,placeholder:T,leftSection:E,maxValues:R,optionsDropdownMaxHeight:D=320,minInputLength:P=0,...A}=e,k=A.disabled,M=SG(c),[$,U]=v.useState(""),[J,Z]=v.useState(),[Y,H]=v.useState(),[Q,O]=v.useState(),[I,z]=v.useState(M.map(d)),[F,K]=v.useState([]),L=p??wG,q=m??jG,ie=g??CG,xe=v.useRef($);xe.current=$;const ve=v.useRef(void 0),Ce=v.useRef(void 0),Oe=v.useRef(J);Oe.current=J;const Ee=v.useRef(Y);Ee.current=Y;const Ge=v.useRef(Q);Ge.current=Q;const it=v.useRef(F);it.current=F;const St=v.useCallback(()=>{if(Z(void 0),xe.current===Ce.current&&f===ve.current||(xe.current?.length??0)<P)return;Ce.current=xe.current,ve.current=f;const _e=new AbortController;H(_e),f(xe.current??"",_e.signal).then(ge=>{_e.signal.aborted||(K(ge.map(d)),Ge.current?(ge.length>0&&x(ge.slice(0,1)),O(!1)):ge.length>0&&t.openDropdown())}).catch(ge=>{_e.signal.aborted||ge.message.includes("aborted")||Ne({color:"red",message:Ye(ge)})}).finally(()=>{_e.signal.aborted||H(void 0)})},[t,f,x,d,P]),kt=v.useCallback(_e=>{(F&&F.length>0||w)&&t.openDropdown(),t.updateSelectedOptionIndex(),U(_e.currentTarget.value),Ee.current&&(Ee.current.abort(),H(void 0)),Oe.current!==void 0&&window.clearTimeout(Oe.current);const ge=window.setTimeout(()=>St(),100);Z(ge)},[t,F,w,St]),Mt=v.useCallback(_e=>{const ge=I.some(me=>me.value===_e),Se=ge?I.filter(me=>me.value!==_e):[...I];let He=F?.find(me=>me.value===_e);if(!He&&w!==!1&&b){const me=b(_e);He=d(me)}if(He){if(R===0){x([He.resource]),I.length>0&&z([]);return}ge||Se.push(He)}if(R!==void 0)for(;Se.length>R;)Se.shift();x(Se.map(me=>me.resource)),z(Se)},[w,F,I,R,x,b,d]),ct=v.useMemo(()=>{if(!k)return _e=>{k||(R===1&&(U(""),K([]),t.closeDropdown()),Ce.current=void 0,_e==="$create"?(U(""),Mt($)):Mt(_e))}},[Mt,t,k,R,$]),bt=v.useCallback(_e=>{const ge=I.filter(Se=>Se.value!==_e.value);x(ge.map(Se=>Se.resource)),z(ge)},[I,x]),Qt=v.useCallback(_e=>{_e.key==="Enter"?(J||Y)&&O(!0):_e.key==="Backspace"&&$.length===0&&(cn(_e),bt(I[I.length-1]))},[Y,bt,$.length,I,J]);v.useEffect(()=>()=>{Ee.current&&Ee.current.abort()},[]);const Ae=!k&&j&&I.length>0&&a.jsx(Xe.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{U(""),z([]),x([]),t.closeDropdown()}}),De=w&&$.trim().length>0,Ze=F.length>0||De;return a.jsxs(Xe,{store:t,onOptionSubmit:ct,withinPortal:!0,shadow:"xl",...A,children:[a.jsx(Xe.DropdownTarget,{children:a.jsx(ss,{label:r,description:o,error:l,className:e.className,leftSection:E,rightSection:Y?a.jsx(Fr,{size:16}):Ae,required:C,disabled:k,children:a.jsxs(la.Group,{"data-testid":pT.selectedItems,children:[I.map(_e=>a.jsx(q,{item:_e,disabled:k,onRemove:()=>bt(_e)},_e.value)),!k&&(R===void 0||R===0||I.length<R)&&a.jsx(Xe.EventsTarget,{children:a.jsx(ss.Field,{role:"searchbox",name:n,value:$,placeholder:T,onFocus:kt,onBlur:()=>{t.closeDropdown(),U("")},onKeyDown:Qt,onChange:kt})})]})})}),a.jsx(Xe.Dropdown,{hidden:!Ze,"data-testid":pT.options,children:a.jsx(Xe.Options,{children:a.jsxs(Ip,{type:"scroll",mah:D,children:[F.map(_e=>{const ge=I.some(Se=>Se.value===_e.value);return a.jsx(Xe.Option,{value:_e.value,active:ge,children:a.jsx(L,{..._e,active:ge})},_e.value)}),De&&a.jsxs(Xe.Option,{value:"$create",children:["+ Create ",$]}),!w&&$.trim().length>0&&F.length===0&&a.jsx(ie,{search:$})]})})})]})}function SG(e){return e?Array.isArray(e)?e:[e]:[]}function wG(e){return a.jsxs(ye,{gap:"xs",children:[e.active&&a.jsx(Po,{size:12}),a.jsx("span",{children:e.label})]})}function jG({item:e,disabled:t,onRemove:n}){return a.jsx(la,{withRemoveButton:!t,onRemove:n,children:e.label})}function CG(){return a.jsx(Xe.Empty,{children:"Nothing found"})}const EG="_searchInput_dick8_1",TG={searchInput:EG};function RG(e){return{value:e.id,label:da(e),resource:e}}function _G(e){const t=bm(),n=Re(),r=v.useCallback(async(l,c)=>{const d=AG(l),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return PG(p,l)},[n]),o=v.useCallback(l=>{l.length>0&&t(`/${_t(l[0])}`)},[t]);return a.jsx(Hb,{size:"sm",radius:"md",className:TG.searchInput,leftSection:a.jsx(Vq,{size:16}),placeholder:"Search",itemComponent:DG,toOption:RG,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const DG=v.forwardRef(({resource:e,active:t,...n},r)=>{let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(gs,{value:e}),a.jsxs("div",{children:[a.jsx(Te,{children:da(e)}),a.jsx(Te,{size:"xs",c:"dimmed",children:o})]})]})})});function AG(e){const t=JSON.stringify(e);return KD(e)?`{
483
- Patients1: PatientList(_id: ${t}, _count: 1) {
484
- resourceType
485
- id
486
- identifier {
487
- system
488
- value
489
- }
490
- name {
491
- given
492
- family
493
- }
494
- birthDate
495
- }
496
- ServiceRequestList(_id: ${t}, _count: 1) {
497
- resourceType
498
- id
499
- identifier {
500
- system
501
- value
502
- }
503
- subject {
504
- display
505
- }
506
- }
507
- }`.replace(/\s+/g," "):`{
508
- Patients1: PatientList(name: ${t}, _count: 5) {
509
- resourceType
510
- id
511
- identifier {
512
- system
513
- value
514
- }
515
- name {
516
- given
517
- family
518
- }
519
- birthDate
520
- }
521
- Patients2: PatientList(identifier: ${t}, _count: 5) {
522
- resourceType
523
- id
524
- identifier {
525
- system
526
- value
527
- }
528
- name {
529
- given
530
- family
531
- }
532
- birthDate
533
- }
534
- ServiceRequestList(identifier: ${t}, _count: 5) {
535
- resourceType
536
- id
537
- identifier {
538
- system
539
- value
540
- }
541
- subject {
542
- display
543
- }
544
- }
545
- }`.replace(/\s+/g," ")}function PG(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),NG(kG(n),t).slice(0,5)}function kG(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 NG(e,t){return e.sort((n,r)=>mT(r,t)-mT(n,t))}function mT(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,gT(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,gT(Jc(r),t));return n}function gT(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function OG(e){const t=Sm(),[n,r]=v.useState(!1);return a.jsx(Vr.Header,{p:8,style:{zIndex:101},children:a.jsxs(ye,{justify:"space-between",children:[a.jsxs(ye,{gap:"xs",children:[a.jsx(sr,{className:wh.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(_G,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(ye,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(je,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(je.Target,{children:a.jsx(sr,{className:Ot(wh.user,{[wh.userActive]:n}),onClick:()=>r(o=>!o),children:a.jsxs(ye,{gap:7,children:[a.jsx(gs,{value:t,radius:"xl",size:24}),a.jsx(Te,{size:"sm",className:wh.userName,children:Jc(t?.name?.[0])}),a.jsx(zb,{size:12,stroke:1.5})]})})}),a.jsx(je.Dropdown,{children:a.jsx(bG,{version:e.version})})]})]})]})})}const qb=v.createContext({submitting:!1});qb.displayName="FormContext";function MG(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?LG(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&IG(t,n);return t}function LG(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function IG(e,t){e[t.name]=t.value}function ut(e){const[t,n]=v.useState(!1);return a.jsx(qb.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=MG(r.target);if(e.onSubmit){n(!0);const l=e.onSubmit(o);l?.then?l.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function vr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(qb);return a.jsx(ke,{type:"submit",loading:r,...n,children:t})}function zG(e){const t=Re(),n=t.getUserConfiguration();function r(o){const{menuname:l,bookmarkname:c}=o,d=`${e.pathname}?${e.searchParams.toString()}`,f=ii(n);f.menu?.find(({title:m})=>m===l)?.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:Ye(m)})})}return a.jsx(Un,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(ut,{onSubmit:r,children:a.jsxs(Be,{children:[a.jsx($G,{config:n}),a.jsx(Ve,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vr,{mt:"sm",children:"OK"})})]})})})}function $G(e){function t(r){return r?.menu?.map(o=>o.title)}const n=t(e.config);return a.jsx(on,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function QA(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function UG(e){return typeof e.display=="string"?e.display:QA(e)}function BG(e){return{value:QA(e),label:UG(e),resource:e}}function VG(e){return{code:e,display:e}}function jm(e){const t=Re(),{binding:n,creatable:r,clearable:o,expandParams:l,withHelpText:c,...d}=e,f=v.useCallback(async(p,m)=>{if(!n)return[];const x=(await t.valueSetExpand({...l,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,l,n]);return a.jsx(Hb,{...d,creatable:r??!0,clearable:o??!0,toOption:BG,loadOptions:f,onCreate:VG,itemComponent:c?FG:void 0})}const FG=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ye,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(Po,{size:12}),a.jsxs("div",{children:[a.jsx(Te,{children:e}),a.jsx(Te,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function WA(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[l,c]=v.useState(t);function d(f){const p=f[0],m=qG(p);c(m),n&&n(m)}return a.jsx(jm,{defaultValue:HG(l),onChange:d,withHelpText:r??!0,...o})}function HG(e){return e?{code:e}:void 0}function qG(e){return e?.code}function Gb(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(l=>{n(l),r&&r(l)},[r]);return a.jsx(WA,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const GG="_menuTitle_9g6l5_1",QG="_link_9g6l5_9",WG="_linkActive_9g6l5_38",mx={menuTitle:GG,link:QG,linkActive:WG};function YG(e){const t=bm(),n=ZG(e.pathname,e.searchParams,e.menus),[r,o]=v.useState(!1);function l(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(Vr.Navbar,{children:a.jsxs(ai,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(Vr.Section,{mb:"sm",children:a.jsx(Gb,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>c(d)},window.location.pathname)}),a.jsxs(Vr.Section,{grow:!0,children:[e.menus?.map(d=>a.jsxs(v.Fragment,{children:[a.jsx(Te,{className:mx.menuTitle,children:d.title}),d.links?.map(f=>a.jsxs(KG,{to:f.href,active:f.href===n?.href,onClick:p=>l(p,f.href),children:[a.jsx(XG,{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(UA,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(zG,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function KG(e){return a.jsx(mt,{onClick:e.onClick,to:e.to,className:Ot(mx.link,{[mx.linkActive]:e.active}),children:e.children})}function XG(e){return e.icon?e.icon:a.jsx(cm,{w:30})}function ZG(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const l of n)if(l.links)for(const c of l.links){const d=JG(e,t,c.href);d>o&&(o=d,r=c)}return r}function JG(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!o.includes(c)&&t.get(c)!==d)return 0;let l=1;for(const[c,d]of t.entries())o.includes(c)||r.searchParams.get(c)===d&&l++;return l}function eQ(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=Re(),o=Sm();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 l(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){l(!1)}function d(){l(!t)}return r.isLoading()?a.jsx(Di,{}):a.jsxs(Vr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(OG,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:d,notifications:e.notifications}),o&&t?a.jsx(YG,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(Vr.Main,{className:uG.main,children:a.jsx(VA,{children:a.jsx(v.Suspense,{fallback:a.jsx(Di,{}),children:e.children})})})]})}const tQ="https://ccda.medplum.com",nQ="https://ccda-validator.medplum.com/";function rQ(e){const{url:t}=e,[n,r]=v.useState(!1),o=v.useRef(null),[l,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&o.current&&(id(o.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=`${nQ}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 T=await C.json();c(T)}catch(x){c(void 0),console.error("CCDA validation error:",x)}finally{f(!1)}},m=()=>{if(!l)return;const x=JSON.stringify(l,null,2);qA(x,"ccda-validation-results")},g=()=>l?l.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:o,src:tQ,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"}),l&&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 Qd(e){const{contentType:t,url:n,title:r}=e.value??{},o=TA(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,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:o})}),(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:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===ln.CDA_XML&&a.jsx(rQ,{url:o}),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:iQ(r),children:r||"Download"})})]}):null}function iQ(e){return e?.includes(".")?e:void 0}const oQ="_root_17n8t_1",aQ="_compact_17n8t_25",vT={root:oQ,compact:aQ};function Cm(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:Ot(vT.root,{[vT.compact]:n}),children:t})}function Ti(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function sQ(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(Qd,{value:r,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!Rn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(Ti,{term:ol(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function Qb(e){const t=Re(),n=v.useRef(null);function r(c){cn(c),n.current?.click()}function o(c){cn(c);const d=c.target.files;d&&Array.from(d).forEach(l)}function l(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(qt(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=>o(c)}),e.children({onClick:r,disabled:e.disabled})]})}function lQ(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function o(l){n(l),e.onChange&&e.onChange(l)}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((l,c)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Qd,{value:l,maxWidth:200})}),a.jsx("td",{children:a.jsx(bn,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{cn(d);const f=t.slice();f.splice(c,1),o(f)},children:a.jsx(lp,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(Qb,{disabled:e.disabled,onUpload:l=>{o([...r.current,l])},children:l=>a.jsx(bn,{...l,title:"Add",variant:"subtle",size:"sm",color:l.disabled?"gray":"green",children:a.jsx($b,{})})})})]})]})]})}function YA(e){const[t,n]=v.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Qd,{value:t,maxWidth:200}),a.jsx(ke,{disabled:e.disabled,onClick:o=>{cn(o),r(void 0)},children:"Remove"})]}):a.jsx(Qb,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(ke,{...o,children:"Upload..."})})}function Mi(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 180",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#9c36b5",d:"M84 56c-3-15-15-24-23-28l5-10c8 2 14 8 20 14 0-12 1-16 5-21 8-9 13-9 41-9 0 7 1 18-3 24-7 9-16 7-41 8 5 8 7 14 8 22 36-24 74-7 74 39 0 42-40 83-80 83s-80-41-80-83c0-46 38-63 74-39Zm-3 43H65c-4 0-7 3-7 7v4c0 4 3 7 7 7h16v16c0 4 3 7 7 7h4c4 0 7-3 7-7v-16h16c4 0 7-3 7-7v-4c0-4-3-7-7-7H99V83c0-4-3-7-7-7h-4c-4 0-7 3-7 7z"})]})}function up(e){const[t,n]=v.useState();return a.jsx(ut,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Ye(o)))},children:a.jsxs(Be,{children:[a.jsxs(ar,{style:{flexDirection:"column"},children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:e.title})]}),t&&a.jsx(ya,{icon:a.jsx(bl,{size:16}),title:"Error",color:"red",children:t}),e.qrCodeUrl&&a.jsxs(Be,{align:"center",children:[a.jsx(Te,{children:"Scan this QR code with your authenticator app."}),a.jsx("img",{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code"})]}),a.jsx(Be,{children:a.jsx(Ve,{name:"token",label:"MFA code",autoComplete:"one-time-code",required:!0,autoFocus:!0})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(vr,{children:e.buttonText})})]})})}const cQ="_root_1vii2_1",uQ={root:cQ};function eu(e){const{children:t,...n}=e;return a.jsx(kd,{className:uQ.root,...n,children:t})}const dQ="_paper_1igaj_1",fQ="_fill_1igaj_20",yT={paper:dQ,fill:fQ};function Sl(e){const{width:t,fill:n,className:r,children:o,...l}=e,c=t?{maxWidth:t}:void 0;return a.jsx(Tr,{className:Ot(yT.paper,n&&yT.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...l,children:o})}function lt(e){const{children:t,...n}=e;return a.jsx(eu,{children:a.jsx(Sl,{...n,children:t})})}function At(e,t){return e?.issue?.filter(n=>KA(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
546
- `)}function tu(e,t){return e?.issue?.filter(n=>KA(n.expression?.[0],t))}const jh=/\[\d+\]/;function KA(e,t){const n=typeof e=="string"&&jh.test(e),r=typeof t=="string"&&jh.test(t);if(n!==r&&(e=e?.replace(jh,""),t=t?.replace(jh,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const l=t.indexOf(".");return l>=0&&t.substring(l+1)===e}function XA(e){const t=Re(),[n,r]=v.useState();return a.jsxs(ut,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(l){r(qt(l))}},children:[a.jsxs(ar,{style:{flexDirection:"column"},children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Create project"})]}),a.jsxs(Be,{gap:"xl",children:[a.jsx(Ve,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:At(n,"projectName")}),a.jsxs(Te,{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(vr,{children:"Create project"})})]})}function ZA(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 JA(e){const t=Re(),{googleClientId:n,handleGoogleCredential:r}=e,o=v.useRef(null),[l,c]=v.useState(typeof google<"u"),[d,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){ZA("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),m(!0))},[t,n,d,l,o,p,r]),n?a.jsx("div",{ref:o}):null}function eP(e){if(e)return e;const t=Xn.getOrigin();if(t&&[].includes(t))return"__GOOGLE_CLIENT_ID__"}function yr(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx(ya,{icon:a.jsx(bl,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:OD(n)},n.details?.text))})}function tP(e){typeof grecaptcha>"u"&&ZA("https://www.google.com/recaptcha/api.js?render="+e)}function nP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function hQ(e){const t=eP(e.googleClientId),n=e.recaptchaSiteKey,r=Re(),[o,l]=v.useState(),c=tu(o,void 0);return v.useEffect(()=>{n&&tP(n)},[n]),a.jsxs(ut,{onSubmit:async d=>{l(void 0);try{let f="";n&&(f=await nP(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){l(qt(f))}},children:[a.jsx(ar,{style:{flexDirection:"column"},children:e.children}),a.jsx(yr,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(JA,{googleClientId:t,handleGoogleCredential:async d=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:d.clientId,googleCredential:d.credential,projectId:e.projectId,createUser:!0}))}catch(f){l(qt(f))}}})}),a.jsx(pn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Be,{gap:"xl",children:[a.jsx(Ve,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:At(o,"firstName")}),a.jsx(Ve,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:At(o,"lastName")}),a.jsx(Ve,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:At(o,"email")}),a.jsx(Qi,{name:"password",label:"Password",autoComplete:"off",required:!0,error:At(o,"password")}),a.jsxs(Te,{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(Te,{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(Pn,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(vr,{children:"Create account"})]})]})}function pQ(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:l,onSuccess:c}=e,d=Re(),[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(qt(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(hQ,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:l,handleAuthResponse:x,children:e.children}),f&&t==="project"&&a.jsx(XA,{login:f,handleAuthResponse:x})]})}function mQ(e){const[t,n]=v.useState();return t?a.jsx(vQ,{email:t,...e}):a.jsx(gQ,{setEmail:n,...e})}function gQ(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:l,...c}=e,d=Re(),f=!e.disableGoogleAuth&&eP(e.googleClientId),[p,m]=v.useState(),g=tu(p,void 0),x=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),T=new URL(j.authorizeUrl);return T.searchParams.set("state",C),Xn.assign(T.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(qt(C))}},[d,c,x,r]);return a.jsxs(ut,{onSubmit:b,children:[a.jsx(ar,{style:{flexDirection:"column"},children:o}),a.jsx(yr,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{justify:"center",p:"xl",style:{height:70},children:a.jsx(JA,{googleClientId:f,handleGoogleCredential:w})}),!l&&a.jsx(pn,{label:"or",labelPosition:"center",my:"lg"})]}),!l&&a.jsx(Ve,{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"})}),!l&&a.jsx(vr,{children:"Next"})]})]})}function vQ(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,l=Re(),[c,d]=v.useState(),f=tu(c,void 0),p=v.useCallback(m=>{l.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(qt(g)))},[l,o,n]);return a.jsxs(ut,{onSubmit:p,children:[a.jsx(ar,{style:{flexDirection:"column"},children:r}),a.jsx(yr,{issues:f}),a.jsx(Be,{gap:"xl",children:a.jsx(Qi,{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(Pn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(vr,{children:"Sign in"})]})]})}function yQ(e){const t=Re(),n=gl(),[r,o]=v.useState(""),[l,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(qt(x)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(Xe.Option,{value:g.id,children:a.jsx(xQ,{...g})},g.id));return a.jsxs(Be,{children:[a.jsxs(jo,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{order:3,children:"Choose profile"})]}),a.jsx(yr,{outcome:l}),a.jsxs(Xe,{store:n,onOptionSubmit:p,children:[a.jsx(Xe.EventsTarget,{children:a.jsx(Ve,{placeholder:"Search",value:r,onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Xe.Options,{children:m.length>0?m:a.jsx(Xe.Empty,{children:"Nothing found..."})})})]})]})}function xQ(e){return a.jsxs(ye,{children:[a.jsx(nl,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(Te,{fz:"sm",fw:500,children:e.profile?.display}),a.jsx(Te,{fz:"xs",opacity:.6,children:e.project?.display})]})]})}const bQ=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,SQ="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",wQ="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",jQ="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",CQ=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,EQ="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",TQ="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",RQ="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",_Q="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",DQ="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",AQ="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function PQ(e){const t=Re();return a.jsx(ut,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Be,{children:[a.jsxs(ar,{style:{flexDirection:"column"},children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Choose scope"})]}),a.jsx(Be,{children:(e.scope??"openid").split(" ").map(n=>{let r;return bQ.test(n)?r=[n+SQ,n+wQ,n+jQ]:CQ.test(n)&&(r=[n+EQ,n+TQ,n+RQ,n+_Q,n+DQ,n+AQ]),a.jsxs(a.Fragment,{children:[a.jsx(Pn,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx(Pn,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(vr,{children:"Set scope"})})]})})}function rP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:l,onCode:c,...d}=e,f=Re(),[p,m]=v.useState(),g=v.useRef(!1),[x,b]=v.useState(!1),[w,j]=v.useState(),[C,T]=v.useState(!1),[E,R]=v.useState(),D=v.useCallback(k=>{c?c(k):f.processCode(k).then(()=>{r&&r()}).catch(M=>Ne({color:"red",message:Ye(M)}))},[f,c,r]),P=v.useCallback(k=>{b(!!k.mfaEnrollRequired),j(k.enrollQrCode),T(!!k.mfaRequired),k.login&&m(k.login),k.memberships&&R(k.memberships),k.code&&(n?R(void 0):D(k.code))},[n,D]),A=v.useCallback(k=>{D(k.code)},[D]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(P).catch(k=>Ne({color:"red",message:Ye(k)})))},[f,t,g,p,P]),a.jsx(lt,{width:450,px:"sm",py:"md",children:p?x&&w?a.jsx(up,{title:"Enroll in MFA",buttonText:"Enroll",qrCodeUrl:w,onSubmit:async k=>{const M=await f.post("auth/mfa/login-enroll",{login:p,token:k.token});P(M)}}):C?a.jsx(up,{title:"Enter MFA code",buttonText:"Submit code",onSubmit:async k=>{const M=await f.post("auth/mfa/verify",{login:p,token:k.token});P(M)}}):E?a.jsx(yQ,{login:p,memberships:E,handleAuthResponse:P}):e.projectId==="new"?a.jsx(XA,{login:p,handleAuthResponse:P}):e.chooseScopes?a.jsx(PQ,{login:p,scope:e.scope,handleAuthResponse:A}):a.jsx("div",{children:"Success"}):a.jsx(mQ,{onForgotPassword:o,onRegister:l,handleAuthResponse:P,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function bo(e){return a.jsx(a.Fragment,{children:ls(e.value)})}function kQ(e){return a.jsx(a.Fragment,{children:Hd(e.value)})}function iP(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function NQ(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(iP,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function Em(e,t,n){const r=Lc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function OQ(e,t,n){const r=UD(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function MQ(e){const{elementDefinitionType:t}=e,n=Re(),r=v.useContext(an),[o,l]=v.useState(zD("Extension")),c=v.useMemo(()=>{if(Rn(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=Zc(c);f(!1),g&&l(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!vb(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,x]=Em({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx(Xi,{propertyType:x,value:g})}return a.jsx(fp,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function LQ(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function IQ(e){return a.jsx(a.Fragment,{children:XU(e.value)})}function vd(e){return a.jsx(a.Fragment,{children:Ks(e.value)})}function Wb(e){return a.jsx(a.Fragment,{children:md(e.value)})}function zQ(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(vd,{value:t.numerator})," / ",a.jsx(vd,{value:t.denominator})]}):null}function dp(e){if(!e.value)return null;const t=e.value.display||e.value.reference||Ki(e.value);return e.link!==!1&&e.value.reference?a.jsx(mt,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function oP(e,t,n,r){if(!Rn(n?.slices))return[e];const o=new Array(t.length+1);for(let l=0;l<o.length;l++)o[l]=[];for(const l of e){const c=wA(l,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),o[d].push(l)}return o}async function aP({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const o=[],l=[],c=[];for(const d of t.slicing.slices){if(!SA(d)){console.debug("Unsupported slice definition",d);continue}let f;Rn(d.elements)||(f=d.type[0]?.profile?.[0]),o.push(d),l.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<o.length;d++){const f=o[d],p=l[d];if(p){const m=Zc(p);f.typeSchema=m}}n(o)}).catch(r)})}function Tm(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function $Q(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(an),l=v.useMemo(()=>{if(Rn(r))return zc({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,e.path,t.typeSchema?.url,r]);return Tm(an.Provider,l,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx(Xi,{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 xT=50;function UQ(e){const{property:t,propertyType:n}=e,r=Re(),o=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[l,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[o]),[g,x]=v.useState(0),b=v.useContext(an);if(v.useEffect(()=>{aP({medplum:r,property:t}).then(C=>{x(o.length),f(C);const T=o.slice(0,xT),E=oP(T,C,t.slicing,b.profileUrl);m(E),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,o]),l)return a.jsx("div",{children:"Loading..."});let w;if(t.type[0]?.code!=="Extension"){const C=p[d.length],T=C.map((E,R)=>a.jsx("div",{children:a.jsx(Xi,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:E,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${R}-${C.length}`));if(e.includeDescriptionListEntry){if(!Rn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const E=e.path.split(".").pop();w=a.jsx(Ti,{term:ol(E),children:T})}else w=a.jsx(a.Fragment,{children:T})}return a.jsxs(a.Fragment,{children:[d.map((C,T)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=a.jsx($Q,{path:e.path,slice:C,property:t,value:p[T],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(E=a.jsx(Ti,{term:ol(C.name),children:E},C.name)),E}),w,g>xT&&a.jsx(ye,{justify:"right",children:a.jsxs(Te,{children:["... ",g," total values"]})})]})}function Xi(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(jo,{gap:3,align:"center",children:[r,!vn(r)&&a.jsx(L0,{value:r,timeout:2e3,children:({copied:l,copy:c})=>a.jsx(ca,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:l?"teal":"gray",onClick:c,children:l?a.jsx(Po,{size:"1rem"}):a.jsx(Ub,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?a.jsx(sQ,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(UQ,{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 e.property?.path?.toLowerCase().includes("secret")?a.jsx(BQ,{value:r}):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(dp,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return a.jsx(a.Fragment,{children:mr(r)});case re.markdown:return a.jsx("pre",{children:r});case re.Address:return a.jsx(KF,{value:r});case re.Annotation:return a.jsx(a.Fragment,{children:r?.text});case re.Attachment:return a.jsx(Qd,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return a.jsx(bo,{value:r});case re.Coding:return a.jsx(kQ,{value:r});case re.ContactDetail:return a.jsx(NQ,{value:r});case re.ContactPoint:return a.jsx(iP,{value:r});case re.HumanName:return a.jsx(Fb,{value:r});case re.Identifier:return a.jsx(LQ,{value:r});case re.Money:return a.jsx(IQ,{value:r});case re.Period:return a.jsx(a.Fragment,{children:GU(r)});case re.Quantity:case re.Duration:return a.jsx(vd,{value:r});case re.Range:return a.jsx(Wb,{value:r});case re.Ratio:return a.jsx(zQ,{value:r});case re.Reference:return a.jsx(dp,{value:r,link:e.link});case re.Timing:return a.jsx(a.Fragment,{children:rA(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(fp,{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(MQ,{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(fp,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function BQ(e){const[t,n]=v.useState(!1),r=e.value??"",o=!vn(r),l="•".repeat(8);return a.jsxs(jo,{gap:3,align:"center",children:[t?a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},"aria-hidden":"true",children:o?l:""}),o&&a.jsxs(a.Fragment,{children:[a.jsx(L0,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(ca,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:c?"teal":"gray",onClick:d,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(Po,{size:"1rem"}):a.jsx(Ub,{size:"1rem"})})})}),a.jsx(ca,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(bn,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(KH,{size:"1rem"}):a.jsx(ZH,{size:"1rem"})})})]})]})}const sP=["extension","modifierExtension"],VQ=MA.filter(e=>!sP.includes(e));function fp(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(an),l=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>dm(r,l),[l,r]),d=v.useMemo(()=>{if(c)return zc({parentContext:o,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,o,e.path,e.accessPolicyResource]);if(vn(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??o;return Tm(an.Provider,d,a.jsx(Cm,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if(sP.includes(p)&&vn(m.slicing?.slices))return null;if(VQ.includes(p))return null;if(LA.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,x]=Em(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&vn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,w=a.jsx(Xi,{property:m,propertyType:x,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?w:a.jsx(Ti,{term:ol(p),children:w},p)})}))}const FQ="_dimmed_11me5_1",HQ="_preserveBreaks_11me5_5",gx={dimmed:FQ,preserveBreaks:HQ},lP="Read Only";function cP(e,t){return e?a.jsx(ca.Floating,{label:e,children:t}):t}function uP(e){const{debugMode:t}=v.useContext(an);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,cP(e?.readonly?lP:void 0,a.jsxs(ye,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(un.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?gx.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Pt(e){const{debugMode:t}=v.useContext(an);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,cP(e?.readonly?lP:void 0,a.jsx(un.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Ot({[gx.dimmed]:e?.readonly},gx.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:At(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function qQ(e,t,n,r,o){const l=r.type;if(l.length>1)for(const c of l){const d=t.replace("[x]",$n(c.code));d in e&&delete e[d]}return vn(o)?e[n]=void 0:e[n]=o,e}function GQ(e){return!!e&&!vn(e.url)&&!vn(e.name)}function QQ(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:l,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const x=YQ(g);p(x),n&&n(x)}return a.jsx(jm,{defaultValue:f&&WQ(f),onChange:m,withHelpText:r??!0,...d})}function WQ(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function YQ(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function KQ(e){const{defaultValue:t,onChange:n,withHelpText:r,response:o,...l}=e,[c,d]=v.useState(o?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&ZQ(m);d(g),n&&n(g)}return a.jsx(jm,{defaultValue:c?XQ(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...l})}function XQ(e){return{system:e.system,code:e.code,display:e.display}}function ZQ(e){return{system:e.system,code:e.code,display:e.display}}function dP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=v.useContext(an),[l,c]=v.useState(e.defaultValue),d=v.useRef(l);d.current=l;const[f,p,m]=v.useMemo(()=>["system","use","value"].map(R=>r[t+"."+R]),[r,t]),[g,x,b]=v.useMemo(()=>["system","use","value"].map(R=>o(t+"."+R)),[o,t]);function w(R){R&&Object.keys(R).length===0&&(R=void 0),c(R),e.onChange&&e.onChange(R)}function j(R){const D={...d.current,system:R};R||delete D.system,w(D)}function C(R){const D={...d.current,use:R};R||delete D.use,w(D)}function T(R){const D={...d.current,value:R};R||delete D.value,w(D)}const E=e.valuePath??t;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(on,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:l?.system,required:(f?.min??0)>0,onChange:R=>j(R.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:At(n,E+".system")}),a.jsx(on,{disabled:e.disabled||x?.readonly,"data-testid":"use",defaultValue:l?.use,required:(p?.min??0)>0,onChange:R=>C(R.currentTarget.value),data:["","home","work","temp","old","mobile"],error:At(n,E+".use")}),a.jsx(Ve,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:l?.value,required:(m?.min??0)>0,onChange:R=>T(R.currentTarget.value),error:At(n,E+".value")})]})}function JQ(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(an),[l,c]=v.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,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(Ve,{disabled:e.disabled||l?.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(dP,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function eW(e){if(!e)return"";const t=new Date(e);return hm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function Yb(e){if(!e)return"";const t=new Date(e);return hm(t)?t.toISOString():""}function So(e){return a.jsx(Ve,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:tW(),step:1,defaultValue:eW(e.defaultValue),autoFocus:e.autoFocus,error:At(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(Yb(n))}}})}function tW(){return"datetime-local"}function nW(e){const{propertyType:t}=e,n=Re(),r=v.useMemo(()=>{if(Rn(t.profile))return t.profile[0]},[t]),[o,l]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(l(!0),n.requestProfileSchema(r).then(()=>l(!1)).catch(c=>{l(!1),console.warn(c)}))},[n,r]),r&&(o||!vb(r))?a.jsx("div",{children:"Loading..."}):a.jsx(Jb,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function rW(e){const{outcome:t,path:n}=e,[r,o]=v.useState(e.defaultValue),{getExtendedProps:l}=v.useContext(an),[c,d,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(E=>l(e.path+"."+E)),[l,e.path]);function g(E){o(E),e.onChange&&e.onChange(E)}function x(E){g({...r,use:E||void 0})}function b(E){g({...r,prefix:E?E.split(" "):void 0})}function w(E){g({...r,given:E?E.split(" "):void 0})}function j(E){g({...r,family:E||void 0})}function C(E){g({...r,suffix:E?E.split(" "):void 0})}const T=e.valuePath??n;return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(on,{disabled:e.disabled||c?.readonly,defaultValue:r?.use,name:e.name+"-use","data-testid":"use",onChange:E=>x(E.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:At(t,T+".use")}),a.jsx(Ve,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:E=>b(E.currentTarget.value),error:At(t,T+".prefix")}),a.jsx(Ve,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:E=>w(E.currentTarget.value),error:At(t,T+".given")}),a.jsx(Ve,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:E=>j(E.currentTarget.value),error:At(t,T+".family")}),a.jsx(Ve,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:E=>C(E.currentTarget.value),error:At(t,T+".suffix")})]})}function iW(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=v.useContext(an),[l,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[d,f]=v.useMemo(()=>["system","value"].map(g=>o(e.path+"."+g)),[o,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(Ve,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(l?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:At(e.outcome,m+".system")}),a.jsx(Ve,{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 oW=["USD","EUR","CAD","GBP","AUD"];function aW(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(an),[l,c]=v.useMemo(()=>["currency","value"].map(g=>o(e.path+"."+g)),[o,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(on,{disabled:e.disabled||l?.readonly,defaultValue:n?.currency,data:oW,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(Ve,{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($H,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function sW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(an),[o,l]=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(So,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(So,{disabled:e.disabled||l?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function ll(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(an),[o,l,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(on,{disabled:e.disabled||o?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(Ve,{disabled:e.disabled||l?.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:lW(f.currentTarget.value)})}}),a.jsx(Ve,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function lW(e){if(e)return parseFloat(e)}function Kb(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(an),[o,l]=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(ll,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(ll,{path:e.path+".high",disabled:e.disabled||l?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function cW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(an),[o,l]=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(ll,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(ll,{path:e.path+".denominator",disabled:e.disabled||l?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const uW={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},dW=["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 fW(e){return{value:_t(e)??"",label:da(e),resource:e}}function wl(e){const t=Re(),{resourceType:n,searchCriteria:r}=e,[o,l]=v.useState(),c=Gt(e.defaultValue,l),d=e.itemComponent??hW,f=e.onChange,p=v.useCallback(async(g,x)=>{const b=pW(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 Rn(e.defaultValue)&&!o&&!c?null:a.jsx(Hb,{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:fW,loadOptions:p,onChange:m,clearable:!0})}const hW=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(ye,{wrap:"nowrap",children:[a.jsx(gs,{value:t}),a.jsxs("div",{children:[a.jsx(Te,{children:e}),a.jsx(Te,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function pW(e){return uW[e]??(dW.includes(e)?"name":"_id")}function os(e){const{onChange:t}=e,n=Re(),[r,o]=v.useState(e.defaultValue),[l,c]=v.useState(()=>mW(e.targetTypes)),[d,f]=v.useState(()=>gW(e.defaultValue,l)),p=v.useRef(new AD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const w=l?.map(j=>{if(!yW(j))return Promise.resolve(j);b=!0;const C=j.value,T=p.current.get(C);if(T)return T;const E=vW(n,j.value).then(D=>{const P={...j};return D?Rn(D.type)?(P.resourceType=D.type,P.name=D.name,P.title=D.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(D=>(console.error(D),{...j,error:D})),R=new Fi(E);return p.current.set(C,R),R});!w||!b||Promise.all(w).then(j=>{if(c(j),!d)return;const C=j.findIndex(T=>T.value===d.value||T.resourceType===d.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${d.resourceType}`);return}f(j[C])}).catch(console.error)},[n,d,l]);const g=v.useCallback(b=>{const w=b?Ht(b):void 0;o(w),t&&t(w)},[t]),x=v.useMemo(()=>l?l.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[l]);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:[l&&l.length>1&&a.jsx(on,{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=l.find(C=>C.value===w);f(j)},data:x}),!l&&a.jsx(Gb,{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(wl,{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 gW(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(o=>o.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function vW(e,t){const n=Zc(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
547
- StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
548
- type,
549
- name,
550
- title,
551
- }
552
- }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function yW(e){return e.type==="profile"&&!e?.error&&vn(e.resourceType)}function xW(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const bW="_indented_ldk1d_1",fP={indented:bW};function Xb({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(cp,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(bn,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(cp,{size:"1.25rem"})})}function hP({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(bn,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(lp,{size:"1.25rem"})})}function SW(e){const{slice:t,property:n}=e,[r,o]=v.useState(e.defaultValue),l=t.typeSchema?.elements??t.elements,c=v.useContext(an),d=v.useMemo(()=>{if(Rn(l))return zc({parentContext:c,elements:l,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,l]);function f(b){o(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=vn(t.elements),g=aA(t.name),x=e.property.readonly&&r.length===0;return Tm(an.Provider,d,a.jsx(Pt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:x?a.jsx(Te,{c:"dimmed",children:"(empty)"}):a.jsxs(Be,{className:m?fP.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(Zb,{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(hP,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${w}`,onClick:j=>{cn(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(Xb,{propertyDisplayName:g,onClick:b=>{cn(b);const w=[...r,void 0];f(w)},testId:e.testId&&`${e.testId}-add`})})]})}))}function wW(e){const{property:t}=e,n=Re(),[r,o]=v.useState(!0),[l,c]=v.useState([]),[d]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[d]),m=v.useContext(an),g=t.type[0]?.code;v.useEffect(()=>{aP({medplum:n,property:t}).then(E=>{c(E);const R=oP(d,E,t.slicing,m.profileUrl);jW(R,E),p(R),o(!1)}).catch(E=>{console.error(E),o(!1)})},[n,t,d,m.profileUrl,p]);function x(E,R){const D=[...f];if(D[R]=E,p(D),e.onChange){const P=D.flat().filter(A=>A!==void 0);e.onChange(P)}}if(r)return a.jsx("div",{children:"Loading..."});const b=l.length,w=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&l.length>0)),C=ol(t.path),T=e.property.readonly&&l.length===0&&d.length===0;return a.jsxs(Be,{className:e.indent?fP.indented:void 0,children:[T&&a.jsx(Te,{c:"dimmed",children:"(empty)"}),l.map((E,R)=>a.jsx(SW,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[R],onChange:D=>{x(D,R)},testId:`slice-${E.name}`},E.name)),j&&w.map((E,R)=>a.jsxs(ye,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Wd,{arrayElement:!0,property:e.property,name:e.name+"."+R,path:e.path,valuePath:xW(e.path,e.valuePath,R),defaultValue:E,onChange:D=>{const P=[...w];P[R]=D,x(P,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(hP,{propertyDisplayName:C,testId:`nonsliced-remove-${R}`,onClick:D=>{cn(D);const P=[...w];P.splice(R,1),x(P,b)}})]},`${R}-${w.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(ye,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(Xb,{propertyDisplayName:C,onClick:E=>{cn(E);const R=[...w];R.push(void 0),x(R,b)},testId:"nonsliced-add"})})]})}function jW(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function CW(e){const[t,n]=v.useState(!1),r=UR(),o=v.useRef(null),l={...e.styles};return t||(l.input||(l.input={}),l.input.WebkitTextSecurity="disc"),a.jsxs(jo,{gap:"xs",children:[a.jsx(vl,{...e,styles:{...l,root:{...l.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(bn,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),Ne({color:"green",message:"Copied"})},children:a.jsx(Ub,{})})]})}const EW=["sun","mon","tue","wed","thu","fri","sat"];function TW(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),l=v.useRef(t);return l.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:rA(l.current)||"No repeat"}),a.jsx(ke,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(RW,{path:e.path,visible:r,defaultValue:l.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),o(!1)},onCancel:()=>o(!1)})]})}const bT={repeat:{period:1,periodUnit:"d"}};function RW(e){const[t,n]=v.useState(e.defaultValue||bT),{getExtendedProps:r}=v.useContext(an),[o,l,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(Un,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Be,{children:[a.jsx(Pt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(So,{disabled:o?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(zd,{disabled:l?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?bT.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(Pt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Ve,{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(on,{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(Pt,{title:"Repeat on",children:a.jsx(ud.Group,{multiple:!0,onChange:w,children:a.jsx(ye,{justify:"space-between",mt:"md",gap:"xs",children:EW.map(j=>a.jsx(ud,{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 Wd(e){const{property:t,name:n,onChange:r,defaultValue:o}=e,l=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(l===re.Attachment)return a.jsx(lQ,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=c[0]?.code!==re.Extension;return a.jsx(wW,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(_W,{elementDefinitionTypes:c,...e}):a.jsx(Zb,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",$n(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 _W(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(l=>l.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=v.useState(n);return a.jsxs(ye,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(on,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:l=>{o(t.find(c=>c.code===l.currentTarget.value))},data:t.map(l=>({value:l.code,label:l.code}))}),a.jsx(Zb,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:l=>{e.onChange&&e.onChange(l,e.name.replace("[x]",$n(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function Zb(e){const{name:t,onChange:n,outcome:r,binding:o,path:l,valuePath:c,readOnly:d}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(an),g=v.useMemo(()=>{if(!Sb(p)||!vn(e.defaultValue))return e.defaultValue;const w=Object.create(null);if(m.path===e.path)rT(w,m.elements);else{const j=Ys(m.path,e.path);if(j===void 0)return e.defaultValue;rT(w,m.elements,j)}return Rn(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:l,valuePath:c,disabled:d}}function b(){const w=At(e.outcome,c??l);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(CW,{...b(),onChange:w=>{e.onChange&&e.onChange(w.currentTarget.value)}}):a.jsx(Ve,{...b(),onChange:w=>{n&&n(w.currentTarget.value)}});case re.date:return a.jsx(Ve,{...b(),type:"date",onChange:w=>{n&&n(w.currentTarget.value)}});case re.dateTime:case re.instant:return a.jsx(So,{...b(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return a.jsx(Ve,{...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(WA,{...b(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case re.boolean:return a.jsx(Pn,{...b(),defaultChecked:!!g,onChange:w=>{n&&n(w.currentTarget.checked)}});case re.base64Binary:case re.markdown:return a.jsx(vl,{...b(),spellCheck:p!==re.base64Binary,onChange:w=>{n&&n(w.currentTarget.value)}});case re.Address:return a.jsx(JF,{...x()});case re.Annotation:return a.jsx(eH,{...x()});case re.Attachment:return a.jsx(YA,{...x()});case re.CodeableConcept:return a.jsx(QQ,{binding:o?.valueSet,...x()});case re.Coding:return a.jsx(KQ,{binding:o?.valueSet,...x()});case re.ContactDetail:return a.jsx(JQ,{...x()});case re.ContactPoint:return a.jsx(dP,{...x()});case re.Extension:return a.jsx(nW,{...x(),propertyType:e.elementDefinitionType});case re.HumanName:return a.jsx(rW,{...x()});case re.Identifier:return a.jsx(iW,{...x()});case re.Money:return a.jsx(aW,{...x()});case re.Period:return a.jsx(sW,{...x()});case re.Duration:case re.Quantity:return a.jsx(ll,{...x()});case re.Range:return a.jsx(Kb,{...x()});case re.Ratio:return a.jsx(cW,{...x()});case re.Reference:return a.jsx(os,{...x(),targetTypes:AW(e.elementDefinitionType)});case re.Timing:return a.jsx(TW,{...x()});case re.Dosage:case re.UsageContext:default:return a.jsx(Jb,{...x(),typeName:p})}}const DW=[`${Ji}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function AW(e){return e?.targetProfile?.map(t=>{const n=DW.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function PW(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(an),o=v.useMemo(()=>ZF(r.elements),[r.elements]);function l(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Be,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([d,f])=>{const[p,m]=OQ(c,d,f),g=f.min!==void 0&&f.min>0,x=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(Wd,{property:f,name:d,path:e.path+"."+d,valuePath:x,defaultValue:p,defaultPropertyType:m,onChange:(w,j)=>{l(qQ({...t},d,j??d,f,w))},outcome:e.outcome},d);return e.type==="Extension"||Ib.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(uP,{title:ol(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx(Pt,{title:ol(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:x,readonly:f.readonly,children:b},d)})})}function Jb(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(an),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>dm(e.typeName,r),[e.typeName,r]),l=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return zc({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?Tm(an.Provider,c,a.jsx(PW,{path:e.path,valuePath:e.valuePath,type:l,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[l," not implemented"]})}const kW="_noteCite_10swh_5",NW="_noteRoot_10swh_10",ST={noteCite:kW,noteRoot:NW};function pP({value:e}){return e?a.jsx(Be,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(N0,{classNames:{cite:ST.noteCite,root:ST.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function jl(e){const{value:t,link:n,...r}=e,[o,l]=v.useState(),c=Gt(t,l);let d;if(o&&!kD(o))d=`[${Ye(o)}]`;else if(c)d=da(c);else return null;return n?a.jsx(mt,{to:t,...r,children:d}):a.jsx(Te,{component:"span",...r,children:d})}function Tc(e){return a.jsxs(ye,{gap:"xs",children:[a.jsx(gs,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(jl,{value:e.value,link:e.link})]})}const OW={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 Rm(e){const{status:t,...n}=e;return a.jsx(Hp,{color:e.color||OW[t],...n,children:t.replace(/-/g," ")})}const MW="_table_pe9td_1",LW="_criticalRow_pe9td_12",mP={table:MW,criticalRow:LW};eS.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function eS(e){const t=Re(),n=Gt(e.value),[r,o]=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(o).catch(console.error)},[t,n]),!n)return null;const l=r?.flatMap(c=>c.note||[])||[];if(n.presentedForm&&n.presentedForm.length>0){const c=n.presentedForm[0];c.contentType?.startsWith("text/plain")&&c.data&&l.push({text:window.atob(c.data)})}return a.jsxs(Be,{children:[a.jsx(Ie,{children:"Diagnostic Report"}),a.jsx(IW,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&zW(r),n.result&&a.jsx($W,{hideObservationNotes:e.hideObservationNotes,value:n.result}),l.length>0&&a.jsx(pP,{value:l})]})}function IW({value:e,hideSubject:t=!1}){return a.jsxs(ye,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(Te,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(Tc,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(Te,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(Tc,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(Te,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(Tc,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(Te,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(Te,{children:mr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(Te,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(Rm,{status:e.status})]})]})}function zW(e){return a.jsxs(Be,{gap:"xs",children:[a.jsx(Ie,{order:2,size:"h6",children:"Specimens"}),a.jsx(Er,{type:"ordered",children:e?.map(t=>a.jsx(Er.Item,{ml:"sm",children:a.jsxs(ye,{gap:20,children:[a.jsxs(ye,{gap:5,children:[a.jsx(Te,{fw:500,children:"Collected:"})," ",mr(t.collection?.collectedDateTime)]}),a.jsxs(ye,{gap:5,children:[a.jsx(Te,{fw:500,children:"Received:"})," ",mr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function $W(e){return a.jsxs("table",{className:mP.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(gP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function gP(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(UW,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${wa(t)?t.reference:t.id}`))})}function UW(e){const t=Gt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=FW(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:Ot({[mP.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(mt,{to:t,children:a.jsx(bo,{value:t.code})})}),a.jsx("td",{children:a.jsx(BW,{value:t})}),a.jsx("td",{children:a.jsx(VW,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(bo,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(o=>a.jsx("div",{children:a.jsx(bo,{value:o})},`category-${ls(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx(dp,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(Rm,{status:t.status})})]}),t.hasMember&&a.jsx(gP,{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(pP,{value:t.note})})})]})}function BW(e){const t=e.value;return a.jsx(a.Fragment,{children:iA(t)})}function VW(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(Wb,{value:t}):null}function FW(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var wy={},ea={},wT;function vP(){if(wT)return ea;wT=1,Object.defineProperty(ea,"__esModule",{value:!0}),ea.Pointer=ea.escapeToken=ea.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}ea.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}ea.escapeToken=t;var n=(function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var l=o.split("/").map(e);if(l[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(l)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var l=null,c="",d=o,f=1,p=this.tokens.length;f<p;f++)l=d,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(d=(l||{})[c]);return{parent:l,key:c,value:d}},r.prototype.get=function(o){return this.evaluate(o).value},r.prototype.set=function(o,l){var c=this.evaluate(o);c.parent&&(c.parent[c.key]=l)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var l=this.tokens.concat(String(o));return new r(l)},r})();return ea.Pointer=n,ea}var hn={},jy={},jT;function yP(){return jT||(jT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var l=o.length,c=new Array(l),d=0;d<l;d++)c[d]=r(o[d]);return c}if(o.constructor==Date){var f=new Date(+o);return f}var p={};for(var m in o)e.hasOwnProperty.call(o,m)&&(p[m]=r(o[m]));return p}e.clone=r})(jy)),jy}var jr={},CT;function xP(){if(CT)return jr;CT=1,Object.defineProperty(jr,"__esModule",{value:!0}),jr.diffAny=jr.diffObjects=jr.diffArrays=jr.intersection=jr.subtract=jr.isDestructive=void 0;var e=yP();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}jr.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)}jr.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)}jr.intersection=r;function o(m){return m.op==="add"}function l(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(D,P){var A="".concat(D,",").concat(P),k=w[A];if(k===void 0){if(D>0&&P>0&&!b(m[D-1],g[P-1],x.add(String(D-1))).length)k=j(D-1,P-1);else{var M=[];if(D>0){var $=j(D-1,P),U={op:"remove",index:D-1};M.push(c($,U))}if(P>0){var J=j(D,P-1),Z={op:"add",index:D-1,value:g[P-1]};M.push(c(J,Z))}if(D>0&&P>0){var Y=j(D-1,P-1),H={op:"replace",index:D-1,original:m[D-1],value:g[P-1]};M.push(c(Y,H))}var Q=M.sort(function(O,I){return O.cost-I.cost})[0];k=Q}w[A]=k}return k}var C=isNaN(m.length)||m.length<=0?0:m.length,T=isNaN(g.length)||g.length<=0?0:g.length,E=j(C,T).operations,R=E.reduce(function(D,P){var A=D[0],k=D[1];if(o(P)){var M=P.index+1+k,$=M<C+k?String(M):"-",U={op:P.op,path:x.add($).toString(),value:P.value};return[A.concat(U),k+1]}else if(l(P)){var U={op:P.op,path:x.add(String(P.index+k)).toString()};return[A.concat(U),k-1]}else{var J=x.add(String(P.index+k)),Z=b(P.original,P.value,J);return[A.concat.apply(A,Z),k]}},[[],0])[0];return R}jr.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}jr.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 jr.diffAny=p,jr}var ET;function HW(){if(ET)return hn;ET=1;var e=hn&&hn.__extends||(function(){var C=function(T,E){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,D){R.__proto__=D}||function(R,D){for(var P in D)Object.prototype.hasOwnProperty.call(D,P)&&(R[P]=D[P])},C(T,E)};return function(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");C(T,E);function R(){this.constructor=T}T.prototype=E===null?Object.create(E):(R.prototype=E.prototype,new R)}})();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=vP(),n=yP(),r=xP(),o=(function(C){e(T,C);function T(E){var R=C.call(this,"Value required at path: ".concat(E))||this;return R.path=E,R.name="MissingError",R}return T})(Error);hn.MissingError=o;var l=(function(C){e(T,C);function T(E,R){var D=C.call(this,"Test failed: ".concat(E," != ").concat(R))||this;return D.actual=E,D.expected=R,D.name="TestError",D}return T})(Error);hn.TestError=l;function c(C,T,E){if(Array.isArray(C))if(T=="-")C.push(E);else{var R=parseInt(T,10);C.splice(R,0,E)}else C[T]=E}function d(C,T){if(Array.isArray(C)){var E=parseInt(T,10);C.splice(E,1)}else delete C[T]}function f(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new o(T.path):(c(E.parent,E.key,(0,n.clone)(T.value)),null)}hn.add=f;function p(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.value===void 0?new o(T.path):(d(E.parent,E.key),null)}hn.remove=p;function m(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);if(E.parent===null)return new o(T.path);if(Array.isArray(E.parent)){if(parseInt(E.key,10)>=E.parent.length)return new o(T.path)}else if(E.value===void 0)return new o(T.path);return E.parent[E.key]=(0,n.clone)(T.value),null}hn.replace=m;function g(C,T){var E=t.Pointer.fromJSON(T.from).evaluate(C);if(E.value===void 0)return new o(T.from);var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new o(T.path):(d(E.parent,E.key),c(R.parent,R.key,E.value),null)}hn.move=g;function x(C,T){var E=t.Pointer.fromJSON(T.from).evaluate(C);if(E.value===void 0)return new o(T.from);var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new o(T.path):(c(R.parent,R.key,(0,n.clone)(E.value)),null)}hn.copy=x;function b(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(E.value,T.value,new t.Pointer).length?new l(E.value,T.value):null}hn.test=b;var w=(function(C){e(T,C);function T(E){var R=C.call(this,"Invalid operation: ".concat(E.op))||this;return R.operation=E,R.name="InvalidOperationError",R}return T})(Error);hn.InvalidOperationError=w;function j(C,T){switch(T.op){case"add":return f(C,T);case"remove":return p(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return x(C,T);case"test":return b(C,T)}return new w(T)}return hn.apply=j,hn}var TT;function qW(){return TT||(TT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=vP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=HW(),r=xP();function o(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=o;function l(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?l(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})(wy)),wy}var bP=qW();const GW="_removed_el5zk_1",QW="_added_el5zk_6",RT={removed:GW,added:QW};function WW(e){const{name:t,path:n,property:r,originalValue:o,revisedValue:l}=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(fe.Tr,{children:[a.jsx(fe.Td,{children:t}),a.jsx(fe.Td,{className:RT.removed,children:o&&a.jsx(Xi,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(fe.Td,{className:RT.added,children:l&&a.jsx(Xi,{path:n,property:r,propertyType:l.type,value:l.value,ignoreMissingValues:!0})})]})}):a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:t}),a.jsx(fe.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(ke,{onClick:p,variant:"light",children:"Expand"})})]})})}const YW="_root_15xvr_1",KW={root:YW};function XW(e){const t=Re(),{original:n,revised:r}=e,[o,l]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>l(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!o)return null;const d=[ri(n)],f=[ri(r)],p=[],m=ZW(bP.createPatch(n,r));for(const g of m){const x=g.path,b=JW(x),w=eY(n.resourceType,b),j=g.op==="add"?void 0:cs(b,d),C=g.op==="remove"?void 0:cs(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${$n(g.op)} ${b}`,path:w?.path??n.resourceType+"."+b,property:w,originalValue:_T(w,j),revisedValue:_T(w,C)})}return p},[o,n,r]);return c?a.jsxs(fe,{className:KW.root,children:[a.jsx(fe.Thead,{children:a.jsxs(fe.Tr,{children:[a.jsx(fe.Th,{}),a.jsx(fe.Th,{children:"Before"}),a.jsx(fe.Th,{children:"After"})]})}),a.jsx(fe.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(WW,{...p},f)})})]}):null}function ZW(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const l=e.filter(d=>d.op===r&&d.path===o).length,c={op:r,path:o};l>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(c.op="replace",c.path=o.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function JW(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function eY(e,t){try{return ym(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}catch(n){console.warn("Failed to get element definition",{resourceType:e,fhirPath:t,err:n});return}}function _T(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:tY(t,!!e?.isArray)}}function tY(e,t){const n=zU(e).flatMap(r=>r.value);return t?n:n[0]}function tS(e){const{profileUrl:t}=e,n=Re(),r=n.getAccessPolicy(),o=Gt(e.value),[l,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Zc(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=o.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,o]);const d=v.useMemo(()=>o&&dA(o,Xs.READ,r),[r,o]);return!l||!o?null:a.jsx(fp,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const nY="_item_5q6yx_1",rY="_itemPadding_5q6yx_5",DT={item:nY,itemPadding:rY};function iY(e){return a.jsx(eu,{children:e.children})}function cl(e){const{resource:t,profile:n,padding:r,popupMenuItems:o,...l}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs(Sl,{"data-testid":"timeline-item",fill:!0,...l,children:[a.jsxs(ye,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(gs,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Te,{size:"sm",children:a.jsx(jl,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(Te,{size:"xs",children:[a.jsx(mt,{c:"dimmed",to:e.resource,children:mr(d)}),a.jsx(Te,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(mt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(je,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(je.Target,{children:a.jsx(bn,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${_t(e.resource)}`,children:a.jsx(qH,{})})}),o]})]}),a.jsx(VA,{children:a.jsx("div",{className:Ot(DT.item,{[DT.itemPadding]:r}),children:e.children})})]})}function SP(e,t){e.sort((n,r)=>{const o=AT(n,t),l=AT(r,t);return o>l?1:o<l?-1:PT(n,t)-PT(r,t)})}function AT(e,t){if(!wP(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function PT(e,t){if(!wP(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 wP(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const oY="_pinnedComment_u08s5_1",aY={pinnedComment:oY};function _m(e){const t=Re(),n=t.getProfile(),r=v.useRef(null),o=Gt(e.value),[l,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(k=>{SP(k,o),k.reverse(),f(k)},[o]),w=v.useCallback(k=>{const M=[];for(const $ of k){if($.status!=="fulfilled")continue;const U=$.value;if(U.type==="history"&&c(U),U.entry)for(const J of U.entry)M.push(J.resource)}b(M)},[b]),j=v.useCallback(k=>b([...x.current,k]),[b]),C=v.useCallback(()=>{let k,M;"resourceType"in e.value?(k=e.value.resourceType,M=e.value.id):[k,M]=e.value.reference?.split("/"),g(t,k,M).then(w).catch(console.error)},[t,e.value,g,w]);v.useEffect(()=>C(),[C]);function T(k){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,k)).then(M=>j(M)).catch(console.error)}function E(k){!o||!e.createMedia||t.createResource(e.createMedia(o,n,k)).then(M=>j(M)).then(()=>Qs({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(Po,{size:16}),autoClose:2e3})).catch(M=>Qs({id:"upload-notification",color:"red",title:"Upload error",message:Ye(M),icon:a.jsx(uT,{size:16}),autoClose:2e3}))}function R(){Ne({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function D(k){Qs({id:"upload-notification",loading:!0,title:"Uploading...",message:hY(k),autoClose:!1,withCloseButton:!1})}function P(k){Qs({id:"upload-notification",color:"red",title:"Upload error",message:Ye(k),icon:a.jsx(uT,{size:16}),autoClose:2e3})}if(!o)return a.jsx(ar,{style:{width:"100%",height:"100%"},children:a.jsx(Fr,{})});const A=d.filter(k=>k).slice(0,p);return a.jsxs(iY,{children:[e.createCommunication&&a.jsx(Sl,{children:a.jsx(ut,{testid:"timeline-form",onSubmit:k=>{T(k.text);const M=r.current;M&&(M.value="",M.focus())},children:a.jsxs(ye,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(gs,{value:n}),a.jsx(Ve,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(bn,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(yq,{size:16})}),a.jsx(Qb,{securityContext:Ht(o),onUpload:E,onUploadStart:R,onUploadProgress:D,onUploadError:P,children:k=>a.jsx(bn,{...k,radius:"xl",color:"blue",variant:"filled",children:a.jsx($b,{size:16})})})]})})}),A.map(k=>{const M=`${k.resourceType}/${k.id}/${k.meta?.versionId}`,$=e.getMenu?e.getMenu({primaryResource:o,currentResource:k,reloadTimeline:C}):void 0;if(k.resourceType===o.resourceType&&k.id===o.id)return a.jsx(sY,{history:l,resource:k,popupMenuItems:$},M);switch(k.resourceType){case"AuditEvent":return a.jsx(dY,{resource:k,popupMenuItems:$},M);case"Communication":return a.jsx(cY,{resource:k,popupMenuItems:$},M);case"DiagnosticReport":return a.jsx(fY,{resource:k,popupMenuItems:$},M);case"Media":return a.jsx(uY,{resource:k,popupMenuItems:$},M);default:return a.jsx(cl,{resource:k,padding:!0,children:a.jsx(tS,{value:k,ignoreMissingValues:!0})},M)}}),p<d.length&&a.jsx(ye,{justify:"center",pb:"lg",children:a.jsx(ke,{onClick:()=>m(p+10),children:"Show More"})})]})}function sY(e){const{history:t,resource:n,...r}=e,o=lY(t,n);return o?a.jsx(cl,{resource:n,padding:!0,...r,children:a.jsx(XW,{original:o,revised:e.resource})}):a.jsxs(cl,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(tS,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function lY(e,t){const n=e.entry??[],r=n.findIndex(o=>o.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function cY(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:aY.pinnedComment;return a.jsx(cl,{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 uY(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(cl,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(Qd,{value:e.resource.content})})}function dY(e){return a.jsx(cl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(ai,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function fY(e){return a.jsx(cl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(eS,{value:e.resource})})}function hY(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Cy(e.loaded)} / ${Cy(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Cy(e.loaded)}`}function Cy(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 pY(e){const{resource:t,...n}=e;return a.jsx(_m,{value:t,loadTimelineResources:async(r,o,l)=>{const c=`${o}/${l}`;return Promise.allSettled([r.readHistory(o,l),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function mY(e){const{encounter:t,...n}=e;return a.jsx(_m,{value:t,loadTimelineResources:async(r,o,l)=>Promise.allSettled([r.readHistory("Encounter",l),r.search("Communication","encounter=Encounter/"+l),r.search("Media","encounter=Encounter/"+l)]),createCommunication:(r,o,l)=>({resourceType:"Communication",status:"completed",encounter:Ht(r),subject:r.subject,sender:Ht(o),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(r,o,l)=>({resourceType:"Media",status:"completed",encounter:Ht(r),subject:r.subject,operator:Ht(o),issued:new Date().toISOString(),content:l}),...n})}function gY(e){let t;try{t=PB(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(Xi,{value:t[0]||"",propertyType:e.propertyType})}function vY(e){return a.jsxs(Un,{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(kT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(kT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(Te,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function kT(e){return a.jsx(ke,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const yY={string:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],fulltext:[de.EQUALS,de.NOT,de.CONTAINS,de.EXACT],token:[de.EQUALS,de.NOT],reference:[de.EQUALS,de.NOT],numeric:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],quantity:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS],date:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],datetime:[de.EQUALS,de.NOT_EQUALS,de.GREATER_THAN,de.LESS_THAN,de.GREATER_THAN_OR_EQUALS,de.LESS_THAN_OR_EQUALS,de.STARTS_AFTER,de.ENDS_BEFORE,de.APPROXIMATELY],uri:[de.EQUALS,de.NOT,de.ABOVE,de.BELOW]},xY={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 nS(e,t){return{...e,filters:t,offset:0,name:void 0}}function jP(e,t){return nS(e,(e.filters??[]).filter(n=>n.code!==t))}function Dm(e,t,n,r,o){const l=[];return e.filters&&l.push(...e.filters),l.push({code:t,operator:n,value:r??""}),nS(e,l)}function bY(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function SY(e,t){return rS(e,t,-1)}function wY(e,t){return rS(e,t,0)}function jY(e,t){return rS(e,t,1)}function rS(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),Am(e,t,r,o)}function CY(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return Am(e,t,n,r)}function EY(e,t){return iS(e,t,-1)}function TY(e,t){return iS(e,t,0)}function RY(e,t){return iS(e,t,1)}function iS(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),Am(e,t,r,o)}function _Y(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),Am(e,t,n,new Date)}function Am(e,t,n,r){return e=jP(e,t),e=NT(e,t,de.GREATER_THAN_OR_EQUALS,n),e=NT(e,t,de.LESS_THAN_OR_EQUALS,r),e}function NT(e,t,n,r){return Dm(e,t,n,r.toISOString())}function OT(e,t,n=!0){return Dm(e,t,de.MISSING,n.toString())}function DY(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function AY(e,t){const n=e.count??pm,r=(t-1)*n;return DY(e,r)}function PY(e,t,n){return t===kY(e)&&n!==void 0&&n===NY(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function kY(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function NY(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function OY(e){return yY[e.type]}function CP(e){return xY[e]??""}function ul(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map($n).join(" "))}function MY(e,t){const n=t.name;return n==="id"?a.jsx(mt,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?mr(e.meta?.lastUpdated):`${e.resourceType}.${t.name}`===t.elementDefinition?.path?LY(e,t.elementDefinition):t.searchParams?.length===1&&t.name===t.searchParams[0].code?IY(e,t.searchParams[0]):null}function LY(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=Em({type:e.resourceType,value:e},n);return r?a.jsx(Xi,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function IY(e,t){const n=cs(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(Xi,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function zY(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(Ki(e.search))}),[o,l]=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=zD(f),m=jb(f);return Ic($Y(p,m)).map(g=>({value:g,label:ul(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Un,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Be,{children:[a.jsx(em,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:d,onDropdownOpen:()=>l(!0),onDropdownClose:()=>l(!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 $Y(e,t){const n=[],r=new Set,o=new Set;for(const l of Object.keys(e.elements))n.push(l),r.add(l.toLowerCase()),o.add(ul(l));if(t)for(const l of Object.keys(t)){const c=ul(l);!r.has(l)&&!o.has(c)&&(n.push(l),r.add(l),o.add(c))}return n}function EP(e){const t=ym(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case dr.REFERENCE:return a.jsx(os,{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 dr.BOOLEAN:return a.jsx(Pn,{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 dr.DATE:return a.jsx(Ve,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case dr.DATETIME:return a.jsx(So,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case dr.NUMBER:return a.jsx(Ve,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case dr.QUANTITY:return a.jsx(ll,{name:n,path:"",defaultValue:UY(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(Ve,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function UY(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function BY(e){const[t,n]=v.useState(ii(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(ii(e.search))},[e.search]);function o(f){n(Dm(r.current,f.code,f.operator,f.value))}const l=e.search.resourceType,c=jb(l)??{},d=t.filters||[];return a.jsx(Un,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(ut,{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(VY,{id:`filter-${p}-row`,resourceType:l,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(nS(r.current,g))},onDelete:()=>n(bY(r.current,p))},`filter-${p}-row`))})]}),a.jsx(Xb,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(ye,{justify:"flex-end",mt:"xl",children:a.jsx(vr,{children:"OK"})})]})})}function VY(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=de.EQUALS,n.current.value="",e.onChange(n.current)}function o(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function l(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],d=c&&OY(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(on,{"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:ul(f)}))]})}),a.jsx("td",{children:d&&a.jsx(on,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>o(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:CP(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(EP,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:l},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),a.jsx("td",{children:e.onDelete&&a.jsx(bn,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(sl,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function FY(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(Un,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(ut,{onSubmit:r,children:a.jsxs(hr,{children:[a.jsx(hr.Col,{span:10,children:a.jsx(EP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(hr.Col,{span:2,children:a.jsx(ke,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function HY(e){const{resourceType:t,filter:n}=e,r=Eo.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===de.EQUALS||n.operator===de.NOT_EQUALS))return a.jsx(jl,{value:{reference:n.value}});const o=ym(t,r);if(n.code==="_lastUpdated"||o.type===dr.DATETIME)return a.jsx(a.Fragment,{children:mr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function qY(e){if(!e.searchParams)return null;function t(l,c){o(PY(e.search,l.code,c))}function n(l){o(jP(e.search,l.code))}function r(l,c){e.onPrompt(l,{code:l.code,operator:c,value:""})}function o(l){e.onChange(l)}return e.searchParams.length===1?a.jsx(GY,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(je.Dropdown,{children:e.searchParams.map(l=>a.jsx(je.Item,{children:ul(l.code)},l.code))})}function GY(e){switch(e.searchParam.type){case"date":return a.jsx(QY,{...e});case"number":case"quantity":return a.jsx(WY,{...e});case"reference":return a.jsx(YY,{...e});case"string":return a.jsx(KY,{...e});case"token":case"uri":return a.jsx(XY,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function QY(e){const{searchParam:t}=e,n=t.code;return a.jsxs(je.Dropdown,{children:[a.jsx(je.Item,{leftSection:a.jsx(Bb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(je.Item,{leftSection:a.jsx(Vb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Gd,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),a.jsx(je.Item,{leftSection:a.jsx(qd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx($A,{size:14}),onClick:()=>e.onPrompt(t,de.ENDS_BEFORE),children:"Before..."}),a.jsx(je.Item,{leftSection:a.jsx(zA,{size:14}),onClick:()=>e.onPrompt(t,de.STARTS_AFTER),children:"After..."}),a.jsx(je.Item,{leftSection:a.jsx(gH,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Between..."}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(jY(e.search,n)),children:"Tomorrow"}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(wY(e.search,n)),children:"Today"}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(SY(e.search,n)),children:"Yesterday"}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(CY(e.search,n)),children:"Next 24 Hours"}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(RY(e.search,n)),children:"Next Month"}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(TY(e.search,n)),children:"This Month"}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(EY(e.search,n)),children:"Last Month"}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Ka,{size:14}),onClick:()=>e.onChange(_Y(e.search,n)),children:"Year to date"}),a.jsx(Yd,{...e})]})}function WY(e){const{searchParam:t}=e;return a.jsxs(je.Dropdown,{children:[a.jsx(je.Item,{leftSection:a.jsx(Bb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(je.Item,{leftSection:a.jsx(Vb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Gd,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),a.jsx(je.Item,{leftSection:a.jsx(qd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT_EQUALS),children:"Does not equal..."}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(zA,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN),children:"Greater than..."}),a.jsx(je.Item,{leftSection:a.jsx(px,{size:14}),onClick:()=>e.onPrompt(t,de.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(je.Item,{leftSection:a.jsx($A,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN),children:"Less than..."}),a.jsx(je.Item,{leftSection:a.jsx(px,{size:14}),onClick:()=>e.onPrompt(t,de.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(Yd,{...e})]})}function YY(e){const{searchParam:t}=e;return a.jsxs(je.Dropdown,{children:[a.jsx(je.Item,{leftSection:a.jsx(Gd,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),a.jsx(je.Item,{leftSection:a.jsx(qd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),a.jsx(Yd,{...e})]})}function KY(e){const{searchParam:t}=e;return a.jsxs(je.Dropdown,{children:[a.jsx(je.Item,{leftSection:a.jsx(Bb,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(je.Item,{leftSection:a.jsx(Vb,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(Gd,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),a.jsx(je.Item,{leftSection:a.jsx(qd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(wH,{size:14}),onClick:()=>e.onPrompt(t,de.CONTAINS),children:"Contains..."}),a.jsx(je.Item,{leftSection:a.jsx(bH,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Does not contain..."}),a.jsx(Yd,{...e})]})}function XY(e){const{searchParam:t}=e;return a.jsxs(je.Dropdown,{children:[a.jsx(je.Item,{leftSection:a.jsx(Gd,{size:14}),onClick:()=>e.onPrompt(t,de.EQUALS),children:"Equals..."}),a.jsx(je.Item,{leftSection:a.jsx(qd,{size:14}),onClick:()=>e.onPrompt(t,de.NOT),children:"Does not equal..."}),a.jsx(Yd,{...e})]})}function Yd(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(fH,{size:14}),onClick:()=>e.onChange(OT(e.search,n)),children:"Missing"}),a.jsx(je.Item,{leftSection:a.jsx(uH,{size:14}),onClick:()=>e.onChange(OT(e.search,n,!1)),children:"Not missing"}),a.jsx(je.Divider,{}),a.jsx(je.Item,{leftSection:a.jsx(sl,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function TP(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 ZY="_root_vlout_1",JY="_table_vlout_8",eK="_tr_vlout_12",tK="_control_vlout_22",nK="_icon_vlout_31",Yu={root:ZY,table:JY,tr:eK,control:tK,icon:nK};function rK(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(iK(t,r));return n}function iK(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=ms(e,t),r=tB(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=jb(e);let l;if(o){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);l=Object.values(o).filter(d=>!!d.expression&&c.test(d?.expression)),l.length===0&&(l=void 0)}return{name:t,elementDefinition:n,searchParams:l}}if(r){const o=ym(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class oK extends Event{constructor(t){super("change"),this.definition=t}}class aK extends Event{constructor(t){super("load"),this.response=t}}class hp extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function nu(e){const t=Re(),[n,r]=v.useState(),{search:o,onLoad:l}=e,[c,d]=v.useState(o);Co(o,c)||d(o);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(H=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,is({...c,total:g,fields:void 0}),H)).then(Q=>{p({...m.current,searchResponse:Q}),l&&l(new aK(Q))}).catch(Q=>{p({...m.current,searchResponse:void 0}),r(qt(Q))})},[t,c,g,l]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),x({cache:"reload"})},[x]);v.useEffect(()=>{x()},[x]);function w(H,Q){H.stopPropagation();const I=H.target.checked,z={...m.current.selected};I?z[Q]=!0:delete z[Q],p({...m.current,selected:z})}function j(H){H.stopPropagation();const O=H.target.checked,I={},z=m.current.searchResponse;O&&z?.entry&&z.entry.forEach(F=>{F.resource?.id&&(I[F.resource.id]=!0)}),p({...m.current,selected:I})}function C(){const H=m.current;if(!H.searchResponse?.entry||H.searchResponse.entry.length===0)return!1;for(const Q of H.searchResponse.entry)if(Q.resource?.id&&!H.selected[Q.resource.id])return!1;return!0}function T(H){e.onChange&&e.onChange(new oK(H))}function E(H,Q){if(HA(H.target)||H.button===2)return;cn(H);const O=FA(H);!O&&e.onClick&&e.onClick(new hp(Q,H)),O&&e.onAuxClick&&e.onAuxClick(new hp(Q,H))}function R(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(yr,{outcome:n});if(!ID(c.resourceType))return a.jsx(ar,{style:{width:"100%",height:"100%"},children:a.jsx(Fr,{})});const D=e.checkboxesEnabled,P=rK(c),A=c.resourceType,k=f.searchResponse,$=k?.entry?.map(H=>H.resource),U="subtle",J="gray",Z=16,Y=window.innerWidth<768;return a.jsxs("div",{className:Yu.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:U,color:J,leftSection:a.jsx(LH,{size:Z}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(ke,{size:"compact-md",variant:U,color:J,leftSection:a.jsx(rq,{size:Z}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(ke,{size:"compact-md",variant:U,color:J,leftSection:a.jsx(tq,{size:Z}),onClick:e.onNew,children:"New..."}),!Y&&R()&&a.jsx(ke,{size:"compact-md",variant:U,color:J,leftSection:a.jsx(Jq,{size:Z}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!Y&&e.onDelete&&a.jsx(ke,{size:"compact-md",variant:U,color:J,leftSection:a.jsx(wm,{size:Z}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!Y&&e.onBulk&&a.jsx(ke,{size:"compact-md",variant:U,color:J,leftSection:a.jsx(pH,{size:Z}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(ye,{gap:2,children:[k&&a.jsxs(Te,{size:"xs",c:"dimmed","data-testid":"count-display",children:[RP(c,k).toLocaleString(),"-",dK(c,k).toLocaleString(),k.total!==void 0&&` of ${c.total==="estimate"?"~":""}${k.total?.toLocaleString()}`]}),a.jsx(bn,{variant:U,color:J,title:"Refresh",onClick:b,children:a.jsx(BA,{size:Z})})]})]}),a.jsxs(fe,{className:Yu.table,children:[a.jsxs(fe.Thead,{children:[a.jsxs(fe.Tr,{children:[D&&a.jsx(fe.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:H=>j(H)})}),P.map(H=>a.jsx(fe.Th,{children:a.jsxs(je,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(je.Target,{children:a.jsx(sr,{className:Yu.control,p:2,children:a.jsxs(ye,{justify:"space-between",wrap:"nowrap",children:[a.jsx(Te,{fw:500,children:ul(H.name)}),a.jsx(ar,{className:Yu.icon,children:a.jsx(rH,{size:14,stroke:1.5})})]})})}),a.jsx(qY,{search:c,searchParams:H.searchParams,onPrompt:(Q,O)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:Q,filterDialogFilter:O,dialogOpenTime:Date.now()})},onChange:Q=>{T(Q)}})]})},H.name))]}),!e.hideFilters&&a.jsxs(fe.Tr,{children:[D&&a.jsx(fe.Th,{}),P.map(H=>a.jsx(fe.Th,{children:H.searchParams&&a.jsx(lK,{resourceType:A,searchParams:H.searchParams,filters:c.filters})},H.name))]})]}),a.jsx(fe.Tbody,{children:$?.map(H=>H&&a.jsxs(fe.Tr,{className:Yu.tr,"data-testid":"search-control-row",onClick:Q=>E(Q,H),onAuxClick:Q=>E(Q,H),children:[D&&a.jsx(fe.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${H.id}`,checked:!!f.selected[H.id],onChange:Q=>w(Q,H.id)})}),P.map(Q=>a.jsx(fe.Td,{children:MY(H,Q)},Q.name))]},H.id))})]}),!$?.length&&a.jsx(eu,{children:a.jsx(ar,{style:{height:150},children:a.jsx(Te,{size:"xl",c:"dimmed",children:"No results"})})}),k&&a.jsx(ar,{m:"md",p:"md",children:a.jsx(Oi,{value:cK(c),total:uK(c,k),onChange:H=>T(AY(c,H)),getControlProps:TP})}),a.jsx(zY,{search:c,visible:m.current.fieldEditorVisible,onOk:H=>{T(H),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(BY,{search:c,visible:m.current.filterEditorVisible,onOk:H=>{T(H),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(vY,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(FY,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?ul(f.filterDialogSearchParam.code):"",resourceType:A,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:H=>{T(Dm(c,H.code,H.operator,H.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}const sK=nu;function lK(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:[CP(n.operator)," ",a.jsx(HY,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function cK(e){return Math.floor((e.offset??0)/(e.count??pm))+1}function uK(e,t){const n=e.count??pm,r=_P(e,t);return Math.ceil(r/n)}function RP(e,t){return Math.min(_P(e,t),(e.offset??0)+1)}function dK(e,t){return Math.max(RP(e,t)+(t.entry?.length??0)-1,0)}function _P(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 fK(e){const t=Re(),[n,r]=v.useState(!1),[o,l]=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(()=>{l(void 0),t.graphql(c).then(p).catch(R=>l(qt(R)))},[t,c]);function w(R,D){R.stopPropagation();const A=R.target.checked,k={...b.current};A?k[D]=!0:delete k[D],g(k)}function j(R){R.stopPropagation();const P=R.target.checked,A={},k=x.current?.data.ResourceList;P&&k&&k.forEach(M=>{M.id&&(A[M.id]=!0)}),g(A)}function C(){const R=x.current?.data.ResourceList;if(!R||R.length===0)return!1;for(const D of R)if(D.id&&!b.current[D.id])return!1;return!0}function T(R,D){HA(R.target)||(cn(R),R.button!==1&&e.onClick&&e.onClick(new hp(D,R)),R.button===1&&e.onAuxClick&&e.onAuxClick(new hp(D,R)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Fr,{});const E=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:R=>cn(R),"data-testid":"search-control",children:[a.jsxs(fe,{children:[a.jsx(fe.Thead,{children:a.jsxs(fe.Tr,{children:[E&&a.jsx(fe.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:R=>j(R)})}),d.map(R=>a.jsx(fe.Th,{children:R.name},R.name))]})}),a.jsx(fe.Tbody,{children:f?.data.ResourceList.map(R=>R&&a.jsxs(fe.Tr,{"data-testid":"search-control-row",onClick:D=>T(D,R),onAuxClick:D=>T(D,R),children:[E&&a.jsx(fe.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!m[R.id],onChange:D=>w(D,R.id)})}),d.map(D=>a.jsx(fe.Td,{children:a.jsx(gY,{propertyType:D.propertyType,path:D.fhirPath,resource:R})},D.name))]},R.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(ke,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const hK=v.memo(fK),pK="_root_1fbwr_1",mK="_entry_1fbwr_8",gK="_key_1fbwr_13",vK="_value_1fbwr_20",Pm={root:pK,entry:mK,key:gK,value:vK};function ht(e){return a.jsx(ai,{children:a.jsx("div",{className:Pm.root,children:e.children})})}ht.Entry=function(t){return a.jsx("div",{className:Pm.entry,children:t.children})};ht.Key=function(t){return a.jsx("div",{className:Pm.key,children:t.children})};ht.Value=function(t){return a.jsx("div",{className:Pm.value,children:t.children})};function yK(e){const{group:t}=e;return a.jsx(Tr,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(ye,{children:[t.measureScore&&a.jsx(SK,{group:t}),!t.measureScore&&a.jsx(bK,{group:t})]})})}function xK(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(Te,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(Te,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function bK(e){const{group:t}=e,n=t.population,r=n?.find(f=>ls(f.code)==="numerator"),o=n?.find(f=>ls(f.code)==="denominator"),l=r?.count,c=o?.count;if(c===0)return a.jsxs(ce,{children:[a.jsx(Ie,{order:3,children:"Not Applicable"}),a.jsx(Te,{children:`Denominator: ${c}`})]});if(l===void 0||c===void 0)return a.jsxs(ce,{children:[a.jsx(Ie,{order:3,children:"Insufficient Data"}),a.jsx(Te,{children:`Numerator: ${l}`}),a.jsx(Te,{children:`Denominator: ${c}`})]});const d=l/c*100;return a.jsx(sm,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:DP(d)}],label:a.jsx(jo,{justify:"center",children:a.jsxs(Te,{fw:700,fz:18,children:[l," / ",c]})})})}function SK(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(sm,{size:120,thickness:12,roundCaps:!0,sections:[{value:wK(t),color:DP(t?.measureScore?.value??0)}],label:a.jsx(jo,{justify:"center",children:a.jsx(Te,{fw:700,fz:18,children:a.jsx(vd,{value:t.measureScore})})})}):a.jsx(jo,{h:120,align:"center",children:a.jsx(Ie,{order:3,children:a.jsx(vd,{value:t.measureScore})})})})}function wK(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function DP(e){return e<=33?"red":e<=67?"yellow":"green"}function jK(e){const t=Gt(e.measureReport),[n]=YF("Measure",{url:t?.measure});return t?a.jsxs(ce,{children:[n&&a.jsx(xK,{measure:n}),a.jsx(lm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(yK,{group:r},r.id??o))})]}):null}const Ey="patient-export",Ty="Patient Export",CK={everything:{operation:"$everything",extension:"json",contentType:ln.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:ln.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:ln.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:ln.CDA_XML}};function EK(e){const t=Re(),{patient:n}=e,r=v.useCallback(async o=>{const l=rl(n),c=o.format,{operation:d,type:f,contentType:p,extension:m}=CK[c],g=t.fhirUrl("Patient",l,d),x={};f&&(x.type=f),o.author&&(x.author={reference:o.author}),o.authoredOn&&(x.authoredOn=Yb(o.authoredOn)),o.startDate&&(x.start=o.startDate),o.endDate&&(x.end=o.endDate),Ci.show({id:Ey,title:Ty,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-${l}-${new Date().toISOString().replaceAll(":","-")}.${m}`;TK(b,w,p),Ci.update({id:Ey,title:Ty,color:"green",message:"Done",icon:a.jsx(Po,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){Ci.update({id:Ey,title:Ty,color:"red",message:Ye(b),icon:a.jsx(sl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(ut,{onSubmit:r,children:a.jsxs(Be,{children:[a.jsx(Pt,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(Id,{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(Pt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(os,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(Pt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(So,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(Pt,{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(So,{name:"startDate",placeholder:"Start date"})}),a.jsx(Pt,{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(So,{name:"endDate",placeholder:"End date"})}),a.jsx(ye,{justify:"right",children:a.jsx(vr,{children:"Request Export"})})]})})}function TK(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),o=new Blob([r],{type:n}),l=window.URL.createObjectURL(o),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=l,c.download=t,c.click(),window.URL.revokeObjectURL(l)}function RK(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function AP(e){const t=Gt(e.patient);return t?a.jsxs(ht,{children:[a.jsx(gs,{value:t,size:"lg",color:RK(t)}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Name"}),a.jsx(ht.Value,{children:a.jsx(mt,{to:t,fw:500,children:t.name?a.jsx(Fb,{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 _K(e){const{patient:t,...n}=e,r=v.useCallback((o,l,c)=>{const d=`${l}/${c}`,f=100;return Promise.allSettled([o.readHistory("Patient",c),o.search("Communication",{subject:d,_count:f}),o.search("Device",{patient:d,_count:f}),o.search("DeviceRequest",{patient:d,_count:f}),o.search("DiagnosticReport",{subject:d,_count:f}),o.search("Media",{subject:d,_count:f}),o.search("ServiceRequest",{subject:d,_count:f}),o.search("Task",{subject:d,_count:f})])},[]);return a.jsx(_m,{value:t,loadTimelineResources:r,createCommunication:(o,l,c)=>({resourceType:"Communication",status:"completed",subject:Ht(o),sender:Ht(l),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(o,l,c)=>({resourceType:"Media",status:"completed",subject:Ht(o),operator:Ht(l),issued:new Date().toISOString(),content:c}),...n})}const DK="_section_pqpwm_1",AK="_hovering_pqpwm_7",vx={section:DK,hovering:AK};function PK(e){const t=Re(),n=Gt(e.value),[r,o]=v.useState(!1),[l,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(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(LK(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(ut,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(Ve,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>w("title",j.currentTarget.value)}),a.jsx(kK,{actions:p.action||[],selectedKey:l,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>w("action",j)}),a.jsx(vr,{children:"Save"})]})})}function kK(e){const t=v.useRef(e.actions);t.current=e.actions;function n(l){e.onChange(t.current.map(c=>c.id===l.id?l:c))}function r(l){e.onChange([...t.current,l]),e.setSelectedKey(l.id)}function o(l){e.onChange(t.current.filter(c=>c!==l))}return a.jsxs(Be,{gap:"md",className:vx.section,children:[e.actions.map(l=>a.jsx(NK,{action:l,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(l)},l.id)),a.jsx("div",{children:a.jsx(ke,{variant:"outline",onClick:l=>{cn(l),r({id:PP()})},children:"Add action"})})]})}function NK(e){const{action:t}=e,n=MK(t);function r(l){l.stopPropagation(),e.setSelectedKey(e.action.id)}function o(l){cn(l),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:r,onMouseOver:o,onFocus:o,children:a.jsx(OK,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function OK(e){const{action:t}=e,[n,r]=v.useState(e.actionType),o=e.selectedKey===e.action.id,l=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const d=Ot(vx.section,{[vx.hovering]:l&&!o});return a.jsxs(Tr,{"data-testid":t.id,className:d,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(jo,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(Ve,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),a.jsx(hs,{"data-testid":"close-button",onClick:e.onRemove})]}),o&&a.jsxs(Be,{gap:"xl",p:"md",children:[a.jsx(ce,{children:a.jsx(Ve,{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(on,{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(Be,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Te,{fw:600,children:"Select questionnaire"}),a.jsx(Te,{c:"red",children:"*"})]}),a.jsxs(Te,{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(MT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&a.jsxs(Be,{gap:0,children:[a.jsxs(ye,{gap:0,mb:"xs",children:[a.jsx(Te,{fw:600,children:"Select activity definition"}),a.jsx(Te,{c:"red",children:"*"})]}),a.jsxs(Te,{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(MT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function MT(e){const{id:t,definitionCanonical:n}=e.action,r=n?.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(wl,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:_t(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function MK(e){return e.definitionCanonical?.startsWith("Questionnaire")?"questionnaire":e.definitionCanonical?.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let Ry=1;function PP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Ry=Math.max(Ry,t+1))}return e}return"id-"+Ry++}function LK(e){return{...e,action:kP(e.action)}}function kP(e){if(e)return e.map(t=>({...t,id:PP(t.id),action:kP(t.action)}))}const el=30,pp=50;function mp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const l=n.type;if(!l)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=aS(r,e.index)??Lb(d),p=Do(r,`${Ji}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(l){case xt.display:m=a.jsx("p",{children:e.item.text},e.item.linkId);break;case xt.boolean:m=a.jsx(uP,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(Pn,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f?.value,onChange:g=>o([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case xt.decimal:m=a.jsx(Ve,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case xt.integer:m=a.jsx(Ve,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case xt.date:m=a.jsx(Ve,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDate:g.currentTarget.value}])});break;case xt.dateTime:m=a.jsx(So,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDateTime:g}])});break;case xt.time:m=a.jsx(Ve,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueTime:g.currentTarget.value}])});break;case xt.string:case xt.url:m=a.jsx(Ve,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;o(x===""?[]:[{valueString:x}])}});break;case xt.text:m=a.jsx(vl,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const x=g.currentTarget.value;o(x===""?[]:[{valueString:x}])}});break;case xt.attachment:m=a.jsx(ye,{py:4,children:a.jsx(YA,{path:"",name:c,defaultValue:f?.value,onChange:g=>o([{valueAttachment:g}])})});break;case xt.reference:m=a.jsx(os,{name:c,required:e.required??n.required,targetTypes:AA(n),searchCriteria:$F(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>o([{valueReference:g}])});break;case xt.quantity:m=a.jsx(ll,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueQuantity:g}]),disableWheel:!0});break;case xt.choice:case xt.openChoice:FK(n)?m=a.jsx(UK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):VK(n)||n.answerValueSet&&!HK(n)?m=a.jsx(IK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):m=a.jsx($K,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(Te,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function IK(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:l,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(oS,{});const d=Lb(o),f=aS(c)??d,p=MP(c),m=n.repeats||qK(n);if(n.answerValueSet)return a.jsx(jm,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:g=>{m?g.length===0?l([{}]):l(g.map(x=>({valueCoding:x}))):l([{valueCoding:g[0]}])},defaultValue:f?.value});if(m){const{propertyName:g,data:x}=GK(n);return a.jsx(em,{data:x,placeholder:"Select items",searchable:!0,defaultValue:p||[il(d)],required:r,onChange:b=>{if(b.length===0)l([{}]);else{const w=_A(b,g,n);l(w)}}})}else{const g=[""];if(n.answerOption)for(const x of n.answerOption){const b=To(x);g.push(il(b))}return a.jsx(on,{id:t,name:t,required:r,onChange:x=>{const b=x.currentTarget.selectedIndex;if(b===0){l([{}]);return}const w=n.answerOption[b-1],j=To(w),C="value"+$n(j.type);l([{[C]:j.value}])},defaultValue:Hd(f?.value)||f?.value,data:g})}}function zK(e,t){return e?t.valueSetExpand({url:e,count:el+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function NP(e){const t=Re(),[n,r]=v.useState([]),[o,l]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){l(!0);try{const d=await zK(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{l(!1)}}}c().catch(console.error)},[e,t]),[n,o]}function OP(e,t){return e.map((n,r)=>{const o=`${t}-valueset-${r}`,l={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[o,l]})}function $K(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:l,response:c}=e,d=ms("QuestionnaireItemAnswerOption","value[x]"),f=Lb(o),[p,m]=NP(n.answerValueSet),g=[];let x;if(n.answerValueSet)g.push(...OP(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,pp).map((T,E)=>{const R=`${t}-option-${E}`,D=To(T);return D?.value?(f&&Ki(D)===Ki(f)&&(x=R),[R,D]):null}).filter(T=>T!==null);g.push(...C)}const b=aS(c),w=BK(g,b);if(m)return a.jsx(Te,{children:"Loading options..."});if(g.length===0)return a.jsx(oS,{});const j=g.slice(0,el);return a.jsxs(a.Fragment,{children:[a.jsx(ur.Group,{name:t,value:w??x,required:r,onChange:C=>{const T=g.find(E=>E[0]===C);if(T){const E=T[1],R="value"+$n(E.type);l([{[R]:E.value}])}},children:j.map(([C,T])=>a.jsx(ur,{id:C,value:C,py:4,required:r,label:a.jsx(Xi,{property:d,propertyType:T.type,value:T.value})},C))}),(n.answerValueSet&&g.length>el||n.answerOption&&g.length>pp)&&a.jsxs(Te,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",el," options"]})]})}function UK(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,l=ms("QuestionnaireItemAnswerOption","value[x]"),[c,d]=NP(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(w=>w.valueCoding)||[]).filter(w=>w!==void 0):MP(o),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...OP(c,t));else if(n.answerOption){const w=n.answerOption.slice(0,pp).map((j,C)=>{const T=`${t}-option-${C}`,E=To(j);return E?.value?[T,E]:null}).filter(j=>j!==null);g.push(...w)}if(d)return a.jsx(Te,{children:"Loading options..."});if(g.length===0)return a.jsx(oS,{});const x=g.slice(0,el),b=(w,j)=>{if(n.answerValueSet){const C=p;let T;j?T=[...C,w.value]:T=C.filter(E=>!Co(E,w.value)),m(T),T.length===0?r([{}]):r(T.map(E=>({valueCoding:E})))}else{const C=p,T=il(w);let E;if(j?E=[...C,T]:E=C.filter(R=>R!==T),m(E),E.length===0)r([{}]);else{const R=_A(E,"value"+$n(w.type),n);r(R)}}};return a.jsxs(ye,{style:{flexDirection:"column",alignItems:"flex-start"},children:[x.map(([w,j])=>{const C=il(j),T=n.answerValueSet?p.some(E=>Co(E,j.value)):p.includes(C);return a.jsx(Pn,{id:w,label:a.jsx(Xi,{property:l,propertyType:j.type,value:j.value}),checked:T,onChange:E=>b(j,E.currentTarget.checked)},w)}),(n.answerValueSet&&g.length>el||n.answerOption&&g.length>pp)&&a.jsxs(Te,{size:"sm",c:"dimmed",children:["Showing first ",el," options"]})]})}function oS(){return a.jsx(Ve,{disabled:!0,placeholder:"No Answers Defined"})}function aS(e,t=0){return To(e?.answer?.[t]??{})}function MP(e){const t=e?.answer;return t?t.map(r=>To(r)).map(r=>Hd(r?.value)||r?.value).filter(Boolean):[]}function BK(e,t){return e.find(n=>Co(n[1].value,t?.value))?.[0]}function km(e,t){return!!e.extension?.some(n=>n.url===Ob&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function VK(e){return km(e,"drop-down")}function FK(e){return km(e,"check-box")}function HK(e){return km(e,"radio-button")}function qK(e){return km(e,"multi-select")}function GK(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=To(t),r="value"+$n(n.type),o=(e.answerOption??[]).map(l=>{const c=To(l),d=il(c);return{value:d,label:d}});return{propertyName:r,data:o}}const QK="_section_my8o4_1",WK="_hovering_my8o4_10",YK="_editing_my8o4_14",KK="_questionBody_my8o4_20",XK="_topActions_my8o4_24",ZK="_bottomActions_my8o4_33",JK="_movementActions_my8o4_44",eX="_movementIcons_my8o4_56",tX="_columnAlignment_my8o4_60",nX="_linkIdInput_my8o4_65",rX="_typeSelect_my8o4_70",iX="_preserveBreaks_my8o4_74",ei={section:QK,hovering:WK,editing:YK,questionBody:KK,topActions:XK,bottomActions:ZK,movementActions:JK,movementIcons:eX,columnAlignment:tX,linkIdInput:nX,typeSelect:rX,preserveBreaks:iX};function oX(e){const t=Re(),n=Gt(e.questionnaire),[r,o]=v.useState(!1),[l,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(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(cX(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||!l?null:a.jsx("div",{children:a.jsxs(ut,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(l),children:[a.jsx(LP,{item:l,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(vr,{children:"Save"})]})})}function LP(e){const t=e.item,n=e.item,r=Ao(e.item),o=r||n.type===xt.group,l=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(R){cn(R),e.setSelectedKey(e.item.id)}function m(R){cn(R),e.setHoverKey(e.item.id)}function g(R){const D=f.current;e.onChange({...D,item:D.item?.map(P=>P.id===R.id?R:P)})}function x(R,D){e.onChange({...e.item,item:[...e.item.item??[],R]},D)}function b(R){e.onChange({...e.item,item:e.item.item?.filter(D=>D!==R)})}function w(R,D){e.onChange({...f.current,[R]:D})}function j(R){e.onChange({...e.item,...R})}function C(R){e.onChange({...e.item,item:e.item.item?.map(D=>D===R?{...D,repeats:!D.repeats}:D)})}function T(R,D){const P=fX(e.item.item,R,D);e.onChange({...e.item,item:P})}const E=Ot(ei.section,{[ei.editing]:c,[ei.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:E,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:ei.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(Ve,{size:"xl",defaultValue:t.title,onBlur:R=>w("title",R.currentTarget.value)}),!r&&a.jsx(vl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:R=>w("text",R.currentTarget.value)}),n.type==="reference"&&a.jsx(lX,{item:n,onChange:j}),DF(n)&&a.jsx(aX,{item:n,onChange:R=>j(R)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Ie,{children:t.title}),n.text&&a.jsx("div",{className:ei.preserveBreaks,children:n.text}),!o&&a.jsx(mp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((R,D)=>a.jsx("div",{children:a.jsx(LP,{item:R,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:D===0,isLast:D===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(R),onRepeatable:C,onMoveUp:()=>T(D,-1),onMoveDown:()=>T(D,1)})},R.id)),!o&&a.jsx("div",{className:ei.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(Ve,{size:"xs",className:ei.linkIdInput,defaultValue:n.linkId,onBlur:R=>w("linkId",R.currentTarget.value)}),!o&&a.jsx(on,{size:"xs",className:ei.typeSelect,defaultValue:n.type,onChange:R=>w("type",R.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:l})}),!r&&a.jsx(ce,{className:ei.movementActions,children:a.jsxs(ce,{className:ei.columnAlignment,children:[!e.isFirst&&a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(lH,{"data-testid":"up-button",size:15,className:ei.movementIcons})}),!e.isLast&&a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(aH,{"data-testid":"down-button",size:15,className:ei.movementIcons})})]})}),a.jsxs("div",{className:ei.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),x({id:dl(),linkId:bx("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),x({id:dl(),linkId:bx("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),x(dX(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Dt,{href:"#",onClick:R=>{R.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function aX(e){const t=ms("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(Ve,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(sX,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ce,{display:"flex",children:[a.jsx(Dt,{href:"#",onClick:r=>{cn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:dl()}]})},children:"Add choice"}),a.jsx(cm,{w:"lg"}),a.jsx(Dt,{href:"#",onClick:r=>{cn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function sX(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=Em({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(Wd,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,l)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[l]:o},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Dt,{href:"#",onClick:o=>{cn(o),e.onChange({...e.item,answerOption:e.options.filter(l=>l.id!==t.id)})},children:"Remove"})})]},t.id)})})}function lX(e){const t=AA(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(ye,{children:[a.jsx(Gb,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(Sy(e.item,t.map(l=>l===n?o:l)))}}),a.jsx(Dt,{href:"#",onClick:o=>{cn(o),e.onChange(Sy(e.item,t.filter(l=>l!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Dt,{href:"#",onClick:n=>{cn(n),e.onChange(Sy(e.item,[...t,""]))},children:"Add Resource Type"})]})}let yx=1,xx=1;function bx(e){return e+yx++}function dl(){return"id-"+xx++}function cX(e){return{...e,id:e.id||dl(),item:IP(e.item)}}function IP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(xx=Math.max(xx,parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(yx=Math.max(yx,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||dl(),item:IP(t.item),answerOption:uX(t.answerOption)}))}function uX(e){if(e)return e.map(t=>({...t,id:t.id||dl()}))}function dX(){return{id:dl(),linkId:bx("s"),type:"group",text:"New Page",extension:[{url:Ob,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function fX(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const l=[...r];return[l[t],l[o]]=[l[o],l[t]],l}/*!
553
- * Signature Pad v5.1.1 | https://github.com/szimek/signature_pad
554
- * (c) 2025 Szymon Nowak | Released under the MIT license
555
- */var gp=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},hX=class zP{constructor(t,n,r,o,l,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=o,this.startWidth=l,this.endWidth=c}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,o=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new zP(t[1],r,o,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const o=t.x-n.x,l=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(o*o+l*l),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,T=n.y-j.y;return{c1:new gp(f.x+C,f.y+T),c2:new gp(p.x+C,p.y+T)}}length(){let n=0,r,o;for(let l=0;l<=10;l+=1){const c=l/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(l>0){const p=d-r,m=f-o;n+=Math.sqrt(p*p+m*m)}r=d,o=f}return n}point(t,n,r,o,l){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*o*(1-t)*t*t+l*t*t*t}},pX=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function mX(e,t=250){let n=0,r=null,o,l,c;const d=()=>{n=Date.now(),r=null,o=e.apply(l,c),r||(l=null,c=[])};return function(...p){const m=Date.now(),g=t-(m-n);return l=this,c=p,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,o=e.apply(l,c),r||(l=null,c=[])):r||(r=window.setTimeout(d,g)),o}}var gX=class Sx extends pX{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??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=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?mX(Sx.prototype._strokeUpdate,this.throttle):Sx.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()}dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;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._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){const t=this._data,n=this._dataUrl,r=this._dataUrlOptions;this.clear(),n&&this.fromDataURL(n,r),this.fromData(t,{clear:!1})}fromDataURL(t,n={}){return new Promise((r,o)=>{const l=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()),l.onload=()=>{this._ctx.drawImage(l,p,m,d,f),r()},l.onerror=g=>{o(g)},l.crossOrigin="anonymous",l.src=t,this._isEmpty=!1,this._dataUrl=t,this._dataUrlOptions={...n}})}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(){const t=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}_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 o=this._getPointGroupOptions(),l={...o,points:[]};this._data.push(l),this._reset(o),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],o=r.points,l=o.length>0&&o[o.length-1],c=l?n.distanceTo(l)<=this.minDistance:!1,d=this._getPointGroupOptions(r);if(!l||!(l&&c)){const f=this._addPoint(n,d);l?f&&this._drawCurve(f,d):this._drawDot(n,d),o.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 o=this.canvas.getBoundingClientRect();return new gp(t-o.left,n-o.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 o=this._calculateCurveWidths(r[1],r[2],n),l=hX.fromPoints(r,o);return r.shift(),l}return null}_calculateCurveWidths(t,n,r){const o=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,l=this._strokeWidth(o,r),c={end:l,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=l,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const o=this._ctx;o.moveTo(t,n),o.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,o=t.endWidth-t.startWidth,l=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<l;c+=1){const d=c/l,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*o,n.maxWidth);this._drawCurveSegment(b,w,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,o=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,o),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const o of t){const{points:l}=o,c=this._getPointGroupOptions(o);if(l.length>1)for(let d=0;d<l.length;d+=1){const f=l[d],p=new gp(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(l[0],c)}}toSVG({includeBackgroundColor:t=!1,includeDataUrl:n=!1}={}){const r=this._data,o=Math.max(window.devicePixelRatio||1,1),l=0,c=0,d=this.canvas.width/o,f=this.canvas.height/o,p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),p.setAttribute("viewBox",`${l} ${c} ${d} ${f}`),p.setAttribute("width",d.toString()),p.setAttribute("height",f.toString()),t&&this.backgroundColor){const m=document.createElement("rect");m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("fill",this.backgroundColor),p.appendChild(m)}if(n&&this._dataUrl){const m=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,g=this._dataUrlOptions?.width||this.canvas.width/m,x=this._dataUrlOptions?.height||this.canvas.height/m,b=this._dataUrlOptions?.xOffset||0,w=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",b.toString()),j.setAttribute("y",w.toString()),j.setAttribute("width",g.toString()),j.setAttribute("height",x.toString()),j.setAttribute("preserveAspectRatio","none"),j.setAttribute("href",this._dataUrl),p.appendChild(j)}return this._fromData(r,(m,{penColor:g})=>{const x=document.createElement("path");if(!isNaN(m.control1.x)&&!isNaN(m.control1.y)&&!isNaN(m.control2.x)&&!isNaN(m.control2.y)){const b=`M ${m.startPoint.x.toFixed(3)},${m.startPoint.y.toFixed(3)} C ${m.control1.x.toFixed(3)},${m.control1.y.toFixed(3)} ${m.control2.x.toFixed(3)},${m.control2.y.toFixed(3)} ${m.endPoint.x.toFixed(3)},${m.endPoint.y.toFixed(3)}`;x.setAttribute("d",b),x.setAttribute("stroke-width",(m.endWidth*2.25).toFixed(3)),x.setAttribute("stroke",g),x.setAttribute("fill","none"),x.setAttribute("stroke-linecap","round"),p.appendChild(x)}},(m,{penColor:g,dotSize:x,minWidth:b,maxWidth:w})=>{const j=document.createElement("circle"),C=x>0?x:(b+w)/2;j.setAttribute("r",C.toString()),j.setAttribute("cx",m.x.toString()),j.setAttribute("cy",m.y.toString()),j.setAttribute("fill",g),p.appendChild(j)}),p.outerHTML}};function vX(e){const t=Re(),{width:n=500,height:r=200,defaultValue:o,who:l,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:Ji+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:l??Ht(t.getProfile()),data:p.current?.toDataURL().split(",")[1]})}if(f.current){const b=new gX(f.current);o?.data&&b.fromDataURL(o.data).catch(console.error),b.addEventListener("endStroke",x),p.current=b}return()=>{p.current&&p.current.removeEventListener("beginStroke",x)}},[t,o,l]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(Tr,{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(wm,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function $P(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(wx,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function yX(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx($P,{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 xX(e){const{formState:t,context:n,item:r,responseItem:o}=e,l=r.type!==xt.choice&&r.type!==xt.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs(Pt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Be,{gap:"xs",children:c?.map((d,f)=>a.jsx(mp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),l&&a.jsx(Dt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function wx(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx(Be,{children:r.map((l,c)=>{if(!AF(l,t.questionnaireResponse))return null;if(l.type===xt.display)return a.jsx("p",{children:l.text},`display-${l.id}-${c}`);const d=o.filter(f=>f.linkId===l.linkId);return l.type===xt.group&&l.repeats?a.jsx(yX,{formState:t,context:n,item:l,responseItems:d},`repeating-group-${l.id}-${c}`):l.type===xt.group?a.jsx($P,{formState:t,context:n,item:l,responseItem:d[0]},`group-${l.id}-${c}`):l.type===xt.boolean?a.jsx(mp,{formState:t,context:n,item:l,responseItem:d[0],index:0},`boolean-item-${l.id}-${c}`):l.repeats?a.jsx(xX,{formState:t,context:n,item:l,responseItem:d[0]},`repeating-item-${l.id}-${c}`):a.jsx(Pt,{htmlFor:l.linkId,title:l.text,withAsterisk:l.required,children:a.jsx(mp,{formState:t,context:n,item:l,responseItem:d[0],index:0})},`repeating-item-${l.id}-${c}`)})})}function bX(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:o}=e,l=t.pages,c=t.activePage,d=c>0,f=c<l.length-1,p=c===l.length-1;return a.jsxs(a.Fragment,{children:[a.jsx(Mc,{active:c,allowNextStepsSelect:!1,p:6,children:l.map((m,g)=>a.jsx(Mc.Step,{label:m.title,children:g===c&&o},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(vr,{children:n??"Submit"})]})]})}function UP(e){const t=Re(),[n,r]=v.useState(!1),o=v.useRef(e);o.current=e;const l=v.useCallback(g=>{r(!1),o.current.onChange?.(g)},[]),c=FF({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:l}),d=v.useRef(c);d.current=c;const f=v.useMemo(()=>c.loading?!1:!!Do(c.questionnaire,_F),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===$h),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const x=o.current.onSubmit;if(!x)return;if(f&&!p){r(!0);return}const b=g.questionnaire,w=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const T=t.getProfile();T&&(C=Ht(T))}x({...w,questionnaire:b.url??_t(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(ut,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Ie,{children:c.questionnaire.title}),c.pagination?a.jsx(bX,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(wx,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(wx,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Be,{mt:"md",gap:0,children:[a.jsx(Te,{size:"sm",fw:500,children:"Signature"}),a.jsx(vX,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(Te,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(ye,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(vr,{children:e.submitButtonText??"Submit"})})]})]})}const SX="_section_4m5it_1",wX={section:SX},jX=["gender","age","gestationalAge","context","appliesTo","category"],CX={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function EX(e){e=Object.assign(CX,e);const t=e.definition,[n,r]=v.useState([]),[o,l]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const w=_X(t,d);r(DX(w.qualifiedInterval||[],l))},[t]),a.jsxs(ut,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Be,{children:n.map(w=>a.jsx(TX,{unit:PX(t.quantitativeDetails?.unit),onChange:g,onAdd:x,onRemove:b,onRemoveGroup:m,intervalGroup:w},`group-${w.id}`))}),a.jsx(bn,{title:"Add Group",variant:"subtle",size:"sm",onClick:w=>{cn(w),p({id:`group-id-${o}`,filters:{},intervals:[]}),l(j=>j+1)},children:a.jsx(cp,{})}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vr,{children:"Save"})})]});function f(){const w=n.flatMap(j=>j.intervals).filter(j=>!kX(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 T=C.find(R=>R.id===w),E=T?.intervals.findIndex(R=>R.id===j.id);return E!==void 0&&T?.intervals[E]&&(T.intervals[E]=j),C})}function x(w,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const T=C.findIndex(E=>E.id===w);if(T!==-1){const E={...C[T]};j={...j,...E.filters},E.intervals=[...E.intervals,j],C[T]=E}return C})}function b(w,j){r(C=>{C=[...C];const T=C.find(E=>E.id===w);return T&&(T.intervals=T.intervals.filter(E=>E.id!==j.id)),C})}}function TX(e){const{intervalGroup:t,unit:n}=e;return a.jsx(eu,{"data-testid":t.id,className:wX.section,children:a.jsxs(Be,{gap:"lg",children:[a.jsx(ye,{justify:"flex-end",children:a.jsx(bn,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{cn(r),e.onRemoveGroup(t)},children:a.jsx(lp,{})},`remove-group-button-${t.id}`)}),a.jsx(RX,{intervalGroup:t,onChange:e.onChange}),a.jsx(pn,{}),t.intervals.map(r=>a.jsxs(Be,{gap:"xs",children:[a.jsxs(ye,{children:[a.jsx(Ve,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{cn(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(bn,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{cn(o),e.onRemove(t.id,r)},children:a.jsx(lp,{})},`remove-interval-${r.id}`)]}),a.jsx(Kb,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(bn,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{cn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(cp,{})})]})})}function RX(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(Be,{style:{maxWidth:"50%"},children:[a.jsx(ye,{children:a.jsx(on,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const o of t.intervals){let l=r.currentTarget.value;l===""&&(l=void 0),n(t.id,{...o,gender:l})}}})}),a.jsxs(ye,{gap:"xs",children:[a.jsx(Te,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(Kb,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const o of t.intervals)n(t.id,{...o,age:r})}},`age-${t.id}`)})]}),a.jsx(on,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:t.filters.context?.text||"",onChange:r=>{for(const o of t.intervals){let l=r.currentTarget.value;l===""?(l=void 0,n(t.id,{...o,context:void 0})):n(t.id,{...o,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(on,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:r=>{for(const o of t.intervals){const l=r.currentTarget.value;l===""?n(t.id,{...o,category:void 0}):n(t.id,{...o,category:l})}}})]})}function _X(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{const l=parseInt(o.id?.substring(3)||"",10);return isNaN(l)?Number.NEGATIVE_INFINITY:l}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function DX(e,t){let n=1;const r={};for(const o of e){const l=AX(o);l in r||(r[l]={id:`group-id-${n++}`,filters:Object.fromEntries(jX.map(c=>[c,o[c]])),intervals:[]}),r[l].intervals.push(o)}return t(n),Object.values(r)}function AX(e){return[`gender=${e.gender}`,`age=${md(e.age)}`,`gestationalAge=${md(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function PX(e){return e&&(IU(e,"http://unitsofmeasure.org")||e.text)}function kX(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function NX(e){const t=Re(),n=Gt(e.value),[r,o]=v.useState(!1),[l,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),o(!0))},[t,n,r]),!n||!l)return null;return a.jsx(hr,{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(hr.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(_H,{}):a.jsx(Qq,{color:"gray"})}),a.jsxs(hr.Col,{span:9,p:"xs",children:[a.jsx(Te,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(jl,{value:g?.meta?.author})," on ",mr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(Rm,{status:g?.status||"unknown"})]})]}),a.jsxs(hr.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 l?.entry??[])if(m.resource&&p.reference===_t(m.resource))return m.resource}}function BP(e,t){const n=OX(e,t);return MX(n,e,t)}function OX(e,t){const n=e.length,r=t.length,o=n+r+1,l=1+2*o,c=l/2|0,d=new Array(l);d[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<o;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 T=C-p,E={i:C,j:T,prev:LX(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>E.i&&(E={i:C,j:T,prev:E,snake:!0}),d[m]=E,C>=n&&T>=r)return d[m]}d[c+f-1]=void 0}}function MX(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o?.prev&&o.prev.j>=0;){const l=o.i,c=o.j;o=o.prev;const d=o.i,f=o.j,p={position:d,lines:t.slice(d,l)},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}),o.snake&&(o=o.prev)}return r}function LX(e){return e&&!e.snake&&e.prev?e.prev:e}function IX(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:Ki(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return zX(n,t),$X(n),n}function zX(e,t){for(let n=1;n<t.length;n++){const r=BP(t[n-1].lines,t[n].lines);for(const o of r){const l=o.original.position,c=o.original.lines,d=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(l,c.length),o.type==="insert"||o.type==="change")for(let f=0;f<o.revised.lines.length;f++)e.splice(l+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function $X(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 UX="_container_1tyf3_1",BX="_root_1tyf3_5",VX="_startRow_1tyf3_20",FX="_normalRow_1tyf3_25",HX="_author_1tyf3_30",qX="_dateTime_1tyf3_34",GX="_lineNumber_1tyf3_40",QX="_line_1tyf3_40",WX="_pre_1tyf3_55",ta={container:UX,root:BX,startRow:VX,normalRow:FX,author:HX,dateTime:qX,lineNumber:GX,line:QX,pre:WX};function YX(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function KX(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return yc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return yc(r,"month");const o=Math.floor(t/86400);if(o>0)return yc(o,"day");const l=Math.floor(t/3600);if(l>0)return yc(l,"hour");const c=Math.floor(t/60);return c>0?yc(c,"minute"):yc(t,"second")}function yc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function XX(e){const t=Re(),[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 o=n.entry?.[0]?.resource;if(!o)return null;const l=IX(n);return a.jsx("div",{className:ta.container,children:a.jsx("table",{className:ta.root,children:a.jsx("tbody",{children:l.map((c,d)=>a.jsxs("tr",{className:c.span>0?ta.startRow:ta.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:ta.author,rowSpan:c.span,children:a.jsx(jl,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:ta.dateTime,rowSpan:c.span,children:a.jsx(mt,{to:YX(o,c.meta.versionId),fz:"xs",children:KX(c.meta.lastUpdated)})})]}),a.jsx("td",{className:ta.lineNumber,children:d+1}),a.jsx("td",{className:ta.line,children:a.jsx("pre",{className:ta.pre,children:c.value})})]},"row-"+d))})})})}const ZX="_removed_el5zk_1",JX="_added_el5zk_6",LT={removed:ZX,added:JX};function eZ(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=Ki(t,!0).match(/[^\r\n]+/g),o=Ki(n,!0).match(/[^\r\n]+/g),l=BP(r,o);return a.jsx("pre",{style:{color:"gray"},children:l.map((c,d)=>a.jsx(tZ,{delta:c},"delta"+d))})}function tZ(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:LT.removed,children:e.delta.original.lines.join(`
556
- `)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:LT.added,children:e.delta.revised.lines.join(`
557
- `)}),"...",a.jsx("br",{})]})}const nZ="_splitButton_1i0gi_1",rZ="_menuControl_1i0gi_6",IT={splitButton:nZ,menuControl:rZ};function vp(e){const{outcome:t}=e,n=Re(),r=Gt(e.defaultValue),o=r?.resourceType,[l,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=Sn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const w=Zc(b);if(w){c(!0);const j=lF(r,w);f(j)}else console.error(`Schema not found for ${b}`)}).catch(w=>{console.error("Error in requestProfileSchema",w)})}else n.requestSchema(o).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const g=v.useMemo(()=>r&&dA(r,Xs.READ,p),[p,r]),x=v.useMemo(()=>n.isSuperAdmin()||!p||!Rn(d?.resourceType)?!0:uV(p,d?.resourceType),[n,p,d?.resourceType]);return!l||!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(Be,{mb:"xl",children:[a.jsx(Pt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(Ve,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(Pt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(Ve,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(Jb,{path:d.resourceType,valuePath:d.resourceType,typeName:o,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:Ot((e.onPatch||e.onDelete)&&IT.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(je,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(je.Target,{children:a.jsx(bn,{variant:"filled",color:m.primaryColor,size:36,className:IT.menuControl,"aria-label":"More actions",children:a.jsx(zb,{size:14,stroke:1.5})})}),a.jsxs(je.Dropdown,{children:[e.onPatch&&a.jsx(je.Item,{leftSection:a.jsx(IA,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(je.Item,{color:"red",leftSection:a.jsx(wm,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs(ya,{color:"red",title:"Permission denied",icon:a.jsx(bl,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function iZ(e){const t=Re(),[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(fe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(fe.Thead,{children:a.jsxs(fe.Tr,{children:[a.jsx(fe.Th,{children:"Author"}),a.jsx(fe.Th,{children:"Date"}),a.jsx(fe.Th,{children:"Version"})]})}),a.jsx(fe.Tbody,{children:n.entry?.map((o,l)=>a.jsx(oZ,{entry:o},"entry-"+l))})]}):a.jsx("div",{children:"Loading..."})}function oZ(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:a.jsx(Tc,{value:n.meta?.author,link:!0})}),a.jsx(fe.Td,{children:mr(n.meta?.lastUpdated)}),a.jsx(fe.Td,{children:a.jsx(mt,{to:aZ(n),children:n.meta?.versionId})})]}):a.jsx(fe.Tr,{children:a.jsx(fe.Td,{colSpan:3,children:Ye(t?.outcome)})})}function aZ(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function sZ(e){const{serviceRequest:t,...n}=e;return a.jsx(_m,{value:t,loadTimelineResources:async(r,o,l)=>{const c=`${o}/${l}`,d=100;return Promise.allSettled([r.readHistory("ServiceRequest",l),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,o,l)=>({resourceType:"Communication",status:"completed",basedOn:[Ht(r)],subject:r.subject,sender:Ht(o),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(r,o,l)=>({resourceType:"Media",status:"completed",basedOn:[Ht(r)],subject:r.subject,operator:Ht(o),issued:new Date().toISOString(),content:l}),...n})}function lZ(e){const t=Re(),{client:n,patient:r,encounter:o,children:l,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",wb(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),Xn.assign(p.toString())}).catch(f=>Ne({color:"red",message:Ye(f),autoClose:!1}))}return a.jsx(Dt,{onClick:()=>d(),...c,children:l})}var _y={exports:{}},Ku={},Dy={exports:{}},Ay={};/**
558
- * @license React
559
- * scheduler.production.js
560
- *
561
- * Copyright (c) Meta Platforms, Inc. and affiliates.
562
- *
563
- * This source code is licensed under the MIT license found in the
564
- * LICENSE file in the root directory of this source tree.
565
- */var zT;function cZ(){return zT||(zT=1,(function(e){function t(O,I){var z=O.length;O.push(I);e:for(;0<z;){var F=z-1>>>1,K=O[F];if(0<o(K,I))O[F]=I,O[z]=K,z=F;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var I=O[0],z=O.pop();if(z!==I){O[0]=z;e:for(var F=0,K=O.length,L=K>>>1;F<L;){var q=2*(F+1)-1,ie=O[q],xe=q+1,ve=O[xe];if(0>o(ie,z))xe<K&&0>o(ve,ie)?(O[F]=ve,O[xe]=z,F=xe):(O[F]=ie,O[q]=z,F=q);else if(xe<K&&0>o(ve,z))O[F]=ve,O[xe]=z,F=xe;else break e}}return I}function o(O,I){var z=O.sortIndex-I.sortIndex;return z!==0?z:O.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.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,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function D(O){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=O)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function P(O){if(j=!1,D(O),!w)if(n(f)!==null)w=!0,A||(A=!0,Z());else{var I=n(p);I!==null&&Q(P,I.startTime-O)}}var A=!1,k=-1,M=5,$=-1;function U(){return C?!0:!(e.unstable_now()-$<M)}function J(){if(C=!1,A){var O=e.unstable_now();$=O;var I=!0;try{e:{w=!1,j&&(j=!1,E(k),k=-1),b=!0;var z=x;try{t:{for(D(O),g=n(f);g!==null&&!(g.expirationTime>O&&U());){var F=g.callback;if(typeof F=="function"){g.callback=null,x=g.priorityLevel;var K=F(g.expirationTime<=O);if(O=e.unstable_now(),typeof K=="function"){g.callback=K,D(O),I=!0;break t}g===n(f)&&r(f),D(O)}else r(f);g=n(f)}if(g!==null)I=!0;else{var L=n(p);L!==null&&Q(P,L.startTime-O),I=!1}}break e}finally{g=null,x=z,b=!1}I=void 0}}finally{I?Z():A=!1}}}var Z;if(typeof R=="function")Z=function(){R(J)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,H=Y.port2;Y.port1.onmessage=J,Z=function(){H.postMessage(null)}}else Z=function(){T(J,0)};function Q(O,I){k=T(function(){O(e.unstable_now())},I)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):M=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(O){switch(x){case 1:case 2:case 3:var I=3;break;default:I=x}var z=x;x=I;try{return O()}finally{x=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(O,I){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var z=x;x=O;try{return I()}finally{x=z}},e.unstable_scheduleCallback=function(O,I,z){var F=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?F+z:F):z=F,O){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=z+K,O={id:m++,callback:I,priorityLevel:O,startTime:z,expirationTime:K,sortIndex:-1},z>F?(O.sortIndex=z,t(p,O),n(f)===null&&O===n(p)&&(j?(E(k),k=-1):j=!0,Q(P,z-F))):(O.sortIndex=K,t(f,O),w||b||(w=!0,A||(A=!0,Z()))),O},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(O){var I=x;return function(){var z=x;x=I;try{return O.apply(this,arguments)}finally{x=z}}}})(Ay)),Ay}var $T;function uZ(){return $T||($T=1,Dy.exports=cZ()),Dy.exports}/**
566
- * @license React
567
- * react-dom-client.production.js
568
- *
569
- * Copyright (c) Meta Platforms, Inc. and affiliates.
570
- *
571
- * This source code is licensed under the MIT license found in the
572
- * LICENSE file in the root directory of this source tree.
573
- */var UT;function dZ(){if(UT)return Ku;UT=1;var e=uZ(),t=Mx(),n=a2();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function c(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(l(i)!==i)throw Error(r(188))}function p(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,h=s;;){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 f(y),i;if(S===h)return f(y),s;S=S.sibling}throw Error(r(188))}if(u.return!==h.return)u=y,h=S;else{for(var _=!1,N=y.child;N;){if(N===u){_=!0,u=y,h=S;break}if(N===h){_=!0,h=y,u=S;break}N=N.sibling}if(!_){for(N=S.child;N;){if(N===u){_=!0,u=S,h=y;break}if(N===h){_=!0,h=S,u=y;break}N=N.sibling}if(!_)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?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),U=Symbol.for("react.memo_cache_sentinel"),J=Symbol.iterator;function Z(i){return i===null||typeof i!="object"?null:(i=J&&i[J]||i["@@iterator"],typeof i=="function"?i:null)}var Y=Symbol.for("react.client.reference");function H(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Y?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case j:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case P:return"Suspense";case A:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case R:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case D:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case k:return s=i.displayName||null,s!==null?s:H(i.type)||"Memo";case M:s=i._payload,i=i._init;try{return H(i(s))}catch{}}return null}var Q=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},F=[],K=-1;function L(i){return{current:i}}function q(i){0>K||(i.current=F[K],F[K]=null,K--)}function ie(i,s){K++,F[K]=i.current,i.current=s}var xe=L(null),ve=L(null),Ce=L(null),Oe=L(null);function Ee(i,s){switch(ie(Ce,s),ie(ve,i),ie(xe,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Oj(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Oj(s),i=Mj(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}q(xe),ie(xe,i)}function Ge(){q(xe),q(ve),q(Ce)}function it(i){i.memoizedState!==null&&ie(Oe,i);var s=xe.current,u=Mj(s,i.type);s!==u&&(ie(ve,i),ie(xe,u))}function St(i){ve.current===i&&(q(xe),q(ve)),Oe.current===i&&(q(Oe),Uu._currentValue=z)}var kt,Mt;function ct(i){if(kt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);kt=s&&s[1]||"",Mt=-1<u.stack.indexOf(`
574
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
575
- `+kt+i+Mt}var bt=!1;function Qt(i,s){if(!i||bt)return"";bt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){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(se){var ne=se}Reflect.construct(i,[],pe)}else{try{pe.call()}catch(se){ne=se}i.call(pe.prototype)}}else{try{throw Error()}catch(se){ne=se}(pe=i())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.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(),_=S[0],N=S[1];if(_&&N){var V=_.split(`
576
- `),te=N.split(`
577
- `);for(y=h=0;h<V.length&&!V[h].includes("DetermineComponentFrameRoot");)h++;for(;y<te.length&&!te[y].includes("DetermineComponentFrameRoot");)y++;if(h===V.length||y===te.length)for(h=V.length-1,y=te.length-1;1<=h&&0<=y&&V[h]!==te[y];)y--;for(;1<=h&&0<=y;h--,y--)if(V[h]!==te[y]){if(h!==1||y!==1)do if(h--,y--,0>y||V[h]!==te[y]){var ue=`
578
- `+V[h].replace(" at new "," at ");return i.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",i.displayName)),ue}while(1<=h&&0<=y);break}}}finally{bt=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?ct(u):""}function Ae(i,s){switch(i.tag){case 26:case 27:case 5:return ct(i.type);case 16:return ct("Lazy");case 13:return i.child!==s&&s!==null?ct("Suspense Fallback"):ct("Suspense");case 19:return ct("SuspenseList");case 0:case 15:return Qt(i.type,!1);case 11:return Qt(i.type.render,!1);case 1:return Qt(i.type,!0);case 31:return ct("Activity");default:return""}}function De(i){try{var s="",u=null;do s+=Ae(i,u),u=i,i=i.return;while(i);return s}catch(h){return`
579
- Error generating stack: `+h.message+`
580
- `+h.stack}}var Ze=Object.prototype.hasOwnProperty,_e=e.unstable_scheduleCallback,ge=e.unstable_cancelCallback,Se=e.unstable_shouldYield,He=e.unstable_requestPaint,me=e.unstable_now,ze=e.unstable_getCurrentPriorityLevel,Nt=e.unstable_ImmediatePriority,Wt=e.unstable_UserBlockingPriority,jn=e.unstable_NormalPriority,Qn=e.unstable_LowPriority,Cn=e.unstable_IdlePriority,Ar=e.log,Jn=e.unstable_setDisableYieldValue,si=null,Wn=null;function xr(i){if(typeof Ar=="function"&&Jn(i),Wn&&typeof Wn.setStrictMode=="function")try{Wn.setStrictMode(si,i)}catch{}}var er=Math.clz32?Math.clz32:xs,Rl=Math.log,Ca=Math.LN2;function xs(i){return i>>>=0,i===0?32:31-(Rl(i)/Ca|0)|0}var li=256,to=262144,Pr=4194304;function En(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function No(i,s,u){var h=i.pendingLanes;if(h===0)return 0;var y=0,S=i.suspendedLanes,_=i.pingedLanes;i=i.warmLanes;var N=h&134217727;return N!==0?(h=N&~S,h!==0?y=En(h):(_&=N,_!==0?y=En(_):u||(u=N&~i,u!==0&&(y=En(u))))):(N=h&~S,N!==0?y=En(N):_!==0?y=En(_):u||(u=h&~i,u!==0&&(y=En(u)))),y===0?0:s!==0&&s!==y&&(s&S)===0&&(S=y&-y,u=s&-s,S>=u||S===32&&(u&4194048)!==0)?s:y}function Li(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Ea(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 _l(){var i=Pr;return Pr<<=1,(Pr&62914560)===0&&(Pr=4194304),i}function kn(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function B(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function X(i,s,u,h,y,S){var _=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var N=i.entanglements,V=i.expirationTimes,te=i.hiddenUpdates;for(u=_&~u;0<u;){var ue=31-er(u),pe=1<<ue;N[ue]=0,V[ue]=-1;var ne=te[ue];if(ne!==null)for(te[ue]=null,ue=0;ue<ne.length;ue++){var se=ne[ue];se!==null&&(se.lane&=-536870913)}u&=~pe}h!==0&&oe(i,h,0),S!==0&&y===0&&i.tag!==0&&(i.suspendedLanes|=S&~(_&~s))}function oe(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var h=31-er(s);i.entangledLanes|=s,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function we(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var h=31-er(u),y=1<<h;y&s|i[h]&s&&(i[h]|=s),u&=~y}}function Pe(i,s){var u=s&-s;return u=(u&42)!==0?1:Ke(u),(u&(i.suspendedLanes|s))!==0?0:u}function Ke(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Je(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function We(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:iC(i.type))}function rt(i,s){var u=I.p;try{return I.p=i,s()}finally{I.p=u}}var nt=Math.random().toString(36).slice(2),Me="__reactFiber$"+nt,Le="__reactProps$"+nt,qe="__reactContainer$"+nt,Lt="__reactEvents$"+nt,_n="__reactListeners$"+nt,tr="__reactHandles$"+nt,sn="__reactResources$"+nt,Bt="__reactMarker$"+nt;function Ii(i){delete i[Me],delete i[Le],delete i[Lt],delete i[_n],delete i[tr]}function ci(i){var s=i[Me];if(s)return s;for(var u=i.parentNode;u;){if(s=u[qe]||u[Me]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=Vj(i);i!==null;){if(u=i[Me])return u;i=Vj(i)}return s}i=u,u=i.parentNode}return null}function br(i){if(i=i[Me]||i[qe]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function lr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function no(i){var s=i[sn];return s||(s=i[sn]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function yn(i){i[Bt]=!0}var ro=new Set,bs={};function ui(i,s){yt(i,s),yt(i+"Capture",s)}function yt(i,s){for(bs[i]=s,i=0;i<s.length;i++)ro.add(s[i])}var Yn=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]*$"),Oo={},io={};function Nn(i){return Ze.call(io,i)?!0:Ze.call(Oo,i)?!1:Yn.test(i)?io[i]=!0:(Oo[i]=!0,!1)}function Mo(i,s,u){if(Nn(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Ss(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function zi(i,s,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+h)}}function di(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function TS(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Lk(i,s,u){var h=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var y=h.get,S=h.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return y.call(this)},set:function(_){u=""+_,S.call(this,_)}}),Object.defineProperty(i,s,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(_){u=""+_},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Lm(i){if(!i._valueTracker){var s=TS(i)?"checked":"value";i._valueTracker=Lk(i,s,""+i[s])}}function RS(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return i&&(h=TS(i)?i.checked?"true":"false":i.value),i=h,i!==u?(s.setValue(i),!0):!1}function tf(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Ik=/[\n"\\]/g;function fi(i){return i.replace(Ik,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Im(i,s,u,h,y,S,_,N){i.name="",_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?i.type=_:i.removeAttribute("type"),s!=null?_==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+di(s)):i.value!==""+di(s)&&(i.value=""+di(s)):_!=="submit"&&_!=="reset"||i.removeAttribute("value"),s!=null?zm(i,_,di(s)):u!=null?zm(i,_,di(u)):h!=null&&i.removeAttribute("value"),y==null&&S!=null&&(i.defaultChecked=!!S),y!=null&&(i.checked=y&&typeof y!="function"&&typeof y!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?i.name=""+di(N):i.removeAttribute("name")}function _S(i,s,u,h,y,S,_,N){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.type=S),s!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||s!=null)){Lm(i);return}u=u!=null?""+di(u):"",s=s!=null?""+di(s):u,N||s===i.value||(i.value=s),i.defaultValue=s}h=h??y,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=N?i.checked:!!h,i.defaultChecked=!!h,_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(i.name=_),Lm(i)}function zm(i,s,u){s==="number"&&tf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Dl(i,s,u,h){if(i=i.options,s){s={};for(var y=0;y<u.length;y++)s["$"+u[y]]=!0;for(u=0;u<i.length;u++)y=s.hasOwnProperty("$"+i[u].value),i[u].selected!==y&&(i[u].selected=y),y&&h&&(i[u].defaultSelected=!0)}else{for(u=""+di(u),s=null,y=0;y<i.length;y++){if(i[y].value===u){i[y].selected=!0,h&&(i[y].defaultSelected=!0);return}s!==null||i[y].disabled||(s=i[y])}s!==null&&(s.selected=!0)}}function DS(i,s,u){if(s!=null&&(s=""+di(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+di(u):""}function AS(i,s,u,h){if(s==null){if(h!=null){if(u!=null)throw Error(r(92));if(Q(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=di(s),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),Lm(i)}function Al(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var zk=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 PS(i,s,u){var h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":h?i.setProperty(s,u):typeof u!="number"||u===0||zk.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function kS(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var y in s)h=s[y],s.hasOwnProperty(y)&&u[y]!==h&&PS(i,y,h)}else for(var S in s)s.hasOwnProperty(S)&&PS(i,S,s[S])}function $m(i){if(i.indexOf("-")===-1)return!1;switch(i){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var $k=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"]]),Uk=/^[\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 nf(i){return Uk.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Lo(){}var Um=null;function Bm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Pl=null,kl=null;function NS(i){var s=br(i);if(s&&(i=s.stateNode)){var u=i[Le]||null;e:switch(i=s.stateNode,s.type){case"input":if(Im(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+fi(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==i&&h.form===i.form){var y=h[Le]||null;if(!y)throw Error(r(90));Im(h,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===i.form&&RS(h)}break e;case"textarea":DS(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Dl(i,!!u.multiple,s,!1)}}}var Vm=!1;function OS(i,s,u){if(Vm)return i(s,u);Vm=!0;try{var h=i(s);return h}finally{if(Vm=!1,(Pl!==null||kl!==null)&&(Hf(),Pl&&(s=Pl,i=kl,kl=Pl=null,NS(s),i)))for(s=0;s<i.length;s++)NS(i[s])}}function ru(i,s){var u=i.stateNode;if(u===null)return null;var h=u[Le]||null;if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var Io=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fm=!1;if(Io)try{var iu={};Object.defineProperty(iu,"passive",{get:function(){Fm=!0}}),window.addEventListener("test",iu,iu),window.removeEventListener("test",iu,iu)}catch{Fm=!1}var Ta=null,Hm=null,rf=null;function MS(){if(rf)return rf;var i,s=Hm,u=s.length,h,y="value"in Ta?Ta.value:Ta.textContent,S=y.length;for(i=0;i<u&&s[i]===y[i];i++);var _=u-i;for(h=1;h<=_&&s[u-h]===y[S-h];h++);return rf=y.slice(i,1<h?1-h:void 0)}function of(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function af(){return!0}function LS(){return!1}function kr(i){function s(u,h,y,S,_){this._reactName=u,this._targetInst=y,this.type=h,this.nativeEvent=S,this.target=_,this.currentTarget=null;for(var N in i)i.hasOwnProperty(N)&&(u=i[N],this[N]=u?u(S):S[N]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?af:LS,this.isPropagationStopped=LS,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=af)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=af)},persist:function(){},isPersistent:af}),s}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},sf=kr(ws),ou=g({},ws,{view:0,detail:0}),Bk=kr(ou),qm,Gm,au,lf=g({},ou,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wm,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==au&&(au&&i.type==="mousemove"?(qm=i.screenX-au.screenX,Gm=i.screenY-au.screenY):Gm=qm=0,au=i),qm)},movementY:function(i){return"movementY"in i?i.movementY:Gm}}),IS=kr(lf),Vk=g({},lf,{dataTransfer:0}),Fk=kr(Vk),Hk=g({},ou,{relatedTarget:0}),Qm=kr(Hk),qk=g({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),Gk=kr(qk),Qk=g({},ws,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),Wk=kr(Qk),Yk=g({},ws,{data:0}),zS=kr(Yk),Kk={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Xk={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"},Zk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Jk(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=Zk[i])?!!s[i]:!1}function Wm(){return Jk}var eN=g({},ou,{key:function(i){if(i.key){var s=Kk[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=of(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?Xk[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wm,charCode:function(i){return i.type==="keypress"?of(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?of(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),tN=kr(eN),nN=g({},lf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),$S=kr(nN),rN=g({},ou,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wm}),iN=kr(rN),oN=g({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),aN=kr(oN),sN=g({},lf,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),lN=kr(sN),cN=g({},ws,{newState:0,oldState:0}),uN=kr(cN),dN=[9,13,27,32],Ym=Io&&"CompositionEvent"in window,su=null;Io&&"documentMode"in document&&(su=document.documentMode);var fN=Io&&"TextEvent"in window&&!su,US=Io&&(!Ym||su&&8<su&&11>=su),BS=" ",VS=!1;function FS(i,s){switch(i){case"keyup":return dN.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function HS(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Nl=!1;function hN(i,s){switch(i){case"compositionend":return HS(s);case"keypress":return s.which!==32?null:(VS=!0,BS);case"textInput":return i=s.data,i===BS&&VS?null:i;default:return null}}function pN(i,s){if(Nl)return i==="compositionend"||!Ym&&FS(i,s)?(i=MS(),rf=Hm=Ta=null,Nl=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return US&&s.locale!=="ko"?null:s.data;default:return null}}var mN={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 qS(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!mN[i.type]:s==="textarea"}function GS(i,s,u,h){Pl?kl?kl.push(h):kl=[h]:Pl=h,s=Xf(s,"onChange"),0<s.length&&(u=new sf("onChange","change",null,u,h),i.push({event:u,listeners:s}))}var lu=null,cu=null;function gN(i){_j(i,0)}function cf(i){var s=lr(i);if(RS(s))return i}function QS(i,s){if(i==="change")return s}var WS=!1;if(Io){var Km;if(Io){var Xm="oninput"in document;if(!Xm){var YS=document.createElement("div");YS.setAttribute("oninput","return;"),Xm=typeof YS.oninput=="function"}Km=Xm}else Km=!1;WS=Km&&(!document.documentMode||9<document.documentMode)}function KS(){lu&&(lu.detachEvent("onpropertychange",XS),cu=lu=null)}function XS(i){if(i.propertyName==="value"&&cf(cu)){var s=[];GS(s,cu,i,Bm(i)),OS(gN,s)}}function vN(i,s,u){i==="focusin"?(KS(),lu=s,cu=u,lu.attachEvent("onpropertychange",XS)):i==="focusout"&&KS()}function yN(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return cf(cu)}function xN(i,s){if(i==="click")return cf(s)}function bN(i,s){if(i==="input"||i==="change")return cf(s)}function SN(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Qr=typeof Object.is=="function"?Object.is:SN;function uu(i,s){if(Qr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var y=u[h];if(!Ze.call(s,y)||!Qr(i[y],s[y]))return!1}return!0}function ZS(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function JS(i,s){var u=ZS(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=s&&h>=s)return{node:u,offset:s-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=ZS(u)}}function e1(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?e1(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function t1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=tf(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=tf(i.document)}return s}function Zm(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var wN=Io&&"documentMode"in document&&11>=document.documentMode,Ol=null,Jm=null,du=null,eg=!1;function n1(i,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;eg||Ol==null||Ol!==tf(h)||(h=Ol,"selectionStart"in h&&Zm(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}),du&&uu(du,h)||(du=h,h=Xf(Jm,"onSelect"),0<h.length&&(s=new sf("onSelect","select",null,s,u),i.push({event:s,listeners:h}),s.target=Ol)))}function js(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var Ml={animationend:js("Animation","AnimationEnd"),animationiteration:js("Animation","AnimationIteration"),animationstart:js("Animation","AnimationStart"),transitionrun:js("Transition","TransitionRun"),transitionstart:js("Transition","TransitionStart"),transitioncancel:js("Transition","TransitionCancel"),transitionend:js("Transition","TransitionEnd")},tg={},r1={};Io&&(r1=document.createElement("div").style,"AnimationEvent"in window||(delete Ml.animationend.animation,delete Ml.animationiteration.animation,delete Ml.animationstart.animation),"TransitionEvent"in window||delete Ml.transitionend.transition);function Cs(i){if(tg[i])return tg[i];if(!Ml[i])return i;var s=Ml[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in r1)return tg[i]=s[u];return i}var i1=Cs("animationend"),o1=Cs("animationiteration"),a1=Cs("animationstart"),jN=Cs("transitionrun"),CN=Cs("transitionstart"),EN=Cs("transitioncancel"),s1=Cs("transitionend"),l1=new Map,ng="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(" ");ng.push("scrollEnd");function $i(i,s){l1.set(i,s),ui(s,[i])}var uf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},hi=[],Ll=0,rg=0;function df(){for(var i=Ll,s=rg=Ll=0;s<i;){var u=hi[s];hi[s++]=null;var h=hi[s];hi[s++]=null;var y=hi[s];hi[s++]=null;var S=hi[s];if(hi[s++]=null,h!==null&&y!==null){var _=h.pending;_===null?y.next=y:(y.next=_.next,_.next=y),h.pending=y}S!==0&&c1(u,y,S)}}function ff(i,s,u,h){hi[Ll++]=i,hi[Ll++]=s,hi[Ll++]=u,hi[Ll++]=h,rg|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function ig(i,s,u,h){return ff(i,s,u,h),hf(i)}function Es(i,s){return ff(i,null,null,s),hf(i)}function c1(i,s,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var y=!1,S=i.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.childLanes|=u),S.tag===22&&(i=S.stateNode,i===null||i._visibility&1||(y=!0)),i=S,S=S.return;return i.tag===3?(S=i.stateNode,y&&s!==null&&(y=31-er(u),i=S.hiddenUpdates,h=i[y],h===null?i[y]=[s]:h.push(s),s.lane=u|536870912),S):null}function hf(i){if(50<Nu)throw Nu=0,hv=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Il={};function TN(i,s,u,h){this.tag=i,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=s,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 Wr(i,s,u,h){return new TN(i,s,u,h)}function og(i){return i=i.prototype,!(!i||!i.isReactComponent)}function zo(i,s){var u=i.alternate;return u===null?(u=Wr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function u1(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function pf(i,s,u,h,y,S){var _=0;if(h=i,typeof i=="function")og(i)&&(_=1);else if(typeof i=="string")_=P3(i,u,xe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=Wr(31,u,s,y),i.elementType=$,i.lanes=S,i;case j:return Ts(u.children,y,S,s);case C:_=8,y|=24;break;case T:return i=Wr(12,u,s,y|2),i.elementType=T,i.lanes=S,i;case P:return i=Wr(13,u,s,y),i.elementType=P,i.lanes=S,i;case A:return i=Wr(19,u,s,y),i.elementType=A,i.lanes=S,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:_=10;break e;case E:_=9;break e;case D:_=11;break e;case k:_=14;break e;case M:_=16,h=null;break e}_=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return s=Wr(_,u,s,y),s.elementType=i,s.type=h,s.lanes=S,s}function Ts(i,s,u,h){return i=Wr(7,i,h,s),i.lanes=u,i}function ag(i,s,u){return i=Wr(6,i,null,s),i.lanes=u,i}function d1(i){var s=Wr(18,null,null,0);return s.stateNode=i,s}function sg(i,s,u){return s=Wr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var f1=new WeakMap;function pi(i,s){if(typeof i=="object"&&i!==null){var u=f1.get(i);return u!==void 0?u:(s={value:i,source:s,stack:De(s)},f1.set(i,s),s)}return{value:i,source:s,stack:De(s)}}var zl=[],$l=0,mf=null,fu=0,mi=[],gi=0,Ra=null,oo=1,ao="";function $o(i,s){zl[$l++]=fu,zl[$l++]=mf,mf=i,fu=s}function h1(i,s,u){mi[gi++]=oo,mi[gi++]=ao,mi[gi++]=Ra,Ra=i;var h=oo;i=ao;var y=32-er(h)-1;h&=~(1<<y),u+=1;var S=32-er(s)+y;if(30<S){var _=y-y%5;S=(h&(1<<_)-1).toString(32),h>>=_,y-=_,oo=1<<32-er(s)+y|u<<y|h,ao=S+i}else oo=1<<S|u<<y|h,ao=i}function lg(i){i.return!==null&&($o(i,1),h1(i,1,0))}function cg(i){for(;i===mf;)mf=zl[--$l],zl[$l]=null,fu=zl[--$l],zl[$l]=null;for(;i===Ra;)Ra=mi[--gi],mi[gi]=null,ao=mi[--gi],mi[gi]=null,oo=mi[--gi],mi[gi]=null}function p1(i,s){mi[gi++]=oo,mi[gi++]=ao,mi[gi++]=Ra,oo=s.id,ao=s.overflow,Ra=i}var nr=null,dn=null,Rt=!1,_a=null,vi=!1,ug=Error(r(519));function Da(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw hu(pi(s,i)),ug}function m1(i){var s=i.stateNode,u=i.type,h=i.memoizedProps;switch(s[Me]=i,s[Le]=h,u){case"dialog":jt("cancel",s),jt("close",s);break;case"iframe":case"object":case"embed":jt("load",s);break;case"video":case"audio":for(u=0;u<Mu.length;u++)jt(Mu[u],s);break;case"source":jt("error",s);break;case"img":case"image":case"link":jt("error",s),jt("load",s);break;case"details":jt("toggle",s);break;case"input":jt("invalid",s),_S(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":jt("invalid",s);break;case"textarea":jt("invalid",s),AS(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||kj(s.textContent,u)?(h.popover!=null&&(jt("beforetoggle",s),jt("toggle",s)),h.onScroll!=null&&jt("scroll",s),h.onScrollEnd!=null&&jt("scrollend",s),h.onClick!=null&&(s.onclick=Lo),s=!0):s=!1,s||Da(i,!0)}function g1(i){for(nr=i.return;nr;)switch(nr.tag){case 5:case 31:case 13:vi=!1;return;case 27:case 3:vi=!0;return;default:nr=nr.return}}function Ul(i){if(i!==nr)return!1;if(!Rt)return g1(i),Rt=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||_v(i.type,i.memoizedProps)),u=!u),u&&dn&&Da(i),g1(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));dn=Bj(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));dn=Bj(i)}else s===27?(s=dn,Fa(i.type)?(i=Nv,Nv=null,dn=i):dn=s):dn=nr?xi(i.stateNode.nextSibling):null;return!0}function Rs(){dn=nr=null,Rt=!1}function dg(){var i=_a;return i!==null&&(Lr===null?Lr=i:Lr.push.apply(Lr,i),_a=null),i}function hu(i){_a===null?_a=[i]:_a.push(i)}var fg=L(null),_s=null,Uo=null;function Aa(i,s,u){ie(fg,s._currentValue),s._currentValue=u}function Bo(i){i._currentValue=fg.current,q(fg)}function hg(i,s,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),i===u)break;i=i.return}}function pg(i,s,u,h){var y=i.child;for(y!==null&&(y.return=i);y!==null;){var S=y.dependencies;if(S!==null){var _=y.child;S=S.firstContext;e:for(;S!==null;){var N=S;S=y;for(var V=0;V<s.length;V++)if(N.context===s[V]){S.lanes|=u,N=S.alternate,N!==null&&(N.lanes|=u),hg(S.return,u,i),h||(_=null);break e}S=N.next}}else if(y.tag===18){if(_=y.return,_===null)throw Error(r(341));_.lanes|=u,S=_.alternate,S!==null&&(S.lanes|=u),hg(_,u,i),_=null}else _=y.child;if(_!==null)_.return=y;else for(_=y;_!==null;){if(_===i){_=null;break}if(y=_.sibling,y!==null){y.return=_.return,_=y;break}_=_.return}y=_}}function Bl(i,s,u,h){i=null;for(var y=s,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 _=y.alternate;if(_===null)throw Error(r(387));if(_=_.memoizedProps,_!==null){var N=y.type;Qr(y.pendingProps.value,_.value)||(i!==null?i.push(N):i=[N])}}else if(y===Oe.current){if(_=y.alternate,_===null)throw Error(r(387));_.memoizedState.memoizedState!==y.memoizedState.memoizedState&&(i!==null?i.push(Uu):i=[Uu])}y=y.return}i!==null&&pg(s,i,u,h),s.flags|=262144}function gf(i){for(i=i.firstContext;i!==null;){if(!Qr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Ds(i){_s=i,Uo=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function rr(i){return v1(_s,i)}function vf(i,s){return _s===null&&Ds(i),v1(i,s)}function v1(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Uo===null){if(i===null)throw Error(r(308));Uo=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Uo=Uo.next=s;return u}var RN=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},_N=e.unstable_scheduleCallback,DN=e.unstable_NormalPriority,Bn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function mg(){return{controller:new RN,data:new Map,refCount:0}}function pu(i){i.refCount--,i.refCount===0&&_N(DN,function(){i.controller.abort()})}var mu=null,gg=0,Vl=0,Fl=null;function AN(i,s){if(mu===null){var u=mu=[];gg=0,Vl=xv(),Fl={status:"pending",value:void 0,then:function(h){u.push(h)}}}return gg++,s.then(y1,y1),s}function y1(){if(--gg===0&&mu!==null){Fl!==null&&(Fl.status="fulfilled");var i=mu;mu=null,Vl=0,Fl=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function PN(i,s){var u=[],h={status:"pending",value:null,reason:null,then:function(y){u.push(y)}};return i.then(function(){h.status="fulfilled",h.value=s;for(var y=0;y<u.length;y++)(0,u[y])(s)},function(y){for(h.status="rejected",h.reason=y,y=0;y<u.length;y++)(0,u[y])(void 0)}),h}var x1=O.S;O.S=function(i,s){nj=me(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&AN(i,s),x1!==null&&x1(i,s)};var As=L(null);function vg(){var i=As.current;return i!==null?i:tn.pooledCache}function yf(i,s){s===null?ie(As,As.current):ie(As,s.pool)}function b1(){var i=vg();return i===null?null:{parent:Bn._currentValue,pool:i}}var Hl=Error(r(460)),yg=Error(r(474)),xf=Error(r(542)),bf={then:function(){}};function S1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function w1(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(Lo,Lo),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,C1(i),i;default:if(typeof s.status=="string")s.then(Lo,Lo);else{if(i=tn,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(h){if(s.status==="pending"){var y=s;y.status="fulfilled",y.value=h}},function(h){if(s.status==="pending"){var y=s;y.status="rejected",y.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,C1(i),i}throw ks=s,Hl}}function Ps(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(ks=u,Hl):u}}var ks=null;function j1(){if(ks===null)throw Error(r(459));var i=ks;return ks=null,i}function C1(i){if(i===Hl||i===xf)throw Error(r(483))}var ql=null,gu=0;function Sf(i){var s=gu;return gu+=1,ql===null&&(ql=[]),w1(ql,i,s)}function vu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function wf(i,s){throw s.$$typeof===x?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function E1(i){function s(W,G){if(i){var ee=W.deletions;ee===null?(W.deletions=[G],W.flags|=16):ee.push(G)}}function u(W,G){if(!i)return null;for(;G!==null;)s(W,G),G=G.sibling;return null}function h(W){for(var G=new Map;W!==null;)W.key!==null?G.set(W.key,W):G.set(W.index,W),W=W.sibling;return G}function y(W,G){return W=zo(W,G),W.index=0,W.sibling=null,W}function S(W,G,ee){return W.index=ee,i?(ee=W.alternate,ee!==null?(ee=ee.index,ee<G?(W.flags|=67108866,G):ee):(W.flags|=67108866,G)):(W.flags|=1048576,G)}function _(W){return i&&W.alternate===null&&(W.flags|=67108866),W}function N(W,G,ee,he){return G===null||G.tag!==6?(G=ag(ee,W.mode,he),G.return=W,G):(G=y(G,ee),G.return=W,G)}function V(W,G,ee,he){var ot=ee.type;return ot===j?ue(W,G,ee.props.children,he,ee.key):G!==null&&(G.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===M&&Ps(ot)===G.type)?(G=y(G,ee.props),vu(G,ee),G.return=W,G):(G=pf(ee.type,ee.key,ee.props,null,W.mode,he),vu(G,ee),G.return=W,G)}function te(W,G,ee,he){return G===null||G.tag!==4||G.stateNode.containerInfo!==ee.containerInfo||G.stateNode.implementation!==ee.implementation?(G=sg(ee,W.mode,he),G.return=W,G):(G=y(G,ee.children||[]),G.return=W,G)}function ue(W,G,ee,he,ot){return G===null||G.tag!==7?(G=Ts(ee,W.mode,he,ot),G.return=W,G):(G=y(G,ee),G.return=W,G)}function pe(W,G,ee){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=ag(""+G,W.mode,ee),G.return=W,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return ee=pf(G.type,G.key,G.props,null,W.mode,ee),vu(ee,G),ee.return=W,ee;case w:return G=sg(G,W.mode,ee),G.return=W,G;case M:return G=Ps(G),pe(W,G,ee)}if(Q(G)||Z(G))return G=Ts(G,W.mode,ee,null),G.return=W,G;if(typeof G.then=="function")return pe(W,Sf(G),ee);if(G.$$typeof===R)return pe(W,vf(W,G),ee);wf(W,G)}return null}function ne(W,G,ee,he){var ot=G!==null?G.key:null;if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ot!==null?null:N(W,G,""+ee,he);if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ee.key===ot?V(W,G,ee,he):null;case w:return ee.key===ot?te(W,G,ee,he):null;case M:return ee=Ps(ee),ne(W,G,ee,he)}if(Q(ee)||Z(ee))return ot!==null?null:ue(W,G,ee,he,null);if(typeof ee.then=="function")return ne(W,G,Sf(ee),he);if(ee.$$typeof===R)return ne(W,G,vf(W,ee),he);wf(W,ee)}return null}function se(W,G,ee,he,ot){if(typeof he=="string"&&he!==""||typeof he=="number"||typeof he=="bigint")return W=W.get(ee)||null,N(G,W,""+he,ot);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case b:return W=W.get(he.key===null?ee:he.key)||null,V(G,W,he,ot);case w:return W=W.get(he.key===null?ee:he.key)||null,te(G,W,he,ot);case M:return he=Ps(he),se(W,G,ee,he,ot)}if(Q(he)||Z(he))return W=W.get(ee)||null,ue(G,W,he,ot,null);if(typeof he.then=="function")return se(W,G,ee,Sf(he),ot);if(he.$$typeof===R)return se(W,G,ee,vf(G,he),ot);wf(G,he)}return null}function Qe(W,G,ee,he){for(var ot=null,It=null,et=G,gt=G=0,Et=null;et!==null&&gt<ee.length;gt++){et.index>gt?(Et=et,et=null):Et=et.sibling;var zt=ne(W,et,ee[gt],he);if(zt===null){et===null&&(et=Et);break}i&&et&&zt.alternate===null&&s(W,et),G=S(zt,G,gt),It===null?ot=zt:It.sibling=zt,It=zt,et=Et}if(gt===ee.length)return u(W,et),Rt&&$o(W,gt),ot;if(et===null){for(;gt<ee.length;gt++)et=pe(W,ee[gt],he),et!==null&&(G=S(et,G,gt),It===null?ot=et:It.sibling=et,It=et);return Rt&&$o(W,gt),ot}for(et=h(et);gt<ee.length;gt++)Et=se(et,W,gt,ee[gt],he),Et!==null&&(i&&Et.alternate!==null&&et.delete(Et.key===null?gt:Et.key),G=S(Et,G,gt),It===null?ot=Et:It.sibling=Et,It=Et);return i&&et.forEach(function(Wa){return s(W,Wa)}),Rt&&$o(W,gt),ot}function st(W,G,ee,he){if(ee==null)throw Error(r(151));for(var ot=null,It=null,et=G,gt=G=0,Et=null,zt=ee.next();et!==null&&!zt.done;gt++,zt=ee.next()){et.index>gt?(Et=et,et=null):Et=et.sibling;var Wa=ne(W,et,zt.value,he);if(Wa===null){et===null&&(et=Et);break}i&&et&&Wa.alternate===null&&s(W,et),G=S(Wa,G,gt),It===null?ot=Wa:It.sibling=Wa,It=Wa,et=Et}if(zt.done)return u(W,et),Rt&&$o(W,gt),ot;if(et===null){for(;!zt.done;gt++,zt=ee.next())zt=pe(W,zt.value,he),zt!==null&&(G=S(zt,G,gt),It===null?ot=zt:It.sibling=zt,It=zt);return Rt&&$o(W,gt),ot}for(et=h(et);!zt.done;gt++,zt=ee.next())zt=se(et,W,gt,zt.value,he),zt!==null&&(i&&zt.alternate!==null&&et.delete(zt.key===null?gt:zt.key),G=S(zt,G,gt),It===null?ot=zt:It.sibling=zt,It=zt);return i&&et.forEach(function(V3){return s(W,V3)}),Rt&&$o(W,gt),ot}function en(W,G,ee,he){if(typeof ee=="object"&&ee!==null&&ee.type===j&&ee.key===null&&(ee=ee.props.children),typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:e:{for(var ot=ee.key;G!==null;){if(G.key===ot){if(ot=ee.type,ot===j){if(G.tag===7){u(W,G.sibling),he=y(G,ee.props.children),he.return=W,W=he;break e}}else if(G.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===M&&Ps(ot)===G.type){u(W,G.sibling),he=y(G,ee.props),vu(he,ee),he.return=W,W=he;break e}u(W,G);break}else s(W,G);G=G.sibling}ee.type===j?(he=Ts(ee.props.children,W.mode,he,ee.key),he.return=W,W=he):(he=pf(ee.type,ee.key,ee.props,null,W.mode,he),vu(he,ee),he.return=W,W=he)}return _(W);case w:e:{for(ot=ee.key;G!==null;){if(G.key===ot)if(G.tag===4&&G.stateNode.containerInfo===ee.containerInfo&&G.stateNode.implementation===ee.implementation){u(W,G.sibling),he=y(G,ee.children||[]),he.return=W,W=he;break e}else{u(W,G);break}else s(W,G);G=G.sibling}he=sg(ee,W.mode,he),he.return=W,W=he}return _(W);case M:return ee=Ps(ee),en(W,G,ee,he)}if(Q(ee))return Qe(W,G,ee,he);if(Z(ee)){if(ot=Z(ee),typeof ot!="function")throw Error(r(150));return ee=ot.call(ee),st(W,G,ee,he)}if(typeof ee.then=="function")return en(W,G,Sf(ee),he);if(ee.$$typeof===R)return en(W,G,vf(W,ee),he);wf(W,ee)}return typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint"?(ee=""+ee,G!==null&&G.tag===6?(u(W,G.sibling),he=y(G,ee),he.return=W,W=he):(u(W,G),he=ag(ee,W.mode,he),he.return=W,W=he),_(W)):u(W,G)}return function(W,G,ee,he){try{gu=0;var ot=en(W,G,ee,he);return ql=null,ot}catch(et){if(et===Hl||et===xf)throw et;var It=Wr(29,et,null,W.mode);return It.lanes=he,It.return=W,It}finally{}}}var Ns=E1(!0),T1=E1(!1),Pa=!1;function xg(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function bg(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function ka(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Na(i,s,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Vt&2)!==0){var y=h.pending;return y===null?s.next=s:(s.next=y.next,y.next=s),h.pending=s,s=hf(i),c1(i,null,u),s}return ff(i,h,s,u),hf(i)}function yu(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,we(i,u)}}function Sg(i,s){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var y=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var _={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?y=S=_:S=S.next=_,u=u.next}while(u!==null);S===null?y=S=s:S=S.next=s}else y=S=s;u={baseState:h.baseState,firstBaseUpdate:y,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var wg=!1;function xu(){if(wg){var i=Fl;if(i!==null)throw i}}function bu(i,s,u,h){wg=!1;var y=i.updateQueue;Pa=!1;var S=y.firstBaseUpdate,_=y.lastBaseUpdate,N=y.shared.pending;if(N!==null){y.shared.pending=null;var V=N,te=V.next;V.next=null,_===null?S=te:_.next=te,_=V;var ue=i.alternate;ue!==null&&(ue=ue.updateQueue,N=ue.lastBaseUpdate,N!==_&&(N===null?ue.firstBaseUpdate=te:N.next=te,ue.lastBaseUpdate=V))}if(S!==null){var pe=y.baseState;_=0,ue=te=V=null,N=S;do{var ne=N.lane&-536870913,se=ne!==N.lane;if(se?(Ct&ne)===ne:(h&ne)===ne){ne!==0&&ne===Vl&&(wg=!0),ue!==null&&(ue=ue.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Qe=i,st=N;ne=s;var en=u;switch(st.tag){case 1:if(Qe=st.payload,typeof Qe=="function"){pe=Qe.call(en,pe,ne);break e}pe=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=st.payload,ne=typeof Qe=="function"?Qe.call(en,pe,ne):Qe,ne==null)break e;pe=g({},pe,ne);break e;case 2:Pa=!0}}ne=N.callback,ne!==null&&(i.flags|=64,se&&(i.flags|=8192),se=y.callbacks,se===null?y.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:N.tag,payload:N.payload,callback:N.callback,next:null},ue===null?(te=ue=se,V=pe):ue=ue.next=se,_|=ne;if(N=N.next,N===null){if(N=y.shared.pending,N===null)break;se=N,N=se.next,se.next=null,y.lastBaseUpdate=se,y.shared.pending=null}}while(!0);ue===null&&(V=pe),y.baseState=V,y.firstBaseUpdate=te,y.lastBaseUpdate=ue,S===null&&(y.shared.lanes=0),za|=_,i.lanes=_,i.memoizedState=pe}}function R1(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function _1(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)R1(u[i],s)}var Gl=L(null),jf=L(0);function D1(i,s){i=Ko,ie(jf,i),ie(Gl,s),Ko=i|s.baseLanes}function jg(){ie(jf,Ko),ie(Gl,Gl.current)}function Cg(){Ko=jf.current,q(Gl),q(jf)}var Yr=L(null),yi=null;function Oa(i){var s=i.alternate;ie(On,On.current&1),ie(Yr,i),yi===null&&(s===null||Gl.current!==null||s.memoizedState!==null)&&(yi=i)}function Eg(i){ie(On,On.current),ie(Yr,i),yi===null&&(yi=i)}function A1(i){i.tag===22?(ie(On,On.current),ie(Yr,i),yi===null&&(yi=i)):Ma()}function Ma(){ie(On,On.current),ie(Yr,Yr.current)}function Kr(i){q(Yr),yi===i&&(yi=null),q(On)}var On=L(0);function Cf(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Pv(u)||kv(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Vo=0,pt=null,Zt=null,Vn=null,Ef=!1,Ql=!1,Os=!1,Tf=0,Su=0,Wl=null,kN=0;function Dn(){throw Error(r(321))}function Tg(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Qr(i[u],s[u]))return!1;return!0}function Rg(i,s,u,h,y,S){return Vo=S,pt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,O.H=i===null||i.memoizedState===null?hw:Vg,Os=!1,S=u(h,y),Os=!1,Ql&&(S=k1(s,u,h,y)),P1(i),S}function P1(i){O.H=Cu;var s=Zt!==null&&Zt.next!==null;if(Vo=0,Vn=Zt=pt=null,Ef=!1,Su=0,Wl=null,s)throw Error(r(300));i===null||Fn||(i=i.dependencies,i!==null&&gf(i)&&(Fn=!0))}function k1(i,s,u,h){pt=i;var y=0;do{if(Ql&&(Wl=null),Su=0,Ql=!1,25<=y)throw Error(r(301));if(y+=1,Vn=Zt=null,i.updateQueue!=null){var S=i.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}O.H=pw,S=s(u,h)}while(Ql);return S}function NN(){var i=O.H,s=i.useState()[0];return s=typeof s.then=="function"?wu(s):s,i=i.useState()[0],(Zt!==null?Zt.memoizedState:null)!==i&&(pt.flags|=1024),s}function _g(){var i=Tf!==0;return Tf=0,i}function Dg(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Ag(i){if(Ef){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Ef=!1}Vo=0,Vn=Zt=pt=null,Ql=!1,Su=Tf=0,Wl=null}function Sr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vn===null?pt.memoizedState=Vn=i:Vn=Vn.next=i,Vn}function Mn(){if(Zt===null){var i=pt.alternate;i=i!==null?i.memoizedState:null}else i=Zt.next;var s=Vn===null?pt.memoizedState:Vn.next;if(s!==null)Vn=s,Zt=i;else{if(i===null)throw pt.alternate===null?Error(r(467)):Error(r(310));Zt=i,i={memoizedState:Zt.memoizedState,baseState:Zt.baseState,baseQueue:Zt.baseQueue,queue:Zt.queue,next:null},Vn===null?pt.memoizedState=Vn=i:Vn=Vn.next=i}return Vn}function Rf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function wu(i){var s=Su;return Su+=1,Wl===null&&(Wl=[]),i=w1(Wl,i,s),s=pt,(Vn===null?s.memoizedState:Vn.next)===null&&(s=s.alternate,O.H=s===null||s.memoizedState===null?hw:Vg),i}function _f(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return wu(i);if(i.$$typeof===R)return rr(i)}throw Error(r(438,String(i)))}function Pg(i){var s=null,u=pt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=pt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(y){return y.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Rf(),pt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),h=0;h<i;h++)u[h]=U;return s.index++,u}function Fo(i,s){return typeof s=="function"?s(i):s}function Df(i){var s=Mn();return kg(s,Zt,i)}function kg(i,s,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var y=i.baseQueue,S=h.pending;if(S!==null){if(y!==null){var _=y.next;y.next=S.next,S.next=_}s.baseQueue=y=S,h.pending=null}if(S=i.baseState,y===null)i.memoizedState=S;else{s=y.next;var N=_=null,V=null,te=s,ue=!1;do{var pe=te.lane&-536870913;if(pe!==te.lane?(Ct&pe)===pe:(Vo&pe)===pe){var ne=te.revertLane;if(ne===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),pe===Vl&&(ue=!0);else if((Vo&ne)===ne){te=te.next,ne===Vl&&(ue=!0);continue}else pe={lane:0,revertLane:te.revertLane,gesture:null,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},V===null?(N=V=pe,_=S):V=V.next=pe,pt.lanes|=ne,za|=ne;pe=te.action,Os&&u(S,pe),S=te.hasEagerState?te.eagerState:u(S,pe)}else ne={lane:pe,revertLane:te.revertLane,gesture:te.gesture,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null},V===null?(N=V=ne,_=S):V=V.next=ne,pt.lanes|=pe,za|=pe;te=te.next}while(te!==null&&te!==s);if(V===null?_=S:V.next=N,!Qr(S,i.memoizedState)&&(Fn=!0,ue&&(u=Fl,u!==null)))throw u;i.memoizedState=S,i.baseState=_,i.baseQueue=V,h.lastRenderedState=S}return y===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function Ng(i){var s=Mn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,y=u.pending,S=s.memoizedState;if(y!==null){u.pending=null;var _=y=y.next;do S=i(S,_.action),_=_.next;while(_!==y);Qr(S,s.memoizedState)||(Fn=!0),s.memoizedState=S,s.baseQueue===null&&(s.baseState=S),u.lastRenderedState=S}return[S,h]}function N1(i,s,u){var h=pt,y=Mn(),S=Rt;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=s();var _=!Qr((Zt||y).memoizedState,u);if(_&&(y.memoizedState=u,Fn=!0),y=y.queue,Lg(L1.bind(null,h,y,i),[i]),y.getSnapshot!==s||_||Vn!==null&&Vn.memoizedState.tag&1){if(h.flags|=2048,Yl(9,{destroy:void 0},M1.bind(null,h,y,u,s),null),tn===null)throw Error(r(349));S||(Vo&127)!==0||O1(h,s,u)}return u}function O1(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=pt.updateQueue,s===null?(s=Rf(),pt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function M1(i,s,u,h){s.value=u,s.getSnapshot=h,I1(s)&&z1(i)}function L1(i,s,u){return u(function(){I1(s)&&z1(i)})}function I1(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Qr(i,u)}catch{return!0}}function z1(i){var s=Es(i,2);s!==null&&Ir(s,i,2)}function Og(i){var s=Sr();if(typeof i=="function"){var u=i;if(i=u(),Os){xr(!0);try{u()}finally{xr(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:i},s}function $1(i,s,u,h){return i.baseState=u,kg(i,Zt,typeof h=="function"?h:Fo)}function ON(i,s,u,h,y){if(kf(i))throw Error(r(485));if(i=s.action,i!==null){var S={payload:y,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(_){S.listeners.push(_)}};O.T!==null?u(!0):S.isTransition=!1,h(S),u=s.pending,u===null?(S.next=s.pending=S,U1(s,S)):(S.next=u.next,s.pending=u.next=S)}}function U1(i,s){var u=s.action,h=s.payload,y=i.state;if(s.isTransition){var S=O.T,_={};O.T=_;try{var N=u(y,h),V=O.S;V!==null&&V(_,N),B1(i,s,N)}catch(te){Mg(i,s,te)}finally{S!==null&&_.types!==null&&(S.types=_.types),O.T=S}}else try{S=u(y,h),B1(i,s,S)}catch(te){Mg(i,s,te)}}function B1(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){V1(i,s,h)},function(h){return Mg(i,s,h)}):V1(i,s,u)}function V1(i,s,u){s.status="fulfilled",s.value=u,F1(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,U1(i,u)))}function Mg(i,s,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,F1(s),s=s.next;while(s!==h)}i.action=null}function F1(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function H1(i,s){return s}function q1(i,s){if(Rt){var u=tn.formState;if(u!==null){e:{var h=pt;if(Rt){if(dn){t:{for(var y=dn,S=vi;y.nodeType!==8;){if(!S){y=null;break t}if(y=xi(y.nextSibling),y===null){y=null;break t}}S=y.data,y=S==="F!"||S==="F"?y:null}if(y){dn=xi(y.nextSibling),h=y.data==="F!";break e}}Da(h)}h=!1}h&&(s=u[0])}}return u=Sr(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:H1,lastRenderedState:s},u.queue=h,u=uw.bind(null,pt,h),h.dispatch=u,h=Og(!1),S=Bg.bind(null,pt,!1,h.queue),h=Sr(),y={state:s,dispatch:null,action:i,pending:null},h.queue=y,u=ON.bind(null,pt,y,S,u),y.dispatch=u,h.memoizedState=i,[s,u,!1]}function G1(i){var s=Mn();return Q1(s,Zt,i)}function Q1(i,s,u){if(s=kg(i,s,H1)[0],i=Df(Fo)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=wu(s)}catch(_){throw _===Hl?xf:_}else h=s;s=Mn();var y=s.queue,S=y.dispatch;return u!==s.memoizedState&&(pt.flags|=2048,Yl(9,{destroy:void 0},MN.bind(null,y,u),null)),[h,S,i]}function MN(i,s){i.action=s}function W1(i){var s=Mn(),u=Zt;if(u!==null)return Q1(s,u,i);Mn(),s=s.memoizedState,u=Mn();var h=u.queue.dispatch;return u.memoizedState=i,[s,h,!1]}function Yl(i,s,u,h){return i={tag:i,create:u,deps:h,inst:s,next:null},s=pt.updateQueue,s===null&&(s=Rf(),pt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,s.lastEffect=i),i}function Y1(){return Mn().memoizedState}function Af(i,s,u,h){var y=Sr();pt.flags|=i,y.memoizedState=Yl(1|s,{destroy:void 0},u,h===void 0?null:h)}function Pf(i,s,u,h){var y=Mn();h=h===void 0?null:h;var S=y.memoizedState.inst;Zt!==null&&h!==null&&Tg(h,Zt.memoizedState.deps)?y.memoizedState=Yl(s,S,u,h):(pt.flags|=i,y.memoizedState=Yl(1|s,S,u,h))}function K1(i,s){Af(8390656,8,i,s)}function Lg(i,s){Pf(2048,8,i,s)}function LN(i){pt.flags|=4;var s=pt.updateQueue;if(s===null)s=Rf(),pt.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function X1(i){var s=Mn().memoizedState;return LN({ref:s,nextImpl:i}),function(){if((Vt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function Z1(i,s){return Pf(4,2,i,s)}function J1(i,s){return Pf(4,4,i,s)}function ew(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function tw(i,s,u){u=u!=null?u.concat([i]):null,Pf(4,4,ew.bind(null,s,i),u)}function Ig(){}function nw(i,s){var u=Mn();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&Tg(s,h[1])?h[0]:(u.memoizedState=[i,s],i)}function rw(i,s){var u=Mn();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&Tg(s,h[1]))return h[0];if(h=i(),Os){xr(!0);try{i()}finally{xr(!1)}}return u.memoizedState=[h,s],h}function zg(i,s,u){return u===void 0||(Vo&1073741824)!==0&&(Ct&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=ij(),pt.lanes|=i,za|=i,u)}function iw(i,s,u,h){return Qr(u,s)?u:Gl.current!==null?(i=zg(i,u,h),Qr(i,s)||(Fn=!0),i):(Vo&42)===0||(Vo&1073741824)!==0&&(Ct&261930)===0?(Fn=!0,i.memoizedState=u):(i=ij(),pt.lanes|=i,za|=i,s)}function ow(i,s,u,h,y){var S=I.p;I.p=S!==0&&8>S?S:8;var _=O.T,N={};O.T=N,Bg(i,!1,s,u);try{var V=y(),te=O.S;if(te!==null&&te(N,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ue=PN(V,h);ju(i,s,ue,Jr(i))}else ju(i,s,h,Jr(i))}catch(pe){ju(i,s,{then:function(){},status:"rejected",reason:pe},Jr())}finally{I.p=S,_!==null&&N.types!==null&&(_.types=N.types),O.T=_}}function IN(){}function $g(i,s,u,h){if(i.tag!==5)throw Error(r(476));var y=aw(i).queue;ow(i,y,s,z,u===null?IN:function(){return sw(i),u(h)})}function aw(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:z},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fo,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function sw(i){var s=aw(i);s.next===null&&(s=i.alternate.memoizedState),ju(i,s.next.queue,{},Jr())}function Ug(){return rr(Uu)}function lw(){return Mn().memoizedState}function cw(){return Mn().memoizedState}function zN(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=Jr();i=ka(u);var h=Na(s,i,u);h!==null&&(Ir(h,s,u),yu(h,s,u)),s={cache:mg()},i.payload=s;return}s=s.return}}function $N(i,s,u){var h=Jr();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},kf(i)?dw(s,u):(u=ig(i,s,u,h),u!==null&&(Ir(u,i,h),fw(u,s,h)))}function uw(i,s,u){var h=Jr();ju(i,s,u,h)}function ju(i,s,u,h){var y={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(kf(i))dw(s,y);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=s.lastRenderedReducer,S!==null))try{var _=s.lastRenderedState,N=S(_,u);if(y.hasEagerState=!0,y.eagerState=N,Qr(N,_))return ff(i,s,y,0),tn===null&&df(),!1}catch{}finally{}if(u=ig(i,s,y,h),u!==null)return Ir(u,i,h),fw(u,s,h),!0}return!1}function Bg(i,s,u,h){if(h={lane:2,revertLane:xv(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},kf(i)){if(s)throw Error(r(479))}else s=ig(i,u,h,2),s!==null&&Ir(s,i,2)}function kf(i){var s=i.alternate;return i===pt||s!==null&&s===pt}function dw(i,s){Ql=Ef=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function fw(i,s,u){if((u&4194048)!==0){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,we(i,u)}}var Cu={readContext:rr,use:_f,useCallback:Dn,useContext:Dn,useEffect:Dn,useImperativeHandle:Dn,useLayoutEffect:Dn,useInsertionEffect:Dn,useMemo:Dn,useReducer:Dn,useRef:Dn,useState:Dn,useDebugValue:Dn,useDeferredValue:Dn,useTransition:Dn,useSyncExternalStore:Dn,useId:Dn,useHostTransitionStatus:Dn,useFormState:Dn,useActionState:Dn,useOptimistic:Dn,useMemoCache:Dn,useCacheRefresh:Dn};Cu.useEffectEvent=Dn;var hw={readContext:rr,use:_f,useCallback:function(i,s){return Sr().memoizedState=[i,s===void 0?null:s],i},useContext:rr,useEffect:K1,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Af(4194308,4,ew.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Af(4194308,4,i,s)},useInsertionEffect:function(i,s){Af(4,2,i,s)},useMemo:function(i,s){var u=Sr();s=s===void 0?null:s;var h=i();if(Os){xr(!0);try{i()}finally{xr(!1)}}return u.memoizedState=[h,s],h},useReducer:function(i,s,u){var h=Sr();if(u!==void 0){var y=u(s);if(Os){xr(!0);try{u(s)}finally{xr(!1)}}}else y=s;return h.memoizedState=h.baseState=y,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:y},h.queue=i,i=i.dispatch=$N.bind(null,pt,i),[h.memoizedState,i]},useRef:function(i){var s=Sr();return i={current:i},s.memoizedState=i},useState:function(i){i=Og(i);var s=i.queue,u=uw.bind(null,pt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Ig,useDeferredValue:function(i,s){var u=Sr();return zg(u,i,s)},useTransition:function(){var i=Og(!1);return i=ow.bind(null,pt,i.queue,!0,!1),Sr().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var h=pt,y=Sr();if(Rt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),tn===null)throw Error(r(349));(Ct&127)!==0||O1(h,s,u)}y.memoizedState=u;var S={value:u,getSnapshot:s};return y.queue=S,K1(L1.bind(null,h,S,i),[i]),h.flags|=2048,Yl(9,{destroy:void 0},M1.bind(null,h,S,u,s),null),u},useId:function(){var i=Sr(),s=tn.identifierPrefix;if(Rt){var u=ao,h=oo;u=(h&~(1<<32-er(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Tf++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=kN++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Ug,useFormState:q1,useActionState:q1,useOptimistic:function(i){var s=Sr();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Bg.bind(null,pt,!0,u),u.dispatch=s,[i,s]},useMemoCache:Pg,useCacheRefresh:function(){return Sr().memoizedState=zN.bind(null,pt)},useEffectEvent:function(i){var s=Sr(),u={impl:i};return s.memoizedState=u,function(){if((Vt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Vg={readContext:rr,use:_f,useCallback:nw,useContext:rr,useEffect:Lg,useImperativeHandle:tw,useInsertionEffect:Z1,useLayoutEffect:J1,useMemo:rw,useReducer:Df,useRef:Y1,useState:function(){return Df(Fo)},useDebugValue:Ig,useDeferredValue:function(i,s){var u=Mn();return iw(u,Zt.memoizedState,i,s)},useTransition:function(){var i=Df(Fo)[0],s=Mn().memoizedState;return[typeof i=="boolean"?i:wu(i),s]},useSyncExternalStore:N1,useId:lw,useHostTransitionStatus:Ug,useFormState:G1,useActionState:G1,useOptimistic:function(i,s){var u=Mn();return $1(u,Zt,i,s)},useMemoCache:Pg,useCacheRefresh:cw};Vg.useEffectEvent=X1;var pw={readContext:rr,use:_f,useCallback:nw,useContext:rr,useEffect:Lg,useImperativeHandle:tw,useInsertionEffect:Z1,useLayoutEffect:J1,useMemo:rw,useReducer:Ng,useRef:Y1,useState:function(){return Ng(Fo)},useDebugValue:Ig,useDeferredValue:function(i,s){var u=Mn();return Zt===null?zg(u,i,s):iw(u,Zt.memoizedState,i,s)},useTransition:function(){var i=Ng(Fo)[0],s=Mn().memoizedState;return[typeof i=="boolean"?i:wu(i),s]},useSyncExternalStore:N1,useId:lw,useHostTransitionStatus:Ug,useFormState:W1,useActionState:W1,useOptimistic:function(i,s){var u=Mn();return Zt!==null?$1(u,Zt,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Pg,useCacheRefresh:cw};pw.useEffectEvent=X1;function Fg(i,s,u,h){s=i.memoizedState,u=u(h,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Hg={enqueueSetState:function(i,s,u){i=i._reactInternals;var h=Jr(),y=ka(h);y.payload=s,u!=null&&(y.callback=u),s=Na(i,y,h),s!==null&&(Ir(s,i,h),yu(s,i,h))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var h=Jr(),y=ka(h);y.tag=1,y.payload=s,u!=null&&(y.callback=u),s=Na(i,y,h),s!==null&&(Ir(s,i,h),yu(s,i,h))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=Jr(),h=ka(u);h.tag=2,s!=null&&(h.callback=s),s=Na(i,h,u),s!==null&&(Ir(s,i,u),yu(s,i,u))}};function mw(i,s,u,h,y,S,_){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,S,_):s.prototype&&s.prototype.isPureReactComponent?!uu(u,h)||!uu(y,S):!0}function gw(i,s,u,h){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==i&&Hg.enqueueReplaceState(s,s.state,null)}function Ms(i,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var y in i)u[y]===void 0&&(u[y]=i[y])}return u}function vw(i){uf(i)}function yw(i){console.error(i)}function xw(i){uf(i)}function Nf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function bw(i,s,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(y){setTimeout(function(){throw y})}}function qg(i,s,u){return u=ka(u),u.tag=3,u.payload={element:null},u.callback=function(){Nf(i,s)},u}function Sw(i){return i=ka(i),i.tag=3,i}function ww(i,s,u,h){var y=u.type.getDerivedStateFromError;if(typeof y=="function"){var S=h.value;i.payload=function(){return y(S)},i.callback=function(){bw(s,u,h)}}var _=u.stateNode;_!==null&&typeof _.componentDidCatch=="function"&&(i.callback=function(){bw(s,u,h),typeof y!="function"&&($a===null?$a=new Set([this]):$a.add(this));var N=h.stack;this.componentDidCatch(h.value,{componentStack:N!==null?N:""})})}function UN(i,s,u,h,y){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=u.alternate,s!==null&&Bl(s,u,y,!0),u=Yr.current,u!==null){switch(u.tag){case 31:case 13:return yi===null?qf():u.alternate===null&&An===0&&(An=3),u.flags&=-257,u.flags|=65536,u.lanes=y,h===bf?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),gv(i,h,y)),!1;case 22:return u.flags|=65536,h===bf?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),gv(i,h,y)),!1}throw Error(r(435,u.tag))}return gv(i,h,y),qf(),!1}if(Rt)return s=Yr.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=y,h!==ug&&(i=Error(r(422),{cause:h}),hu(pi(i,u)))):(h!==ug&&(s=Error(r(423),{cause:h}),hu(pi(s,u))),i=i.current.alternate,i.flags|=65536,y&=-y,i.lanes|=y,h=pi(h,u),y=qg(i.stateNode,h,y),Sg(i,y),An!==4&&(An=2)),!1;var S=Error(r(520),{cause:h});if(S=pi(S,u),ku===null?ku=[S]:ku.push(S),An!==4&&(An=2),s===null)return!0;h=pi(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=y&-y,u.lanes|=i,i=qg(u.stateNode,h,i),Sg(u,i),!1;case 1:if(s=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&($a===null||!$a.has(S))))return u.flags|=65536,y&=-y,u.lanes|=y,y=Sw(y),ww(y,i,u,h),Sg(u,y),!1}u=u.return}while(u!==null);return!1}var Gg=Error(r(461)),Fn=!1;function ir(i,s,u,h){s.child=i===null?T1(s,null,u,h):Ns(s,i.child,u,h)}function jw(i,s,u,h,y){u=u.render;var S=s.ref;if("ref"in h){var _={};for(var N in h)N!=="ref"&&(_[N]=h[N])}else _=h;return Ds(s),h=Rg(i,s,u,_,S,y),N=_g(),i!==null&&!Fn?(Dg(i,s,y),Ho(i,s,y)):(Rt&&N&&lg(s),s.flags|=1,ir(i,s,h,y),s.child)}function Cw(i,s,u,h,y){if(i===null){var S=u.type;return typeof S=="function"&&!og(S)&&S.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=S,Ew(i,s,S,h,y)):(i=pf(u.type,null,h,s,s.mode,y),i.ref=s.ref,i.return=s,s.child=i)}if(S=i.child,!ev(i,y)){var _=S.memoizedProps;if(u=u.compare,u=u!==null?u:uu,u(_,h)&&i.ref===s.ref)return Ho(i,s,y)}return s.flags|=1,i=zo(S,h),i.ref=s.ref,i.return=s,s.child=i}function Ew(i,s,u,h,y){if(i!==null){var S=i.memoizedProps;if(uu(S,h)&&i.ref===s.ref)if(Fn=!1,s.pendingProps=h=S,ev(i,y))(i.flags&131072)!==0&&(Fn=!0);else return s.lanes=i.lanes,Ho(i,s,y)}return Qg(i,s,u,h,y)}function Tw(i,s,u,h){var y=h.children,S=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,i!==null){for(h=s.child=i.child,y=0;h!==null;)y=y|h.lanes|h.childLanes,h=h.sibling;h=y&~S}else h=0,s.child=null;return Rw(i,s,S,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&yf(s,S!==null?S.cachePool:null),S!==null?D1(s,S):jg(),A1(s);else return h=s.lanes=536870912,Rw(i,s,S!==null?S.baseLanes|u:u,u,h)}else S!==null?(yf(s,S.cachePool),D1(s,S),Ma(),s.memoizedState=null):(i!==null&&yf(s,null),jg(),Ma());return ir(i,s,y,u),s.child}function Eu(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Rw(i,s,u,h,y){var S=vg();return S=S===null?null:{parent:Bn._currentValue,pool:S},s.memoizedState={baseLanes:u,cachePool:S},i!==null&&yf(s,null),jg(),A1(s),i!==null&&Bl(i,s,h,!0),s.childLanes=y,null}function Of(i,s){return s=Lf({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function _w(i,s,u){return Ns(s,i.child,null,u),i=Of(s,s.pendingProps),i.flags|=2,Kr(s),s.memoizedState=null,i}function BN(i,s,u){var h=s.pendingProps,y=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Rt){if(h.mode==="hidden")return i=Of(s,h),s.lanes=536870912,Eu(null,i);if(Eg(s),(i=dn)?(i=Uj(i,vi),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Ra!==null?{id:oo,overflow:ao}:null,retryLane:536870912,hydrationErrors:null},u=d1(i),u.return=s,s.child=u,nr=s,dn=null)):i=null,i===null)throw Da(s);return s.lanes=536870912,null}return Of(s,h)}var S=i.memoizedState;if(S!==null){var _=S.dehydrated;if(Eg(s),y)if(s.flags&256)s.flags&=-257,s=_w(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(Fn||Bl(i,s,u,!1),y=(u&i.childLanes)!==0,Fn||y){if(h=tn,h!==null&&(_=Pe(h,u),_!==0&&_!==S.retryLane))throw S.retryLane=_,Es(i,_),Ir(h,i,_),Gg;qf(),s=_w(i,s,u)}else i=S.treeContext,dn=xi(_.nextSibling),nr=s,Rt=!0,_a=null,vi=!1,i!==null&&p1(s,i),s=Of(s,h),s.flags|=4096;return s}return i=zo(i.child,{mode:h.mode,children:h.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Mf(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function Qg(i,s,u,h,y){return Ds(s),u=Rg(i,s,u,h,void 0,y),h=_g(),i!==null&&!Fn?(Dg(i,s,y),Ho(i,s,y)):(Rt&&h&&lg(s),s.flags|=1,ir(i,s,u,y),s.child)}function Dw(i,s,u,h,y,S){return Ds(s),s.updateQueue=null,u=k1(s,h,u,y),P1(i),h=_g(),i!==null&&!Fn?(Dg(i,s,S),Ho(i,s,S)):(Rt&&h&&lg(s),s.flags|=1,ir(i,s,u,S),s.child)}function Aw(i,s,u,h,y){if(Ds(s),s.stateNode===null){var S=Il,_=u.contextType;typeof _=="object"&&_!==null&&(S=rr(_)),S=new u(h,S),s.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=Hg,s.stateNode=S,S._reactInternals=s,S=s.stateNode,S.props=h,S.state=s.memoizedState,S.refs={},xg(s),_=u.contextType,S.context=typeof _=="object"&&_!==null?rr(_):Il,S.state=s.memoizedState,_=u.getDerivedStateFromProps,typeof _=="function"&&(Fg(s,u,_,h),S.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(_=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),_!==S.state&&Hg.enqueueReplaceState(S,S.state,null),bu(s,h,S,y),xu(),S.state=s.memoizedState),typeof S.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(i===null){S=s.stateNode;var N=s.memoizedProps,V=Ms(u,N);S.props=V;var te=S.context,ue=u.contextType;_=Il,typeof ue=="object"&&ue!==null&&(_=rr(ue));var pe=u.getDerivedStateFromProps;ue=typeof pe=="function"||typeof S.getSnapshotBeforeUpdate=="function",N=s.pendingProps!==N,ue||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(N||te!==_)&&gw(s,S,h,_),Pa=!1;var ne=s.memoizedState;S.state=ne,bu(s,h,S,y),xu(),te=s.memoizedState,N||ne!==te||Pa?(typeof pe=="function"&&(Fg(s,u,pe,h),te=s.memoizedState),(V=Pa||mw(s,u,V,h,ne,te,_))?(ue||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"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=te),S.props=h,S.state=te,S.context=_,h=V):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{S=s.stateNode,bg(i,s),_=s.memoizedProps,ue=Ms(u,_),S.props=ue,pe=s.pendingProps,ne=S.context,te=u.contextType,V=Il,typeof te=="object"&&te!==null&&(V=rr(te)),N=u.getDerivedStateFromProps,(te=typeof N=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(_!==pe||ne!==V)&&gw(s,S,h,V),Pa=!1,ne=s.memoizedState,S.state=ne,bu(s,h,S,y),xu();var se=s.memoizedState;_!==pe||ne!==se||Pa||i!==null&&i.dependencies!==null&&gf(i.dependencies)?(typeof N=="function"&&(Fg(s,u,N,h),se=s.memoizedState),(ue=Pa||mw(s,u,ue,h,ne,se,V)||i!==null&&i.dependencies!==null&&gf(i.dependencies))?(te||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,se,V),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,se,V)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||_===i.memoizedProps&&ne===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&ne===i.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=se),S.props=h,S.state=se,S.context=V,h=ue):(typeof S.componentDidUpdate!="function"||_===i.memoizedProps&&ne===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||_===i.memoizedProps&&ne===i.memoizedState||(s.flags|=1024),h=!1)}return S=h,Mf(i,s),h=(s.flags&128)!==0,S||h?(S=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),s.flags|=1,i!==null&&h?(s.child=Ns(s,i.child,null,y),s.child=Ns(s,null,u,y)):ir(i,s,u,y),s.memoizedState=S.state,i=s.child):i=Ho(i,s,y),i}function Pw(i,s,u,h){return Rs(),s.flags|=256,ir(i,s,u,h),s.child}var Wg={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Yg(i){return{baseLanes:i,cachePool:b1()}}function Kg(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=Zr),i}function kw(i,s,u){var h=s.pendingProps,y=!1,S=(s.flags&128)!==0,_;if((_=S)||(_=i!==null&&i.memoizedState===null?!1:(On.current&2)!==0),_&&(y=!0,s.flags&=-129),_=(s.flags&32)!==0,s.flags&=-33,i===null){if(Rt){if(y?Oa(s):Ma(),(i=dn)?(i=Uj(i,vi),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Ra!==null?{id:oo,overflow:ao}:null,retryLane:536870912,hydrationErrors:null},u=d1(i),u.return=s,s.child=u,nr=s,dn=null)):i=null,i===null)throw Da(s);return kv(i)?s.lanes=32:s.lanes=536870912,null}var N=h.children;return h=h.fallback,y?(Ma(),y=s.mode,N=Lf({mode:"hidden",children:N},y),h=Ts(h,y,u,null),N.return=s,h.return=s,N.sibling=h,s.child=N,h=s.child,h.memoizedState=Yg(u),h.childLanes=Kg(i,_,u),s.memoizedState=Wg,Eu(null,h)):(Oa(s),Xg(s,N))}var V=i.memoizedState;if(V!==null&&(N=V.dehydrated,N!==null)){if(S)s.flags&256?(Oa(s),s.flags&=-257,s=Zg(i,s,u)):s.memoizedState!==null?(Ma(),s.child=i.child,s.flags|=128,s=null):(Ma(),N=h.fallback,y=s.mode,h=Lf({mode:"visible",children:h.children},y),N=Ts(N,y,u,null),N.flags|=2,h.return=s,N.return=s,h.sibling=N,s.child=h,Ns(s,i.child,null,u),h=s.child,h.memoizedState=Yg(u),h.childLanes=Kg(i,_,u),s.memoizedState=Wg,s=Eu(null,h));else if(Oa(s),kv(N)){if(_=N.nextSibling&&N.nextSibling.dataset,_)var te=_.dgst;_=te,h=Error(r(419)),h.stack="",h.digest=_,hu({value:h,source:null,stack:null}),s=Zg(i,s,u)}else if(Fn||Bl(i,s,u,!1),_=(u&i.childLanes)!==0,Fn||_){if(_=tn,_!==null&&(h=Pe(_,u),h!==0&&h!==V.retryLane))throw V.retryLane=h,Es(i,h),Ir(_,i,h),Gg;Pv(N)||qf(),s=Zg(i,s,u)}else Pv(N)?(s.flags|=192,s.child=i.child,s=null):(i=V.treeContext,dn=xi(N.nextSibling),nr=s,Rt=!0,_a=null,vi=!1,i!==null&&p1(s,i),s=Xg(s,h.children),s.flags|=4096);return s}return y?(Ma(),N=h.fallback,y=s.mode,V=i.child,te=V.sibling,h=zo(V,{mode:"hidden",children:h.children}),h.subtreeFlags=V.subtreeFlags&65011712,te!==null?N=zo(te,N):(N=Ts(N,y,u,null),N.flags|=2),N.return=s,h.return=s,h.sibling=N,s.child=h,Eu(null,h),h=s.child,N=i.child.memoizedState,N===null?N=Yg(u):(y=N.cachePool,y!==null?(V=Bn._currentValue,y=y.parent!==V?{parent:V,pool:V}:y):y=b1(),N={baseLanes:N.baseLanes|u,cachePool:y}),h.memoizedState=N,h.childLanes=Kg(i,_,u),s.memoizedState=Wg,Eu(i.child,h)):(Oa(s),u=i.child,i=u.sibling,u=zo(u,{mode:"visible",children:h.children}),u.return=s,u.sibling=null,i!==null&&(_=s.deletions,_===null?(s.deletions=[i],s.flags|=16):_.push(i)),s.child=u,s.memoizedState=null,u)}function Xg(i,s){return s=Lf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Lf(i,s){return i=Wr(22,i,null,s),i.lanes=0,i}function Zg(i,s,u){return Ns(s,i.child,null,u),i=Xg(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Nw(i,s,u){i.lanes|=s;var h=i.alternate;h!==null&&(h.lanes|=s),hg(i.return,s,u)}function Jg(i,s,u,h,y,S){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:y,treeForkCount:S}:(_.isBackwards=s,_.rendering=null,_.renderingStartTime=0,_.last=h,_.tail=u,_.tailMode=y,_.treeForkCount=S)}function Ow(i,s,u){var h=s.pendingProps,y=h.revealOrder,S=h.tail;h=h.children;var _=On.current,N=(_&2)!==0;if(N?(_=_&1|2,s.flags|=128):_&=1,ie(On,_),ir(i,s,h,u),h=Rt?fu:0,!N&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Nw(i,u,s);else if(i.tag===19)Nw(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(y){case"forwards":for(u=s.child,y=null;u!==null;)i=u.alternate,i!==null&&Cf(i)===null&&(y=u),u=u.sibling;u=y,u===null?(y=s.child,s.child=null):(y=u.sibling,u.sibling=null),Jg(s,!1,y,u,S,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,y=s.child,s.child=null;y!==null;){if(i=y.alternate,i!==null&&Cf(i)===null){s.child=y;break}i=y.sibling,y.sibling=u,u=y,y=i}Jg(s,!0,u,null,S,h);break;case"together":Jg(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function Ho(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),za|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Bl(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=zo(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=zo(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function ev(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&gf(i)))}function VN(i,s,u){switch(s.tag){case 3:Ee(s,s.stateNode.containerInfo),Aa(s,Bn,i.memoizedState.cache),Rs();break;case 27:case 5:it(s);break;case 4:Ee(s,s.stateNode.containerInfo);break;case 10:Aa(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Eg(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Oa(s),s.flags|=128,null):(u&s.child.childLanes)!==0?kw(i,s,u):(Oa(s),i=Ho(i,s,u),i!==null?i.sibling:null);Oa(s);break;case 19:var y=(i.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(Bl(i,s,u,!1),h=(u&s.childLanes)!==0),y){if(h)return Ow(i,s,u);s.flags|=128}if(y=s.memoizedState,y!==null&&(y.rendering=null,y.tail=null,y.lastEffect=null),ie(On,On.current),h)break;return null;case 22:return s.lanes=0,Tw(i,s,u,s.pendingProps);case 24:Aa(s,Bn,i.memoizedState.cache)}return Ho(i,s,u)}function Mw(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Fn=!0;else{if(!ev(i,u)&&(s.flags&128)===0)return Fn=!1,VN(i,s,u);Fn=(i.flags&131072)!==0}else Fn=!1,Rt&&(s.flags&1048576)!==0&&h1(s,fu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(i=Ps(s.elementType),s.type=i,typeof i=="function")og(i)?(h=Ms(i,h),s.tag=1,s=Aw(null,s,i,h,u)):(s.tag=0,s=Qg(null,s,i,h,u));else{if(i!=null){var y=i.$$typeof;if(y===D){s.tag=11,s=jw(null,s,i,h,u);break e}else if(y===k){s.tag=14,s=Cw(null,s,i,h,u);break e}}throw s=H(i)||i,Error(r(306,s,""))}}return s;case 0:return Qg(i,s,s.type,s.pendingProps,u);case 1:return h=s.type,y=Ms(h,s.pendingProps),Aw(i,s,h,y,u);case 3:e:{if(Ee(s,s.stateNode.containerInfo),i===null)throw Error(r(387));h=s.pendingProps;var S=s.memoizedState;y=S.element,bg(i,s),bu(s,h,null,u);var _=s.memoizedState;if(h=_.cache,Aa(s,Bn,h),h!==S.cache&&pg(s,[Bn],u,!0),xu(),h=_.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:_.cache},s.updateQueue.baseState=S,s.memoizedState=S,s.flags&256){s=Pw(i,s,h,u);break e}else if(h!==y){y=pi(Error(r(424)),s),hu(y),s=Pw(i,s,h,u);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(dn=xi(i.firstChild),nr=s,Rt=!0,_a=null,vi=!0,u=T1(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Rs(),h===y){s=Ho(i,s,u);break e}ir(i,s,h,u)}s=s.child}return s;case 26:return Mf(i,s),i===null?(u=Gj(s.type,null,s.pendingProps,null))?s.memoizedState=u:Rt||(u=s.type,i=s.pendingProps,h=Zf(Ce.current).createElement(u),h[Me]=s,h[Le]=i,or(h,u,i),yn(h),s.stateNode=h):s.memoizedState=Gj(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return it(s),i===null&&Rt&&(h=s.stateNode=Fj(s.type,s.pendingProps,Ce.current),nr=s,vi=!0,y=dn,Fa(s.type)?(Nv=y,dn=xi(h.firstChild)):dn=y),ir(i,s,s.pendingProps.children,u),Mf(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Rt&&((y=h=dn)&&(h=y3(h,s.type,s.pendingProps,vi),h!==null?(s.stateNode=h,nr=s,dn=xi(h.firstChild),vi=!1,y=!0):y=!1),y||Da(s)),it(s),y=s.type,S=s.pendingProps,_=i!==null?i.memoizedProps:null,h=S.children,_v(y,S)?h=null:_!==null&&_v(y,_)&&(s.flags|=32),s.memoizedState!==null&&(y=Rg(i,s,NN,null,null,u),Uu._currentValue=y),Mf(i,s),ir(i,s,h,u),s.child;case 6:return i===null&&Rt&&((i=u=dn)&&(u=x3(u,s.pendingProps,vi),u!==null?(s.stateNode=u,nr=s,dn=null,i=!0):i=!1),i||Da(s)),null;case 13:return kw(i,s,u);case 4:return Ee(s,s.stateNode.containerInfo),h=s.pendingProps,i===null?s.child=Ns(s,null,h,u):ir(i,s,h,u),s.child;case 11:return jw(i,s,s.type,s.pendingProps,u);case 7:return ir(i,s,s.pendingProps,u),s.child;case 8:return ir(i,s,s.pendingProps.children,u),s.child;case 12:return ir(i,s,s.pendingProps.children,u),s.child;case 10:return h=s.pendingProps,Aa(s,s.type,h.value),ir(i,s,h.children,u),s.child;case 9:return y=s.type._context,h=s.pendingProps.children,Ds(s),y=rr(y),h=h(y),s.flags|=1,ir(i,s,h,u),s.child;case 14:return Cw(i,s,s.type,s.pendingProps,u);case 15:return Ew(i,s,s.type,s.pendingProps,u);case 19:return Ow(i,s,u);case 31:return BN(i,s,u);case 22:return Tw(i,s,u,s.pendingProps);case 24:return Ds(s),h=rr(Bn),i===null?(y=vg(),y===null&&(y=tn,S=mg(),y.pooledCache=S,S.refCount++,S!==null&&(y.pooledCacheLanes|=u),y=S),s.memoizedState={parent:h,cache:y},xg(s),Aa(s,Bn,y)):((i.lanes&u)!==0&&(bg(i,s),bu(s,null,null,u),xu()),y=i.memoizedState,S=s.memoizedState,y.parent!==h?(y={parent:h,cache:h},s.memoizedState=y,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=y),Aa(s,Bn,h)):(h=S.cache,Aa(s,Bn,h),h!==y.cache&&pg(s,[Bn],u,!0))),ir(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function qo(i){i.flags|=4}function tv(i,s,u,h,y){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(y&335544128)===y)if(i.stateNode.complete)i.flags|=8192;else if(lj())i.flags|=8192;else throw ks=bf,yg}else i.flags&=-16777217}function Lw(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!Xj(s))if(lj())i.flags|=8192;else throw ks=bf,yg}function If(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?_l():536870912,i.lanes|=s,Jl|=s)}function Tu(i,s){if(!Rt)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function fn(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(s)for(var y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags&65011712,h|=y.flags&65011712,y.return=i,y=y.sibling;else for(y=i.child;y!==null;)u|=y.lanes|y.childLanes,h|=y.subtreeFlags,h|=y.flags,y.return=i,y=y.sibling;return i.subtreeFlags|=h,i.childLanes=u,s}function FN(i,s,u){var h=s.pendingProps;switch(cg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fn(s),null;case 1:return fn(s),null;case 3:return u=s.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Bo(Bn),Ge(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Ul(s)?qo(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,dg())),fn(s),null;case 26:var y=s.type,S=s.memoizedState;return i===null?(qo(s),S!==null?(fn(s),Lw(s,S)):(fn(s),tv(s,y,null,h,u))):S?S!==i.memoizedState?(qo(s),fn(s),Lw(s,S)):(fn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==h&&qo(s),fn(s),tv(s,y,i,h,u)),null;case 27:if(St(s),u=Ce.current,y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==h&&qo(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return fn(s),null}i=xe.current,Ul(s)?m1(s):(i=Fj(y,h,u),s.stateNode=i,qo(s))}return fn(s),null;case 5:if(St(s),y=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==h&&qo(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return fn(s),null}if(S=xe.current,Ul(s))m1(s);else{var _=Zf(Ce.current);switch(S){case 1:S=_.createElementNS("http://www.w3.org/2000/svg",y);break;case 2:S=_.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;default:switch(y){case"svg":S=_.createElementNS("http://www.w3.org/2000/svg",y);break;case"math":S=_.createElementNS("http://www.w3.org/1998/Math/MathML",y);break;case"script":S=_.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof h.is=="string"?_.createElement("select",{is:h.is}):_.createElement("select"),h.multiple?S.multiple=!0:h.size&&(S.size=h.size);break;default:S=typeof h.is=="string"?_.createElement(y,{is:h.is}):_.createElement(y)}}S[Me]=s,S[Le]=h;e:for(_=s.child;_!==null;){if(_.tag===5||_.tag===6)S.appendChild(_.stateNode);else if(_.tag!==4&&_.tag!==27&&_.child!==null){_.child.return=_,_=_.child;continue}if(_===s)break e;for(;_.sibling===null;){if(_.return===null||_.return===s)break e;_=_.return}_.sibling.return=_.return,_=_.sibling}s.stateNode=S;e:switch(or(S,y,h),y){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&qo(s)}}return fn(s),tv(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==h&&qo(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(i=Ce.current,Ul(s)){if(i=s.stateNode,u=s.memoizedProps,h=null,y=nr,y!==null)switch(y.tag){case 27:case 5:h=y.memoizedProps}i[Me]=s,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||kj(i.nodeValue,u)),i||Da(s,!0)}else i=Zf(i).createTextNode(h),i[Me]=s,s.stateNode=i}return fn(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(h=Ul(s),u!==null){if(i===null){if(!h)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Me]=s}else Rs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;fn(s),i=!1}else u=dg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(Kr(s),s):(Kr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return fn(s),null;case 13:if(h=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(y=Ul(s),h!==null&&h.dehydrated!==null){if(i===null){if(!y)throw Error(r(318));if(y=s.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error(r(317));y[Me]=s}else Rs(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;fn(s),y=!1}else y=dg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=y),y=!0;if(!y)return s.flags&256?(Kr(s),s):(Kr(s),null)}return Kr(s),(s.flags&128)!==0?(s.lanes=u,s):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=s.child,y=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(y=h.alternate.memoizedState.cachePool.pool),S=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==y&&(h.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),If(s,s.updateQueue),fn(s),null);case 4:return Ge(),i===null&&jv(s.stateNode.containerInfo),fn(s),null;case 10:return Bo(s.type),fn(s),null;case 19:if(q(On),h=s.memoizedState,h===null)return fn(s),null;if(y=(s.flags&128)!==0,S=h.rendering,S===null)if(y)Tu(h,!1);else{if(An!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(S=Cf(i),S!==null){for(s.flags|=128,Tu(h,!1),i=S.updateQueue,s.updateQueue=i,If(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)u1(u,i),u=u.sibling;return ie(On,On.current&1|2),Rt&&$o(s,h.treeForkCount),s.child}i=i.sibling}h.tail!==null&&me()>Vf&&(s.flags|=128,y=!0,Tu(h,!1),s.lanes=4194304)}else{if(!y)if(i=Cf(S),i!==null){if(s.flags|=128,y=!0,i=i.updateQueue,s.updateQueue=i,If(s,i),Tu(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!Rt)return fn(s),null}else 2*me()-h.renderingStartTime>Vf&&u!==536870912&&(s.flags|=128,y=!0,Tu(h,!1),s.lanes=4194304);h.isBackwards?(S.sibling=s.child,s.child=S):(i=h.last,i!==null?i.sibling=S:s.child=S,h.last=S)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=me(),i.sibling=null,u=On.current,ie(On,y?u&1|2:u&1),Rt&&$o(s,h.treeForkCount),i):(fn(s),null);case 22:case 23:return Kr(s),Cg(),h=s.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(fn(s),s.subtreeFlags&6&&(s.flags|=8192)):fn(s),u=s.updateQueue,u!==null&&If(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==u&&(s.flags|=2048),i!==null&&q(As),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Bo(Bn),fn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function HN(i,s){switch(cg(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Bo(Bn),Ge(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return St(s),null;case 31:if(s.memoizedState!==null){if(Kr(s),s.alternate===null)throw Error(r(340));Rs()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(Kr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Rs()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return q(On),null;case 4:return Ge(),null;case 10:return Bo(s.type),null;case 22:case 23:return Kr(s),Cg(),i!==null&&q(As),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Bo(Bn),null;case 25:return null;default:return null}}function Iw(i,s){switch(cg(s),s.tag){case 3:Bo(Bn),Ge();break;case 26:case 27:case 5:St(s);break;case 4:Ge();break;case 31:s.memoizedState!==null&&Kr(s);break;case 13:Kr(s);break;case 19:q(On);break;case 10:Bo(s.type);break;case 22:case 23:Kr(s),Cg(),i!==null&&q(As);break;case 24:Bo(Bn)}}function Ru(i,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var y=h.next;u=y;do{if((u.tag&i)===i){h=void 0;var S=u.create,_=u.inst;h=S(),_.destroy=h}u=u.next}while(u!==y)}}catch(N){Kt(s,s.return,N)}}function La(i,s,u){try{var h=s.updateQueue,y=h!==null?h.lastEffect:null;if(y!==null){var S=y.next;h=S;do{if((h.tag&i)===i){var _=h.inst,N=_.destroy;if(N!==void 0){_.destroy=void 0,y=s;var V=u,te=N;try{te()}catch(ue){Kt(y,V,ue)}}}h=h.next}while(h!==S)}}catch(ue){Kt(s,s.return,ue)}}function zw(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{_1(s,u)}catch(h){Kt(i,i.return,h)}}}function $w(i,s,u){u.props=Ms(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){Kt(i,s,h)}}function _u(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(y){Kt(i,s,y)}}function so(i,s){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(y){Kt(i,s,y)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(y){Kt(i,s,y)}else u.current=null}function Uw(i){var s=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(s){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){Kt(i,i.return,y)}}function nv(i,s,u){try{var h=i.stateNode;f3(h,i.type,u,s),h[Le]=s}catch(y){Kt(i,i.return,y)}}function Bw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Fa(i.type)||i.tag===4}function rv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Bw(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Fa(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function iv(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Lo));else if(h!==4&&(h===27&&Fa(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(iv(i,s,u),i=i.sibling;i!==null;)iv(i,s,u),i=i.sibling}function zf(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(h!==4&&(h===27&&Fa(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(zf(i,s,u),i=i.sibling;i!==null;)zf(i,s,u),i=i.sibling}function Vw(i){var s=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,y=s.attributes;y.length;)s.removeAttributeNode(y[0]);or(s,h,u),s[Me]=i,s[Le]=u}catch(S){Kt(i,i.return,S)}}var Go=!1,Hn=!1,ov=!1,Fw=typeof WeakSet=="function"?WeakSet:Set,Kn=null;function qN(i,s){if(i=i.containerInfo,Tv=oh,i=t1(i),Zm(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.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 _=0,N=-1,V=-1,te=0,ue=0,pe=i,ne=null;t:for(;;){for(var se;pe!==u||y!==0&&pe.nodeType!==3||(N=_+y),pe!==S||h!==0&&pe.nodeType!==3||(V=_+h),pe.nodeType===3&&(_+=pe.nodeValue.length),(se=pe.firstChild)!==null;)ne=pe,pe=se;for(;;){if(pe===i)break t;if(ne===u&&++te===y&&(N=_),ne===S&&++ue===h&&(V=_),(se=pe.nextSibling)!==null)break;pe=ne,ne=pe.parentNode}pe=se}u=N===-1||V===-1?null:{start:N,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for(Rv={focusedElem:i,selectionRange:u},oh=!1,Kn=s;Kn!==null;)if(s=Kn,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Kn=i;else for(;Kn!==null;){switch(s=Kn,S=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)y=i[u],y.ref.impl=y.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&S!==null){i=void 0,u=s,y=S.memoizedProps,S=S.memoizedState,h=u.stateNode;try{var Qe=Ms(u.type,y);i=h.getSnapshotBeforeUpdate(Qe,S),h.__reactInternalSnapshotBeforeUpdate=i}catch(st){Kt(u,u.return,st)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Av(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Av(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Kn=i;break}Kn=s.return}}function Hw(i,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:Wo(i,u),h&4&&Ru(5,u);break;case 1:if(Wo(i,u),h&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(_){Kt(u,u.return,_)}else{var y=Ms(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(y,s,i.__reactInternalSnapshotBeforeUpdate)}catch(_){Kt(u,u.return,_)}}h&64&&zw(u),h&512&&_u(u,u.return);break;case 3:if(Wo(i,u),h&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{_1(i,s)}catch(_){Kt(u,u.return,_)}}break;case 27:s===null&&h&4&&Vw(u);case 26:case 5:Wo(i,u),s===null&&h&4&&Uw(u),h&512&&_u(u,u.return);break;case 12:Wo(i,u);break;case 31:Wo(i,u),h&4&&Qw(i,u);break;case 13:Wo(i,u),h&4&&Ww(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=e3.bind(null,u),b3(i,u))));break;case 22:if(h=u.memoizedState!==null||Go,!h){s=s!==null&&s.memoizedState!==null||Hn,y=Go;var S=Hn;Go=h,(Hn=s)&&!S?Yo(i,u,(u.subtreeFlags&8772)!==0):Wo(i,u),Go=y,Hn=S}break;case 30:break;default:Wo(i,u)}}function qw(i){var s=i.alternate;s!==null&&(i.alternate=null,qw(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&Ii(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var xn=null,Nr=!1;function Qo(i,s,u){for(u=u.child;u!==null;)Gw(i,s,u),u=u.sibling}function Gw(i,s,u){if(Wn&&typeof Wn.onCommitFiberUnmount=="function")try{Wn.onCommitFiberUnmount(si,u)}catch{}switch(u.tag){case 26:Hn||so(u,s),Qo(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Hn||so(u,s);var h=xn,y=Nr;Fa(u.type)&&(xn=u.stateNode,Nr=!1),Qo(i,s,u),Iu(u.stateNode),xn=h,Nr=y;break;case 5:Hn||so(u,s);case 6:if(h=xn,y=Nr,xn=null,Qo(i,s,u),xn=h,Nr=y,xn!==null)if(Nr)try{(xn.nodeType===9?xn.body:xn.nodeName==="HTML"?xn.ownerDocument.body:xn).removeChild(u.stateNode)}catch(S){Kt(u,s,S)}else try{xn.removeChild(u.stateNode)}catch(S){Kt(u,s,S)}break;case 18:xn!==null&&(Nr?(i=xn,zj(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),sc(i)):zj(xn,u.stateNode));break;case 4:h=xn,y=Nr,xn=u.stateNode.containerInfo,Nr=!0,Qo(i,s,u),xn=h,Nr=y;break;case 0:case 11:case 14:case 15:La(2,u,s),Hn||La(4,u,s),Qo(i,s,u);break;case 1:Hn||(so(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&$w(u,s,h)),Qo(i,s,u);break;case 21:Qo(i,s,u);break;case 22:Hn=(h=Hn)||u.memoizedState!==null,Qo(i,s,u),Hn=h;break;default:Qo(i,s,u)}}function Qw(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{sc(i)}catch(u){Kt(s,s.return,u)}}}function Ww(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{sc(i)}catch(u){Kt(s,s.return,u)}}function GN(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new Fw),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new Fw),s;default:throw Error(r(435,i.tag))}}function $f(i,s){var u=GN(i);s.forEach(function(h){if(!u.has(h)){u.add(h);var y=t3.bind(null,i,h);h.then(y,y)}})}function Or(i,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var y=u[h],S=i,_=s,N=_;e:for(;N!==null;){switch(N.tag){case 27:if(Fa(N.type)){xn=N.stateNode,Nr=!1;break e}break;case 5:xn=N.stateNode,Nr=!1;break e;case 3:case 4:xn=N.stateNode.containerInfo,Nr=!0;break e}N=N.return}if(xn===null)throw Error(r(160));Gw(S,_,y),xn=null,Nr=!1,S=y.alternate,S!==null&&(S.return=null),y.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)Yw(s,i),s=s.sibling}var Ui=null;function Yw(i,s){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:Or(s,i),Mr(i),h&4&&(La(3,i,i.return),Ru(3,i),La(5,i,i.return));break;case 1:Or(s,i),Mr(i),h&512&&(Hn||u===null||so(u,u.return)),h&64&&Go&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var y=Ui;if(Or(s,i),Mr(i),h&512&&(Hn||u===null||so(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,y=y.ownerDocument||y;t:switch(h){case"title":S=y.getElementsByTagName("title")[0],(!S||S[Bt]||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"))),or(S,h,u),S[Me]=i,yn(S),h=S;break e;case"link":var _=Yj("link","href",y).get(h+(u.href||""));if(_){for(var N=0;N<_.length;N++)if(S=_[N],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)){_.splice(N,1);break t}}S=y.createElement(h),or(S,h,u),y.head.appendChild(S);break;case"meta":if(_=Yj("meta","content",y).get(h+(u.content||""))){for(N=0;N<_.length;N++)if(S=_[N],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)){_.splice(N,1);break t}}S=y.createElement(h),or(S,h,u),y.head.appendChild(S);break;default:throw Error(r(468,h))}S[Me]=i,yn(S),h=S}i.stateNode=h}else Kj(y,i.type,i.stateNode);else i.stateNode=Wj(y,h,i.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?Kj(y,i.type,i.stateNode):Wj(y,h,i.memoizedProps)):h===null&&i.stateNode!==null&&nv(i,i.memoizedProps,u.memoizedProps)}break;case 27:Or(s,i),Mr(i),h&512&&(Hn||u===null||so(u,u.return)),u!==null&&h&4&&nv(i,i.memoizedProps,u.memoizedProps);break;case 5:if(Or(s,i),Mr(i),h&512&&(Hn||u===null||so(u,u.return)),i.flags&32){y=i.stateNode;try{Al(y,"")}catch(Qe){Kt(i,i.return,Qe)}}h&4&&i.stateNode!=null&&(y=i.memoizedProps,nv(i,y,u!==null?u.memoizedProps:y)),h&1024&&(ov=!0);break;case 6:if(Or(s,i),Mr(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(Qe){Kt(i,i.return,Qe)}}break;case 3:if(th=null,y=Ui,Ui=Jf(s.containerInfo),Or(s,i),Ui=y,Mr(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{sc(s.containerInfo)}catch(Qe){Kt(i,i.return,Qe)}ov&&(ov=!1,Kw(i));break;case 4:h=Ui,Ui=Jf(i.stateNode.containerInfo),Or(s,i),Mr(i),Ui=h;break;case 12:Or(s,i),Mr(i);break;case 31:Or(s,i),Mr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,$f(i,h)));break;case 13:Or(s,i),Mr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Bf=me()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,$f(i,h)));break;case 22:y=i.memoizedState!==null;var V=u!==null&&u.memoizedState!==null,te=Go,ue=Hn;if(Go=te||y,Hn=ue||V,Or(s,i),Hn=ue,Go=te,Mr(i),h&8192)e:for(s=i.stateNode,s._visibility=y?s._visibility&-2:s._visibility|1,y&&(u===null||V||Go||Hn||Ls(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){V=u=s;try{if(S=V.stateNode,y)_=S.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none";else{N=V.stateNode;var pe=V.memoizedProps.style,ne=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;N.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Qe){Kt(V,V.return,Qe)}}}else if(s.tag===6){if(u===null){V=s;try{V.stateNode.nodeValue=y?"":V.memoizedProps}catch(Qe){Kt(V,V.return,Qe)}}}else if(s.tag===18){if(u===null){V=s;try{var se=V.stateNode;y?$j(se,!0):$j(V.stateNode,!1)}catch(Qe){Kt(V,V.return,Qe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,$f(i,u))));break;case 19:Or(s,i),Mr(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,$f(i,h)));break;case 30:break;case 21:break;default:Or(s,i),Mr(i)}}function Mr(i){var s=i.flags;if(s&2){try{for(var u,h=i.return;h!==null;){if(Bw(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var y=u.stateNode,S=rv(i);zf(i,S,y);break;case 5:var _=u.stateNode;u.flags&32&&(Al(_,""),u.flags&=-33);var N=rv(i);zf(i,N,_);break;case 3:case 4:var V=u.stateNode.containerInfo,te=rv(i);iv(i,te,V);break;default:throw Error(r(161))}}catch(ue){Kt(i,i.return,ue)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function Kw(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;Kw(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function Wo(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Hw(i,s.alternate,s),s=s.sibling}function Ls(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:La(4,s,s.return),Ls(s);break;case 1:so(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&$w(s,s.return,u),Ls(s);break;case 27:Iu(s.stateNode);case 26:case 5:so(s,s.return),Ls(s);break;case 22:s.memoizedState===null&&Ls(s);break;case 30:Ls(s);break;default:Ls(s)}i=i.sibling}}function Yo(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,y=i,S=s,_=S.flags;switch(S.tag){case 0:case 11:case 15:Yo(y,S,u),Ru(4,S);break;case 1:if(Yo(y,S,u),h=S,y=h.stateNode,typeof y.componentDidMount=="function")try{y.componentDidMount()}catch(te){Kt(h,h.return,te)}if(h=S,y=h.updateQueue,y!==null){var N=h.stateNode;try{var V=y.shared.hiddenCallbacks;if(V!==null)for(y.shared.hiddenCallbacks=null,y=0;y<V.length;y++)R1(V[y],N)}catch(te){Kt(h,h.return,te)}}u&&_&64&&zw(S),_u(S,S.return);break;case 27:Vw(S);case 26:case 5:Yo(y,S,u),u&&h===null&&_&4&&Uw(S),_u(S,S.return);break;case 12:Yo(y,S,u);break;case 31:Yo(y,S,u),u&&_&4&&Qw(y,S);break;case 13:Yo(y,S,u),u&&_&4&&Ww(y,S);break;case 22:S.memoizedState===null&&Yo(y,S,u),_u(S,S.return);break;case 30:break;default:Yo(y,S,u)}s=s.sibling}}function av(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&pu(u))}function sv(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&pu(i))}function Bi(i,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Xw(i,s,u,h),s=s.sibling}function Xw(i,s,u,h){var y=s.flags;switch(s.tag){case 0:case 11:case 15:Bi(i,s,u,h),y&2048&&Ru(9,s);break;case 1:Bi(i,s,u,h);break;case 3:Bi(i,s,u,h),y&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&pu(i)));break;case 12:if(y&2048){Bi(i,s,u,h),i=s.stateNode;try{var S=s.memoizedProps,_=S.id,N=S.onPostCommit;typeof N=="function"&&N(_,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(V){Kt(s,s.return,V)}}else Bi(i,s,u,h);break;case 31:Bi(i,s,u,h);break;case 13:Bi(i,s,u,h);break;case 23:break;case 22:S=s.stateNode,_=s.alternate,s.memoizedState!==null?S._visibility&2?Bi(i,s,u,h):Du(i,s):S._visibility&2?Bi(i,s,u,h):(S._visibility|=2,Kl(i,s,u,h,(s.subtreeFlags&10256)!==0||!1)),y&2048&&av(_,s);break;case 24:Bi(i,s,u,h),y&2048&&sv(s.alternate,s);break;default:Bi(i,s,u,h)}}function Kl(i,s,u,h,y){for(y=y&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var S=i,_=s,N=u,V=h,te=_.flags;switch(_.tag){case 0:case 11:case 15:Kl(S,_,N,V,y),Ru(8,_);break;case 23:break;case 22:var ue=_.stateNode;_.memoizedState!==null?ue._visibility&2?Kl(S,_,N,V,y):Du(S,_):(ue._visibility|=2,Kl(S,_,N,V,y)),y&&te&2048&&av(_.alternate,_);break;case 24:Kl(S,_,N,V,y),y&&te&2048&&sv(_.alternate,_);break;default:Kl(S,_,N,V,y)}s=s.sibling}}function Du(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,h=s,y=h.flags;switch(h.tag){case 22:Du(u,h),y&2048&&av(h.alternate,h);break;case 24:Du(u,h),y&2048&&sv(h.alternate,h);break;default:Du(u,h)}s=s.sibling}}var Au=8192;function Xl(i,s,u){if(i.subtreeFlags&Au)for(i=i.child;i!==null;)Zw(i,s,u),i=i.sibling}function Zw(i,s,u){switch(i.tag){case 26:Xl(i,s,u),i.flags&Au&&i.memoizedState!==null&&k3(u,Ui,i.memoizedState,i.memoizedProps);break;case 5:Xl(i,s,u);break;case 3:case 4:var h=Ui;Ui=Jf(i.stateNode.containerInfo),Xl(i,s,u),Ui=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=Au,Au=16777216,Xl(i,s,u),Au=h):Xl(i,s,u));break;default:Xl(i,s,u)}}function Jw(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Pu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];Kn=h,tj(h,i)}Jw(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ej(i),i=i.sibling}function ej(i){switch(i.tag){case 0:case 11:case 15:Pu(i),i.flags&2048&&La(9,i,i.return);break;case 3:Pu(i);break;case 12:Pu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Uf(i)):Pu(i);break;default:Pu(i)}}function Uf(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];Kn=h,tj(h,i)}Jw(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:La(8,s,s.return),Uf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Uf(s));break;default:Uf(s)}i=i.sibling}}function tj(i,s){for(;Kn!==null;){var u=Kn;switch(u.tag){case 0:case 11:case 15:La(8,u,s);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:pu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,Kn=h;else e:for(u=i;Kn!==null;){h=Kn;var y=h.sibling,S=h.return;if(qw(h),h===u){Kn=null;break e}if(y!==null){y.return=S,Kn=y;break e}Kn=S}}}var QN={getCacheForType:function(i){var s=rr(Bn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return rr(Bn).controller.signal}},WN=typeof WeakMap=="function"?WeakMap:Map,Vt=0,tn=null,wt=null,Ct=0,Yt=0,Xr=null,Ia=!1,Zl=!1,lv=!1,Ko=0,An=0,za=0,Is=0,cv=0,Zr=0,Jl=0,ku=null,Lr=null,uv=!1,Bf=0,nj=0,Vf=1/0,Ff=null,$a=null,Gn=0,Ua=null,ec=null,Xo=0,dv=0,fv=null,rj=null,Nu=0,hv=null;function Jr(){return(Vt&2)!==0&&Ct!==0?Ct&-Ct:O.T!==null?xv():We()}function ij(){if(Zr===0)if((Ct&536870912)===0||Rt){var i=to;to<<=1,(to&3932160)===0&&(to=262144),Zr=i}else Zr=536870912;return i=Yr.current,i!==null&&(i.flags|=32),Zr}function Ir(i,s,u){(i===tn&&(Yt===2||Yt===9)||i.cancelPendingCommit!==null)&&(tc(i,0),Ba(i,Ct,Zr,!1)),B(i,u),((Vt&2)===0||i!==tn)&&(i===tn&&((Vt&2)===0&&(Is|=u),An===4&&Ba(i,Ct,Zr,!1)),lo(i))}function oj(i,s,u){if((Vt&6)!==0)throw Error(r(327));var h=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Li(i,s),y=h?XN(i,s):mv(i,s,!0),S=h;do{if(y===0){Zl&&!h&&Ba(i,s,0,!1);break}else{if(u=i.current.alternate,S&&!YN(u)){y=mv(i,s,!1),S=!1;continue}if(y===2){if(S=s,i.errorRecoveryDisabledLanes&S)var _=0;else _=i.pendingLanes&-536870913,_=_!==0?_:_&536870912?536870912:0;if(_!==0){s=_;e:{var N=i;y=ku;var V=N.current.memoizedState.isDehydrated;if(V&&(tc(N,_).flags|=256),_=mv(N,_,!1),_!==2){if(lv&&!V){N.errorRecoveryDisabledLanes|=S,Is|=S,y=4;break e}S=Lr,Lr=y,S!==null&&(Lr===null?Lr=S:Lr.push.apply(Lr,S))}y=_}if(S=!1,y!==2)continue}}if(y===1){tc(i,0),Ba(i,s,0,!0);break}e:{switch(h=i,S=y,S){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ba(h,s,Zr,!Ia);break e;case 2:Lr=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(y=Bf+300-me(),10<y)){if(Ba(h,s,Zr,!Ia),No(h,0,!0)!==0)break e;Xo=s,h.timeoutHandle=Lj(aj.bind(null,h,u,Lr,Ff,uv,s,Zr,Is,Jl,Ia,S,"Throttled",-0,0),y);break e}aj(h,u,Lr,Ff,uv,s,Zr,Is,Jl,Ia,S,null,-0,0)}}break}while(!0);lo(i)}function aj(i,s,u,h,y,S,_,N,V,te,ue,pe,ne,se){if(i.timeoutHandle=-1,pe=s.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Lo},Zw(s,S,pe);var Qe=(S&62914560)===S?Bf-me():(S&4194048)===S?nj-me():0;if(Qe=N3(pe,Qe),Qe!==null){Xo=S,i.cancelPendingCommit=Qe(pj.bind(null,i,s,S,u,h,y,_,N,V,ue,pe,null,ne,se)),Ba(i,S,_,!te);return}}pj(i,s,S,u,h,y,_,N,V)}function YN(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.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(!Qr(S(),y))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ba(i,s,u,h){s&=~cv,s&=~Is,i.suspendedLanes|=s,i.pingedLanes&=~s,h&&(i.warmLanes|=s),h=i.expirationTimes;for(var y=s;0<y;){var S=31-er(y),_=1<<S;h[S]=-1,y&=~_}u!==0&&oe(i,u,s)}function Hf(){return(Vt&6)===0?(Ou(0),!1):!0}function pv(){if(wt!==null){if(Yt===0)var i=wt.return;else i=wt,Uo=_s=null,Ag(i),ql=null,gu=0,i=wt;for(;i!==null;)Iw(i.alternate,i),i=i.return;wt=null}}function tc(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,m3(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),Xo=0,pv(),tn=i,wt=u=zo(i.current,null),Ct=s,Yt=0,Xr=null,Ia=!1,Zl=Li(i,s),lv=!1,Jl=Zr=cv=Is=za=An=0,Lr=ku=null,uv=!1,(s&8)!==0&&(s|=s&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=s;0<h;){var y=31-er(h),S=1<<y;s|=i[y],h&=~S}return Ko=s,df(),u}function sj(i,s){pt=null,O.H=Cu,s===Hl||s===xf?(s=j1(),Yt=3):s===yg?(s=j1(),Yt=4):Yt=s===Gg?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,Xr=s,wt===null&&(An=1,Nf(i,pi(s,i.current)))}function lj(){var i=Yr.current;return i===null?!0:(Ct&4194048)===Ct?yi===null:(Ct&62914560)===Ct||(Ct&536870912)!==0?i===yi:!1}function cj(){var i=O.H;return O.H=Cu,i===null?Cu:i}function uj(){var i=O.A;return O.A=QN,i}function qf(){An=4,Ia||(Ct&4194048)!==Ct&&Yr.current!==null||(Zl=!0),(za&134217727)===0&&(Is&134217727)===0||tn===null||Ba(tn,Ct,Zr,!1)}function mv(i,s,u){var h=Vt;Vt|=2;var y=cj(),S=uj();(tn!==i||Ct!==s)&&(Ff=null,tc(i,s)),s=!1;var _=An;e:do try{if(Yt!==0&&wt!==null){var N=wt,V=Xr;switch(Yt){case 8:pv(),_=6;break e;case 3:case 2:case 9:case 6:Yr.current===null&&(s=!0);var te=Yt;if(Yt=0,Xr=null,nc(i,N,V,te),u&&Zl){_=0;break e}break;default:te=Yt,Yt=0,Xr=null,nc(i,N,V,te)}}KN(),_=An;break}catch(ue){sj(i,ue)}while(!0);return s&&i.shellSuspendCounter++,Uo=_s=null,Vt=h,O.H=y,O.A=S,wt===null&&(tn=null,Ct=0,df()),_}function KN(){for(;wt!==null;)dj(wt)}function XN(i,s){var u=Vt;Vt|=2;var h=cj(),y=uj();tn!==i||Ct!==s?(Ff=null,Vf=me()+500,tc(i,s)):Zl=Li(i,s);e:do try{if(Yt!==0&&wt!==null){s=wt;var S=Xr;t:switch(Yt){case 1:Yt=0,Xr=null,nc(i,s,S,1);break;case 2:case 9:if(S1(S)){Yt=0,Xr=null,fj(s);break}s=function(){Yt!==2&&Yt!==9||tn!==i||(Yt=7),lo(i)},S.then(s,s);break e;case 3:Yt=7;break e;case 4:Yt=5;break e;case 7:S1(S)?(Yt=0,Xr=null,fj(s)):(Yt=0,Xr=null,nc(i,s,S,7));break;case 5:var _=null;switch(wt.tag){case 26:_=wt.memoizedState;case 5:case 27:var N=wt;if(_?Xj(_):N.stateNode.complete){Yt=0,Xr=null;var V=N.sibling;if(V!==null)wt=V;else{var te=N.return;te!==null?(wt=te,Gf(te)):wt=null}break t}}Yt=0,Xr=null,nc(i,s,S,5);break;case 6:Yt=0,Xr=null,nc(i,s,S,6);break;case 8:pv(),An=6;break e;default:throw Error(r(462))}}ZN();break}catch(ue){sj(i,ue)}while(!0);return Uo=_s=null,O.H=h,O.A=y,Vt=u,wt!==null?0:(tn=null,Ct=0,df(),An)}function ZN(){for(;wt!==null&&!Se();)dj(wt)}function dj(i){var s=Mw(i.alternate,i,Ko);i.memoizedProps=i.pendingProps,s===null?Gf(i):wt=s}function fj(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=Dw(u,s,s.pendingProps,s.type,void 0,Ct);break;case 11:s=Dw(u,s,s.pendingProps,s.type.render,s.ref,Ct);break;case 5:Ag(s);default:Iw(u,s),s=wt=u1(s,Ko),s=Mw(u,s,Ko)}i.memoizedProps=i.pendingProps,s===null?Gf(i):wt=s}function nc(i,s,u,h){Uo=_s=null,Ag(s),ql=null,gu=0;var y=s.return;try{if(UN(i,y,s,u,Ct)){An=1,Nf(i,pi(u,i.current)),wt=null;return}}catch(S){if(y!==null)throw wt=y,S;An=1,Nf(i,pi(u,i.current)),wt=null;return}s.flags&32768?(Rt||h===1?i=!0:Zl||(Ct&536870912)!==0?i=!1:(Ia=i=!0,(h===2||h===9||h===3||h===6)&&(h=Yr.current,h!==null&&h.tag===13&&(h.flags|=16384))),hj(s,i)):Gf(s)}function Gf(i){var s=i;do{if((s.flags&32768)!==0){hj(s,Ia);return}i=s.return;var u=FN(s.alternate,s,Ko);if(u!==null){wt=u;return}if(s=s.sibling,s!==null){wt=s;return}wt=s=i}while(s!==null);An===0&&(An=5)}function hj(i,s){do{var u=HN(i.alternate,i);if(u!==null){u.flags&=32767,wt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){wt=i;return}wt=i=u}while(i!==null);An=6,wt=null}function pj(i,s,u,h,y,S,_,N,V){i.cancelPendingCommit=null;do Qf();while(Gn!==0);if((Vt&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(S=s.lanes|s.childLanes,S|=rg,X(i,u,S,_,N,V),i===tn&&(wt=tn=null,Ct=0),ec=s,Ua=i,Xo=u,dv=S,fv=y,rj=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,n3(jn,function(){return xj(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=O.T,O.T=null,y=I.p,I.p=2,_=Vt,Vt|=4;try{qN(i,s,u)}finally{Vt=_,I.p=y,O.T=h}}Gn=1,mj(),gj(),vj()}}function mj(){if(Gn===1){Gn=0;var i=Ua,s=ec,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=O.T,O.T=null;var h=I.p;I.p=2;var y=Vt;Vt|=4;try{Yw(s,i);var S=Rv,_=t1(i.containerInfo),N=S.focusedElem,V=S.selectionRange;if(_!==N&&N&&N.ownerDocument&&e1(N.ownerDocument.documentElement,N)){if(V!==null&&Zm(N)){var te=V.start,ue=V.end;if(ue===void 0&&(ue=te),"selectionStart"in N)N.selectionStart=te,N.selectionEnd=Math.min(ue,N.value.length);else{var pe=N.ownerDocument||document,ne=pe&&pe.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),Qe=N.textContent.length,st=Math.min(V.start,Qe),en=V.end===void 0?st:Math.min(V.end,Qe);!se.extend&&st>en&&(_=en,en=st,st=_);var W=JS(N,st),G=JS(N,en);if(W&&G&&(se.rangeCount!==1||se.anchorNode!==W.node||se.anchorOffset!==W.offset||se.focusNode!==G.node||se.focusOffset!==G.offset)){var ee=pe.createRange();ee.setStart(W.node,W.offset),se.removeAllRanges(),st>en?(se.addRange(ee),se.extend(G.node,G.offset)):(ee.setEnd(G.node,G.offset),se.addRange(ee))}}}}for(pe=[],se=N;se=se.parentNode;)se.nodeType===1&&pe.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<pe.length;N++){var he=pe[N];he.element.scrollLeft=he.left,he.element.scrollTop=he.top}}oh=!!Tv,Rv=Tv=null}finally{Vt=y,I.p=h,O.T=u}}i.current=s,Gn=2}}function gj(){if(Gn===2){Gn=0;var i=Ua,s=ec,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=O.T,O.T=null;var h=I.p;I.p=2;var y=Vt;Vt|=4;try{Hw(i,s.alternate,s)}finally{Vt=y,I.p=h,O.T=u}}Gn=3}}function vj(){if(Gn===4||Gn===3){Gn=0,He();var i=Ua,s=ec,u=Xo,h=rj;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?Gn=5:(Gn=0,ec=Ua=null,yj(i,i.pendingLanes));var y=i.pendingLanes;if(y===0&&($a=null),Je(u),s=s.stateNode,Wn&&typeof Wn.onCommitFiberRoot=="function")try{Wn.onCommitFiberRoot(si,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=O.T,y=I.p,I.p=2,O.T=null;try{for(var S=i.onRecoverableError,_=0;_<h.length;_++){var N=h[_];S(N.value,{componentStack:N.stack})}}finally{O.T=s,I.p=y}}(Xo&3)!==0&&Qf(),lo(i),y=i.pendingLanes,(u&261930)!==0&&(y&42)!==0?i===hv?Nu++:(Nu=0,hv=i):Nu=0,Ou(0)}}function yj(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,pu(s)))}function Qf(){return mj(),gj(),vj(),xj()}function xj(){if(Gn!==5)return!1;var i=Ua,s=dv;dv=0;var u=Je(Xo),h=O.T,y=I.p;try{I.p=32>u?32:u,O.T=null,u=fv,fv=null;var S=Ua,_=Xo;if(Gn=0,ec=Ua=null,Xo=0,(Vt&6)!==0)throw Error(r(331));var N=Vt;if(Vt|=4,ej(S.current),Xw(S,S.current,_,u),Vt=N,Ou(0,!1),Wn&&typeof Wn.onPostCommitFiberRoot=="function")try{Wn.onPostCommitFiberRoot(si,S)}catch{}return!0}finally{I.p=y,O.T=h,yj(i,s)}}function bj(i,s,u){s=pi(u,s),s=qg(i.stateNode,s,2),i=Na(i,s,2),i!==null&&(B(i,2),lo(i))}function Kt(i,s,u){if(i.tag===3)bj(i,i,u);else for(;s!==null;){if(s.tag===3){bj(s,i,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&($a===null||!$a.has(h))){i=pi(u,i),u=Sw(2),h=Na(s,u,2),h!==null&&(ww(u,h,s,i),B(h,2),lo(h));break}}s=s.return}}function gv(i,s,u){var h=i.pingCache;if(h===null){h=i.pingCache=new WN;var y=new Set;h.set(s,y)}else y=h.get(s),y===void 0&&(y=new Set,h.set(s,y));y.has(u)||(lv=!0,y.add(u),i=JN.bind(null,i,s,u),s.then(i,i))}function JN(i,s,u){var h=i.pingCache;h!==null&&h.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,tn===i&&(Ct&u)===u&&(An===4||An===3&&(Ct&62914560)===Ct&&300>me()-Bf?(Vt&2)===0&&tc(i,0):cv|=u,Jl===Ct&&(Jl=0)),lo(i)}function Sj(i,s){s===0&&(s=_l()),i=Es(i,s),i!==null&&(B(i,s),lo(i))}function e3(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),Sj(i,u)}function t3(i,s){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,y=i.memoizedState;y!==null&&(u=y.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),Sj(i,u)}function n3(i,s){return _e(i,s)}var Wf=null,rc=null,vv=!1,Yf=!1,yv=!1,Va=0;function lo(i){i!==rc&&i.next===null&&(rc===null?Wf=rc=i:rc=rc.next=i),Yf=!0,vv||(vv=!0,i3())}function Ou(i,s){if(!yv&&Yf){yv=!0;do for(var u=!1,h=Wf;h!==null;){if(i!==0){var y=h.pendingLanes;if(y===0)var S=0;else{var _=h.suspendedLanes,N=h.pingedLanes;S=(1<<31-er(42|i)+1)-1,S&=y&~(_&~N),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,Ej(h,S))}else S=Ct,S=No(h,h===tn?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||Li(h,S)||(u=!0,Ej(h,S));h=h.next}while(u);yv=!1}}function r3(){wj()}function wj(){Yf=vv=!1;var i=0;Va!==0&&p3()&&(i=Va);for(var s=me(),u=null,h=Wf;h!==null;){var y=h.next,S=jj(h,s);S===0?(h.next=null,u===null?Wf=y:u.next=y,y===null&&(rc=u)):(u=h,(i!==0||(S&3)!==0)&&(Yf=!0)),h=y}Gn!==0&&Gn!==5||Ou(i),Va!==0&&(Va=0)}function jj(i,s){for(var u=i.suspendedLanes,h=i.pingedLanes,y=i.expirationTimes,S=i.pendingLanes&-62914561;0<S;){var _=31-er(S),N=1<<_,V=y[_];V===-1?((N&u)===0||(N&h)!==0)&&(y[_]=Ea(N,s)):V<=s&&(i.expiredLanes|=N),S&=~N}if(s=tn,u=Ct,u=No(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===s&&(Yt===2||Yt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&&ge(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Li(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(h!==null&&ge(h),Je(u)){case 2:case 8:u=Wt;break;case 32:u=jn;break;case 268435456:u=Cn;break;default:u=jn}return h=Cj.bind(null,i),u=_e(u,h),i.callbackPriority=s,i.callbackNode=u,s}return h!==null&&h!==null&&ge(h),i.callbackPriority=2,i.callbackNode=null,2}function Cj(i,s){if(Gn!==0&&Gn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Qf()&&i.callbackNode!==u)return null;var h=Ct;return h=No(i,i===tn?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(oj(i,h,s),jj(i,me()),i.callbackNode!=null&&i.callbackNode===u?Cj.bind(null,i):null)}function Ej(i,s){if(Qf())return null;oj(i,s,!0)}function i3(){g3(function(){(Vt&6)!==0?_e(Nt,r3):wj()})}function xv(){if(Va===0){var i=Vl;i===0&&(i=li,li<<=1,(li&261888)===0&&(li=256)),Va=i}return Va}function Tj(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:nf(""+i)}function Rj(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function o3(i,s,u,h,y){if(s==="submit"&&u&&u.stateNode===y){var S=Tj((y[Le]||null).action),_=h.submitter;_&&(s=(s=_[Le]||null)?Tj(s.formAction):_.getAttribute("formAction"),s!==null&&(S=s,_=null));var N=new sf("action","action",null,h,y);i.push({event:N,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Va!==0){var V=_?Rj(y,_):new FormData(y);$g(u,{pending:!0,data:V,method:y.method,action:S},null,V)}}else typeof S=="function"&&(N.preventDefault(),V=_?Rj(y,_):new FormData(y),$g(u,{pending:!0,data:V,method:y.method,action:S},S,V))},currentTarget:y}]})}}for(var bv=0;bv<ng.length;bv++){var Sv=ng[bv],a3=Sv.toLowerCase(),s3=Sv[0].toUpperCase()+Sv.slice(1);$i(a3,"on"+s3)}$i(i1,"onAnimationEnd"),$i(o1,"onAnimationIteration"),$i(a1,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(jN,"onTransitionRun"),$i(CN,"onTransitionStart"),$i(EN,"onTransitionCancel"),$i(s1,"onTransitionEnd"),yt("onMouseEnter",["mouseout","mouseover"]),yt("onMouseLeave",["mouseout","mouseover"]),yt("onPointerEnter",["pointerout","pointerover"]),yt("onPointerLeave",["pointerout","pointerover"]),ui("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ui("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ui("onBeforeInput",["compositionend","keypress","textInput","paste"]),ui("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ui("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ui("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Mu="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(" "),l3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Mu));function _j(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],y=h.event;h=h.listeners;e:{var S=void 0;if(s)for(var _=h.length-1;0<=_;_--){var N=h[_],V=N.instance,te=N.currentTarget;if(N=N.listener,V!==S&&y.isPropagationStopped())break e;S=N,y.currentTarget=te;try{S(y)}catch(ue){uf(ue)}y.currentTarget=null,S=V}else for(_=0;_<h.length;_++){if(N=h[_],V=N.instance,te=N.currentTarget,N=N.listener,V!==S&&y.isPropagationStopped())break e;S=N,y.currentTarget=te;try{S(y)}catch(ue){uf(ue)}y.currentTarget=null,S=V}}}}function jt(i,s){var u=s[Lt];u===void 0&&(u=s[Lt]=new Set);var h=i+"__bubble";u.has(h)||(Dj(s,i,2,!1),u.add(h))}function wv(i,s,u){var h=0;s&&(h|=4),Dj(u,i,h,s)}var Kf="_reactListening"+Math.random().toString(36).slice(2);function jv(i){if(!i[Kf]){i[Kf]=!0,ro.forEach(function(u){u!=="selectionchange"&&(l3.has(u)||wv(u,!1,i),wv(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[Kf]||(s[Kf]=!0,wv("selectionchange",!1,s))}}function Dj(i,s,u,h){switch(iC(s)){case 2:var y=L3;break;case 8:y=I3;break;default:y=zv}u=y.bind(null,s,u,i),y=void 0,!Fm||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(y=!0),h?y!==void 0?i.addEventListener(s,u,{capture:!0,passive:y}):i.addEventListener(s,u,!0):y!==void 0?i.addEventListener(s,u,{passive:y}):i.addEventListener(s,u,!1)}function Cv(i,s,u,h,y){var S=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var _=h.tag;if(_===3||_===4){var N=h.stateNode.containerInfo;if(N===y)break;if(_===4)for(_=h.return;_!==null;){var V=_.tag;if((V===3||V===4)&&_.stateNode.containerInfo===y)return;_=_.return}for(;N!==null;){if(_=ci(N),_===null)return;if(V=_.tag,V===5||V===6||V===26||V===27){h=S=_;continue e}N=N.parentNode}}h=h.return}OS(function(){var te=S,ue=Bm(u),pe=[];e:{var ne=l1.get(i);if(ne!==void 0){var se=sf,Qe=i;switch(i){case"keypress":if(of(u)===0)break e;case"keydown":case"keyup":se=tN;break;case"focusin":Qe="focus",se=Qm;break;case"focusout":Qe="blur",se=Qm;break;case"beforeblur":case"afterblur":se=Qm;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":se=IS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=Fk;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=iN;break;case i1:case o1:case a1:se=Gk;break;case s1:se=aN;break;case"scroll":case"scrollend":se=Bk;break;case"wheel":se=lN;break;case"copy":case"cut":case"paste":se=Wk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=$S;break;case"toggle":case"beforetoggle":se=uN}var st=(s&4)!==0,en=!st&&(i==="scroll"||i==="scrollend"),W=st?ne!==null?ne+"Capture":null:ne;st=[];for(var G=te,ee;G!==null;){var he=G;if(ee=he.stateNode,he=he.tag,he!==5&&he!==26&&he!==27||ee===null||W===null||(he=ru(G,W),he!=null&&st.push(Lu(G,he,ee))),en)break;G=G.return}0<st.length&&(ne=new se(ne,Qe,null,u,ue),pe.push({event:ne,listeners:st}))}}if((s&7)===0){e:{if(ne=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",ne&&u!==Um&&(Qe=u.relatedTarget||u.fromElement)&&(ci(Qe)||Qe[qe]))break e;if((se||ne)&&(ne=ue.window===ue?ue:(ne=ue.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(Qe=u.relatedTarget||u.toElement,se=te,Qe=Qe?ci(Qe):null,Qe!==null&&(en=l(Qe),st=Qe.tag,Qe!==en||st!==5&&st!==27&&st!==6)&&(Qe=null)):(se=null,Qe=te),se!==Qe)){if(st=IS,he="onMouseLeave",W="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(st=$S,he="onPointerLeave",W="onPointerEnter",G="pointer"),en=se==null?ne:lr(se),ee=Qe==null?ne:lr(Qe),ne=new st(he,G+"leave",se,u,ue),ne.target=en,ne.relatedTarget=ee,he=null,ci(ue)===te&&(st=new st(W,G+"enter",Qe,u,ue),st.target=ee,st.relatedTarget=en,he=st),en=he,se&&Qe)t:{for(st=c3,W=se,G=Qe,ee=0,he=W;he;he=st(he))ee++;he=0;for(var ot=G;ot;ot=st(ot))he++;for(;0<ee-he;)W=st(W),ee--;for(;0<he-ee;)G=st(G),he--;for(;ee--;){if(W===G||G!==null&&W===G.alternate){st=W;break t}W=st(W),G=st(G)}st=null}else st=null;se!==null&&Aj(pe,ne,se,st,!1),Qe!==null&&en!==null&&Aj(pe,en,Qe,st,!0)}}e:{if(ne=te?lr(te):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var It=QS;else if(qS(ne))if(WS)It=bN;else{It=yN;var et=vN}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?te&&$m(te.elementType)&&(It=QS):It=xN;if(It&&(It=It(i,te))){GS(pe,It,u,ue);break e}et&&et(i,ne,te),i==="focusout"&&te&&ne.type==="number"&&te.memoizedProps.value!=null&&zm(ne,"number",ne.value)}switch(et=te?lr(te):window,i){case"focusin":(qS(et)||et.contentEditable==="true")&&(Ol=et,Jm=te,du=null);break;case"focusout":du=Jm=Ol=null;break;case"mousedown":eg=!0;break;case"contextmenu":case"mouseup":case"dragend":eg=!1,n1(pe,u,ue);break;case"selectionchange":if(wN)break;case"keydown":case"keyup":n1(pe,u,ue)}var gt;if(Ym)e:{switch(i){case"compositionstart":var Et="onCompositionStart";break e;case"compositionend":Et="onCompositionEnd";break e;case"compositionupdate":Et="onCompositionUpdate";break e}Et=void 0}else Nl?FS(i,u)&&(Et="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(Et="onCompositionStart");Et&&(US&&u.locale!=="ko"&&(Nl||Et!=="onCompositionStart"?Et==="onCompositionEnd"&&Nl&&(gt=MS()):(Ta=ue,Hm="value"in Ta?Ta.value:Ta.textContent,Nl=!0)),et=Xf(te,Et),0<et.length&&(Et=new zS(Et,i,null,u,ue),pe.push({event:Et,listeners:et}),gt?Et.data=gt:(gt=HS(u),gt!==null&&(Et.data=gt)))),(gt=fN?hN(i,u):pN(i,u))&&(Et=Xf(te,"onBeforeInput"),0<Et.length&&(et=new zS("onBeforeInput","beforeinput",null,u,ue),pe.push({event:et,listeners:Et}),et.data=gt)),o3(pe,i,te,u,ue)}_j(pe,s)})}function Lu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function Xf(i,s){for(var u=s+"Capture",h=[];i!==null;){var y=i,S=y.stateNode;if(y=y.tag,y!==5&&y!==26&&y!==27||S===null||(y=ru(i,u),y!=null&&h.unshift(Lu(i,y,S)),y=ru(i,s),y!=null&&h.push(Lu(i,y,S))),i.tag===3)return h;i=i.return}return[]}function c3(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Aj(i,s,u,h,y){for(var S=s._reactName,_=[];u!==null&&u!==h;){var N=u,V=N.alternate,te=N.stateNode;if(N=N.tag,V!==null&&V===h)break;N!==5&&N!==26&&N!==27||te===null||(V=te,y?(te=ru(u,S),te!=null&&_.unshift(Lu(u,te,V))):y||(te=ru(u,S),te!=null&&_.push(Lu(u,te,V)))),u=u.return}_.length!==0&&i.push({event:s,listeners:_})}var u3=/\r\n?/g,d3=/\u0000|\uFFFD/g;function Pj(i){return(typeof i=="string"?i:""+i).replace(u3,`
581
- `).replace(d3,"")}function kj(i,s){return s=Pj(s),Pj(i)===s}function Jt(i,s,u,h,y,S){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||Al(i,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&Al(i,""+h);break;case"className":Ss(i,"class",h);break;case"tabIndex":Ss(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Ss(i,u,h);break;case"style":kS(i,h,S);break;case"data":if(s!=="object"){Ss(i,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=nf(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.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"?(s!=="input"&&Jt(i,s,"name",y.name,y,null),Jt(i,s,"formEncType",y.formEncType,y,null),Jt(i,s,"formMethod",y.formMethod,y,null),Jt(i,s,"formTarget",y.formTarget,y,null)):(Jt(i,s,"encType",y.encType,y,null),Jt(i,s,"method",y.method,y,null),Jt(i,s,"target",y.target,y,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=nf(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=Lo);break;case"onScroll":h!=null&&jt("scroll",i);break;case"onScrollEnd":h!=null&&jt("scrollend",i);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));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=nf(""+h),i.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"?i.setAttribute(u,""+h):i.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"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":jt("beforetoggle",i),jt("toggle",i),Mo(i,"popover",h);break;case"xlinkActuate":zi(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":zi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":zi(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":zi(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":zi(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":zi(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":zi(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":zi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":zi(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Mo(i,"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=$k.get(u)||u,Mo(i,u,h))}}function Ev(i,s,u,h,y,S){switch(u){case"style":kS(i,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));i.innerHTML=u}}break;case"children":typeof h=="string"?Al(i,h):(typeof h=="number"||typeof h=="bigint")&&Al(i,""+h);break;case"onScroll":h!=null&&jt("scroll",i);break;case"onScrollEnd":h!=null&&jt("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Lo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!bs.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(y=u.endsWith("Capture"),s=u.slice(2,y?u.length-7:void 0),S=i[Le]||null,S=S!=null?S[u]:null,typeof S=="function"&&i.removeEventListener(s,S,y),typeof h=="function")){typeof S!="function"&&S!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,h,y);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):Mo(i,u,h)}}}function or(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":jt("error",i),jt("load",i);var h=!1,y=!1,S;for(S in u)if(u.hasOwnProperty(S)){var _=u[S];if(_!=null)switch(S){case"src":h=!0;break;case"srcSet":y=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Jt(i,s,S,_,u,null)}}y&&Jt(i,s,"srcSet",u.srcSet,u,null),h&&Jt(i,s,"src",u.src,u,null);return;case"input":jt("invalid",i);var N=S=_=y=null,V=null,te=null;for(h in u)if(u.hasOwnProperty(h)){var ue=u[h];if(ue!=null)switch(h){case"name":y=ue;break;case"type":_=ue;break;case"checked":V=ue;break;case"defaultChecked":te=ue;break;case"value":S=ue;break;case"defaultValue":N=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(r(137,s));break;default:Jt(i,s,h,ue,u,null)}}_S(i,S,N,V,te,_,y,!1);return;case"select":jt("invalid",i),h=_=S=null;for(y in u)if(u.hasOwnProperty(y)&&(N=u[y],N!=null))switch(y){case"value":S=N;break;case"defaultValue":_=N;break;case"multiple":h=N;default:Jt(i,s,y,N,u,null)}s=S,u=_,i.multiple=!!h,s!=null?Dl(i,!!h,s,!1):u!=null&&Dl(i,!!h,u,!0);return;case"textarea":jt("invalid",i),S=y=h=null;for(_ in u)if(u.hasOwnProperty(_)&&(N=u[_],N!=null))switch(_){case"value":h=N;break;case"defaultValue":y=N;break;case"children":S=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(r(91));break;default:Jt(i,s,_,N,u,null)}AS(i,h,y,S);return;case"option":for(V in u)if(u.hasOwnProperty(V)&&(h=u[V],h!=null))switch(V){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Jt(i,s,V,h,u,null)}return;case"dialog":jt("beforetoggle",i),jt("toggle",i),jt("cancel",i),jt("close",i);break;case"iframe":case"object":jt("load",i);break;case"video":case"audio":for(h=0;h<Mu.length;h++)jt(Mu[h],i);break;case"image":jt("error",i),jt("load",i);break;case"details":jt("toggle",i);break;case"embed":case"source":case"link":jt("error",i),jt("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(te in u)if(u.hasOwnProperty(te)&&(h=u[te],h!=null))switch(te){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Jt(i,s,te,h,u,null)}return;default:if($m(s)){for(ue in u)u.hasOwnProperty(ue)&&(h=u[ue],h!==void 0&&Ev(i,s,ue,h,u,void 0));return}}for(N in u)u.hasOwnProperty(N)&&(h=u[N],h!=null&&Jt(i,s,N,h,u,null))}function f3(i,s,u,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var y=null,S=null,_=null,N=null,V=null,te=null,ue=null;for(se in u){var pe=u[se];if(u.hasOwnProperty(se)&&pe!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":V=pe;default:h.hasOwnProperty(se)||Jt(i,s,se,null,h,pe)}}for(var ne in h){var se=h[ne];if(pe=u[ne],h.hasOwnProperty(ne)&&(se!=null||pe!=null))switch(ne){case"type":S=se;break;case"name":y=se;break;case"checked":te=se;break;case"defaultChecked":ue=se;break;case"value":_=se;break;case"defaultValue":N=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,s));break;default:se!==pe&&Jt(i,s,ne,se,h,pe)}}Im(i,_,N,V,te,ue,S,y);return;case"select":se=_=N=ne=null;for(S in u)if(V=u[S],u.hasOwnProperty(S)&&V!=null)switch(S){case"value":break;case"multiple":se=V;default:h.hasOwnProperty(S)||Jt(i,s,S,null,h,V)}for(y in h)if(S=h[y],V=u[y],h.hasOwnProperty(y)&&(S!=null||V!=null))switch(y){case"value":ne=S;break;case"defaultValue":N=S;break;case"multiple":_=S;default:S!==V&&Jt(i,s,y,S,h,V)}s=N,u=_,h=se,ne!=null?Dl(i,!!u,ne,!1):!!h!=!!u&&(s!=null?Dl(i,!!u,s,!0):Dl(i,!!u,u?[]:"",!1));return;case"textarea":se=ne=null;for(N in u)if(y=u[N],u.hasOwnProperty(N)&&y!=null&&!h.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Jt(i,s,N,null,h,y)}for(_ in h)if(y=h[_],S=u[_],h.hasOwnProperty(_)&&(y!=null||S!=null))switch(_){case"value":ne=y;break;case"defaultValue":se=y;break;case"children":break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(r(91));break;default:y!==S&&Jt(i,s,_,y,h,S)}DS(i,ne,se);return;case"option":for(var Qe in u)if(ne=u[Qe],u.hasOwnProperty(Qe)&&ne!=null&&!h.hasOwnProperty(Qe))switch(Qe){case"selected":i.selected=!1;break;default:Jt(i,s,Qe,null,h,ne)}for(V in h)if(ne=h[V],se=u[V],h.hasOwnProperty(V)&&ne!==se&&(ne!=null||se!=null))switch(V){case"selected":i.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:Jt(i,s,V,ne,h,se)}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 st in u)ne=u[st],u.hasOwnProperty(st)&&ne!=null&&!h.hasOwnProperty(st)&&Jt(i,s,st,null,h,ne);for(te in h)if(ne=h[te],se=u[te],h.hasOwnProperty(te)&&ne!==se&&(ne!=null||se!=null))switch(te){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,s));break;default:Jt(i,s,te,ne,h,se)}return;default:if($m(s)){for(var en in u)ne=u[en],u.hasOwnProperty(en)&&ne!==void 0&&!h.hasOwnProperty(en)&&Ev(i,s,en,void 0,h,ne);for(ue in h)ne=h[ue],se=u[ue],!h.hasOwnProperty(ue)||ne===se||ne===void 0&&se===void 0||Ev(i,s,ue,ne,h,se);return}}for(var W in u)ne=u[W],u.hasOwnProperty(W)&&ne!=null&&!h.hasOwnProperty(W)&&Jt(i,s,W,null,h,ne);for(pe in h)ne=h[pe],se=u[pe],!h.hasOwnProperty(pe)||ne===se||ne==null&&se==null||Jt(i,s,pe,ne,h,se)}function Nj(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function h3(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var y=u[h],S=y.transferSize,_=y.initiatorType,N=y.duration;if(S&&N&&Nj(_)){for(_=0,N=y.responseEnd,h+=1;h<u.length;h++){var V=u[h],te=V.startTime;if(te>N)break;var ue=V.transferSize,pe=V.initiatorType;ue&&Nj(pe)&&(V=V.responseEnd,_+=ue*(V<N?1:(N-te)/(V-te)))}if(--h,s+=8*(S+_)/(y.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Tv=null,Rv=null;function Zf(i){return i.nodeType===9?i:i.ownerDocument}function Oj(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Mj(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function _v(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Dv=null;function p3(){var i=window.event;return i&&i.type==="popstate"?i===Dv?!1:(Dv=i,!0):(Dv=null,!1)}var Lj=typeof setTimeout=="function"?setTimeout:void 0,m3=typeof clearTimeout=="function"?clearTimeout:void 0,Ij=typeof Promise=="function"?Promise:void 0,g3=typeof queueMicrotask=="function"?queueMicrotask:typeof Ij<"u"?function(i){return Ij.resolve(null).then(i).catch(v3)}:Lj;function v3(i){setTimeout(function(){throw i})}function Fa(i){return i==="head"}function zj(i,s){var u=s,h=0;do{var y=u.nextSibling;if(i.removeChild(u),y&&y.nodeType===8)if(u=y.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(y),sc(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Iu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Iu(u);for(var S=u.firstChild;S;){var _=S.nextSibling,N=S.nodeName;S[Bt]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=_}}else u==="body"&&Iu(i.ownerDocument.body);u=y}while(u);sc(s)}function $j(i,s){var u=i;i=0;do{var h=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=h}while(u)}function Av(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Av(u),Ii(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function y3(i,s,u,h){for(;i.nodeType===1;){var y=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[Bt])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(S=i.getAttribute("rel"),S==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(S!==y.rel||i.getAttribute("href")!==(y.href==null||y.href===""?null:y.href)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin)||i.getAttribute("title")!==(y.title==null?null:y.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(S=i.getAttribute("src"),(S!==(y.src==null?null:y.src)||i.getAttribute("type")!==(y.type==null?null:y.type)||i.getAttribute("crossorigin")!==(y.crossOrigin==null?null:y.crossOrigin))&&S&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var S=y.name==null?null:""+y.name;if(y.type==="hidden"&&i.getAttribute("name")===S)return i}else return i;if(i=xi(i.nextSibling),i===null)break}return null}function x3(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=xi(i.nextSibling),i===null))return null;return i}function Uj(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=xi(i.nextSibling),i===null))return null;return i}function Pv(i){return i.data==="$?"||i.data==="$~"}function kv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function b3(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function xi(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Nv=null;function Bj(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return xi(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function Vj(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function Fj(i,s,u){switch(s=Zf(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Iu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);Ii(i)}var bi=new Map,Hj=new Set;function Jf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Zo=I.d;I.d={f:S3,r:w3,D:j3,C:C3,L:E3,m:T3,X:_3,S:R3,M:D3};function S3(){var i=Zo.f(),s=Hf();return i||s}function w3(i){var s=br(i);s!==null&&s.tag===5&&s.type==="form"?sw(s):Zo.r(i)}var ic=typeof document>"u"?null:document;function qj(i,s,u){var h=ic;if(h&&typeof s=="string"&&s){var y=fi(s);y='link[rel="'+i+'"][href="'+y+'"]',typeof u=="string"&&(y+='[crossorigin="'+u+'"]'),Hj.has(y)||(Hj.add(y),i={rel:i,crossOrigin:u,href:s},h.querySelector(y)===null&&(s=h.createElement("link"),or(s,"link",i),yn(s),h.head.appendChild(s)))}}function j3(i){Zo.D(i),qj("dns-prefetch",i,null)}function C3(i,s){Zo.C(i,s),qj("preconnect",i,s)}function E3(i,s,u){Zo.L(i,s,u);var h=ic;if(h&&i&&s){var y='link[rel="preload"][as="'+fi(s)+'"]';s==="image"&&u&&u.imageSrcSet?(y+='[imagesrcset="'+fi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(y+='[imagesizes="'+fi(u.imageSizes)+'"]')):y+='[href="'+fi(i)+'"]';var S=y;switch(s){case"style":S=oc(i);break;case"script":S=ac(i)}bi.has(S)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),bi.set(S,i),h.querySelector(y)!==null||s==="style"&&h.querySelector(zu(S))||s==="script"&&h.querySelector($u(S))||(s=h.createElement("link"),or(s,"link",i),yn(s),h.head.appendChild(s)))}}function T3(i,s){Zo.m(i,s);var u=ic;if(u&&i){var h=s&&typeof s.as=="string"?s.as:"script",y='link[rel="modulepreload"][as="'+fi(h)+'"][href="'+fi(i)+'"]',S=y;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=ac(i)}if(!bi.has(S)&&(i=g({rel:"modulepreload",href:i},s),bi.set(S,i),u.querySelector(y)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector($u(S)))return}h=u.createElement("link"),or(h,"link",i),yn(h),u.head.appendChild(h)}}}function R3(i,s,u){Zo.S(i,s,u);var h=ic;if(h&&i){var y=no(h).hoistableStyles,S=oc(i);s=s||"default";var _=y.get(S);if(!_){var N={loading:0,preload:null};if(_=h.querySelector(zu(S)))N.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=bi.get(S))&&Ov(i,u);var V=_=h.createElement("link");yn(V),or(V,"link",i),V._p=new Promise(function(te,ue){V.onload=te,V.onerror=ue}),V.addEventListener("load",function(){N.loading|=1}),V.addEventListener("error",function(){N.loading|=2}),N.loading|=4,eh(_,s,h)}_={type:"stylesheet",instance:_,count:1,state:N},y.set(S,_)}}}function _3(i,s){Zo.X(i,s);var u=ic;if(u&&i){var h=no(u).hoistableScripts,y=ac(i),S=h.get(y);S||(S=u.querySelector($u(y)),S||(i=g({src:i,async:!0},s),(s=bi.get(y))&&Mv(i,s),S=u.createElement("script"),yn(S),or(S,"link",i),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function D3(i,s){Zo.M(i,s);var u=ic;if(u&&i){var h=no(u).hoistableScripts,y=ac(i),S=h.get(y);S||(S=u.querySelector($u(y)),S||(i=g({src:i,async:!0,type:"module"},s),(s=bi.get(y))&&Mv(i,s),S=u.createElement("script"),yn(S),or(S,"link",i),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(y,S))}}function Gj(i,s,u,h){var y=(y=Ce.current)?Jf(y):null;if(!y)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=oc(u.href),u=no(y).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=oc(u.href);var S=no(y).hoistableStyles,_=S.get(i);if(_||(y=y.ownerDocument||y,_={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(i,_),(S=y.querySelector(zu(i)))&&!S._p&&(_.instance=S,_.state.loading=5),bi.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},bi.set(i,u),S||A3(y,i,u,_.state))),s&&h===null)throw Error(r(528,""));return _}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=ac(u),u=no(y).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function oc(i){return'href="'+fi(i)+'"'}function zu(i){return'link[rel="stylesheet"]['+i+"]"}function Qj(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function A3(i,s,u,h){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=i.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),or(s,"link",u),yn(s),i.head.appendChild(s))}function ac(i){return'[src="'+fi(i)+'"]'}function $u(i){return"script[async]"+i}function Wj(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=i.querySelector('style[data-href~="'+fi(u.href)+'"]');if(h)return s.instance=h,yn(h),h;var y=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),yn(h),or(h,"style",y),eh(h,u.precedence,i),s.instance=h;case"stylesheet":y=oc(u.href);var S=i.querySelector(zu(y));if(S)return s.state.loading|=4,s.instance=S,yn(S),S;h=Qj(u),(y=bi.get(y))&&Ov(h,y),S=(i.ownerDocument||i).createElement("link"),yn(S);var _=S;return _._p=new Promise(function(N,V){_.onload=N,_.onerror=V}),or(S,"link",h),s.state.loading|=4,eh(S,u.precedence,i),s.instance=S;case"script":return S=ac(u.src),(y=i.querySelector($u(S)))?(s.instance=y,yn(y),y):(h=u,(y=bi.get(S))&&(h=g({},u),Mv(h,y)),i=i.ownerDocument||i,y=i.createElement("script"),yn(y),or(y,"link",h),i.head.appendChild(y),s.instance=y);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,eh(h,u.precedence,i));return s.instance}function eh(i,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),y=h.length?h[h.length-1]:null,S=y,_=0;_<h.length;_++){var N=h[_];if(N.dataset.precedence===s)S=N;else if(S!==y)break}S?S.parentNode.insertBefore(i,S.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function Ov(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Mv(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var th=null;function Yj(i,s,u){if(th===null){var h=new Map,y=th=new Map;y.set(u,h)}else y=th,h=y.get(u),h||(h=new Map,y.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),y=0;y<u.length;y++){var S=u[y];if(!(S[Bt]||S[Me]||i==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var _=S.getAttribute(s)||"";_=i+_;var N=h.get(_);N?N.push(S):h.set(_,[S])}}return h}function Kj(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function P3(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function Xj(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function k3(i,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var y=oc(h.href),S=s.querySelector(zu(y));if(S){s=S._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=nh.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=S,yn(S);return}S=s.ownerDocument||s,h=Qj(h),(y=bi.get(y))&&Ov(h,y),S=S.createElement("link"),yn(S);var _=S;_._p=new Promise(function(N,V){_.onload=N,_.onerror=V}),or(S,"link",h),u.instance=S}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=nh.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Lv=0;function N3(i,s){return i.stylesheets&&i.count===0&&ih(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&ih(i,i.stylesheets),i.unsuspend){var S=i.unsuspend;i.unsuspend=null,S()}},6e4+s);0<i.imgBytes&&Lv===0&&(Lv=62500*h3());var y=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&ih(i,i.stylesheets),i.unsuspend)){var S=i.unsuspend;i.unsuspend=null,S()}},(i.imgBytes>Lv?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(y)}}:null}function nh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ih(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var rh=null;function ih(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,rh=new Map,s.forEach(O3,i),rh=null,nh.call(i))}function O3(i,s){if(!(s.state.loading&4)){var u=rh.get(i);if(u)var h=u.get(null);else{u=new Map,rh.set(i,u);for(var y=i.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<y.length;S++){var _=y[S];(_.nodeName==="LINK"||_.getAttribute("media")!=="not all")&&(u.set(_.dataset.precedence,_),h=_)}h&&u.set(null,h)}y=s.instance,_=y.getAttribute("data-precedence"),S=u.get(_)||h,S===h&&u.set(null,y),u.set(_,y),this.count++,h=nh.bind(this),y.addEventListener("load",h),y.addEventListener("error",h),S?S.parentNode.insertBefore(y,S.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(y,i.firstChild)),s.state.loading|=4}}var Uu={$$typeof:R,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function M3(i,s,u,h,y,S,_,N,V){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kn(0),this.hiddenUpdates=kn(null),this.identifierPrefix=h,this.onUncaughtError=y,this.onCaughtError=S,this.onRecoverableError=_,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function Zj(i,s,u,h,y,S,_,N,V,te,ue,pe){return i=new M3(i,s,u,_,V,te,ue,pe,N),s=1,S===!0&&(s|=24),S=Wr(3,null,null,s),i.current=S,S.stateNode=i,s=mg(),s.refCount++,i.pooledCache=s,s.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:s},xg(S),i}function Jj(i){return i?(i=Il,i):Il}function eC(i,s,u,h,y,S){y=Jj(y),h.context===null?h.context=y:h.pendingContext=y,h=ka(s),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=Na(i,h,s),u!==null&&(Ir(u,i,s),yu(u,i,s))}function tC(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Iv(i,s){tC(i,s),(i=i.alternate)&&tC(i,s)}function nC(i){if(i.tag===13||i.tag===31){var s=Es(i,67108864);s!==null&&Ir(s,i,67108864),Iv(i,67108864)}}function rC(i){if(i.tag===13||i.tag===31){var s=Jr();s=Ke(s);var u=Es(i,s);u!==null&&Ir(u,i,s),Iv(i,s)}}var oh=!0;function L3(i,s,u,h){var y=O.T;O.T=null;var S=I.p;try{I.p=2,zv(i,s,u,h)}finally{I.p=S,O.T=y}}function I3(i,s,u,h){var y=O.T;O.T=null;var S=I.p;try{I.p=8,zv(i,s,u,h)}finally{I.p=S,O.T=y}}function zv(i,s,u,h){if(oh){var y=$v(h);if(y===null)Cv(i,s,h,ah,u),oC(i,h);else if($3(y,i,s,u,h))h.stopPropagation();else if(oC(i,h),s&4&&-1<z3.indexOf(i)){for(;y!==null;){var S=br(y);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var _=En(S.pendingLanes);if(_!==0){var N=S;for(N.pendingLanes|=2,N.entangledLanes|=2;_;){var V=1<<31-er(_);N.entanglements[1]|=V,_&=~V}lo(S),(Vt&6)===0&&(Vf=me()+500,Ou(0))}}break;case 31:case 13:N=Es(S,2),N!==null&&Ir(N,S,2),Hf(),Iv(S,2)}if(S=$v(h),S===null&&Cv(i,s,h,ah,u),S===y)break;y=S}y!==null&&h.stopPropagation()}else Cv(i,s,h,null,u)}}function $v(i){return i=Bm(i),Uv(i)}var ah=null;function Uv(i){if(ah=null,i=ci(i),i!==null){var s=l(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=c(s),i!==null)return i;i=null}else if(u===31){if(i=d(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return ah=i,null}function iC(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ze()){case Nt:return 2;case Wt:return 8;case jn:case Qn:return 32;case Cn:return 268435456;default:return 32}default:return 32}}var Bv=!1,Ha=null,qa=null,Ga=null,Bu=new Map,Vu=new Map,Qa=[],z3="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 oC(i,s){switch(i){case"focusin":case"focusout":Ha=null;break;case"dragenter":case"dragleave":qa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":Bu.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vu.delete(s.pointerId)}}function Fu(i,s,u,h,y,S){return i===null||i.nativeEvent!==S?(i={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[y]},s!==null&&(s=br(s),s!==null&&nC(s)),i):(i.eventSystemFlags|=h,s=i.targetContainers,y!==null&&s.indexOf(y)===-1&&s.push(y),i)}function $3(i,s,u,h,y){switch(s){case"focusin":return Ha=Fu(Ha,i,s,u,h,y),!0;case"dragenter":return qa=Fu(qa,i,s,u,h,y),!0;case"mouseover":return Ga=Fu(Ga,i,s,u,h,y),!0;case"pointerover":var S=y.pointerId;return Bu.set(S,Fu(Bu.get(S)||null,i,s,u,h,y)),!0;case"gotpointercapture":return S=y.pointerId,Vu.set(S,Fu(Vu.get(S)||null,i,s,u,h,y)),!0}return!1}function aC(i){var s=ci(i.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=c(u),s!==null){i.blockedOn=s,rt(i.priority,function(){rC(u)});return}}else if(s===31){if(s=d(u),s!==null){i.blockedOn=s,rt(i.priority,function(){rC(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function sh(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=$v(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);Um=h,u.target.dispatchEvent(h),Um=null}else return s=br(u),s!==null&&nC(s),i.blockedOn=u,!1;s.shift()}return!0}function sC(i,s,u){sh(i)&&u.delete(s)}function U3(){Bv=!1,Ha!==null&&sh(Ha)&&(Ha=null),qa!==null&&sh(qa)&&(qa=null),Ga!==null&&sh(Ga)&&(Ga=null),Bu.forEach(sC),Vu.forEach(sC)}function lh(i,s){i.blockedOn===s&&(i.blockedOn=null,Bv||(Bv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,U3)))}var ch=null;function lC(i){ch!==i&&(ch=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ch===i&&(ch=null);for(var s=0;s<i.length;s+=3){var u=i[s],h=i[s+1],y=i[s+2];if(typeof h!="function"){if(Uv(h||u)===null)continue;break}var S=br(u);S!==null&&(i.splice(s,3),s-=3,$g(S,{pending:!0,data:y,method:u.method,action:h},h,y))}}))}function sc(i){function s(V){return lh(V,i)}Ha!==null&&lh(Ha,i),qa!==null&&lh(qa,i),Ga!==null&&lh(Ga,i),Bu.forEach(s),Vu.forEach(s);for(var u=0;u<Qa.length;u++){var h=Qa[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<Qa.length&&(u=Qa[0],u.blockedOn===null);)aC(u),u.blockedOn===null&&Qa.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var y=u[h],S=u[h+1],_=y[Le]||null;if(typeof S=="function")_||lC(u);else if(_){var N=null;if(S&&S.hasAttribute("formAction")){if(y=S,_=S[Le]||null)N=_.formAction;else if(Uv(y)!==null)continue}else N=_.action;typeof N=="function"?u[h+1]=N:(u.splice(h,3),h-=3),lC(u)}}}function cC(){function i(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(_){return y=_})},focusReset:"manual",scroll:"manual"})}function s(){y!==null&&(y(),y=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,y=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),y!==null&&(y(),y=null)}}}function Vv(i){this._internalRoot=i}uh.prototype.render=Vv.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,h=Jr();eC(u,h,i,s,null,null)},uh.prototype.unmount=Vv.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;eC(i.current,2,null,i,null,null),Hf(),s[qe]=null}};function uh(i){this._internalRoot=i}uh.prototype.unstable_scheduleHydration=function(i){if(i){var s=We();i={blockedOn:null,target:i,priority:s};for(var u=0;u<Qa.length&&s!==0&&s<Qa[u].priority;u++);Qa.splice(u,0,i),u===0&&aC(i)}};var uC=t.version;if(uC!=="19.2.0")throw Error(r(527,uC,"19.2.0"));I.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=p(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var B3={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dh.isDisabled&&dh.supportsFiber)try{si=dh.inject(B3),Wn=dh}catch{}}return Ku.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,h="",y=vw,S=yw,_=xw;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(y=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(_=s.onRecoverableError)),s=Zj(i,1,!1,null,null,u,h,null,y,S,_,cC),i[qe]=s.current,jv(i),new Vv(s)},Ku.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var h=!1,y="",S=vw,_=yw,N=xw,V=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&&(_=u.onCaughtError),u.onRecoverableError!==void 0&&(N=u.onRecoverableError),u.formState!==void 0&&(V=u.formState)),s=Zj(i,1,!0,s,u??null,h,y,V,S,_,N,cC),s.context=Jj(null),u=s.current,h=Jr(),h=Ke(h),y=ka(h),y.callback=null,Na(u,y,h),u=h,s.current.lanes=u,B(s,u),lo(s),i[qe]=s.current,jv(i),new uh(s)},Ku.version="19.2.0",Ku}var BT;function fZ(){if(BT)return _y.exports;BT=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(),_y.exports=dZ(),_y.exports}var hZ=fZ();/**
582
- * react-router v7.9.4
583
- *
584
- * Copyright (c) Remix Software Inc.
585
- *
586
- * This source code is licensed under the MIT license found in the
587
- * LICENSE.md file in the root directory of this source tree.
588
- *
589
- * @license MIT
590
- */var VP=e=>{throw TypeError(e)},pZ=(e,t,n)=>t.has(e)||VP("Cannot "+n),Py=(e,t,n)=>(pZ(e,t,"read from private field"),n?n.call(e):t.get(e)),mZ=(e,t,n)=>t.has(e)?VP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),VT="popstate";function gZ(e={}){function t(r,o){let{pathname:l,search:c,hash:d}=r.location;return yd("",{pathname:l,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:us(o)}return yZ(t,n,null,e)}function vt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function zn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function vZ(){return Math.random().toString(36).substring(2,10)}function FT(e,t){return{usr:e.state,key:e.key,idx:t}}function yd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ja(t):t,state:n,key:t&&t.key||r||vZ()}}function us({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 ja(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 yZ(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:l=!1}=r,c=o.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(),T=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:T})}function x(C,T){d="PUSH";let E=yd(j.location,C,T);p=m()+1;let R=FT(E,p),D=j.createHref(E);try{c.pushState(R,"",D)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(D)}l&&f&&f({action:d,location:j.location,delta:1})}function b(C,T){d="REPLACE";let E=yd(j.location,C,T);p=m();let R=FT(E,p),D=j.createHref(E);c.replaceState(R,"",D),l&&f&&f({action:d,location:j.location,delta:0})}function w(C){return FP(C)}let j={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(VT,g),f=C,()=>{o.removeEventListener(VT,g),f=null}},createHref(C){return t(o,C)},createURL:w,encodeLocation(C){let T=w(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:x,replace:b,go(C){return c.go(C)}};return j}function FP(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),vt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:us(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var nd,HT=class{constructor(e){if(mZ(this,nd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(Py(this,nd).has(e))return Py(this,nd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){Py(this,nd).set(e,t)}};nd=new WeakMap;var xZ=new Set(["lazy","caseSensitive","path","id","index","children"]);function bZ(e){return xZ.has(e)}var SZ=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function wZ(e){return SZ.has(e)}function jZ(e){return e.index===!0}function xd(e,t,n=[],r={},o=!1){return e.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(vt(l.index!==!0||!l.children,"Cannot specify children on an index route"),vt(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),jZ(l)){let p={...l,...t(l),id:f};return r[f]=p,p}else{let p={...l,...t(l),id:f,children:void 0};return r[f]=p,l.children&&(p.children=xd(l.children,t,d,r,o)),p}})}function ts(e,t,n="/"){return Uh(e,t,n,!1)}function Uh(e,t,n,r){let o=typeof t=="string"?ja(t):t,l=Ai(o.pathname||"/",n);if(l==null)return null;let c=HP(e);EZ(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=LZ(l);d=OZ(c[f],p,r)}return d}function CZ(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function HP(e,t=[],n=[],r="",o=!1){let l=(c,d,f=o,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;vt(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=wo([r,m.relativePath]),x=n.concat(m);c.children&&c.children.length>0&&(vt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),HP(c.children,t,x,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:kZ(g,c.index),routesMeta:x})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))l(c,d);else for(let f of qP(c.path))l(c,d,!0,f)}),t}function qP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return o?[l,""]:[l];let c=qP(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function EZ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:NZ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var TZ=/^:[\w-]+$/,RZ=3,_Z=2,DZ=1,AZ=10,PZ=-2,qT=e=>e==="*";function kZ(e,t){let n=e.split("/"),r=n.length;return n.some(qT)&&(r+=PZ),t&&(r+=_Z),n.filter(o=>!qT(o)).reduce((o,l)=>o+(TZ.test(l)?RZ:l===""?DZ:AZ),r)}function NZ(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function OZ(e,t,n=!1){let{routesMeta:r}=e,o={},l="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],p=d===r.length-1,m=l==="/"?t:t.slice(l.length)||"/",g=yp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),x=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=yp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:wo([l,g.pathname]),pathnameBase:UZ(wo([l,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(l=wo([l,g.pathnameBase]))}return c}function yp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=MZ(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],c=l.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},x)=>{if(m==="*"){let w=d[x]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[x];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:l,pathnameBase:c,pattern:e}}function MZ(e,t=!1,n=!0){zn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function LZ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return zn(!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 Ai(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 IZ({basename:e,pathname:t}){return t==="/"?e:wo([e,t])}function zZ(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ja(e):e;return{pathname:n?n.startsWith("/")?n:$Z(n,t):t,search:BZ(r),hash:VZ(o)}}function $Z(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function ky(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 GP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function sS(e){let t=GP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function lS(e,t,n,r=!1){let o;typeof e=="string"?o=ja(e):(o={...e},vt(!o.pathname||!o.pathname.includes("?"),ky("?","pathname","search",o)),vt(!o.pathname||!o.pathname.includes("#"),ky("#","pathname","hash",o)),vt(!o.search||!o.search.includes("#"),ky("#","search","hash",o)));let l=e===""||o.pathname==="",c=l?"/":o.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;o.pathname=x.join("/")}d=g>=0?t[g]:"/"}let f=zZ(o,d),p=c&&c!=="/"&&c.endsWith("/"),m=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var wo=e=>e.join("/").replace(/\/\/+/g,"/"),UZ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),BZ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,VZ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,xp=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 bd(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var QP=["POST","PUT","PATCH","DELETE"],FZ=new Set(QP),HZ=["GET",...QP],qZ=new Set(HZ),GZ=new Set([301,302,303,307,308]),QZ=new Set([307,308]),Ny={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},WZ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Xu={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},YZ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,cS=e=>YZ.test(e),KZ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),WP="remix-router-transitions",YP=Symbol("ResetLoaderData");function XZ(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u";vt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||KZ,l={},c=xd(e.routes,o,void 0,l),d,f=e.basename||"/";f.startsWith("/")||(f=`/${f}`);let p=e.dataStrategy||nJ,m={...e.future},g=null,x=new Set,b=null,w=null,j=null,C=e.hydrationData!=null,T=ts(c,e.history.location,f),E=!1,R=null,D;if(T==null&&!e.patchRoutesOnNavigation){let B=ji(404,{pathname:e.history.location.pathname}),{matches:X,route:oe}=Ch(c);D=!0,T=X,R={[oe.id]:B}}else if(T&&!e.hydrationData&&Li(T,c,e.history.location.pathname).active&&(T=null),T)if(T.some(B=>B.route.lazy))D=!1;else if(!T.some(B=>uS(B.route)))D=!0;else{let B=e.hydrationData?e.hydrationData.loaderData:null,X=e.hydrationData?e.hydrationData.errors:null;if(X){let oe=T.findIndex(we=>X[we.route.id]!==void 0);D=T.slice(0,oe+1).every(we=>!Cx(we.route,B,X))}else D=T.every(oe=>!Cx(oe.route,B,X))}else{D=!1,T=[];let B=Li(null,c,e.history.location.pathname);B.active&&B.matches&&(E=!0,T=B.matches)}let P,A={historyAction:e.history.action,location:e.history.location,matches:T,initialized:D,navigation:Ny,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||R,fetchers:new Map,blockers:new Map},k="POP",M=!1,$,U=!1,J=new Map,Z=null,Y=!1,H=!1,Q=new Set,O=new Map,I=0,z=-1,F=new Map,K=new Set,L=new Map,q=new Map,ie=new Set,xe=new Map,ve,Ce=null;function Oe(){if(g=e.history.listen(({action:B,location:X,delta:oe})=>{if(ve){ve(),ve=void 0;return}zn(xe.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 we=xs({currentLocation:A.location,nextLocation:X,historyAction:B});if(we&&oe!=null){let Pe=new Promise(Ke=>{ve=Ke});e.history.go(oe*-1),Ca(we,{state:"blocked",location:X,proceed(){Ca(we,{state:"proceeding",proceed:void 0,reset:void 0,location:X}),Pe.then(()=>e.history.go(oe))},reset(){let Ke=new Map(A.blockers);Ke.set(we,Xu),it({blockers:Ke})}});return}return ct(B,X)}),n){vJ(t,J);let B=()=>yJ(t,J);t.addEventListener("pagehide",B),Z=()=>t.removeEventListener("pagehide",B)}return A.initialized||ct("POP",A.location,{initialHydration:!0}),P}function Ee(){g&&g(),Z&&Z(),x.clear(),$&&$.abort(),A.fetchers.forEach((B,X)=>Cn(X)),A.blockers.forEach((B,X)=>Rl(X))}function Ge(B){return x.add(B),()=>x.delete(B)}function it(B,X={}){B.matches&&(B.matches=B.matches.map(Pe=>{let Ke=l[Pe.route.id],Je=Pe.route;return Je.element!==Ke.element||Je.errorElement!==Ke.errorElement||Je.hydrateFallbackElement!==Ke.hydrateFallbackElement?{...Pe,route:Ke}:Pe})),A={...A,...B};let oe=[],we=[];A.fetchers.forEach((Pe,Ke)=>{Pe.state==="idle"&&(ie.has(Ke)?oe.push(Ke):we.push(Ke))}),ie.forEach(Pe=>{!A.fetchers.has(Pe)&&!O.has(Pe)&&oe.push(Pe)}),[...x].forEach(Pe=>Pe(A,{deletedFetchers:oe,viewTransitionOpts:X.viewTransitionOpts,flushSync:X.flushSync===!0})),oe.forEach(Pe=>Cn(Pe)),we.forEach(Pe=>A.fetchers.delete(Pe))}function St(B,X,{flushSync:oe}={}){let we=A.actionData!=null&&A.navigation.formMethod!=null&&$r(A.navigation.formMethod)&&A.navigation.state==="loading"&&B.state?._isRedirect!==!0,Pe;X.actionData?Object.keys(X.actionData).length>0?Pe=X.actionData:Pe=null:we?Pe=A.actionData:Pe=null;let Ke=X.loaderData?tR(A.loaderData,X.loaderData,X.matches||[],X.errors):A.loaderData,Je=A.blockers;Je.size>0&&(Je=new Map(Je),Je.forEach((Me,Le)=>Je.set(Le,Xu)));let We=Y?!1:No(B,X.matches||A.matches),rt=M===!0||A.navigation.formMethod!=null&&$r(A.navigation.formMethod)&&B.state?._isRedirect!==!0;d&&(c=d,d=void 0),Y||k==="POP"||(k==="PUSH"?e.history.push(B,B.state):k==="REPLACE"&&e.history.replace(B,B.state));let nt;if(k==="POP"){let Me=J.get(A.location.pathname);Me&&Me.has(B.pathname)?nt={currentLocation:A.location,nextLocation:B}:J.has(B.pathname)&&(nt={currentLocation:B,nextLocation:A.location})}else if(U){let Me=J.get(A.location.pathname);Me?Me.add(B.pathname):(Me=new Set([B.pathname]),J.set(A.location.pathname,Me)),nt={currentLocation:A.location,nextLocation:B}}it({...X,actionData:Pe,loaderData:Ke,historyAction:k,location:B,initialized:!0,navigation:Ny,revalidation:"idle",restoreScrollPosition:We,preventScrollReset:rt,blockers:Je},{viewTransitionOpts:nt,flushSync:oe===!0}),k="POP",M=!1,U=!1,Y=!1,H=!1,Ce?.resolve(),Ce=null}async function kt(B,X){if(typeof B=="number"){e.history.go(B);return}let oe=jx(A.location,A.matches,f,B,X?.fromRouteId,X?.relative),{path:we,submission:Pe,error:Ke}=GT(!1,oe,X),Je=A.location,We=yd(A.location,we,X&&X.state);We={...We,...e.history.encodeLocation(We)};let rt=X&&X.replace!=null?X.replace:void 0,nt="PUSH";rt===!0?nt="REPLACE":rt===!1||Pe!=null&&$r(Pe.formMethod)&&Pe.formAction===A.location.pathname+A.location.search&&(nt="REPLACE");let Me=X&&"preventScrollReset"in X?X.preventScrollReset===!0:void 0,Le=(X&&X.flushSync)===!0,qe=xs({currentLocation:Je,nextLocation:We,historyAction:nt});if(qe){Ca(qe,{state:"blocked",location:We,proceed(){Ca(qe,{state:"proceeding",proceed:void 0,reset:void 0,location:We}),kt(B,X)},reset(){let Lt=new Map(A.blockers);Lt.set(qe,Xu),it({blockers:Lt})}});return}await ct(nt,We,{submission:Pe,pendingError:Ke,preventScrollReset:Me,replace:X&&X.replace,enableViewTransition:X&&X.viewTransition,flushSync:Le})}function Mt(){Ce||(Ce=xJ()),ze(),it({revalidation:"loading"});let B=Ce.promise;return A.navigation.state==="submitting"?B:A.navigation.state==="idle"?(ct(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),B):(ct(k||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:U===!0}),B)}async function ct(B,X,oe){$&&$.abort(),$=null,k=B,Y=(oe&&oe.startUninterruptedRevalidation)===!0,En(A.location,A.matches),M=(oe&&oe.preventScrollReset)===!0,U=(oe&&oe.enableViewTransition)===!0;let we=d||c,Pe=oe&&oe.overrideNavigation,Ke=oe?.initialHydration&&A.matches&&A.matches.length>0&&!E?A.matches:ts(we,X,f),Je=(oe&&oe.flushSync)===!0;if(Ke&&A.initialized&&!H&&uJ(A.location,X)&&!(oe&&oe.submission&&$r(oe.submission.formMethod))){St(X,{matches:Ke},{flushSync:Je});return}let We=Li(Ke,we,X.pathname);if(We.active&&We.matches&&(Ke=We.matches),!Ke){let{error:tr,notFoundMatches:sn,route:Bt}=li(X.pathname);St(X,{matches:sn,loaderData:{},errors:{[Bt.id]:tr}},{flushSync:Je});return}$=new AbortController;let rt=Sc(e.history,X,$.signal,oe&&oe.submission),nt=e.getContext?await e.getContext():new HT,Me;if(oe&&oe.pendingError)Me=[ns(Ke).route.id,{type:"error",error:oe.pendingError}];else if(oe&&oe.submission&&$r(oe.submission.formMethod)){let tr=await bt(rt,X,oe.submission,Ke,nt,We.active,oe&&oe.initialHydration===!0,{replace:oe.replace,flushSync:Je});if(tr.shortCircuited)return;if(tr.pendingActionResult){let[sn,Bt]=tr.pendingActionResult;if(ti(Bt)&&bd(Bt.error)&&Bt.error.status===404){$=null,St(X,{matches:tr.matches,loaderData:{},errors:{[sn]:Bt.error}});return}}Ke=tr.matches||Ke,Me=tr.pendingActionResult,Pe=Oy(X,oe.submission),Je=!1,We.active=!1,rt=Sc(e.history,rt.url,rt.signal)}let{shortCircuited:Le,matches:qe,loaderData:Lt,errors:_n}=await Qt(rt,X,Ke,nt,We.active,Pe,oe&&oe.submission,oe&&oe.fetcherSubmission,oe&&oe.replace,oe&&oe.initialHydration===!0,Je,Me);Le||($=null,St(X,{matches:qe||Ke,...nR(Me),loaderData:Lt,errors:_n}))}async function bt(B,X,oe,we,Pe,Ke,Je,We={}){ze();let rt=mJ(X,oe);if(it({navigation:rt},{flushSync:We.flushSync===!0}),Ke){let Le=await Ea(we,X.pathname,B.signal);if(Le.type==="aborted")return{shortCircuited:!0};if(Le.type==="error"){if(Le.partialMatches.length===0){let{matches:Lt,route:_n}=Ch(c);return{matches:Lt,pendingActionResult:[_n.id,{type:"error",error:Le.error}]}}let qe=ns(Le.partialMatches).route.id;return{matches:Le.partialMatches,pendingActionResult:[qe,{type:"error",error:Le.error}]}}else if(Le.matches)we=Le.matches;else{let{notFoundMatches:qe,error:Lt,route:_n}=li(X.pathname);return{matches:qe,pendingActionResult:[_n.id,{type:"error",error:Lt}]}}}let nt,Me=Bh(we,X);if(!Me.route.action&&!Me.route.lazy)nt={type:"error",error:ji(405,{method:B.method,pathname:X.pathname,routeId:Me.route.id})};else{let Le=Rc(o,l,B,we,Me,Je?[]:r,Pe),qe=await He(B,Le,Pe,null);if(nt=qe[Me.route.id],!nt){for(let Lt of we)if(qe[Lt.route.id]){nt=qe[Lt.route.id];break}}if(B.signal.aborted)return{shortCircuited:!0}}if(Zs(nt)){let Le;return We&&We.replace!=null?Le=We.replace:Le=ZT(nt.response.headers.get("Location"),new URL(B.url),f)===A.location.pathname+A.location.search,await Se(B,nt,!0,{submission:oe,replace:Le}),{shortCircuited:!0}}if(ti(nt)){let Le=ns(we,Me.route.id);return(We&&We.replace)!==!0&&(k="PUSH"),{matches:we,pendingActionResult:[Le.route.id,nt,Me.route.id]}}return{matches:we,pendingActionResult:[Me.route.id,nt]}}async function Qt(B,X,oe,we,Pe,Ke,Je,We,rt,nt,Me,Le){let qe=Ke||Oy(X,Je),Lt=Je||We||iR(qe),_n=!Y&&!nt;if(Pe){if(_n){let Yn=Ae(Le);it({navigation:qe,...Yn!==void 0?{actionData:Yn}:{}},{flushSync:Me})}let yt=await Ea(oe,X.pathname,B.signal);if(yt.type==="aborted")return{shortCircuited:!0};if(yt.type==="error"){if(yt.partialMatches.length===0){let{matches:Oo,route:io}=Ch(c);return{matches:Oo,loaderData:{},errors:{[io.id]:yt.error}}}let Yn=ns(yt.partialMatches).route.id;return{matches:yt.partialMatches,loaderData:{},errors:{[Yn]:yt.error}}}else if(yt.matches)oe=yt.matches;else{let{error:Yn,notFoundMatches:Oo,route:io}=li(X.pathname);return{matches:Oo,loaderData:{},errors:{[io.id]:Yn}}}}let tr=d||c,{dsMatches:sn,revalidatingFetchers:Bt}=QT(B,we,o,l,e.history,A,oe,Lt,X,nt?[]:r,nt===!0,H,Q,ie,L,K,tr,f,e.patchRoutesOnNavigation!=null,Le);if(z=++I,!e.dataStrategy&&!sn.some(yt=>yt.shouldLoad)&&!sn.some(yt=>yt.route.middleware&&yt.route.middleware.length>0)&&Bt.length===0){let yt=Wn();return St(X,{matches:oe,loaderData:{},errors:Le&&ti(Le[1])?{[Le[0]]:Le[1].error}:null,...nR(Le),...yt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:Me}),{shortCircuited:!0}}if(_n){let yt={};if(!Pe){yt.navigation=qe;let Yn=Ae(Le);Yn!==void 0&&(yt.actionData=Yn)}Bt.length>0&&(yt.fetchers=De(Bt)),it(yt,{flushSync:Me})}Bt.forEach(yt=>{Jn(yt.key),yt.controller&&O.set(yt.key,yt.controller)});let Ii=()=>Bt.forEach(yt=>Jn(yt.key));$&&$.signal.addEventListener("abort",Ii);let{loaderResults:ci,fetcherResults:br}=await me(sn,Bt,B,we);if(B.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Ii),Bt.forEach(yt=>O.delete(yt.key));let lr=Eh(ci);if(lr)return await Se(B,lr.result,!0,{replace:rt}),{shortCircuited:!0};if(lr=Eh(br),lr)return K.add(lr.key),await Se(B,lr.result,!0,{replace:rt}),{shortCircuited:!0};let{loaderData:no,errors:yn}=eR(A,oe,ci,Le,Bt,br);nt&&A.errors&&(yn={...A.errors,...yn});let ro=Wn(),bs=xr(z),ui=ro||bs||Bt.length>0;return{matches:oe,loaderData:no,errors:yn,...ui?{fetchers:new Map(A.fetchers)}:{}}}function Ae(B){if(B&&!ti(B[1]))return{[B[0]]:B[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function De(B){return B.forEach(X=>{let oe=A.fetchers.get(X.key),we=Zu(void 0,oe?oe.data:void 0);A.fetchers.set(X.key,we)}),new Map(A.fetchers)}async function Ze(B,X,oe,we){Jn(B);let Pe=(we&&we.flushSync)===!0,Ke=d||c,Je=jx(A.location,A.matches,f,oe,X,we?.relative),We=ts(Ke,Je,f),rt=Li(We,Ke,Je);if(rt.active&&rt.matches&&(We=rt.matches),!We){Wt(B,X,ji(404,{pathname:Je}),{flushSync:Pe});return}let{path:nt,submission:Me,error:Le}=GT(!0,Je,we);if(Le){Wt(B,X,Le,{flushSync:Pe});return}let qe=e.getContext?await e.getContext():new HT,Lt=(we&&we.preventScrollReset)===!0;if(Me&&$r(Me.formMethod)){await _e(B,X,nt,We,qe,rt.active,Pe,Lt,Me);return}L.set(B,{routeId:X,path:nt}),await ge(B,X,nt,We,qe,rt.active,Pe,Lt,Me)}async function _e(B,X,oe,we,Pe,Ke,Je,We,rt){ze(),L.delete(B);let nt=A.fetchers.get(B);Nt(B,gJ(rt,nt),{flushSync:Je});let Me=new AbortController,Le=Sc(e.history,oe,Me.signal,rt);if(Ke){let Nn=await Ea(we,new URL(Le.url).pathname,Le.signal,B);if(Nn.type==="aborted")return;if(Nn.type==="error"){Wt(B,X,Nn.error,{flushSync:Je});return}else if(Nn.matches)we=Nn.matches;else{Wt(B,X,ji(404,{pathname:oe}),{flushSync:Je});return}}let qe=Bh(we,oe);if(!qe.route.action&&!qe.route.lazy){let Nn=ji(405,{method:rt.formMethod,pathname:oe,routeId:X});Wt(B,X,Nn,{flushSync:Je});return}O.set(B,Me);let Lt=I,_n=Rc(o,l,Le,we,qe,r,Pe),sn=(await He(Le,_n,Pe,B))[qe.route.id];if(Le.signal.aborted){O.get(B)===Me&&O.delete(B);return}if(ie.has(B)){if(Zs(sn)||ti(sn)){Nt(B,na(void 0));return}}else{if(Zs(sn))if(O.delete(B),z>Lt){Nt(B,na(void 0));return}else return K.add(B),Nt(B,Zu(rt)),Se(Le,sn,!1,{fetcherSubmission:rt,preventScrollReset:We});if(ti(sn)){Wt(B,X,sn.error);return}}let Bt=A.navigation.location||A.location,Ii=Sc(e.history,Bt,Me.signal),ci=d||c,br=A.navigation.state!=="idle"?ts(ci,A.navigation.location,f):A.matches;vt(br,"Didn't find any matches after fetcher action");let lr=++I;F.set(B,lr);let no=Zu(rt,sn.data);A.fetchers.set(B,no);let{dsMatches:yn,revalidatingFetchers:ro}=QT(Ii,Pe,o,l,e.history,A,br,rt,Bt,r,!1,H,Q,ie,L,K,ci,f,e.patchRoutesOnNavigation!=null,[qe.route.id,sn]);ro.filter(Nn=>Nn.key!==B).forEach(Nn=>{let Mo=Nn.key,Ss=A.fetchers.get(Mo),zi=Zu(void 0,Ss?Ss.data:void 0);A.fetchers.set(Mo,zi),Jn(Mo),Nn.controller&&O.set(Mo,Nn.controller)}),it({fetchers:new Map(A.fetchers)});let bs=()=>ro.forEach(Nn=>Jn(Nn.key));Me.signal.addEventListener("abort",bs);let{loaderResults:ui,fetcherResults:yt}=await me(yn,ro,Ii,Pe);if(Me.signal.aborted)return;if(Me.signal.removeEventListener("abort",bs),F.delete(B),O.delete(B),ro.forEach(Nn=>O.delete(Nn.key)),A.fetchers.has(B)){let Nn=na(sn.data);A.fetchers.set(B,Nn)}let Yn=Eh(ui);if(Yn)return Se(Ii,Yn.result,!1,{preventScrollReset:We});if(Yn=Eh(yt),Yn)return K.add(Yn.key),Se(Ii,Yn.result,!1,{preventScrollReset:We});let{loaderData:Oo,errors:io}=eR(A,br,ui,void 0,ro,yt);xr(lr),A.navigation.state==="loading"&&lr>z?(vt(k,"Expected pending action"),$&&$.abort(),St(A.navigation.location,{matches:br,loaderData:Oo,errors:io,fetchers:new Map(A.fetchers)})):(it({errors:io,loaderData:tR(A.loaderData,Oo,br,io),fetchers:new Map(A.fetchers)}),H=!1)}async function ge(B,X,oe,we,Pe,Ke,Je,We,rt){let nt=A.fetchers.get(B);Nt(B,Zu(rt,nt?nt.data:void 0),{flushSync:Je});let Me=new AbortController,Le=Sc(e.history,oe,Me.signal);if(Ke){let Bt=await Ea(we,new URL(Le.url).pathname,Le.signal,B);if(Bt.type==="aborted")return;if(Bt.type==="error"){Wt(B,X,Bt.error,{flushSync:Je});return}else if(Bt.matches)we=Bt.matches;else{Wt(B,X,ji(404,{pathname:oe}),{flushSync:Je});return}}let qe=Bh(we,oe);O.set(B,Me);let Lt=I,_n=Rc(o,l,Le,we,qe,r,Pe),sn=(await He(Le,_n,Pe,B))[qe.route.id];if(O.get(B)===Me&&O.delete(B),!Le.signal.aborted){if(ie.has(B)){Nt(B,na(void 0));return}if(Zs(sn))if(z>Lt){Nt(B,na(void 0));return}else{K.add(B),await Se(Le,sn,!1,{preventScrollReset:We});return}if(ti(sn)){Wt(B,X,sn.error);return}Nt(B,na(sn.data))}}async function Se(B,X,oe,{submission:we,fetcherSubmission:Pe,preventScrollReset:Ke,replace:Je}={}){X.response.headers.has("X-Remix-Revalidate")&&(H=!0);let We=X.response.headers.get("Location");vt(We,"Expected a Location header on the redirect Response"),We=ZT(We,new URL(B.url),f);let rt=yd(A.location,We,{_isRedirect:!0});if(n){let _n=!1;if(X.response.headers.has("X-Remix-Reload-Document"))_n=!0;else if(cS(We)){const tr=FP(We,!0);_n=tr.origin!==t.location.origin||Ai(tr.pathname,f)==null}if(_n){Je?t.location.replace(We):t.location.assign(We);return}}$=null;let nt=Je===!0||X.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:Me,formAction:Le,formEncType:qe}=A.navigation;!we&&!Pe&&Me&&Le&&qe&&(we=iR(A.navigation));let Lt=we||Pe;if(QZ.has(X.response.status)&&Lt&&$r(Lt.formMethod))await ct(nt,rt,{submission:{...Lt,formAction:We},preventScrollReset:Ke||M,enableViewTransition:oe?U:void 0});else{let _n=Oy(rt,we);await ct(nt,rt,{overrideNavigation:_n,fetcherSubmission:Pe,preventScrollReset:Ke||M,enableViewTransition:oe?U:void 0})}}async function He(B,X,oe,we){let Pe,Ke={};try{Pe=await iJ(p,B,X,we,oe,!1)}catch(Je){return X.filter(We=>We.shouldLoad).forEach(We=>{Ke[We.route.id]={type:"error",error:Je}}),Ke}if(B.signal.aborted)return Ke;for(let[Je,We]of Object.entries(Pe))if(hJ(We)){let rt=We.result;Ke[Je]={type:"redirect",response:lJ(rt,B,Je,X,f)}}else Ke[Je]=await sJ(We);return Ke}async function me(B,X,oe,we){let Pe=He(oe,B,we,null),Ke=Promise.all(X.map(async rt=>{if(rt.matches&&rt.match&&rt.request&&rt.controller){let Me=(await He(rt.request,rt.matches,we,rt.key))[rt.match.route.id];return{[rt.key]:Me}}else return Promise.resolve({[rt.key]:{type:"error",error:ji(404,{pathname:rt.path})}})})),Je=await Pe,We=(await Ke).reduce((rt,nt)=>Object.assign(rt,nt),{});return{loaderResults:Je,fetcherResults:We}}function ze(){H=!0,L.forEach((B,X)=>{O.has(X)&&Q.add(X),Jn(X)})}function Nt(B,X,oe={}){A.fetchers.set(B,X),it({fetchers:new Map(A.fetchers)},{flushSync:(oe&&oe.flushSync)===!0})}function Wt(B,X,oe,we={}){let Pe=ns(A.matches,X);Cn(B),it({errors:{[Pe.route.id]:oe},fetchers:new Map(A.fetchers)},{flushSync:(we&&we.flushSync)===!0})}function jn(B){return q.set(B,(q.get(B)||0)+1),ie.has(B)&&ie.delete(B),A.fetchers.get(B)||WZ}function Qn(B,X){Jn(B,X?.reason),Nt(B,na(null))}function Cn(B){let X=A.fetchers.get(B);O.has(B)&&!(X&&X.state==="loading"&&F.has(B))&&Jn(B),L.delete(B),F.delete(B),K.delete(B),ie.delete(B),Q.delete(B),A.fetchers.delete(B)}function Ar(B){let X=(q.get(B)||0)-1;X<=0?(q.delete(B),ie.add(B)):q.set(B,X),it({fetchers:new Map(A.fetchers)})}function Jn(B,X){let oe=O.get(B);oe&&(oe.abort(X),O.delete(B))}function si(B){for(let X of B){let oe=jn(X),we=na(oe.data);A.fetchers.set(X,we)}}function Wn(){let B=[],X=!1;for(let oe of K){let we=A.fetchers.get(oe);vt(we,`Expected fetcher: ${oe}`),we.state==="loading"&&(K.delete(oe),B.push(oe),X=!0)}return si(B),X}function xr(B){let X=[];for(let[oe,we]of F)if(we<B){let Pe=A.fetchers.get(oe);vt(Pe,`Expected fetcher: ${oe}`),Pe.state==="loading"&&(Jn(oe),F.delete(oe),X.push(oe))}return si(X),X.length>0}function er(B,X){let oe=A.blockers.get(B)||Xu;return xe.get(B)!==X&&xe.set(B,X),oe}function Rl(B){A.blockers.delete(B),xe.delete(B)}function Ca(B,X){let oe=A.blockers.get(B)||Xu;vt(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 we=new Map(A.blockers);we.set(B,X),it({blockers:we})}function xs({currentLocation:B,nextLocation:X,historyAction:oe}){if(xe.size===0)return;xe.size>1&&zn(!1,"A router only supports one blocker at a time");let we=Array.from(xe.entries()),[Pe,Ke]=we[we.length-1],Je=A.blockers.get(Pe);if(!(Je&&Je.state==="proceeding")&&Ke({currentLocation:B,nextLocation:X,historyAction:oe}))return Pe}function li(B){let X=ji(404,{pathname:B}),oe=d||c,{matches:we,route:Pe}=Ch(oe);return{notFoundMatches:we,route:Pe,error:X}}function to(B,X,oe){if(b=B,j=X,w=oe||null,!C&&A.navigation===Ny){C=!0;let we=No(A.location,A.matches);we!=null&&it({restoreScrollPosition:we})}return()=>{b=null,j=null,w=null}}function Pr(B,X){return w&&w(B,X.map(we=>CZ(we,A.loaderData)))||B.key}function En(B,X){if(b&&j){let oe=Pr(B,X);b[oe]=j()}}function No(B,X){if(b){let oe=Pr(B,X),we=b[oe];if(typeof we=="number")return we}return null}function Li(B,X,oe){if(e.patchRoutesOnNavigation)if(B){if(Object.keys(B[0].params).length>0)return{active:!0,matches:Uh(X,oe,f,!0)}}else return{active:!0,matches:Uh(X,oe,f,!0)||[]};return{active:!1,matches:null}}async function Ea(B,X,oe,we){if(!e.patchRoutesOnNavigation)return{type:"success",matches:B};let Pe=B;for(;;){let Ke=d==null,Je=d||c,We=l;try{await e.patchRoutesOnNavigation({signal:oe,path:X,matches:Pe,fetcherKey:we,patch:(Me,Le)=>{oe.aborted||WT(Me,Le,Je,We,o,!1)}})}catch(Me){return{type:"error",error:Me,partialMatches:Pe}}finally{Ke&&!oe.aborted&&(c=[...c])}if(oe.aborted)return{type:"aborted"};let rt=ts(Je,X,f);if(rt)return{type:"success",matches:rt};let nt=Uh(Je,X,f,!0);if(!nt||Pe.length===nt.length&&Pe.every((Me,Le)=>Me.route.id===nt[Le].route.id))return{type:"success",matches:null};Pe=nt}}function _l(B){l={},d=xd(B,o,void 0,l)}function kn(B,X,oe=!1){let we=d==null;WT(B,X,d||c,l,o,oe),we&&(c=[...c],it({}))}return P={get basename(){return f},get future(){return m},get state(){return A},get routes(){return c},get window(){return t},initialize:Oe,subscribe:Ge,enableScrollRestoration:to,navigate:kt,fetch:Ze,revalidate:Mt,createHref:B=>e.history.createHref(B),encodeLocation:B=>e.history.encodeLocation(B),getFetcher:jn,resetFetcher:Qn,deleteFetcher:Ar,dispose:Ee,getBlocker:er,deleteBlocker:Rl,patchRoutes:kn,_internalFetchControllers:O,_internalSetRoutes:_l,_internalSetStateDoNotUseOrYouWillBreakYourApp(B){it(B)}},P}function ZZ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function jx(e,t,n,r,o,l){let c,d;if(o){c=[];for(let p of t)if(c.push(p),p.route.id===o){d=p;break}}else c=t,d=t[t.length-1];let f=lS(r||".",sS(c),Ai(e.pathname,n)||e.pathname,l==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let p=dS(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=IZ({basename:n,pathname:f.pathname})),us(f)}function GT(e,t,n){if(!n||!ZZ(n))return{path:t};if(n.formMethod&&!pJ(n.formMethod))return{path:t,error:ji(405,{method:n.formMethod})};let r=()=>({path:t,error:ji(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=tk(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!$r(l))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}
591
- `,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!$r(l))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}vt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=Tx(n.formData),f=n.formData;else if(n.body instanceof FormData)d=Tx(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=JT(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=JT(d)}catch{return r()}let p={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if($r(p.formMethod))return{path:t,submission:p};let m=ja(t);return e&&m.search&&dS(m.search)&&d.append("index",""),m.search=`?${d}`,{path:us(m),submission:p}}function QT(e,t,n,r,o,l,c,d,f,p,m,g,x,b,w,j,C,T,E,R){let D=R?ti(R[1])?R[1].error:R[1].data:void 0,P=o.createURL(l.location),A=o.createURL(f),k;if(m&&l.errors){let Y=Object.keys(l.errors)[0];k=c.findIndex(H=>H.route.id===Y)}else if(R&&ti(R[1])){let Y=R[0];k=c.findIndex(H=>H.route.id===Y)-1}let M=R?R[1].statusCode:void 0,$=M&&M>=400,U={currentUrl:P,currentParams:l.matches[0]?.params||{},nextUrl:A,nextParams:c[0].params,...d,actionResult:D,actionStatus:M},J=c.map((Y,H)=>{let{route:Q}=Y,O=null;if(k!=null&&H>k?O=!1:Q.lazy?O=!0:uS(Q)?m?O=Cx(Q,l.loaderData,l.errors):JZ(l.loaderData,l.matches[H],Y)&&(O=!0):O=!1,O!==null)return Ex(n,r,e,Y,p,t,O);let I=$?!1:g||P.pathname+P.search===A.pathname+A.search||P.search!==A.search||eJ(l.matches[H],Y),z={...U,defaultShouldRevalidate:I},F=bp(Y,z);return Ex(n,r,e,Y,p,t,F,z)}),Z=[];return w.forEach((Y,H)=>{if(m||!c.some(q=>q.route.id===Y.routeId)||b.has(H))return;let Q=l.fetchers.get(H),O=Q&&Q.state!=="idle"&&Q.data===void 0,I=ts(C,Y.path,T);if(!I){if(E&&O)return;Z.push({key:H,routeId:Y.routeId,path:Y.path,matches:null,match:null,request:null,controller:null});return}if(j.has(H))return;let z=Bh(I,Y.path),F=new AbortController,K=Sc(o,Y.path,F.signal),L=null;if(x.has(H))x.delete(H),L=Rc(n,r,K,I,z,p,t);else if(O)g&&(L=Rc(n,r,K,I,z,p,t));else{let q={...U,defaultShouldRevalidate:$?!1:g};bp(z,q)&&(L=Rc(n,r,K,I,z,p,t,q))}L&&Z.push({key:H,routeId:Y.routeId,path:Y.path,matches:L,match:z,request:K,controller:F})}),{dsMatches:J,revalidatingFetchers:Z}}function uS(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Cx(e,t,n){if(e.lazy)return!0;if(!uS(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function JZ(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function eJ(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function bp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function WT(e,t,n,r,o,l){let c;if(e){let p=r[e];vt(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=>KP(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=xd(d,o,[e||"_","patch",String(c?.length||"0")],r);c.push(...p)}if(l&&f.length>0)for(let p=0;p<f.length;p++){let{existingRoute:m,newRoute:g}=f[p],x=m,[b]=xd([g],o,[],{},!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 KP(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(o=>KP(n,o))):!1}var YT=new WeakMap,XP=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(vt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let c=YT.get(o);c||(c={},YT.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let p=bZ(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)zn(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)zn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let x=await l();x!=null&&(Object.assign(o,{[e]:x}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(x=>x===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},KT=new WeakMap;function tJ(e,t,n,r,o){let l=n[e.id];if(vt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=KT.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{vt(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=wZ(w),E=l[w]!==void 0&&w!=="hasErrorBoundary";C?zn(!C,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?zn(!E,`Route "${l.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(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return KT.set(l,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(o&&o.includes(m))continue;let g=XP({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 XT(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{n[t[l].route.id]=o}),n}async function nJ(e){return e.matches.some(t=>t.route.middleware)?ZP(e,()=>XT(e)):XT(e)}function ZP(e,t){return rJ(e,t,r=>r,dJ,n);function n(r,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===o),0),Math.max(c.findIndex(p=>p.unstable_shouldCallHandler()),0)),f=ns(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function rJ(e,t,n,r,o){let{matches:l,request:c,params:d,context:f}=e,p=l.flatMap(g=>g.route.middleware?g.route.middleware.map(x=>[g.route.id,x]):[]);return await JP({request:c,params:d,context:f},p,t,n,r,o)}async function JP(e,t,n,r,o,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[p,m]=f,g,x=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await JP(e,t,n,r,o,l,c+1)},g.value}catch(b){return g={value:await l(b,p,g)},g.value}};try{let b=await m(e,x),w=b!=null?r(b):void 0;return o(w)?w:g?w??g.value:(g={value:await x()},g.value)}catch(b){return await l(b,p,g)}}function ek(e,t,n,r,o){let l=XP({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=tJ(r.route,$r(n.method)?"action":"loader",t,e,o);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Ex(e,t,n,r,o,l,c,d=null){let f=!1,p=ek(e,t,n,r,o);return{...r,_lazyPromises:p,shouldLoad:c,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler(m){return f=!0,d?typeof m=="boolean"?bp(r,{...d,defaultShouldRevalidate:m}):bp(r,d):c},resolve(m){let{lazy:g,loader:x,middleware:b}=r.route,w=f||c||m&&!$r(n.method)&&(g||x),j=b&&b.length>0&&!x&&!g;return w&&!j?oJ({request:n,match:r,lazyHandlerPromise:p?.handler,lazyRoutePromise:p?.route,handlerOverride:m,scopedContext:l}):Promise.resolve({type:"data",result:void 0})}}}function Rc(e,t,n,r,o,l,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:ek(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ex(e,t,n,f,l,c,!0,d))}async function iJ(e,t,n,r,o,l){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let c={request:t,params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:p=>{let m=c;return ZP(m,()=>p({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function oJ({request:e,match:t,lazyHandlerPromise:n,lazyRoutePromise:r,handlerOverride:o,scopedContext:l}){let c,d,f=$r(e.method),p=f?"action":"loader",m=g=>{let x,b=new Promise((C,T)=>x=T);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:l},...C!==void 0?[C]:[]),j=(async()=>{try{return{type:"data",result:await(o?o(T=>w(T)):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 ji(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 ji(404,{pathname:b})}}catch(g){return{type:"error",result:g}}finally{d&&e.signal.removeEventListener("abort",d)}return c}async function aJ(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 sJ(e){let{result:t,type:n}=e;if(nk(t)){let r;try{r=await aJ(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new xp(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?rR(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 xp(t.init?.status||500,void 0,t.data),statusCode:bd(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:bd(t)?t.status:void 0}:rR(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 lJ(e,t,n,r,o){let l=e.headers.get("Location");if(vt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!cS(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=jx(new URL(t.url),c,o,l),e.headers.set("Location",l)}return e}function ZT(e,t,n){if(cS(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=Ai(o.pathname,n)!=null;if(o.origin===t.origin&&l)return o.pathname+o.search+o.hash}return e}function Sc(e,t,n,r){let o=e.createURL(tk(t)).toString(),l={signal:n};if(r&&$r(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=Tx(r.formData):l.body=r.formData}return new Request(o,l)}function Tx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function JT(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function cJ(e,t,n,r=!1,o=!1){let l={},c=null,d,f=!1,p={},m=n&&ti(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(vt(!Zs(b),"Cannot handle redirect results in processLoaderData"),ti(b)){let w=b.error;if(m!==void 0&&(w=m,m=void 0),c=c||{},o)c[x]=w;else{let j=ns(e,x);c[j.route.id]==null&&(c[j.route.id]=w)}r||(l[x]=YP),f||(f=!0,d=bd(b.error)?b.error.status:500),b.headers&&(p[x]=b.headers)}else l[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]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:p}}function eR(e,t,n,r,o,l){let{loaderData:c,errors:d}=cJ(t,n,r);return o.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=l[p];if(vt(x,"Did not find corresponding fetcher result"),ti(x)){let b=ns(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:x.error}),e.fetchers.delete(p)}else if(Zs(x))vt(!1,"Unhandled fetcher revalidation redirect");else{let b=na(x.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function tR(e,t,n,r){let o=Object.entries(t).filter(([,l])=>l!==YP).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function nR(e){return e?ti(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ns(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 Ch(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 ji(e,{pathname:t,routeId:n,method:r,type:o,message:l}={}){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.`:o==="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 xp(e||500,c,new Error(d),!0)}function Eh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(Zs(o))return{key:r,result:o}}}function tk(e){let t=typeof e=="string"?ja(e):e;return us({...t,hash:""})}function uJ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function dJ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&fJ(n))}function fJ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function hJ(e){return nk(e.result)&&GZ.has(e.result.status)}function ti(e){return e.type==="error"}function Zs(e){return(e&&e.type)==="redirect"}function rR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function nk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function pJ(e){return qZ.has(e.toUpperCase())}function $r(e){return FZ.has(e.toUpperCase())}function dS(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Bh(e,t){let n=typeof t=="string"?ja(t).search:t.search;if(e[e.length-1].route.index&&dS(n||""))return e[e.length-1];let r=GP(e);return r[r.length-1]}function iR(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:l,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,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 Oy(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 mJ(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 Zu(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 gJ(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 na(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 vJ(e,t){try{let n=e.sessionStorage.getItem(WP);if(n){let r=JSON.parse(n);for(let[o,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function yJ(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(WP,JSON.stringify(n))}catch(r){zn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function xJ(){let e,t,n=new Promise((r,o)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{o(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Cl=v.createContext(null);Cl.displayName="DataRouter";var Kd=v.createContext(null);Kd.displayName="DataRouterState";v.createContext(!1);var fS=v.createContext({isTransitioning:!1});fS.displayName="ViewTransition";var rk=v.createContext(new Map);rk.displayName="Fetchers";var bJ=v.createContext(null);bJ.displayName="Await";var ko=v.createContext(null);ko.displayName="Navigation";var Xd=v.createContext(null);Xd.displayName="Location";var eo=v.createContext({outlet:null,matches:[],isDataRoute:!1});eo.displayName="Route";var hS=v.createContext(null);hS.displayName="RouteError";function SJ(e,{relative:t}={}){vt(Zd(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext(ko),{hash:o,pathname:l,search:c}=Jd(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:wo([n,l])),r.createHref({pathname:d,search:c,hash:o})}function Zd(){return v.useContext(Xd)!=null}function Gr(){return vt(Zd(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(Xd).location}var ik="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function ok(e){v.useContext(ko).static||v.useLayoutEffect(e)}function wn(){let{isDataRoute:e}=v.useContext(eo);return e?LJ():wJ()}function wJ(){vt(Zd(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Cl),{basename:t,navigator:n}=v.useContext(ko),{matches:r}=v.useContext(eo),{pathname:o}=Gr(),l=JSON.stringify(sS(r)),c=v.useRef(!1);return ok(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(zn(c.current,ik),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=lS(f,JSON.parse(l),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:wo([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,l,o,e])}var jJ=v.createContext(null);function CJ(e){let t=v.useContext(eo).outlet;return v.useMemo(()=>t&&v.createElement(jJ.Provider,{value:e},t),[t,e])}function Ut(){let{matches:e}=v.useContext(eo),t=e[e.length-1];return t?t.params:{}}function Jd(e,{relative:t}={}){let{matches:n}=v.useContext(eo),{pathname:r}=Gr(),o=JSON.stringify(sS(n));return v.useMemo(()=>lS(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function EJ(e,t){return ak(e,t)}function ak(e,t,n,r,o){vt(Zd(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=v.useContext(ko),{matches:c}=v.useContext(eo),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let E=g&&g.path||"";sk(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
592
-
593
- Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let x=Gr(),b;if(t){let E=typeof t=="string"?ja(t):t;vt(m==="/"||E.pathname?.startsWith(m),`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 "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),b=E}else b=x;let w=b.pathname||"/",j=w;if(m!=="/"){let E=m.replace(/^\//,"").split("/");j="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=ts(e,{pathname:j});zn(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),zn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=AJ(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:wo([m,l.encodeLocation?l.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:wo([m,l.encodeLocation?l.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),c,n,r,o);return t&&T?v.createElement(Xd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},T):T}function TJ(){let e=MJ(),t=bd(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},l={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:l},"ErrorBoundary")," or"," ",v.createElement("code",{style:l},"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:o},n):null,c)}var RJ=v.createElement(TJ,null),_J=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){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(eo.Provider,{value:this.props.routeContext},v.createElement(hS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function DJ({routeContext:e,match:t,children:n}){let r=v.useContext(Cl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(eo.Provider,{value:e},n)}function AJ(e,t=[],n=null,r=null,o=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 l=e,c=n?.errors;if(c!=null){let p=l.findIndex(m=>m.route.id&&c?.[m.route.id]!==void 0);vt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,p+1))}let d=!1,f=-1;if(n)for(let p=0;p<l.length;p++){let m=l[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(f=p),m.route.id){let{loaderData:g,errors:x}=n,b=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!x||x[m.route.id]===void 0);if(m.route.lazy||b){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((p,m,g)=>{let x,b=!1,w=null,j=null;n&&(x=c&&m.route.id?c[m.route.id]:void 0,w=m.route.errorElement||RJ,d&&(f<0&&g===0?(sk("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,j=null):f===g&&(b=!0,j=m.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,g+1)),T=()=>{let E;return x?E=w:b?E=j:m.route.Component?E=v.createElement(m.route.Component,null):m.route.element?E=m.route.element:E=p,v.createElement(DJ,{match:m,routeContext:{outlet:p,matches:C,isDataRoute:n!=null},children:E})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?v.createElement(_J,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},unstable_onError:r}):T()},null)}function pS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PJ(e){let t=v.useContext(Cl);return vt(t,pS(e)),t}function kJ(e){let t=v.useContext(Kd);return vt(t,pS(e)),t}function NJ(e){let t=v.useContext(eo);return vt(t,pS(e)),t}function mS(e){let t=NJ(e),n=t.matches[t.matches.length-1];return vt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function OJ(){return mS("useRouteId")}function MJ(){let e=v.useContext(hS),t=kJ("useRouteError"),n=mS("useRouteError");return e!==void 0?e:t.errors?.[n]}function LJ(){let{router:e}=PJ("useNavigate"),t=mS("useNavigate"),n=v.useRef(!1);return ok(()=>{n.current=!0}),v.useCallback(async(o,l={})=>{zn(n.current,ik),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var oR={};function sk(e,t,n){!t&&!oR[e]&&(oR[e]=!0,zn(!1,n))}var aR={};function sR(e,t){!e&&!aR[t]&&(aR[t]=!0,console.warn(t))}function IJ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&zn(!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&&zn(!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&&zn(!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 zJ=["HydrateFallback","hydrateFallbackElement"],$J=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 UJ({router:e,flushSync:t,unstable_onError:n}){let[r,o]=v.useState(e.state),[l,c]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[p,m]=v.useState(),[g,x]=v.useState(),[b,w]=v.useState(),j=v.useRef(new Map),C=v.useCallback(P=>{o(A=>(P.errors&&n&&Object.entries(P.errors).forEach(([k,M])=>{A.errors?.[k]!==M&&n(M)}),P))},[n]),T=v.useCallback((P,{deletedFetchers:A,flushSync:k,viewTransitionOpts:M})=>{P.fetchers.forEach((U,J)=>{U.data!==void 0&&j.current.set(J,U.data)}),A.forEach(U=>j.current.delete(U)),sR(k===!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 $=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(sR(M==null||$,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!M||!$){t&&k?t(()=>C(P)):v.startTransition(()=>C(P));return}if(t&&k){t(()=>{g&&(p&&p.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let U=e.window.document.startViewTransition(()=>{t(()=>C(P))});U.finished.finally(()=>{t(()=>{m(void 0),x(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>x(U));return}g?(p&&p.resolve(),g.skipTransition(),w({state:P,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(c(P),f({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[e.window,t,g,p,C]);v.useLayoutEffect(()=>e.subscribe(T),[e,T]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new $J)},[d]),v.useEffect(()=>{if(p&&l&&e.window){let P=l,A=p.promise,k=e.window.document.startViewTransition(async()=>{v.startTransition(()=>C(P)),await A});k.finished.finally(()=>{m(void 0),x(void 0),c(void 0),f({isTransitioning:!1})}),x(k)}},[l,p,e.window,C]),v.useEffect(()=>{p&&l&&r.location.key===l.location.key&&p.resolve()},[p,g,r.location,l]),v.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let E=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:P=>e.navigate(P),push:(P,A,k)=>e.navigate(P,{state:A,preventScrollReset:k?.preventScrollReset}),replace:(P,A,k)=>e.navigate(P,{replace:!0,state:A,preventScrollReset:k?.preventScrollReset})}),[e]),R=e.basename||"/",D=v.useMemo(()=>({router:e,navigator:E,static:!1,basename:R,unstable_onError:n}),[e,E,R,n]);return v.createElement(v.Fragment,null,v.createElement(Cl.Provider,{value:D},v.createElement(Kd.Provider,{value:r},v.createElement(rk.Provider,{value:j.current},v.createElement(fS.Provider,{value:d},v.createElement(FJ,{basename:R,location:r.location,navigationType:r.historyAction,navigator:E},v.createElement(BJ,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var BJ=v.memo(VJ);function VJ({routes:e,future:t,state:n,unstable_onError:r}){return ak(e,void 0,n,r,t)}function gS(e){return CJ(e.context)}function Ue(e){vt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function FJ({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:l=!1}){vt(!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:o,static:l,future:{}}),[c,o,l]);typeof n=="string"&&(n=ja(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:x="default"}=n,b=v.useMemo(()=>{let w=Ai(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 zn(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(ko.Provider,{value:d},v.createElement(Xd.Provider,{children:t,value:b}))}function HJ({children:e,location:t}){return EJ(Rx(e),t)}function Rx(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let l=[...t,o];if(r.type===v.Fragment){n.push.apply(n,Rx(r.props.children,l));return}vt(r.type===Ue,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),vt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,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=Rx(r.props.children,l)),n.push(c)}),n}var Vh="get",Fh="application/x-www-form-urlencoded";function Nm(e){return e!=null&&typeof e.tagName=="string"}function qJ(e){return Nm(e)&&e.tagName.toLowerCase()==="button"}function GJ(e){return Nm(e)&&e.tagName.toLowerCase()==="form"}function QJ(e){return Nm(e)&&e.tagName.toLowerCase()==="input"}function WJ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function YJ(e,t){return e.button===0&&(!t||t==="_self")&&!WJ(e)}function _x(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function KJ(e,t){let n=_x(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}var Th=null;function XJ(){if(Th===null)try{new FormData(document.createElement("form"),0),Th=!1}catch{Th=!0}return Th}var ZJ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function My(e){return e!=null&&!ZJ.has(e)?(zn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Fh}"`),null):e}function JJ(e,t){let n,r,o,l,c;if(GJ(e)){let d=e.getAttribute("action");r=d?Ai(d,t):null,n=e.getAttribute("method")||Vh,o=My(e.getAttribute("enctype"))||Fh,l=new FormData(e)}else if(qJ(e)||QJ(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?Ai(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Vh,o=My(e.getAttribute("formenctype"))||My(d.getAttribute("enctype"))||Fh,l=new FormData(d,e),!XJ()){let{name:p,type:m,value:g}=e;if(m==="image"){let x=p?`${p}.`:"";l.append(`${x}x`,"0"),l.append(`${x}y`,"0")}else p&&l.append(p,g)}}else{if(Nm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Vh,r=null,o=Fh,c=e}return l&&o==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function eee(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&&Ai(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function tee(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 nee(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 ree(e,t,n){let r=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let c=await tee(l,n);return c.links?c.links():[]}return[]}));return see(r.flat(1).filter(nee).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function lR(e,t,n,r,o,l){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 l==="assets"?t.filter((f,p)=>c(f,p)||d(f,p)):l==="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(o.pathname+o.search+o.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 iee(e,t,{includeHydrateFallback:n}={}){return oee(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function oee(e){return[...new Set(e)]}function aee(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function see(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let l=JSON.stringify(aee(o));return n.has(l)||(n.add(l),r.push({key:l,link:o})),r},[])}function lk(){let e=v.useContext(Cl);return vS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function lee(){let e=v.useContext(Kd);return vS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var yS=v.createContext(void 0);yS.displayName="FrameworkContext";function ck(){let e=v.useContext(yS);return vS(e,"You must render this element inside a <HydratedRouter> element"),e}function cee(e,t){let n=v.useContext(yS),[r,o]=v.useState(!1),[l,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=T=>{T.forEach(E=>{c(E.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=()=>{o(!0)},w=()=>{o(!1),c(!1)};return n?e!=="intent"?[l,x,{}]:[l,x,{onFocus:Ju(d,b),onBlur:Ju(f,w),onMouseEnter:Ju(p,b),onMouseLeave:Ju(m,w),onTouchStart:Ju(g,b)}]:[!1,x,{}]}function Ju(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function uee({page:e,...t}){let{router:n}=lk(),r=v.useMemo(()=>ts(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(fee,{page:e,matches:r,...t}):null}function dee(e){let{manifest:t,routeModules:n}=ck(),[r,o]=v.useState([]);return v.useEffect(()=>{let l=!1;return ree(e,t,n).then(c=>{l||o(c)}),()=>{l=!0}},[e,t,n]),r}function fee({page:e,matches:t,...n}){let r=Gr(),{manifest:o,routeModules:l}=ck(),{basename:c}=lk(),{loaderData:d,matches:f}=lee(),p=v.useMemo(()=>lR(e,t,f,o,r,"data"),[e,t,f,o,r]),m=v.useMemo(()=>lR(e,t,f,o,r,"assets"),[e,t,f,o,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,j=!1;if(t.forEach(T=>{let E=o.routes[T.route.id];!E||!E.hasLoader||(!p.some(R=>R.route.id===T.route.id)&&T.route.id in d&&l[T.route.id]?.shouldRevalidate||E.hasClientLoader?j=!0:w.add(T.route.id))}),w.size===0)return[];let C=eee(e,c,"data");return j&&w.size>0&&C.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,p,t,e,l]),x=v.useMemo(()=>iee(m,o),[m,o]),b=dee(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 hee(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var uk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{uk&&(window.__reactRouterVersion="7.9.4")}catch{}function pee(e,t){return XZ({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:gZ({window:t?.window}),hydrationData:mee(),routes:e,mapRouteProperties:IJ,hydrationRouteProperties:zJ,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window}).initialize()}function mee(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:gee(e.errors)}),e}function gee(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new xp(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let c=new l(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(o.message);l.stack="",n[r]=l}}else n[r]=o;return n}var dk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,fk=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:l,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,...x},b){let{basename:w}=v.useContext(ko),j=typeof p=="string"&&dk.test(p),C,T=!1;if(typeof p=="string"&&j&&(C=p,uk))try{let $=new URL(window.location.href),U=p.startsWith("//")?new URL($.protocol+p):new URL(p),J=Ai(U.pathname,w);U.origin===$.origin&&J!=null?p=J+U.search+U.hash:T=!0}catch{zn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=SJ(p,{relative:o}),[R,D,P]=cee(r,x),A=bee(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g});function k($){t&&t($),$.defaultPrevented||A($)}let M=v.createElement("a",{...x,...P,href:C||E,onClick:T||l?t:k,ref:hee(b,D),target:f,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?v.createElement(v.Fragment,null,M,v.createElement(uee,{page:E})):M});fk.displayName="Link";var vee=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:l,to:c,viewTransition:d,children:f,...p},m){let g=Jd(c,{relative:p.relative}),x=Gr(),b=v.useContext(Kd),{navigator:w,basename:j}=v.useContext(ko),C=b!=null&&Eee(g)&&d===!0,T=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,E=x.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),R=R?R.toLowerCase():null,T=T.toLowerCase()),R&&j&&(R=Ai(R,j)||R);const D=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let P=E===T||!o&&E.startsWith(T)&&E.charAt(D)==="/",A=R!=null&&(R===T||!o&&R.startsWith(T)&&R.charAt(T.length)==="/"),k={isActive:P,isPending:A,isTransitioning:C},M=P?t:void 0,$;typeof r=="function"?$=r(k):$=[r,P?"active":null,A?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let U=typeof l=="function"?l(k):l;return v.createElement(fk,{...p,"aria-current":M,className:$,ref:m,style:U,to:c,viewTransition:d},typeof f=="function"?f(k):f)});vee.displayName="NavLink";var yee=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:l,method:c=Vh,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...x},b)=>{let w=jee(),j=Cee(d,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&dk.test(d),E=R=>{if(f&&f(R),R.defaultPrevented)return;R.preventDefault();let D=R.nativeEvent.submitter,P=D?.getAttribute("formmethod")||c;w(D||R.currentTarget,{fetcherKey:t,method:P,navigate:n,replace:o,state:l,relative:p,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:E,...x,"data-discover":!T&&e==="render"?"true":void 0})});yee.displayName="Form";function xee(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function hk(e){let t=v.useContext(Cl);return vt(t,xee(e)),t}function bee(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:l,viewTransition:c}={}){let d=wn(),f=Gr(),p=Jd(e,{relative:l});return v.useCallback(m=>{if(YJ(m,t)){m.preventDefault();let g=n!==void 0?n:us(f)===us(p);d(e,{replace:g,state:r,preventScrollReset:o,relative:l,viewTransition:c})}},[f,d,p,n,r,t,e,o,l,c])}function xS(e){zn(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(_x(e)),n=v.useRef(!1),r=Gr(),o=v.useMemo(()=>KJ(r.search,n.current?null:t.current),[r.search]),l=wn(),c=v.useCallback((d,f)=>{const p=_x(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,l("?"+p,f)},[l,o]);return[o,c]}var See=0,wee=()=>`__${String(++See)}__`;function jee(){let{router:e}=hk("useSubmit"),{basename:t}=v.useContext(ko),n=OJ();return v.useCallback(async(r,o={})=>{let{action:l,method:c,encType:d,formData:f,body:p}=JJ(r,t);if(o.navigate===!1){let m=o.fetcherKey||wee();await e.fetch(m,n,o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await e.navigate(o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function Cee(e,{relative:t}={}){let{basename:n}=v.useContext(ko),r=v.useContext(eo);vt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),l={...Jd(e||".",{relative:t})},c=Gr();if(e==null){l.search=c.search;let d=new URLSearchParams(l.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();l.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:wo([n,l.pathname])),us(l)}function Eee(e,{relative:t}={}){let n=v.useContext(fS);vt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=hk("useViewTransitionState"),o=Jd(e,{relative:t});if(!n.isTransitioning)return!1;let l=Ai(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Ai(n.nextLocation.pathname,r)||n.nextLocation.pathname;return yp(o.pathname,c)!=null||yp(o.pathname,l)!=null}function bS(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function Tee(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 vs(e){return rl(e.getActiveLogin()?.project)}function Om(e){const t=Re(),n=vs(t),r=wn(),[o,l]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:de.EQUALS,value:"Project/"+n},{code:"profile-type",operator:de.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(nu,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>l(c.definition),hideFilters:!0,hideToolbar:!0})}function Ree(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Bots"}),a.jsx(Om,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(mt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function _ee(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Clients"}),a.jsx(Om,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(mt,{to:"/admin/clients/new",children:"Create new client"})})]})}function Mm(e){return a.jsx(wl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Ao(t)?e.onChange(Ht(t)):e.onChange(void 0)}})}function Dee(){const e=Re(),t=vs(e),[n,r]=v.useState(""),[o,l]=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(ut,{onSubmit:()=>{const x={name:n,description:o,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:Ye(b),autoClose:!1}),p(qt(b))})},children:[!m&&a.jsxs(Be,{children:[a.jsx(Pt,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(Ve,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:x=>r(x.currentTarget.value),error:At(f,"name")})}),a.jsx(Pt,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(Ve,{id:"description",name:"description",onChange:x=>l(x.currentTarget.value),error:At(f,"description")})}),a.jsx(Pt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(Mm,{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(Te,{children:"Bot created"}),a.jsxs(Er,{children:[a.jsx(Er.Item,{children:a.jsx(mt,{to:m,children:"Go to new bot"})}),a.jsx(Er.Item,{children:a.jsx(mt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function Aee(){const e=Re(),t=vs(e),[n,r]=v.useState(""),[o,l]=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(ut,{onSubmit:()=>{const w={name:n,description:o,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:Ye(j),autoClose:!1}),g(qt(j))})},children:[!x&&a.jsxs(Be,{children:[a.jsx(Pt,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(Ve,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:w=>r(w.currentTarget.value),error:At(m,"name")})}),a.jsx(Pt,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(Ve,{id:"description",name:"description",onChange:w=>l(w.currentTarget.value),error:At(m,"description")})}),a.jsx(Pt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(Ve,{id:"redirectUri",name:"redirectUri",onChange:w=>d(w.currentTarget.value),error:At(m,"redirectUri")})}),a.jsx(Pt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(Mm,{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(Te,{children:"Client created"}),a.jsxs(Er,{children:[a.jsx(Er.Item,{children:a.jsx(mt,{to:x,children:"Go to new client"})}),a.jsx(Er.Item,{children:a.jsx(mt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function SS(e,t,n,r){const o=Date.now().toString();Ne({id:o,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const l={method:"POST",pollStatusOnAccepted:!0};return r&&(l.body=JSON.stringify(r)),e.startAsyncRequest(n,l).then(c=>{let d="Done";return c.resourceType==="AsyncJob"?d=a.jsx(mt,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(Te,{children:c.issue[0].details.text})),Ci.update({id:o,color:"green",title:t,message:d,icon:a.jsx(Po,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw Ci.update({id:o,color:"red",title:t,message:Ye(c),icon:a.jsx(sl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function Us(e,t,n,r){SS(e,t,n,r).catch(()=>{})}const Pee=8;function kee({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=gl({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),[l,c]=v.useState(""),[d,f]=v.useState([]),p=w=>{const j=d.includes(w)?d.filter(C=>C!==w):[...d,w];f(j),r&&r(j)},m=w=>f(j=>j.filter(C=>C!==w)),g=v.useMemo(()=>d.map(w=>a.jsx(la,{withRemoveButton:!0,onRemove:()=>m(w),children:w},w)),[d]),x=v.useMemo(()=>{const w=l.trim().toLowerCase();return n.filter(j=>j.toLowerCase().includes(w))},[n,l]),b=v.useMemo(()=>{const w=new Array(Math.min(x.length,Pee));for(let j=0;j<w.length;j++){const C=x[j];w[j]=a.jsx(Xe.Option,{value:C,active:d.includes(C),children:a.jsxs(ye,{gap:"sm",children:[d.includes(C)?a.jsx(Ad,{size:12}):null,a.jsx("span",{children:C})]})},C)}return w},[x,d]);return a.jsxs(Xe,{store:o,onOptionSubmit:p,withinPortal:!1,children:[a.jsx(Xe.DropdownTarget,{children:a.jsx(ss,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(la.Group,{children:[g,a.jsx(Xe.EventsTarget,{children:a.jsx(ss.Field,{onFocus:()=>o.openDropdown(),onBlur:()=>{o.closeDropdown(),c("")},value:l,onChange:w=>{o.updateSelectedOptionIndex(),c(w.currentTarget.value)},onKeyDown:w=>{w.key==="Backspace"&&l.length===0&&d.length>0&&(w.preventDefault(),m(d[d.length-1]))},...t})})]})})}),a.jsx(Xe.Dropdown,{children:a.jsx(Xe.Options,{children:b.length>0?b:a.jsx(Xe.Empty,{children:"Nothing found..."})})})]})}function Nee({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=Re(),[o,l]=v.useState(!1),[c,d]=v.useState([]),[f,p]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[x,b]=v.useState(void 0),w=()=>{const j={tableName:c};f==="reset"?j.fastUpdateAction="reset":f==="on"?(j.fastUpdateAction="set",j.fastUpdateValue=!0):f==="off"&&(j.fastUpdateAction="set",j.fastUpdateValue=!1),m==="reset"?j.ginPendingListLimitAction="reset":m==="set"&&(j.ginPendingListLimitAction="set",j.ginPendingListLimitValue=x),l(!0),SS(r,"Configure GIN Indexes","fhir/R4/$db-configure-indexes",j).then(C=>{n(C)}).catch(()=>{}).finally(()=>{l(!1)})};return a.jsx(ut,{onSubmit:w,children:a.jsxs(Be,{gap:"sm",maw:"800",children:[a.jsx(Td,{label:"Table(s)",children:a.jsx(kee,{data:t,onChange:j=>d(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(ur.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>p(j),children:a.jsxs(ye,{h:"36",children:[a.jsx(ur,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(ur,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(ur,{size:"sm",value:"off",label:"off"}),a.jsx(ur,{size:"sm",value:"on",label:"on"})]})}),a.jsx(ur.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&b(void 0)},children:a.jsxs(ye,{h:"36",children:[a.jsx(ur,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(ur,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(ye,{children:[a.jsx(ur,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(Oc,{title:"gin_pending_list_limit_value",name:"gin_pending_list_limit_value",value:(m==="set"?x:"")||"",disabled:m!=="set",required:m==="set",size:"sm",w:"100",min:64,max:2147483647,onChange:j=>{b(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(ye,{justify:"center",children:a.jsx(vr,{size:"sm",loading:o,children:"Update"})})]})})}const Oee=8;function Mee({inputProps:e,data:t,onChange:n}){const r=gl({onDropdownClose:()=>r.resetSelectedOption()}),[o,l]=v.useState(null),[c,d]=v.useState(""),f=v.useMemo(()=>t.filter(m=>m.toLowerCase().includes(c.toLowerCase().trim())),[t,c]),p=v.useMemo(()=>{const m=new Array(Math.min(f.length,Oee));for(let g=0;g<m.length;g++){const x=f[g];m[g]=a.jsx(Xe.Option,{value:x,children:x},x)}return m},[f]);return a.jsxs(Xe,{store:r,withinPortal:!1,onOptionSubmit:m=>{n&&n(m),l(m),d(m),r.closeDropdown()},children:[a.jsx(Xe.Target,{children:a.jsx(Dr,{rightSection:a.jsx(Xe.Chevron,{}),value:c,onChange:m=>{r.openDropdown(),r.updateSelectedOptionIndex(),d(m.currentTarget.value)},onClick:()=>r.openDropdown(),onFocus:()=>r.openDropdown(),onBlur:()=>{r.closeDropdown(),d(o||"")},rightSectionPointerEvents:"none",...e})}),a.jsx(Xe.Dropdown,{children:a.jsx(Xe.Options,{children:p.length>0?p:a.jsx(Xe.Empty,{children:"Nothing found"})})})]})}function Lee(e){let t=[];for(const n of e)t.push(n),t.push(n+"_History"),t.push(n+"_References");return t.push("Address"),t.push("ContactPoint"),t.push("HumanName"),t.push("Coding"),t.push("Coding_Property"),t.push("DatabaseMigration"),t=Ic(t),t}function pk(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}function Iee(){const e=Re(),[t,{open:n,close:r}]=wd(!1),[o,l]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[x,b]=v.useState(!1),[w,j]=v.useState(void 0),[C,T]=v.useState([]),[E,R]=v.useState(0);v.useEffect(()=>{async function k(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map($=>$.code).filter($=>$!==void 0)??[]}k().then(M=>{T(Lee(M))}).catch(console.error)},[e]),v.useEffect(()=>{b(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(k=>{const M=k.parameter?.find(U=>U.name==="defaultGinPendingListLimit")?.valueInteger??0;g(M);const $=k.parameter?.filter(U=>U.name==="index");j($??[])}).finally(()=>{b(!1)}).catch(k=>{Ne({color:"red",message:k.message})})},[e,f,E]);const D=k=>{l("Configure results"),d(a.jsx("pre",{children:JSON.stringify(k,null,2)})),n(),R(M=>(M+1)%100)},P={onClick:k=>{l("Details"),d(a.jsx("pre",{children:k})),n()}};let A;return x?A="Loading...":f?w?.length===0&&(A="No GIN indexes on this table"):A="Select a table",a.jsxs(a.Fragment,{children:[a.jsxs(Be,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(ye,{children:a.jsx(Nee,{defaultGinPendingListLimit:m,availableTables:C,onResponse:D})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(ye,{children:[a.jsx(Mee,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:k=>{p(k)}}),a.jsx(ke,{loading:x,onClick:()=>R(k=>(k+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(fe.ScrollContainer,{minWidth:500,children:a.jsxs(fe,{striped:!0,highlightOnHover:!0,children:[a.jsx(fe.Thead,{children:a.jsxs(fe.Tr,{children:[a.jsx(fe.Th,{children:"Schema"}),a.jsx(fe.Th,{children:"Table"}),a.jsx(fe.Th,{children:"Index"}),a.jsx(fe.Th,{children:"fastupdate"}),a.jsx(fe.Th,{children:"gin_pending_list_limit"}),a.jsx(fe.Th,{children:"options"})]})}),a.jsxs(fe.Tbody,{children:[A&&a.jsx(fe.Tr,{children:a.jsx(fe.Td,{colSpan:16,children:A})}),!A&&w?.map(k=>{const M=k.part??[],$=M.find(U=>U.name==="indexName")?.valueString;if(!$)throw new Error("Index missing name",{cause:k});return a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:M.find(U=>U.name==="schemaName")?.valueString}),a.jsx(fe.Td,{children:M.find(U=>U.name==="tableName")?.valueString}),a.jsx(fe.Td,{children:$}),a.jsx(Ly,{value:M.find(U=>U.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(Te,{span:!0,c:"dimmed",fs:"italic",children:["default (",pk(!0),")"]}),...P}),a.jsx(Ly,{value:M.find(U=>U.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(Te,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...P}),a.jsx(Ly,{value:M.find(U=>U.name==="indexOptions")?.valueString,defaultValue:a.jsx(Te,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...P})]},$)})]})]})})]}),a.jsx(Un,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function Ly({value:e,onClick:t,defaultValue:n}){return a.jsx(fe.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:pk(e)})}function zee(){const e=Re(),t=["GIN Indexes"],[n,r]=v.useState(t[0]);function o(l){l||(l=t[0]),r(l)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(yr,{outcome:Vd}):a.jsx(eu,{maw:"100%",children:a.jsxs(Sl,{children:[a.jsx(Ie,{order:1,children:"Database Tools"}),a.jsxs(Tt,{value:n,onChange:o,children:[a.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:t.map(l=>a.jsx(Tt.Tab,{value:l,children:l},l))}),a.jsx(Tt.Panel,{value:"GIN Indexes",pt:"md",children:a.jsx(Iee,{})})]})]})})}function $ee(e){return a.jsx(wl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Ao(t)?e.onChange(Ht(t)):e.onChange(void 0)}})}function Uee(){const{membershipId:e}=Ut(),t=Re(),n=vs(t),r=wn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[l,c]=v.useState(o.accessPolicy),[d,f]=v.useState(o.userConfiguration),[p,m]=v.useState(o.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(qt(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(Tc,{value:o.profile,link:!0})}),a.jsxs(ut,{onSubmit:()=>{const C={...o,accessPolicy:l,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>w(!0)).catch(T=>x(qt(T)))},children:[!b&&a.jsxs(Be,{children:[a.jsx(Pt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(Mm,{name:"accessPolicy",defaultValue:l,onChange:c})}),a.jsx(Pt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx($ee,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(Pt,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(Pn,{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(mt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Bee(){const e=Re(),[t,n]=v.useState(e.getProject()),[r,o]=v.useState(),[l,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",mfaRequired:x.mfaRequired==="on"};return e.invite(t?.id,b).then(w=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),um(w)?c(w):m(w),f(b.sendEmail??!1),Ne({color:"green",message:"Invite success"})}).catch(w=>{Ne({color:"red",message:Ye(w),autoClose:!1}),c(qt(w))})},[e,t,r]);return a.jsxs(ut,{onSubmit:g,children:[!p&&!l&&a.jsxs(Be,{children:[a.jsx(Ie,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(Pt,{title:"Project",htmlFor:"project",outcome:l,children:a.jsx(wl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(on,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:At(l,"resourceType")}),a.jsx(Ve,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:At(l,"firstName")}),a.jsx(Ve,{name:"lastName",label:"Last Name",required:!0,error:At(l,"lastName")}),a.jsx(Ve,{name:"email",type:"email",label:"Email",required:!0,error:At(l,"email")}),a.jsx(Pt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:l,children:a.jsx(Mm,{name:"accessPolicy",onChange:o})}),a.jsx(Pn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(Pn,{name:"isAdmin",label:"Admin"}),a.jsx(Pn,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(Pn,{name:"mfaRequired",label:"MFA required"}),a.jsx(ye,{justify:"flex-end",children:a.jsx(vr,{children:"Invite"})})]}),l&&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(mt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Te,{children:"User created"}),d&&a.jsx(Te,{children:"Email sent"}),a.jsxs(Er,{children:[a.jsx(Er.Item,{children:a.jsx(mt,{to:p,children:"Go to new membership"})}),a.jsx(Er.Item,{children:a.jsx(mt,{to:p.profile,children:"Go to new profile"})}),a.jsx(Er.Item,{children:a.jsx(mt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Vee(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Patients"}),a.jsx(Om,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(mt,{to:"/admin/invite",children:"Invite new patient"})})]})}function Fee(){const e=Re();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(yr,{outcome:Vd});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ne({color:"green",message:"Done"})).catch(r=>Ne({color:"red",message:Ye(r),autoClose:!1}))}return a.jsxs(lt,{width:600,children:[a.jsx(Ie,{order:1,children:"Project Admin"}),a.jsx(pn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Force Set Password"}),a.jsx(Te,{children:"Sets the password for the specified user in this project."}),a.jsx(Te,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(ut,{onSubmit:t,children:a.jsxs(Be,{children:[a.jsx(Ve,{name:"email",label:"Email",required:!0}),a.jsx(Qi,{name:"password",label:"Password",required:!0}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})})]})}function cR(){const e=Re(),t=vs(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Details"}),a.jsxs(Cm,{children:[a.jsx(Ti,{term:"ID",children:n.project.id}),a.jsx(Ti,{term:"Name",children:n.project.name})]})]})}const uR=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function Hee(){const e=wn(),n=Gr().pathname.replace("/admin/","")||uR[0],r=Re(),o=vs(r),l=v.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function c(d){e(`/admin/${d}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(Tr,{children:[a.jsx(ht,{children:a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Project"}),a.jsx(ht.Value,{children:l.project.name})]})}),a.jsx(ai,{children:a.jsx(Tt,{value:n.toLowerCase(),onChange:c,children:a.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:uR.map(d=>a.jsx(Tt.Tab,{value:d.toLowerCase(),children:d},d))})})})]}),a.jsx(lt,{children:a.jsx(gS,{})})]})}function qee(){const e=Re(),t=vs(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[l,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(ii(n.project.secret||[]))},[e,n]),!r||!l?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/secrets`,l).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(Wd,{property:ms("Project","secret"),name:"secret",path:"Project.secret",defaultValue:l,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}function Gee(){const e=Re(),t=vs(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[l,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(ii(n.project.site||[]))},[e,n]),!r||!l?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/sites`,l).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ne({color:"green",message:"Saved"})).catch(f=>{const p=qt(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(Wd,{property:ms("Project","site"),name:"site",path:"Project.site",defaultValue:l,onChange:c,outcome:void 0}),a.jsx(ke,{type:"submit",children:"Save"})]})}const mk="System AsyncJob",gk="Post-deploy Migrations",Rh=[gk,mk];function Qee(){const e=Re(),[t,n]=v.useState(Rh[0]);function r(o){o||=Rh[0],Rh.includes(o)&&n(o)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(yr,{outcome:Vd}):a.jsx(eu,{miw:"1600",maw:"2000",children:a.jsxs(Sl,{children:[a.jsx(Ie,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(Tt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Rh.map(o=>a.jsx(Tt.Tab,{value:o,children:o},o))}),a.jsx(Tt.Panel,{value:mk,pt:"md",children:a.jsx(Yee,{})}),a.jsx(Tt.Panel,{value:gk,pt:"md",children:a.jsx(Xee,{})})]})]})})}const Wee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:de.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function Yee(){const e=wn(),[t]=v.useState(Wee);return a.jsxs(Be,{children:[a.jsx(mt,{to:`/${t.resourceType}/${is(t)}`,children:"Show in search page"}),a.jsx(nu,{checkboxesEnabled:!1,search:t,onClick:n=>e(dR(n.resource))?.catch(console.error),onAuxClick:n=>window.open(dR(n.resource),"_blank")})]})}const Kee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:de.MISSING,value:"true"},{code:"type",operator:de.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function Xee(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(),[l,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((T,E)=>E-T),n(C)}).catch(C=>{Ne({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",is({...Kee,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(T=>T.resource))})).catch(C=>{o(void 0),Ne({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]);function g(){f(j=>j+1)}function x(j){SS(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(qp,{visible:C}),a.jsxs(fe,{children:[a.jsx(fe.Thead,{children:a.jsxs(fe.Tr,{children:[a.jsx(fe.Th,{children:"Version"}),a.jsx(fe.Th,{children:"Action"}),a.jsx(fe.Th,{children:"Status"}),a.jsx(fe.Th,{children:"AsyncJob"}),a.jsx(fe.Th,{children:"Last Updated"}),a.jsx(fe.Th,{children:"Request Time"}),a.jsx(fe.Th,{children:"Duration"}),a.jsx(fe.Th,{children:"Attempts"})]})}),a.jsx(fe.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(ke,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(BA,{size:14}),onClick:g,loading:b,children:"Refresh"}),w(()=>{if(!b){if(!t)return a.jsx(fe.Tr,{children:a.jsx(fe.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(fe.Tr,{children:a.jsx(fe.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:T,asyncJobs:E}=Zee(j,r??[],t?.pendingPostDeployMigration),R=l.includes(j),D=j===t?.pendingPostDeployMigration&&(!T||T?.status==="error"),P=[a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:j}),a.jsx(fe.Td,{children:D&&a.jsx(ke,{color:"green",size:"xs",onClick:()=>x(j),children:"Start"})}),a.jsx(fe.Td,{children:C}),a.jsx(fe.Td,{children:T&&a.jsx(mt,{to:`/AsyncJob/${T?.id}`,children:T?.id})}),a.jsx(fe.Td,{children:T?.meta?.lastUpdated}),a.jsx(fe.Td,{children:T?.requestTime}),a.jsx(fe.Td,{children:fR(T)}),a.jsx(fe.Td,{display:"flex",children:a.jsxs(ye,{gap:"xs",children:[E.length?E.length:"",R&&E.length>1&&a.jsx(ke,{leftSection:a.jsx(wq,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A.filter(k=>k!==j):A),children:"Hide all"}),!R&&E.length>1&&a.jsx(ke,{leftSection:a.jsx(UA,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(A=>A.includes(j)?A:[...A,j]),children:"Show all"})]})})]},j)];return R&&P.push(...E.filter(A=>A.id!==T?.id).map(A=>a.jsxs(fe.Tr,{bg:"gray.1",children:[a.jsx(fe.Td,{children:j}),a.jsx(fe.Td,{}),a.jsx(fe.Td,{children:A.status}),a.jsx(fe.Td,{children:a.jsx(mt,{to:`/AsyncJob/${A.id}`,children:A.id})}),a.jsx(fe.Td,{children:A.meta?.lastUpdated}),a.jsx(fe.Td,{children:A.requestTime}),a.jsx(fe.Td,{children:fR(A)}),a.jsx(fe.Td,{})]},A.id))),P})},{isLoading:b})]})}function Zee(e,t,n){const r=t.filter(c=>c.dataVersion===e),o=r.find(c=>c.status==="completed")??r[0];let l;return n===0?l=o?.status??"completed":e>n?l=o?.status??"pending":e===n?l=o?.status??"next":l=o?.status??"completed",{status:l,asyncJob:o,asyncJobs:r}}function dR(e){return`/${e.resourceType}/${e.id}`}function fR(e){const t=e?.requestTime,n=e?.transactionTime??e?.meta?.lastUpdated;if(!t||!n)return"";const r=new Date(t),l=new Date(n).getTime()-r.getTime();if(l<1e3)return`${l.toFixed(0)}ms`;const c=l/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function Jee(){const e=Re(),[t,{open:n,close:r}]=wd(!1),[o,l]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(yr,{outcome:Vd});function f(){Us(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){Us(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){Us(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(P){Us(e,"Reindexing Resources","admin/super/reindex",P)}function x(){Us(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){Us(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:Ye(A),autoClose:!1}))}function j(P){e.post("admin/super/purge",{...P,before:Yb(P.before)}).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ye(A),autoClose:!1}))}function C(P){e.post("admin/super/setpassword",P).then(()=>Ne({color:"green",message:"Done"})).catch(A=>Ne({color:"red",message:Ye(A),autoClose:!1}))}function T(P){e.post("fhir/R4/$db-stats",P.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:P.tableNames}]}:void 0).then(A=>{l("Database Stats"),d(a.jsx("pre",{children:A.parameter?.find(k=>k.name==="tableString")?.valueString})),n()}).catch(A=>Ne({color:"red",message:Ye(A),autoClose:!1}))}function E(){e.post("fhir/R4/$db-invalid-indexes").then(P=>{l("Database Invalid Indexes"),d(a.jsx("pre",{children:P.parameter?.filter(A=>A.name==="invalidIndex").map(A=>A.valueString).join(`
594
- `)})),n()}).catch(P=>Ne({color:"red",message:Ye(P),autoClose:!1}))}function R(){e.post("fhir/R4/$db-schema-diff").then(P=>{l("Schema Diff"),d(a.jsx("pre",{children:P.parameter?.find(A=>A.name==="migrationString")?.valueString})),n()}).catch(P=>Ne({color:"red",message:Ye(P),autoClose:!1}))}function D(){Us(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(pn,{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(ut,{children:a.jsx(ke,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(pn,{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(ut,{children:a.jsx(ke,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(pn,{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(ut,{children:a.jsx(ke,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(pn,{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(ut,{onSubmit:b,children:a.jsx(Be,{children:a.jsx(ke,{type:"submit",children:"Start Migration"})})}),a.jsx(pn,{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(ut,{onSubmit:g,children:a.jsxs(Be,{children:[a.jsx(Pt,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(Ve,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(Pt,{title:"Search Filter",htmlFor:"filter",children:a.jsx(Ve,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(Pt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx(ete,{})}),a.jsx(ke,{type:"submit",children:"Reindex"})]})}),a.jsx(pn,{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(ut,{onSubmit:j,children:a.jsxs(Be,{children:[a.jsx(Pt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(on,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(Pt,{title:"Purge Before",htmlFor:"before",children:a.jsx(So,{name:"before",placeholder:"Before Date"})}),a.jsx(ke,{type:"submit",children:"Purge"})]})}),a.jsx(pn,{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(ut,{onSubmit:w,children:a.jsxs(Be,{children:[a.jsx(Pt,{title:"Bot ID",children:a.jsx(Ve,{name:"botId",placeholder:"Bot Id"})}),a.jsx(ke,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(pn,{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(ut,{onSubmit:C,children:a.jsxs(Be,{children:[a.jsx(Ve,{name:"email",label:"Email",required:!0}),a.jsx(Qi,{name:"password",label:"Password",required:!0}),a.jsx(Ve,{name:"projectId",label:"Project ID"}),a.jsx(ke,{type:"submit",children:"Force Set Password"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(ut,{onSubmit:T,children:a.jsxs(Be,{children:[a.jsx(Pt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(Ve,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(ke,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(pn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(ut,{onSubmit:E,children:a.jsx(Be,{children:a.jsx(ke,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(pn,{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(hr,{children:[a.jsx(hr.Col,{span:6,children:a.jsx(ut,{onSubmit:R,children:a.jsx(Be,{children:a.jsx(ke,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(hr.Col,{span:6,children:a.jsx(ut,{onSubmit:D,children:a.jsx(Be,{children:a.jsx(ke,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(pn,{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(ut,{onSubmit:x,children:a.jsx(Be,{children:a.jsx(ke,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(pn,{my:"lg"}),a.jsx(Ie,{order:2,children:"Database Explain Search"}),a.jsx("p",{children:"Runs an EXPLAIN query on the database to show the query plan for a search."}),a.jsx(tte,{setModalTitle:l,setModalContent:d,openModal:n}),a.jsx(Un,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function ete(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(on,{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(Oc,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function tte({setModalTitle:e,setModalContent:t,openModal:n}){const r=Re(),[o,l]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),x=v.useMemo(()=>{if(o?.reference)return{"_has:ProjectMembership:profile:project":o.reference}},[o]);v.useEffect(()=>{if(g(void 0),!c?.reference&&!o?.reference){p(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:o?.reference,_count:20}).then(j=>{p(j),j.length===1&&g(Ht(j[0]))}).catch(j=>{console.error(j),Ne({color:"red",message:Ye(j),autoClose:!1})})},[r,c,o]);const b=v.useMemo(()=>{const j={};return c?.reference&&(j.profile=c?.reference),o?.reference&&(j.project=o?.reference),j},[c,o]);function w(j){if(!j.query){Ne({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const T={query:j.query,analyze:j.analyze==="on",format:"text"},E={};C&&(E["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",T,void 0,{headers:E}).then(R=>{e("Database Explain");const D=R.parameter?.find(M=>M.name==="explain")?.valueString,P=R.parameter?.find(M=>M.name==="query")?.valueString,A=R.parameter?.find(M=>M.name==="parameters")?.valueString,k=[P,A,`
595
- `,D].join(`
596
- `);t(a.jsx(Pd,{block:!0,maw:"100%",children:k})),n()}).catch(R=>{Ne({color:"red",message:Ye(R),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(yr,{outcome:Vd}):a.jsx(ut,{onSubmit:w,children:a.jsxs(Be,{children:[a.jsx(Ve,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(Pn,{name:"analyze",label:"Analyze"}),a.jsx(Td,{label:"On Behalf Of",children:a.jsxs(Be,{gap:"sm",children:[a.jsx(os,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:l}),a.jsx(os,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:x}),f?.length!==1&&a.jsx(os,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:b}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:_t(f[0])}),a.jsx(dp,{value:Ht(f[0])})]}),!m&&a.jsx(Te,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(ke,{type:"submit",children:"Explain Search"})]})})}function nte(){return a.jsxs(a.Fragment,{children:[a.jsx(Ie,{children:"Users"}),a.jsx(Om,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(ye,{justify:"flex-end",children:a.jsx(mt,{to:"/admin/invite",children:"Invite new user"})})]})}const rte=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 Uc(e,t,n){const r=ite(e),{webkitRelativePath:o}=e,l=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&hR(r,"path",l),hR(r,"relativePath",l),r}function ite(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=rte.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function hR(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var El=(e,t,n)=>new Promise((r,o)=>{var l=f=>{try{d(n.next(f))}catch(p){o(p)}},c=f=>{try{d(n.throw(f))}catch(p){o(p)}},d=f=>f.done?r(f.value):Promise.resolve(f.value).then(l,c);d((n=n.apply(e,t)).next())});const ote=[".DS_Store","Thumbs.db"];function ate(e){return El(this,null,function*(){return Sp(e)&&ste(e.dataTransfer)?dte(e.dataTransfer,e.type):lte(e)?cte(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?ute(e):[]})}function ste(e){return Sp(e)}function lte(e){return Sp(e)&&Sp(e.target)}function Sp(e){return typeof e=="object"&&e!==null}function cte(e){return Dx(e.target.files).map(t=>Uc(t))}function ute(e){return El(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Uc(n))})}function dte(e,t){return El(this,null,function*(){if(e.items){const n=Dx(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(fte));return pR(vk(r))}return pR(Dx(e.files).map(n=>Uc(n)))})}function pR(e){return e.filter(t=>ote.indexOf(t.name)===-1)}function Dx(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 fte(e){if(typeof e.webkitGetAsEntry!="function")return mR(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?yk(t):mR(e,t)}function vk(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?vk(n):[n]],[])}function mR(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(l=>El(this,null,function*(){const c=yield l.getFile();return c.handle=l,Uc(c)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const o=Uc(r,(n=t?.fullPath)!=null?n:void 0);return Promise.resolve(o)}function hte(e){return El(this,null,function*(){return e.isDirectory?yk(e):pte(e)})}function yk(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function l(){t.readEntries(c=>El(this,null,function*(){if(c.length){const d=Promise.all(c.map(hte));o.push(d),l()}else try{const d=yield Promise.all(o);n(d)}catch(d){r(d)}}),c=>{r(c)})}l()})}function pte(e){return El(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Uc(r,e.fullPath);t(o)},r=>{n(r)})})})}function Iy(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",o=(e.type||"").toLowerCase(),l=o.replace(/\/.*$/,"");return n.some(c=>{const d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?l===d.replace(/\/.*$/,""):o===d})}return!0}var mte=Object.defineProperty,gte=Object.defineProperties,vte=Object.getOwnPropertyDescriptors,gR=Object.getOwnPropertySymbols,yte=Object.prototype.hasOwnProperty,xte=Object.prototype.propertyIsEnumerable,vR=(e,t,n)=>t in e?mte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bte=(e,t)=>{for(var n in t||(t={}))yte.call(t,n)&&vR(e,n,t[n]);if(gR)for(var n of gR(t))xte.call(t,n)&&vR(e,n,t[n]);return e},Ste=(e,t)=>gte(e,vte(t));const wte=typeof Iy=="function"?Iy:Iy.default,jte="file-invalid-type",Cte="file-too-large",Ete="file-too-small",Tte="too-many-files",Rte=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:jte,message:`File type must be ${n}`}},yR=e=>({code:Cte,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),xR=e=>({code:Ete,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),_te={code:Tte,message:"Too many files"};function xk(e,t){const n=e.type==="application/x-moz-file"||wte(e,t);return[n,n?null:Rte(t)]}function bk(e,t,n){if(qs(e.size))if(qs(t)&&qs(n)){if(e.size>n)return[!1,yR(n)];if(e.size<t)return[!1,xR(t)]}else{if(qs(t)&&e.size<t)return[!1,xR(t)];if(qs(n)&&e.size>n)return[!1,yR(n)]}return[!0,null]}function qs(e){return e!=null}function Dte({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:l,validator:c}){return!o&&e.length>1||o&&l>=1&&e.length>l?!1:e.every(d=>{const[f]=xk(d,t),[p]=bk(d,n,r),m=c?c(d):null;return f&&p&&!m})}function wp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function _h(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 bR(e){e.preventDefault()}function Ate(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Pte(e){return e.indexOf("Edge/")!==-1}function kte(e=window.navigator.userAgent){return Ate(e)||Pte(e)}function uo(...e){return(t,...n)=>e.some(r=>(!wp(t)&&r&&r(t,...n),wp(t)))}function Nte(){return"showOpenFilePicker"in window}function Ote(e){return qs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return Sk(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),o=!1),(!Array.isArray(r)||!r.every(wk))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>Ste(bte({},n),{[r]:o}),{})}]:e}function Mte(e){if(qs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>Sk(t)||wk(t)).join(",")}function Lte(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Ite(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Sk(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function wk(e){return/^.*\.[\w]+$/.test(e)}var zte=Object.defineProperty,$te=Object.defineProperties,Ute=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,jk=Object.prototype.hasOwnProperty,Ck=Object.prototype.propertyIsEnumerable,SR=(e,t,n)=>t in e?zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Cr=(e,t)=>{for(var n in t||(t={}))jk.call(t,n)&&SR(e,n,t[n]);if(jp)for(var n of jp(t))Ck.call(t,n)&&SR(e,n,t[n]);return e},Ja=(e,t)=>$te(e,Ute(t)),Cp=(e,t)=>{var n={};for(var r in e)jk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&jp)for(var r of jp(e))t.indexOf(r)<0&&Ck.call(e,r)&&(n[r]=e[r]);return n};const wS=v.forwardRef((e,t)=>{var n=e,{children:r}=n,o=Cp(n,["children"]);const l=Tk(o),{open:c}=l,d=Cp(l,["open"]);return v.useImperativeHandle(t,()=>({open:c}),[c]),Tn.createElement(v.Fragment,null,r(Ja(Cr({},d),{open:c})))});wS.displayName="Dropzone";const Ek={disabled:!1,getFilesFromEvent:ate,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};wS.defaultProps=Ek;wS.propTypes={children:nn.func,accept:nn.objectOf(nn.arrayOf(nn.string)),multiple:nn.bool,preventDropOnDocument:nn.bool,noClick:nn.bool,noKeyboard:nn.bool,noDrag:nn.bool,noDragEventsBubbling:nn.bool,minSize:nn.number,maxSize:nn.number,maxFiles:nn.number,disabled:nn.bool,getFilesFromEvent:nn.func,onFileDialogCancel:nn.func,onFileDialogOpen:nn.func,useFsAccessApi:nn.bool,autoFocus:nn.bool,onDragEnter:nn.func,onDragLeave:nn.func,onDragOver:nn.func,onDrop:nn.func,onDropAccepted:nn.func,onDropRejected:nn.func,onError:nn.func,validator:nn.func};const Ax={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function Tk(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:l,multiple:c,maxFiles:d,onDragEnter:f,onDragLeave:p,onDragOver:m,onDrop:g,onDropAccepted:x,onDropRejected:b,onFileDialogCancel:w,onFileDialogOpen:j,useFsAccessApi:C,autoFocus:T,preventDropOnDocument:E,noClick:R,noKeyboard:D,noDrag:P,noDragEventsBubbling:A,onError:k,validator:M}=Cr(Cr({},Ek),e),$=v.useMemo(()=>Mte(t),[t]),U=v.useMemo(()=>Ote(t),[t]),J=v.useMemo(()=>typeof j=="function"?j:wR,[j]),Z=v.useMemo(()=>typeof w=="function"?w:wR,[w]),Y=v.useRef(null),H=v.useRef(null),[Q,O]=v.useReducer(Bte,Ax),{isFocused:I,isFileDialogActive:z}=Q,F=v.useRef(typeof window<"u"&&window.isSecureContext&&C&&Nte()),K=()=>{!F.current&&z&&setTimeout(()=>{if(H.current){const{files:ge}=H.current;ge.length||(O({type:"closeDialog"}),Z())}},300)};v.useEffect(()=>(window.addEventListener("focus",K,!1),()=>{window.removeEventListener("focus",K,!1)}),[H,z,Z,F]);const L=v.useRef([]),q=ge=>{Y.current&&Y.current.contains(ge.target)||(ge.preventDefault(),L.current=[])};v.useEffect(()=>(E&&(document.addEventListener("dragover",bR,!1),document.addEventListener("drop",q,!1)),()=>{E&&(document.removeEventListener("dragover",bR),document.removeEventListener("drop",q))}),[Y,E]),v.useEffect(()=>(!n&&T&&Y.current&&Y.current.focus(),()=>{}),[Y,T,n]);const ie=v.useCallback(ge=>{k?k(ge):console.error(ge)},[k]),xe=v.useCallback(ge=>{ge.preventDefault(),ge.persist(),Ae(ge),L.current=[...L.current,ge.target],_h(ge)&&Promise.resolve(r(ge)).then(Se=>{if(wp(ge)&&!A)return;const He=Se.length,me=He>0&&Dte({files:Se,accept:$,minSize:l,maxSize:o,multiple:c,maxFiles:d,validator:M}),ze=He>0&&!me;O({isDragAccept:me,isDragReject:ze,isDragActive:!0,type:"setDraggedFiles"}),f&&f(ge)}).catch(Se=>ie(Se))},[r,f,ie,A,$,l,o,c,d,M]),ve=v.useCallback(ge=>{ge.preventDefault(),ge.persist(),Ae(ge);const Se=_h(ge);if(Se&&ge.dataTransfer)try{ge.dataTransfer.dropEffect="copy"}catch{}return Se&&m&&m(ge),!1},[m,A]),Ce=v.useCallback(ge=>{ge.preventDefault(),ge.persist(),Ae(ge);const Se=L.current.filter(me=>Y.current&&Y.current.contains(me)),He=Se.indexOf(ge.target);He!==-1&&Se.splice(He,1),L.current=Se,!(Se.length>0)&&(O({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),_h(ge)&&p&&p(ge))},[Y,p,A]),Oe=v.useCallback((ge,Se)=>{const He=[],me=[];ge.forEach(ze=>{const[Nt,Wt]=xk(ze,$),[jn,Qn]=bk(ze,l,o),Cn=M?M(ze):null;if(Nt&&jn&&!Cn)He.push(ze);else{let Ar=[Wt,Qn];Cn&&(Ar=Ar.concat(Cn)),me.push({file:ze,errors:Ar.filter(Jn=>Jn)})}}),(!c&&He.length>1||c&&d>=1&&He.length>d)&&(He.forEach(ze=>{me.push({file:ze,errors:[_te]})}),He.splice(0)),O({acceptedFiles:He,fileRejections:me,isDragReject:me.length>0,type:"setFiles"}),g&&g(He,me,Se),me.length>0&&b&&b(me,Se),He.length>0&&x&&x(He,Se)},[O,c,$,l,o,d,g,x,b,M]),Ee=v.useCallback(ge=>{ge.preventDefault(),ge.persist(),Ae(ge),L.current=[],_h(ge)&&Promise.resolve(r(ge)).then(Se=>{wp(ge)&&!A||Oe(Se,ge)}).catch(Se=>ie(Se)),O({type:"reset"})},[r,Oe,ie,A]),Ge=v.useCallback(()=>{if(F.current){O({type:"openDialog"}),J();const ge={multiple:c,types:U};window.showOpenFilePicker(ge).then(Se=>r(Se)).then(Se=>{Oe(Se,null),O({type:"closeDialog"})}).catch(Se=>{Lte(Se)?(Z(Se),O({type:"closeDialog"})):Ite(Se)?(F.current=!1,H.current?(H.current.value=null,H.current.click()):ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ie(Se)});return}H.current&&(O({type:"openDialog"}),J(),H.current.value=null,H.current.click())},[O,J,Z,C,Oe,ie,U,c]),it=v.useCallback(ge=>{!Y.current||!Y.current.isEqualNode(ge.target)||(ge.key===" "||ge.key==="Enter"||ge.keyCode===32||ge.keyCode===13)&&(ge.preventDefault(),Ge())},[Y,Ge]),St=v.useCallback(()=>{O({type:"focus"})},[]),kt=v.useCallback(()=>{O({type:"blur"})},[]),Mt=v.useCallback(()=>{R||(kte()?setTimeout(Ge,0):Ge())},[R,Ge]),ct=ge=>n?null:ge,bt=ge=>D?null:ct(ge),Qt=ge=>P?null:ct(ge),Ae=ge=>{A&&ge.stopPropagation()},De=v.useMemo(()=>(ge={})=>{var Se=ge,{refKey:He="ref",role:me,onKeyDown:ze,onFocus:Nt,onBlur:Wt,onClick:jn,onDragEnter:Qn,onDragOver:Cn,onDragLeave:Ar,onDrop:Jn}=Se,si=Cp(Se,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Cr(Cr({onKeyDown:bt(uo(ze,it)),onFocus:bt(uo(Nt,St)),onBlur:bt(uo(Wt,kt)),onClick:ct(uo(jn,Mt)),onDragEnter:Qt(uo(Qn,xe)),onDragOver:Qt(uo(Cn,ve)),onDragLeave:Qt(uo(Ar,Ce)),onDrop:Qt(uo(Jn,Ee)),role:typeof me=="string"&&me!==""?me:"presentation",[He]:Y},!n&&!D?{tabIndex:0}:{}),si)},[Y,it,St,kt,Mt,xe,ve,Ce,Ee,D,P,n]),Ze=v.useCallback(ge=>{ge.stopPropagation()},[]),_e=v.useMemo(()=>(ge={})=>{var Se=ge,{refKey:He="ref",onChange:me,onClick:ze}=Se,Nt=Cp(Se,["refKey","onChange","onClick"]);const Wt={accept:$,multiple:c,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:ct(uo(me,Ee)),onClick:ct(uo(ze,Ze)),tabIndex:-1,[He]:H};return Cr(Cr({},Wt),Nt)},[H,t,c,Ee,n]);return Ja(Cr({},Q),{isFocused:I&&!n,getRootProps:De,getInputProps:_e,rootRef:Y,inputRef:H,open:ct(Ge)})}function Bte(e,t){switch(t.type){case"focus":return Ja(Cr({},e),{isFocused:!0});case"blur":return Ja(Cr({},e),{isFocused:!1});case"openDialog":return Ja(Cr({},Ax),{isFileDialogActive:!0});case"closeDialog":return Ja(Cr({},e),{isFileDialogActive:!1});case"setDraggedFiles":return Ja(Cr({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Ja(Cr({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Cr({},Ax);default:return e}}function wR(){}const[Vte,Fte]=Rr("Dropzone component was not found in tree");function jS(e){const t=n=>{const{children:r,...o}=ae(`Dropzone${SC(e)}`,{},n),l=Fte(),c=fa(r)?r:a.jsx("span",{children:r});return l[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${SC(e)}`,t}const Hte=jS("accept"),qte=jS("reject"),Gte=jS("idle");var Sd={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const Qte={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},Wte=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const l=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":$t(t),"--dropzone-accept-color":l.color,"--dropzone-accept-bg":l.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},ys=be((e,t)=>{const n=ae("Dropzone",Qte,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:x,maxSize:b,accept:w,children:j,onDropAny:C,onDrop:T,onReject:E,openRef:R,name:D,maxFiles:P,autoFocus:A,activateOnClick:k,activateOnDrag:M,dragEventsBubbling:$,activateOnKeyboard:U,onDragEnter:J,onDragLeave:Z,onDragOver:Y,onFileDialogCancel:H,onFileDialogOpen:Q,preventDropOnDocument:O,useFsAccessApi:I,getFilesFromEvent:z,validator:F,rejectColor:K,acceptColor:L,enablePointerEvents:q,loaderProps:ie,inputProps:xe,mod:ve,...Ce}=n,Oe=$e({name:"Dropzone",classes:Sd,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:Wte}),{getRootProps:Ee,getInputProps:Ge,isDragAccept:it,isDragReject:St,isDragActive:kt,open:Mt}=Tk({onDrop:C,onDropAccepted:T,onDropRejected:E,disabled:m||g,accept:Array.isArray(w)?w.reduce((Ae,De)=>({...Ae,[De]:[]}),{}):w,multiple:x,maxSize:b,maxFiles:P,autoFocus:A,noClick:!k,noDrag:!M,noDragEventsBubbling:!$,noKeyboard:!U,onDragEnter:J,onDragLeave:Z,onDragOver:Y,onFileDialogCancel:H,onFileDialogOpen:Q,preventDropOnDocument:O,useFsAccessApi:I,validator:F,...z?{getFilesFromEvent:z}:null});sd(R,Mt);const ct=kt&&it,bt=kt&&St,Qt=!ct&&!bt;return a.jsx(Vte,{value:{accept:ct,reject:bt,idle:Qt},children:a.jsxs(ce,{...Ee(),...Oe("root",{focusable:!0}),...Ce,mod:[{accept:ct,reject:bt,idle:Qt,disabled:m,loading:g,"activate-on-click":k},ve],children:[a.jsx(qp,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:ie}),a.jsx("input",{...Ge(xe),name:D}),a.jsx("div",{...Oe("inner"),ref:t,"data-enable-pointer-events":q||void 0,children:j})]})})});ys.classes=Sd;ys.displayName="@mantine/dropzone/Dropzone";ys.Accept=Hte;ys.Idle=Gte;ys.Reject=qte;const Yte={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:oi("max"),withinPortal:!0},CS=be((e,t)=>{const n=ae("DropzoneFullScreen",Yte,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:x,withinPortal:b,portalProps:w,...j}=n,C=$e({name:"DropzoneFullScreen",classes:Sd,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,rootSelector:"fullScreen"}),{resolvedClassNames:T,resolvedStyles:E}=fl({classNames:r,styles:c,props:n}),[R,D]=v.useState(0),[P,{open:A,close:k}]=wd(!1),M=U=>{U.dataTransfer?.types.includes("Files")&&(D(J=>J+1),A())},$=()=>{D(U=>U-1)};return v.useEffect(()=>{R===0&&k()},[R]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",M,!1),document.addEventListener("dragleave",$,!1),()=>{document.removeEventListener("dragenter",M,!1),document.removeEventListener("dragleave",$,!1)}},[p]),a.jsx(fs,{...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(ys,{...j,classNames:T,styles:E,unstyled:d,className:Sd.dropzone,onDrop:U=>{m?.(U),k(),D(0)},onReject:U=>{g?.(U),k(),D(0)}})})})});CS.classes=Sd;CS.displayName="@mantine/dropzone/DropzoneFullScreen";ys.FullScreen=CS;const Dh=ys,Kte='{"resourceType": "Bundle"}';function zy({id:e,title:t,message:n,color:r,icon:o,withCloseButton:l=!1,method:c="show",loading:d}){Ci[c]({id:e,loading:d,title:t,message:n,color:r,icon:o,withCloseButton:l,autoClose:!1})}function Xte(){const e=Sn(),t=Re(),[n,r]=v.useState({}),o=v.useCallback(async(d,f)=>{const p="batch-upload";zy({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=mA(m));const g=await t.executeBatch(m);r(x=>({...x,[f]:g})),zy({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(Po,{size:"1rem"}),withCloseButton:!0})}catch(m){zy({id:p,title:"Batch Upload Failed",color:"red",message:Ye(m),method:"update",icon:a.jsx(sl,{size:"1rem"}),withCloseButton:!0})}},[t]),l=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>o(m.target?.result,f.name),p.readAsText(f)}},[o]),c=v.useCallback(async d=>{await o(d.input,"JSON Data")},[o]);return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Batch Create"}),a.jsxs(Te,{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(Tt,{defaultValue:"upload",children:[a.jsxs(Tt.List,{children:[a.jsx(Tt.Tab,{value:"upload",children:"File Upload"}),a.jsx(Tt.Tab,{value:"json",children:"JSON"})]}),a.jsx(Tt.Panel,{value:"upload",pt:"xs",children:a.jsx(Dh,{onDrop:l,accept:["application/json"],children:a.jsxs(ye,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(Dh.Accept,{children:a.jsx(fT,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(Dh.Reject,{children:a.jsx(sl,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(Dh.Idle,{children:a.jsx(fT,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(Te,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(Te,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(Tt.Panel,{value:"json",pt:"xs",children:a.jsxs(ut,{onSubmit:c,children:[a.jsx(Wc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:Kte,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(Tt,{defaultValue:Object.keys(n)[0],children:[a.jsx(Tt.List,{children:Object.keys(n).map(d=>a.jsx(Tt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(Tt.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 Zte(){const{resourceType:e}=Ut(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=$c("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(lt,{children:[a.jsxs(Ie,{children:["No apps for ",e]}),a.jsx(mt,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(lt,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(mt,{to:`/forms/${o.id}?subject=`+n.map(l=>`${e}/${l}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Di,{})}function Jte(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(lt,{width:450,children:a.jsxs(ut,{onSubmit:l=>{n(void 0),e.post("auth/changepassword",l).then(()=>o(!0)).catch(c=>n(qt(c)))},children:[a.jsxs(ar,{style:{flexDirection:"column"},children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Change password"})]}),!r&&a.jsxs(Be,{gap:"xl",mt:"xl",children:[a.jsx(Qi,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:At(t,"oldPassword")}),a.jsx(Qi,{name:"newPassword",label:"New password",required:!0,error:At(t,"newPassword")}),a.jsx(Qi,{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 Px=["Form","JSON","Profiles"],ene=["Profiles"],$y=Px[0].toLowerCase();function tne(){const e=wn(),t=Sn(),{resourceType:n}=Ut(),[r,o]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&Px.map(d=>d.toLowerCase()).includes(c)?c:$y});function l(c){c||(c=$y),o(c),e(`/${n}/new/${c}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(Tr,{children:[a.jsxs(Te,{p:"md",fw:500,children:["New ",n]}),a.jsx(ai,{children:a.jsx(Tt,{defaultValue:$y,value:r,onChange:l,children:a.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Px.map(c=>a.jsx(Tt.Tab,{value:c.toLowerCase(),px:"md",children:ene.includes(c)?a.jsxs(ye,{gap:"xs",wrap:"nowrap",children:[c,a.jsx(Hp,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),a.jsx(gS,{})]})}function nne(){return a.jsx(lt,{children:a.jsxs(Be,{children:[a.jsx(Ie,{order:1,children:"Unexpected Error"}),a.jsx(Te,{children:"We're sorry, something went wrong."}),a.jsxs(Te,{children:["Please contact ",a.jsx(Dt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function Rk(e){const t=Gt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(mt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,d){c&&d&&n.push({key:c,value:d})}function o(c){c&&r(c.system,c.value)}function l(c,d){Array.isArray(d)?d.forEach(f=>l(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=da(t);c!==_t(t)&&r("Name",c)}return"category"in t&&l("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&l("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),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 rne(){const{id:e}=Ut(),t=Gr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=Re(),[l,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 R={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const D=r.split(",").filter(P=>!!P);D.length===1&&R.entry.push({request:{method:"GET",url:D[0]}}),m(D)}o.executeBatch(R).then(D=>{D.entry?.[0]?.response?.status!=="200"?w(D.entry?.[0]?.response?.outcome):(f(D.entry[0]?.resource),x(D.entry[1]?.resource)),c(!1)}).catch(D=>{w(D),c(!1)})},[o,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(mt,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(R=>a.jsx("li",{children:a.jsx(mt,{to:R,children:_t(R)})},R.id))})]}),g&&a.jsx("li",{children:a.jsxs(mt,{to:g,children:["Back to ",da(g)]})}),a.jsx("li",{children:a.jsx(mt,{to:"/",children:"Go back home"})})]})]});if(l||!d)return a.jsx(Di,{});const T=g&&bS(g);return a.jsxs(a.Fragment,{children:[a.jsxs(Tr,{shadow:"xs",radius:0,children:[T&&a.jsx(AP,{patient:T}),g&&g.resourceType!=="Patient"&&a.jsx(Rk,{resource:g}),a.jsx(ce,{px:"xl",py:"md",children:a.jsxs(Te,{children:[da(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(lt,{children:a.jsx(UP,{questionnaire:d,subject:g&&Ht(g),onSubmit:E})})]});async function E(R){const D=[];if(!p||p.length===0)D.push(await o.createResource(R));else for(const P of p)D.push(await o.createResource({...R,subject:{reference:P}}));C(D)}}const ine="_paper_unw9o_1",one={paper:ine},ane={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function _k(e,t){const n=e.resourceType||sne(t),r=e.fields??lne(n),o=e.filters??(e.resourceType?void 0:cne(n)),l=e.sortRules??une(n),c=e.offset??0,d=e.count??pm;return{...e,resourceType:n,fields:r,filters:o,sortRules:l,offset:c,count:d}}function sne(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function lne(e){const t=ES(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 cne(e){return ES(e)?.filters}function une(e){const t=ES(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function ES(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function dne(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function fne(e,t){const n={...e,count:1e3,offset:0},r=_k(n,t.getUserConfiguration()),o=await t.search(r.resourceType,is({...r,total:"accurate",fields:void 0}));return mA(o)}function jR(){const e=Re(),t=wn(),n=Gr(),[r,o]=v.useState();return v.useEffect(()=>{const l=uA(n.pathname+n.search),c=_k(l,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===is(c)?(dne(c),o(c)):t(`/${c.resourceType}${is(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(Di,{}):a.jsx(Tr,{shadow:"xs",m:"md",p:"xs",className:one.paper,children:a.jsx(nu,{checkboxesEnabled:!0,search:r,onClick:l=>t(`/${l.resource.resourceType}/${l.resource.id}`)?.catch(console.error),onAuxClick:l=>window.open(`/${l.resource.resourceType}/${l.resource.id}`,"_blank"),onChange:l=>{t(`/${r.resourceType}${is(l.definition)}`)?.catch(console.error)},onNew:()=>{t(ane[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const l=e.fhirUrl(r.resourceType,"$csv")+is(r);e.download(l).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>Ne({color:"red",message:Ye(c),autoClose:!1}))},onExportTransactionBundle:async()=>{fne(r,e).then(l=>qA(JSON.stringify(l,void 0,2))).catch(l=>Ne({color:"red",message:Ye(l),autoClose:!1}))},onDelete:l=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:l.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>o({...r})).catch(c=>Ne({color:"red",message:Ye(c),autoClose:!1})))},onBulk:l=>{t(`/bulk/${r.resourceType}?ids=${l.join(",")}`)?.catch(console.error)}})})}function hne(){const[e]=$c("ObservationDefinition","_count=100");return e?a.jsxs(fe,{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(bo,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(bo,{value:t.code})}),a.jsx("td",{children:a.jsx(bo,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(kx,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(Di,{})}function kx(e){const{ranges:t}=e;if(!t)return null;const n=CR(t.map(o=>o.gender));if(n.length>1)return Ic(n),a.jsx(a.Fragment,{children:n.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:$n(o)})}),a.jsx(kx,{ranges:e.ranges?.filter(l=>l.gender===o)})]},o))});const r=CR(t.map(o=>o.age&&md(o.age)));return r.length>1?(Ic(r),a.jsx(a.Fragment,{children:r.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:$n(o)})}),a.jsx(kx,{ranges:e.ranges?.filter(l=>md(l.age)===o)})]},o))})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(Wb,{value:o.range})})]})})},`range-${o.condition}`))})}function CR(e){return[...new Set(e.filter(t=>!!t))]}function pne(){const[e]=$c("ActivityDefinition","_count=100"),[t]=$c("ObservationDefinition","_count=100");return!e||!t?a.jsx(Di,{}):a.jsxs(fe,{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(bo,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(bo,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function mne(){const e=Re(),[t,n]=v.useState(),[r,o]=v.useState(void 0),[l,c]=v.useState(!1),d=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),o(m.enrolled)}).catch(m=>Ne({color:"red",message:Ye(m),autoClose:!1}))},[e]);v.useEffect(()=>{d()},[d]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{o(!0),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Ye(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(Un,{title:"Disable MFA",opened:l,onClose:()=>c(!1),children:a.jsx(up,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),o(!1),Ne({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(PH,{})}),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.jsx(up,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const gne={},Nx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:gne?.MEDPLUM_AWS_TEXTRACT_ENABLED};function ef(){return Nx}function Dk(){return Ak("registerEnabled")}function vne(){return Ak("awsTextractEnabled")}function Ak(e){try{return Nx[e]!==!1&&Nx[e]!=="false"}catch{return!0}}function yne(){const e=wn(),[t]=xS(),n=Re(),r=t.get("scope")||"openid",[o,l]=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}`);l(x)}catch(x){Ne({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ye(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),Xn.assign(x.toString())}return a.jsx(rP,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:ef().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:[o?.logo?.url?a.jsx("img",{src:o?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx(Mi,{size:32}),a.jsx(Ie,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function xne(){const e=Re(),t=wn(),n=ef();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),Dk()?a.jsxs(pQ,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Create a new account"})]}):a.jsx(lt,{width:450,children:a.jsx(ya,{icon:a.jsx(bl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function bne(){const e=wn(),t=Re(),[n,r]=v.useState(),[o,l]=v.useState(!1),c=ef().recaptchaSiteKey;return v.useEffect(()=>{tP(c)},[c]),a.jsx(lt,{width:450,children:a.jsxs(ut,{onSubmit:async d=>{let f="";f=await nP(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>l(!0)).catch(p=>r(qt(p)))},children:[a.jsxs(Be,{gap:"lg",mb:"xl",align:"center",children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Password Reset"})]}),a.jsxs(Be,{gap:"xl",children:[a.jsx(yr,{issues:tu(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(Ve,{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"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function Sne(e){const t=Re(),[n,r]=v.useState(),[o,l]=v.useState();return o?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(mt,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(mt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(ut,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n?.reference}]}).then(l).catch(console.log)},children:a.jsxs(Be,{children:[a.jsxs(Ie,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(Te,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(Te,{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(bo,{value:c.code[0]})]},`action-${d}`))}),a.jsx(Pt,{title:"Subject",children:a.jsx(os,{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 wne(){const{resourceType:e,id:t}=Ut(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{children:a.jsx(Sne,{planDefinition:n})}):null}function jne(){const{resourceType:e,id:t}=Ut(),n=Gt({reference:e+"/"+t}),[r,o]=$c("Questionnaire","subject-type="+e),[l,c]=$c("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(Di,{});const d=l?.filter(m=>Cne(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=Ht(n):n.resourceType==="Encounter"&&(f=n.subject,p=Ht(n)),a.jsxs(lt,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(Ie,{order:3,children:a.jsx(mt,{to:`/forms/${m.id}?subject=${_t(n)}`,children:m.title||m.name})}),a.jsx(Te,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(Ie,{order:3,children:a.jsx(lZ,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(Te,{children:m.description})]},m.id))]})}function Cne(e){return e==="Patient"||e==="Encounter"}function Ene(){const{resourceType:e,id:t}=Ut(),n=wn(),[r,o]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(lt,{children:a.jsx(nu,{search:r,onClick:l=>n(`/${l.resource.resourceType}/${l.resource.id}`)?.catch(console.error),onChange:l=>o(l.definition),hideFilters:!0})})}function Tne(){const e=Re(),{resourceType:t,id:n}=Ut(),r=e.readHistory(t,n).read();return a.jsx(kd,{maw:1200,children:a.jsx(Sl,{children:a.jsx(XX,{history:r})})})}const Rne="_hl7Input_k5xm3_1",_ne={hl7Input:Rne};function Dne(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 Ane(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=>{id(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Pne=`{
597
- "resourceType": "Patient",
598
- "name": [
599
- {
600
- "given": [
601
- "Alice"
602
- ],
603
- "family": "Smith"
604
- }
605
- ]
606
- }`,kne="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 Nne(){const e=Re(),{id:t}=Ut(),[n,r]=v.useState(),[o,l]=v.useState(),[c,d]=v.useState(Pne),[f,p]=v.useState(kne),[m,g]=v.useState(ln.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),l(await One(e,A))}).catch(A=>Ne({color:"red",message:Ye(A),autoClose:!1}))},[e,t]);const C=v.useCallback(async()=>id(x.current,{command:"getValue"}),[]),T=v.useCallback(async()=>id(x.current,{command:"getOutput"}),[]),E=v.useCallback(async()=>m===ln.FHIR_JSON?JSON.parse(c):f,[m,c,f]),R=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const k=await C(),M=await T(),$=await e.createAttachment({data:k,filename:"index.ts",contentType:"text/typescript"}),U=await e.createAttachment({data:M,filename:"index.js",contentType:"text/typescript"}),J=[{op:"add",path:"/sourceCode",value:$},{op:"add",path:"/executableCode",value:U}];await e.patchResource("Bot",t,J),Ne({color:"green",message:"Saved"})}catch(k){Ne({color:"red",message:Ye(k),autoClose:!1})}finally{j(!1)}},[e,t,C,T]),D=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(k){Ne({color:"red",message:Ye(k),autoClose:!1})}finally{j(!1)}},[e,t]),P=v.useCallback(async A=>{A.preventDefault(),A.stopPropagation(),j(!0);try{const k=await E(),M=await e.post(e.fhirUrl("Bot",t,"$execute"),k,m);await id(b.current,{command:"setValue",value:M}),Ne({color:"green",message:"Success"})}catch(k){Ne({color:"red",message:Ye(k),autoClose:!1})}finally{j(!1)}},[e,t,E,m]);return!n||o===void 0?null:a.jsxs(hr,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(hr.Col,{span:8,children:a.jsxs(Tr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Ane,{iframeRef:x,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),a.jsxs(ye,{justify:"flex-end",gap:"xs",children:[a.jsx(ke,{type:"button",onClick:R,loading:w,leftSection:a.jsx(FH,{size:"1rem"}),children:"Save"}),a.jsx(ke,{type:"button",onClick:D,loading:w,leftSection:a.jsx($b,{size:"1rem"}),children:"Deploy"}),a.jsx(ke,{type:"button",onClick:P,loading:w,leftSection:a.jsx(Aq,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(hr.Col,{span:4,children:[a.jsxs(Tr,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(on,{data:[{label:"FHIR",value:ln.FHIR_JSON},{label:"HL7",value:ln.HL7_V2}],onChange:A=>g(A.currentTarget.value)}),m===ln.FHIR_JSON?a.jsx(Wc,{value:c,onChange:A=>d(A),autosize:!0,minRows:15}):a.jsx("textarea",{className:_ne.hl7Input,value:f,onChange:A=>p(A.currentTarget.value),rows:15})]}),a.jsx(Tr,{m:2,p:"xs",shadow:"md",children:a.jsx(Dne,{iframeRef:b,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function One(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(KD);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function Tl(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Mne(){const e=Re(),{resourceType:t,id:n}=Ut(),r={reference:t+"/"+n},o=v.useCallback(l=>{e.updateResource(Tl(l)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Ye(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(lt,{children:a.jsx(PK,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(lt,{children:a.jsx(oX,{questionnaire:r,onSubmit:o})});default:return null}}function Lne(){const{resourceType:e,id:t}=Ut(),n=Gt({reference:e+"/"+t}),r=wn();return n?a.jsx(lt,{children:a.jsx(NX,{value:n,onStart:(o,l)=>r(`/forms/${rl(l)}`)?.catch(console.error),onEdit:(o,l,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function Ine(){const e=Re(),{resourceType:t,id:n}=Ut(),r=wn();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(o=>Ne({color:"red",message:Ye(o),autoClose:!1}))},children:"Delete"})]})}const zne="_selectProfileBtn_tbaz6_1",$ne="_chevron_tbaz6_13",ER={selectProfileBtn:zne,chevron:$ne};function Une(){const{resourceType:e,id:t}=Ut(),n=Gt({reference:e+"/"+t}),[r,o]=v.useState(),l=gl({onDropdownClose:()=>l.resetSelectedOption()}),c=v.useMemo(()=>{if(Rn(n?.meta?.profile))return[a.jsx(Xe.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(Xe.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&o(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return Rn(c)&&(d=a.jsx(ye,{justify:"flex-end",children:a.jsxs(Be,{align:"flex-end",gap:"xs",children:[a.jsxs(Xe,{store:l,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{o(f),l.closeDropdown()},children:[a.jsx(Xe.Target,{children:a.jsx(sr,{onClick:()=>l.toggleDropdown(),children:a.jsxs(Pd,{fw:"bold",fs:"sm",className:ER.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(zb,{stroke:1.5,className:ER.chevron})]})})}),a.jsx(Xe.Dropdown,{w:"max-content",children:a.jsx(Xe.Options,{children:c})})]}),a.jsx(ce,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(Te,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(Te,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(Te,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(lt,{children:a.jsxs(Be,{gap:"xl",children:[d,a.jsx(tS,{value:n,profileUrl:r})]})})}function Bne(){const e=Re(),{resourceType:t,id:n}=Ut(),[r,o]=v.useState(),[l,c]=v.useState(),d=wn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{o(ii(b)),c(ii(b))}).catch(b=>{p(qt(b)),Ne({color:"red",message:Ye(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(Tl(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),Ne({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(qt(w)),Ne({color:"red",message:Ye(w),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const w=bP.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(qt(j)),Ne({color:"red",message:Ye(j),autoClose:!1})})},[e,t,n,r,d]),x=v.useCallback(()=>d(`/${t}/${n}/delete`)?.catch(console.error),[d,t,n]);return l?a.jsx(lt,{children:a.jsx(vp,{defaultValue:l,onSubmit:m,onPatch:g,onDelete:x,outcome:f})}):null}function Vne(){const{resourceType:e,id:t}=Ut(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{maw:700,children:n.resourceType==="Patient"?a.jsx(EK,{patient:n}):a.jsx(ya,{icon:a.jsx(bl,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function Pk({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=Re(),[l,c]=v.useState();return v.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(GQ))}).catch(console.error)},[o,n,r]),a.jsx(Tt,{value:t?.url,onChange:d=>{const f=l?.find(p=>p.url===d);f&&n(f)},children:a.jsx(Tt.List,{children:l?.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(Tt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(pb,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(lG,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function kk(e,t){const n=Re(),r=wn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(qt(d)),Ne({color:"red",message:Ye(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Uy(){const{resourceType:e}=Ut(),t=Gr(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:l}=kk(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=Tl(m);c&&tA(g,c.url),l(g)},[c,l]);return f?a.jsx(lt,{children:a.jsxs(Be,{children:[a.jsx(Pk,{resource:o,currentProfile:c,onChange:d}),c?a.jsx(vp,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(Te,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(lt,{children:a.jsx(vp,{defaultValue:o,onSubmit:l,outcome:n})})}function TR(){const e=Re(),{resourceType:t,id:n}=Ut(),r=e.readHistory(t,n).read();return a.jsx(lt,{children:a.jsx(iZ,{history:r})})}function Fne(){const{resourceType:e}=Ut(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=kk(e,n),l=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(lt,{children:[t&&a.jsx(yr,{outcome:t}),a.jsxs(ut,{onSubmit:l,children:[a.jsx(Wc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:Ki(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 Hne(){const e=Re(),{resourceType:t,id:n}=Ut(),r=Gt({reference:t+"/"+n}),o=wn(),[l,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(Tl(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),Ne({color:"green",message:"Success"})}).catch(p=>{Ne({color:"red",message:Ye(p),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(lt,{children:[l&&a.jsx(yr,{outcome:l}),a.jsxs(ut,{onSubmit:d,children:[a.jsx(Wc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:Ki(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 qne(){const{resourceType:e,id:t}=Ut();return Gt({reference:e+"/"+t})?a.jsxs(lt,{children:[a.jsxs(ya,{icon:a.jsx(bl,{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(UP,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Gne(){const e=Re(),{resourceType:t,id:n}=Ut(),[r,o]=v.useState(),[l,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>o(ii(d))).catch(d=>{Ne({color:"red",message:Ye(d)})})},[e,t,n]),r?a.jsxs(lt,{children:[a.jsxs(Ie,{order:2,children:["Available ",t," profiles"]}),a.jsx(Be,{children:a.jsxs(a.Fragment,{children:[a.jsx(Pk,{resource:r,currentProfile:l,onChange:c}),l?a.jsx(Qne,{profile:l,resource:r,onResourceUpdated:d=>o(d)},l.url):a.jsx(Te,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const Qne=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Re(),[o,l]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{l(void 0);const m=Tl(p);c?tA(m,e.url):FU(m,e.url),r.updateResource(m).then(g=>{n(g),Ne({color:"green",message:"Success"})}).catch(g=>{l(qt(g)),Ne({color:"red",message:Ye(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Be,{children:[a.jsx(zd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(vp,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):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"})})})]})},Nk={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Wne=Object.keys(Nk);function Yne(){const e=Re(),{id:t}=Ut(),n=Gt({reference:`Questionnaire/${t}`}),[r,o]=v.useState(),[l,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>Kne(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},${_t(n)}`:_t(n)}`,channel:{type:"rest-hook",endpoint:_t(r)},...l?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:l}]}:void 0}).then(()=>{o(void 0),f(Date.now()),e.invalidateSearches("Subscription"),Ne({color:"green",message:"Success"})}).catch(g=>Ne({color:"red",message:Ye(g),autoClose:!1}))}return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Bots"}),a.jsxs(Be,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(jl,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(pn,{}),a.jsxs(Be,{mt:10,children:[a.jsx(Ed,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(ye,{children:[a.jsx(wl,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(ke,{onClick:m,children:"Connect"})]}),a.jsx(ye,{children:a.jsx(on,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Wne,onChange:g=>c(Nk[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function Kne(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(_t(t))||(t.url?n.includes(t.url):!1))}function Xne(){const{id:e}=Ut(),t=wn(),r=Re().readReference({reference:`Questionnaire/${e}`}).read(),[o,l]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:de.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return a.jsx(lt,{children:a.jsx(nu,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>l(c.definition),hideFilters:!0,hideToolbar:!0})})}function Zne(){const e=Re(),{resourceType:t,id:n}=Ut(),r=Gt({reference:t+"/"+n}),o=v.useCallback(l=>{e.updateResource(Tl(l)).then(()=>{Ne({color:"green",message:"Success"})}).catch(c=>{Ne({color:"red",message:Ye(c),autoClose:!1})})},[e]);return r?a.jsx(lt,{children:a.jsx(EX,{onSubmit:o,definition:r})}):null}function Jne(){const{resourceType:e,id:t}=Ut(),n=Gt({reference:e+"/"+t});return n?a.jsx(lt,{children:e==="MeasureReport"?a.jsx(jK,{measureReport:n}):a.jsx(eS,{value:n})}):null}const ere="_container_1ue98_1",tre="_entry_1ue98_14",nre="_active_1ue98_21",By={container:ere,entry:tre,active:nre};function rre(e){const t=Re(),n=Gt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const l=bS(n);if(!l)return;const c="reference"in l?l.reference:_t(l);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);SP(p),p.reverse(),o(p)}).catch(d=>Ne({color:"red",message:Ye(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:By.container,children:r.map(l=>a.jsxs("div",{className:Ot(By.entry,{[By.active]:l.id===n?.id}),children:[a.jsx("p",{children:a.jsx(mt,{to:l,children:ire(l)})}),l.category?.[0]?.text&&a.jsx("p",{children:l.category[0]?.text}),l.code?.coding?.[0]?.code&&a.jsx("p",{children:l.code.coding[0]?.code}),a.jsx("p",{children:ore(l)})]},l.id))}):null}function ire(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function ore(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const are="_container_1l2dh_1",sre={container:are};function lre(e){const t=Gt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(o=>o.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:sre.container,children:a.jsx(on,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function cre(e){const t=Gt(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:mr(t.collection?.collectedDateTime)})]}),a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Age"}),a.jsx(ht.Value,{children:ure(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(ht.Entry,{children:[a.jsx(ht.Key,{children:"Specimen Stability"}),a.jsx(ht.Value,{children:dre(t)})]}):a.jsx(a.Fragment,{})]}):null}function ure(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return Ok(Mk(n,new Date))}function dre(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return Ok(Mk(t,n))}function Ok(e){return e.toString().padStart(3,"0")+"D"}function Mk(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function fre(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 hre(){const e=Re(),{resourceType:t,id:n}=Ut(),r={reference:t+"/"+n},o=wn(),[l,c]=v.useState(),d=Gt(r,c),f=fre(t),[p,m]=v.useState(()=>{const E=window.location.pathname.split("/").pop();return E&&f.map(R=>R.toLowerCase()).includes(E)?E:f[0].toLowerCase()});async function g(){const R=(await e.readHistory(t,n)).entry?.find(D=>!!D.resource)?.resource;R?x(R):Ne({color:"red",message:"No history to restore",autoClose:!1})}function x(E){e.updateResource(Tl(E)).then(()=>{c(void 0),Ne({color:"green",message:"Success"})}).catch(R=>{Ne({color:"red",message:Ye(R),autoClose:!1})})}if(l)return Z$(l)?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(yr,{outcome:l});function b(E){E||(E=f[0].toLowerCase()),m(E),o(`/${t}/${n}/${E}`)?.catch(console.error)}function w(E){const R=d,D=R.orderDetail||[];D.length===0&&D.push({}),D[0].text!==E&&(D[0].text=E,x({...R,orderDetail:D}))}const j=d&&bS(d),C=d&&Tee(d),T=e.getUserConfiguration()?.option?.find(E=>E.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[d?.resourceType==="ServiceRequest"&&T&&a.jsx(lre,{valueSet:{reference:T},defaultValue:d.orderDetail?.[0]?.text,onChange:w},_t(d)+"-"+d.orderDetail?.[0]?.text),d&&a.jsx(rre,{value:d}),d&&a.jsxs(Tr,{children:[j&&a.jsx(AP,{patient:j}),C&&a.jsx(cre,{specimen:C}),t!=="Patient"&&a.jsx(Rk,{resource:r}),a.jsx(ai,{children:a.jsx(Tt,{value:p.toLowerCase(),onChange:b,children:a.jsx(Tt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(E=>a.jsx(Tt.Tab,{value:E.toLowerCase(),children:E},E))})})})]}),a.jsx(gS,{})]})}function Ah(){const e=wn(),{resourceType:t,id:n,versionId:r,tab:o}=Ut(),l=Re(),[c,d]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),d(!0),l.readHistory(t,n).then(R=>p(R)).then(()=>d(!1)).catch(R=>{g(R),d(!1)})},[l,t,n]),c)return a.jsx(Di,{});const x=f?.entry??[],b=x.findIndex(R=>R.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(lt,{children:[a.jsx(Ie,{children:"Version not found"}),a.jsx(mt,{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",T=o||C,E=x.length-b;return a.jsx(kd,{maw:1200,children:a.jsx(Sl,{children:a.jsxs(Be,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(lm,{cols:2,mb:"lg",children:[a.jsx(Oi,{total:x.length,value:E,getControlProps:TP,onChange:R=>e(`/${t}/${n}/_history/${x[x.length-R]?.resource?.meta?.versionId}/${T}`)?.catch(console.error)}),a.jsx(ye,{justify:"right",children:a.jsx(Id,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:T,onChange:R=>e(`/${t}/${n}/_history/${r}/${R||C}`)?.catch(console.error)})})]}),a.jsx(ce,{mb:"lg",children:a.jsxs(Cm,{compact:!0,children:[a.jsx(Ti,{term:"Version ID",children:w.meta?.versionId}),a.jsx(Ti,{term:"Author",children:a.jsx(Tc,{value:w.meta?.author,link:!0},w.meta?.author?.reference)}),a.jsx(Ti,{term:"Date/Time",children:mr(w.meta?.lastUpdated)})]})}),T==="diff"&&a.jsx(eZ,{original:j??{resourceType:t,id:n},revised:w}),T==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(w,void 0,2)})]})})})}function pre(){const{resourceType:e,id:t}=Ut(),n=wn(),[r,o]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:de.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(lt,{children:a.jsx(sK,{search:r,onClick:l=>n(`/${l.resource.resourceType}/${l.resource.id}`)?.catch(console.error),onChange:l=>o(l.definition),hideFilters:!0})})}function mre(e){const t=Re(),{resource:n,opened:r,onClose:o}=e,[l,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:l&&d?_t(d):void 0,verbose:p}),Ne({color:"green",message:"Done"}),o()}catch(x){Ne({color:"red",message:Ye(x),autoClose:!1})}},[t,n,o,l,d,p]);return a.jsx(Un,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(ut,{onSubmit:g,children:a.jsxs(Be,{children:[a.jsx(Pn,{label:"Choose subscription (all subscriptions by default)",onChange:x=>c(x.currentTarget.checked)}),l&&a.jsx(wl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(Pn,{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=Re(),t=bm(),{resourceType:n,id:r}=Ut(),o={reference:n+"/"+r},[l,c]=v.useState(),d=wd(!1);function f(E,R){return e.updateResource({...E,priority:R})}function p(E,R){f(E,"stat").then(R).catch(console.error)}function m(E,R){f(E,"routine").then(R).catch(console.error)}function g(E){t(`/${E.resourceType}/${E.id}`)}function x(E){t(`/${E.resourceType}/${E.id}/edit`)}function b(E){t(`/${E.resourceType}/${E.id}/delete`)}function w(E){c(E),d[1].open()}function j(E){t(`/${E.resourceType}/${E.id}/_history/${E.meta?.versionId}`)}function C(E,R){const D="aws-textract";Ne({id:D,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(E.resourceType,E.id,"$aws-textract"),{}).then(()=>{R(),Qs({id:D,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(Po,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(P=>Qs({id:D,title:"AWS Textract Error",color:"red",message:Ye(P),icon:a.jsx(sl,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(E){const{primaryResource:R,currentResource:D,reloadTimeline:P}=E,A=D.resourceType===R.resourceType&&D.id===R.id,k=D.resourceType==="Communication"&&D.priority!=="stat",M=D.resourceType==="Communication"&&D.priority==="stat",$=A,U=!A,J=!A,Z=!A,Y=e.getProjectMembership()?.admin,H=Y,Q=vne()&&(D.resourceType==="DocumentReference"||D.resourceType==="Media");return a.jsxs(je.Dropdown,{children:[a.jsx(je.Label,{children:"Resource"}),k&&a.jsx(je.Item,{leftSection:a.jsx(Tq,{size:14}),onClick:()=>p(D,P),"aria-label":`Pin ${_t(D)}`,children:"Pin"}),M&&a.jsx(je.Item,{leftSection:a.jsx(_q,{size:14}),onClick:()=>m(D,P),"aria-label":`Unpin ${_t(D)}`,children:"Unpin"}),U&&a.jsx(je.Item,{leftSection:a.jsx(dT,{size:14}),onClick:()=>g(D),"aria-label":`Details ${_t(D)}`,children:"Details"}),$&&a.jsx(je.Item,{leftSection:a.jsx(dT,{size:14}),onClick:()=>j(D),"aria-label":`Details ${_t(D)}`,children:"Details"}),J&&a.jsx(je.Item,{leftSection:a.jsx(IA,{size:14}),onClick:()=>x(D),"aria-label":`Edit ${_t(D)}`,children:"Edit"}),Y&&a.jsxs(a.Fragment,{children:[a.jsx(je.Divider,{}),a.jsx(je.Label,{children:"Admin"}),H&&a.jsx(je.Item,{leftSection:a.jsx(Lq,{size:14}),onClick:()=>w(D),"aria-label":`Resend Subscriptions ${_t(D)}`,children:"Resend Subscriptions"})]}),Q&&a.jsxs(a.Fragment,{children:[a.jsx(je.Divider,{}),a.jsx(je.Label,{children:"AWS AI"}),a.jsx(je.Item,{leftSection:a.jsx(tG,{size:14}),onClick:()=>C(D,P),"aria-label":`AWS Textract ${_t(D)}`,children:"AWS Textract"})]}),Z&&a.jsxs(a.Fragment,{children:[a.jsx(je.Divider,{}),a.jsx(je.Label,{children:"Danger zone"}),a.jsx(je.Item,{color:"red",leftSection:a.jsx(wm,{size:14}),onClick:()=>b(D),"aria-label":`Delete ${_t(D)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(mY,{encounter:o,getMenu:T}),n==="Patient"&&a.jsx(_K,{patient:o,getMenu:T}),n==="ServiceRequest"&&a.jsx(sZ,{serviceRequest:o,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(pY,{resource:o,getMenu:T}),a.jsx(mre,{resource:l,opened:d[0],onClose:d[1].close},`resend-subscriptions-${l?.id}`)]})}function gre(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:l,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||SF("app-tools-page").then(f).catch(console.error),l())},[t,d,l]),d&&r&&!o?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(Pn,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(Di,{})}function vre(){const e=Re(),{id:t}=Ut(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=v.useState(!1),[l,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(!1),[g,x]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState(),[T,E]=v.useState(),[R,D]=v.useState(!1),[P,A]=v.useState(!1),[k,M]=v.useState(),[$,{open:U,close:J}]=wd(!1);v.useEffect(()=>{if(r||l||d||R){A(!0);return}A(!1)},[r,l,d,R]);const Z=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(F=>{x(F.parameter?.find(K=>K.name==="status")?.valueCode),w(F.parameter?.find(K=>K.name==="version")?.valueString),C(F.parameter?.find(K=>K.name==="lastUpdated")?.valueInstant)}).catch(F=>z(Ye(F))).finally(()=>o(!1))},[e,t]),Y=v.useCallback(F=>{const K=F.host,L=F.pingCount||1;K&&(D(!0),e.pushToAgent(n,K,`PING ${L}`,ln.PING,!0).then(q=>E(q)).catch(q=>z(Ye(q))).finally(()=>D(!1)))},[e,n]),H=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(F=>{I("Agent config reloaded successfully.")}).catch(F=>z(Ye(F))).finally(()=>c(!1))},[e,t]),Q=v.useCallback(F=>{f(!0);const K=e.fhirUrl("Agent",t,"$upgrade");K.searchParams.set("force",String(F)),e.get(K,{cache:"reload"}).then(L=>{I("Agent upgraded successfully.")}).catch(L=>z(Ye(L))).finally(()=>f(!1))},[e,t]),O=v.useCallback(F=>{m(!0);const K=F.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${K!==void 0?`?limit=${K}`:""}`),{cache:"reload"}).then(L=>{const q=L?.parameter?.find(ie=>ie.name==="logs");q&&M(q?.valueString)}).catch(L=>z(Ye(L))).finally(()=>m(!1))},[e,t]);function I(F){Ne({color:"green",title:"Success",icon:a.jsx(Po,{size:"1rem"}),message:F})}function z(F){Ne({color:"red",title:"Error",message:F,autoClose:!1})}return a.jsxs(lt,{children:[a.jsx(Un,{opened:$,onClose:J,title:"Upgrade Agent",centered:!0,children:a.jsx(gre,{opened:$,close:J,version:b,loadingStatus:r,handleStatus:Z,handleUpgrade:Q})}),a.jsx(Ie,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(jl,{value:n,link:!0})]}),a.jsx(pn,{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:Z,loading:r,disabled:P&&!r,children:"Get Status"}),!r&&g&&a.jsx(fe,{children:a.jsxs(fe.Tbody,{children:[a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:"Status"}),a.jsx(fe.Td,{children:a.jsx(Rm,{status:g})})]}),a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:"Version"}),a.jsx(fe.Td,{children:b})]}),a.jsxs(fe.Tr,{children:[a.jsx(fe.Td,{children:"Last Updated"}),a.jsx(fe.Td,{children:mr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(pn,{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:l,disabled:P&&!l,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(pn,{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:U,loading:d,disabled:P&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(pn,{my:"lg"}),a.jsxs(ut,{onSubmit:O,children:[a.jsx(Ie,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),k?.length?a.jsx(Pd,{block:!0,mb:15,children:k}):null,a.jsxs(ye,{children:[a.jsx(Oc,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(ke,{mt:22,loading:p,disabled:P&&!p,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(pn,{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(ut,{onSubmit:Y,children:a.jsxs(ye,{children:[a.jsx(Ve,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(bn,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:R,disabled:P&&!R,children:a.jsx(Uq,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(Oc,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!R&&T&&a.jsxs(a.Fragment,{children:[a.jsx(Ie,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:T})]})]})}function yre(){const e=wn(),t=Re(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(l=>Ne({color:"red",message:Ye(l),autoClose:!1}))},[t]);function o(l){t.post("auth/revoke",{loginId:l}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ne({color:"green",message:"Login revoked"})).catch(c=>Ne({color:"red",message:Ye(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(lt,{children:[a.jsx(Ie,{children:"Security"}),a.jsxs(Cm,{children:[a.jsx(Ti,{term:"ID",children:a.jsx(Dt,{href:`/${_t(n.profile)}`,children:n.profile.id})}),a.jsx(Ti,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(Ti,{term:"Name",children:Jc(n.profile.name?.[0])})]})]}),a.jsxs(lt,{children:[a.jsx(Ie,{children:"Sessions"}),a.jsxs(fe,{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(l=>a.jsxs("tr",{children:[a.jsx("td",{children:l.os}),a.jsx("td",{children:l.browser}),a.jsx("td",{children:l.remoteAddress}),a.jsx("td",{children:l.authMethod}),a.jsx("td",{children:mr(l.lastUpdated)}),a.jsx("td",{children:a.jsx(Dt,{href:"#",onClick:()=>o(l.id),children:"Revoke"})})]},l.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 xre(){const{id:e,secret:t}=Ut(),n=Re(),[r,o]=v.useState(),[l,c]=v.useState(!1),d=tu(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(yr,{issues:d}),a.jsxs(ut,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(xo("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>o(qt(m)))},children:[a.jsxs(ar,{style:{flexDirection:"column"},children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Set password"})]}),!l&&a.jsxs(Be,{children:[a.jsx(Qi,{name:"password",label:"New password",required:!0,error:At(r,"password")}),a.jsx(Qi,{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"})})]}),l&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(mt,{to:"/signin",children:"sign in"}),"."]})]})]})}function bre(){const e=Sm(),t=wn(),[n]=xS(),r=ef(),o=v.useCallback(()=>{const l=n.get("next");t(l?.startsWith("/")?l:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(rP,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:Dk()?()=>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(Mi,{size:32}),a.jsxs(Ie,{children:["Sign in to ",GA()]}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function Sre(){const e=wn(),t=Gr(),[n,r]=v.useState(),[o,l]=v.useState(),[c,d]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),l(f.query),d(JSON.parse(f.fields))},[t]),!n||!o||!c?null:a.jsx(hK,{resourceType:n,checkboxesEnabled:!0,query:o,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 wre(){const{id:e,secret:t}=Ut(),n=Re(),[r,o]=v.useState(),[l,c]=v.useState(!1),d=tu(r,void 0);return a.jsxs(lt,{width:450,children:[a.jsx(yr,{issues:d}),a.jsxs(ut,{onSubmit:()=>{o(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>o(qt(p)))},children:[a.jsxs(ar,{style:{flexDirection:"column"},children:[a.jsx(Mi,{size:32}),a.jsx(Ie,{children:"Email address verification required"})]}),!l&&a.jsxs(Be,{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"})})]}),l&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(mt,{to:"/signin",children:"sign in"}),"."]})]})]})}function jre(){return a.jsx(HJ,{children:a.jsxs(Ue,{errorElement:a.jsx(nne,{}),children:[a.jsx(Ue,{path:"/signin",element:a.jsx(bre,{})}),a.jsx(Ue,{path:"/oauth",element:a.jsx(yne,{})}),a.jsx(Ue,{path:"/resetpassword",element:a.jsx(bne,{})}),a.jsx(Ue,{path:"/setpassword/:id/:secret",element:a.jsx(xre,{})}),a.jsx(Ue,{path:"/verifyemail/:id/:secret",element:a.jsx(wre,{})}),a.jsx(Ue,{path:"/register",element:a.jsx(xne,{})}),a.jsx(Ue,{path:"/changepassword",element:a.jsx(Jte,{})}),a.jsx(Ue,{path:"/security",element:a.jsx(yre,{})}),a.jsx(Ue,{path:"/mfa",element:a.jsx(mne,{})}),a.jsx(Ue,{path:"/batch",element:a.jsx(Xte,{})}),a.jsx(Ue,{path:"/bulk/:resourceType",element:a.jsx(Zte,{})}),a.jsx(Ue,{path:"/smart",element:a.jsx(Sre,{})}),a.jsx(Ue,{path:"/forms/:id",element:a.jsx(rne,{})}),a.jsx(Ue,{path:"/admin/super",element:a.jsx(Jee,{})}),a.jsx(Ue,{path:"/admin/super/asyncjob",element:a.jsx(Qee,{})}),a.jsx(Ue,{path:"/admin/super/db",element:a.jsx(zee,{})}),a.jsx(Ue,{path:"/admin/config",element:a.jsx(Fee,{})}),a.jsxs(Ue,{path:"/admin",element:a.jsx(Hee,{}),children:[a.jsx(Ue,{path:"patients",element:a.jsx(Vee,{})}),a.jsx(Ue,{path:"bots/new",element:a.jsx(Dee,{})}),a.jsx(Ue,{path:"bots",element:a.jsx(Ree,{})}),a.jsx(Ue,{path:"clients/new",element:a.jsx(Aee,{})}),a.jsx(Ue,{path:"clients",element:a.jsx(_ee,{})}),a.jsx(Ue,{path:"details",element:a.jsx(cR,{})}),a.jsx(Ue,{path:"invite",element:a.jsx(Bee,{})}),a.jsx(Ue,{path:"users",element:a.jsx(nte,{})}),a.jsx(Ue,{path:"project",element:a.jsx(cR,{})}),a.jsx(Ue,{path:"secrets",element:a.jsx(qee,{})}),a.jsx(Ue,{path:"sites",element:a.jsx(Gee,{})}),a.jsx(Ue,{path:"members/:membershipId",element:a.jsx(Uee,{})})]}),a.jsx(Ue,{path:"/lab/assays",element:a.jsx(hne,{})}),a.jsx(Ue,{path:"/lab/panels",element:a.jsx(pne,{})}),a.jsxs(Ue,{path:"/:resourceType/new",element:a.jsx(tne,{}),children:[a.jsx(Ue,{index:!0,element:a.jsx(Uy,{})}),a.jsx(Ue,{path:"form",element:a.jsx(Uy,{})}),a.jsx(Ue,{path:"json",element:a.jsx(Fne,{})}),a.jsx(Ue,{path:"profiles",element:a.jsx(Uy,{})})]}),a.jsxs(Ue,{path:"/:resourceType/:id",element:a.jsx(hre,{}),children:[a.jsx(Ue,{index:!0,element:a.jsx(RR,{})}),a.jsx(Ue,{path:"apply",element:a.jsx(wne,{})}),a.jsx(Ue,{path:"apps",element:a.jsx(jne,{})}),a.jsx(Ue,{path:"event",element:a.jsx(Ene,{})}),a.jsx(Ue,{path:"blame",element:a.jsx(Tne,{})}),a.jsx(Ue,{path:"bots",element:a.jsx(Yne,{})}),a.jsx(Ue,{path:"builder",element:a.jsx(Mne,{})}),a.jsx(Ue,{path:"checklist",element:a.jsx(Lne,{})}),a.jsx(Ue,{path:"delete",element:a.jsx(Ine,{})}),a.jsx(Ue,{path:"details",element:a.jsx(Une,{})}),a.jsx(Ue,{path:"edit",element:a.jsx(Bne,{})}),a.jsx(Ue,{path:"editor",element:a.jsx(Nne,{})}),a.jsxs(Ue,{path:"history",children:[a.jsx(Ue,{index:!0,element:a.jsx(TR,{})}),a.jsx(Ue,{path:":versionId/:tab",element:a.jsx(Ah,{})}),a.jsx(Ue,{path:":versionId",element:a.jsx(Ah,{})})]}),a.jsxs(Ue,{path:"_history",children:[a.jsx(Ue,{index:!0,element:a.jsx(TR,{})}),a.jsx(Ue,{path:":versionId/:tab",element:a.jsx(Ah,{})}),a.jsx(Ue,{path:":versionId",element:a.jsx(Ah,{})})]}),a.jsx(Ue,{path:"json",element:a.jsx(Hne,{})}),a.jsx(Ue,{path:"preview",element:a.jsx(qne,{})}),a.jsx(Ue,{path:"responses",element:a.jsx(Xne,{})}),a.jsx(Ue,{path:"report",element:a.jsx(Jne,{})}),a.jsx(Ue,{path:"ranges",element:a.jsx(Zne,{})}),a.jsx(Ue,{path:"subscriptions",element:a.jsx(pre,{})}),a.jsx(Ue,{path:"timeline",element:a.jsx(RR,{})}),a.jsx(Ue,{path:"tools",element:a.jsx(vre,{})}),a.jsx(Ue,{path:"profiles",element:a.jsx(Gne,{})}),a.jsx(Ue,{path:"export",element:a.jsx(Vne,{})})]}),a.jsx(Ue,{path:"/:resourceType",element:a.jsx(jR,{})}),a.jsx(Ue,{path:"/",element:a.jsx(jR,{})})]})})}function Cre(){const e=Re(),t=e.getUserConfiguration(),n=Gr(),[r]=xS();return e.isLoading()?a.jsx(Di,{}):a.jsx(eQ,{logo:a.jsx(Mi,{size:24}),pathname:n.pathname,searchParams:r,version:xA,menus:Ere(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(Di,{}),children:a.jsx(jre,{})})})}function Ere(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:Tre(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(fq,{})}]}),t}const _R={Patient:Yq,Practitioner:sq,Organization:CH,ServiceRequest:Nq,DiagnosticReport:zq,Questionnaire:oq,admin:yH,AccessPolicy:uq,Subscription:oG,batch:Cq,Observation:bq};function Tre(e){if(e.includes("admin/super/db"))return a.jsx(BH,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in _R){const n=_R[t];return a.jsx(n,{})}}catch{}return a.jsx(cm,{w:30})}async function Rre(){const e=ef(),t=new bA({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=pee([{path:"*",element:a.jsx(Cre,{})}]),o=c=>r.navigate(c);hZ.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(wF,{medplum:t,navigate:o,children:a.jsxs(JR,{theme:n,children:[a.jsx(Sa,{position:"bottom-right"}),a.jsx(UJ,{router:r})]})})}))}Rre().catch(console.error);
607
- //# sourceMappingURL=index-CqVoJmTZ.js.map