@medplum/app 3.2.31 → 3.2.32

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,587 +0,0 @@
1
- function Wj(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function yy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nm={exports:{}},Nc={},Mm={exports:{}},wt={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var _0;function C_(){if(_0)return wt;_0=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=m&&I[m]||I["@@iterator"],typeof I=="function"?I:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function j(I,F,Z){this.props=I,this.context=F,this.refs=w,this.updater=Z||x}j.prototype.isReactComponent={},j.prototype.setState=function(I,F){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,F,"setState")},j.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function P(){}P.prototype=j.prototype;function T(I,F,Z){this.props=I,this.context=F,this.refs=w,this.updater=Z||x}var k=T.prototype=new P;k.constructor=T,b(k,j.prototype),k.isPureReactComponent=!0;var C=Array.isArray,_=Object.prototype.hasOwnProperty,R={current:null},M={key:!0,ref:!0,__self:!0,__source:!0};function N(I,F,Z){var ae,je={},me=null,xe=null;if(F!=null)for(ae in F.ref!==void 0&&(xe=F.ref),F.key!==void 0&&(me=""+F.key),F)_.call(F,ae)&&!M.hasOwnProperty(ae)&&(je[ae]=F[ae]);var Te=arguments.length-2;if(Te===1)je.children=Z;else if(1<Te){for(var le=Array(Te),et=0;et<Te;et++)le[et]=arguments[et+2];je.children=le}if(I&&I.defaultProps)for(ae in Te=I.defaultProps,Te)je[ae]===void 0&&(je[ae]=Te[ae]);return{$$typeof:e,type:I,key:me,ref:xe,props:je,_owner:R.current}}function L(I,F){return{$$typeof:e,type:I.type,key:F,ref:I.ref,props:I.props,_owner:I._owner}}function z(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function G(I){var F={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Z){return F[Z]})}var q=/\/+/g;function Y(I,F){return typeof I=="object"&&I!==null&&I.key!=null?G(""+I.key):F.toString(36)}function Q(I,F,Z,ae,je){var me=typeof I;(me==="undefined"||me==="boolean")&&(I=null);var xe=!1;if(I===null)xe=!0;else switch(me){case"string":case"number":xe=!0;break;case"object":switch(I.$$typeof){case e:case t:xe=!0}}if(xe)return xe=I,je=je(xe),I=ae===""?"."+Y(xe,0):ae,C(je)?(Z="",I!=null&&(Z=I.replace(q,"$&/")+"/"),Q(je,F,Z,"",function(et){return et})):je!=null&&(z(je)&&(je=L(je,Z+(!je.key||xe&&xe.key===je.key?"":(""+je.key).replace(q,"$&/")+"/")+I)),F.push(je)),1;if(xe=0,ae=ae===""?".":ae+":",C(I))for(var Te=0;Te<I.length;Te++){me=I[Te];var le=ae+Y(me,Te);xe+=Q(me,F,Z,le,je)}else if(le=v(I),typeof le=="function")for(I=le.call(I),Te=0;!(me=I.next()).done;)me=me.value,le=ae+Y(me,Te++),xe+=Q(me,F,Z,le,je);else if(me==="object")throw F=String(I),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.");return xe}function ne(I,F,Z){if(I==null)return I;var ae=[],je=0;return Q(I,ae,"","",function(me){return F.call(Z,me,je++)}),ae}function V(I){if(I._status===-1){var F=I._result;F=F(),F.then(function(Z){(I._status===0||I._status===-1)&&(I._status=1,I._result=Z)},function(Z){(I._status===0||I._status===-1)&&(I._status=2,I._result=Z)}),I._status===-1&&(I._status=0,I._result=F)}if(I._status===1)return I._result.default;throw I._result}var O={current:null},A={transition:null},B={ReactCurrentDispatcher:O,ReactCurrentBatchConfig:A,ReactCurrentOwner:R};return wt.Children={map:ne,forEach:function(I,F,Z){ne(I,function(){F.apply(this,arguments)},Z)},count:function(I){var F=0;return ne(I,function(){F++}),F},toArray:function(I){return ne(I,function(F){return F})||[]},only:function(I){if(!z(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},wt.Component=j,wt.Fragment=n,wt.Profiler=i,wt.PureComponent=T,wt.StrictMode=r,wt.Suspense=d,wt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=B,wt.cloneElement=function(I,F,Z){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var ae=b({},I.props),je=I.key,me=I.ref,xe=I._owner;if(F!=null){if(F.ref!==void 0&&(me=F.ref,xe=R.current),F.key!==void 0&&(je=""+F.key),I.type&&I.type.defaultProps)var Te=I.type.defaultProps;for(le in F)_.call(F,le)&&!M.hasOwnProperty(le)&&(ae[le]=F[le]===void 0&&Te!==void 0?Te[le]:F[le])}var le=arguments.length-2;if(le===1)ae.children=Z;else if(1<le){Te=Array(le);for(var et=0;et<le;et++)Te[et]=arguments[et+2];ae.children=Te}return{$$typeof:e,type:I.type,key:je,ref:me,props:ae,_owner:xe}},wt.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:s,_context:I},I.Consumer=I},wt.createElement=N,wt.createFactory=function(I){var F=N.bind(null,I);return F.type=I,F},wt.createRef=function(){return{current:null}},wt.forwardRef=function(I){return{$$typeof:u,render:I}},wt.isValidElement=z,wt.lazy=function(I){return{$$typeof:h,_payload:{_status:-1,_result:I},_init:V}},wt.memo=function(I,F){return{$$typeof:p,type:I,compare:F===void 0?null:F}},wt.startTransition=function(I){var F=A.transition;A.transition={};try{I()}finally{A.transition=F}},wt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},wt.useCallback=function(I,F){return O.current.useCallback(I,F)},wt.useContext=function(I){return O.current.useContext(I)},wt.useDebugValue=function(){},wt.useDeferredValue=function(I){return O.current.useDeferredValue(I)},wt.useEffect=function(I,F){return O.current.useEffect(I,F)},wt.useId=function(){return O.current.useId()},wt.useImperativeHandle=function(I,F,Z){return O.current.useImperativeHandle(I,F,Z)},wt.useInsertionEffect=function(I,F){return O.current.useInsertionEffect(I,F)},wt.useLayoutEffect=function(I,F){return O.current.useLayoutEffect(I,F)},wt.useMemo=function(I,F){return O.current.useMemo(I,F)},wt.useReducer=function(I,F,Z){return O.current.useReducer(I,F,Z)},wt.useRef=function(I){return O.current.useRef(I)},wt.useState=function(I){return O.current.useState(I)},wt.useSyncExternalStore=function(I,F,Z){return O.current.useSyncExternalStore(I,F,Z)},wt.useTransition=function(){return O.current.useTransition()},wt.version="18.2.0",wt}var D0;function vy(){return D0||(D0=1,Mm.exports=C_()),Mm.exports}/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var I0;function E_(){if(I0)return Nc;I0=1;var e=vy(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s={key:!0,ref:!0,__self:!0,__source:!0};function l(u,d,p){var h,m={},v=null,x=null;p!==void 0&&(v=""+p),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(x=d.ref);for(h in d)r.call(d,h)&&!s.hasOwnProperty(h)&&(m[h]=d[h]);if(u&&u.defaultProps)for(h in d=u.defaultProps,d)m[h]===void 0&&(m[h]=d[h]);return{$$typeof:t,type:u,key:v,ref:x,props:m,_owner:i.current}}return Nc.Fragment=n,Nc.jsx=l,Nc.jsxs=l,Nc}var A0;function k_(){return A0||(A0=1,Nm.exports=E_()),Nm.exports}var o=k_(),Ui=function(){return Ui=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},Ui.apply(this,arguments)};function Hj(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function T_(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r<i;r++)(s||!(r in t))&&(s||(s=Array.prototype.slice.call(t,0,r)),s[r]=t[r]);return e.concat(s||Array.prototype.slice.call(t))}var y=vy();const xn=yy(y),qj=Wj({__proto__:null,default:xn},[y]);var uf="right-scroll-bar-position",df="width-before-scroll-bar",P_="with-scroll-bars-hidden",R_="--removed-body-scroll-bar-size";function Om(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function __(e,t){var n=y.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=t,n.facade}var D_=typeof window<"u"?y.useLayoutEffect:y.useEffect,N0=new WeakMap;function I_(e,t){var n=__(null,function(r){return e.forEach(function(i){return Om(i,r)})});return D_(function(){var r=N0.get(n);if(r){var i=new Set(r),s=new Set(e),l=n.current;i.forEach(function(u){s.has(u)||Om(u,null)}),s.forEach(function(u){i.has(u)||Om(u,l)})}N0.set(n,e)},[e]),n}function A_(e){return e}function N_(e,t){t===void 0&&(t=A_);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(s){var l=t(s,r);return n.push(l),function(){n=n.filter(function(u){return u!==l})}},assignSyncMedium:function(s){for(r=!0;n.length;){var l=n;n=[],l.forEach(s)}n={push:function(u){return s(u)},filter:function(){return n}}},assignMedium:function(s){r=!0;var l=[];if(n.length){var u=n;n=[],u.forEach(s),l=n}var d=function(){var h=l;l=[],h.forEach(s)},p=function(){return Promise.resolve().then(d)};p(),n={push:function(h){l.push(h),p()},filter:function(h){return l=l.filter(h),n}}}};return i}function M_(e){e===void 0&&(e={});var t=N_(null);return t.options=Ui({async:!0,ssr:!1},e),t}var Gj=function(e){var t=e.sideCar,n=Hj(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return y.createElement(r,Ui({},n))};Gj.isSideCarExport=!0;function O_(e,t){return e.useMedium(t),Gj}var Qj=M_(),Lm=function(){},Qf=y.forwardRef(function(e,t){var n=y.useRef(null),r=y.useState({onScrollCapture:Lm,onWheelCapture:Lm,onTouchMoveCapture:Lm}),i=r[0],s=r[1],l=e.forwardProps,u=e.children,d=e.className,p=e.removeScrollBar,h=e.enabled,m=e.shards,v=e.sideCar,x=e.noIsolation,b=e.inert,w=e.allowPinchZoom,j=e.as,P=j===void 0?"div":j,T=e.gapMode,k=Hj(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=v,_=I_([n,t]),R=Ui(Ui({},k),i);return y.createElement(y.Fragment,null,h&&y.createElement(C,{sideCar:Qj,removeScrollBar:p,shards:m,noIsolation:x,inert:b,setCallbacks:s,allowPinchZoom:!!w,lockRef:n,gapMode:T}),l?y.cloneElement(y.Children.only(u),Ui(Ui({},R),{ref:_})):y.createElement(P,Ui({},R,{className:d,ref:_}),u))});Qf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Qf.classNames={fullWidth:df,zeroRight:uf};var L_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function $_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=L_();return t&&e.setAttribute("nonce",t),e}function F_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function z_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var B_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=$_())&&(F_(t,n),z_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},U_=function(){var e=B_();return function(t,n){y.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Kj=function(){var e=U_(),t=function(n){var r=n.styles,i=n.dynamic;return e(r,i),null};return t},V_={left:0,top:0,right:0,gap:0},$m=function(e){return parseInt(e||"",10)||0},W_=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],i=t[e==="padding"?"paddingRight":"marginRight"];return[$m(n),$m(r),$m(i)]},H_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return V_;var t=W_(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])}},q_=Kj(),yl="data-scroll-locked",G_=function(e,t,n,r){var i=e.left,s=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),`
18
- .`.concat(P_,` {
19
- overflow: hidden `).concat(r,`;
20
- padding-right: `).concat(u,"px ").concat(r,`;
21
- }
22
- body[`).concat(yl,`] {
23
- overflow: hidden `).concat(r,`;
24
- overscroll-behavior: contain;
25
- `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
26
- padding-left: `.concat(i,`px;
27
- padding-top: `).concat(s,`px;
28
- padding-right: `).concat(l,`px;
29
- margin-left:0;
30
- margin-top:0;
31
- margin-right: `).concat(u,"px ").concat(r,`;
32
- `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),`
33
- }
34
-
35
- .`).concat(uf,` {
36
- right: `).concat(u,"px ").concat(r,`;
37
- }
38
-
39
- .`).concat(df,` {
40
- margin-right: `).concat(u,"px ").concat(r,`;
41
- }
42
-
43
- .`).concat(uf," .").concat(uf,` {
44
- right: 0 `).concat(r,`;
45
- }
46
-
47
- .`).concat(df," .").concat(df,` {
48
- margin-right: 0 `).concat(r,`;
49
- }
50
-
51
- body[`).concat(yl,`] {
52
- `).concat(R_,": ").concat(u,`px;
53
- }
54
- `)},M0=function(){var e=parseInt(document.body.getAttribute(yl)||"0",10);return isFinite(e)?e:0},Q_=function(){y.useEffect(function(){return document.body.setAttribute(yl,(M0()+1).toString()),function(){var e=M0()-1;e<=0?document.body.removeAttribute(yl):document.body.setAttribute(yl,e.toString())}},[])},K_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?"margin":r;Q_();var s=y.useMemo(function(){return H_(i)},[i]);return y.createElement(q_,{styles:G_(s,!t,i,n?"":"!important")})},kg=!1;if(typeof window<"u")try{var qd=Object.defineProperty({},"passive",{get:function(){return kg=!0,!0}});window.addEventListener("test",qd,qd),window.removeEventListener("test",qd,qd)}catch{kg=!1}var tl=kg?{passive:!1}:!1,Y_=function(e){return e.tagName==="TEXTAREA"},Yj=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Y_(e)&&n[t]==="visible")},X_=function(e){return Yj(e,"overflowY")},J_=function(e){return Yj(e,"overflowX")},O0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=Xj(e,r);if(i){var s=Jj(e,r),l=s[1],u=s[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Z_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},eD=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},Xj=function(e,t){return e==="v"?X_(t):J_(t)},Jj=function(e,t){return e==="v"?Z_(t):eD(t)},tD=function(e,t){return e==="h"&&t==="rtl"?-1:1},nD=function(e,t,n,r,i){var s=tD(e,window.getComputedStyle(t).direction),l=s*r,u=n.target,d=t.contains(u),p=!1,h=l>0,m=0,v=0;do{var x=Jj(e,u),b=x[0],w=x[1],j=x[2],P=w-j-s*b;(b||P)&&Xj(e,u)&&(m+=P,v+=b),u instanceof ShadowRoot?u=u.host:u=u.parentNode}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(h&&Math.abs(m)<1||!h&&Math.abs(v)<1)&&(p=!0),p},Gd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},L0=function(e){return[e.deltaX,e.deltaY]},$0=function(e){return e&&"current"in e?e.current:e},rD=function(e,t){return e[0]===t[0]&&e[1]===t[1]},iD=function(e){return`
55
- .block-interactivity-`.concat(e,` {pointer-events: none;}
56
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
- `)},oD=0,nl=[];function sD(e){var t=y.useRef([]),n=y.useRef([0,0]),r=y.useRef(),i=y.useState(oD++)[0],s=y.useState(Kj)[0],l=y.useRef(e);y.useEffect(function(){l.current=e},[e]),y.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(i));var w=T_([e.lockRef.current],(e.shards||[]).map($0),!0).filter(Boolean);return w.forEach(function(j){return j.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),w.forEach(function(j){return j.classList.remove("allow-interactivity-".concat(i))})}}},[e.inert,e.lockRef.current,e.shards]);var u=y.useCallback(function(w,j){if("touches"in w&&w.touches.length===2||w.type==="wheel"&&w.ctrlKey)return!l.current.allowPinchZoom;var P=Gd(w),T=n.current,k="deltaX"in w?w.deltaX:T[0]-P[0],C="deltaY"in w?w.deltaY:T[1]-P[1],_,R=w.target,M=Math.abs(k)>Math.abs(C)?"h":"v";if("touches"in w&&M==="h"&&R.type==="range")return!1;var N=O0(M,R);if(!N)return!0;if(N?_=M:(_=M==="v"?"h":"v",N=O0(M,R)),!N)return!1;if(!r.current&&"changedTouches"in w&&(k||C)&&(r.current=_),!_)return!0;var L=r.current||_;return nD(L,j,w,L==="h"?k:C)},[]),d=y.useCallback(function(w){var j=w;if(!(!nl.length||nl[nl.length-1]!==s)){var P="deltaY"in j?L0(j):Gd(j),T=t.current.filter(function(_){return _.name===j.type&&(_.target===j.target||j.target===_.shadowParent)&&rD(_.delta,P)})[0];if(T&&T.should){j.cancelable&&j.preventDefault();return}if(!T){var k=(l.current.shards||[]).map($0).filter(Boolean).filter(function(_){return _.contains(j.target)}),C=k.length>0?u(j,k[0]):!l.current.noIsolation;C&&j.cancelable&&j.preventDefault()}}},[]),p=y.useCallback(function(w,j,P,T){var k={name:w,delta:j,target:P,should:T,shadowParent:aD(P)};t.current.push(k),setTimeout(function(){t.current=t.current.filter(function(C){return C!==k})},1)},[]),h=y.useCallback(function(w){n.current=Gd(w),r.current=void 0},[]),m=y.useCallback(function(w){p(w.type,L0(w),w.target,u(w,e.lockRef.current))},[]),v=y.useCallback(function(w){p(w.type,Gd(w),w.target,u(w,e.lockRef.current))},[]);y.useEffect(function(){return nl.push(s),e.setCallbacks({onScrollCapture:m,onWheelCapture:m,onTouchMoveCapture:v}),document.addEventListener("wheel",d,tl),document.addEventListener("touchmove",d,tl),document.addEventListener("touchstart",h,tl),function(){nl=nl.filter(function(w){return w!==s}),document.removeEventListener("wheel",d,tl),document.removeEventListener("touchmove",d,tl),document.removeEventListener("touchstart",h,tl)}},[]);var x=e.removeScrollBar,b=e.inert;return y.createElement(y.Fragment,null,b?y.createElement(s,{styles:iD(i)}):null,x?y.createElement(K_,{gapMode:e.gapMode}):null)}function aD(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const lD=O_(Qj,sD);var Sl=y.forwardRef(function(e,t){return y.createElement(Qf,Ui({},e,{ref:t,sideCar:lD}))});Sl.classNames=Qf.classNames;function Qt(e){return Object.keys(e)}function Fm(e){return e&&typeof e=="object"&&!Array.isArray(e)}function xy(e,t){const n={...e},r=t;return Fm(e)&&Fm(t)&&Object.keys(t).forEach(i=>{Fm(r[i])&&i in e?n[i]=xy(n[i],r[i]):n[i]=r[i]}),n}function cD(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function uD(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function Qc(e){const t=uD(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 zm(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function Zj(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const i=`${r/16}${e}`;return t?zm(i):i}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(s=>n(s)).join(",");if(r.includes(" "))return r.split(" ").map(s=>n(s)).join(" ");if(r.includes(e))return t?zm(r):r;const i=r.replace("px","");if(!Number.isNaN(Number(i))){const s=`${Number(i)/16}${e}`;return t?zm(s):s}}return r}return n}const oe=Zj("rem",{shouldScale:!0}),vf=Zj("em");function gs(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function eC(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 Eo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==y.Fragment:!1}function pr(e){const t=y.createContext(null);return[({children:i,value:s})=>o.jsx(t.Provider,{value:s,children:i}),()=>{const i=y.useContext(t);if(i===null)throw new Error(e);return i}]}function ko(e=null){const t=y.createContext(e);return[({children:i,value:s})=>o.jsx(t.Provider,{value:s,children:i}),()=>y.useContext(t)]}function F0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function xf(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function dD(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 fD(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 pD(e,t,n){return xf(e,n)===xf(t,n)}function tC({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:i=!1,dir:s="rtl",orientation:l}){return u=>{var b;n==null||n(u);const d=Array.from(((b=xf(u.currentTarget,e))==null?void 0:b.querySelectorAll(t))||[]).filter(w=>pD(u.currentTarget,w,e)),p=d.findIndex(w=>u.currentTarget===w),h=fD(p,d,r),m=dD(p,d,r),v=s==="rtl"?m:h,x=s==="rtl"?h:m;switch(u.key){case"ArrowRight":{l==="horizontal"&&(u.stopPropagation(),u.preventDefault(),d[v].focus(),i&&d[v].click());break}case"ArrowLeft":{l==="horizontal"&&(u.stopPropagation(),u.preventDefault(),d[x].focus(),i&&d[x].click());break}case"ArrowUp":{l==="vertical"&&(u.stopPropagation(),u.preventDefault(),d[m].focus(),i&&d[m].click());break}case"ArrowDown":{l==="vertical"&&(u.stopPropagation(),u.preventDefault(),d[h].focus(),i&&d[h].click());break}case"Home":{u.stopPropagation(),u.preventDefault(),!d[0].disabled&&d[0].focus();break}case"End":{u.stopPropagation(),u.preventDefault();const w=d.length-1;!d[w].disabled&&d[w].focus();break}}}}const hD={app:100,modal:200,popover:300,overlay:400,max:9999};function Br(e){return hD[e]}const bf=()=>{};function mD(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||bf:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function rt(e,t="size",n=!0){if(e!==void 0)return eC(e)?n?oe(e):e:`var(--${t}-${e})`}function Dn(e){return rt(e,"mantine-spacing")}function Ot(e){return e===void 0?"var(--mantine-radius-default)":rt(e,"mantine-radius")}function In(e){return rt(e,"mantine-font-size")}function nC(e){return rt(e,"mantine-line-height",!1)}function by(e){if(e)return rt(e,"mantine-shadow",!1)}function Cr(e,t){return n=>{e==null||e(n),t==null||t(n)}}function wy(e,t){return e in t?Qc(t[e]):Qc(e)}function Kc(e,t){const n=e.map(r=>({value:r,px:wy(r,t)}));return n.sort((r,i)=>r.px-i.px),n}function wi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function gD(e,t,n){var r;return n?Array.from(((r=xf(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(i=>i===n):null}function yD(){const[e,t]=y.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Qd(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 rC(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function z0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ks(e){const t=y.useRef(e);return y.useEffect(()=>{t.current=e}),y.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}const vD=()=>{};function Kf(e,t){const n=typeof t=="number"?t:t.delay,r=typeof t=="number"?!1:t.flushOnUnmount,i=Ks(e),s=y.useRef(0),l=Object.assign(y.useCallback((...u)=>{window.clearTimeout(s.current);const d=()=>{s.current!==0&&(s.current=0,i(...u))};l.flush=d,s.current=window.setTimeout(d,n)},[i,n]),{flush:vD});return y.useEffect(()=>()=>{window.clearTimeout(s.current),r&&l.flush()},[l,r]),l}const B0=["mousedown","touchstart"];function xD(e,t,n){const r=y.useRef(null);return y.useEffect(()=>{const i=s=>{const{target:l}=s??{};if(Array.isArray(n)){const u=(l==null?void 0:l.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(l)&&l.tagName!=="HTML";n.every(p=>!!p&&!s.composedPath().includes(p))&&!u&&e()}else r.current&&!r.current.contains(l)&&e()};return(t||B0).forEach(s=>document.addEventListener(s,i)),()=>{(t||B0).forEach(s=>document.removeEventListener(s,i))}},[r,e,n]),r}function iC({timeout:e=2e3}={}){const[t,n]=y.useState(null),[r,i]=y.useState(!1),[s,l]=y.useState(null),u=h=>{window.clearTimeout(s),l(window.setTimeout(()=>i(!1),e)),i(h)};return{copy:h=>{"clipboard"in navigator?navigator.clipboard.writeText(h).then(()=>u(!0)).catch(m=>n(m)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{i(!1),n(null),window.clearTimeout(s)},error:t,copied:r}}function bD(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function wD(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function oC(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,i]=y.useState(n?t:wD(e)),s=y.useRef(null);return y.useEffect(()=>{if("matchMedia"in window)return s.current=window.matchMedia(e),i(s.current.matches),bD(s.current,l=>i(l.matches))},[e]),r}function SD(e,t){return oC("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Ll=typeof document<"u"?y.useLayoutEffect:y.useEffect;function vo(e,t){const n=y.useRef(!1);y.useEffect(()=>()=>{n.current=!1},[]),y.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function sC({opened:e,shouldReturnFocus:t=!0}){const n=y.useRef(null),r=()=>{var i;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((i=n.current)==null||i.focus({preventScroll:!0}))};return vo(()=>{let i=-1;const s=l=>{l.key==="Tab"&&window.clearTimeout(i)};return document.addEventListener("keydown",s),e?n.current=document.activeElement:t&&(i=window.setTimeout(r,10)),()=>{window.clearTimeout(i),document.removeEventListener("keydown",s)}},[e,t]),r}const jD=/input|select|textarea|button|object/,aC="a, input, select, textarea, button, object, [tabindex]";function CD(e){return e.style.display==="none"}function ED(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(CD(n))return!1;n=n.parentNode}return!0}function lC(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Tg(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(lC(e));return(jD.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&ED(e)}function cC(e){const t=lC(e);return(Number.isNaN(t)||t>=0)&&Tg(e)}function kD(e){return Array.from(e.querySelectorAll(aC)).filter(cC)}function TD(e,t){const n=kD(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],i=e.getRootNode();let s=r===i.activeElement||e===i.activeElement;const l=i.activeElement;if(l.tagName==="INPUT"&&l.getAttribute("type")==="radio"&&(s=n.filter(h=>h.getAttribute("type")==="radio"&&h.getAttribute("name")===l.getAttribute("name")).includes(r)),!s)return;t.preventDefault();const d=n[t.shiftKey?n.length-1:0];d&&d.focus()}function PD(e=!0){const t=y.useRef(null),n=i=>{let s=i.querySelector("[data-autofocus]");if(!s){const l=Array.from(i.querySelectorAll(aC));s=l.find(cC)||l.find(Tg)||null,!s&&Tg(i)&&(s=i)}s&&s.focus({preventScroll:!0})},r=y.useCallback(i=>{e&&i!==null&&t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&n(i)}),t.current=i):t.current=null)},[e]);return y.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const i=s=>{s.key==="Tab"&&t.current&&TD(t.current,s)};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[e]),r}const RD=e=>(e+1)%1e6;function _D(){const[,e]=y.useReducer(RD,0);return e}const DD=xn.useId||(()=>{});function ID(){const e=DD();return e?`mantine-${e.replace(/:/g,"")}`:""}function hr(e){const t=ID(),[n,r]=y.useState(t);return Ll(()=>{r(rC())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function uC(e,t,n){y.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Yc(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function AD(...e){const t=new Map;return n=>{if(e.forEach(r=>{const i=Yc(r,n);i&&t.set(r,i)}),t.size>0)return()=>{e.forEach(r=>{const i=t.get(r);i?i():Yc(r,null)}),t.clear()}}}function Nn(...e){return y.useCallback(AD(...e),e)}function Vn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[i,s]=y.useState(t!==void 0?t:n),l=(u,...d)=>{s(u),r==null||r(u,...d)};return e!==void 0?[e,r,!0]:[i,l,!1]}function is(e,t){const n=t-e+1;return Array.from({length:n},(r,i)=>i+e)}const Kd="dots";function ND({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:i=1,onChange:s}){const l=Math.max(Math.trunc(e),0),[u,d]=Vn({value:r,onChange:s,defaultValue:i,finalValue:i}),p=w=>{w<=0?d(1):w>l?d(l):d(w)},h=()=>p(u+1),m=()=>p(u-1),v=()=>p(1),x=()=>p(l);return{range:y.useMemo(()=>{if(t*2+3+n*2>=l)return is(1,l);const j=Math.max(u-t,n),P=Math.min(u+t,l-n),T=j>n+2,k=P<l-(n+1);if(!T&&k){const C=t*2+n+2;return[...is(1,C),Kd,...is(l-(n-1),l)]}if(T&&!k){const C=n+1+2*t;return[...is(1,n),Kd,...is(l-C,l)]}return[...is(1,n),Kd,...is(j,P),Kd,...is(l-n+1,l)]},[l,t,u]),active:u,setPage:p,next:h,previous:m,first:v,last:x}}function Sy(e,t){return oC("(prefers-reduced-motion: reduce)",e,t)}function Yf(e=!1,t){const{onOpen:n,onClose:r}={},[i,s]=y.useState(e),l=y.useCallback(()=>{s(p=>p||(n==null||n(),!0))},[n]),u=y.useCallback(()=>{s(p=>p&&(r==null||r(),!1))},[r]),d=y.useCallback(()=>{i?u():l()},[u,l,i]);return[i,{open:l,close:u,toggle:d}]}function MD(e,t,n={autoInvoke:!1}){const r=y.useRef(null),i=y.useCallback((...l)=>{r.current||(r.current=window.setTimeout(()=>{e(l),r.current=null},t))},[t]),s=y.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return y.useEffect(()=>(n.autoInvoke&&i(),s),[s,i]),{start:i,clear:s}}function OD(e,t,n){const r=y.useRef(null),i=y.useRef(null);return y.useEffect(()=>{const s=typeof n=="function"?n():n;return(s||i.current)&&(r.current=new MutationObserver(e),r.current.observe(s||i.current,t)),()=>{var l;(l=r.current)==null||l.disconnect()}},[e,t]),i}function LD(){const[e,t]=y.useState(!1);return y.useEffect(()=>t(!0),[]),e}var $D={};function dC(){return typeof process<"u"&&$D?"production":"development"}function Xf(e){var n;const t=xn.version;return typeof xn.version!="string"||t.startsWith("18.")?e==null?void 0:e.ref:(n=e==null?void 0:e.props)==null?void 0:n.ref}function fC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=fC(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Nt(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=fC(e))&&(r&&(r+=" "),r+=t);return r}const FD={};function zD(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,i])=>{t[r]?t[r]=Nt(t[r],i):t[r]=i})}),t}function Jf({theme:e,classNames:t,props:n,stylesCtx:r}){const s=(Array.isArray(t)?t:[t]).map(l=>typeof l=="function"?l(e,n,r):l||FD);return zD(s)}function wf({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((s,l)=>typeof l=="function"?{...s,...l(e,n,r)}:{...s,...l},{})}const jy=y.createContext(null);function ys(){const e=y.useContext(jy);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function BD(){return ys().cssVariablesResolver}function UD(){return ys().classNamesPrefix}function Zf(){return ys().getStyleNonce}function VD(){return ys().withStaticClasses}function WD(){return ys().headless}function HD(){var e;return(e=ys().stylesTransform)==null?void 0:e.sx}function qD(){var e;return(e=ys().stylesTransform)==null?void 0:e.styles}function GD(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function QD(e){let t=e.replace("#","");if(t.length===3){const l=t.split("");t=[l[0],l[0],l[1],l[1],l[2],l[2]].join("")}if(t.length===8){const l=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:l}}const n=parseInt(t,16),r=n>>16&255,i=n>>8&255,s=n&255;return{r,g:i,b:s,a:1}}function KD(e){const[t,n,r,i]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i||1}}function YD(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),i=parseInt(n[2],10)/100,s=parseInt(n[3],10)/100,l=n[5]?parseFloat(n[5]):void 0,u=(1-Math.abs(2*s-1))*i,d=r/60,p=u*(1-Math.abs(d%2-1)),h=s-u/2;let m,v,x;return d>=0&&d<1?(m=u,v=p,x=0):d>=1&&d<2?(m=p,v=u,x=0):d>=2&&d<3?(m=0,v=u,x=p):d>=3&&d<4?(m=0,v=p,x=u):d>=4&&d<5?(m=p,v=0,x=u):(m=u,v=0,x=p),{r:Math.round((m+h)*255),g:Math.round((v+h)*255),b:Math.round((x+h)*255),a:l||1}}function Cy(e){return GD(e)?QD(e):e.startsWith("rgb")?KD(e):e.startsWith("hsl")?YD(e):{r:0,g:0,b:0,a:1}}function Yd(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:i,a:s}=Cy(e),l=1-t,u=d=>Math.round(d*l);return`rgba(${u(n)}, ${u(r)}, ${u(i)}, ${s})`}function Xc(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Bm(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function XD(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function JD(e){if(e.startsWith("oklch("))return(XD(e)||0)/100;const{r:t,g:n,b:r}=Cy(e),i=t/255,s=n/255,l=r/255,u=Bm(i),d=Bm(s),p=Bm(l);return .2126*u+.7152*d+.0722*p}function Mc(e,t=.179){return e.startsWith("var(")?!1:JD(e)>t}function ei({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Mc(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Mc(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Mc(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,i]=e.split("."),s=i?Number(i):void 0,l=r in t.colors;if(l){const u=s!==void 0?t.colors[r][s]:t.colors[r][Xc(t,n||"light")];return{color:r,value:u,shade:s,isThemeColor:l,isLight:Mc(u,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${s}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:l,isLight:Mc(e,t.luminanceThreshold),shade:s,variable:void 0}}function $t(e,t){const n=ei({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Pg(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)||t.defaultGradient.deg||0},r=$t(n.from,t),i=$t(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function Jr(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const s=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${s}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:i}=Cy(e);return`rgba(${n}, ${r}, ${i}, ${t})`}const rl=Jr,ZD=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{const s=ei({color:e,theme:t}),l=typeof i=="boolean"?i:t.autoContrast;if(n==="filled"){const u=l&&s.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return s.isThemeColor?s.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:u,border:`${oe(1)} solid transparent`}:{background:`var(--mantine-color-${s.color}-${s.shade})`,hover:`var(--mantine-color-${s.color}-${s.shade===9?8:s.shade+1})`,color:u,border:`${oe(1)} solid transparent`}:{background:e,hover:Yd(e,.1),color:u,border:`${oe(1)} solid transparent`}}if(n==="light"){if(s.isThemeColor){if(s.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:Jr(u,.1),hover:Jr(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:Jr(e,.1),hover:Jr(e,.12),color:e,border:`${oe(1)} solid transparent`}}if(n==="outline")return s.isThemeColor?s.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${oe(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Jr(t.colors[s.color][s.shade],.05),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${oe(1)} solid var(--mantine-color-${s.color}-${s.shade})`}:{background:"transparent",hover:Jr(e,.05),color:e,border:`${oe(1)} solid ${e}`};if(n==="subtle"){if(s.isThemeColor){if(s.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`};const u=t.colors[s.color][s.shade];return{background:"transparent",hover:Jr(u,.12),color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${oe(1)} solid transparent`}}return{background:"transparent",hover:Jr(e,.12),color:e,border:`${oe(1)} solid transparent`}}return n==="transparent"?s.isThemeColor?s.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${s.color}-${Math.min(s.shade,6)})`,border:`${oe(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${oe(1)} solid transparent`}:n==="white"?s.isThemeColor?s.shade===void 0?{background:"var(--mantine-color-white)",hover:Yd(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Yd(t.white,.01),color:`var(--mantine-color-${s.color}-${s.shade})`,border:`${oe(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Yd(t.white,.01),color:e,border:`${oe(1)} solid transparent`}:n==="gradient"?{background:Pg(r,t),hover:Pg(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:`${oe(1)} solid var(--mantine-color-default-border)`}:{}},eI={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"]},U0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Ey={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:eI,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:ZD,autoContrast:!1,luminanceThreshold:.3,fontFamily:U0,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:U0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:oe(34),lineHeight:"1.3"},h2:{fontSize:oe(26),lineHeight:"1.35"},h3:{fontSize:oe(22),lineHeight:"1.4"},h4:{fontSize:oe(18),lineHeight:"1.45"},h5:{fontSize:oe(16),lineHeight:"1.5"},h6:{fontSize:oe(14),lineHeight:"1.5"}}},fontSizes:{xs:oe(12),sm:oe(14),md:oe(16),lg:oe(18),xl:oe(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:oe(2),sm:oe(4),md:oe(8),lg:oe(16),xl:oe(32)},spacing:{xs:oe(10),sm:oe(12),md:oe(16),lg:oe(20),xl:oe(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), 0 ${oe(1)} ${oe(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(10)} ${oe(15)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(7)} ${oe(7)} ${oe(-5)}`,md:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(20)} ${oe(25)} ${oe(-5)}, rgba(0, 0, 0, 0.04) 0 ${oe(10)} ${oe(10)} ${oe(-5)}`,lg:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(28)} ${oe(23)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(12)} ${oe(12)} ${oe(-7)}`,xl:`0 ${oe(1)} ${oe(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${oe(36)} ${oe(28)} ${oe(-7)}, rgba(0, 0, 0, 0.04) 0 ${oe(17)} ${oe(17)} ${oe(-7)}`},other:{},components:{}};function V0(e){return e==="auto"||e==="dark"||e==="light"}function tI({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 V0(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&&V0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const nI="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",W0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Um(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function H0(e){if(!(e.primaryColor in e.colors))throw new Error(nI);if(typeof e.primaryShade=="object"&&(!Um(e.primaryShade.dark)||!Um(e.primaryShade.light)))throw new Error(W0);if(typeof e.primaryShade=="number"&&!Um(e.primaryShade))throw new Error(W0)}function rI(e,t){var r;if(!t)return H0(e),e;const n=xy(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),H0(n),n}const ky=y.createContext(null),iI=()=>y.useContext(ky)||Ey;function dn(){const e=y.useContext(ky);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 pC({theme:e,children:t,inherit:n=!0}){const r=iI(),i=y.useMemo(()=>rI(n?r:Ey,e),[e,r,n]);return o.jsx(ky.Provider,{value:i,children:t})}pC.displayName="@mantine/core/MantineThemeProvider";function oI(){const e=dn(),t=Zf(),n=Qt(e.breakpoints).reduce((r,i)=>{const s=e.breakpoints[i].includes("px"),l=Qc(e.breakpoints[i]),u=s?`${l-.1}px`:vf(l-.1),d=s?`${l}px`:vf(l);return`${r}@media (max-width: ${u}) {.mantine-visible-from-${i} {display: none !important;}}@media (min-width: ${d}) {.mantine-hidden-from-${i} {display: none !important;}}`},"");return o.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function Vm(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Oc(e,t){return(Array.isArray(e)?e:[e]).reduce((r,i)=>`${i}{${r}}`,t)}function sI(e,t){const n=Vm(e.variables),r=n?Oc(t,n):"",i=Vm(e.dark),s=Vm(e.light),l=i?Oc(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,i):"",u=s?Oc(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,s):"";return`${r}${l}${u}`}function To({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&ei({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function q0(e,t){return To({color:e.colors[e.primaryColor][Xc(e,t)],theme:e,autoContrast:null})}function Xd({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n==="light"){const u=Xc(e,"light"),d={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${u===9?8:u+1})`,[`--mantine-color-${r}-light`]:rl(e.colors[t][u],.1),[`--mantine-color-${r}-light-hover`]:rl(e.colors[t][u],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${u})`,[`--mantine-color-${r}-outline-hover`]:rl(e.colors[t][u],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...d}:d}const s=Xc(e,"dark"),l={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${s})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${s===9?8:s+1})`,[`--mantine-color-${r}-light`]:rl(e.colors[t][Math.max(0,s-2)],.15),[`--mantine-color-${r}-light-hover`]:rl(e.colors[t][Math.max(0,s-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(s-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(s-4,0)})`,[`--mantine-color-${r}-outline-hover`]:rl(e.colors[t][Math.max(s-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...l}:l}function aI(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function il(e,t,n){Qt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const hC=e=>{const t=Xc(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:oe(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":q0(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":q0(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)"}};il(r.variables,e.breakpoints,"breakpoint"),il(r.variables,e.spacing,"spacing"),il(r.variables,e.fontSizes,"font-size"),il(r.variables,e.lineHeights,"line-height"),il(r.variables,e.shadows,"shadow"),il(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((s,l)=>{r.variables[`--mantine-primary-color-${l}`]=`var(--mantine-color-${e.primaryColor}-${l})`}),Qt(e.colors).forEach(s=>{const l=e.colors[s];if(aI(l)){Object.assign(r.light,Xd({theme:e,name:l.name,color:l.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Xd({theme:e,name:l.name,color:l.dark,colorScheme:"dark",withColorValues:!0}));return}l.forEach((u,d)=>{r.variables[`--mantine-color-${s}-${d}`]=u}),Object.assign(r.light,Xd({theme:e,color:s,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Xd({theme:e,color:s,colorScheme:"dark",withColorValues:!1}))});const i=e.headings.sizes;return Qt(i).forEach(s=>{r.variables[`--mantine-${s}-font-size`]=i[s].fontSize,r.variables[`--mantine-${s}-line-height`]=i[s].lineHeight,r.variables[`--mantine-${s}-font-weight`]=i[s].fontWeight||e.headings.fontWeight}),r};function lI({theme:e,generator:t}){const n=hC(e),r=t==null?void 0:t(e);return r?xy(n,r):n}const Wm=hC(Ey);function cI(e){const t={variables:{},light:{},dark:{}};return Qt(e.variables).forEach(n=>{Wm.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),Qt(e.light).forEach(n=>{Wm.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),Qt(e.dark).forEach(n=>{Wm.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function uI(e){return`
58
- ${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
59
- ${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
60
- `}function mC({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=dn(),r=Zf(),i=BD(),s=lI({theme:n,generator:i}),l=e===":root"&&t,u=l?cI(s):s,d=sI(u,e);return d?o.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${d}${l?"":uI(e)}`}}):null}mC.displayName="@mantine/CssVariables";function dI(){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 ol(e,t){var i,s;const n=typeof window<"u"&&"matchMedia"in window&&((i=window.matchMedia("(prefers-color-scheme: dark)"))==null?void 0:i.matches),r=e!=="auto"?e:n?"dark":"light";(s=t())==null||s.setAttribute("data-mantine-color-scheme",r)}function fI({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const i=y.useRef(null),[s,l]=y.useState(()=>e.get(t)),u=r||s,d=y.useCallback(h=>{r||(ol(h,n),l(h),e.set(h))},[e.set,u,r]),p=y.useCallback(()=>{l(t),ol(t,n),e.clear()},[e.clear,t]);return y.useEffect(()=>(e.subscribe(d),e.unsubscribe),[e.subscribe,e.unsubscribe]),Ll(()=>{ol(e.get(t),n)},[]),y.useEffect(()=>{var m;if(r)return ol(r,n),()=>{};r===void 0&&ol(s,n),typeof window<"u"&&"matchMedia"in window&&(i.current=window.matchMedia("(prefers-color-scheme: dark)"));const h=v=>{s==="auto"&&ol(v.matches?"dark":"light",n)};return(m=i.current)==null||m.addEventListener("change",h),()=>{var v;return(v=i.current)==null?void 0:v.removeEventListener("change",h)}},[s,r]),{colorScheme:u,setColorScheme:d,clearColorScheme:p}}function pI({respectReducedMotion:e,getRootElement:t}){Ll(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}dI();function gC({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:s=!0,withCssVariables:l=!0,cssVariablesSelector:u=":root",classNamesPrefix:d="mantine",colorSchemeManager:p=tI(),defaultColorScheme:h="light",getRootElement:m=()=>document.documentElement,cssVariablesResolver:v,forceColorScheme:x,stylesTransform:b}){const{colorScheme:w,setColorScheme:j,clearColorScheme:P}=fI({defaultColorScheme:h,forceColorScheme:x,manager:p,getRootElement:m});return pI({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:m}),o.jsx(jy.Provider,{value:{colorScheme:w,setColorScheme:j,clearColorScheme:P,getRootElement:m,classNamesPrefix:d,getStyleNonce:n,cssVariablesResolver:v,cssVariablesSelector:u,withStaticClasses:r,stylesTransform:b},children:o.jsxs(pC,{theme:e,children:[l&&o.jsx(mC,{cssVariablesSelector:u,deduplicateCssVariables:s}),i&&o.jsx(oI,{}),t]})})}gC.displayName="@mantine/core/MantineProvider";function va({classNames:e,styles:t,props:n,stylesCtx:r}){const i=dn();return{resolvedClassNames:Jf({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:wf({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}const hI={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function mI({theme:e,options:t,unstyled:n}){return Nt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||hI[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function gI({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return Jf({theme:i,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function G0({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return Jf({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function yI({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function vI({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function xI({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(i=>`${t}-${i}-${n}`)}function bI({themeName:e,theme:t,selector:n,props:r,stylesCtx:i}){return e.map(s=>{var l,u;return(u=Jf({theme:t,classNames:(l=t.components[s])==null?void 0:l.classNames,props:r,stylesCtx:i}))==null?void 0:u[n]})}function wI({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function SI({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,classNames:s,classes:l,unstyled:u,className:d,rootSelector:p,props:h,stylesCtx:m,withStaticClasses:v,headless:x,transformedStyles:b}){return Nt(mI({theme:e,options:t,unstyled:u||x}),bI({theme:e,themeName:n,selector:r,props:h,stylesCtx:m}),wI({options:t,classes:l,selector:r,unstyled:u}),G0({selector:r,stylesCtx:m,theme:e,classNames:s,props:h}),G0({selector:r,stylesCtx:m,theme:e,classNames:b,props:h}),gI({selector:r,stylesCtx:m,options:t,props:h,theme:e}),yI({rootSelector:p,selector:r,className:d}),vI({selector:r,classes:l,unstyled:u||x}),v&&!x&&xI({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function jI({theme:e,themeName:t,props:n,stylesCtx:r,selector:i}){return t.map(s=>{var l;return wf({theme:e,styles:(l=e.components[s])==null?void 0:l.styles,props:n,stylesCtx:r})[i]}).reduce((s,l)=>({...s,...l}),{})}function Rg({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Rg({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function CI(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...gs(n[r])}}),t),{})}function EI({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:i,selector:s,themeName:l,headless:u}){var d;return(d=CI([u?{}:t==null?void 0:t(n,r,i),...l.map(p=>{var h,m,v;return(v=(m=(h=n.components)==null?void 0:h[p])==null?void 0:m.vars)==null?void 0:v.call(m,n,r,i)}),e==null?void 0:e(n,r,i)]))==null?void 0:d[s]}function kI({theme:e,themeName:t,selector:n,options:r,props:i,stylesCtx:s,rootSelector:l,styles:u,style:d,vars:p,varsResolver:h,headless:m,withStylesTransform:v}){return{...!v&&jI({theme:e,themeName:t,props:i,stylesCtx:s,selector:n}),...!v&&wf({theme:e,styles:u,props:i,stylesCtx:s})[n],...!v&&wf({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||i,stylesCtx:s})[n],...EI({theme:e,props:i,stylesCtx:s,vars:p,varsResolver:h,selector:n,themeName:t,headless:m}),...l===n?Rg({style:d,theme:e}):null,...Rg({style:r==null?void 0:r.style,theme:e})}}function TI({props:e,stylesCtx:t,themeName:n}){var l;const r=dn(),i=(l=qD())==null?void 0:l();return{getTransformedStyles:u=>i?[...u.map(p=>i(p,{props:e,theme:r,ctx:t})),...n.map(p=>{var h;return i((h=r.components[p])==null?void 0:h.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!i}}function Ne({name:e,classes:t,props:n,stylesCtx:r,className:i,style:s,rootSelector:l="root",unstyled:u,classNames:d,styles:p,vars:h,varsResolver:m}){const v=dn(),x=UD(),b=VD(),w=WD(),j=(Array.isArray(e)?e:[e]).filter(k=>k),{withStylesTransform:P,getTransformedStyles:T}=TI({props:n,stylesCtx:r,themeName:j});return(k,C)=>({className:SI({theme:v,options:C,themeName:j,selector:k,classNamesPrefix:x,classNames:d,classes:t,unstyled:u,className:i,rootSelector:l,props:n,stylesCtx:r,withStaticClasses:b,headless:w,transformedStyles:T([C==null?void 0:C.styles,p])}),style:kI({theme:v,themeName:j,selector:k,options:C,props:n,stylesCtx:r,rootSelector:l,styles:p,style:s,vars:h,varsResolver:m,headless:w,withStylesTransform:P})})}function xa(e,t){return typeof e=="boolean"?e:t.autoContrast}function Q0(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 PI({keepTransitions:e}={}){const t=y.useRef(bf),n=y.useRef(-1),r=y.useContext(jy),i=Zf(),s=y.useRef(i==null?void 0:i());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const l=m=>{r.setColorScheme(m),t.current=e?()=>{}:Q0(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var v;(v=t.current)==null||v.call(t)},10)},u=()=>{r.clearColorScheme(),t.current=e?()=>{}:Q0(s.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var m;(m=t.current)==null||m.call(t)},10)},d=SD("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?d:r.colorScheme,h=y.useCallback(()=>l(p==="light"?"dark":"light"),[l,p]);return y.useEffect(()=>()=>{var m;(m=t.current)==null||m.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:l,clearColorScheme:u,toggleColorScheme:h}}function ie(e,t,n){var l;const r=dn(),i=(l=r.components[e])==null?void 0:l.defaultProps,s=typeof i=="function"?i(r):i;return{...t,...s,...gs(n)}}function Hm(e){return Qt(e).reduce((t,n)=>e[n]!==void 0?`${t}${cD(n)}:${e[n]};`:t,"").trim()}function RI({selector:e,styles:t,media:n,container:r}){const i=t?Hm(t):"",s=Array.isArray(n)?n.map(u=>`@media${u.query}{${e}{${Hm(u.styles)}}}`):[],l=Array.isArray(r)?r.map(u=>`@container ${u.query}{${e}{${Hm(u.styles)}}}`):[];return`${i?`${e}{${i}}`:""}${s.join("")}${l.join("")}`.trim()}function ba(e){const t=Zf();return o.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:RI(e)}})}function Po(e){const{m:t,mx:n,my:r,mt:i,mb:s,ml:l,mr:u,me:d,ms:p,p:h,px:m,py:v,pt:x,pb:b,pl:w,pr:j,pe:P,ps:T,bd:k,bg:C,c:_,opacity:R,ff:M,fz:N,fw:L,lts:z,ta:G,lh:q,fs:Y,tt:Q,td:ne,w:V,miw:O,maw:A,h:B,mih:I,mah:F,bgsz:Z,bgp:ae,bgr:je,bga:me,pos:xe,top:Te,left:le,bottom:et,right:ht,inset:ct,display:St,flex:Et,hiddenFrom:Tt,visibleFrom:vt,lightHidden:_t,darkHidden:we,sx:Re,...ke}=e;return{styleProps:gs({m:t,mx:n,my:r,mt:i,mb:s,ml:l,mr:u,me:d,ms:p,p:h,px:m,py:v,pt:x,pb:b,pl:w,pr:j,pe:P,ps:T,bd:k,bg:C,c:_,opacity:R,ff:M,fz:N,fw:L,lts:z,ta:G,lh:q,fs:Y,tt:Q,td:ne,w:V,miw:O,maw:A,h:B,mih:I,mah:F,bgsz:Z,bgp:ae,bgr:je,bga:me,pos:xe,top:Te,left:le,bottom:et,right:ht,inset:ct,display:St,flex:Et,hiddenFrom:Tt,visibleFrom:vt,lightHidden:_t,darkHidden:we,sx:Re}),rest:ke}}const _I={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 Ty(e,t){const n=ei({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 DI(e,t){const n=ei({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Ty(e,t)}function II(e,t){if(typeof e=="number")return oe(e);if(typeof e=="string"){const[n,r,...i]=e.split(" ").filter(l=>l.trim()!=="");let s=`${oe(n)}`;return r&&(s+=` ${r}`),i.length>0&&(s+=` ${Ty(i.join(" "),t)}`),s.trim()}return e}const K0={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 AI(e){return typeof e=="string"&&e in K0?K0[e]:e}const NI=["h1","h2","h3","h4","h5","h6"];function MI(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&NI.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?oe(e):e}function OI(e){return e}const LI=["h1","h2","h3","h4","h5","h6"];function $I(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&LI.includes(e)?`var(--mantine-${e}-line-height)`:e}function FI(e){return typeof e=="number"?oe(e):e}function zI(e,t){if(typeof e=="number")return oe(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return oe(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const qm={color:Ty,textColor:DI,fontSize:MI,spacing:zI,identity:OI,size:FI,lineHeight:$I,fontFamily:AI,border:II};function Y0(e){return e.replace("(min-width: ","").replace("em)","")}function BI({media:e,...t}){const r=Object.keys(e).sort((i,s)=>Number(Y0(i))-Number(Y0(s))).map(i=>({query:i,styles:e[i]}));return{...t,media:r}}function UI(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function VI(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function WI(e){return typeof e=="object"&&e!==null?Qt(e).filter(t=>t!=="base"):[]}function HI(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function yC({styleProps:e,data:t,theme:n}){return BI(Qt(e).reduce((r,i)=>{if(i==="hiddenFrom"||i==="visibleFrom"||i==="sx")return r;const s=t[i],l=Array.isArray(s.property)?s.property:[s.property],u=VI(e[i]);if(!UI(e[i]))return l.forEach(p=>{r.inlineStyles[p]=qm[s.type](u,n)}),r;r.hasResponsiveStyles=!0;const d=WI(e[i]);return l.forEach(p=>{u&&(r.styles[p]=qm[s.type](u,n)),d.forEach(h=>{const m=`(min-width: ${n.breakpoints[h]})`;r.media[m]={...r.media[m],[p]:qm[s.type](HI(e[i],h),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function fu(){return`__m__-${y.useId().replace(/:/g,"")}`}function vC(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...vC(r,t)}),{}):typeof e=="function"?e(t):e??{}}function xC(e){return e.startsWith("data-")?e:`data-${e}`}function qI(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[xC(n)]=e[n]),t},{})}function bC(e){return e?typeof e=="string"?{[xC(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...bC(n)}),{}):qI(e):null}function _g(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,..._g(r,t)}),{}):typeof e=="function"?e(t):e??{}}function GI({theme:e,style:t,vars:n,styleProps:r}){const i=_g(t,e),s=_g(n,e);return{...i,...s,...r}}const wC=y.forwardRef(({component:e,style:t,__vars:n,className:r,variant:i,mod:s,size:l,hiddenFrom:u,visibleFrom:d,lightHidden:p,darkHidden:h,renderRoot:m,__size:v,...x},b)=>{var N;const w=dn(),j=e||"div",{styleProps:P,rest:T}=Po(x),k=HD(),C=(N=k==null?void 0:k())==null?void 0:N(P.sx),_=fu(),R=yC({styleProps:P,theme:w,data:_I}),M={ref:b,style:GI({theme:w,style:t,vars:n,styleProps:R.inlineStyles}),className:Nt(r,C,{[_]:R.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":h,[`mantine-hidden-from-${u}`]:u,[`mantine-visible-from-${d}`]:d}),"data-variant":i,"data-size":eC(l)?void 0:l||void 0,size:v,...bC(s),...T};return o.jsxs(o.Fragment,{children:[R.hasResponsiveStyles&&o.jsx(ba,{selector:`.${_}`,styles:R.styles,media:R.media}),typeof m=="function"?m(M):o.jsx(j,{...M})]})});wC.displayName="@mantine/core/Box";const se=wC;function SC(e){return e}function fe(e){const t=y.forwardRef(e);return t.extend=SC,t.withProps=n=>{const r=y.forwardRef((i,s)=>o.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function ir(e){const t=y.forwardRef(e);return t.withProps=n=>{const r=y.forwardRef((i,s)=>o.jsx(t,{...n,...i,ref:s}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=SC,t}const QI=y.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function wa(){return y.useContext(QI)}var Gm={exports:{}},wr={},Qm={exports:{}},Km={};/**
61
- * @license React
62
- * scheduler.production.min.js
63
- *
64
- * Copyright (c) Facebook, Inc. and its affiliates.
65
- *
66
- * This source code is licensed under the MIT license found in the
67
- * LICENSE file in the root directory of this source tree.
68
- */var X0;function KI(){return X0||(X0=1,function(e){function t(A,B){var I=A.length;A.push(B);e:for(;0<I;){var F=I-1>>>1,Z=A[F];if(0<i(Z,B))A[F]=B,A[I]=Z,I=F;else break e}}function n(A){return A.length===0?null:A[0]}function r(A){if(A.length===0)return null;var B=A[0],I=A.pop();if(I!==B){A[0]=I;e:for(var F=0,Z=A.length,ae=Z>>>1;F<ae;){var je=2*(F+1)-1,me=A[je],xe=je+1,Te=A[xe];if(0>i(me,I))xe<Z&&0>i(Te,me)?(A[F]=Te,A[xe]=I,F=xe):(A[F]=me,A[je]=I,F=je);else if(xe<Z&&0>i(Te,I))A[F]=Te,A[xe]=I,F=xe;else break e}}return B}function i(A,B){var I=A.sortIndex-B.sortIndex;return I!==0?I:A.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],p=[],h=1,m=null,v=3,x=!1,b=!1,w=!1,j=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(A){for(var B=n(p);B!==null;){if(B.callback===null)r(p);else if(B.startTime<=A)r(p),B.sortIndex=B.expirationTime,t(d,B);else break;B=n(p)}}function C(A){if(w=!1,k(A),!b)if(n(d)!==null)b=!0,V(_);else{var B=n(p);B!==null&&O(C,B.startTime-A)}}function _(A,B){b=!1,w&&(w=!1,P(N),N=-1),x=!0;var I=v;try{for(k(B),m=n(d);m!==null&&(!(m.expirationTime>B)||A&&!G());){var F=m.callback;if(typeof F=="function"){m.callback=null,v=m.priorityLevel;var Z=F(m.expirationTime<=B);B=e.unstable_now(),typeof Z=="function"?m.callback=Z:m===n(d)&&r(d),k(B)}else r(d);m=n(d)}if(m!==null)var ae=!0;else{var je=n(p);je!==null&&O(C,je.startTime-B),ae=!1}return ae}finally{m=null,v=I,x=!1}}var R=!1,M=null,N=-1,L=5,z=-1;function G(){return!(e.unstable_now()-z<L)}function q(){if(M!==null){var A=e.unstable_now();z=A;var B=!0;try{B=M(!0,A)}finally{B?Y():(R=!1,M=null)}}else R=!1}var Y;if(typeof T=="function")Y=function(){T(q)};else if(typeof MessageChannel<"u"){var Q=new MessageChannel,ne=Q.port2;Q.port1.onmessage=q,Y=function(){ne.postMessage(null)}}else Y=function(){j(q,0)};function V(A){M=A,R||(R=!0,Y())}function O(A,B){N=j(function(){A(e.unstable_now())},B)}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(A){A.callback=null},e.unstable_continueExecution=function(){b||x||(b=!0,V(_))},e.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):L=0<A?Math.floor(1e3/A):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(A){switch(v){case 1:case 2:case 3:var B=3;break;default:B=v}var I=v;v=B;try{return A()}finally{v=I}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(A,B){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var I=v;v=A;try{return B()}finally{v=I}},e.unstable_scheduleCallback=function(A,B,I){var F=e.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?F+I:F):I=F,A){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=I+Z,A={id:h++,callback:B,priorityLevel:A,startTime:I,expirationTime:Z,sortIndex:-1},I>F?(A.sortIndex=I,t(p,A),n(d)===null&&A===n(p)&&(w?(P(N),N=-1):w=!0,O(C,I-F))):(A.sortIndex=Z,t(d,A),b||x||(b=!0,V(_))),A},e.unstable_shouldYield=G,e.unstable_wrapCallback=function(A){var B=v;return function(){var I=v;v=B;try{return A.apply(this,arguments)}finally{v=I}}}}(Km)),Km}var J0;function YI(){return J0||(J0=1,Qm.exports=KI()),Qm.exports}/**
69
- * @license React
70
- * react-dom.production.min.js
71
- *
72
- * Copyright (c) Facebook, Inc. and its affiliates.
73
- *
74
- * This source code is licensed under the MIT license found in the
75
- * LICENSE file in the root directory of this source tree.
76
- */var Z0;function XI(){if(Z0)return wr;Z0=1;var e=vy(),t=YI();function n(a){for(var c="https://reactjs.org/docs/error-decoder.html?invariant="+a,f=1;f<arguments.length;f++)c+="&args[]="+encodeURIComponent(arguments[f]);return"Minified React error #"+a+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,i={};function s(a,c){l(a,c),l(a+"Capture",c)}function l(a,c){for(i[a]=c,a=0;a<c.length;a++)r.add(c[a])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,h={},m={};function v(a){return d.call(m,a)?!0:d.call(h,a)?!1:p.test(a)?m[a]=!0:(h[a]=!0,!1)}function x(a,c,f,g){if(f!==null&&f.type===0)return!1;switch(typeof c){case"function":case"symbol":return!0;case"boolean":return g?!1:f!==null?!f.acceptsBooleans:(a=a.toLowerCase().slice(0,5),a!=="data-"&&a!=="aria-");default:return!1}}function b(a,c,f,g){if(c===null||typeof c>"u"||x(a,c,f,g))return!0;if(g)return!1;if(f!==null)switch(f.type){case 3:return!c;case 4:return c===!1;case 5:return isNaN(c);case 6:return isNaN(c)||1>c}return!1}function w(a,c,f,g,S,E,D){this.acceptsBooleans=c===2||c===3||c===4,this.attributeName=g,this.attributeNamespace=S,this.mustUseProperty=f,this.propertyName=a,this.type=c,this.sanitizeURL=E,this.removeEmptyString=D}var j={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(a){j[a]=new w(a,0,!1,a,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(a){var c=a[0];j[c]=new w(c,1,!1,a[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(a){j[a]=new w(a,2,!1,a.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(a){j[a]=new w(a,2,!1,a,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(a){j[a]=new w(a,3,!1,a.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(a){j[a]=new w(a,3,!0,a,null,!1,!1)}),["capture","download"].forEach(function(a){j[a]=new w(a,4,!1,a,null,!1,!1)}),["cols","rows","size","span"].forEach(function(a){j[a]=new w(a,6,!1,a,null,!1,!1)}),["rowSpan","start"].forEach(function(a){j[a]=new w(a,5,!1,a.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function T(a){return a[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(a){var c=a.replace(P,T);j[c]=new w(c,1,!1,a,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(a){var c=a.replace(P,T);j[c]=new w(c,1,!1,a,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(a){var c=a.replace(P,T);j[c]=new w(c,1,!1,a,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(a){j[a]=new w(a,1,!1,a.toLowerCase(),null,!1,!1)}),j.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(a){j[a]=new w(a,1,!1,a.toLowerCase(),null,!0,!0)});function k(a,c,f,g){var S=j.hasOwnProperty(c)?j[c]:null;(S!==null?S.type!==0:g||!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(b(c,f,S,g)&&(f=null),g||S===null?v(c)&&(f===null?a.removeAttribute(c):a.setAttribute(c,""+f)):S.mustUseProperty?a[S.propertyName]=f===null?S.type===3?!1:"":f:(c=S.attributeName,g=S.attributeNamespace,f===null?a.removeAttribute(c):(S=S.type,f=S===3||S===4&&f===!0?"":""+f,g?a.setAttributeNS(g,c,f):a.setAttribute(c,f))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_=Symbol.for("react.element"),R=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),z=Symbol.for("react.provider"),G=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),V=Symbol.for("react.lazy"),O=Symbol.for("react.offscreen"),A=Symbol.iterator;function B(a){return a===null||typeof a!="object"?null:(a=A&&a[A]||a["@@iterator"],typeof a=="function"?a:null)}var I=Object.assign,F;function Z(a){if(F===void 0)try{throw Error()}catch(f){var c=f.stack.trim().match(/\n( *(at )?)/);F=c&&c[1]||""}return`
77
- `+F+a}var ae=!1;function je(a,c){if(!a||ae)return"";ae=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(c)if(c=function(){throw Error()},Object.defineProperty(c.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(c,[])}catch(te){var g=te}Reflect.construct(a,[],c)}else{try{c.call()}catch(te){g=te}a.call(c.prototype)}else{try{throw Error()}catch(te){g=te}a()}}catch(te){if(te&&g&&typeof te.stack=="string"){for(var S=te.stack.split(`
78
- `),E=g.stack.split(`
79
- `),D=S.length-1,$=E.length-1;1<=D&&0<=$&&S[D]!==E[$];)$--;for(;1<=D&&0<=$;D--,$--)if(S[D]!==E[$]){if(D!==1||$!==1)do if(D--,$--,0>$||S[D]!==E[$]){var W=`
80
- `+S[D].replace(" at new "," at ");return a.displayName&&W.includes("<anonymous>")&&(W=W.replace("<anonymous>",a.displayName)),W}while(1<=D&&0<=$);break}}}finally{ae=!1,Error.prepareStackTrace=f}return(a=a?a.displayName||a.name:"")?Z(a):""}function me(a){switch(a.tag){case 5:return Z(a.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return a=je(a.type,!1),a;case 11:return a=je(a.type.render,!1),a;case 1:return a=je(a.type,!0),a;default:return""}}function xe(a){if(a==null)return null;if(typeof a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case M:return"Fragment";case R:return"Portal";case L:return"Profiler";case N:return"StrictMode";case Y:return"Suspense";case Q:return"SuspenseList"}if(typeof a=="object")switch(a.$$typeof){case G:return(a.displayName||"Context")+".Consumer";case z:return(a._context.displayName||"Context")+".Provider";case q:var c=a.render;return a=a.displayName,a||(a=c.displayName||c.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case ne:return c=a.displayName||null,c!==null?c:xe(a.type)||"Memo";case V:c=a._payload,a=a._init;try{return xe(a(c))}catch{}}return null}function Te(a){var c=a.type;switch(a.tag){case 24:return"Cache";case 9:return(c.displayName||"Context")+".Consumer";case 10:return(c._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return a=c.render,a=a.displayName||a.name||"",c.displayName||(a!==""?"ForwardRef("+a+")":"ForwardRef");case 7:return"Fragment";case 5:return c;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return xe(c);case 8:return c===N?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof c=="function")return c.displayName||c.name||null;if(typeof c=="string")return c}return null}function le(a){switch(typeof a){case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function et(a){var c=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(c==="checkbox"||c==="radio")}function ht(a){var c=et(a)?"checked":"value",f=Object.getOwnPropertyDescriptor(a.constructor.prototype,c),g=""+a[c];if(!a.hasOwnProperty(c)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var S=f.get,E=f.set;return Object.defineProperty(a,c,{configurable:!0,get:function(){return S.call(this)},set:function(D){g=""+D,E.call(this,D)}}),Object.defineProperty(a,c,{enumerable:f.enumerable}),{getValue:function(){return g},setValue:function(D){g=""+D},stopTracking:function(){a._valueTracker=null,delete a[c]}}}}function ct(a){a._valueTracker||(a._valueTracker=ht(a))}function St(a){if(!a)return!1;var c=a._valueTracker;if(!c)return!0;var f=c.getValue(),g="";return a&&(g=et(a)?a.checked?"true":"false":a.value),a=g,a!==f?(c.setValue(a),!0):!1}function Et(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}function Tt(a,c){var f=c.checked;return I({},c,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:f??a._wrapperState.initialChecked})}function vt(a,c){var f=c.defaultValue==null?"":c.defaultValue,g=c.checked!=null?c.checked:c.defaultChecked;f=le(c.value!=null?c.value:f),a._wrapperState={initialChecked:g,initialValue:f,controlled:c.type==="checkbox"||c.type==="radio"?c.checked!=null:c.value!=null}}function _t(a,c){c=c.checked,c!=null&&k(a,"checked",c,!1)}function we(a,c){_t(a,c);var f=le(c.value),g=c.type;if(f!=null)g==="number"?(f===0&&a.value===""||a.value!=f)&&(a.value=""+f):a.value!==""+f&&(a.value=""+f);else if(g==="submit"||g==="reset"){a.removeAttribute("value");return}c.hasOwnProperty("value")?ke(a,c.type,f):c.hasOwnProperty("defaultValue")&&ke(a,c.type,le(c.defaultValue)),c.checked==null&&c.defaultChecked!=null&&(a.defaultChecked=!!c.defaultChecked)}function Re(a,c,f){if(c.hasOwnProperty("value")||c.hasOwnProperty("defaultValue")){var g=c.type;if(!(g!=="submit"&&g!=="reset"||c.value!==void 0&&c.value!==null))return;c=""+a._wrapperState.initialValue,f||c===a.value||(a.value=c),a.defaultValue=c}f=a.name,f!==""&&(a.name=""),a.defaultChecked=!!a._wrapperState.initialChecked,f!==""&&(a.name=f)}function ke(a,c,f){(c!=="number"||Et(a.ownerDocument)!==a)&&(f==null?a.defaultValue=""+a._wrapperState.initialValue:a.defaultValue!==""+f&&(a.defaultValue=""+f))}var _e=Array.isArray;function ce(a,c,f,g){if(a=a.options,c){c={};for(var S=0;S<f.length;S++)c["$"+f[S]]=!0;for(f=0;f<a.length;f++)S=c.hasOwnProperty("$"+a[f].value),a[f].selected!==S&&(a[f].selected=S),S&&g&&(a[f].defaultSelected=!0)}else{for(f=""+le(f),c=null,S=0;S<a.length;S++){if(a[S].value===f){a[S].selected=!0,g&&(a[S].defaultSelected=!0);return}c!==null||a[S].disabled||(c=a[S])}c!==null&&(c.selected=!0)}}function ve(a,c){if(c.dangerouslySetInnerHTML!=null)throw Error(n(91));return I({},c,{value:void 0,defaultValue:void 0,children:""+a._wrapperState.initialValue})}function Me(a,c){var f=c.value;if(f==null){if(f=c.children,c=c.defaultValue,f!=null){if(c!=null)throw Error(n(92));if(_e(f)){if(1<f.length)throw Error(n(93));f=f[0]}c=f}c==null&&(c=""),f=c}a._wrapperState={initialValue:le(f)}}function ue(a,c){var f=le(c.value),g=le(c.defaultValue);f!=null&&(f=""+f,f!==a.value&&(a.value=f),c.defaultValue==null&&a.defaultValue!==f&&(a.defaultValue=f)),g!=null&&(a.defaultValue=""+g)}function Ue(a){var c=a.textContent;c===a._wrapperState.initialValue&&c!==""&&c!==null&&(a.value=c)}function bt(a){switch(a){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function jt(a,c){return a==null||a==="http://www.w3.org/1999/xhtml"?bt(c):a==="http://www.w3.org/2000/svg"&&c==="foreignObject"?"http://www.w3.org/1999/xhtml":a}var Dt,mn=function(a){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(c,f,g,S){MSApp.execUnsafeLocalFunction(function(){return a(c,f,g,S)})}:a}(function(a,c){if(a.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in a)a.innerHTML=c;else{for(Dt=Dt||document.createElement("div"),Dt.innerHTML="<svg>"+c.valueOf().toString()+"</svg>",c=Dt.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;c.firstChild;)a.appendChild(c.firstChild)}});function ft(a,c){if(c){var f=a.firstChild;if(f&&f===a.lastChild&&f.nodeType===3){f.nodeValue=c;return}}a.textContent=c}var wn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yn=["Webkit","ms","Moz","O"];Object.keys(wn).forEach(function(a){Yn.forEach(function(c){c=c+a.charAt(0).toUpperCase()+a.substring(1),wn[c]=wn[a]})});function Ji(a,c,f){return c==null||typeof c=="boolean"||c===""?"":f||typeof c!="number"||c===0||wn.hasOwnProperty(a)&&wn[a]?(""+c).trim():c+"px"}function Ts(a,c){a=a.style;for(var f in c)if(c.hasOwnProperty(f)){var g=f.indexOf("--")===0,S=Ji(f,c[f],g);f==="float"&&(f="cssFloat"),g?a.setProperty(f,S):a[f]=S}}var Ia=I({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function or(a,c){if(c){if(Ia[a]&&(c.children!=null||c.dangerouslySetInnerHTML!=null))throw Error(n(137,a));if(c.dangerouslySetInnerHTML!=null){if(c.children!=null)throw Error(n(60));if(typeof c.dangerouslySetInnerHTML!="object"||!("__html"in c.dangerouslySetInnerHTML))throw Error(n(61))}if(c.style!=null&&typeof c.style!="object")throw Error(n(62))}}function Di(a,c){if(a.indexOf("-")===-1)return typeof c.is=="string";switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Ii=null;function Oo(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Ai=null,mr=null,Ur=null;function Vr(a){if(a=xc(a)){if(typeof Ai!="function")throw Error(n(280));var c=a.stateNode;c&&(c=ad(c),Ai(a.stateNode,a.type,c))}}function Wn(a){mr?Ur?Ur.push(a):Ur=[a]:mr=a}function Ps(){if(mr){var a=mr,c=Ur;if(Ur=mr=null,Vr(a),c)for(a=0;a<c.length;a++)Vr(c[a])}}function Lo(a,c){return a(c)}function Zi(){}var Rs=!1;function Tn(a,c,f){if(Rs)return a(c,f);Rs=!0;try{return Lo(a,c,f)}finally{Rs=!1,(mr!==null||Ur!==null)&&(Zi(),Ps())}}function U(a,c){var f=a.stateNode;if(f===null)return null;var g=ad(f);if(g===null)return null;f=g[c];e:switch(c){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(a=a.type,g=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!g;break e;default:a=!1}if(a)return null;if(f&&typeof f!="function")throw Error(n(231,c,typeof f));return f}var K=!1;if(u)try{var ee={};Object.defineProperty(ee,"passive",{get:function(){K=!0}}),window.addEventListener("test",ee,ee),window.removeEventListener("test",ee,ee)}catch{K=!1}function de(a,c,f,g,S,E,D,$,W){var te=Array.prototype.slice.call(arguments,3);try{c.apply(f,te)}catch(he){this.onError(he)}}var De=!1,Qe=null,st=!1,$e=null,We={onError:function(a){De=!0,Qe=a}};function Fe(a,c,f,g,S,E,D,$,W){De=!1,Qe=null,de.apply(We,arguments)}function Je(a,c,f,g,S,E,D,$,W){if(Fe.apply(this,arguments),De){if(De){var te=Qe;De=!1,Qe=null}else throw Error(n(198));st||(st=!0,$e=te)}}function Ve(a){var c=a,f=a;if(a.alternate)for(;c.return;)c=c.return;else{a=c;do c=a,c.flags&4098&&(f=c.return),a=c.return;while(a)}return c.tag===3?f:null}function mt(a){if(a.tag===13){var c=a.memoizedState;if(c===null&&(a=a.alternate,a!==null&&(c=a.memoizedState)),c!==null)return c.dehydrated}return null}function gn(a){if(Ve(a)!==a)throw Error(n(188))}function Lt(a){var c=a.alternate;if(!c){if(c=Ve(a),c===null)throw Error(n(188));return c!==a?null:a}for(var f=a,g=c;;){var S=f.return;if(S===null)break;var E=S.alternate;if(E===null){if(g=S.return,g!==null){f=g;continue}break}if(S.child===E.child){for(E=S.child;E;){if(E===f)return gn(S),a;if(E===g)return gn(S),c;E=E.sibling}throw Error(n(188))}if(f.return!==g.return)f=S,g=E;else{for(var D=!1,$=S.child;$;){if($===f){D=!0,f=S,g=E;break}if($===g){D=!0,g=S,f=E;break}$=$.sibling}if(!D){for($=E.child;$;){if($===f){D=!0,f=E,g=S;break}if($===g){D=!0,g=E,f=S;break}$=$.sibling}if(!D)throw Error(n(189))}}if(f.alternate!==g)throw Error(n(190))}if(f.tag!==3)throw Error(n(188));return f.stateNode.current===f?a:c}function Ct(a){return a=Lt(a),a!==null?nn(a):null}function nn(a){if(a.tag===5||a.tag===6)return a;for(a=a.child;a!==null;){var c=nn(a);if(c!==null)return c;a=a.sibling}return null}var eo=t.unstable_scheduleCallback,$o=t.unstable_cancelCallback,ci=t.unstable_shouldYield,Wr=t.unstable_requestPaint,rn=t.unstable_now,_s=t.unstable_getCurrentPriorityLevel,ui=t.unstable_ImmediatePriority,Ds=t.unstable_UserBlockingPriority,to=t.unstable_NormalPriority,Pt=t.unstable_LowPriority,on=t.unstable_IdlePriority,di=null,Xn=null;function Sn(a){if(Xn&&typeof Xn.onCommitFiberRoot=="function")try{Xn.onCommitFiberRoot(di,a,void 0,(a.current.flags&128)===128)}catch{}}var Fn=Math.clz32?Math.clz32:UR,Uu=Math.log,eh=Math.LN2;function UR(a){return a>>>=0,a===0?32:31-(Uu(a)/eh|0)|0}var Vu=64,Wu=4194304;function tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return a}}function Hu(a,c){var f=a.pendingLanes;if(f===0)return 0;var g=0,S=a.suspendedLanes,E=a.pingedLanes,D=f&268435455;if(D!==0){var $=D&~S;$!==0?g=tc($):(E&=D,E!==0&&(g=tc(E)))}else D=f&~S,D!==0?g=tc(D):E!==0&&(g=tc(E));if(g===0)return 0;if(c!==0&&c!==g&&!(c&S)&&(S=g&-g,E=c&-c,S>=E||S===16&&(E&4194240)!==0))return c;if(g&4&&(g|=f&16),c=a.entangledLanes,c!==0)for(a=a.entanglements,c&=g;0<c;)f=31-Fn(c),S=1<<f,g|=a[f],c&=~S;return g}function VR(a,c){switch(a){case 1:case 2:case 4:return c+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return c+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function WR(a,c){for(var f=a.suspendedLanes,g=a.pingedLanes,S=a.expirationTimes,E=a.pendingLanes;0<E;){var D=31-Fn(E),$=1<<D,W=S[D];W===-1?(!($&f)||$&g)&&(S[D]=VR($,c)):W<=c&&(a.expiredLanes|=$),E&=~$}}function th(a){return a=a.pendingLanes&-1073741825,a!==0?a:a&1073741824?1073741824:0}function sb(){var a=Vu;return Vu<<=1,!(Vu&4194240)&&(Vu=64),a}function nh(a){for(var c=[],f=0;31>f;f++)c.push(a);return c}function nc(a,c,f){a.pendingLanes|=c,c!==536870912&&(a.suspendedLanes=0,a.pingedLanes=0),a=a.eventTimes,c=31-Fn(c),a[c]=f}function HR(a,c){var f=a.pendingLanes&~c;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.expiredLanes&=c,a.mutableReadLanes&=c,a.entangledLanes&=c,c=a.entanglements;var g=a.eventTimes;for(a=a.expirationTimes;0<f;){var S=31-Fn(f),E=1<<S;c[S]=0,g[S]=-1,a[S]=-1,f&=~E}}function rh(a,c){var f=a.entangledLanes|=c;for(a=a.entanglements;f;){var g=31-Fn(f),S=1<<g;S&c|a[g]&c&&(a[g]|=c),f&=~S}}var Bt=0;function ab(a){return a&=-a,1<a?4<a?a&268435455?16:536870912:4:1}var lb,ih,cb,ub,db,oh=!1,qu=[],Fo=null,zo=null,Bo=null,rc=new Map,ic=new Map,Uo=[],qR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function fb(a,c){switch(a){case"focusin":case"focusout":Fo=null;break;case"dragenter":case"dragleave":zo=null;break;case"mouseover":case"mouseout":Bo=null;break;case"pointerover":case"pointerout":rc.delete(c.pointerId);break;case"gotpointercapture":case"lostpointercapture":ic.delete(c.pointerId)}}function oc(a,c,f,g,S,E){return a===null||a.nativeEvent!==E?(a={blockedOn:c,domEventName:f,eventSystemFlags:g,nativeEvent:E,targetContainers:[S]},c!==null&&(c=xc(c),c!==null&&ih(c)),a):(a.eventSystemFlags|=g,c=a.targetContainers,S!==null&&c.indexOf(S)===-1&&c.push(S),a)}function GR(a,c,f,g,S){switch(c){case"focusin":return Fo=oc(Fo,a,c,f,g,S),!0;case"dragenter":return zo=oc(zo,a,c,f,g,S),!0;case"mouseover":return Bo=oc(Bo,a,c,f,g,S),!0;case"pointerover":var E=S.pointerId;return rc.set(E,oc(rc.get(E)||null,a,c,f,g,S)),!0;case"gotpointercapture":return E=S.pointerId,ic.set(E,oc(ic.get(E)||null,a,c,f,g,S)),!0}return!1}function pb(a){var c=Is(a.target);if(c!==null){var f=Ve(c);if(f!==null){if(c=f.tag,c===13){if(c=mt(f),c!==null){a.blockedOn=c,db(a.priority,function(){cb(f)});return}}else if(c===3&&f.stateNode.current.memoizedState.isDehydrated){a.blockedOn=f.tag===3?f.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Gu(a){if(a.blockedOn!==null)return!1;for(var c=a.targetContainers;0<c.length;){var f=ah(a.domEventName,a.eventSystemFlags,c[0],a.nativeEvent);if(f===null){f=a.nativeEvent;var g=new f.constructor(f.type,f);Ii=g,f.target.dispatchEvent(g),Ii=null}else return c=xc(f),c!==null&&ih(c),a.blockedOn=f,!1;c.shift()}return!0}function hb(a,c,f){Gu(a)&&f.delete(c)}function QR(){oh=!1,Fo!==null&&Gu(Fo)&&(Fo=null),zo!==null&&Gu(zo)&&(zo=null),Bo!==null&&Gu(Bo)&&(Bo=null),rc.forEach(hb),ic.forEach(hb)}function sc(a,c){a.blockedOn===c&&(a.blockedOn=null,oh||(oh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,QR)))}function ac(a){function c(S){return sc(S,a)}if(0<qu.length){sc(qu[0],a);for(var f=1;f<qu.length;f++){var g=qu[f];g.blockedOn===a&&(g.blockedOn=null)}}for(Fo!==null&&sc(Fo,a),zo!==null&&sc(zo,a),Bo!==null&&sc(Bo,a),rc.forEach(c),ic.forEach(c),f=0;f<Uo.length;f++)g=Uo[f],g.blockedOn===a&&(g.blockedOn=null);for(;0<Uo.length&&(f=Uo[0],f.blockedOn===null);)pb(f),f.blockedOn===null&&Uo.shift()}var Aa=C.ReactCurrentBatchConfig,Qu=!0;function KR(a,c,f,g){var S=Bt,E=Aa.transition;Aa.transition=null;try{Bt=1,sh(a,c,f,g)}finally{Bt=S,Aa.transition=E}}function YR(a,c,f,g){var S=Bt,E=Aa.transition;Aa.transition=null;try{Bt=4,sh(a,c,f,g)}finally{Bt=S,Aa.transition=E}}function sh(a,c,f,g){if(Qu){var S=ah(a,c,f,g);if(S===null)Ch(a,c,g,Ku,f),fb(a,g);else if(GR(S,a,c,f,g))g.stopPropagation();else if(fb(a,g),c&4&&-1<qR.indexOf(a)){for(;S!==null;){var E=xc(S);if(E!==null&&lb(E),E=ah(a,c,f,g),E===null&&Ch(a,c,g,Ku,f),E===S)break;S=E}S!==null&&g.stopPropagation()}else Ch(a,c,g,null,f)}}var Ku=null;function ah(a,c,f,g){if(Ku=null,a=Oo(g),a=Is(a),a!==null)if(c=Ve(a),c===null)a=null;else if(f=c.tag,f===13){if(a=mt(c),a!==null)return a;a=null}else if(f===3){if(c.stateNode.current.memoizedState.isDehydrated)return c.tag===3?c.stateNode.containerInfo:null;a=null}else c!==a&&(a=null);return Ku=a,null}function mb(a){switch(a){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(_s()){case ui:return 1;case Ds:return 4;case to:case Pt:return 16;case on:return 536870912;default:return 16}default:return 16}}var Vo=null,lh=null,Yu=null;function gb(){if(Yu)return Yu;var a,c=lh,f=c.length,g,S="value"in Vo?Vo.value:Vo.textContent,E=S.length;for(a=0;a<f&&c[a]===S[a];a++);var D=f-a;for(g=1;g<=D&&c[f-g]===S[E-g];g++);return Yu=S.slice(a,1<g?1-g:void 0)}function Xu(a){var c=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&c===13&&(a=13)):a=c,a===10&&(a=13),32<=a||a===13?a:0}function Ju(){return!0}function yb(){return!1}function Ir(a){function c(f,g,S,E,D){this._reactName=f,this._targetInst=S,this.type=g,this.nativeEvent=E,this.target=D,this.currentTarget=null;for(var $ in a)a.hasOwnProperty($)&&(f=a[$],this[$]=f?f(E):E[$]);return this.isDefaultPrevented=(E.defaultPrevented!=null?E.defaultPrevented:E.returnValue===!1)?Ju:yb,this.isPropagationStopped=yb,this}return I(c.prototype,{preventDefault:function(){this.defaultPrevented=!0;var f=this.nativeEvent;f&&(f.preventDefault?f.preventDefault():typeof f.returnValue!="unknown"&&(f.returnValue=!1),this.isDefaultPrevented=Ju)},stopPropagation:function(){var f=this.nativeEvent;f&&(f.stopPropagation?f.stopPropagation():typeof f.cancelBubble!="unknown"&&(f.cancelBubble=!0),this.isPropagationStopped=Ju)},persist:function(){},isPersistent:Ju}),c}var Na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ch=Ir(Na),lc=I({},Na,{view:0,detail:0}),XR=Ir(lc),uh,dh,cc,Zu=I({},lc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ph,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==cc&&(cc&&a.type==="mousemove"?(uh=a.screenX-cc.screenX,dh=a.screenY-cc.screenY):dh=uh=0,cc=a),uh)},movementY:function(a){return"movementY"in a?a.movementY:dh}}),vb=Ir(Zu),JR=I({},Zu,{dataTransfer:0}),ZR=Ir(JR),e2=I({},lc,{relatedTarget:0}),fh=Ir(e2),t2=I({},Na,{animationName:0,elapsedTime:0,pseudoElement:0}),n2=Ir(t2),r2=I({},Na,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),i2=Ir(r2),o2=I({},Na,{data:0}),xb=Ir(o2),s2={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a2={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"},l2={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function c2(a){var c=this.nativeEvent;return c.getModifierState?c.getModifierState(a):(a=l2[a])?!!c[a]:!1}function ph(){return c2}var u2=I({},lc,{key:function(a){if(a.key){var c=s2[a.key]||a.key;if(c!=="Unidentified")return c}return a.type==="keypress"?(a=Xu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?a2[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ph,charCode:function(a){return a.type==="keypress"?Xu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Xu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),d2=Ir(u2),f2=I({},Zu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),bb=Ir(f2),p2=I({},lc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ph}),h2=Ir(p2),m2=I({},Na,{propertyName:0,elapsedTime:0,pseudoElement:0}),g2=Ir(m2),y2=I({},Zu,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),v2=Ir(y2),x2=[9,13,27,32],hh=u&&"CompositionEvent"in window,uc=null;u&&"documentMode"in document&&(uc=document.documentMode);var b2=u&&"TextEvent"in window&&!uc,wb=u&&(!hh||uc&&8<uc&&11>=uc),Sb=" ",jb=!1;function Cb(a,c){switch(a){case"keyup":return x2.indexOf(c.keyCode)!==-1;case"keydown":return c.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eb(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Ma=!1;function w2(a,c){switch(a){case"compositionend":return Eb(c);case"keypress":return c.which!==32?null:(jb=!0,Sb);case"textInput":return a=c.data,a===Sb&&jb?null:a;default:return null}}function S2(a,c){if(Ma)return a==="compositionend"||!hh&&Cb(a,c)?(a=gb(),Yu=lh=Vo=null,Ma=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(c.ctrlKey||c.altKey||c.metaKey)||c.ctrlKey&&c.altKey){if(c.char&&1<c.char.length)return c.char;if(c.which)return String.fromCharCode(c.which)}return null;case"compositionend":return wb&&c.locale!=="ko"?null:c.data;default:return null}}var j2={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 kb(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c==="input"?!!j2[a.type]:c==="textarea"}function Tb(a,c,f,g){Wn(g),c=id(c,"onChange"),0<c.length&&(f=new ch("onChange","change",null,f,g),a.push({event:f,listeners:c}))}var dc=null,fc=null;function C2(a){Hb(a,0)}function ed(a){var c=za(a);if(St(c))return a}function E2(a,c){if(a==="change")return c}var Pb=!1;if(u){var mh;if(u){var gh="oninput"in document;if(!gh){var Rb=document.createElement("div");Rb.setAttribute("oninput","return;"),gh=typeof Rb.oninput=="function"}mh=gh}else mh=!1;Pb=mh&&(!document.documentMode||9<document.documentMode)}function _b(){dc&&(dc.detachEvent("onpropertychange",Db),fc=dc=null)}function Db(a){if(a.propertyName==="value"&&ed(fc)){var c=[];Tb(c,fc,a,Oo(a)),Tn(C2,c)}}function k2(a,c,f){a==="focusin"?(_b(),dc=c,fc=f,dc.attachEvent("onpropertychange",Db)):a==="focusout"&&_b()}function T2(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return ed(fc)}function P2(a,c){if(a==="click")return ed(c)}function R2(a,c){if(a==="input"||a==="change")return ed(c)}function _2(a,c){return a===c&&(a!==0||1/a===1/c)||a!==a&&c!==c}var fi=typeof Object.is=="function"?Object.is:_2;function pc(a,c){if(fi(a,c))return!0;if(typeof a!="object"||a===null||typeof c!="object"||c===null)return!1;var f=Object.keys(a),g=Object.keys(c);if(f.length!==g.length)return!1;for(g=0;g<f.length;g++){var S=f[g];if(!d.call(c,S)||!fi(a[S],c[S]))return!1}return!0}function Ib(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ab(a,c){var f=Ib(a);a=0;for(var g;f;){if(f.nodeType===3){if(g=a+f.textContent.length,a<=c&&g>=c)return{node:f,offset:c-a};a=g}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=Ib(f)}}function Nb(a,c){return a&&c?a===c?!0:a&&a.nodeType===3?!1:c&&c.nodeType===3?Nb(a,c.parentNode):"contains"in a?a.contains(c):a.compareDocumentPosition?!!(a.compareDocumentPosition(c)&16):!1:!1}function Mb(){for(var a=window,c=Et();c instanceof a.HTMLIFrameElement;){try{var f=typeof c.contentWindow.location.href=="string"}catch{f=!1}if(f)a=c.contentWindow;else break;c=Et(a.document)}return c}function yh(a){var c=a&&a.nodeName&&a.nodeName.toLowerCase();return c&&(c==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||c==="textarea"||a.contentEditable==="true")}function D2(a){var c=Mb(),f=a.focusedElem,g=a.selectionRange;if(c!==f&&f&&f.ownerDocument&&Nb(f.ownerDocument.documentElement,f)){if(g!==null&&yh(f)){if(c=g.start,a=g.end,a===void 0&&(a=c),"selectionStart"in f)f.selectionStart=c,f.selectionEnd=Math.min(a,f.value.length);else if(a=(c=f.ownerDocument||document)&&c.defaultView||window,a.getSelection){a=a.getSelection();var S=f.textContent.length,E=Math.min(g.start,S);g=g.end===void 0?E:Math.min(g.end,S),!a.extend&&E>g&&(S=g,g=E,E=S),S=Ab(f,E);var D=Ab(f,g);S&&D&&(a.rangeCount!==1||a.anchorNode!==S.node||a.anchorOffset!==S.offset||a.focusNode!==D.node||a.focusOffset!==D.offset)&&(c=c.createRange(),c.setStart(S.node,S.offset),a.removeAllRanges(),E>g?(a.addRange(c),a.extend(D.node,D.offset)):(c.setEnd(D.node,D.offset),a.addRange(c)))}}for(c=[],a=f;a=a.parentNode;)a.nodeType===1&&c.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof f.focus=="function"&&f.focus(),f=0;f<c.length;f++)a=c[f],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var I2=u&&"documentMode"in document&&11>=document.documentMode,Oa=null,vh=null,hc=null,xh=!1;function Ob(a,c,f){var g=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;xh||Oa==null||Oa!==Et(g)||(g=Oa,"selectionStart"in g&&yh(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),hc&&pc(hc,g)||(hc=g,g=id(vh,"onSelect"),0<g.length&&(c=new ch("onSelect","select",null,c,f),a.push({event:c,listeners:g}),c.target=Oa)))}function td(a,c){var f={};return f[a.toLowerCase()]=c.toLowerCase(),f["Webkit"+a]="webkit"+c,f["Moz"+a]="moz"+c,f}var La={animationend:td("Animation","AnimationEnd"),animationiteration:td("Animation","AnimationIteration"),animationstart:td("Animation","AnimationStart"),transitionend:td("Transition","TransitionEnd")},bh={},Lb={};u&&(Lb=document.createElement("div").style,"AnimationEvent"in window||(delete La.animationend.animation,delete La.animationiteration.animation,delete La.animationstart.animation),"TransitionEvent"in window||delete La.transitionend.transition);function nd(a){if(bh[a])return bh[a];if(!La[a])return a;var c=La[a],f;for(f in c)if(c.hasOwnProperty(f)&&f in Lb)return bh[a]=c[f];return a}var $b=nd("animationend"),Fb=nd("animationiteration"),zb=nd("animationstart"),Bb=nd("transitionend"),Ub=new Map,Vb="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Wo(a,c){Ub.set(a,c),s(c,[a])}for(var wh=0;wh<Vb.length;wh++){var Sh=Vb[wh],A2=Sh.toLowerCase(),N2=Sh[0].toUpperCase()+Sh.slice(1);Wo(A2,"on"+N2)}Wo($b,"onAnimationEnd"),Wo(Fb,"onAnimationIteration"),Wo(zb,"onAnimationStart"),Wo("dblclick","onDoubleClick"),Wo("focusin","onFocus"),Wo("focusout","onBlur"),Wo(Bb,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),s("onBeforeInput",["compositionend","keypress","textInput","paste"]),s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mc="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(" "),M2=new Set("cancel close invalid load scroll toggle".split(" ").concat(mc));function Wb(a,c,f){var g=a.type||"unknown-event";a.currentTarget=f,Je(g,c,void 0,a),a.currentTarget=null}function Hb(a,c){c=(c&4)!==0;for(var f=0;f<a.length;f++){var g=a[f],S=g.event;g=g.listeners;e:{var E=void 0;if(c)for(var D=g.length-1;0<=D;D--){var $=g[D],W=$.instance,te=$.currentTarget;if($=$.listener,W!==E&&S.isPropagationStopped())break e;Wb(S,$,te),E=W}else for(D=0;D<g.length;D++){if($=g[D],W=$.instance,te=$.currentTarget,$=$.listener,W!==E&&S.isPropagationStopped())break e;Wb(S,$,te),E=W}}}if(st)throw a=$e,st=!1,$e=null,a}function sn(a,c){var f=c[_h];f===void 0&&(f=c[_h]=new Set);var g=a+"__bubble";f.has(g)||(qb(c,a,2,!1),f.add(g))}function jh(a,c,f){var g=0;c&&(g|=4),qb(f,a,g,c)}var rd="_reactListening"+Math.random().toString(36).slice(2);function gc(a){if(!a[rd]){a[rd]=!0,r.forEach(function(f){f!=="selectionchange"&&(M2.has(f)||jh(f,!1,a),jh(f,!0,a))});var c=a.nodeType===9?a:a.ownerDocument;c===null||c[rd]||(c[rd]=!0,jh("selectionchange",!1,c))}}function qb(a,c,f,g){switch(mb(c)){case 1:var S=KR;break;case 4:S=YR;break;default:S=sh}f=S.bind(null,c,f,a),S=void 0,!K||c!=="touchstart"&&c!=="touchmove"&&c!=="wheel"||(S=!0),g?S!==void 0?a.addEventListener(c,f,{capture:!0,passive:S}):a.addEventListener(c,f,!0):S!==void 0?a.addEventListener(c,f,{passive:S}):a.addEventListener(c,f,!1)}function Ch(a,c,f,g,S){var E=g;if(!(c&1)&&!(c&2)&&g!==null)e:for(;;){if(g===null)return;var D=g.tag;if(D===3||D===4){var $=g.stateNode.containerInfo;if($===S||$.nodeType===8&&$.parentNode===S)break;if(D===4)for(D=g.return;D!==null;){var W=D.tag;if((W===3||W===4)&&(W=D.stateNode.containerInfo,W===S||W.nodeType===8&&W.parentNode===S))return;D=D.return}for(;$!==null;){if(D=Is($),D===null)return;if(W=D.tag,W===5||W===6){g=E=D;continue e}$=$.parentNode}}g=g.return}Tn(function(){var te=E,he=Oo(f),ge=[];e:{var pe=Ub.get(a);if(pe!==void 0){var Oe=ch,Ge=a;switch(a){case"keypress":if(Xu(f)===0)break e;case"keydown":case"keyup":Oe=d2;break;case"focusin":Ge="focus",Oe=fh;break;case"focusout":Ge="blur",Oe=fh;break;case"beforeblur":case"afterblur":Oe=fh;break;case"click":if(f.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Oe=vb;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Oe=ZR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Oe=h2;break;case $b:case Fb:case zb:Oe=n2;break;case Bb:Oe=g2;break;case"scroll":Oe=XR;break;case"wheel":Oe=v2;break;case"copy":case"cut":case"paste":Oe=i2;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Oe=bb}var Ye=(c&4)!==0,Pn=!Ye&&a==="scroll",X=Ye?pe!==null?pe+"Capture":null:pe;Ye=[];for(var H=te,J;H!==null;){J=H;var Ce=J.stateNode;if(J.tag===5&&Ce!==null&&(J=Ce,X!==null&&(Ce=U(H,X),Ce!=null&&Ye.push(yc(H,Ce,J)))),Pn)break;H=H.return}0<Ye.length&&(pe=new Oe(pe,Ge,null,f,he),ge.push({event:pe,listeners:Ye}))}}if(!(c&7)){e:{if(pe=a==="mouseover"||a==="pointerover",Oe=a==="mouseout"||a==="pointerout",pe&&f!==Ii&&(Ge=f.relatedTarget||f.fromElement)&&(Is(Ge)||Ge[no]))break e;if((Oe||pe)&&(pe=he.window===he?he:(pe=he.ownerDocument)?pe.defaultView||pe.parentWindow:window,Oe?(Ge=f.relatedTarget||f.toElement,Oe=te,Ge=Ge?Is(Ge):null,Ge!==null&&(Pn=Ve(Ge),Ge!==Pn||Ge.tag!==5&&Ge.tag!==6)&&(Ge=null)):(Oe=null,Ge=te),Oe!==Ge)){if(Ye=vb,Ce="onMouseLeave",X="onMouseEnter",H="mouse",(a==="pointerout"||a==="pointerover")&&(Ye=bb,Ce="onPointerLeave",X="onPointerEnter",H="pointer"),Pn=Oe==null?pe:za(Oe),J=Ge==null?pe:za(Ge),pe=new Ye(Ce,H+"leave",Oe,f,he),pe.target=Pn,pe.relatedTarget=J,Ce=null,Is(he)===te&&(Ye=new Ye(X,H+"enter",Ge,f,he),Ye.target=J,Ye.relatedTarget=Pn,Ce=Ye),Pn=Ce,Oe&&Ge)t:{for(Ye=Oe,X=Ge,H=0,J=Ye;J;J=$a(J))H++;for(J=0,Ce=X;Ce;Ce=$a(Ce))J++;for(;0<H-J;)Ye=$a(Ye),H--;for(;0<J-H;)X=$a(X),J--;for(;H--;){if(Ye===X||X!==null&&Ye===X.alternate)break t;Ye=$a(Ye),X=$a(X)}Ye=null}else Ye=null;Oe!==null&&Gb(ge,pe,Oe,Ye,!1),Ge!==null&&Pn!==null&&Gb(ge,Pn,Ge,Ye,!0)}}e:{if(pe=te?za(te):window,Oe=pe.nodeName&&pe.nodeName.toLowerCase(),Oe==="select"||Oe==="input"&&pe.type==="file")var Ze=E2;else if(kb(pe))if(Pb)Ze=R2;else{Ze=T2;var it=k2}else(Oe=pe.nodeName)&&Oe.toLowerCase()==="input"&&(pe.type==="checkbox"||pe.type==="radio")&&(Ze=P2);if(Ze&&(Ze=Ze(a,te))){Tb(ge,Ze,f,he);break e}it&&it(a,pe,te),a==="focusout"&&(it=pe._wrapperState)&&it.controlled&&pe.type==="number"&&ke(pe,"number",pe.value)}switch(it=te?za(te):window,a){case"focusin":(kb(it)||it.contentEditable==="true")&&(Oa=it,vh=te,hc=null);break;case"focusout":hc=vh=Oa=null;break;case"mousedown":xh=!0;break;case"contextmenu":case"mouseup":case"dragend":xh=!1,Ob(ge,f,he);break;case"selectionchange":if(I2)break;case"keydown":case"keyup":Ob(ge,f,he)}var ot;if(hh)e:{switch(a){case"compositionstart":var ut="onCompositionStart";break e;case"compositionend":ut="onCompositionEnd";break e;case"compositionupdate":ut="onCompositionUpdate";break e}ut=void 0}else Ma?Cb(a,f)&&(ut="onCompositionEnd"):a==="keydown"&&f.keyCode===229&&(ut="onCompositionStart");ut&&(wb&&f.locale!=="ko"&&(Ma||ut!=="onCompositionStart"?ut==="onCompositionEnd"&&Ma&&(ot=gb()):(Vo=he,lh="value"in Vo?Vo.value:Vo.textContent,Ma=!0)),it=id(te,ut),0<it.length&&(ut=new xb(ut,a,null,f,he),ge.push({event:ut,listeners:it}),ot?ut.data=ot:(ot=Eb(f),ot!==null&&(ut.data=ot)))),(ot=b2?w2(a,f):S2(a,f))&&(te=id(te,"onBeforeInput"),0<te.length&&(he=new xb("onBeforeInput","beforeinput",null,f,he),ge.push({event:he,listeners:te}),he.data=ot))}Hb(ge,c)})}function yc(a,c,f){return{instance:a,listener:c,currentTarget:f}}function id(a,c){for(var f=c+"Capture",g=[];a!==null;){var S=a,E=S.stateNode;S.tag===5&&E!==null&&(S=E,E=U(a,f),E!=null&&g.unshift(yc(a,E,S)),E=U(a,c),E!=null&&g.push(yc(a,E,S))),a=a.return}return g}function $a(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5);return a||null}function Gb(a,c,f,g,S){for(var E=c._reactName,D=[];f!==null&&f!==g;){var $=f,W=$.alternate,te=$.stateNode;if(W!==null&&W===g)break;$.tag===5&&te!==null&&($=te,S?(W=U(f,E),W!=null&&D.unshift(yc(f,W,$))):S||(W=U(f,E),W!=null&&D.push(yc(f,W,$)))),f=f.return}D.length!==0&&a.push({event:c,listeners:D})}var O2=/\r\n?/g,L2=/\u0000|\uFFFD/g;function Qb(a){return(typeof a=="string"?a:""+a).replace(O2,`
81
- `).replace(L2,"")}function od(a,c,f){if(c=Qb(c),Qb(a)!==c&&f)throw Error(n(425))}function sd(){}var Eh=null,kh=null;function Th(a,c){return a==="textarea"||a==="noscript"||typeof c.children=="string"||typeof c.children=="number"||typeof c.dangerouslySetInnerHTML=="object"&&c.dangerouslySetInnerHTML!==null&&c.dangerouslySetInnerHTML.__html!=null}var Ph=typeof setTimeout=="function"?setTimeout:void 0,$2=typeof clearTimeout=="function"?clearTimeout:void 0,Kb=typeof Promise=="function"?Promise:void 0,F2=typeof queueMicrotask=="function"?queueMicrotask:typeof Kb<"u"?function(a){return Kb.resolve(null).then(a).catch(z2)}:Ph;function z2(a){setTimeout(function(){throw a})}function Rh(a,c){var f=c,g=0;do{var S=f.nextSibling;if(a.removeChild(f),S&&S.nodeType===8)if(f=S.data,f==="/$"){if(g===0){a.removeChild(S),ac(c);return}g--}else f!=="$"&&f!=="$?"&&f!=="$!"||g++;f=S}while(f);ac(c)}function Ho(a){for(;a!=null;a=a.nextSibling){var c=a.nodeType;if(c===1||c===3)break;if(c===8){if(c=a.data,c==="$"||c==="$!"||c==="$?")break;if(c==="/$")return null}}return a}function Yb(a){a=a.previousSibling;for(var c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="$"||f==="$!"||f==="$?"){if(c===0)return a;c--}else f==="/$"&&c++}a=a.previousSibling}return null}var Fa=Math.random().toString(36).slice(2),Ni="__reactFiber$"+Fa,vc="__reactProps$"+Fa,no="__reactContainer$"+Fa,_h="__reactEvents$"+Fa,B2="__reactListeners$"+Fa,U2="__reactHandles$"+Fa;function Is(a){var c=a[Ni];if(c)return c;for(var f=a.parentNode;f;){if(c=f[no]||f[Ni]){if(f=c.alternate,c.child!==null||f!==null&&f.child!==null)for(a=Yb(a);a!==null;){if(f=a[Ni])return f;a=Yb(a)}return c}a=f,f=a.parentNode}return null}function xc(a){return a=a[Ni]||a[no],!a||a.tag!==5&&a.tag!==6&&a.tag!==13&&a.tag!==3?null:a}function za(a){if(a.tag===5||a.tag===6)return a.stateNode;throw Error(n(33))}function ad(a){return a[vc]||null}var Dh=[],Ba=-1;function qo(a){return{current:a}}function an(a){0>Ba||(a.current=Dh[Ba],Dh[Ba]=null,Ba--)}function Xt(a,c){Ba++,Dh[Ba]=a.current,a.current=c}var Go={},Jn=qo(Go),gr=qo(!1),As=Go;function Ua(a,c){var f=a.type.contextTypes;if(!f)return Go;var g=a.stateNode;if(g&&g.__reactInternalMemoizedUnmaskedChildContext===c)return g.__reactInternalMemoizedMaskedChildContext;var S={},E;for(E in f)S[E]=c[E];return g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=c,a.__reactInternalMemoizedMaskedChildContext=S),S}function yr(a){return a=a.childContextTypes,a!=null}function ld(){an(gr),an(Jn)}function Xb(a,c,f){if(Jn.current!==Go)throw Error(n(168));Xt(Jn,c),Xt(gr,f)}function Jb(a,c,f){var g=a.stateNode;if(c=c.childContextTypes,typeof g.getChildContext!="function")return f;g=g.getChildContext();for(var S in g)if(!(S in c))throw Error(n(108,Te(a)||"Unknown",S));return I({},f,g)}function cd(a){return a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Go,As=Jn.current,Xt(Jn,a),Xt(gr,gr.current),!0}function Zb(a,c,f){var g=a.stateNode;if(!g)throw Error(n(169));f?(a=Jb(a,c,As),g.__reactInternalMemoizedMergedChildContext=a,an(gr),an(Jn),Xt(Jn,a)):an(gr),Xt(gr,f)}var ro=null,ud=!1,Ih=!1;function e1(a){ro===null?ro=[a]:ro.push(a)}function V2(a){ud=!0,e1(a)}function Qo(){if(!Ih&&ro!==null){Ih=!0;var a=0,c=Bt;try{var f=ro;for(Bt=1;a<f.length;a++){var g=f[a];do g=g(!0);while(g!==null)}ro=null,ud=!1}catch(S){throw ro!==null&&(ro=ro.slice(a+1)),eo(ui,Qo),S}finally{Bt=c,Ih=!1}}return null}var Va=[],Wa=0,dd=null,fd=0,Hr=[],qr=0,Ns=null,io=1,oo="";function Ms(a,c){Va[Wa++]=fd,Va[Wa++]=dd,dd=a,fd=c}function t1(a,c,f){Hr[qr++]=io,Hr[qr++]=oo,Hr[qr++]=Ns,Ns=a;var g=io;a=oo;var S=32-Fn(g)-1;g&=~(1<<S),f+=1;var E=32-Fn(c)+S;if(30<E){var D=S-S%5;E=(g&(1<<D)-1).toString(32),g>>=D,S-=D,io=1<<32-Fn(c)+S|f<<S|g,oo=E+a}else io=1<<E|f<<S|g,oo=a}function Ah(a){a.return!==null&&(Ms(a,1),t1(a,1,0))}function Nh(a){for(;a===dd;)dd=Va[--Wa],Va[Wa]=null,fd=Va[--Wa],Va[Wa]=null;for(;a===Ns;)Ns=Hr[--qr],Hr[qr]=null,oo=Hr[--qr],Hr[qr]=null,io=Hr[--qr],Hr[qr]=null}var Ar=null,Nr=null,fn=!1,pi=null;function n1(a,c){var f=Yr(5,null,null,0);f.elementType="DELETED",f.stateNode=c,f.return=a,c=a.deletions,c===null?(a.deletions=[f],a.flags|=16):c.push(f)}function r1(a,c){switch(a.tag){case 5:var f=a.type;return c=c.nodeType!==1||f.toLowerCase()!==c.nodeName.toLowerCase()?null:c,c!==null?(a.stateNode=c,Ar=a,Nr=Ho(c.firstChild),!0):!1;case 6:return c=a.pendingProps===""||c.nodeType!==3?null:c,c!==null?(a.stateNode=c,Ar=a,Nr=null,!0):!1;case 13:return c=c.nodeType!==8?null:c,c!==null?(f=Ns!==null?{id:io,overflow:oo}:null,a.memoizedState={dehydrated:c,treeContext:f,retryLane:1073741824},f=Yr(18,null,null,0),f.stateNode=c,f.return=a,a.child=f,Ar=a,Nr=null,!0):!1;default:return!1}}function Mh(a){return(a.mode&1)!==0&&(a.flags&128)===0}function Oh(a){if(fn){var c=Nr;if(c){var f=c;if(!r1(a,c)){if(Mh(a))throw Error(n(418));c=Ho(f.nextSibling);var g=Ar;c&&r1(a,c)?n1(g,f):(a.flags=a.flags&-4097|2,fn=!1,Ar=a)}}else{if(Mh(a))throw Error(n(418));a.flags=a.flags&-4097|2,fn=!1,Ar=a}}}function i1(a){for(a=a.return;a!==null&&a.tag!==5&&a.tag!==3&&a.tag!==13;)a=a.return;Ar=a}function pd(a){if(a!==Ar)return!1;if(!fn)return i1(a),fn=!0,!1;var c;if((c=a.tag!==3)&&!(c=a.tag!==5)&&(c=a.type,c=c!=="head"&&c!=="body"&&!Th(a.type,a.memoizedProps)),c&&(c=Nr)){if(Mh(a))throw o1(),Error(n(418));for(;c;)n1(a,c),c=Ho(c.nextSibling)}if(i1(a),a.tag===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(n(317));e:{for(a=a.nextSibling,c=0;a;){if(a.nodeType===8){var f=a.data;if(f==="/$"){if(c===0){Nr=Ho(a.nextSibling);break e}c--}else f!=="$"&&f!=="$!"&&f!=="$?"||c++}a=a.nextSibling}Nr=null}}else Nr=Ar?Ho(a.stateNode.nextSibling):null;return!0}function o1(){for(var a=Nr;a;)a=Ho(a.nextSibling)}function Ha(){Nr=Ar=null,fn=!1}function Lh(a){pi===null?pi=[a]:pi.push(a)}var W2=C.ReactCurrentBatchConfig;function hi(a,c){if(a&&a.defaultProps){c=I({},c),a=a.defaultProps;for(var f in a)c[f]===void 0&&(c[f]=a[f]);return c}return c}var hd=qo(null),md=null,qa=null,$h=null;function Fh(){$h=qa=md=null}function zh(a){var c=hd.current;an(hd),a._currentValue=c}function Bh(a,c,f){for(;a!==null;){var g=a.alternate;if((a.childLanes&c)!==c?(a.childLanes|=c,g!==null&&(g.childLanes|=c)):g!==null&&(g.childLanes&c)!==c&&(g.childLanes|=c),a===f)break;a=a.return}}function Ga(a,c){md=a,$h=qa=null,a=a.dependencies,a!==null&&a.firstContext!==null&&(a.lanes&c&&(vr=!0),a.firstContext=null)}function Gr(a){var c=a._currentValue;if($h!==a)if(a={context:a,memoizedValue:c,next:null},qa===null){if(md===null)throw Error(n(308));qa=a,md.dependencies={lanes:0,firstContext:a}}else qa=qa.next=a;return c}var Os=null;function Uh(a){Os===null?Os=[a]:Os.push(a)}function s1(a,c,f,g){var S=c.interleaved;return S===null?(f.next=f,Uh(c)):(f.next=S.next,S.next=f),c.interleaved=f,so(a,g)}function so(a,c){a.lanes|=c;var f=a.alternate;for(f!==null&&(f.lanes|=c),f=a,a=a.return;a!==null;)a.childLanes|=c,f=a.alternate,f!==null&&(f.childLanes|=c),f=a,a=a.return;return f.tag===3?f.stateNode:null}var Ko=!1;function Vh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a1(a,c){a=a.updateQueue,c.updateQueue===a&&(c.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function ao(a,c){return{eventTime:a,lane:c,tag:0,payload:null,callback:null,next:null}}function Yo(a,c,f){var g=a.updateQueue;if(g===null)return null;if(g=g.shared,It&2){var S=g.pending;return S===null?c.next=c:(c.next=S.next,S.next=c),g.pending=c,so(a,f)}return S=g.interleaved,S===null?(c.next=c,Uh(g)):(c.next=S.next,S.next=c),g.interleaved=c,so(a,f)}function gd(a,c,f){if(c=c.updateQueue,c!==null&&(c=c.shared,(f&4194240)!==0)){var g=c.lanes;g&=a.pendingLanes,f|=g,c.lanes=f,rh(a,f)}}function l1(a,c){var f=a.updateQueue,g=a.alternate;if(g!==null&&(g=g.updateQueue,f===g)){var S=null,E=null;if(f=f.firstBaseUpdate,f!==null){do{var D={eventTime:f.eventTime,lane:f.lane,tag:f.tag,payload:f.payload,callback:f.callback,next:null};E===null?S=E=D:E=E.next=D,f=f.next}while(f!==null);E===null?S=E=c:E=E.next=c}else S=E=c;f={baseState:g.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:g.shared,effects:g.effects},a.updateQueue=f;return}a=f.lastBaseUpdate,a===null?f.firstBaseUpdate=c:a.next=c,f.lastBaseUpdate=c}function yd(a,c,f,g){var S=a.updateQueue;Ko=!1;var E=S.firstBaseUpdate,D=S.lastBaseUpdate,$=S.shared.pending;if($!==null){S.shared.pending=null;var W=$,te=W.next;W.next=null,D===null?E=te:D.next=te,D=W;var he=a.alternate;he!==null&&(he=he.updateQueue,$=he.lastBaseUpdate,$!==D&&($===null?he.firstBaseUpdate=te:$.next=te,he.lastBaseUpdate=W))}if(E!==null){var ge=S.baseState;D=0,he=te=W=null,$=E;do{var pe=$.lane,Oe=$.eventTime;if((g&pe)===pe){he!==null&&(he=he.next={eventTime:Oe,lane:0,tag:$.tag,payload:$.payload,callback:$.callback,next:null});e:{var Ge=a,Ye=$;switch(pe=c,Oe=f,Ye.tag){case 1:if(Ge=Ye.payload,typeof Ge=="function"){ge=Ge.call(Oe,ge,pe);break e}ge=Ge;break e;case 3:Ge.flags=Ge.flags&-65537|128;case 0:if(Ge=Ye.payload,pe=typeof Ge=="function"?Ge.call(Oe,ge,pe):Ge,pe==null)break e;ge=I({},ge,pe);break e;case 2:Ko=!0}}$.callback!==null&&$.lane!==0&&(a.flags|=64,pe=S.effects,pe===null?S.effects=[$]:pe.push($))}else Oe={eventTime:Oe,lane:pe,tag:$.tag,payload:$.payload,callback:$.callback,next:null},he===null?(te=he=Oe,W=ge):he=he.next=Oe,D|=pe;if($=$.next,$===null){if($=S.shared.pending,$===null)break;pe=$,$=pe.next,pe.next=null,S.lastBaseUpdate=pe,S.shared.pending=null}}while(!0);if(he===null&&(W=ge),S.baseState=W,S.firstBaseUpdate=te,S.lastBaseUpdate=he,c=S.shared.interleaved,c!==null){S=c;do D|=S.lane,S=S.next;while(S!==c)}else E===null&&(S.shared.lanes=0);Fs|=D,a.lanes=D,a.memoizedState=ge}}function c1(a,c,f){if(a=c.effects,c.effects=null,a!==null)for(c=0;c<a.length;c++){var g=a[c],S=g.callback;if(S!==null){if(g.callback=null,g=f,typeof S!="function")throw Error(n(191,S));S.call(g)}}}var u1=new e.Component().refs;function Wh(a,c,f,g){c=a.memoizedState,f=f(g,c),f=f==null?c:I({},c,f),a.memoizedState=f,a.lanes===0&&(a.updateQueue.baseState=f)}var vd={isMounted:function(a){return(a=a._reactInternals)?Ve(a)===a:!1},enqueueSetState:function(a,c,f){a=a._reactInternals;var g=ar(),S=es(a),E=ao(g,S);E.payload=c,f!=null&&(E.callback=f),c=Yo(a,E,S),c!==null&&(yi(c,a,S,g),gd(c,a,S))},enqueueReplaceState:function(a,c,f){a=a._reactInternals;var g=ar(),S=es(a),E=ao(g,S);E.tag=1,E.payload=c,f!=null&&(E.callback=f),c=Yo(a,E,S),c!==null&&(yi(c,a,S,g),gd(c,a,S))},enqueueForceUpdate:function(a,c){a=a._reactInternals;var f=ar(),g=es(a),S=ao(f,g);S.tag=2,c!=null&&(S.callback=c),c=Yo(a,S,g),c!==null&&(yi(c,a,g,f),gd(c,a,g))}};function d1(a,c,f,g,S,E,D){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(g,E,D):c.prototype&&c.prototype.isPureReactComponent?!pc(f,g)||!pc(S,E):!0}function f1(a,c,f){var g=!1,S=Go,E=c.contextType;return typeof E=="object"&&E!==null?E=Gr(E):(S=yr(c)?As:Jn.current,g=c.contextTypes,E=(g=g!=null)?Ua(a,S):Go),c=new c(f,E),a.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=vd,a.stateNode=c,c._reactInternals=a,g&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=S,a.__reactInternalMemoizedMaskedChildContext=E),c}function p1(a,c,f,g){a=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(f,g),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(f,g),c.state!==a&&vd.enqueueReplaceState(c,c.state,null)}function Hh(a,c,f,g){var S=a.stateNode;S.props=f,S.state=a.memoizedState,S.refs=u1,Vh(a);var E=c.contextType;typeof E=="object"&&E!==null?S.context=Gr(E):(E=yr(c)?As:Jn.current,S.context=Ua(a,E)),S.state=a.memoizedState,E=c.getDerivedStateFromProps,typeof E=="function"&&(Wh(a,c,E,f),S.state=a.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(c=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),c!==S.state&&vd.enqueueReplaceState(S,S.state,null),yd(a,f,S,g),S.state=a.memoizedState),typeof S.componentDidMount=="function"&&(a.flags|=4194308)}function bc(a,c,f){if(a=f.ref,a!==null&&typeof a!="function"&&typeof a!="object"){if(f._owner){if(f=f._owner,f){if(f.tag!==1)throw Error(n(309));var g=f.stateNode}if(!g)throw Error(n(147,a));var S=g,E=""+a;return c!==null&&c.ref!==null&&typeof c.ref=="function"&&c.ref._stringRef===E?c.ref:(c=function(D){var $=S.refs;$===u1&&($=S.refs={}),D===null?delete $[E]:$[E]=D},c._stringRef=E,c)}if(typeof a!="string")throw Error(n(284));if(!f._owner)throw Error(n(290,a))}return a}function xd(a,c){throw a=Object.prototype.toString.call(c),Error(n(31,a==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":a))}function h1(a){var c=a._init;return c(a._payload)}function m1(a){function c(X,H){if(a){var J=X.deletions;J===null?(X.deletions=[H],X.flags|=16):J.push(H)}}function f(X,H){if(!a)return null;for(;H!==null;)c(X,H),H=H.sibling;return null}function g(X,H){for(X=new Map;H!==null;)H.key!==null?X.set(H.key,H):X.set(H.index,H),H=H.sibling;return X}function S(X,H){return X=ns(X,H),X.index=0,X.sibling=null,X}function E(X,H,J){return X.index=J,a?(J=X.alternate,J!==null?(J=J.index,J<H?(X.flags|=2,H):J):(X.flags|=2,H)):(X.flags|=1048576,H)}function D(X){return a&&X.alternate===null&&(X.flags|=2),X}function $(X,H,J,Ce){return H===null||H.tag!==6?(H=Pm(J,X.mode,Ce),H.return=X,H):(H=S(H,J),H.return=X,H)}function W(X,H,J,Ce){var Ze=J.type;return Ze===M?he(X,H,J.props.children,Ce,J.key):H!==null&&(H.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===V&&h1(Ze)===H.type)?(Ce=S(H,J.props),Ce.ref=bc(X,H,J),Ce.return=X,Ce):(Ce=$d(J.type,J.key,J.props,null,X.mode,Ce),Ce.ref=bc(X,H,J),Ce.return=X,Ce)}function te(X,H,J,Ce){return H===null||H.tag!==4||H.stateNode.containerInfo!==J.containerInfo||H.stateNode.implementation!==J.implementation?(H=Rm(J,X.mode,Ce),H.return=X,H):(H=S(H,J.children||[]),H.return=X,H)}function he(X,H,J,Ce,Ze){return H===null||H.tag!==7?(H=Vs(J,X.mode,Ce,Ze),H.return=X,H):(H=S(H,J),H.return=X,H)}function ge(X,H,J){if(typeof H=="string"&&H!==""||typeof H=="number")return H=Pm(""+H,X.mode,J),H.return=X,H;if(typeof H=="object"&&H!==null){switch(H.$$typeof){case _:return J=$d(H.type,H.key,H.props,null,X.mode,J),J.ref=bc(X,null,H),J.return=X,J;case R:return H=Rm(H,X.mode,J),H.return=X,H;case V:var Ce=H._init;return ge(X,Ce(H._payload),J)}if(_e(H)||B(H))return H=Vs(H,X.mode,J,null),H.return=X,H;xd(X,H)}return null}function pe(X,H,J,Ce){var Ze=H!==null?H.key:null;if(typeof J=="string"&&J!==""||typeof J=="number")return Ze!==null?null:$(X,H,""+J,Ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case _:return J.key===Ze?W(X,H,J,Ce):null;case R:return J.key===Ze?te(X,H,J,Ce):null;case V:return Ze=J._init,pe(X,H,Ze(J._payload),Ce)}if(_e(J)||B(J))return Ze!==null?null:he(X,H,J,Ce,null);xd(X,J)}return null}function Oe(X,H,J,Ce,Ze){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number")return X=X.get(J)||null,$(H,X,""+Ce,Ze);if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case _:return X=X.get(Ce.key===null?J:Ce.key)||null,W(H,X,Ce,Ze);case R:return X=X.get(Ce.key===null?J:Ce.key)||null,te(H,X,Ce,Ze);case V:var it=Ce._init;return Oe(X,H,J,it(Ce._payload),Ze)}if(_e(Ce)||B(Ce))return X=X.get(J)||null,he(H,X,Ce,Ze,null);xd(H,Ce)}return null}function Ge(X,H,J,Ce){for(var Ze=null,it=null,ot=H,ut=H=0,Un=null;ot!==null&&ut<J.length;ut++){ot.index>ut?(Un=ot,ot=null):Un=ot.sibling;var Mt=pe(X,ot,J[ut],Ce);if(Mt===null){ot===null&&(ot=Un);break}a&&ot&&Mt.alternate===null&&c(X,ot),H=E(Mt,H,ut),it===null?Ze=Mt:it.sibling=Mt,it=Mt,ot=Un}if(ut===J.length)return f(X,ot),fn&&Ms(X,ut),Ze;if(ot===null){for(;ut<J.length;ut++)ot=ge(X,J[ut],Ce),ot!==null&&(H=E(ot,H,ut),it===null?Ze=ot:it.sibling=ot,it=ot);return fn&&Ms(X,ut),Ze}for(ot=g(X,ot);ut<J.length;ut++)Un=Oe(ot,X,ut,J[ut],Ce),Un!==null&&(a&&Un.alternate!==null&&ot.delete(Un.key===null?ut:Un.key),H=E(Un,H,ut),it===null?Ze=Un:it.sibling=Un,it=Un);return a&&ot.forEach(function(rs){return c(X,rs)}),fn&&Ms(X,ut),Ze}function Ye(X,H,J,Ce){var Ze=B(J);if(typeof Ze!="function")throw Error(n(150));if(J=Ze.call(J),J==null)throw Error(n(151));for(var it=Ze=null,ot=H,ut=H=0,Un=null,Mt=J.next();ot!==null&&!Mt.done;ut++,Mt=J.next()){ot.index>ut?(Un=ot,ot=null):Un=ot.sibling;var rs=pe(X,ot,Mt.value,Ce);if(rs===null){ot===null&&(ot=Un);break}a&&ot&&rs.alternate===null&&c(X,ot),H=E(rs,H,ut),it===null?Ze=rs:it.sibling=rs,it=rs,ot=Un}if(Mt.done)return f(X,ot),fn&&Ms(X,ut),Ze;if(ot===null){for(;!Mt.done;ut++,Mt=J.next())Mt=ge(X,Mt.value,Ce),Mt!==null&&(H=E(Mt,H,ut),it===null?Ze=Mt:it.sibling=Mt,it=Mt);return fn&&Ms(X,ut),Ze}for(ot=g(X,ot);!Mt.done;ut++,Mt=J.next())Mt=Oe(ot,X,ut,Mt.value,Ce),Mt!==null&&(a&&Mt.alternate!==null&&ot.delete(Mt.key===null?ut:Mt.key),H=E(Mt,H,ut),it===null?Ze=Mt:it.sibling=Mt,it=Mt);return a&&ot.forEach(function(j_){return c(X,j_)}),fn&&Ms(X,ut),Ze}function Pn(X,H,J,Ce){if(typeof J=="object"&&J!==null&&J.type===M&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case _:e:{for(var Ze=J.key,it=H;it!==null;){if(it.key===Ze){if(Ze=J.type,Ze===M){if(it.tag===7){f(X,it.sibling),H=S(it,J.props.children),H.return=X,X=H;break e}}else if(it.elementType===Ze||typeof Ze=="object"&&Ze!==null&&Ze.$$typeof===V&&h1(Ze)===it.type){f(X,it.sibling),H=S(it,J.props),H.ref=bc(X,it,J),H.return=X,X=H;break e}f(X,it);break}else c(X,it);it=it.sibling}J.type===M?(H=Vs(J.props.children,X.mode,Ce,J.key),H.return=X,X=H):(Ce=$d(J.type,J.key,J.props,null,X.mode,Ce),Ce.ref=bc(X,H,J),Ce.return=X,X=Ce)}return D(X);case R:e:{for(it=J.key;H!==null;){if(H.key===it)if(H.tag===4&&H.stateNode.containerInfo===J.containerInfo&&H.stateNode.implementation===J.implementation){f(X,H.sibling),H=S(H,J.children||[]),H.return=X,X=H;break e}else{f(X,H);break}else c(X,H);H=H.sibling}H=Rm(J,X.mode,Ce),H.return=X,X=H}return D(X);case V:return it=J._init,Pn(X,H,it(J._payload),Ce)}if(_e(J))return Ge(X,H,J,Ce);if(B(J))return Ye(X,H,J,Ce);xd(X,J)}return typeof J=="string"&&J!==""||typeof J=="number"?(J=""+J,H!==null&&H.tag===6?(f(X,H.sibling),H=S(H,J),H.return=X,X=H):(f(X,H),H=Pm(J,X.mode,Ce),H.return=X,X=H),D(X)):f(X,H)}return Pn}var Qa=m1(!0),g1=m1(!1),wc={},Mi=qo(wc),Sc=qo(wc),jc=qo(wc);function Ls(a){if(a===wc)throw Error(n(174));return a}function qh(a,c){switch(Xt(jc,c),Xt(Sc,a),Xt(Mi,wc),a=c.nodeType,a){case 9:case 11:c=(c=c.documentElement)?c.namespaceURI:jt(null,"");break;default:a=a===8?c.parentNode:c,c=a.namespaceURI||null,a=a.tagName,c=jt(c,a)}an(Mi),Xt(Mi,c)}function Ka(){an(Mi),an(Sc),an(jc)}function y1(a){Ls(jc.current);var c=Ls(Mi.current),f=jt(c,a.type);c!==f&&(Xt(Sc,a),Xt(Mi,f))}function Gh(a){Sc.current===a&&(an(Mi),an(Sc))}var yn=qo(0);function bd(a){for(var c=a;c!==null;){if(c.tag===13){var f=c.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||f.data==="$?"||f.data==="$!"))return c}else if(c.tag===19&&c.memoizedProps.revealOrder!==void 0){if(c.flags&128)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}var Qh=[];function Kh(){for(var a=0;a<Qh.length;a++)Qh[a]._workInProgressVersionPrimary=null;Qh.length=0}var wd=C.ReactCurrentDispatcher,Yh=C.ReactCurrentBatchConfig,$s=0,vn=null,On=null,zn=null,Sd=!1,Cc=!1,Ec=0,H2=0;function Zn(){throw Error(n(321))}function Xh(a,c){if(c===null)return!1;for(var f=0;f<c.length&&f<a.length;f++)if(!fi(a[f],c[f]))return!1;return!0}function Jh(a,c,f,g,S,E){if($s=E,vn=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,wd.current=a===null||a.memoizedState===null?K2:Y2,a=f(g,S),Cc){E=0;do{if(Cc=!1,Ec=0,25<=E)throw Error(n(301));E+=1,zn=On=null,c.updateQueue=null,wd.current=X2,a=f(g,S)}while(Cc)}if(wd.current=Ed,c=On!==null&&On.next!==null,$s=0,zn=On=vn=null,Sd=!1,c)throw Error(n(300));return a}function Zh(){var a=Ec!==0;return Ec=0,a}function Oi(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zn===null?vn.memoizedState=zn=a:zn=zn.next=a,zn}function Qr(){if(On===null){var a=vn.alternate;a=a!==null?a.memoizedState:null}else a=On.next;var c=zn===null?vn.memoizedState:zn.next;if(c!==null)zn=c,On=a;else{if(a===null)throw Error(n(310));On=a,a={memoizedState:On.memoizedState,baseState:On.baseState,baseQueue:On.baseQueue,queue:On.queue,next:null},zn===null?vn.memoizedState=zn=a:zn=zn.next=a}return zn}function kc(a,c){return typeof c=="function"?c(a):c}function em(a){var c=Qr(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var g=On,S=g.baseQueue,E=f.pending;if(E!==null){if(S!==null){var D=S.next;S.next=E.next,E.next=D}g.baseQueue=S=E,f.pending=null}if(S!==null){E=S.next,g=g.baseState;var $=D=null,W=null,te=E;do{var he=te.lane;if(($s&he)===he)W!==null&&(W=W.next={lane:0,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null}),g=te.hasEagerState?te.eagerState:a(g,te.action);else{var ge={lane:he,action:te.action,hasEagerState:te.hasEagerState,eagerState:te.eagerState,next:null};W===null?($=W=ge,D=g):W=W.next=ge,vn.lanes|=he,Fs|=he}te=te.next}while(te!==null&&te!==E);W===null?D=g:W.next=$,fi(g,c.memoizedState)||(vr=!0),c.memoizedState=g,c.baseState=D,c.baseQueue=W,f.lastRenderedState=g}if(a=f.interleaved,a!==null){S=a;do E=S.lane,vn.lanes|=E,Fs|=E,S=S.next;while(S!==a)}else S===null&&(f.lanes=0);return[c.memoizedState,f.dispatch]}function tm(a){var c=Qr(),f=c.queue;if(f===null)throw Error(n(311));f.lastRenderedReducer=a;var g=f.dispatch,S=f.pending,E=c.memoizedState;if(S!==null){f.pending=null;var D=S=S.next;do E=a(E,D.action),D=D.next;while(D!==S);fi(E,c.memoizedState)||(vr=!0),c.memoizedState=E,c.baseQueue===null&&(c.baseState=E),f.lastRenderedState=E}return[E,g]}function v1(){}function x1(a,c){var f=vn,g=Qr(),S=c(),E=!fi(g.memoizedState,S);if(E&&(g.memoizedState=S,vr=!0),g=g.queue,nm(S1.bind(null,f,g,a),[a]),g.getSnapshot!==c||E||zn!==null&&zn.memoizedState.tag&1){if(f.flags|=2048,Tc(9,w1.bind(null,f,g,S,c),void 0,null),Bn===null)throw Error(n(349));$s&30||b1(f,c,S)}return S}function b1(a,c,f){a.flags|=16384,a={getSnapshot:c,value:f},c=vn.updateQueue,c===null?(c={lastEffect:null,stores:null},vn.updateQueue=c,c.stores=[a]):(f=c.stores,f===null?c.stores=[a]:f.push(a))}function w1(a,c,f,g){c.value=f,c.getSnapshot=g,j1(c)&&C1(a)}function S1(a,c,f){return f(function(){j1(c)&&C1(a)})}function j1(a){var c=a.getSnapshot;a=a.value;try{var f=c();return!fi(a,f)}catch{return!0}}function C1(a){var c=so(a,1);c!==null&&yi(c,a,1,-1)}function E1(a){var c=Oi();return typeof a=="function"&&(a=a()),c.memoizedState=c.baseState=a,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:kc,lastRenderedState:a},c.queue=a,a=a.dispatch=Q2.bind(null,vn,a),[c.memoizedState,a]}function Tc(a,c,f,g){return a={tag:a,create:c,destroy:f,deps:g,next:null},c=vn.updateQueue,c===null?(c={lastEffect:null,stores:null},vn.updateQueue=c,c.lastEffect=a.next=a):(f=c.lastEffect,f===null?c.lastEffect=a.next=a:(g=f.next,f.next=a,a.next=g,c.lastEffect=a)),a}function k1(){return Qr().memoizedState}function jd(a,c,f,g){var S=Oi();vn.flags|=a,S.memoizedState=Tc(1|c,f,void 0,g===void 0?null:g)}function Cd(a,c,f,g){var S=Qr();g=g===void 0?null:g;var E=void 0;if(On!==null){var D=On.memoizedState;if(E=D.destroy,g!==null&&Xh(g,D.deps)){S.memoizedState=Tc(c,f,E,g);return}}vn.flags|=a,S.memoizedState=Tc(1|c,f,E,g)}function T1(a,c){return jd(8390656,8,a,c)}function nm(a,c){return Cd(2048,8,a,c)}function P1(a,c){return Cd(4,2,a,c)}function R1(a,c){return Cd(4,4,a,c)}function _1(a,c){if(typeof c=="function")return a=a(),c(a),function(){c(null)};if(c!=null)return a=a(),c.current=a,function(){c.current=null}}function D1(a,c,f){return f=f!=null?f.concat([a]):null,Cd(4,4,_1.bind(null,c,a),f)}function rm(){}function I1(a,c){var f=Qr();c=c===void 0?null:c;var g=f.memoizedState;return g!==null&&c!==null&&Xh(c,g[1])?g[0]:(f.memoizedState=[a,c],a)}function A1(a,c){var f=Qr();c=c===void 0?null:c;var g=f.memoizedState;return g!==null&&c!==null&&Xh(c,g[1])?g[0]:(a=a(),f.memoizedState=[a,c],a)}function N1(a,c,f){return $s&21?(fi(f,c)||(f=sb(),vn.lanes|=f,Fs|=f,a.baseState=!0),c):(a.baseState&&(a.baseState=!1,vr=!0),a.memoizedState=f)}function q2(a,c){var f=Bt;Bt=f!==0&&4>f?f:4,a(!0);var g=Yh.transition;Yh.transition={};try{a(!1),c()}finally{Bt=f,Yh.transition=g}}function M1(){return Qr().memoizedState}function G2(a,c,f){var g=es(a);if(f={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null},O1(a))L1(c,f);else if(f=s1(a,c,f,g),f!==null){var S=ar();yi(f,a,g,S),$1(f,c,g)}}function Q2(a,c,f){var g=es(a),S={lane:g,action:f,hasEagerState:!1,eagerState:null,next:null};if(O1(a))L1(c,S);else{var E=a.alternate;if(a.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var D=c.lastRenderedState,$=E(D,f);if(S.hasEagerState=!0,S.eagerState=$,fi($,D)){var W=c.interleaved;W===null?(S.next=S,Uh(c)):(S.next=W.next,W.next=S),c.interleaved=S;return}}catch{}finally{}f=s1(a,c,S,g),f!==null&&(S=ar(),yi(f,a,g,S),$1(f,c,g))}}function O1(a){var c=a.alternate;return a===vn||c!==null&&c===vn}function L1(a,c){Cc=Sd=!0;var f=a.pending;f===null?c.next=c:(c.next=f.next,f.next=c),a.pending=c}function $1(a,c,f){if(f&4194240){var g=c.lanes;g&=a.pendingLanes,f|=g,c.lanes=f,rh(a,f)}}var Ed={readContext:Gr,useCallback:Zn,useContext:Zn,useEffect:Zn,useImperativeHandle:Zn,useInsertionEffect:Zn,useLayoutEffect:Zn,useMemo:Zn,useReducer:Zn,useRef:Zn,useState:Zn,useDebugValue:Zn,useDeferredValue:Zn,useTransition:Zn,useMutableSource:Zn,useSyncExternalStore:Zn,useId:Zn,unstable_isNewReconciler:!1},K2={readContext:Gr,useCallback:function(a,c){return Oi().memoizedState=[a,c===void 0?null:c],a},useContext:Gr,useEffect:T1,useImperativeHandle:function(a,c,f){return f=f!=null?f.concat([a]):null,jd(4194308,4,_1.bind(null,c,a),f)},useLayoutEffect:function(a,c){return jd(4194308,4,a,c)},useInsertionEffect:function(a,c){return jd(4,2,a,c)},useMemo:function(a,c){var f=Oi();return c=c===void 0?null:c,a=a(),f.memoizedState=[a,c],a},useReducer:function(a,c,f){var g=Oi();return c=f!==void 0?f(c):c,g.memoizedState=g.baseState=c,a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:c},g.queue=a,a=a.dispatch=G2.bind(null,vn,a),[g.memoizedState,a]},useRef:function(a){var c=Oi();return a={current:a},c.memoizedState=a},useState:E1,useDebugValue:rm,useDeferredValue:function(a){return Oi().memoizedState=a},useTransition:function(){var a=E1(!1),c=a[0];return a=q2.bind(null,a[1]),Oi().memoizedState=a,[c,a]},useMutableSource:function(){},useSyncExternalStore:function(a,c,f){var g=vn,S=Oi();if(fn){if(f===void 0)throw Error(n(407));f=f()}else{if(f=c(),Bn===null)throw Error(n(349));$s&30||b1(g,c,f)}S.memoizedState=f;var E={value:f,getSnapshot:c};return S.queue=E,T1(S1.bind(null,g,E,a),[a]),g.flags|=2048,Tc(9,w1.bind(null,g,E,f,c),void 0,null),f},useId:function(){var a=Oi(),c=Bn.identifierPrefix;if(fn){var f=oo,g=io;f=(g&~(1<<32-Fn(g)-1)).toString(32)+f,c=":"+c+"R"+f,f=Ec++,0<f&&(c+="H"+f.toString(32)),c+=":"}else f=H2++,c=":"+c+"r"+f.toString(32)+":";return a.memoizedState=c},unstable_isNewReconciler:!1},Y2={readContext:Gr,useCallback:I1,useContext:Gr,useEffect:nm,useImperativeHandle:D1,useInsertionEffect:P1,useLayoutEffect:R1,useMemo:A1,useReducer:em,useRef:k1,useState:function(){return em(kc)},useDebugValue:rm,useDeferredValue:function(a){var c=Qr();return N1(c,On.memoizedState,a)},useTransition:function(){var a=em(kc)[0],c=Qr().memoizedState;return[a,c]},useMutableSource:v1,useSyncExternalStore:x1,useId:M1,unstable_isNewReconciler:!1},X2={readContext:Gr,useCallback:I1,useContext:Gr,useEffect:nm,useImperativeHandle:D1,useInsertionEffect:P1,useLayoutEffect:R1,useMemo:A1,useReducer:tm,useRef:k1,useState:function(){return tm(kc)},useDebugValue:rm,useDeferredValue:function(a){var c=Qr();return On===null?c.memoizedState=a:N1(c,On.memoizedState,a)},useTransition:function(){var a=tm(kc)[0],c=Qr().memoizedState;return[a,c]},useMutableSource:v1,useSyncExternalStore:x1,useId:M1,unstable_isNewReconciler:!1};function Ya(a,c){try{var f="",g=c;do f+=me(g),g=g.return;while(g);var S=f}catch(E){S=`
82
- Error generating stack: `+E.message+`
83
- `+E.stack}return{value:a,source:c,stack:S,digest:null}}function im(a,c,f){return{value:a,source:null,stack:f??null,digest:c??null}}function om(a,c){try{console.error(c.value)}catch(f){setTimeout(function(){throw f})}}var J2=typeof WeakMap=="function"?WeakMap:Map;function F1(a,c,f){f=ao(-1,f),f.tag=3,f.payload={element:null};var g=c.value;return f.callback=function(){Id||(Id=!0,bm=g),om(a,c)},f}function z1(a,c,f){f=ao(-1,f),f.tag=3;var g=a.type.getDerivedStateFromError;if(typeof g=="function"){var S=c.value;f.payload=function(){return g(S)},f.callback=function(){om(a,c)}}var E=a.stateNode;return E!==null&&typeof E.componentDidCatch=="function"&&(f.callback=function(){om(a,c),typeof g!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this));var D=c.stack;this.componentDidCatch(c.value,{componentStack:D!==null?D:""})}),f}function B1(a,c,f){var g=a.pingCache;if(g===null){g=a.pingCache=new J2;var S=new Set;g.set(c,S)}else S=g.get(c),S===void 0&&(S=new Set,g.set(c,S));S.has(f)||(S.add(f),a=f_.bind(null,a,c,f),c.then(a,a))}function U1(a){do{var c;if((c=a.tag===13)&&(c=a.memoizedState,c=c!==null?c.dehydrated!==null:!0),c)return a;a=a.return}while(a!==null);return null}function V1(a,c,f,g,S){return a.mode&1?(a.flags|=65536,a.lanes=S,a):(a===c?a.flags|=65536:(a.flags|=128,f.flags|=131072,f.flags&=-52805,f.tag===1&&(f.alternate===null?f.tag=17:(c=ao(-1,1),c.tag=2,Yo(f,c,1))),f.lanes|=1),a)}var Z2=C.ReactCurrentOwner,vr=!1;function sr(a,c,f,g){c.child=a===null?g1(c,null,f,g):Qa(c,a.child,f,g)}function W1(a,c,f,g,S){f=f.render;var E=c.ref;return Ga(c,S),g=Jh(a,c,f,g,E,S),f=Zh(),a!==null&&!vr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,lo(a,c,S)):(fn&&f&&Ah(c),c.flags|=1,sr(a,c,g,S),c.child)}function H1(a,c,f,g,S){if(a===null){var E=f.type;return typeof E=="function"&&!Tm(E)&&E.defaultProps===void 0&&f.compare===null&&f.defaultProps===void 0?(c.tag=15,c.type=E,q1(a,c,E,g,S)):(a=$d(f.type,null,g,c,c.mode,S),a.ref=c.ref,a.return=c,c.child=a)}if(E=a.child,!(a.lanes&S)){var D=E.memoizedProps;if(f=f.compare,f=f!==null?f:pc,f(D,g)&&a.ref===c.ref)return lo(a,c,S)}return c.flags|=1,a=ns(E,g),a.ref=c.ref,a.return=c,c.child=a}function q1(a,c,f,g,S){if(a!==null){var E=a.memoizedProps;if(pc(E,g)&&a.ref===c.ref)if(vr=!1,c.pendingProps=g=E,(a.lanes&S)!==0)a.flags&131072&&(vr=!0);else return c.lanes=a.lanes,lo(a,c,S)}return sm(a,c,f,g,S)}function G1(a,c,f){var g=c.pendingProps,S=g.children,E=a!==null?a.memoizedState:null;if(g.mode==="hidden")if(!(c.mode&1))c.memoizedState={baseLanes:0,cachePool:null,transitions:null},Xt(Ja,Mr),Mr|=f;else{if(!(f&1073741824))return a=E!==null?E.baseLanes|f:f,c.lanes=c.childLanes=1073741824,c.memoizedState={baseLanes:a,cachePool:null,transitions:null},c.updateQueue=null,Xt(Ja,Mr),Mr|=a,null;c.memoizedState={baseLanes:0,cachePool:null,transitions:null},g=E!==null?E.baseLanes:f,Xt(Ja,Mr),Mr|=g}else E!==null?(g=E.baseLanes|f,c.memoizedState=null):g=f,Xt(Ja,Mr),Mr|=g;return sr(a,c,S,f),c.child}function Q1(a,c){var f=c.ref;(a===null&&f!==null||a!==null&&a.ref!==f)&&(c.flags|=512,c.flags|=2097152)}function sm(a,c,f,g,S){var E=yr(f)?As:Jn.current;return E=Ua(c,E),Ga(c,S),f=Jh(a,c,f,g,E,S),g=Zh(),a!==null&&!vr?(c.updateQueue=a.updateQueue,c.flags&=-2053,a.lanes&=~S,lo(a,c,S)):(fn&&g&&Ah(c),c.flags|=1,sr(a,c,f,S),c.child)}function K1(a,c,f,g,S){if(yr(f)){var E=!0;cd(c)}else E=!1;if(Ga(c,S),c.stateNode===null)Td(a,c),f1(c,f,g),Hh(c,f,g,S),g=!0;else if(a===null){var D=c.stateNode,$=c.memoizedProps;D.props=$;var W=D.context,te=f.contextType;typeof te=="object"&&te!==null?te=Gr(te):(te=yr(f)?As:Jn.current,te=Ua(c,te));var he=f.getDerivedStateFromProps,ge=typeof he=="function"||typeof D.getSnapshotBeforeUpdate=="function";ge||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||($!==g||W!==te)&&p1(c,D,g,te),Ko=!1;var pe=c.memoizedState;D.state=pe,yd(c,g,D,S),W=c.memoizedState,$!==g||pe!==W||gr.current||Ko?(typeof he=="function"&&(Wh(c,f,he,g),W=c.memoizedState),($=Ko||d1(c,f,$,g,pe,W,te))?(ge||typeof D.UNSAFE_componentWillMount!="function"&&typeof D.componentWillMount!="function"||(typeof D.componentWillMount=="function"&&D.componentWillMount(),typeof D.UNSAFE_componentWillMount=="function"&&D.UNSAFE_componentWillMount()),typeof D.componentDidMount=="function"&&(c.flags|=4194308)):(typeof D.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=g,c.memoizedState=W),D.props=g,D.state=W,D.context=te,g=$):(typeof D.componentDidMount=="function"&&(c.flags|=4194308),g=!1)}else{D=c.stateNode,a1(a,c),$=c.memoizedProps,te=c.type===c.elementType?$:hi(c.type,$),D.props=te,ge=c.pendingProps,pe=D.context,W=f.contextType,typeof W=="object"&&W!==null?W=Gr(W):(W=yr(f)?As:Jn.current,W=Ua(c,W));var Oe=f.getDerivedStateFromProps;(he=typeof Oe=="function"||typeof D.getSnapshotBeforeUpdate=="function")||typeof D.UNSAFE_componentWillReceiveProps!="function"&&typeof D.componentWillReceiveProps!="function"||($!==ge||pe!==W)&&p1(c,D,g,W),Ko=!1,pe=c.memoizedState,D.state=pe,yd(c,g,D,S);var Ge=c.memoizedState;$!==ge||pe!==Ge||gr.current||Ko?(typeof Oe=="function"&&(Wh(c,f,Oe,g),Ge=c.memoizedState),(te=Ko||d1(c,f,te,g,pe,Ge,W)||!1)?(he||typeof D.UNSAFE_componentWillUpdate!="function"&&typeof D.componentWillUpdate!="function"||(typeof D.componentWillUpdate=="function"&&D.componentWillUpdate(g,Ge,W),typeof D.UNSAFE_componentWillUpdate=="function"&&D.UNSAFE_componentWillUpdate(g,Ge,W)),typeof D.componentDidUpdate=="function"&&(c.flags|=4),typeof D.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof D.componentDidUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),c.memoizedProps=g,c.memoizedState=Ge),D.props=g,D.state=Ge,D.context=W,g=te):(typeof D.componentDidUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=4),typeof D.getSnapshotBeforeUpdate!="function"||$===a.memoizedProps&&pe===a.memoizedState||(c.flags|=1024),g=!1)}return am(a,c,f,g,E,S)}function am(a,c,f,g,S,E){Q1(a,c);var D=(c.flags&128)!==0;if(!g&&!D)return S&&Zb(c,f,!1),lo(a,c,E);g=c.stateNode,Z2.current=c;var $=D&&typeof f.getDerivedStateFromError!="function"?null:g.render();return c.flags|=1,a!==null&&D?(c.child=Qa(c,a.child,null,E),c.child=Qa(c,null,$,E)):sr(a,c,$,E),c.memoizedState=g.state,S&&Zb(c,f,!0),c.child}function Y1(a){var c=a.stateNode;c.pendingContext?Xb(a,c.pendingContext,c.pendingContext!==c.context):c.context&&Xb(a,c.context,!1),qh(a,c.containerInfo)}function X1(a,c,f,g,S){return Ha(),Lh(S),c.flags|=256,sr(a,c,f,g),c.child}var lm={dehydrated:null,treeContext:null,retryLane:0};function cm(a){return{baseLanes:a,cachePool:null,transitions:null}}function J1(a,c,f){var g=c.pendingProps,S=yn.current,E=!1,D=(c.flags&128)!==0,$;if(($=D)||($=a!==null&&a.memoizedState===null?!1:(S&2)!==0),$?(E=!0,c.flags&=-129):(a===null||a.memoizedState!==null)&&(S|=1),Xt(yn,S&1),a===null)return Oh(c),a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null)?(c.mode&1?a.data==="$!"?c.lanes=8:c.lanes=1073741824:c.lanes=1,null):(D=g.children,a=g.fallback,E?(g=c.mode,E=c.child,D={mode:"hidden",children:D},!(g&1)&&E!==null?(E.childLanes=0,E.pendingProps=D):E=Fd(D,g,0,null),a=Vs(a,g,f,null),E.return=c,a.return=c,E.sibling=a,c.child=E,c.child.memoizedState=cm(f),c.memoizedState=lm,a):um(c,D));if(S=a.memoizedState,S!==null&&($=S.dehydrated,$!==null))return e_(a,c,D,g,$,S,f);if(E){E=g.fallback,D=c.mode,S=a.child,$=S.sibling;var W={mode:"hidden",children:g.children};return!(D&1)&&c.child!==S?(g=c.child,g.childLanes=0,g.pendingProps=W,c.deletions=null):(g=ns(S,W),g.subtreeFlags=S.subtreeFlags&14680064),$!==null?E=ns($,E):(E=Vs(E,D,f,null),E.flags|=2),E.return=c,g.return=c,g.sibling=E,c.child=g,g=E,E=c.child,D=a.child.memoizedState,D=D===null?cm(f):{baseLanes:D.baseLanes|f,cachePool:null,transitions:D.transitions},E.memoizedState=D,E.childLanes=a.childLanes&~f,c.memoizedState=lm,g}return E=a.child,a=E.sibling,g=ns(E,{mode:"visible",children:g.children}),!(c.mode&1)&&(g.lanes=f),g.return=c,g.sibling=null,a!==null&&(f=c.deletions,f===null?(c.deletions=[a],c.flags|=16):f.push(a)),c.child=g,c.memoizedState=null,g}function um(a,c){return c=Fd({mode:"visible",children:c},a.mode,0,null),c.return=a,a.child=c}function kd(a,c,f,g){return g!==null&&Lh(g),Qa(c,a.child,null,f),a=um(c,c.pendingProps.children),a.flags|=2,c.memoizedState=null,a}function e_(a,c,f,g,S,E,D){if(f)return c.flags&256?(c.flags&=-257,g=im(Error(n(422))),kd(a,c,D,g)):c.memoizedState!==null?(c.child=a.child,c.flags|=128,null):(E=g.fallback,S=c.mode,g=Fd({mode:"visible",children:g.children},S,0,null),E=Vs(E,S,D,null),E.flags|=2,g.return=c,E.return=c,g.sibling=E,c.child=g,c.mode&1&&Qa(c,a.child,null,D),c.child.memoizedState=cm(D),c.memoizedState=lm,E);if(!(c.mode&1))return kd(a,c,D,null);if(S.data==="$!"){if(g=S.nextSibling&&S.nextSibling.dataset,g)var $=g.dgst;return g=$,E=Error(n(419)),g=im(E,g,void 0),kd(a,c,D,g)}if($=(D&a.childLanes)!==0,vr||$){if(g=Bn,g!==null){switch(D&-D){case 4:S=2;break;case 16:S=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:S=32;break;case 536870912:S=268435456;break;default:S=0}S=S&(g.suspendedLanes|D)?0:S,S!==0&&S!==E.retryLane&&(E.retryLane=S,so(a,S),yi(g,a,S,-1))}return km(),g=im(Error(n(421))),kd(a,c,D,g)}return S.data==="$?"?(c.flags|=128,c.child=a.child,c=p_.bind(null,a),S._reactRetry=c,null):(a=E.treeContext,Nr=Ho(S.nextSibling),Ar=c,fn=!0,pi=null,a!==null&&(Hr[qr++]=io,Hr[qr++]=oo,Hr[qr++]=Ns,io=a.id,oo=a.overflow,Ns=c),c=um(c,g.children),c.flags|=4096,c)}function Z1(a,c,f){a.lanes|=c;var g=a.alternate;g!==null&&(g.lanes|=c),Bh(a.return,c,f)}function dm(a,c,f,g,S){var E=a.memoizedState;E===null?a.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:g,tail:f,tailMode:S}:(E.isBackwards=c,E.rendering=null,E.renderingStartTime=0,E.last=g,E.tail=f,E.tailMode=S)}function e0(a,c,f){var g=c.pendingProps,S=g.revealOrder,E=g.tail;if(sr(a,c,g.children,f),g=yn.current,g&2)g=g&1|2,c.flags|=128;else{if(a!==null&&a.flags&128)e:for(a=c.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&Z1(a,f,c);else if(a.tag===19)Z1(a,f,c);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===c)break e;for(;a.sibling===null;){if(a.return===null||a.return===c)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}g&=1}if(Xt(yn,g),!(c.mode&1))c.memoizedState=null;else switch(S){case"forwards":for(f=c.child,S=null;f!==null;)a=f.alternate,a!==null&&bd(a)===null&&(S=f),f=f.sibling;f=S,f===null?(S=c.child,c.child=null):(S=f.sibling,f.sibling=null),dm(c,!1,S,f,E);break;case"backwards":for(f=null,S=c.child,c.child=null;S!==null;){if(a=S.alternate,a!==null&&bd(a)===null){c.child=S;break}a=S.sibling,S.sibling=f,f=S,S=a}dm(c,!0,f,null,E);break;case"together":dm(c,!1,null,null,void 0);break;default:c.memoizedState=null}return c.child}function Td(a,c){!(c.mode&1)&&a!==null&&(a.alternate=null,c.alternate=null,c.flags|=2)}function lo(a,c,f){if(a!==null&&(c.dependencies=a.dependencies),Fs|=c.lanes,!(f&c.childLanes))return null;if(a!==null&&c.child!==a.child)throw Error(n(153));if(c.child!==null){for(a=c.child,f=ns(a,a.pendingProps),c.child=f,f.return=c;a.sibling!==null;)a=a.sibling,f=f.sibling=ns(a,a.pendingProps),f.return=c;f.sibling=null}return c.child}function t_(a,c,f){switch(c.tag){case 3:Y1(c),Ha();break;case 5:y1(c);break;case 1:yr(c.type)&&cd(c);break;case 4:qh(c,c.stateNode.containerInfo);break;case 10:var g=c.type._context,S=c.memoizedProps.value;Xt(hd,g._currentValue),g._currentValue=S;break;case 13:if(g=c.memoizedState,g!==null)return g.dehydrated!==null?(Xt(yn,yn.current&1),c.flags|=128,null):f&c.child.childLanes?J1(a,c,f):(Xt(yn,yn.current&1),a=lo(a,c,f),a!==null?a.sibling:null);Xt(yn,yn.current&1);break;case 19:if(g=(f&c.childLanes)!==0,a.flags&128){if(g)return e0(a,c,f);c.flags|=128}if(S=c.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),Xt(yn,yn.current),g)break;return null;case 22:case 23:return c.lanes=0,G1(a,c,f)}return lo(a,c,f)}var t0,fm,n0,r0;t0=function(a,c){for(var f=c.child;f!==null;){if(f.tag===5||f.tag===6)a.appendChild(f.stateNode);else if(f.tag!==4&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return;f=f.return}f.sibling.return=f.return,f=f.sibling}},fm=function(){},n0=function(a,c,f,g){var S=a.memoizedProps;if(S!==g){a=c.stateNode,Ls(Mi.current);var E=null;switch(f){case"input":S=Tt(a,S),g=Tt(a,g),E=[];break;case"select":S=I({},S,{value:void 0}),g=I({},g,{value:void 0}),E=[];break;case"textarea":S=ve(a,S),g=ve(a,g),E=[];break;default:typeof S.onClick!="function"&&typeof g.onClick=="function"&&(a.onclick=sd)}or(f,g);var D;f=null;for(te in S)if(!g.hasOwnProperty(te)&&S.hasOwnProperty(te)&&S[te]!=null)if(te==="style"){var $=S[te];for(D in $)$.hasOwnProperty(D)&&(f||(f={}),f[D]="")}else te!=="dangerouslySetInnerHTML"&&te!=="children"&&te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&te!=="autoFocus"&&(i.hasOwnProperty(te)?E||(E=[]):(E=E||[]).push(te,null));for(te in g){var W=g[te];if($=S!=null?S[te]:void 0,g.hasOwnProperty(te)&&W!==$&&(W!=null||$!=null))if(te==="style")if($){for(D in $)!$.hasOwnProperty(D)||W&&W.hasOwnProperty(D)||(f||(f={}),f[D]="");for(D in W)W.hasOwnProperty(D)&&$[D]!==W[D]&&(f||(f={}),f[D]=W[D])}else f||(E||(E=[]),E.push(te,f)),f=W;else te==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,$=$?$.__html:void 0,W!=null&&$!==W&&(E=E||[]).push(te,W)):te==="children"?typeof W!="string"&&typeof W!="number"||(E=E||[]).push(te,""+W):te!=="suppressContentEditableWarning"&&te!=="suppressHydrationWarning"&&(i.hasOwnProperty(te)?(W!=null&&te==="onScroll"&&sn("scroll",a),E||$===W||(E=[])):(E=E||[]).push(te,W))}f&&(E=E||[]).push("style",f);var te=E;(c.updateQueue=te)&&(c.flags|=4)}},r0=function(a,c,f,g){f!==g&&(c.flags|=4)};function Pc(a,c){if(!fn)switch(a.tailMode){case"hidden":c=a.tail;for(var f=null;c!==null;)c.alternate!==null&&(f=c),c=c.sibling;f===null?a.tail=null:f.sibling=null;break;case"collapsed":f=a.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?c||a.tail===null?a.tail=null:a.tail.sibling=null:g.sibling=null}}function er(a){var c=a.alternate!==null&&a.alternate.child===a.child,f=0,g=0;if(c)for(var S=a.child;S!==null;)f|=S.lanes|S.childLanes,g|=S.subtreeFlags&14680064,g|=S.flags&14680064,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)f|=S.lanes|S.childLanes,g|=S.subtreeFlags,g|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=g,a.childLanes=f,c}function n_(a,c,f){var g=c.pendingProps;switch(Nh(c),c.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return er(c),null;case 1:return yr(c.type)&&ld(),er(c),null;case 3:return g=c.stateNode,Ka(),an(gr),an(Jn),Kh(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(a===null||a.child===null)&&(pd(c)?c.flags|=4:a===null||a.memoizedState.isDehydrated&&!(c.flags&256)||(c.flags|=1024,pi!==null&&(jm(pi),pi=null))),fm(a,c),er(c),null;case 5:Gh(c);var S=Ls(jc.current);if(f=c.type,a!==null&&c.stateNode!=null)n0(a,c,f,g,S),a.ref!==c.ref&&(c.flags|=512,c.flags|=2097152);else{if(!g){if(c.stateNode===null)throw Error(n(166));return er(c),null}if(a=Ls(Mi.current),pd(c)){g=c.stateNode,f=c.type;var E=c.memoizedProps;switch(g[Ni]=c,g[vc]=E,a=(c.mode&1)!==0,f){case"dialog":sn("cancel",g),sn("close",g);break;case"iframe":case"object":case"embed":sn("load",g);break;case"video":case"audio":for(S=0;S<mc.length;S++)sn(mc[S],g);break;case"source":sn("error",g);break;case"img":case"image":case"link":sn("error",g),sn("load",g);break;case"details":sn("toggle",g);break;case"input":vt(g,E),sn("invalid",g);break;case"select":g._wrapperState={wasMultiple:!!E.multiple},sn("invalid",g);break;case"textarea":Me(g,E),sn("invalid",g)}or(f,E),S=null;for(var D in E)if(E.hasOwnProperty(D)){var $=E[D];D==="children"?typeof $=="string"?g.textContent!==$&&(E.suppressHydrationWarning!==!0&&od(g.textContent,$,a),S=["children",$]):typeof $=="number"&&g.textContent!==""+$&&(E.suppressHydrationWarning!==!0&&od(g.textContent,$,a),S=["children",""+$]):i.hasOwnProperty(D)&&$!=null&&D==="onScroll"&&sn("scroll",g)}switch(f){case"input":ct(g),Re(g,E,!0);break;case"textarea":ct(g),Ue(g);break;case"select":case"option":break;default:typeof E.onClick=="function"&&(g.onclick=sd)}g=S,c.updateQueue=g,g!==null&&(c.flags|=4)}else{D=S.nodeType===9?S:S.ownerDocument,a==="http://www.w3.org/1999/xhtml"&&(a=bt(f)),a==="http://www.w3.org/1999/xhtml"?f==="script"?(a=D.createElement("div"),a.innerHTML="<script><\/script>",a=a.removeChild(a.firstChild)):typeof g.is=="string"?a=D.createElement(f,{is:g.is}):(a=D.createElement(f),f==="select"&&(D=a,g.multiple?D.multiple=!0:g.size&&(D.size=g.size))):a=D.createElementNS(a,f),a[Ni]=c,a[vc]=g,t0(a,c,!1,!1),c.stateNode=a;e:{switch(D=Di(f,g),f){case"dialog":sn("cancel",a),sn("close",a),S=g;break;case"iframe":case"object":case"embed":sn("load",a),S=g;break;case"video":case"audio":for(S=0;S<mc.length;S++)sn(mc[S],a);S=g;break;case"source":sn("error",a),S=g;break;case"img":case"image":case"link":sn("error",a),sn("load",a),S=g;break;case"details":sn("toggle",a),S=g;break;case"input":vt(a,g),S=Tt(a,g),sn("invalid",a);break;case"option":S=g;break;case"select":a._wrapperState={wasMultiple:!!g.multiple},S=I({},g,{value:void 0}),sn("invalid",a);break;case"textarea":Me(a,g),S=ve(a,g),sn("invalid",a);break;default:S=g}or(f,S),$=S;for(E in $)if($.hasOwnProperty(E)){var W=$[E];E==="style"?Ts(a,W):E==="dangerouslySetInnerHTML"?(W=W?W.__html:void 0,W!=null&&mn(a,W)):E==="children"?typeof W=="string"?(f!=="textarea"||W!=="")&&ft(a,W):typeof W=="number"&&ft(a,""+W):E!=="suppressContentEditableWarning"&&E!=="suppressHydrationWarning"&&E!=="autoFocus"&&(i.hasOwnProperty(E)?W!=null&&E==="onScroll"&&sn("scroll",a):W!=null&&k(a,E,W,D))}switch(f){case"input":ct(a),Re(a,g,!1);break;case"textarea":ct(a),Ue(a);break;case"option":g.value!=null&&a.setAttribute("value",""+le(g.value));break;case"select":a.multiple=!!g.multiple,E=g.value,E!=null?ce(a,!!g.multiple,E,!1):g.defaultValue!=null&&ce(a,!!g.multiple,g.defaultValue,!0);break;default:typeof S.onClick=="function"&&(a.onclick=sd)}switch(f){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}}g&&(c.flags|=4)}c.ref!==null&&(c.flags|=512,c.flags|=2097152)}return er(c),null;case 6:if(a&&c.stateNode!=null)r0(a,c,a.memoizedProps,g);else{if(typeof g!="string"&&c.stateNode===null)throw Error(n(166));if(f=Ls(jc.current),Ls(Mi.current),pd(c)){if(g=c.stateNode,f=c.memoizedProps,g[Ni]=c,(E=g.nodeValue!==f)&&(a=Ar,a!==null))switch(a.tag){case 3:od(g.nodeValue,f,(a.mode&1)!==0);break;case 5:a.memoizedProps.suppressHydrationWarning!==!0&&od(g.nodeValue,f,(a.mode&1)!==0)}E&&(c.flags|=4)}else g=(f.nodeType===9?f:f.ownerDocument).createTextNode(g),g[Ni]=c,c.stateNode=g}return er(c),null;case 13:if(an(yn),g=c.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(fn&&Nr!==null&&c.mode&1&&!(c.flags&128))o1(),Ha(),c.flags|=98560,E=!1;else if(E=pd(c),g!==null&&g.dehydrated!==null){if(a===null){if(!E)throw Error(n(318));if(E=c.memoizedState,E=E!==null?E.dehydrated:null,!E)throw Error(n(317));E[Ni]=c}else Ha(),!(c.flags&128)&&(c.memoizedState=null),c.flags|=4;er(c),E=!1}else pi!==null&&(jm(pi),pi=null),E=!0;if(!E)return c.flags&65536?c:null}return c.flags&128?(c.lanes=f,c):(g=g!==null,g!==(a!==null&&a.memoizedState!==null)&&g&&(c.child.flags|=8192,c.mode&1&&(a===null||yn.current&1?Ln===0&&(Ln=3):km())),c.updateQueue!==null&&(c.flags|=4),er(c),null);case 4:return Ka(),fm(a,c),a===null&&gc(c.stateNode.containerInfo),er(c),null;case 10:return zh(c.type._context),er(c),null;case 17:return yr(c.type)&&ld(),er(c),null;case 19:if(an(yn),E=c.memoizedState,E===null)return er(c),null;if(g=(c.flags&128)!==0,D=E.rendering,D===null)if(g)Pc(E,!1);else{if(Ln!==0||a!==null&&a.flags&128)for(a=c.child;a!==null;){if(D=bd(a),D!==null){for(c.flags|=128,Pc(E,!1),g=D.updateQueue,g!==null&&(c.updateQueue=g,c.flags|=4),c.subtreeFlags=0,g=f,f=c.child;f!==null;)E=f,a=g,E.flags&=14680066,D=E.alternate,D===null?(E.childLanes=0,E.lanes=a,E.child=null,E.subtreeFlags=0,E.memoizedProps=null,E.memoizedState=null,E.updateQueue=null,E.dependencies=null,E.stateNode=null):(E.childLanes=D.childLanes,E.lanes=D.lanes,E.child=D.child,E.subtreeFlags=0,E.deletions=null,E.memoizedProps=D.memoizedProps,E.memoizedState=D.memoizedState,E.updateQueue=D.updateQueue,E.type=D.type,a=D.dependencies,E.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext}),f=f.sibling;return Xt(yn,yn.current&1|2),c.child}a=a.sibling}E.tail!==null&&rn()>Za&&(c.flags|=128,g=!0,Pc(E,!1),c.lanes=4194304)}else{if(!g)if(a=bd(D),a!==null){if(c.flags|=128,g=!0,f=a.updateQueue,f!==null&&(c.updateQueue=f,c.flags|=4),Pc(E,!0),E.tail===null&&E.tailMode==="hidden"&&!D.alternate&&!fn)return er(c),null}else 2*rn()-E.renderingStartTime>Za&&f!==1073741824&&(c.flags|=128,g=!0,Pc(E,!1),c.lanes=4194304);E.isBackwards?(D.sibling=c.child,c.child=D):(f=E.last,f!==null?f.sibling=D:c.child=D,E.last=D)}return E.tail!==null?(c=E.tail,E.rendering=c,E.tail=c.sibling,E.renderingStartTime=rn(),c.sibling=null,f=yn.current,Xt(yn,g?f&1|2:f&1),c):(er(c),null);case 22:case 23:return Em(),g=c.memoizedState!==null,a!==null&&a.memoizedState!==null!==g&&(c.flags|=8192),g&&c.mode&1?Mr&1073741824&&(er(c),c.subtreeFlags&6&&(c.flags|=8192)):er(c),null;case 24:return null;case 25:return null}throw Error(n(156,c.tag))}function r_(a,c){switch(Nh(c),c.tag){case 1:return yr(c.type)&&ld(),a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 3:return Ka(),an(gr),an(Jn),Kh(),a=c.flags,a&65536&&!(a&128)?(c.flags=a&-65537|128,c):null;case 5:return Gh(c),null;case 13:if(an(yn),a=c.memoizedState,a!==null&&a.dehydrated!==null){if(c.alternate===null)throw Error(n(340));Ha()}return a=c.flags,a&65536?(c.flags=a&-65537|128,c):null;case 19:return an(yn),null;case 4:return Ka(),null;case 10:return zh(c.type._context),null;case 22:case 23:return Em(),null;case 24:return null;default:return null}}var Pd=!1,tr=!1,i_=typeof WeakSet=="function"?WeakSet:Set,He=null;function Xa(a,c){var f=a.ref;if(f!==null)if(typeof f=="function")try{f(null)}catch(g){jn(a,c,g)}else f.current=null}function pm(a,c,f){try{f()}catch(g){jn(a,c,g)}}var i0=!1;function o_(a,c){if(Eh=Qu,a=Mb(),yh(a)){if("selectionStart"in a)var f={start:a.selectionStart,end:a.selectionEnd};else e:{f=(f=a.ownerDocument)&&f.defaultView||window;var g=f.getSelection&&f.getSelection();if(g&&g.rangeCount!==0){f=g.anchorNode;var S=g.anchorOffset,E=g.focusNode;g=g.focusOffset;try{f.nodeType,E.nodeType}catch{f=null;break e}var D=0,$=-1,W=-1,te=0,he=0,ge=a,pe=null;t:for(;;){for(var Oe;ge!==f||S!==0&&ge.nodeType!==3||($=D+S),ge!==E||g!==0&&ge.nodeType!==3||(W=D+g),ge.nodeType===3&&(D+=ge.nodeValue.length),(Oe=ge.firstChild)!==null;)pe=ge,ge=Oe;for(;;){if(ge===a)break t;if(pe===f&&++te===S&&($=D),pe===E&&++he===g&&(W=D),(Oe=ge.nextSibling)!==null)break;ge=pe,pe=ge.parentNode}ge=Oe}f=$===-1||W===-1?null:{start:$,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(kh={focusedElem:a,selectionRange:f},Qu=!1,He=c;He!==null;)if(c=He,a=c.child,(c.subtreeFlags&1028)!==0&&a!==null)a.return=c,He=a;else for(;He!==null;){c=He;try{var Ge=c.alternate;if(c.flags&1024)switch(c.tag){case 0:case 11:case 15:break;case 1:if(Ge!==null){var Ye=Ge.memoizedProps,Pn=Ge.memoizedState,X=c.stateNode,H=X.getSnapshotBeforeUpdate(c.elementType===c.type?Ye:hi(c.type,Ye),Pn);X.__reactInternalSnapshotBeforeUpdate=H}break;case 3:var J=c.stateNode.containerInfo;J.nodeType===1?J.textContent="":J.nodeType===9&&J.documentElement&&J.removeChild(J.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Ce){jn(c,c.return,Ce)}if(a=c.sibling,a!==null){a.return=c.return,He=a;break}He=c.return}return Ge=i0,i0=!1,Ge}function Rc(a,c,f){var g=c.updateQueue;if(g=g!==null?g.lastEffect:null,g!==null){var S=g=g.next;do{if((S.tag&a)===a){var E=S.destroy;S.destroy=void 0,E!==void 0&&pm(c,f,E)}S=S.next}while(S!==g)}}function Rd(a,c){if(c=c.updateQueue,c=c!==null?c.lastEffect:null,c!==null){var f=c=c.next;do{if((f.tag&a)===a){var g=f.create;f.destroy=g()}f=f.next}while(f!==c)}}function hm(a){var c=a.ref;if(c!==null){var f=a.stateNode;switch(a.tag){case 5:a=f;break;default:a=f}typeof c=="function"?c(a):c.current=a}}function o0(a){var c=a.alternate;c!==null&&(a.alternate=null,o0(c)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(c=a.stateNode,c!==null&&(delete c[Ni],delete c[vc],delete c[_h],delete c[B2],delete c[U2])),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}function s0(a){return a.tag===5||a.tag===3||a.tag===4}function a0(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||s0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function mm(a,c,f){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?f.nodeType===8?f.parentNode.insertBefore(a,c):f.insertBefore(a,c):(f.nodeType===8?(c=f.parentNode,c.insertBefore(a,f)):(c=f,c.appendChild(a)),f=f._reactRootContainer,f!=null||c.onclick!==null||(c.onclick=sd));else if(g!==4&&(a=a.child,a!==null))for(mm(a,c,f),a=a.sibling;a!==null;)mm(a,c,f),a=a.sibling}function gm(a,c,f){var g=a.tag;if(g===5||g===6)a=a.stateNode,c?f.insertBefore(a,c):f.appendChild(a);else if(g!==4&&(a=a.child,a!==null))for(gm(a,c,f),a=a.sibling;a!==null;)gm(a,c,f),a=a.sibling}var Hn=null,mi=!1;function Xo(a,c,f){for(f=f.child;f!==null;)l0(a,c,f),f=f.sibling}function l0(a,c,f){if(Xn&&typeof Xn.onCommitFiberUnmount=="function")try{Xn.onCommitFiberUnmount(di,f)}catch{}switch(f.tag){case 5:tr||Xa(f,c);case 6:var g=Hn,S=mi;Hn=null,Xo(a,c,f),Hn=g,mi=S,Hn!==null&&(mi?(a=Hn,f=f.stateNode,a.nodeType===8?a.parentNode.removeChild(f):a.removeChild(f)):Hn.removeChild(f.stateNode));break;case 18:Hn!==null&&(mi?(a=Hn,f=f.stateNode,a.nodeType===8?Rh(a.parentNode,f):a.nodeType===1&&Rh(a,f),ac(a)):Rh(Hn,f.stateNode));break;case 4:g=Hn,S=mi,Hn=f.stateNode.containerInfo,mi=!0,Xo(a,c,f),Hn=g,mi=S;break;case 0:case 11:case 14:case 15:if(!tr&&(g=f.updateQueue,g!==null&&(g=g.lastEffect,g!==null))){S=g=g.next;do{var E=S,D=E.destroy;E=E.tag,D!==void 0&&(E&2||E&4)&&pm(f,c,D),S=S.next}while(S!==g)}Xo(a,c,f);break;case 1:if(!tr&&(Xa(f,c),g=f.stateNode,typeof g.componentWillUnmount=="function"))try{g.props=f.memoizedProps,g.state=f.memoizedState,g.componentWillUnmount()}catch($){jn(f,c,$)}Xo(a,c,f);break;case 21:Xo(a,c,f);break;case 22:f.mode&1?(tr=(g=tr)||f.memoizedState!==null,Xo(a,c,f),tr=g):Xo(a,c,f);break;default:Xo(a,c,f)}}function c0(a){var c=a.updateQueue;if(c!==null){a.updateQueue=null;var f=a.stateNode;f===null&&(f=a.stateNode=new i_),c.forEach(function(g){var S=h_.bind(null,a,g);f.has(g)||(f.add(g),g.then(S,S))})}}function gi(a,c){var f=c.deletions;if(f!==null)for(var g=0;g<f.length;g++){var S=f[g];try{var E=a,D=c,$=D;e:for(;$!==null;){switch($.tag){case 5:Hn=$.stateNode,mi=!1;break e;case 3:Hn=$.stateNode.containerInfo,mi=!0;break e;case 4:Hn=$.stateNode.containerInfo,mi=!0;break e}$=$.return}if(Hn===null)throw Error(n(160));l0(E,D,S),Hn=null,mi=!1;var W=S.alternate;W!==null&&(W.return=null),S.return=null}catch(te){jn(S,c,te)}}if(c.subtreeFlags&12854)for(c=c.child;c!==null;)u0(c,a),c=c.sibling}function u0(a,c){var f=a.alternate,g=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:if(gi(c,a),Li(a),g&4){try{Rc(3,a,a.return),Rd(3,a)}catch(Ye){jn(a,a.return,Ye)}try{Rc(5,a,a.return)}catch(Ye){jn(a,a.return,Ye)}}break;case 1:gi(c,a),Li(a),g&512&&f!==null&&Xa(f,f.return);break;case 5:if(gi(c,a),Li(a),g&512&&f!==null&&Xa(f,f.return),a.flags&32){var S=a.stateNode;try{ft(S,"")}catch(Ye){jn(a,a.return,Ye)}}if(g&4&&(S=a.stateNode,S!=null)){var E=a.memoizedProps,D=f!==null?f.memoizedProps:E,$=a.type,W=a.updateQueue;if(a.updateQueue=null,W!==null)try{$==="input"&&E.type==="radio"&&E.name!=null&&_t(S,E),Di($,D);var te=Di($,E);for(D=0;D<W.length;D+=2){var he=W[D],ge=W[D+1];he==="style"?Ts(S,ge):he==="dangerouslySetInnerHTML"?mn(S,ge):he==="children"?ft(S,ge):k(S,he,ge,te)}switch($){case"input":we(S,E);break;case"textarea":ue(S,E);break;case"select":var pe=S._wrapperState.wasMultiple;S._wrapperState.wasMultiple=!!E.multiple;var Oe=E.value;Oe!=null?ce(S,!!E.multiple,Oe,!1):pe!==!!E.multiple&&(E.defaultValue!=null?ce(S,!!E.multiple,E.defaultValue,!0):ce(S,!!E.multiple,E.multiple?[]:"",!1))}S[vc]=E}catch(Ye){jn(a,a.return,Ye)}}break;case 6:if(gi(c,a),Li(a),g&4){if(a.stateNode===null)throw Error(n(162));S=a.stateNode,E=a.memoizedProps;try{S.nodeValue=E}catch(Ye){jn(a,a.return,Ye)}}break;case 3:if(gi(c,a),Li(a),g&4&&f!==null&&f.memoizedState.isDehydrated)try{ac(c.containerInfo)}catch(Ye){jn(a,a.return,Ye)}break;case 4:gi(c,a),Li(a);break;case 13:gi(c,a),Li(a),S=a.child,S.flags&8192&&(E=S.memoizedState!==null,S.stateNode.isHidden=E,!E||S.alternate!==null&&S.alternate.memoizedState!==null||(xm=rn())),g&4&&c0(a);break;case 22:if(he=f!==null&&f.memoizedState!==null,a.mode&1?(tr=(te=tr)||he,gi(c,a),tr=te):gi(c,a),Li(a),g&8192){if(te=a.memoizedState!==null,(a.stateNode.isHidden=te)&&!he&&a.mode&1)for(He=a,he=a.child;he!==null;){for(ge=He=he;He!==null;){switch(pe=He,Oe=pe.child,pe.tag){case 0:case 11:case 14:case 15:Rc(4,pe,pe.return);break;case 1:Xa(pe,pe.return);var Ge=pe.stateNode;if(typeof Ge.componentWillUnmount=="function"){g=pe,f=pe.return;try{c=g,Ge.props=c.memoizedProps,Ge.state=c.memoizedState,Ge.componentWillUnmount()}catch(Ye){jn(g,f,Ye)}}break;case 5:Xa(pe,pe.return);break;case 22:if(pe.memoizedState!==null){p0(ge);continue}}Oe!==null?(Oe.return=pe,He=Oe):p0(ge)}he=he.sibling}e:for(he=null,ge=a;;){if(ge.tag===5){if(he===null){he=ge;try{S=ge.stateNode,te?(E=S.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none"):($=ge.stateNode,W=ge.memoizedProps.style,D=W!=null&&W.hasOwnProperty("display")?W.display:null,$.style.display=Ji("display",D))}catch(Ye){jn(a,a.return,Ye)}}}else if(ge.tag===6){if(he===null)try{ge.stateNode.nodeValue=te?"":ge.memoizedProps}catch(Ye){jn(a,a.return,Ye)}}else if((ge.tag!==22&&ge.tag!==23||ge.memoizedState===null||ge===a)&&ge.child!==null){ge.child.return=ge,ge=ge.child;continue}if(ge===a)break e;for(;ge.sibling===null;){if(ge.return===null||ge.return===a)break e;he===ge&&(he=null),ge=ge.return}he===ge&&(he=null),ge.sibling.return=ge.return,ge=ge.sibling}}break;case 19:gi(c,a),Li(a),g&4&&c0(a);break;case 21:break;default:gi(c,a),Li(a)}}function Li(a){var c=a.flags;if(c&2){try{e:{for(var f=a.return;f!==null;){if(s0(f)){var g=f;break e}f=f.return}throw Error(n(160))}switch(g.tag){case 5:var S=g.stateNode;g.flags&32&&(ft(S,""),g.flags&=-33);var E=a0(a);gm(a,E,S);break;case 3:case 4:var D=g.stateNode.containerInfo,$=a0(a);mm(a,$,D);break;default:throw Error(n(161))}}catch(W){jn(a,a.return,W)}a.flags&=-3}c&4096&&(a.flags&=-4097)}function s_(a,c,f){He=a,d0(a)}function d0(a,c,f){for(var g=(a.mode&1)!==0;He!==null;){var S=He,E=S.child;if(S.tag===22&&g){var D=S.memoizedState!==null||Pd;if(!D){var $=S.alternate,W=$!==null&&$.memoizedState!==null||tr;$=Pd;var te=tr;if(Pd=D,(tr=W)&&!te)for(He=S;He!==null;)D=He,W=D.child,D.tag===22&&D.memoizedState!==null?h0(S):W!==null?(W.return=D,He=W):h0(S);for(;E!==null;)He=E,d0(E),E=E.sibling;He=S,Pd=$,tr=te}f0(a)}else S.subtreeFlags&8772&&E!==null?(E.return=S,He=E):f0(a)}}function f0(a){for(;He!==null;){var c=He;if(c.flags&8772){var f=c.alternate;try{if(c.flags&8772)switch(c.tag){case 0:case 11:case 15:tr||Rd(5,c);break;case 1:var g=c.stateNode;if(c.flags&4&&!tr)if(f===null)g.componentDidMount();else{var S=c.elementType===c.type?f.memoizedProps:hi(c.type,f.memoizedProps);g.componentDidUpdate(S,f.memoizedState,g.__reactInternalSnapshotBeforeUpdate)}var E=c.updateQueue;E!==null&&c1(c,E,g);break;case 3:var D=c.updateQueue;if(D!==null){if(f=null,c.child!==null)switch(c.child.tag){case 5:f=c.child.stateNode;break;case 1:f=c.child.stateNode}c1(c,D,f)}break;case 5:var $=c.stateNode;if(f===null&&c.flags&4){f=$;var W=c.memoizedProps;switch(c.type){case"button":case"input":case"select":case"textarea":W.autoFocus&&f.focus();break;case"img":W.src&&(f.src=W.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(c.memoizedState===null){var te=c.alternate;if(te!==null){var he=te.memoizedState;if(he!==null){var ge=he.dehydrated;ge!==null&&ac(ge)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}tr||c.flags&512&&hm(c)}catch(pe){jn(c,c.return,pe)}}if(c===a){He=null;break}if(f=c.sibling,f!==null){f.return=c.return,He=f;break}He=c.return}}function p0(a){for(;He!==null;){var c=He;if(c===a){He=null;break}var f=c.sibling;if(f!==null){f.return=c.return,He=f;break}He=c.return}}function h0(a){for(;He!==null;){var c=He;try{switch(c.tag){case 0:case 11:case 15:var f=c.return;try{Rd(4,c)}catch(W){jn(c,f,W)}break;case 1:var g=c.stateNode;if(typeof g.componentDidMount=="function"){var S=c.return;try{g.componentDidMount()}catch(W){jn(c,S,W)}}var E=c.return;try{hm(c)}catch(W){jn(c,E,W)}break;case 5:var D=c.return;try{hm(c)}catch(W){jn(c,D,W)}}}catch(W){jn(c,c.return,W)}if(c===a){He=null;break}var $=c.sibling;if($!==null){$.return=c.return,He=$;break}He=c.return}}var a_=Math.ceil,_d=C.ReactCurrentDispatcher,ym=C.ReactCurrentOwner,Kr=C.ReactCurrentBatchConfig,It=0,Bn=null,An=null,qn=0,Mr=0,Ja=qo(0),Ln=0,_c=null,Fs=0,Dd=0,vm=0,Dc=null,xr=null,xm=0,Za=1/0,co=null,Id=!1,bm=null,Jo=null,Ad=!1,Zo=null,Nd=0,Ic=0,wm=null,Md=-1,Od=0;function ar(){return It&6?rn():Md!==-1?Md:Md=rn()}function es(a){return a.mode&1?It&2&&qn!==0?qn&-qn:W2.transition!==null?(Od===0&&(Od=sb()),Od):(a=Bt,a!==0||(a=window.event,a=a===void 0?16:mb(a.type)),a):1}function yi(a,c,f,g){if(50<Ic)throw Ic=0,wm=null,Error(n(185));nc(a,f,g),(!(It&2)||a!==Bn)&&(a===Bn&&(!(It&2)&&(Dd|=f),Ln===4&&ts(a,qn)),br(a,g),f===1&&It===0&&!(c.mode&1)&&(Za=rn()+500,ud&&Qo()))}function br(a,c){var f=a.callbackNode;WR(a,c);var g=Hu(a,a===Bn?qn:0);if(g===0)f!==null&&$o(f),a.callbackNode=null,a.callbackPriority=0;else if(c=g&-g,a.callbackPriority!==c){if(f!=null&&$o(f),c===1)a.tag===0?V2(g0.bind(null,a)):e1(g0.bind(null,a)),F2(function(){!(It&6)&&Qo()}),f=null;else{switch(ab(g)){case 1:f=ui;break;case 4:f=Ds;break;case 16:f=to;break;case 536870912:f=on;break;default:f=to}f=C0(f,m0.bind(null,a))}a.callbackPriority=c,a.callbackNode=f}}function m0(a,c){if(Md=-1,Od=0,It&6)throw Error(n(327));var f=a.callbackNode;if(el()&&a.callbackNode!==f)return null;var g=Hu(a,a===Bn?qn:0);if(g===0)return null;if(g&30||g&a.expiredLanes||c)c=Ld(a,g);else{c=g;var S=It;It|=2;var E=v0();(Bn!==a||qn!==c)&&(co=null,Za=rn()+500,Bs(a,c));do try{u_();break}catch($){y0(a,$)}while(!0);Fh(),_d.current=E,It=S,An!==null?c=0:(Bn=null,qn=0,c=Ln)}if(c!==0){if(c===2&&(S=th(a),S!==0&&(g=S,c=Sm(a,S))),c===1)throw f=_c,Bs(a,0),ts(a,g),br(a,rn()),f;if(c===6)ts(a,g);else{if(S=a.current.alternate,!(g&30)&&!l_(S)&&(c=Ld(a,g),c===2&&(E=th(a),E!==0&&(g=E,c=Sm(a,E))),c===1))throw f=_c,Bs(a,0),ts(a,g),br(a,rn()),f;switch(a.finishedWork=S,a.finishedLanes=g,c){case 0:case 1:throw Error(n(345));case 2:Us(a,xr,co);break;case 3:if(ts(a,g),(g&130023424)===g&&(c=xm+500-rn(),10<c)){if(Hu(a,0)!==0)break;if(S=a.suspendedLanes,(S&g)!==g){ar(),a.pingedLanes|=a.suspendedLanes&S;break}a.timeoutHandle=Ph(Us.bind(null,a,xr,co),c);break}Us(a,xr,co);break;case 4:if(ts(a,g),(g&4194240)===g)break;for(c=a.eventTimes,S=-1;0<g;){var D=31-Fn(g);E=1<<D,D=c[D],D>S&&(S=D),g&=~E}if(g=S,g=rn()-g,g=(120>g?120:480>g?480:1080>g?1080:1920>g?1920:3e3>g?3e3:4320>g?4320:1960*a_(g/1960))-g,10<g){a.timeoutHandle=Ph(Us.bind(null,a,xr,co),g);break}Us(a,xr,co);break;case 5:Us(a,xr,co);break;default:throw Error(n(329))}}}return br(a,rn()),a.callbackNode===f?m0.bind(null,a):null}function Sm(a,c){var f=Dc;return a.current.memoizedState.isDehydrated&&(Bs(a,c).flags|=256),a=Ld(a,c),a!==2&&(c=xr,xr=f,c!==null&&jm(c)),a}function jm(a){xr===null?xr=a:xr.push.apply(xr,a)}function l_(a){for(var c=a;;){if(c.flags&16384){var f=c.updateQueue;if(f!==null&&(f=f.stores,f!==null))for(var g=0;g<f.length;g++){var S=f[g],E=S.getSnapshot;S=S.value;try{if(!fi(E(),S))return!1}catch{return!1}}}if(f=c.child,c.subtreeFlags&16384&&f!==null)f.return=c,c=f;else{if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function ts(a,c){for(c&=~vm,c&=~Dd,a.suspendedLanes|=c,a.pingedLanes&=~c,a=a.expirationTimes;0<c;){var f=31-Fn(c),g=1<<f;a[f]=-1,c&=~g}}function g0(a){if(It&6)throw Error(n(327));el();var c=Hu(a,0);if(!(c&1))return br(a,rn()),null;var f=Ld(a,c);if(a.tag!==0&&f===2){var g=th(a);g!==0&&(c=g,f=Sm(a,g))}if(f===1)throw f=_c,Bs(a,0),ts(a,c),br(a,rn()),f;if(f===6)throw Error(n(345));return a.finishedWork=a.current.alternate,a.finishedLanes=c,Us(a,xr,co),br(a,rn()),null}function Cm(a,c){var f=It;It|=1;try{return a(c)}finally{It=f,It===0&&(Za=rn()+500,ud&&Qo())}}function zs(a){Zo!==null&&Zo.tag===0&&!(It&6)&&el();var c=It;It|=1;var f=Kr.transition,g=Bt;try{if(Kr.transition=null,Bt=1,a)return a()}finally{Bt=g,Kr.transition=f,It=c,!(It&6)&&Qo()}}function Em(){Mr=Ja.current,an(Ja)}function Bs(a,c){a.finishedWork=null,a.finishedLanes=0;var f=a.timeoutHandle;if(f!==-1&&(a.timeoutHandle=-1,$2(f)),An!==null)for(f=An.return;f!==null;){var g=f;switch(Nh(g),g.tag){case 1:g=g.type.childContextTypes,g!=null&&ld();break;case 3:Ka(),an(gr),an(Jn),Kh();break;case 5:Gh(g);break;case 4:Ka();break;case 13:an(yn);break;case 19:an(yn);break;case 10:zh(g.type._context);break;case 22:case 23:Em()}f=f.return}if(Bn=a,An=a=ns(a.current,null),qn=Mr=c,Ln=0,_c=null,vm=Dd=Fs=0,xr=Dc=null,Os!==null){for(c=0;c<Os.length;c++)if(f=Os[c],g=f.interleaved,g!==null){f.interleaved=null;var S=g.next,E=f.pending;if(E!==null){var D=E.next;E.next=S,g.next=D}f.pending=g}Os=null}return a}function y0(a,c){do{var f=An;try{if(Fh(),wd.current=Ed,Sd){for(var g=vn.memoizedState;g!==null;){var S=g.queue;S!==null&&(S.pending=null),g=g.next}Sd=!1}if($s=0,zn=On=vn=null,Cc=!1,Ec=0,ym.current=null,f===null||f.return===null){Ln=1,_c=c,An=null;break}e:{var E=a,D=f.return,$=f,W=c;if(c=qn,$.flags|=32768,W!==null&&typeof W=="object"&&typeof W.then=="function"){var te=W,he=$,ge=he.tag;if(!(he.mode&1)&&(ge===0||ge===11||ge===15)){var pe=he.alternate;pe?(he.updateQueue=pe.updateQueue,he.memoizedState=pe.memoizedState,he.lanes=pe.lanes):(he.updateQueue=null,he.memoizedState=null)}var Oe=U1(D);if(Oe!==null){Oe.flags&=-257,V1(Oe,D,$,E,c),Oe.mode&1&&B1(E,te,c),c=Oe,W=te;var Ge=c.updateQueue;if(Ge===null){var Ye=new Set;Ye.add(W),c.updateQueue=Ye}else Ge.add(W);break e}else{if(!(c&1)){B1(E,te,c),km();break e}W=Error(n(426))}}else if(fn&&$.mode&1){var Pn=U1(D);if(Pn!==null){!(Pn.flags&65536)&&(Pn.flags|=256),V1(Pn,D,$,E,c),Lh(Ya(W,$));break e}}E=W=Ya(W,$),Ln!==4&&(Ln=2),Dc===null?Dc=[E]:Dc.push(E),E=D;do{switch(E.tag){case 3:E.flags|=65536,c&=-c,E.lanes|=c;var X=F1(E,W,c);l1(E,X);break e;case 1:$=W;var H=E.type,J=E.stateNode;if(!(E.flags&128)&&(typeof H.getDerivedStateFromError=="function"||J!==null&&typeof J.componentDidCatch=="function"&&(Jo===null||!Jo.has(J)))){E.flags|=65536,c&=-c,E.lanes|=c;var Ce=z1(E,$,c);l1(E,Ce);break e}}E=E.return}while(E!==null)}b0(f)}catch(Ze){c=Ze,An===f&&f!==null&&(An=f=f.return);continue}break}while(!0)}function v0(){var a=_d.current;return _d.current=Ed,a===null?Ed:a}function km(){(Ln===0||Ln===3||Ln===2)&&(Ln=4),Bn===null||!(Fs&268435455)&&!(Dd&268435455)||ts(Bn,qn)}function Ld(a,c){var f=It;It|=2;var g=v0();(Bn!==a||qn!==c)&&(co=null,Bs(a,c));do try{c_();break}catch(S){y0(a,S)}while(!0);if(Fh(),It=f,_d.current=g,An!==null)throw Error(n(261));return Bn=null,qn=0,Ln}function c_(){for(;An!==null;)x0(An)}function u_(){for(;An!==null&&!ci();)x0(An)}function x0(a){var c=j0(a.alternate,a,Mr);a.memoizedProps=a.pendingProps,c===null?b0(a):An=c,ym.current=null}function b0(a){var c=a;do{var f=c.alternate;if(a=c.return,c.flags&32768){if(f=r_(f,c),f!==null){f.flags&=32767,An=f;return}if(a!==null)a.flags|=32768,a.subtreeFlags=0,a.deletions=null;else{Ln=6,An=null;return}}else if(f=n_(f,c,Mr),f!==null){An=f;return}if(c=c.sibling,c!==null){An=c;return}An=c=a}while(c!==null);Ln===0&&(Ln=5)}function Us(a,c,f){var g=Bt,S=Kr.transition;try{Kr.transition=null,Bt=1,d_(a,c,f,g)}finally{Kr.transition=S,Bt=g}return null}function d_(a,c,f,g){do el();while(Zo!==null);if(It&6)throw Error(n(327));f=a.finishedWork;var S=a.finishedLanes;if(f===null)return null;if(a.finishedWork=null,a.finishedLanes=0,f===a.current)throw Error(n(177));a.callbackNode=null,a.callbackPriority=0;var E=f.lanes|f.childLanes;if(HR(a,E),a===Bn&&(An=Bn=null,qn=0),!(f.subtreeFlags&2064)&&!(f.flags&2064)||Ad||(Ad=!0,C0(to,function(){return el(),null})),E=(f.flags&15990)!==0,f.subtreeFlags&15990||E){E=Kr.transition,Kr.transition=null;var D=Bt;Bt=1;var $=It;It|=4,ym.current=null,o_(a,f),u0(f,a),D2(kh),Qu=!!Eh,kh=Eh=null,a.current=f,s_(f),Wr(),It=$,Bt=D,Kr.transition=E}else a.current=f;if(Ad&&(Ad=!1,Zo=a,Nd=S),E=a.pendingLanes,E===0&&(Jo=null),Sn(f.stateNode),br(a,rn()),c!==null)for(g=a.onRecoverableError,f=0;f<c.length;f++)S=c[f],g(S.value,{componentStack:S.stack,digest:S.digest});if(Id)throw Id=!1,a=bm,bm=null,a;return Nd&1&&a.tag!==0&&el(),E=a.pendingLanes,E&1?a===wm?Ic++:(Ic=0,wm=a):Ic=0,Qo(),null}function el(){if(Zo!==null){var a=ab(Nd),c=Kr.transition,f=Bt;try{if(Kr.transition=null,Bt=16>a?16:a,Zo===null)var g=!1;else{if(a=Zo,Zo=null,Nd=0,It&6)throw Error(n(331));var S=It;for(It|=4,He=a.current;He!==null;){var E=He,D=E.child;if(He.flags&16){var $=E.deletions;if($!==null){for(var W=0;W<$.length;W++){var te=$[W];for(He=te;He!==null;){var he=He;switch(he.tag){case 0:case 11:case 15:Rc(8,he,E)}var ge=he.child;if(ge!==null)ge.return=he,He=ge;else for(;He!==null;){he=He;var pe=he.sibling,Oe=he.return;if(o0(he),he===te){He=null;break}if(pe!==null){pe.return=Oe,He=pe;break}He=Oe}}}var Ge=E.alternate;if(Ge!==null){var Ye=Ge.child;if(Ye!==null){Ge.child=null;do{var Pn=Ye.sibling;Ye.sibling=null,Ye=Pn}while(Ye!==null)}}He=E}}if(E.subtreeFlags&2064&&D!==null)D.return=E,He=D;else e:for(;He!==null;){if(E=He,E.flags&2048)switch(E.tag){case 0:case 11:case 15:Rc(9,E,E.return)}var X=E.sibling;if(X!==null){X.return=E.return,He=X;break e}He=E.return}}var H=a.current;for(He=H;He!==null;){D=He;var J=D.child;if(D.subtreeFlags&2064&&J!==null)J.return=D,He=J;else e:for(D=H;He!==null;){if($=He,$.flags&2048)try{switch($.tag){case 0:case 11:case 15:Rd(9,$)}}catch(Ze){jn($,$.return,Ze)}if($===D){He=null;break e}var Ce=$.sibling;if(Ce!==null){Ce.return=$.return,He=Ce;break e}He=$.return}}if(It=S,Qo(),Xn&&typeof Xn.onPostCommitFiberRoot=="function")try{Xn.onPostCommitFiberRoot(di,a)}catch{}g=!0}return g}finally{Bt=f,Kr.transition=c}}return!1}function w0(a,c,f){c=Ya(f,c),c=F1(a,c,1),a=Yo(a,c,1),c=ar(),a!==null&&(nc(a,1,c),br(a,c))}function jn(a,c,f){if(a.tag===3)w0(a,a,f);else for(;c!==null;){if(c.tag===3){w0(c,a,f);break}else if(c.tag===1){var g=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(Jo===null||!Jo.has(g))){a=Ya(f,a),a=z1(c,a,1),c=Yo(c,a,1),a=ar(),c!==null&&(nc(c,1,a),br(c,a));break}}c=c.return}}function f_(a,c,f){var g=a.pingCache;g!==null&&g.delete(c),c=ar(),a.pingedLanes|=a.suspendedLanes&f,Bn===a&&(qn&f)===f&&(Ln===4||Ln===3&&(qn&130023424)===qn&&500>rn()-xm?Bs(a,0):vm|=f),br(a,c)}function S0(a,c){c===0&&(a.mode&1?(c=Wu,Wu<<=1,!(Wu&130023424)&&(Wu=4194304)):c=1);var f=ar();a=so(a,c),a!==null&&(nc(a,c,f),br(a,f))}function p_(a){var c=a.memoizedState,f=0;c!==null&&(f=c.retryLane),S0(a,f)}function h_(a,c){var f=0;switch(a.tag){case 13:var g=a.stateNode,S=a.memoizedState;S!==null&&(f=S.retryLane);break;case 19:g=a.stateNode;break;default:throw Error(n(314))}g!==null&&g.delete(c),S0(a,f)}var j0;j0=function(a,c,f){if(a!==null)if(a.memoizedProps!==c.pendingProps||gr.current)vr=!0;else{if(!(a.lanes&f)&&!(c.flags&128))return vr=!1,t_(a,c,f);vr=!!(a.flags&131072)}else vr=!1,fn&&c.flags&1048576&&t1(c,fd,c.index);switch(c.lanes=0,c.tag){case 2:var g=c.type;Td(a,c),a=c.pendingProps;var S=Ua(c,Jn.current);Ga(c,f),S=Jh(null,c,g,a,S,f);var E=Zh();return c.flags|=1,typeof S=="object"&&S!==null&&typeof S.render=="function"&&S.$$typeof===void 0?(c.tag=1,c.memoizedState=null,c.updateQueue=null,yr(g)?(E=!0,cd(c)):E=!1,c.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,Vh(c),S.updater=vd,c.stateNode=S,S._reactInternals=c,Hh(c,g,a,f),c=am(null,c,g,!0,E,f)):(c.tag=0,fn&&E&&Ah(c),sr(null,c,S,f),c=c.child),c;case 16:g=c.elementType;e:{switch(Td(a,c),a=c.pendingProps,S=g._init,g=S(g._payload),c.type=g,S=c.tag=g_(g),a=hi(g,a),S){case 0:c=sm(null,c,g,a,f);break e;case 1:c=K1(null,c,g,a,f);break e;case 11:c=W1(null,c,g,a,f);break e;case 14:c=H1(null,c,g,hi(g.type,a),f);break e}throw Error(n(306,g,""))}return c;case 0:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:hi(g,S),sm(a,c,g,S,f);case 1:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:hi(g,S),K1(a,c,g,S,f);case 3:e:{if(Y1(c),a===null)throw Error(n(387));g=c.pendingProps,E=c.memoizedState,S=E.element,a1(a,c),yd(c,g,null,f);var D=c.memoizedState;if(g=D.element,E.isDehydrated)if(E={element:g,isDehydrated:!1,cache:D.cache,pendingSuspenseBoundaries:D.pendingSuspenseBoundaries,transitions:D.transitions},c.updateQueue.baseState=E,c.memoizedState=E,c.flags&256){S=Ya(Error(n(423)),c),c=X1(a,c,g,f,S);break e}else if(g!==S){S=Ya(Error(n(424)),c),c=X1(a,c,g,f,S);break e}else for(Nr=Ho(c.stateNode.containerInfo.firstChild),Ar=c,fn=!0,pi=null,f=g1(c,null,g,f),c.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(Ha(),g===S){c=lo(a,c,f);break e}sr(a,c,g,f)}c=c.child}return c;case 5:return y1(c),a===null&&Oh(c),g=c.type,S=c.pendingProps,E=a!==null?a.memoizedProps:null,D=S.children,Th(g,S)?D=null:E!==null&&Th(g,E)&&(c.flags|=32),Q1(a,c),sr(a,c,D,f),c.child;case 6:return a===null&&Oh(c),null;case 13:return J1(a,c,f);case 4:return qh(c,c.stateNode.containerInfo),g=c.pendingProps,a===null?c.child=Qa(c,null,g,f):sr(a,c,g,f),c.child;case 11:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:hi(g,S),W1(a,c,g,S,f);case 7:return sr(a,c,c.pendingProps,f),c.child;case 8:return sr(a,c,c.pendingProps.children,f),c.child;case 12:return sr(a,c,c.pendingProps.children,f),c.child;case 10:e:{if(g=c.type._context,S=c.pendingProps,E=c.memoizedProps,D=S.value,Xt(hd,g._currentValue),g._currentValue=D,E!==null)if(fi(E.value,D)){if(E.children===S.children&&!gr.current){c=lo(a,c,f);break e}}else for(E=c.child,E!==null&&(E.return=c);E!==null;){var $=E.dependencies;if($!==null){D=E.child;for(var W=$.firstContext;W!==null;){if(W.context===g){if(E.tag===1){W=ao(-1,f&-f),W.tag=2;var te=E.updateQueue;if(te!==null){te=te.shared;var he=te.pending;he===null?W.next=W:(W.next=he.next,he.next=W),te.pending=W}}E.lanes|=f,W=E.alternate,W!==null&&(W.lanes|=f),Bh(E.return,f,c),$.lanes|=f;break}W=W.next}}else if(E.tag===10)D=E.type===c.type?null:E.child;else if(E.tag===18){if(D=E.return,D===null)throw Error(n(341));D.lanes|=f,$=D.alternate,$!==null&&($.lanes|=f),Bh(D,f,c),D=E.sibling}else D=E.child;if(D!==null)D.return=E;else for(D=E;D!==null;){if(D===c){D=null;break}if(E=D.sibling,E!==null){E.return=D.return,D=E;break}D=D.return}E=D}sr(a,c,S.children,f),c=c.child}return c;case 9:return S=c.type,g=c.pendingProps.children,Ga(c,f),S=Gr(S),g=g(S),c.flags|=1,sr(a,c,g,f),c.child;case 14:return g=c.type,S=hi(g,c.pendingProps),S=hi(g.type,S),H1(a,c,g,S,f);case 15:return q1(a,c,c.type,c.pendingProps,f);case 17:return g=c.type,S=c.pendingProps,S=c.elementType===g?S:hi(g,S),Td(a,c),c.tag=1,yr(g)?(a=!0,cd(c)):a=!1,Ga(c,f),f1(c,g,S),Hh(c,g,S,f),am(null,c,g,!0,a,f);case 19:return e0(a,c,f);case 22:return G1(a,c,f)}throw Error(n(156,c.tag))};function C0(a,c){return eo(a,c)}function m_(a,c,f,g){this.tag=a,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Yr(a,c,f,g){return new m_(a,c,f,g)}function Tm(a){return a=a.prototype,!(!a||!a.isReactComponent)}function g_(a){if(typeof a=="function")return Tm(a)?1:0;if(a!=null){if(a=a.$$typeof,a===q)return 11;if(a===ne)return 14}return 2}function ns(a,c){var f=a.alternate;return f===null?(f=Yr(a.tag,c,a.key,a.mode),f.elementType=a.elementType,f.type=a.type,f.stateNode=a.stateNode,f.alternate=a,a.alternate=f):(f.pendingProps=c,f.type=a.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=a.flags&14680064,f.childLanes=a.childLanes,f.lanes=a.lanes,f.child=a.child,f.memoizedProps=a.memoizedProps,f.memoizedState=a.memoizedState,f.updateQueue=a.updateQueue,c=a.dependencies,f.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},f.sibling=a.sibling,f.index=a.index,f.ref=a.ref,f}function $d(a,c,f,g,S,E){var D=2;if(g=a,typeof a=="function")Tm(a)&&(D=1);else if(typeof a=="string")D=5;else e:switch(a){case M:return Vs(f.children,S,E,c);case N:D=8,S|=8;break;case L:return a=Yr(12,f,c,S|2),a.elementType=L,a.lanes=E,a;case Y:return a=Yr(13,f,c,S),a.elementType=Y,a.lanes=E,a;case Q:return a=Yr(19,f,c,S),a.elementType=Q,a.lanes=E,a;case O:return Fd(f,S,E,c);default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:D=10;break e;case G:D=9;break e;case q:D=11;break e;case ne:D=14;break e;case V:D=16,g=null;break e}throw Error(n(130,a==null?a:typeof a,""))}return c=Yr(D,f,c,S),c.elementType=a,c.type=g,c.lanes=E,c}function Vs(a,c,f,g){return a=Yr(7,a,g,c),a.lanes=f,a}function Fd(a,c,f,g){return a=Yr(22,a,g,c),a.elementType=O,a.lanes=f,a.stateNode={isHidden:!1},a}function Pm(a,c,f){return a=Yr(6,a,null,c),a.lanes=f,a}function Rm(a,c,f){return c=Yr(4,a.children!==null?a.children:[],a.key,c),c.lanes=f,c.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},c}function y_(a,c,f,g,S){this.tag=c,this.containerInfo=a,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=nh(0),this.expirationTimes=nh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nh(0),this.identifierPrefix=g,this.onRecoverableError=S,this.mutableSourceEagerHydrationData=null}function _m(a,c,f,g,S,E,D,$,W){return a=new y_(a,c,f,$,W),c===1?(c=1,E===!0&&(c|=8)):c=0,E=Yr(3,null,null,c),a.current=E,E.stateNode=a,E.memoizedState={element:g,isDehydrated:f,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vh(E),a}function v_(a,c,f){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:g==null?null:""+g,children:a,containerInfo:c,implementation:f}}function E0(a){if(!a)return Go;a=a._reactInternals;e:{if(Ve(a)!==a||a.tag!==1)throw Error(n(170));var c=a;do{switch(c.tag){case 3:c=c.stateNode.context;break e;case 1:if(yr(c.type)){c=c.stateNode.__reactInternalMemoizedMergedChildContext;break e}}c=c.return}while(c!==null);throw Error(n(171))}if(a.tag===1){var f=a.type;if(yr(f))return Jb(a,f,c)}return c}function k0(a,c,f,g,S,E,D,$,W){return a=_m(f,g,!0,a,S,E,D,$,W),a.context=E0(null),f=a.current,g=ar(),S=es(f),E=ao(g,S),E.callback=c??null,Yo(f,E,S),a.current.lanes=S,nc(a,S,g),br(a,g),a}function zd(a,c,f,g){var S=c.current,E=ar(),D=es(S);return f=E0(f),c.context===null?c.context=f:c.pendingContext=f,c=ao(E,D),c.payload={element:a},g=g===void 0?null:g,g!==null&&(c.callback=g),a=Yo(S,c,D),a!==null&&(yi(a,S,D,E),gd(a,S,D)),D}function Bd(a){if(a=a.current,!a.child)return null;switch(a.child.tag){case 5:return a.child.stateNode;default:return a.child.stateNode}}function T0(a,c){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var f=a.retryLane;a.retryLane=f!==0&&f<c?f:c}}function Dm(a,c){T0(a,c),(a=a.alternate)&&T0(a,c)}function x_(){return null}var P0=typeof reportError=="function"?reportError:function(a){console.error(a)};function Im(a){this._internalRoot=a}Ud.prototype.render=Im.prototype.render=function(a){var c=this._internalRoot;if(c===null)throw Error(n(409));zd(a,c,null,null)},Ud.prototype.unmount=Im.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var c=a.containerInfo;zs(function(){zd(null,a,null,null)}),c[no]=null}};function Ud(a){this._internalRoot=a}Ud.prototype.unstable_scheduleHydration=function(a){if(a){var c=ub();a={blockedOn:null,target:a,priority:c};for(var f=0;f<Uo.length&&c!==0&&c<Uo[f].priority;f++);Uo.splice(f,0,a),f===0&&pb(a)}};function Am(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function Vd(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11&&(a.nodeType!==8||a.nodeValue!==" react-mount-point-unstable "))}function R0(){}function b_(a,c,f,g,S){if(S){if(typeof g=="function"){var E=g;g=function(){var te=Bd(D);E.call(te)}}var D=k0(c,g,a,0,null,!1,!1,"",R0);return a._reactRootContainer=D,a[no]=D.current,gc(a.nodeType===8?a.parentNode:a),zs(),D}for(;S=a.lastChild;)a.removeChild(S);if(typeof g=="function"){var $=g;g=function(){var te=Bd(W);$.call(te)}}var W=_m(a,0,!1,null,null,!1,!1,"",R0);return a._reactRootContainer=W,a[no]=W.current,gc(a.nodeType===8?a.parentNode:a),zs(function(){zd(c,W,f,g)}),W}function Wd(a,c,f,g,S){var E=f._reactRootContainer;if(E){var D=E;if(typeof S=="function"){var $=S;S=function(){var W=Bd(D);$.call(W)}}zd(c,D,a,S)}else D=b_(f,c,a,S,g);return Bd(D)}lb=function(a){switch(a.tag){case 3:var c=a.stateNode;if(c.current.memoizedState.isDehydrated){var f=tc(c.pendingLanes);f!==0&&(rh(c,f|1),br(c,rn()),!(It&6)&&(Za=rn()+500,Qo()))}break;case 13:zs(function(){var g=so(a,1);if(g!==null){var S=ar();yi(g,a,1,S)}}),Dm(a,1)}},ih=function(a){if(a.tag===13){var c=so(a,134217728);if(c!==null){var f=ar();yi(c,a,134217728,f)}Dm(a,134217728)}},cb=function(a){if(a.tag===13){var c=es(a),f=so(a,c);if(f!==null){var g=ar();yi(f,a,c,g)}Dm(a,c)}},ub=function(){return Bt},db=function(a,c){var f=Bt;try{return Bt=a,c()}finally{Bt=f}},Ai=function(a,c,f){switch(c){case"input":if(we(a,f),c=f.name,f.type==="radio"&&c!=null){for(f=a;f.parentNode;)f=f.parentNode;for(f=f.querySelectorAll("input[name="+JSON.stringify(""+c)+'][type="radio"]'),c=0;c<f.length;c++){var g=f[c];if(g!==a&&g.form===a.form){var S=ad(g);if(!S)throw Error(n(90));St(g),we(g,S)}}}break;case"textarea":ue(a,f);break;case"select":c=f.value,c!=null&&ce(a,!!f.multiple,c,!1)}},Lo=Cm,Zi=zs;var w_={usingClientEntryPoint:!1,Events:[xc,za,ad,Wn,Ps,Cm]},Ac={findFiberByHostInstance:Is,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},S_={bundleType:Ac.bundleType,version:Ac.version,rendererPackageName:Ac.rendererPackageName,rendererConfig:Ac.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(a){return a=Ct(a),a===null?null:a.stateNode},findFiberByHostInstance:Ac.findFiberByHostInstance||x_,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hd.isDisabled&&Hd.supportsFiber)try{di=Hd.inject(S_),Xn=Hd}catch{}}return wr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=w_,wr.createPortal=function(a,c){var f=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Am(c))throw Error(n(200));return v_(a,c,null,f)},wr.createRoot=function(a,c){if(!Am(a))throw Error(n(299));var f=!1,g="",S=P0;return c!=null&&(c.unstable_strictMode===!0&&(f=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onRecoverableError!==void 0&&(S=c.onRecoverableError)),c=_m(a,1,!1,null,null,f,!1,g,S),a[no]=c.current,gc(a.nodeType===8?a.parentNode:a),new Im(c)},wr.findDOMNode=function(a){if(a==null)return null;if(a.nodeType===1)return a;var c=a._reactInternals;if(c===void 0)throw typeof a.render=="function"?Error(n(188)):(a=Object.keys(a).join(","),Error(n(268,a)));return a=Ct(c),a=a===null?null:a.stateNode,a},wr.flushSync=function(a){return zs(a)},wr.hydrate=function(a,c,f){if(!Vd(c))throw Error(n(200));return Wd(null,a,c,!0,f)},wr.hydrateRoot=function(a,c,f){if(!Am(a))throw Error(n(405));var g=f!=null&&f.hydratedSources||null,S=!1,E="",D=P0;if(f!=null&&(f.unstable_strictMode===!0&&(S=!0),f.identifierPrefix!==void 0&&(E=f.identifierPrefix),f.onRecoverableError!==void 0&&(D=f.onRecoverableError)),c=k0(c,null,a,1,f??null,S,!1,E,D),a[no]=c.current,gc(a),g)for(a=0;a<g.length;a++)f=g[a],S=f._getVersion,S=S(f._source),c.mutableSourceEagerHydrationData==null?c.mutableSourceEagerHydrationData=[f,S]:c.mutableSourceEagerHydrationData.push(f,S);return new Ud(c)},wr.render=function(a,c,f){if(!Vd(c))throw Error(n(200));return Wd(null,a,c,!1,f)},wr.unmountComponentAtNode=function(a){if(!Vd(a))throw Error(n(40));return a._reactRootContainer?(zs(function(){Wd(null,null,a,!1,function(){a._reactRootContainer=null,a[no]=null})}),!0):!1},wr.unstable_batchedUpdates=Cm,wr.unstable_renderSubtreeIntoContainer=function(a,c,f,g){if(!Vd(f))throw Error(n(200));if(a==null||a._reactInternals===void 0)throw Error(n(38));return Wd(a,c,f,!1,g)},wr.version="18.2.0-next-9e3b772b8-20220608",wr}var ew;function jC(){if(ew)return Gm.exports;ew=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(),Gm.exports=XI(),Gm.exports}var ep=jC();const hl=yy(ep),JI=Wj({__proto__:null,default:hl},[ep]),[ZI,ii]=pr("ScrollArea.Root component was not found in tree");function jl(e,t){const n=Ks(t);Ll(()=>{let r=0;if(e){const i=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return i.observe(e),()=>{window.cancelAnimationFrame(r),i.unobserve(e)}}},[e,n])}const eA=y.forwardRef((e,t)=>{const{style:n,...r}=e,i=ii(),[s,l]=y.useState(0),[u,d]=y.useState(0),p=!!(s&&u);return jl(i.scrollbarX,()=>{var m;const h=((m=i.scrollbarX)==null?void 0:m.offsetHeight)||0;i.onCornerHeightChange(h),d(h)}),jl(i.scrollbarY,()=>{var m;const h=((m=i.scrollbarY)==null?void 0:m.offsetWidth)||0;i.onCornerWidthChange(h),l(h)}),p?o.jsx("div",{...r,ref:t,style:{...n,width:s,height:u}}):null}),tA=y.forwardRef((e,t)=>{const n=ii(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?o.jsx(eA,{...e,ref:t}):null}),nA={scrollHideDelay:1e3,type:"hover"},CC=y.forwardRef((e,t)=>{const n=ie("ScrollAreaRoot",nA,e),{type:r,scrollHideDelay:i,scrollbars:s,...l}=n,[u,d]=y.useState(null),[p,h]=y.useState(null),[m,v]=y.useState(null),[x,b]=y.useState(null),[w,j]=y.useState(null),[P,T]=y.useState(0),[k,C]=y.useState(0),[_,R]=y.useState(!1),[M,N]=y.useState(!1),L=Nn(t,z=>d(z));return o.jsx(ZI,{value:{type:r,scrollHideDelay:i,scrollArea:u,viewport:p,onViewportChange:h,content:m,onContentChange:v,scrollbarX:x,onScrollbarXChange:b,scrollbarXEnabled:_,onScrollbarXEnabledChange:R,scrollbarY:w,onScrollbarYChange:j,scrollbarYEnabled:M,onScrollbarYEnabledChange:N,onCornerWidthChange:T,onCornerHeightChange:C},children:o.jsx(se,{...l,ref:L,__vars:{"--sa-corner-width":s!=="xy"?"0px":`${P}px`,"--sa-corner-height":s!=="xy"?"0px":`${k}px`}})})});CC.displayName="@mantine/core/ScrollAreaRoot";function EC(e,t){const n=e/t;return Number.isNaN(n)?0:n}function tp(e){const t=EC(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function kC(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 rA(e,[t,n]){return Math.min(n,Math.max(t,e))}function tw(e,t,n="ltr"){const r=tp(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,s=t.scrollbar.size-i,l=t.content-t.viewport,u=s-r,d=n==="ltr"?[0,l]:[l*-1,0],p=rA(e,d);return kC([0,l],[0,u])(p)}function iA(e,t,n,r="ltr"){const i=tp(n),s=i/2,l=t||s,u=i-l,d=n.scrollbar.paddingStart+l,p=n.scrollbar.size-n.scrollbar.paddingEnd-u,h=n.content-n.viewport,m=r==="ltr"?[0,h]:[h*-1,0];return kC([d,p],m)(e)}function TC(e,t){return e>0&&e<t}function us(e){return e?parseInt(e,10):0}function oa(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[oA,PC]=pr("ScrollAreaScrollbar was not found in tree"),RC=y.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:l,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...m}=e,v=ii(),[x,b]=y.useState(null),w=Nn(t,N=>b(N)),j=y.useRef(null),P=y.useRef(""),{viewport:T}=v,k=n.content-n.viewport,C=Ks(p),_=Ks(u),R=Kf(h,10),M=N=>{if(j.current){const L=N.clientX-j.current.left,z=N.clientY-j.current.top;d({x:L,y:z})}};return y.useEffect(()=>{const N=L=>{const z=L.target;(x==null?void 0:x.contains(z))&&C(L,k)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[T,x,k,C]),y.useEffect(_,[n,_]),jl(x,R),jl(v.content,R),o.jsx(oA,{value:{scrollbar:x,hasThumb:r,onThumbChange:Ks(i),onThumbPointerUp:Ks(s),onThumbPositionChange:_,onThumbPointerDown:Ks(l)},children:o.jsx("div",{...m,ref:w,"data-mantine-scrollbar":!0,style:{position:"absolute",...m.style},onPointerDown:oa(e.onPointerDown,N=>{N.preventDefault(),N.button===0&&(N.target.setPointerCapture(N.pointerId),j.current=x.getBoundingClientRect(),P.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",M(N))}),onPointerMove:oa(e.onPointerMove,M),onPointerUp:oa(e.onPointerUp,N=>{N.preventDefault();const L=N.target;L.hasPointerCapture(N.pointerId)&&L.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=P.current,j.current=null})})})}),_C=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,l=ii(),[u,d]=y.useState(),p=y.useRef(null),h=Nn(t,p,l.onScrollbarXChange);return y.useEffect(()=>{p.current&&d(getComputedStyle(p.current))},[p]),o.jsx(RC,{"data-orientation":"horizontal",...s,ref:h,sizes:n,style:{...i,"--sa-thumb-width":`${tp(n)}px`},onThumbPointerDown:m=>e.onThumbPointerDown(m.x),onDragScroll:m=>e.onDragScroll(m.x),onWheelScroll:(m,v)=>{if(l.viewport){const x=l.viewport.scrollLeft+m.deltaX;e.onWheelScroll(x),TC(x,v)&&m.preventDefault()}},onResize:()=>{p.current&&l.viewport&&u&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:us(u.paddingLeft),paddingEnd:us(u.paddingRight)}})}})});_C.displayName="@mantine/core/ScrollAreaScrollbarX";const DC=y.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:i,...s}=e,l=ii(),[u,d]=y.useState(),p=y.useRef(null),h=Nn(t,p,l.onScrollbarYChange);return y.useEffect(()=>{p.current&&d(window.getComputedStyle(p.current))},[]),o.jsx(RC,{...s,"data-orientation":"vertical",ref:h,sizes:n,style:{"--sa-thumb-height":`${tp(n)}px`,...i},onThumbPointerDown:m=>e.onThumbPointerDown(m.y),onDragScroll:m=>e.onDragScroll(m.y),onWheelScroll:(m,v)=>{if(l.viewport){const x=l.viewport.scrollTop+m.deltaY;e.onWheelScroll(x),TC(x,v)&&m.preventDefault()}},onResize:()=>{p.current&&l.viewport&&u&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:us(u.paddingTop),paddingEnd:us(u.paddingBottom)}})}})});DC.displayName="@mantine/core/ScrollAreaScrollbarY";const np=y.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:i}=wa(),s=ii(),l=y.useRef(null),u=y.useRef(0),[d,p]=y.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=EC(d.viewport,d.content),m={...r,sizes:d,onSizesChange:p,hasThumb:h>0&&h<1,onThumbChange:x=>{l.current=x},onThumbPointerUp:()=>{u.current=0},onThumbPointerDown:x=>{u.current=x}},v=(x,b)=>iA(x,u.current,d,b);return n==="horizontal"?o.jsx(_C,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const x=s.viewport.scrollLeft,b=tw(x,d,i);l.current.style.transform=`translate3d(${b}px, 0, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollLeft=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollLeft=v(x,i))}}):n==="vertical"?o.jsx(DC,{...m,ref:t,onThumbPositionChange:()=>{if(s.viewport&&l.current){const x=s.viewport.scrollTop,b=tw(x,d);d.scrollbar.size===0?l.current.style.setProperty("--thumb-opacity","0"):l.current.style.setProperty("--thumb-opacity","1"),l.current.style.transform=`translate3d(0, ${b}px, 0)`}},onWheelScroll:x=>{s.viewport&&(s.viewport.scrollTop=x)},onDragScroll:x=>{s.viewport&&(s.viewport.scrollTop=v(x))}}):null});np.displayName="@mantine/core/ScrollAreaScrollbarVisible";const Py=y.forwardRef((e,t)=>{const n=ii(),{forceMount:r,...i}=e,[s,l]=y.useState(!1),u=e.orientation==="horizontal",d=Kf(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;l(u?p:h)}},10);return jl(n.viewport,d),jl(n.content,d),r||s?o.jsx(np,{"data-state":s?"visible":"hidden",...i,ref:t}):null});Py.displayName="@mantine/core/ScrollAreaScrollbarAuto";const IC=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ii(),[s,l]=y.useState(!1);return y.useEffect(()=>{const{scrollArea:u}=i;let d=0;if(u){const p=()=>{window.clearTimeout(d),l(!0)},h=()=>{d=window.setTimeout(()=>l(!1),i.scrollHideDelay)};return u.addEventListener("pointerenter",p),u.addEventListener("pointerleave",h),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",p),u.removeEventListener("pointerleave",h)}}},[i.scrollArea,i.scrollHideDelay]),n||s?o.jsx(Py,{"data-state":s?"visible":"hidden",...r,ref:t}):null});IC.displayName="@mantine/core/ScrollAreaScrollbarHover";const sA=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ii(),s=e.orientation==="horizontal",[l,u]=y.useState("hidden"),d=Kf(()=>u("idle"),100);return y.useEffect(()=>{if(l==="idle"){const p=window.setTimeout(()=>u("hidden"),i.scrollHideDelay);return()=>window.clearTimeout(p)}},[l,i.scrollHideDelay]),y.useEffect(()=>{const{viewport:p}=i,h=s?"scrollLeft":"scrollTop";if(p){let m=p[h];const v=()=>{const x=p[h];m!==x&&(u("scrolling"),d()),m=x};return p.addEventListener("scroll",v),()=>p.removeEventListener("scroll",v)}},[i.viewport,s,d]),n||l!=="hidden"?o.jsx(np,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:oa(e.onPointerEnter,()=>u("interacting")),onPointerLeave:oa(e.onPointerLeave,()=>u("idle"))}):null}),Dg=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=ii(),{onScrollbarXEnabledChange:s,onScrollbarYEnabledChange:l}=i,u=e.orientation==="horizontal";return y.useEffect(()=>(u?s(!0):l(!0),()=>{u?s(!1):l(!1)}),[u,s,l]),i.type==="hover"?o.jsx(IC,{...r,ref:t,forceMount:n}):i.type==="scroll"?o.jsx(sA,{...r,ref:t,forceMount:n}):i.type==="auto"?o.jsx(Py,{...r,ref:t,forceMount:n}):i.type==="always"?o.jsx(np,{...r,ref:t}):null});Dg.displayName="@mantine/core/ScrollAreaScrollbar";function aA(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function i(){const s={left:e.scrollLeft,top:e.scrollTop},l=n.left!==s.left,u=n.top!==s.top;(l||u)&&t(),n=s,r=window.requestAnimationFrame(i)}(),()=>window.cancelAnimationFrame(r)}const AC=y.forwardRef((e,t)=>{const{style:n,...r}=e,i=ii(),s=PC(),{onThumbPositionChange:l}=s,u=Nn(t,h=>s.onThumbChange(h)),d=y.useRef(void 0),p=Kf(()=>{d.current&&(d.current(),d.current=void 0)},100);return y.useEffect(()=>{const{viewport:h}=i;if(h){const m=()=>{if(p(),!d.current){const v=aA(h,l);d.current=v,l()}};return l(),h.addEventListener("scroll",m),()=>h.removeEventListener("scroll",m)}},[i.viewport,p,l]),o.jsx("div",{"data-state":s.hasThumb?"visible":"hidden",...r,ref:u,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:oa(e.onPointerDownCapture,h=>{const v=h.target.getBoundingClientRect(),x=h.clientX-v.left,b=h.clientY-v.top;s.onThumbPointerDown({x,y:b})}),onPointerUp:oa(e.onPointerUp,s.onThumbPointerUp)})});AC.displayName="@mantine/core/ScrollAreaThumb";const Ig=y.forwardRef((e,t)=>{const{forceMount:n,...r}=e,i=PC();return n||i.hasThumb?o.jsx(AC,{ref:t,...r}):null});Ig.displayName="@mantine/core/ScrollAreaThumb";const NC=y.forwardRef(({children:e,style:t,...n},r)=>{const i=ii(),s=Nn(r,i.onViewportChange);return o.jsx(se,{...n,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...t},children:o.jsx("div",{style:{minWidth:"100%",display:"table"},ref:i.onContentChange,children:e})})});NC.displayName="@mantine/core/ScrollAreaViewport";var Ry={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const MC={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},lA=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":oe(t)}}),oi=fe((e,t)=>{const n=ie("ScrollArea",MC,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,scrollbarSize:d,vars:p,type:h,scrollHideDelay:m,viewportProps:v,viewportRef:x,onScrollPositionChange:b,children:w,offsetScrollbars:j,scrollbars:P,onBottomReached:T,onTopReached:k,...C}=n,[_,R]=y.useState(!1),M=Ne({name:"ScrollArea",props:n,classes:Ry,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:lA});return o.jsxs(CC,{type:h==="never"?"always":h,scrollHideDelay:m,ref:t,scrollbars:P,...M("root"),...C,children:[o.jsx(NC,{...v,...M("viewport",{style:v==null?void 0:v.style}),ref:x,"data-offset-scrollbars":j===!0?"xy":j||void 0,"data-scrollbars":P||void 0,onScroll:N=>{var q;(q=v==null?void 0:v.onScroll)==null||q.call(v,N),b==null||b({x:N.currentTarget.scrollLeft,y:N.currentTarget.scrollTop});const{scrollTop:L,scrollHeight:z,clientHeight:G}=N.currentTarget;L-(z-G)>=0&&(T==null||T()),L===0&&(k==null||k())},children:w}),(P==="xy"||P==="x")&&o.jsx(Dg,{...M("scrollbar"),orientation:"horizontal","data-hidden":h==="never"||void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:o.jsx(Ig,{...M("thumb")})}),(P==="xy"||P==="y")&&o.jsx(Dg,{...M("scrollbar"),orientation:"vertical","data-hidden":h==="never"||void 0,forceMount:!0,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:o.jsx(Ig,{...M("thumb")})}),o.jsx(tA,{...M("corner"),"data-hovered":_||void 0,"data-hidden":h==="never"||void 0})]})});oi.displayName="@mantine/core/ScrollArea";const rp=fe((e,t)=>{const{children:n,classNames:r,styles:i,scrollbarSize:s,scrollHideDelay:l,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:x,viewportProps:b,scrollbars:w,style:j,vars:P,onBottomReached:T,onTopReached:k,...C}=ie("ScrollAreaAutosize",MC,e);return o.jsx(se,{...C,ref:t,style:[{display:"flex",overflow:"auto"},j],children:o.jsx(se,{style:{display:"flex",flexDirection:"column",flex:1},children:o.jsx(oi,{classNames:r,styles:i,scrollHideDelay:l,scrollbarSize:s,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:x,viewportProps:b,vars:P,scrollbars:w,onBottomReached:T,onTopReached:k,children:n})})})});oi.classes=Ry;rp.displayName="@mantine/core/ScrollAreaAutosize";rp.classes=Ry;oi.Autosize=rp;var OC={root:"m_87cf2631"};const cA={__staticSelector:"UnstyledButton"},Qn=ir((e,t)=>{const n=ie("UnstyledButton",cA,e),{className:r,component:i="button",__staticSelector:s,unstyled:l,classNames:u,styles:d,style:p,...h}=n,m=Ne({name:s,props:n,classes:OC,className:r,style:p,classNames:u,styles:d,unstyled:l});return o.jsx(se,{...m("root",{focusable:!0}),component:i,ref:t,type:i==="button"?"button":void 0,...h})});Qn.classes=OC;Qn.displayName="@mantine/core/UnstyledButton";var LC={root:"m_515a97f8"};const uA={},_y=fe((e,t)=>{const n=ie("VisuallyHidden",uA,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,...p}=n,h=Ne({name:"VisuallyHidden",classes:LC,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u});return o.jsx(se,{component:"span",ref:t,...h("root"),...p})});_y.classes=LC;_y.displayName="@mantine/core/VisuallyHidden";var $C={root:"m_1b7284a3"};const dA={},fA=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Ot(t),"--paper-shadow":by(n)}}),Er=ir((e,t)=>{const n=ie("Paper",dA,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,withBorder:d,vars:p,radius:h,shadow:m,variant:v,mod:x,...b}=n,w=Ne({name:"Paper",props:n,classes:$C,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:fA});return o.jsx(se,{ref:t,mod:[{"data-with-border":d},x],...w("root"),variant:v,...b})});Er.classes=$C;Er.displayName="@mantine/core/Paper";function ip(){return typeof window<"u"}function $l(e){return FC(e)?(e.nodeName||"").toLowerCase():"#document"}function kr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Yi(e){var t;return(t=(FC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function FC(e){return ip()?e instanceof Node||e instanceof kr(e).Node:!1}function cn(e){return ip()?e instanceof Element||e instanceof kr(e).Element:!1}function Fr(e){return ip()?e instanceof HTMLElement||e instanceof kr(e).HTMLElement:!1}function Ag(e){return!ip()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kr(e).ShadowRoot}function pu(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=ti(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function pA(e){return["table","td","th"].includes($l(e))}function op(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Dy(e){const t=sp(),n=cn(e)?ti(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function hA(e){let t=xo(e);for(;Fr(t)&&!ps(t);){if(Dy(t))return t;if(op(t))return null;t=xo(t)}return null}function sp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ps(e){return["html","body","#document"].includes($l(e))}function ti(e){return kr(e).getComputedStyle(e)}function ap(e){return cn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xo(e){if($l(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ag(e)&&e.host||Yi(e);return Ag(t)?t.host:t}function zC(e){const t=xo(e);return ps(t)?e.ownerDocument?e.ownerDocument.body:e.body:Fr(t)&&pu(t)?t:zC(t)}function go(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=zC(e),s=i===((r=e.ownerDocument)==null?void 0:r.body),l=kr(i);if(s){const u=Ng(l);return t.concat(l,l.visualViewport||[],pu(i)?i:[],u&&n?go(u):[])}return t.concat(i,go(i,[],n))}function Ng(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function nw(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function Jc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ag(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function BC(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function UC(){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 mA(e){return vA()?!1:!rw()&&e.width===0&&e.height===0||rw()&&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 gA(){return/apple/i.test(navigator.vendor)}function rw(){const e=/android/i;return e.test(BC())||e.test(UC())}function yA(){return BC().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function vA(){return UC().includes("jsdom/")}function Mg(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function xA(e){return"nativeEvent"in e}function bA(e){return e.matches("html,body")}function ea(e){return(e==null?void 0:e.ownerDocument)||document}function Ym(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 fl(e){return"composedPath"in e?e.composedPath()[0]:e.target}const wA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function SA(e){return Fr(e)&&e.matches(wA)}const Ci=Math.min,nr=Math.max,Sf=Math.round,Jd=Math.floor,Wi=e=>({x:e,y:e}),jA={left:"right",right:"left",bottom:"top",top:"bottom"},CA={start:"end",end:"start"};function Og(e,t,n){return nr(e,Ci(t,n))}function bo(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function Fl(e){return e.split("-")[1]}function Iy(e){return e==="x"?"y":"x"}function Ay(e){return e==="y"?"height":"width"}function wo(e){return["top","bottom"].includes(Ei(e))?"y":"x"}function Ny(e){return Iy(wo(e))}function EA(e,t,n){n===void 0&&(n=!1);const r=Fl(e),i=Ny(e),s=Ay(i);let l=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(l=jf(l)),[l,jf(l)]}function kA(e){const t=jf(e);return[Lg(e),t,Lg(t)]}function Lg(e){return e.replace(/start|end/g,t=>CA[t])}function TA(e,t,n){const r=["left","right"],i=["right","left"],s=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:r:t?r:i;case"left":case"right":return t?s:l;default:return[]}}function PA(e,t,n,r){const i=Fl(e);let s=TA(Ei(e),n==="start",r);return i&&(s=s.map(l=>l+"-"+i),t&&(s=s.concat(s.map(Lg)))),s}function jf(e){return e.replace(/left|right|bottom|top/g,t=>jA[t])}function RA(e){return{top:0,right:0,bottom:0,left:0,...e}}function My(e){return typeof e!="number"?RA(e):{top:e,right:e,bottom:e,left:e}}function Cl(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function iw(e,t,n){let{reference:r,floating:i}=e;const s=wo(t),l=Ny(t),u=Ay(l),d=Ei(t),p=s==="y",h=r.x+r.width/2-i.width/2,m=r.y+r.height/2-i.height/2,v=r[u]/2-i[u]/2;let x;switch(d){case"top":x={x:h,y:r.y-i.height};break;case"bottom":x={x:h,y:r.y+r.height};break;case"right":x={x:r.x+r.width,y:m};break;case"left":x={x:r.x-i.width,y:m};break;default:x={x:r.x,y:r.y}}switch(Fl(t)){case"start":x[l]-=v*(n&&p?-1:1);break;case"end":x[l]+=v*(n&&p?-1:1);break}return x}const _A=async(e,t,n)=>{const{placement:r="bottom",strategy:i="absolute",middleware:s=[],platform:l}=n,u=s.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:h,y:m}=iw(p,r,d),v=r,x={},b=0;for(let w=0;w<u.length;w++){const{name:j,fn:P}=u[w],{x:T,y:k,data:C,reset:_}=await P({x:h,y:m,initialPlacement:r,placement:v,strategy:i,middlewareData:x,rects:p,platform:l,elements:{reference:e,floating:t}});h=T??h,m=k??m,x={...x,[j]:{...x[j],...C}},_&&b<=50&&(b++,typeof _=="object"&&(_.placement&&(v=_.placement),_.rects&&(p=_.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):_.rects),{x:h,y:m}=iw(p,v,d)),w=-1)}return{x:h,y:m,placement:v,strategy:i,middlewareData:x}};async function Oy(e,t){var n;t===void 0&&(t={});const{x:r,y:i,platform:s,rects:l,elements:u,strategy:d}=e,{boundary:p="clippingAncestors",rootBoundary:h="viewport",elementContext:m="floating",altBoundary:v=!1,padding:x=0}=bo(t,e),b=My(x),j=u[v?m==="floating"?"reference":"floating":m],P=Cl(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(j)))==null||n?j:j.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(u.floating)),boundary:p,rootBoundary:h,strategy:d})),T=m==="floating"?{x:r,y:i,width:l.floating.width,height:l.floating.height}:l.reference,k=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u.floating)),C=await(s.isElement==null?void 0:s.isElement(k))?await(s.getScale==null?void 0:s.getScale(k))||{x:1,y:1}:{x:1,y:1},_=Cl(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:k,strategy:d}):T);return{top:(P.top-_.top+b.top)/C.y,bottom:(_.bottom-P.bottom+b.bottom)/C.y,left:(P.left-_.left+b.left)/C.x,right:(_.right-P.right+b.right)/C.x}}const DA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:i,rects:s,platform:l,elements:u,middlewareData:d}=t,{element:p,padding:h=0}=bo(e,t)||{};if(p==null)return{};const m=My(h),v={x:n,y:r},x=Ny(i),b=Ay(x),w=await l.getDimensions(p),j=x==="y",P=j?"top":"left",T=j?"bottom":"right",k=j?"clientHeight":"clientWidth",C=s.reference[b]+s.reference[x]-v[x]-s.floating[b],_=v[x]-s.reference[x],R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let M=R?R[k]:0;(!M||!await(l.isElement==null?void 0:l.isElement(R)))&&(M=u.floating[k]||s.floating[b]);const N=C/2-_/2,L=M/2-w[b]/2-1,z=Ci(m[P],L),G=Ci(m[T],L),q=z,Y=M-w[b]-G,Q=M/2-w[b]/2+N,ne=Og(q,Q,Y),V=!d.arrow&&Fl(i)!=null&&Q!==ne&&s.reference[b]/2-(Q<q?z:G)-w[b]/2<0,O=V?Q<q?Q-q:Q-Y:0;return{[x]:v[x]+O,data:{[x]:ne,centerOffset:Q-ne-O,...V&&{alignmentOffset:O}},reset:V}}}),IA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:i,middlewareData:s,rects:l,initialPlacement:u,platform:d,elements:p}=t,{mainAxis:h=!0,crossAxis:m=!0,fallbackPlacements:v,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...j}=bo(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const P=Ei(i),T=wo(u),k=Ei(u)===u,C=await(d.isRTL==null?void 0:d.isRTL(p.floating)),_=v||(k||!w?[jf(u)]:kA(u)),R=b!=="none";!v&&R&&_.push(...PA(u,w,b,C));const M=[u,..._],N=await Oy(t,j),L=[];let z=((r=s.flip)==null?void 0:r.overflows)||[];if(h&&L.push(N[P]),m){const Q=EA(i,l,C);L.push(N[Q[0]],N[Q[1]])}if(z=[...z,{placement:i,overflows:L}],!L.every(Q=>Q<=0)){var G,q;const Q=(((G=s.flip)==null?void 0:G.index)||0)+1,ne=M[Q];if(ne)return{data:{index:Q,overflows:z},reset:{placement:ne}};let V=(q=z.filter(O=>O.overflows[0]<=0).sort((O,A)=>O.overflows[1]-A.overflows[1])[0])==null?void 0:q.placement;if(!V)switch(x){case"bestFit":{var Y;const O=(Y=z.filter(A=>{if(R){const B=wo(A.placement);return B===T||B==="y"}return!0}).map(A=>[A.placement,A.overflows.filter(B=>B>0).reduce((B,I)=>B+I,0)]).sort((A,B)=>A[1]-B[1])[0])==null?void 0:Y[0];O&&(V=O);break}case"initialPlacement":V=u;break}if(i!==V)return{reset:{placement:V}}}return{}}}};function VC(e){const t=Ci(...e.map(s=>s.left)),n=Ci(...e.map(s=>s.top)),r=nr(...e.map(s=>s.right)),i=nr(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:i-n}}function AA(e){const t=e.slice().sort((i,s)=>i.y-s.y),n=[];let r=null;for(let i=0;i<t.length;i++){const s=t[i];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(i=>Cl(VC(i)))}const NA=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:i,platform:s,strategy:l}=t,{padding:u=2,x:d,y:p}=bo(e,t),h=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),m=AA(h),v=Cl(VC(h)),x=My(u);function b(){if(m.length===2&&m[0].left>m[1].right&&d!=null&&p!=null)return m.find(j=>d>j.left-x.left&&d<j.right+x.right&&p>j.top-x.top&&p<j.bottom+x.bottom)||v;if(m.length>=2){if(wo(n)==="y"){const z=m[0],G=m[m.length-1],q=Ei(n)==="top",Y=z.top,Q=G.bottom,ne=q?z.left:G.left,V=q?z.right:G.right,O=V-ne,A=Q-Y;return{top:Y,bottom:Q,left:ne,right:V,width:O,height:A,x:ne,y:Y}}const j=Ei(n)==="left",P=nr(...m.map(z=>z.right)),T=Ci(...m.map(z=>z.left)),k=m.filter(z=>j?z.left===T:z.right===P),C=k[0].top,_=k[k.length-1].bottom,R=T,M=P,N=M-R,L=_-C;return{top:C,bottom:_,left:R,right:M,width:N,height:L,x:R,y:C}}return v}const w=await s.getElementRects({reference:{getBoundingClientRect:b},floating:r.floating,strategy:l});return i.reference.x!==w.reference.x||i.reference.y!==w.reference.y||i.reference.width!==w.reference.width||i.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};async function MA(e,t){const{placement:n,platform:r,elements:i}=e,s=await(r.isRTL==null?void 0:r.isRTL(i.floating)),l=Ei(n),u=Fl(n),d=wo(n)==="y",p=["left","top"].includes(l)?-1:1,h=s&&d?-1:1,m=bo(t,e);let{mainAxis:v,crossAxis:x,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:m.mainAxis||0,crossAxis:m.crossAxis||0,alignmentAxis:m.alignmentAxis};return u&&typeof b=="number"&&(x=u==="end"?b*-1:b),d?{x:x*h,y:v*p}:{x:v*p,y:x*h}}const OA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:i,y:s,placement:l,middlewareData:u}=t,d=await MA(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:i+d.x,y:s+d.y,data:{...d,placement:l}}}}},LA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:i}=t,{mainAxis:s=!0,crossAxis:l=!1,limiter:u={fn:j=>{let{x:P,y:T}=j;return{x:P,y:T}}},...d}=bo(e,t),p={x:n,y:r},h=await Oy(t,d),m=wo(Ei(i)),v=Iy(m);let x=p[v],b=p[m];if(s){const j=v==="y"?"top":"left",P=v==="y"?"bottom":"right",T=x+h[j],k=x-h[P];x=Og(T,x,k)}if(l){const j=m==="y"?"top":"left",P=m==="y"?"bottom":"right",T=b+h[j],k=b-h[P];b=Og(T,b,k)}const w=u.fn({...t,[v]:x,[m]:b});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[v]:s,[m]:l}}}}}},$A=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:i,rects:s,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:p=!0}=bo(e,t),h={x:n,y:r},m=wo(i),v=Iy(m);let x=h[v],b=h[m];const w=bo(u,t),j=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(d){const k=v==="y"?"height":"width",C=s.reference[v]-s.floating[k]+j.mainAxis,_=s.reference[v]+s.reference[k]-j.mainAxis;x<C?x=C:x>_&&(x=_)}if(p){var P,T;const k=v==="y"?"width":"height",C=["top","left"].includes(Ei(i)),_=s.reference[m]-s.floating[k]+(C&&((P=l.offset)==null?void 0:P[m])||0)+(C?0:j.crossAxis),R=s.reference[m]+s.reference[k]+(C?0:((T=l.offset)==null?void 0:T[m])||0)-(C?j.crossAxis:0);b<_?b=_:b>R&&(b=R)}return{[v]:x,[m]:b}}}},FA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:i,rects:s,platform:l,elements:u}=t,{apply:d=()=>{},...p}=bo(e,t),h=await Oy(t,p),m=Ei(i),v=Fl(i),x=wo(i)==="y",{width:b,height:w}=s.floating;let j,P;m==="top"||m==="bottom"?(j=m,P=v===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(P=m,j=v==="end"?"top":"bottom");const T=w-h.top-h.bottom,k=b-h.left-h.right,C=Ci(w-h[j],T),_=Ci(b-h[P],k),R=!t.middlewareData.shift;let M=C,N=_;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(N=k),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(M=T),R&&!v){const z=nr(h.left,0),G=nr(h.right,0),q=nr(h.top,0),Y=nr(h.bottom,0);x?N=b-2*(z!==0||G!==0?z+G:nr(h.left,h.right)):M=w-2*(q!==0||Y!==0?q+Y:nr(h.top,h.bottom))}await d({...t,availableWidth:N,availableHeight:M});const L=await l.getDimensions(u.floating);return b!==L.width||w!==L.height?{reset:{rects:!0}}:{}}}};function WC(e){const t=ti(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Fr(e),s=i?e.offsetWidth:n,l=i?e.offsetHeight:r,u=Sf(n)!==s||Sf(r)!==l;return u&&(n=s,r=l),{width:n,height:r,$:u}}function Ly(e){return cn(e)?e:e.contextElement}function vl(e){const t=Ly(e);if(!Fr(t))return Wi(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:s}=WC(t);let l=(s?Sf(n.width):n.width)/r,u=(s?Sf(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const zA=Wi(0);function HC(e){const t=kr(e);return!sp()||!t.visualViewport?zA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function BA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kr(e)?!1:t}function sa(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Ly(e);let l=Wi(1);t&&(r?cn(r)&&(l=vl(r)):l=vl(e));const u=BA(s,n,r)?HC(s):Wi(0);let d=(i.left+u.x)/l.x,p=(i.top+u.y)/l.y,h=i.width/l.x,m=i.height/l.y;if(s){const v=kr(s),x=r&&cn(r)?kr(r):r;let b=v,w=Ng(b);for(;w&&r&&x!==b;){const j=vl(w),P=w.getBoundingClientRect(),T=ti(w),k=P.left+(w.clientLeft+parseFloat(T.paddingLeft))*j.x,C=P.top+(w.clientTop+parseFloat(T.paddingTop))*j.y;d*=j.x,p*=j.y,h*=j.x,m*=j.y,d+=k,p+=C,b=kr(w),w=Ng(b)}}return Cl({width:h,height:m,x:d,y:p})}function $y(e,t){const n=ap(e).scrollLeft;return t?t.left+n:sa(Yi(e)).left+n}function qC(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=r.left+t.scrollLeft-(n?0:$y(e,r)),s=r.top+t.scrollTop;return{x:i,y:s}}function UA(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e;const s=i==="fixed",l=Yi(r),u=t?op(t.floating):!1;if(r===l||u&&s)return n;let d={scrollLeft:0,scrollTop:0},p=Wi(1);const h=Wi(0),m=Fr(r);if((m||!m&&!s)&&(($l(r)!=="body"||pu(l))&&(d=ap(r)),Fr(r))){const x=sa(r);p=vl(r),h.x=x.x+r.clientLeft,h.y=x.y+r.clientTop}const v=l&&!m&&!s?qC(l,d,!0):Wi(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-d.scrollLeft*p.x+h.x+v.x,y:n.y*p.y-d.scrollTop*p.y+h.y+v.y}}function VA(e){return Array.from(e.getClientRects())}function WA(e){const t=Yi(e),n=ap(e),r=e.ownerDocument.body,i=nr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=nr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+$y(e);const u=-n.scrollTop;return ti(r).direction==="rtl"&&(l+=nr(t.clientWidth,r.clientWidth)-i),{width:i,height:s,x:l,y:u}}function HA(e,t){const n=kr(e),r=Yi(e),i=n.visualViewport;let s=r.clientWidth,l=r.clientHeight,u=0,d=0;if(i){s=i.width,l=i.height;const p=sp();(!p||p&&t==="fixed")&&(u=i.offsetLeft,d=i.offsetTop)}return{width:s,height:l,x:u,y:d}}function qA(e,t){const n=sa(e,!0,t==="fixed"),r=n.top+e.clientTop,i=n.left+e.clientLeft,s=Fr(e)?vl(e):Wi(1),l=e.clientWidth*s.x,u=e.clientHeight*s.y,d=i*s.x,p=r*s.y;return{width:l,height:u,x:d,y:p}}function ow(e,t,n){let r;if(t==="viewport")r=HA(e,n);else if(t==="document")r=WA(Yi(e));else if(cn(t))r=qA(t,n);else{const i=HC(e);r={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Cl(r)}function GC(e,t){const n=xo(e);return n===t||!cn(n)||ps(n)?!1:ti(n).position==="fixed"||GC(n,t)}function GA(e,t){const n=t.get(e);if(n)return n;let r=go(e,[],!1).filter(u=>cn(u)&&$l(u)!=="body"),i=null;const s=ti(e).position==="fixed";let l=s?xo(e):e;for(;cn(l)&&!ps(l);){const u=ti(l),d=Dy(l);!d&&u.position==="fixed"&&(i=null),(s?!d&&!i:!d&&u.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||pu(l)&&!d&&GC(e,l))?r=r.filter(h=>h!==l):i=u,l=xo(l)}return t.set(e,r),r}function QA(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e;const l=[...n==="clippingAncestors"?op(t)?[]:GA(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((p,h)=>{const m=ow(t,h,i);return p.top=nr(m.top,p.top),p.right=Ci(m.right,p.right),p.bottom=Ci(m.bottom,p.bottom),p.left=nr(m.left,p.left),p},ow(t,u,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function KA(e){const{width:t,height:n}=WC(e);return{width:t,height:n}}function YA(e,t,n){const r=Fr(t),i=Yi(t),s=n==="fixed",l=sa(e,!0,s,t);let u={scrollLeft:0,scrollTop:0};const d=Wi(0);if(r||!r&&!s)if(($l(t)!=="body"||pu(i))&&(u=ap(t)),r){const v=sa(t,!0,s,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else i&&(d.x=$y(i));const p=i&&!r&&!s?qC(i,u):Wi(0),h=l.left+u.scrollLeft-d.x-p.x,m=l.top+u.scrollTop-d.y-p.y;return{x:h,y:m,width:l.width,height:l.height}}function Xm(e){return ti(e).position==="static"}function sw(e,t){if(!Fr(e)||ti(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Yi(e)===n&&(n=n.ownerDocument.body),n}function QC(e,t){const n=kr(e);if(op(e))return n;if(!Fr(e)){let i=xo(e);for(;i&&!ps(i);){if(cn(i)&&!Xm(i))return i;i=xo(i)}return n}let r=sw(e,t);for(;r&&pA(r)&&Xm(r);)r=sw(r,t);return r&&ps(r)&&Xm(r)&&!Dy(r)?n:r||hA(e)||n}const XA=async function(e){const t=this.getOffsetParent||QC,n=this.getDimensions,r=await n(e.floating);return{reference:YA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function JA(e){return ti(e).direction==="rtl"}const ZA={convertOffsetParentRelativeRectToViewportRelativeRect:UA,getDocumentElement:Yi,getClippingRect:QA,getOffsetParent:QC,getElementRects:XA,getClientRects:VA,getDimensions:KA,getScale:vl,isElement:cn,isRTL:JA};function KC(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function eN(e,t){let n=null,r;const i=Yi(e);function s(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),s();const p=e.getBoundingClientRect(),{left:h,top:m,width:v,height:x}=p;if(u||t(),!v||!x)return;const b=Jd(m),w=Jd(i.clientWidth-(h+v)),j=Jd(i.clientHeight-(m+x)),P=Jd(h),k={rootMargin:-b+"px "+-w+"px "+-j+"px "+-P+"px",threshold:nr(0,Ci(1,d))||1};let C=!0;function _(R){const M=R[0].intersectionRatio;if(M!==d){if(!C)return l();M?l(!1,M):r=setTimeout(()=>{l(!1,1e-7)},1e3)}M===1&&!KC(p,e.getBoundingClientRect())&&l(),C=!1}try{n=new IntersectionObserver(_,{...k,root:i.ownerDocument})}catch{n=new IntersectionObserver(_,k)}n.observe(e)}return l(!0),s}function tN(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,p=Ly(e),h=i||s?[...p?go(p):[],...go(t)]:[];h.forEach(P=>{i&&P.addEventListener("scroll",n,{passive:!0}),s&&P.addEventListener("resize",n)});const m=p&&u?eN(p,n):null;let v=-1,x=null;l&&(x=new ResizeObserver(P=>{let[T]=P;T&&T.target===p&&x&&(x.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var k;(k=x)==null||k.observe(t)})),n()}),p&&!d&&x.observe(p),x.observe(t));let b,w=d?sa(e):null;d&&j();function j(){const P=sa(e);w&&!KC(w,P)&&n(),w=P,b=requestAnimationFrame(j)}return n(),()=>{var P;h.forEach(T=>{i&&T.removeEventListener("scroll",n),s&&T.removeEventListener("resize",n)}),m==null||m(),(P=x)==null||P.disconnect(),x=null,d&&cancelAnimationFrame(b)}}const nN=OA,rN=LA,iN=IA,oN=FA,aw=DA,sN=NA,aN=$A,lN=(e,t,n)=>{const r=new Map,i={platform:ZA,...n},s={...i.platform,_c:r};return _A(e,t,{...i,platform:s})};var ff=typeof document<"u"?y.useLayoutEffect:y.useEffect;function Cf(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Cf(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){const s=i[r];if(!(s==="_owner"&&e.$$typeof)&&!Cf(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function YC(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function lw(e,t){const n=YC(e);return Math.round(t*n)/n}function Jm(e){const t=y.useRef(e);return ff(()=>{t.current=e}),t}function cN(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:i,elements:{reference:s,floating:l}={},transform:u=!0,whileElementsMounted:d,open:p}=e,[h,m]=y.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,x]=y.useState(r);Cf(v,r)||x(r);const[b,w]=y.useState(null),[j,P]=y.useState(null),T=y.useCallback(A=>{A!==R.current&&(R.current=A,w(A))},[]),k=y.useCallback(A=>{A!==M.current&&(M.current=A,P(A))},[]),C=s||b,_=l||j,R=y.useRef(null),M=y.useRef(null),N=y.useRef(h),L=d!=null,z=Jm(d),G=Jm(i),q=Jm(p),Y=y.useCallback(()=>{if(!R.current||!M.current)return;const A={placement:t,strategy:n,middleware:v};G.current&&(A.platform=G.current),lN(R.current,M.current,A).then(B=>{const I={...B,isPositioned:q.current!==!1};Q.current&&!Cf(N.current,I)&&(N.current=I,ep.flushSync(()=>{m(I)}))})},[v,t,n,G,q]);ff(()=>{p===!1&&N.current.isPositioned&&(N.current.isPositioned=!1,m(A=>({...A,isPositioned:!1})))},[p]);const Q=y.useRef(!1);ff(()=>(Q.current=!0,()=>{Q.current=!1}),[]),ff(()=>{if(C&&(R.current=C),_&&(M.current=_),C&&_){if(z.current)return z.current(C,_,Y);Y()}},[C,_,Y,z,L]);const ne=y.useMemo(()=>({reference:R,floating:M,setReference:T,setFloating:k}),[T,k]),V=y.useMemo(()=>({reference:C,floating:_}),[C,_]),O=y.useMemo(()=>{const A={position:n,left:0,top:0};if(!V.floating)return A;const B=lw(V.floating,h.x),I=lw(V.floating,h.y);return u?{...A,transform:"translate("+B+"px, "+I+"px)",...YC(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:I}},[n,u,V.floating,h.x,h.y]);return y.useMemo(()=>({...h,update:Y,refs:ne,elements:V,floatingStyles:O}),[h,Y,ne,V,O])}const uN=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:i}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?aw({element:r.current,padding:i}).fn(n):{}:r?aw({element:r,padding:i}).fn(n):{}}}},XC=(e,t)=>({...nN(e),options:[e,t]}),Fy=(e,t)=>({...rN(e),options:[e,t]}),cw=(e,t)=>({...aN(e),options:[e,t]}),Ef=(e,t)=>({...iN(e),options:[e,t]}),dN=(e,t)=>({...oN(e),options:[e,t]}),qc=(e,t)=>({...sN(e),options:[e,t]}),JC=(e,t)=>({...uN(e),options:[e,t]}),ZC={...qj},fN=ZC.useInsertionEffect,pN=fN||(e=>e());function mo(e){const t=y.useRef(()=>{});return pN(()=>{t.current=e}),y.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}var Hi=typeof document<"u"?y.useLayoutEffect:y.useEffect;let uw=!1,hN=0;const dw=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+hN++;function mN(){const[e,t]=y.useState(()=>uw?dw():void 0);return Hi(()=>{e==null&&t(dw())},[]),y.useEffect(()=>{uw=!0},[]),e}const gN=ZC.useId,eE=gN||mN;function yN(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(i=>i!==n))||[])}}}const vN=y.createContext(null),xN=y.createContext(null),zy=()=>{var e;return((e=y.useContext(vN))==null?void 0:e.id)||null},By=()=>y.useContext(xN);function Uy(e){return"data-floating-ui-"+e}function Zm(e){const t=y.useRef(e);return Hi(()=>{t.current=e}),t}const fw=Uy("safe-polygon");function pf(e,t,n){return n&&!Mg(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function bN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:i,events:s,elements:l}=e,{enabled:u=!0,delay:d=0,handleClose:p=null,mouseOnly:h=!1,restMs:m=0,move:v=!0}=t,x=By(),b=zy(),w=Zm(p),j=Zm(d),P=Zm(n),T=y.useRef(),k=y.useRef(-1),C=y.useRef(),_=y.useRef(-1),R=y.useRef(!0),M=y.useRef(!1),N=y.useRef(()=>{}),L=y.useRef(!1),z=y.useCallback(()=>{var O;const A=(O=i.current.openEvent)==null?void 0:O.type;return(A==null?void 0:A.includes("mouse"))&&A!=="mousedown"},[i]);y.useEffect(()=>{if(!u)return;function O(A){let{open:B}=A;B||(clearTimeout(k.current),clearTimeout(_.current),R.current=!0,L.current=!1)}return s.on("openchange",O),()=>{s.off("openchange",O)}},[u,s]),y.useEffect(()=>{if(!u||!w.current||!n)return;function O(B){z()&&r(!1,B,"hover")}const A=ea(l.floating).documentElement;return A.addEventListener("mouseleave",O),()=>{A.removeEventListener("mouseleave",O)}},[l.floating,n,r,u,w,z]);const G=y.useCallback(function(O,A,B){A===void 0&&(A=!0),B===void 0&&(B="hover");const I=pf(j.current,"close",T.current);I&&!C.current?(clearTimeout(k.current),k.current=window.setTimeout(()=>r(!1,O,B),I)):A&&(clearTimeout(k.current),r(!1,O,B))},[j,r]),q=mo(()=>{N.current(),C.current=void 0}),Y=mo(()=>{if(M.current){const O=ea(l.floating).body;O.style.pointerEvents="",O.removeAttribute(fw),M.current=!1}}),Q=mo(()=>i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1);y.useEffect(()=>{if(!u)return;function O(F){if(clearTimeout(k.current),R.current=!1,h&&!Mg(T.current)||m>0&&!pf(j.current,"open"))return;const Z=pf(j.current,"open",T.current);Z?k.current=window.setTimeout(()=>{P.current||r(!0,F,"hover")},Z):n||r(!0,F,"hover")}function A(F){if(Q())return;N.current();const Z=ea(l.floating);if(clearTimeout(_.current),L.current=!1,w.current&&i.current.floatingContext){n||clearTimeout(k.current),C.current=w.current({...i.current.floatingContext,tree:x,x:F.clientX,y:F.clientY,onClose(){Y(),q(),Q()||G(F,!0,"safe-polygon")}});const je=C.current;Z.addEventListener("mousemove",je),N.current=()=>{Z.removeEventListener("mousemove",je)};return}(T.current==="touch"?!Jc(l.floating,F.relatedTarget):!0)&&G(F)}function B(F){Q()||i.current.floatingContext&&(w.current==null||w.current({...i.current.floatingContext,tree:x,x:F.clientX,y:F.clientY,onClose(){Y(),q(),Q()||G(F)}})(F))}if(cn(l.domReference)){var I;const F=l.domReference;return n&&F.addEventListener("mouseleave",B),(I=l.floating)==null||I.addEventListener("mouseleave",B),v&&F.addEventListener("mousemove",O,{once:!0}),F.addEventListener("mouseenter",O),F.addEventListener("mouseleave",A),()=>{var Z;n&&F.removeEventListener("mouseleave",B),(Z=l.floating)==null||Z.removeEventListener("mouseleave",B),v&&F.removeEventListener("mousemove",O),F.removeEventListener("mouseenter",O),F.removeEventListener("mouseleave",A)}}},[l,u,e,h,m,v,G,q,Y,r,n,P,x,j,w,i,Q]),Hi(()=>{var O;if(u&&n&&(O=w.current)!=null&&O.__options.blockPointerEvents&&z()){M.current=!0;const B=l.floating;if(cn(l.domReference)&&B){var A;const I=ea(l.floating).body;I.setAttribute(fw,"");const F=l.domReference,Z=x==null||(A=x.nodesRef.current.find(ae=>ae.id===b))==null||(A=A.context)==null?void 0:A.elements.floating;return Z&&(Z.style.pointerEvents=""),I.style.pointerEvents="none",F.style.pointerEvents="auto",B.style.pointerEvents="auto",()=>{I.style.pointerEvents="",F.style.pointerEvents="",B.style.pointerEvents=""}}}},[u,n,b,l,x,w,z]),Hi(()=>{n||(T.current=void 0,L.current=!1,q(),Y())},[n,q,Y]),y.useEffect(()=>()=>{q(),clearTimeout(k.current),clearTimeout(_.current),Y()},[u,l.domReference,q,Y]);const ne=y.useMemo(()=>{function O(A){T.current=A.pointerType}return{onPointerDown:O,onPointerEnter:O,onMouseMove(A){const{nativeEvent:B}=A;function I(){!R.current&&!P.current&&r(!0,B,"hover")}h&&!Mg(T.current)||n||m===0||L.current&&A.movementX**2+A.movementY**2<2||(clearTimeout(_.current),T.current==="touch"?I():(L.current=!0,_.current=window.setTimeout(I,m)))}}},[h,r,n,P,m]),V=y.useMemo(()=>({onMouseEnter(){clearTimeout(k.current)},onMouseLeave(O){Q()||G(O.nativeEvent,!1)}}),[G,Q]);return y.useMemo(()=>u?{reference:ne,floating:V}:{},[u,ne,V])}const $g=()=>{},tE=y.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:$g,setState:$g,isInstantPhase:!1}),wN=()=>y.useContext(tE);function SN(e){const{children:t,delay:n,timeoutMs:r=0}=e,[i,s]=y.useReducer((d,p)=>({...d,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),l=y.useRef(null),u=y.useCallback(d=>{s({currentId:d})},[]);return Hi(()=>{i.currentId?l.current===null?l.current=i.currentId:i.isInstantPhase||s({isInstantPhase:!0}):(i.isInstantPhase&&s({isInstantPhase:!1}),l.current=null)},[i.currentId,i.isInstantPhase]),y.createElement(tE.Provider,{value:y.useMemo(()=>({...i,setState:s,setCurrentId:u}),[i,u])},t)}function jN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:i}=e,{id:s,enabled:l=!0}=t,u=s??i,d=wN(),{currentId:p,setCurrentId:h,initialDelay:m,setState:v,timeoutMs:x}=d;return Hi(()=>{l&&p&&(v({delay:{open:1,close:pf(m,"close")}}),p!==u&&r(!1))},[l,u,r,v,p,m]),Hi(()=>{function b(){r(!1),v({delay:m,currentId:null})}if(l&&p&&!n&&p===u){if(x){const w=window.setTimeout(b,x);return()=>{clearTimeout(w)}}b()}},[l,n,v,p,u,r,m,x]),Hi(()=>{l&&(h===$g||!n||h(u))},[l,n,h,u]),d}function eg(e,t){let n=e.filter(i=>{var s;return i.parentId===t&&((s=i.context)==null?void 0:s.open)}),r=n;for(;r.length;)r=e.filter(i=>{var s;return(s=r)==null?void 0:s.some(l=>{var u;return i.parentId===l.id&&((u=i.context)==null?void 0:u.open)})}),n=n.concat(r);return n}const CN="data-floating-ui-focusable",EN={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},kN={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pw=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function TN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:i,dataRef:s}=e,{enabled:l=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:p="pointerdown",referencePress:h=!1,referencePressEvent:m="pointerdown",ancestorScroll:v=!1,bubbles:x,capture:b}=t,w=By(),j=mo(typeof d=="function"?d:()=>!1),P=typeof d=="function"?j:d,T=y.useRef(!1),k=y.useRef(!1),{escapeKey:C,outsidePress:_}=pw(x),{escapeKey:R,outsidePress:M}=pw(b),N=y.useRef(!1),L=mo(ne=>{var V;if(!n||!l||!u||ne.key!=="Escape"||N.current)return;const O=(V=s.current.floatingContext)==null?void 0:V.nodeId,A=w?eg(w.nodesRef.current,O):[];if(!C&&(ne.stopPropagation(),A.length>0)){let B=!0;if(A.forEach(I=>{var F;if((F=I.context)!=null&&F.open&&!I.context.dataRef.current.__escapeKeyBubbles){B=!1;return}}),!B)return}r(!1,xA(ne)?ne.nativeEvent:ne,"escape-key")}),z=mo(ne=>{var V;const O=()=>{var A;L(ne),(A=fl(ne))==null||A.removeEventListener("keydown",O)};(V=fl(ne))==null||V.addEventListener("keydown",O)}),G=mo(ne=>{var V;const O=T.current;T.current=!1;const A=k.current;if(k.current=!1,p==="click"&&A||O||typeof P=="function"&&!P(ne))return;const B=fl(ne),I="["+Uy("inert")+"]",F=ea(i.floating).querySelectorAll(I);let Z=cn(B)?B:null;for(;Z&&!ps(Z);){const xe=xo(Z);if(ps(xe)||!cn(xe))break;Z=xe}if(F.length&&cn(B)&&!bA(B)&&!Jc(B,i.floating)&&Array.from(F).every(xe=>!Jc(Z,xe)))return;if(Fr(B)&&Q){const xe=B.clientWidth>0&&B.scrollWidth>B.clientWidth,Te=B.clientHeight>0&&B.scrollHeight>B.clientHeight;let le=Te&&ne.offsetX>B.clientWidth;if(Te&&ti(B).direction==="rtl"&&(le=ne.offsetX<=B.offsetWidth-B.clientWidth),le||xe&&ne.offsetY>B.clientHeight)return}const ae=(V=s.current.floatingContext)==null?void 0:V.nodeId,je=w&&eg(w.nodesRef.current,ae).some(xe=>{var Te;return Ym(ne,(Te=xe.context)==null?void 0:Te.elements.floating)});if(Ym(ne,i.floating)||Ym(ne,i.domReference)||je)return;const me=w?eg(w.nodesRef.current,ae):[];if(me.length>0){let xe=!0;if(me.forEach(Te=>{var le;if((le=Te.context)!=null&&le.open&&!Te.context.dataRef.current.__outsidePressBubbles){xe=!1;return}}),!xe)return}r(!1,ne,"outside-press")}),q=mo(ne=>{var V;const O=()=>{var A;G(ne),(A=fl(ne))==null||A.removeEventListener(p,O)};(V=fl(ne))==null||V.addEventListener(p,O)});y.useEffect(()=>{if(!n||!l)return;s.current.__escapeKeyBubbles=C,s.current.__outsidePressBubbles=_;let ne=-1;function V(F){r(!1,F,"ancestor-scroll")}function O(){window.clearTimeout(ne),N.current=!0}function A(){ne=window.setTimeout(()=>{N.current=!1},sp()?5:0)}const B=ea(i.floating);u&&(B.addEventListener("keydown",R?z:L,R),B.addEventListener("compositionstart",O),B.addEventListener("compositionend",A)),P&&B.addEventListener(p,M?q:G,M);let I=[];return v&&(cn(i.domReference)&&(I=go(i.domReference)),cn(i.floating)&&(I=I.concat(go(i.floating))),!cn(i.reference)&&i.reference&&i.reference.contextElement&&(I=I.concat(go(i.reference.contextElement)))),I=I.filter(F=>{var Z;return F!==((Z=B.defaultView)==null?void 0:Z.visualViewport)}),I.forEach(F=>{F.addEventListener("scroll",V,{passive:!0})}),()=>{u&&(B.removeEventListener("keydown",R?z:L,R),B.removeEventListener("compositionstart",O),B.removeEventListener("compositionend",A)),P&&B.removeEventListener(p,M?q:G,M),I.forEach(F=>{F.removeEventListener("scroll",V)}),window.clearTimeout(ne)}},[s,i,u,P,p,n,r,v,l,C,_,L,R,z,G,M,q]),y.useEffect(()=>{T.current=!1},[P,p]);const Y=y.useMemo(()=>({onKeyDown:L,[EN[m]]:ne=>{h&&r(!1,ne.nativeEvent,"reference-press")}}),[L,r,h,m]),Q=y.useMemo(()=>({onKeyDown:L,onMouseDown(){k.current=!0},onMouseUp(){k.current=!0},[kN[p]]:()=>{T.current=!0}}),[L,p]);return y.useMemo(()=>l?{reference:Y,floating:Q}:{},[l,Y,Q])}function PN(e){const{open:t=!1,onOpenChange:n,elements:r}=e,i=eE(),s=y.useRef({}),[l]=y.useState(()=>yN()),u=zy()!=null,[d,p]=y.useState(r.reference),h=mo((x,b,w)=>{s.current.openEvent=x?b:void 0,l.emit("openchange",{open:x,event:b,reason:w,nested:u}),n==null||n(x,b,w)}),m=y.useMemo(()=>({setPositionReference:p}),[]),v=y.useMemo(()=>({reference:d||r.reference||null,floating:r.floating||null,domReference:r.reference}),[d,r.reference,r.floating]);return y.useMemo(()=>({dataRef:s,open:t,onOpenChange:h,elements:v,events:l,floatingId:i,refs:m}),[t,h,v,l,i,m])}function Vy(e){e===void 0&&(e={});const{nodeId:t}=e,n=PN({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,i=r.elements,[s,l]=y.useState(null),[u,d]=y.useState(null),h=(i==null?void 0:i.domReference)||s,m=y.useRef(null),v=By();Hi(()=>{h&&(m.current=h)},[h]);const x=cN({...e,elements:{...i,...u&&{reference:u}}}),b=y.useCallback(k=>{const C=cn(k)?{getBoundingClientRect:()=>k.getBoundingClientRect(),contextElement:k}:k;d(C),x.refs.setReference(C)},[x.refs]),w=y.useCallback(k=>{(cn(k)||k===null)&&(m.current=k,l(k)),(cn(x.refs.reference.current)||x.refs.reference.current===null||k!==null&&!cn(k))&&x.refs.setReference(k)},[x.refs]),j=y.useMemo(()=>({...x.refs,setReference:w,setPositionReference:b,domReference:m}),[x.refs,w,b]),P=y.useMemo(()=>({...x.elements,domReference:h}),[x.elements,h]),T=y.useMemo(()=>({...x,...r,refs:j,elements:P,nodeId:t}),[x,j,P,t,r]);return Hi(()=>{r.dataRef.current.floatingContext=T;const k=v==null?void 0:v.nodesRef.current.find(C=>C.id===t);k&&(k.context=T)}),y.useMemo(()=>({...x,context:T,refs:j,elements:P}),[x,j,P,T])}function RN(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:i,dataRef:s,elements:l}=e,{enabled:u=!0,visibleOnly:d=!0}=t,p=y.useRef(!1),h=y.useRef(),m=y.useRef(!0);y.useEffect(()=>{if(!u)return;const x=kr(l.domReference);function b(){!n&&Fr(l.domReference)&&l.domReference===nw(ea(l.domReference))&&(p.current=!0)}function w(){m.current=!0}return x.addEventListener("blur",b),x.addEventListener("keydown",w,!0),()=>{x.removeEventListener("blur",b),x.removeEventListener("keydown",w,!0)}},[l.domReference,n,u]),y.useEffect(()=>{if(!u)return;function x(b){let{reason:w}=b;(w==="reference-press"||w==="escape-key")&&(p.current=!0)}return i.on("openchange",x),()=>{i.off("openchange",x)}},[i,u]),y.useEffect(()=>()=>{clearTimeout(h.current)},[]);const v=y.useMemo(()=>({onPointerDown(x){mA(x.nativeEvent)||(m.current=!1)},onMouseLeave(){p.current=!1},onFocus(x){if(p.current)return;const b=fl(x.nativeEvent);if(d&&cn(b))try{if(gA()&&yA())throw Error();if(!b.matches(":focus-visible"))return}catch{if(!m.current&&!SA(b))return}r(!0,x.nativeEvent,"focus")},onBlur(x){p.current=!1;const b=x.relatedTarget,w=x.nativeEvent,j=cn(b)&&b.hasAttribute(Uy("focus-guard"))&&b.getAttribute("data-type")==="outside";h.current=window.setTimeout(()=>{var P;const T=nw(l.domReference?l.domReference.ownerDocument:document);!b&&T===l.domReference||Jc((P=s.current.floatingContext)==null?void 0:P.refs.floating.current,T)||Jc(l.domReference,T)||j||r(!1,w,"focus")})}}),[s,l.domReference,r,d]);return y.useMemo(()=>u?{reference:v}:{},[u,v])}const hw="active",mw="selected";function tg(e,t,n){const r=new Map,i=n==="item";let s=e;if(i&&e){const{[hw]:l,[mw]:u,...d}=e;s=d}return{...n==="floating"&&{tabIndex:-1,[CN]:""},...s,...t.map(l=>{const u=l?l[n]:null;return typeof u=="function"?e?u(e):null:u}).concat(e).reduce((l,u)=>(u&&Object.entries(u).forEach(d=>{let[p,h]=d;if(!(i&&[hw,mw].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof h=="function"){var m;(m=r.get(p))==null||m.push(h),l[p]=function(){for(var v,x=arguments.length,b=new Array(x),w=0;w<x;w++)b[w]=arguments[w];return(v=r.get(p))==null?void 0:v.map(j=>j(...b)).find(j=>j!==void 0)}}}else l[p]=h}),l),{})}}function _N(e){e===void 0&&(e=[]);const t=e.map(u=>u==null?void 0:u.reference),n=e.map(u=>u==null?void 0:u.floating),r=e.map(u=>u==null?void 0:u.item),i=y.useCallback(u=>tg(u,e,"reference"),t),s=y.useCallback(u=>tg(u,e,"floating"),n),l=y.useCallback(u=>tg(u,e,"item"),r);return y.useMemo(()=>({getReferenceProps:i,getFloatingProps:s,getItemProps:l}),[i,s,l])}const DN=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function IN(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:i}=e,{enabled:s=!0,role:l="dialog"}=t,u=(n=DN.get(l))!=null?n:l,d=eE(),h=zy()!=null,m=y.useMemo(()=>u==="tooltip"||l==="label"?{["aria-"+(l==="label"?"labelledby":"describedby")]:r?i:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":u==="alertdialog"?"dialog":u,"aria-controls":r?i:void 0,...u==="listbox"&&{role:"combobox"},...u==="menu"&&{id:d},...u==="menu"&&h&&{role:"menuitem"},...l==="select"&&{"aria-autocomplete":"none"},...l==="combobox"&&{"aria-autocomplete":"list"}},[u,i,h,r,d,l]),v=y.useMemo(()=>{const b={id:i,...u&&{role:u}};return u==="tooltip"||l==="label"?b:{...b,...u==="menu"&&{"aria-labelledby":d}}},[u,i,d,l]),x=y.useCallback(b=>{let{active:w,selected:j}=b;const P={role:"option",...w&&{id:i+"-option"}};switch(l){case"select":return{...P,"aria-selected":w&&j};case"combobox":return{...P,...w&&{"aria-selected":!0}}}return{}},[i,l]);return y.useMemo(()=>s?{reference:m,floating:v,item:x}:{},[s,m,v,x])}function nE(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),i=n==="right"?"left":"right";return r===void 0?i:`${i}-${r}`}return t}function gw(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function yw(e,t,n,r,i){return e==="center"||r==="center"?{left:t}:e==="end"?{[i==="ltr"?"right":"left"]:n}:e==="start"?{[i==="ltr"?"left":"right"]:n}:{}}const AN={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function NN({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:s,arrowY:l,dir:u}){const[d,p="center"]=e.split("-"),h={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[AN[d]]:r},m=-t/2;return d==="left"?{...h,...gw(p,l,n,i),right:m,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:d==="right"?{...h,...gw(p,l,n,i),left:m,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:d==="top"?{...h,...yw(p,s,n,i,u),bottom:m,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:d==="bottom"?{...h,...yw(p,s,n,i,u),top:m,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const Wy=y.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:s,arrowX:l,arrowY:u,style:d,...p},h)=>{const{dir:m}=wa();return s?o.jsx("div",{...p,ref:h,style:{...d,...NN({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:m,arrowX:l,arrowY:u})}}):null});Wy.displayName="@mantine/core/FloatingArrow";var rE={root:"m_9814e45f"};const MN={zIndex:Br("modal")},ON=(e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:s,zIndex:l})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Jr(n||"#000",r??.6)||void 0,"--overlay-filter":i?`blur(${oe(i)})`:void 0,"--overlay-radius":s===void 0?void 0:Ot(s),"--overlay-z-index":l==null?void 0:l.toString()}}),El=ir((e,t)=>{const n=ie("Overlay",MN,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,fixed:p,center:h,children:m,radius:v,zIndex:x,gradient:b,blur:w,color:j,backgroundOpacity:P,mod:T,...k}=n,C=Ne({name:"Overlay",props:n,classes:rE,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:ON});return o.jsx(se,{ref:t,...C("root"),mod:[{center:h,fixed:p},T],...k,children:m})});El.classes=rE;El.displayName="@mantine/core/Overlay";function LN(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}const $N={},iE=y.forwardRef((e,t)=>{const{children:n,target:r,...i}=ie("Portal",$N,e),[s,l]=y.useState(!1),u=y.useRef(null);return Ll(()=>(l(!0),u.current=r?typeof r=="string"?document.querySelector(r):r:LN(i),Yc(t,u.current),!r&&u.current&&document.body.appendChild(u.current),()=>{!r&&u.current&&document.body.removeChild(u.current)}),[r]),!s||!u.current?null:ep.createPortal(o.jsx(o.Fragment,{children:n}),u.current)});iE.displayName="@mantine/core/Portal";function vs({withinPortal:e=!0,children:t,...n}){return e?o.jsx(iE,{...n,children:t}):o.jsx(o.Fragment,{children:t})}vs.displayName="@mantine/core/OptionalPortal";const Lc=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Zd={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:{...Lc("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Lc("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Lc("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Lc("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Lc("top"),common:{transformOrigin:"top right"}}},vw={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function FN({transition:e,state:t,duration:n,timingFunction:r}){const i={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Zd?{transitionProperty:Zd[e].transitionProperty,...i,...Zd[e].common,...Zd[e][vw[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[vw[t]]}}function zN({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:s,onEntered:l,onExited:u,enterDelay:d,exitDelay:p}){const h=dn(),m=Sy(),v=h.respectReducedMotion?m:!1,[x,b]=y.useState(v?0:e),[w,j]=y.useState(r?"entered":"exited"),P=y.useRef(-1),T=y.useRef(-1),k=y.useRef(-1),C=R=>{const M=R?i:s,N=R?l:u;window.clearTimeout(P.current);const L=v?0:R?e:t;b(L),L===0?(typeof M=="function"&&M(),typeof N=="function"&&N(),j(R?"entered":"exited")):k.current=requestAnimationFrame(()=>{hl.flushSync(()=>{j(R?"pre-entering":"pre-exiting")}),k.current=requestAnimationFrame(()=>{typeof M=="function"&&M(),j(R?"entering":"exiting"),P.current=window.setTimeout(()=>{typeof N=="function"&&N(),j(R?"entered":"exited")},L)})})},_=R=>{if(window.clearTimeout(T.current),typeof(R?d:p)!="number"){C(R);return}T.current=window.setTimeout(()=>{C(R)},R?d:p)};return vo(()=>{_(r)},[r]),y.useEffect(()=>()=>{window.clearTimeout(P.current),cancelAnimationFrame(k.current)},[]),{transitionDuration:x,transitionStatus:w,transitionTimingFunction:n||"ease"}}function Xi({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:i,children:s,timingFunction:l="ease",onExit:u,onEntered:d,onEnter:p,onExited:h,enterDelay:m,exitDelay:v}){const{transitionDuration:x,transitionStatus:b,transitionTimingFunction:w}=zN({mounted:i,exitDuration:r,duration:n,timingFunction:l,onExit:u,onEntered:d,onEnter:p,onExited:h,enterDelay:m,exitDelay:v});return x===0?i?o.jsx(o.Fragment,{children:s({})}):e?s({display:"none"}):null:b==="exited"?e?s({display:"none"}):null:o.jsx(o.Fragment,{children:s(FN({transition:t,duration:x,state:b,timingFunction:w}))})}Xi.displayName="@mantine/core/Transition";const[BN,oE]=pr("Popover component was not found in the tree");function lp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const i=PD(t),s=Nn(i,r);return Eo(e)?y.cloneElement(e,{[n]:s}):e}function sE(e){return o.jsx(_y,{tabIndex:-1,"data-autofocus":!0,...e})}lp.displayName="@mantine/core/FocusTrap";sE.displayName="@mantine/core/FocusTrapInitialFocus";lp.InitialFocus=sE;var aE={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const UN={},Hy=fe((e,t)=>{var j,P,T,k;const n=ie("PopoverDropdown",UN,e),{className:r,style:i,vars:s,children:l,onKeyDownCapture:u,variant:d,classNames:p,styles:h,...m}=n,v=oE(),x=sC({opened:v.opened,shouldReturnFocus:v.returnFocus}),b=v.withRoles?{"aria-labelledby":v.getTargetId(),id:v.getDropdownId(),role:"dialog",tabIndex:-1}:{},w=Nn(t,v.floating);return v.disabled?null:o.jsx(vs,{...v.portalProps,withinPortal:v.withinPortal,children:o.jsx(Xi,{mounted:v.opened,...v.transitionProps,transition:((j=v.transitionProps)==null?void 0:j.transition)||"fade",duration:((P=v.transitionProps)==null?void 0:P.duration)??150,keepMounted:v.keepMounted,exitDuration:typeof((T=v.transitionProps)==null?void 0:T.exitDuration)=="number"?v.transitionProps.exitDuration:(k=v.transitionProps)==null?void 0:k.duration,children:C=>o.jsx(lp,{active:v.trapFocus&&v.opened,innerRef:w,children:o.jsxs(se,{...b,...m,variant:d,onKeyDownCapture:mD(v.onClose,{active:v.closeOnEscape,onTrigger:x,onKeyDown:u}),"data-position":v.placement,"data-fixed":v.floatingStrategy==="fixed"||void 0,...v.getStyles("dropdown",{className:r,props:n,classNames:p,styles:h,style:[{...C,zIndex:v.zIndex,top:v.y??0,left:v.x??0,width:v.width==="target"?void 0:oe(v.width)},v.resolvedStyles.dropdown,h==null?void 0:h.dropdown,i]}),children:[l,o.jsx(Wy,{ref:v.arrowRef,arrowX:v.arrowX,arrowY:v.arrowY,visible:v.withArrow,position:v.placement,arrowSize:v.arrowSize,arrowRadius:v.arrowRadius,arrowOffset:v.arrowOffset,arrowPosition:v.arrowPosition,...v.getStyles("arrow",{props:n,classNames:p,styles:h})})]})})})})});Hy.classes=aE;Hy.displayName="@mantine/core/PopoverDropdown";const VN={refProp:"ref",popupType:"dialog"},lE=fe((e,t)=>{const{children:n,refProp:r,popupType:i,...s}=ie("PopoverTarget",VN,e);if(!Eo(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const l=s,u=oE(),d=Nn(u.reference,Xf(n),t),p=u.withRoles?{"aria-haspopup":i,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:u.getTargetId()}:{};return y.cloneElement(n,{...l,...p,...u.targetProps,className:Nt(u.targetProps.className,l.className,n.props.className),[r]:d,...u.controlled?null:{onClick:u.onToggle}})});lE.displayName="@mantine/core/PopoverTarget";function cE({opened:e,floating:t,position:n,positionDependencies:r}){const[i,s]=y.useState(0);y.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current&&e)return tN(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,i,n]),vo(()=>{t.update()},r),vo(()=>{s(l=>l+1)},[e])}function WN(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 HN(e,t){const n=WN(e.middlewares),r=[XC(e.offset)];return n.shift&&r.push(Fy(typeof n.shift=="boolean"?{limiter:cw(),padding:5}:{limiter:cw(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Ef():Ef(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?qc():qc(n.inline)),r.push(JC({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(dN({...typeof n.size=="boolean"?{}:n.size,apply({rects:i,availableWidth:s,availableHeight:l,...u}){var h;const p=((h=t().refs.floating.current)==null?void 0:h.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:i,availableWidth:s,availableHeight:l,...u}):Object.assign(p,{maxWidth:`${s}px`,maxHeight:`${l}px`})),e.width==="target"&&Object.assign(p,{width:`${i.reference.width}px`})}})),r}function qN(e){const[t,n]=Vn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=y.useRef(t),i=()=>{t&&n(!1)},s=()=>n(!t),l=Vy({strategy:e.strategy,placement:e.position,middleware:HN(e,()=>l)});return cE({opened:t,position:e.position,positionDependencies:e.positionDependencies||[],floating:l}),vo(()=>{var u;(u=e.onPositionChange)==null||u.call(e,l.placement)},[l.placement]),vo(()=>{var u,d;t!==r.current&&(t?(d=e.onOpen)==null||d.call(e):(u=e.onClose)==null||u.call(e)),r.current=t},[t,e.onClose,e.onOpen]),{floating:l,controlled:typeof e.opened=="boolean",opened:t,onClose:i,onToggle:s}}const GN={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Br("popover"),__staticSelector:"Popover",width:"max-content"},QN=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ot(t),"--popover-shadow":by(n)}});function Pi(e){var ue,Ue,bt,jt,Dt,mn;const t=ie("Popover",GN,e),{children:n,position:r,offset:i,onPositionChange:s,positionDependencies:l,opened:u,transitionProps:d,onExitTransitionEnd:p,onEnterTransitionEnd:h,width:m,middlewares:v,withArrow:x,arrowSize:b,arrowOffset:w,arrowRadius:j,arrowPosition:P,unstyled:T,classNames:k,styles:C,closeOnClickOutside:_,withinPortal:R,portalProps:M,closeOnEscape:N,clickOutsideEvents:L,trapFocus:z,onClose:G,onOpen:q,onChange:Y,zIndex:Q,radius:ne,shadow:V,id:O,defaultOpened:A,__staticSelector:B,withRoles:I,disabled:F,returnFocus:Z,variant:ae,keepMounted:je,vars:me,floatingStrategy:xe,withOverlay:Te,overlayProps:le,...et}=t,ht=Ne({name:B,props:t,classes:aE,classNames:k,styles:C,unstyled:T,rootSelector:"dropdown",vars:me,varsResolver:QN}),{resolvedStyles:ct}=va({classNames:k,styles:C,props:t}),St=y.useRef(null),[Et,Tt]=y.useState(null),[vt,_t]=y.useState(null),{dir:we}=wa(),Re=hr(O),ke=qN({middlewares:v,width:m,position:nE(we,r),offset:typeof i=="number"?i+(x?b/2:0):i,arrowRef:St,arrowOffset:w,onPositionChange:s,positionDependencies:l,opened:u,defaultOpened:A,onChange:Y,onOpen:q,onClose:G,strategy:xe});xD(()=>_&&ke.onClose(),L,[Et,vt]);const _e=y.useCallback(ft=>{Tt(ft),ke.floating.refs.setReference(ft)},[ke.floating.refs.setReference]),ce=y.useCallback(ft=>{_t(ft),ke.floating.refs.setFloating(ft)},[ke.floating.refs.setFloating]),ve=y.useCallback(()=>{var ft;(ft=d==null?void 0:d.onExited)==null||ft.call(d),p==null||p()},[d==null?void 0:d.onExited,p]),Me=y.useCallback(()=>{var ft;(ft=d==null?void 0:d.onEntered)==null||ft.call(d),h==null||h()},[d==null?void 0:d.onEntered,h]);return o.jsxs(BN,{value:{returnFocus:Z,disabled:F,controlled:ke.controlled,reference:_e,floating:ce,x:ke.floating.x,y:ke.floating.y,arrowX:(bt=(Ue=(ue=ke.floating)==null?void 0:ue.middlewareData)==null?void 0:Ue.arrow)==null?void 0:bt.x,arrowY:(mn=(Dt=(jt=ke.floating)==null?void 0:jt.middlewareData)==null?void 0:Dt.arrow)==null?void 0:mn.y,opened:ke.opened,arrowRef:St,transitionProps:{...d,onExited:ve,onEntered:Me},width:m,withArrow:x,arrowSize:b,arrowOffset:w,arrowRadius:j,arrowPosition:P,placement:ke.floating.placement,trapFocus:z,withinPortal:R,portalProps:M,zIndex:Q,radius:ne,shadow:V,closeOnEscape:N,onClose:ke.onClose,onToggle:ke.onToggle,getTargetId:()=>`${Re}-target`,getDropdownId:()=>`${Re}-dropdown`,withRoles:I,targetProps:et,__staticSelector:B,classNames:k,styles:C,unstyled:T,variant:ae,keepMounted:je,getStyles:ht,resolvedStyles:ct,floatingStrategy:xe},children:[n,Te&&o.jsx(Xi,{transition:"fade",mounted:ke.opened,duration:(d==null?void 0:d.duration)||250,exitDuration:(d==null?void 0:d.exitDuration)||250,children:ft=>o.jsx(vs,{withinPortal:R,children:o.jsx(El,{...le,...ht("overlay",{className:le==null?void 0:le.className,style:[ft,le==null?void 0:le.style]})})})})]})}Pi.Target=lE;Pi.Dropdown=Hy;Pi.displayName="@mantine/core/Popover";Pi.extend=e=>e;var Si={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 uE=y.forwardRef(({className:e,...t},n)=>o.jsxs(se,{component:"span",className:Nt(Si.barsLoader,e),...t,ref:n,children:[o.jsx("span",{className:Si.bar}),o.jsx("span",{className:Si.bar}),o.jsx("span",{className:Si.bar})]}));uE.displayName="@mantine/core/Bars";const dE=y.forwardRef(({className:e,...t},n)=>o.jsxs(se,{component:"span",className:Nt(Si.dotsLoader,e),...t,ref:n,children:[o.jsx("span",{className:Si.dot}),o.jsx("span",{className:Si.dot}),o.jsx("span",{className:Si.dot})]}));dE.displayName="@mantine/core/Dots";const fE=y.forwardRef(({className:e,...t},n)=>o.jsx(se,{component:"span",className:Nt(Si.ovalLoader,e),...t,ref:n}));fE.displayName="@mantine/core/Oval";const pE={bars:uE,oval:fE,dots:dE},KN={loaders:pE,type:"oval"},YN=(e,{size:t,color:n})=>({root:{"--loader-size":rt(t,"loader-size"),"--loader-color":n?$t(n,e):void 0}}),Pr=fe((e,t)=>{const n=ie("Loader",KN,e),{size:r,color:i,type:s,vars:l,className:u,style:d,classNames:p,styles:h,unstyled:m,loaders:v,variant:x,children:b,...w}=n,j=Ne({name:"Loader",props:n,classes:Si,className:u,style:d,classNames:p,styles:h,unstyled:m,vars:l,varsResolver:YN});return b?o.jsx(se,{...j("root"),ref:t,...w,children:b}):o.jsx(se,{...j("root"),ref:t,component:v[s],variant:x,size:r,...w})});Pr.defaultLoaders=pE;Pr.classes=Si;Pr.displayName="@mantine/core/Loader";var zl={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const xw={orientation:"horizontal"},XN=(e,{borderWidth:t})=>({group:{"--ai-border-width":oe(t)}}),qy=fe((e,t)=>{const n=ie("ActionIconGroup",xw,e),{className:r,style:i,classNames:s,styles:l,unstyled:u,orientation:d,vars:p,borderWidth:h,variant:m,mod:v,...x}=ie("ActionIconGroup",xw,e),b=Ne({name:"ActionIconGroup",props:n,classes:zl,className:r,style:i,classNames:s,styles:l,unstyled:u,vars:p,varsResolver:XN,rootSelector:"group"});return o.jsx(se,{...b("group"),ref:t,variant:m,mod:[{"data-orientation":d},v],role:"group",...x})});qy.classes=zl;qy.displayName="@mantine/core/ActionIconGroup";const bw={},JN=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":rt(l,"section-height"),"--section-padding-x":rt(l,"section-padding-x"),"--section-fz":In(l),"--section-radius":t===void 0?void 0:Ot(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},Gy=fe((e,t)=>{const n=ie("ActionIconGroupSection",bw,e),{className:r,style:i,classNames:s,styles:l,unstyled:u,vars:d,variant:p,gradient:h,radius:m,autoContrast:v,...x}=ie("ActionIconGroupSection",bw,e),b=Ne({name:"ActionIconGroupSection",props:n,classes:zl,className:r,style:i,classNames:s,styles:l,unstyled:u,vars:d,varsResolver:JN,rootSelector:"groupSection"});return o.jsx(se,{...b("groupSection"),ref:t,variant:p,...x})});Gy.classes=zl;Gy.displayName="@mantine/core/ActionIconGroupSection";const ZN={},e4=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:l})=>{const u=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:l});return{root:{"--ai-size":rt(t,"ai-size"),"--ai-radius":n===void 0?void 0:Ot(n),"--ai-bg":s||r?u.background:void 0,"--ai-hover":s||r?u.hover:void 0,"--ai-hover-color":s||r?u.hoverColor:void 0,"--ai-color":u.color,"--ai-bd":s||r?u.border:void 0}}},En=ir((e,t)=>{const n=ie("ActionIcon",ZN,e),{className:r,unstyled:i,variant:s,classNames:l,styles:u,style:d,loading:p,loaderProps:h,size:m,color:v,radius:x,__staticSelector:b,gradient:w,vars:j,children:P,disabled:T,"data-disabled":k,autoContrast:C,mod:_,...R}=n,M=Ne({name:["ActionIcon",b],props:n,className:r,style:d,classes:zl,classNames:l,styles:u,unstyled:i,vars:j,varsResolver:e4});return o.jsxs(Qn,{...M("root",{active:!T&&!p&&!k}),...R,unstyled:i,variant:s,size:m,disabled:T||p,ref:t,mod:[{loading:p,disabled:T||k},_],children:[o.jsx(Xi,{mounted:!!p,transition:"slide-down",duration:150,children:N=>o.jsx(se,{component:"span",...M("loader",{style:N}),"aria-hidden":!0,children:o.jsx(Pr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...h})})}),o.jsx(se,{component:"span",mod:{loading:p},...M("icon"),children:P})]})});En.classes=zl;En.displayName="@mantine/core/ActionIcon";En.Group=qy;En.GroupSection=Gy;const hE=y.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>o.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:o.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"})}));hE.displayName="@mantine/core/CloseIcon";var mE={root:"m_86a44da5","root--subtle":"m_220c80f2"};const t4={variant:"subtle"},n4=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":rt(t,"cb-size"),"--cb-radius":n===void 0?void 0:Ot(n),"--cb-icon-size":oe(r)}}),Sa=ir((e,t)=>{const n=ie("CloseButton",t4,e),{iconSize:r,children:i,vars:s,radius:l,className:u,classNames:d,style:p,styles:h,unstyled:m,"data-disabled":v,disabled:x,variant:b,icon:w,mod:j,__staticSelector:P,...T}=n,k=Ne({name:P||"CloseButton",props:n,className:u,style:p,classes:mE,classNames:d,styles:h,unstyled:m,vars:s,varsResolver:n4});return o.jsxs(Qn,{ref:t,...T,unstyled:m,variant:b,disabled:x,mod:[{disabled:x||v},j],...k("root",{variant:b,active:!x&&!v}),children:[w||o.jsx(hE,{}),i]})});Sa.classes=mE;Sa.displayName="@mantine/core/CloseButton";function r4(e){return y.Children.toArray(e).filter(Boolean)}var gE={root:"m_4081bf90"};const i4={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},o4=(e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:s,wrap:l},{childWidth:u})=>({root:{"--group-child-width":t&&n?u:void 0,"--group-gap":Dn(r),"--group-align":i,"--group-justify":s,"--group-wrap":l}}),be=fe((e,t)=>{const n=ie("Group",i4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,children:d,gap:p,align:h,justify:m,wrap:v,grow:x,preventGrowOverflow:b,vars:w,variant:j,__size:P,mod:T,...k}=n,C=r4(d),_=C.length,R=Dn(p??"md"),N={childWidth:`calc(${100/_}% - (${R} - ${R} / ${_}))`},L=Ne({name:"Group",props:n,stylesCtx:N,className:i,style:s,classes:gE,classNames:r,styles:l,unstyled:u,vars:w,varsResolver:o4});return o.jsx(se,{...L("root"),ref:t,variant:j,mod:[{grow:x},T],size:P,...k,children:C})});be.classes=gE;be.displayName="@mantine/core/Group";const[s4,Ro]=pr("ModalBase component was not found in tree");function a4({opened:e,transitionDuration:t}){const[n,r]=y.useState(e),i=y.useRef(-1),l=Sy()?0:t;return y.useEffect(()=>(e?(r(!0),window.clearTimeout(i.current)):l===0?r(!1):i.current=window.setTimeout(()=>r(!1),l),()=>window.clearTimeout(i.current)),[e,l]),n}function l4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:s,returnFocus:l}){const u=hr(e),[d,p]=y.useState(!1),[h,m]=y.useState(!1),v=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,x=a4({opened:n,transitionDuration:v});return uC("keydown",b=>{var w;b.key==="Escape"&&i&&n&&((w=b.target)==null?void 0:w.getAttribute("data-mantine-stop-propagation"))!=="true"&&s()},{capture:!0}),sC({opened:n,shouldReturnFocus:r&&l}),{_id:u,titleMounted:d,bodyMounted:h,shouldLockScroll:x,setTitleMounted:p,setBodyMounted:m}}const yE=y.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:i,onExitTransitionEnd:s,onEnterTransitionEnd:l,trapFocus:u,closeOnEscape:d,returnFocus:p,closeOnClickOutside:h,withinPortal:m,portalProps:v,lockScroll:x,children:b,zIndex:w,shadow:j,padding:P,__vars:T,unstyled:k,removeScrollProps:C,..._},R)=>{const{_id:M,titleMounted:N,bodyMounted:L,shouldLockScroll:z,setTitleMounted:G,setBodyMounted:q}=l4({id:r,transitionProps:i,opened:t,trapFocus:u,closeOnEscape:d,onClose:n,returnFocus:p}),{key:Y,...Q}=C||{};return o.jsx(vs,{...v,withinPortal:m,children:o.jsx(s4,{value:{opened:t,onClose:n,closeOnClickOutside:h,onExitTransitionEnd:s,onEnterTransitionEnd:l,transitionProps:{...i,keepMounted:e},getTitleId:()=>`${M}-title`,getBodyId:()=>`${M}-body`,titleMounted:N,bodyMounted:L,setTitleMounted:G,setBodyMounted:q,trapFocus:u,closeOnEscape:d,zIndex:w,unstyled:k},children:o.jsx(Sl,{enabled:z&&x,...Q,children:o.jsx(se,{ref:R,..._,__vars:{...T,"--mb-z-index":(w||Br("modal")).toString(),"--mb-shadow":by(j),"--mb-padding":Dn(P)},children:b})},Y)})})});yE.displayName="@mantine/core/ModalBase";function c4(){const e=Ro();return y.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var kl={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const vE=y.forwardRef(({className:e,...t},n)=>{const r=c4(),i=Ro();return o.jsx(se,{ref:n,...t,id:r,className:Nt({[kl.body]:!i.unstyled},e)})});vE.displayName="@mantine/core/ModalBaseBody";const xE=y.forwardRef(({className:e,onClick:t,...n},r)=>{const i=Ro();return o.jsx(Sa,{ref:r,...n,onClick:s=>{i.onClose(),t==null||t(s)},className:Nt({[kl.close]:!i.unstyled},e),unstyled:i.unstyled})});xE.displayName="@mantine/core/ModalBaseCloseButton";const bE=y.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,...s},l)=>{const u=Ro();return o.jsx(Xi,{mounted:u.opened,transition:"pop",...u.transitionProps,onExited:()=>{var d,p,h;(d=u.onExitTransitionEnd)==null||d.call(u),(h=(p=u.transitionProps)==null?void 0:p.onExited)==null||h.call(p)},onEntered:()=>{var d,p,h;(d=u.onEnterTransitionEnd)==null||d.call(u),(h=(p=u.transitionProps)==null?void 0:p.onEntered)==null||h.call(p)},...e,children:d=>o.jsx("div",{...n,className:Nt({[kl.inner]:!u.unstyled},n.className),children:o.jsx(lp,{active:u.opened&&u.trapFocus,innerRef:l,children:o.jsx(Er,{...s,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":u.bodyMounted?u.getBodyId():void 0,"aria-labelledby":u.titleMounted?u.getTitleId():void 0,style:[i,d],className:Nt({[kl.content]:!u.unstyled},t),unstyled:u.unstyled,children:s.children})})})})});bE.displayName="@mantine/core/ModalBaseContent";const wE=y.forwardRef(({className:e,...t},n)=>{const r=Ro();return o.jsx(se,{component:"header",ref:n,className:Nt({[kl.header]:!r.unstyled},e),...t})});wE.displayName="@mantine/core/ModalBaseHeader";const u4={duration:200,timingFunction:"ease",transition:"fade"};function d4(e){const t=Ro();return{...u4,...t.transitionProps,...e}}const SE=y.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...i},s)=>{const l=Ro(),u=d4(t);return o.jsx(Xi,{mounted:r!==void 0?r:l.opened,...u,transition:"fade",children:d=>o.jsx(El,{ref:s,fixed:!0,style:[n,d],zIndex:l.zIndex,unstyled:l.unstyled,onClick:p=>{e==null||e(p),l.closeOnClickOutside&&l.onClose()},...i})})});SE.displayName="@mantine/core/ModalBaseOverlay";function f4(){const e=Ro();return y.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const jE=y.forwardRef(({className:e,...t},n)=>{const r=f4(),i=Ro();return o.jsx(se,{component:"h2",ref:n,className:Nt({[kl.title]:!i.unstyled},e),...t,id:r})});jE.displayName="@mantine/core/ModalBaseTitle";function p4({children:e}){return o.jsx(o.Fragment,{children:e})}const[h4,m4]=ko({size:"sm"}),g4={},CE=fe((e,t)=>{const n=ie("InputClearButton",g4,e),{size:r,variant:i,vars:s,classNames:l,styles:u,...d}=n,p=m4(),{resolvedClassNames:h,resolvedStyles:m}=va({classNames:l,styles:u,props:n});return o.jsx(Sa,{variant:i||"transparent",ref:t,size:r||(p==null?void 0:p.size)||"sm",classNames:h,styles:m,__staticSelector:"InputClearButton",...d})});CE.displayName="@mantine/core/InputClearButton";const[y4,Bl]=ko({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var si={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 ww={},v4=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${In(t)} - ${oe(2)})`}}),cp=fe((e,t)=>{const n=ie("InputDescription",ww,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,size:p,__staticSelector:h,__inheritStyles:m=!0,variant:v,...x}=ie("InputDescription",ww,n),b=Bl(),w=Ne({name:["InputWrapper",h],props:n,classes:si,className:i,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"description",vars:d,varsResolver:v4}),j=m&&(b==null?void 0:b.getStyles)||w;return o.jsx(se,{component:"p",ref:t,variant:v,size:p,...j("description",b!=null&&b.getStyles?{className:i,style:s}:void 0),...x})});cp.classes=si;cp.displayName="@mantine/core/InputDescription";const x4={},b4=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${In(t)} - ${oe(2)})`}}),up=fe((e,t)=>{const n=ie("InputError",x4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,size:p,__staticSelector:h,__inheritStyles:m=!0,variant:v,...x}=n,b=Ne({name:["InputWrapper",h],props:n,classes:si,className:i,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"error",vars:d,varsResolver:b4}),w=Bl(),j=m&&(w==null?void 0:w.getStyles)||b;return o.jsx(se,{component:"p",ref:t,variant:v,size:p,...j("error",w!=null&&w.getStyles?{className:i,style:s}:void 0),...x})});up.classes=si;up.displayName="@mantine/core/InputError";const Sw={labelElement:"label"},w4=(e,{size:t})=>({label:{"--input-label-size":In(t),"--input-asterisk-color":void 0}}),hu=fe((e,t)=>{const n=ie("InputLabel",Sw,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,labelElement:p,size:h,required:m,htmlFor:v,onMouseDown:x,children:b,__staticSelector:w,variant:j,mod:P,...T}=ie("InputLabel",Sw,n),k=Ne({name:["InputWrapper",w],props:n,classes:si,className:i,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"label",vars:d,varsResolver:w4}),C=Bl(),_=(C==null?void 0:C.getStyles)||k;return o.jsxs(se,{..._("label",C!=null&&C.getStyles?{className:i,style:s}:void 0),component:p,variant:j,size:h,ref:t,htmlFor:p==="label"?v:void 0,mod:[{required:m},P],onMouseDown:R=>{x==null||x(R),!R.defaultPrevented&&R.detail>1&&R.preventDefault()},...T,children:[b,m&&o.jsx("span",{..._("required"),"aria-hidden":!0,children:" *"})]})});hu.classes=si;hu.displayName="@mantine/core/InputLabel";const jw={},Qy=fe((e,t)=>{const n=ie("InputPlaceholder",jw,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,__staticSelector:p,variant:h,error:m,mod:v,...x}=ie("InputPlaceholder",jw,n),b=Ne({name:["InputPlaceholder",p],props:n,classes:si,className:i,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"placeholder"});return o.jsx(se,{...b("placeholder"),mod:[{error:!!m},v],component:"span",variant:h,ref:t,...x})});Qy.classes=si;Qy.displayName="@mantine/core/InputPlaceholder";function S4(e,{hasDescription:t,hasError:n}){const r=e.findIndex(d=>d==="input"),i=e.slice(0,r),s=e.slice(r+1),l=t&&i.includes("description")||n&&i.includes("error");return{offsetBottom:t&&s.includes("description")||n&&s.includes("error"),offsetTop:l}}const j4={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},C4=(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)} - ${oe(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${In(t)} - ${oe(2)})`}}),Ky=fe((e,t)=>{const n=ie("InputWrapper",j4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,size:p,variant:h,__staticSelector:m,inputContainer:v,inputWrapperOrder:x,label:b,error:w,description:j,labelProps:P,descriptionProps:T,errorProps:k,labelElement:C,children:_,withAsterisk:R,id:M,required:N,__stylesApiProps:L,mod:z,...G}=n,q=Ne({name:["InputWrapper",m],props:L||n,classes:si,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:C4}),Y={size:p,variant:h,__staticSelector:m},Q=hr(M),ne=typeof R=="boolean"?R:N,V=(k==null?void 0:k.id)||`${Q}-error`,O=(T==null?void 0:T.id)||`${Q}-description`,A=Q,B=!!w&&typeof w!="boolean",I=!!j,F=`${B?V:""} ${I?O:""}`,Z=F.trim().length>0?F.trim():void 0,ae=(P==null?void 0:P.id)||`${Q}-label`,je=b&&o.jsx(hu,{labelElement:C,id:ae,htmlFor:A,required:ne,...Y,...P,children:b},"label"),me=I&&o.jsx(cp,{...T,...Y,size:(T==null?void 0:T.size)||Y.size,id:(T==null?void 0:T.id)||O,children:j},"description"),xe=o.jsx(y.Fragment,{children:v(_)},"input"),Te=B&&y.createElement(up,{...k,...Y,size:(k==null?void 0:k.size)||Y.size,key:"error",id:(k==null?void 0:k.id)||V},w),le=x.map(et=>{switch(et){case"label":return je;case"input":return xe;case"description":return me;case"error":return Te;default:return null}});return o.jsx(y4,{value:{getStyles:q,describedBy:Z,inputId:A,labelId:ae,...S4(x,{hasDescription:I,hasError:B})},children:o.jsx(se,{ref:t,variant:h,size:p,mod:[{error:!!w},z],...q("root"),...G,children:le})})});Ky.classes=si;Ky.displayName="@mantine/core/InputWrapper";const E4={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},k4=(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":rt(t.size,"input-height"),"--input-fz":In(t.size),"--input-radius":t.radius===void 0?void 0:Ot(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?oe(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?oe(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?rt(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),tn=ir((e,t)=>{const n=ie("Input",E4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,required:d,__staticSelector:p,__stylesApiProps:h,size:m,wrapperProps:v,error:x,disabled:b,leftSection:w,leftSectionProps:j,leftSectionWidth:P,rightSection:T,rightSectionProps:k,rightSectionWidth:C,rightSectionPointerEvents:_,leftSectionPointerEvents:R,variant:M,vars:N,pointer:L,multiline:z,radius:G,id:q,withAria:Y,withErrorStyles:Q,mod:ne,inputSize:V,__clearSection:O,__clearable:A,__defaultRightSection:B,...I}=n,{styleProps:F,rest:Z}=Po(I),ae=Bl(),je={offsetBottom:ae==null?void 0:ae.offsetBottom,offsetTop:ae==null?void 0:ae.offsetTop},me=Ne({name:["Input",p],props:h||n,classes:si,className:i,style:s,classNames:r,styles:l,unstyled:u,stylesCtx:je,rootSelector:"wrapper",vars:N,varsResolver:k4}),xe=Y?{required:d,disabled:b,"aria-invalid":!!x,"aria-describedby":ae==null?void 0:ae.describedBy,id:(ae==null?void 0:ae.inputId)||q}:{},Te=T||A&&O||B;return o.jsx(h4,{value:{size:m||"sm"},children:o.jsxs(se,{...me("wrapper"),...F,...v,mod:[{error:!!x&&Q,pointer:L,disabled:b,multiline:z,"data-with-right-section":!!T,"data-with-left-section":!!w},ne],variant:M,size:m,children:[w&&o.jsx("div",{...j,"data-position":"left",...me("section",{className:j==null?void 0:j.className,style:j==null?void 0:j.style}),children:w}),o.jsx(se,{component:"input",...Z,...xe,ref:t,required:d,mod:{disabled:b,error:!!x&&Q},variant:M,__size:V,...me("input")}),Te&&o.jsx("div",{...k,"data-position":"right",...me("section",{className:k==null?void 0:k.className,style:k==null?void 0:k.style}),children:Te})]})})});tn.classes=si;tn.Wrapper=Ky;tn.Label=hu;tn.Error=up;tn.Description=cp;tn.Placeholder=Qy;tn.ClearButton=CE;tn.displayName="@mantine/core/Input";function T4(e,t,n){const r=ie(e,t,n),{label:i,description:s,error:l,required:u,classNames:d,styles:p,className:h,unstyled:m,__staticSelector:v,__stylesApiProps:x,errorProps:b,labelProps:w,descriptionProps:j,wrapperProps:P,id:T,size:k,style:C,inputContainer:_,inputWrapperOrder:R,withAsterisk:M,variant:N,vars:L,mod:z,...G}=r,{styleProps:q,rest:Y}=Po(G),Q={label:i,description:s,error:l,required:u,classNames:d,className:h,__staticSelector:v,__stylesApiProps:x||r,errorProps:b,labelProps:w,descriptionProps:j,unstyled:m,styles:p,size:k,style:C,inputContainer:_,inputWrapperOrder:R,withAsterisk:M,variant:N,id:T,mod:z,...P};return{...Y,classNames:d,styles:p,unstyled:m,wrapperProps:{...Q,...q},inputProps:{required:u,classNames:d,styles:p,unstyled:m,size:k,__staticSelector:v,__stylesApiProps:x||r,error:l,variant:N,id:T}}}const P4={__staticSelector:"InputBase",withAria:!0},_r=ir((e,t)=>{const{inputProps:n,wrapperProps:r,...i}=T4("InputBase",P4,e);return o.jsx(tn.Wrapper,{...r,children:o.jsx(tn,{...n,...i,ref:t})})});_r.classes={...tn.classes,...tn.Wrapper.classes};_r.displayName="@mantine/core/InputBase";const R4={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 EE={root:"m_8bffd616"};const _4={},aa=ir((e,t)=>{const n=ie("Flex",_4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,gap:p,rowGap:h,columnGap:m,align:v,justify:x,wrap:b,direction:w,...j}=n,P=Ne({name:"Flex",classes:EE,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d}),T=dn(),k=fu(),C=yC({styleProps:{gap:p,rowGap:h,columnGap:m,align:v,justify:x,wrap:b,direction:w},theme:T,data:R4});return o.jsxs(o.Fragment,{children:[C.hasResponsiveStyles&&o.jsx(ba,{selector:`.${k}`,styles:C.styles,media:C.media}),o.jsx(se,{ref:t,...P("root",{className:k,style:gs(C.inlineStyles)}),...j})]})});aa.classes=EE;aa.displayName="@mantine/core/Flex";function D4(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 I4({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const i=y.useRef(-1),[s,l]=y.useState(!1),[u,d]=y.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const x=e.getBoundingClientRect(),b=t.getBoundingClientRect(),w=window.getComputedStyle(e),j=window.getComputedStyle(t),P=us(w.borderTopWidth)+us(j.borderTopWidth),T=us(w.borderLeftWidth)+us(j.borderLeftWidth),k={top:x.top-b.top-P,left:x.left-b.left-T,width:x.width,height:x.height};n.current.style.transform=`translateY(${k.top}px) translateX(${k.left}px)`,n.current.style.width=`${k.width}px`,n.current.style.height=`${k.height}px`},h=()=>{window.clearTimeout(i.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),i.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},m=y.useRef(null),v=y.useRef(null);return y.useEffect(()=>{if(p(),e)return m.current=new ResizeObserver(h),m.current.observe(e),t&&(v.current=new ResizeObserver(h),v.current.observe(t)),()=>{var x,b;(x=m.current)==null||x.disconnect(),(b=v.current)==null||b.disconnect()}},[t,e]),y.useEffect(()=>{if(t){const x=b=>{D4(b.target,t)&&(h(),d(!1))};return t.addEventListener("transitionend",x),()=>{t.removeEventListener("transitionend",x)}}},[t]),MD(()=>{dC()!=="test"&&l(!0)},20,{autoInvoke:!0}),OD(x=>{x.forEach(b=>{b.type==="attributes"&&b.attributeName==="dir"&&h()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:s,hidden:u}}var kE={root:"m_96b553a6"};const A4={},N4=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Yy=fe((e,t)=>{const n=ie("FloatingIndicator",A4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,target:p,parent:h,transitionDuration:m,mod:v,displayAfterTransitionEnd:x,...b}=n,w=Ne({name:"FloatingIndicator",classes:kE,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:N4}),j=y.useRef(null),{initialized:P,hidden:T}=I4({target:p,parent:h,ref:j,displayAfterTransitionEnd:x}),k=Nn(t,j);return!p||!h?null:o.jsx(se,{ref:k,mod:[{initialized:P,hidden:T},v],...w("root"),...b})});Yy.displayName="@mantine/core/FloatingIndicator";Yy.classes=kE;var TE={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 M4={},O4=(e,{radius:t,color:n,variant:r,autoContrast:i})=>{const s=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:Ot(t),"--alert-bg":n||r?s.background:void 0,"--alert-color":s.color,"--alert-bd":n||r?s.border:void 0}}},xs=fe((e,t)=>{const n=ie("Alert",M4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,radius:p,color:h,title:m,children:v,id:x,icon:b,withCloseButton:w,onClose:j,closeButtonLabel:P,variant:T,autoContrast:k,...C}=n,_=Ne({name:"Alert",classes:TE,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:O4}),R=hr(x),M=m&&`${R}-title`||void 0,N=`${R}-body`;return o.jsx(se,{id:R,..._("root",{variant:T}),variant:T,ref:t,...C,role:"alert","aria-describedby":N,"aria-labelledby":M,children:o.jsxs("div",{..._("wrapper"),children:[b&&o.jsx("div",{..._("icon"),children:b}),o.jsxs("div",{..._("body"),children:[m&&o.jsx("div",{..._("title"),"data-with-close-button":w||void 0,children:o.jsx("span",{id:M,..._("label"),children:m})}),v&&o.jsx("div",{id:N,..._("message"),"data-variant":T,children:v})]}),w&&o.jsx(Sa,{..._("closeButton"),onClick:j,variant:"transparent",size:16,iconSize:16,"aria-label":P,unstyled:u})]})})});xs.classes=TE;xs.displayName="@mantine/core/Alert";var PE={root:"m_b6d8b162"};function L4(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const $4={inherit:!1},F4=(e,{variant:t,lineClamp:n,gradient:r,size:i,color:s})=>({root:{"--text-fz":In(i),"--text-lh":nC(i),"--text-gradient":t==="gradient"?Pg(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":s?$t(s,e):void 0}}),Le=ir((e,t)=>{const n=ie("Text",$4,e),{lineClamp:r,truncate:i,inline:s,inherit:l,gradient:u,span:d,__staticSelector:p,vars:h,className:m,style:v,classNames:x,styles:b,unstyled:w,variant:j,mod:P,size:T,...k}=n,C=Ne({name:["Text",p],props:n,classes:PE,className:m,style:v,classNames:x,styles:b,unstyled:w,vars:h,varsResolver:F4});return o.jsx(se,{...C("root",{focusable:!0}),ref:t,component:d?"span":"p",variant:j,mod:[{"data-truncate":L4(i),"data-line-clamp":typeof r=="number","data-inline":s,"data-inherit":l},P],size:T,...k})});Le.classes=PE;Le.displayName="@mantine/core/Text";var RE={root:"m_849cf0da"};const z4={underline:"hover"},Rt=ir((e,t)=>{const{underline:n,className:r,unstyled:i,mod:s,...l}=ie("Anchor",z4,e);return o.jsx(Le,{component:"a",ref:t,className:Nt({[RE.root]:!i},r),...l,mod:[{underline:n},s],__staticSelector:"Anchor",unstyled:i})});Rt.classes=RE;Rt.displayName="@mantine/core/Anchor";const[B4,Ul]=pr("AppShell was not found in tree");var bs={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const U4={},Xy=fe((e,t)=>{const n=ie("AppShellAside",U4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:o.jsx(se,{component:"aside",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("aside",{className:i,classNames:r,styles:l,style:s}),...v,__vars:{"--app-shell-aside-z-index":`calc(${h??x.zIndex} + 1)`}})});Xy.classes=bs;Xy.displayName="@mantine/core/AppShellAside";const V4={},Jy=fe((e,t)=>{var b;const n=ie("AppShellFooter",V4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:o.jsx(se,{component:"footer",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("footer",{className:Nt({[Sl.classNames.zeroRight]:x.offsetScrollbars},i),classNames:r,styles:l,style:s}),...v,__vars:{"--app-shell-footer-z-index":(b=h??x.zIndex)==null?void 0:b.toString()}})});Jy.classes=bs;Jy.displayName="@mantine/core/AppShellFooter";const W4={},Zy=fe((e,t)=>{var b;const n=ie("AppShellHeader",W4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:o.jsx(se,{component:"header",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("header",{className:Nt({[Sl.classNames.zeroRight]:x.offsetScrollbars},i),classNames:r,styles:l,style:s}),...v,__vars:{"--app-shell-header-z-index":(b=h??x.zIndex)==null?void 0:b.toString()}})});Zy.classes=bs;Zy.displayName="@mantine/core/AppShellHeader";const H4={},ev=fe((e,t)=>{const n=ie("AppShellMain",H4,e),{classNames:r,className:i,style:s,styles:l,vars:u,...d}=n,p=Ul();return o.jsx(se,{component:"main",ref:t,...p.getStyles("main",{className:i,style:s,classNames:r,styles:l}),...d})});ev.classes=bs;ev.displayName="@mantine/core/AppShellMain";function mu(e){return typeof e=="object"?e.base:e}function gu(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 yu(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function q4({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i}){var d,p,h;const s=r==null?void 0:r.width,l="translateX(var(--app-shell-aside-width))",u="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((d=r==null?void 0:r.collapsed)!=null&&d.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),gu(s)){const m=oe(mu(s));e["--app-shell-aside-width"]=m,e["--app-shell-aside-offset"]=m}if(yu(s)&&(typeof s.base<"u"&&(e["--app-shell-aside-width"]=oe(s.base),e["--app-shell-aside-offset"]=oe(s.base)),Qt(s).forEach(m=>{m!=="base"&&(t[m]=t[m]||{},t[m]["--app-shell-aside-width"]=oe(s[m]),t[m]["--app-shell-aside-offset"]=oe(s[m]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const m=r.breakpoint;t[m]=t[m]||{},t[m]["--app-shell-aside-transform"]=l,t[m]["--app-shell-aside-transform-rtl"]=u,t[m]["--app-shell-aside-offset"]="0px !important"}if((h=r==null?void 0:r.collapsed)!=null&&h.mobile){const m=wy(r.breakpoint,i.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-aside-width"]="100%",n[m]["--app-shell-aside-offset"]="0px",n[m]["--app-shell-aside-transform"]=l,n[m]["--app-shell-aside-transform-rtl"]=u}}function G4({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,i="translateY(var(--app-shell-footer-height))",s=(n==null?void 0:n.offset)??!0;if(gu(r)){const l=oe(mu(r));e["--app-shell-footer-height"]=l,s&&(e["--app-shell-footer-offset"]=l)}yu(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=oe(r.base),s&&(e["--app-shell-footer-offset"]=oe(r.base))),Qt(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-footer-height"]=oe(r[l]),s&&(t[l]["--app-shell-footer-offset"]=oe(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=i,e["--app-shell-footer-offset"]="0px !important")}function Q4({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,i="translateY(calc(var(--app-shell-header-height) * -1))",s=(n==null?void 0:n.offset)??!0;if(gu(r)){const l=oe(mu(r));e["--app-shell-header-height"]=l,s&&(e["--app-shell-header-offset"]=l)}yu(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=oe(r.base),s&&(e["--app-shell-header-offset"]=oe(r.base))),Qt(r).forEach(l=>{l!=="base"&&(t[l]=t[l]||{},t[l]["--app-shell-header-height"]=oe(r[l]),s&&(t[l]["--app-shell-header-offset"]=oe(r[l])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=i,e["--app-shell-header-offset"]="0px !important")}function K4({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i}){var d,p,h;const s=r==null?void 0:r.width,l="translateX(calc(var(--app-shell-navbar-width) * -1))",u="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((d=r==null?void 0:r.collapsed)!=null&&d.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),gu(s)){const m=oe(mu(s));e["--app-shell-navbar-width"]=m,e["--app-shell-navbar-offset"]=m}if(yu(s)&&(typeof s.base<"u"&&(e["--app-shell-navbar-width"]=oe(s.base),e["--app-shell-navbar-offset"]=oe(s.base)),Qt(s).forEach(m=>{m!=="base"&&(t[m]=t[m]||{},t[m]["--app-shell-navbar-width"]=oe(s[m]),t[m]["--app-shell-navbar-offset"]=oe(s[m]))})),(p=r==null?void 0:r.collapsed)!=null&&p.desktop){const m=r.breakpoint;t[m]=t[m]||{},t[m]["--app-shell-navbar-transform"]=l,t[m]["--app-shell-navbar-transform-rtl"]=u,t[m]["--app-shell-navbar-offset"]="0px !important"}if((h=r==null?void 0:r.collapsed)!=null&&h.mobile){const m=wy(r.breakpoint,i.breakpoints)-.1;n[m]=n[m]||{},n[m]["--app-shell-navbar-width"]="100%",n[m]["--app-shell-navbar-offset"]="0px",n[m]["--app-shell-navbar-transform"]=l,n[m]["--app-shell-navbar-transform-rtl"]=u}}function ng(e){return Number(e)===0?"0px":Dn(e)}function Y4({padding:e,baseStyles:t,minMediaStyles:n}){gu(e)&&(t["--app-shell-padding"]=ng(mu(e))),yu(e)&&(e.base&&(t["--app-shell-padding"]=ng(e.base)),Qt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=ng(e[r]))}))}function X4({navbar:e,header:t,footer:n,aside:r,padding:i,theme:s}){const l={},u={},d={};K4({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,navbar:e,theme:s}),q4({baseStyles:d,minMediaStyles:l,maxMediaStyles:u,aside:r,theme:s}),Q4({baseStyles:d,minMediaStyles:l,header:t}),G4({baseStyles:d,minMediaStyles:l,footer:n}),Y4({baseStyles:d,minMediaStyles:l,padding:i});const p=Kc(Qt(l),s.breakpoints).map(v=>({query:`(min-width: ${vf(v.px)})`,styles:l[v.value]})),h=Kc(Qt(u),s.breakpoints).map(v=>({query:`(max-width: ${vf(v.px)})`,styles:u[v.value]})),m=[...p,...h];return{baseStyles:d,media:m}}function J4({navbar:e,header:t,aside:n,footer:r,padding:i}){const s=dn(),l=ys(),{media:u,baseStyles:d}=X4({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s});return o.jsx(ba,{media:u,styles:d,selector:l.cssVariablesSelector})}const Z4={},tv=fe((e,t)=>{const n=ie("AppShellNavbar",Z4,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,withBorder:p,zIndex:h,mod:m,...v}=n,x=Ul();return x.disabled?null:o.jsx(se,{component:"nav",ref:t,mod:[{"with-border":p??x.withBorder},m],...x.getStyles("navbar",{className:i,classNames:r,styles:l,style:s}),...v,__vars:{"--app-shell-navbar-z-index":`calc(${h??x.zIndex} + 1)`}})});tv.classes=bs;tv.displayName="@mantine/core/AppShellNavbar";const e3={},nv=ir((e,t)=>{const n=ie("AppShellSection",e3,e),{classNames:r,className:i,style:s,styles:l,vars:u,grow:d,mod:p,...h}=n,m=Ul();return o.jsx(se,{ref:t,mod:[{grow:d},p],...m.getStyles("section",{className:i,style:s,classNames:r,styles:l}),...h})});nv.classes=bs;nv.displayName="@mantine/core/AppShellSection";function t3({transitionDuration:e,disabled:t}){const[n,r]=y.useState(!0),i=y.useRef(-1),s=y.useRef(-1);return uC("resize",()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),200)}),Ll(()=>{r(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>y.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const n3={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Br("app")},r3=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Tr=fe((e,t)=>{const n=ie("AppShell",n3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,navbar:p,withBorder:h,padding:m,transitionDuration:v,transitionTimingFunction:x,header:b,zIndex:w,layout:j,disabled:P,aside:T,footer:k,offsetScrollbars:C=j!=="alt",mod:_,...R}=n,M=Ne({name:"AppShell",classes:bs,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:r3}),N=t3({disabled:P,transitionDuration:v});return o.jsxs(B4,{value:{getStyles:M,withBorder:h,zIndex:w,disabled:P,offsetScrollbars:C},children:[o.jsx(J4,{navbar:p,header:b,aside:T,footer:k,padding:m}),o.jsx(se,{ref:t,...M("root"),mod:[{resizing:N,layout:j,disabled:P},_],...R})]})});Tr.classes=bs;Tr.displayName="@mantine/core/AppShell";Tr.Navbar=tv;Tr.Header=Zy;Tr.Main=ev;Tr.Aside=Xy;Tr.Footer=Jy;Tr.Section=nv;function _E(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=>_E(t))}:e}function DE(e){return e?e.map(t=>_E(t)):[]}function IE(e){return e.reduce((t,n)=>"group"in n?{...t,...IE(n.items)}:(t[n.value]=n,t),{})}var Rr={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 i3={error:null},o3=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":rt(t,"combobox-chevron-size"),"--combobox-chevron-color":n?$t(n,e):void 0}}),dp=fe((e,t)=>{const n=ie("ComboboxChevron",i3,e),{size:r,error:i,style:s,className:l,classNames:u,styles:d,unstyled:p,vars:h,mod:m,...v}=n,x=Ne({name:"ComboboxChevron",classes:Rr,props:n,style:s,className:l,classNames:u,styles:d,unstyled:p,vars:h,varsResolver:o3,rootSelector:"chevron"});return o.jsx(se,{component:"svg",...v,...x("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:i},m],ref:t,children:o.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"})})});dp.classes=Rr;dp.displayName="@mantine/core/ComboboxChevron";const[s3,ai]=pr("Combobox component was not found in tree"),AE=y.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...i},s)=>o.jsx(tn.ClearButton,{ref:s,tabIndex:-1,"aria-hidden":!0,...i,onMouseDown:l=>{l.preventDefault(),t==null||t(l)},onClick:l=>{r(),n==null||n(l)}}));AE.displayName="@mantine/core/ComboboxClearButton";const a3={},rv=fe((e,t)=>{const{classNames:n,styles:r,className:i,style:s,hidden:l,...u}=ie("ComboboxDropdown",a3,e),d=ai();return o.jsx(Pi.Dropdown,{...u,ref:t,role:"presentation","data-hidden":l||void 0,...d.getStyles("dropdown",{className:i,style:s,classNames:n,styles:r})})});rv.classes=Rr;rv.displayName="@mantine/core/ComboboxDropdown";const l3={refProp:"ref"},NE=fe((e,t)=>{const{children:n,refProp:r}=ie("ComboboxDropdownTarget",l3,e);if(ai(),!Eo(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 o.jsx(Pi.Target,{ref:t,refProp:r,children:n})});NE.displayName="@mantine/core/ComboboxDropdownTarget";const c3={},iv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,...u}=ie("ComboboxEmpty",c3,e),d=ai();return o.jsx(se,{ref:t,...d.getStyles("empty",{className:r,classNames:n,styles:s,style:i}),...u})});iv.classes=Rr;iv.displayName="@mantine/core/ComboboxEmpty";function ov({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:i,autoComplete:s}){const l=ai(),[u,d]=y.useState(null),p=m=>{if(e==null||e(m),!l.readOnly&&t){if(m.nativeEvent.isComposing)return;if(m.nativeEvent.code==="ArrowDown"&&(m.preventDefault(),l.store.dropdownOpened?d(l.store.selectNextOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),m.nativeEvent.code==="ArrowUp"&&(m.preventDefault(),l.store.dropdownOpened?d(l.store.selectPreviousOption()):(l.store.openDropdown("keyboard"),d(l.store.selectActiveOption()),l.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),m.nativeEvent.code==="Enter"||m.nativeEvent.code==="NumpadEnter"){if(m.nativeEvent.keyCode===229)return;const v=l.store.getSelectedOptionIndex();l.store.dropdownOpened&&v!==-1?(m.preventDefault(),l.store.clickSelectedOption()):i==="button"&&(m.preventDefault(),l.store.openDropdown("keyboard"))}m.key==="Escape"&&l.store.closeDropdown("keyboard"),m.nativeEvent.code==="Space"&&i==="button"&&(m.preventDefault(),l.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(l.store.listId&&l.store.dropdownOpened)||void 0,"aria-controls":l.store.dropdownOpened?l.store.listId:void 0,"aria-activedescendant":l.store.dropdownOpened&&u||void 0,autoComplete:s,"data-expanded":l.store.dropdownOpened||void 0,"data-mantine-stop-propagation":l.store.dropdownOpened||void 0}:{},onKeyDown:p}}const u3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},ME=fe((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:l,targetType:u,autoComplete:d,...p}=ie("ComboboxEventsTarget",u3,e);if(!Eo(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const h=ai(),m=ov({targetType:u,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:l,onKeyDown:n.props.onKeyDown,autoComplete:d});return y.cloneElement(n,{...m,...p,[r]:Nn(t,h.store.targetRef,Xf(n))})});ME.displayName="@mantine/core/ComboboxEventsTarget";const d3={},sv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,...u}=ie("ComboboxFooter",d3,e),d=ai();return o.jsx(se,{ref:t,...d.getStyles("footer",{className:r,classNames:n,style:i,styles:s}),...u,onMouseDown:p=>{p.preventDefault()}})});sv.classes=Rr;sv.displayName="@mantine/core/ComboboxFooter";const f3={},av=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,children:u,label:d,...p}=ie("ComboboxGroup",f3,e),h=ai();return o.jsxs(se,{ref:t,...h.getStyles("group",{className:r,classNames:n,style:i,styles:s}),...p,children:[d&&o.jsx("div",{...h.getStyles("groupLabel",{classNames:n,styles:s}),children:d}),u]})});av.classes=Rr;av.displayName="@mantine/core/ComboboxGroup";const p3={},lv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,...u}=ie("ComboboxHeader",p3,e),d=ai();return o.jsx(se,{ref:t,...d.getStyles("header",{className:r,classNames:n,style:i,styles:s}),...u,onMouseDown:p=>{p.preventDefault()}})});lv.classes=Rr;lv.displayName="@mantine/core/ComboboxHeader";function OE({value:e,valuesDivider:t=",",...n}){return o.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}OE.displayName="@mantine/core/ComboboxHiddenInput";const h3={},cv=fe((e,t)=>{const n=ie("ComboboxOption",h3,e),{classNames:r,className:i,style:s,styles:l,vars:u,onClick:d,id:p,active:h,onMouseDown:m,onMouseOver:v,disabled:x,selected:b,mod:w,...j}=n,P=ai(),T=y.useId(),k=p||T;return o.jsx(se,{...P.getStyles("option",{className:i,classNames:r,styles:l,style:s}),...j,ref:t,id:k,mod:["combobox-option",{"combobox-active":h,"combobox-disabled":x,"combobox-selected":b},w],role:"option",onClick:C=>{var _;x?C.preventDefault():((_=P.onOptionSubmit)==null||_.call(P,n.value,n),d==null||d(C))},onMouseDown:C=>{C.preventDefault(),m==null||m(C)},onMouseOver:C=>{P.resetSelectionOnOptionHover&&P.store.resetSelectedOption(),v==null||v(C)}})});cv.classes=Rr;cv.displayName="@mantine/core/ComboboxOption";const m3={},uv=fe((e,t)=>{const n=ie("ComboboxOptions",m3,e),{classNames:r,className:i,style:s,styles:l,id:u,onMouseDown:d,labelledBy:p,...h}=n,m=ai(),v=hr(u);return y.useEffect(()=>{m.store.setListId(v)},[v]),o.jsx(se,{ref:t,...m.getStyles("options",{className:i,style:s,classNames:r,styles:l}),...h,id:v,role:"listbox","aria-labelledby":p,onMouseDown:x=>{x.preventDefault(),d==null||d(x)}})});uv.classes=Rr;uv.displayName="@mantine/core/ComboboxOptions";const g3={withAriaAttributes:!0,withKeyboardNavigation:!0},dv=fe((e,t)=>{const n=ie("ComboboxSearch",g3,e),{classNames:r,styles:i,unstyled:s,vars:l,withAriaAttributes:u,onKeyDown:d,withKeyboardNavigation:p,size:h,...m}=n,v=ai(),x=v.getStyles("search"),b=ov({targetType:"input",withAriaAttributes:u,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:d,autoComplete:"off"});return o.jsx(tn,{ref:Nn(t,v.store.searchRef),classNames:[{input:x.className},r],styles:[{input:x.style},i],size:h||v.size,...b,...m,__staticSelector:"Combobox"})});dv.classes=Rr;dv.displayName="@mantine/core/ComboboxSearch";const y3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},LE=fe((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:i,withAriaAttributes:s,withExpandedAttribute:l,targetType:u,autoComplete:d,...p}=ie("ComboboxTarget",y3,e);if(!Eo(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const h=ai(),m=ov({targetType:u,withAriaAttributes:s,withKeyboardNavigation:i,withExpandedAttribute:l,onKeyDown:n.props.onKeyDown,autoComplete:d}),v=y.cloneElement(n,{...m,...p});return o.jsx(Pi.Target,{ref:Nn(t,h.store.targetRef),children:v})});LE.displayName="@mantine/core/ComboboxTarget";function v3(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 x3(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 b3(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function vu({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:i,loop:s=!0,scrollBehavior:l="instant"}={}){const[u,d]=Vn({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=y.useRef(null),h=y.useRef(-1),m=y.useRef(null),v=y.useRef(null),x=y.useRef(-1),b=y.useRef(-1),w=y.useRef(-1),j=y.useCallback((V="unknown")=>{u||(d(!0),i==null||i(V))},[d,i,u]),P=y.useCallback((V="unknown")=>{u&&(d(!1),r==null||r(V))},[d,r,u]),T=y.useCallback((V="unknown")=>{u?P(V):j(V)},[P,j,u]),k=y.useCallback(()=>{const V=document.querySelector(`#${p.current} [data-combobox-selected]`);V==null||V.removeAttribute("data-combobox-selected"),V==null||V.removeAttribute("aria-selected")},[]),C=y.useCallback(V=>{const O=document.getElementById(p.current),A=O==null?void 0:O.querySelectorAll("[data-combobox-option]");if(!A)return null;const B=V>=A.length?0:V<0?A.length-1:V;return h.current=B,A!=null&&A[B]&&!A[B].hasAttribute("data-combobox-disabled")?(k(),A[B].setAttribute("data-combobox-selected","true"),A[B].setAttribute("aria-selected","true"),A[B].scrollIntoView({block:"nearest",behavior:l}),A[B].id):null},[l,k]),_=y.useCallback(()=>{const V=document.querySelector(`#${p.current} [data-combobox-active]`);if(V){const O=document.querySelectorAll(`#${p.current} [data-combobox-option]`),A=Array.from(O).findIndex(B=>B===V);return C(A)}return C(0)},[C]),R=y.useCallback(()=>C(x3(h.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[C,s]),M=y.useCallback(()=>C(v3(h.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),s)),[C,s]),N=y.useCallback(()=>C(b3(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[C]),L=y.useCallback((V="selected",O)=>{w.current=window.setTimeout(()=>{var I;const A=document.querySelectorAll(`#${p.current} [data-combobox-option]`),B=Array.from(A).findIndex(F=>F.hasAttribute(`data-combobox-${V}`));h.current=B,O!=null&&O.scrollIntoView&&((I=A[B])==null||I.scrollIntoView({block:"nearest",behavior:l}))},0)},[]),z=y.useCallback(()=>{h.current=-1,k()},[k]),G=y.useCallback(()=>{const V=document.querySelectorAll(`#${p.current} [data-combobox-option]`),O=V==null?void 0:V[h.current];O==null||O.click()},[]),q=y.useCallback(V=>{p.current=V},[]),Y=y.useCallback(()=>{x.current=window.setTimeout(()=>m.current.focus(),0)},[]),Q=y.useCallback(()=>{b.current=window.setTimeout(()=>v.current.focus(),0)},[]),ne=y.useCallback(()=>h.current,[]);return y.useEffect(()=>()=>{window.clearTimeout(x.current),window.clearTimeout(b.current),window.clearTimeout(w.current)},[]),{dropdownOpened:u,openDropdown:j,closeDropdown:P,toggleDropdown:T,selectedOptionIndex:h.current,getSelectedOptionIndex:ne,selectOption:C,selectFirstOption:N,selectActiveOption:_,selectNextOption:R,selectPreviousOption:M,resetSelectedOption:z,updateSelectedOptionIndex:L,listId:p.current,setListId:q,clickSelectedOption:G,searchRef:m,focusSearchInput:Y,targetRef:v,focusTarget:Q}}const w3={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},S3=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":In(t),"--combobox-option-padding":rt(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:oe(n),"--combobox-option-fz":In(t),"--combobox-option-padding":rt(t,"combobox-option-padding")}});function lt(e){const t=ie("Combobox",w3,e),{classNames:n,styles:r,unstyled:i,children:s,store:l,vars:u,onOptionSubmit:d,onClose:p,size:h,dropdownPadding:m,resetSelectionOnOptionHover:v,__staticSelector:x,readOnly:b,...w}=t,j=vu(),P=l||j,T=Ne({name:x||"Combobox",classes:Rr,props:t,classNames:n,styles:r,unstyled:i,vars:u,varsResolver:S3}),k=()=>{p==null||p(),P.closeDropdown()};return o.jsx(s3,{value:{getStyles:T,store:P,onOptionSubmit:d,size:h,resetSelectionOnOptionHover:v,readOnly:b},children:o.jsx(Pi,{opened:P.dropdownOpened,...w,onChange:C=>!C&&k(),withRoles:!1,unstyled:i,children:s})})}const j3=e=>e;lt.extend=j3;lt.classes=Rr;lt.displayName="@mantine/core/Combobox";lt.Target=LE;lt.Dropdown=rv;lt.Options=uv;lt.Option=cv;lt.Search=dv;lt.Empty=iv;lt.Chevron=dp;lt.Footer=sv;lt.Header=lv;lt.EventsTarget=ME;lt.DropdownTarget=NE;lt.Group=av;lt.ClearButton=AE;lt.HiddenInput=OE;var $E={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const FE=$E,fp=y.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:s,children:l,label:u,description:d,id:p,disabled:h,error:m,size:v,labelPosition:x="left",bodyElement:b="div",labelElement:w="label",variant:j,style:P,vars:T,mod:k,...C},_)=>{const R=Ne({name:e,props:t,className:n,style:P,classes:$E,classNames:r,styles:i,unstyled:s});return o.jsx(se,{...R("root"),ref:_,__vars:{"--label-fz":In(v),"--label-lh":rt(v,"label-lh")},mod:[{"label-position":x},k],variant:j,size:v,...C,children:o.jsxs(se,{component:b,htmlFor:b==="label"?p:void 0,...R("body"),children:[l,o.jsxs("div",{...R("labelWrapper"),"data-disabled":h||void 0,children:[u&&o.jsx(se,{component:w,htmlFor:w==="label"?p:void 0,...R("label"),"data-disabled":h||void 0,children:u}),d&&o.jsx(tn.Description,{size:v,__inheritStyles:!1,...R("description"),children:d}),m&&typeof m!="boolean"&&o.jsx(tn.Error,{size:v,__inheritStyles:!1,...R("error"),children:m})]})]})})});fp.displayName="@mantine/core/InlineInput";const zE=y.createContext(null),C3=zE.Provider,BE=()=>y.useContext(zE),[E3,k3]=ko();var UE={card:"m_26775b0a"};const T3={withBorder:!0},P3=(e,{radius:t})=>({card:{"--card-radius":Ot(t)}}),fv=fe((e,t)=>{const n=ie("CheckboxCard",T3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,checked:p,mod:h,withBorder:m,value:v,onClick:x,defaultChecked:b,onChange:w,...j}=n,P=Ne({name:"CheckboxCard",classes:UE,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:P3,rootSelector:"card"}),T=BE(),k=typeof p=="boolean"?p:T?T.value.includes(v||""):void 0,[C,_]=Vn({value:k,defaultValue:b,finalValue:!1,onChange:w});return o.jsx(E3,{value:{checked:C},children:o.jsx(Qn,{ref:t,mod:[{"with-border":m,checked:C},h],...P("card"),...j,role:"checkbox","aria-checked":C,onClick:R=>{x==null||x(R),T==null||T.onChange(v||""),_(!C)}})})});fv.displayName="@mantine/core/CheckboxCard";fv.classes=UE;function pv({children:e,role:t}){const n=Bl();return n?o.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):o.jsx(o.Fragment,{children:e})}const R3={},hv=fe((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:l,children:u,readOnly:d,...p}=ie("CheckboxGroup",R3,e),[h,m]=Vn({value:n,defaultValue:r,finalValue:[],onChange:i}),v=x=>{const b=typeof x=="string"?x:x.currentTarget.value;!d&&m(h.includes(b)?h.filter(w=>w!==b):[...h,b])};return o.jsx(C3,{value:{value:h,onChange:v,size:s},children:o.jsx(tn.Wrapper,{size:s,ref:t,...l,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:o.jsx(pv,{role:"group",children:u})})})});hv.classes=tn.Wrapper.classes;hv.displayName="@mantine/core/CheckboxGroup";function pp({size:e,style:t,...n}){const r=e!==void 0?{width:oe(e),height:oe(e),...t}:t;return o.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:o.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 VE({indeterminate:e,...t}){return e?o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:o.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):o.jsx(pp,{...t})}var WE={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const _3={icon:VE},D3=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:l})=>{const u=ei({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ot(t),"--checkbox-color":s==="outline"?d:$t(n,e),"--checkbox-icon-color":i?$t(i,e):xa(l,e)?To({color:n,theme:e,autoContrast:l}):void 0}}},mv=fe((e,t)=>{const n=ie("CheckboxIndicator",_3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,icon:p,indeterminate:h,radius:m,color:v,iconColor:x,autoContrast:b,checked:w,mod:j,variant:P,disabled:T,...k}=n,C=p,_=Ne({name:"CheckboxIndicator",classes:WE,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:D3,rootSelector:"indicator"}),R=k3(),M=typeof w=="boolean"||typeof h=="boolean"?w||h:(R==null?void 0:R.checked)||!1;return o.jsx(se,{ref:t,..._("indicator",{variant:P}),variant:P,mod:[{checked:M,disabled:T},j],...k,children:o.jsx(C,{indeterminate:h,..._("icon")})})});mv.displayName="@mantine/core/CheckboxIndicator";mv.classes=WE;var HE={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const I3={labelPosition:"right",icon:VE},A3=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:l})=>{const u=ei({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--checkbox-size":rt(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Ot(t),"--checkbox-color":s==="outline"?d:$t(n,e),"--checkbox-icon-color":i?$t(i,e):xa(l,e)?To({color:n,theme:e,autoContrast:l}):void 0}}},Kn=fe((e,t)=>{const n=ie("Checkbox",I3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,color:p,label:h,id:m,size:v,radius:x,wrapperProps:b,checked:w,labelPosition:j,description:P,error:T,disabled:k,variant:C,indeterminate:_,icon:R,rootRef:M,iconColor:N,onChange:L,autoContrast:z,mod:G,...q}=n,Y=BE(),Q=v||(Y==null?void 0:Y.size),ne=R,V=Ne({name:"Checkbox",props:n,classes:HE,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:A3}),{styleProps:O,rest:A}=Po(q),B=hr(m),I=Y?{checked:Y.value.includes(A.value),onChange:F=>{Y.onChange(F),L==null||L(F)}}:{};return o.jsx(fp,{...V("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:B,size:Q,labelPosition:j,label:h,description:P,error:T,disabled:k,classNames:r,styles:l,unstyled:u,"data-checked":I.checked||w||void 0,variant:C,ref:M,mod:G,...O,...b,children:o.jsxs(se,{...V("inner"),mod:{"data-label-position":j},children:[o.jsx(se,{component:"input",id:B,ref:t,checked:w,disabled:k,mod:{error:!!T,indeterminate:_},...V("input",{focusable:!0,variant:C}),onChange:L,...A,...I,type:"checkbox"}),o.jsx(ne,{indeterminate:_,...V("icon")})]})})});Kn.classes={...HE,...FE};Kn.displayName="@mantine/core/Checkbox";Kn.Group=hv;Kn.Indicator=mv;Kn.Card=fv;function Tl(e){return"group"in e}function qE({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),i=[];for(let s=0;s<e.length;s+=1){const l=e[s];if(i.length===n)return i;Tl(l)&&i.push({group:l.group,items:qE({options:l.items,search:t,limit:n-i.length})}),Tl(l)||l.label.toLowerCase().includes(r)&&i.push(l)}return i}function N3(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 GE(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Tl(n))GE(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 M3(e,t){return Array.isArray(e)?e.includes(t):e===t}function QE({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:i,renderOption:s}){if(!Tl(e)){const u=M3(n,e.value),d=t&&u&&o.jsx(pp,{className:Rr.optionsDropdownCheckIcon}),p=o.jsxs(o.Fragment,{children:[r==="left"&&d,o.jsx("span",{children:e.label}),r==="right"&&d]});return o.jsx(lt.Option,{value:e.value,disabled:e.disabled,className:Nt({[Rr.optionsDropdownOption]:!i}),"data-reverse":r==="right"||void 0,"data-checked":u||void 0,"aria-selected":u,active:u,children:typeof s=="function"?s({option:e,checked:u}):p})}const l=e.items.map(u=>o.jsx(QE,{data:u,value:n,unstyled:i,withCheckIcon:t,checkIconPosition:r,renderOption:s},u.value));return o.jsx(lt.Group,{label:e.group,children:l})}function O3({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:s,maxDropdownHeight:l,withScrollArea:u=!0,filterOptions:d=!0,withCheckIcon:p=!1,value:h,checkIconPosition:m,nothingFoundMessage:v,unstyled:x,labelId:b,renderOption:w,scrollAreaProps:j,"aria-label":P}){GE(e);const k=typeof i=="string"?(r||qE)({options:e,search:d?i:"",limit:s??1/0}):e,C=N3(k),_=k.map(R=>o.jsx(QE,{data:R,withCheckIcon:p,value:h,checkIconPosition:m,unstyled:x,renderOption:w},Tl(R)?R.group:R.value));return o.jsx(lt.Dropdown,{hidden:t||n&&C,children:o.jsxs(lt.Options,{labelledBy:b,"aria-label":P,children:[u?o.jsx(oi.Autosize,{mah:l??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...j,children:_}):_,C&&v&&o.jsx(lt.Empty,{children:v})]})})}const KE=y.createContext(null),L3=KE.Provider;function $3(){return{withinGroup:!!y.useContext(KE)}}var hp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const F3={},z3=(e,{spacing:t})=>({group:{"--ag-spacing":Dn(t)}}),gv=fe((e,t)=>{const n=ie("AvatarGroup",F3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,spacing:p,...h}=n,m=Ne({name:"AvatarGroup",classes:hp,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:z3,rootSelector:"group"});return o.jsx(L3,{value:!0,children:o.jsx(se,{ref:t,...m("group"),...h})})});gv.classes=hp;gv.displayName="@mantine/core/AvatarGroup";function B3(e){return o.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:o.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 U3(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 V3=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function W3(e,t=V3){const n=U3(e),r=Math.abs(n)%t.length;return t[r]}function H3(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 q3={},G3=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:l,name:u,allowedInitialsColors:d})=>{const p=s==="initials"&&typeof u=="string"?W3(u,d):s,h=e.variantColorResolver({color:p||"gray",theme:e,gradient:i,variant:r||"light",autoContrast:l});return{root:{"--avatar-size":rt(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Ot(n),"--avatar-bg":p||r?h.background:void 0,"--avatar-color":p||r?h.color:void 0,"--avatar-bd":p||r?h.border:void 0}}},la=ir((e,t)=>{const n=ie("Avatar",q3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,src:p,alt:h,radius:m,color:v,gradient:x,imageProps:b,children:w,autoContrast:j,mod:P,name:T,allowedInitialsColors:k,...C}=n,_=$3(),[R,M]=y.useState(!p),N=Ne({name:"Avatar",props:n,classes:hp,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:G3});return y.useEffect(()=>M(!p),[p]),o.jsx(se,{...N("root"),mod:[{"within-group":_.withinGroup},P],ref:t,...C,children:R?o.jsx("span",{...N("placeholder"),title:h,children:w||typeof T=="string"&&H3(T)||o.jsx(B3,{})}):o.jsx("img",{...b,...N("image"),src:p,alt:h,onError:L=>{var z;M(!0),(z=b==null?void 0:b.onError)==null||z.call(b,L)}})})});la.classes=hp;la.displayName="@mantine/core/Avatar";la.Group=gv;var YE={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const Q3={},K3=(e,{radius:t,color:n,gradient:r,variant:i,size:s,autoContrast:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:l});return{root:{"--badge-height":rt(s,"badge-height"),"--badge-padding-x":rt(s,"badge-padding-x"),"--badge-fz":rt(s,"badge-fz"),"--badge-radius":t===void 0?void 0:Ot(t),"--badge-bg":n||i?u.background:void 0,"--badge-color":n||i?u.color:void 0,"--badge-bd":n||i?u.border:void 0,"--badge-dot-color":i==="dot"?$t(n,e):void 0}}},xu=ir((e,t)=>{const n=ie("Badge",Q3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,radius:p,color:h,gradient:m,leftSection:v,rightSection:x,children:b,variant:w,fullWidth:j,autoContrast:P,circle:T,mod:k,...C}=n,_=Ne({name:"Badge",props:n,classes:YE,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:K3});return o.jsxs(se,{variant:w,mod:[{block:j,circle:T,"with-right-section":!!x,"with-left-section":!!v},k],..._("root",{variant:w}),ref:t,...C,children:[v&&o.jsx("span",{..._("section"),"data-position":"left",children:v}),o.jsx("span",{..._("label"),children:b}),x&&o.jsx("span",{..._("section"),"data-position":"right",children:x})]})});xu.classes=YE;xu.displayName="@mantine/core/Badge";var XE={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const Y3={iconSize:48},X3=(e,{color:t,iconSize:n,radius:r})=>{const i=ei({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),s=ei({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Jr(s.value,.07),"--bq-bg-dark":Jr(i.value,.06),"--bq-bd":$t(t,e),"--bq-icon-size":oe(n),"--bq-radius":Ot(r)}}},yv=fe((e,t)=>{const n=ie("Blockquote",Y3,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,children:p,icon:h,iconSize:m,cite:v,...x}=n,b=Ne({name:"Blockquote",classes:XE,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:X3});return o.jsxs(se,{component:"blockquote",ref:t,...b("root"),...x,children:[h&&o.jsx("span",{...b("icon"),children:h}),p,v&&o.jsx("cite",{...b("cite"),children:v})]})});yv.classes=XE;yv.displayName="@mantine/core/Blockquote";var Vl={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const Cw={orientation:"horizontal"},J3=(e,{borderWidth:t})=>({group:{"--button-border-width":oe(t)}}),vv=fe((e,t)=>{const n=ie("ButtonGroup",Cw,e),{className:r,style:i,classNames:s,styles:l,unstyled:u,orientation:d,vars:p,borderWidth:h,variant:m,mod:v,...x}=ie("ButtonGroup",Cw,e),b=Ne({name:"ButtonGroup",props:n,classes:Vl,className:r,style:i,classNames:s,styles:l,unstyled:u,vars:p,varsResolver:J3,rootSelector:"group"});return o.jsx(se,{...b("group"),ref:t,variant:m,mod:[{"data-orientation":d},v],role:"group",...x})});vv.classes=Vl;vv.displayName="@mantine/core/ButtonGroup";const Ew={},Z3=(e,{radius:t,color:n,gradient:r,variant:i,autoContrast:s,size:l})=>{const u=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:s});return{groupSection:{"--section-height":rt(l,"section-height"),"--section-padding-x":rt(l,"section-padding-x"),"--section-fz":l!=null&&l.includes("compact")?In(l.replace("compact-","")):In(l),"--section-radius":t===void 0?void 0:Ot(t),"--section-bg":n||i?u.background:void 0,"--section-color":u.color,"--section-bd":n||i?u.border:void 0}}},xv=fe((e,t)=>{const n=ie("ButtonGroupSection",Ew,e),{className:r,style:i,classNames:s,styles:l,unstyled:u,vars:d,variant:p,gradient:h,radius:m,autoContrast:v,...x}=ie("ButtonGroupSection",Ew,e),b=Ne({name:"ButtonGroupSection",props:n,classes:Vl,className:r,style:i,classNames:s,styles:l,unstyled:u,vars:d,varsResolver:Z3,rootSelector:"groupSection"});return o.jsx(se,{...b("groupSection"),ref:t,variant:p,...x})});xv.classes=Vl;xv.displayName="@mantine/core/ButtonGroupSection";const e9={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${oe(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},t9={},n9=(e,{radius:t,color:n,gradient:r,variant:i,size:s,justify:l,autoContrast:u})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||"filled",autoContrast:u});return{root:{"--button-justify":l,"--button-height":rt(s,"button-height"),"--button-padding-x":rt(s,"button-padding-x"),"--button-fz":s!=null&&s.includes("compact")?In(s.replace("compact-","")):In(s),"--button-radius":t===void 0?void 0:Ot(t),"--button-bg":n||i?d.background:void 0,"--button-hover":n||i?d.hover:void 0,"--button-color":d.color,"--button-bd":n||i?d.border:void 0,"--button-hover-color":n||i?d.hoverColor:void 0}}},Ee=ir((e,t)=>{const n=ie("Button",t9,e),{style:r,vars:i,className:s,color:l,disabled:u,children:d,leftSection:p,rightSection:h,fullWidth:m,variant:v,radius:x,loading:b,loaderProps:w,gradient:j,classNames:P,styles:T,unstyled:k,"data-disabled":C,autoContrast:_,mod:R,...M}=n,N=Ne({name:"Button",props:n,classes:Vl,className:s,style:r,classNames:P,styles:T,unstyled:k,vars:i,varsResolver:n9}),L=!!p,z=!!h;return o.jsxs(Qn,{ref:t,...N("root",{active:!u&&!b&&!C}),unstyled:k,variant:v,disabled:u||b,mod:[{disabled:u||C,loading:b,block:m,"with-left-section":L,"with-right-section":z},R],...M,children:[o.jsx(Xi,{mounted:!!b,transition:e9,duration:150,children:G=>o.jsx(se,{component:"span",...N("loader",{style:G}),"aria-hidden":!0,children:o.jsx(Pr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...w})})}),o.jsxs("span",{...N("inner"),children:[p&&o.jsx(se,{component:"span",...N("section"),mod:{position:"left"},children:p}),o.jsx(se,{component:"span",mod:{loading:b},...N("label"),children:d}),h&&o.jsx(se,{component:"span",...N("section"),mod:{position:"right"},children:h})]})]})});Ee.classes=Vl;Ee.displayName="@mantine/core/Button";Ee.Group=vv;Ee.GroupSection=xv;var JE={root:"m_4451eb3a"};const r9={},Gn=ir((e,t)=>{const n=ie("Center",r9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,inline:p,mod:h,...m}=n,v=Ne({name:"Center",props:n,classes:JE,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d});return o.jsx(se,{ref:t,mod:[{inline:p},h],...v("root"),...m})});Gn.classes=JE;Gn.displayName="@mantine/core/Center";const[i9,o9]=ko(),s9={};function ZE(e){const{value:t,defaultValue:n,onChange:r,multiple:i,children:s}=ie("ChipGroup",s9,e),[l,u]=Vn({value:t,defaultValue:n,finalValue:i?[]:null,onChange:r}),d=h=>Array.isArray(l)?l.includes(h):h===l,p=h=>{const m=h.currentTarget.value;Array.isArray(l)?u(l.includes(m)?l.filter(v=>v!==m):[...l,m]):u(m)};return o.jsx(i9,{value:{isChipSelected:d,onChange:p,multiple:i},children:s})}ZE.displayName="@mantine/core/ChipGroup";var ek={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 a9={type:"checkbox"},l9=(e,{size:t,radius:n,variant:r,color:i,autoContrast:s})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,variant:r||"filled",autoContrast:s});return{root:{"--chip-fz":In(t),"--chip-size":rt(t,"chip-size"),"--chip-radius":n===void 0?void 0:Ot(n),"--chip-checked-padding":rt(t,"chip-checked-padding"),"--chip-padding":rt(t,"chip-padding"),"--chip-icon-size":rt(t,"chip-icon-size"),"--chip-bg":i||r?l.background:void 0,"--chip-hover":i||r?l.hover:void 0,"--chip-color":i||r?l.color:void 0,"--chip-bd":i||r?l.border:void 0,"--chip-spacing":rt(t,"chip-spacing")}}},Zc=fe((e,t)=>{const n=ie("Chip",a9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,id:p,checked:h,defaultChecked:m,onChange:v,value:x,wrapperProps:b,type:w,disabled:j,children:P,size:T,variant:k,icon:C,rootRef:_,autoContrast:R,mod:M,...N}=n,L=Ne({name:"Chip",classes:ek,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:l9}),z=o9(),G=hr(p),{styleProps:q,rest:Y}=Po(N),[Q,ne]=Vn({value:h,defaultValue:m,finalValue:!1,onChange:v}),V=z?{checked:z.isChipSelected(x),onChange:A=>{z.onChange(A),v==null||v(A.currentTarget.checked)},type:z.multiple?"checkbox":"radio"}:{},O=V.checked||Q;return o.jsxs(se,{size:T,variant:k,ref:_,mod:M,...L("root"),...q,...b,children:[o.jsx("input",{type:w,...L("input"),checked:O,onChange:A=>ne(A.currentTarget.checked),id:G,disabled:j,ref:t,value:x,...V,...Y}),o.jsxs("label",{htmlFor:G,"data-checked":O||void 0,"data-disabled":j||void 0,...L("label",{variant:k||"filled"}),children:[O&&o.jsx("span",{...L("iconWrapper"),children:C||o.jsx(pp,{...L("checkIcon")})}),o.jsx("span",{children:P})]})]})});Zc.classes=ek;Zc.displayName="@mantine/core/Chip";Zc.Group=ZE;var tk={root:"m_b183c0a2"};const c9={},u9=(e,{color:t})=>({root:{"--code-bg":t?$t(t,e):void 0}}),bv=fe((e,t)=>{const n=ie("Code",c9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,color:p,block:h,variant:m,mod:v,...x}=n,b=Ne({name:"Code",props:n,classes:tk,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:u9});return o.jsx(se,{component:h?"pre":"code",variant:m,ref:t,mod:[{block:h},v],...b("root"),...x,dir:"ltr"})});bv.classes=tk;bv.displayName="@mantine/core/Code";var nk={root:"m_7485cace"};const d9={},f9=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:rt(t,"container-size")}}),wv=fe((e,t)=>{const n=ie("Container",d9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,fluid:p,mod:h,...m}=n,v=Ne({name:"Container",classes:nk,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:f9});return o.jsx(se,{ref:t,mod:[{fluid:p},h],...v("root"),...m})});wv.classes=nk;wv.displayName="@mantine/core/Container";const p9={timeout:1e3};function rk(e){const{children:t,timeout:n,value:r,...i}=ie("CopyButton",p9,e),s=iC({timeout:n}),l=()=>s.copy(r);return o.jsx(o.Fragment,{children:t({copy:l,copied:s.copied,...i})})}rk.displayName="@mantine/core/CopyButton";var ik={root:"m_3eebeb36",label:"m_9e365f20"};const h9={orientation:"horizontal"},m9=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?$t(t,e):void 0,"--divider-border-style":n,"--divider-size":rt(r,"divider-size")}}),_n=fe((e,t)=>{const n=ie("Divider",h9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,color:p,orientation:h,label:m,labelPosition:v,mod:x,...b}=n,w=Ne({name:"Divider",classes:ik,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:m9});return o.jsx(se,{ref:t,mod:[{orientation:h,"with-label":!!m},x],...w("root"),...b,role:"separator",children:m&&o.jsx(se,{component:"span",mod:{position:v},...w("label"),children:m})})});_n.classes=ik;_n.displayName="@mantine/core/Divider";function g9({open:e,close:t,openDelay:n,closeDelay:r}){const i=y.useRef(-1),s=y.useRef(-1),l=()=>{window.clearTimeout(i.current),window.clearTimeout(s.current)},u=()=>{l(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},d=()=>{l(),r===0||r===void 0?t():s.current=window.setTimeout(t,r)};return y.useEffect(()=>l,[]),{openDropdown:u,closeDropdown:d}}const[kw,ok]=pr("Grid component was not found in tree"),Fg=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,Tw=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Fg(e,t),Pw=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Rw=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function y9({span:e,order:t,offset:n,selector:r}){var x;const i=dn(),s=ok(),l=s.breakpoints||i.breakpoints,d=wi(e)===void 0?12:wi(e),p=gs({"--col-order":(x=wi(t))==null?void 0:x.toString(),"--col-flex-grow":Pw(d,s.grow),"--col-flex-basis":Fg(d,s.columns),"--col-width":d==="content"?"auto":void 0,"--col-max-width":Tw(d,s.columns,s.grow),"--col-offset":Rw(wi(n),s.columns)}),h=Qt(l).reduce((b,w)=>{var j;return b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=(j=t[w])==null?void 0:j.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=Pw(e[w],s.grow),b[w]["--col-flex-basis"]=Fg(e[w],s.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=Tw(e[w],s.columns,s.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=Rw(n[w],s.columns)),b},{}),v=Kc(Qt(h),l).filter(b=>Qt(h[b.value]).length>0).map(b=>({query:s.type==="container"?`mantine-grid (min-width: ${l[b.value]})`:`(min-width: ${l[b.value]})`,styles:h[b.value]}));return o.jsx(ba,{styles:p,media:s.type==="container"?void 0:v,container:s.type==="container"?v:void 0,selector:r})}var Sv={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const v9={span:12},jv=fe((e,t)=>{const n=ie("GridCol",v9,e),{classNames:r,className:i,style:s,styles:l,vars:u,span:d,order:p,offset:h,...m}=n,v=ok(),x=fu();return o.jsxs(o.Fragment,{children:[o.jsx(y9,{selector:`.${x}`,span:d,order:p,offset:h}),o.jsx(se,{ref:t,...v.getStyles("col",{className:Nt(i,x),style:s,classNames:r,styles:l}),...m})]})});jv.classes=Sv;jv.displayName="@mantine/core/GridCol";function _w({gutter:e,selector:t,breakpoints:n,type:r}){const i=dn(),s=n||i.breakpoints,l=gs({"--grid-gutter":Dn(wi(e))}),u=Qt(s).reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--grid-gutter"]=Dn(e[m])),h),{}),p=Kc(Qt(u),s).filter(h=>Qt(u[h.value]).length>0).map(h=>({query:r==="container"?`mantine-grid (min-width: ${s[h.value]})`:`(min-width: ${s[h.value]})`,styles:u[h.value]}));return o.jsx(ba,{styles:l,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const x9={gutter:"md",grow:!1,columns:12},b9=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),$r=fe((e,t)=>{const n=ie("Grid",x9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,grow:p,gutter:h,columns:m,align:v,justify:x,children:b,breakpoints:w,type:j,...P}=n,T=Ne({name:"Grid",classes:Sv,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:b9}),k=fu();return j==="container"&&w?o.jsxs(kw,{value:{getStyles:T,grow:p,columns:m||12,breakpoints:w,type:j},children:[o.jsx(_w,{selector:`.${k}`,...n}),o.jsx("div",{...T("container"),children:o.jsx(se,{ref:t,...T("root",{className:k}),...P,children:o.jsx("div",{...T("inner"),children:b})})})]}):o.jsxs(kw,{value:{getStyles:T,grow:p,columns:m||12,breakpoints:w,type:j},children:[o.jsx(_w,{selector:`.${k}`,...n}),o.jsx(se,{ref:t,...T("root",{className:k}),...P,children:o.jsx("div",{...T("inner"),children:b})})]})});$r.classes=Sv;$r.displayName="@mantine/core/Grid";$r.Col=jv;function kf(){return kf=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},kf.apply(null,arguments)}function Cv(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 w9=y.useLayoutEffect,S9=function(t){var n=xn.useRef(t);return w9(function(){n.current=t}),n},Dw=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},j9=function(t,n){var r=xn.useRef();return xn.useCallback(function(i){t.current=i,r.current&&Dw(r.current,null),r.current=n,n&&Dw(n,i)},[n])},Iw={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},C9=function(t){Object.keys(Iw).forEach(function(n){t.style.setProperty(n,Iw[n],"important")})},Aw=C9,lr=null,Nw=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function E9(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),lr||(lr=document.createElement("textarea"),lr.setAttribute("tabindex","-1"),lr.setAttribute("aria-hidden","true"),Aw(lr)),lr.parentNode===null&&document.body.appendChild(lr);var i=e.paddingSize,s=e.borderSize,l=e.sizingStyle,u=l.boxSizing;Object.keys(l).forEach(function(v){var x=v;lr.style[x]=l[x]}),Aw(lr),lr.value=t;var d=Nw(lr,e);lr.value=t,d=Nw(lr,e),lr.value="x";var p=lr.scrollHeight-i,h=p*n;u==="border-box"&&(h=h+i+s),d=Math.max(h,d);var m=p*r;return u==="border-box"&&(m=m+i+s),d=Math.min(m,d),[d,p]}var Mw=function(){},k9=function(t,n){return t.reduce(function(r,i){return r[i]=n[i],r},{})},T9=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],P9=!!document.documentElement.currentStyle,R9=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=k9(T9,n),i=r.boxSizing;if(i==="")return null;P9&&i==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),l=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:l}},_9=R9;function sk(e,t,n){var r=S9(n);y.useLayoutEffect(function(){var i=function(l){return r.current(l)};if(e)return e.addEventListener(t,i),function(){return e.removeEventListener(t,i)}},[])}var D9=function(t){sk(window,"resize",t)},I9=function(t){sk(document.fonts,"loadingdone",t)},A9=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],N9=function(t,n){var r=t.cacheMeasurements,i=t.maxRows,s=t.minRows,l=t.onChange,u=l===void 0?Mw:l,d=t.onHeightChange,p=d===void 0?Mw:d,h=Cv(t,A9),m=h.value!==void 0,v=y.useRef(null),x=j9(v,n),b=y.useRef(0),w=y.useRef(),j=function(){var k=v.current,C=r&&w.current?w.current:_9(k);if(C){w.current=C;var _=E9(C,k.value||k.placeholder||"x",s,i),R=_[0],M=_[1];b.current!==R&&(b.current=R,k.style.setProperty("height",R+"px","important"),p(R,{rowHeight:M}))}},P=function(k){m||j(),u(k)};return y.useLayoutEffect(j),D9(j),I9(j),y.createElement("textarea",kf({},h,{onChange:P,ref:x}))},M9=y.forwardRef(N9);const O9={},ja=fe((e,t)=>{const{autosize:n,maxRows:r,minRows:i,__staticSelector:s,resize:l,...u}=ie("Textarea",O9,e),d=n&&dC()!=="test",p=d?{maxRows:r,minRows:i}:{};return o.jsx(_r,{component:d?M9:"textarea",ref:t,...u,__staticSelector:s||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":l},...p})});ja.classes=_r.classes;ja.displayName="@mantine/core/Textarea";function Ow(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const L9={serialize:JSON.stringify,deserialize:JSON.parse},Wl=fe((e,t)=>{const{value:n,defaultValue:r,onChange:i,formatOnBlur:s,validationError:l,serialize:u,deserialize:d,onFocus:p,onBlur:h,readOnly:m,error:v,...x}=ie("JsonInput",L9,e),[b,w]=Vn({value:n,defaultValue:r,finalValue:"",onChange:i}),[j,P]=y.useState(Ow(b,d)),T=C=>{p==null||p(C),P(!0)},k=C=>{typeof h=="function"&&h(C);const _=Ow(C.currentTarget.value,d);s&&!m&&_&&C.currentTarget.value.trim()!==""&&w(u(d(C.currentTarget.value),null,2)),P(_)};return o.jsx(ja,{value:b,onChange:C=>w(C.currentTarget.value),onFocus:T,onBlur:k,ref:t,readOnly:m,...x,autoComplete:"off",__staticSelector:"JsonInput",error:j?v:l||!0,"data-monospace":!0})});Wl.classes=_r.classes;Wl.displayName="@mantine/core/JsonInput";const[$9,F9]=pr("List component was not found in tree");var Ev={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const z9={},kv=fe((e,t)=>{const n=ie("ListItem",z9,e),{classNames:r,className:i,style:s,styles:l,vars:u,icon:d,children:p,mod:h,...m}=n,v=F9(),x=d||v.icon,b={classNames:r,styles:l};return o.jsx(se,{...v.getStyles("item",{...b,className:i,style:s}),component:"li",mod:[{"with-icon":!!x,centered:v.center},h],ref:t,...m,children:o.jsxs("div",{...v.getStyles("itemWrapper",b),children:[x&&o.jsx("span",{...v.getStyles("itemIcon",b),children:x}),o.jsx("span",{...v.getStyles("itemLabel",b),children:p})]})})});kv.classes=Ev;kv.displayName="@mantine/core/ListItem";const B9={type:"unordered"},U9=(e,{size:t,spacing:n})=>({root:{"--list-fz":In(t),"--list-lh":nC(t),"--list-spacing":Dn(n)}}),dr=fe((e,t)=>{const n=ie("List",B9,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,children:p,type:h,withPadding:m,icon:v,spacing:x,center:b,listStyleType:w,mod:j,...P}=n,T=Ne({name:"List",classes:Ev,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:U9});return o.jsx($9,{value:{center:b,icon:v,getStyles:T},children:o.jsx(se,{...T("root",{style:{listStyleType:w}}),component:h==="unordered"?"ul":"ol",mod:[{"with-padding":m},j],ref:t,...P,children:p})})});dr.classes=Ev;dr.displayName="@mantine/core/List";dr.Item=kv;var ak={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const Lw={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Br("overlay")},V9=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),Tv=fe((e,t)=>{const n=ie("LoadingOverlay",Lw,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,transitionProps:p,loaderProps:h,overlayProps:m,visible:v,zIndex:x,...b}=n,w=dn(),j=Ne({name:"LoadingOverlay",classes:ak,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:V9}),P={...Lw.overlayProps,...m};return o.jsx(Xi,{transition:"fade",...p,mounted:!!v,children:T=>o.jsxs(se,{...j("root",{style:T}),ref:t,...b,children:[o.jsx(Pr,{...j("loader"),unstyled:u,...h}),o.jsx(El,{...P,...j("overlay"),darkHidden:!0,unstyled:u,color:(m==null?void 0:m.color)||w.white}),o.jsx(El,{...P,...j("overlay"),lightHidden:!0,unstyled:u,color:(m==null?void 0:m.color)||w.colors.dark[5]})]})})});Tv.classes=ak;Tv.displayName="@mantine/core/LoadingOverlay";const[W9,bu]=pr("Menu component was not found in the tree");var Hl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const H9={},Pv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,...u}=ie("MenuDivider",H9,e),d=bu();return o.jsx(se,{ref:t,...d.getStyles("divider",{className:r,style:i,styles:s,classNames:n}),...u})});Pv.classes=Hl;Pv.displayName="@mantine/core/MenuDivider";const q9={},Rv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,onMouseEnter:u,onMouseLeave:d,onKeyDown:p,children:h,...m}=ie("MenuDropdown",q9,e),v=y.useRef(null),x=bu(),b=Cr(p,P=>{var T,k;(P.key==="ArrowUp"||P.key==="ArrowDown")&&(P.preventDefault(),(k=(T=v.current)==null?void 0:T.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||k.focus())}),w=Cr(u,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.openDropdown()),j=Cr(d,()=>(x.trigger==="hover"||x.trigger==="click-hover")&&x.closeDropdown());return o.jsxs(Pi.Dropdown,{...m,onMouseEnter:w,onMouseLeave:j,role:"menu","aria-orientation":"vertical",ref:Nn(t,v),...x.getStyles("dropdown",{className:r,style:i,styles:s,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:b,children:[x.withInitialFocusPlaceholder&&o.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),h]})});Rv.classes=Hl;Rv.displayName="@mantine/core/MenuDropdown";const G9={},_v=ir((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,color:u,closeMenuOnClick:d,leftSection:p,rightSection:h,children:m,disabled:v,"data-disabled":x,...b}=ie("MenuItem",G9,e),w=bu(),j=dn(),{dir:P}=wa(),T=y.useRef(null),k=w.getItemIndex(T.current),C=b,_=Cr(C.onMouseLeave,()=>w.setHovered(-1)),R=Cr(C.onMouseEnter,()=>w.setHovered(w.getItemIndex(T.current))),M=Cr(C.onClick,()=>{x||(typeof d=="boolean"?d&&w.closeDropdownImmediately():w.closeOnItemClick&&w.closeDropdownImmediately())}),N=Cr(C.onFocus,()=>w.setHovered(w.getItemIndex(T.current))),L=u?j.variantColorResolver({color:u,theme:j,variant:"light"}):void 0,z=u?ei({color:u,theme:j}):null;return o.jsxs(Qn,{...b,unstyled:w.unstyled,tabIndex:w.menuItemTabIndex,onFocus:N,...w.getStyles("item",{className:r,style:i,styles:s,classNames:n}),ref:Nn(T,t),role:"menuitem",disabled:v,"data-menu-item":!0,"data-disabled":v||x||void 0,"data-hovered":w.hovered===k?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:R,onMouseLeave:_,onClick:M,onKeyDown:tC({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:w.loop,dir:P,orientation:"vertical",onKeyDown:C.onKeyDown}),__vars:{"--menu-item-color":z!=null&&z.isThemeColor&&(z==null?void 0:z.shade)===void 0?`var(--mantine-color-${z.color}-6)`:L==null?void 0:L.color,"--menu-item-hover":L==null?void 0:L.hover},children:[p&&o.jsx("div",{...w.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"left",children:p}),m&&o.jsx("div",{...w.getStyles("itemLabel",{styles:s,classNames:n}),children:m}),h&&o.jsx("div",{...w.getStyles("itemSection",{styles:s,classNames:n}),"data-position":"right",children:h})]})});_v.classes=Hl;_v.displayName="@mantine/core/MenuItem";const Q9={},Dv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,...u}=ie("MenuLabel",Q9,e),d=bu();return o.jsx(se,{ref:t,...d.getStyles("label",{className:r,style:i,styles:s,classNames:n}),...u})});Dv.classes=Hl;Dv.displayName="@mantine/core/MenuLabel";const K9={refProp:"ref"},lk=y.forwardRef((e,t)=>{const{children:n,refProp:r,...i}=ie("MenuTarget",K9,e);if(!Eo(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const s=bu(),l=n.props,u=Cr(l.onClick,()=>{s.trigger==="click"?s.toggleDropdown():s.trigger==="click-hover"&&(s.setOpenedViaClick(!0),s.opened||s.openDropdown())}),d=Cr(l.onMouseEnter,()=>(s.trigger==="hover"||s.trigger==="click-hover")&&s.openDropdown()),p=Cr(l.onMouseLeave,()=>{(s.trigger==="hover"||s.trigger==="click-hover"&&!s.openedViaClick)&&s.closeDropdown()});return o.jsx(Pi.Target,{refProp:r,popupType:"menu",ref:t,...i,children:y.cloneElement(n,{onClick:u,onMouseEnter:d,onMouseLeave:p,"data-expanded":s.opened?!0:void 0})})});lk.displayName="@mantine/core/MenuTarget";const Y9={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function ye(e){const t=ie("Menu",Y9,e),{children:n,onOpen:r,onClose:i,opened:s,defaultOpened:l,trapFocus:u,onChange:d,closeOnItemClick:p,loop:h,closeOnEscape:m,trigger:v,openDelay:x,closeDelay:b,classNames:w,styles:j,unstyled:P,variant:T,vars:k,menuItemTabIndex:C,keepMounted:_,withInitialFocusPlaceholder:R,...M}=t,N=Ne({name:"Menu",classes:Hl,props:t,classNames:w,styles:j,unstyled:P}),[L,{setHovered:z,resetHovered:G}]=yD(),[q,Y]=Vn({value:s,defaultValue:l,finalValue:!1,onChange:d}),[Q,ne]=y.useState(!1),V=()=>{Y(!1),ne(!1),q&&(i==null||i())},O=()=>{Y(!0),!q&&(r==null||r())},A=()=>{q?V():O()},{openDropdown:B,closeDropdown:I}=g9({open:O,close:V,closeDelay:b,openDelay:x}),F=je=>gD("[data-menu-item]","[data-menu-dropdown]",je),{resolvedClassNames:Z,resolvedStyles:ae}=va({classNames:w,styles:j,props:t});return vo(()=>{G()},[q]),o.jsx(W9,{value:{getStyles:N,opened:q,toggleDropdown:A,getItemIndex:F,hovered:L,setHovered:z,openedViaClick:Q,setOpenedViaClick:ne,closeOnItemClick:p,closeDropdown:v==="click"?V:I,openDropdown:v==="click"?O:B,closeDropdownImmediately:V,loop:h,trigger:v,unstyled:P,menuItemTabIndex:C,withInitialFocusPlaceholder:R},children:o.jsx(Pi,{...M,opened:q,onChange:A,defaultOpened:l,trapFocus:_?!1:u,closeOnEscape:m,__staticSelector:"Menu",classNames:Z,styles:ae,unstyled:P,variant:T,keepMounted:_,children:n})})}ye.extend=e=>e;ye.classes=Hl;ye.displayName="@mantine/core/Menu";ye.Item=_v;ye.Label=Dv;ye.Dropdown=Rv;ye.Target=lk;ye.Divider=Pv;const[X9,ql]=pr("Modal component was not found in tree");var _o={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const J9={},mp=fe((e,t)=>{const n=ie("ModalBody",J9,e),{classNames:r,className:i,style:s,styles:l,vars:u,...d}=n,p=ql();return o.jsx(vE,{ref:t,...p.getStyles("body",{classNames:r,style:s,styles:l,className:i}),...d})});mp.classes=_o;mp.displayName="@mantine/core/ModalBody";const Z9={},gp=fe((e,t)=>{const n=ie("ModalCloseButton",Z9,e),{classNames:r,className:i,style:s,styles:l,vars:u,...d}=n,p=ql();return o.jsx(xE,{ref:t,...p.getStyles("close",{classNames:r,style:s,styles:l,className:i}),...d})});gp.classes=_o;gp.displayName="@mantine/core/ModalCloseButton";const eM={},yp=fe((e,t)=>{const n=ie("ModalContent",eM,e),{classNames:r,className:i,style:s,styles:l,vars:u,children:d,__hidden:p,...h}=n,m=ql(),v=m.scrollAreaComponent||p4;return o.jsx(bE,{...m.getStyles("content",{className:i,style:s,styles:l,classNames:r}),innerProps:m.getStyles("inner",{className:i,style:s,styles:l,classNames:r}),"data-full-screen":m.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...h,children:o.jsx(v,{style:{maxHeight:m.fullScreen?"100dvh":`calc(100dvh - (${oe(m.yOffset)} * 2))`},children:d})})});yp.classes=_o;yp.displayName="@mantine/core/ModalContent";const tM={},vp=fe((e,t)=>{const n=ie("ModalHeader",tM,e),{classNames:r,className:i,style:s,styles:l,vars:u,...d}=n,p=ql();return o.jsx(wE,{ref:t,...p.getStyles("header",{classNames:r,style:s,styles:l,className:i}),...d})});vp.classes=_o;vp.displayName="@mantine/core/ModalHeader";const nM={},xp=fe((e,t)=>{const n=ie("ModalOverlay",nM,e),{classNames:r,className:i,style:s,styles:l,vars:u,...d}=n,p=ql();return o.jsx(SE,{ref:t,...p.getStyles("overlay",{classNames:r,style:s,styles:l,className:i}),...d})});xp.classes=_o;xp.displayName="@mantine/core/ModalOverlay";const rM={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Br("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},iM=(e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Ot(t),"--modal-size":rt(n,"modal-size"),"--modal-y-offset":oe(r),"--modal-x-offset":oe(i)}}),bp=fe((e,t)=>{const n=ie("ModalRoot",rM,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,yOffset:p,scrollAreaComponent:h,radius:m,fullScreen:v,centered:x,xOffset:b,__staticSelector:w,...j}=n,P=Ne({name:w,classes:_o,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:iM});return o.jsx(X9,{value:{yOffset:p,scrollAreaComponent:h,getStyles:P,fullScreen:v},children:o.jsx(yE,{ref:t,...P("root"),"data-full-screen":v||void 0,"data-centered":x||void 0,unstyled:u,...j})})});bp.classes=_o;bp.displayName="@mantine/core/ModalRoot";const[oM,sM]=ko();function ck({children:e}){const[t,n]=y.useState([]),[r,i]=y.useState(Br("modal"));return o.jsx(oM,{value:{stack:t,addModal:(s,l)=>{n(u=>[...new Set([...u,s])]),i(u=>typeof l=="number"&&typeof u=="number"?Math.max(u,l):u)},removeModal:s=>n(l=>l.filter(u=>u!==s)),getZIndex:s=>`calc(${r} + ${t.indexOf(s)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}ck.displayName="@mantine/core/ModalStack";const aM={},wp=fe((e,t)=>{const n=ie("ModalTitle",aM,e),{classNames:r,className:i,style:s,styles:l,vars:u,...d}=n,p=ql();return o.jsx(jE,{ref:t,...p.getStyles("title",{classNames:r,style:s,styles:l,className:i}),...d})});wp.classes=_o;wp.displayName="@mantine/core/ModalTitle";const lM={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Br("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Mn=fe((e,t)=>{const{title:n,withOverlay:r,overlayProps:i,withCloseButton:s,closeButtonProps:l,children:u,radius:d,opened:p,stackId:h,zIndex:m,...v}=ie("Modal",lM,e),x=sM(),b=!!n||s,w=x&&h?{closeOnEscape:x.currentId===h,trapFocus:x.currentId===h,zIndex:x.getZIndex(h)}:{},j=r===!1?!1:h&&x?x.currentId===h:p;return y.useEffect(()=>{x&&h&&(p?x.addModal(h,m||Br("modal")):x.removeModal(h))},[p,h,m]),o.jsxs(bp,{ref:t,radius:d,opened:p,zIndex:x&&h?x.getZIndex(h):m,...v,...w,children:[r&&o.jsx(xp,{visible:j,transitionProps:x&&h?{duration:0}:void 0,...i}),o.jsxs(yp,{radius:d,__hidden:x&&h&&p?h!==x.currentId:!1,children:[b&&o.jsxs(vp,{children:[n&&o.jsx(wp,{children:n}),s&&o.jsx(gp,{...l})]}),o.jsx(mp,{children:u})]})]})});Mn.classes=_o;Mn.displayName="@mantine/core/Modal";Mn.Root=bp;Mn.Overlay=xp;Mn.Content=yp;Mn.Body=mp;Mn.Header=vp;Mn.Title=wp;Mn.CloseButton=gp;Mn.Stack=ck;const[cM,Iv]=ko(),[uM,dM]=ko();var Sp={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const fM={},pM=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?rt(t):rt(n,"pg-gap")}}),Av=fe((e,t)=>{const n=ie("PillGroup",fM,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,size:p,disabled:h,...m}=n,v=Iv(),x=(v==null?void 0:v.size)||p||void 0,b=Ne({name:"PillGroup",classes:Sp,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:pM,stylesCtx:{size:x},rootSelector:"group"});return o.jsx(uM,{value:{size:x,disabled:h},children:o.jsx(se,{ref:t,size:x,...b("group"),...m})})});Av.classes=Sp;Av.displayName="@mantine/core/PillGroup";const hM={variant:"default"},mM=(e,{radius:t},{size:n})=>({root:{"--pill-fz":rt(n,"pill-fz"),"--pill-height":rt(n,"pill-height"),"--pill-radius":t===void 0?void 0:Ot(t)}}),ca=fe((e,t)=>{const n=ie("Pill",hM,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,variant:p,children:h,withRemoveButton:m,onRemove:v,removeButtonProps:x,radius:b,size:w,disabled:j,mod:P,...T}=n,k=dM(),C=Iv(),_=w||(k==null?void 0:k.size)||void 0,R=(C==null?void 0:C.variant)==="filled"?"contrast":p||"default",M=Ne({name:"Pill",classes:Sp,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:mM,stylesCtx:{size:_}});return o.jsxs(se,{component:"span",ref:t,variant:R,size:_,...M("root",{variant:R}),mod:[{"with-remove":m&&!j,disabled:j||(k==null?void 0:k.disabled)},P],...T,children:[o.jsx("span",{...M("label"),children:h}),m&&o.jsx(Sa,{variant:"transparent",radius:b,tabIndex:-1,"aria-hidden":!0,unstyled:u,...x,...M("remove",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),onMouseDown:N=>{var L;N.preventDefault(),N.stopPropagation(),(L=x==null?void 0:x.onMouseDown)==null||L.call(x,N)},onClick:N=>{var L;N.stopPropagation(),v==null||v(),(L=x==null?void 0:x.onClick)==null||L.call(x,N)}})]})});ca.classes=Sp;ca.displayName="@mantine/core/Pill";ca.Group=Av;var uk={field:"m_45c4369d"};const gM={type:"visible"},Nv=fe((e,t)=>{const n=ie("PillsInputField",gM,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,type:p,disabled:h,id:m,pointer:v,mod:x,...b}=n,w=Iv(),j=Bl(),P=Ne({name:"PillsInputField",classes:uk,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"field"}),T=h||(w==null?void 0:w.disabled);return o.jsx(se,{component:"input",ref:Nn(t,w==null?void 0:w.fieldRef),"data-type":p,disabled:T,mod:[{disabled:T,pointer:v},x],...P("field"),...b,id:(j==null?void 0:j.inputId)||m,"aria-invalid":w==null?void 0:w.hasError,"aria-describedby":j==null?void 0:j.describedBy,type:"text",onMouseDown:k=>!v&&k.stopPropagation()})});Nv.classes=uk;Nv.displayName="@mantine/core/PillsInputField";const yM={},Pl=fe((e,t)=>{const n=ie("PillsInput",yM,e),{children:r,onMouseDown:i,onClick:s,size:l,disabled:u,__staticSelector:d,error:p,variant:h,...m}=n,v=y.useRef(null);return o.jsx(cM,{value:{fieldRef:v,size:l,disabled:u,hasError:!!p,variant:h},children:o.jsx(_r,{size:l,error:p,variant:h,component:"div",ref:t,onMouseDown:x=>{var b;x.preventDefault(),i==null||i(x),(b=v.current)==null||b.focus()},onClick:x=>{var b;x.preventDefault(),s==null||s(x),(b=v.current)==null||b.focus()},...m,multiline:!0,disabled:u,__staticSelector:d||"PillsInput",withAria:!1,children:r})})});Pl.displayName="@mantine/core/PillsInput";Pl.Field=Nv;function vM({data:e,value:t}){const n=t.map(i=>i.trim().toLowerCase());return e.reduce((i,s)=>(Tl(s)?i.push({group:s.group,items:s.items.filter(l=>n.indexOf(l.value.toLowerCase().trim())===-1)}):n.indexOf(s.value.toLowerCase().trim())===-1&&i.push(s),i),[])}const xM={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},wu=fe((e,t)=>{const n=ie("MultiSelect",xM,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,size:p,value:h,defaultValue:m,onChange:v,onKeyDown:x,variant:b,data:w,dropdownOpened:j,defaultDropdownOpened:P,onDropdownOpen:T,onDropdownClose:k,selectFirstOptionOnChange:C,onOptionSubmit:_,comboboxProps:R,filter:M,limit:N,withScrollArea:L,maxDropdownHeight:z,searchValue:G,defaultSearchValue:q,onSearchChange:Y,readOnly:Q,disabled:ne,onFocus:V,onBlur:O,onPaste:A,radius:B,rightSection:I,rightSectionWidth:F,rightSectionPointerEvents:Z,rightSectionProps:ae,leftSection:je,leftSectionWidth:me,leftSectionPointerEvents:xe,leftSectionProps:Te,inputContainer:le,inputWrapperOrder:et,withAsterisk:ht,labelProps:ct,descriptionProps:St,errorProps:Et,wrapperProps:Tt,description:vt,label:_t,error:we,maxValues:Re,searchable:ke,nothingFoundMessage:_e,withCheckIcon:ce,checkIconPosition:ve,hidePickedOptions:Me,withErrorStyles:ue,name:Ue,form:bt,id:jt,clearable:Dt,clearButtonProps:mn,hiddenInputProps:ft,placeholder:wn,hiddenInputValuesDivider:Yn,required:Ji,mod:Ts,renderOption:Ia,onRemove:or,onClear:Di,scrollAreaProps:Ii,chevronColor:Oo,...Ai}=n,mr=hr(jt),Ur=DE(w),Vr=IE(Ur),Wn=vu({opened:j,defaultOpened:P,onDropdownOpen:T,onDropdownClose:()=>{k==null||k(),Wn.resetSelectedOption()}}),{styleProps:Ps,rest:{type:Lo,autoComplete:Zi,...Rs}}=Po(Ai),[Tn,U]=Vn({value:h,defaultValue:m,finalValue:[],onChange:v}),[K,ee]=Vn({value:G,defaultValue:q,finalValue:"",onChange:Y}),de=Ne({name:"MultiSelect",classes:{},props:n,classNames:r,styles:l,unstyled:u}),{resolvedClassNames:De,resolvedStyles:Qe}=va({props:n,styles:l,classNames:r}),st=Ve=>{x==null||x(Ve),Ve.key===" "&&!ke&&(Ve.preventDefault(),Wn.toggleDropdown()),Ve.key==="Backspace"&&K.length===0&&Tn.length>0&&(or==null||or(Tn[Tn.length-1]),U(Tn.slice(0,Tn.length-1)))},$e=Tn.map((Ve,mt)=>{var gn,Lt;return o.jsx(ca,{withRemoveButton:!Q&&!((gn=Vr[Ve])!=null&&gn.disabled),onRemove:()=>{U(Tn.filter(Ct=>Ve!==Ct)),or==null||or(Ve)},unstyled:u,disabled:ne,...de("pill"),children:((Lt=Vr[Ve])==null?void 0:Lt.label)||Ve},`${Ve}-${mt}`)});y.useEffect(()=>{C&&Wn.selectFirstOption()},[C,Tn]);const We=o.jsx(lt.ClearButton,{...mn,onClear:()=>{Di==null||Di(),U([]),ee("")}}),Fe=vM({data:Ur,value:Tn}),Je=Dt&&Tn.length>0&&!ne&&!Q;return o.jsxs(o.Fragment,{children:[o.jsxs(lt,{store:Wn,classNames:De,styles:Qe,unstyled:u,size:p,readOnly:Q,__staticSelector:"MultiSelect",onOptionSubmit:Ve=>{_==null||_(Ve),ee(""),Wn.updateSelectedOptionIndex("selected"),Tn.includes(Vr[Ve].value)?(U(Tn.filter(mt=>mt!==Vr[Ve].value)),or==null||or(Vr[Ve].value)):Tn.length<Re&&U([...Tn,Vr[Ve].value])},...R,children:[o.jsx(lt.DropdownTarget,{children:o.jsx(Pl,{...Ps,__staticSelector:"MultiSelect",classNames:De,styles:Qe,unstyled:u,size:p,className:i,style:s,variant:b,disabled:ne,radius:B,__defaultRightSection:o.jsx(lt.Chevron,{size:p,error:we,unstyled:u,color:Oo}),__clearSection:We,__clearable:Je,rightSection:I,rightSectionPointerEvents:Z||(We?"all":"none"),rightSectionWidth:F,rightSectionProps:ae,leftSection:je,leftSectionWidth:me,leftSectionPointerEvents:xe,leftSectionProps:Te,inputContainer:le,inputWrapperOrder:et,withAsterisk:ht,labelProps:ct,descriptionProps:St,errorProps:Et,wrapperProps:Tt,description:vt,label:_t,error:we,multiline:!0,withErrorStyles:ue,__stylesApiProps:{...n,rightSectionPointerEvents:Z||(Je?"all":"none"),multiline:!0},pointer:!ke,onClick:()=>ke?Wn.openDropdown():Wn.toggleDropdown(),"data-expanded":Wn.dropdownOpened||void 0,id:mr,required:Ji,mod:Ts,children:o.jsxs(ca.Group,{disabled:ne,unstyled:u,...de("pillsList"),children:[$e,o.jsx(lt.EventsTarget,{autoComplete:Zi,children:o.jsx(Pl.Field,{...Rs,ref:t,id:mr,placeholder:wn,type:!ke&&!wn?"hidden":"visible",...de("inputField"),unstyled:u,onFocus:Ve=>{V==null||V(Ve),ke&&Wn.openDropdown()},onBlur:Ve=>{O==null||O(Ve),Wn.closeDropdown(),ee("")},onKeyDown:st,value:K,onChange:Ve=>{ee(Ve.currentTarget.value),ke&&Wn.openDropdown(),C&&Wn.selectFirstOption()},disabled:ne,readOnly:Q||!ke,pointer:!ke})})]})})}),o.jsx(O3,{data:Me?Fe:Ur,hidden:Q||ne,filter:M,search:K,limit:N,hiddenWhenEmpty:!_e,withScrollArea:L,maxDropdownHeight:z,filterOptions:ke,value:Tn,checkIconPosition:ve,withCheckIcon:ce,nothingFoundMessage:_e,unstyled:u,labelId:_t?`${mr}-label`:void 0,"aria-label":_t?void 0:Ai["aria-label"],renderOption:Ia,scrollAreaProps:Ii})]}),o.jsx(lt.HiddenInput,{name:Ue,valuesDivider:Yn,value:Tn,form:bt,disabled:ne,...ft})]})});wu.classes={..._r.classes,...lt.classes};wu.displayName="@mantine/core/MultiSelect";function bM(e){return"group"in e}function Mv({data:e}){if(bM(e)){const i=e.items.map(s=>o.jsx(Mv,{data:s},s.value));return o.jsx("optgroup",{label:e.group,children:i})}const{value:t,label:n,...r}=e;return o.jsx("option",{value:e.value,...r,children:e.label},e.value)}Mv.displayName="@mantine/core/NativeSelectOption";const wM={rightSectionPointerEvents:"none"},en=fe((e,t)=>{const{data:n,children:r,size:i,error:s,rightSection:l,unstyled:u,...d}=ie("NativeSelect",wM,e),p=DE(n).map((h,m)=>o.jsx(Mv,{data:h},m));return o.jsx(_r,{component:"select",ref:t,...d,__staticSelector:"NativeSelect",size:i,pointer:!0,error:s,unstyled:u,rightSection:l||o.jsx(dp,{size:i,error:s,unstyled:u}),children:r||p})});en.classes=_r.classes;en.displayName="@mantine/core/NativeSelect";var dk={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const SM={withCloseButton:!0},jM=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Ot(t),"--notification-color":n?$t(n,e):void 0}}),Ov=fe((e,t)=>{const n=ie("Notification",SM,e),{className:r,color:i,radius:s,loading:l,withCloseButton:u,withBorder:d,title:p,icon:h,children:m,onClose:v,closeButtonProps:x,classNames:b,style:w,styles:j,unstyled:P,variant:T,vars:k,mod:C,..._}=n,R=Ne({name:"Notification",classes:dk,props:n,className:r,style:w,classNames:b,styles:j,unstyled:P,vars:k,varsResolver:jM});return o.jsxs(se,{...R("root"),mod:[{"data-with-icon":!!h||l,"data-with-border":d},C],ref:t,variant:T,..._,role:"alert",children:[h&&!l&&o.jsx("div",{...R("icon"),children:h}),l&&o.jsx(Pr,{size:28,color:i,...R("loader")}),o.jsxs("div",{...R("body"),children:[p&&o.jsx("div",{...R("title"),children:p}),o.jsx(se,{...R("description"),mod:{"data-with-title":!!p},children:m})]}),u&&o.jsx(Sa,{iconSize:16,color:"gray",...x,unstyled:P,onClick:v,...R("closeButton")})]})});Ov.classes=dk;Ov.displayName="@mantine/core/Notification";function fk(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var eu;(function(e){e.event="event",e.props="prop"})(eu||(eu={}));function cs(){}function CM(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(s,l){return s===t[l]})||(t=r,n=e.apply(void 0,r)),n}}function tu(e){return!!(e||"").match(/\d/)}function xl(e){return e==null}function EM(e){return typeof e=="number"&&isNaN(e)}function pk(e){return xl(e)||EM(e)||typeof e=="number"&&!isFinite(e)}function hk(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function kM(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 TM(e,t,n){var r=kM(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function PM(e){var t=y.useRef(e);t.current=e;var n=y.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function Lv(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),s=i[0],l=i[1]||"";return{beforeDecimal:s,afterDecimal:l,hasNegation:n,addNegation:r}}function RM(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function mk(e,t,n){for(var r="",i=n?"0":"",s=0;s<=t-1;s++)r+=e[s]||i;return r}function $w(e,t){return Array(t+1).join(e)}function gk(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],s=r[1];if(s=Number(s),!s)return n+i;i=i.replace(".","");var l=1+s,u=i.length;return l<0?i="0."+$w("0",Math.abs(l))+i:l>=u?i=i+$w("0",l-u):i=(i.substring(0,l)||"0")+"."+i.substring(l),n+i}function Fw(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=Lv(e),s=i.beforeDecimal,l=i.afterDecimal,u=i.hasNegation,d=parseFloat("0."+(l||"0")),p=l.length<=t?"0."+l:d.toFixed(t),h=p.split("."),m=s;s&&Number(h[0])&&(m=s.split("").reverse().reduce(function(w,j,P){return w.length>P?(Number(w[0])+Number(j)).toString()+w.substring(1,w.length):j+w},h[0]));var v=mk(h[1]||"",t,n),x=u?"-":"",b=r?".":"";return""+x+m+b+v}function Ys(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 yk=CM(function(e,t){for(var n=0,r=0,i=e.length,s=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[s-1-r]&&s-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:s-r}}}),_M=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function DM(e,t,n){return Math.min(Math.max(e,t),n)}function rg(e){return Math.max(e.selectionStart,e.selectionEnd)}function IM(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function AM(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function NM(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function MM(e,t,n,r,i,s,l){l===void 0&&(l=NM);var u=i.findIndex(function(C){return C}),d=e.slice(0,u);!t&&!n.startsWith(d)&&(t=d,n=d+n,r=r+d.length);for(var p=n.length,h=e.length,m={},v=new Array(p),x=0;x<p;x++){v[x]=-1;for(var b=0,w=h;b<w;b++){var j=l({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:x,formattedValueIndex:b});if(j&&m[b]!==!0){v[x]=b,m[b]=!0;break}}}for(var P=r;P<p&&(v[P]===-1||!s(n[P]));)P++;var T=P===p||v[P]===-1?h:v[P];for(P=r-1;P>0&&v[P]===-1;)P--;var k=P===-1||v[P]===-1?0:v[P]+1;return k>T?T:r-k<T-r?k:T}function zw(e,t,n,r){var i=e.length;if(t=DM(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function OM(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(tu(e[n])||tu(e[n-1]));return t}function vk(e,t,n,r,i,s){s===void 0&&(s=cs);var l=PM(function(b,w){var j,P;return pk(b)?(P="",j=""):typeof b=="number"||w?(P=typeof b=="number"?gk(b):b,j=r(P)):(P=i(b,void 0),j=r(P)),{formattedValue:j,numAsString:P}}),u=y.useState(function(){return l(xl(e)?t:e,n)}),d=u[0],p=u[1],h=function(b,w){b.formattedValue!==d.formattedValue&&p({formattedValue:b.formattedValue,numAsString:b.value}),s(b,w)},m=e,v=n;xl(e)&&(m=d.numAsString,v=!0);var x=l(m,v);return y.useMemo(function(){p(x)},[x.formattedValue]),[d,h]}function LM(e){return e.replace(/[^0-9]/g,"")}function $M(e){return e}function FM(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,s=e.getInputRef,l=e.format;l===void 0&&(l=$M);var u=e.removeFormatting;u===void 0&&(u=LM);var d=e.defaultValue,p=e.valueIsNumericString,h=e.onValueChange,m=e.isAllowed,v=e.onChange;v===void 0&&(v=cs);var x=e.onKeyDown;x===void 0&&(x=cs);var b=e.onMouseUp;b===void 0&&(b=cs);var w=e.onFocus;w===void 0&&(w=cs);var j=e.onBlur;j===void 0&&(j=cs);var P=e.value,T=e.getCaretBoundary;T===void 0&&(T=OM);var k=e.isValidInputCharacter;k===void 0&&(k=tu);var C=e.isCharacterSame,_=fk(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),R=vk(P,d,!!p,l,u,h),M=R[0],N=M.formattedValue,L=M.numAsString,z=R[1],G=y.useRef(),q=y.useRef({formattedValue:N,numAsString:L}),Y=function(we,Re){q.current={formattedValue:we.formattedValue,numAsString:we.value},z(we,Re)},Q=y.useState(!1),ne=Q[0],V=Q[1],O=y.useRef(null),A=y.useRef({setCaretTimeout:null,focusTimeout:null});y.useEffect(function(){return V(!0),function(){clearTimeout(A.current.setCaretTimeout),clearTimeout(A.current.focusTimeout)}},[]);var B=l,I=function(we,Re){var ke=parseFloat(Re);return{formattedValue:we,value:Re,floatValue:isNaN(ke)?void 0:ke}},F=function(we,Re,ke){we.selectionStart===0&&we.selectionEnd===we.value.length||(Ys(we,Re),A.current.setCaretTimeout=setTimeout(function(){we.value===ke&&we.selectionStart!==Re&&Ys(we,Re)},0))},Z=function(we,Re,ke){return zw(we,Re,T(we),ke)},ae=function(we,Re,ke){var _e=T(Re),ce=MM(Re,N,we,ke,_e,k,C);return ce=zw(Re,ce,_e),ce},je=function(we){var Re=we.formattedValue;Re===void 0&&(Re="");var ke=we.input,_e=we.source,ce=we.event,ve=we.numAsString,Me;if(ke){var ue=we.inputValue||ke.value,Ue=rg(ke);ke.value=Re,Me=ae(ue,Re,Ue),Me!==void 0&&F(ke,Me,Re)}Re!==N&&Y(I(Re,ve),{event:ce,source:_e})};y.useEffect(function(){var we=q.current,Re=we.formattedValue,ke=we.numAsString;(N!==Re||L!==ke)&&Y(I(N,L),{event:void 0,source:eu.props})},[N,L]);var me=O.current?rg(O.current):void 0,xe=typeof window<"u"?y.useLayoutEffect:y.useEffect;xe(function(){var we=O.current;if(N!==q.current.formattedValue&&we){var Re=ae(q.current.formattedValue,N,me);we.value=N,F(we,Re,N)}},[N]);var Te=function(we,Re,ke){var _e=Re.target,ce=G.current?_M(G.current,_e.selectionEnd):yk(N,we),ve=Object.assign(Object.assign({},ce),{lastValue:N}),Me=u(we,ve),ue=B(Me);if(Me=u(ue,void 0),m&&!m(I(ue,Me))){var Ue=Re.target,bt=rg(Ue),jt=ae(we,N,bt);return Ue.value=N,F(Ue,jt,N),!1}return je({formattedValue:ue,numAsString:Me,inputValue:we,event:Re,source:ke,input:Re.target}),!0},le=function(we,Re){Re===void 0&&(Re=0);var ke=we.selectionStart,_e=we.selectionEnd;G.current={selectionStart:ke,selectionEnd:_e+Re}},et=function(we){var Re=we.target,ke=Re.value,_e=Te(ke,we,eu.event);_e&&v(we),G.current=void 0},ht=function(we){var Re=we.target,ke=we.key,_e=Re.selectionStart,ce=Re.selectionEnd,ve=Re.value;ve===void 0&&(ve="");var Me;ke==="ArrowLeft"||ke==="Backspace"?Me=Math.max(_e-1,0):ke==="ArrowRight"?Me=Math.min(_e+1,ve.length):ke==="Delete"&&(Me=_e);var ue=0;ke==="Delete"&&_e===ce&&(ue=1);var Ue=ke==="ArrowLeft"||ke==="ArrowRight";if(Me===void 0||_e!==ce&&!Ue){x(we),le(Re,ue);return}var bt=Me;if(Ue){var jt=ke==="ArrowLeft"?"left":"right";bt=Z(ve,Me,jt),bt!==Me&&we.preventDefault()}else ke==="Delete"&&!k(ve[Me])?bt=Z(ve,Me,"right"):ke==="Backspace"&&!k(ve[Me])&&(bt=Z(ve,Me,"left"));bt!==Me&&F(Re,bt,ve),x(we),le(Re,ue)},ct=function(we){var Re=we.target,ke=function(){var _e=Re.selectionStart,ce=Re.selectionEnd,ve=Re.value;if(ve===void 0&&(ve=""),_e===ce){var Me=Z(ve,_e);Me!==_e&&F(Re,Me,ve)}};ke(),requestAnimationFrame(function(){ke()}),b(we),le(Re)},St=function(we){we.persist&&we.persist();var Re=we.target,ke=we.currentTarget;O.current=Re,A.current.focusTimeout=setTimeout(function(){var _e=Re.selectionStart,ce=Re.selectionEnd,ve=Re.value;ve===void 0&&(ve="");var Me=Z(ve,_e);Me!==_e&&!(_e===0&&ce===ve.length)&&F(Re,Me,ve),w(Object.assign(Object.assign({},we),{currentTarget:ke}))},0)},Et=function(we){O.current=null,clearTimeout(A.current.focusTimeout),clearTimeout(A.current.setCaretTimeout),j(we)},Tt=ne&&IM()?"numeric":void 0,vt=Object.assign({inputMode:Tt},_,{type:t,value:N,onChange:et,onKeyDown:ht,onMouseUp:ct,onFocus:St,onBlur:Et});if(n==="text")return i?xn.createElement(xn.Fragment,null,i(N,_)||null):xn.createElement("span",Object.assign({},_,{ref:s}),N);if(r){var _t=r;return xn.createElement(_t,Object.assign({},vt,{ref:s}))}return xn.createElement("input",Object.assign({},vt,{ref:s}))}function Bw(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var s=t.suffix;s===void 0&&(s="");var l=t.allowNegative,u=t.thousandsGroupStyle;if(u===void 0&&(u="thousand"),e===""||e==="-")return e;var d=jp(t),p=d.thousandSeparator,h=d.decimalSeparator,m=n!==0&&e.indexOf(".")!==-1||n&&r,v=Lv(e,l),x=v.beforeDecimal,b=v.afterDecimal,w=v.addNegation;return n!==void 0&&(b=mk(b,n,!!r)),p&&(x=TM(x,p,u)),i&&(x=i+x),s&&(b=b+s),w&&(x="-"+x),e=x+(m&&h||"")+b,e}function jp(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 zM(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),s=r.test(e);return e=e.replace(/-/g,""),i&&!s&&t&&(e="-"+e),e}function BM(e,t){return new RegExp("(^-)|[0-9]|"+hk(e),"g")}function UM(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function VM(e,t,n){var r;t===void 0&&(t=AM(e));var i=n.allowNegative,s=n.prefix;s===void 0&&(s="");var l=n.suffix;l===void 0&&(l="");var u=n.decimalScale,d=t.from,p=t.to,h=p.start,m=p.end,v=jp(n),x=v.allowedDecimalSeparators,b=v.decimalSeparator,w=e[m]===b;if(tu(e)&&(e===s||e===l)&&t.lastValue==="")return e;if(m-h===1&&x.indexOf(e[h])!==-1){var j=u===0?"":b;e=e.substring(0,h)+j+e.substring(h+1,e.length)}var P=function(O,A,B){var I=!1,F=!1;s.startsWith("-")?I=!1:O.startsWith("--")?(I=!1,F=!0):l.startsWith("-")&&O.length===l.length?I=!1:O[0]==="-"&&(I=!0);var Z=I?1:0;return F&&(Z=2),Z&&(O=O.substring(Z),A-=Z,B-=Z),{value:O,start:A,end:B,hasNegation:I}},T=P(e,h,m),k=T.hasNegation;r=T,e=r.value,h=r.start,m=r.end;var C=P(t.lastValue,d.start,d.end),_=C.start,R=C.end,M=C.value,N=e.substring(h,m);e.length&&M.length&&(_>M.length-l.length||R<s.length)&&!(N&&l.startsWith(N))&&(e=M);var L=0;e.startsWith(s)?L+=s.length:h<s.length&&(L=h),e=e.substring(L),m-=L;var z=e.length,G=e.length-l.length;e.endsWith(l)?z=G:(m>G||m>e.length-l.length)&&(z=m),e=e.substring(0,z),e=zM(k?"-"+e:e,i),e=(e.match(BM(b))||[]).join("");var q=e.indexOf(b);e=e.replace(new RegExp(hk(b),"g"),function(O,A){return A===q?".":""});var Y=Lv(e,i),Q=Y.beforeDecimal,ne=Y.afterDecimal,V=Y.addNegation;return p.end-p.start<d.end-d.start&&Q===""&&w&&!parseFloat(ne)&&(e=V?"-":""),e}function WM(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),s=e[0]==="-";i.fill(!1,0,n.length+(s?1:0));var l=e.length;return i.fill(!1,l-r.length+1,l+1),i}function HM(e){var t=jp(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var s=e.allowNegative;if(s===void 0&&(s=!0),n===r)throw new Error(`
84
- Decimal separator can't be same as thousand separator.
85
- thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
86
- decimalSeparator: `+r+` (default value for decimalSeparator is .)
87
- `);return i.startsWith("-")&&s&&(console.error(`
88
- Prefix can't start with '-' when allowNegative is true.
89
- prefix: `+i+`
90
- allowNegative: `+s+`
91
- `),s=!1),Object.assign(Object.assign({},e),{allowNegative:s})}function qM(e){e=HM(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=cs);var s=e.onBlur;s===void 0&&(s=cs);var l=e.thousandSeparator,u=e.decimalScale,d=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var h=e.defaultValue,m=e.value,v=e.valueIsNumericString,x=e.onValueChange,b=fk(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),w=jp(e),j=w.decimalSeparator,P=w.allowedDecimalSeparators,T=function(V){return Bw(V,e)},k=function(V,O){return VM(V,O,e)},C=xl(m)?h:m,_=v??UM(C,p,t);xl(m)?xl(h)||(_=_||typeof h=="number"):_=_||typeof m=="number";var R=function(V){return pk(V)?V:(typeof V=="number"&&(V=gk(V)),_&&typeof u=="number"?Fw(V,u,!!d):V)},M=vk(R(m),R(h),!!_,T,k,x),N=M[0],L=N.numAsString,z=N.formattedValue,G=M[1],q=function(V){var O=V.target,A=V.key,B=O.selectionStart,I=O.selectionEnd,F=O.value;if(F===void 0&&(F=""),(A==="Backspace"||A==="Delete")&&I<p.length){V.preventDefault();return}if(B!==I){i(V);return}A==="Backspace"&&F[0]==="-"&&B===p.length+1&&n&&Ys(O,1),u&&d&&(A==="Backspace"&&F[B-1]===j?(Ys(O,B-1),V.preventDefault()):A==="Delete"&&F[B]===j&&V.preventDefault()),P!=null&&P.includes(A)&&F[B]===j&&Ys(O,B+1);var Z=l===!0?",":l;A==="Backspace"&&F[B-1]===Z&&Ys(O,B-1),A==="Delete"&&F[B]===Z&&Ys(O,B+1),i(V)},Y=function(V){var O=L;if(O.match(/\d/g)||(O=""),r||(O=RM(O)),d&&u&&(O=Fw(O,u,d)),O!==L){var A=Bw(O,e);G({formattedValue:A,value:O,floatValue:parseFloat(O)},{event:V,source:eu.event})}s(V)},Q=function(V){return V===j?!0:tu(V)},ne=function(V){var O=V.currentValue,A=V.lastValue,B=V.formattedValue,I=V.currentValueIndex,F=V.formattedValueIndex,Z=O[I],ae=B[F],je=yk(A,O),me=je.to,xe=function(Te){return k(Te).indexOf(".")+p.length};return m===0&&d&&u&&O[me.start]===j&&xe(O)<I&&xe(B)>F?!1:I>=me.start&&I<me.end&&P&&P.includes(Z)&&ae===j?!0:Z===ae};return Object.assign(Object.assign({},b),{value:z,valueIsNumericString:!1,isValidInputCharacter:Q,isCharacterSame:ne,onValueChange:G,format:T,removeFormatting:k,getCaretBoundary:function(V){return WM(V,e)},onKeyDown:q,onBlur:Y})}function GM(e){var t=qM(e);return xn.createElement(FM,Object.assign({},t))}function Uw({direction:e,style:t,...n}){return o.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:o.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 zg={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const QM=/^(0\.0*|-0(\.0*)?)$/,KM=/^-?0\d+(\.\d+)?\.?$/;function Bg(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function ig(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||Bg(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function YM(e){return e.toString().replace(".","").length}function XM(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&YM(t)<14&&t!==""}function Vw(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,i=n===void 0||e<=n;return r&&i}const JM={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},ZM=(e,{size:t})=>({controls:{"--ni-chevron-size":rt(t,"ni-chevron-size")}}),$v=fe((e,t)=>{const n=ie("NumberInput",JM,e),{className:r,classNames:i,styles:s,unstyled:l,vars:u,onChange:d,onValueChange:p,value:h,defaultValue:m,max:v,min:x,step:b,hideControls:w,rightSection:j,isAllowed:P,clampBehavior:T,onBlur:k,allowDecimal:C,decimalScale:_,onKeyDown:R,onKeyDownCapture:M,handlersRef:N,startValue:L,disabled:z,rightSectionPointerEvents:G,allowNegative:q,readOnly:Y,size:Q,rightSectionWidth:ne,stepHoldInterval:V,stepHoldDelay:O,allowLeadingZeros:A,withKeyboardEvents:B,trimLeadingZeroesOnBlur:I,...F}=n,Z=Ne({name:"NumberInput",classes:zg,props:n,classNames:i,styles:s,unstyled:l,vars:u,varsResolver:ZM}),{resolvedClassNames:ae,resolvedStyles:je}=va({classNames:i,styles:s,props:n}),[me,xe]=Vn({value:h,defaultValue:m,finalValue:"",onChange:d}),Te=O!==void 0&&V!==void 0,le=y.useRef(null),et=y.useRef(null),ht=y.useRef(0),ct=(ue,Ue)=>{Ue.source==="event"&&xe(XM(ue.floatValue,ue.value)&&!QM.test(ue.value)&&!(A&&KM.test(ue.value))?ue.floatValue:ue.value),p==null||p(ue,Ue)},St=ue=>{const Ue=String(ue).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ue?Math.max(0,(Ue[1]?Ue[1].length:0)-(Ue[2]?+Ue[2]:0)):0},Et=ue=>{le.current&&typeof ue<"u"&&le.current.setSelectionRange(ue,ue)},Tt=y.useRef(bf);Tt.current=()=>{if(!ig(me))return;let ue;const Ue=St(me),bt=St(b),jt=Math.max(Ue,bt),Dt=10**jt;if(!Bg(me)&&(typeof me!="number"||Number.isNaN(me)))ue=Qd(L,x,v);else if(v!==void 0){const ft=(Math.round(Number(me)*Dt)+Math.round(b*Dt))/Dt;ue=ft<=v?ft:v}else ue=(Math.round(Number(me)*Dt)+Math.round(b*Dt))/Dt;const mn=ue.toFixed(jt);xe(parseFloat(mn)),p==null||p({floatValue:parseFloat(mn),formattedValue:mn,value:mn},{source:"increment"}),setTimeout(()=>{var ft;return Et((ft=le.current)==null?void 0:ft.value.length)},0)};const vt=y.useRef(bf);vt.current=()=>{if(!ig(me))return;let ue;const Ue=x!==void 0?x:q?Number.MIN_SAFE_INTEGER:0,bt=St(me),jt=St(b),Dt=Math.max(bt,jt),mn=10**Dt;if(!Bg(me)&&typeof me!="number"||Number.isNaN(me))ue=Qd(L,Ue,v);else{const wn=(Math.round(Number(me)*mn)-Math.round(b*mn))/mn;ue=Ue!==void 0&&wn<Ue?Ue:wn}const ft=ue.toFixed(Dt);xe(parseFloat(ft)),p==null||p({floatValue:parseFloat(ft),formattedValue:ft,value:ft},{source:"decrement"}),setTimeout(()=>{var wn;return Et((wn=le.current)==null?void 0:wn.value.length)},0)};const _t=ue=>{R==null||R(ue),!(Y||!B)&&(ue.key==="ArrowUp"&&(ue.preventDefault(),Tt.current()),ue.key==="ArrowDown"&&(ue.preventDefault(),vt.current()))},we=ue=>{if(M==null||M(ue),ue.key==="Backspace"){const Ue=le.current;Ue.selectionStart===0&&Ue.selectionStart===Ue.selectionEnd&&(ue.preventDefault(),window.setTimeout(()=>Et(0),0))}},Re=ue=>{let Ue=me;if(T==="blur"&&typeof Ue=="number"&&(Ue=Qd(Ue,x,v)),I&&typeof Ue=="string"&&St(Ue)<15){const bt=Ue.toString().replace(/^0+/,""),jt=parseFloat(bt);Ue=Number.isNaN(jt)||jt>Number.MAX_SAFE_INTEGER?bt:Qd(jt,x,v)}me!==Ue&&xe(Ue),k==null||k(ue)};Yc(N,{increment:Tt.current,decrement:vt.current});const ke=ue=>{ue?Tt.current():vt.current(),ht.current+=1},_e=ue=>{if(ke(ue),Te){const Ue=typeof V=="number"?V:V(ht.current);et.current=window.setTimeout(()=>_e(ue),Ue)}},ce=(ue,Ue)=>{var bt;ue.preventDefault(),(bt=le.current)==null||bt.focus(),ke(Ue),Te&&(et.current=window.setTimeout(()=>_e(Ue),O))},ve=()=>{et.current&&window.clearTimeout(et.current),et.current=null,ht.current=0},Me=o.jsxs("div",{...Z("controls"),children:[o.jsx(Qn,{...Z("control"),tabIndex:-1,"aria-hidden":!0,disabled:z||typeof me=="number"&&v!==void 0&&me>=v,mod:{direction:"up"},onMouseDown:ue=>ue.preventDefault(),onPointerDown:ue=>{ce(ue,!0)},onPointerUp:ve,onPointerLeave:ve,children:o.jsx(Uw,{direction:"up"})}),o.jsx(Qn,{...Z("control"),tabIndex:-1,"aria-hidden":!0,disabled:z||typeof me=="number"&&x!==void 0&&me<=x,mod:{direction:"down"},onMouseDown:ue=>ue.preventDefault(),onPointerDown:ue=>{ce(ue,!1)},onPointerUp:ve,onPointerLeave:ve,children:o.jsx(Uw,{direction:"down"})})]});return o.jsx(_r,{component:GM,allowNegative:q,className:Nt(zg.root,r),size:Q,...F,readOnly:Y,disabled:z,value:me,getInputRef:Nn(t,le),onValueChange:ct,rightSection:w||Y||!ig(me)?j:j||Me,classNames:ae,styles:je,unstyled:l,__staticSelector:"NumberInput",decimalScale:C?_:0,onKeyDown:_t,onKeyDownCapture:we,rightSectionPointerEvents:G??(z?"none":void 0),rightSectionWidth:ne??`var(--ni-right-section-width-${Q||"sm"})`,allowLeadingZeros:A,onBlur:Re,isAllowed:ue=>T==="strict"?P?P(ue)&&Vw(ue.floatValue,x,v):Vw(ue.floatValue,x,v):P?P(ue):!0})});$v.classes={..._r.classes,...zg};$v.displayName="@mantine/core/NumberInput";const[eO,Cp]=pr("Pagination.Root component was not found in tree");var Su={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const tO={withPadding:!0},ju=fe((e,t)=>{const n=ie("PaginationControl",tO,e),{classNames:r,className:i,style:s,styles:l,vars:u,active:d,disabled:p,withPadding:h,mod:m,...v}=n,x=Cp(),b=p||x.disabled;return o.jsx(Qn,{ref:t,disabled:b,mod:[{active:d,disabled:b,"with-padding":h},m],...x.getStyles("control",{className:i,style:s,classNames:r,styles:l,active:!b}),...v})});ju.classes=Su;ju.displayName="@mantine/core/PaginationControl";function Cu({style:e,children:t,path:n,...r}){return o.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:o.jsx("path",{d:n,fill:"currentColor"})})}const nO=e=>o.jsx(Cu,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),rO=e=>o.jsx(Cu,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),iO=e=>o.jsx(Cu,{...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"}),oO=e=>o.jsx(Cu,{...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"}),sO=e=>o.jsx(Cu,{...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"}),aO={icon:sO},Ep=fe((e,t)=>{const n=ie("PaginationDots",aO,e),{classNames:r,className:i,style:s,styles:l,vars:u,icon:d,...p}=n,h=Cp(),m=d;return o.jsx(se,{ref:t,...h.getStyles("dots",{className:i,style:s,styles:l,classNames:r}),...p,children:o.jsx(m,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Ep.classes=Su;Ep.displayName="@mantine/core/PaginationDots";function kp({icon:e,name:t,action:n,type:r}){const i={icon:e},s=y.forwardRef((l,u)=>{const{icon:d,...p}=ie(t,i,l),h=d,m=Cp(),v=r==="next"?m.active===m.total:m.active===1;return o.jsx(ju,{disabled:m.disabled||v,ref:u,onClick:m[n],withPadding:!1,...p,children:o.jsx(h,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return s.displayName=`@mantine/core/${t}`,s}const xk=kp({icon:nO,name:"PaginationNext",action:"onNext",type:"next"}),bk=kp({icon:rO,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),wk=kp({icon:iO,name:"PaginationFirst",action:"onFirst",type:"previous"}),Sk=kp({icon:oO,name:"PaginationLast",action:"onLast",type:"next"});function Fv({dotsIcon:e}){const t=Cp(),n=t.range.map((r,i)=>{var s,l,u;return r==="dots"?o.jsx(Ep,{icon:e},i):o.jsx(ju,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(s=t.getItemProps)==null?void 0:s.call(t,r),children:((u=(l=t.getItemProps)==null?void 0:l.call(t,r))==null?void 0:u.children)??r},i)});return o.jsx(o.Fragment,{children:n})}Fv.displayName="@mantine/core/PaginationItems";const lO={siblings:1,boundaries:1},cO=(e,{size:t,radius:n,color:r,autoContrast:i})=>({root:{"--pagination-control-radius":n===void 0?void 0:Ot(n),"--pagination-control-size":rt(t,"pagination-control-size"),"--pagination-control-fz":In(t),"--pagination-active-bg":r?$t(r,e):void 0,"--pagination-active-color":xa(i,e)?To({color:r,theme:e,autoContrast:i}):void 0}}),Tp=fe((e,t)=>{const n=ie("PaginationRoot",lO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,total:p,value:h,defaultValue:m,onChange:v,disabled:x,siblings:b,boundaries:w,color:j,radius:P,onNextPage:T,onPreviousPage:k,onFirstPage:C,onLastPage:_,getItemProps:R,autoContrast:M,...N}=n,L=Ne({name:"Pagination",classes:Su,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:cO}),{range:z,setPage:G,next:q,previous:Y,active:Q,first:ne,last:V}=ND({page:h,initialPage:m,onChange:v,total:p,siblings:b,boundaries:w}),O=Cr(T,q),A=Cr(k,Y),B=Cr(C,ne),I=Cr(_,V);return o.jsx(eO,{value:{total:p,range:z,active:Q,disabled:x,getItemProps:R,onChange:G,onNext:O,onPrevious:A,onFirst:B,onLast:I,getStyles:L},children:o.jsx(se,{ref:t,...L("root"),...N})})});Tp.classes=Su;Tp.displayName="@mantine/core/PaginationRoot";const uO={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},Ri=fe((e,t)=>{const n=ie("Pagination",uO,e),{withEdges:r,withControls:i,getControlProps:s,nextIcon:l,previousIcon:u,lastIcon:d,firstIcon:p,dotsIcon:h,total:m,gap:v,hideWithOnePage:x,withPages:b,...w}=n;return m<=0||x&&m===1?null:o.jsx(Tp,{ref:t,total:m,...w,children:o.jsxs(be,{gap:v,children:[r&&o.jsx(wk,{icon:p,...s==null?void 0:s("first")}),i&&o.jsx(bk,{icon:u,...s==null?void 0:s("previous")}),b&&o.jsx(Fv,{dotsIcon:h}),i&&o.jsx(xk,{icon:l,...s==null?void 0:s("next")}),r&&o.jsx(Sk,{icon:d,...s==null?void 0:s("last")})]})})});Ri.classes=Su;Ri.displayName="@mantine/core/Pagination";Ri.Root=Tp;Ri.Control=ju;Ri.Dots=Ep;Ri.First=wk;Ri.Last=Sk;Ri.Next=xk;Ri.Previous=bk;Ri.Items=Fv;const dO=({reveal:e})=>o.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:o.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 Ug={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const fO={visibilityToggleIcon:dO},pO=(e,{size:t})=>({root:{"--psi-icon-size":rt(t,"psi-icon-size"),"--psi-button-size":rt(t,"psi-button-size")}}),ji=fe((e,t)=>{const n=ie("PasswordInput",fO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,required:p,error:h,leftSection:m,disabled:v,id:x,variant:b,inputContainer:w,description:j,label:P,size:T,errorProps:k,descriptionProps:C,labelProps:_,withAsterisk:R,inputWrapperOrder:M,wrapperProps:N,radius:L,rightSection:z,rightSectionWidth:G,rightSectionPointerEvents:q,leftSectionWidth:Y,visible:Q,defaultVisible:ne,onVisibilityChange:V,visibilityToggleIcon:O,visibilityToggleButtonProps:A,rightSectionProps:B,leftSectionProps:I,leftSectionPointerEvents:F,withErrorStyles:Z,mod:ae,...je}=n,me=hr(x),[xe,Te]=Vn({value:Q,defaultValue:ne,finalValue:!1,onChange:V}),le=()=>Te(!xe),et=Ne({name:"PasswordInput",classes:Ug,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:pO}),{resolvedClassNames:ht,resolvedStyles:ct}=va({classNames:r,styles:l,props:n}),{styleProps:St,rest:Et}=Po(je),Tt=O,vt=o.jsx(En,{...et("visibilityToggle"),disabled:v,radius:L,"aria-hidden":!A,tabIndex:-1,...A,variant:(A==null?void 0:A.variant)??"subtle",color:"gray",unstyled:u,onTouchEnd:_t=>{var we;_t.preventDefault(),(we=A==null?void 0:A.onTouchEnd)==null||we.call(A,_t),le()},onMouseDown:_t=>{var we;_t.preventDefault(),(we=A==null?void 0:A.onMouseDown)==null||we.call(A,_t),le()},onKeyDown:_t=>{var we;(we=A==null?void 0:A.onKeyDown)==null||we.call(A,_t),_t.key===" "&&(_t.preventDefault(),le())},children:o.jsx(Tt,{reveal:xe})});return o.jsx(tn.Wrapper,{required:p,id:me,label:P,error:h,description:j,size:T,classNames:ht,styles:ct,__staticSelector:"PasswordInput",errorProps:k,descriptionProps:C,unstyled:u,withAsterisk:R,inputWrapperOrder:M,inputContainer:w,variant:b,labelProps:{..._,htmlFor:me},mod:ae,...et("root"),...St,...N,children:o.jsx(tn,{component:"div",error:h,leftSection:m,size:T,classNames:{...ht,input:Nt(Ug.input,ht.input)},styles:ct,radius:L,disabled:v,__staticSelector:"PasswordInput",rightSectionWidth:G,rightSection:z??vt,variant:b,unstyled:u,leftSectionWidth:Y,rightSectionPointerEvents:q||"all",rightSectionProps:B,leftSectionProps:I,leftSectionPointerEvents:F,withAria:!1,withErrorStyles:Z,children:o.jsx("input",{required:p,"data-invalid":!!h||void 0,"data-with-left-section":!!m||void 0,...et("innerInput"),disabled:v,id:me,ref:t,...Et,autoComplete:Et.autoComplete||"off",type:xe?"text":"password"})})})});ji.classes={..._r.classes,...Ug};ji.displayName="@mantine/core/PasswordInput";const[hO,jk]=ko(),[mO,gO]=ko();var Ck={card:"m_9dc8ae12"};const yO={withBorder:!0},vO=(e,{radius:t})=>({card:{"--card-radius":Ot(t)}}),zv=fe((e,t)=>{const n=ie("RadioCard",yO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,checked:p,mod:h,withBorder:m,value:v,onClick:x,name:b,onKeyDown:w,...j}=n,P=Ne({name:"RadioCard",classes:Ck,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:vO,rootSelector:"card"}),{dir:T}=wa(),k=jk(),C=typeof p=="boolean"?p:(k==null?void 0:k.value)===v||!1,_=b||(k==null?void 0:k.name),R=M=>{if(w==null||w(M),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(M.nativeEvent.code)){M.preventDefault();const N=Array.from(document.querySelectorAll(`[role="radio"][name="${_||"__mantine"}"]`)),L=N.findIndex(q=>q===M.target),z=L+1>=N.length?0:L+1,G=L-1<0?N.length-1:L-1;M.nativeEvent.code==="ArrowDown"&&(N[z].focus(),N[z].click()),M.nativeEvent.code==="ArrowUp"&&(N[G].focus(),N[G].click()),M.nativeEvent.code==="ArrowLeft"&&(N[T==="ltr"?G:z].focus(),N[T==="ltr"?G:z].click()),M.nativeEvent.code==="ArrowRight"&&(N[T==="ltr"?z:G].focus(),N[T==="ltr"?z:G].click())}};return o.jsx(mO,{value:{checked:C},children:o.jsx(Qn,{ref:t,mod:[{"with-border":m,checked:C},h],...P("card"),...j,role:"radio","aria-checked":C,name:_,onClick:M=>{x==null||x(M),k==null||k.onChange(v||"")},onKeyDown:R})})});zv.displayName="@mantine/core/RadioCard";zv.classes=Ck;const xO={},Bv=fe((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:l,children:u,name:d,readOnly:p,...h}=ie("RadioGroup",xO,e),m=hr(d),[v,x]=Vn({value:n,defaultValue:r,finalValue:"",onChange:i}),b=w=>!p&&x(typeof w=="string"?w:w.currentTarget.value);return o.jsx(hO,{value:{value:v,onChange:b,size:s,name:m},children:o.jsx(tn.Wrapper,{size:s,ref:t,...l,...h,labelElement:"div",__staticSelector:"RadioGroup",children:o.jsx(pv,{role:"radiogroup",children:u})})})});Bv.classes=tn.Wrapper.classes;Bv.displayName="@mantine/core/RadioGroup";function Ek({size:e,style:t,...n}){return o.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:oe(e),height:oe(e),...t},"aria-hidden":!0,...n,children:o.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var kk={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const bO={icon:Ek},wO=(e,{radius:t,color:n,size:r,iconColor:i,variant:s,autoContrast:l})=>{const u=ei({color:n||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{indicator:{"--radio-size":rt(r,"radio-size"),"--radio-radius":t===void 0?void 0:Ot(t),"--radio-color":s==="outline"?d:$t(n,e),"--radio-icon-size":rt(r,"radio-icon-size"),"--radio-icon-color":i?$t(i,e):xa(l,e)?To({color:n,theme:e,autoContrast:l}):void 0}}},Uv=fe((e,t)=>{const n=ie("RadioIndicator",bO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,icon:p,radius:h,color:m,iconColor:v,autoContrast:x,checked:b,mod:w,variant:j,disabled:P,...T}=n,k=p,C=Ne({name:"RadioIndicator",classes:kk,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:wO,rootSelector:"indicator"}),_=gO(),R=typeof b=="boolean"?b:(_==null?void 0:_.checked)||!1;return o.jsx(se,{ref:t,...C("indicator",{variant:j}),variant:j,mod:[{checked:R,disabled:P},w],...T,children:o.jsx(k,{...C("icon")})})});Uv.displayName="@mantine/core/RadioIndicator";Uv.classes=kk;var Tk={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const SO={labelPosition:"right"},jO=(e,{size:t,radius:n,color:r,iconColor:i,variant:s,autoContrast:l})=>{const u=ei({color:r||e.primaryColor,theme:e}),d=u.isThemeColor&&u.shade===void 0?`var(--mantine-color-${u.color}-outline)`:u.color;return{root:{"--radio-size":rt(t,"radio-size"),"--radio-radius":n===void 0?void 0:Ot(n),"--radio-color":s==="outline"?d:$t(r,e),"--radio-icon-color":i?$t(i,e):xa(l,e)?To({color:r,theme:e,autoContrast:l}):void 0,"--radio-icon-size":rt(t,"radio-icon-size")}}},ua=fe((e,t)=>{const n=ie("Radio",SO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,id:p,size:h,label:m,labelPosition:v,description:x,error:b,radius:w,color:j,variant:P,disabled:T,wrapperProps:k,icon:C=Ek,rootRef:_,iconColor:R,onChange:M,mod:N,...L}=n,z=Ne({name:"Radio",classes:Tk,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:jO}),G=jk(),q=(G==null?void 0:G.size)??h,Y=n.size?h:q,{styleProps:Q,rest:ne}=Po(L),V=hr(p),O=G?{checked:G.value===ne.value,name:ne.name??G.name,onChange:A=>{G.onChange(A),M==null||M(A)}}:{};return o.jsx(fp,{...z("root"),__staticSelector:"Radio",__stylesApiProps:n,id:V,size:Y,labelPosition:v,label:m,description:x,error:b,disabled:T,classNames:r,styles:l,unstyled:u,"data-checked":O.checked||void 0,variant:P,ref:_,mod:N,...Q,...k,children:o.jsxs(se,{...z("inner"),mod:{"label-position":v},children:[o.jsx(se,{...z("radio",{focusable:!0,variant:P}),onChange:M,...ne,...O,component:"input",mod:{error:!!b},ref:t,id:V,disabled:T,type:"radio"}),o.jsx(C,{...z("icon"),"aria-hidden":!0})]})})});ua.classes=Tk;ua.displayName="@mantine/core/Radio";ua.Group=Bv;ua.Card=zv;ua.Indicator=Uv;const CO={duration:100,transition:"fade"};function EO(e,t){return{...CO,...t,...e}}function kO({offset:e,position:t,defaultOpened:n}){const[r,i]=y.useState(n),s=y.useRef(null),{x:l,y:u,elements:d,refs:p,update:h,placement:m}=Vy({placement:t,middleware:[Fy({crossAxis:!0,padding:5,rootBoundary:"document"})]}),v=m.includes("right")?e:t.includes("left")?e*-1:0,x=m.includes("bottom")?e:t.includes("top")?e*-1:0,b=y.useCallback(({clientX:w,clientY:j})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:w,y:j,left:w+v,top:j+x,right:w,bottom:j}}})},[d.reference]);return y.useEffect(()=>{if(p.floating.current){const w=s.current;w.addEventListener("mousemove",b);const j=go(p.floating.current);return j.forEach(P=>{P.addEventListener("scroll",h)}),()=>{w.removeEventListener("mousemove",b),j.forEach(P=>{P.removeEventListener("scroll",h)})}}},[d.reference,p.floating.current,h,b,r]),{handleMouseMove:b,x:l,y:u,opened:r,setOpened:i,boundaryRef:s,floating:p.setFloating}}var Pp={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const TO={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Br("popover")},PO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ot(t),"--tooltip-bg":n?$t(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Vv=fe((e,t)=>{const n=ie("TooltipFloating",TO,e),{children:r,refProp:i,withinPortal:s,style:l,className:u,classNames:d,styles:p,unstyled:h,radius:m,color:v,label:x,offset:b,position:w,multiline:j,zIndex:P,disabled:T,defaultOpened:k,variant:C,vars:_,portalProps:R,...M}=n,N=dn(),L=Ne({name:"TooltipFloating",props:n,classes:Pp,className:u,style:l,classNames:d,styles:p,unstyled:h,rootSelector:"tooltip",vars:_,varsResolver:PO}),{handleMouseMove:z,x:G,y:q,opened:Y,boundaryRef:Q,floating:ne,setOpened:V}=kO({offset:b,position:w,defaultOpened:k});if(!Eo(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 O=Nn(Q,Xf(r),t),A=r.props,B=F=>{var Z;(Z=A.onMouseEnter)==null||Z.call(A,F),z(F),V(!0)},I=F=>{var Z;(Z=A.onMouseLeave)==null||Z.call(A,F),V(!1)};return o.jsxs(o.Fragment,{children:[o.jsx(vs,{...R,withinPortal:s,children:o.jsx(se,{...M,...L("tooltip",{style:{...vC(l,N),zIndex:P,display:!T&&Y?"block":"none",top:(q&&Math.round(q))??"",left:(G&&Math.round(G))??""}}),variant:C,ref:ne,mod:{multiline:j},children:x})}),y.cloneElement(r,{...A,[i]:O,onMouseEnter:B,onMouseLeave:I})]})});Vv.classes=Pp;Vv.displayName="@mantine/core/TooltipFloating";const Pk=y.createContext(!1),RO=Pk.Provider,_O=()=>y.useContext(Pk),DO={openDelay:0,closeDelay:0};function Wv(e){const{openDelay:t,closeDelay:n,children:r}=ie("TooltipGroup",DO,e);return o.jsx(RO,{value:!0,children:o.jsx(SN,{delay:{open:t,close:n},children:r})})}Wv.displayName="@mantine/core/TooltipGroup";Wv.extend=e=>e;function IO(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 AO(e){const t=IO(e.middlewares),n=[XC(e.offset)];return t.shift&&n.push(Fy(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?Ef():Ef(t.flip)),n.push(JC({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?qc():qc(t.inline)):e.inline&&n.push(qc()),n}function NO(e){var R,M,N;const[t,n]=y.useState(e.defaultOpened),i=typeof e.opened=="boolean"?e.opened:t,s=_O(),l=hr(),u=y.useCallback(L=>{n(L),L&&T(l)},[l]),{x:d,y:p,context:h,refs:m,update:v,placement:x,middlewareData:{arrow:{x:b,y:w}={}}}=Vy({strategy:e.strategy,placement:e.position,open:i,onOpenChange:u,middleware:AO(e)}),{delay:j,currentId:P,setCurrentId:T}=jN(h,{id:l}),{getReferenceProps:k,getFloatingProps:C}=_N([bN(h,{enabled:(R=e.events)==null?void 0:R.hover,delay:s?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((M=e.events)!=null&&M.touch)}),RN(h,{enabled:(N=e.events)==null?void 0:N.focus,visibleOnly:!0}),IN(h,{role:"tooltip"}),TN(h,{enabled:typeof e.opened>"u"})]);cE({opened:i,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:m,update:v}}),vo(()=>{var L;(L=e.onPositionChange)==null||L.call(e,x)},[x]);const _=i&&P&&P!==l;return{x:d,y:p,arrowX:b,arrowY:w,reference:m.setReference,floating:m.setFloating,getFloatingProps:C,getReferenceProps:k,isGroupPhase:_,opened:i,placement:x}}const Ww={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Br("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},MO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Ot(t),"--tooltip-bg":n?$t(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Ca=fe((e,t)=>{const n=ie("Tooltip",Ww,e),{children:r,position:i,refProp:s,label:l,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,defaultOpened:m,withinPortal:v,radius:x,color:b,classNames:w,styles:j,unstyled:P,style:T,className:k,withArrow:C,arrowSize:_,arrowOffset:R,arrowRadius:M,arrowPosition:N,offset:L,transitionProps:z,multiline:G,events:q,zIndex:Y,disabled:Q,positionDependencies:ne,onClick:V,onMouseEnter:O,onMouseLeave:A,inline:B,variant:I,keepMounted:F,vars:Z,portalProps:ae,mod:je,floatingStrategy:me,middlewares:xe,...Te}=ie("Tooltip",Ww,n),{dir:le}=wa(),et=y.useRef(null),ht=NO({position:nE(le,i),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,defaultOpened:m,events:q,arrowRef:et,arrowOffset:R,offset:typeof L=="number"?L+(C?_/2:0):L,positionDependencies:[...ne,r],inline:B,strategy:me,middlewares:xe}),ct=Ne({name:"Tooltip",props:n,classes:Pp,className:k,style:T,classNames:w,styles:j,unstyled:P,rootSelector:"tooltip",vars:Z,varsResolver:MO});if(!Eo(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 St=Nn(ht.reference,Xf(r),t),Et=EO(z,{duration:100,transition:"fade"}),Tt=r.props;return o.jsxs(o.Fragment,{children:[o.jsx(vs,{...ae,withinPortal:v,children:o.jsx(Xi,{...Et,keepMounted:F,mounted:!Q&&!!ht.opened,duration:ht.isGroupPhase?10:Et.duration,children:vt=>o.jsxs(se,{...Te,"data-fixed":me==="fixed"||void 0,variant:I,mod:[{multiline:G},je],...ht.getFloatingProps({ref:ht.floating,className:ct("tooltip").className,style:{...ct("tooltip").style,...vt,zIndex:Y,top:ht.y??0,left:ht.x??0}}),children:[l,o.jsx(Wy,{ref:et,arrowX:ht.arrowX,arrowY:ht.arrowY,visible:C,position:ht.placement,arrowSize:_,arrowOffset:R,arrowRadius:M,arrowPosition:N,...ct("arrow")})]})})}),y.cloneElement(r,ht.getReferenceProps({onClick:V,onMouseEnter:O,onMouseLeave:A,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[s]:St,className:Nt(k,Tt.className),...Tt}))]})});Ca.classes=Pp;Ca.displayName="@mantine/core/Tooltip";Ca.Floating=Vv;Ca.Group=Wv;function OO({size:e,thickness:t,sum:n,value:r,root:i,offset:s}){const l=(e*.9-t*2)/2,u=Math.PI*l*2/100,d=i||r===void 0?`${(100-n)*u}, ${n*u}`:`${r*u}, ${(100-r)*u}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:l||0,transform:i?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:d,strokeDashoffset:i?0:s||0}}function Rk({size:e,value:t,offset:n,sum:r,thickness:i,root:s,color:l,lineRoundCaps:u,tooltip:d,getStyles:p,display:h,...m}){const v=dn();return o.jsx(Ca.Floating,{disabled:!d,label:d,children:o.jsx(se,{component:"circle",...m,...p("curve"),__vars:{"--curve-color":l?$t(l,v):void 0},fill:"none",strokeLinecap:u?"round":"butt",...OO({sum:r,size:e,thickness:i,value:t,offset:n,root:s})})})}Rk.displayName="@mantine/core/Curve";function LO({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:i}){const s=n.reduce((h,m)=>h+m.value,0),l=Math.PI*((e*.9-t*2)/2)*2;let u=l;const d=[],p=[];for(let h=0;h<n.length;h+=1)d.push({sum:s,offset:u,data:n[h],root:!1}),u-=n[h].value/100*l;if(d.push({sum:s,offset:u,data:{color:i},root:!0}),p.push({...d[d.length-1],lineRoundCaps:!1}),d.length>2){p.push({...d[0],lineRoundCaps:r}),p.push({...d[d.length-2],lineRoundCaps:r});for(let h=1;h<=d.length-3;h+=1)p.push({...d[h],lineRoundCaps:!1})}else p.push({...d[0],lineRoundCaps:r});return p}var _k={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function $O(e,t){return Math.min(e||12,(t||120)/4)}const FO={size:120,thickness:12},zO=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":oe(t),"--rp-label-offset":oe(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),Rp=fe((e,t)=>{const n=ie("RingProgress",FO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,label:p,sections:h,size:m,thickness:v,roundCaps:x,rootColor:b,transitionDuration:w,...j}=n,P=Ne({name:"RingProgress",classes:_k,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:zO}),T=$O(v,m),k=LO({size:m,thickness:T,sections:h,renderRoundedLineCaps:x,rootColor:b}).map(({data:C,sum:_,root:R,lineRoundCaps:M,offset:N},L)=>y.createElement(Rk,{...C,key:L,size:m,thickness:T,sum:_,offset:N,color:C==null?void 0:C.color,root:R,lineRoundCaps:M,getStyles:P}));return o.jsxs(se,{...P("root"),size:m,ref:t,...j,children:[o.jsx("svg",{...P("svg"),children:k}),p&&o.jsx("div",{...P("label"),children:p})]})});Rp.classes=_k;Rp.displayName="@mantine/core/RingProgress";var Dk={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const BO={withItemsBorders:!0},UO=(e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:s})=>({root:{"--sc-radius":t===void 0?void 0:Ot(t),"--sc-color":n?$t(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":s,"--sc-padding":rt(i,"sc-padding"),"--sc-font-size":In(i)}}),Hv=fe((e,t)=>{var xe,Te;const n=ie("SegmentedControl",BO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,data:p,value:h,defaultValue:m,onChange:v,size:x,name:b,disabled:w,readOnly:j,fullWidth:P,orientation:T,radius:k,color:C,transitionDuration:_,transitionTimingFunction:R,variant:M,autoContrast:N,withItemsBorders:L,mod:z,...G}=n,q=Ne({name:"SegmentedControl",props:n,classes:Dk,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:UO}),Y=dn(),Q=p.map(le=>typeof le=="string"?{label:le,value:le}:le),ne=LD(),[V,O]=y.useState(null),[A,B]=y.useState({}),I=(le,et)=>{A[et]=le,B(A)},[F,Z]=Vn({value:h,defaultValue:m,finalValue:Array.isArray(p)?((xe=Q.find(le=>!le.disabled))==null?void 0:xe.value)??((Te=p[0])==null?void 0:Te.value)??null:null,onChange:v}),ae=hr(b),je=Q.map(le=>y.createElement(se,{...q("control"),mod:{active:F===le.value,orientation:T},key:le.value},y.createElement("input",{...q("input"),disabled:w||le.disabled,type:"radio",name:ae,value:le.value,id:`${ae}-${le.value}`,checked:F===le.value,onChange:()=>!j&&Z(le.value),"data-focus-ring":Y.focusRing,key:`${le.value}-input`}),y.createElement(se,{component:"label",...q("label"),mod:{active:F===le.value&&!(w||le.disabled),disabled:w||le.disabled,"read-only":j},htmlFor:`${ae}-${le.value}`,ref:et=>I(et,le.value),__vars:{"--sc-label-color":C!==void 0?To({color:C,theme:Y,autoContrast:N}):void 0},key:`${le.value}-label`},o.jsx("span",{...q("innerLabel"),children:le.label})))),me=Nn(t,le=>O(le));return p.length===0?null:o.jsxs(se,{...q("root"),variant:M,size:x,ref:me,mod:[{"full-width":P,orientation:T,initialized:ne,"with-items-borders":L},z],...G,role:"radiogroup","data-disabled":w,children:[typeof F=="string"&&o.jsx(Yy,{target:A[F],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...q("indicator")}),je]})});Hv.classes=Dk;Hv.displayName="@mantine/core/SegmentedControl";function VO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var h;const i=dn(),s=t===void 0?e:t,l=gs({"--sg-spacing-x":Dn(wi(e)),"--sg-spacing-y":Dn(wi(s)),"--sg-cols":(h=wi(n))==null?void 0:h.toString()}),u=Qt(i.breakpoints).reduce((m,v)=>(m[v]||(m[v]={}),typeof e=="object"&&e[v]!==void 0&&(m[v]["--sg-spacing-x"]=Dn(e[v])),typeof s=="object"&&s[v]!==void 0&&(m[v]["--sg-spacing-y"]=Dn(s[v])),typeof n=="object"&&n[v]!==void 0&&(m[v]["--sg-cols"]=n[v]),m),{}),p=Kc(Qt(u),i.breakpoints).filter(m=>Qt(u[m.value]).length>0).map(m=>({query:`(min-width: ${i.breakpoints[m.value]})`,styles:u[m.value]}));return o.jsx(ba,{styles:l,media:p,selector:r})}function og(e){return typeof e=="object"&&e!==null?Qt(e):[]}function WO(e){return e.sort((t,n)=>Qc(t)-Qc(n))}function HO({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...og(e),...og(t),...og(n)]));return WO(r)}function qO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var p;const i=t===void 0?e:t,s=gs({"--sg-spacing-x":Dn(wi(e)),"--sg-spacing-y":Dn(wi(i)),"--sg-cols":(p=wi(n))==null?void 0:p.toString()}),l=HO({spacing:e,verticalSpacing:t,cols:n}),u=l.reduce((h,m)=>(h[m]||(h[m]={}),typeof e=="object"&&e[m]!==void 0&&(h[m]["--sg-spacing-x"]=Dn(e[m])),typeof i=="object"&&i[m]!==void 0&&(h[m]["--sg-spacing-y"]=Dn(i[m])),typeof n=="object"&&n[m]!==void 0&&(h[m]["--sg-cols"]=n[m]),h),{}),d=l.map(h=>({query:`simple-grid (min-width: ${h})`,styles:u[h]}));return o.jsx(ba,{styles:s,container:d,selector:r})}var Ik={container:"m_925c2d2c",root:"m_2415a157"};const GO={cols:1,spacing:"md",type:"media"},qv=fe((e,t)=>{const n=ie("SimpleGrid",GO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,cols:p,verticalSpacing:h,spacing:m,type:v,...x}=n,b=Ne({name:"SimpleGrid",classes:Ik,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d}),w=fu();return v==="container"?o.jsxs(o.Fragment,{children:[o.jsx(qO,{...n,selector:`.${w}`}),o.jsx("div",{...b("container"),children:o.jsx(se,{ref:t,...b("root",{className:w}),...x})})]}):o.jsxs(o.Fragment,{children:[o.jsx(VO,{...n,selector:`.${w}`}),o.jsx(se,{ref:t,...b("root",{className:w}),...x})]})});qv.classes=Ik;qv.displayName="@mantine/core/SimpleGrid";const QO={},_p=fe((e,t)=>{const{w:n,h:r,miw:i,mih:s,...l}=ie("Space",QO,e);return o.jsx(se,{ref:t,...l,w:n,miw:i??n,h:r,mih:s??r})});_p.displayName="@mantine/core/Space";var Ak={root:"m_6d731127"};const KO={gap:"md",align:"stretch",justify:"flex-start"},YO=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Dn(t),"--stack-align":n,"--stack-justify":r}}),nt=fe((e,t)=>{const n=ie("Stack",KO,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,align:p,justify:h,gap:m,variant:v,...x}=n,b=Ne({name:"Stack",props:n,classes:Ak,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:YO});return o.jsx(se,{ref:t,...b("root"),variant:v,...x})});nt.classes=Ak;nt.displayName="@mantine/core/Stack";const[XO,JO]=pr("Stepper component was not found in tree"),Tf=()=>null;Tf.displayName="@mantine/core/StepperCompleted";var Gv={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 ef=(e,t)=>typeof e=="function"?o.jsx(e,{step:t||0}):e,ZO={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Qv=fe((e,t)=>{const{classNames:n,className:r,style:i,styles:s,vars:l,step:u,state:d,color:p,icon:h,completedIcon:m,progressIcon:v,label:x,description:b,withIcon:w,iconSize:j,loading:P,allowStepClick:T,allowStepSelect:k,iconPosition:C,orientation:_,mod:R,...M}=ie("StepperStep",ZO,e),N=JO(),L=dn(),z={classNames:n,styles:s},G=d==="stepCompleted"?null:d==="stepProgress"?v:h,q={"data-progress":d==="stepProgress"||void 0,"data-completed":d==="stepCompleted"||void 0};return o.jsxs(Qn,{...N.getStyles("step",{className:r,style:i,variant:N.orientation,...z}),mod:[{"icon-position":C||N.iconPosition,"allow-click":T},R],ref:t,...q,...M,__vars:{"--step-color":p?$t(p,L):void 0},tabIndex:T?0:-1,children:[w&&o.jsxs("span",{...N.getStyles("stepWrapper",z),children:[o.jsxs("span",{...N.getStyles("stepIcon",z),...q,children:[o.jsx(Xi,{mounted:d==="stepCompleted",transition:"pop",duration:200,children:Y=>o.jsx("span",{...N.getStyles("stepCompletedIcon",{style:Y,...z}),children:P?o.jsx(Pr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...N.getStyles("stepLoader",z)}):ef(m,u)||o.jsx(pp,{size:"60%"})})}),d!=="stepCompleted"?P?o.jsx(Pr,{...N.getStyles("stepLoader",z),size:"calc(var(--stepper-icon-size) / 2)",color:p}):ef(G||h,u):null]}),_==="vertical"&&o.jsx("span",{...N.getStyles("verticalSeparator",z),"data-active":d==="stepCompleted"||void 0})]}),(x||b)&&o.jsxs("span",{...N.getStyles("stepBody",z),"data-orientation":N.orientation,"data-icon-position":C||N.iconPosition,children:[x&&o.jsx("span",{...N.getStyles("stepLabel",z),children:ef(x,u)}),b&&o.jsx("span",{...N.getStyles("stepDescription",z),children:ef(b,u)})]})]})});Qv.classes=Gv;Qv.displayName="@mantine/core/StepperStep";const e5={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},t5=(e,{color:t,iconSize:n,size:r,contentPadding:i,radius:s,autoContrast:l})=>({root:{"--stepper-color":t?$t(t,e):void 0,"--stepper-icon-color":xa(l,e)?To({color:t,theme:e,autoContrast:l}):void 0,"--stepper-icon-size":n===void 0?rt(r,"stepper-icon-size"):oe(n),"--stepper-content-padding":Dn(i),"--stepper-radius":s===void 0?void 0:Ot(s),"--stepper-fz":In(r),"--stepper-spacing":Dn(r)}}),Rl=fe((e,t)=>{var A,B,I;const n=ie("Stepper",e5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,children:p,onStepClick:h,active:m,icon:v,completedIcon:x,progressIcon:b,color:w,iconSize:j,contentPadding:P,orientation:T,iconPosition:k,size:C,radius:_,allowNextStepsSelect:R,wrap:M,autoContrast:N,...L}=n,z=Ne({name:"Stepper",classes:Gv,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:t5}),G=y.Children.toArray(p),q=G.filter(F=>F.type!==Tf),Y=G.find(F=>F.type===Tf),Q=q.reduce((F,Z,ae)=>{const je=m===ae?"stepProgress":m>ae?"stepCompleted":"stepInactive",xe=typeof h!="function"?!1:typeof Z.props.allowStepSelect=="boolean"?Z.props.allowStepSelect:je==="stepCompleted"||R;return F.push(y.cloneElement(Z,{icon:Z.props.icon||v||ae+1,key:ae,step:ae,state:je,onClick:()=>xe&&(h==null?void 0:h(ae)),allowStepClick:xe,completedIcon:Z.props.completedIcon||x,progressIcon:Z.props.progressIcon||b,color:Z.props.color||w,iconSize:j,iconPosition:Z.props.iconPosition||k,orientation:T})),T==="horizontal"&&ae!==q.length-1&&F.push(y.createElement("div",{...z("separator"),"data-active":ae<m||void 0,"data-orientation":T,key:`separator-${ae}`})),F},[]),ne=(B=(A=q[m])==null?void 0:A.props)==null?void 0:B.children,V=(I=Y==null?void 0:Y.props)==null?void 0:I.children,O=m>q.length-1?V:ne;return o.jsx(XO,{value:{getStyles:z,orientation:T,iconPosition:k},children:o.jsxs(se,{...z("root"),ref:t,size:C,...L,children:[o.jsx(se,{...z("steps"),mod:{orientation:T,"icon-position":k,wrap:M&&T!=="vertical"},children:Q}),O&&o.jsx("div",{...z("content"),children:O})]})})});Rl.classes=Gv;Rl.displayName="@mantine/core/Stepper";Rl.Completed=Tf;Rl.Step=Qv;const Nk=y.createContext(null),n5=Nk.Provider,r5=()=>y.useContext(Nk),i5={},Kv=fe((e,t)=>{const{value:n,defaultValue:r,onChange:i,size:s,wrapperProps:l,children:u,readOnly:d,...p}=ie("SwitchGroup",i5,e),[h,m]=Vn({value:n,defaultValue:r,finalValue:[],onChange:i}),v=x=>{const b=x.currentTarget.value;!d&&m(h.includes(b)?h.filter(w=>w!==b):[...h,b])};return o.jsx(n5,{value:{value:h,onChange:v,size:s},children:o.jsx(tn.Wrapper,{size:s,ref:t,...l,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:o.jsx(pv,{role:"group",children:u})})})});Kv.classes=tn.Wrapper.classes;Kv.displayName="@mantine/core/SwitchGroup";var Mk={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const o5={labelPosition:"right"},s5=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Ot(t),"--switch-height":rt(r,"switch-height"),"--switch-width":rt(r,"switch-width"),"--switch-thumb-size":rt(r,"switch-thumb-size"),"--switch-label-font-size":rt(r,"switch-label-font-size"),"--switch-track-label-padding":rt(r,"switch-track-label-padding"),"--switch-color":n?$t(n,e):void 0}}),Eu=fe((e,t)=>{const n=ie("Switch",o5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,color:p,label:h,offLabel:m,onLabel:v,id:x,size:b,radius:w,wrapperProps:j,thumbIcon:P,checked:T,defaultChecked:k,onChange:C,labelPosition:_,description:R,error:M,disabled:N,variant:L,rootRef:z,mod:G,...q}=n,Y=r5(),Q=b||(Y==null?void 0:Y.size),ne=Ne({name:"Switch",props:n,classes:Mk,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:s5}),{styleProps:V,rest:O}=Po(q),A=hr(x),B=Y?{checked:Y.value.includes(O.value),onChange:Y.onChange}:{},[I,F]=Vn({value:B.checked??T,defaultValue:k,finalValue:!1});return o.jsxs(fp,{...ne("root"),__staticSelector:"Switch",__stylesApiProps:n,id:A,size:Q,labelPosition:_,label:h,description:R,error:M,disabled:N,bodyElement:"label",labelElement:"span",classNames:r,styles:l,unstyled:u,"data-checked":B.checked||T||void 0,variant:L,ref:z,mod:G,...V,...j,children:[o.jsx("input",{...O,disabled:N,checked:I,"data-checked":B.checked||T||void 0,onChange:Z=>{var ae;Y?(ae=B.onChange)==null||ae.call(B,Z):C==null||C(Z),F(Z.currentTarget.checked)},id:A,ref:t,type:"checkbox",role:"switch",...ne("input")}),o.jsxs(se,{"aria-hidden":"true",mod:{error:M,"label-position":_,"without-labels":!v&&!m},...ne("track"),children:[o.jsx(se,{component:"span",mod:"reduce-motion",...ne("thumb"),children:P}),o.jsx("span",{...ne("trackLabel"),children:I?v:m})]})]})});Eu.classes={...Mk,...FE};Eu.displayName="@mantine/core/Switch";Eu.Group=Kv;const[a5,l5]=pr("Table component was not found in the tree");var ku={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 c5(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 Ea(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=fe((i,s)=>{const l=ie(n,{},i),{classNames:u,className:d,style:p,styles:h,...m}=l,v=l5();return o.jsx(se,{component:e,ref:s,...c5(v,t),...v.getStyles(e,{className:d,classNames:u,style:p,styles:h,props:l}),...m})});return r.displayName=`@mantine/core/${n}`,r.classes=ku,r}const Vg=Ea("th",{columnBorder:!0}),Ok=Ea("td",{columnBorder:!0}),hf=Ea("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),Lk=Ea("thead",{stickyHeader:!0}),$k=Ea("tbody"),Fk=Ea("tfoot"),zk=Ea("caption",{captionSide:!0});function Yv({data:e}){return o.jsxs(o.Fragment,{children:[e.caption&&o.jsx(zk,{children:e.caption}),e.head&&o.jsx(Lk,{children:o.jsx(hf,{children:e.head.map((t,n)=>o.jsx(Vg,{children:t},n))})}),e.body&&o.jsx($k,{children:e.body.map((t,n)=>o.jsx(hf,{children:t.map((r,i)=>o.jsx(Ok,{children:r},i))},n))}),e.foot&&o.jsx(Fk,{children:o.jsx(hf,{children:e.foot.map((t,n)=>o.jsx(Vg,{children:t},n))})})]})}Yv.displayName="@mantine/core/TableDataRenderer";const u5={type:"scrollarea"},d5=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":oe(t),"--table-overflow":n==="native"?"auto":void 0}}),Xv=fe((e,t)=>{const n=ie("TableScrollContainer",u5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,children:p,minWidth:h,type:m,...v}=n,x=Ne({name:"TableScrollContainer",classes:ku,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:d5,rootSelector:"scrollContainer"});return o.jsx(se,{component:m==="scrollarea"?oi:"div",...m==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...x("scrollContainer"),...v,children:o.jsx("div",{...x("scrollContainerInner"),children:p})})});Xv.classes=ku;Xv.displayName="@mantine/core/TableScrollContainer";const f5={withRowBorders:!0,verticalSpacing:7},p5=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:s,stripedColor:l,highlightOnHoverColor:u,striped:d,highlightOnHover:p,stickyHeaderOffset:h,stickyHeader:m})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Dn(r),"--table-vertical-spacing":Dn(i),"--table-border-color":s?$t(s,e):void 0,"--table-striped-color":d&&l?$t(l,e):void 0,"--table-highlight-on-hover-color":p&&u?$t(u,e):void 0,"--table-sticky-header-offset":m?oe(h):void 0}}),Ae=fe((e,t)=>{const n=ie("Table",f5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,horizontalSpacing:p,verticalSpacing:h,captionSide:m,stripedColor:v,highlightOnHoverColor:x,striped:b,highlightOnHover:w,withColumnBorders:j,withRowBorders:P,withTableBorder:T,borderColor:k,layout:C,variant:_,data:R,children:M,stickyHeader:N,stickyHeaderOffset:L,mod:z,tabularNums:G,...q}=n,Y=Ne({name:"Table",props:n,className:i,style:s,classes:ku,classNames:r,styles:l,unstyled:u,rootSelector:"table",vars:d,varsResolver:p5});return o.jsx(a5,{value:{getStyles:Y,stickyHeader:N,striped:b===!0?"odd":b||void 0,highlightOnHover:w,withColumnBorders:j,withRowBorders:P,captionSide:m||"bottom"},children:o.jsx(se,{component:"table",variant:_,ref:t,mod:[{"data-with-table-border":T,"data-tabular-nums":G},z],...Y("table"),...q,children:M||!!R&&o.jsx(Yv,{data:R})})})});Ae.classes=ku;Ae.displayName="@mantine/core/Table";Ae.Td=Ok;Ae.Th=Vg;Ae.Tr=hf;Ae.Thead=Lk;Ae.Tbody=$k;Ae.Tfoot=Fk;Ae.Caption=zk;Ae.ScrollContainer=Xv;Ae.DataRenderer=Yv;const[h5,Jv]=pr("Tabs component was not found in the tree");var Tu={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 m5={},Zv=fe((e,t)=>{const n=ie("TabsList",m5,e),{children:r,className:i,grow:s,justify:l,classNames:u,styles:d,style:p,mod:h,...m}=n,v=Jv();return o.jsx(se,{...m,...v.getStyles("list",{className:i,style:p,classNames:u,styles:d,props:n,variant:v.variant}),ref:t,role:"tablist",variant:v.variant,mod:[{grow:s,orientation:v.orientation,placement:v.orientation==="vertical"&&v.placement,inverted:v.inverted},h],"aria-orientation":v.orientation,__vars:{"--tabs-justify":l},children:r})});Zv.classes=Tu;Zv.displayName="@mantine/core/TabsList";const g5={},ex=fe((e,t)=>{const n=ie("TabsPanel",g5,e),{children:r,className:i,value:s,classNames:l,styles:u,style:d,mod:p,keepMounted:h,...m}=n,v=Jv(),x=v.value===s,b=v.keepMounted||h||x?r:null;return o.jsx(se,{...m,...v.getStyles("panel",{className:i,classNames:l,styles:u,style:[d,x?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:v.orientation},p],role:"tabpanel",id:v.getPanelId(s),"aria-labelledby":v.getTabId(s),children:b})});ex.classes=Tu;ex.displayName="@mantine/core/TabsPanel";const y5={},tx=fe((e,t)=>{const n=ie("TabsTab",y5,e),{className:r,children:i,rightSection:s,leftSection:l,value:u,onClick:d,onKeyDown:p,disabled:h,color:m,style:v,classNames:x,styles:b,vars:w,mod:j,tabIndex:P,...T}=n,k=dn(),{dir:C}=wa(),_=Jv(),R=u===_.value,M=L=>{_.onChange(_.allowTabDeactivation&&u===_.value?null:u),d==null||d(L)},N={classNames:x,styles:b,props:n};return o.jsxs(Qn,{...T,..._.getStyles("tab",{className:r,style:v,variant:_.variant,...N}),disabled:h,unstyled:_.unstyled,variant:_.variant,mod:[{active:R,disabled:h,orientation:_.orientation,inverted:_.inverted,placement:_.orientation==="vertical"&&_.placement},j],ref:t,role:"tab",id:_.getTabId(u),"aria-selected":R,tabIndex:P!==void 0?P:R||_.value===null?0:-1,"aria-controls":_.getPanelId(u),onClick:M,__vars:{"--tabs-color":m?$t(m,k):void 0},onKeyDown:tC({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:_.activateTabWithKeyboard,loop:_.loop,orientation:_.orientation||"horizontal",dir:C,onKeyDown:p}),children:[l&&o.jsx("span",{..._.getStyles("tabSection",N),"data-position":"left",children:l}),i&&o.jsx("span",{..._.getStyles("tabLabel",N),children:i}),s&&o.jsx("span",{..._.getStyles("tabSection",N),"data-position":"right",children:s})]})});tx.classes=Tu;tx.displayName="@mantine/core/TabsTab";const Hw="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",v5={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},x5=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Ot(t),"--tabs-color":$t(n,e),"--tabs-text-color":xa(r,e)?To({color:n,theme:e,autoContrast:r}):void 0}}),At=fe((e,t)=>{const n=ie("Tabs",v5,e),{defaultValue:r,value:i,onChange:s,orientation:l,children:u,loop:d,id:p,activateTabWithKeyboard:h,allowTabDeactivation:m,variant:v,color:x,radius:b,inverted:w,placement:j,keepMounted:P,classNames:T,styles:k,unstyled:C,className:_,style:R,vars:M,autoContrast:N,mod:L,...z}=n,G=hr(p),[q,Y]=Vn({value:i,defaultValue:r,finalValue:null,onChange:s}),Q=Ne({name:"Tabs",props:n,classes:Tu,className:_,style:R,classNames:T,styles:k,unstyled:C,vars:M,varsResolver:x5});return o.jsx(h5,{value:{placement:j,value:q,orientation:l,id:G,loop:d,activateTabWithKeyboard:h,getTabId:F0(`${G}-tab`,Hw),getPanelId:F0(`${G}-panel`,Hw),onChange:Y,allowTabDeactivation:m,variant:v,color:x,radius:b,inverted:w,keepMounted:P,unstyled:C,getStyles:Q},children:o.jsx(se,{ref:t,id:G,variant:v,mod:[{orientation:l,inverted:l==="horizontal"&&w,placement:l==="vertical"&&j},L],...Q("root"),...z,children:u})})});At.classes=Tu;At.displayName="@mantine/core/Tabs";At.Tab=tx;At.Panel=ex;At.List=Zv;const b5={},Be=fe((e,t)=>{const n=ie("TextInput",b5,e);return o.jsx(_r,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});Be.classes=_r.classes;Be.displayName="@mantine/core/TextInput";var Bk={root:"m_7341320d"};const w5={},S5=(e,{size:t,radius:n,variant:r,gradient:i,color:s,autoContrast:l})=>{const u=e.variantColorResolver({color:s||e.primaryColor,theme:e,gradient:i,variant:r||"filled",autoContrast:l});return{root:{"--ti-size":rt(t,"ti-size"),"--ti-radius":n===void 0?void 0:Ot(n),"--ti-bg":s||r?u.background:void 0,"--ti-color":s||r?u.color:void 0,"--ti-bd":s||r?u.border:void 0}}},nx=fe((e,t)=>{const n=ie("ThemeIcon",w5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,autoContrast:p,...h}=n,m=Ne({name:"ThemeIcon",classes:Bk,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:S5});return o.jsx(se,{ref:t,...m("root"),...h})});nx.classes=Bk;nx.displayName="@mantine/core/ThemeIcon";const j5=["h1","h2","h3","h4","h5","h6"],C5=["xs","sm","md","lg","xl"];function E5(e,t){const n=t!==void 0?t:`h${e}`;return j5.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:C5.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:oe(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var Uk={root:"m_8a5d1357"};const k5={order:1},T5=(e,{order:t,size:n,lineClamp:r,textWrap:i})=>{const s=E5(t,n);return{root:{"--title-fw":s.fontWeight,"--title-lh":s.lineHeight,"--title-fz":s.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":i}}},ze=fe((e,t)=>{const n=ie("Title",k5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,order:d,vars:p,size:h,variant:m,lineClamp:v,textWrap:x,mod:b,...w}=n,j=Ne({name:"Title",props:n,classes:Uk,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:p,varsResolver:T5});return[1,2,3,4,5,6].includes(d)?o.jsx(se,{...j("root"),component:`h${d}`,variant:m,ref:t,mod:[{order:d,"data-line-clamp":typeof v=="number"},b],size:h,...w}):null});ze.classes=Uk;ze.displayName="@mantine/core/Title";function P5(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(i){t=typeof i=="function"?i(t):i},setState(i){this.updateState(i),r.forEach(s=>s(t))},initialize(i){n||(t=i,n=!0)},subscribe(i){return r.add(i),()=>r.delete(i)}}}function R5(e){return y.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function _5(e,t,n){const r=[],i=[],s={};for(const l of e){const u=l.position||t;s[u]=s[u]||0,s[u]+=1,s[u]<=n?i.push(l):r.push(l)}return{notifications:i,queue:r}}const D5=()=>P5({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),ka=D5(),I5=(e=ka)=>R5(e);function Gl(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),i=_5(r,n.defaultPosition,n.limit);e.setState({notifications:i.notifications,queue:i.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function Ie(e,t=ka){const n=e.id||rC();return Gl(t,r=>e.id&&r.some(i=>i.id===e.id)?r:[...r,{...e,id:n}]),n}function Vk(e,t=ka){return Gl(t,n=>n.filter(r=>{var i;return r.id===e?((i=r.onClose)==null||i.call(r,r),!1):!0})),e}function ta(e,t=ka){return Gl(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function A5(e=ka){Gl(e,()=>[])}function N5(e=ka){Gl(e,t=>t.slice(0,e.getState().limit))}const qi={show:Ie,hide:Vk,update:ta,clean:A5,cleanQueue:N5,updateState:Gl};function Wg(e,t){return Wg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Wg(e,t)}function Wk(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Wg(e,t)}var sg={exports:{}},ag,qw;function M5(){if(qw)return ag;qw=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ag=e,ag}var lg,Gw;function O5(){if(Gw)return lg;Gw=1;var e=M5();function t(){}function n(){}return n.resetWarningCache=t,lg=function(){function r(l,u,d,p,h,m){if(m!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function i(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:i,element:r,elementType:r,instanceOf:i,node:r,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:t};return s.PropTypes=s,s},lg}var Qw;function L5(){return Qw||(Qw=1,sg.exports=O5()()),sg.exports}var $5=L5();const qt=yy($5),Kw={disabled:!1},Pf=xn.createContext(null);var F5=function(t){return t.scrollTop},Wc="unmounted",Gs="exited",Qs="entering",pl="entered",Hg="exiting",Do=function(e){Wk(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var l=i,u=l&&!l.isMounting?r.enter:r.appear,d;return s.appearStatus=null,r.in?u?(d=Gs,s.appearStatus=Qs):d=pl:r.unmountOnExit||r.mountOnEnter?d=Wc:d=Gs,s.state={status:d},s.nextCallback=null,s}t.getDerivedStateFromProps=function(i,s){var l=i.in;return l&&s.status===Wc?{status:Gs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var l=this.state.status;this.props.in?l!==Qs&&l!==pl&&(s=Qs):(l===Qs||l===pl)&&(s=Hg)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,l,u;return s=l=u=i,i!=null&&typeof i!="number"&&(s=i.exit,l=i.enter,u=i.appear!==void 0?i.appear:l),{exit:s,enter:l,appear:u}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===Qs){if(this.props.unmountOnExit||this.props.mountOnEnter){var l=this.props.nodeRef?this.props.nodeRef.current:hl.findDOMNode(this);l&&F5(l)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Gs&&this.setState({status:Wc})},n.performEnter=function(i){var s=this,l=this.props.enter,u=this.context?this.context.isMounting:i,d=this.props.nodeRef?[u]:[hl.findDOMNode(this),u],p=d[0],h=d[1],m=this.getTimeouts(),v=u?m.appear:m.enter;if(!i&&!l||Kw.disabled){this.safeSetState({status:pl},function(){s.props.onEntered(p)});return}this.props.onEnter(p,h),this.safeSetState({status:Qs},function(){s.props.onEntering(p,h),s.onTransitionEnd(v,function(){s.safeSetState({status:pl},function(){s.props.onEntered(p,h)})})})},n.performExit=function(){var i=this,s=this.props.exit,l=this.getTimeouts(),u=this.props.nodeRef?void 0:hl.findDOMNode(this);if(!s||Kw.disabled){this.safeSetState({status:Gs},function(){i.props.onExited(u)});return}this.props.onExit(u),this.safeSetState({status:Hg},function(){i.props.onExiting(u),i.onTransitionEnd(l.exit,function(){i.safeSetState({status:Gs},function(){i.props.onExited(u)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,l=!0;return this.nextCallback=function(u){l&&(l=!1,s.nextCallback=null,i(u))},this.nextCallback.cancel=function(){l=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var l=this.props.nodeRef?this.props.nodeRef.current:hl.findDOMNode(this),u=i==null&&!this.props.addEndListener;if(!l||u){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var d=this.props.nodeRef?[this.nextCallback]:[l,this.nextCallback],p=d[0],h=d[1];this.props.addEndListener(p,h)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Wc)return null;var s=this.props,l=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var u=Cv(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return xn.createElement(Pf.Provider,{value:null},typeof l=="function"?l(i,u):xn.cloneElement(xn.Children.only(l),u))},t}(xn.Component);Do.contextType=Pf;Do.propTypes={};function sl(){}Do.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:sl,onEntering:sl,onEntered:sl,onExit:sl,onExiting:sl,onExited:sl};Do.UNMOUNTED=Wc;Do.EXITED=Gs;Do.ENTERING=Qs;Do.ENTERED=pl;Do.EXITING=Hg;function z5(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rx(e,t){var n=function(s){return t&&y.isValidElement(s)?t(s):s},r=Object.create(null);return e&&y.Children.map(e,function(i){return i}).forEach(function(i){r[i.key]=n(i)}),r}function B5(e,t){e=e||{},t=t||{};function n(h){return h in t?t[h]:e[h]}var r=Object.create(null),i=[];for(var s in e)s in t?i.length&&(r[s]=i,i=[]):i.push(s);var l,u={};for(var d in t){if(r[d])for(l=0;l<r[d].length;l++){var p=r[d][l];u[r[d][l]]=n(p)}u[d]=n(d)}for(l=0;l<i.length;l++)u[i[l]]=n(i[l]);return u}function na(e,t,n){return n[t]!=null?n[t]:e.props[t]}function U5(e,t){return rx(e.children,function(n){return y.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:na(n,"appear",e),enter:na(n,"enter",e),exit:na(n,"exit",e)})})}function V5(e,t,n){var r=rx(e.children),i=B5(t,r);return Object.keys(i).forEach(function(s){var l=i[s];if(y.isValidElement(l)){var u=s in t,d=s in r,p=t[s],h=y.isValidElement(p)&&!p.props.in;d&&(!u||h)?i[s]=y.cloneElement(l,{onExited:n.bind(null,l),in:!0,exit:na(l,"exit",e),enter:na(l,"enter",e)}):!d&&u&&!h?i[s]=y.cloneElement(l,{in:!1}):d&&u&&y.isValidElement(p)&&(i[s]=y.cloneElement(l,{onExited:n.bind(null,l),in:p.props.in,exit:na(l,"exit",e),enter:na(l,"enter",e)}))}}),i}var W5=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},H5={component:"div",childFactory:function(t){return t}},ss=function(e){Wk(t,e);function t(r,i){var s;s=e.call(this,r,i)||this;var l=s.handleExited.bind(z5(s));return s.state={contextValue:{isMounting:!0},handleExited:l,firstRender:!0},s}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(i,s){var l=s.children,u=s.handleExited,d=s.firstRender;return{children:d?U5(i,u):V5(i,l,u),firstRender:!1}},n.handleExited=function(i,s){var l=rx(this.props.children);i.key in l||(i.props.onExited&&i.props.onExited(s),this.mounted&&this.setState(function(u){var d=kf({},u.children);return delete d[i.key],{children:d}}))},n.render=function(){var i=this.props,s=i.component,l=i.childFactory,u=Cv(i,["component","childFactory"]),d=this.state.contextValue,p=W5(this.state.children).map(l);return delete u.appear,delete u.enter,delete u.exit,s===null?xn.createElement(Pf.Provider,{value:d},p):xn.createElement(Pf.Provider,{value:d},xn.createElement(s,u,p))},t}(xn.Component);ss.propTypes={};ss.defaultProps=H5;const Hk=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function q5(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),Hk.reduce((n,r)=>(n[r]=[],n),{}))}const Yw={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},G5={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Q5({state:e,maxHeight:t,position:n,transitionDuration:r}){const[i,s]=n.split("-"),l=s==="center"?`${i}-center`:s,u={opacity:0,maxHeight:t,transform:Yw[l],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},d={opacity:1,transform:G5[l]},p={opacity:0,maxHeight:0,transform:Yw[l]};return{...u,...{entering:d,entered:d,exiting:p,exited:p}[e]}}function K5(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const qk=y.forwardRef(({data:e,onHide:t,autoClose:n,...r},i)=>{const{autoClose:s,message:l,...u}=e,d=K5(n,e.autoClose),p=y.useRef(-1),h=()=>window.clearTimeout(p.current),m=()=>{t(e.id),h()},v=()=>{typeof d=="number"&&(p.current=window.setTimeout(m,d))};return y.useEffect(()=>{var x;(x=e.onOpen)==null||x.call(e,e)},[]),y.useEffect(()=>(v(),h),[d]),o.jsx(Ov,{...r,...u,onClose:m,ref:i,onMouseEnter:h,onMouseLeave:v,children:l})});qk.displayName="@mantine/notifications/NotificationContainer";var Gk={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const Y5=Do,X5={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Br("overlay"),store:ka,withinPortal:!0},J5=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":oe(n)}}),Io=fe((e,t)=>{const n=ie("Notifications",X5,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,position:p,autoClose:h,transitionDuration:m,containerWidth:v,notificationMaxHeight:x,limit:b,zIndex:w,store:j,portalProps:P,withinPortal:T,...k}=n,C=dn(),_=I5(j),R=_D(),M=Sy(),N=y.useRef({}),L=y.useRef(0),G=(C.respectReducedMotion?M:!1)?1:m,q=Ne({name:"Notifications",classes:Gk,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:J5});y.useEffect(()=>{j==null||j.updateState(ne=>({...ne,limit:b||5,defaultPosition:p}))},[b,p]),vo(()=>{_.notifications.length>L.current&&setTimeout(()=>R(),0),L.current=_.notifications.length},[_.notifications]);const Y=q5(_.notifications,p),Q=Hk.reduce((ne,V)=>(ne[V]=Y[V].map(({style:O,...A})=>o.jsx(Y5,{timeout:G,onEnter:()=>N.current[A.id].offsetHeight,nodeRef:{current:N.current[A.id]},children:B=>o.jsx(qk,{ref:I=>{N.current[A.id]=I},data:A,onHide:I=>Vk(I,j),autoClose:h,...q("notification",{style:{...Q5({state:B,position:V,transitionDuration:G,maxHeight:x}),...O}})})},A.id)),ne),{});return o.jsxs(vs,{withinPortal:T,...P,children:[o.jsx(se,{...q("root"),"data-position":"top-center",ref:t,...k,children:o.jsx(ss,{children:Q["top-center"]})}),o.jsx(se,{...q("root"),"data-position":"top-left",...k,children:o.jsx(ss,{children:Q["top-left"]})}),o.jsx(se,{...q("root",{className:Sl.classNames.fullWidth}),"data-position":"top-right",...k,children:o.jsx(ss,{children:Q["top-right"]})}),o.jsx(se,{...q("root",{className:Sl.classNames.fullWidth}),"data-position":"bottom-right",...k,children:o.jsx(ss,{children:Q["bottom-right"]})}),o.jsx(se,{...q("root"),"data-position":"bottom-left",...k,children:o.jsx(ss,{children:Q["bottom-left"]})}),o.jsx(se,{...q("root"),"data-position":"bottom-center",...k,children:o.jsx(ss,{children:Q["bottom-center"]})})]})});Io.classes=Gk;Io.displayName="@mantine/notifications/Notifications";Io.show=qi.show;Io.hide=qi.hide;Io.update=qi.update;Io.clean=qi.clean;Io.cleanQueue=qi.cleanQueue;Io.updateState=qi.updateState;class Z5{constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Pu{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class eL{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(i,s){const l=i.consumeAndParse(n);return r(s,l)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(i,s,l){const u=i.consumeAndParse(n);return r(s,l,u)},precedence:n})}construct(t){return new tL(t,this.prefixParselets,this.infixParselets)}}class tL{constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let i=r.parse(this,n);for(;t>this.getPrecedence();){const s=this.consume();i=this.getInfixParselet(s).parse(this,i,s)}return i}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){var r,i;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const s=this.peek();throw Error(`Expected ${t} but got "${s.id}" (${s.value}) at line ${s.line} column ${s.column}.`)}if(n&&((i=this.peek())==null?void 0:i.value)!==n){const s=this.peek();throw Error(`Expected "${n}" but got "${s.value}" at line ${s.line} column ${s.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}const Dp="http://hl7.org",Qk="ok",nL="created",rL="gone",iL="not-modified",oL="not-found",sL="unauthorized",aL="forbidden",lL="accepted",cL={resourceType:"OperationOutcome",id:Qk,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},uL={resourceType:"OperationOutcome",id:oL,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},nu={resourceType:"OperationOutcome",id:sL,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},dL={...nu,issue:[...nu.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},Xw={...nu,issue:[...nu.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Kk={resourceType:"OperationOutcome",id:aL,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Gi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function un(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function fL(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Ip(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function Yk(e){return e.id===Qk||e.id===nL||e.id===iL||e.id===lL}function pL(e){return e.id===rL}class dt extends Error{constructor(t,n){super(Xk(t)),this.outcome=t,this.cause=n}}function Vt(e){return e instanceof dt?e.outcome:Ip(e)?e:Gi(tt(e))}function tt(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Ip(e)?Xk(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function Xk(e){var n;const t=((n=e.issue)==null?void 0:n.map(Jk))??[];return t.length>0?t.join("; "):"Unknown error"}function Jk(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function hL(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 mL(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([i,s])=>[i,hL(i,s)])),constraints:[],innerTypes:[]};return t}const gL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},yL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},vL={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"}]}}},xL={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"}]}}},bL={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"}]}}},wL={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"}]}}},SL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},jL={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"}]}}},CL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},EL={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"}]}}},kL={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"}]}}},TL={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"}]}}},PL={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"}]}}},RL={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"}]}}},_L={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"}]}}},DL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},IL={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"}]}}},AL={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"]}]}}},NL={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"]}]}}},ML={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"}]}}},OL={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"}]}}},LL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},$L={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"}]}}},FL={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"}]}}},zL={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"}]}}},BL={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"}]}}},UL={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"]}]}}},VL={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"]}]}}},WL={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"}]}}},HL={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"}]}}},qL={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"}]}}},GL={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"}]}}},QL={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"]}]}}},KL={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"}]}}},YL={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"}]}}},XL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},JL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},ZL={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"]}]}}},e7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},t7={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"}]}}},n7={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"}]}}},r7={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"}]}}},i7={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"}]}}},o7={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"]}]}}},s7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},a7={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"}]}}},l7={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"]}]}}},c7={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"}]}}},u7={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"}]}}},d7={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"}]}}},f7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},p7={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"}]}}},h7={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"}]}}},m7={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"}]}}},g7={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"]}]}}},y7={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"}]}}},v7={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"}]}}},x7={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"}]}}},b7={Element:gL,BackboneElement:yL,Address:vL,Age:xL,Annotation:bL,Attachment:wL,CodeableConcept:SL,Coding:jL,ContactDetail:CL,ContactPoint:EL,Contributor:kL,Count:TL,DataRequirement:PL,DataRequirementCodeFilter:RL,DataRequirementDateFilter:_L,DataRequirementSort:DL,Distance:IL,Dosage:AL,DosageDoseAndRate:NL,Duration:ML,ElementDefinition:OL,ElementDefinitionSlicingDiscriminator:LL,ElementDefinitionSlicing:$L,ElementDefinitionBase:FL,ElementDefinitionType:zL,ElementDefinitionExample:BL,ElementDefinitionConstraint:UL,ElementDefinitionBinding:VL,ElementDefinitionMapping:WL,Expression:HL,Extension:qL,HumanName:GL,Identifier:QL,MarketingStatus:KL,Meta:YL,Money:XL,Narrative:JL,ParameterDefinition:ZL,Period:e7,Population:t7,ProdCharacteristic:n7,ProductShelfLife:r7,Quantity:i7,Range:o7,Ratio:s7,Reference:a7,RelatedArtifact:l7,SampledData:c7,Signature:u7,SubstanceAmount:d7,SubstanceAmountReferenceRange:f7,Timing:p7,TimingRepeat:h7,TriggerDefinition:m7,UsageContext:g7,MoneyQuantity:y7,SimpleQuantity:v7,IdentityProvider:x7};function w7(e){return new j7(e).parse()}const Rf=mL(b7),ix=Object.create(null),Jw=Object.create(null),S7={"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 Zk(e){let t;return t=Jw[e],t||(t=Jw[e]=Object.create(null)),t}function Zw(e){var r;const n=(Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(i=>i.resource))??[]).filter(i=>(i==null?void 0:i.resourceType)==="StructureDefinition");p$(n);for(const i of n)eT(i)}function eT(e){var s,l;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=w7(e),n=S7[e.url];let r,i;n?(r=Rf,i=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(s=e.type)!=null&&s.startsWith("http://")||(l=e.type)!=null&&l.startsWith("https://")?(r=Rf,i=e.type):(r=Zk(e.url),i=e.type),r[i]=t;for(const u of t.innerTypes)u.parentType=t,r[u.name]=u;ix[e.url]=t}function tT(e){return!!Rf[e]}function Ap(e,t){if(t){const n=Zk(t)[e];if(n)return n}return Rf[e]}function nT(e,t){const n=Ap(e,t);if(!n)throw new dt(Gi("Unknown data type: "+e));return n}function ox(e){return!!ix[e]}function Ql(e){return ix[e]}class j7{constructor(t){var n;if(!((n=t.snapshot)!=null&&n.element)||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:k7(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,i,s,l;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const u=cg(t,this.slicingContext.path);this.slicingContext.current.elements[u]=this.parseElementDefinition(t)}}else{const u=this.parseElementDefinition(t);this.checkFieldEnter(t,u);let d=this.backboneContext;for(;d;){if((i=t.path)!=null&&i.startsWith(d.path+".")){d.type.elements[cg(t,d.path)]=u;break}d=d.parent}if(!d){const p=cg(t,this.root.path);t.isSummary&&((s=this.resourceSchema.summaryProperties)==null||s.add(p.replace("[x]",""))),u.min>0&&((l=this.resourceSchema.mandatoryProperties)==null||l.add(p.replace("[x]",""))),this.resourceSchema.elements[p]=u}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!al(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,i,s;for(;this.backboneContext&&!al((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=lS(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:al((i=this.backboneContext)==null?void 0:i.path,t.path)?this.backboneContext:(s=this.backboneContext)==null?void 0:s.parent}}enterSlice(t,n){var r,i,s,l;E7(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((i=t.slicing)==null?void 0:i.discriminator)??[]).map(u=>{if(u.type!=="value"&&u.type!=="pattern"&&u.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${u.type}`);return{path:u.path,type:u.type}}),slices:[],ordered:((s=t.slicing)==null?void 0:s.ordered)??!1,rule:(l=t.slicing)==null?void 0:l.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!al(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!al(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){var n,r,i,s,l;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const u=t.contentReference.slice(t.contentReference.indexOf("#")+1),d=this.elementIndex[u];return d?{...d,id:t.id,path:t.path,min:t.min??d.min,max:t.max??d.max,base:{path:((n=d.base)==null?void 0:n.path)??u,min:((r=t.base)==null?void 0:r.min)??((i=d.base)==null?void 0:i.min)??d.min,max:((s=t.base)==null?void 0:s.max)??((l=d.base)==null?void 0:l.max)??d.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(al(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(i=>["BackboneElement","Element"].includes(i.code))))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var i;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=lS(t)),r||(r=(i=ws(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:i.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var s,l;const n=eS(t.max),r=(s=t.base)!=null&&s.max?eS(t.base.max):n,i={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((l=t.base)==null?void 0:l.path)||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(u=>({key:u.key??"",severity:u.severity??"error",expression:u.expression??"",description:u.human??""})),type:this.parseElementDefinitionType(t),fixed:tS(_l(i,"fixed[x]")),pattern:tS(_l(i,"pattern[x]")),binding:t.binding}}}function eS(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function cg(e,t=""){return C7(e.path,t)}function C7(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function al(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function tS(e){return Array.isArray(e)&&e.length>0?e[0]:hn(e)?void 0:e}function E7(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(i=>i.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function k7(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function T7(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?P7:_l,[i,...s]=t.split(".");let l=[r(e,i,n)];for(const u of s){const d=[];for(const p of l)if(Array.isArray(p))for(const h of p)d.push(r(h,u,n));else(n!=null&&n.withPath&&p&&p.value!==void 0||!(n!=null&&n.withPath)&&p!==void 0)&&d.push(r(p,u,n));l=d}return l}function P7(e,t,n){const r=e.path;return R7(_l(e,t,n),r,t)}function R7(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((i,s)=>({...i,path:`${r}${n}[${s}]`})):{...e,path:`${r}${n}`}}const rT={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 _7(e,t,n,r){var l;if(Array.isArray(e))return!1;let i;t.path==="$this"?i=n:i=(r??n.elements)[t.path];const s=n.type;switch(t.type){case"value":case"pattern":if(!e||!i)return!1;if(i.pattern)return lx(e,i.pattern);if(i.fixed)return hs(e,i.fixed);if(((l=i.binding)==null?void 0:l.strength)==="required"&&i.binding.valueSet)return!0;break;case"type":return!e||!(s!=null&&s.length)?!1:s.some(u=>u.code===e.type)}return!1}function Xe(e){return[{type:re.boolean,value:e}]}function ni(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}:Zr(e)?{type:re.Quantity,value:e}:Ao(e)?{type:e.resourceType,value:e}:fT(e)?{type:re.CodeableConcept,value:e}:dT(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function Vi(e){return e.length===0?!1:!!e[0].value}function So(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 _l(e,t,n){if(!e.value)return;const r=Ta(e.type,t,n==null?void 0:n.profileUrl);return r?iT(e,t,r):Ru(e,t)}function iT(e,t,n){const r=e.value,i=n.type;if(!i||i.length===0)return;let s,l="undefined",u;const d=n.path.lastIndexOf("."),p=n.path.substring(d+1);for(const h of i){const m=p.replace("[x]",$n(h.code));if(s=r[m],u=r["_"+m],s!==void 0||u!==void 0){l=h.code;break}}if(u)if(Array.isArray(s)){s=s.slice();for(let h=0;h<Math.max(s.length,u.length);h++)s[h]=oS(s[h],u[h])}else s=oS(s,u);if(!hn(s))return(l==="Element"||l==="BackboneElement")&&(l=n.type[0].code),Array.isArray(s)?s.map(h=>nS(h,l)):nS(s,l)}function nS(e,t){return t==="Resource"&&Ao(e)&&(t=e.resourceType),{type:t,value:e}}function Ru(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const i=n[t];Array.isArray(i)?r=i.map(ni):r=ni(i)}else{const i=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const s of Object.values(re)){const l=i+$n(s);if(l in n){const u=n[l];Array.isArray(u)?r=u.map(d=>({type:s,value:d})):r={type:s,value:u};break}}}if(Array.isArray(r)){if(r.length===0||hn(r[0]))return}else if(hn(r))return;return r}function oT(e){const t=[];for(const n of e){let r=!1;for(const i of t)if(Vi(sx(n,i))){r=!0;break}r||t.push(n)}return t}function D7(e){return Xe(!Vi(e))}function I7(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Xe(!1):Xe(e.every((n,r)=>Vi(sx(n,t[r]))))}function A7(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Xe(!0):Xe(e.some((n,r)=>!Vi(sx(n,t[r]))))}function sx(e,t){var i,s;const n=(i=e.value)==null?void 0:i.valueOf(),r=(s=t.value)==null?void 0:s.valueOf();return typeof n=="number"&&typeof r=="number"?Xe(Math.abs(n-r)<1e-8):Zr(n)&&Zr(r)?Xe(lT(n,r)):Xe(typeof n=="object"&&typeof r=="object"?ax(e,t):n===r)}function sT(e,t){return e.length===0&&t.length===0?Xe(!0):e.length!==t.length?Xe(!1):(e.sort(rS),t.sort(rS),Xe(e.every((n,r)=>Vi(N7(n,t[r])))))}function N7(e,t){const{type:n,value:r}=e,{type:i,value:s}=t,l=r==null?void 0:r.valueOf(),u=s==null?void 0:s.valueOf();return typeof l=="number"&&typeof u=="number"?Xe(Math.abs(l-u)<.01):Zr(l)&&Zr(u)?Xe(lT(l,u)):Xe(n==="Coding"&&i==="Coding"?typeof l!="object"||typeof u!="object"?!1:l.code===u.code&&l.system===u.system:typeof l=="object"&&typeof u=="object"?ax({...l,id:void 0},{...u,id:void 0}):typeof l=="string"&&typeof u=="string"?l.toLowerCase()===u.toLowerCase():l===u)}function rS(e,t){var i,s;const n=(i=e.value)==null?void 0:i.valueOf(),r=(s=t.value)==null?void 0:s.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function aT(e,t){const{value:n}=e;if(n==null)return!1;switch(t){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return M7(n);case"DateTime":return _f(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return O7(n);case"Quantity":return Zr(n);default:return e.type===t||typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function M7(e){return typeof e=="string"&&!!rT.date.exec(e)}function _f(e){return typeof e=="string"&&!!rT.dateTime.exec(e)}function O7(e){return!!(e&&typeof e=="object"&&("start"in e&&_f(e.start)||"end"in e&&_f(e.end)))}function Zr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function lT(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 ax(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const i of n){const s=e[i],l=t[i];if(iS(s)&&iS(l)){if(!ax(s,l))return!1}else if(s!==l)return!1}return!0}function iS(e){return e!==null&&typeof e=="object"}function oS(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return L7(e??{},t)}return e}function L7(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Zt(e){const t=Ft(e),n=jo(e);return n===t?{reference:t}:{reference:t,display:n}}function Ft(e){return Pa(e)?e.reference:`${e.resourceType}/${e.id}`}function Dl(e){if(e)return Pa(e)?e.reference.split("/")[1]:e.id}function $7(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function jo(e){if($7(e)){const t=F7(e);if(t)return t}if(e.resourceType==="Device"){const t=z7(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return ms(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]),fT(t))return ms(t);if(K7(t))return t.text}return Ft(e)}function F7(e){const t=e.name;if(t&&t.length>0)return Kl(t[0])}function z7(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function B7(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=sS(n);if(r)return r}else return sS(t)}function sS(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function cT(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const i=n.getUTCFullYear(),s=n.getUTCMonth(),l=n.getUTCDate(),u=r.getUTCFullYear(),d=r.getUTCMonth(),p=r.getUTCDate();let h=u-i;(d<s||d===s&&p<l)&&h--;let m=u*12+d-(i*12+s);p<l&&m--;const v=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:h,months:m,days:v}}function U7(e,t){const{years:n,months:r,days:i}=cT(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":i.toString().padStart(3,"0")+"D"}function ws(e,...t){var r;let n=e;for(let i=0;i<t.length&&n;i++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(s=>s.url===t[i]);return n}function ki(e,t){return JSON.stringify(e,V7,t?2:void 0)??""}function V7(e,t){return!W7(e)&&hn(t)?void 0:t}function W7(e){return!!/\d+$/.exec(e)}function hn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!bn(e):!1}function bn(e){if(e==null)return!1;const t=typeof e;return t==="string"&&e!==""||t==="object"&&("length"in e&&e.length>0||Object.keys(e).length>0)}function hs(e,t,n){return e===t||hn(e)&&hn(t)?!0:hn(e)||hn(t)?!1:Array.isArray(e)&&Array.isArray(t)?H7(e,t):Array.isArray(e)||Array.isArray(t)?!1:rr(e)&&rr(t)?q7(e,t,n):(rr(e)||rr(t),!1)}function H7(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!hs(e[n],t[n]))return!1;return!0}function q7(e,t,n){const r=new Set;Object.keys(e).forEach(i=>r.add(i)),Object.keys(t).forEach(i=>r.add(i)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const i of r){const s=e[i],l=t[i];if(!hs(s,l,i))return!1}return!0}function lx(e,t){return hn(e)?!0:hn(t)?!1:Array.isArray(e)&&Array.isArray(t)?G7(e,t):Array.isArray(e)||Array.isArray(t)?!1:rr(e)&&rr(t)?Q7(e,t):rr(e)||rr(t)?!1:e===t}function G7(e,t){return t.every(n=>e.some(r=>lx(r,n)))}function Q7(e,t){return Object.entries(t).every(([n,r])=>n in e&&lx(e[n],r))}function zr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function uT(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function rr(e){return e!==null&&typeof e=="object"}function dT(e){return rr(e)&&"code"in e&&typeof e.code=="string"}function fT(e){return rr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(dT)}function K7(e){return rr(e)&&"text"in e&&typeof e.text=="string"}const pT=[];for(let e=0;e<256;e++)pT.push(e.toString(16).padStart(2,"0"));function Y7(e){const t=hT(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=pT[n[i]];return r.join("")}function X7(e){const t=hT(e),n=new Uint8Array(t),r=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=String.fromCharCode(n[i]);return window.btoa(r.join(""))}function hT(e){return ArrayBuffer.isView(e)?e.buffer:e}function $n(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function cx(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function ru(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function J7(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(i=>i.system===t))==null?void 0:r.code}function Z7(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const aS=e=>new Promise(t=>{setTimeout(t,e)});function qg(e,t,n){const r=[];for(let i=0;i<n-1;i++){const s=e.indexOf(t);if(s<0)break;r.push(e.slice(0,s)),e=e.slice(s+t.length)}return r.push(e),r}function e$(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function $c(e,t){return e?(e.push(t),e):[t]}function iu(e){return e.sort((t,n)=>t.localeCompare(n))}function ux(e){return e.endsWith("/")?e:e+"/"}function t$(e){return e.startsWith("/")?e.slice(1):e}function zi(e,t){return new URL(t$(t),ux(e.toString())).toString()}function n$(e,t){return zi(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function r$(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 mT(e,t){var n,r;return(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function i$(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const i=e.meta.profile.indexOf(t);e.meta.profile.splice(i,1)}return e}function ou(e){if(!e)return"";switch(e.type){case"Address":return gT(e.value);case"CodeableConcept":return ms(e.value);case"Coding":return _u(e.value);case"ContactPoint":return e.value.value;case"HumanName":return Kl(e.value);case"Quantity":return ra(e.value);case"Reference":return o$(e.value);default:return e.value.toString()}}function o$(e){return e?e.display??e.reference??ki(e):""}function gT(e,t){const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&(t!=null&&t.use),n.join(", ").trim()}function Kl(e,t){const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=au(e.text);if(r)return r}return n.join(" ").trim()}function Np(e){return e instanceof Date&&!isNaN(e.getTime())}function s$(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Np(r)?r.toLocaleTimeString(t,n):""}function fr(e,t,n){if(!e)return"";const r=new Date(e);return Np(r)?r.toLocaleString(t,n):""}function a$(e,t,n){return!e||!e.start&&!e.end?"":fr(e.start,t,n)+" - "+fr(e.end,t,n)}const l$={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},c$={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},u$={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function yT(e){if(!e)return"";const t=[];return d$(t,e.repeat),e.event&&t.push(e.event.map(n=>fr(n)).join(", ")),$n(t.join(" ").trim())}function d$(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,i=t.periodUnit;n===1&&r===1?e.push(l$[i]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+c$[i]):e.push("per "+r+" "+u$[i])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map($n).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(s=>s$(s)).join(", "))}function su(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},i=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(i==null?void 0:i.value)===void 0?`>= ${ra(r)}`:(r==null?void 0:r.value)===void 0&&(i==null?void 0:i.value)!==void 0?`<= ${ra(i)}`:((r==null?void 0:r.unit)===(i==null?void 0:i.unit)&&(r==null||delete r.unit),`${ra(r)} - ${ra(i)}`)}function ra(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 f$(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ms(e){if(!e)return"";const t=au(e.text);return t||(e.coding?e.coding.map(n=>_u(n)).join(", "):"")}function _u(e,t){const n=au(e==null?void 0:e.display);return n?`${n}`:au(e==null?void 0:e.code)??""}function vT(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(ra(e.valueQuantity));else if(e.valueCodeableConcept)t.push(ms(e.valueCodeableConcept));else{const n=au(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>vT(n)).join(" / ")),t.join(" / ").trim()}function au(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 p$(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)(r==null?void 0:r.resourceType)==="StructureDefinition"&&r.kind==="resource"&&xT(r.type)}function xT(e){let t=Ki.types[e];return t||(t={searchParamsDetails:{}},Ki.types[e]=t),t.searchParams||(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function h$(e){for(const t of e.base??[]){const n=xT(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function lS(e){var n,r,i,s;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?m$((s=((i=e.base)==null?void 0:i.path)??e.path)==null?void 0:s.split(".")):t}function m$(e){return e.length===1?e[0]:e.map($n).join("")}function dx(e){var t;return(t=Ki.types[e])==null?void 0:t.searchParams}function g$(e,t){var n,r;return(r=(n=Ki.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function da(e){const t=e.replaceAll("[x]","").split(".").pop();return bT(t)}function bT(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(v$).join(" ").replace("_"," ").replace(/\s+/g," ")}const y$=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function v$(e){const t=e.toUpperCase();return e===t?e:y$.has(t)?t:t.charAt(0)+e.slice(1)}function Ta(e,t,n){const r=Ap(e,n);if(r)return x$(r.elements,t)}function x$(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const i=t[r];if(i>="A"&&i<="Z"){const s=t.slice(0,r)+"[x]",l=e[s];if(l)return l}}}function Ao(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Pa(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Ki={types:{}};function mf(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 uo=()=>[],Sr={empty:(e,t)=>Xe(t.length===0||t.every(n=>hn(n.value))),hasValue:(e,t)=>Xe(t.length!==0),exists:(e,t,n)=>Xe(n?t.filter(r=>Vi(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!hn(r.value))),all:(e,t,n)=>Xe(t.every(r=>Vi(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Xe(!1);return Xe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Xe(!0);return Xe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Xe(!1);return Xe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Xe(!0);return Xe(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Xe(!0);const r=n.eval(e,Ws(e));return r.length===0?Xe(!1):Xe(t.every(i=>r.some(s=>s.value===i.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Ws(e));return r.length===0?Xe(!0):t.length===0?Xe(!1):Xe(r.every(i=>t.some(s=>s.value===i.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(i=>i.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Xe(t.length===Sr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Vi(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:uo,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{var i;const r=(i=n.eval(e,t)[0])==null?void 0:i.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{var i;const r=(i=n.eval(e,t)[0])==null?void 0:i.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,Ws(e)),i=[];for(const s of t)!i.some(l=>l.value===s.value)&&r.some(l=>l.value===s.value)&&i.push(s);return i},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ws(e)),i=[];for(const s of t)r.some(l=>l.value===s.value)||i.push(s);return i},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ws(e));return oT([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Ws(e));return[...t,...r]},htmlChecks:(e,t,n)=>[ni(!0)],iif:(e,t,n,r,i)=>{const s=n.eval(e,t);if(s.length>1||s.length===1&&typeof s[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Vi(s)?r.eval(e,t):i?i.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Xe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Xe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Xe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Xe(Sr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(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?[]:Xe(Sr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:mf(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Xe(Sr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:mf(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Xe(Sr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(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?[]:Xe(Sr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(t,1);return Zr(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?[]:Xe(Sr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(t,1);return n==null?[]:Zr(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Xe(Sr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=Bi(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:mf("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Xe(Sr.toTime(e,t).length===1),indexOf:(e,t,n)=>Xr((r,i)=>r.indexOf(i),e,t,n),substring:(e,t,n,r)=>Xr((i,s,l)=>{const u=s,d=l?u+l:i.length;return u<0||u>=i.length?void 0:i.substring(u,d)},e,t,n,r),startsWith:(e,t,n)=>Xr((r,i)=>r.startsWith(i),e,t,n),endsWith:(e,t,n)=>Xr((r,i)=>r.endsWith(i),e,t,n),contains:(e,t,n)=>Xr((r,i)=>r.includes(i),e,t,n),upper:(e,t)=>Xr(n=>n.toUpperCase(),e,t),lower:(e,t)=>Xr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Xr((i,s,l)=>i.replaceAll(s,l),e,t,n,r),matches:(e,t,n)=>Xr((r,i)=>!!new RegExp(i).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Xr((i,s,l)=>i.replaceAll(s,l),e,t,n,r),length:(e,t)=>Xr(n=>n.length,e,t),toChars:(e,t)=>Xr(n=>n?n.split(""):void 0,e,t),encode:uo,decode:uo,escape:uo,unescape:uo,trim:uo,split:uo,join:(e,t,n)=>{var i;const r=((i=n==null?void 0:n.eval(e,Ws(e))[0])==null?void 0:i.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(s=>{var l;return((l=s.value)==null?void 0:l.toString())??""}).join(r)}]},abs:(e,t)=>$i(Math.abs,e,t),ceiling:(e,t)=>$i(Math.ceil,e,t),exp:(e,t)=>$i(Math.exp,e,t),floor:(e,t)=>$i(Math.floor,e,t),ln:(e,t)=>$i(Math.log,e,t),log:(e,t,n)=>$i((r,i)=>Math.log(r)/Math.log(i),e,t,n),power:(e,t,n)=>$i(Math.pow,e,t,n),round:(e,t)=>$i(Math.round,e,t),sqrt:(e,t)=>$i(Math.sqrt,e,t),truncate:(e,t)=>$i(n=>n|0,e,t),children:uo,descendants:uo,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,i)=>{var p;const s=Sr.toDateTime(e,n.eval(e,t));if(s.length===0)throw new Error("Invalid start date");const l=Sr.toDateTime(e,r.eval(e,t));if(l.length===0)throw new Error("Invalid end date");const u=(p=i.eval(e,t)[0])==null?void 0:p.value;if(u!=="years"&&u!=="months"&&u!=="days")throw new Error("Invalid units");const d=cT(s[0].value,l[0].value);return[{type:re.Quantity,value:{value:d[u],unit:u}}]},is:(e,t,n)=>{let r="";return n instanceof Df?r=n.name:n instanceof px&&(r=n.left.name+"."+n.right.name),r?t.map(i=>({type:re.boolean,value:aT(i,r)})):[]},not:(e,t)=>Sr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let i;if(typeof r=="string")i=r;else if(typeof r=="object"){const s=r;if(s.resource)return ni(s.resource);s.reference?i=s.reference:s.type&&s.identifier&&(i=`${s.type}?identifier=${s.identifier.system}|${s.identifier.value}`)}if(i!=null&&i.includes("?")){const[s]=i.split("?");return{type:s,value:{resourceType:s}}}if(i!=null&&i.includes("/")){const[s,l]=i.split("/");return{type:s,value:{resourceType:s,id:l}}}return{type:re.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:re.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:re.BackboneElement,value:{namespace:"System",name:"Integer"}}: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 i=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(s=>{var l;return{type:re.boolean,value:((l=s.value)==null?void 0:l.resourceType)===i}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let i="";return n instanceof Df&&(i=n.name),i&&!r.reference.startsWith(i+"/")?[]:[{type:re.id,value:Dl(r)}]},extension:(e,t,n)=>{var s;const r=n.eval(e,t)[0].value,i=(s=t==null?void 0:t[0])==null?void 0:s.value;if(i){const l=ws(i,r);if(l)return[{type:re.Extension,value:l}]}return[]}};function Xr(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Bi(n,1);if(typeof i!="string")throw new Error("String function cannot be called with non-string");const s=e(i,...r.map(l=>{var u;return(u=l==null?void 0:l.eval(t,n)[0])==null?void 0:u.value}));return s===void 0?[]:Array.isArray(s)?s.map(ni):[ni(s)]}function $i(e,t,n,...r){if(n.length===0)return[];const[{value:i}]=Bi(n,1),s=Zr(i),l=s?i.value:i;if(typeof l!="number")throw new Error("Math function cannot be called with non-number");const u=e(l,...r.map(h=>{var m;return(m=h.eval(t,n)[0])==null?void 0:m.value})),d=s?re.Quantity:n[0].type,p=s?{...i,value:u}:u;return[{type:d,value:p}]}function Bi(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 Ws(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class b${constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const i of n)r.push(this.child.eval({parent:t,variables:{$this:i}},[i]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class ll{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Df{constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(i=>this.evalValue(i)).filter(i=>(i==null?void 0:i.value)!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return Ao(n)&&n.resourceType===this.name?t:_l(t,this.name)}toString(){return this.name}}class w${eval(){return[]}toString(){return"{}"}}class S$ extends Z5{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 fx extends Pu{constructor(t,n){super("as",t,n)}eval(t,n){return Sr.ofType(t,this.left.eval(t,n),this.right)}}class Dr extends Pu{}class vi extends Dr{constructor(t,n,r,i){super(t,n,r),this.impl=i}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.eval(t,n);if(i.length!==1)return[];const s=r[0].value,l=i[0].value,u=Zr(s)?s.value:s,d=Zr(l)?l.value:l,p=this.impl(u,d);return typeof p=="boolean"?Xe(p):Zr(s)?[{type:re.Quantity,value:{...s,value:p}}]:[ni(p)]}}class j$ extends Pu{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n),s=[...r,...i];return s.length>0&&s.every(l=>typeof l.value=="string")?[{type:re.string,value:s.map(l=>l.value).join("")}]:s}}class C$ extends Dr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return Xe(r.some(s=>s.value===i[0].value))}}class E$ extends Dr{constructor(t,n){super("in",t,n)}eval(t,n){const r=So(this.left.eval(t,n)),i=this.right.eval(t,n);return r?Xe(i.some(s=>s.value===r.value)):[]}}class px extends Pu{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 wT extends Pu{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return oT([...r,...i])}}class k$ extends Dr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return I7(r,i)}}class T$ extends Dr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return A7(r,i)}}class P$ extends Dr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return sT(r,i)}}class R$ extends Dr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),i=this.right.eval(t,n);return D7(sT(r,i))}}class hx extends Dr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const i=this.right.name;return Xe(aT(r[0],i))}}class _$ extends Dr{constructor(t,n){super("and",t,n)}eval(t,n){const r=So(this.left.eval(t,n),"boolean"),i=So(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(i==null?void 0:i.value)===!0?Xe(!0):(r==null?void 0:r.value)===!1||(i==null?void 0:i.value)===!1?Xe(!1):[]}}class D$ extends Dr{constructor(t,n){super("or",t,n)}eval(t,n){const r=So(this.left.eval(t,n),"boolean"),i=So(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(i==null?void 0:i.value)===!1?Xe(!1):r!=null&&r.value||i!=null&&i.value?Xe(!0):[]}}class I$ extends Dr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=So(this.left.eval(t,n),"boolean"),i=So(this.right.eval(t,n),"boolean");return!r||!i?[]:Xe(r.value!==i.value)}}class A$ extends Dr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=So(this.left.eval(t,n),"boolean"),i=So(this.right.eval(t,n),"boolean");return(i==null?void 0:i.value)===!0||(r==null?void 0:r.value)===!1?Xe(!0):!r||!i?[]:Xe(!1)}}class mx{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Sr[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 gx{constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const i=r[0].value;if(typeof i!="number")throw new Error("Invalid indexer expression: should return integer}");const s=this.left.eval(t,n);return i in s?[s[i]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const N$=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class M${constructor(t,n,r,i){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(i!=null&&i.dateTimeLiterals),this.symbolRegex=(i==null?void 0:i.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
92
- `))}consumeString(t){this.advance();const n=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),n}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let i=this.str.substring(t,this.pos.index);return i.endsWith("T")?i=i.substring(0,i.length-1):!i.startsWith("T")&&n&&!r&&(i+="Z"),this.buildToken("DateTime",i)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&O$(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.value)!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}prev(){return this.str[this.pos.index-1]??""}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
93
- `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function O$(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&N$.includes(e.value)))}const L$=["true","false"],$$=["!=","!~","<=",">=","{}","->"];function F$(e){return new M$(e,L$,$$).tokenize()}const Ut={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},z$={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},B$={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new gx(t,n)},precedence:Ut.Indexer},U$={parse(e,t){if(!(t instanceof Df))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new mx(t.name,n)},precedence:Ut.FunctionCall};function V$(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function W$(){return new eL().registerPrefix("String",{parse:(e,t)=>new ll({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new ll({type:re.dateTime,value:mf(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new ll({type:re.Quantity,value:V$(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new ll({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new ll({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new ll({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Df(t.value)}).registerPrefix("{}",{parse:()=>new w$}).registerPrefix("(",z$).registerInfix("[",B$).registerInfix("(",U$).prefix("+",Ut.UnaryAdd,(e,t)=>new S$("+",t,n=>n)).prefix("-",Ut.UnarySubtract,(e,t)=>new vi("-",t,t,(n,r)=>-r)).infixLeft(".",Ut.Dot,(e,t,n)=>new px(e,n)).infixLeft("/",Ut.Divide,(e,t,n)=>new vi("/",e,n,(r,i)=>r/i)).infixLeft("*",Ut.Multiply,(e,t,n)=>new vi("*",e,n,(r,i)=>r*i)).infixLeft("+",Ut.Add,(e,t,n)=>new vi("+",e,n,(r,i)=>r+i)).infixLeft("-",Ut.Subtract,(e,t,n)=>new vi("-",e,n,(r,i)=>r-i)).infixLeft("|",Ut.Union,(e,t,n)=>new wT(e,n)).infixLeft("=",Ut.Equals,(e,t,n)=>new k$(e,n)).infixLeft("!=",Ut.NotEquals,(e,t,n)=>new T$(e,n)).infixLeft("~",Ut.Equivalent,(e,t,n)=>new P$(e,n)).infixLeft("!~",Ut.NotEquivalent,(e,t,n)=>new R$(e,n)).infixLeft("<",Ut.LessThan,(e,t,n)=>new vi("<",e,n,(r,i)=>r<i)).infixLeft("<=",Ut.LessThanOrEquals,(e,t,n)=>new vi("<=",e,n,(r,i)=>r<=i)).infixLeft(">",Ut.GreaterThan,(e,t,n)=>new vi(">",e,n,(r,i)=>r>i)).infixLeft(">=",Ut.GreaterThanOrEquals,(e,t,n)=>new vi(">=",e,n,(r,i)=>r>=i)).infixLeft("&",Ut.Ampersand,(e,t,n)=>new j$(e,n)).infixLeft("and",Ut.And,(e,t,n)=>new _$(e,n)).infixLeft("as",Ut.As,(e,t,n)=>new fx(e,n)).infixLeft("contains",Ut.Contains,(e,t,n)=>new C$(e,n)).infixLeft("div",Ut.Divide,(e,t,n)=>new vi("div",e,n,(r,i)=>r/i|0)).infixLeft("in",Ut.In,(e,t,n)=>new E$(e,n)).infixLeft("is",Ut.Is,(e,t,n)=>new hx(e,n)).infixLeft("mod",Ut.Modulo,(e,t,n)=>new vi("mod",e,n,(r,i)=>r%i)).infixLeft("or",Ut.Or,(e,t,n)=>new D$(e,n)).infixLeft("xor",Ut.Xor,(e,t,n)=>new I$(e,n)).infixLeft("implies",Ut.Implies,(e,t,n)=>new A$(e,n))}const H$=W$();function ST(e){return new b$(e,H$.construct(F$(e)).consumeAndParse())}function Yl(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const i=n[r];typeof i=="object"&&"type"in i&&"value"in i||(n[r]=ni(n[r]))}return fa(e,n).map(r=>r.value)}function fa(e,t,n={}){return ST(e).eval({variables:n},t).map(i=>{var s;return{type:i.type,value:(s=i.value)==null?void 0:s.valueOf()}})}var ho=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(ho||{});function Xl(e,t){var r,i;let n=(i=(r=Ki.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:i[t.code];return n||(n=G$(e,t)),n}function q$(e,t,n){let r=Ki.types[e];r||(r={},Ki.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function G$(e,t){const n=t.code,r=X$(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of r){const u=gf(l),d=e$(()=>u.join("."));u.length===1&&u[0]instanceof Dr?i.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?i.propertyTypes.add("Identifier"):d().endsWith("extension.value.code")||d().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):jT(i,u,e,1),d().endsWith("extension.valueDateTime")&&(i.array=!1)}const s={type:Y$(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return q$(e,n,s),s}function jT(e,t,n,r){const i=t[r];if(i instanceof fx){e.propertyTypes.add(i.right.toString());return}if(i instanceof mx){Q$(e,i);return}const s=i.toString(),l=Ta(n,s);if(!l)throw new Error(`Element definition not found for ${n} ${s}`);let u=!1,d=r+1;if(d<t.length&&t[d]instanceof gx&&(u=!0,d++),l.isArray&&!u&&(e.array=!0),d>=t.length){e.elementDefinitions.push(l);for(const p of l.type)e.propertyTypes.add(p.code);return}for(const p of l.type){let h=p.code;K$(h)&&(h=l.type[0].code),jT(e,t,h,d)}}function Q$(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 hx){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function K$(e){return e==="Element"||e==="BackboneElement"}function Y$(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(re.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(re.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function X$(e,t){const n=[],r=ST(t);return Gg(e,r.child,n),n}function Gg(e,t,n){t instanceof wT?(Gg(e,t.left,n),Gg(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function gf(e){if(e instanceof fx||e instanceof gx)return[gf(e.left),e].flat();if(e instanceof Dr)return[e];if(e instanceof px)return[gf(e.left),gf(e.right)].flat();if(e instanceof mx){if(e.name==="where"&&!(e.args[0]instanceof hx))return[];if(e.name==="last")return[]}return[e]}const Mp=20;var Se=(e=>(e.EQUALS="eq",e.NOT_EQUALS="ne",e.GREATER_THAN="gt",e.LESS_THAN="lt",e.GREATER_THAN_OR_EQUALS="ge",e.LESS_THAN_OR_EQUALS="le",e.STARTS_AFTER="sa",e.ENDS_BEFORE="eb",e.APPROXIMATELY="ap",e.CONTAINS="contains",e.STARTS_WITH="sw",e.EXACT="exact",e.TEXT="text",e.NOT="not",e.ABOVE="above",e.BELOW="below",e.IN="in",e.NOT_IN="not-in",e.OF_TYPE="of-type",e.MISSING="missing",e.PRESENT="present",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(Se||{});const CT={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},yx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap",sw:"sw"};function ET(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[l,u]=e.split("?");n=l,r=new URLSearchParams(u)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let i;n.includes("/")?i=n.split("/").filter(Boolean).pop():i=n;const s=[];return r&&s.push(...r.entries()),J$(i,s)}function J$(e,t){const n={resourceType:e};for(const[r,i]of t)Z$(n,r,i);return n}function Z$(e,t,n){var l,u;let r,i;const s=t.indexOf(":");if(s>=0?(r=t.substring(0,s),i=t.substring(s+1)):(r=t,i=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=$c(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":e6(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const d=cS(n);i==="iterate"&&(d.modifier="iterate"),e.include=$c(e.include,d);break}case"_revinclude":{const d=cS(n);i==="iterate"&&(d.modifier="iterate"),e.revInclude=$c(e.revInclude,d);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const d=(u=(l=Ki.types[e.resourceType])==null?void 0:l.searchParams)==null?void 0:u[r];d?e.filters=$c(e.filters,n6(d,i,n)):e.filters=$c(e.filters,r6(r,i,n))}}}}function e6(e,t){for(const n of t.split(",")){let r,i=!1;n.startsWith("-")?(r=n.substring(1),i=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:i})}}const t6=["missing","present"];function n6(e,t,n){if(t6.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:i}=i6(n);if(!uS(e,i))throw new dt(Gi(`Invalid format for ${e.type} search parameter: ${i}`));return{code:e.code,operator:r,value:i}}case"reference":case"string":case"token":case"uri":if(!uS(e,n))throw new dt(Gi(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:o6(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function r6(e,t,n){var i;let r="eq";if(t)r=t;else if(n.length>=2){const s=n.substring(0,2);s in yx&&(n.length===2||(i=n.at(2))!=null&&i.match(/\d/))&&(r=s,n=n.substring(s.length))}return{code:e,operator:r,value:n}}function i6(e){const t=e.substring(0,2),n=yx[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function o6(e){return CT[e]??"eq"}function cS(e){const t=e.split(":");if(t.includes("*"))throw new dt(Gi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new dt(Gi(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new dt(Gi(`Invalid include value '${e}'`))}function uS(e,t){switch(e.type){case"date":return _f(t);default:return!0}}function ml(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(s6(n))),e.sortRules&&e.sortRules.length>0&&t.push(a6(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.include&&e.include.forEach(n=>t.push(dS("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(dS("_revinclude",n))),t.length===0?"":(iu(t),"?"+t.join("&"))}function s6(e){const t=e.operator in CT?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in yx?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function a6(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function dS(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function vx(e){const t=[];let n="",r=!1;for(const i of e)r?(n+=i,r=!1):i==="\\"?r=!0:i===","?(t.push(n),n=""):n+=i;return t.push(n),t}function l6(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!c6(e,t,n))return!1}return!0}function c6(e,t,n){var i,s;const r=(s=(i=Ki.types[t.resourceType])==null?void 0:i.searchParams)==null?void 0:s[n.code];if(!r)return!1;if(n.operator===Se.MISSING||n.operator===Se.PRESENT)return u6(e,n,r);switch(r.type){case"reference":return d6(e,n,r);case"string":case"uri":return kT(e,n,r);case"token":return f6(e,n,r);case"date":return g6(e,n,r);default:return!1}}function u6(e,t,n){const i=Yl(n.expression,e).length>0;return(t.operator===Se.MISSING&&t.value==="false"||t.operator===Se.PRESENT&&t.value==="true")===i}function d6(e,t,n){const r=Yl(n.expression,e),i=Op(t.operator);if(t.value===""&&r.length===0)return t.operator===Se.EQUALS;const s=r.map(l=>typeof l=="string"?l:l.reference);for(const l of vx(t.value)){let u=s.includes(l);if(!u&&t.code==="_compartment"&&(u=s.some(d=>d==null?void 0:d.endsWith("/"+l))),u)return!i}return i}function f6(e,t,n){return Xl(e.resourceType,n).type===ho.BOOLEAN?p6(e,t,n):kT(e,t,n,!0)}function p6(e,t,n){const r=Yl(n.expression,e),i=t.value==="true",s=r.includes(i);return Op(t.operator)?!s:s}function kT(e,t,n,r){var p,h,m,v;const s=(v=(m=(h=(p=Xl(e.resourceType,n).elementDefinitions)==null?void 0:p[0])==null?void 0:h.type)==null?void 0:m[0])==null?void 0:v.code,l=Yl(n.expression,e),u=vx(t.value),d=Op(t.operator);for(const x of l)for(const b of u){let w;if(s===re.Identifier?w=h6(x,t.operator,b):s===re.CodeableConcept?w=m6(x,t.operator,b):w=Qg(x,t.operator,b,r),w)return!d}return d}function Qg(e,t,n,r){if(r&&n.includes("|")){const[s,l]=n.split("|");return Qg(e,t,s,!1)&&(!l||Qg(e,t,l,!1))}let i="";return e&&(typeof e=="string"?i=e:typeof e=="object"&&(i=JSON.stringify(e))),i.toLowerCase().includes(n.toLowerCase())}function h6(e,t,n){var r,i,s,l;if(n.includes("|")){const[u,d]=n.split("|").map(p=>p.toLowerCase());return!u&&!d?!1:u?((i=e.system)==null?void 0:i.toLowerCase())===u&&(!d||((s=e.value)==null?void 0:s.toLowerCase())===d):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===d}return((l=e.value)==null?void 0:l.toLowerCase())===n.toLowerCase()}function m6(e,t,n){var r,i,s,l;if(n.includes("|")){const[u,d]=n.split("|").map(p=>p.toLowerCase());return!u&&!d?!1:u?((i=e.coding)==null?void 0:i.some(p=>{var h,m;return((h=p.system)==null?void 0:h.toLowerCase())===u&&(!d||((m=p.code)==null?void 0:m.toLowerCase())===d)}))??!1:((r=e.coding)==null?void 0:r.some(p=>{var h;return!p.system&&((h=p.code)==null?void 0:h.toLowerCase())===d}))??!1}return((s=e.text)==null?void 0:s.toLowerCase())===n.toLowerCase()||(((l=e.coding)==null?void 0:l.some(u=>{var d;return((d=u.code)==null?void 0:d.toLowerCase())===n.toLowerCase()}))??!1)}function g6(e,t,n){const r=Yl(n.expression,e),i=vx(t.value),s=Op(t.operator);for(const l of r)for(const u of i)if(y6(l,t.operator,u))return!s;return s}function y6(e,t,n){switch(t){case Se.STARTS_AFTER:case Se.GREATER_THAN:return e>n;case Se.GREATER_THAN_OR_EQUALS:return e>=n;case Se.ENDS_BEFORE:case Se.LESS_THAN:return e<n;case Se.LESS_THAN_OR_EQUALS:return e<=n;case Se.EQUALS:case Se.NOT_EQUALS:return e===n;default:return!1}}function Op(e){return e===Se.NOT_EQUALS||e===Se.NOT}const v6={resourceType:"*"},x6=["DomainConfiguration","JsonWebKey","Login"],b6=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"];var xx=(e=>(e.READ="read",e.VREAD="vread",e.UPDATE="update",e.PATCH="patch",e.DELETE="delete",e.HISTORY="history",e.HISTORY_INSTANCE="history-instance",e.HISTORY_TYPE="history-type",e.HISTORY_SYSTEM="history-system",e.CREATE="create",e.SEARCH="search",e.SEARCH_TYPE="search-type",e.SEARCH_SYSTEM="search-system",e.SEARCH_COMPARTMENT="search-compartment",e.CAPABILITIES="capabilities",e.TRANSACTION="transaction",e.BATCH="batch",e.OPERATION="operation",e))(xx||{});const w6=["read","vread","history","history-instance"];function S6(e,t){if(x6.includes(t))return!1;if(e.resource){for(const n of e.resource)if(PT(n.resourceType,t)&&!n.readonly)return!0}return!1}function TT(e,t,n){if(!n)return v6;if(n.resource){for(const r of n.resource)if(j6(e,t,r))return r}}function j6(e,t,n){var i,s;const r=e.resourceType;return!(!PT(n.resourceType,r)||n.readonly&&!w6.includes(t)||n.compartment&&!((s=(i=e.meta)==null?void 0:i.compartment)!=null&&s.find(l=>{var u;return l.reference===((u=n.compartment)==null?void 0:u.reference)}))||n.criteria&&!l6(e,ET(n.criteria)))}function PT(e,t){return e===t||e==="*"&&!b6.includes(t)}function C6(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function E6(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function fS(){const e=new Uint32Array(28);return crypto.getRandomValues(e),Y7(e.buffer)}async function k6(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function RT(){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 _T(e){var i,s,l;const t={};e=zr(e);for(const u of e.entry||[]){((i=u.resource)==null?void 0:i.meta)!==void 0&&(delete u.resource.meta.author,delete u.resource.meta.compartment,delete u.resource.meta.lastUpdated,delete u.resource.meta.project,delete u.resource.meta.versionId);const d=(s=u.resource)==null?void 0:s.id;d&&(t[d]=RT(),u.fullUrl="urn:uuid:"+t[d],(l=u.resource)==null||delete l.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(u=>({fullUrl:u.fullUrl,request:{method:"POST",url:u.resource.resourceType},resource:u.resource}))},(u,d)=>T6(u,d,t),2);return P6(JSON.parse(r))}function T6(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const i=n[r];if(i)return"urn:uuid:"+i}}return t}function P6(e){const t=_6(e),{sorted:n,cycles:r}=R6(t),i={};for(const l of e.entry??[])l.fullUrl&&(i[l.fullUrl]=l);const s=n.map(l=>i[l]);for(const l of r)for(const u of l){const d=i[u],p={...d,request:{...d.request,method:"PUT"}};s.push(p)}return{...e,entry:s}}function R6(e){const t=[],n={},r=[];for(const s of Object.keys(e))n[s]=0;function i(s,l){if(n[s]===2)return!0;if(n[s]===1){const d=l.lastIndexOf(s);return d!==-1&&r.push(l.slice(d)),!0}n[s]=1,l.push(s);let u=!1;for(const d of e[s])i(d,l)||(u=!0);return n[s]=2,l.pop(),t.unshift(s),!u}for(const s in e)n[s]===0&&i(s,[]);return{sorted:t,cycles:r}}function DT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Pa(r)){const i=r.reference;i.startsWith("urn:uuid:")&&t(i)}else DT(r,t)}}function _6(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&&DT(n.resource,i=>{t[i]&&t[i].push(r)})}return t}class IT{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 Cn={FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",JSON:"application/json",JSON_PATCH:"application/json-patch+json",TEXT:"text/plain",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml"};class D6{constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let i=0;i<r.length;i++)if(r[i]===n){r.splice(i,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}}class Lp{constructor(){this.emitter=new D6}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 Kg={"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"},I6=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],bx=["DiagnosticReport-update"];function A6(e){return bx.includes(e)}function N6(e){if(bx.includes(e))throw new dt(un(`'context.version' is required for '${e}'.`))}const M6={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function O6(e){return I6.includes(e)}function AT(e){return!!e.endpoint}function pS(e){if(!wx(e))throw new dt(un("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:i}=e,s={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":i.join(",")};return AT(e)&&(s.endpoint=e.endpoint),new URLSearchParams(s).toString()}function wx(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:i}=e;if(!(t&&n&&r&&i)||typeof r!="string"||typeof i!="object"||!Array.isArray(i)||i.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const s of i)if(!Kg[s])return!1;return!(AT(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function hS(e,t,n,r){if(typeof t!="object")throw new dt(un(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new dt(un(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new dt(un(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const i=r.resourceType;if(i!=="*"){if(!O6(t.resourceType))throw new dt(un(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(i&&t.resourceType!==i)throw new dt(un(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${i}.`))}}function L6(e,t,n,r,i){if(i.set(t.key,(i.get(t.key)??0)+1),!r.isArray)hS(e,t.resource,n,r);else{const{resources:s}=t;if(!s)throw new dt(un(`context[${n}] is invalid. context[${n}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const l of s)hS(e,l,n,r)}}function $6(e,t){const n=new Map,r=M6[e];for(let i=0;i<t.length;i++){const s=t[i].key;if(!r[s])throw new dt(un(`Key '${s}' not found for event '${e}'. Make sure to add only valid keys.`));L6(e,t[i],i,r[s],n)}for(const[i,s]of Object.entries(r)){if(!(s.optional||n.has(i)))throw new dt(un(`Missing required key '${i}' on context for '${e}' event.`));if(!s.manyAllowed&&(n.get(i)||0)>1)throw new dt(un(`${n.get(i)} context entries with key '${i}' found for the '${e}' event when schema only allows for 1.`))}}function mS(e,t,n,r){if(!(e&&typeof e=="string"))throw new dt(un("Must provide a topic."));if(!Kg[t])throw new dt(un(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Kg).join(", ")}`));if(typeof n!="object")throw new dt(un("context must be a context object or array of context objects."));if(bx.includes(t)&&!r)throw new dt(un(`The '${t}' event must contain a 'context.versionId'.`));const i=Array.isArray(n)?n:[n];return $6(t,i),{timestamp:new Date().toISOString(),id:RT(),event:{"hub.topic":e,"hub.event":t,context:i,...r?{"context.versionId":r}:{}}}}class F6 extends Lp{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new dt(un("Subscription request should contain an endpoint."));if(!wx(t))throw new dt(un("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const i=JSON.parse(r.data);if(i["hub.topic"])return;const s=i;s.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:s}),n.send(JSON.stringify({id:i==null?void 0:i.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function z6(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=C6(t),r=Array.from(n).reduce((s,l)=>{const u=("00"+l.charCodeAt(0).toString(16)).slice(-2);return`${s}%${u}`},""),i=decodeURIComponent(r);return JSON.parse(i)}function B6(e){return e.split(".").length===3}function Sx(e){const[t,n,r]=e.split(".");return z6(n)}function U6(e){try{return typeof Sx(e).login_id=="string"}catch{return!1}}function V6(e){try{const n=Sx(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class W6{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,Cn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var NT;NT=Symbol.toStringTag;class xi{constructor(t){this[NT]="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 H6{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new q6)}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 q6{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
94
- * Reconnecting WebSocket
95
- * by Pedro Ladaria <pedro.ladaria@gmail.com>
96
- * https://github.com/pladaria/reconnecting-websocket
97
- * License MIT
98
- *
99
- * Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
100
- * https://github.com/partykit/partykit/blob/main/packages/partysocket
101
- */const bl={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let gS=!1;function G6(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");bl.Event=globalThis.Event,bl.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},bl.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function Q6(e,t){if(!e)throw new Error(t)}function tf(e){return new e.constructor(e.type,e)}const Hs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let yS=!1;class as extends Lp{constructor(t,n,r={}){gS||(G6(),gS=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=i=>{this._debug("open event");const{minUptime:s=Hs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),s),Q6(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(l=>{var u;return(u=this._ws)==null?void 0:u.send(l)}),this._messageQueue=[],this.onopen&&this.onopen(i),this.dispatchEvent(tf(i))},this._handleMessage=i=>{this._debug("message event"),this.onmessage&&this.onmessage(i),this.dispatchEvent(tf(i))},this._handleError=i=>{this._debug("error event",i.message),this._disconnect(void 0,i.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(i),this._debug("exec error listeners"),this.dispatchEvent(tf(i)),this._connect()},this._handleClose=i=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(i),this.dispatchEvent(tf(i))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return as.CONNECTING}get OPEN(){return as.OPEN}get CLOSING(){return as.CLOSING}get CLOSED(){return as.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){var n;return this._messageQueue.reduce((r,i)=>(typeof i=="string"?r+=i.length:i instanceof Blob?r+=i.size:r+=i.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?as.CLOSED:as.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=Hs.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=Hs.reconnectionDelayGrowFactor,minReconnectionDelay:n=Hs.minReconnectionDelay,maxReconnectionDelay:r=Hs.maxReconnectionDelay}=this._options;let i=0;return this._retryCount>0&&(i=n*Math.pow(t,this._retryCount-1),i>r&&(i=r)),this._debug("next delay",i),i}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Hs.maxRetries,connectionTimeout:n=Hs.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"&&!yS&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),yS=!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 bl.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new bl.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new bl.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 K6=5e3;class Yg extends Lp{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 Y6{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Yg(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class X6{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof OT))throw new dt(un("First arg of constructor should be a `MedplumClient`"));let i;try{i=new URL(n).toString()}catch{throw new dt(un("Not a valid URL"))}const s=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new as(i,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=s,this.masterSubEmitter=new Yg,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??K6,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,i,s,l,u,d;try{const p=JSON.parse(n.data);if(p.type==="pong"){this.waitingForPong=!1;return}const h=p,m=(i=(r=h==null?void 0:h.entry)==null?void 0:r[0])==null?void 0:i.resource;if(m.type==="heartbeat"){(s=this.masterSubEmitter)==null||s.dispatchEvent({type:"heartbeat",payload:h});return}if(m.type==="handshake"){const x=Dl(m.subscription),b={type:"connect",payload:{subscriptionId:x}};(l=this.masterSubEmitter)==null||l.dispatchEvent(b);const w=this.criteriaEntriesBySubscriptionId.get(x);if(!w){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}w.connecting=!1,w.emitter.dispatchEvent({...b});return}(u=this.masterSubEmitter)==null||u.dispatchEvent({type:"message",payload:h});const v=this.criteriaEntriesBySubscriptionId.get(Dl(m.subscription));if(!v){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}v.emitter.dispatchEvent({type:"message",payload:h})}catch(p){console.error(p);const h={type:"error",payload:p};(d=this.masterSubEmitter)==null||d.dispatchEvent(h);for(const m of this.getAllCriteriaEmitters())m.dispatchEvent({...h})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new dt(fL(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,i;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const s of this.getAllCriteriaEmitters())s.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(i=this.masterSubEmitter)==null||i.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var i;const r={type:"error",payload:n};(i=this.masterSubEmitter)==null||i.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const i={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(i),t.emitter.dispatchEvent({...i})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var l,u;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Ft(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),i=(l=r==null?void 0:r.find(d=>d.name==="token"))==null?void 0:l.valueString,s=(u=r==null?void 0:r.find(d=>d.name==="websocket-url"))==null?void 0:u.valueUrl;if(!i)throw new dt(un("Failed to get token"));if(!s)throw new dt(un("Failed to get URL from $get-ws-binding-token"));return[n,i]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const i of r.criteriaWithProps)if(hs(n,i.subscriptionProps))return i}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let i;this.criteriaEntries.has(n)?i=this.criteriaEntries.get(n):(i={criteriaWithProps:[]},this.criteriaEntries.set(n,i)),r?i.criteriaWithProps.push(t):i.bareCriteria=t}removeCriteriaEntry(t){var u;const{criteria:n,subscriptionProps:r,subscriptionId:i,token:s}=t;if(!this.criteriaEntries.has(n))return;const l=this.criteriaEntries.get(n);r?l.criteriaWithProps=l.criteriaWithProps.filter(d=>{const p=d.subscriptionProps;return!hs(r,p)}):l.bareCriteria=void 0,!l.bareCriteria&&l.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(u=this.masterSubEmitter)==null||u._removeCriteria(n)),i&&this.criteriaEntriesBySubscriptionId.delete(i),s&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:s}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(tt(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const i=new Y6(t,n);return this.addCriteriaEntry(i),this.subscribeToCriteria(i).catch(console.error),i.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new Yg(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const MT="3.2.31-bf22d6e26",J6=Cn.FHIR_JSON+", */*; q=0.1",Z6="https://api.medplum.com/",eF=1e3,tF=6e4,nF=0,rF=3e5,iF="Binary/",vS={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class OT extends Lp{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??oF(),this.storage=(t==null?void 0:t.storage)??new H6,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=ux((t==null?void 0:t.baseUrl)??Z6),this.fhirBaseUrl=zi(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=zi(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=zi(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=zi(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.fhircastHubUrl=zi(this.baseUrl,(t==null?void 0:t.fhircastHubUrl)??"fhircast/STU3"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.defaultHeaders=(t==null?void 0:t.defaultHeaders)??{},this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??rF,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?nF:tF),this.cacheTime>0?this.requestCache=new IT((t==null?void 0:t.resourceCacheSize)??eF):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=zi(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let i;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?i=new Promise((l,u)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:l,reject:u}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):i=this.request("GET",t,n);const s=new xi(i);return this.setCacheEntry(t,s),s}post(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("POST",t,i)}put(t,n,r,i={}){return t=t.toString(),this.setRequestBody(i,n),r&&this.setRequestContentType(i,r),this.invalidateUrl(t),this.request("PUT",t,i)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,Cn.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:i}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:i},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,i,s=!0){let l=i;s&&(l=await this.ensureCodeChallenge(i)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,l,s))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");const r=new URLSearchParams;return r.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),r.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),r.set("client_id",n),r.set("subject_token",t),this.fetchTokens(r)}getExternalAuthRedirectUri(t,n,r,i,s=!0){const l=new URL(t);if(l.searchParams.set("response_type","code"),l.searchParams.set("client_id",n),l.searchParams.set("redirect_uri",r),l.searchParams.set("scope",i.scope??"openid profile email"),l.searchParams.set("state",JSON.stringify(i)),s){const{codeChallenge:u,codeChallengeMethod:d}=i;if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!u)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");l.searchParams.set("code_challenge_method",d),l.searchParams.set("code_challenge",u)}return l.toString()}fhirUrl(...t){return new URL(zi(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=r$(n)),r}search(t,n,r){const i=this.fhirSearchUrl(t,n),s="search-"+i.toString(),l=this.getCacheEntry(s,r);if(l)return l.value;const u=new xi((async()=>{const d=await this.get(i,r);if(d.entry)for(const p of d.entry)this.cacheResource(p.resource);return d})());return this.setCacheEntry(s,u),u}searchOne(t,n,r){const i=this.fhirSearchUrl(t,n);i.searchParams.set("_count","1"),i.searchParams.sort();const s="searchOne-"+i.toString(),l=this.getCacheEntry(s,r);if(l)return l.value;const u=new xi(this.search(t,i.searchParams,r).then(d=>{var p,h;return(h=(p=d.entry)==null?void 0:p[0])==null?void 0:h.resource}));return this.setCacheEntry(s,u),u}searchResources(t,n,r){const s="searchResources-"+this.fhirSearchUrl(t,n).toString(),l=this.getCacheEntry(s,r);if(l)return l.value;const u=new xi(this.search(t,n,r).then(wS));return this.setCacheEntry(s,u),u}async*searchResourcePages(t,n,r){var s,l;let i=this.fhirSearchUrl(t,n);for(;i;){const u=new URL(i).searchParams,d=await this.search(t,u,r),p=(s=d.link)==null?void 0:s.find(h=>h.relation==="next");if(!((l=d.entry)!=null&&l.length)&&!p)break;yield wS(d),i=p!=null&&p.url?new URL(p.url):void 0}}searchValueSet(t,n,r){return this.valueSetExpand({url:t,filter:n},r)}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var i,s;const r=(s=(i=this.requestCache)==null?void 0:i.get(this.fhirUrl(t,n).toString()))==null?void 0:s.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return vS;const[r,i]=n.split("/");if(!(!r||!i))return this.getCached(r,i)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new xi(Promise.reject(new Error("Missing reference")));if(r==="system")return new xi(Promise.resolve(vS));const[i,s]=r.split("/");return!i||!s?new xi(Promise.reject(new Error("Invalid reference"))):this.readResource(i,s,n)}requestSchema(t){if(tT(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const i=new xi((async()=>{const s=`{
102
- StructureDefinitionList(name: "${t}") {
103
- resourceType,
104
- name,
105
- kind,
106
- description,
107
- type,
108
- url,
109
- snapshot {
110
- element {
111
- id,
112
- path,
113
- definition,
114
- min,
115
- max,
116
- base {
117
- path,
118
- min,
119
- max
120
- },
121
- contentReference,
122
- type {
123
- code,
124
- profile,
125
- targetProfile
126
- },
127
- binding {
128
- strength,
129
- valueSet
130
- }
131
- }
132
- }
133
- }
134
- SearchParameterList(base: "${t}", _count: 100) {
135
- base,
136
- code,
137
- type,
138
- expression,
139
- target
140
- }
141
- }`.replace(/\s+/g," "),l=await this.graphql(s);Zw(l.data.StructureDefinitionList.filter(u=>u.name===t));for(const u of l.data.SearchParameterList)h$(u)})());return this.setCacheEntry(n,i),i}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&ox(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),i=this.getCacheEntry(r,void 0);if(i)return i.value;const s=new xi((async()=>{if(n!=null&&n.expandProfile){const l=this.fhirUrl("StructureDefinition","$expand-profile");l.search=new URLSearchParams({url:t}).toString();const u=await this.post(l.toString(),{});Zw(u)}else{const l=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!l){console.warn(`No StructureDefinition found for ${t}!`);return}eT(l)}})());return this.setCacheEntry(r,s),s}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,i){return this.get(this.fhirUrl(t,n,"_history",r),i)}readPatientEverything(t,n){return this.get(this.fhirUrl("Patient",t,"$everything"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){const i=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const s=await this.post(i,t,void 0,r);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async upsertResource(t,n,r){const i=this.fhirSearchUrl(t.resourceType,n);let s=await this.put(i,t,void 0,r);return s||(s=t),this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),s}async createAttachment(t,n,r,i,s){let l=SS(t,n,r,i);if(l.contentType===Cn.XML){const p=l.data;let h;p instanceof Blob?h=await new Promise((m,v)=>{const x=new FileReader;x.onload=()=>{if(!x.result){v(new Error("Failed to load file"));return}m(x.result)},x.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?h=new TextDecoder().decode(p):h=p,h.includes("<ClinicalDocument")&&h.includes("urn:hl7-org:v3")&&(l={...l,contentType:Cn.CDA_XML})}const u=s??(typeof n=="object"?n:{}),d=await this.createBinary(l,u);return{contentType:l.contentType,url:d.url,title:l.filename}}createBinary(t,n,r,i,s){const l=SS(t,n,r,i),u=s??(typeof n=="object"?n:{}),{data:d,contentType:p,filename:h,securityContext:m,onProgress:v}=l,x=this.fhirUrl("Binary");return h&&x.searchParams.set("_filename",h),m!=null&&m.reference&&this.setRequestHeader(u,"X-Security-Context",m.reference),v?this.uploadwithProgress(x,d,p,v,u):this.post(x,d,p,u)}uploadwithProgress(t,n,r,i,s){return new Promise((l,u)=>{var m;const d=new XMLHttpRequest,p=()=>d.abort();(m=s==null?void 0:s.signal)==null||m.addEventListener("abort",p);const h=v=>{var x;(x=s==null?void 0:s.signal)==null||x.removeEventListener("abort",p),v instanceof Error?u(v):l(v)};if(d.responseType="json",d.onabort=()=>h(new DOMException("Request aborted","AbortError")),d.onerror=()=>h(new Error("Request error")),i&&(d.upload.onprogress=v=>i(v),d.upload.onload=v=>i(v)),d.onload=()=>{d.status>=200&&d.status<300?h(d.response):h(new dt(Vt(d.response||d.statusText)))},d.open("POST",t),d.withCredentials=!0,d.setRequestHeader("Authorization","Bearer "+this.accessToken),d.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),d.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&d.setRequestHeader("X-Medplum","extended"),s!=null&&s.headers){const v=s.headers;for(const[x,b]of Object.entries(v))d.setRequestHeader(x,b)}d.send(n)})}async createPdf(t,n,r,i){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const s=lF(t,n,r,i),l=typeof n=="object"?n:{},{docDefinition:u,tableLayouts:d,fonts:p,...h}=s,m=await this.createPdfImpl(u,d,p),v={...h,data:m,contentType:"application/pdf"};return this.createBinary(v,l)}createComment(t,n,r){const i=this.getProfile();let s,l;return t.resourceType==="Encounter"&&(s=Zt(t),l=t.subject),t.resourceType==="ServiceRequest"&&(s=t.encounter,l=t.subject),t.resourceType==="Patient"&&(l=Zt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Zt(t)],encounter:s,subject:l,sender:i?Zt(i):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,i){const s=await this.patch(this.fhirUrl(t,n),r,i);return this.cacheResource(s),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),s}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,i){let s;if(typeof t=="string"){const l=t;s=this.fhirUrl("Bot",l,"$execute")}else{const l=t;s=this.fhirUrl("Bot","$execute"),s.searchParams.set("identifier",l.system+"|"+l.value)}return this.post(s,n,r,i)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,Cn.JSON,n)}graphql(t,n,r,i){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},Cn.JSON,i)}readResourceGraph(t,n,r,i){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,i)}pushToAgent(t,n,r,i,s,l){return this.post(this.fhirUrl("Agent",Dl(t),"$push"),{destination:typeof n=="string"?n:Ft(n),body:r,contentType:i,waitForResponse:s},Cn.FHIR_JSON,l)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||Ft(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.reference))&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=V6(t),this.medplumServer=U6(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var i,s;return((i=r.profile)==null?void 0:i.reference)!==((s=t.profile)==null?void 0:s.reference)});n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{var s,l;this.profilePromise=void 0;const i=((l=(s=this.sessionDetails)==null?void 0:s.profile)==null?void 0:l.id)!==r.profile.id;this.sessionDetails=r,i&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(iF)&&(t=this.fhirUrl(r));let i=n.headers;return i||(i={},n.headers=i),i.Accept||(i.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...i}=t,s=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});i.securityContext||(i.securityContext=Zt(s));const l=await this.createAttachment(i,n);return this.updateResource({...s,status:"completed",content:l})}async uploadMedia(t,n,r,i,s){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:i},s)}async bulkExport(t="",n,r,i){const s=t&&`${t}/`,l=this.fhirUrl(`${s}$export`);return n&&l.searchParams.set("_type",n),r&&l.searchParams.set("_since",r),this.startAsyncRequest(l.toString(),i)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new W6(this)),this.keyValueClient}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0:n.cache)==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(i=>i.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new xi(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},i={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const s=await this.fetchWithRetry(n,r);if(s.status===401)return this.handleUnauthenticated(t,n,r);if(s.status===204||s.status===304)return;const l=s.headers.get("content-type"),u=l==null?void 0:l.includes("json");if(s.status===404&&!u)throw new dt(uL);const d=await this.parseBody(s,u);if(s.status===200&&r.followRedirectOnOk||s.status===201&&r.followRedirectOnCreated){const p=await bS(s,d);if(p)return this.request("GET",p,{...r,body:void 0})}if(s.status===202&&r.pollStatusOnAccepted){const h=await bS(s,d)??i.statusUrl;if(h)return this.pollStatus(h,r,i)}if(s.status>=400)throw new dt(Vt(d));return d}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(i){throw console.error("Error parsing response",t.status,i),i}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=zi(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,i=200;for(let s=0;s<=r;s++){try{this.options.verbose&&this.logRequest(t,n);const l=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(l),l.status<500||s===r)return l}catch(l){if(l.message==="Failed to fetch"&&s===0&&this.dispatchEvent({type:"offline"}),l.name==="AbortError"||s===r)throw l}await aS(i)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const i of iu(Object.keys(r)))console.log(`> ${i}: ${r[i]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}async pollStatus(t,n,r){const i={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(i.headers={...n.headers},delete i.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const s=n.pollStatusPeriod??1e3;await aS(s),r.pollCount++}return this.request("GET",t,i,r)}async executeAutoBatch(){var i,s;if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const l=t[0];try{l.resolve(await this.request(l.method,zi(this.fhirBaseUrl,l.url),l.options))}catch(u){l.reject(new dt(Vt(u)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(l=>({request:{method:l.method,url:l.url},resource:l.options.body?JSON.parse(l.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let l=0;l<t.length;l++){const u=t[l],d=(i=r.entry)==null?void 0:i[l];(s=d==null?void 0:d.response)!=null&&s.outcome&&!Yk(d.response.outcome)?u.reject(new dt(d.response.outcome)):u.resolve(d==null?void 0:d.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",J6,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",Cn.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,i=!1){t.headers||(t.headers={});const s=t.headers;i&&s[n]||(s[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||(n==null?void 0:n.constructor.name)==="Blob")||typeof File<"u"&&(n instanceof File||(n==null?void 0:n.constructor.name)==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||(n==null?void 0:n.constructor.name)==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new dt(nu)))}async startPkce(){const t=fS();sessionStorage.setItem("pkceState",t);const n=fS().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await k6(n),i=X7(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",i),{codeChallengeMethod:"S256",codeChallenge:i}}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??xS()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r=new URLSearchParams;if(r.set("grant_type","authorization_code"),r.set("code",t),r.set("client_id",(n==null?void 0:n.clientId)??this.clientId),r.set("redirect_uri",(n==null?void 0:n.redirectUri)??xS()),typeof sessionStorage<"u"){const i=sessionStorage.getItem("codeVerifier");i&&r.set("code_verifier",i)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){this.clientId=t,this.clientSecret=n;const r=new URLSearchParams;return r.set("grant_type","client_credentials"),r.set("client_id",t),r.set("client_secret",n),this.fetchTokens(r)}async startJwtBearerLogin(t,n,r){this.clientId=t;const i=new URLSearchParams;return i.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),i.set("client_id",t),i.set("assertion",n),i.set("scope",r),this.fetchTokens(i)}async startJwtAssertionLogin(t){const n=new URLSearchParams;return n.append("grant_type","client_credentials"),n.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),n.append("client_assertion",t),this.fetchTokens(n)}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=E6(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new dt(un("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new dt(un("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},s=(await this.post(this.fhircastHubUrl,pS(r),Cn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!s)throw new Error("Invalid response!");return r.endpoint=s,r}async fhircastUnsubscribe(t){if(!wx(t))throw new dt(un("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new dt(un("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,pS(t),Cn.FORM_URL_ENCODED)}fhircastConnect(t){return new F6(t)}async fhircastPublish(t,n,r,i){return A6(n)?this.post(this.fhircastHubUrl,mS(t,n,r,i),Cn.JSON):(N6(n),this.post(this.fhircastHubUrl,mS(t,n,r),Cn.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":Cn.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},r=n.headers;Object.assign(r,this.defaultHeaders),this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let i;try{i=await this.fetchWithRetry(this.tokenUrl,n)}catch(l){throw this.refreshPromise=void 0,l}if(!i.ok){this.clearActiveLogin();try{const l=await i.json();throw new dt(Gi(l.error_description))}catch(l){throw new dt(Gi("Failed to fetch tokens"),l)}}const s=await i.json();return await this.verifyTokens(s),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(B6(n)){const r=Sx(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new dt(dL);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new dt(Xw)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new dt(Xw)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new X6(this,n$(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 oF(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function xS(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function bS(e,t){var i,s;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Ip(t)&&((s=(i=t.issue)==null?void 0:i[0])!=null&&s.diagnostics))return t.issue[0].diagnostics}function wS(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function sF(e){return rr(e)&&"data"in e&&"contentType"in e}function SS(e,t,n,r){return sF(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function aF(e){return rr(e)&&"docDefinition"in e}function lF(e,t,n,r){return aF(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Il({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:i,accessPolicyResource:s}){if(t===(e==null?void 0:e.path))return;i??(i=(e==null?void 0:e.debugMode)??!1),s??(s=e==null?void 0:e.accessPolicyResource);let l=cF(t,n,e,!!i);const u=qg(t,".",2)[1];l=uF(l,s,u),l=dF(l,s,u);const d=Object.create(null);for(const[h,m]of Object.entries(l))d[t+"."+h]=m;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const h=Object.create(null);p=m=>{const v=qg(m,".",2)[1];if(v){if(!h[v]){const x=If(v,s==null?void 0:s.hiddenFields);h[v]={hidden:x,readonly:x||If(v,s==null?void 0:s.readonlyFields)}}return h[v]}}}return{path:t,elements:l,elementsByPath:d,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:i,getExtendedProps:p,accessPolicyResource:s}}function cF(e,t,n,r){const i=Object.create(null);if(n)for(const[l,u]of Object.entries(n.elementsByPath)){const d=ru(e,l);d!==void 0&&(i[d]=u)}let s=!1;if(t)for(const[l,u]of Object.entries(t))l in i||(i[l]=u,s=!0);return r&&console.assert(s,"Unnecessary ElementsContext; not using any newly provided elements"),i}function uF(e,t,n){var i;if(!((i=t==null?void 0:t.hiddenFields)!=null&&i.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([s])=>!If(r+s,t.hiddenFields)))}function dF(e,t,n){var s;if(!((s=t==null?void 0:t.readonlyFields)!=null&&s.length))return e;const r=Object.create(null),i=n?n+".":"";for(const[l,u]of Object.entries(e))If(i+l,t.readonlyFields)?r[l]={...u,readonly:!0}:r[l]=u;return r}function If(e,t){if(!(t!=null&&t.length))return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const i=n.slice(0,r).join(".");if(t.includes(i))return!0}return!1}function LT(e){return e.type!==void 0&&e.type.length>0}function fF(e,t,n,r){var s;const i=T7(e,t.path,{profileUrl:r});if(i){const l=((s=n.typeSchema)==null?void 0:s.elements)??n.elements;return i.some(u=>_7(u,t,n,l))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function $T(e,t,n,r){var i,s;if(e)for(const l of t){const u={value:e,type:((i=l.typeSchema)==null?void 0:i.type)??((s=l.type)==null?void 0:s[0].code)};if(n.every(d=>{var p;return fF(u,d,l,((p=l.typeSchema)==null?void 0:p.url)??r)}))return l.name}}class pF{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const i=Il({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(i===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[i],this.visitor=n}get elementsContext(){return this.elementsContextStack[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const i=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([s])=>s.startsWith(n)));this.crawlElementsImpl(i,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const i=this.prepareSlices(r.slices,r);if(!bn(i.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(i.slices[0],n.path,i),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=hF(t);for(const i of r)this.crawlElementNode(i,n)}crawlElementNode(t,n){var i,s;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const l of t.children)this.crawlElementNode(l,n);bn((s=(i=t.element)==null?void 0:i.slicing)==null?void 0:s.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var s,l;const r=[];for(const u of t){if(!LT(u))continue;const d=(l=(s=u.type.find(p=>bn(p.profile)))==null?void 0:s.profile)==null?void 0:l[0];if(bn(d)){const p=Ql(d);p&&(u.typeSchema=p)}r.push(u)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const i of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(i))&&this.crawlSliceImpl(i,n,r)}crawlSliceImpl(t,n,r){const i=t.typeSchema;i&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(i),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let s;const l=(i==null?void 0:i.elements)??t.elements;bn(l)&&(s=Il({path:n,parentContext:this.elementsContext,elements:l})),s&&this.elementsContextStack.push(s),this.crawlElementsImpl(l,n),s&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),i&&this.visitor.onExitSchema&&this.visitor.onExitSchema(i)}}function hF(e){const t=[];function n(s,l){return l.startsWith(s+".")}function r(s,l){for(const u of s.children)if(n(u.key,l.key)){r(u,l);return}s.children.push(l)}const i=Object.entries(e);i.sort((s,l)=>s[0].localeCompare(l[0]));for(const[s,l]of i){const u={key:s,element:l,children:[]};let d=!1;for(const p of t)if(n(p.key,s)){r(p,u),d=!0;break}d||t.push(u)}return t}const ug="__sliceName";function mF(e,t){const n=new gF(e,e.resourceType,"resource");return new pF(t,n).crawlResource(),n.getDefaultValue()}function jS(e,t,n){for(const[r,i]of Object.entries(t)){if(n===void 0||n===r){Af(e,r,i,t);continue}const s=ru(n,r);s!==void 0&&Af(e,s,i,t)}return e}class gF{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=zr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const i=this.value.values,s=this.value.path,l=ru(s,t);if(l===void 0)throw new Error(`Expected ${t} to be prefixed by ${s}`);const u=[];for(const d of i){if(d===void 0)continue;const p=Array.isArray(d)?d:[d];for(const h of p){yF(h,l,n,r.elements),Af(h,l,n,r.elements);const m=Jg(h,l,n,r.elements);m!==void 0&&u.push(m)}}this.valueStack.push({type:"element",path:t,values:u})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const s=ru(this.value.path,t);if(s===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const l of this.value.values){const u=Jg(l,s,n,r.elements);if(Array.isArray(u))for(let d=u.length-1;d>=0;d--){const p=u[d];bn(p)||u.splice(d,1)}hn(u)&&Xg(l,void 0,s,n)}}onEnterSlice(t,n,r){const i=this.value.values,s=[];for(const l of i)if(l!==void 0){const u=Array.isArray(l)?l:[l],d=this.getMatchingSliceValues(u,n,r);s.push(d)}this.valueStack.push({type:"slice",path:t,values:s})}getMatchingSliceValues(t,n,r){const i=[];for(const s of t)(s[ug]??$T(s,[n],r.discriminator,this.schema.url))===n.name&&i.push(s);for(let s=i.length;s<n.min;s++)if(cx(n.type[0].code)){const l=Object.create(null);i.push(l),t.push(l)}return i}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const i=n[r];ug in i&&delete i[ug]}}getDefaultValue(){return this.rootValue}}function yF(e,t,n,r){const i=Jg(e,t,n,r);n.min>0&&i===void 0&&cx(n.type[0].code)&&(n.isArray?Xg(e,[Object.create(null)],t,n):Xg(e,Object.create(null),t,n))}function Xg(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let i=n;if(n.includes("[x]")){const s=r.type[0].code;i=n.replace("[x]",$n(s))}t===void 0?delete e[i]:e[i]=t}function Jg(e,t,n,r){const i=t.split(".");let s=e,l;for(let u=0;u<i.length;u++){let d=i[u];if(d.includes("[x]")){const h=r[i.slice(0,u+1).join(".")].type[0].code;d=d.replace("[x]",$n(h))}if(u===i.length-1){Array.isArray(s)?l=s.map(p=>p[d]):l=s[d];continue}if(Array.isArray(s))s=s.map(p=>p[d]);else if(rr(s)){if(s[d]===void 0)return;s=s[d]}else return}return l}function Af(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(u=>Af(u,t,n,r));e==null&&(e=Object.create(null));const i=e,s=t.split(".");let l=i;for(let u=0;u<s.length;u++){let d=s[u];if(d.includes("[x]")){const h=r[s.slice(0,u+1).join(".")].type[0].code;d=d.replace("[x]",$n(h))}if(u===s.length-1){const p=Array.isArray(l)?l:[l];for(const h of p)n.fixed?h[d]??(h[d]=n.fixed.value):n.pattern&&(h[d]=FT(h[d],n.pattern.value))}else{if(!(d in l)){const p=s.slice(0,u+1).join(".");l[d]=r[p].isArray?[Object.create(null)]:Object.create(null)}l=l[d]}}return i}function FT(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:zr(t);if(rr(t)&&(rr(e)&&!Array.isArray(e)||e===void 0)){const n=zr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=FT(n[r],t[r]);return n}return e}const vF="https://meta.medplum.com/releases",dg=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!=null&&n.length))throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function bF(e,t,n){let r=dg.get("latest");if(!r){const i="latest",s=new URL(`${vF}/${i}.json`);s.searchParams.set("a",e),s.searchParams.set("c",MT);const l=await fetch(s.toString());if(l.status!==200){let d;try{d=(await l.json()).message}catch(p){console.error(`Failed to parse message from body: ${tt(p)}`)}throw new Error(`Received status code ${l.status} while fetching manifest for version 'latest'. Message: ${d}`)}const u=await l.json();xF(u),r=u,dg.set("latest",r),dg.set(r.tag_name.slice(1),r)}return r}async function wF(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 zT=y.createContext(void 0);function $p(){return y.useContext(zT)}function Pe(){return $p().medplum}function Fp(){return $p().navigate}function zp(){return $p().profile}const CS=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function SF(e){const t=e.medplum,n=e.navigate??jF,[r,i]=y.useState({profile:t.getProfile(),loading:t.isLoading()});y.useEffect(()=>{function l(){i(u=>({...u,profile:t.getProfile(),loading:t.isLoading()}))}for(const u of CS)t.addEventListener(u,l);return()=>{for(const u of CS)t.removeEventListener(u,l)}},[t]);const s=y.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return o.jsx(zT.Provider,{value:s,children:e.children})}function jF(e){window.location.assign(e)}const ES=new Map,BT=e=>y.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const i=ES.get(t);if(i){const l=new URLSearchParams(new URL(i).search).get("Expires");if(l&&parseInt(l,10)*1e3-5e3>Date.now())return i}return ES.set(t,e),e},[e]);function CF(e){const t=y.useRef();return y.useEffect(()=>{t.current=e}),t.current}function Yt(e,t){const n=Pe(),[r,i]=y.useState(()=>kS(n,e)),s=y.useCallback(l=>{hs(l,r)||i(l)},[r]);return y.useEffect(()=>{let l=!0;const u=kS(n,e);return!u&&Pa(e)?n.readReference(e).then(d=>{l&&s(d)}).catch(d=>{l&&(s(void 0),t&&t(Vt(d)))}):s(u),()=>l=!1},[n,e,s,t]),r}function kS(e,t){if(t){if(Ao(t))return t;if(Pa(t))return e.getCachedReference(t)}}function EF(e,t,n={leading:!1}){const[r,i]=y.useState(e),s=y.useRef(!1),l=y.useRef(),u=y.useRef(!1),d=y.useCallback(()=>window.clearTimeout(l.current),[]);return y.useEffect(()=>{s.current&&(!u.current&&n.leading?(u.current=!0,i(e)):(d(),l.current=setTimeout(()=>{u.current=!1,i(e)},t)))},[e,n.leading,t,d]),y.useEffect(()=>(s.current=!0,d),[d]),[r,d]}const kF=250;function TF(e,t,n){return UT("searchOne",e,t)}function Al(e,t,n){return UT("searchResources",e,t)}function UT(e,t,n,r){const i=Pe(),[s,l]=y.useState(),[u,d]=y.useState(!0),[p,h]=y.useState(),[m,v]=y.useState(),x=i.fhirSearchUrl(t,n).toString(),[b]=EF(x,kF,{leading:!0});return y.useEffect(()=>{b!==s&&(l(b),i[e](t,n).then(w=>{d(!1),h(w),v(cL)}).catch(w=>{d(!1),h(void 0),v(Vt(w))}))},[i,e,t,n,s,b]),[p,u,m]}function PF(e){const t=e.value;return t?o.jsx(o.Fragment,{children:gT(t)}):null}const VT=["meta","implicitRules","contained","extension","modifierExtension"],WT=["language","text"],Kt=y.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});Kt.displayName="ElementsContext";const jx=["extension","modifierExtension"],RF=["id",...VT].filter(e=>!jx.includes(e));function _F(e){return Object.entries(e).filter(([n,r])=>{var i;return!bn(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||jx.includes(n)&&!bn((i=r.slicing)==null?void 0:i.slices)||RF.includes(n)?!1:!(WT.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function TS(e,t){return e.line&&e.line.length>t?e.line[t]:""}function PS(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function DF(e){const[t,n]=y.useState(e.defaultValue||{}),r=y.useRef();r.current=t;const{getExtendedProps:i}=y.useContext(Kt),[s,l,u,d,p,h,m]=y.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(C=>i(e.path+"."+C)),[i,e.path]);function v(C){n(C),e.onChange&&e.onChange(C)}function x(C){v({...r.current,use:C})}function b(C){v({...r.current,type:C})}function w(C){v(PS(r.current||{},0,C))}function j(C){v(PS(r.current||{},1,C))}function P(C){v({...r.current,city:C})}function T(C){v({...r.current,state:C})}function k(C){v({...r.current,postalCode:C})}return o.jsxs(be,{gap:"xs",wrap:"nowrap",grow:!0,children:[o.jsx(en,{disabled:e.disabled||(s==null?void 0:s.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:C=>x(C.currentTarget.value),data:["","home","work","temp","old","billing"]}),o.jsx(en,{disabled:e.disabled||(l==null?void 0:l.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:C=>b(C.currentTarget.value),data:["","postal","physical","both"]}),o.jsx(Be,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Line 1",defaultValue:TS(t,0),onChange:C=>w(C.currentTarget.value)}),o.jsx(Be,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Line 2",defaultValue:TS(t,1),onChange:C=>j(C.currentTarget.value)}),o.jsx(Be,{disabled:e.disabled||(p==null?void 0:p.readonly),placeholder:"City",defaultValue:t.city,onChange:C=>P(C.currentTarget.value)}),o.jsx(Be,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"State",defaultValue:t.state,onChange:C=>T(C.currentTarget.value)}),o.jsx(Be,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:C=>k(C.currentTarget.value)})]})}function IF(e){const t=zp(),[n,r]=y.useState(e.defaultValue||{});function i(s){const l=s?{text:s,authorReference:t&&Zt(t),time:new Date().toISOString()}:{};r(l),e.onChange&&e.onChange(l)}return o.jsx(Be,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:s=>i(s.currentTarget.value)})}/**
142
- * @license @tabler/icons-react v3.17.0 - MIT
143
- *
144
- * This source code is licensed under the MIT license.
145
- * See the LICENSE file in the root directory of this source tree.
146
- */var AF={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
147
- * @license @tabler/icons-react v3.17.0 - MIT
148
- *
149
- * This source code is licensed under the MIT license.
150
- * See the LICENSE file in the root directory of this source tree.
151
- */const qe=(e,t,n,r)=>{const i=y.forwardRef(({color:s="currentColor",size:l=24,stroke:u=2,title:d,className:p,children:h,...m},v)=>y.createElement("svg",{ref:v,...AF[e],width:l,height:l,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:s}:{strokeWidth:u,stroke:s},...m},[d&&y.createElement("title",{key:"svg-title"},d),...r.map(([x,b])=>y.createElement(x,b)),...Array.isArray(h)?h:[h]]));return i.displayName=`${n}`,i};/**
152
- * @license @tabler/icons-react v3.17.0 - MIT
153
- *
154
- * This source code is licensed under the MIT license.
155
- * See the LICENSE file in the root directory of this source tree.
156
- */var NF=qe("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]]);/**
157
- * @license @tabler/icons-react v3.17.0 - MIT
158
- *
159
- * This source code is licensed under the MIT license.
160
- * See the LICENSE file in the root directory of this source tree.
161
- */var Jl=qe("outline","alert-circle","IconAlertCircle",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]]);/**
162
- * @license @tabler/icons-react v3.17.0 - MIT
163
- *
164
- * This source code is licensed under the MIT license.
165
- * See the LICENSE file in the root directory of this source tree.
166
- */var MF=qe("outline","arrow-down","IconArrowDown",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]]);/**
167
- * @license @tabler/icons-react v3.17.0 - MIT
168
- *
169
- * This source code is licensed under the MIT license.
170
- * See the LICENSE file in the root directory of this source tree.
171
- */var OF=qe("outline","arrow-up","IconArrowUp",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]]);/**
172
- * @license @tabler/icons-react v3.17.0 - MIT
173
- *
174
- * This source code is licensed under the MIT license.
175
- * See the LICENSE file in the root directory of this source tree.
176
- */var LF=qe("outline","bleach-off","IconBleachOff",[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]]);/**
177
- * @license @tabler/icons-react v3.17.0 - MIT
178
- *
179
- * This source code is licensed under the MIT license.
180
- * See the LICENSE file in the root directory of this source tree.
181
- */var $F=qe("outline","bleach","IconBleach",[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]]);/**
182
- * @license @tabler/icons-react v3.17.0 - MIT
183
- *
184
- * This source code is licensed under the MIT license.
185
- * See the LICENSE file in the root directory of this source tree.
186
- */var FF=qe("outline","box-multiple","IconBoxMultiple",[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]]);/**
187
- * @license @tabler/icons-react v3.17.0 - MIT
188
- *
189
- * This source code is licensed under the MIT license.
190
- * See the LICENSE file in the root directory of this source tree.
191
- */var zF=qe("outline","brackets-contain","IconBracketsContain",[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]]);/**
192
- * @license @tabler/icons-react v3.17.0 - MIT
193
- *
194
- * This source code is licensed under the MIT license.
195
- * See the LICENSE file in the root directory of this source tree.
196
- */var BF=qe("outline","brand-asana","IconBrandAsana",[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]]);/**
197
- * @license @tabler/icons-react v3.17.0 - MIT
198
- *
199
- * This source code is licensed under the MIT license.
200
- * See the LICENSE file in the root directory of this source tree.
201
- */var UF=qe("outline","bucket-off","IconBucketOff",[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]);/**
202
- * @license @tabler/icons-react v3.17.0 - MIT
203
- *
204
- * This source code is licensed under the MIT license.
205
- * See the LICENSE file in the root directory of this source tree.
206
- */var VF=qe("outline","bucket","IconBucket",[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]]);/**
207
- * @license @tabler/icons-react v3.17.0 - MIT
208
- *
209
- * This source code is licensed under the MIT license.
210
- * See the LICENSE file in the root directory of this source tree.
211
- */var WF=qe("outline","building","IconBuilding",[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]]);/**
212
- * @license @tabler/icons-react v3.17.0 - MIT
213
- *
214
- * This source code is licensed under the MIT license.
215
- * See the LICENSE file in the root directory of this source tree.
216
- */var qs=qe("outline","calendar","IconCalendar",[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]]);/**
217
- * @license @tabler/icons-react v3.17.0 - MIT
218
- *
219
- * This source code is licensed under the MIT license.
220
- * See the LICENSE file in the root directory of this source tree.
221
- */var Ss=qe("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
222
- * @license @tabler/icons-react v3.17.0 - MIT
223
- *
224
- * This source code is licensed under the MIT license.
225
- * See the LICENSE file in the root directory of this source tree.
226
- */var HF=qe("outline","checkbox","IconCheckbox",[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]]);/**
227
- * @license @tabler/icons-react v3.17.0 - MIT
228
- *
229
- * This source code is licensed under the MIT license.
230
- * See the LICENSE file in the root directory of this source tree.
231
- */var Cx=qe("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
232
- * @license @tabler/icons-react v3.17.0 - MIT
233
- *
234
- * This source code is licensed under the MIT license.
235
- * See the LICENSE file in the root directory of this source tree.
236
- */var qF=qe("outline","circle-check","IconCircleCheck",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]]);/**
237
- * @license @tabler/icons-react v3.17.0 - MIT
238
- *
239
- * This source code is licensed under the MIT license.
240
- * See the LICENSE file in the root directory of this source tree.
241
- */var Nf=qe("outline","circle-minus","IconCircleMinus",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]]);/**
242
- * @license @tabler/icons-react v3.17.0 - MIT
243
- *
244
- * This source code is licensed under the MIT license.
245
- * See the LICENSE file in the root directory of this source tree.
246
- */var Mf=qe("outline","circle-plus","IconCirclePlus",[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]]);/**
247
- * @license @tabler/icons-react v3.17.0 - MIT
248
- *
249
- * This source code is licensed under the MIT license.
250
- * See the LICENSE file in the root directory of this source tree.
251
- */var Ex=qe("outline","cloud-upload","IconCloudUpload",[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]]);/**
252
- * @license @tabler/icons-react v3.17.0 - MIT
253
- *
254
- * This source code is licensed under the MIT license.
255
- * See the LICENSE file in the root directory of this source tree.
256
- */var GF=qe("outline","columns","IconColumns",[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]]);/**
257
- * @license @tabler/icons-react v3.17.0 - MIT
258
- *
259
- * This source code is licensed under the MIT license.
260
- * See the LICENSE file in the root directory of this source tree.
261
- */var HT=qe("outline","copy","IconCopy",[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]]);/**
262
- * @license @tabler/icons-react v3.17.0 - MIT
263
- *
264
- * This source code is licensed under the MIT license.
265
- * See the LICENSE file in the root directory of this source tree.
266
- */var QF=qe("outline","currency-dollar","IconCurrencyDollar",[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]]);/**
267
- * @license @tabler/icons-react v3.17.0 - MIT
268
- *
269
- * This source code is licensed under the MIT license.
270
- * See the LICENSE file in the root directory of this source tree.
271
- */var KF=qe("outline","device-floppy","IconDeviceFloppy",[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]]);/**
272
- * @license @tabler/icons-react v3.17.0 - MIT
273
- *
274
- * This source code is licensed under the MIT license.
275
- * See the LICENSE file in the root directory of this source tree.
276
- */var YF=qe("outline","dots","IconDots",[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]]);/**
277
- * @license @tabler/icons-react v3.17.0 - MIT
278
- *
279
- * This source code is licensed under the MIT license.
280
- * See the LICENSE file in the root directory of this source tree.
281
- */var qT=qe("outline","edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);/**
282
- * @license @tabler/icons-react v3.17.0 - MIT
283
- *
284
- * This source code is licensed under the MIT license.
285
- * See the LICENSE file in the root directory of this source tree.
286
- */var Du=qe("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
287
- * @license @tabler/icons-react v3.17.0 - MIT
288
- *
289
- * This source code is licensed under the MIT license.
290
- * See the LICENSE file in the root directory of this source tree.
291
- */var Iu=qe("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
292
- * @license @tabler/icons-react v3.17.0 - MIT
293
- *
294
- * This source code is licensed under the MIT license.
295
- * See the LICENSE file in the root directory of this source tree.
296
- */var RS=qe("outline","file-alert","IconFileAlert",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]]);/**
297
- * @license @tabler/icons-react v3.17.0 - MIT
298
- *
299
- * This source code is licensed under the MIT license.
300
- * See the LICENSE file in the root directory of this source tree.
301
- */var XF=qe("outline","file-plus","IconFilePlus",[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]]);/**
302
- * @license @tabler/icons-react v3.17.0 - MIT
303
- *
304
- * This source code is licensed under the MIT license.
305
- * See the LICENSE file in the root directory of this source tree.
306
- */var JF=qe("outline","filter","IconFilter",[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]]);/**
307
- * @license @tabler/icons-react v3.17.0 - MIT
308
- *
309
- * This source code is licensed under the MIT license.
310
- * See the LICENSE file in the root directory of this source tree.
311
- */var ZF=qe("outline","forms","IconForms",[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]]);/**
312
- * @license @tabler/icons-react v3.17.0 - MIT
313
- *
314
- * This source code is licensed under the MIT license.
315
- * See the LICENSE file in the root directory of this source tree.
316
- */var e8=qe("outline","id","IconId",[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]]);/**
317
- * @license @tabler/icons-react v3.17.0 - MIT
318
- *
319
- * This source code is licensed under the MIT license.
320
- * See the LICENSE file in the root directory of this source tree.
321
- */var _S=qe("outline","list-details","IconListDetails",[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]]);/**
322
- * @license @tabler/icons-react v3.17.0 - MIT
323
- *
324
- * This source code is licensed under the MIT license.
325
- * See the LICENSE file in the root directory of this source tree.
326
- */var t8=qe("outline","lock-access","IconLockAccess",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]]);/**
327
- * @license @tabler/icons-react v3.17.0 - MIT
328
- *
329
- * This source code is licensed under the MIT license.
330
- * See the LICENSE file in the root directory of this source tree.
331
- */var n8=qe("outline","lock","IconLock",[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]]);/**
332
- * @license @tabler/icons-react v3.17.0 - MIT
333
- *
334
- * This source code is licensed under the MIT license.
335
- * See the LICENSE file in the root directory of this source tree.
336
- */var r8=qe("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
337
- * @license @tabler/icons-react v3.17.0 - MIT
338
- *
339
- * This source code is licensed under the MIT license.
340
- * See the LICENSE file in the root directory of this source tree.
341
- */var GT=qe("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
342
- * @license @tabler/icons-react v3.17.0 - MIT
343
- *
344
- * This source code is licensed under the MIT license.
345
- * See the LICENSE file in the root directory of this source tree.
346
- */var QT=qe("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
347
- * @license @tabler/icons-react v3.17.0 - MIT
348
- *
349
- * This source code is licensed under the MIT license.
350
- * See the LICENSE file in the root directory of this source tree.
351
- */var i8=qe("outline","message","IconMessage",[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]]);/**
352
- * @license @tabler/icons-react v3.17.0 - MIT
353
- *
354
- * This source code is licensed under the MIT license.
355
- * See the LICENSE file in the root directory of this source tree.
356
- */var o8=qe("outline","microscope","IconMicroscope",[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]]);/**
357
- * @license @tabler/icons-react v3.17.0 - MIT
358
- *
359
- * This source code is licensed under the MIT license.
360
- * See the LICENSE file in the root directory of this source tree.
361
- */var s8=qe("outline","packages","IconPackages",[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]]);/**
362
- * @license @tabler/icons-react v3.17.0 - MIT
363
- *
364
- * This source code is licensed under the MIT license.
365
- * See the LICENSE file in the root directory of this source tree.
366
- */var a8=qe("outline","pin","IconPin",[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]]);/**
367
- * @license @tabler/icons-react v3.17.0 - MIT
368
- *
369
- * This source code is licensed under the MIT license.
370
- * See the LICENSE file in the root directory of this source tree.
371
- */var l8=qe("outline","pinned-off","IconPinnedOff",[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]]);/**
372
- * @license @tabler/icons-react v3.17.0 - MIT
373
- *
374
- * This source code is licensed under the MIT license.
375
- * See the LICENSE file in the root directory of this source tree.
376
- */var c8=qe("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
377
- * @license @tabler/icons-react v3.17.0 - MIT
378
- *
379
- * This source code is licensed under the MIT license.
380
- * See the LICENSE file in the root directory of this source tree.
381
- */var u8=qe("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
382
- * @license @tabler/icons-react v3.17.0 - MIT
383
- *
384
- * This source code is licensed under the MIT license.
385
- * See the LICENSE file in the root directory of this source tree.
386
- */var d8=qe("outline","receipt","IconReceipt",[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]]);/**
387
- * @license @tabler/icons-react v3.17.0 - MIT
388
- *
389
- * This source code is licensed under the MIT license.
390
- * See the LICENSE file in the root directory of this source tree.
391
- */var f8=qe("outline","refresh","IconRefresh",[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]]);/**
392
- * @license @tabler/icons-react v3.17.0 - MIT
393
- *
394
- * This source code is licensed under the MIT license.
395
- * See the LICENSE file in the root directory of this source tree.
396
- */var p8=qe("outline","repeat","IconRepeat",[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]]);/**
397
- * @license @tabler/icons-react v3.17.0 - MIT
398
- *
399
- * This source code is licensed under the MIT license.
400
- * See the LICENSE file in the root directory of this source tree.
401
- */var h8=qe("outline","report-medical","IconReportMedical",[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]]);/**
402
- * @license @tabler/icons-react v3.17.0 - MIT
403
- *
404
- * This source code is licensed under the MIT license.
405
- * See the LICENSE file in the root directory of this source tree.
406
- */var m8=qe("outline","router","IconRouter",[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]]);/**
407
- * @license @tabler/icons-react v3.17.0 - MIT
408
- *
409
- * This source code is licensed under the MIT license.
410
- * See the LICENSE file in the root directory of this source tree.
411
- */var g8=qe("outline","search","IconSearch",[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]]);/**
412
- * @license @tabler/icons-react v3.17.0 - MIT
413
- *
414
- * This source code is licensed under the MIT license.
415
- * See the LICENSE file in the root directory of this source tree.
416
- */var Zg=qe("outline","settings","IconSettings",[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]]);/**
417
- * @license @tabler/icons-react v3.17.0 - MIT
418
- *
419
- * This source code is licensed under the MIT license.
420
- * See the LICENSE file in the root directory of this source tree.
421
- */var kx=qe("outline","sort-ascending","IconSortAscending",[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
422
- * @license @tabler/icons-react v3.17.0 - MIT
423
- *
424
- * This source code is licensed under the MIT license.
425
- * See the LICENSE file in the root directory of this source tree.
426
- */var Tx=qe("outline","sort-descending","IconSortDescending",[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]]);/**
427
- * @license @tabler/icons-react v3.17.0 - MIT
428
- *
429
- * This source code is licensed under the MIT license.
430
- * See the LICENSE file in the root directory of this source tree.
431
- */var y8=qe("outline","square","IconSquare",[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]]);/**
432
- * @license @tabler/icons-react v3.17.0 - MIT
433
- *
434
- * This source code is licensed under the MIT license.
435
- * See the LICENSE file in the root directory of this source tree.
436
- */var v8=qe("outline","star","IconStar",[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]]);/**
437
- * @license @tabler/icons-react v3.17.0 - MIT
438
- *
439
- * This source code is licensed under the MIT license.
440
- * See the LICENSE file in the root directory of this source tree.
441
- */var x8=qe("outline","switch-horizontal","IconSwitchHorizontal",[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]]);/**
442
- * @license @tabler/icons-react v3.17.0 - MIT
443
- *
444
- * This source code is licensed under the MIT license.
445
- * See the LICENSE file in the root directory of this source tree.
446
- */var b8=qe("outline","table-export","IconTableExport",[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]]);/**
447
- * @license @tabler/icons-react v3.17.0 - MIT
448
- *
449
- * This source code is licensed under the MIT license.
450
- * See the LICENSE file in the root directory of this source tree.
451
- */var w8=qe("outline","text-recognition","IconTextRecognition",[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]]);/**
452
- * @license @tabler/icons-react v3.17.0 - MIT
453
- *
454
- * This source code is licensed under the MIT license.
455
- * See the LICENSE file in the root directory of this source tree.
456
- */var Px=qe("outline","trash","IconTrash",[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]]);/**
457
- * @license @tabler/icons-react v3.17.0 - MIT
458
- *
459
- * This source code is licensed under the MIT license.
460
- * See the LICENSE file in the root directory of this source tree.
461
- */var DS=qe("outline","upload","IconUpload",[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]]);/**
462
- * @license @tabler/icons-react v3.17.0 - MIT
463
- *
464
- * This source code is licensed under the MIT license.
465
- * See the LICENSE file in the root directory of this source tree.
466
- */var S8=qe("outline","webhook","IconWebhook",[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]]);/**
467
- * @license @tabler/icons-react v3.17.0 - MIT
468
- *
469
- * This source code is licensed under the MIT license.
470
- * See the LICENSE file in the root directory of this source tree.
471
- */var Nl=qe("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
472
- * @license @tabler/icons-react v3.17.0 - MIT
473
- *
474
- * This source code is licensed under the MIT license.
475
- * See the LICENSE file in the root directory of this source tree.
476
- */var j8=qe("filled","circle-filled","IconCircleFilled",[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]]);class KT extends y.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?o.jsx(xs,{icon:o.jsx(Jl,{size:16}),title:"Something went wrong",color:"red",children:tt(this.state.error)}):this.props.children}}function ri(){return o.jsx(Gn,{style:{width:"100%",height:"100vh"},children:o.jsx(Pr,{})})}const C8="_main_g2hyx_1",E8={main:C8};function Gt(e){e.preventDefault(),e.stopPropagation()}function YT(e){if(IS(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&IS(t[0]))return!0}return!1}function IS(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function Gc(e,t){return new Promise((n,r)=>{var s;const i=new MessageChannel;i.port1.onmessage=({data:l})=>{i.port1.close(),l.error?r(l.error):n(l.result)},(s=e.contentWindow)==null||s.postMessage(t,new URL(e.src).origin,[i.port2])})}function xt(e){const t=Fp(),{to:n,suffix:r,label:i,onClick:s,children:l,...u}=e;let d=k8(n);return r&&(d+="/"+r),o.jsx(Rt,{href:d,"aria-label":i,onClick:p=>{Gt(p),s?s(p):n&&t(d)},...u,children:l})}function k8(e){if(e){if(typeof e=="string")return T8(e);if(Ao(e))return P8(e);if(Pa(e))return R8(e)}return"#"}function T8(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function P8(e){return`/${e.resourceType}/${e.id}`}function R8(e){return`/${e.reference}`}function _8(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 js(e){const t=Yt(e.value),n=t?jo(t):e.alt??"",r=_8(n),i=(t&&B7(t))??e.src,s=BT(i??void 0),l=e.radius??"xl",u={...e,value:void 0,link:void 0};return e.link?o.jsx(xt,{to:t,children:o.jsx(la,{src:s,alt:n,radius:l,...u,children:r})}):o.jsx(la,{src:s,alt:n,radius:l,...u,children:r})}const D8="_logoButton_189g3_1",I8="_user_189g3_11",A8="_userName_189g3_21",N8="_userActive_189g3_31",nf={logoButton:D8,user:I8,userName:A8,userActive:N8};function Rx(e){const t=e.value;return t?o.jsx(o.Fragment,{children:Kl(t,e.options)}):null}function M8(e){var d,p,h;const t=$p(),{medplum:n,profile:r,navigate:i}=t,s=n.getLogins(),{colorScheme:l,setColorScheme:u}=PI();return o.jsxs(o.Fragment,{children:[o.jsxs(nt,{align:"center",p:"xl",children:[o.jsx(js,{size:"xl",radius:100,value:t.profile}),o.jsx(Rx,{value:(p=(d=t.profile)==null?void 0:d.name)==null?void 0:p[0]}),o.jsx(Le,{c:"dimmed",size:"xs",children:(h=n.getActiveLogin())==null?void 0:h.project.display})]}),s.length>1&&o.jsx(ye.Divider,{}),s.map(m=>m.profile.reference!==Ft(t.profile)&&o.jsx(ye.Item,{onClick:()=>{n.setActiveLogin(m).then(()=>window.location.reload()).catch(console.log)},children:o.jsxs(be,{children:[o.jsx(la,{radius:"xl"}),o.jsxs("div",{style:{flex:1},children:[o.jsx(Le,{size:"sm",fw:500,children:m.profile.display}),o.jsx(Le,{c:"dimmed",size:"xs",children:m.project.display})]})]})},m.profile.reference)),o.jsx(ye.Divider,{}),o.jsx(be,{justify:"center",children:o.jsx(Hv,{size:"xs",value:l,onChange:m=>u(m),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(x8,{size:14,stroke:1.5}),onClick:()=>i("/signin"),children:"Add another account"}),o.jsx(ye.Item,{leftSection:o.jsx(Zg,{size:14,stroke:1.5}),onClick:()=>i(`/${Ft(r)}`),children:"Account settings"}),o.jsx(ye.Item,{leftSection:o.jsx(r8,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),i("/signin")},children:"Sign out"}),o.jsx(Le,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const AS={selectedItems:"selected-items",options:"options"};function _x(e){const t=vu({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:i,error:s,defaultValue:l,toOption:u,loadOptions:d,itemComponent:p,pillComponent:h,emptyComponent:m,onChange:v,onCreate:x,creatable:b,clearable:w,required:j,placeholder:P,leftSection:T,maxValues:k,optionsDropdownMaxHeight:C=320,minInputLength:_=0,...R}=e,M=R.disabled,N=O8(l),[L,z]=y.useState(""),[G,q]=y.useState(),[Y,Q]=y.useState(),[ne,V]=y.useState(),[O,A]=y.useState(N.map(u)),[B,I]=y.useState([]),F=p??L8,Z=h??$8,ae=m??F8,je=y.useRef();je.current=L;const me=y.useRef(),xe=y.useRef(),Te=y.useRef();Te.current=G;const le=y.useRef();le.current=Y;const et=y.useRef();et.current=ne;const ht=y.useRef();ht.current=B;const ct=y.useCallback(()=>{var ce;if(q(void 0),je.current===xe.current&&d===me.current||(((ce=je.current)==null?void 0:ce.length)??0)<_)return;xe.current=je.current,me.current=d;const _e=new AbortController;Q(_e),d(je.current??"",_e.signal).then(ve=>{_e.signal.aborted||(I(ve.map(u)),et.current?(ve.length>0&&v(ve.slice(0,1)),V(!1)):ve.length>0&&t.openDropdown())}).catch(ve=>{_e.signal.aborted||ve.message.includes("aborted")||Ie({color:"red",message:tt(ve)})}).finally(()=>{_e.signal.aborted||Q(void 0)})},[t,d,v,u,_]),St=y.useCallback(_e=>{(B&&B.length>0||b)&&t.openDropdown(),t.updateSelectedOptionIndex(),z(_e.currentTarget.value),le.current&&(le.current.abort(),Q(void 0)),Te.current!==void 0&&window.clearTimeout(Te.current);const ce=window.setTimeout(()=>ct(),100);q(ce)},[t,B,b,ct]),Et=y.useCallback(_e=>{const ce=O.some(ue=>ue.value===_e),ve=ce?O.filter(ue=>ue.value!==_e):[...O];let Me=B==null?void 0:B.find(ue=>ue.value===_e);if(!Me&&b!==!1&&x){const ue=x(_e);Me=u(ue)}if(Me){if(k===0){v([Me.resource]),O.length>0&&A([]);return}ce||ve.push(Me)}if(k!==void 0)for(;ve.length>k;)ve.shift();v(ve.map(ue=>ue.resource)),A(ve)},[b,B,O,k,v,x,u]),Tt=y.useMemo(()=>{if(!M)return _e=>{M||(k===1&&(z(""),I([]),t.closeDropdown()),xe.current=void 0,_e==="$create"?(z(""),Et(L)):Et(_e))}},[Et,t,M,k,L]),vt=y.useCallback(_e=>{const ce=O.filter(ve=>ve.value!==_e.value);v(ce.map(ve=>ve.resource)),A(ce)},[O,v]),_t=y.useCallback(_e=>{_e.key==="Enter"?(G||Y)&&V(!0):_e.key==="Backspace"&&L.length===0&&(Gt(_e),vt(O[O.length-1]))},[Y,vt,L.length,O,G]);y.useEffect(()=>()=>{le.current&&le.current.abort()},[]);const we=!M&&w&&O.length>0&&o.jsx(lt.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{z(""),A([]),v([]),t.closeDropdown()}}),Re=b&&L.trim().length>0,ke=B.length>0||Re;return o.jsxs(lt,{store:t,onOptionSubmit:Tt,withinPortal:!0,shadow:"xl",...R,children:[o.jsx(lt.DropdownTarget,{children:o.jsx(Pl,{label:r,description:i,error:s,className:e.className,leftSection:T,rightSection:Y?o.jsx(Pr,{size:16}):we,required:j,disabled:M,children:o.jsxs(ca.Group,{"data-testid":AS.selectedItems,children:[O.map(_e=>o.jsx(Z,{item:_e,disabled:M,onRemove:()=>vt(_e)},_e.value)),!M&&(k===void 0||k===0||O.length<k)&&o.jsx(lt.EventsTarget,{children:o.jsx(Pl.Field,{role:"searchbox",name:n,value:L,placeholder:P,onFocus:St,onBlur:()=>{t.closeDropdown(),z("")},onKeyDown:_t,onChange:St})})]})})}),o.jsx(lt.Dropdown,{hidden:!ke,"data-testid":AS.options,children:o.jsx(lt.Options,{children:o.jsxs(rp,{type:"scroll",mah:C,children:[B.map(_e=>{const ce=O.some(ve=>ve.value===_e.value);return o.jsx(lt.Option,{value:_e.value,active:ce,children:o.jsx(F,{..._e,active:ce})},_e.value)}),Re&&o.jsxs(lt.Option,{value:"$create",children:["+ Create ",L]}),!b&&L.trim().length>0&&B.length===0&&o.jsx(ae,{search:L})]})})})]})}function O8(e){return e?Array.isArray(e)?e:[e]:[]}function L8(e){return o.jsxs(be,{gap:"xs",children:[e.active&&o.jsx(Ss,{size:12}),o.jsx("span",{children:e.label})]})}function $8({item:e,disabled:t,onRemove:n}){return o.jsx(ca,{withRemoveButton:!t,onRemove:n,children:e.label})}function F8(){return o.jsx(lt.Empty,{children:"Nothing found"})}const z8="_searchInput_dick8_1",B8={searchInput:z8};function U8(e){return{value:e.id,label:jo(e),resource:e}}function V8(e){const t=Fp(),n=Pe(),r=y.useCallback(async(s,l)=>{const u=H8(s),d={signal:l},p=await n.graphql(u,void 0,void 0,d);return q8(p,s)},[n]),i=y.useCallback(s=>{s.length>0&&t(`/${Ft(s[0])}`)},[t]);return o.jsx(_x,{size:"sm",radius:"md",className:B8.searchInput,leftSection:o.jsx(g8,{size:16}),placeholder:"Search",itemComponent:W8,toOption:U8,onChange:i,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const W8=y.forwardRef(({resource:e,active:t,...n},r)=>{var s;let i;return e.resourceType==="Patient"?i=e.birthDate:e.resourceType==="ServiceRequest"&&(i=(s=e.subject)==null?void 0:s.display),o.jsx("div",{ref:r,...n,children:o.jsxs(be,{wrap:"nowrap",children:[o.jsx(js,{value:e}),o.jsxs("div",{children:[o.jsx(Le,{children:jo(e)}),o.jsx(Le,{size:"xs",c:"dimmed",children:i})]})]})})});function H8(e){const t=JSON.stringify(e);return uT(e)?`{
477
- Patients1: PatientList(_id: ${t}, _count: 1) {
478
- resourceType
479
- id
480
- identifier {
481
- system
482
- value
483
- }
484
- name {
485
- given
486
- family
487
- }
488
- birthDate
489
- }
490
- ServiceRequestList(_id: ${t}, _count: 1) {
491
- resourceType
492
- id
493
- identifier {
494
- system
495
- value
496
- }
497
- subject {
498
- display
499
- }
500
- }
501
- }`.replace(/\s+/g," "):`{
502
- Patients1: PatientList(name: ${t}, _count: 5) {
503
- resourceType
504
- id
505
- identifier {
506
- system
507
- value
508
- }
509
- name {
510
- given
511
- family
512
- }
513
- birthDate
514
- }
515
- Patients2: PatientList(identifier: ${t}, _count: 5) {
516
- resourceType
517
- id
518
- identifier {
519
- system
520
- value
521
- }
522
- name {
523
- given
524
- family
525
- }
526
- birthDate
527
- }
528
- ServiceRequestList(identifier: ${t}, _count: 5) {
529
- resourceType
530
- id
531
- identifier {
532
- system
533
- value
534
- }
535
- subject {
536
- display
537
- }
538
- }
539
- }`.replace(/\s+/g," ")}function q8(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),Q8(G8(n),t).slice(0,5)}function G8(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 Q8(e,t){return e.sort((n,r)=>NS(r,t)-NS(n,t))}function NS(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,MS(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,MS(Kl(r),t));return n}function MS(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function K8(e){var i;const t=zp(),[n,r]=y.useState(!1);return o.jsx(Tr.Header,{p:8,style:{zIndex:101},children:o.jsxs(be,{justify:"space-between",children:[o.jsxs(be,{gap:"xs",children:[o.jsx(Qn,{className:nf.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&o.jsx(V8,{pathname:e.pathname,searchParams:e.searchParams})]}),o.jsxs(be,{gap:"lg",pr:"sm",children:[e.notifications,o.jsxs(ye,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[o.jsx(ye.Target,{children:o.jsx(Qn,{className:Nt(nf.user,{[nf.userActive]:n}),onClick:()=>r(s=>!s),children:o.jsxs(be,{gap:7,children:[o.jsx(js,{value:t,radius:"xl",size:24}),o.jsx(Le,{size:"sm",className:nf.userName,children:Kl((i=t==null?void 0:t.name)==null?void 0:i[0])}),o.jsx(Cx,{size:12,stroke:1.5})]})})}),o.jsx(ye.Dropdown,{children:o.jsx(M8,{version:e.version})})]})]})]})})}function Y8(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?X8(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&J8(t,n);return t}function X8(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function J8(e,t){e[t.name]=t.value}function gt(e){return o.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=Y8(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function Z8(e){const t=Pe(),n=t.getUserConfiguration();function r(i){var h,m;const{menuname:s,bookmarkname:l}=i,u=`${e.pathname}?${e.searchParams.toString()}`,d=zr(n),p=(h=d.menu)==null?void 0:h.find(({title:v})=>v===s);(m=p==null?void 0:p.link)==null||m.push({name:l,target:u}),t.updateResource(d).then(v=>{n.menu=v.menu,t.dispatchEvent({type:"change"}),Ie({color:"green",message:"Success"}),e.onOk()}).catch(v=>{Ie({color:"red",message:tt(v)})})}return o.jsx(Mn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:o.jsx(gt,{onSubmit:r,children:o.jsxs(nt,{children:[o.jsx(ez,{config:n}),o.jsx(Be,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{mt:"sm",type:"submit",children:"OK"})})]})})})}function ez(e){function t(r){var i;return(i=r==null?void 0:r.menu)==null?void 0:i.map(s=>s.title)}const n=t(e.config);return o.jsx(en,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function XT(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function tz(e){return typeof e.display=="string"?e.display:XT(e)}function nz(e){return{value:XT(e),label:tz(e),resource:e}}function rz(e){return{code:e,display:e}}function Dx(e){const t=Pe(),{binding:n,creatable:r,clearable:i,expandParams:s,withHelpText:l,...u}=e,d=y.useCallback(async(p,h)=>{var b;if(!n)return[];const v=((b=(await t.valueSetExpand({...s,url:n,filter:p},{signal:h})).expansion)==null?void 0:b.contains)??[],x=[];for(const w of v)w.code&&!x.some(j=>j.code===w.code)&&x.push(w);return x},[t,s,n]);return o.jsx(_x,{...u,creatable:r??!0,clearable:i??!0,toOption:nz,loadOptions:d,onCreate:rz,itemComponent:l?iz:void 0})}const iz=y.forwardRef(({label:e,resource:t,active:n,...r},i)=>o.jsx("div",{ref:i,...r,children:o.jsxs(be,{wrap:"nowrap",gap:"xs",children:[n&&o.jsx(Ss,{size:12}),o.jsxs("div",{children:[o.jsx(Le,{children:e}),o.jsx(Le,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function JT(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[s,l]=y.useState(t);function u(d){const p=d[0],h=sz(p);l(h),n&&n(h)}return o.jsx(Dx,{defaultValue:oz(s),onChange:u,withHelpText:r??!0,...i})}function oz(e){return e?{code:e}:void 0}function sz(e){return e==null?void 0:e.code}function Ix(e){const[t,n]=y.useState(e.defaultValue),r=e.onChange,i=y.useCallback(s=>{n(s),r&&r(s)},[r]);return o.jsx(JT,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:i,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const az="_menuTitle_9g6l5_1",lz="_link_9g6l5_9",cz="_linkActive_9g6l5_38",ey={menuTitle:az,link:lz,linkActive:cz};function uz(e){var u;const t=Fp(),n=pz(e.pathname,e.searchParams,e.menus),[r,i]=y.useState(!1);function s(d,p){d.stopPropagation(),d.preventDefault(),t(p),window.innerWidth<768&&e.closeNavbar()}function l(d){d&&t(`/${d}`)}return o.jsxs(o.Fragment,{children:[o.jsx(Tr.Navbar,{children:o.jsxs(oi,{p:"xs",children:[!e.resourceTypeSearchDisabled&&o.jsx(Tr.Section,{mb:"sm",children:o.jsx(Ix,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>l(d)},window.location.pathname)}),o.jsxs(Tr.Section,{grow:!0,children:[(u=e.menus)==null?void 0:u.map(d=>{var p;return o.jsxs(y.Fragment,{children:[o.jsx(Le,{className:ey.menuTitle,children:d.title}),(p=d.links)==null?void 0:p.map(h=>o.jsxs(dz,{to:h.href,active:h.href===(n==null?void 0:n.href),onClick:m=>s(m,h.href),children:[o.jsx(fz,{to:h.href,icon:h.icon}),o.jsx("span",{children:h.label})]},h.href))]},`menu-${d.title}`)}),e.displayAddBookmark&&o.jsx(Ee,{variant:"subtle",size:"xs",mt:"xl",leftSection:o.jsx(u8,{size:"0.75rem"}),onClick:()=>i(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&o.jsx(Z8,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>i(!1),onCancel:()=>i(!1)})]})}function dz(e){return o.jsx(xt,{onClick:e.onClick,to:e.to,className:Nt(ey.link,{[ey.linkActive]:e.active}),children:e.children})}function fz(e){return e.icon?e.icon:o.jsx(_p,{w:30})}function pz(e,t,n){if(!e||!t||!n)return;let r,i=0;for(const s of n)if(s.links)for(const l of s.links){const u=hz(e,t,l.href);u>i&&(i=u,r=l)}return r}function hz(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const i=["_count","_offset"];for(const[l,u]of r.searchParams.entries())if(!i.includes(l)&&t.get(l)!==u)return 0;let s=1;for(const[l,u]of t.entries())i.includes(l)||r.searchParams.get(l)===u&&s++;return s}function mz(e){const[t,n]=y.useState(localStorage.navbarOpen==="true"),r=Pe(),i=zp();y.useEffect(()=>{function d(){Ie({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",d),()=>r.removeEventListener("offline",d)},[r]);function s(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){s(!1)}function u(){s(!t)}return r.isLoading()?o.jsx(ri,{}):o.jsxs(Tr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!i||!t,mobile:!i||!t}},padding:0,children:[i&&o.jsx(K8,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:u,notifications:e.notifications}),i&&t?o.jsx(uz,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,o.jsx(Tr.Main,{className:E8.main,children:o.jsx(KT,{children:o.jsx(y.Suspense,{fallback:o.jsx(ri,{}),children:e.children})})})]})}const gz="https://ccda.medplum.com";function yz(e){const{url:t}=e,[n,r]=y.useState(!1),i=y.useRef(null);return y.useEffect(()=>{t&&n&&i.current&&(Gc(i.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]),t?o.jsx("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:o.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:i,src:gz,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}):null}function Au(e){const{contentType:t,url:n,title:r}=e.value??{},i=BT(n);return i?o.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&o.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:i,alt:r}),(t==null?void 0:t.startsWith("video/"))&&o.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:o.jsx("source",{type:t,src:i})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&o.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:o.jsx("iframe",{width:"100%",height:"400",src:i+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===Cn.CDA_XML&&o.jsx(yz,{url:i}),o.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:o.jsx(Rt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:vz(r),children:r||"Download"})})]}):null}function vz(e){return e!=null&&e.includes(".")?e:void 0}const xz="_root_17n8t_1",bz="_compact_17n8t_25",OS={root:xz,compact:bz};function Ax(e){const{children:t,compact:n}=e;return o.jsx("dl",{className:Nt(OS.root,{[OS.compact]:n}),children:t})}function yo(e){return o.jsxs(o.Fragment,{children:[o.jsx("dt",{children:e.term}),o.jsx("dd",{children:e.children})]})}function wz(e){var r;const t=(r=e.values)==null?void 0:r.map((i,s)=>o.jsx("div",{children:o.jsx(Au,{value:i,maxWidth:e.maxWidth})},"attatchment-"+s));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!bn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const i=e.path.split(".").pop();n=o.jsx(yo,{term:da(i),children:t})}else n=o.jsx(o.Fragment,{children:t});return n}function Nx(e){const t=Pe(),n=y.useRef(null);function r(l){var u;Gt(l),(u=n.current)==null||u.click()}function i(l){Gt(l);const u=l.target.files;u&&Array.from(u).forEach(s)}function s(l){!l||!l.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:l,contentType:l.type||"application/octet-stream",filename:l.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(d=>e.onUpload(d)).catch(d=>{e.onUploadError&&e.onUploadError(Vt(d))}))}return o.jsxs(o.Fragment,{children:[o.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:l=>i(l)}),e.children({onClick:r,disabled:e.disabled})]})}function Sz(e){const[t,n]=y.useState(e.defaultValue??[]),r=y.useRef();r.current=t;function i(s){n(s),e.onChange&&e.onChange(s)}return o.jsxs("table",{style:{width:"100%"},children:[o.jsxs("colgroup",{children:[o.jsx("col",{width:"97%"}),o.jsx("col",{width:"3%"})]}),o.jsxs("tbody",{children:[t.map((s,l)=>o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(Au,{value:s,maxWidth:200})}),o.jsx("td",{children:o.jsx(En,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:u=>{Gt(u);const d=t.slice();d.splice(l,1),i(d)},children:o.jsx(Nf,{})})})]},`${l}-${t.length}`)),o.jsxs("tr",{children:[o.jsx("td",{}),o.jsx("td",{children:o.jsx(Nx,{disabled:e.disabled,onUpload:s=>{i([...r.current,s])},children:s=>o.jsx(En,{...s,title:"Add",variant:"subtle",size:"sm",color:s.disabled?"gray":"green",children:o.jsx(Ex,{})})})})]})]})]})}function ZT(e){const[t,n]=y.useState(e.defaultValue);function r(i){n(i),e.onChange&&e.onChange(i)}return t?o.jsxs(o.Fragment,{children:[o.jsx(Au,{value:t,maxWidth:200}),o.jsx(Ee,{disabled:e.disabled,onClick:i=>{Gt(i),r(void 0)},children:"Remove"})]}):o.jsx(Nx,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:i=>o.jsx(Ee,{...i,children:"Upload..."})})}const jz="_root_1vii2_1",Cz={root:jz};function Nu(e){const{children:t,...n}=e;return o.jsx(wv,{className:Cz.root,...n,children:t})}const Ez="_paper_1igaj_1",kz="_fill_1igaj_20",LS={paper:Ez,fill:kz};function Mx(e){const{width:t,fill:n,className:r,children:i,...s}=e,l=t?{maxWidth:t}:void 0;return o.jsx(Er,{className:Nt(LS.paper,n&&LS.fill,r),style:l,shadow:"sm",radius:"sm",withBorder:!0,...s,children:i})}function at(e){const{children:t,...n}=e;return o.jsx(Nu,{children:o.jsx(Mx,{...n,children:t})})}function _i(e){return o.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[o.jsx("title",{children:"Medplum Logo"}),o.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),o.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),o.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),o.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),o.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function kt(e,t){var n,r,i;return(i=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(s=>{var l;return eP((l=s.expression)==null?void 0:l[0],t)}))==null?void 0:r.map(s=>{var l;return(l=s.details)==null?void 0:l.text}))==null?void 0:i.join(`
540
- `)}function Mu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var i;return eP((i=r.expression)==null?void 0:i[0],t)})}const rf=/\[\d+\]/;function eP(e,t){const n=typeof e=="string"&&rf.test(e),r=typeof t=="string"&&rf.test(t);if(n!==r&&(e=e==null?void 0:e.replace(rf,""),t=t==null?void 0:t.replace(rf,"")),e===t)return!0;if(!e||!t)return!1;const i=e.indexOf(".");if(i>=0&&e.substring(i+1)===t)return!0;const s=t.indexOf(".");return s>=0&&t.substring(s+1)===e}function tP(e){const t=Pe(),[n,r]=y.useState();return o.jsxs(gt,{onSubmit:async i=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:i.projectName}))}catch(s){r(Vt(s))}},children:[o.jsxs(Gn,{style:{flexDirection:"column"},children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Create project"})]}),o.jsxs(nt,{gap:"xl",children:[o.jsx(Be,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:kt(n,"projectName")}),o.jsxs(Le,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",o.jsx(Rt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",o.jsx(Rt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),o.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ee,{type:"submit",children:"Create project"})})]})}function nP(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 rP(e){const t=Pe(),{googleClientId:n,handleGoogleCredential:r}=e,i=y.useRef(null),[s,l]=y.useState(typeof google<"u"),[u,d]=y.useState(!1),[p,h]=y.useState(!1);return y.useEffect(()=>{if(typeof google>"u"){nP("https://accounts.google.com/gsi/client",()=>l(!0));return}u||(google.accounts.id.initialize({client_id:n,callback:r}),d(!0)),i.current&&!p&&(google.accounts.id.renderButton(i.current,{}),h(!0))},[t,n,u,s,i,p,r]),n?o.jsx("div",{ref:i}):null}function iP(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function li(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:o.jsx(xs,{icon:o.jsx(Jl,{size:16}),color:"red",children:t.map(r=>{var i;return o.jsx("div",{"data-testid":"text-field-error",children:Jk(r)},(i=r.details)==null?void 0:i.text)})})}function oP(e){typeof grecaptcha>"u"&&nP("https://www.google.com/recaptcha/api.js?render="+e)}function sP(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function Tz(e){const t=iP(e.googleClientId),n=e.recaptchaSiteKey,r=Pe(),[i,s]=y.useState(),l=Mu(i,void 0);return y.useEffect(()=>{n&&oP(n)},[n]),o.jsxs(gt,{onSubmit:async u=>{try{let d="";n&&(d=await sP(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:u.firstName,lastName:u.lastName,email:u.email,password:u.password,remember:u.remember==="true",recaptchaSiteKey:n,recaptchaToken:d}))}catch(d){s(Vt(d))}},children:[o.jsx(Gn,{style:{flexDirection:"column"},children:e.children}),o.jsx(li,{issues:l}),t&&o.jsxs(o.Fragment,{children:[o.jsx(be,{justify:"center",p:"xl",style:{height:70},children:o.jsx(rP,{googleClientId:t,handleGoogleCredential:async u=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:u.clientId,googleCredential:u.credential,projectId:e.projectId,createUser:!0}))}catch(d){s(Vt(d))}}})}),o.jsx(_n,{label:"or",labelPosition:"center",my:"lg"})]}),o.jsxs(nt,{gap:"xl",children:[o.jsx(Be,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:kt(i,"firstName")}),o.jsx(Be,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:kt(i,"lastName")}),o.jsx(Be,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:kt(i,"email")}),o.jsx(ji,{name:"password",label:"Password",autoComplete:"off",required:!0,error:kt(i,"password")}),o.jsxs(Le,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",o.jsx(Rt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",o.jsx(Rt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),o.jsxs(Le,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",o.jsx(Rt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",o.jsx(Rt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),o.jsxs(be,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[o.jsx(Kn,{name:"remember",label:"Remember me",size:"xs"}),o.jsx(Ee,{type:"submit",children:"Create account"})]})]})}function Pz(e){const{type:t,projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,onSuccess:l}=e,u=Pe(),[d,p]=y.useState(),[h,m]=y.useState();y.useEffect(()=>{t==="patient"&&d&&u.startNewPatient({login:d,projectId:n}).then(x=>u.processCode(x.code)).then(()=>l()).catch(x=>m(Vt(x)))},[u,t,n,d,l]);function v(x){x.code?u.processCode(x.code).then(()=>l()).catch(console.log):x.login&&p(x.login)}return o.jsxs(at,{width:450,children:[h&&o.jsx("pre",{children:JSON.stringify(h,null,2)}),!d&&o.jsx(Tz,{projectId:n,clientId:r,googleClientId:i,recaptchaSiteKey:s,handleAuthResponse:v,children:e.children}),d&&t==="project"&&o.jsx(tP,{login:d,handleAuthResponse:v})]})}function Rz(e){const[t,n]=y.useState();return t?o.jsx(Dz,{email:t,...e}):o.jsx(_z,{setEmail:n,...e})}function _z(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:i,disableEmailAuth:s,...l}=e,u=Pe(),d=!e.disableGoogleAuth&&iP(e.googleClientId),[p,h]=y.useState(),m=Mu(p,void 0),v=y.useCallback(async w=>{if(!w.authorizeUrl)return!1;const j=JSON.stringify({...await u.ensureCodeChallenge(l),domain:w.domain}),P=new URL(w.authorizeUrl);return P.searchParams.set("state",j),window.location.assign(P.toString()),!0},[u,l]),x=y.useCallback(async w=>{const j=await u.post("auth/method",{email:w.email});await v(j)||t(w.email)},[u,v,t]),b=y.useCallback(async w=>{try{const j=await u.startGoogleLogin({...l,googleCredential:w.credential});await v(j)||r(j)}catch(j){h(Vt(j))}},[u,l,v,r]);return o.jsxs(gt,{onSubmit:x,children:[o.jsx(Gn,{style:{flexDirection:"column"},children:i}),o.jsx(li,{issues:m}),d&&o.jsxs(o.Fragment,{children:[o.jsx(be,{justify:"center",p:"xl",style:{height:70},children:o.jsx(rP,{googleClientId:d,handleGoogleCredential:b})}),!s&&o.jsx(_n,{label:"or",labelPosition:"center",my:"lg"})]}),!s&&o.jsx(Be,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:kt(p,"email")}),o.jsxs(be,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[o.jsx("div",{children:n&&o.jsx(Rt,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!s&&o.jsx(Ee,{type:"submit",children:"Next"})]})]})}function Dz(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...i}=e,s=Pe(),[l,u]=y.useState(),d=Mu(l,void 0),p=y.useCallback(h=>{s.startLogin({...i,password:h.password,remember:h.remember==="on"}).then(n).catch(m=>u(Vt(m)))},[s,i,n]);return o.jsxs(gt,{onSubmit:p,children:[o.jsx(Gn,{style:{flexDirection:"column"},children:r}),o.jsx(li,{issues:d}),o.jsx(nt,{gap:"xl",children:o.jsx(ji,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:kt(l,"password")})}),o.jsxs(be,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&o.jsx(Rt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),o.jsx(Kn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),o.jsx(Ee,{type:"submit",children:"Sign in"})]})]})}function Iz(e){const t=Pe(),n=vu(),[r,i]=y.useState(""),[s,l]=y.useState();function u(m){var v;return!!((v=m==null?void 0:m.toLowerCase())!=null&&v.includes(r.toLowerCase()))}function d(m){var v,x;return u((v=m.profile)==null?void 0:v.display)||u((x=m.project)==null?void 0:x.display)}function p(m){t.post("auth/profile",{login:e.login,profile:m}).then(e.handleAuthResponse).catch(v=>l(Vt(v)))}const h=e.memberships.filter(d).slice(0,10).map(m=>o.jsx(lt.Option,{value:m.id,children:o.jsx(Az,{...m})},m.id));return o.jsxs(nt,{children:[o.jsxs(aa,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[o.jsx(_i,{size:32}),o.jsx(ze,{order:3,children:"Choose profile"})]}),o.jsx(li,{outcome:s}),o.jsxs(lt,{store:n,onOptionSubmit:p,children:[o.jsx(lt.EventsTarget,{children:o.jsx(Be,{placeholder:"Search",value:r,onChange:m=>{i(m.currentTarget.value),n.updateSelectedOptionIndex()}})}),o.jsx("div",{children:o.jsx(lt.Options,{children:h.length>0?h:o.jsx(lt.Empty,{children:"Nothing found..."})})})]})]})}function Az(e){var t,n;return o.jsxs(be,{children:[o.jsx(la,{radius:"xl"}),o.jsxs("div",{children:[o.jsx(Le,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),o.jsx(Le,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}const Nz=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,Mz="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",Oz="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",Lz="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",$z=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,Fz="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",zz="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",Bz="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",Uz="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",Vz="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",Wz="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function Hz(e){const t=Pe();return o.jsx(gt,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:o.jsxs(nt,{children:[o.jsxs(Gn,{style:{flexDirection:"column"},children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Choose scope"})]}),o.jsx(nt,{children:(e.scope??"openid").split(" ").map(n=>{let r;return Nz.test(n)?r=[n+Mz,n+Oz,n+Lz]:$z.test(n)&&(r=[n+Fz,n+zz,n+Bz,n+Uz,n+Vz,n+Wz]),o.jsxs(o.Fragment,{children:[o.jsx(Kn,{id:n,name:n,label:n,defaultChecked:!0},n),r==null?void 0:r.map(i=>o.jsx(Kn,{id:i,name:i,label:i},i))]})})}),o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"Set scope"})})]})})}function aP(e){const[t,n]=y.useState();return o.jsx(gt,{onSubmit:r=>{n(void 0),e.onSubmit(r).catch(i=>n(tt(i)))},children:o.jsxs(nt,{children:[o.jsxs(Gn,{style:{flexDirection:"column"},children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Enter MFA code"})]}),t&&o.jsx(xs,{icon:o.jsx(Jl,{size:16}),title:"Error",color:"red",children:t}),o.jsx(nt,{children:o.jsx(Be,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"Submit code"})})]})})}function lP(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:i,onRegister:s,onCode:l,...u}=e,d=Pe(),[p,h]=y.useState(),m=y.useRef(!1),[v,x]=y.useState(!1),[b,w]=y.useState(),j=y.useCallback(k=>{l?l(k):d.processCode(k).then(()=>{r&&r()}).catch(C=>Ie({color:"red",message:tt(C)}))},[d,l,r]),P=y.useCallback(k=>{x(!!k.mfaRequired),k.login&&h(k.login),k.memberships&&w(k.memberships),k.code&&(n?w(void 0):j(k.code))},[n,j]),T=y.useCallback(k=>{j(k.code)},[j]);return y.useEffect(()=>{t&&!m.current&&!p&&(m.current=!0,d.get("auth/login/"+t).then(P).catch(k=>Ie({color:"red",message:tt(k)})))},[d,t,m,p,P]),o.jsx(at,{width:450,px:"sm",py:"md",children:p?v?o.jsx(aP,{onSubmit:async k=>{const C=await d.post("auth/mfa/verify",{login:p,token:k.token});P(C)}}):b?o.jsx(Iz,{login:p,memberships:b,handleAuthResponse:P}):e.projectId==="new"?o.jsx(tP,{login:p,handleAuthResponse:P}):e.chooseScopes?o.jsx(Hz,{login:p,scope:e.scope,handleAuthResponse:T}):o.jsx("div",{children:"Success"}):o.jsx(Rz,{onForgotPassword:i,onRegister:s,handleAuthResponse:P,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...u,children:e.children})})}function Qi(e){return o.jsx(o.Fragment,{children:ms(e.value)})}function qz(e){return o.jsx(o.Fragment,{children:_u(e.value)})}function cP(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("]")),o.jsx(o.Fragment,{children:n.join("").trim()})}function Gz(e){var n;const t=e.value;return t?o.jsxs(o.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>o.jsx(cP,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function Qz(e){var t,n;return o.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function Kz(e){return o.jsx(o.Fragment,{children:f$(e.value)})}function lu(e){return o.jsx(o.Fragment,{children:ra(e.value)})}function Ox(e){return o.jsx(o.Fragment,{children:su(e.value)})}function Yz(e){const t=e.value;return t?o.jsxs(o.Fragment,{children:[o.jsx(lu,{value:t.numerator})," / ",o.jsx(lu,{value:t.denominator})]}):null}function Of(e){if(!e.value)return null;const t=e.value.display||e.value.reference||ki(e.value);return e.link!==!1&&e.value.reference?o.jsx(xt,{to:e.value,children:t}):o.jsx(o.Fragment,{children:t})}function uP(e,t,n,r){if(!bn(n==null?void 0:n.slices))return[e];const i=new Array(t.length+1);for(let s=0;s<i.length;s++)i[s]=[];for(const s of e){const l=$T(s,t,n.discriminator,r);let u=l?t.findIndex(d=>d.name===l):-1;u===-1&&(u=t.length),i[u].push(s)}return i}async function dP({medplum:e,property:t}){return new Promise((n,r)=>{var u,d;if(!t.slicing){n([]);return}const i=[],s=[],l=[];for(const p of t.slicing.slices){if(!LT(p)){console.debug("Unsupported slice definition",p);continue}let h;bn(p.elements)||(h=(d=(u=p.type[0])==null?void 0:u.profile)==null?void 0:d[0]),i.push(p),s.push(h),h&&l.push(e.requestProfileSchema(h))}Promise.all(l).then(()=>{for(let p=0;p<i.length;p++){const h=i[p],m=s[p];if(m){const v=Ql(m);h.typeSchema=v}}n(i)}).catch(r)})}function Bp(e,t,n){return t!==void 0?o.jsx(e,{value:t,children:n}):n}function Xz(e){var l,u;const{slice:t,property:n}=e,r=((l=t.typeSchema)==null?void 0:l.elements)??t.elements,i=y.useContext(Kt),s=y.useMemo(()=>{var d;if(bn(r))return Il({parentContext:i,elements:r,path:e.path,profileUrl:(d=t.typeSchema)==null?void 0:d.url})},[i,e.path,(u=t.typeSchema)==null?void 0:u.url,r]);return Bp(Kt.Provider,s,o.jsx(o.Fragment,{children:e.value.map((d,p)=>o.jsx("div",{children:o.jsx(Ti,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:d,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${p}-${e.value.length}`))}))}function Jz(e){var b;const{property:t,propertyType:n}=e,r=Pe(),i=y.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[s,l]=y.useState(!0),[u,d]=y.useState([]),[p,h]=y.useState(()=>[i]),m=y.useContext(Kt);if(y.useEffect(()=>{dP({medplum:r,property:t}).then(w=>{d(w);const j=uP(i,w,t.slicing,m.profileUrl);h(j),l(!1)}).catch(w=>{console.error(w),l(!1)})},[r,t,m.profileUrl,h,i]),s)return o.jsx("div",{children:"Loading..."});let v;if(((b=t.type[0])==null?void 0:b.code)!=="Extension"){const w=p[u.length],j=w.map((P,T)=>o.jsx("div",{children:o.jsx(Ti,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:P,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${T}-${w.length}`));if(e.includeDescriptionListEntry){if(!bn(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const P=e.path.split(".").pop();v=o.jsx(yo,{term:da(P),children:j})}else v=o.jsx(o.Fragment,{children:j})}return o.jsxs(o.Fragment,{children:[u.map((w,j)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let P=o.jsx(Xz,{path:e.path,slice:w,property:t,value:p[j],ignoreMissingValues:e.ignoreMissingValues,link:e.link},w.name);return e.includeDescriptionListEntry&&(P=o.jsx(yo,{term:da(w.name),children:P},w.name)),P}),v]})}function Ou(e,t,n){const r=_l(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function Zz(e,t,n){const r=iT(e,t,n);return r?Array.isArray(r)?[r.map(i=>i.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function eB(e){const{elementDefinitionType:t}=e,n=Pe(),r=y.useContext(Kt),[i,s]=y.useState(nT("Extension")),l=y.useMemo(()=>{if(bn(t==null?void 0:t.profile))return t.profile[0]},[t]),[u,d]=y.useState(l!==void 0);if(y.useEffect(()=>{l&&(d(!0),n.requestProfileSchema(l).then(()=>{const m=Ql(l);d(!1),m&&s(m)}).catch(m=>{d(!1),console.warn(m)}))},[n,l]),l&&(u||!ox(l)))return o.jsx("div",{children:"Loading..."});const p=i.elements["value[x]"];if((p==null?void 0:p.max)!==0){const[m,v]=Ou({type:"Extension",value:e.value},"value[x]",l??r.profileUrl);return o.jsx(Ti,{propertyType:v,value:m})}return o.jsx(Lf,{path:e.path,value:{type:i.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:l})}function Ti(e){var s;const{property:t,propertyType:n,value:r}=e;if((s=t==null?void 0:t.path)==null?void 0:s.endsWith(".id"))return o.jsxs(se,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!hn(r)&&o.jsx(rk,{value:r,timeout:2e3,children:({copied:l,copy:u})=>o.jsx(Ca,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:o.jsx(En,{variant:"subtle",color:l?"teal":"gray",onClick:u,children:l?o.jsx(Ss,{size:"1rem"}):o.jsx(HT,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?o.jsx(wz,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):o.jsx(Jz,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return o.jsx(o.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return o.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 o.jsx(o.Fragment,{children:r});case re.canonical:return o.jsx(Of,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return o.jsx(o.Fragment,{children:fr(r)});case re.markdown:return o.jsx("pre",{children:r});case re.Address:return o.jsx(PF,{value:r});case re.Annotation:return o.jsx(o.Fragment,{children:r==null?void 0:r.text});case re.Attachment:return o.jsx(Au,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return o.jsx(Qi,{value:r});case re.Coding:return o.jsx(qz,{value:r});case re.ContactDetail:return o.jsx(Gz,{value:r});case re.ContactPoint:return o.jsx(cP,{value:r});case re.HumanName:return o.jsx(Rx,{value:r});case re.Identifier:return o.jsx(Qz,{value:r});case re.Money:return o.jsx(Kz,{value:r});case re.Period:return o.jsx(o.Fragment,{children:a$(r)});case re.Quantity:case re.Duration:return o.jsx(lu,{value:r});case re.Range:return o.jsx(Ox,{value:r});case re.Ratio:return o.jsx(Yz,{value:r});case re.Reference:return o.jsx(Of,{value:r,link:e.link});case re.Timing:return o.jsx(o.Fragment,{children:yT(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return o.jsx(Lf,{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 o.jsx(eB,{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 o.jsx(Lf,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const fP=["extension","modifierExtension"],tB=VT.filter(e=>!fP.includes(e));function Lf(e){const t=e.value,{value:n,type:r}=t,i=y.useContext(Kt),s=e.profileUrl??(i==null?void 0:i.profileUrl),l=y.useMemo(()=>Ap(r,s),[s,r]),u=y.useMemo(()=>{if(l)return Il({parentContext:i,elements:l.elements,path:e.path,profileUrl:l.url,accessPolicyResource:e.accessPolicyResource})},[l,i,e.path,e.accessPolicyResource]);if(hn(n))return null;if(!l)return o.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return o.jsx("div",{children:n.name});const d=u??i;return Bp(Kt.Provider,u,o.jsx(Ax,{compact:e.compact,children:Object.entries(d.elements).map(([p,h])=>{var w;if(fP.includes(p)&&hn((w=h.slicing)==null?void 0:w.slices))return null;if(tB.includes(p))return null;if(WT.includes(p)&&h.path.split(".").length===2||p.includes("."))return null;const[m,v]=Ou(t,p,d.profileUrl);if((e.ignoreMissingValues||h.max===0)&&hn(m)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const x=h.max>1||h.isArray,b=o.jsx(Ti,{property:h,propertyType:v,path:e.path+"."+p,value:m,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:x,link:e.link},p);return x?b:o.jsx(yo,{term:da(p),children:b},p)})}))}const pP="Read Only";function hP(e,t){return e?o.jsx(Ca.Floating,{label:e,children:t}):t}const nB="_dimmed_t0nld_1",rB="_preserveBreaks_t0nld_5",ty={dimmed:nB,preserveBreaks:rB};function mP(e){const{debugMode:t}=y.useContext(Kt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,hP(e!=null&&e.readonly?pP:void 0,o.jsxs(be,{wrap:"nowrap","data-testid":e.testId,children:[o.jsx("div",{children:e.children}),o.jsx("div",{children:o.jsx(tn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?ty.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Ht(e){const{debugMode:t}=y.useContext(Kt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,hP(e!=null&&e.readonly?pP:void 0,o.jsx(tn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:Nt({[ty.dimmed]:e==null?void 0:e.readonly},ty.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:kt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function gP(e,t,n,r,i){const s=r.type;if(s.length>1)for(const l of s){const u=t.replace("[x]",$n(l.code));u in e&&delete e[u]}return hn(i)?e[n]=void 0:e[n]=i,e}function iB(e){return!!e&&!hn(e.url)&&!hn(e.name)}function oB(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:i,path:s,valuePath:l,...u}=e,[d,p]=y.useState(t);function h(m){const v=aB(m);p(v),n&&n(v)}return o.jsx(Dx,{defaultValue:d&&sB(d),onChange:h,withHelpText:r??!0,...u})}function sB(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function aB(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function yP(e){const{defaultValue:t,onChange:n,withHelpText:r,...i}=e,[s,l]=y.useState(t);function u(d){const p=d[0],h=p&&cB(p);l(h),n&&n(h)}return o.jsx(Dx,{defaultValue:s&&lB(s),maxValues:1,onChange:u,withHelpText:r??!0,...i})}function lB(e){return{system:e.system,code:e.code,display:e.display}}function cB(e){return{system:e.system,code:e.code,display:e.display}}function vP(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:i}=y.useContext(Kt),[s,l]=y.useState(e.defaultValue),u=y.useRef();u.current=s;const[d,p,h]=y.useMemo(()=>["system","use","value"].map(k=>r[t+"."+k]),[r,t]),[m,v,x]=y.useMemo(()=>["system","use","value"].map(k=>i(t+"."+k)),[i,t]);function b(k){k&&Object.keys(k).length===0&&(k=void 0),l(k),e.onChange&&e.onChange(k)}function w(k){const C={...u.current,system:k};k||delete C.system,b(C)}function j(k){const C={...u.current,use:k};k||delete C.use,b(C)}function P(k){const C={...u.current,value:k};k||delete C.value,b(C)}const T=e.valuePath??t;return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[o.jsx(en,{disabled:e.disabled||(m==null?void 0:m.readonly),"data-testid":"system",defaultValue:s==null?void 0:s.system,required:((d==null?void 0:d.min)??0)>0,onChange:k=>w(k.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:kt(n,T+".system")}),o.jsx(en,{disabled:e.disabled||(v==null?void 0:v.readonly),"data-testid":"use",defaultValue:s==null?void 0:s.use,required:((p==null?void 0:p.min)??0)>0,onChange:k=>j(k.currentTarget.value),data:["","home","work","temp","old","mobile"],error:kt(n,T+".use")}),o.jsx(Be,{disabled:e.disabled||(x==null?void 0:x.readonly),placeholder:"Value",defaultValue:s==null?void 0:s.value,required:((h==null?void 0:h.min)??0)>0,onChange:k=>P(k.currentTarget.value),error:kt(n,T+".value")})]})}function uB(e){var h;const[t,n]=y.useState(e.defaultValue),r=y.useRef();r.current=t;const{getExtendedProps:i}=y.useContext(Kt),[s,l]=y.useMemo(()=>["name","telecom"].map(m=>i(e.path+"."+m)),[i,e.path]);function u(m){n(m),e.onChange&&e.onChange(m)}function d(m){const v={...r.current,name:m};m||delete v.name,u(v)}function p(m){const v={...r.current,telecom:m&&[m]};m||delete v.telecom,u(v)}return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(Be,{disabled:e.disabled||(s==null?void 0:s.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:m=>d(m.currentTarget.value)}),o.jsx(vP,{disabled:e.disabled||(l==null?void 0:l.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(h=t==null?void 0:t.telecom)==null?void 0:h[0],onChange:p,outcome:e.outcome})]})}function dB(e){if(!e)return"";const t=new Date(e);return Np(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function xP(e){if(!e)return"";const t=new Date(e);return Np(t)?t.toISOString():""}function pa(e){return o.jsx(Be,{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:fB(),defaultValue:dB(e.defaultValue),autoFocus:e.autoFocus,error:kt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(xP(n))}}})}function fB(){return"datetime-local"}function pB(e){const{propertyType:t}=e,n=Pe(),r=y.useMemo(()=>{if(bn(t.profile))return t.profile[0]},[t]),[i,s]=y.useState(r!==void 0);return y.useEffect(()=>{r&&(s(!0),n.requestProfileSchema(r).then(()=>s(!1)).catch(l=>{s(!1),console.warn(l)}))},[n,r]),r&&(i||!ox(r))?o.jsx("div",{children:"Loading..."}):o.jsx(zx,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function hB(e){var T,k,C;const{outcome:t,path:n}=e,[r,i]=y.useState(e.defaultValue),{getExtendedProps:s}=y.useContext(Kt),[l,u,d,p,h]=y.useMemo(()=>["use","prefix","given","family","suffix"].map(_=>s(e.path+"."+_)),[s,e.path]);function m(_){i(_),e.onChange&&e.onChange(_)}function v(_){m({...r,use:_||void 0})}function x(_){m({...r,prefix:_?_.split(" "):void 0})}function b(_){m({...r,given:_?_.split(" "):void 0})}function w(_){m({...r,family:_||void 0})}function j(_){m({...r,suffix:_?_.split(" "):void 0})}const P=e.valuePath??n;return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(en,{disabled:e.disabled||(l==null?void 0:l.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:_=>v(_.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:kt(t,P+".use")}),o.jsx(Be,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(T=r==null?void 0:r.prefix)==null?void 0:T.join(" "),onChange:_=>x(_.currentTarget.value),error:kt(t,P+".prefix")}),o.jsx(Be,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(k=r==null?void 0:r.given)==null?void 0:k.join(" "),onChange:_=>b(_.currentTarget.value),error:kt(t,P+".given")}),o.jsx(Be,{disabled:e.disabled||(p==null?void 0:p.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:_=>w(_.currentTarget.value),error:kt(t,P+".family")}),o.jsx(Be,{disabled:e.disabled||(h==null?void 0:h.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(C=r==null?void 0:r.suffix)==null?void 0:C.join(" "),onChange:_=>j(_.currentTarget.value),error:kt(t,P+".suffix")})]})}function mB(e){const[t,n]=y.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:i}=y.useContext(Kt),[s,l]=y.useMemo(()=>["system","value"].map(m=>r[e.path+"."+m]),[r,e.path]),[u,d]=y.useMemo(()=>["system","value"].map(m=>i(e.path+"."+m)),[i,e.path]);function p(m){n(m),e.onChange&&e.onChange(m)}const h=e.valuePath??e.path;return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[o.jsx(Be,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"System",required:((s==null?void 0:s.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:m=>p({...t,system:m.currentTarget.value}),error:kt(e.outcome,h+".system")}),o.jsx(Be,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Value",required:((l==null?void 0:l.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:m=>p({...t,value:m.currentTarget.value}),error:kt(e.outcome,h+".value")})]})}const gB=["USD","EUR","CAD","GBP","AUD"];function yB(e){var m;const{onChange:t}=e,[n,r]=y.useState(e.defaultValue),{getExtendedProps:i}=y.useContext(Kt),[s,l]=y.useMemo(()=>["currency","value"].map(v=>i(e.path+"."+v)),[i,e.path]),u=y.useCallback(v=>{r(v),t&&t(v)},[t]),d=y.useCallback(v=>{u({...n,currency:v.currentTarget.value})},[n,u]),p=y.useCallback(v=>{u({...n,value:v.currentTarget.valueAsNumber})},[n,u]),h=o.jsx(en,{disabled:e.disabled||(s==null?void 0:s.readonly),defaultValue:n==null?void 0:n.currency,data:gB,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:d});return o.jsx(Be,{disabled:e.disabled||(l==null?void 0:l.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((m=n==null?void 0:n.value)==null?void 0:m.toString())??"USD",leftSection:o.jsx(QF,{size:14}),rightSection:h,rightSectionWidth:92,onChange:p})}function vB(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(Kt),[i,s]=y.useMemo(()=>["start","end"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(pa,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:u=>l({...t,start:u})}),o.jsx(pa,{disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:u=>l({...t,end:u})})]})}function ha(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(Kt),[i,s,l]=y.useMemo(()=>["comparator","value","unit"].map(d=>r(e.path+"."+d)),[r,e.path]);function u(d){n(d),e.onChange&&e.onChange(d)}return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(en,{disabled:e.disabled||(i==null?void 0:i.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:d=>u({...t,comparator:d.currentTarget.value})}),o.jsx(Be,{disabled:e.disabled||(s==null?void 0:s.readonly),id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:d=>{e.disableWheel&&d.currentTarget.blur()},onChange:d=>{u({...t,value:xB(d.currentTarget.value)})}}),o.jsx(Be,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:d=>u({...t,unit:d.currentTarget.value})})]})}function xB(e){if(e)return parseFloat(e)}function Lx(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(Kt),[i,s]=y.useMemo(()=>["low","high"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(ha,{path:e.path+".low",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:u=>l({...t,low:u})}),o.jsx(ha,{path:e.path+".high",disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:u=>l({...t,high:u})})]})}function bB(e){const[t,n]=y.useState(e.defaultValue),{getExtendedProps:r}=y.useContext(Kt),[i,s]=y.useMemo(()=>["numerator","denominator"].map(u=>r(e.path+"."+u)),[r,e.path]);function l(u){n(u),e.onChange&&e.onChange(u)}return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(ha,{path:e.path+".numerator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:u=>l({...t,numerator:u})}),o.jsx(ha,{path:e.path+".denominator",disabled:e.disabled||(s==null?void 0:s.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:u=>l({...t,denominator:u})})]})}const wB={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},SB=["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 jB(e){return{value:Ft(e),label:jo(e),resource:e}}function Ra(e){const t=Pe(),{resourceType:n,searchCriteria:r}=e,[i,s]=y.useState(),l=Yt(e.defaultValue,s),u=e.itemComponent??CB,d=e.onChange,p=y.useCallback(async(m,v)=>{const x=EB(n),b=new URLSearchParams({[x]:m??"",_count:"10",...r});return await t.searchResources(n,b,{signal:v})},[t,n,r]),h=y.useCallback(m=>{d&&d(m[0])},[d]);return bn(e.defaultValue)&&!i&&!l?null:o.jsx(_x,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:u,defaultValue:l,placeholder:e.placeholder,maxValues:1,toOption:jB,loadOptions:p,onChange:h,clearable:!0})}const CB=y.forwardRef(({label:e,resource:t,active:n,...r},i)=>o.jsx("div",{ref:i,...r,children:o.jsxs(be,{wrap:"nowrap",children:[o.jsx(js,{value:t}),o.jsxs("div",{children:[o.jsx(Le,{children:e}),o.jsx(Le,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function EB(e){return wB[e]??(SB.includes(e)?"name":"_id")}function Up(e){const{onChange:t}=e,n=Pe(),[r,i]=y.useState(e.defaultValue),[s,l]=y.useState(()=>kB(e.targetTypes)),[u,d]=y.useState(()=>TB(e.defaultValue,s)),p=y.useRef(new IT),h=y.useMemo(()=>(u==null?void 0:u.type)==="profile"?{...e.searchCriteria,_profile:u.value}:e.searchCriteria,[e.searchCriteria,u]);y.useEffect(()=>{let x=!1;const b=s==null?void 0:s.map(w=>{if(!RB(w))return Promise.resolve(w);x=!0;const j=w.value,P=p.current.get(j);if(P)return P;const T=PB(n,w.value).then(C=>{const _={...w};return C?bn(C.type)?(_.resourceType=C.type,_.name=C.name,_.title=C.title):(console.error(`StructureDefinition.type missing for ${w.value}`),_.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${w.value}`),_.error="StructureDefinition not found"),_}).catch(C=>(console.error(C),{...w,error:C})),k=new xi(T);return p.current.set(j,k),k});!b||!x||Promise.all(b).then(w=>{if(l(w),!u)return;const j=w.findIndex(P=>P.value===u.value||P.resourceType===u.resourceType);if(j===-1){console.debug(`defaultValue had unexpected resourceType: ${u.resourceType}`);return}d(w[j])}).catch(console.error)},[n,u,s]);const m=y.useCallback(x=>{const b=x?Zt(x):void 0;i(b),t&&t(b)},[t]),v=y.useMemo(()=>s?s.map(x=>({value:x.value,label:x.type==="profile"?x.title??x.name??x.resourceType??x.value:x.value})):[],[s]);return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[s&&s.length>1&&o.jsx(en,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:u==null?void 0:u.resourceType,autoFocus:e.autoFocus,onChange:x=>{const b=x.currentTarget.value,w=s.find(j=>j.value===b);d(w)},data:v}),!s&&o.jsx(Ix,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:u==null?void 0:u.resourceType,onChange:x=>{d(x?{type:"resourceType",value:x,resourceType:x}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),o.jsx(Ra,{resourceType:u==null?void 0:u.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:h,onChange:m,disabled:e.disabled})]})}function kB(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 TB(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const i=t==null?void 0:t.find(s=>s.resourceType===n);return i||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function PB(e,t){const n=Ql(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
541
- StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
542
- type,
543
- name,
544
- title,
545
- }
546
- }`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function RB(e){return e.type==="profile"&&!(e!=null&&e.error)&&hn(e.resourceType)}const _B="_indented_ldk1d_1",bP={indented:_B};function $x({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?o.jsx(Ee,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:o.jsx(Mf,{size:"1.25rem"}),onClick:t,children:r}):o.jsx(En,{title:r,color:"green.6","data-testid":n,onClick:t,children:o.jsx(Mf,{size:"1.25rem"})})}function wP({propertyDisplayName:e,onClick:t,testId:n}){return o.jsx(En,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:o.jsx(Nf,{size:"1.25rem"})})}function DB(e){var x,b;const{slice:t,property:n}=e,[r,i]=y.useState(e.defaultValue),s=((x=t.typeSchema)==null?void 0:x.elements)??t.elements,l=y.useContext(Kt),u=y.useMemo(()=>{var w;if(bn(s))return Il({parentContext:l,elements:s,path:e.path,profileUrl:(w=t.typeSchema)==null?void 0:w.url})},[l,e.path,(b=t.typeSchema)==null?void 0:b.url,s]);function d(w){i(w),e.onChange&&e.onChange(w)}const p=t.min>0,h=hn(t.elements),m=bT(t.name),v=e.property.readonly&&r.length===0;return Bp(Kt.Provider,u,o.jsx(Ht,{title:m,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:v?o.jsx(Le,{c:"dimmed",children:"(empty)"}):o.jsxs(nt,{className:h?bP.indented:void 0,children:[r.map((w,j)=>o.jsxs(be,{wrap:"nowrap",children:[o.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${j}`,children:o.jsx(Fx,{elementDefinitionType:t.type[0],name:t.name,defaultValue:w,onChange:P=>{const T=[...r];T[j]=P,d(T)},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&&o.jsx(wP,{propertyDisplayName:m,testId:e.testId&&`${e.testId}-remove-${j}`,onClick:P=>{Gt(P);const T=[...r];T.splice(j,1),d(T)}})]},`${j}-${r.length}`)),!e.property.readonly&&r.length<t.max&&o.jsx(be,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:o.jsx($x,{propertyDisplayName:m,onClick:w=>{Gt(w);const j=[...r,void 0];d(j)},testId:e.testId&&`${e.testId}-add`})})]})}))}function IB(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function AB(e){var T;const{property:t}=e,n=Pe(),[r,i]=y.useState(!0),[s,l]=y.useState([]),[u]=y.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[d,p]=y.useState(()=>[u]),h=y.useContext(Kt),m=(T=t.type[0])==null?void 0:T.code;y.useEffect(()=>{dP({medplum:n,property:t}).then(k=>{l(k);const C=uP(u,k,t.slicing,h.profileUrl);NB(C,k),p(C),i(!1)}).catch(k=>{console.error(k),i(!1)})},[n,t,u,h.profileUrl,p]);function v(k,C){const _=[...d];if(_[C]=k,p(_),e.onChange){const R=_.flat().filter(M=>M!==void 0);e.onChange(R)}}if(r)return o.jsx("div",{children:"Loading..."});const x=s.length,b=d[x],w=!(e.hideNonSliceValues??(m==="Extension"&&s.length>0)),j=da(t.path),P=e.property.readonly&&s.length===0&&u.length===0;return o.jsxs(nt,{className:e.indent?bP.indented:void 0,children:[P&&o.jsx(Le,{c:"dimmed",children:"(empty)"}),s.map((k,C)=>o.jsx(DB,{slice:k,path:e.path,valuePath:e.valuePath,property:t,defaultValue:d[C],onChange:_=>{v(_,C)},testId:`slice-${k.name}`},k.name)),w&&b.map((k,C)=>o.jsxs(be,{wrap:"nowrap",style:{flexGrow:1},children:[o.jsx("div",{style:{flexGrow:1},children:o.jsx(Zl,{arrayElement:!0,property:e.property,name:e.name+"."+C,path:e.path,valuePath:IB(e.path,e.valuePath,C),defaultValue:k,onChange:_=>{const R=[...b];R[C]=_,v(R,x)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&o.jsx(wP,{propertyDisplayName:j,testId:`nonsliced-remove-${C}`,onClick:_=>{Gt(_);const R=[...b];R.splice(C,1),v(R,x)}})]},`${C}-${b.length}`)),!e.property.readonly&&w&&d.flat().length<t.max&&o.jsx(be,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:o.jsx($x,{propertyDisplayName:j,onClick:k=>{Gt(k);const C=[...b];C.push(void 0),v(C,x)},testId:"nonsliced-add"})})]})}function NB(e,t){for(let n=0;n<t.length;n++){const r=t[n],i=e[n];for(;i.length<r.min;)i.push(void 0)}}function MB(e){const[t,n]=y.useState(!1),r=iC(),i=y.useRef(null),s={...e.styles};return t||(s.input||(s.input={}),s.input.WebkitTextSecurity="disc"),o.jsxs(aa,{gap:"xs",children:[o.jsx(ja,{...e,styles:{...s,root:{...s.root??{},flexGrow:1}},ref:i,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),o.jsx(En,{title:"Copy secret",onClick:()=>{var l;r.copy((l=i.current)==null?void 0:l.value),Ie({color:"green",message:"Copied"})},children:o.jsx(HT,{})})]})}const OB=["sun","mon","tue","wed","thu","fri","sat"];function LB(e){const[t,n]=y.useState(e.defaultValue),[r,i]=y.useState(!e.disabled&&(e.defaultModalOpen??!1)),s=y.useRef();return s.current=t,o.jsxs(o.Fragment,{children:[o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx("span",{children:yT(s.current)||"No repeat"}),o.jsx(Ee,{disabled:e.disabled,onClick:()=>i(!0),children:"Edit"})]}),!e.disabled&&o.jsx($B,{path:e.path,visible:r,defaultValue:s.current,onOk:l=>{e.onChange&&e.onChange(l),n(l),i(!1)},onCancel:()=>i(!1)})]})}const $S={repeat:{period:1,periodUnit:"d"}};function $B(e){const[t,n]=y.useState(e.defaultValue||$S),{getExtendedProps:r}=y.useContext(Kt),[i,s,l,u,d]=y.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(w=>r(e.path+"."+w)),[r,e.path]),p=y.useRef();p.current=t;function h(w){n({...p.current,event:[w]})}function m(w){n({...p.current,repeat:w})}function v(w){var j;m({...(j=p.current)==null?void 0:j.repeat,period:w})}function x(w){var j;m({...(j=p.current)==null?void 0:j.repeat,periodUnit:w})}function b(w){var j;m({...(j=p.current)==null?void 0:j.repeat,dayOfWeek:w})}return o.jsx(Mn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:o.jsxs(nt,{children:[o.jsx(Ht,{title:"Starts on",htmlFor:"timing-dialog-start",children:o.jsx(pa,{disabled:i==null?void 0:i.readonly,name:"timing-dialog-start",onChange:w=>h(w)})}),o.jsx(Eu,{disabled:s==null?void 0:s.readonly,label:"Repeat",checked:!!t.repeat,onChange:w=>m(w.currentTarget.checked?$S.repeat:void 0)}),t.repeat&&o.jsxs(o.Fragment,{children:[o.jsx(Ht,{title:"Repeat every",htmlFor:"timing-dialog-period",children:o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",children:[o.jsx(Be,{disabled:l==null?void 0:l.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:w=>v(parseInt(w.currentTarget.value,10)||1)}),o.jsx(en,{disabled:u==null?void 0:u.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:w=>x(w.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&o.jsx(Ht,{title:"Repeat on",children:o.jsx(Zc.Group,{multiple:!0,onChange:b,children:o.jsx(be,{justify:"space-between",mt:"md",gap:"xs",children:OB.map(w=>o.jsx(Zc,{value:w,size:"xs",radius:"xl",disabled:d==null?void 0:d.readonly,children:w.charAt(0).toUpperCase()},w))})})})]}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Zl(e){var u;const{property:t,name:n,onChange:r,defaultValue:i}=e,s=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,l=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(s===re.Attachment)return o.jsx(Sz,{name:n,defaultValue:i,onChange:r,disabled:t.readonly});const d=((u=l[0])==null?void 0:u.code)!==re.Extension;return o.jsx(AB,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:i,indent:d,onChange:r,outcome:e.outcome})}else return l.length>1?o.jsx(FB,{elementDefinitionTypes:l,...e}):o.jsx(Fx,{name:n,defaultValue:i,onChange:d=>{if(e.onChange){const p=e.name.replace("[x]",$n(l[0].code));e.onChange(d,p)}},outcome:e.outcome,elementDefinitionType:l[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function FB(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(s=>s.code===e.defaultPropertyType)),n||(n=t[0]);const[r,i]=y.useState(n);return o.jsxs(be,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[o.jsx(en,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:s=>{i(t.find(l=>l.code===s.currentTarget.value))},data:t.map(s=>({value:s.code,label:s.code}))}),o.jsx(Fx,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:s=>{e.onChange&&e.onChange(s,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 Fx(e){const{name:t,onChange:n,outcome:r,binding:i,path:s,valuePath:l,readOnly:u}=e,d=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,h=y.useContext(Kt),m=y.useMemo(()=>{if(!cx(p)||!hn(e.defaultValue))return e.defaultValue;const b=Object.create(null);if(h.path===e.path)jS(b,h.elements);else{const w=ru(h.path,e.path);if(w===void 0)return e.defaultValue;jS(b,h.elements,w)}return bn(b)?b:e.defaultValue},[p,h.path,h.elements,e.path,e.defaultValue]);if(!p)return o.jsx("div",{children:"Property type not specified "});function v(){return{name:t,defaultValue:m,onChange:n,outcome:r,path:s,valuePath:l,disabled:u}}function x(){const b=kt(e.outcome,l??s);return{id:t,name:t,"data-testid":t,defaultValue:m,required:d,error:b,disabled:u}}switch(p){case re.SystemString:case re.canonical:case re.string:case re.time:case re.uri:case re.url:return e.path==="Project.secret.value[x]"?o.jsx(MB,{...x(),onChange:b=>{e.onChange&&e.onChange(b.currentTarget.value)}}):o.jsx(Be,{...x(),onChange:b=>{n&&n(b.currentTarget.value)}});case re.date:return o.jsx(Be,{...x(),type:"date",onChange:b=>{n&&n(b.currentTarget.value)}});case re.dateTime:case re.instant:return o.jsx(pa,{...x(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return o.jsx(Be,{...x(),type:"number",step:p===re.decimal?"any":"1",onChange:b=>{if(n){const w=b.currentTarget.valueAsNumber;n(Number.isNaN(w)?void 0:w)}}});case re.code:return o.jsx(JT,{...x(),error:void 0,onChange:n,binding:i==null?void 0:i.valueSet,creatable:!0,maxValues:1});case re.boolean:return o.jsx(Kn,{...x(),defaultChecked:!!m,onChange:b=>{n&&n(b.currentTarget.checked)}});case re.base64Binary:case re.markdown:return o.jsx(ja,{...x(),spellCheck:p!==re.base64Binary,onChange:b=>{n&&n(b.currentTarget.value)}});case re.Address:return o.jsx(DF,{...v()});case re.Annotation:return o.jsx(IF,{...v()});case re.Attachment:return o.jsx(ZT,{...v()});case re.CodeableConcept:return o.jsx(oB,{binding:i==null?void 0:i.valueSet,...v()});case re.Coding:return o.jsx(yP,{binding:i==null?void 0:i.valueSet,...v()});case re.ContactDetail:return o.jsx(uB,{...v()});case re.ContactPoint:return o.jsx(vP,{...v()});case re.Extension:return o.jsx(pB,{...v(),propertyType:e.elementDefinitionType});case re.HumanName:return o.jsx(hB,{...v()});case re.Identifier:return o.jsx(mB,{...v()});case re.Money:return o.jsx(yB,{...v()});case re.Period:return o.jsx(vB,{...v()});case re.Duration:case re.Quantity:return o.jsx(ha,{...v()});case re.Range:return o.jsx(Lx,{...v()});case re.Ratio:return o.jsx(bB,{...v()});case re.Reference:return o.jsx(Up,{...v(),targetTypes:BB(e.elementDefinitionType)});case re.Timing:return o.jsx(LB,{...v()});case re.Dosage:case re.UsageContext:default:return o.jsx(zx,{...v(),typeName:p})}}const zB=[`${Dp}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function BB(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=zB.find(i=>n.startsWith(i));return r?n.slice(r.length):n})}function UB(e){const[t,n]=y.useState(e.defaultValue??{}),r=y.useContext(Kt),i=y.useMemo(()=>_F(r.elements),[r.elements]);function s(u){n(u),e.onChange&&e.onChange(u)}const l={type:e.type,value:t};return o.jsx(nt,{style:{flexGrow:1},"data-testid":e.testId,children:i.map(([u,d])=>{const[p,h]=Zz(l,u,d),m=d.min!==void 0&&d.min>0,v=e.valuePath?e.valuePath+"."+u:void 0,x=o.jsx(Zl,{property:d,name:u,path:e.path+"."+u,valuePath:v,defaultValue:p,defaultPropertyType:h,onChange:(b,w)=>{s(gP({...t},u,w??u,d,b))},outcome:e.outcome},u);return e.type==="Extension"||jx.includes(u)?x:d.type.length===1&&d.type[0].code==="boolean"?o.jsx(mP,{title:da(u),description:d.description,htmlFor:u,fhirPath:d.path,withAsterisk:m,readonly:d.readonly,children:x},u):o.jsx(Ht,{title:da(u),description:d.description,withAsterisk:m,htmlFor:u,outcome:e.outcome,fhirPath:d.path,errorExpression:v,readonly:d.readonly,children:x},u)})})}function zx(e){const[t]=y.useState(()=>e.defaultValue??{}),n=y.useContext(Kt),r=e.profileUrl??(n==null?void 0:n.profileUrl),i=y.useMemo(()=>Ap(e.typeName,r),[e.typeName,r]),s=(i==null?void 0:i.type)??e.typeName,l=y.useMemo(()=>{if(i)return Il({parentContext:n,elements:i.elements,path:e.path,profileUrl:i.url,accessPolicyResource:e.accessPolicyResource})},[i,n,e.path,e.accessPolicyResource]);return i?Bp(Kt.Provider,l,o.jsx(UB,{path:e.path,valuePath:e.valuePath,type:s,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):o.jsxs("div",{children:[s," not implemented"]})}const VB="_noteCite_10swh_5",WB="_noteRoot_10swh_10",FS={noteCite:VB,noteRoot:WB};function SP({value:e}){return e?o.jsx(nt,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&o.jsx(yv,{classNames:{cite:FS.noteCite,root:FS.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function ec(e){const{value:t,link:n,...r}=e,[i,s]=y.useState(),l=Yt(t,s);let u;if(i&&!Yk(i))u=`[${tt(i)}]`;else if(l)u=jo(l);else return null;return n?o.jsx(xt,{to:t,...r,children:u}):o.jsx(Le,{component:"span",...r,children:u})}function wl(e){return o.jsxs(be,{gap:"xs",children:[o.jsx(js,{size:24,radius:12,value:e.value,link:e.link}),o.jsx(ec,{value:e.value,link:e.link})]})}const HB={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red","not-done":"red",connected:"green",disconnected:"red"};function Bx(e){return o.jsx(xu,{color:HB[e.status],children:e.status})}const qB="_table_pe9td_1",GB="_criticalRow_pe9td_12",jP={table:qB,criticalRow:GB};Ux.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Ux(e){var l;const t=Pe(),n=Yt(e.value),[r,i]=y.useState();if(y.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(u=>t.readReference(u))).then(u=>u.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(i).catch(console.error)},[t,n]),!n)return null;const s=(r==null?void 0:r.flatMap(u=>u.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const u=n.presentedForm[0];(l=u.contentType)!=null&&l.startsWith("text/plain")&&u.data&&s.push({text:window.atob(u.data)})}return o.jsxs(nt,{children:[o.jsx(ze,{children:"Diagnostic Report"}),o.jsx(QB,{value:n}),r&&!e.hideSpecimenInfo&&KB(r),n.result&&o.jsx(YB,{hideObservationNotes:e.hideObservationNotes,value:n.result}),s.length>0&&o.jsx(SP,{value:s})]})}function QB({value:e}){var t,n;return o.jsxs(be,{mt:"md",gap:30,children:[e.subject&&o.jsxs("div",{children:[o.jsx(Le,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),o.jsx(wl,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>o.jsxs("div",{children:[o.jsx(Le,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),o.jsx(wl,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>o.jsxs("div",{children:[o.jsx(Le,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),o.jsx(wl,{value:r,link:!0})]},r.reference)),e.issued&&o.jsxs("div",{children:[o.jsx(Le,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),o.jsx(Le,{children:fr(e.issued)})]}),e.status&&o.jsxs("div",{children:[o.jsx(Le,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),o.jsx(Le,{children:$n(e.status)})]})]})}function KB(e){return o.jsxs(nt,{gap:"xs",children:[o.jsx(ze,{order:2,size:"h6",children:"Specimens"}),o.jsx(dr,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return o.jsx(dr.Item,{ml:"sm",children:o.jsxs(be,{gap:20,children:[o.jsxs(be,{gap:5,children:[o.jsx(Le,{fw:500,children:"Collected:"})," ",fr((n=t.collection)==null?void 0:n.collectedDateTime)]}),o.jsxs(be,{gap:5,children:[o.jsx(Le,{fw:500,children:"Received:"})," ",fr(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function YB(e){return o.jsxs("table",{className:jP.table,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Test"}),o.jsx("th",{children:"Value"}),o.jsx("th",{children:"Reference Range"}),o.jsx("th",{children:"Interpretation"}),o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Performer"}),o.jsx("th",{children:"Status"})]})}),o.jsx("tbody",{children:o.jsx(CP,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function CP(e){var t;return o.jsx(o.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>o.jsx(XB,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Pa(n)?n.reference:n.id}`))})}function XB(e){var i,s;const t=Yt(e.value);if(!t||(i=e.ancestorIds)!=null&&i.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=eU(t);return o.jsxs(o.Fragment,{children:[o.jsxs("tr",{className:Nt({[jP.criticalRow]:r}),children:[o.jsx("td",{rowSpan:n?2:1,children:o.jsx(xt,{to:t,children:o.jsx(Qi,{value:t.code})})}),o.jsx("td",{children:o.jsx(JB,{value:t})}),o.jsx("td",{children:o.jsx(ZB,{value:t.referenceRange})}),o.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&o.jsx(Qi,{value:t.interpretation[0]})}),o.jsx("td",{children:t.category&&t.category.length>0&&o.jsx(o.Fragment,{children:t.category.map(l=>o.jsx("div",{children:o.jsx(Qi,{value:l})},`category-${ms(l)}`))})}),o.jsx("td",{children:(s=t.performer)==null?void 0:s.map(l=>o.jsx(Of,{value:l},l.reference))}),o.jsx("td",{children:t.status&&o.jsx(Bx,{status:t.status})})]}),t.hasMember&&o.jsx(CP,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&o.jsx("tr",{children:o.jsx("td",{colSpan:6,children:o.jsx(SP,{value:t.note})})})]})}function JB(e){const t=e.value;return o.jsx(o.Fragment,{children:vT(t)})}function ZB(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?o.jsx(o.Fragment,{children:t.text}):o.jsx(Ox,{value:t}):null}function eU(e){var n,r,i,s;const t=(s=(i=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:s.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var fg={},fo={},zS;function EP(){if(zS)return fo;zS=1,Object.defineProperty(fo,"__esModule",{value:!0}),fo.Pointer=fo.escapeToken=fo.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}fo.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}fo.escapeToken=t;var n=function(){function r(i){i===void 0&&(i=[""]),this.tokens=i}return r.fromJSON=function(i){var s=i.split("/").map(e);if(s[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(i));return new r(s)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(i){for(var s=null,l="",u=i,d=1,p=this.tokens.length;d<p;d++)s=u,l=this.tokens[d],!(l=="__proto__"||l=="constructor"||l=="prototype")&&(u=(s||{})[l]);return{parent:s,key:l,value:u}},r.prototype.get=function(i){return this.evaluate(i).value},r.prototype.set=function(i,s){var l=this.evaluate(i);l.parent&&(l.parent[l.key]=s)},r.prototype.push=function(i){this.tokens.push(i)},r.prototype.add=function(i){var s=this.tokens.concat(String(i));return new r(s)},r}();return fo.Pointer=n,fo}var ln={},pg={},BS;function kP(){return BS||(BS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(i){return i===void 0?"undefined":i===null?"null":Array.isArray(i)?"array":typeof i}e.objectType=t;function n(i){return i!=null&&typeof i=="object"}function r(i){if(!n(i))return i;if(i.constructor==Array){for(var s=i.length,l=new Array(s),u=0;u<s;u++)l[u]=r(i[u]);return l}if(i.constructor==Date){var d=new Date(+i);return d}var p={};for(var h in i)e.hasOwnProperty.call(i,h)&&(p[h]=r(i[h]));return p}e.clone=r}(pg)),pg}var cr={},US;function TP(){if(US)return cr;US=1,Object.defineProperty(cr,"__esModule",{value:!0}),cr.diffAny=cr.diffObjects=cr.diffArrays=cr.intersection=cr.subtract=cr.isDestructive=void 0;var e=kP();function t(h){var m=h.op;return m==="remove"||m==="replace"||m==="copy"||m==="move"}cr.isDestructive=t;function n(h,m){var v={};for(var x in h)e.hasOwnProperty.call(h,x)&&h[x]!==void 0&&(v[x]=1);for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&delete v[b];return Object.keys(v)}cr.subtract=n;function r(h){for(var m=h.length,v={},x=0;x<m;x++){var b=h[x];for(var w in b)e.hasOwnProperty.call(b,w)&&b[w]!==void 0&&(v[w]=(v[w]||0)+1)}for(var w in v)v[w]<m&&delete v[w];return Object.keys(v)}cr.intersection=r;function i(h){return h.op==="add"}function s(h){return h.op==="remove"}function l(h,m){return{operations:h.operations.concat(m),cost:h.cost+1}}function u(h,m,v,x){x===void 0&&(x=p);var b={"0,0":{operations:[],cost:0}};function w(C,_){var R="".concat(C,",").concat(_),M=b[R];if(M===void 0){if(C>0&&_>0&&!x(h[C-1],m[_-1],v.add(String(C-1))).length)M=w(C-1,_-1);else{var N=[];if(C>0){var L=w(C-1,_),z={op:"remove",index:C-1};N.push(l(L,z))}if(_>0){var G=w(C,_-1),q={op:"add",index:C-1,value:m[_-1]};N.push(l(G,q))}if(C>0&&_>0){var Y=w(C-1,_-1),Q={op:"replace",index:C-1,original:h[C-1],value:m[_-1]};N.push(l(Y,Q))}var ne=N.sort(function(V,O){return V.cost-O.cost})[0];M=ne}b[R]=M}return M}var j=isNaN(h.length)||h.length<=0?0:h.length,P=isNaN(m.length)||m.length<=0?0:m.length,T=w(j,P).operations,k=T.reduce(function(C,_){var R=C[0],M=C[1];if(i(_)){var N=_.index+1+M,L=N<j+M?String(N):"-",z={op:_.op,path:v.add(L).toString(),value:_.value};return[R.concat(z),M+1]}else if(s(_)){var z={op:_.op,path:v.add(String(_.index+M)).toString()};return[R.concat(z),M-1]}else{var G=v.add(String(_.index+M)),q=x(_.original,_.value,G);return[R.concat.apply(R,q),M]}},[[],0])[0];return k}cr.diffArrays=u;function d(h,m,v,x){x===void 0&&(x=p);var b=[];return n(h,m).forEach(function(w){b.push({op:"remove",path:v.add(w).toString()})}),n(m,h).forEach(function(w){b.push({op:"add",path:v.add(w).toString(),value:m[w]})}),r([h,m]).forEach(function(w){b.push.apply(b,x(h[w],m[w],v.add(w)))}),b}cr.diffObjects=d;function p(h,m,v,x){if(x===void 0&&(x=p),h===m)return[];var b=(0,e.objectType)(h),w=(0,e.objectType)(m);return b=="array"&&w=="array"?u(h,m,v,x):b=="object"&&w=="object"?d(h,m,v,x):[{op:"replace",path:v.toString(),value:m}]}return cr.diffAny=p,cr}var VS;function tU(){if(VS)return ln;VS=1;var e=ln&&ln.__extends||function(){var j=function(P,T){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(k,C){k.__proto__=C}||function(k,C){for(var _ in C)Object.prototype.hasOwnProperty.call(C,_)&&(k[_]=C[_])},j(P,T)};return function(P,T){if(typeof T!="function"&&T!==null)throw new TypeError("Class extends value "+String(T)+" is not a constructor or null");j(P,T);function k(){this.constructor=P}P.prototype=T===null?Object.create(T):(k.prototype=T.prototype,new k)}}();Object.defineProperty(ln,"__esModule",{value:!0}),ln.apply=ln.InvalidOperationError=ln.test=ln.copy=ln.move=ln.replace=ln.remove=ln.add=ln.TestError=ln.MissingError=void 0;var t=EP(),n=kP(),r=TP(),i=function(j){e(P,j);function P(T){var k=j.call(this,"Value required at path: ".concat(T))||this;return k.path=T,k.name="MissingError",k}return P}(Error);ln.MissingError=i;var s=function(j){e(P,j);function P(T,k){var C=j.call(this,"Test failed: ".concat(T," != ").concat(k))||this;return C.actual=T,C.expected=k,C.name="TestError",C}return P}(Error);ln.TestError=s;function l(j,P,T){if(Array.isArray(j))if(P=="-")j.push(T);else{var k=parseInt(P,10);j.splice(k,0,T)}else j[P]=T}function u(j,P){if(Array.isArray(j)){var T=parseInt(P,10);j.splice(T,1)}else delete j[P]}function d(j,P){var T=t.Pointer.fromJSON(P.path).evaluate(j);return T.parent===void 0?new i(P.path):(l(T.parent,T.key,(0,n.clone)(P.value)),null)}ln.add=d;function p(j,P){var T=t.Pointer.fromJSON(P.path).evaluate(j);return T.value===void 0?new i(P.path):(u(T.parent,T.key),null)}ln.remove=p;function h(j,P){var T=t.Pointer.fromJSON(P.path).evaluate(j);if(T.parent===null)return new i(P.path);if(Array.isArray(T.parent)){if(parseInt(T.key,10)>=T.parent.length)return new i(P.path)}else if(T.value===void 0)return new i(P.path);return T.parent[T.key]=(0,n.clone)(P.value),null}ln.replace=h;function m(j,P){var T=t.Pointer.fromJSON(P.from).evaluate(j);if(T.value===void 0)return new i(P.from);var k=t.Pointer.fromJSON(P.path).evaluate(j);return k.parent===void 0?new i(P.path):(u(T.parent,T.key),l(k.parent,k.key,T.value),null)}ln.move=m;function v(j,P){var T=t.Pointer.fromJSON(P.from).evaluate(j);if(T.value===void 0)return new i(P.from);var k=t.Pointer.fromJSON(P.path).evaluate(j);return k.parent===void 0?new i(P.path):(l(k.parent,k.key,(0,n.clone)(T.value)),null)}ln.copy=v;function x(j,P){var T=t.Pointer.fromJSON(P.path).evaluate(j);return(0,r.diffAny)(T.value,P.value,new t.Pointer).length?new s(T.value,P.value):null}ln.test=x;var b=function(j){e(P,j);function P(T){var k=j.call(this,"Invalid operation: ".concat(T.op))||this;return k.operation=T,k.name="InvalidOperationError",k}return P}(Error);ln.InvalidOperationError=b;function w(j,P){switch(P.op){case"add":return d(j,P);case"remove":return p(j,P);case"replace":return h(j,P);case"move":return m(j,P);case"copy":return v(j,P);case"test":return x(j,P)}return new b(P)}return ln.apply=w,ln}var WS;function nU(){return WS||(WS=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=EP();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=tU(),r=TP();function i(p,h){return h.map(function(m){return(0,n.apply)(p,m)})}e.applyPatch=i;function s(p){function h(m,v,x){var b=p(m,v,x);return Array.isArray(b)?b:(0,r.diffAny)(m,v,x,h)}return h}function l(p,h,m){var v=new t.Pointer;return(m?s(m):r.diffAny)(p,h,v)}e.createPatch=l;function u(p,h){var m=t.Pointer.fromJSON(h).evaluate(p);if(m!==void 0)return{op:"test",path:h,value:m.value}}function d(p,h){var m=new Array;return h.filter(r.isDestructive).forEach(function(v){var x=u(p,v.path);if(x&&m.push(x),"from"in v){var b=u(p,v.from);b&&m.push(b)}}),m}e.createTests=d}(fg)),fg}var PP=nU();const rU="_removed_el5zk_1",iU="_added_el5zk_6",HS={removed:rU,added:iU};function oU(e){var h;const{name:t,path:n,property:r,originalValue:i,revisedValue:s}=e,l=!!((h=r==null?void 0:r.type)!=null&&h.find(m=>m.code==="Attachment")),[u,d]=y.useState(l),p=()=>d(m=>!m);return o.jsx(o.Fragment,{children:l&&!u||!l?o.jsx(o.Fragment,{children:o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Td,{children:t}),o.jsx(Ae.Td,{className:HS.removed,children:i&&o.jsx(Ti,{path:n,property:r,propertyType:i.type,value:i.value,ignoreMissingValues:!0})}),o.jsx(Ae.Td,{className:HS.added,children:s&&o.jsx(Ti,{path:n,property:r,propertyType:s.type,value:s.value,ignoreMissingValues:!0})})]})}):o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Td,{children:t}),o.jsx(Ae.Td,{colSpan:2,style:{textAlign:"right"},children:o.jsx(Ee,{onClick:p,variant:"light",children:"Expand"})})]})})}const sU="_root_x463w_1",aU={root:sU};function lU(e){const t=Pe(),{original:n,revised:r}=e,[i,s]=y.useState(!1);y.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>s(!0)).catch(console.log)},[t,e.original.resourceType]);const l=y.useMemo(()=>{if(!i)return null;const u=[ni(n)],d=[ni(r)],p=[],h=cU(PP.createPatch(n,r));for(const m of h){const v=m.path,x=uU(v),b=dU(n.resourceType,x),w=m.op==="add"?void 0:fa(x,u),j=m.op==="remove"?void 0:fa(x,d);p.push({key:`op-${m.op}-${m.path}`,name:`${$n(m.op)} ${x}`,path:(b==null?void 0:b.path)??n.resourceType+"."+x,property:b,originalValue:qS(b,w),revisedValue:qS(b,j)})}return p},[i,n,r]);return l?o.jsxs(Ae,{className:aU.root,children:[o.jsx(Ae.Thead,{children:o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Th,{}),o.jsx(Ae.Th,{children:"Before"}),o.jsx(Ae.Th,{children:"After"})]})}),o.jsx(Ae.Tbody,{children:l.map(u=>o.jsx(oU,{...u}))})]}):null}function cU(e){const t=[];for(const n of e){const{op:r,path:i}=n;if(i.startsWith("/meta/author")||i.startsWith("/meta/compartment")||i.startsWith("/meta/lastUpdated")||i.startsWith("/meta/versionId"))continue;const s=e.filter(u=>u.op===r&&u.path===i).length,l={op:r,path:i};s>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(i)&&(l.op="replace",l.path=i.replace(/\/[^/]+$/,"")),t.some(u=>u.op===l.op&&u.path===l.path)||t.push(l)}return t}function uU(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const i=t[r];i==="-"?n+=".last()":/^\d+$/.test(i)?n+=`[${i}]`:(r>0&&(n+="."),n+=i)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function dU(e,t){var r;const n=Xl(e,{code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function qS(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:fU(t,!!(e!=null&&e.isArray))}}function fU(e,t){const n=Z7(e).flatMap(r=>r.value);return t?n:n[0]}function Vx(e){const{profileUrl:t}=e,n=Pe(),r=n.getAccessPolicy(),i=Yt(e.value),[s,l]=y.useState(!1);y.useEffect(()=>{if(i)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{Ql(t)?l(!0):console.error(`Schema not found for ${t}`)}).catch(d=>{console.error("Error in requestProfileSchema",d)});else{const d=i.resourceType;n.requestSchema(d).then(()=>{l(!0)}).catch(console.error)}},[n,t,i]);const u=y.useMemo(()=>i&&TT(i,xx.READ,r),[r,i]);return!s||!i?null:o.jsx(Lf,{path:i.resourceType,value:{type:i.resourceType,value:e.forceUseInput?e.value:i},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:u})}const pU="_item_5q6yx_1",hU="_itemPadding_5q6yx_5",GS={item:pU,itemPadding:hU};function mU(e){return o.jsx(Nu,{children:e.children})}function ma(e){var d,p;const{resource:t,profile:n,padding:r,popupMenuItems:i,...s}=e,l=n??((d=t.meta)==null?void 0:d.author),u=e.dateTime??((p=t.meta)==null?void 0:p.lastUpdated);return o.jsxs(Mx,{"data-testid":"timeline-item",fill:!0,...s,children:[o.jsxs(be,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[o.jsx(js,{value:l,link:!0,size:"md"}),o.jsxs("div",{style:{flex:1},children:[o.jsx(Le,{size:"sm",children:o.jsx(ec,{c:"dark",fw:500,value:l,link:!0})}),o.jsxs(Le,{size:"xs",children:[o.jsx(xt,{c:"dimmed",to:e.resource,children:fr(u)}),o.jsx(Le,{component:"span",c:"dimmed",mx:8,children:"·"}),o.jsx(xt,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),i&&o.jsxs(ye,{position:"bottom-end",shadow:"md",width:200,children:[o.jsx(ye.Target,{children:o.jsx(En,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Ft(e.resource)}`,children:o.jsx(YF,{})})}),i]})]}),o.jsx(KT,{children:o.jsx("div",{className:Nt(GS.item,{[GS.itemPadding]:r}),children:e.children})})]})}function RP(e,t){e.sort((n,r)=>{const i=QS(n,t),s=QS(r,t);return i>s?1:i<s?-1:KS(n,t)-KS(r,t)})}function QS(e,t){if(!_P(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function KS(e,t){var r;if(!_P(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function _P(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const gU="_pinnedComment_5uxzi_2",yU={pinnedComment:gU};function Vp(e){const t=Pe(),n=t.getProfile(),r=y.useRef(null),i=Yt(e.value),[s,l]=y.useState(),[u,d]=y.useState([]),p=e.loadTimelineResources,h=y.useRef(u);h.current=u;const m=y.useCallback(C=>{RP(C,i),C.reverse(),d(C)},[i]),v=y.useCallback(C=>{const _=[];for(const R of C){if(R.status!=="fulfilled")continue;const M=R.value;if(M.type==="history"&&l(M),M.entry)for(const N of M.entry)_.push(N.resource)}m(_)},[m]),x=y.useCallback(C=>m([...h.current,C]),[m]),b=y.useCallback(()=>{var R;let C,_;"resourceType"in e.value?(C=e.value.resourceType,_=e.value.id):[C,_]=(R=e.value.reference)==null?void 0:R.split("/"),p(t,C,_).then(v).catch(console.error)},[t,e.value,p,v]);y.useEffect(()=>b(),[b]);function w(C){!i||!e.createCommunication||t.createResource(e.createCommunication(i,n,C)).then(_=>x(_)).catch(console.error)}function j(C){!i||!e.createMedia||t.createResource(e.createMedia(i,n,C)).then(_=>x(_)).then(()=>ta({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:o.jsx(Ss,{size:16}),autoClose:2e3})).catch(_=>ta({id:"upload-notification",color:"red",title:"Upload error",message:tt(_),icon:o.jsx(RS,{size:16}),autoClose:2e3}))}function P(){Ie({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function T(C){ta({id:"upload-notification",loading:!0,title:"Uploading...",message:CU(C),autoClose:!1,withCloseButton:!1})}function k(C){ta({id:"upload-notification",color:"red",title:"Upload error",message:tt(C),icon:o.jsx(RS,{size:16}),autoClose:2e3})}return i?o.jsxs(mU,{children:[e.createCommunication&&o.jsx(Mx,{children:o.jsx(gt,{testid:"timeline-form",onSubmit:C=>{w(C.text);const _=r.current;_&&(_.value="",_.focus())},children:o.jsxs(be,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[o.jsx(js,{value:n}),o.jsx(Be,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),o.jsx(En,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:o.jsx(i8,{size:16})}),o.jsx(Nx,{securityContext:Zt(i),onUpload:j,onUploadStart:P,onUploadProgress:T,onUploadError:k,children:C=>o.jsx(En,{...C,radius:"xl",color:"blue",variant:"filled",children:o.jsx(Ex,{size:16})})})]})})}),u.map(C=>{var M;if(!C)return null;const _=`${C.resourceType}/${C.id}/${(M=C.meta)==null?void 0:M.versionId}`,R=e.getMenu?e.getMenu({primaryResource:i,currentResource:C,reloadTimeline:b}):void 0;if(C.resourceType===i.resourceType&&C.id===i.id)return o.jsx(vU,{history:s,resource:C,popupMenuItems:R},_);switch(C.resourceType){case"AuditEvent":return o.jsx(SU,{resource:C,popupMenuItems:R},_);case"Communication":return o.jsx(bU,{resource:C,popupMenuItems:R},_);case"DiagnosticReport":return o.jsx(jU,{resource:C,popupMenuItems:R},_);case"Media":return o.jsx(wU,{resource:C,popupMenuItems:R},_);default:return o.jsx(ma,{resource:C,padding:!0,children:o.jsx(Vx,{value:C,ignoreMissingValues:!0})},_)}})]}):o.jsx(Gn,{style:{width:"100%",height:"100%"},children:o.jsx(Pr,{})})}function vU(e){const{history:t,resource:n,...r}=e,i=xU(t,n);return i?o.jsx(ma,{resource:n,padding:!0,...r,children:o.jsx(lU,{original:i,revised:e.resource})}):o.jsxs(ma,{resource:n,padding:!0,...r,children:[o.jsx("h3",{children:"Created"}),o.jsx(Vx,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function xU(e,t){const n=e.entry??[],r=n.findIndex(i=>{var s,l,u;return((l=(s=i.resource)==null?void 0:s.meta)==null?void 0:l.versionId)===((u=t.meta)==null?void 0:u.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function bU(e){var r,i;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:yU.pinnedComment;return o.jsx(ma,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:o.jsx("p",{children:(i=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:i.contentString})})}function wU(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return o.jsx(ma,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:o.jsx(Au,{value:e.resource.content})})}function SU(e){return o.jsx(ma,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:o.jsx(oi,{children:o.jsx("pre",{children:e.resource.outcomeDesc})})})}function jU(e){return o.jsx(ma,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:o.jsx(Ux,{value:e.resource})})}function CU(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${hg(e.loaded)} / ${hg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${hg(e.loaded)}`}function hg(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 EU(e){const{resource:t,...n}=e;return o.jsx(Vp,{value:t,loadTimelineResources:async(r,i,s)=>{const l=`${i}/${s}`;return Promise.allSettled([r.readHistory(i,s),r.search("Task",{_filter:`based-on eq ${l} or focus eq ${l} or subject eq ${l}`,_count:100})])},...n})}function kU(e){const{encounter:t,...n}=e;return o.jsx(Vp,{value:t,loadTimelineResources:async(r,i,s)=>Promise.allSettled([r.readHistory("Encounter",s),r.search("Communication","encounter=Encounter/"+s),r.search("Media","encounter=Encounter/"+s)]),createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",encounter:Zt(r),subject:r.subject,sender:Zt(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",encounter:Zt(r),subject:r.subject,operator:Zt(i),issued:new Date().toISOString(),content:s}),...n})}function TU(e){let t;try{t=Yl(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 o.jsx(Ti,{value:t[0]||"",propertyType:e.propertyType})}function PU(e){return o.jsxs(Mn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[o.jsxs(se,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&o.jsx(YS,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&o.jsx(YS,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),o.jsx(Le,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function YS(e){return o.jsx(Ee,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const RU={string:[Se.EQUALS,Se.NOT,Se.CONTAINS,Se.EXACT],fulltext:[Se.EQUALS,Se.NOT,Se.CONTAINS,Se.EXACT],token:[Se.EQUALS,Se.NOT],reference:[Se.EQUALS,Se.NOT],numeric:[Se.EQUALS,Se.NOT_EQUALS,Se.GREATER_THAN,Se.LESS_THAN,Se.GREATER_THAN_OR_EQUALS,Se.LESS_THAN_OR_EQUALS],quantity:[Se.EQUALS,Se.NOT_EQUALS,Se.GREATER_THAN,Se.LESS_THAN,Se.GREATER_THAN_OR_EQUALS,Se.LESS_THAN_OR_EQUALS],date:[Se.EQUALS,Se.NOT_EQUALS,Se.GREATER_THAN,Se.LESS_THAN,Se.GREATER_THAN_OR_EQUALS,Se.LESS_THAN_OR_EQUALS,Se.STARTS_AFTER,Se.ENDS_BEFORE,Se.APPROXIMATELY],datetime:[Se.EQUALS,Se.NOT_EQUALS,Se.GREATER_THAN,Se.LESS_THAN,Se.GREATER_THAN_OR_EQUALS,Se.LESS_THAN_OR_EQUALS,Se.STARTS_AFTER,Se.ENDS_BEFORE,Se.APPROXIMATELY],uri:[Se.EQUALS,Se.NOT,Se.ABOVE,Se.BELOW]},_U={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 Wx(e,t){return{...e,filters:t,offset:0,name:void 0}}function DP(e,t){return Wx(e,(e.filters??[]).filter(n=>n.code!==t))}function Wp(e,t,n,r,i){const s=[];return e.filters&&s.push(...e.filters),s.push({code:t,operator:n,value:r??""}),Wx(e,s)}function DU(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function IU(e,t){return Hx(e,t,-1)}function AU(e,t){return Hx(e,t,0)}function NU(e,t){return Hx(e,t,1)}function Hx(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setDate(i.getDate()+1),i.setTime(i.getTime()-1),Gx(e,t,r,i)}function MU(e,t){return qx(e,t,-1)}function OU(e,t){return qx(e,t,0)}function LU(e,t){return qx(e,t,1)}function qx(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const i=new Date(r.getTime());return i.setMonth(i.getMonth()+1),i.setDate(1),i.setHours(0,0,0,0),i.setTime(i.getTime()-1),Gx(e,t,r,i)}function $U(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),Gx(e,t,n,new Date)}function Gx(e,t,n,r){return e=DP(e,t),e=XS(e,t,Se.GREATER_THAN_OR_EQUALS,n),e=XS(e,t,Se.LESS_THAN_OR_EQUALS,r),e}function XS(e,t,n,r){return Wp(e,t,n,r.toISOString())}function JS(e,t,n=!0){return Wp(e,t,Se.MISSING,n.toString())}function FU(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function zU(e,t){const n=e.count??Mp,r=(t-1)*n;return FU(e,r)}function BU(e,t,n){return t===UU(e)&&n!==void 0&&n===VU(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function UU(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function VU(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function WU(e){return RU[e.type]}function IP(e){return _U[e]??""}function ga(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 HU(e,t){var r,i;const n=t.name;return n==="id"?e.id:n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?fr((i=e.meta)==null?void 0:i.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?qU(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?GU(e,t.searchParams[0]):null}function qU(e,t){var s,l,u;const n=((u=(l=(s=t.path)==null?void 0:s.split("."))==null?void 0:l.pop())==null?void 0:u.replaceAll("[x]",""))??"",[r,i]=Ou({type:e.resourceType,value:e},n);return r?o.jsx(Ti,{path:t.path,property:t,propertyType:i,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function GU(e,t){const n=fa(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:o.jsx(o.Fragment,{children:n.map((r,i)=>o.jsx(Ti,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${i}-${n.length}`))})}function QU(e){const t=y.useRef(!1),[n,r]=y.useState({search:JSON.parse(ki(e.search))}),[i,s]=y.useState(!1);y.useEffect(()=>{r({search:e.search})},[e.search]);const l=y.useMemo(()=>{if(!e.visible)return[];const d=e.search.resourceType,p=nT(d),h=dx(d);return iu(KU(p,h)).map(m=>({value:m,label:ga(m)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function u(d){r({search:{...n.search,fields:d}})}return o.jsx(Mn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=i},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:o.jsx("div",{"data-testid":"overlay-child"})},children:o.jsxs(nt,{children:[o.jsx(wu,{style:{width:550},placeholder:"Select fields to display",data:l,value:n.search.fields??[],onChange:u,onDropdownOpen:()=>s(!0),onDropdownClose:()=>s(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function KU(e,t){const n=[],r=new Set,i=new Set;for(const s of Object.keys(e.elements))n.push(s),r.add(s.toLowerCase()),i.add(ga(s));if(t)for(const s of Object.keys(t)){const l=ga(s);!r.has(s)&&!i.has(l)&&(n.push(s),r.add(s),i.add(l))}return n}function AP(e){const t=Xl(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case ho.REFERENCE:return o.jsx(Up,{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 ho.BOOLEAN:return o.jsx(Kn,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case ho.DATE:return o.jsx(Be,{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 ho.DATETIME:return o.jsx(pa,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ho.NUMBER:return o.jsx(Be,{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 ho.QUANTITY:return o.jsx(ha,{name:n,path:"",defaultValue:YU(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return o.jsx(Be,{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 YU(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function XU(e){const[t,n]=y.useState(zr(e.search)),r=y.useRef(t);r.current=t,y.useEffect(()=>{n(zr(e.search))},[e.search]);function i(d){n(Wp(r.current,d.code,d.operator,d.value))}if(!e.visible)return null;const s=e.search.resourceType,l=dx(s)??{},u=t.filters||[];return o.jsx(Mn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:o.jsxs(gt,{onSubmit:()=>e.onOk(r.current),children:[o.jsxs("div",{children:[o.jsxs("table",{children:[o.jsxs("colgroup",{children:[o.jsx("col",{style:{width:200}}),o.jsx("col",{style:{width:200}}),o.jsx("col",{style:{width:380}}),o.jsx("col",{style:{width:40}})]}),o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Field"}),o.jsx("th",{children:"Operation"}),o.jsx("th",{children:"Value"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:u.map((d,p)=>o.jsx(JU,{id:`filter-${p}-row`,resourceType:s,searchParams:l,value:d,onChange:h=>{const m=[...u];m[p]=h,n(Wx(r.current,m))},onDelete:()=>n(DU(r.current,p))},`filter-${p}-row`))})]}),o.jsx($x,{propertyDisplayName:"Filter",onClick:()=>i({})})]}),o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"OK"})})]})})}function JU(e){const t=e.value,n=y.useRef(t);n.current=t;function r(d){n.current.code=d,n.current.operator=Se.EQUALS,n.current.value="",e.onChange(n.current)}function i(d){n.current.operator=d,n.current.value="",e.onChange(n.current)}function s(d){n.current.value=d,e.onChange(n.current)}const l=e.searchParams[t.code],u=l&&WU(l);return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(en,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:d=>r(d.currentTarget.value),data:["",...Object.keys(e.searchParams).map(d=>({value:d,label:ga(d)}))]})}),o.jsx("td",{children:u&&o.jsx(en,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:d=>i(d.currentTarget.value),data:["",...u.map(d=>({value:d,label:IP(d)}))]})}),o.jsx("td",{children:l&&t.operator&&o.jsx(AP,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:s})}),o.jsx("td",{children:e.onDelete&&o.jsx(En,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:o.jsx(Nl,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function ZU(e){const[t,n]=y.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return o.jsx(Mn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:o.jsx(gt,{onSubmit:r,children:o.jsxs($r,{children:[o.jsx($r.Col,{span:10,children:o.jsx(AP,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),o.jsx($r.Col,{span:2,children:o.jsx(Ee,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function eV(e){var i;const{resourceType:t,filter:n}=e,r=(i=Ki.types[t].searchParams)==null?void 0:i[n.code];if(r){if(r.type==="reference"&&(n.operator===Se.EQUALS||n.operator===Se.NOT_EQUALS))return o.jsx(ec,{value:{reference:n.value}});const s=Xl(t,r);if(n.code==="_lastUpdated"||s.type===ho.DATETIME)return o.jsx(o.Fragment,{children:fr(n.value)})}return o.jsx(o.Fragment,{children:n.value})}function tV(e){if(!e.searchParams)return null;function t(s,l){i(BU(e.search,s.code,l))}function n(s){i(DP(e.search,s.code))}function r(s,l){e.onPrompt(s,{code:s.code,operator:l,value:""})}function i(s){e.onChange(s)}return e.searchParams.length===1?o.jsx(nV,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:i,onClear:n}):o.jsx(ye.Dropdown,{children:e.searchParams.map(s=>o.jsx(ye.Item,{children:ga(s.code)},s.code))})}function nV(e){switch(e.searchParam.type){case"date":return o.jsx(rV,{...e});case"number":case"quantity":return o.jsx(iV,{...e});case"reference":return o.jsx(oV,{...e});case"string":return o.jsx(sV,{...e});case"token":case"uri":return o.jsx(aV,{...e});default:return o.jsxs(o.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function rV(e){const{searchParam:t}=e,n=t.code;return o.jsxs(ye.Dropdown,{children:[o.jsx(ye.Item,{leftSection:o.jsx(kx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),o.jsx(ye.Item,{leftSection:o.jsx(Tx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Equals..."}),o.jsx(ye.Item,{leftSection:o.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Se.NOT_EQUALS),children:"Does not equal..."}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(QT,{size:14}),onClick:()=>e.onPrompt(t,Se.ENDS_BEFORE),children:"Before..."}),o.jsx(ye.Item,{leftSection:o.jsx(GT,{size:14}),onClick:()=>e.onPrompt(t,Se.STARTS_AFTER),children:"After..."}),o.jsx(ye.Item,{leftSection:o.jsx(zF,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Between..."}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange(NU(e.search,n)),children:"Tomorrow"}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange(AU(e.search,n)),children:"Today"}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange(IU(e.search,n)),children:"Yesterday"}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange(LU(e.search,n)),children:"Next Month"}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange(OU(e.search,n)),children:"This Month"}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange(MU(e.search,n)),children:"Last Month"}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(qs,{size:14}),onClick:()=>e.onChange($U(e.search,n)),children:"Year to date"}),o.jsx(Lu,{...e})]})}function iV(e){const{searchParam:t}=e;return o.jsxs(ye.Dropdown,{children:[o.jsx(ye.Item,{leftSection:o.jsx(kx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),o.jsx(ye.Item,{leftSection:o.jsx(Tx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Equals..."}),o.jsx(ye.Item,{leftSection:o.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Se.NOT_EQUALS),children:"Does not equal..."}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(GT,{size:14}),onClick:()=>e.onPrompt(t,Se.GREATER_THAN),children:"Greater than..."}),o.jsx(ye.Item,{leftSection:o.jsx(Zg,{size:14}),onClick:()=>e.onPrompt(t,Se.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),o.jsx(ye.Item,{leftSection:o.jsx(QT,{size:14}),onClick:()=>e.onPrompt(t,Se.LESS_THAN),children:"Less than..."}),o.jsx(ye.Item,{leftSection:o.jsx(Zg,{size:14}),onClick:()=>e.onPrompt(t,Se.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),o.jsx(Lu,{...e})]})}function oV(e){const{searchParam:t}=e;return o.jsxs(ye.Dropdown,{children:[o.jsx(ye.Item,{leftSection:o.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Equals..."}),o.jsx(ye.Item,{leftSection:o.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Se.NOT),children:"Does not equal..."}),o.jsx(Lu,{...e})]})}function sV(e){const{searchParam:t}=e;return o.jsxs(ye.Dropdown,{children:[o.jsx(ye.Item,{leftSection:o.jsx(kx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),o.jsx(ye.Item,{leftSection:o.jsx(Tx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Equals..."}),o.jsx(ye.Item,{leftSection:o.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Se.NOT),children:"Does not equal..."}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(VF,{size:14}),onClick:()=>e.onPrompt(t,Se.CONTAINS),children:"Contains..."}),o.jsx(ye.Item,{leftSection:o.jsx(UF,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Does not contain..."}),o.jsx(Lu,{...e})]})}function aV(e){const{searchParam:t}=e;return o.jsxs(ye.Dropdown,{children:[o.jsx(ye.Item,{leftSection:o.jsx(Iu,{size:14}),onClick:()=>e.onPrompt(t,Se.EQUALS),children:"Equals..."}),o.jsx(ye.Item,{leftSection:o.jsx(Du,{size:14}),onClick:()=>e.onPrompt(t,Se.NOT),children:"Does not equal..."}),o.jsx(Lu,{...e})]})}function Lu(e){const{searchParam:t}=e,n=t.code;return o.jsxs(o.Fragment,{children:[o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx($F,{size:14}),onClick:()=>e.onChange(JS(e.search,n)),children:"Missing"}),o.jsx(ye.Item,{leftSection:o.jsx(LF,{size:14}),onClick:()=>e.onChange(JS(e.search,n,!1)),children:"Not missing"}),o.jsx(ye.Divider,{}),o.jsx(ye.Item,{leftSection:o.jsx(Nl,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const lV="_root_vlout_1",cV="_table_vlout_8",uV="_tr_vlout_12",dV="_control_vlout_22",fV="_icon_vlout_31",Fc={root:lV,table:cV,tr:uV,control:dV,icon:fV};function pV(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(hV(t,r));return n}function hV(e,t){var i;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=Ta(e,t),r=g$(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const s=dx(e);let l;if(s){const u=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);l=Object.values(s).filter(d=>!!d.expression&&u.test(d==null?void 0:d.expression)),l.length===0&&(l=void 0)}return{name:t,elementDefinition:n,searchParams:l}}if(r){const s=Xl(e,r);return{name:t,elementDefinition:(i=s.elementDefinitions)==null?void 0:i[0],searchParams:[r]}}return{name:t}}class mV extends Event{constructor(t){super("change"),this.definition=t}}class gV extends Event{constructor(t){super("load"),this.response=t}}class $f extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function $u(e){var Q,ne,V;const t=Pe(),[n,r]=y.useState(),{search:i,onLoad:s}=e,[l,u]=y.useState(i);hs(i,l)||u(i);const[d,p]=y.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),h=y.useRef(d);h.current=d;const m=l.total??"accurate",v=y.useCallback(O=>{r(void 0),t.requestSchema(l.resourceType).then(()=>t.search(l.resourceType,ml({...l,total:m,fields:void 0}),O)).then(A=>{p({...h.current,searchResponse:A}),s&&s(new gV(A))}).catch(A=>{p({...h.current,searchResponse:void 0}),r(Vt(A))})},[t,l,m,s]),x=y.useCallback(()=>{p({...h.current,searchResponse:void 0}),v({cache:"reload"})},[v]);y.useEffect(()=>{v()},[v]);function b(O,A){O.stopPropagation();const I=O.target.checked,F={...h.current.selected};I?F[A]=!0:delete F[A],p({...h.current,selected:F})}function w(O){O.stopPropagation();const B=O.target.checked,I={},F=h.current.searchResponse;B&&(F!=null&&F.entry)&&F.entry.forEach(Z=>{var ae;(ae=Z.resource)!=null&&ae.id&&(I[Z.resource.id]=!0)}),p({...h.current,selected:I})}function j(){var A,B;const O=h.current;if(!((A=O.searchResponse)!=null&&A.entry)||O.searchResponse.entry.length===0)return!1;for(const I of O.searchResponse.entry)if((B=I.resource)!=null&&B.id&&!O.selected[I.resource.id])return!1;return!0}function P(O){e.onChange&&e.onChange(new mV(O))}function T(O,A){if(YT(O.target)||O.button===2)return;Gt(O);const B=O.button===1||O.ctrlKey||O.metaKey;!B&&e.onClick&&e.onClick(new $f(A,O)),B&&e.onAuxClick&&e.onAuxClick(new $f(A,O))}function k(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return o.jsx(li,{outcome:n});if(!tT(l.resourceType))return o.jsx(Gn,{style:{width:"100%",height:"100%"},children:o.jsx(Pr,{})});const C=e.checkboxesEnabled,_=pV(l),R=l.resourceType,M=d.searchResponse,N=M==null?void 0:M.entry,L=N==null?void 0:N.map(O=>O.resource),z="subtle",G="gray",q=16,Y=window.innerWidth<768;return o.jsxs("div",{className:Fc.root,"data-testid":"search-control",children:[!e.hideToolbar&&o.jsxs(be,{justify:"space-between",mb:"xl",children:[o.jsxs(be,{gap:2,children:[o.jsx(Ee,{size:"compact-md",variant:z,color:G,leftSection:o.jsx(GF,{size:q}),onClick:()=>p({...h.current,fieldEditorVisible:!0}),children:"Fields"}),o.jsx(Ee,{size:"compact-md",variant:z,color:G,leftSection:o.jsx(JF,{size:q}),onClick:()=>p({...h.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&o.jsx(Ee,{size:"compact-md",variant:z,color:G,leftSection:o.jsx(XF,{size:q}),onClick:e.onNew,children:"New..."}),!Y&&k()&&o.jsx(Ee,{size:"compact-md",variant:z,color:G,leftSection:o.jsx(b8,{size:q}),onClick:e.onExport?e.onExport:()=>p({...h.current,exportDialogVisible:!0}),children:"Export..."}),!Y&&e.onDelete&&o.jsx(Ee,{size:"compact-md",variant:z,color:G,leftSection:o.jsx(Px,{size:q}),onClick:()=>e.onDelete(Object.keys(d.selected)),children:"Delete..."}),!Y&&e.onBulk&&o.jsx(Ee,{size:"compact-md",variant:z,color:G,leftSection:o.jsx(FF,{size:q}),onClick:()=>e.onBulk(Object.keys(d.selected)),children:"Bulk..."})]}),o.jsxs(be,{gap:2,children:[M&&o.jsxs(Le,{size:"xs",c:"dimmed","data-testid":"count-display",children:[NP(l,M).toLocaleString(),"-",wV(l,M).toLocaleString(),M.total!==void 0&&` of ${l.total==="estimate"?"~":""}${(Q=M.total)==null?void 0:Q.toLocaleString()}`]}),o.jsx(En,{variant:z,color:G,title:"Refresh",onClick:x,children:o.jsx(f8,{size:q})})]})]}),o.jsxs(Ae,{className:Fc.table,children:[o.jsxs(Ae.Thead,{children:[o.jsxs(Ae.Tr,{children:[C&&o.jsx(Ae.Th,{children:o.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:j(),onChange:O=>w(O)})}),_.map(O=>o.jsx(Ae.Th,{children:o.jsxs(ye,{shadow:"md",width:240,position:"bottom-end",children:[o.jsx(ye.Target,{children:o.jsx(Qn,{className:Fc.control,p:2,children:o.jsxs(be,{justify:"space-between",wrap:"nowrap",children:[o.jsx(Le,{fw:500,children:ga(O.name)}),o.jsx(Gn,{className:Fc.icon,children:o.jsx(NF,{size:14,stroke:1.5})})]})})}),o.jsx(tV,{search:l,searchParams:O.searchParams,onPrompt:(A,B)=>{p({...h.current,filterDialogVisible:!0,filterDialogSearchParam:A,filterDialogFilter:B})},onChange:A=>{P(A)}})]})},O.name))]}),!e.hideFilters&&o.jsxs(Ae.Tr,{children:[C&&o.jsx(Ae.Th,{}),_.map(O=>o.jsx(Ae.Th,{children:O.searchParams&&o.jsx(vV,{resourceType:R,searchParams:O.searchParams,filters:l.filters})},O.name))]})]}),o.jsx(Ae.Tbody,{children:L==null?void 0:L.map(O=>O&&o.jsxs(Ae.Tr,{className:Fc.tr,"data-testid":"search-control-row",onClick:A=>T(A,O),onAuxClick:A=>T(A,O),children:[C&&o.jsx(Ae.Td,{children:o.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${O.id}`,checked:!!d.selected[O.id],onChange:A=>b(A,O.id)})}),_.map(A=>o.jsx(Ae.Td,{children:HU(O,A)},A.name))]},O.id))})]}),!(L!=null&&L.length)&&o.jsx(Nu,{children:o.jsx(Gn,{style:{height:150},children:o.jsx(Le,{size:"xl",c:"dimmed",children:"No results"})})}),M&&o.jsx(Gn,{m:"md",p:"md",children:o.jsx(Ri,{value:xV(l),total:bV(l,M),onChange:O=>P(zU(l,O)),getControlProps:O=>{switch(O){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o.jsx(QU,{search:l,visible:h.current.fieldEditorVisible,onOk:O=>{P(O),p({...h.current,fieldEditorVisible:!1})},onCancel:()=>{p({...h.current,fieldEditorVisible:!1})}}),o.jsx(XU,{search:l,visible:h.current.filterEditorVisible,onOk:O=>{P(O),p({...h.current,filterEditorVisible:!1})},onCancel:()=>{p({...h.current,filterEditorVisible:!1})}}),o.jsx(PU,{visible:h.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...h.current,exportDialogVisible:!1})}}),o.jsx(ZU,{visible:h.current.filterDialogVisible,title:(ne=d.filterDialogSearchParam)!=null&&ne.code?ga(d.filterDialogSearchParam.code):"",resourceType:R,searchParam:d.filterDialogSearchParam,filter:d.filterDialogFilter,defaultValue:"",onOk:O=>{P(Wp(l,O.code,O.operator,O.value)),p({...h.current,filterDialogVisible:!1})},onCancel:()=>{p({...h.current,filterDialogVisible:!1})}},(V=d.filterDialogSearchParam)==null?void 0:V.code)]})}const yV=$u;function vV(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?o.jsx("span",{children:"no filters"}):o.jsx(o.Fragment,{children:t.map(n=>o.jsxs("div",{children:[IP(n.operator)," ",o.jsx(eV,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function xV(e){return Math.floor((e.offset??0)/(e.count??Mp))+1}function bV(e,t){const n=e.count??Mp,r=MP(e,t);return Math.ceil(r/n)}function NP(e,t){return Math.min(MP(e,t),(e.offset??0)+1)}function wV(e,t){var n;return Math.max(NP(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function MP(e,t){var r,i;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((i=t.link)!=null&&i.some(s=>s.relation==="next")?1:0)),n}function SV(e){const t=Pe(),[n,r]=y.useState(!1),[i,s]=y.useState(),{query:l,fields:u}=e,[d,p]=y.useState(),[h,m]=y.useState({}),v=y.useRef();v.current=d;const x=y.useRef({});x.current=h,y.useEffect(()=>{s(void 0),t.graphql(l).then(p).catch(k=>s(Vt(k)))},[t,l]);function b(k,C){k.stopPropagation();const R=k.target.checked,M={...x.current};R?M[C]=!0:delete M[C],m(M)}function w(k){var N;k.stopPropagation();const _=k.target.checked,R={},M=(N=v.current)==null?void 0:N.data.ResourceList;_&&M&&M.forEach(L=>{L.id&&(R[L.id]=!0)}),m(R)}function j(){var C;const k=(C=v.current)==null?void 0:C.data.ResourceList;if(!k||k.length===0)return!1;for(const _ of k)if(_.id&&!x.current[_.id])return!1;return!0}function P(k,C){YT(k.target)||(Gt(k),k.button!==1&&e.onClick&&e.onClick(new $f(C,k)),k.button===1&&e.onAuxClick&&e.onAuxClick(new $f(C,k)))}if(y.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return o.jsx(Pr,{});const T=e.checkboxesEnabled;return o.jsxs("div",{onContextMenu:k=>Gt(k),"data-testid":"search-control",children:[o.jsxs(Ae,{children:[o.jsx(Ae.Thead,{children:o.jsxs(Ae.Tr,{children:[T&&o.jsx(Ae.Th,{children:o.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:j(),onChange:k=>w(k)})}),u.map(k=>o.jsx(Ae.Th,{children:k.name},k.name))]})}),o.jsx(Ae.Tbody,{children:d==null?void 0:d.data.ResourceList.map(k=>k&&o.jsxs(Ae.Tr,{"data-testid":"search-control-row",onClick:C=>P(C,k),onAuxClick:C=>P(C,k),children:[T&&o.jsx(Ae.Td,{children:o.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${k.id}`,checked:!!h[k.id],onChange:C=>b(C,k.id)})}),u.map(C=>o.jsx(Ae.Td,{children:o.jsx(TU,{propertyType:C.propertyType,path:C.fhirPath,resource:k})},C.name))]},k.id))})]}),(d==null?void 0:d.data.ResourceList.length)===0&&o.jsx("div",{"data-testid":"empty-search",children:"No results"}),i&&o.jsx("div",{"data-testid":"search-error",children:o.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(i,void 0,2)})}),e.onBulk&&o.jsx(Ee,{onClick:()=>e.onBulk(Object.keys(x.current)),children:"Bulk..."})]})}const jV=y.memo(SV);function CV(e){const{group:t}=e;return o.jsx(Er,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:o.jsxs(be,{children:[t.measureScore&&o.jsx(TV,{group:t}),!t.measureScore&&o.jsx(kV,{group:t})]})})}function EV(e){const{measure:t}=e;return o.jsxs(o.Fragment,{children:[o.jsx(Le,{fz:"md",fw:500,mb:8,children:t.title}),o.jsx(Le,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function kV(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(d=>ms(d.code)==="numerator"),i=n==null?void 0:n.find(d=>ms(d.code)==="denominator"),s=r==null?void 0:r.count,l=i==null?void 0:i.count;if(l===0)return o.jsxs(se,{children:[o.jsx(ze,{order:3,children:"Not Applicable"}),o.jsx(Le,{children:`Denominator: ${l}`})]});if(s===void 0||l===void 0)return o.jsxs(se,{children:[o.jsx(ze,{order:3,children:"Insufficient Data"}),o.jsx(Le,{children:`Numerator: ${s}`}),o.jsx(Le,{children:`Denominator: ${l}`})]});const u=s/l*100;return o.jsx(Rp,{size:120,thickness:12,roundCaps:!0,sections:[{value:u,color:OP(u)}],label:o.jsx(aa,{justify:"center",children:o.jsxs(Le,{fw:700,fz:18,children:[s," / ",l]})})})}function TV(e){var r,i,s;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((i=t.measureScore)==null?void 0:i.code);return o.jsx(o.Fragment,{children:n==="%"?o.jsx(Rp,{size:120,thickness:12,roundCaps:!0,sections:[{value:PV(t),color:OP(((s=t==null?void 0:t.measureScore)==null?void 0:s.value)??0)}],label:o.jsx(aa,{justify:"center",children:o.jsx(Le,{fw:700,fz:18,children:o.jsx(lu,{value:t.measureScore})})})}):o.jsx(aa,{h:120,align:"center",children:o.jsx(ze,{order:3,children:o.jsx(lu,{value:t.measureScore})})})})}function PV(e){var r,i;const t=(r=e.measureScore)==null?void 0:r.value,n=(i=e.measureScore)==null?void 0:i.unit;return t?t<=1&&n==="%"?t*100:t:0}function OP(e){return e<=33?"red":e<=67?"yellow":"green"}function RV(e){var r;const t=Yt(e.measureReport),[n]=TF("Measure",{url:t==null?void 0:t.measure});return t?o.jsxs(se,{children:[n&&o.jsx(EV,{measure:n}),o.jsx(qv,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((i,s)=>o.jsx(CV,{group:i},i.id??s))})]}):null}function _V(e){const{patient:t,...n}=e,r=y.useCallback((i,s,l)=>{const u=`${s}/${l}`,d=100;return Promise.allSettled([i.readHistory("Patient",l),i.search("Communication",{subject:u,_count:d}),i.search("Device",{patient:u,_count:d}),i.search("DeviceRequest",{patient:u,_count:d}),i.search("DiagnosticReport",{subject:u,_count:d}),i.search("Media",{subject:u,_count:d}),i.search("ServiceRequest",{subject:u,_count:d}),i.search("Task",{subject:u,_count:d})])},[]);return o.jsx(Vp,{value:t,loadTimelineResources:r,createCommunication:(i,s,l)=>({resourceType:"Communication",status:"completed",subject:Zt(i),sender:Zt(s),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(i,s,l)=>({resourceType:"Media",status:"completed",subject:Zt(i),operator:Zt(s),issued:new Date().toISOString(),content:l}),...n})}const DV="_section_14dzq_2",IV="_hovering_14dzq_11",AV="_editing_14dzq_15",NV="_bottomActions_14dzq_20",gl={section:DV,hovering:IV,editing:AV,bottomActions:NV};function MV(e){const t=Pe(),n=Yt(e.value),[r,i]=y.useState(!1),[s,l]=y.useState(),[u,d]=y.useState(),[p,h]=y.useState();function m(){d(void 0)}function v(){l(void 0)}const x=y.useRef();if(x.current=p,y.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>i(!0)).catch(console.log)},[t]),y.useEffect(()=>(h(BV(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",m),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("click",v)}),[n]),!r||!p)return null;function b(w,j){h({...x.current,[w]:j})}return o.jsx("div",{children:o.jsxs(gt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[o.jsx(Be,{label:"Plan Title",defaultValue:p.title,onChange:w=>b("title",w.currentTarget.value)}),o.jsx(LP,{actions:p.action||[],selectedKey:s,setSelectedKey:l,hoverKey:u,setHoverKey:d,onChange:w=>b("action",w)}),o.jsx(Ee,{type:"submit",children:"Save"})]})})}function LP(e){const t=y.useRef();t.current=e.actions;function n(s){e.onChange(t.current.map(l=>l.id===s.id?s:l))}function r(s){e.onChange([...t.current,s]),e.setSelectedKey(s.id)}function i(s){e.onChange(t.current.filter(l=>l!==s))}return o.jsxs("div",{className:gl.section,children:[e.actions.map(s=>o.jsx("div",{children:o.jsx(OV,{action:s,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>i(s)})},s.id)),o.jsx("div",{className:gl.bottomActions,children:o.jsx(Rt,{href:"#",onClick:s=>{Gt(s),r({id:FP()})},children:"Add action"})})]})}function OV(e){const{action:t}=e,n=zV(t),r=e.selectedKey===e.action.id,i=e.hoverKey===e.action.id;function s(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function l(d){Gt(d),e.setHoverKey(e.action.id)}const u=Nt(gl.section,{[gl.editing]:r,[gl.hovering]:i&&!r});return o.jsxs("div",{"data-testid":t.id,className:u,onClick:s,onMouseOver:l,onFocus:l,children:[r?o.jsx($V,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):o.jsx(LV,{action:t,actionType:n}),o.jsx("div",{className:gl.bottomActions,children:o.jsx(Rt,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const ny={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function LV(e){const{action:t,actionType:n}=e,[r,i]=$P(t);return o.jsxs("div",{children:[o.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&o.jsx("div",{children:o.jsx(Of,{value:{reference:t.definitionCanonical}})}),r&&o.jsx("div",{children:o.jsx(Ti,{property:ny,propertyType:i,value:r})})]})}function $V(e){const{action:t}=e,[n,r]=y.useState(e.actionType);function i(s,l){e.onChange({...t,[s]:l})}return o.jsxs(nt,{gap:"xl",children:[o.jsx(Be,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:s=>i("title",s.currentTarget.value)}),o.jsx(Be,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:s=>i("description",s.currentTarget.value)}),o.jsx(en,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:n,onChange:s=>r(s.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&o.jsx(LP,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:s=>i("action",s)}),(()=>{switch(n){case"appointment":return o.jsx(of,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return o.jsx(of,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return o.jsx(of,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return o.jsx(of,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),o.jsx(Ht,{title:"Timing",description:"When the action should take place.",children:o.jsx(FV,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function of(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return o.jsx(Ra,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:i=>{i?e.onChange({...e.action,definitionCanonical:Ft(i)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function FV(e){const t=e.action,n="timing",[r,i]=$P(t);return o.jsx(Zl,{property:ny,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:i,onChange:(s,l)=>{e.onChange(gP(t,n,l??n,ny,s))},outcome:void 0})}function zV(e){var t,n,r;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((n=e.definitionCanonical)!=null&&n.startsWith("Questionnaire/"))return"questionnaire";if((r=e.definitionCanonical)!=null&&r.startsWith("ActivityDefinition/"))return"task"}function $P(e){return Ou({type:"PlanDefinitionAction",value:e},"timing")}let mg=1;function FP(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(mg=Math.max(mg,t+1))}return e}return"id-"+mg++}function BV(e){return{...e,action:zP(e.action)}}function zP(e){if(e)return e.map(t=>({...t,id:FP(t.id),action:zP(t.action)}))}var Jt=(e=>(e.group="group",e.display="display",e.question="question",e.boolean="boolean",e.decimal="decimal",e.integer="integer",e.date="date",e.dateTime="dateTime",e.time="time",e.string="string",e.text="text",e.url="url",e.choice="choice",e.openChoice="open-choice",e.attachment="attachment",e.reference="reference",e.quantity="quantity",e))(Jt||{});function UV(e){return e.type==="choice"||e.type==="open-choice"}function VV(e,t){var i;const n=ws(e,Dp+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression");if(t&&n){const s=(i=n.valueExpression)==null?void 0:i.expression;if(s){const l=ni(t),u=fa(s,[l],{"%resource":l});return Vi(u)}}if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const s of e.enableWhen){const l=WP(t==null?void 0:t.item,s.question);if(s.operator==="exists"&&!s.answerBoolean&&!(l!=null&&l.length)){if(r==="any")return!0;continue}const{anyMatch:u,allMatch:d}=GV(s,l,r);if(r==="any"&&u)return!0;if(r==="all"&&!d)return!1}return r!=="any"}function BP(e,t){return e.map(n=>{if(n.item)return{...n,item:BP(n.item,t)};{const r=HV(n,t);if(!r)return null;const i=WV(n,r);return i?{id:n==null?void 0:n.id,linkId:n==null?void 0:n.linkId,text:n.text,answer:[i]}:null}}).filter(n=>n!==null)}function WV(e,t){if(e.type)switch(e.type){case"boolean":return t.type===re.boolean?{valueBoolean:t.value}:void 0;case"date":return t.type===re.date?{valueDate:t.value}:void 0;case"dateTime":return t.type===re.dateTime?{valueDateTime:t.value}:void 0;case"time":return t.type===re.time?{valueTime:t.value}:void 0;case"url":return t.type===re.url?{valueString:t.value}:void 0;case"text":return t.type===re.string?{valueString:t.value}:void 0;case"attachment":return t.type===re.Attachment?{valueAttachment:t.value}:void 0;case"reference":return t.type===re.Reference?{valueReference:t.value}:void 0;case"quantity":return{valueQuantity:t.value};case"decimal":return{valueDecimal:t.value};case"integer":return{valueInteger:t.value};case"string":return{valueString:t.value};default:return}}function HV(e,t){var r;if(!t)return;const n=ws(e,Dp+"/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression");if(n){const i=(r=n.valueExpression)==null?void 0:r.expression;if(i){const s=ni(t),l=fa(i,[s],{"%resource":s});return l.length!==0?l[0]:void 0}}}function UP(e,t){return e.map(n=>{const r=t.find(i=>i.linkId===n.linkId);return r?{...n,item:r.item?UP(n.item||[],r.item):n.item,answer:r.answer||n.answer}:n})}function VP(e,t,n){var i;const r=[];for(const s of e){const l=(i=n.answerOption)==null?void 0:i.find(u=>ou(Co(u))===s);if(l){const u=Co(l);u&&r.push({[t]:u.value})}}return r}function WP(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=WP(n.item,t);if(r)return r}}}function qV(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:i}]=fa(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return i}else return!1}function GV(e,t,n){const r=t||[],i=eW(e);let s=!1,l=!0;for(const u of r){const d=tW(u),{operator:p}=e;if(qV(d,i,p)?s=!0:l=!1,n==="any"&&s)break}return{anyMatch:s,allMatch:l}}function HP(e){var n,r;const t=ws(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(i=>i.code)}}function gg(e,t){var i;const n=zr(e);let r=ws(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(i=n.extension)==null?void 0:i.filter(s=>s!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(s=>({code:s}))},delete r.valueCode),n)}function QV(e,t,n){const r=ws(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let i=r.valueString;t!=null&&t.reference&&(i=i.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(i=i.replaceAll("$encounter",n.reference));const s={},l=i.split("&");for(const u of l){const[d,p]=qg(u,"=",2);s[d]=p}return s}function KV(e){return{resourceType:"QuestionnaireResponse",questionnaire:Ft(e),item:qP(e.item),status:"in-progress"}}function qP(e){return(e==null?void 0:e.map(GP))??[]}function GP(e){var t;return{id:XV(),linkId:e.linkId,text:e.text,item:qP(e.item),answer:((t=e.initial)==null?void 0:t.map(JV))??[]}}let YV=1;function XV(){return"id-"+YV++}function JV(e){return{...e}}function ZV(e){var n,r,i,s;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const l=ws(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((s=(i=(r=l==null?void 0:l.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:s.code)==="page")return e.item.length}return 1}function Hp(e){return Ru({value:e},"value")}function Co(e){return Ru({value:e},"value")}function eW(e){return Ru({value:e},"answer")}function tW(e){return Ru({value:e},"value")}const QP=y.createContext({});function ry(e){const t=y.useContext(QP),n=e.item,r=e.response;function i(p){var m,v,x,b;let h;Array.isArray(p)?h=p:e.index>=(((v=(m=e.response)==null?void 0:m.answer)==null?void 0:v.length)??0)?h=(((x=e.response)==null?void 0:x.answer)??[]).concat([p]):h=(((b=e.response)==null?void 0:b.answer)??[]).map((j,P)=>P===e.index?p:j)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:h})}const s=n.type;if(!s)return null;const l=n.linkId;if(!l)return null;const u=n.initial&&n.initial.length>0?n.initial[0]:void 0,d=Kx(r,e.index)??Hp(u);switch(s){case Jt.display:return o.jsx("p",{children:e.item.text},e.item.linkId);case Jt.boolean:return o.jsx(mP,{title:e.item.text,htmlFor:e.item.linkId,children:o.jsx(Kn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:d==null?void 0:d.value,onChange:p=>i({valueBoolean:p.currentTarget.checked})})},e.item.linkId);case Jt.decimal:return o.jsx(Be,{type:"number",step:"any",id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueDecimal:p.currentTarget.valueAsNumber})});case Jt.integer:return o.jsx(Be,{type:"number",step:1,id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueInteger:p.currentTarget.valueAsNumber})});case Jt.date:return o.jsx(Be,{type:"date",id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueDate:p.currentTarget.value})});case Jt.dateTime:return o.jsx(pa,{name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueDateTime:p})});case Jt.time:return o.jsx(Be,{type:"time",id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueTime:p.currentTarget.value})});case Jt.string:case Jt.url:return o.jsx(Be,{id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueString:p.currentTarget.value})});case Jt.text:return o.jsx(ja,{id:l,name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueString:p.currentTarget.value})});case Jt.attachment:return o.jsx(be,{py:4,children:o.jsx(ZT,{path:"",name:l,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueAttachment:p})})});case Jt.reference:return o.jsx(Up,{name:l,required:n.required,targetTypes:HP(n),searchCriteria:QV(n,t.subject,t.encounter),defaultValue:d==null?void 0:d.value,onChange:p=>i({valueReference:p})});case Jt.quantity:return o.jsx(ha,{path:"",name:l,required:n.required,defaultValue:d==null?void 0:d.value,onChange:p=>i({valueQuantity:p}),disableWheel:!0});case Jt.choice:case Jt.openChoice:return aW(n)&&!n.answerValueSet?o.jsx(nW,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>i(p)}):lW(n)&&!n.answerValueSet?o.jsx(rW,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>i(p)}):o.jsx(iW,{name:l,item:n,initial:u,response:r,onChangeAnswer:p=>i(p)});default:return null}}function nW(e){var d;const{name:t,item:n,initial:r,response:i}=e;if(!((d=n.answerOption)!=null&&d.length))return o.jsx(Qx,{});const s=Hp(r),l=[""];for(const p of n.answerOption){const h=Co(p);l.push(ou(h))}const u=Kx(i)??s;if(n.repeats){const{propertyName:p,data:h}=YP(e.item),m=KP(i);return o.jsx(wu,{data:h,placeholder:"Select items",searchable:!0,defaultValue:m||[ou(s)],onChange:v=>{const x=VP(v,p,n);e.onChangeAnswer(x)}})}return o.jsx(en,{id:t,name:t,onChange:p=>{const h=p.currentTarget.selectedIndex;if(h===0){e.onChangeAnswer({});return}const m=n.answerOption[h-1],v=Co(m),x="value"+$n(v.type);e.onChangeAnswer({[x]:v.value})},defaultValue:_u(u==null?void 0:u.value)||(u==null?void 0:u.value),data:l})}function rW(e){var d;const{item:t,initial:n,response:r}=e;if(!((d=t.answerOption)!=null&&d.length))return o.jsx(Qx,{});const i=Hp(n),{propertyName:s,data:l}=YP(e.item),u=KP(r);return o.jsx(wu,{data:l,placeholder:"Select items",searchable:!0,defaultValue:u||[ou(i)],onChange:p=>{const h=VP(p,s,t);e.onChangeAnswer(h)}})}function iW(e){var l;const{name:t,item:n,initial:r,onChangeAnswer:i,response:s}=e;return!((l=n.answerOption)!=null&&l.length)&&!n.answerValueSet?o.jsx(Qx,{}):n.answerValueSet?o.jsx(yP,{path:"",name:t,binding:n.answerValueSet,onChange:u=>i({valueCoding:u}),creatable:n.type===Jt.openChoice}):o.jsx(oW,{name:(s==null?void 0:s.id)??t,item:n,initial:r,response:s,onChangeAnswer:i})}function oW(e){const{name:t,item:n,initial:r,onChangeAnswer:i,response:s}=e,l=Ta("QuestionnaireItemAnswerOption","value[x]"),u=Hp(r),d=[];let p;if(n.answerOption)for(let v=0;v<n.answerOption.length;v++){const x=n.answerOption[v],b=`${t}-option-${v}`,w=Co(x);w!=null&&w.value&&(u&&ki(w)===ki(u)&&(p=b),d.push([b,w]))}const h=Kx(s),m=sW(d,h);return o.jsx(ua.Group,{name:t,value:m??p,onChange:v=>{const x=d.find(b=>b[0]===v);if(x){const b=x[1],w="value"+$n(b.type);i({[w]:b.value})}},children:d.map(([v,x])=>o.jsx(ua,{id:v,value:v,py:4,label:o.jsx(Ti,{property:l,propertyType:x.type,value:x.value})},v))})}function Qx(){return o.jsx(Be,{disabled:!0,placeholder:"No Answers Defined"})}function Kx(e,t=0){const n=e.answer;return Co((n==null?void 0:n[t])??{})}function KP(e){const t=e.answer;return t?t.map(r=>Co(r)).map(r=>_u(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function sW(e,t){var n;return(n=e.find(r=>hs(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function aW(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,i,s;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((s=(i=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:s.code)==="drop-down"}))}function lW(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,i,s;return n.url===Dp+"/fhir/StructureDefinition/questionnaire-itemControl"&&((s=(i=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:i[0])==null?void 0:s.code)==="multi-select"}))}function YP(e){var s;if(((s=e.answerOption)==null?void 0:s.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=Co(t),r="value"+$n(n.type),i=(e.answerOption??[]).map(l=>{const u=Co(l),d=ou(u);return{value:d,label:d}});return{propertyName:r,data:i}}const cW="_section_1rlfy_1",uW="_hovering_1rlfy_10",dW="_editing_1rlfy_14",fW="_questionBody_1rlfy_20",pW="_topActions_1rlfy_24",hW="_bottomActions_1rlfy_33",mW="_movementActions_1rlfy_44",gW="_movementIcons_1rlfy_56",yW="_columnAlignment_1rlfy_60",vW="_linkIdInput_1rlfy_65",xW="_typeSelect_1rlfy_70",bW="_preserveBreaks_1rlfy_74",Or={section:cW,hovering:uW,editing:dW,questionBody:fW,topActions:pW,bottomActions:hW,movementActions:mW,movementIcons:gW,columnAlignment:yW,linkIdInput:vW,typeSelect:xW,preserveBreaks:bW};function wW(e){const t=Pe(),n=Yt(e.questionnaire),[r,i]=y.useState(!1),[s,l]=y.useState(),[u,d]=y.useState(),[p,h]=y.useState();function m(){h(void 0)}function v(){d(void 0)}y.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>i(!0)).catch(console.log)},[t]),y.useEffect(()=>(l(EW(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",m),document.addEventListener("click",v),()=>{document.removeEventListener("mouseover",m),document.removeEventListener("click",v)}),[n]);const x=(b,w)=>{l(b),e.autoSave&&!w&&e.onSubmit&&e.onSubmit(b)};return!r||!s?null:o.jsx("div",{children:o.jsxs(gt,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(s),children:[o.jsx(XP,{item:s,selectedKey:u,setSelectedKey:d,hoverKey:p,setHoverKey:h,onChange:x}),o.jsx(Ee,{type:"submit",children:"Save"})]})})}function XP(e){var k;const t=e.item,n=e.item,r=Ao(e.item),i=r||n.type===Jt.group,s=n.linkId??"[untitled]",l=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=y.useRef();d.current=e.item;function p(C){Gt(C),e.setSelectedKey(e.item.id)}function h(C){Gt(C),e.setHoverKey(e.item.id)}function m(C){var R;const _=d.current;e.onChange({..._,item:(R=_.item)==null?void 0:R.map(M=>M.id===C.id?C:M)})}function v(C,_){e.onChange({...e.item,item:[...e.item.item??[],C]},_)}function x(C){var _;e.onChange({...e.item,item:(_=e.item.item)==null?void 0:_.filter(R=>R!==C)})}function b(C,_){e.onChange({...d.current,[C]:_})}function w(C){e.onChange({...e.item,...C})}function j(C){var _;e.onChange({...e.item,item:(_=e.item.item)==null?void 0:_.map(R=>R===C?{...R,repeats:!R.repeats}:R)})}function P(C,_){const R=PW(e.item.item,C,_);e.onChange({...e.item,item:R})}const T=Nt(Or.section,{[Or.editing]:l,[Or.hovering]:u&&!l});return o.jsxs("div",{"data-testid":n.linkId,className:T,onClick:p,onMouseOver:h,onFocus:h,children:[o.jsx("div",{className:Or.questionBody,children:l?o.jsxs(o.Fragment,{children:[r&&o.jsx(Be,{size:"xl",defaultValue:t.title,onBlur:C=>b("title",C.currentTarget.value)}),!r&&o.jsx(ja,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:C=>b("text",C.currentTarget.value)}),n.type==="reference"&&o.jsx(CW,{item:n,onChange:w}),UV(n)&&o.jsx(SW,{item:n,onChange:C=>w(C)})]}):o.jsxs(o.Fragment,{children:[t.title&&o.jsx(ze,{children:t.title}),n.text&&o.jsx("div",{className:Or.preserveBreaks,children:n.text}),!i&&o.jsx(ry,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(k=n.item)==null?void 0:k.map((C,_)=>o.jsx("div",{children:o.jsx(XP,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>x(C),onRepeatable:j,onMoveUp:()=>P(_,-1),onMoveDown:()=>P(_,1)})},C.id)),!i&&o.jsx("div",{className:Or.topActions,children:l?o.jsxs(o.Fragment,{children:[o.jsx(Be,{size:"xs",className:Or.linkIdInput,defaultValue:n.linkId,onBlur:C=>b("linkId",C.currentTarget.value)}),!i&&o.jsx(en,{size:"xs",className:Or.typeSelect,defaultValue:n.type,onChange:C=>b("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):o.jsx("div",{children:s})}),!r&&o.jsx(se,{className:Or.movementActions,children:o.jsxs(se,{className:Or.columnAlignment,children:[!e.isFirst&&o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:o.jsx(OF,{"data-testid":"up-button",size:15,className:Or.movementIcons})}),!e.isLast&&o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:o.jsx(MF,{"data-testid":"down-button",size:15,className:Or.movementIcons})})]})}),o.jsxs("div",{className:Or.bottomActions,children:[i&&o.jsxs(o.Fragment,{children:[o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),v({id:ya(),linkId:sy("q"),type:"string",text:"Question"})},children:"Add item"}),o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),v({id:ya(),linkId:sy("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),v(TW(),!0)},children:"Add Page"}),l&&!r&&o.jsxs(o.Fragment,{children:[o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),o.jsx(Rt,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function SW(e){const t=Ta("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return o.jsxs("div",{children:[e.item.answerValueSet!==void 0?o.jsx(Be,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):o.jsx(jW,{options:n,property:t,item:e.item,onChange:e.onChange}),o.jsxs(se,{display:"flex",children:[o.jsx(Rt,{href:"#",onClick:r=>{Gt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:ya()}]})},children:"Add choice"}),o.jsx(_p,{w:"lg"}),o.jsx(Rt,{href:"#",onClick:r=>{Gt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function jW(e){return o.jsx("div",{children:e.options.map(t=>{const[n,r]=Ou({type:"QuestionnaireItemAnswerOption",value:t},"value");return o.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[o.jsx("div",{children:o.jsx(Zl,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(i,s)=>{const l=[...e.options],u=l.findIndex(d=>d.id===t.id);l[u]={id:t.id,[s]:i},e.onChange({...e.item,answerOption:l})},outcome:void 0},t.id)}),o.jsx("div",{children:o.jsx(Rt,{href:"#",onClick:i=>{Gt(i),e.onChange({...e.item,answerOption:e.options.filter(s=>s.id!==t.id)})},children:"Remove"})})]},t.id)})})}function CW(e){const t=HP(e.item)??[];return o.jsxs(o.Fragment,{children:[t.map((n,r)=>o.jsxs(be,{children:[o.jsx(Ix,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:i=>{e.onChange(gg(e.item,t.map(s=>s===n?i:s)))}}),o.jsx(Rt,{href:"#",onClick:i=>{Gt(i),e.onChange(gg(e.item,t.filter(s=>s!==n)))},children:"Remove"})]},`${n}-${r}`)),o.jsx(Rt,{href:"#",onClick:n=>{Gt(n),e.onChange(gg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let iy=1,oy=1;function sy(e){return e+iy++}function ya(){return"id-"+oy++}function EW(e){return{...e,id:e.id||ya(),item:JP(e.item)}}function JP(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(oy=Math.max(oy,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(iy=Math.max(iy,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ya(),item:JP(t.item),answerOption:kW(t.answerOption)}))}function kW(e){if(e)return e.map(t=>({...t,id:t.id||ya()}))}function TW(){return{id:ya(),linkId:sy("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function PW(e,t,n){const r=e??[],i=t+n;if(i<0||i>=r.length)return r;const s=[...r];return[s[t],s[i]]=[s[i],s[t]],s}function ZP(e){const{item:t,response:n,onChange:r}=e,[i,s]=y.useState(RW(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===Jt.display)return o.jsx("p",{children:t.text},t.linkId);const l=(t==null?void 0:t.repeats)&&t.type!==Jt.choice&&t.type!==Jt.openChoice;return t.type===Jt.boolean?o.jsx(ry,{item:t,response:n,onChange:u=>r([u]),index:0},t.linkId):o.jsxs(Ht,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(i)].map((u,d)=>o.jsx(ry,{item:t,response:n,onChange:p=>r([p]),index:d},`${t.linkId}-${d}`)),l&&o.jsx(Rt,{onClick:()=>s(u=>u+1),children:"Add Item"})]},e.item.linkId)}function RW(e,t){if(e.type===Jt.choice||e.type===Jt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function eR(e){const[t,n]=y.useState(e.response);if(y.useEffect(()=>{n(e.response)},[e.response]),t.length===0)return null;function r(s,l){const u=t.map((d,p)=>p===l?s[0]:d);n(u),e.onChange(u)}function i(){const s=GP(e.item);n([...t,s])}return o.jsxs(o.Fragment,{children:[t.map((s,l)=>o.jsx(tR,{item:e.item,response:s,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:u=>r(u,l)},s.id)),e.item.repeats&&o.jsx(Rt,{onClick:i,children:`Add Group: ${e.item.text}`})]})}function tR(e){var s;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function i(l){var h;const u=(h=t.item)==null?void 0:h.map(m=>l.find(x=>x.id===m.id)??m),d=u==null?void 0:u.concat(l.slice(1)),p={...t,item:d};r([p])}return e.checkForQuestionEnabled(e.item)?o.jsxs("div",{children:[e.item.text&&o.jsx(ze,{order:3,mb:"md",children:e.item.text}),o.jsx(nt,{children:(s=e.item.item)==null?void 0:s.map(l=>{var u,d,p;return l.type===Jt.group?l.repeats?o.jsx(eR,{item:l,response:((u=t.item)==null?void 0:u.filter(h=>h.linkId===l.linkId))??[],checkForQuestionEnabled:n,onChange:i},l.linkId):o.jsx(tR,{item:l,checkForQuestionEnabled:n,response:((d=t.item)==null?void 0:d.find(h=>h.linkId===l.linkId))??{linkId:l.linkId},onChange:i},l.linkId):o.jsx(ZP,{item:l,response:(p=t.item)==null?void 0:p.find(h=>h.linkId===l.linkId),onChange:i,checkForQuestionEnabled:n},l.linkId)})})]},e.item.linkId):null}function _W(e){const{items:t,response:n,activePage:r,onChange:i,nextStep:s,prevStep:l,numberOfPages:u,renderPages:d,submitButtonText:p,excludeButtons:h,checkForQuestionEnabled:m}=e,v=t.map(x=>{var j;const b=((j=n==null?void 0:n.item)==null?void 0:j.filter(P=>P.linkId===x.linkId))??[],w=x.type===Jt.group?o.jsx(eR,{item:x,response:b,onChange:i,checkForQuestionEnabled:m},x.linkId):o.jsx(ZP,{item:x,response:b==null?void 0:b[0],onChange:i,checkForQuestionEnabled:m},x.linkId);return d?o.jsx(Rl.Step,{label:x.text,children:w},x.linkId):w});return o.jsxs(o.Fragment,{children:[d&&o.jsx(Rl,{active:r??0,allowNextStepsSelect:!1,p:6,children:v}),!d&&o.jsx(nt,{children:v}),!h&&o.jsx(DW,{activePage:r??0,numberOfPages:u,nextStep:d?s:void 0,prevStep:d?l:void 0,renderPages:d,submitButtonText:p})]})}function DW(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return o.jsxs(be,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&o.jsx(Ee,{onClick:e.prevStep,children:"Back"}),n&&o.jsx(Ee,{onClick:i=>{const s=i.currentTarget.closest("form");e.nextStep&&s.reportValidity()&&e.nextStep()},children:"Next"}),r&&o.jsx(Ee,{type:"submit",children:e.submitButtonText??"Submit"})]})}function nR(e){const t=Pe(),{subject:n,source:r}=e,i=Yt(e.questionnaire),s=CF(i),[l,u]=y.useState(),[d,p]=y.useState(0),h=y.useRef(e.onChange);h.current=e.onChange;const m=y.useRef(e.onSubmit);m.current=e.onSubmit,y.useEffect(()=>{i&&ZS(s)===ZS(i)||u(i?KV(i):void 0)},[i,s]),y.useEffect(()=>{if(l&&h.current)try{h.current(l)}catch(T){console.error("Error invoking QuestionnaireForm.onChange callback",T)}},[l]);const v=y.useCallback(T=>{u(k=>{const C=(k==null?void 0:k.item)??[],_=rR(C,Array.isArray(T)?T:[T]),R={resourceType:"QuestionnaireResponse",status:"in-progress",item:_},M=BP((i==null?void 0:i.item)??[],R);return{resourceType:"QuestionnaireResponse",status:"in-progress",item:UP(_,M)}})},[i]),x=y.useCallback(()=>{const T=m.current;if(T&&l){let k=r;if(!k){const C=t.getProfile();C&&(k=Zt(C))}T({...l,questionnaire:Ft(i),subject:n,source:k,authored:new Date().toISOString(),status:"completed"})}},[t,i,l,n,r]);function b(T){return VV(T,l)}if(!i||!l)return null;const w=ZV(i),j=()=>p(T=>T+1),P=()=>p(T=>T-1);return o.jsx(QP.Provider,{value:{subject:e.subject,encounter:e.encounter},children:o.jsxs(gt,{testid:"questionnaire-form",onSubmit:x,children:[i.title&&o.jsx(ze,{children:i.title}),o.jsx(_W,{items:i.item??[],response:l,onChange:v,renderPages:!e.disablePagination&&w>1,activePage:d,numberOfPages:w,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:b,nextStep:j,prevStep:P})]})})}function IW(e,t){const n=rR(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function rR(e,t){const n=[],r=new Set;for(const i of e){const s=i.id,l=t.find(u=>u.id===s);l?(n.push(IW(i,l)),r.add(l.id)):n.push(i)}for(const i of t)r.has(i.id)||n.push(i);return n}function ZS(e){return(e==null?void 0:e.id)||e}const AW="_section_4m5it_1",NW={section:AW},MW=["gender","age","gestationalAge","context","appliesTo","category"],OW={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function LW(e){e=Object.assign(OW,e);const t=e.definition,[n,r]=y.useState([]),[i,s]=y.useState(1),[l,u]=y.useState(1);return y.useEffect(()=>{const b=zW(t,u);r(BW(b.qualifiedInterval||[],s))},[t]),o.jsxs(gt,{testid:"reference-range-editor",onSubmit:d,children:[o.jsx(nt,{children:n.map(b=>{var w;return o.jsx($W,{unit:VW((w=t.quantitativeDetails)==null?void 0:w.unit),onChange:m,onAdd:v,onRemove:x,onRemoveGroup:h,intervalGroup:b},`group-${b.id}`)})}),o.jsx(En,{title:"Add Group",variant:"subtle",size:"sm",onClick:b=>{Gt(b),p({id:`group-id-${i}`,filters:{},intervals:[]}),s(w=>w+1)},children:o.jsx(Mf,{})}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{type:"submit",children:"Save"})})]});function d(){const b=n.flatMap(w=>w.intervals).filter(w=>!WW(w));e.onSubmit({...t,qualifiedInterval:b})}function p(b){r(w=>[...w,b])}function h(b){r(w=>w.filter(j=>j.id!==b.id))}function m(b,w){r(j=>{j=[...j];const P=j.find(k=>k.id===b),T=P==null?void 0:P.intervals.findIndex(k=>k.id===w.id);return T!==void 0&&(P!=null&&P.intervals[T])&&(P.intervals[T]=w),j})}function v(b,w){w.id===void 0&&(w.id=`id-${l}`,u(j=>j+1)),r(j=>{j=[...j];const P=j.findIndex(T=>T.id===b);if(P!==-1){const T={...j[P]};w={...w,...T.filters},T.intervals=[...T.intervals,w],j[P]=T}return j})}function x(b,w){r(j=>{j=[...j];const P=j.find(T=>T.id===b);return P&&(P.intervals=P.intervals.filter(T=>T.id!==w.id)),j})}}function $W(e){const{intervalGroup:t,unit:n}=e;return o.jsx(Nu,{"data-testid":t.id,className:NW.section,children:o.jsxs(nt,{gap:"lg",children:[o.jsx(be,{justify:"flex-end",children:o.jsx(En,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{Gt(r),e.onRemoveGroup(t)},children:o.jsx(Nf,{})},`remove-group-button-${t.id}`)}),o.jsx(FW,{intervalGroup:t,onChange:e.onChange}),o.jsx(_n,{}),t.intervals.map(r=>o.jsxs(nt,{gap:"xs",children:[o.jsxs(be,{children:[o.jsx(Be,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:i=>{Gt(i),e.onChange(t.id,{...r,condition:i.currentTarget.value.trim()})}},`condition-${r.id}`),o.jsx(En,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:i=>{Gt(i),e.onRemove(t.id,r)},children:o.jsx(Nf,{})},`remove-interval-${r.id}`)]}),o.jsx(Lx,{path:"",onChange:i=>{e.onChange(t.id,{...r,range:i})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),o.jsx(En,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{Gt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:o.jsx(Mf,{})})]})})}function FW(e){var r,i;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const s of["low","high"])(r=t.filters.age[s])!=null&&r.unit||(t.filters.age[s]={...t.filters.age[s],unit:"years",system:"http://unitsofmeasure.org"});return o.jsxs(nt,{style:{maxWidth:"50%"},children:[o.jsx(be,{children:o.jsx(en,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:s=>{for(const l of t.intervals){let u=s.currentTarget.value;u===""&&(u=void 0),n(t.id,{...l,gender:u})}}})}),o.jsxs(be,{gap:"xs",children:[o.jsx(Le,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),o.jsx("div",{id:`div-age-${t.id}`,children:o.jsx(Lx,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:s=>{for(const l of t.intervals)n(t.id,{...l,age:s})}},`age-${t.id}`)})]}),o.jsx(en,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((i=t.filters.context)==null?void 0:i.text)||"",onChange:s=>{for(const l of t.intervals){let u=s.currentTarget.value;u===""?(u=void 0,n(t.id,{...l,context:void 0})):n(t.id,{...l,context:{text:u,coding:[{code:u,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),o.jsx(en,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:s=>{for(const l of t.intervals){const u=s.currentTarget.value;u===""?n(t.id,{...l,category:void 0}):n(t.id,{...l,category:u})}}})]})}function zW(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(i=>{var l;const s=parseInt(((l=i.id)==null?void 0:l.substring(3))||"",10);return isNaN(s)?Number.NEGATIVE_INFINITY:s}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(i=>({...i,id:i.id||`id-${r++}`}))},t(r),e}function BW(e,t){let n=1;const r={};for(const i of e){const s=UW(i);s in r||(r[s]={id:`group-id-${n++}`,filters:Object.fromEntries(MW.map(l=>[l,i[l]])),intervals:[]}),r[s].intervals.push(i)}return t(n),Object.values(r)}function UW(e){var n,r;return[`gender=${e.gender}`,`age=${su(e.age)}`,`gestationalAge=${su(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(i=>i.text).join("+")}`,`category=${e.category}`].join(":")}function VW(e){return e&&(J7(e,"http://unitsofmeasure.org")||e.text)}function WW(e){var t,n,r,i;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((i=(r=e.range)==null?void 0:r.high)==null?void 0:i.value)===void 0}function HW(e){var p;const t=Pe(),n=Yt(e.value),[r,i]=y.useState(!1),[s,l]=y.useState();if(y.useEffect(()=>{n&&!r&&(t.executeBatch(u(n)).then(l).catch(console.log),i(!0))},[t,n,r]),!n||!s)return null;return o.jsx($r,{children:(p=n.action)==null?void 0:p.map((h,m)=>{var w,j,P,T,k,C;const v=h.resource&&d(h.resource),x=(j=(w=v==null?void 0:v.input)==null?void 0:w[0])==null?void 0:j.valueReference,b=(T=(P=v==null?void 0:v.output)==null?void 0:P[0])==null?void 0:T.valueReference;return o.jsxs(y.Fragment,{children:[o.jsx($r.Col,{span:1,p:"md",children:(v==null?void 0:v.status)==="completed"?o.jsx(HF,{}):o.jsx(y8,{color:"gray"})}),o.jsxs($r.Col,{span:9,p:"xs",children:[o.jsx(Le,{fw:500,children:h.title}),h.description&&o.jsx("div",{children:h.description}),o.jsxs("div",{children:["Last edited by ",o.jsx(ec,{value:(k=v==null?void 0:v.meta)==null?void 0:k.author})," on ",fr((C=v==null?void 0:v.meta)==null?void 0:C.lastUpdated)]}),o.jsxs("div",{children:["Status: ",o.jsx(Bx,{status:(v==null?void 0:v.status)||"unknown"})]})]}),o.jsxs($r.Col,{span:2,p:"md",children:[x&&!b&&o.jsx(Ee,{onClick:()=>e.onStart(v,x),children:"Start"}),x&&b&&o.jsx(Ee,{onClick:()=>e.onEdit(v,x,b),children:"Edit"})]})]},`action-${m}`)})});function u(h){var v;const m=[];if(h.action)for(const x of h.action)(v=x.resource)!=null&&v.reference&&m.push({request:{method:"GET",url:x.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function d(h){for(const m of(s==null?void 0:s.entry)??[])if(m.resource&&h.reference===Ft(m.resource))return m.resource}}function iR(e,t){const n=qW(e,t);return GW(n,e,t)}function qW(e,t){const n=e.length,r=t.length,i=n+r+1,s=1+2*i,l=s/2|0,u=new Array(s);u[l+1]={i:0,j:-1,prev:void 0,snake:!0};for(let d=0;d<i;d++){for(let p=-d;p<=d;p+=2){const h=l+p,m=h+1,v=h-1,x=u[m],b=u[v];let w,j=0;p===-d||p!==d&&b.i<x.i?(j=x.i,w=x):(j=b.i+1,w=b),u[v]=void 0;let P=j-p,T={i:j,j:P,prev:QW(w),snake:!1};for(;j<n&&P<r&&e[j]===t[P];)j++,P++;if(j>T.i&&(T={i:j,j:P,prev:T,snake:!0}),u[h]=T,j>=n&&P>=r)return u[h]}u[l+d-1]=void 0}}function GW(e,t,n){const r=[];let i=e;for(i.snake&&(i=i.prev);i!=null&&i.prev&&i.prev.j>=0;){const s=i.i,l=i.j;i=i.prev;const u=i.i,d=i.j,p={position:u,lines:t.slice(u,s)},h={position:d,lines:n.slice(d,l)};let m;p.lines.length===0&&h.lines.length>0?m="insert":p.lines.length>0&&h.lines.length===0?m="delete":m="change",r.push({original:p,revised:h,type:m}),i.snake&&(i=i.prev)}return r}function QW(e){return e&&!e.snake&&e.prev?e.prev:e}function KW(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>{var i;return{meta:(i=r.resource)==null?void 0:i.meta,lines:ki(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,i)=>r.meta.lastUpdated.localeCompare(i.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return YW(n,t),XW(n),n}function YW(e,t){for(let n=1;n<t.length;n++){const r=iR(t[n-1].lines,t[n].lines);for(const i of r){const s=i.original.position,l=i.original.lines,u=i.revised.lines;if((i.type==="delete"||i.type==="change")&&e.splice(s,l.length),i.type==="insert"||i.type==="change")for(let d=0;d<i.revised.lines.length;d++)e.splice(s+d,0,{id:t[n].meta.versionId,meta:t[n].meta,value:u[d],span:1})}}}function XW(e){let t=0;for(;t<e.length;){let n=t;for(;n<e.length&&e[n].id===e[t].id;)e[n].span=-1,n++;e[t].span=n-t,t=n}}const JW="_container_1oj0p_1",ZW="_root_1oj0p_5",eH="_startRow_1oj0p_20",tH="_normalRow_1oj0p_24",nH="_author_1oj0p_28",rH="_dateTime_1oj0p_32",iH="_lineNumber_1oj0p_37",oH="_line_1oj0p_37",sH="_pre_1oj0p_52",po={container:JW,root:ZW,startRow:eH,normalRow:tH,author:nH,dateTime:rH,lineNumber:iH,line:oH,pre:sH};function aH(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function lH(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return cl(n,"year");const r=Math.floor(t/2592e3);if(r>0)return cl(r,"month");const i=Math.floor(t/86400);if(i>0)return cl(i,"day");const s=Math.floor(t/3600);if(s>0)return cl(s,"hour");const l=Math.floor(t/60);return l>0?cl(l,"minute"):cl(t,"second")}function cl(e,t){return`${e} ${e===1?t:t+"s"} ago`}function cH(e){var l,u;const t=Pe(),[n,r]=y.useState(e.history);if(y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return o.jsx("div",{children:"Loading..."});const i=(u=(l=n.entry)==null?void 0:l[0])==null?void 0:u.resource;if(!i)return null;const s=KW(n);return o.jsx("div",{className:po.container,children:o.jsx("table",{className:po.root,children:o.jsx("tbody",{children:s.map((d,p)=>o.jsxs("tr",{className:d.span>0?po.startRow:po.normalRow,children:[d.span>0&&o.jsxs(o.Fragment,{children:[o.jsx("td",{className:po.author,rowSpan:d.span,children:o.jsx(wl,{value:d.meta.author,link:!0})}),o.jsx("td",{className:po.dateTime,rowSpan:d.span,children:o.jsx(xt,{to:aH(i,d.meta.versionId),children:lH(d.meta.lastUpdated)})})]}),o.jsx("td",{className:po.lineNumber,children:p+1}),o.jsx("td",{className:po.line,children:o.jsx("pre",{className:po.pre,children:d.value})})]},"row-"+p))})})})}const uH="_removed_mgz0k_2",dH="_added_mgz0k_7",ej={removed:uH,added:dH};function fH(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),i=ki(n,!0).match(/[^\r\n]+/g),s=iR(r,i);return o.jsx("pre",{style:{color:"gray"},children:s.map((l,u)=>o.jsx(pH,{delta:l},"delta"+u))})}function pH(e){return o.jsxs(o.Fragment,{children:["...",o.jsx("br",{}),e.delta.original.lines.length>0&&o.jsx("div",{className:ej.removed,children:e.delta.original.lines.join(`
547
- `)}),e.delta.revised.lines.length>0&&o.jsx("div",{className:ej.added,children:e.delta.revised.lines.join(`
548
- `)}),"...",o.jsx("br",{})]})}const hH="_splitButton_1i0gi_1",mH="_menuControl_1i0gi_6",tj={splitButton:hH,menuControl:mH};function Ff(e){const{outcome:t}=e,n=Pe(),r=Yt(e.defaultValue),i=r==null?void 0:r.resourceType,[s,l]=y.useState(!1),[u,d]=y.useState(),p=n.getAccessPolicy(),h=dn();y.useEffect(()=>{if(r)if(e.profileUrl){const x=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const b=Ql(x);if(b){l(!0);const w=mF(r,b);d(w)}else console.error(`Schema not found for ${x}`)}).catch(b=>{console.error("Error in requestProfileSchema",b)})}else n.requestSchema(i).then(()=>{d(r),l(!0)}).catch(console.log)},[n,r,i,e.profileUrl]);const m=y.useMemo(()=>r&&TT(r,xx.READ,p),[p,r]),v=y.useMemo(()=>n.isSuperAdmin()||!p||!bn(u==null?void 0:u.resourceType)?!0:S6(p,u==null?void 0:u.resourceType),[n,p,u==null?void 0:u.resourceType]);return!s||!u?o.jsx("div",{children:"Loading..."}):v?o.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:x=>{x.preventDefault(),e.onSubmit&&e.onSubmit(u)},children:[o.jsxs(nt,{mb:"xl",children:[o.jsx(Ht,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:o.jsx(Be,{name:"resourceType",defaultValue:u.resourceType,disabled:!0})}),o.jsx(Ht,{title:"ID",htmlFor:"id",outcome:t,children:o.jsx(Be,{name:"id",defaultValue:u.id,disabled:!0})})]}),o.jsx(zx,{path:u.resourceType,valuePath:u.resourceType,typeName:i,defaultValue:u,outcome:t,onChange:d,profileUrl:e.profileUrl,accessPolicyResource:m}),o.jsxs(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[o.jsx(Ee,{type:"submit",className:Nt((e.onPatch||e.onDelete)&&tj.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&o.jsxs(ye,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[o.jsx(ye.Target,{children:o.jsx(En,{variant:"filled",color:h.primaryColor,size:36,className:tj.menuControl,"aria-label":"More actions",children:o.jsx(Cx,{size:14,stroke:1.5})})}),o.jsxs(ye.Dropdown,{children:[e.onPatch&&o.jsx(ye.Item,{leftSection:o.jsx(qT,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(u)},children:"Patch"}),e.onDelete&&o.jsx(ye.Item,{color:"red",leftSection:o.jsx(Px,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(u)},children:"Delete"})]})]})]})]}):o.jsxs(xs,{color:"red",title:"Permission denied",icon:o.jsx(Jl,{}),children:["Your access level prevents you from editing and creating ",u.resourceType," resources."]})}function gH(e){var i;const t=Pe(),[n,r]=y.useState(e.history);return y.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?o.jsxs(Ae,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[o.jsx(Ae.Thead,{children:o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Th,{children:"Author"}),o.jsx(Ae.Th,{children:"Date"}),o.jsx(Ae.Th,{children:"Version"})]})}),o.jsx(Ae.Tbody,{children:(i=n.entry)==null?void 0:i.map((s,l)=>o.jsx(yH,{entry:s},"entry-"+l))})]}):o.jsx("div",{children:"Loading..."})}function yH(e){var r,i,s;const{response:t,resource:n}=e.entry;return n?o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Td,{children:o.jsx(wl,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),o.jsx(Ae.Td,{children:fr((i=n.meta)==null?void 0:i.lastUpdated)}),o.jsx(Ae.Td,{children:o.jsx(xt,{to:vH(n),children:(s=n.meta)==null?void 0:s.versionId})})]}):o.jsx(Ae.Tr,{children:o.jsx(Ae.Td,{colSpan:3,children:tt(t==null?void 0:t.outcome)})})}function vH(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function xH(e){const{serviceRequest:t,...n}=e;return o.jsx(Vp,{value:t,loadTimelineResources:async(r,i,s)=>{const l=`${i}/${s}`,u=100;return Promise.allSettled([r.readHistory("ServiceRequest",s),r.search("Communication",{"based-on":l,_count:u}),r.search("DiagnosticReport",{"based-on":l,_count:u}),r.search("Media",{"based-on":l,_count:u}),r.search("DocumentReference",{related:l,_count:u}),r.search("Task",{_filter:`based-on eq ${l} or focus eq ${l} or subject eq ${l}`,_count:u})])},createCommunication:(r,i,s)=>({resourceType:"Communication",status:"completed",basedOn:[Zt(r)],subject:r.subject,sender:Zt(i),sent:new Date().toISOString(),payload:[{contentString:s}]}),createMedia:(r,i,s)=>({resourceType:"Media",status:"completed",basedOn:[Zt(r)],subject:r.subject,operator:Zt(i),issued:new Date().toISOString(),content:s}),...n})}function bH(e){const t=Pe(),{client:n,patient:r,encounter:i,children:s,...l}=e;function u(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:i}).then(d=>{const p=new URL(n.launchUri);p.searchParams.set("iss",ux(t.fhirUrl().toString())),p.searchParams.set("launch",d.id),window.location.assign(p.toString())}).catch(d=>Ie({color:"red",message:tt(d),autoClose:!1}))}return o.jsx(Rt,{onClick:()=>u(),...l,children:s})}var sf={},nj;function wH(){if(nj)return sf;nj=1;var e=jC();return sf.createRoot=e.createRoot,sf.hydrateRoot=e.hydrateRoot,sf}var SH=wH();/**
549
- * @remix-run/router v1.21.0
550
- *
551
- * Copyright (c) Remix Software Inc.
552
- *
553
- * This source code is licensed under the MIT license found in the
554
- * LICENSE.md file in the root directory of this source tree.
555
- *
556
- * @license MIT
557
- */function pn(){return pn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pn.apply(this,arguments)}var Rn;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Rn||(Rn={}));const rj="popstate";function jH(e){e===void 0&&(e={});function t(r,i){let{pathname:s,search:l,hash:u}=r.location;return cu("",{pathname:s,search:l,hash:u},i.state&&i.state.usr||null,i.state&&i.state.key||"default")}function n(r,i){return typeof i=="string"?i:Fu(i)}return EH(t,n,null,e)}function yt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Ml(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function CH(){return Math.random().toString(36).substr(2,8)}function ij(e,t){return{usr:e.state,key:e.key,idx:t}}function cu(e,t,n,r){return n===void 0&&(n=null),pn({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?No(t):t,{state:n,key:t&&t.key||r||CH()})}function Fu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function No(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function EH(e,t,n,r){r===void 0&&(r={});let{window:i=document.defaultView,v5Compat:s=!1}=r,l=i.history,u=Rn.Pop,d=null,p=h();p==null&&(p=0,l.replaceState(pn({},l.state,{idx:p}),""));function h(){return(l.state||{idx:null}).idx}function m(){u=Rn.Pop;let j=h(),P=j==null?null:j-p;p=j,d&&d({action:u,location:w.location,delta:P})}function v(j,P){u=Rn.Push;let T=cu(w.location,j,P);p=h()+1;let k=ij(T,p),C=w.createHref(T);try{l.pushState(k,"",C)}catch(_){if(_ instanceof DOMException&&_.name==="DataCloneError")throw _;i.location.assign(C)}s&&d&&d({action:u,location:w.location,delta:1})}function x(j,P){u=Rn.Replace;let T=cu(w.location,j,P);p=h();let k=ij(T,p),C=w.createHref(T);l.replaceState(k,"",C),s&&d&&d({action:u,location:w.location,delta:0})}function b(j){let P=i.location.origin!=="null"?i.location.origin:i.location.href,T=typeof j=="string"?j:Fu(j);return T=T.replace(/ $/,"%20"),yt(P,"No window.location.(origin|href) available to create URL for href: "+T),new URL(T,P)}let w={get action(){return u},get location(){return e(i,l)},listen(j){if(d)throw new Error("A history only accepts one active listener");return i.addEventListener(rj,m),d=j,()=>{i.removeEventListener(rj,m),d=null}},createHref(j){return t(i,j)},createURL:b,encodeLocation(j){let P=b(j);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:v,replace:x,go(j){return l.go(j)}};return w}var Wt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Wt||(Wt={}));const kH=new Set(["lazy","caseSensitive","path","id","index","children"]);function TH(e){return e.index===!0}function zf(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((i,s)=>{let l=[...n,String(s)],u=typeof i.id=="string"?i.id:l.join("-");if(yt(i.index!==!0||!i.children,"Cannot specify children on an index route"),yt(!r[u],'Found a route id collision on id "'+u+`". Route id's must be globally unique within Data Router usages`),TH(i)){let d=pn({},i,t(i),{id:u});return r[u]=d,d}else{let d=pn({},i,t(i),{id:u,children:void 0});return r[u]=d,i.children&&(d.children=zf(i.children,t,l,r)),d}})}function Xs(e,t,n){return n===void 0&&(n="/"),yf(e,t,n,!1)}function yf(e,t,n,r){let i=typeof t=="string"?No(t):t,s=zu(i.pathname||"/",n);if(s==null)return null;let l=oR(e);RH(l);let u=null;for(let d=0;u==null&&d<l.length;++d){let p=zH(s);u=$H(l[d],p,r)}return u}function PH(e,t){let{route:n,pathname:r,params:i}=e;return{id:n.id,pathname:r,params:i,data:t[n.id],handle:n.handle}}function oR(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let i=(s,l,u)=>{let d={relativePath:u===void 0?s.path||"":u,caseSensitive:s.caseSensitive===!0,childrenIndex:l,route:s};d.relativePath.startsWith("/")&&(yt(d.relativePath.startsWith(r),'Absolute route path "'+d.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),d.relativePath=d.relativePath.slice(r.length));let p=fs([r,d.relativePath]),h=n.concat(d);s.children&&s.children.length>0&&(yt(s.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),oR(s.children,t,h,p)),!(s.path==null&&!s.index)&&t.push({path:p,score:OH(p,s.index),routesMeta:h})};return e.forEach((s,l)=>{var u;if(s.path===""||!((u=s.path)!=null&&u.includes("?")))i(s,l);else for(let d of sR(s.path))i(s,l,d)}),t}function sR(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,i=n.endsWith("?"),s=n.replace(/\?$/,"");if(r.length===0)return i?[s,""]:[s];let l=sR(r.join("/")),u=[];return u.push(...l.map(d=>d===""?s:[s,d].join("/"))),i&&u.push(...l),u.map(d=>e.startsWith("/")&&d===""?"/":d)}function RH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:LH(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const _H=/^:[\w-]+$/,DH=3,IH=2,AH=1,NH=10,MH=-2,oj=e=>e==="*";function OH(e,t){let n=e.split("/"),r=n.length;return n.some(oj)&&(r+=MH),t&&(r+=IH),n.filter(i=>!oj(i)).reduce((i,s)=>i+(_H.test(s)?DH:s===""?AH:NH),r)}function LH(e,t){return e.length===t.length&&e.slice(0,-1).every((r,i)=>r===t[i])?e[e.length-1]-t[t.length-1]:0}function $H(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,i={},s="/",l=[];for(let u=0;u<r.length;++u){let d=r[u],p=u===r.length-1,h=s==="/"?t:t.slice(s.length)||"/",m=sj({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},h),v=d.route;if(!m&&p&&n&&!r[r.length-1].route.index&&(m=sj({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},h)),!m)return null;Object.assign(i,m.params),l.push({params:i,pathname:fs([s,m.pathname]),pathnameBase:VH(fs([s,m.pathnameBase])),route:v}),m.pathnameBase!=="/"&&(s=fs([s,m.pathnameBase]))}return l}function sj(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=FH(e.path,e.caseSensitive,e.end),i=t.match(n);if(!i)return null;let s=i[0],l=s.replace(/(.)\/+$/,"$1"),u=i.slice(1);return{params:r.reduce((p,h,m)=>{let{paramName:v,isOptional:x}=h;if(v==="*"){let w=u[m]||"";l=s.slice(0,s.length-w.length).replace(/(.)\/+$/,"$1")}const b=u[m];return x&&!b?p[v]=void 0:p[v]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:e}}function FH(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Ml(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],i="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,d)=>(r.push({paramName:u,isOptional:d!=null}),d?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),i+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":e!==""&&e!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,t?void 0:"i"),r]}function zH(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Ml(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function zu(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 BH(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:i=""}=typeof e=="string"?No(e):e;return{pathname:n?n.startsWith("/")?n:UH(n,t):t,search:WH(r),hash:HH(i)}}function UH(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function yg(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 aR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function lR(e,t){let n=aR(e);return t?n.map((r,i)=>i===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function cR(e,t,n,r){r===void 0&&(r=!1);let i;typeof e=="string"?i=No(e):(i=pn({},e),yt(!i.pathname||!i.pathname.includes("?"),yg("?","pathname","search",i)),yt(!i.pathname||!i.pathname.includes("#"),yg("#","pathname","hash",i)),yt(!i.search||!i.search.includes("#"),yg("#","search","hash",i)));let s=e===""||i.pathname==="",l=s?"/":i.pathname,u;if(l==null)u=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let v=l.split("/");for(;v[0]==="..";)v.shift(),m-=1;i.pathname=v.join("/")}u=m>=0?t[m]:"/"}let d=BH(i,u),p=l&&l!=="/"&&l.endsWith("/"),h=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||h)&&(d.pathname+="/"),d}const fs=e=>e.join("/").replace(/\/\/+/g,"/"),VH=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),WH=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,HH=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Bf{constructor(t,n,r,i){i===void 0&&(i=!1),this.status=t,this.statusText=n||"",this.internal=i,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function qp(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const uR=["post","put","patch","delete"],qH=new Set(uR),GH=["get",...uR],QH=new Set(GH),KH=new Set([301,302,303,307,308]),YH=new Set([307,308]),vg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},XH={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},zc={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Yx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,JH=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),dR="remix-router-transitions";function ZH(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;yt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let i;if(e.mapRouteProperties)i=e.mapRouteProperties;else if(e.detectErrorBoundary){let U=e.detectErrorBoundary;i=K=>({hasErrorBoundary:U(K)})}else i=JH;let s={},l=zf(e.routes,i,void 0,s),u,d=e.basename||"/",p=e.dataStrategy||rq,h=e.patchRoutesOnNavigation,m=pn({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),v=null,x=new Set,b=null,w=null,j=null,P=e.hydrationData!=null,T=Xs(l,e.history.location,d),k=null;if(T==null&&!h){let U=jr(404,{pathname:e.history.location.pathname}),{matches:K,route:ee}=yj(l);T=K,k={[ee.id]:U}}T&&!e.hydrationData&&Lo(T,l,e.history.location.pathname).active&&(T=null);let C;if(T)if(T.some(U=>U.route.lazy))C=!1;else if(!T.some(U=>U.route.loader))C=!0;else if(m.v7_partialHydration){let U=e.hydrationData?e.hydrationData.loaderData:null,K=e.hydrationData?e.hydrationData.errors:null;if(K){let ee=T.findIndex(de=>K[de.route.id]!==void 0);C=T.slice(0,ee+1).every(de=>!ly(de.route,U,K))}else C=T.every(ee=>!ly(ee.route,U,K))}else C=e.hydrationData!=null;else if(C=!1,T=[],m.v7_partialHydration){let U=Lo(null,l,e.history.location.pathname);U.active&&U.matches&&(T=U.matches)}let _,R={historyAction:e.history.action,location:e.history.location,matches:T,initialized:C,navigation:vg,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||k,fetchers:new Map,blockers:new Map},M=Rn.Pop,N=!1,L,z=!1,G=new Map,q=null,Y=!1,Q=!1,ne=[],V=new Set,O=new Map,A=0,B=-1,I=new Map,F=new Set,Z=new Map,ae=new Map,je=new Set,me=new Map,xe=new Map,Te;function le(){if(v=e.history.listen(U=>{let{action:K,location:ee,delta:de}=U;if(Te){Te(),Te=void 0;return}Ml(xe.size===0||de!=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 De=Oo({currentLocation:R.location,nextLocation:ee,historyAction:K});if(De&&de!=null){let Qe=new Promise(st=>{Te=st});e.history.go(de*-1),Ii(De,{state:"blocked",location:ee,proceed(){Ii(De,{state:"proceeding",proceed:void 0,reset:void 0,location:ee}),Qe.then(()=>e.history.go(de))},reset(){let st=new Map(R.blockers);st.set(De,zc),ct({blockers:st})}});return}return vt(K,ee)}),n){yq(t,G);let U=()=>vq(t,G);t.addEventListener("pagehide",U),q=()=>t.removeEventListener("pagehide",U)}return R.initialized||vt(Rn.Pop,R.location,{initialHydration:!0}),_}function et(){v&&v(),q&&q(),x.clear(),L&&L.abort(),R.fetchers.forEach((U,K)=>ft(K)),R.blockers.forEach((U,K)=>Di(K))}function ht(U){return x.add(U),()=>x.delete(U)}function ct(U,K){K===void 0&&(K={}),R=pn({},R,U);let ee=[],de=[];m.v7_fetcherPersist&&R.fetchers.forEach((De,Qe)=>{De.state==="idle"&&(je.has(Qe)?de.push(Qe):ee.push(Qe))}),[...x].forEach(De=>De(R,{deletedFetchers:de,viewTransitionOpts:K.viewTransitionOpts,flushSync:K.flushSync===!0})),m.v7_fetcherPersist&&(ee.forEach(De=>R.fetchers.delete(De)),de.forEach(De=>ft(De)))}function St(U,K,ee){var de,De;let{flushSync:Qe}=ee===void 0?{}:ee,st=R.actionData!=null&&R.navigation.formMethod!=null&&bi(R.navigation.formMethod)&&R.navigation.state==="loading"&&((de=U.state)==null?void 0:de._isRedirect)!==!0,$e;K.actionData?Object.keys(K.actionData).length>0?$e=K.actionData:$e=null:st?$e=R.actionData:$e=null;let We=K.loaderData?mj(R.loaderData,K.loaderData,K.matches||[],K.errors):R.loaderData,Fe=R.blockers;Fe.size>0&&(Fe=new Map(Fe),Fe.forEach((mt,gn)=>Fe.set(gn,zc)));let Je=N===!0||R.navigation.formMethod!=null&&bi(R.navigation.formMethod)&&((De=U.state)==null?void 0:De._isRedirect)!==!0;u&&(l=u,u=void 0),Y||M===Rn.Pop||(M===Rn.Push?e.history.push(U,U.state):M===Rn.Replace&&e.history.replace(U,U.state));let Ve;if(M===Rn.Pop){let mt=G.get(R.location.pathname);mt&&mt.has(U.pathname)?Ve={currentLocation:R.location,nextLocation:U}:G.has(U.pathname)&&(Ve={currentLocation:U,nextLocation:R.location})}else if(z){let mt=G.get(R.location.pathname);mt?mt.add(U.pathname):(mt=new Set([U.pathname]),G.set(R.location.pathname,mt)),Ve={currentLocation:R.location,nextLocation:U}}ct(pn({},K,{actionData:$e,loaderData:We,historyAction:M,location:U,initialized:!0,navigation:vg,revalidation:"idle",restoreScrollPosition:Ps(U,K.matches||R.matches),preventScrollReset:Je,blockers:Fe}),{viewTransitionOpts:Ve,flushSync:Qe===!0}),M=Rn.Pop,N=!1,z=!1,Y=!1,Q=!1,ne=[]}async function Et(U,K){if(typeof U=="number"){e.history.go(U);return}let ee=ay(R.location,R.matches,d,m.v7_prependBasename,U,m.v7_relativeSplatPath,K==null?void 0:K.fromRouteId,K==null?void 0:K.relative),{path:de,submission:De,error:Qe}=aj(m.v7_normalizeFormMethod,!1,ee,K),st=R.location,$e=cu(R.location,de,K&&K.state);$e=pn({},$e,e.history.encodeLocation($e));let We=K&&K.replace!=null?K.replace:void 0,Fe=Rn.Push;We===!0?Fe=Rn.Replace:We===!1||De!=null&&bi(De.formMethod)&&De.formAction===R.location.pathname+R.location.search&&(Fe=Rn.Replace);let Je=K&&"preventScrollReset"in K?K.preventScrollReset===!0:void 0,Ve=(K&&K.flushSync)===!0,mt=Oo({currentLocation:st,nextLocation:$e,historyAction:Fe});if(mt){Ii(mt,{state:"blocked",location:$e,proceed(){Ii(mt,{state:"proceeding",proceed:void 0,reset:void 0,location:$e}),Et(U,K)},reset(){let gn=new Map(R.blockers);gn.set(mt,zc),ct({blockers:gn})}});return}return await vt(Fe,$e,{submission:De,pendingError:Qe,preventScrollReset:Je,replace:K&&K.replace,enableViewTransition:K&&K.viewTransition,flushSync:Ve})}function Tt(){if(bt(),ct({revalidation:"loading"}),R.navigation.state!=="submitting"){if(R.navigation.state==="idle"){vt(R.historyAction,R.location,{startUninterruptedRevalidation:!0});return}vt(M||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:z===!0})}}async function vt(U,K,ee){L&&L.abort(),L=null,M=U,Y=(ee&&ee.startUninterruptedRevalidation)===!0,Wn(R.location,R.matches),N=(ee&&ee.preventScrollReset)===!0,z=(ee&&ee.enableViewTransition)===!0;let de=u||l,De=ee&&ee.overrideNavigation,Qe=Xs(de,K,d),st=(ee&&ee.flushSync)===!0,$e=Lo(Qe,de,K.pathname);if($e.active&&$e.matches&&(Qe=$e.matches),!Qe){let{error:Lt,notFoundMatches:Ct,route:nn}=Ai(K.pathname);St(K,{matches:Ct,loaderData:{},errors:{[nn.id]:Lt}},{flushSync:st});return}if(R.initialized&&!Q&&cq(R.location,K)&&!(ee&&ee.submission&&bi(ee.submission.formMethod))){St(K,{matches:Qe},{flushSync:st});return}L=new AbortController;let We=ul(e.history,K,L.signal,ee&&ee.submission),Fe;if(ee&&ee.pendingError)Fe=[Js(Qe).route.id,{type:Wt.error,error:ee.pendingError}];else if(ee&&ee.submission&&bi(ee.submission.formMethod)){let Lt=await _t(We,K,ee.submission,Qe,$e.active,{replace:ee.replace,flushSync:st});if(Lt.shortCircuited)return;if(Lt.pendingActionResult){let[Ct,nn]=Lt.pendingActionResult;if(Lr(nn)&&qp(nn.error)&&nn.error.status===404){L=null,St(K,{matches:Lt.matches,loaderData:{},errors:{[Ct]:nn.error}});return}}Qe=Lt.matches||Qe,Fe=Lt.pendingActionResult,De=xg(K,ee.submission),st=!1,$e.active=!1,We=ul(e.history,We.url,We.signal)}let{shortCircuited:Je,matches:Ve,loaderData:mt,errors:gn}=await we(We,K,Qe,$e.active,De,ee&&ee.submission,ee&&ee.fetcherSubmission,ee&&ee.replace,ee&&ee.initialHydration===!0,st,Fe);Je||(L=null,St(K,pn({matches:Ve||Qe},gj(Fe),{loaderData:mt,errors:gn})))}async function _t(U,K,ee,de,De,Qe){Qe===void 0&&(Qe={}),bt();let st=mq(K,ee);if(ct({navigation:st},{flushSync:Qe.flushSync===!0}),De){let Fe=await Zi(de,K.pathname,U.signal);if(Fe.type==="aborted")return{shortCircuited:!0};if(Fe.type==="error"){let Je=Js(Fe.partialMatches).route.id;return{matches:Fe.partialMatches,pendingActionResult:[Je,{type:Wt.error,error:Fe.error}]}}else if(Fe.matches)de=Fe.matches;else{let{notFoundMatches:Je,error:Ve,route:mt}=Ai(K.pathname);return{matches:Je,pendingActionResult:[mt.id,{type:Wt.error,error:Ve}]}}}let $e,We=Hc(de,K);if(!We.route.action&&!We.route.lazy)$e={type:Wt.error,error:jr(405,{method:U.method,pathname:K.pathname,routeId:We.route.id})};else if($e=(await ue("action",R,U,[We],de,null))[We.route.id],U.signal.aborted)return{shortCircuited:!0};if(ia($e)){let Fe;return Qe&&Qe.replace!=null?Fe=Qe.replace:Fe=fj($e.response.headers.get("Location"),new URL(U.url),d)===R.location.pathname+R.location.search,await Me(U,$e,!0,{submission:ee,replace:Fe}),{shortCircuited:!0}}if(ds($e))throw jr(400,{type:"defer-action"});if(Lr($e)){let Fe=Js(de,We.route.id);return(Qe&&Qe.replace)!==!0&&(M=Rn.Push),{matches:de,pendingActionResult:[Fe.route.id,$e]}}return{matches:de,pendingActionResult:[We.route.id,$e]}}async function we(U,K,ee,de,De,Qe,st,$e,We,Fe,Je){let Ve=De||xg(K,Qe),mt=Qe||st||xj(Ve),gn=!Y&&(!m.v7_partialHydration||!We);if(de){if(gn){let on=Re(Je);ct(pn({navigation:Ve},on!==void 0?{actionData:on}:{}),{flushSync:Fe})}let Pt=await Zi(ee,K.pathname,U.signal);if(Pt.type==="aborted")return{shortCircuited:!0};if(Pt.type==="error"){let on=Js(Pt.partialMatches).route.id;return{matches:Pt.partialMatches,loaderData:{},errors:{[on]:Pt.error}}}else if(Pt.matches)ee=Pt.matches;else{let{error:on,notFoundMatches:di,route:Xn}=Ai(K.pathname);return{matches:di,loaderData:{},errors:{[Xn.id]:on}}}}let Lt=u||l,[Ct,nn]=cj(e.history,R,ee,mt,K,m.v7_partialHydration&&We===!0,m.v7_skipActionErrorRevalidation,Q,ne,V,je,Z,F,Lt,d,Je);if(mr(Pt=>!(ee&&ee.some(on=>on.route.id===Pt))||Ct&&Ct.some(on=>on.route.id===Pt)),B=++A,Ct.length===0&&nn.length===0){let Pt=Ts();return St(K,pn({matches:ee,loaderData:{},errors:Je&&Lr(Je[1])?{[Je[0]]:Je[1].error}:null},gj(Je),Pt?{fetchers:new Map(R.fetchers)}:{}),{flushSync:Fe}),{shortCircuited:!0}}if(gn){let Pt={};if(!de){Pt.navigation=Ve;let on=Re(Je);on!==void 0&&(Pt.actionData=on)}nn.length>0&&(Pt.fetchers=ke(nn)),ct(Pt,{flushSync:Fe})}nn.forEach(Pt=>{Yn(Pt.key),Pt.controller&&O.set(Pt.key,Pt.controller)});let eo=()=>nn.forEach(Pt=>Yn(Pt.key));L&&L.signal.addEventListener("abort",eo);let{loaderResults:$o,fetcherResults:ci}=await Ue(R,ee,Ct,nn,U);if(U.signal.aborted)return{shortCircuited:!0};L&&L.signal.removeEventListener("abort",eo),nn.forEach(Pt=>O.delete(Pt.key));let Wr=af($o);if(Wr)return await Me(U,Wr.result,!0,{replace:$e}),{shortCircuited:!0};if(Wr=af(ci),Wr)return F.add(Wr.key),await Me(U,Wr.result,!0,{replace:$e}),{shortCircuited:!0};let{loaderData:rn,errors:_s}=hj(R,ee,$o,Je,nn,ci,me);me.forEach((Pt,on)=>{Pt.subscribe(di=>{(di||Pt.done)&&me.delete(on)})}),m.v7_partialHydration&&We&&R.errors&&(_s=pn({},R.errors,_s));let ui=Ts(),Ds=Ia(B),to=ui||Ds||nn.length>0;return pn({matches:ee,loaderData:rn,errors:_s},to?{fetchers:new Map(R.fetchers)}:{})}function Re(U){if(U&&!Lr(U[1]))return{[U[0]]:U[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function ke(U){return U.forEach(K=>{let ee=R.fetchers.get(K.key),de=Bc(void 0,ee?ee.data:void 0);R.fetchers.set(K.key,de)}),new Map(R.fetchers)}function _e(U,K,ee,de){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");Yn(U);let De=(de&&de.flushSync)===!0,Qe=u||l,st=ay(R.location,R.matches,d,m.v7_prependBasename,ee,m.v7_relativeSplatPath,K,de==null?void 0:de.relative),$e=Xs(Qe,st,d),We=Lo($e,Qe,st);if(We.active&&We.matches&&($e=We.matches),!$e){Dt(U,K,jr(404,{pathname:st}),{flushSync:De});return}let{path:Fe,submission:Je,error:Ve}=aj(m.v7_normalizeFormMethod,!0,st,de);if(Ve){Dt(U,K,Ve,{flushSync:De});return}let mt=Hc($e,Fe),gn=(de&&de.preventScrollReset)===!0;if(Je&&bi(Je.formMethod)){ce(U,K,Fe,mt,$e,We.active,De,gn,Je);return}Z.set(U,{routeId:K,path:Fe}),ve(U,K,Fe,mt,$e,We.active,De,gn,Je)}async function ce(U,K,ee,de,De,Qe,st,$e,We){bt(),Z.delete(U);function Fe(Sn){if(!Sn.route.action&&!Sn.route.lazy){let Fn=jr(405,{method:We.formMethod,pathname:ee,routeId:K});return Dt(U,K,Fn,{flushSync:st}),!0}return!1}if(!Qe&&Fe(de))return;let Je=R.fetchers.get(U);jt(U,gq(We,Je),{flushSync:st});let Ve=new AbortController,mt=ul(e.history,ee,Ve.signal,We);if(Qe){let Sn=await Zi(De,ee,mt.signal);if(Sn.type==="aborted")return;if(Sn.type==="error"){Dt(U,K,Sn.error,{flushSync:st});return}else if(Sn.matches){if(De=Sn.matches,de=Hc(De,ee),Fe(de))return}else{Dt(U,K,jr(404,{pathname:ee}),{flushSync:st});return}}O.set(U,Ve);let gn=A,Ct=(await ue("action",R,mt,[de],De,U))[de.route.id];if(mt.signal.aborted){O.get(U)===Ve&&O.delete(U);return}if(m.v7_fetcherPersist&&je.has(U)){if(ia(Ct)||Lr(Ct)){jt(U,os(void 0));return}}else{if(ia(Ct))if(O.delete(U),B>gn){jt(U,os(void 0));return}else return F.add(U),jt(U,Bc(We)),Me(mt,Ct,!1,{fetcherSubmission:We,preventScrollReset:$e});if(Lr(Ct)){Dt(U,K,Ct.error);return}}if(ds(Ct))throw jr(400,{type:"defer-action"});let nn=R.navigation.location||R.location,eo=ul(e.history,nn,Ve.signal),$o=u||l,ci=R.navigation.state!=="idle"?Xs($o,R.navigation.location,d):R.matches;yt(ci,"Didn't find any matches after fetcher action");let Wr=++A;I.set(U,Wr);let rn=Bc(We,Ct.data);R.fetchers.set(U,rn);let[_s,ui]=cj(e.history,R,ci,We,nn,!1,m.v7_skipActionErrorRevalidation,Q,ne,V,je,Z,F,$o,d,[de.route.id,Ct]);ui.filter(Sn=>Sn.key!==U).forEach(Sn=>{let Fn=Sn.key,Uu=R.fetchers.get(Fn),eh=Bc(void 0,Uu?Uu.data:void 0);R.fetchers.set(Fn,eh),Yn(Fn),Sn.controller&&O.set(Fn,Sn.controller)}),ct({fetchers:new Map(R.fetchers)});let Ds=()=>ui.forEach(Sn=>Yn(Sn.key));Ve.signal.addEventListener("abort",Ds);let{loaderResults:to,fetcherResults:Pt}=await Ue(R,ci,_s,ui,eo);if(Ve.signal.aborted)return;Ve.signal.removeEventListener("abort",Ds),I.delete(U),O.delete(U),ui.forEach(Sn=>O.delete(Sn.key));let on=af(to);if(on)return Me(eo,on.result,!1,{preventScrollReset:$e});if(on=af(Pt),on)return F.add(on.key),Me(eo,on.result,!1,{preventScrollReset:$e});let{loaderData:di,errors:Xn}=hj(R,ci,to,void 0,ui,Pt,me);if(R.fetchers.has(U)){let Sn=os(Ct.data);R.fetchers.set(U,Sn)}Ia(Wr),R.navigation.state==="loading"&&Wr>B?(yt(M,"Expected pending action"),L&&L.abort(),St(R.navigation.location,{matches:ci,loaderData:di,errors:Xn,fetchers:new Map(R.fetchers)})):(ct({errors:Xn,loaderData:mj(R.loaderData,di,ci,Xn),fetchers:new Map(R.fetchers)}),Q=!1)}async function ve(U,K,ee,de,De,Qe,st,$e,We){let Fe=R.fetchers.get(U);jt(U,Bc(We,Fe?Fe.data:void 0),{flushSync:st});let Je=new AbortController,Ve=ul(e.history,ee,Je.signal);if(Qe){let Ct=await Zi(De,ee,Ve.signal);if(Ct.type==="aborted")return;if(Ct.type==="error"){Dt(U,K,Ct.error,{flushSync:st});return}else if(Ct.matches)De=Ct.matches,de=Hc(De,ee);else{Dt(U,K,jr(404,{pathname:ee}),{flushSync:st});return}}O.set(U,Je);let mt=A,Lt=(await ue("loader",R,Ve,[de],De,U))[de.route.id];if(ds(Lt)&&(Lt=await Xx(Lt,Ve.signal,!0)||Lt),O.get(U)===Je&&O.delete(U),!Ve.signal.aborted){if(je.has(U)){jt(U,os(void 0));return}if(ia(Lt))if(B>mt){jt(U,os(void 0));return}else{F.add(U),await Me(Ve,Lt,!1,{preventScrollReset:$e});return}if(Lr(Lt)){Dt(U,K,Lt.error);return}yt(!ds(Lt),"Unhandled fetcher deferred data"),jt(U,os(Lt.data))}}async function Me(U,K,ee,de){let{submission:De,fetcherSubmission:Qe,preventScrollReset:st,replace:$e}=de===void 0?{}:de;K.response.headers.has("X-Remix-Revalidate")&&(Q=!0);let We=K.response.headers.get("Location");yt(We,"Expected a Location header on the redirect Response"),We=fj(We,new URL(U.url),d);let Fe=cu(R.location,We,{_isRedirect:!0});if(n){let Ct=!1;if(K.response.headers.has("X-Remix-Reload-Document"))Ct=!0;else if(Yx.test(We)){const nn=e.history.createURL(We);Ct=nn.origin!==t.location.origin||zu(nn.pathname,d)==null}if(Ct){$e?t.location.replace(We):t.location.assign(We);return}}L=null;let Je=$e===!0||K.response.headers.has("X-Remix-Replace")?Rn.Replace:Rn.Push,{formMethod:Ve,formAction:mt,formEncType:gn}=R.navigation;!De&&!Qe&&Ve&&mt&&gn&&(De=xj(R.navigation));let Lt=De||Qe;if(YH.has(K.response.status)&&Lt&&bi(Lt.formMethod))await vt(Je,Fe,{submission:pn({},Lt,{formAction:We}),preventScrollReset:st||N,enableViewTransition:ee?z:void 0});else{let Ct=xg(Fe,De);await vt(Je,Fe,{overrideNavigation:Ct,fetcherSubmission:Qe,preventScrollReset:st||N,enableViewTransition:ee?z:void 0})}}async function ue(U,K,ee,de,De,Qe){let st,$e={};try{st=await iq(p,U,K,ee,de,De,Qe,s,i)}catch(We){return de.forEach(Fe=>{$e[Fe.route.id]={type:Wt.error,error:We}}),$e}for(let[We,Fe]of Object.entries(st))if(uq(Fe)){let Je=Fe.result;$e[We]={type:Wt.redirect,response:aq(Je,ee,We,De,d,m.v7_relativeSplatPath)}}else $e[We]=await sq(Fe);return $e}async function Ue(U,K,ee,de,De){let Qe=U.matches,st=ue("loader",U,De,ee,K,null),$e=Promise.all(de.map(async Je=>{if(Je.matches&&Je.match&&Je.controller){let mt=(await ue("loader",U,ul(e.history,Je.path,Je.controller.signal),[Je.match],Je.matches,Je.key))[Je.match.route.id];return{[Je.key]:mt}}else return Promise.resolve({[Je.key]:{type:Wt.error,error:jr(404,{pathname:Je.path})}})})),We=await st,Fe=(await $e).reduce((Je,Ve)=>Object.assign(Je,Ve),{});return await Promise.all([pq(K,We,De.signal,Qe,U.loaderData),hq(K,Fe,de)]),{loaderResults:We,fetcherResults:Fe}}function bt(){Q=!0,ne.push(...mr()),Z.forEach((U,K)=>{O.has(K)&&V.add(K),Yn(K)})}function jt(U,K,ee){ee===void 0&&(ee={}),R.fetchers.set(U,K),ct({fetchers:new Map(R.fetchers)},{flushSync:(ee&&ee.flushSync)===!0})}function Dt(U,K,ee,de){de===void 0&&(de={});let De=Js(R.matches,K);ft(U),ct({errors:{[De.route.id]:ee},fetchers:new Map(R.fetchers)},{flushSync:(de&&de.flushSync)===!0})}function mn(U){return m.v7_fetcherPersist&&(ae.set(U,(ae.get(U)||0)+1),je.has(U)&&je.delete(U)),R.fetchers.get(U)||XH}function ft(U){let K=R.fetchers.get(U);O.has(U)&&!(K&&K.state==="loading"&&I.has(U))&&Yn(U),Z.delete(U),I.delete(U),F.delete(U),je.delete(U),V.delete(U),R.fetchers.delete(U)}function wn(U){if(m.v7_fetcherPersist){let K=(ae.get(U)||0)-1;K<=0?(ae.delete(U),je.add(U)):ae.set(U,K)}else ft(U);ct({fetchers:new Map(R.fetchers)})}function Yn(U){let K=O.get(U);K&&(K.abort(),O.delete(U))}function Ji(U){for(let K of U){let ee=mn(K),de=os(ee.data);R.fetchers.set(K,de)}}function Ts(){let U=[],K=!1;for(let ee of F){let de=R.fetchers.get(ee);yt(de,"Expected fetcher: "+ee),de.state==="loading"&&(F.delete(ee),U.push(ee),K=!0)}return Ji(U),K}function Ia(U){let K=[];for(let[ee,de]of I)if(de<U){let De=R.fetchers.get(ee);yt(De,"Expected fetcher: "+ee),De.state==="loading"&&(Yn(ee),I.delete(ee),K.push(ee))}return Ji(K),K.length>0}function or(U,K){let ee=R.blockers.get(U)||zc;return xe.get(U)!==K&&xe.set(U,K),ee}function Di(U){R.blockers.delete(U),xe.delete(U)}function Ii(U,K){let ee=R.blockers.get(U)||zc;yt(ee.state==="unblocked"&&K.state==="blocked"||ee.state==="blocked"&&K.state==="blocked"||ee.state==="blocked"&&K.state==="proceeding"||ee.state==="blocked"&&K.state==="unblocked"||ee.state==="proceeding"&&K.state==="unblocked","Invalid blocker state transition: "+ee.state+" -> "+K.state);let de=new Map(R.blockers);de.set(U,K),ct({blockers:de})}function Oo(U){let{currentLocation:K,nextLocation:ee,historyAction:de}=U;if(xe.size===0)return;xe.size>1&&Ml(!1,"A router only supports one blocker at a time");let De=Array.from(xe.entries()),[Qe,st]=De[De.length-1],$e=R.blockers.get(Qe);if(!($e&&$e.state==="proceeding")&&st({currentLocation:K,nextLocation:ee,historyAction:de}))return Qe}function Ai(U){let K=jr(404,{pathname:U}),ee=u||l,{matches:de,route:De}=yj(ee);return mr(),{notFoundMatches:de,route:De,error:K}}function mr(U){let K=[];return me.forEach((ee,de)=>{(!U||U(de))&&(ee.cancel(),K.push(de),me.delete(de))}),K}function Ur(U,K,ee){if(b=U,j=K,w=ee||null,!P&&R.navigation===vg){P=!0;let de=Ps(R.location,R.matches);de!=null&&ct({restoreScrollPosition:de})}return()=>{b=null,j=null,w=null}}function Vr(U,K){return w&&w(U,K.map(de=>PH(de,R.loaderData)))||U.key}function Wn(U,K){if(b&&j){let ee=Vr(U,K);b[ee]=j()}}function Ps(U,K){if(b){let ee=Vr(U,K),de=b[ee];if(typeof de=="number")return de}return null}function Lo(U,K,ee){if(h)if(U){if(Object.keys(U[0].params).length>0)return{active:!0,matches:yf(K,ee,d,!0)}}else return{active:!0,matches:yf(K,ee,d,!0)||[]};return{active:!1,matches:null}}async function Zi(U,K,ee){if(!h)return{type:"success",matches:U};let de=U;for(;;){let De=u==null,Qe=u||l,st=s;try{await h({path:K,matches:de,patch:(Fe,Je)=>{ee.aborted||dj(Fe,Je,Qe,st,i)}})}catch(Fe){return{type:"error",error:Fe,partialMatches:de}}finally{De&&!ee.aborted&&(l=[...l])}if(ee.aborted)return{type:"aborted"};let $e=Xs(Qe,K,d);if($e)return{type:"success",matches:$e};let We=yf(Qe,K,d,!0);if(!We||de.length===We.length&&de.every((Fe,Je)=>Fe.route.id===We[Je].route.id))return{type:"success",matches:null};de=We}}function Rs(U){s={},u=zf(U,i,void 0,s)}function Tn(U,K){let ee=u==null;dj(U,K,u||l,s,i),ee&&(l=[...l],ct({}))}return _={get basename(){return d},get future(){return m},get state(){return R},get routes(){return l},get window(){return t},initialize:le,subscribe:ht,enableScrollRestoration:Ur,navigate:Et,fetch:_e,revalidate:Tt,createHref:U=>e.history.createHref(U),encodeLocation:U=>e.history.encodeLocation(U),getFetcher:mn,deleteFetcher:wn,dispose:et,getBlocker:or,deleteBlocker:Di,patchRoutes:Tn,_internalFetchControllers:O,_internalActiveDeferreds:me,_internalSetRoutes:Rs},_}function eq(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function ay(e,t,n,r,i,s,l,u){let d,p;if(l){d=[];for(let m of t)if(d.push(m),m.route.id===l){p=m;break}}else d=t,p=t[t.length-1];let h=cR(i||".",lR(d,s),zu(e.pathname,n)||e.pathname,u==="path");if(i==null&&(h.search=e.search,h.hash=e.hash),(i==null||i===""||i===".")&&p){let m=Jx(h.search);if(p.route.index&&!m)h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index";else if(!p.route.index&&m){let v=new URLSearchParams(h.search),x=v.getAll("index");v.delete("index"),x.filter(w=>w).forEach(w=>v.append("index",w));let b=v.toString();h.search=b?"?"+b:""}}return r&&n!=="/"&&(h.pathname=h.pathname==="/"?n:fs([n,h.pathname])),Fu(h)}function aj(e,t,n,r){if(!r||!eq(r))return{path:n};if(r.formMethod&&!fq(r.formMethod))return{path:n,error:jr(405,{method:r.formMethod})};let i=()=>({path:n,error:jr(400,{type:"invalid-body"})}),s=r.formMethod||"get",l=e?s.toUpperCase():s.toLowerCase(),u=hR(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!bi(l))return i();let v=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((x,b)=>{let[w,j]=b;return""+x+w+"="+j+`
558
- `},""):String(r.body);return{path:n,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:void 0,text:v}}}else if(r.formEncType==="application/json"){if(!bi(l))return i();try{let v=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:l,formAction:u,formEncType:r.formEncType,formData:void 0,json:v,text:void 0}}}catch{return i()}}}yt(typeof FormData=="function","FormData is not available in this environment");let d,p;if(r.formData)d=cy(r.formData),p=r.formData;else if(r.body instanceof FormData)d=cy(r.body),p=r.body;else if(r.body instanceof URLSearchParams)d=r.body,p=pj(d);else if(r.body==null)d=new URLSearchParams,p=new FormData;else try{d=new URLSearchParams(r.body),p=pj(d)}catch{return i()}let h={formMethod:l,formAction:u,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:p,json:void 0,text:void 0};if(bi(h.formMethod))return{path:n,submission:h};let m=No(n);return t&&m.search&&Jx(m.search)&&d.append("index",""),m.search="?"+d,{path:Fu(m),submission:h}}function lj(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(i=>i.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function cj(e,t,n,r,i,s,l,u,d,p,h,m,v,x,b,w){let j=w?Lr(w[1])?w[1].error:w[1].data:void 0,P=e.createURL(t.location),T=e.createURL(i),k=n;s&&t.errors?k=lj(n,Object.keys(t.errors)[0],!0):w&&Lr(w[1])&&(k=lj(n,w[0]));let C=w?w[1].statusCode:void 0,_=l&&C&&C>=400,R=k.filter((N,L)=>{let{route:z}=N;if(z.lazy)return!0;if(z.loader==null)return!1;if(s)return ly(z,t.loaderData,t.errors);if(tq(t.loaderData,t.matches[L],N)||d.some(Y=>Y===N.route.id))return!0;let G=t.matches[L],q=N;return uj(N,pn({currentUrl:P,currentParams:G.params,nextUrl:T,nextParams:q.params},r,{actionResult:j,actionStatus:C,defaultShouldRevalidate:_?!1:u||P.pathname+P.search===T.pathname+T.search||P.search!==T.search||fR(G,q)}))}),M=[];return m.forEach((N,L)=>{if(s||!n.some(Q=>Q.route.id===N.routeId)||h.has(L))return;let z=Xs(x,N.path,b);if(!z){M.push({key:L,routeId:N.routeId,path:N.path,matches:null,match:null,controller:null});return}let G=t.fetchers.get(L),q=Hc(z,N.path),Y=!1;v.has(L)?Y=!1:p.has(L)?(p.delete(L),Y=!0):G&&G.state!=="idle"&&G.data===void 0?Y=u:Y=uj(q,pn({currentUrl:P,currentParams:t.matches[t.matches.length-1].params,nextUrl:T,nextParams:n[n.length-1].params},r,{actionResult:j,actionStatus:C,defaultShouldRevalidate:_?!1:u})),Y&&M.push({key:L,routeId:N.routeId,path:N.path,matches:z,match:q,controller:new AbortController})}),[R,M]}function ly(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,i=n!=null&&n[e.id]!==void 0;return!r&&i?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!i}function tq(e,t,n){let r=!t||n.route.id!==t.route.id,i=e[n.route.id]===void 0;return r||i}function fR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function uj(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function dj(e,t,n,r,i){var s;let l;if(e){let p=r[e];yt(p,"No route found to patch children into: routeId = "+e),p.children||(p.children=[]),l=p.children}else l=n;let u=t.filter(p=>!l.some(h=>pR(p,h))),d=zf(u,i,[e||"_","patch",String(((s=l)==null?void 0:s.length)||"0")],r);l.push(...d)}function pR(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var i;return(i=t.children)==null?void 0:i.some(s=>pR(n,s))}):!1}async function nq(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let i=n[e.id];yt(i,"No route found in manifest");let s={};for(let l in r){let d=i[l]!==void 0&&l!=="hasErrorBoundary";Ml(!d,'Route "'+i.id+'" has a static property "'+l+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+l+'" will be ignored.')),!d&&!kH.has(l)&&(s[l]=r[l])}Object.assign(i,s),Object.assign(i,pn({},t(i),{lazy:void 0}))}async function rq(e){let{matches:t}=e,n=t.filter(i=>i.shouldLoad);return(await Promise.all(n.map(i=>i.resolve()))).reduce((i,s,l)=>Object.assign(i,{[n[l].route.id]:s}),{})}async function iq(e,t,n,r,i,s,l,u,d,p){let h=s.map(x=>x.route.lazy?nq(x.route,d,u):void 0),m=s.map((x,b)=>{let w=h[b],j=i.some(T=>T.route.id===x.route.id);return pn({},x,{shouldLoad:j,resolve:async T=>(T&&r.method==="GET"&&(x.route.lazy||x.route.loader)&&(j=!0),j?oq(t,r,x,w,T,p):Promise.resolve({type:Wt.data,result:void 0}))})}),v=await e({matches:m,request:r,params:s[0].params,fetcherKey:l,context:p});try{await Promise.all(h)}catch{}return v}async function oq(e,t,n,r,i,s){let l,u,d=p=>{let h,m=new Promise((b,w)=>h=w);u=()=>h(),t.signal.addEventListener("abort",u);let v=b=>typeof p!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):p({request:t,params:n.params,context:s},...b!==void 0?[b]:[]),x=(async()=>{try{return{type:"data",result:await(i?i(w=>v(w)):v())}}catch(b){return{type:"error",result:b}}})();return Promise.race([x,m])};try{let p=n.route[e];if(r)if(p){let h,[m]=await Promise.all([d(p).catch(v=>{h=v}),r]);if(h!==void 0)throw h;l=m}else if(await r,p=n.route[e],p)l=await d(p);else if(e==="action"){let h=new URL(t.url),m=h.pathname+h.search;throw jr(405,{method:t.method,pathname:m,routeId:n.route.id})}else return{type:Wt.data,result:void 0};else if(p)l=await d(p);else{let h=new URL(t.url),m=h.pathname+h.search;throw jr(404,{pathname:m})}yt(l.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(p){return{type:Wt.error,result:p}}finally{u&&t.signal.removeEventListener("abort",u)}return l}async function sq(e){let{result:t,type:n}=e;if(mR(t)){let p;try{let h=t.headers.get("Content-Type");h&&/\bapplication\/json\b/.test(h)?t.body==null?p=null:p=await t.json():p=await t.text()}catch(h){return{type:Wt.error,error:h}}return n===Wt.error?{type:Wt.error,error:new Bf(t.status,t.statusText,p),statusCode:t.status,headers:t.headers}:{type:Wt.data,data:p,statusCode:t.status,headers:t.headers}}if(n===Wt.error){if(vj(t)){var r;if(t.data instanceof Error){var i;return{type:Wt.error,error:t.data,statusCode:(i=t.init)==null?void 0:i.status}}t=new Bf(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Wt.error,error:t,statusCode:qp(t)?t.status:void 0}}if(dq(t)){var s,l;return{type:Wt.deferred,deferredData:t,statusCode:(s=t.init)==null?void 0:s.status,headers:((l=t.init)==null?void 0:l.headers)&&new Headers(t.init.headers)}}if(vj(t)){var u,d;return{type:Wt.data,data:t.data,statusCode:(u=t.init)==null?void 0:u.status,headers:(d=t.init)!=null&&d.headers?new Headers(t.init.headers):void 0}}return{type:Wt.data,data:t}}function aq(e,t,n,r,i,s){let l=e.headers.get("Location");if(yt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!Yx.test(l)){let u=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=ay(new URL(t.url),u,i,!0,l,s),e.headers.set("Location",l)}return e}function fj(e,t,n){if(Yx.test(e)){let r=e,i=r.startsWith("//")?new URL(t.protocol+r):new URL(r),s=zu(i.pathname,n)!=null;if(i.origin===t.origin&&s)return i.pathname+i.search+i.hash}return e}function ul(e,t,n,r){let i=e.createURL(hR(t)).toString(),s={signal:n};if(r&&bi(r.formMethod)){let{formMethod:l,formEncType:u}=r;s.method=l.toUpperCase(),u==="application/json"?(s.headers=new Headers({"Content-Type":u}),s.body=JSON.stringify(r.json)):u==="text/plain"?s.body=r.text:u==="application/x-www-form-urlencoded"&&r.formData?s.body=cy(r.formData):s.body=r.formData}return new Request(i,s)}function cy(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function pj(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function lq(e,t,n,r,i){let s={},l=null,u,d=!1,p={},h=n&&Lr(n[1])?n[1].error:void 0;return e.forEach(m=>{if(!(m.route.id in t))return;let v=m.route.id,x=t[v];if(yt(!ia(x),"Cannot handle redirect results in processLoaderData"),Lr(x)){let b=x.error;h!==void 0&&(b=h,h=void 0),l=l||{};{let w=Js(e,v);l[w.route.id]==null&&(l[w.route.id]=b)}s[v]=void 0,d||(d=!0,u=qp(x.error)?x.error.status:500),x.headers&&(p[v]=x.headers)}else ds(x)?(r.set(v,x.deferredData),s[v]=x.deferredData.data,x.statusCode!=null&&x.statusCode!==200&&!d&&(u=x.statusCode),x.headers&&(p[v]=x.headers)):(s[v]=x.data,x.statusCode&&x.statusCode!==200&&!d&&(u=x.statusCode),x.headers&&(p[v]=x.headers))}),h!==void 0&&n&&(l={[n[0]]:h},s[n[0]]=void 0),{loaderData:s,errors:l,statusCode:u||200,loaderHeaders:p}}function hj(e,t,n,r,i,s,l){let{loaderData:u,errors:d}=lq(t,n,r,l);return i.forEach(p=>{let{key:h,match:m,controller:v}=p,x=s[h];if(yt(x,"Did not find corresponding fetcher result"),!(v&&v.signal.aborted))if(Lr(x)){let b=Js(e.matches,m==null?void 0:m.route.id);d&&d[b.route.id]||(d=pn({},d,{[b.route.id]:x.error})),e.fetchers.delete(h)}else if(ia(x))yt(!1,"Unhandled fetcher revalidation redirect");else if(ds(x))yt(!1,"Unhandled fetcher deferred data");else{let b=os(x.data);e.fetchers.set(h,b)}}),{loaderData:u,errors:d}}function mj(e,t,n,r){let i=pn({},t);for(let s of n){let l=s.route.id;if(t.hasOwnProperty(l)?t[l]!==void 0&&(i[l]=t[l]):e[l]!==void 0&&s.route.loader&&(i[l]=e[l]),r&&r.hasOwnProperty(l))break}return i}function gj(e){return e?Lr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Js(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 yj(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 jr(e,t){let{pathname:n,routeId:r,method:i,type:s,message:l}=t===void 0?{}:t,u="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(u="Bad Request",i&&n&&r?d="You made a "+i+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":s==="defer-action"?d="defer() is not supported in actions":s==="invalid-body"&&(d="Unable to encode submission body")):e===403?(u="Forbidden",d='Route "'+r+'" does not match URL "'+n+'"'):e===404?(u="Not Found",d='No route matches URL "'+n+'"'):e===405&&(u="Method Not Allowed",i&&n&&r?d="You made a "+i.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":i&&(d='Invalid request method "'+i.toUpperCase()+'"')),new Bf(e||500,u,new Error(d),!0)}function af(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,i]=t[n];if(ia(i))return{key:r,result:i}}}function hR(e){let t=typeof e=="string"?No(e):e;return Fu(pn({},t,{hash:""}))}function cq(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function uq(e){return mR(e.result)&&KH.has(e.result.status)}function ds(e){return e.type===Wt.deferred}function Lr(e){return e.type===Wt.error}function ia(e){return(e&&e.type)===Wt.redirect}function vj(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function dq(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function mR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function fq(e){return QH.has(e.toLowerCase())}function bi(e){return qH.has(e.toLowerCase())}async function pq(e,t,n,r,i){let s=Object.entries(t);for(let l=0;l<s.length;l++){let[u,d]=s[l],p=e.find(v=>(v==null?void 0:v.route.id)===u);if(!p)continue;let h=r.find(v=>v.route.id===p.route.id),m=h!=null&&!fR(h,p)&&(i&&i[p.route.id])!==void 0;ds(d)&&m&&await Xx(d,n,!1).then(v=>{v&&(t[u]=v)})}}async function hq(e,t,n){for(let r=0;r<n.length;r++){let{key:i,routeId:s,controller:l}=n[r],u=t[i];e.find(p=>(p==null?void 0:p.route.id)===s)&&ds(u)&&(yt(l,"Expected an AbortController for revalidating fetcher deferred result"),await Xx(u,l.signal,!0).then(p=>{p&&(t[i]=p)}))}}async function Xx(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Wt.data,data:e.deferredData.unwrappedData}}catch(i){return{type:Wt.error,error:i}}return{type:Wt.data,data:e.deferredData.data}}}function Jx(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Hc(e,t){let n=typeof t=="string"?No(t).search:t.search;if(e[e.length-1].route.index&&Jx(n||""))return e[e.length-1];let r=aR(e);return r[r.length-1]}function xj(e){let{formMethod:t,formAction:n,formEncType:r,text:i,formData:s,json:l}=e;if(!(!t||!n||!r)){if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:i};if(s!=null)return{formMethod:t,formAction:n,formEncType:r,formData:s,json:void 0,text:void 0};if(l!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:l,text:void 0}}}function xg(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 mq(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 Bc(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 gq(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 os(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 yq(e,t){try{let n=e.sessionStorage.getItem(dR);if(n){let r=JSON.parse(n);for(let[i,s]of Object.entries(r||{}))s&&Array.isArray(s)&&t.set(i,new Set(s||[]))}}catch{}}function vq(e,t){if(t.size>0){let n={};for(let[r,i]of t)n[r]=[...i];try{e.sessionStorage.setItem(dR,JSON.stringify(n))}catch(r){Ml(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
559
- * React Router v6.28.0
560
- *
561
- * Copyright (c) Remix Software Inc.
562
- *
563
- * This source code is licensed under the MIT license found in the
564
- * LICENSE.md file in the root directory of this source tree.
565
- *
566
- * @license MIT
567
- */function uu(){return uu=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uu.apply(this,arguments)}const Gp=y.createContext(null),gR=y.createContext(null),Qp=y.createContext(null),Kp=y.createContext(null),Cs=y.createContext({outlet:null,matches:[],isDataRoute:!1}),yR=y.createContext(null);function Yp(){return y.useContext(Kp)!=null}function Mo(){return Yp()||yt(!1),y.useContext(Kp).location}function vR(e){y.useContext(Qp).static||y.useLayoutEffect(e)}function kn(){let{isDataRoute:e}=y.useContext(Cs);return e?Iq():xq()}function xq(){Yp()||yt(!1);let e=y.useContext(Gp),{basename:t,future:n,navigator:r}=y.useContext(Qp),{matches:i}=y.useContext(Cs),{pathname:s}=Mo(),l=JSON.stringify(lR(i,n.v7_relativeSplatPath)),u=y.useRef(!1);return vR(()=>{u.current=!0}),y.useCallback(function(p,h){if(h===void 0&&(h={}),!u.current)return;if(typeof p=="number"){r.go(p);return}let m=cR(p,JSON.parse(l),s,h.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:fs([t,m.pathname])),(h.replace?r.replace:r.push)(m,h.state,h)},[t,r,l,s,e])}const bq=y.createContext(null);function wq(e){let t=y.useContext(Cs).outlet;return t&&y.createElement(bq.Provider,{value:e},t)}function zt(){let{matches:e}=y.useContext(Cs),t=e[e.length-1];return t?t.params:{}}function Sq(e,t){return xR(e,t)}function xR(e,t,n,r){Yp()||yt(!1);let{navigator:i}=y.useContext(Qp),{matches:s}=y.useContext(Cs),l=s[s.length-1],u=l?l.params:{};l&&l.pathname;let d=l?l.pathnameBase:"/";l&&l.route;let p=Mo(),h;if(t){var m;let j=typeof t=="string"?No(t):t;d==="/"||(m=j.pathname)!=null&&m.startsWith(d)||yt(!1),h=j}else h=p;let v=h.pathname||"/",x=v;if(d!=="/"){let j=d.replace(/^\//,"").split("/");x="/"+v.replace(/^\//,"").split("/").slice(j.length).join("/")}let b=Xs(e,{pathname:x}),w=Tq(b&&b.map(j=>Object.assign({},j,{params:Object.assign({},u,j.params),pathname:fs([d,i.encodeLocation?i.encodeLocation(j.pathname).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?d:fs([d,i.encodeLocation?i.encodeLocation(j.pathnameBase).pathname:j.pathnameBase])})),s,n,r);return t&&w?y.createElement(Kp.Provider,{value:{location:uu({pathname:"/",search:"",hash:"",state:null,key:"default"},h),navigationType:Rn.Pop}},w):w}function jq(){let e=Dq(),t=qp(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,i={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return y.createElement(y.Fragment,null,y.createElement("h2",null,"Unexpected Application Error!"),y.createElement("h3",{style:{fontStyle:"italic"}},t),n?y.createElement("pre",{style:i},n):null,null)}const Cq=y.createElement(jq,null);class Eq extends y.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?y.createElement(Cs.Provider,{value:this.props.routeContext},y.createElement(yR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function kq(e){let{routeContext:t,match:n,children:r}=e,i=y.useContext(Gp);return i&&i.static&&i.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=n.route.id),y.createElement(Cs.Provider,{value:t},r)}function Tq(e,t,n,r){var i;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var s;if(!n)return null;if(n.errors)e=n.matches;else if((s=r)!=null&&s.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,u=(i=n)==null?void 0:i.errors;if(u!=null){let h=l.findIndex(m=>m.route.id&&(u==null?void 0:u[m.route.id])!==void 0);h>=0||yt(!1),l=l.slice(0,Math.min(l.length,h+1))}let d=!1,p=-1;if(n&&r&&r.v7_partialHydration)for(let h=0;h<l.length;h++){let m=l[h];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(p=h),m.route.id){let{loaderData:v,errors:x}=n,b=m.route.loader&&v[m.route.id]===void 0&&(!x||x[m.route.id]===void 0);if(m.route.lazy||b){d=!0,p>=0?l=l.slice(0,p+1):l=[l[0]];break}}}return l.reduceRight((h,m,v)=>{let x,b=!1,w=null,j=null;n&&(x=u&&m.route.id?u[m.route.id]:void 0,w=m.route.errorElement||Cq,d&&(p<0&&v===0?(Aq("route-fallback"),b=!0,j=null):p===v&&(b=!0,j=m.route.hydrateFallbackElement||null)));let P=t.concat(l.slice(0,v+1)),T=()=>{let k;return x?k=w:b?k=j:m.route.Component?k=y.createElement(m.route.Component,null):m.route.element?k=m.route.element:k=h,y.createElement(kq,{match:m,routeContext:{outlet:h,matches:P,isDataRoute:n!=null},children:k})};return n&&(m.route.ErrorBoundary||m.route.errorElement||v===0)?y.createElement(Eq,{location:n.location,revalidation:n.revalidation,component:w,error:x,children:T(),routeContext:{outlet:null,matches:P,isDataRoute:!0}}):T()},null)}var bR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(bR||{}),Uf=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Uf||{});function Pq(e){let t=y.useContext(Gp);return t||yt(!1),t}function Rq(e){let t=y.useContext(gR);return t||yt(!1),t}function _q(e){let t=y.useContext(Cs);return t||yt(!1),t}function wR(e){let t=_q(),n=t.matches[t.matches.length-1];return n.route.id||yt(!1),n.route.id}function Dq(){var e;let t=y.useContext(yR),n=Rq(Uf.UseRouteError),r=wR(Uf.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Iq(){let{router:e}=Pq(bR.UseNavigateStable),t=wR(Uf.UseNavigateStable),n=y.useRef(!1);return vR(()=>{n.current=!0}),y.useCallback(function(i,s){s===void 0&&(s={}),n.current&&(typeof i=="number"?e.navigate(i):e.navigate(i,uu({fromRouteId:t},s)))},[e,t])}const bj={};function Aq(e,t,n){bj[e]||(bj[e]=!0)}const wj={};function Nq(e,t){wj[t]||(wj[t]=!0,console.warn(t))}const dl=(e,t,n)=>Nq(e,"⚠️ React Router Future Flag Warning: "+t+". "+("You can use the `"+e+"` future flag to opt-in early. ")+("For more information, see "+n+"."));function Mq(e,t){e!=null&&e.v7_startTransition||dl("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),!(e!=null&&e.v7_relativeSplatPath)&&(!t||!t.v7_relativeSplatPath)&&dl("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath"),t&&(t.v7_fetcherPersist||dl("v7_fetcherPersist","The persistence behavior of fetchers is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_fetcherpersist"),t.v7_normalizeFormMethod||dl("v7_normalizeFormMethod","Casing of `formMethod` fields is being normalized to uppercase in v7","https://reactrouter.com/v6/upgrading/future#v7_normalizeformmethod"),t.v7_partialHydration||dl("v7_partialHydration","`RouterProvider` hydration behavior is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_partialhydration"),t.v7_skipActionErrorRevalidation||dl("v7_skipActionErrorRevalidation","The revalidation behavior after 4xx/5xx `action` responses is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_skipactionerrorrevalidation"))}function Zx(e){return wq(e.context)}function Ke(e){yt(!1)}function Oq(e){let{basename:t="/",children:n=null,location:r,navigationType:i=Rn.Pop,navigator:s,static:l=!1,future:u}=e;Yp()&&yt(!1);let d=t.replace(/^\/*/,"/"),p=y.useMemo(()=>({basename:d,navigator:s,static:l,future:uu({v7_relativeSplatPath:!1},u)}),[d,u,s,l]);typeof r=="string"&&(r=No(r));let{pathname:h="/",search:m="",hash:v="",state:x=null,key:b="default"}=r,w=y.useMemo(()=>{let j=zu(h,d);return j==null?null:{location:{pathname:j,search:m,hash:v,state:x,key:b},navigationType:i}},[d,h,m,v,x,b,i]);return w==null?null:y.createElement(Qp.Provider,{value:p},y.createElement(Kp.Provider,{children:n,value:w}))}function Lq(e){let{children:t,location:n}=e;return Sq(uy(t),n)}new Promise(()=>{});function uy(e,t){t===void 0&&(t=[]);let n=[];return y.Children.forEach(e,(r,i)=>{if(!y.isValidElement(r))return;let s=[...t,i];if(r.type===y.Fragment){n.push.apply(n,uy(r.props.children,s));return}r.type!==Ke&&yt(!1),!r.props.index||!r.props.children||yt(!1);let l={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=uy(r.props.children,s)),n.push(l)}),n}function $q(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:y.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:y.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:y.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
568
- * React Router DOM v6.28.0
569
- *
570
- * Copyright (c) Remix Software Inc.
571
- *
572
- * This source code is licensed under the MIT license found in the
573
- * LICENSE.md file in the root directory of this source tree.
574
- *
575
- * @license MIT
576
- */function Vf(){return Vf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Vf.apply(this,arguments)}function dy(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(i=>[n,i]):[[n,r]])},[]))}function Fq(e,t){let n=dy(e);return t&&t.forEach((r,i)=>{n.has(i)||t.getAll(i).forEach(s=>{n.append(i,s)})}),n}const zq="6";try{window.__reactRouterVersion=zq}catch{}function Bq(e,t){return ZH({basename:void 0,future:Vf({},void 0,{v7_prependBasename:!0}),history:jH({window:void 0}),hydrationData:Uq(),routes:e,mapRouteProperties:$q,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function Uq(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Vf({},t,{errors:Vq(t.errors)})),t}function Vq(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,i]of t)if(i&&i.__type==="RouteErrorResponse")n[r]=new Bf(i.status,i.statusText,i.data,i.internal===!0);else if(i&&i.__type==="Error"){if(i.__subType){let s=window[i.__subType];if(typeof s=="function")try{let l=new s(i.message);l.stack="",n[r]=l}catch{}}if(n[r]==null){let s=new Error(i.message);s.stack="",n[r]=s}}else n[r]=i;return n}const Wq=y.createContext({isTransitioning:!1}),Hq=y.createContext(new Map),qq="startTransition",Sj=qj[qq],Gq="flushSync",jj=JI[Gq];function Qq(e){Sj?Sj(e):e()}function Uc(e){jj?jj(e):e()}class Kq{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function Yq(e){let{fallbackElement:t,router:n,future:r}=e,[i,s]=y.useState(n.state),[l,u]=y.useState(),[d,p]=y.useState({isTransitioning:!1}),[h,m]=y.useState(),[v,x]=y.useState(),[b,w]=y.useState(),j=y.useRef(new Map),{v7_startTransition:P}=r||{},T=y.useCallback(N=>{P?Qq(N):N()},[P]),k=y.useCallback((N,L)=>{let{deletedFetchers:z,flushSync:G,viewTransitionOpts:q}=L;z.forEach(Q=>j.current.delete(Q)),N.fetchers.forEach((Q,ne)=>{Q.data!==void 0&&j.current.set(ne,Q.data)});let Y=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!q||Y){G?Uc(()=>s(N)):T(()=>s(N));return}if(G){Uc(()=>{v&&(h&&h.resolve(),v.skipTransition()),p({isTransitioning:!0,flushSync:!0,currentLocation:q.currentLocation,nextLocation:q.nextLocation})});let Q=n.window.document.startViewTransition(()=>{Uc(()=>s(N))});Q.finished.finally(()=>{Uc(()=>{m(void 0),x(void 0),u(void 0),p({isTransitioning:!1})})}),Uc(()=>x(Q));return}v?(h&&h.resolve(),v.skipTransition(),w({state:N,currentLocation:q.currentLocation,nextLocation:q.nextLocation})):(u(N),p({isTransitioning:!0,flushSync:!1,currentLocation:q.currentLocation,nextLocation:q.nextLocation}))},[n.window,v,h,j,T]);y.useLayoutEffect(()=>n.subscribe(k),[n,k]),y.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new Kq)},[d]),y.useEffect(()=>{if(h&&l&&n.window){let N=l,L=h.promise,z=n.window.document.startViewTransition(async()=>{T(()=>s(N)),await L});z.finished.finally(()=>{m(void 0),x(void 0),u(void 0),p({isTransitioning:!1})}),x(z)}},[T,l,h,n.window]),y.useEffect(()=>{h&&l&&i.location.key===l.location.key&&h.resolve()},[h,v,i.location,l]),y.useEffect(()=>{!d.isTransitioning&&b&&(u(b.state),p({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]),y.useEffect(()=>{},[]);let C=y.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:N=>n.navigate(N),push:(N,L,z)=>n.navigate(N,{state:L,preventScrollReset:z==null?void 0:z.preventScrollReset}),replace:(N,L,z)=>n.navigate(N,{replace:!0,state:L,preventScrollReset:z==null?void 0:z.preventScrollReset})}),[n]),_=n.basename||"/",R=y.useMemo(()=>({router:n,navigator:C,static:!1,basename:_}),[n,C,_]),M=y.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return y.useEffect(()=>Mq(r,n.future),[r,n.future]),y.createElement(y.Fragment,null,y.createElement(Gp.Provider,{value:R},y.createElement(gR.Provider,{value:i},y.createElement(Hq.Provider,{value:j.current},y.createElement(Wq.Provider,{value:d},y.createElement(Oq,{basename:_,location:i.location,navigationType:i.historyAction,navigator:C,future:M},i.initialized||n.future.v7_partialHydration?y.createElement(Xq,{routes:n.routes,future:n.future,state:i}):t))))),null)}const Xq=y.memo(Jq);function Jq(e){let{routes:t,future:n,state:r}=e;return xR(t,void 0,r,n)}var Cj;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Cj||(Cj={}));var Ej;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Ej||(Ej={}));function eb(e){let t=y.useRef(dy(e)),n=y.useRef(!1),r=Mo(),i=y.useMemo(()=>Fq(r.search,n.current?null:t.current),[r.search]),s=kn(),l=y.useCallback((u,d)=>{const p=dy(typeof u=="function"?u(i):u);n.current=!0,s("?"+p,d)},[s,i]);return[i,l]}const Zq=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 Ol(e,t,n){const r=eG(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&kj(r,"path",s),kj(r,"relativePath",s),r}function eG(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=Zq.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function kj(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}var _a=(e,t,n)=>new Promise((r,i)=>{var s=d=>{try{u(n.next(d))}catch(p){i(p)}},l=d=>{try{u(n.throw(d))}catch(p){i(p)}},u=d=>d.done?r(d.value):Promise.resolve(d.value).then(s,l);u((n=n.apply(e,t)).next())});const tG=[".DS_Store","Thumbs.db"];function nG(e){return _a(this,null,function*(){return Wf(e)&&rG(e.dataTransfer)?aG(e.dataTransfer,e.type):iG(e)?oG(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?sG(e):[]})}function rG(e){return Wf(e)}function iG(e){return Wf(e)&&Wf(e.target)}function Wf(e){return typeof e=="object"&&e!==null}function oG(e){return fy(e.target.files).map(t=>Ol(t))}function sG(e){return _a(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Ol(n))})}function aG(e,t){return _a(this,null,function*(){if(e.items){const n=fy(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(lG));return Tj(SR(r))}return Tj(fy(e.files).map(n=>Ol(n)))})}function Tj(e){return e.filter(t=>tG.indexOf(t.name)===-1)}function fy(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 lG(e){if(typeof e.webkitGetAsEntry!="function")return Pj(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?jR(t):Pj(e,t)}function SR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?SR(n):[n]],[])}function Pj(e,t){var n;if(typeof e.getAsFileSystemHandle=="function")return e.getAsFileSystemHandle().then(s=>_a(this,null,function*(){const l=yield s.getFile();return l.handle=s,Ol(l)}));const r=e.getAsFile();if(!r)return Promise.reject(`${e} is not a File`);const i=Ol(r,(n=t==null?void 0:t.fullPath)!=null?n:void 0);return Promise.resolve(i)}function cG(e){return _a(this,null,function*(){return e.isDirectory?jR(e):uG(e)})}function jR(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(l=>_a(this,null,function*(){if(l.length){const u=Promise.all(l.map(cG));i.push(u),s()}else try{const u=yield Promise.all(i);n(u)}catch(u){r(u)}}),l=>{r(l)})}s()})}function uG(e){return _a(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Ol(r,e.fullPath);t(i)},r=>{n(r)})})})}function bg(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;const r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(l=>{const u=l.trim().toLowerCase();return u.charAt(0)==="."?r.toLowerCase().endsWith(u):u.endsWith("/*")?s===u.replace(/\/.*$/,""):i===u})}return!0}var dG=Object.defineProperty,fG=Object.defineProperties,pG=Object.getOwnPropertyDescriptors,Rj=Object.getOwnPropertySymbols,hG=Object.prototype.hasOwnProperty,mG=Object.prototype.propertyIsEnumerable,_j=(e,t,n)=>t in e?dG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,gG=(e,t)=>{for(var n in t||(t={}))hG.call(t,n)&&_j(e,n,t[n]);if(Rj)for(var n of Rj(t))mG.call(t,n)&&_j(e,n,t[n]);return e},yG=(e,t)=>fG(e,pG(t));const vG=typeof bg=="function"?bg:bg.default,xG="file-invalid-type",bG="file-too-large",wG="file-too-small",SG="too-many-files",jG=(e="")=>{const t=e.split(","),n=t.length>1?`one of ${t.join(", ")}`:t[0];return{code:xG,message:`File type must be ${n}`}},Dj=e=>({code:bG,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),Ij=e=>({code:wG,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),CG={code:SG,message:"Too many files"};function CR(e,t){const n=e.type==="application/x-moz-file"||vG(e,t);return[n,n?null:jG(t)]}function ER(e,t,n){if(Zs(e.size))if(Zs(t)&&Zs(n)){if(e.size>n)return[!1,Dj(n)];if(e.size<t)return[!1,Ij(t)]}else{if(Zs(t)&&e.size<t)return[!1,Ij(t)];if(Zs(n)&&e.size>n)return[!1,Dj(n)]}return[!0,null]}function Zs(e){return e!=null}function EG({files:e,accept:t,minSize:n,maxSize:r,multiple:i,maxFiles:s,validator:l}){return!i&&e.length>1||i&&s>=1&&e.length>s?!1:e.every(u=>{const[d]=CR(u,t),[p]=ER(u,n,r),h=l?l(u):null;return d&&p&&!h})}function Hf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function lf(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 Aj(e){e.preventDefault()}function kG(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function TG(e){return e.indexOf("Edge/")!==-1}function PG(e=window.navigator.userAgent){return kG(e)||TG(e)}function Fi(...e){return(t,...n)=>e.some(r=>(!Hf(t)&&r&&r(t,...n),Hf(t)))}function RG(){return"showOpenFilePicker"in window}function _G(e){return Zs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let i=!0;return kR(n)||(console.warn(`Skipped "${n}" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.`),i=!1),(!Array.isArray(r)||!r.every(TR))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),i=!1),i}).reduce((n,[r,i])=>yG(gG({},n),{[r]:i}),{})}]:e}function DG(e){if(Zs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>kR(t)||TR(t)).join(",")}function IG(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function AG(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function kR(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function TR(e){return/^.*\.[\w]+$/.test(e)}var NG=Object.defineProperty,MG=Object.defineProperties,OG=Object.getOwnPropertyDescriptors,qf=Object.getOwnPropertySymbols,PR=Object.prototype.hasOwnProperty,RR=Object.prototype.propertyIsEnumerable,Nj=(e,t,n)=>t in e?NG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,ur=(e,t)=>{for(var n in t||(t={}))PR.call(t,n)&&Nj(e,n,t[n]);if(qf)for(var n of qf(t))RR.call(t,n)&&Nj(e,n,t[n]);return e},ls=(e,t)=>MG(e,OG(t)),Gf=(e,t)=>{var n={};for(var r in e)PR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&qf)for(var r of qf(e))t.indexOf(r)<0&&RR.call(e,r)&&(n[r]=e[r]);return n};const tb=y.forwardRef((e,t)=>{var n=e,{children:r}=n,i=Gf(n,["children"]);const s=DR(i),{open:l}=s,u=Gf(s,["open"]);return y.useImperativeHandle(t,()=>({open:l}),[l]),xn.createElement(y.Fragment,null,r(ls(ur({},u),{open:l})))});tb.displayName="Dropzone";const _R={disabled:!1,getFilesFromEvent:nG,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};tb.defaultProps=_R;tb.propTypes={children:qt.func,accept:qt.objectOf(qt.arrayOf(qt.string)),multiple:qt.bool,preventDropOnDocument:qt.bool,noClick:qt.bool,noKeyboard:qt.bool,noDrag:qt.bool,noDragEventsBubbling:qt.bool,minSize:qt.number,maxSize:qt.number,maxFiles:qt.number,disabled:qt.bool,getFilesFromEvent:qt.func,onFileDialogCancel:qt.func,onFileDialogOpen:qt.func,useFsAccessApi:qt.bool,autoFocus:qt.bool,onDragEnter:qt.func,onDragLeave:qt.func,onDragOver:qt.func,onDrop:qt.func,onDropAccepted:qt.func,onDropRejected:qt.func,onError:qt.func,validator:qt.func};const py={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function DR(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:i,minSize:s,multiple:l,maxFiles:u,onDragEnter:d,onDragLeave:p,onDragOver:h,onDrop:m,onDropAccepted:v,onDropRejected:x,onFileDialogCancel:b,onFileDialogOpen:w,useFsAccessApi:j,autoFocus:P,preventDropOnDocument:T,noClick:k,noKeyboard:C,noDrag:_,noDragEventsBubbling:R,onError:M,validator:N}=ur(ur({},_R),e),L=y.useMemo(()=>DG(t),[t]),z=y.useMemo(()=>_G(t),[t]),G=y.useMemo(()=>typeof w=="function"?w:Mj,[w]),q=y.useMemo(()=>typeof b=="function"?b:Mj,[b]),Y=y.useRef(null),Q=y.useRef(null),[ne,V]=y.useReducer(LG,py),{isFocused:O,isFileDialogActive:A}=ne,B=y.useRef(typeof window<"u"&&window.isSecureContext&&j&&RG()),I=()=>{!B.current&&A&&setTimeout(()=>{if(Q.current){const{files:ce}=Q.current;ce.length||(V({type:"closeDialog"}),q())}},300)};y.useEffect(()=>(window.addEventListener("focus",I,!1),()=>{window.removeEventListener("focus",I,!1)}),[Q,A,q,B]);const F=y.useRef([]),Z=ce=>{Y.current&&Y.current.contains(ce.target)||(ce.preventDefault(),F.current=[])};y.useEffect(()=>(T&&(document.addEventListener("dragover",Aj,!1),document.addEventListener("drop",Z,!1)),()=>{T&&(document.removeEventListener("dragover",Aj),document.removeEventListener("drop",Z))}),[Y,T]),y.useEffect(()=>(!n&&P&&Y.current&&Y.current.focus(),()=>{}),[Y,P,n]);const ae=y.useCallback(ce=>{M?M(ce):console.error(ce)},[M]),je=y.useCallback(ce=>{ce.preventDefault(),ce.persist(),we(ce),F.current=[...F.current,ce.target],lf(ce)&&Promise.resolve(r(ce)).then(ve=>{if(Hf(ce)&&!R)return;const Me=ve.length,ue=Me>0&&EG({files:ve,accept:L,minSize:s,maxSize:i,multiple:l,maxFiles:u,validator:N}),Ue=Me>0&&!ue;V({isDragAccept:ue,isDragReject:Ue,isDragActive:!0,type:"setDraggedFiles"}),d&&d(ce)}).catch(ve=>ae(ve))},[r,d,ae,R,L,s,i,l,u,N]),me=y.useCallback(ce=>{ce.preventDefault(),ce.persist(),we(ce);const ve=lf(ce);if(ve&&ce.dataTransfer)try{ce.dataTransfer.dropEffect="copy"}catch{}return ve&&h&&h(ce),!1},[h,R]),xe=y.useCallback(ce=>{ce.preventDefault(),ce.persist(),we(ce);const ve=F.current.filter(ue=>Y.current&&Y.current.contains(ue)),Me=ve.indexOf(ce.target);Me!==-1&&ve.splice(Me,1),F.current=ve,!(ve.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),lf(ce)&&p&&p(ce))},[Y,p,R]),Te=y.useCallback((ce,ve)=>{const Me=[],ue=[];ce.forEach(Ue=>{const[bt,jt]=CR(Ue,L),[Dt,mn]=ER(Ue,s,i),ft=N?N(Ue):null;if(bt&&Dt&&!ft)Me.push(Ue);else{let wn=[jt,mn];ft&&(wn=wn.concat(ft)),ue.push({file:Ue,errors:wn.filter(Yn=>Yn)})}}),(!l&&Me.length>1||l&&u>=1&&Me.length>u)&&(Me.forEach(Ue=>{ue.push({file:Ue,errors:[CG]})}),Me.splice(0)),V({acceptedFiles:Me,fileRejections:ue,isDragReject:ue.length>0,type:"setFiles"}),m&&m(Me,ue,ve),ue.length>0&&x&&x(ue,ve),Me.length>0&&v&&v(Me,ve)},[V,l,L,s,i,u,m,v,x,N]),le=y.useCallback(ce=>{ce.preventDefault(),ce.persist(),we(ce),F.current=[],lf(ce)&&Promise.resolve(r(ce)).then(ve=>{Hf(ce)&&!R||Te(ve,ce)}).catch(ve=>ae(ve)),V({type:"reset"})},[r,Te,ae,R]),et=y.useCallback(()=>{if(B.current){V({type:"openDialog"}),G();const ce={multiple:l,types:z};window.showOpenFilePicker(ce).then(ve=>r(ve)).then(ve=>{Te(ve,null),V({type:"closeDialog"})}).catch(ve=>{IG(ve)?(q(ve),V({type:"closeDialog"})):AG(ve)?(B.current=!1,Q.current?(Q.current.value=null,Q.current.click()):ae(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ae(ve)});return}Q.current&&(V({type:"openDialog"}),G(),Q.current.value=null,Q.current.click())},[V,G,q,j,Te,ae,z,l]),ht=y.useCallback(ce=>{!Y.current||!Y.current.isEqualNode(ce.target)||(ce.key===" "||ce.key==="Enter"||ce.keyCode===32||ce.keyCode===13)&&(ce.preventDefault(),et())},[Y,et]),ct=y.useCallback(()=>{V({type:"focus"})},[]),St=y.useCallback(()=>{V({type:"blur"})},[]),Et=y.useCallback(()=>{k||(PG()?setTimeout(et,0):et())},[k,et]),Tt=ce=>n?null:ce,vt=ce=>C?null:Tt(ce),_t=ce=>_?null:Tt(ce),we=ce=>{R&&ce.stopPropagation()},Re=y.useMemo(()=>(ce={})=>{var ve=ce,{refKey:Me="ref",role:ue,onKeyDown:Ue,onFocus:bt,onBlur:jt,onClick:Dt,onDragEnter:mn,onDragOver:ft,onDragLeave:wn,onDrop:Yn}=ve,Ji=Gf(ve,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return ur(ur({onKeyDown:vt(Fi(Ue,ht)),onFocus:vt(Fi(bt,ct)),onBlur:vt(Fi(jt,St)),onClick:Tt(Fi(Dt,Et)),onDragEnter:_t(Fi(mn,je)),onDragOver:_t(Fi(ft,me)),onDragLeave:_t(Fi(wn,xe)),onDrop:_t(Fi(Yn,le)),role:typeof ue=="string"&&ue!==""?ue:"presentation",[Me]:Y},!n&&!C?{tabIndex:0}:{}),Ji)},[Y,ht,ct,St,Et,je,me,xe,le,C,_,n]),ke=y.useCallback(ce=>{ce.stopPropagation()},[]),_e=y.useMemo(()=>(ce={})=>{var ve=ce,{refKey:Me="ref",onChange:ue,onClick:Ue}=ve,bt=Gf(ve,["refKey","onChange","onClick"]);const jt={accept:L,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Tt(Fi(ue,le)),onClick:Tt(Fi(Ue,ke)),tabIndex:-1,[Me]:Q};return ur(ur({},jt),bt)},[Q,t,l,le,n]);return ls(ur({},ne),{isFocused:O&&!n,getRootProps:Re,getInputProps:_e,rootRef:Y,inputRef:Q,open:Tt(et)})}function LG(e,t){switch(t.type){case"focus":return ls(ur({},e),{isFocused:!0});case"blur":return ls(ur({},e),{isFocused:!1});case"openDialog":return ls(ur({},py),{isFileDialogActive:!0});case"closeDialog":return ls(ur({},e),{isFileDialogActive:!1});case"setDraggedFiles":return ls(ur({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ls(ur({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return ur({},py);default:return e}}function Mj(){}const[$G,FG]=pr("Dropzone component was not found in tree");function nb(e){const t=n=>{const{children:r,...i}=ie(`Dropzone${z0(e)}`,{},n),s=FG(),l=Eo(r)?r:o.jsx("span",{children:r});return s[e]?y.cloneElement(l,i):null};return t.displayName=`@mantine/dropzone/${z0(e)}`,t}const zG=nb("accept"),BG=nb("reject"),UG=nb("idle");var du={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const VG={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},WG=(e,{radius:t,variant:n,acceptColor:r,rejectColor:i})=>{const s=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),l=e.variantColorResolver({color:i||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Ot(t),"--dropzone-accept-color":s.color,"--dropzone-accept-bg":s.background,"--dropzone-reject-color":l.color,"--dropzone-reject-bg":l.background}}},Es=fe((e,t)=>{const n=ie("Dropzone",VG,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,radius:p,disabled:h,loading:m,multiple:v,maxSize:x,accept:b,children:w,onDropAny:j,onDrop:P,onReject:T,openRef:k,name:C,maxFiles:_,autoFocus:R,activateOnClick:M,activateOnDrag:N,dragEventsBubbling:L,activateOnKeyboard:z,onDragEnter:G,onDragLeave:q,onDragOver:Y,onFileDialogCancel:Q,onFileDialogOpen:ne,preventDropOnDocument:V,useFsAccessApi:O,getFilesFromEvent:A,validator:B,rejectColor:I,acceptColor:F,enablePointerEvents:Z,loaderProps:ae,inputProps:je,mod:me,...xe}=n,Te=Ne({name:"Dropzone",classes:du,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,vars:d,varsResolver:WG}),{getRootProps:le,getInputProps:et,isDragAccept:ht,isDragReject:ct,open:St}=DR({onDrop:j,onDropAccepted:P,onDropRejected:T,disabled:h||m,accept:Array.isArray(b)?b.reduce((Tt,vt)=>({...Tt,[vt]:[]}),{}):b,multiple:v,maxSize:x,maxFiles:_,autoFocus:R,noClick:!M,noDrag:!N,noDragEventsBubbling:!L,noKeyboard:!z,onDragEnter:G,onDragLeave:q,onDragOver:Y,onFileDialogCancel:Q,onFileDialogOpen:ne,preventDropOnDocument:V,useFsAccessApi:O,validator:B,...A?{getFilesFromEvent:A}:null});Yc(k,St);const Et=!ht&&!ct;return o.jsx($G,{value:{accept:ht,reject:ct,idle:Et},children:o.jsxs(se,{...le(),...Te("root",{focusable:!0}),...xe,mod:[{accept:ht,reject:ct,idle:Et,disabled:h,loading:m,"activate-on-click":M},me],children:[o.jsx(Tv,{visible:m,overlayProps:{radius:p},unstyled:u,loaderProps:ae}),o.jsx("input",{...et(je),name:C}),o.jsx("div",{...Te("inner"),ref:t,"data-enable-pointer-events":Z||void 0,children:w})]})})});Es.classes=du;Es.displayName="@mantine/dropzone/Dropzone";Es.Accept=zG;Es.Idle=UG;Es.Reject=BG;const HG={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Br("max"),withinPortal:!0},rb=fe((e,t)=>{const n=ie("DropzoneFullScreen",HG,e),{classNames:r,className:i,style:s,styles:l,unstyled:u,vars:d,active:p,onDrop:h,onReject:m,zIndex:v,withinPortal:x,portalProps:b,...w}=n,j=Ne({name:"DropzoneFullScreen",classes:du,props:n,className:i,style:s,classNames:r,styles:l,unstyled:u,rootSelector:"fullScreen"}),{resolvedClassNames:P,resolvedStyles:T}=va({classNames:r,styles:l,props:n}),[k,C]=y.useState(0),[_,{open:R,close:M}]=Yf(!1),N=z=>{var G;(G=z.dataTransfer)!=null&&G.types.includes("Files")&&(C(q=>q+1),R())},L=()=>{C(z=>z-1)};return y.useEffect(()=>{k===0&&M()},[k]),y.useEffect(()=>{if(p)return document.addEventListener("dragenter",N,!1),document.addEventListener("dragleave",L,!1),()=>{document.removeEventListener("dragenter",N,!1),document.removeEventListener("dragleave",L,!1)}},[p]),o.jsx(vs,{...b,withinPortal:x,children:o.jsx(se,{...j("fullScreen",{style:{opacity:_?1:0,pointerEvents:_?"all":"none",zIndex:v}}),ref:t,children:o.jsx(Es,{...w,classNames:P,styles:T,unstyled:u,className:du.dropzone,onDrop:z=>{h==null||h(z),M(),C(0)},onReject:z=>{m==null||m(z),M(),C(0)}})})})});rb.classes=du;rb.displayName="@mantine/dropzone/DropzoneFullScreen";Es.FullScreen=rb;const cf=Es,qG='{"resourceType": "Bundle"}';function wg({id:e,title:t,message:n,color:r,icon:i,withCloseButton:s=!1,method:l="show",loading:u}){qi[l]({id:e,loading:u,title:t,message:n,color:r,icon:i,withCloseButton:s,autoClose:!1})}function GG(){const e=dn(),t=Pe(),[n,r]=y.useState({}),i=y.useCallback(async(u,d)=>{const p="batch-upload";wg({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let h=JSON.parse(u);h.type!=="batch"&&h.type!=="transaction"&&(h=_T(h));const m=await t.executeBatch(h);r(v=>({...v,[d]:m})),wg({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:o.jsx(Ss,{size:"1rem"}),withCloseButton:!0})}catch(h){wg({id:p,title:"Batch Upload Failed",color:"red",message:tt(h),method:"update",icon:o.jsx(Nl,{size:"1rem"}),withCloseButton:!0})}},[t]),s=y.useCallback(async u=>{for(const d of u){const p=new FileReader;p.onload=h=>{var m;return i((m=h.target)==null?void 0:m.result,d.name)},p.readAsText(d)}},[i]),l=y.useCallback(async u=>{await i(u.input,"JSON Data")},[i]);return o.jsxs(at,{children:[o.jsx(ze,{children:"Batch Create"}),o.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",o.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{children:"Input"}),o.jsxs(At,{defaultValue:"upload",children:[o.jsxs(At.List,{children:[o.jsx(At.Tab,{value:"upload",children:"File Upload"}),o.jsx(At.Tab,{value:"json",children:"JSON"})]}),o.jsx(At.Panel,{value:"upload",pt:"xs",children:o.jsx(cf,{onDrop:s,accept:["application/json"],children:o.jsxs(be,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[o.jsx(cf.Accept,{children:o.jsx(DS,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),o.jsx(cf.Reject,{children:o.jsx(Nl,{size:50,stroke:1.5,color:e.colors.red[5]})}),o.jsx(cf.Idle,{children:o.jsx(DS,{size:50,stroke:1.5})}),o.jsxs("div",{children:[o.jsx(Le,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),o.jsx(Le,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),o.jsx(At.Panel,{value:"json",pt:"xs",children:o.jsxs(gt,{onSubmit:l,children:[o.jsx(Wl,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:qG,deserialize:JSON.parse}),o.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ee,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&o.jsxs(o.Fragment,{children:[o.jsx("h3",{children:"Output"}),o.jsxs(At,{defaultValue:Object.keys(n)[0],children:[o.jsx(At.List,{children:Object.keys(n).map(u=>o.jsx(At.Tab,{value:u,children:u},u))}),Object.keys(n).map(u=>o.jsx(At.Panel,{value:u,children:o.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[u],void 0,2)})},u))]}),o.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ee,{onClick:()=>r({}),children:"Start over"})})]})]})}function QG(){const{resourceType:e}=zt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),[r]=Al("Questionnaire",`subject-type=${e}`);return r?r.length===0?o.jsxs(at,{children:[o.jsxs(ze,{children:["No apps for ",e]}),o.jsx(xt,{to:`/${e}`,children:"Return to search page"})]}):o.jsx(at,{children:o.jsx("div",{children:r.map(i=>o.jsxs("div",{children:[o.jsx("h3",{children:o.jsx(xt,{to:`/forms/${i.id}?subject=`+n.map(s=>`${e}/${s}`).join(","),children:i.name})}),o.jsx("p",{children:i.description})]},i.id))})}):o.jsx(ri,{})}function KG(){const e=Pe(),[t,n]=y.useState(),[r,i]=y.useState(!1);return o.jsx(at,{width:450,children:o.jsxs(gt,{onSubmit:s=>{n(void 0),e.post("auth/changepassword",s).then(()=>i(!0)).catch(l=>n(Vt(l)))},children:[o.jsxs(Gn,{style:{flexDirection:"column"},children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Change password"})]}),!r&&o.jsxs(nt,{gap:"xl",mt:"xl",children:[o.jsx(ji,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:kt(t,"oldPassword")}),o.jsx(ji,{name:"newPassword",label:"New password",required:!0,error:kt(t,"newPassword")}),o.jsx(ji,{name:"confirmPassword",label:"Confirm new password",required:!0,error:kt(t,"confirmPassword")}),o.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ee,{type:"submit",children:"Change password"})})]}),r&&o.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const hy=["Form","JSON","Profiles"],YG=["Profiles"],Sg=hy[0].toLowerCase();function XG(){const e=kn(),t=dn(),{resourceType:n}=zt(),[r,i]=y.useState(()=>{const l=window.location.pathname.split("/").pop();return l&&hy.map(u=>u.toLowerCase()).includes(l)?l:Sg});function s(l){l||(l=Sg),i(l),e(`/${n}/new/${l}`)}return o.jsxs(o.Fragment,{children:[o.jsxs(Er,{children:[o.jsxs(Le,{p:"md",fw:500,children:["New ",n]}),o.jsx(oi,{children:o.jsx(At,{defaultValue:Sg,value:r,onChange:s,children:o.jsx(At.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:hy.map(l=>o.jsx(At.Tab,{value:l.toLowerCase(),px:"md",children:YG.includes(l)?o.jsxs(be,{gap:"xs",wrap:"nowrap",children:[l,o.jsx(xu,{color:t.primaryColor,size:"sm",children:"Beta"})]}):l},l))})})})]}),o.jsx(Zx,{})]})}function JG(){return o.jsx(at,{children:o.jsxs(nt,{children:[o.jsx(ze,{order:1,children:"Unexpected Error"}),o.jsx(Le,{children:"We're sorry, something went wrong."}),o.jsxs(Le,{children:["Please contact ",o.jsx(Rt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const ZG="_root_1fbwr_1",eQ="_entry_1fbwr_8",tQ="_key_1fbwr_13",nQ="_value_1fbwr_20",Xp={root:ZG,entry:eQ,key:tQ,value:nQ};function pt(e){return o.jsx(oi,{children:o.jsx("div",{className:Xp.root,children:e.children})})}pt.Entry=function(t){return o.jsx("div",{className:Xp.entry,children:t.children})};pt.Key=function(t){return o.jsx("div",{className:Xp.key,children:t.children})};pt.Value=function(t){return o.jsx("div",{className:Xp.value,children:t.children})};function rQ(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function IR(e){var n,r;const t=Yt(e.patient);return t?o.jsxs(pt,{children:[o.jsx(js,{value:t,size:"lg",color:rQ(t)}),o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Name"}),o.jsx(pt.Value,{children:o.jsx(xt,{to:t,fw:500,children:t.name?o.jsx(Rx,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&o.jsxs(o.Fragment,{children:[o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"DoB"}),o.jsx(pt.Value,{children:t.birthDate})]}),o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Age"}),o.jsx(pt.Value,{children:U7(t.birthDate)})]})]}),t.gender&&o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Gender"}),o.jsx(pt.Value,{children:t.gender})]}),t.address&&o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"State"}),o.jsx(pt.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(i=>o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:i==null?void 0:i.system}),o.jsx(pt.Value,{children:i==null?void 0:i.value})]},`${i==null?void 0:i.system}-${i==null?void 0:i.value}`))]}):null}function AR(e){const t=Yt(e.resource);if(!t)return null;const n=[{key:"Type",value:o.jsx(xt,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(l,u){l&&u&&n.push({key:l,value:u})}function i(l){l&&r(l.system,l.value)}function s(l,u){Array.isArray(u)?u.forEach(d=>s(l,d)):typeof u=="string"?r(l,u):u&&(Array.isArray(u.coding)?r(l,u.coding.map(d=>d.display||d.code).join(", ")):r(l,u.text))}if("name"in t){const l=jo(t);l!==Ft(t)&&r("Name",l)}return"category"in t&&s("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&s("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(i):i(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),o.jsx(pt,{children:n.map((l,u)=>o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:l.key}),o.jsx(pt.Value,{children:l.value})]},`${l.key}-${u}`))})}function ib(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function iQ(e){var t;if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return(t=e.specimen)==null?void 0:t[0]}function ks(e){var t;return Dl((t=e.getActiveLogin())==null?void 0:t.project)}function oQ(e,t){const n=new Blob([e],{type:Cn.JSON}),r=URL.createObjectURL(n),i=document.createElement("a");i.href=r;const s=new Date().toISOString().replace(/\D/g,"");i.download=`${s}.json`,document.body.appendChild(i),i.click(),URL.revokeObjectURL(r)}function sQ(){const{id:e}=zt(),t=Mo(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,i=Pe(),[s,l]=y.useState(!0),[u,d]=y.useState(),[p,h]=y.useState(),[m,v]=y.useState(),[x,b]=y.useState(),[w,j]=y.useState();if(y.useEffect(()=>{const k={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const C=r.split(",").filter(_=>!!_);C.length===1&&k.entry.push({request:{method:"GET",url:C[0]}}),h(C)}i.executeBatch(k).then(C=>{var _,R,M,N,L,z,G,q;((M=(R=(_=C.entry)==null?void 0:_[0])==null?void 0:R.response)==null?void 0:M.status)!=="200"?b((z=(L=(N=C.entry)==null?void 0:N[0])==null?void 0:L.response)==null?void 0:z.outcome):(d((G=C.entry[0])==null?void 0:G.resource),v((q=C.entry[1])==null?void 0:q.resource)),l(!1)}).catch(C=>{b(C),l(!1)})},[i,e,r]),x)return o.jsx(at,{children:o.jsx("pre",{"data-testid":"error",children:JSON.stringify(x,void 0,2)})});if(w)return o.jsxs(at,{children:[o.jsx(ze,{children:u==null?void 0:u.title}),o.jsx("p",{children:"Your response has been recorded."}),o.jsxs("ul",{children:[w.length===1&&o.jsx("li",{children:o.jsx(xt,{to:w[0],children:"Review your answers"})}),w.length>1&&o.jsxs("li",{children:["Review your answers:",o.jsx("ul",{children:w.map(k=>o.jsx("li",{children:o.jsx(xt,{to:k,children:Ft(k)})},k.id))})]}),m&&o.jsx("li",{children:o.jsxs(xt,{to:m,children:["Back to ",jo(m)]})}),o.jsx("li",{children:o.jsx(xt,{to:"/",children:"Go back home"})})]})]});if(s||!u)return o.jsx(ri,{});const P=m&&ib(m);return o.jsxs(o.Fragment,{children:[o.jsxs(Er,{shadow:"xs",radius:0,children:[P&&o.jsx(IR,{patient:P}),m&&m.resourceType!=="Patient"&&o.jsx(AR,{resource:m}),o.jsx(se,{px:"xl",py:"md",children:o.jsxs(Le,{children:[jo(u),p&&p.length>1&&o.jsxs(o.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),o.jsx(at,{children:o.jsx(nR,{questionnaire:u,subject:m&&Zt(m),onSubmit:T})})]});async function T(k){const C=[];if(!p||p.length===0)C.push(await i.createResource(k));else for(const _ of p)C.push(await i.createResource({...k,subject:{reference:_}}));j(C)}}const aQ="_paper_unw9o_1",lQ={paper:aQ},cQ={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function NR(e,t){const n=e.resourceType||uQ(t),r=e.fields??dQ(n),i=e.filters??(e.resourceType?void 0:fQ(n)),s=e.sortRules??pQ(n),l=e.offset??0,u=e.count??Mp;return{...e,resourceType:n,fields:r,filters:i,sortRules:s,offset:l,count:u}}function uQ(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function dQ(e){const t=ob(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function fQ(e){var t;return(t=ob(e))==null?void 0:t.filters}function pQ(e){const t=ob(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function ob(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function hQ(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function mQ(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=NR(n,t.getUserConfiguration()),i=await t.search(r.resourceType,ml({...r,total:"accurate",fields:void 0}));return _T(i)}function Oj(){const e=Pe(),t=kn(),n=Mo(),[r,i]=y.useState();return y.useEffect(()=>{const s=ET(n.pathname+n.search),l=NR(s,e.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===ml(l)?(hQ(l),i(l)):t(`/${l.resourceType}${ml(l)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?o.jsx(ri,{}):o.jsx(Er,{shadow:"xs",m:"md",p:"xs",className:lQ.paper,children:o.jsx($u,{checkboxesEnabled:!0,search:r,onClick:s=>t(`/${s.resource.resourceType}/${s.resource.id}`),onAuxClick:s=>window.open(`/${s.resource.resourceType}/${s.resource.id}`,"_blank"),onChange:s=>{t(`/${r.resourceType}${ml(s.definition)}`)},onNew:()=>{t(cQ[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const s=e.fhirUrl(r.resourceType,"$csv")+ml(r);e.download(s).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>Ie({color:"red",message:tt(l),autoClose:!1}))},onExportTransactionBundle:async()=>{mQ(r,e).then(s=>oQ(JSON.stringify(s,void 0,2))).catch(s=>Ie({color:"red",message:tt(s),autoClose:!1}))},onDelete:s=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:s.map(l=>({request:{method:"DELETE",url:`${r.resourceType}/${l}`}}))}).then(()=>i({...r})).catch(l=>Ie({color:"red",message:tt(l),autoClose:!1})))},onBulk:s=>{t(`/bulk/${r.resourceType}?ids=${s.join(",")}`)}})})}function gQ(){const e=Pe(),[t,n]=y.useState(),[r,i]=y.useState(void 0),[s,l]=y.useState(!1),u=y.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(h=>{n(h.enrollQrCode),i(h.enrolled)}).catch(h=>Ie({color:"red",message:tt(h),autoClose:!1}))},[e]);y.useEffect(()=>{u()},[u]);const d=y.useCallback(h=>{e.post("auth/mfa/enroll",h).then(()=>{i(!0),Ie({color:"green",message:"Success"})}).catch(m=>Ie({color:"red",message:tt(m),autoClose:!1}))},[e]),p=y.useCallback(async h=>e.post("auth/mfa/disable",{token:h.token}),[e]);return r===void 0?null:r?o.jsxs(at,{children:[o.jsx(Mn,{title:"Disable MFA",opened:s,onClose:()=>l(!1),children:o.jsx(aP,{onSubmit:async h=>{await p(h),l(!1),i(!1),Ie({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:o.jsx(qF,{})}),u()}})}),o.jsxs(be,{children:[o.jsx(ze,{children:"MFA is enabled"}),o.jsx(Ee,{onClick:()=>l(!0),children:"Disable MFA"})]})]}):o.jsx(at,{width:400,children:o.jsxs(gt,{onSubmit:d,children:[o.jsx(ze,{children:"Multi Factor Auth Setup"}),o.jsx(Gn,{children:o.jsx("img",{src:t})}),o.jsx(Be,{name:"token",label:"Code"}),o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"Enroll"})})]})})}const jg={},my={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:jg==null?void 0:jg.MEDPLUM_AWS_TEXTRACT_ENABLED};function Bu(){return my}function MR(){return OR("registerEnabled")}function yQ(){return OR("awsTextractEnabled")}function OR(e){try{return my[e]!==!1&&my[e]!=="false"}catch{return!0}}function vQ(){var h,m;const e=kn(),[t]=eb(),n=Pe(),r=t.get("scope")||"openid",[i,s]=y.useState(),[l,u]=y.useState(!0),d=t.get("client_id");if(y.useEffect(()=>{if(!d||d==="medplum-cli")return;async function v(){try{const x=await n.get(`/auth/clientinfo/${d}`);s(x)}catch(x){Ie({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:tt(x),withCloseButton:!0})}finally{u(!1)}}v().catch(console.error)},[n,d]),!d)return null;function p(v){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",v),window.location.assign(x.toString())}return o.jsx(lP,{onCode:p,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Bu().googleClientId,clientId:d||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",children:!l&&o.jsxs(o.Fragment,{children:[(h=i==null?void 0:i.logo)!=null&&h.url?o.jsx("img",{src:(m=i==null?void 0:i.logo)==null?void 0:m.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):o.jsx(_i,{size:32}),o.jsx(ze,{children:(i==null?void 0:i.welcomeString)??"Sign in to Medplum"})]})})}function xQ(){const e=Pe(),t=kn(),n=Bu();return y.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),MR()?o.jsxs(Pz,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Create a new account"})]}):o.jsx(at,{width:450,children:o.jsx(xs,{icon:o.jsx(Jl,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function bQ(){const e=kn(),t=Pe(),[n,r]=y.useState(),[i,s]=y.useState(!1),l=Bu().recaptchaSiteKey;return y.useEffect(()=>{oP(l)},[l]),o.jsx(at,{width:450,children:o.jsxs(gt,{onSubmit:async u=>{let d="";d=await sP(l),t.post("auth/resetpassword",{...u,recaptchaToken:d}).then(()=>s(!0)).catch(p=>r(Vt(p)))},children:[o.jsxs(nt,{gap:"lg",mb:"xl",align:"center",children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Medplum Password Reset"})]}),o.jsxs(nt,{gap:"xl",children:[o.jsx(li,{issues:Mu(n,void 0)}),!i&&o.jsxs(o.Fragment,{children:[o.jsx(Be,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:kt(n,"email")}),o.jsxs(be,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[o.jsx(Rt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),o.jsx(Ee,{type:"submit",children:"Reset password"})]})]}),i&&o.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function wQ(){var s;const e=kn(),t=Pe(),[n,r]=y.useState();y.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(l=>Ie({color:"red",message:tt(l),autoClose:!1}))},[t]);function i(l){t.post("auth/revoke",{loginId:l}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>Ie({color:"green",message:"Login revoked"})).catch(u=>Ie({color:"red",message:tt(u),autoClose:!1}))}return n?o.jsxs(o.Fragment,{children:[o.jsxs(at,{children:[o.jsx(ze,{children:"Security"}),o.jsxs(Ax,{children:[o.jsx(yo,{term:"ID",children:o.jsx(Rt,{href:`/${Ft(n.profile)}`,children:n.profile.id})}),o.jsx(yo,{term:"Resource Type",children:n.profile.resourceType}),o.jsx(yo,{term:"Name",children:Kl((s=n.profile.name)==null?void 0:s[0])})]})]}),o.jsxs(at,{children:[o.jsx(ze,{children:"Sessions"}),o.jsxs(Ae,{children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"OS"}),o.jsx("th",{children:"Browser"}),o.jsx("th",{children:"IP Address"}),o.jsx("th",{children:"Auth Method"}),o.jsx("th",{children:"Last Updated"}),o.jsx("th",{})]})}),o.jsx("tbody",{children:n.security.sessions.map(l=>o.jsxs("tr",{children:[o.jsx("td",{children:l.os}),o.jsx("td",{children:l.browser}),o.jsx("td",{children:l.remoteAddress}),o.jsx("td",{children:l.authMethod}),o.jsx("td",{children:fr(l.lastUpdated)}),o.jsx("td",{children:o.jsx(Rt,{href:"#",onClick:()=>i(l.id),children:"Revoke"})})]},l.id))})]})]}),o.jsxs(at,{children:[o.jsx(ze,{children:"Password"}),o.jsx(Ee,{onClick:()=>e("/changepassword"),children:"Change password"})]}),o.jsxs(at,{children:[o.jsx(ze,{children:"Multi Factor Auth"}),o.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&o.jsx(Ee,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function SQ(){const{id:e,secret:t}=zt(),n=Pe(),[r,i]=y.useState(),[s,l]=y.useState(!1),u=Mu(r,void 0);return o.jsxs(at,{width:450,children:[o.jsx(li,{issues:u}),o.jsxs(gt,{onSubmit:d=>{if(d.password!==d.confirmPassword){i(Gi("Passwords do not match","confirmPassword"));return}i(void 0);const p={id:e,secret:t,password:d.password};n.post("auth/setpassword",p).then(()=>l(!0)).catch(h=>i(Vt(h)))},children:[o.jsxs(Gn,{style:{flexDirection:"column"},children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Set password"})]}),!s&&o.jsxs(nt,{children:[o.jsx(ji,{name:"password",label:"New password",required:!0,error:kt(r,"password")}),o.jsx(ji,{name:"confirmPassword",label:"Confirm new password",required:!0,error:kt(r,"confirmPassword")}),o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"Set password"})})]}),s&&o.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",o.jsx(xt,{to:"/signin",children:"sign in"}),"."]})]})]})}function jQ(){const e=zp(),t=kn(),[n]=eb(),r=Bu(),i=y.useCallback(()=>{const s=n.get("next");t(s!=null&&s.startsWith("/")?s:"/")},[n,t]);return y.useEffect(()=>{e&&n.has("next")&&i()},[e,n,i]),o.jsxs(lP,{onSuccess:()=>i(),onForgotPassword:()=>t("/resetpassword"),onRegister:MR()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[o.jsx(_i,{size:32}),o.jsx(ze,{children:"Sign in to Medplum"}),n.get("project")==="new"&&o.jsx("div",{children:"Sign in again to create a new project"})]})}function CQ(){const e=kn(),t=Mo(),[n,r]=y.useState(),[i,s]=y.useState(),[l,u]=y.useState();return y.useEffect(()=>{const d=Object.fromEntries(new URLSearchParams(t.search).entries());r(d.resourceType),s(d.query),u(JSON.parse(d.fields))},[t]),!n||!i||!l?null:o.jsx(jV,{resourceType:n,checkboxesEnabled:!0,query:i,fields:l,onClick:d=>e(`/${n}/${d.resource.id}`),onAuxClick:d=>window.open(`/${n}/${d.resource.id}`,"_blank"),onBulk:d=>{e(`/bulk/${n}?ids=${d.join(",")}`)}})}function Jp(e){const t=Pe(),n=ks(t),r=kn(),[i,s]=y.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:Se.EQUALS,value:"Project/"+n},{code:"profile-type",operator:Se.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return o.jsx($u,{search:i,onClick:l=>r(`/admin/members/${l.resource.id}`),onChange:l=>s(l.definition),hideFilters:!0,hideToolbar:!0})}function EQ(){return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Bots"}),o.jsx(Jp,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),o.jsx(be,{justify:"flex-end",children:o.jsx(xt,{to:"/admin/bots/new",children:"Create new bot"})})]})}function kQ(){return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Clients"}),o.jsx(Jp,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),o.jsx(be,{justify:"flex-end",children:o.jsx(xt,{to:"/admin/clients/new",children:"Create new client"})})]})}function Zp(e){return o.jsx(Ra,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Ao(t)?e.onChange(Zt(t)):e.onChange(void 0)}})}function TQ(){const e=Pe(),t=ks(e),[n,r]=y.useState(""),[i,s]=y.useState(""),[l,u]=y.useState(),[d,p]=y.useState(),[h,m]=y.useState(void 0);return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Create new Bot"}),o.jsxs(gt,{onSubmit:()=>{const v={name:n,description:i,accessPolicy:l};e.post("admin/projects/"+t+"/bot",v).then(x=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),m(x),Ie({color:"green",message:"Bot created"})}).catch(x=>{Ie({color:"red",message:tt(x),autoClose:!1}),p(Vt(x))})},children:[!h&&o.jsxs(nt,{children:[o.jsx(Ht,{title:"Name",htmlFor:"name",outcome:d,children:o.jsx(Be,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>r(v.currentTarget.value),error:kt(d,"name")})}),o.jsx(Ht,{title:"Description",htmlFor:"description",outcome:d,children:o.jsx(Be,{id:"description",name:"description",onChange:v=>s(v.currentTarget.value),error:kt(d,"description")})}),o.jsx(Ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:o.jsx(Zp,{name:"accessPolicy",onChange:u})}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{type:"submit",children:"Create Bot"})})]}),h&&o.jsxs("div",{"data-testid":"success",children:[o.jsx(Le,{children:"Bot created"}),o.jsxs(dr,{children:[o.jsx(dr.Item,{children:o.jsx(xt,{to:h,children:"Go to new bot"})}),o.jsx(dr.Item,{children:o.jsx(xt,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function PQ(){const e=Pe(),t=ks(e),[n,r]=y.useState(""),[i,s]=y.useState(""),[l,u]=y.useState(""),[d,p]=y.useState(),[h,m]=y.useState(),[v,x]=y.useState(void 0);return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Create new Client"}),o.jsxs(gt,{onSubmit:()=>{const b={name:n,description:i,redirectUri:l,accessPolicy:d};e.post("admin/projects/"+t+"/client",b).then(w=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),x(w),Ie({color:"green",message:"Client created"})}).catch(w=>{Ie({color:"red",message:tt(w),autoClose:!1}),m(Vt(w))})},children:[!v&&o.jsxs(nt,{children:[o.jsx(Ht,{title:"Name",htmlFor:"name",outcome:h,children:o.jsx(Be,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:b=>r(b.currentTarget.value),error:kt(h,"name")})}),o.jsx(Ht,{title:"Description",htmlFor:"description",outcome:h,children:o.jsx(Be,{id:"description",name:"description",onChange:b=>s(b.currentTarget.value),error:kt(h,"description")})}),o.jsx(Ht,{title:"Redirect URI",htmlFor:"redirectUri",outcome:h,children:o.jsx(Be,{id:"redirectUri",name:"redirectUri",onChange:b=>u(b.currentTarget.value),error:kt(h,"redirectUri")})}),o.jsx(Ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:h,children:o.jsx(Zp,{name:"accessPolicy",onChange:p})}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{type:"submit",children:"Create Client"})})]}),v&&o.jsxs("div",{"data-testid":"success",children:[o.jsx(Le,{children:"Client created"}),o.jsxs(dr,{children:[o.jsx(dr.Item,{children:o.jsx(xt,{to:v,children:"Go to new client"})}),o.jsx(dr.Item,{children:o.jsx(xt,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function RQ(e){return o.jsx(Ra,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Ao(t)?e.onChange(Zt(t)):e.onChange(void 0)}})}function _Q(){const{membershipId:e}=zt(),t=Pe(),n=ks(t),r=kn(),i=t.get(`admin/projects/${n}/members/${e}`).read(),[s,l]=y.useState(i.accessPolicy),[u,d]=y.useState(i.userConfiguration),[p,h]=y.useState(i.admin),[m,v]=y.useState(),[x,b]=y.useState(!1);function w(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(j=>v(Vt(j)))}return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Edit membership"}),o.jsx("h3",{children:o.jsx(wl,{value:i.profile,link:!0})}),o.jsxs(gt,{onSubmit:()=>{const j={...i,accessPolicy:s,userConfiguration:u,admin:p};t.post(`admin/projects/${n}/members/${e}`,j).then(()=>b(!0)).catch(P=>v(Vt(P)))},children:[!x&&o.jsxs(nt,{children:[o.jsx(Ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:o.jsx(Zp,{name:"accessPolicy",defaultValue:s,onChange:l})}),o.jsx(Ht,{title:"User Configuration",htmlFor:"userConfiguration",outcome:m,children:o.jsx(RQ,{name:"userConfiguration",defaultValue:u,onChange:d})}),o.jsx(Ht,{title:"Admin",htmlFor:"admin",outcome:m,children:o.jsx(Kn,{id:"admin",name:"admin",defaultChecked:p,onChange:j=>h(j.currentTarget.checked)})}),o.jsxs(be,{justify:"flex-end",mt:"xl",children:[o.jsx(Ee,{type:"submit",children:"Save"}),o.jsx(Ee,{type:"button",color:"red",variant:"outline",onClick:w,children:"Remove user"})]})]}),x&&o.jsxs("div",{"data-testid":"success",children:[o.jsx("p",{children:"User updated"}),o.jsx("pre",{children:JSON.stringify(m,void 0,2)}),o.jsxs("p",{children:["Click ",o.jsx(xt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function DQ(){const e=Pe(),[t,n]=y.useState(e.getProject()),[r,i]=y.useState(),[s,l]=y.useState(),[u,d]=y.useState(!1),[p,h]=y.useState(void 0),m=y.useCallback(v=>{const x={resourceType:v.resourceType,firstName:v.firstName,lastName:v.lastName,email:v.email,sendEmail:v.sendEmail==="on",accessPolicy:r,admin:v.isAdmin==="on"};e.invite(t==null?void 0:t.id,x).then(b=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Ip(b)?l(b):h(b),d(x.sendEmail??!1),Ie({color:"green",message:"Invite success"})}).catch(b=>{Ie({color:"red",message:tt(b),autoClose:!1}),l(Vt(b))})},[e,t,r]);return o.jsxs(gt,{onSubmit:m,children:[!p&&!s&&o.jsxs(nt,{children:[o.jsx(ze,{children:"Invite new member"}),e.isSuperAdmin()&&o.jsx(Ht,{title:"Project",htmlFor:"project",outcome:s,children:o.jsx(Ra,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),o.jsx(en,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:kt(s,"resourceType")}),o.jsx(Be,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:kt(s,"firstName")}),o.jsx(Be,{name:"lastName",label:"Last Name",required:!0,error:kt(s,"lastName")}),o.jsx(Be,{name:"email",type:"email",label:"Email",required:!0,error:kt(s,"email")}),o.jsx(Ht,{title:"Access Policy",htmlFor:"accessPolicy",outcome:s,children:o.jsx(Zp,{name:"accessPolicy",onChange:i})}),o.jsx(Kn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),o.jsx(Kn,{name:"isAdmin",label:"Admin"}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{type:"submit",children:"Invite"})})]}),s&&o.jsxs("div",{"data-testid":"success",children:[o.jsx("p",{children:"User created, email couldn't be sent"}),o.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),o.jsxs("p",{children:["Click ",o.jsx(xt,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&o.jsxs("div",{"data-testid":"success",children:[o.jsx(Le,{children:"User created"}),u&&o.jsx(Le,{children:"Email sent"}),o.jsxs(dr,{children:[o.jsx(dr.Item,{children:o.jsx(xt,{to:p,children:"Go to new membership"})}),o.jsx(dr.Item,{children:o.jsx(xt,{to:p.profile,children:"Go to new profile"})}),o.jsx(dr.Item,{children:o.jsx(xt,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function IQ(){return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Patients"}),o.jsx(Jp,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),o.jsx(be,{justify:"flex-end",children:o.jsx(xt,{to:"/admin/invite",children:"Invite new patient"})})]})}function AQ(){const e=Pe();if(!e.isLoading()&&!e.isProjectAdmin())return o.jsx(li,{outcome:Kk});function t(n){e.post("admin/projects/setpassword",n).then(()=>Ie({color:"green",message:"Done"})).catch(r=>Ie({color:"red",message:tt(r),autoClose:!1}))}return o.jsxs(at,{width:600,children:[o.jsx(ze,{order:1,children:"Project Admin"}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Force Set Password"}),o.jsx(Le,{children:"Sets the password for the specified user in this project."}),o.jsx(Le,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),o.jsx(gt,{onSubmit:t,children:o.jsxs(nt,{children:[o.jsx(Be,{name:"email",label:"Email",required:!0}),o.jsx(ji,{name:"password",label:"Password",required:!0}),o.jsx(Ee,{type:"submit",children:"Force Set Password"})]})})]})}function Lj(){const e=Pe(),t=ks(e),n=e.get(`admin/projects/${t}`).read();return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Details"}),o.jsxs(Ax,{children:[o.jsx(yo,{term:"ID",children:n.project.id}),o.jsx(yo,{term:"Name",children:n.project.name})]})]})}const $j=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function NQ(){const e=kn(),n=Mo().pathname.replace("/admin/","")||$j[0],r=Pe(),i=ks(r),s=y.useMemo(()=>r.get("admin/projects/"+i).read(),[r,i]);function l(u){e(`/admin/${u}`)}return o.jsxs(o.Fragment,{children:[o.jsxs(Er,{children:[o.jsx(pt,{children:o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Project"}),o.jsx(pt.Value,{children:s.project.name})]})}),o.jsx(oi,{children:o.jsx(At,{value:n.toLowerCase(),onChange:l,children:o.jsx(At.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:$j.map(u=>o.jsx(At.Tab,{value:u.toLowerCase(),children:u},u))})})})]}),o.jsx(at,{children:o.jsx(Zx,{})})]})}function MQ(){const e=Pe(),t=ks(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=y.useState(!1),[s,l]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&l(zr(n.project.secret||[]))},[e,n]),!r||!s?o.jsx("div",{children:"Loading..."}):o.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/secrets`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ie({color:"green",message:"Saved"})).catch(console.log)},children:[o.jsx(ze,{children:"Project Secrets"}),o.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),o.jsx(Zl,{property:Ta("Project","secret"),name:"secret",path:"Project.secret",defaultValue:s,onChange:l,outcome:void 0}),o.jsx(Ee,{type:"submit",children:"Save"})]})}function OQ(){const e=Pe(),t=ks(e),n=e.get(`admin/projects/${t}`).read(),[r,i]=y.useState(!1),[s,l]=y.useState();return y.useEffect(()=>{e.requestSchema("Project").then(()=>i(!0)).catch(console.log)},[e]),y.useEffect(()=>{n&&l(zr(n.project.site||[]))},[e,n]),!r||!s?o.jsx("div",{children:"Loading..."}):o.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:u=>{u.preventDefault(),e.post(`admin/projects/${t}/sites`,s).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>Ie({color:"green",message:"Saved"})).catch(d=>{var h,m,v,x;const p=Vt(d);Ie({color:"red",message:`Error ${(m=(h=p.issue)==null?void 0:h[0].details)==null?void 0:m.text} ${(x=(v=p.issue)==null?void 0:v[0].expression)==null?void 0:x[0]}`,autoClose:!1})})},children:[o.jsx(ze,{children:"Project Sites"}),o.jsx("p",{children:"Use project sites configure your project on a separate domain."}),o.jsx(Zl,{property:Ta("Project","site"),name:"site",path:"Project.site",defaultValue:s,onChange:l,outcome:void 0}),o.jsx(Ee,{type:"submit",children:"Save"})]})}function LQ(){const e=Pe(),[t,{open:n,close:r}]=Yf(!1),[i,s]=y.useState(""),[l,u]=y.useState();if(!e.isLoading()&&!e.isSuperAdmin())return o.jsx(li,{outcome:Kk});function d(){Vc(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){Vc(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function h(){Vc(e,"Rebuilding Value Sets","admin/super/valuesets")}function m(T){Vc(e,"Reindexing Resources","admin/super/reindex",T)}function v(){Vc(e,"Reload Cron Resources","admin/super/reloadcron")}function x(T){e.post("admin/super/removebotidjobsfromqueue",T).then(()=>Ie({color:"green",message:"Done"})).catch(k=>Ie({color:"red",message:tt(k),autoClose:!1}))}function b(T){e.post("admin/super/purge",{...T,before:xP(T.before)}).then(()=>Ie({color:"green",message:"Done"})).catch(k=>Ie({color:"red",message:tt(k),autoClose:!1}))}function w(T){e.post("admin/super/setpassword",T).then(()=>Ie({color:"green",message:"Done"})).catch(k=>Ie({color:"red",message:tt(k),autoClose:!1}))}function j(T){e.post("fhir/R4/$db-stats",T.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:T.tableNames}]}:void 0).then(k=>{var C,_;s("Database Stats"),u(o.jsx("pre",{children:(_=(C=k.parameter)==null?void 0:C.find(R=>R.name==="tableString"))==null?void 0:_.valueString})),n()}).catch(k=>Ie({color:"red",message:tt(k),autoClose:!1}))}function P(){e.post("fhir/R4/$db-schema-diff").then(T=>{var k,C;s("Schema Diff"),u(o.jsx("pre",{children:(C=(k=T.parameter)==null?void 0:k.find(_=>_.name==="migrationString"))==null?void 0:C.valueString})),n()}).catch(T=>Ie({color:"red",message:tt(T),autoClose:!1}))}return o.jsxs(at,{width:600,children:[o.jsx(ze,{order:1,children:"Super Admin"}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Structure Definitions"}),o.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."}),o.jsx(gt,{children:o.jsx(Ee,{onClick:d,children:"Rebuild StructureDefinitions"})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Search Parameters"}),o.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."}),o.jsx(gt,{children:o.jsx(Ee,{onClick:p,children:"Rebuild SearchParameters"})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Value Sets"}),o.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."}),o.jsx(gt,{children:o.jsx(Ee,{onClick:h,children:"Rebuild ValueSets"})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Reindex Resources"}),o.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),o.jsx(gt,{onSubmit:m,children:o.jsxs(nt,{children:[o.jsx(Ht,{title:"Resource Type",htmlFor:"resourceType",children:o.jsx(Be,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),o.jsx(Ht,{title:"Search Filter",htmlFor:"filter",children:o.jsx(Be,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),o.jsx(Ee,{type:"submit",children:"Reindex"})]})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Purge Resources"}),o.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),o.jsx(gt,{onSubmit:b,children:o.jsxs(nt,{children:[o.jsx(Ht,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:o.jsx(en,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),o.jsx(Ht,{title:"Purge Before",htmlFor:"before",children:o.jsx(pa,{name:"before",placeholder:"Before Date"})}),o.jsx(Ee,{type:"submit",children:"Purge"})]})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Remove Bot ID Jobs from Queue"}),o.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),o.jsx(gt,{onSubmit:x,children:o.jsxs(nt,{children:[o.jsx(Ht,{title:"Bot ID",children:o.jsx(Be,{name:"botId",placeholder:"Bot Id"})}),o.jsx(Ee,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Force Set Password"}),o.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.'}),o.jsx(gt,{onSubmit:w,children:o.jsxs(nt,{children:[o.jsx(Be,{name:"email",label:"Email",required:!0}),o.jsx(ji,{name:"password",label:"Password",required:!0}),o.jsx(Be,{name:"projectId",label:"Project ID"}),o.jsx(Ee,{type:"submit",children:"Force Set Password"})]})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Database Stats"}),o.jsx("p",{children:"Query current table statistics from the database."}),o.jsx(gt,{onSubmit:j,children:o.jsxs(nt,{children:[o.jsx(Ht,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:o.jsx(Be,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),o.jsx(Ee,{type:"submit",children:"Get Database Stats"})]})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Database Schema Drift"}),o.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),o.jsx(gt,{onSubmit:P,children:o.jsx(nt,{children:o.jsx(Ee,{type:"submit",children:"Get Database Schema Drift"})})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Reload Cron Resources"}),o.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),o.jsx(gt,{onSubmit:v,children:o.jsx(nt,{children:o.jsx(Ee,{type:"submit",children:"Reload Cron Resources"})})}),o.jsx(Mn,{opened:t,onClose:r,title:i,centered:!0,size:"auto",children:l})]})}function Vc(e,t,n,r){qi.show({id:n,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const i={method:"POST",pollStatusOnAccepted:!0};r&&(i.body=JSON.stringify(r)),e.startAsyncRequest(n,i).then(()=>{qi.update({id:n,color:"green",title:t,message:"Done",icon:o.jsx(Ss,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(s=>{qi.update({id:n,color:"red",title:t,message:tt(s),icon:o.jsx(Nl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function $Q(){return o.jsxs(o.Fragment,{children:[o.jsx(ze,{children:"Users"}),o.jsx(Jp,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),o.jsx(be,{justify:"flex-end",children:o.jsx(xt,{to:"/admin/invite",children:"Invite new user"})})]})}function FQ(){const[e]=Al("ObservationDefinition","_count=100");return e?o.jsxs(Ae,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Code"}),o.jsx("th",{children:"Method"}),o.jsx("th",{children:"Unit"}),o.jsx("th",{children:"Precision"}),o.jsx("th",{children:"Ranges"})]})}),o.jsx("tbody",{children:e.map(t=>{var n,r,i,s;return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(Qi,{value:(n=t.category)==null?void 0:n[0]})}),o.jsx("td",{children:o.jsx(Qi,{value:t.code})}),o.jsx("td",{children:o.jsx(Qi,{value:t.method})}),o.jsx("td",{children:(i=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:i.text}),o.jsx("td",{children:(s=t.quantitativeDetails)==null?void 0:s.decimalPrecision}),o.jsx("td",{children:o.jsx(gy,{ranges:t.qualifiedInterval})})]},t.id)})})]}):o.jsx(ri,{})}function gy(e){const{ranges:t}=e;if(!t)return null;const n=Fj(t.map(i=>i.gender));if(n.length>1)return iu(n),o.jsx(o.Fragment,{children:n.map(i=>{var s;return o.jsxs(y.Fragment,{children:[o.jsx("div",{children:o.jsx("strong",{children:$n(i)})}),o.jsx(gy,{ranges:(s=e.ranges)==null?void 0:s.filter(l=>l.gender===i)})]},i)})});const r=Fj(t.map(i=>i.age&&su(i.age)));return r.length>1?(iu(r),o.jsx(o.Fragment,{children:r.map(i=>{var s;return o.jsxs(y.Fragment,{children:[o.jsx("div",{children:o.jsx("strong",{children:$n(i)})}),o.jsx(gy,{ranges:(s=e.ranges)==null?void 0:s.filter(l=>su(l.age)===i)})]},i)})})):o.jsx(o.Fragment,{children:t.map(i=>o.jsx("table",{children:o.jsx("tbody",{children:o.jsxs("tr",{children:[o.jsx("td",{children:i.condition}),o.jsx("td",{children:o.jsx(Ox,{value:i.range})})]})})},`range-${i.condition}`))})}function Fj(e){return[...new Set(e.filter(t=>!!t))]}function zQ(){const[e]=Al("ActivityDefinition","_count=100"),[t]=Al("ObservationDefinition","_count=100");return!e||!t?o.jsx(ri,{}):o.jsxs(Ae,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[o.jsx("thead",{children:o.jsxs("tr",{children:[o.jsx("th",{children:"Category"}),o.jsx("th",{children:"Assay"}),e.map(n=>o.jsx("th",{children:n.name},n.id))]})}),o.jsx("tbody",{children:t.map(n=>{var r;return o.jsxs("tr",{children:[o.jsx("td",{children:o.jsx(Qi,{value:(r=n.category)==null?void 0:r[0]})}),o.jsx("td",{children:o.jsx(Qi,{value:n.code})}),e.map(i=>{var s;return o.jsx("td",{children:(s=i.observationResultRequirement)!=null&&s.find(l=>{var u;return(u=l.reference)==null?void 0:u.includes(n.id)})?"✅":""},i.id)})]},n.id)})})]})}function BQ(e){var l;const t=Pe(),[n,r]=y.useState(),[i,s]=y.useState();return i?o.jsxs(o.Fragment,{children:[o.jsx("p",{children:"Request group created successfully."}),o.jsxs("ul",{children:[o.jsxs("li",{children:["Go to the"," ",o.jsx(xt,{to:i,suffix:"checklist",children:"Request Group"})]}),o.jsxs("li",{children:["Back to the ",o.jsx(xt,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):o.jsx(gt,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(s).catch(console.log)},children:o.jsxs(nt,{children:[o.jsxs(ze,{children:['Start "',e.planDefinition.title,'"']}),o.jsxs(Le,{children:["Use the ",o.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),o.jsx(Le,{children:"The following tasks will be created:"}),o.jsx("ul",{children:(l=e.planDefinition.action)==null?void 0:l.map((u,d)=>{var p;return o.jsxs("li",{children:[((p=u.definitionCanonical)==null?void 0:p.startsWith("Questionnaire/"))&&"Questionnaire request: ",u.title&&o.jsx(o.Fragment,{children:u.title}),u.code&&o.jsx(Qi,{value:u.code[0]})]},`action-${d}`)})}),o.jsx(Ht,{title:"Subject",children:o.jsx(Up,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"Go"})})]})})}function UQ(){const{resourceType:e,id:t}=zt(),n=Yt({reference:e+"/"+t});return n?o.jsx(at,{children:o.jsx(BQ,{planDefinition:n})}):null}function VQ(){const{resourceType:e,id:t}=zt(),n=Yt({reference:e+"/"+t}),[r,i]=Al("Questionnaire","subject-type="+e),[s,l]=Al("ClientApplication",{_count:1e3});if(!n||i||l)return o.jsx(ri,{});const u=s==null?void 0:s.filter(h=>WQ(e)&&!!h.launchUri);if((!r||r.length===0)&&(!u||u.length===0))return o.jsxs(at,{children:[o.jsx(ze,{children:"Apps"}),o.jsxs("p",{children:["No apps found. Contact your administrator or ",o.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let d,p;return n.resourceType==="Patient"?d=Zt(n):n.resourceType==="Encounter"&&(d=n.subject,p=Zt(n)),o.jsxs(at,{children:[r==null?void 0:r.map(h=>o.jsxs("div",{children:[o.jsx(ze,{order:3,children:o.jsx(xt,{to:`/forms/${h.id}?subject=${Ft(n)}`,children:h.title||h.name})}),o.jsx(Le,{children:h.description})]},h.id)),u==null?void 0:u.map(h=>o.jsxs("div",{children:[o.jsx(ze,{order:3,children:o.jsx(bH,{client:h,patient:d,encounter:p,children:h.name})}),o.jsx(Le,{children:h.description})]},h.id))]})}function WQ(e){return e==="Patient"||e==="Encounter"}function HQ(){const{resourceType:e,id:t}=zt(),n=kn(),[r,i]=y.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:Se.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return o.jsx(at,{children:o.jsx($u,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`),onChange:s=>i(s.definition),hideFilters:!0})})}function qQ(){const e=Pe(),{resourceType:t,id:n}=zt(),r=e.readHistory(t,n).read();return o.jsx(at,{children:o.jsx(cH,{history:r})})}const GQ="_hl7Input_k5xm3_1",QQ={hl7Input:GQ};function KQ(e){return o.jsx("iframe",{frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function YQ(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),o.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Gc(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const XQ=`{
577
- "resourceType": "Patient",
578
- "name": [
579
- {
580
- "given": [
581
- "Alice"
582
- ],
583
- "family": "Smith"
584
- }
585
- ]
586
- }`,JQ="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 ZQ(){const e=Pe(),{id:t}=zt(),[n,r]=y.useState(),[i,s]=y.useState(),[l,u]=y.useState(XQ),[d,p]=y.useState(JQ),[h,m]=y.useState(Cn.FHIR_JSON),v=y.useRef(null),x=y.useRef(null),[b,w]=y.useState(!1);y.useEffect(()=>{e.readResource("Bot",t).then(async R=>{r(R),s(await eK(e,R))}).catch(R=>Ie({color:"red",message:tt(R),autoClose:!1}))},[e,t]);const j=y.useCallback(async()=>Gc(v.current,{command:"getValue"}),[]),P=y.useCallback(async()=>Gc(v.current,{command:"getOutput"}),[]),T=y.useCallback(async()=>h===Cn.FHIR_JSON?JSON.parse(l):d,[h,l,d]),k=y.useCallback(async R=>{R.preventDefault(),R.stopPropagation(),w(!0);try{const M=await j(),N=await P(),L=await e.createAttachment(M,"index.ts","text/typescript"),z=await e.createAttachment(N,"index.js","text/typescript"),G=[{op:"add",path:"/sourceCode",value:L},{op:"add",path:"/executableCode",value:z}];await e.patchResource("Bot",t,G),Ie({color:"green",message:"Saved"})}catch(M){Ie({color:"red",message:tt(M),autoClose:!1})}finally{w(!1)}},[e,t,j,P]),C=y.useCallback(async R=>{R.preventDefault(),R.stopPropagation(),w(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),Ie({color:"green",message:"Deployed"})}catch(M){Ie({color:"red",message:tt(M),autoClose:!1})}finally{w(!1)}},[e,t]),_=y.useCallback(async R=>{R.preventDefault(),R.stopPropagation(),w(!0);try{const M=await T(),N=await e.post(e.fhirUrl("Bot",t,"$execute"),M,h);await Gc(x.current,{command:"setValue",value:N}),Ie({color:"green",message:"Success"})}catch(M){Ie({color:"red",message:tt(M),autoClose:!1})}finally{w(!1)}},[e,t,T,h]);return!n||i===void 0?null:o.jsxs($r,{m:0,gutter:0,style:{overflow:"hidden"},children:[o.jsx($r.Col,{span:8,children:o.jsxs(Er,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[o.jsx(YQ,{iframeRef:v,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:i,minHeight:"528px"}),o.jsxs(be,{justify:"flex-end",gap:"xs",children:[o.jsx(Ee,{type:"button",onClick:k,loading:b,leftSection:o.jsx(KF,{size:"1rem"}),children:"Save"}),o.jsx(Ee,{type:"button",onClick:C,loading:b,leftSection:o.jsx(Ex,{size:"1rem"}),children:"Deploy"}),o.jsx(Ee,{type:"button",onClick:_,loading:b,leftSection:o.jsx(c8,{size:"1rem"}),children:"Execute"})]})]})}),o.jsxs($r.Col,{span:4,children:[o.jsxs(Er,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[o.jsx(en,{data:[{label:"FHIR",value:Cn.FHIR_JSON},{label:"HL7",value:Cn.HL7_V2}],onChange:R=>m(R.currentTarget.value)}),h===Cn.FHIR_JSON?o.jsx(Wl,{value:l,onChange:R=>u(R),autosize:!0,minRows:15}):o.jsx("textarea",{className:QQ.hl7Input,value:d,onChange:R=>p(R.currentTarget.value),rows:15})]}),o.jsx(Er,{m:2,p:"xs",shadow:"md",children:o.jsx(KQ,{iframeRef:x,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function eK(e,t){var n,r,i;if((n=t.sourceCode)!=null&&n.url){const s=(i=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:i.find(uT);return(await e.download(e.fhirUrl("Binary",s))).text()}return t.code??""}function Da(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function tK(){const e=Pe(),{resourceType:t,id:n}=zt(),r={reference:t+"/"+n},i=y.useCallback(s=>{e.updateResource(Da(s)).then(()=>{Ie({color:"green",message:"Success"})}).catch(l=>{Ie({color:"red",message:tt(l),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return o.jsx(at,{children:o.jsx(MV,{value:r,onSubmit:i})});case"Questionnaire":return o.jsx(at,{children:o.jsx(wW,{questionnaire:r,onSubmit:i})});default:return null}}function nK(){const{resourceType:e,id:t}=zt(),n=Yt({reference:e+"/"+t}),r=kn();return n?o.jsx(at,{children:o.jsx(HW,{value:n,onStart:(i,s)=>r(`/forms/${Dl(s)}`),onEdit:(i,s,l)=>r(`/${l.reference}}`)})}):null}function rK(){const e=Pe(),{resourceType:t,id:n}=zt(),r=kn();return o.jsxs(at,{children:[o.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),o.jsx(Ee,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(i=>Ie({color:"red",message:tt(i),autoClose:!1}))},children:"Delete"})]})}const iK="_selectProfileBtn_tbaz6_1",oK="_chevron_tbaz6_13",zj={selectProfileBtn:iK,chevron:oK};function sK(){var d,p;const{resourceType:e,id:t}=zt(),n=Yt({reference:e+"/"+t}),[r,i]=y.useState(),s=vu({onDropdownClose:()=>s.resetSelectedOption()}),l=y.useMemo(()=>{var h;if(bn((h=n==null?void 0:n.meta)==null?void 0:h.profile))return[o.jsx(lt.Option,{value:"",children:"None"},""),...n.meta.profile.map(m=>o.jsx(lt.Option,{value:m,children:m},m))]},[(d=n==null?void 0:n.meta)==null?void 0:d.profile]);if(y.useEffect(()=>{var h,m;((m=(h=n==null?void 0:n.meta)==null?void 0:h.profile)==null?void 0:m.length)===1&&i(n.meta.profile[0])},[(p=n==null?void 0:n.meta)==null?void 0:p.profile]),!n)return null;let u;return bn(l)&&(u=o.jsx(be,{justify:"flex-end",children:o.jsxs(nt,{align:"flex-end",gap:"xs",children:[o.jsxs(lt,{store:s,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:h=>{i(h),s.closeDropdown()},children:[o.jsx(lt.Target,{children:o.jsx(Qn,{onClick:()=>s.toggleDropdown(),children:o.jsxs(bv,{fw:"bold",fs:"sm",className:zj.selectProfileBtn,children:[o.jsx("span",{children:"Pick profile"}),o.jsx(Cx,{stroke:1.5,className:zj.chevron})]})})}),o.jsx(lt.Dropdown,{w:"max-content",children:o.jsx(lt.Options,{children:l})})]}),o.jsx(se,{children:r?o.jsxs(o.Fragment,{children:[o.jsx(Le,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),o.jsx(Le,{span:!0,size:"sm",children:r||"Nothing selected"})]}):o.jsx(Le,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),o.jsx(at,{children:o.jsxs(nt,{gap:"xl",children:[u,o.jsx(Vx,{value:n,profileUrl:r})]})})}function aK(){const e=Pe(),{resourceType:t,id:n}=zt(),[r,i]=y.useState(),[s,l]=y.useState(),u=kn(),[d,p]=y.useState();y.useEffect(()=>{e.readResource(t,n).then(x=>{i(zr(x)),l(zr(x))}).catch(x=>{p(Vt(x)),Ie({color:"red",message:tt(x),autoClose:!1})})},[e,t,n]);const h=y.useCallback(x=>{p(void 0),e.updateResource(Da(x)).then(()=>{u(`/${t}/${n}/details`),Ie({id:"succes",color:"green",message:"Success"})}).catch(b=>{p(Vt(b)),Ie({color:"red",message:tt(b),autoClose:!1})})},[e,t,n,u]),m=y.useCallback(x=>{p(void 0);const b=PP.createPatch(r,x);e.patchResource(t,n,b).then(()=>{u(`/${t}/${n}/details`),Ie({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(Vt(w)),Ie({color:"red",message:tt(w),autoClose:!1})})},[e,t,n,r,u]),v=y.useCallback(()=>u(`/${t}/${n}/delete`),[u,t,n]);return s?o.jsx(at,{children:o.jsx(Ff,{defaultValue:s,onSubmit:h,onPatch:m,onDelete:v,outcome:d})}):null}function LR({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,i=Pe(),[s,l]=y.useState();return y.useEffect(()=>{i.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(u=>{l(u.filter(iB))}).catch(console.error)},[i,n,r]),o.jsx(At,{value:t==null?void 0:t.url,onChange:u=>{const d=s==null?void 0:s.find(p=>p.url===u);d&&n(d)},children:o.jsx(At.List,{children:s==null?void 0:s.map(u=>{var h,m;const d=(m=(h=e.meta)==null?void 0:h.profile)==null?void 0:m.includes(u.url),p=d?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return o.jsx(At.Tab,{value:u.url,title:p,rightSection:d&&o.jsx(nx,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:o.jsx(j8,{size:"90%"})}),children:u.title||u.name},u.url)})})})}function $R(e,t){const n=Pe(),r=kn();return{defaultValue:{resourceType:e},handleSubmit:l=>{t&&t(void 0),n.createResource(l).then(u=>r("/"+u.resourceType+"/"+u.id)).catch(u=>{t&&t(Vt(u)),Ie({color:"red",message:tt(u),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Cg(){const{resourceType:e}=zt(),t=Mo(),[n,r]=y.useState(),{defaultValue:i,handleSubmit:s}=$R(e,r),[l,u]=y.useState(),d=t.pathname.toLowerCase().endsWith("profiles"),p=y.useCallback(h=>{const m=Da(h);l&&mT(m,l.url),s(m)},[l,s]);return d?o.jsx(at,{children:o.jsxs(nt,{children:[o.jsx(LR,{resource:i,currentProfile:l,onChange:u}),l?o.jsx(Ff,{defaultValue:i,onSubmit:p,outcome:n,profileUrl:l.url},l.url):o.jsx(Le,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):o.jsx(at,{children:o.jsx(Ff,{defaultValue:i,onSubmit:s,outcome:n})})}function lK(){const e=Pe(),{resourceType:t,id:n}=zt(),r=e.readHistory(t,n).read();return o.jsx(at,{children:o.jsx(gH,{history:r})})}function cK(){const{resourceType:e}=zt(),[t,n]=y.useState(),{defaultValue:r,handleSubmit:i}=$R(e,n),s=y.useCallback(l=>{i(JSON.parse(l["new-resource"]))},[i]);return o.jsxs(at,{children:[t&&o.jsx(li,{outcome:t}),o.jsxs(gt,{onSubmit:s,children:[o.jsx(Wl,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:ki(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),o.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ee,{type:"submit",children:"OK"})})]})]})}function uK(){const e=Pe(),{resourceType:t,id:n}=zt(),r=Yt({reference:t+"/"+n}),i=kn(),[s,l]=y.useState(),u=y.useCallback(d=>{e.updateResource(Da(JSON.parse(d.resource))).then(()=>{l(void 0),i(`/${t}/${n}/details`),Ie({color:"green",message:"Success"})}).catch(p=>{Ie({color:"red",message:tt(p),autoClose:!1})})},[e,t,n,i]);return r?o.jsxs(at,{children:[s&&o.jsx(li,{outcome:s}),o.jsxs(gt,{onSubmit:u,children:[o.jsx(Wl,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:ki(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),o.jsx(be,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:o.jsx(Ee,{type:"submit",children:"OK"})})]})]}):null}function dK(){const{resourceType:e,id:t}=zt();return Yt({reference:e+"/"+t})?o.jsxs(at,{children:[o.jsxs(xs,{icon:o.jsx(Jl,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",o.jsx("br",{}),o.jsx(Rt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),o.jsx(nR,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function fK(){const e=Pe(),{resourceType:t,id:n}=zt(),[r,i]=y.useState(),[s,l]=y.useState();return y.useEffect(()=>{e.readResource(t,n).then(u=>i(zr(u))).catch(u=>{Ie({color:"red",message:tt(u)})})},[e,t,n]),r?o.jsxs(at,{children:[o.jsxs(ze,{order:2,children:["Available ",t," profiles"]}),o.jsx(nt,{children:o.jsxs(o.Fragment,{children:[o.jsx(LR,{resource:r,currentProfile:s,onChange:l}),s?o.jsx(pK,{profile:s,resource:r,onResourceUpdated:u=>i(u)},s.url):o.jsx(Le,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const pK=({profile:e,resource:t,onResourceUpdated:n})=>{const r=Pe(),[i,s]=y.useState(),[l,u]=y.useState(()=>{var p,h;return(h=(p=t.meta)==null?void 0:p.profile)==null?void 0:h.includes(e.url)}),d=y.useCallback(p=>{s(void 0);const h=Da(p);l?mT(h,e.url):i$(h,e.url),r.updateResource(h).then(m=>{n(m),Ie({color:"green",message:"Success"})}).catch(m=>{s(Vt(m)),Ie({color:"red",message:tt(m),autoClose:!1})})},[r,e.url,n,l]);return o.jsxs(nt,{children:[o.jsx(Eu,{size:"md",checked:l,label:`Conform resource to ${e.title}`,onChange:p=>u(p.currentTarget.checked),"data-testid":"profile-toggle"}),l?o.jsx(Ff,{profileUrl:e.url,defaultValue:t,onSubmit:d,outcome:i}):o.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),d(t)},children:o.jsx(be,{justify:"flex-end",mt:"xl",children:o.jsx(Ee,{type:"submit",children:"OK"})})})]})},FR={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},hK=Object.keys(FR);function mK(){const e=Pe(),{id:t}=zt(),[n,r]=y.useState(),[i,s]=y.useState("create"),[l,u]=y.useState(0),d=e.searchResources("Subscription","status=active&_count=100").read().filter(h=>gK(h,t));function p(){n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${n.name} to questionnaire responses`,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:Ft(n)},...i?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:i}]}:void 0}).then(()=>{r(void 0),u(Date.now()),e.invalidateSearches("Subscription"),Ie({color:"green",message:"Success"})}).catch(h=>Ie({color:"red",message:tt(h),autoClose:!1}))}return o.jsxs(at,{children:[o.jsx(ze,{children:"Bots"}),o.jsxs(nt,{children:[d.length===0&&o.jsx("p",{children:"No bots found."}),d.map(h=>{var m;return o.jsxs("div",{children:[o.jsx("h3",{children:o.jsx(ec,{value:{reference:(m=h.channel)==null?void 0:m.endpoint},link:!0})}),o.jsxs("p",{children:["Criteria: ",h.criteria]})]},h.id)})]}),o.jsx(_n,{}),o.jsxs(nt,{mt:10,children:[o.jsx(hu,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),o.jsxs(be,{children:[o.jsx(Ra,{name:"bot",resourceType:"Bot",onChange:h=>r(h)}),o.jsx(Ee,{onClick:p,children:"Connect"})]}),o.jsx(be,{children:o.jsx(en,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:hK,onChange:h=>s(FR[h.target.value])})})]}),o.jsx("div",{style:{display:"none"},children:l})]})}function gK(e,t){var i;const n=e.criteria||"",r=((i=e.channel)==null?void 0:i.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&n.includes(t)&&r.startsWith("Bot/")}function yK(){const{id:e}=zt(),t=kn(),[n,r]=y.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:Se.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return o.jsx(at,{children:o.jsx($u,{search:n,onClick:i=>t(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>r(i.definition),hideFilters:!0,hideToolbar:!0})})}function vK(){const e=Pe(),{resourceType:t,id:n}=zt(),r=Yt({reference:t+"/"+n}),i=y.useCallback(s=>{e.updateResource(Da(s)).then(()=>{Ie({color:"green",message:"Success"})}).catch(l=>{Ie({color:"red",message:tt(l),autoClose:!1})})},[e]);return r?o.jsx(at,{children:o.jsx(LW,{onSubmit:i,definition:r})}):null}function xK(){const{resourceType:e,id:t}=zt(),n=Yt({reference:e+"/"+t});return n?o.jsx(at,{children:e==="MeasureReport"?o.jsx(RV,{measureReport:n}):o.jsx(Ux,{value:n})}):null}const bK="_container_1ue98_1",wK="_entry_1ue98_14",SK="_active_1ue98_21",Eg={container:bK,entry:wK,active:SK};function jK(e){const t=Pe(),n=Yt(e.value),[r,i]=y.useState();return y.useEffect(()=>{if(!n)return;const s=ib(n);if(!s)return;const l="reference"in s?s.reference:Ft(s);t.search("ServiceRequest","subject="+l).then(u=>{const p=(u.entry??[]).map(h=>h.resource);RP(p),p.reverse(),i(p)}).catch(u=>Ie({color:"red",message:tt(u),autoClose:!1}))},[t,n]),r?o.jsx("div",{"data-testid":"quick-service-requests",className:Eg.container,children:r.map(s=>{var l,u,d,p,h,m,v;return o.jsxs("div",{className:Nt(Eg.entry,{[Eg.active]:s.id===(n==null?void 0:n.id)}),children:[o.jsx("p",{children:o.jsx(xt,{to:s,children:CK(s)})}),((u=(l=s.category)==null?void 0:l[0])==null?void 0:u.text)&&o.jsx("p",{children:(d=s.category[0])==null?void 0:d.text}),((m=(h=(p=s.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&o.jsx("p",{children:(v=s.code.coding[0])==null?void 0:v.code}),o.jsx("p",{children:EK(s)})]},s.id)})}):null}function CK(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function EK(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const kK="_container_1l2dh_1",TK={container:kK};function PK(e){var i,s,l,u;const t=Yt(e.valueSet);if(!t)return null;const n=[""],r=(u=(l=(s=(i=t.compose)==null?void 0:i.include)==null?void 0:s[0])==null?void 0:l.concept)==null?void 0:u.map(d=>d.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),o.jsx("div",{className:TK.container,children:o.jsx(en,{defaultValue:e.defaultValue,onChange:d=>e.onChange(d.currentTarget.value),data:n})})}function RK(e){var n,r;const t=Yt(e.specimen);return t?o.jsxs(pt,{children:[o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Type"}),o.jsx(pt.Value,{children:"Specimen"})]}),o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Collected"}),o.jsx(pt.Value,{children:fr((n=t.collection)==null?void 0:n.collectedDateTime)})]}),o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Specimen Age"}),o.jsx(pt.Value,{children:_K(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?o.jsxs(pt.Entry,{children:[o.jsx(pt.Key,{children:"Specimen Stability"}),o.jsx(pt.Value,{children:DK(t)})]}):o.jsx(o.Fragment,{})]}):null}function _K(e){var i;const t=(i=e.collection)==null?void 0:i.collectedDateTime;if(!t)return;const n=new Date(t);return zR(BR(n,new Date))}function DK(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return zR(BR(t,n))}function zR(e){return e.toString().padStart(3,"0")+"D"}function BR(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function IK(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),t}const AK=[];function NK(){var k,C,_,R,M,N,L;const e=Pe(),{resourceType:t,id:n}=zt(),r={reference:t+"/"+n},i=kn(),[s,l]=y.useState(),u=Yt(r,l),d=IK(t),[p,h]=y.useState(()=>{const z=window.location.pathname.split("/").pop();return z&&d.map(G=>G.toLowerCase()).includes(z)?z:d[0].toLowerCase()}),m=dn();async function v(){var q,Y;const G=(Y=(q=(await e.readHistory(t,n)).entry)==null?void 0:q.find(Q=>!!Q.resource))==null?void 0:Y.resource;G?x(G):Ie({color:"red",message:"No history to restore",autoClose:!1})}function x(z){e.updateResource(Da(z)).then(()=>{l(void 0),Ie({color:"green",message:"Success"})}).catch(G=>{Ie({color:"red",message:tt(G),autoClose:!1})})}if(s)return pL(s)?o.jsxs(at,{children:[o.jsx(ze,{children:"Deleted"}),o.jsx("p",{children:"The resource was deleted."}),o.jsx(Ee,{color:"red",onClick:v,children:"Restore"})]}):o.jsx(li,{outcome:s});function b(z){z||(z=d[0].toLowerCase()),h(z),i(`/${t}/${n}/${z}`)}function w(z){const G=u,q=G.orderDetail||[];q.length===0&&q.push({}),q[0].text!==z&&(q[0].text=z,x({...G,orderDetail:q}))}const j=u&&ib(u),P=u&&iQ(u),T=(_=(C=(k=e.getUserConfiguration())==null?void 0:k.option)==null?void 0:C.find(z=>z.id==="statusValueSet"))==null?void 0:_.valueString;return o.jsxs(o.Fragment,{children:[(u==null?void 0:u.resourceType)==="ServiceRequest"&&T&&o.jsx(PK,{valueSet:{reference:T},defaultValue:(M=(R=u.orderDetail)==null?void 0:R[0])==null?void 0:M.text,onChange:w},Ft(u)+"-"+((L=(N=u.orderDetail)==null?void 0:N[0])==null?void 0:L.text)),u&&o.jsx(jK,{value:u}),u&&o.jsxs(Er,{children:[j&&o.jsx(IR,{patient:j}),P&&o.jsx(RK,{specimen:P}),t!=="Patient"&&o.jsx(AR,{resource:r}),o.jsx(oi,{children:o.jsx(At,{value:p.toLowerCase(),onChange:b,children:o.jsx(At.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:d.map(z=>o.jsx(At.Tab,{value:z.toLowerCase(),children:AK.includes(z)?o.jsxs(be,{gap:"xs",wrap:"nowrap",children:[z,o.jsx(xu,{color:m.primaryColor,size:"sm",children:"Beta"})]}):z},z))})})})]}),o.jsx(Zx,{})]})}function Bj(){var P,T,k,C;const e=kn(),{resourceType:t,id:n,versionId:r,tab:i}=zt(),s=Pe(),[l,u]=y.useState(!0),[d,p]=y.useState(),[h,m]=y.useState();if(y.useEffect(()=>{m(void 0),u(!0),s.readHistory(t,n).then(_=>p(_)).then(()=>u(!1)).catch(_=>{m(_),u(!1)})},[s,t,n]),l)return o.jsx(ri,{});if(!d)return o.jsxs(at,{children:[o.jsx(ze,{children:"Resource not found"}),o.jsx(xt,{to:`/${t}`,children:"Return to search page"})]});const v=d.entry??[],x=v.findIndex(_=>{var R,M;return((M=(R=_.resource)==null?void 0:R.meta)==null?void 0:M.versionId)===r});if(x===-1)return o.jsxs(at,{children:[o.jsx(ze,{children:"Version not found"}),o.jsx(xt,{to:`/${t}/${n}`,children:"Return to resource"})]});const b=v[x].resource,w=x<v.length-1?v[x+1].resource:void 0,j="diff";return o.jsxs(At,{value:i||j,onChange:_=>e(`/${t}/${n}/_history/${r}/${_||j}`),children:[o.jsxs(Er,{children:[o.jsx(Nu,{fluid:!0,p:"md",children:o.jsx(Le,{children:`${t} ${n}`})}),o.jsxs(At.List,{children:[o.jsx(At.Tab,{value:"diff",children:"Diff"}),o.jsx(At.Tab,{value:"raw",children:"Raw"})]})]}),o.jsxs(at,{children:[h&&o.jsx("pre",{"data-testid":"error",children:JSON.stringify(h,void 0,2)}),o.jsx(At.Panel,{value:"diff",children:w?o.jsxs(o.Fragment,{children:[o.jsxs("ul",{children:[o.jsxs("li",{children:["Current: ",(P=b.meta)==null?void 0:P.versionId]}),o.jsxs("li",{children:["Previous:"," ",o.jsx(xt,{to:`/${t}/${n}/_history/${(T=w.meta)==null?void 0:T.versionId}`,children:(k=w.meta)==null?void 0:k.versionId})]})]}),o.jsx(fH,{original:w,revised:b})]}):o.jsxs(o.Fragment,{children:[o.jsxs("ul",{children:[o.jsxs("li",{children:["Current: ",(C=b.meta)==null?void 0:C.versionId]}),o.jsx("li",{children:"Previous: (none)"})]}),o.jsx("pre",{children:JSON.stringify(b,void 0,2)})]})}),o.jsx(At.Panel,{value:"raw",children:o.jsx("pre",{children:JSON.stringify(b,void 0,2)})})]})]})}function MK(){const{resourceType:e,id:t}=zt(),n=kn(),[r,i]=y.useState({resourceType:"Subscription",filters:[{code:"url",operator:Se.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return o.jsx(at,{children:o.jsx(yV,{search:r,onClick:s=>n(`/${s.resource.resourceType}/${s.resource.id}`),onChange:s=>i(s.definition),hideFilters:!0})})}function OK(e){const t=Pe(),{resource:n,opened:r,onClose:i}=e,[s,l]=y.useState(!1),[u,d]=y.useState(),[p,h]=y.useState(!1),m=y.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:s&&u?Ft(u):void 0,verbose:p}),Ie({color:"green",message:"Done"}),i()}catch(v){Ie({color:"red",message:tt(v),autoClose:!1})}},[t,n,i,s,u,p]);return o.jsx(Mn,{opened:r,onClose:i,title:"Resend Subscriptions",children:o.jsx(gt,{onSubmit:m,children:o.jsxs(nt,{children:[o.jsx(Kn,{label:"Choose subscription (all subscriptions by default)",onChange:v=>l(v.currentTarget.checked)}),s&&o.jsx(Ra,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:d}),o.jsx(Kn,{label:"Verbose mode",onChange:v=>h(v.currentTarget.checked)}),o.jsx(be,{justify:"flex-end",children:o.jsx(Ee,{type:"submit",children:"Resend"})})]})})})}function Uj(){const e=Pe(),t=Fp(),{resourceType:n,id:r}=zt(),i={reference:n+"/"+r},[s,l]=y.useState(),u=Yf(!1);function d(T,k){return e.updateResource({...T,priority:k})}function p(T,k){d(T,"stat").then(k).catch(console.error)}function h(T,k){d(T,"routine").then(k).catch(console.error)}function m(T){t(`/${T.resourceType}/${T.id}`)}function v(T){t(`/${T.resourceType}/${T.id}/edit`)}function x(T){t(`/${T.resourceType}/${T.id}/delete`)}function b(T){l(T),u[1].open()}function w(T){var k;t(`/${T.resourceType}/${T.id}/_history/${(k=T.meta)==null?void 0:k.versionId}`)}function j(T,k){const C="aws-textract";Ie({id:C,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(T.resourceType,T.id,"$aws-textract"),{}).then(()=>{k(),ta({id:C,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:o.jsx(Ss,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(_=>ta({id:C,title:"AWS Textract Error",color:"red",message:tt(_),icon:o.jsx(Nl,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function P(T){var V;const{primaryResource:k,currentResource:C,reloadTimeline:_}=T,R=C.resourceType===k.resourceType&&C.id===k.id,M=C.resourceType==="Communication"&&C.priority!=="stat",N=C.resourceType==="Communication"&&C.priority==="stat",L=R,z=!R,G=!R,q=!R,Y=(V=e.getProjectMembership())==null?void 0:V.admin,Q=Y,ne=yQ()&&(C.resourceType==="DocumentReference"||C.resourceType==="Media");return o.jsxs(ye.Dropdown,{children:[o.jsx(ye.Label,{children:"Resource"}),M&&o.jsx(ye.Item,{leftSection:o.jsx(a8,{size:14}),onClick:()=>p(C,_),"aria-label":`Pin ${Ft(C)}`,children:"Pin"}),N&&o.jsx(ye.Item,{leftSection:o.jsx(l8,{size:14}),onClick:()=>h(C,_),"aria-label":`Unpin ${Ft(C)}`,children:"Unpin"}),z&&o.jsx(ye.Item,{leftSection:o.jsx(_S,{size:14}),onClick:()=>m(C),"aria-label":`Details ${Ft(C)}`,children:"Details"}),L&&o.jsx(ye.Item,{leftSection:o.jsx(_S,{size:14}),onClick:()=>w(C),"aria-label":`Details ${Ft(C)}`,children:"Details"}),G&&o.jsx(ye.Item,{leftSection:o.jsx(qT,{size:14}),onClick:()=>v(C),"aria-label":`Edit ${Ft(C)}`,children:"Edit"}),Y&&o.jsxs(o.Fragment,{children:[o.jsx(ye.Divider,{}),o.jsx(ye.Label,{children:"Admin"}),Q&&o.jsx(ye.Item,{leftSection:o.jsx(p8,{size:14}),onClick:()=>b(C),"aria-label":`Resend Subscriptions ${Ft(C)}`,children:"Resend Subscriptions"})]}),ne&&o.jsxs(o.Fragment,{children:[o.jsx(ye.Divider,{}),o.jsx(ye.Label,{children:"AWS AI"}),o.jsx(ye.Item,{leftSection:o.jsx(w8,{size:14}),onClick:()=>j(C,_),"aria-label":`AWS Textract ${Ft(C)}`,children:"AWS Textract"})]}),q&&o.jsxs(o.Fragment,{children:[o.jsx(ye.Divider,{}),o.jsx(ye.Label,{children:"Danger zone"}),o.jsx(ye.Item,{color:"red",leftSection:o.jsx(Px,{size:14}),onClick:()=>x(C),"aria-label":`Delete ${Ft(C)}`,children:"Delete"})]})]})}return o.jsxs(o.Fragment,{children:[n==="Encounter"&&o.jsx(kU,{encounter:i,getMenu:P}),n==="Patient"&&o.jsx(_V,{patient:i,getMenu:P}),n==="ServiceRequest"&&o.jsx(xH,{serviceRequest:i,getMenu:P}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&o.jsx(EU,{resource:i,getMenu:P}),o.jsx(OK,{resource:s,opened:u[0],onClose:u[1].close},`resend-subscriptions-${s==null?void 0:s.id}`)]})}function LK(e){const{opened:t,close:n,version:r,loadingStatus:i,handleStatus:s,handleUpgrade:l}=e,[u,d]=y.useState();return y.useEffect(()=>{t&&(u||wF("app-tools-page").then(d).catch(console.error),s())},[t,u,s]),u&&r&&!i?r==="unknown"?o.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(u)?o.jsxs("p",{children:["This agent is already on the latest version (",u,")."]}):o.jsxs(o.Fragment,{children:[o.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",u,"?"]}),o.jsx(Ee,{onClick:()=>{l(),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"})]}):o.jsx(ri,{})}function $K(){const e=Pe(),{id:t}=zt(),n=y.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,i]=y.useState(!1),[s,l]=y.useState(!1),[u,d]=y.useState(!1),[p,h]=y.useState(),[m,v]=y.useState(),[x,b]=y.useState(),[w,j]=y.useState(),[P,T]=y.useState(!1),[k,C]=y.useState(!1),[_,{open:R,close:M}]=Yf(!1);y.useEffect(()=>{if(r||s||u||P){C(!0);return}C(!1)},[r,s,u,P]);const N=y.useCallback(()=>{i(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(Q=>{var ne,V,O,A,B,I;h((V=(ne=Q.parameter)==null?void 0:ne.find(F=>F.name==="status"))==null?void 0:V.valueCode),v((A=(O=Q.parameter)==null?void 0:O.find(F=>F.name==="version"))==null?void 0:A.valueString),b((I=(B=Q.parameter)==null?void 0:B.find(F=>F.name==="lastUpdated"))==null?void 0:I.valueInstant)}).catch(Q=>Y(tt(Q))).finally(()=>i(!1))},[e,t]),L=y.useCallback(Q=>{const ne=Q.host,V=Q.pingCount||1;ne&&(T(!0),e.pushToAgent(n,ne,`PING ${V}`,Cn.PING,!0).then(O=>j(O)).catch(O=>Y(tt(O))).finally(()=>T(!1)))},[e,n]),z=y.useCallback(()=>{l(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(Q=>{q("Agent config reloaded successfully.")}).catch(Q=>Y(tt(Q))).finally(()=>l(!1))},[e,t]),G=y.useCallback(()=>{d(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(Q=>{q("Agent upgraded successfully.")}).catch(Q=>Y(tt(Q))).finally(()=>d(!1))},[e,t]);function q(Q){Ie({color:"green",title:"Success",icon:o.jsx(Ss,{size:"1rem"}),message:Q})}function Y(Q){Ie({color:"red",title:"Error",message:Q,autoClose:!1})}return o.jsxs(at,{children:[o.jsx(Mn,{opened:_,onClose:M,title:"Upgrade Agent",centered:!0,children:o.jsx(LK,{opened:_,close:M,version:m,loadingStatus:r,handleStatus:N,handleUpgrade:G})}),o.jsx(ze,{order:1,children:"Agent Tools"}),o.jsxs("div",{style:{marginBottom:10},children:["Agent: ",o.jsx(ec,{value:n,link:!0})]}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Agent Status"}),o.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."}),o.jsx(Ee,{onClick:N,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&p&&o.jsx(Ae,{children:o.jsxs(Ae.Tbody,{children:[o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Td,{children:"Status"}),o.jsx(Ae.Td,{children:o.jsx(Bx,{status:p})})]}),o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Td,{children:"Version"}),o.jsx(Ae.Td,{children:m})]}),o.jsxs(Ae.Tr,{children:[o.jsx(Ae.Td,{children:"Last Updated"}),o.jsx(Ae.Td,{children:fr(x,void 0,{timeZoneName:"longOffset"})})]})]})}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Reload Config"}),o.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),o.jsx(Ee,{onClick:z,loading:s,disabled:k&&!s,"aria-label":"Reload config",children:"Reload Config"}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Upgrade Agent"}),o.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),o.jsx(Ee,{onClick:R,loading:u,disabled:k&&!u,"aria-label":"Upgrade agent",children:"Upgrade"}),o.jsx(_n,{my:"lg"}),o.jsx(ze,{order:2,children:"Ping from Agent"}),o.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."}),o.jsx(gt,{onSubmit:L,children:o.jsxs(be,{children:[o.jsx(Be,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:o.jsx(En,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:P,disabled:k&&!P,children:o.jsx(m8,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),o.jsx($v,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!P&&w&&o.jsxs(o.Fragment,{children:[o.jsx(ze,{order:5,mt:"sm",mb:0,children:"Last Ping"}),o.jsx("pre",{children:w})]})]})}function FK(){return o.jsx(Lq,{children:o.jsxs(Ke,{errorElement:o.jsx(JG,{}),children:[o.jsx(Ke,{path:"/signin",element:o.jsx(jQ,{})}),o.jsx(Ke,{path:"/oauth",element:o.jsx(vQ,{})}),o.jsx(Ke,{path:"/resetpassword",element:o.jsx(bQ,{})}),o.jsx(Ke,{path:"/setpassword/:id/:secret",element:o.jsx(SQ,{})}),o.jsx(Ke,{path:"/register",element:o.jsx(xQ,{})}),o.jsx(Ke,{path:"/changepassword",element:o.jsx(KG,{})}),o.jsx(Ke,{path:"/security",element:o.jsx(wQ,{})}),o.jsx(Ke,{path:"/mfa",element:o.jsx(gQ,{})}),o.jsx(Ke,{path:"/batch",element:o.jsx(GG,{})}),o.jsx(Ke,{path:"/bulk/:resourceType",element:o.jsx(QG,{})}),o.jsx(Ke,{path:"/smart",element:o.jsx(CQ,{})}),o.jsx(Ke,{path:"/forms/:id",element:o.jsx(sQ,{})}),o.jsx(Ke,{path:"/admin/super",element:o.jsx(LQ,{})}),o.jsx(Ke,{path:"/admin/config",element:o.jsx(AQ,{})}),o.jsxs(Ke,{path:"/admin",element:o.jsx(NQ,{}),children:[o.jsx(Ke,{path:"patients",element:o.jsx(IQ,{})}),o.jsx(Ke,{path:"bots/new",element:o.jsx(TQ,{})}),o.jsx(Ke,{path:"bots",element:o.jsx(EQ,{})}),o.jsx(Ke,{path:"clients/new",element:o.jsx(PQ,{})}),o.jsx(Ke,{path:"clients",element:o.jsx(kQ,{})}),o.jsx(Ke,{path:"details",element:o.jsx(Lj,{})}),o.jsx(Ke,{path:"invite",element:o.jsx(DQ,{})}),o.jsx(Ke,{path:"users",element:o.jsx($Q,{})}),o.jsx(Ke,{path:"project",element:o.jsx(Lj,{})}),o.jsx(Ke,{path:"secrets",element:o.jsx(MQ,{})}),o.jsx(Ke,{path:"sites",element:o.jsx(OQ,{})}),o.jsx(Ke,{path:"members/:membershipId",element:o.jsx(_Q,{})})]}),o.jsx(Ke,{path:"/lab/assays",element:o.jsx(FQ,{})}),o.jsx(Ke,{path:"/lab/panels",element:o.jsx(zQ,{})}),o.jsx(Ke,{path:"/:resourceType/:id/_history/:versionId/:tab",element:o.jsx(Bj,{})}),o.jsx(Ke,{path:"/:resourceType/:id/_history/:versionId",element:o.jsx(Bj,{})}),o.jsxs(Ke,{path:"/:resourceType/new",element:o.jsx(XG,{}),children:[o.jsx(Ke,{index:!0,element:o.jsx(Cg,{})}),o.jsx(Ke,{path:"form",element:o.jsx(Cg,{})}),o.jsx(Ke,{path:"json",element:o.jsx(cK,{})}),o.jsx(Ke,{path:"profiles",element:o.jsx(Cg,{})})]}),o.jsxs(Ke,{path:"/:resourceType/:id",element:o.jsx(NK,{}),children:[o.jsx(Ke,{index:!0,element:o.jsx(Uj,{})}),o.jsx(Ke,{path:"apply",element:o.jsx(UQ,{})}),o.jsx(Ke,{path:"apps",element:o.jsx(VQ,{})}),o.jsx(Ke,{path:"event",element:o.jsx(HQ,{})}),o.jsx(Ke,{path:"blame",element:o.jsx(qQ,{})}),o.jsx(Ke,{path:"bots",element:o.jsx(mK,{})}),o.jsx(Ke,{path:"builder",element:o.jsx(tK,{})}),o.jsx(Ke,{path:"checklist",element:o.jsx(nK,{})}),o.jsx(Ke,{path:"delete",element:o.jsx(rK,{})}),o.jsx(Ke,{path:"details",element:o.jsx(sK,{})}),o.jsx(Ke,{path:"edit",element:o.jsx(aK,{})}),o.jsx(Ke,{path:"editor",element:o.jsx(ZQ,{})}),o.jsx(Ke,{path:"history",element:o.jsx(lK,{})}),o.jsx(Ke,{path:"json",element:o.jsx(uK,{})}),o.jsx(Ke,{path:"preview",element:o.jsx(dK,{})}),o.jsx(Ke,{path:"responses",element:o.jsx(yK,{})}),o.jsx(Ke,{path:"report",element:o.jsx(xK,{})}),o.jsx(Ke,{path:"ranges",element:o.jsx(vK,{})}),o.jsx(Ke,{path:"subscriptions",element:o.jsx(MK,{})}),o.jsx(Ke,{path:"timeline",element:o.jsx(Uj,{})}),o.jsx(Ke,{path:"tools",element:o.jsx($K,{})}),o.jsx(Ke,{path:"profiles",element:o.jsx(fK,{})})]}),o.jsx(Ke,{path:"/:resourceType",element:o.jsx(Oj,{})}),o.jsx(Ke,{path:"/",element:o.jsx(Oj,{})})]})})}function zK(){const e=Pe(),t=e.getUserConfiguration(),n=Mo(),[r]=eb();return e.isLoading()?o.jsx(ri,{}):o.jsx(mz,{logo:o.jsx(_i,{size:24}),pathname:n.pathname,searchParams:r,version:MT,menus:BK(t),displayAddBookmark:!!(t!=null&&t.id),children:o.jsx(y.Suspense,{fallback:o.jsx(ri,{}),children:o.jsx(FK,{})})})}function BK(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var i;return{title:r.title,links:((i=r.link)==null?void 0:i.map(s=>({label:s.name,href:s.target,icon:UK(s.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:o.jsx(n8,{})}]}),t}const Vj={Patient:v8,Practitioner:e8,Organization:WF,ServiceRequest:d8,DiagnosticReport:h8,Questionnaire:ZF,admin:BF,AccessPolicy:t8,Subscription:S8,batch:s8,Observation:o8};function UK(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in Vj){const n=Vj[t];return o.jsx(n,{})}}catch{}return o.jsx(_p,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function VK(){const e=Bu(),t=new OT({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=Bq([{path:"*",element:o.jsx(zK,{})}]),i=l=>r.navigate(l);SH.createRoot(document.getElementById("root")).render(o.jsx(y.StrictMode,{children:o.jsx(SF,{medplum:t,navigate:i,children:o.jsxs(gC,{theme:n,children:[o.jsx(Io,{position:"bottom-right"}),o.jsx(Yq,{router:r})]})})}))}VK().catch(console.error);
587
- //# sourceMappingURL=index-DaHjK2GI.js.map