@medplum/app 2.1.11 → 2.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,235 @@
1
+ function I3(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const a=Object.getOwnPropertyDescriptor(n,o);a&&Object.defineProperty(e,o,a.get?a:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const a of o)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function r(o){const a={};return o.integrity&&(a.integrity=o.integrity),o.referrerPolicy&&(a.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?a.credentials="include":o.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(o){if(o.ep)return;o.ep=!0;const a=r(o);fetch(o.href,a)}})();function yy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var DC={exports:{}},dh={},NC={exports:{}},Re={};/**
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 sc=Symbol.for("react.element"),D3=Symbol.for("react.portal"),N3=Symbol.for("react.fragment"),A3=Symbol.for("react.strict_mode"),M3=Symbol.for("react.profiler"),L3=Symbol.for("react.provider"),z3=Symbol.for("react.context"),F3=Symbol.for("react.forward_ref"),V3=Symbol.for("react.suspense"),B3=Symbol.for("react.memo"),U3=Symbol.for("react.lazy"),Z1=Symbol.iterator;function W3(e){return e===null||typeof e!="object"?null:(e=Z1&&e[Z1]||e["@@iterator"],typeof e=="function"?e:null)}var AC={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},MC=Object.assign,LC={};function _s(e,t,r){this.props=e,this.context=t,this.refs=LC,this.updater=r||AC}_s.prototype.isReactComponent={};_s.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,t,"setState")};_s.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function zC(){}zC.prototype=_s.prototype;function xy(e,t,r){this.props=e,this.context=t,this.refs=LC,this.updater=r||AC}var wy=xy.prototype=new zC;wy.constructor=xy;MC(wy,_s.prototype);wy.isPureReactComponent=!0;var ex=Array.isArray,FC=Object.prototype.hasOwnProperty,by={current:null},VC={key:!0,ref:!0,__self:!0,__source:!0};function BC(e,t,r){var n,o={},a=null,i=null;if(t!=null)for(n in t.ref!==void 0&&(i=t.ref),t.key!==void 0&&(a=""+t.key),t)FC.call(t,n)&&!VC.hasOwnProperty(n)&&(o[n]=t[n]);var l=arguments.length-2;if(l===1)o.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(n in l=e.defaultProps,l)o[n]===void 0&&(o[n]=l[n]);return{$$typeof:sc,type:e,key:a,ref:i,props:o,_owner:by.current}}function H3(e,t){return{$$typeof:sc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function _y(e){return typeof e=="object"&&e!==null&&e.$$typeof===sc}function q3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var tx=/\/+/g;function _m(e,t){return typeof e=="object"&&e!==null&&e.key!=null?q3(""+e.key):t.toString(36)}function zu(e,t,r,n,o){var a=typeof e;(a==="undefined"||a==="boolean")&&(e=null);var i=!1;if(e===null)i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case sc:case D3:i=!0}}if(i)return i=e,o=o(i),e=n===""?"."+_m(i,0):n,ex(o)?(r="",e!=null&&(r=e.replace(tx,"$&/")+"/"),zu(o,t,r,"",function(u){return u})):o!=null&&(_y(o)&&(o=H3(o,r+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(tx,"$&/")+"/")+e)),t.push(o)),1;if(i=0,n=n===""?".":n+":",ex(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+_m(a,l);i+=zu(a,t,r,c,o)}else if(c=W3(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+_m(a,l++),i+=zu(a,t,r,c,o);else if(a==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function Bc(e,t,r){if(e==null)return e;var n=[],o=0;return zu(e,n,"","",function(a){return t.call(r,a,o++)}),n}function G3(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(r){(e._status===0||e._status===-1)&&(e._status=1,e._result=r)},function(r){(e._status===0||e._status===-1)&&(e._status=2,e._result=r)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var hr={current:null},Fu={transition:null},Q3={ReactCurrentDispatcher:hr,ReactCurrentBatchConfig:Fu,ReactCurrentOwner:by};Re.Children={map:Bc,forEach:function(e,t,r){Bc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Bc(e,function(){t++}),t},toArray:function(e){return Bc(e,function(t){return t})||[]},only:function(e){if(!_y(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Re.Component=_s;Re.Fragment=N3;Re.Profiler=M3;Re.PureComponent=xy;Re.StrictMode=A3;Re.Suspense=V3;Re.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Q3;Re.cloneElement=function(e,t,r){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=MC({},e.props),o=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=by.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)FC.call(t,c)&&!VC.hasOwnProperty(c)&&(n[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:sc,type:e.type,key:o,ref:a,props:n,_owner:i}};Re.createContext=function(e){return e={$$typeof:z3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:L3,_context:e},e.Consumer=e};Re.createElement=BC;Re.createFactory=function(e){var t=BC.bind(null,e);return t.type=e,t};Re.createRef=function(){return{current:null}};Re.forwardRef=function(e){return{$$typeof:F3,render:e}};Re.isValidElement=_y;Re.lazy=function(e){return{$$typeof:U3,_payload:{_status:-1,_result:e},_init:G3}};Re.memo=function(e,t){return{$$typeof:B3,type:e,compare:t===void 0?null:t}};Re.startTransition=function(e){var t=Fu.transition;Fu.transition={};try{e()}finally{Fu.transition=t}};Re.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Re.useCallback=function(e,t){return hr.current.useCallback(e,t)};Re.useContext=function(e){return hr.current.useContext(e)};Re.useDebugValue=function(){};Re.useDeferredValue=function(e){return hr.current.useDeferredValue(e)};Re.useEffect=function(e,t){return hr.current.useEffect(e,t)};Re.useId=function(){return hr.current.useId()};Re.useImperativeHandle=function(e,t,r){return hr.current.useImperativeHandle(e,t,r)};Re.useInsertionEffect=function(e,t){return hr.current.useInsertionEffect(e,t)};Re.useLayoutEffect=function(e,t){return hr.current.useLayoutEffect(e,t)};Re.useMemo=function(e,t){return hr.current.useMemo(e,t)};Re.useReducer=function(e,t,r){return hr.current.useReducer(e,t,r)};Re.useRef=function(e){return hr.current.useRef(e)};Re.useState=function(e){return hr.current.useState(e)};Re.useSyncExternalStore=function(e,t,r){return hr.current.useSyncExternalStore(e,t,r)};Re.useTransition=function(){return hr.current.useTransition()};Re.version="18.2.0";NC.exports=Re;var f=NC.exports;const S=yy(f),Il=I3({__proto__:null,default:S},[f]);/**
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 K3=f,Y3=Symbol.for("react.element"),X3=Symbol.for("react.fragment"),J3=Object.prototype.hasOwnProperty,Z3=K3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,eA={key:!0,ref:!0,__self:!0,__source:!0};function UC(e,t,r){var n,o={},a=null,i=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(i=t.ref);for(n in t)J3.call(t,n)&&!eA.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:Y3,type:e,key:a,ref:i,props:o,_owner:Z3.current}}dh.Fragment=X3;dh.jsx=UC;dh.jsxs=UC;DC.exports=dh;var s=DC.exports,Un=function(){return Un=Object.assign||function(t){for(var r,n=1,o=arguments.length;n<o;n++){r=arguments[n];for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a])}return t},Un.apply(this,arguments)};function WC(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}function Ss(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function l(d){try{u(n.next(d))}catch(p){i(p)}}function c(d){try{u(n.throw(d))}catch(p){i(p)}}function u(d){d.done?a(d.value):o(d.value).then(l,c)}u((n=n.apply(e,t||[])).next())})}function Ps(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i;return i={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,u[0]&&(r=0)),r;)try{if(n=1,o&&(a=u[0]&2?o.return:u[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,u[1])).done)return a;switch(o=0,a&&(u=[u[0]&2,a.value]),u[0]){case 0:case 1:a=u;break;case 4:return r.label++,{value:u[1],done:!1};case 5:r.label++,o=u[1],u=[0];continue;case 7:u=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){r=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){r.label=u[1];break}if(u[0]===6&&r.label<a[1]){r.label=a[1],a=u;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(u);break}a[2]&&r.ops.pop(),r.trys.pop();continue}u=t.call(e,r)}catch(d){u=[6,d],o=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function rx(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(l){i={error:l}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function Ag(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}var Vu="right-scroll-bar-position",Bu="width-before-scroll-bar",tA="with-scroll-bars-hidden",rA="--removed-body-scroll-bar-size";function nA(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function oA(e,t){var r=f.useState(function(){return{value:e,callback:t,facade:{get current(){return r.value},set current(n){var o=r.value;o!==n&&(r.value=n,r.callback(n,o))}}}})[0];return r.callback=t,r.facade}function aA(e,t){return oA(t||null,function(r){return e.forEach(function(n){return nA(n,r)})})}function iA(e){return e}function sA(e,t){t===void 0&&(t=iA);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(a){var i=t(a,n);return r.push(i),function(){r=r.filter(function(l){return l!==i})}},assignSyncMedium:function(a){for(n=!0;r.length;){var i=r;r=[],i.forEach(a)}r={push:function(l){return a(l)},filter:function(){return r}}},assignMedium:function(a){n=!0;var i=[];if(r.length){var l=r;r=[],l.forEach(a),i=r}var c=function(){var d=i;i=[],d.forEach(a)},u=function(){return Promise.resolve().then(c)};u(),r={push:function(d){i.push(d),u()},filter:function(d){return i=i.filter(d),r}}}};return o}function lA(e){e===void 0&&(e={});var t=sA(null);return t.options=Un({async:!0,ssr:!1},e),t}var HC=function(e){var t=e.sideCar,r=WC(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return f.createElement(n,Un({},r))};HC.isSideCarExport=!0;function cA(e,t){return e.useMedium(t),HC}var qC=lA(),Sm=function(){},fh=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:Sm,onWheelCapture:Sm,onTouchMoveCapture:Sm}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,m=e.noIsolation,v=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?"div":_,x=e.gapMode,w=WC(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,O=aA([r,t]),C=Un(Un({},w),o);return f.createElement(f.Fragment,null,d&&f.createElement(b,{sideCar:qC,removeScrollBar:u,shards:p,noIsolation:m,inert:v,setCallbacks:a,allowPinchZoom:!!g,lockRef:r,gapMode:x}),i?f.cloneElement(f.Children.only(l),Un(Un({},C),{ref:O})):f.createElement(y,Un({},C,{className:c,ref:O}),l))});fh.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};fh.classNames={fullWidth:Bu,zeroRight:Vu};var nx,uA=function(){if(nx)return nx;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function dA(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=uA();return t&&e.setAttribute("nonce",t),e}function fA(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pA(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hA=function(){var e=0,t=null;return{add:function(r){e==0&&(t=dA())&&(fA(t,r),pA(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},mA=function(){var e=hA();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},GC=function(){var e=mA(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},gA={left:0,top:0,right:0,gap:0},Pm=function(e){return parseInt(e||"",10)||0},vA=function(e){var t=window.getComputedStyle(document.body),r=t[e==="padding"?"paddingLeft":"marginLeft"],n=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[Pm(r),Pm(n),Pm(o)]},yA=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return gA;var t=vA(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},xA=GC(),wA=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,l=e.gap;return r===void 0&&(r="margin"),`
18
+ .`.concat(tA,` {
19
+ overflow: hidden `).concat(n,`;
20
+ padding-right: `).concat(l,"px ").concat(n,`;
21
+ }
22
+ body {
23
+ overflow: hidden `).concat(n,`;
24
+ overscroll-behavior: contain;
25
+ `).concat([t&&"position: relative ".concat(n,";"),r==="margin"&&`
26
+ padding-left: `.concat(o,`px;
27
+ padding-top: `).concat(a,`px;
28
+ padding-right: `).concat(i,`px;
29
+ margin-left:0;
30
+ margin-top:0;
31
+ margin-right: `).concat(l,"px ").concat(n,`;
32
+ `),r==="padding"&&"padding-right: ".concat(l,"px ").concat(n,";")].filter(Boolean).join(""),`
33
+ }
34
+
35
+ .`).concat(Vu,` {
36
+ right: `).concat(l,"px ").concat(n,`;
37
+ }
38
+
39
+ .`).concat(Bu,` {
40
+ margin-right: `).concat(l,"px ").concat(n,`;
41
+ }
42
+
43
+ .`).concat(Vu," .").concat(Vu,` {
44
+ right: 0 `).concat(n,`;
45
+ }
46
+
47
+ .`).concat(Bu," .").concat(Bu,` {
48
+ margin-right: 0 `).concat(n,`;
49
+ }
50
+
51
+ body {
52
+ `).concat(rA,": ").concat(l,`px;
53
+ }
54
+ `)},bA=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,a=f.useMemo(function(){return yA(o)},[o]);return f.createElement(xA,{styles:wA(a,!t,o,r?"":"!important")})},Mg=!1;if(typeof window<"u")try{var Uc=Object.defineProperty({},"passive",{get:function(){return Mg=!0,!0}});window.addEventListener("test",Uc,Uc),window.removeEventListener("test",Uc,Uc)}catch{Mg=!1}var xi=Mg?{passive:!1}:!1,_A=function(e){return e.tagName==="TEXTAREA"},QC=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_A(e)&&r[t]==="visible")},SA=function(e){return QC(e,"overflowY")},PA=function(e){return QC(e,"overflowX")},ox=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=KC(e,n);if(o){var a=YC(e,n),i=a[1],l=a[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},jA=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},OA=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},KC=function(e,t){return e==="v"?SA(t):PA(t)},YC=function(e,t){return e==="v"?jA(t):OA(t)},CA=function(e,t){return e==="h"&&t==="rtl"?-1:1},EA=function(e,t,r,n,o){var a=CA(e,window.getComputedStyle(t).direction),i=a*n,l=r.target,c=t.contains(l),u=!1,d=i>0,p=0,h=0;do{var m=YC(e,l),v=m[0],g=m[1],_=m[2],y=g-_-a*v;(v||y)&&KC(e,l)&&(p+=y,h+=v),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&Math.abs(p)<1||!o&&i>p)||!d&&(o&&Math.abs(h)<1||!o&&-i>h))&&(u=!0),u},Wc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},ax=function(e){return[e.deltaX,e.deltaY]},ix=function(e){return e&&"current"in e?e.current:e},$A=function(e,t){return e[0]===t[0]&&e[1]===t[1]},kA=function(e){return`
55
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
56
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
57
+ `)},RA=0,wi=[];function TA(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(RA++)[0],a=f.useState(GC)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var g=Ag([e.lockRef.current],(e.shards||[]).map(ix),!0).filter(Boolean);return g.forEach(function(_){return _.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),g.forEach(function(_){return _.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(g,_){if("touches"in g&&g.touches.length===2)return!i.current.allowPinchZoom;var y=Wc(g),x=r.current,w="deltaX"in g?g.deltaX:x[0]-y[0],b="deltaY"in g?g.deltaY:x[1]-y[1],O,C=g.target,j=Math.abs(w)>Math.abs(b)?"h":"v";if("touches"in g&&j==="h"&&C.type==="range")return!1;var E=ox(j,C);if(!E)return!0;if(E?O=j:(O=j==="v"?"h":"v",E=ox(j,C)),!E)return!1;if(!n.current&&"changedTouches"in g&&(w||b)&&(n.current=O),!O)return!0;var T=n.current||O;return EA(T,_,g,T==="h"?w:b,!0)},[]),c=f.useCallback(function(g){var _=g;if(!(!wi.length||wi[wi.length-1]!==a)){var y="deltaY"in _?ax(_):Wc(_),x=t.current.filter(function(O){return O.name===_.type&&(O.target===_.target||_.target===O.shadowParent)&&$A(O.delta,y)})[0];if(x&&x.should){_.cancelable&&_.preventDefault();return}if(!x){var w=(i.current.shards||[]).map(ix).filter(Boolean).filter(function(O){return O.contains(_.target)}),b=w.length>0?l(_,w[0]):!i.current.noIsolation;b&&_.cancelable&&_.preventDefault()}}},[]),u=f.useCallback(function(g,_,y,x){var w={name:g,delta:_,target:y,should:x,shadowParent:IA(y)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(b){return b!==w})},1)},[]),d=f.useCallback(function(g){r.current=Wc(g),n.current=void 0},[]),p=f.useCallback(function(g){u(g.type,ax(g),g.target,l(g,e.lockRef.current))},[]),h=f.useCallback(function(g){u(g.type,Wc(g),g.target,l(g,e.lockRef.current))},[]);f.useEffect(function(){return wi.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,xi),document.addEventListener("touchmove",c,xi),document.addEventListener("touchstart",d,xi),function(){wi=wi.filter(function(g){return g!==a}),document.removeEventListener("wheel",c,xi),document.removeEventListener("touchmove",c,xi),document.removeEventListener("touchstart",d,xi)}},[]);var m=e.removeScrollBar,v=e.inert;return f.createElement(f.Fragment,null,v?f.createElement(a,{styles:kA(o)}):null,m?f.createElement(bA,{gapMode:e.gapMode}):null)}function IA(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const DA=cA(qC,TA);var XC=f.forwardRef(function(e,t){return f.createElement(fh,Un({},e,{ref:t,sideCar:DA}))});XC.classNames=fh.classNames;const NA=XC;function cd(e,t){let r=e;for(;(r=r.parentElement)&&!r.matches(t););return r}function AA(e,t,r){for(let n=e-1;n>=0;n-=1)if(!t[n].disabled)return n;if(r){for(let n=t.length-1;n>-1;n-=1)if(!t[n].disabled)return n}return e}function MA(e,t,r){for(let n=e+1;n<t.length;n+=1)if(!t[n].disabled)return n;if(r){for(let n=0;n<t.length;n+=1)if(!t[n].disabled)return n}return e}function LA(e,t,r){return cd(e,r)===cd(t,r)}function JC({parentSelector:e,siblingSelector:t,onKeyDown:r,loop:n=!0,activateOnFocus:o=!1,dir:a="rtl",orientation:i}){return l=>{var c;r==null||r(l);const u=Array.from(((c=cd(l.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(g=>LA(l.currentTarget,g,e)),d=u.findIndex(g=>l.currentTarget===g),p=MA(d,u,n),h=AA(d,u,n),m=a==="rtl"?h:p,v=a==="rtl"?p:h;switch(l.key){case"ArrowRight":{i==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[m].focus(),o&&u[m].click());break}case"ArrowLeft":{i==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[v].focus(),o&&u[v].click());break}case"ArrowUp":{i==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[h].focus(),o&&u[h].click());break}case"ArrowDown":{i==="vertical"&&(l.stopPropagation(),l.preventDefault(),u[p].focus(),o&&u[p].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!u[0].disabled&&u[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const g=u.length-1;!u[g].disabled&&u[g].focus();break}}}}function zA(e,t,r){var n;return r?Array.from(((n=cd(r,t))==null?void 0:n.querySelectorAll(e))||[]).findIndex(o=>o===r):null}function Po(e){const t=f.createContext(null);return[({children:o,value:a})=>S.createElement(t.Provider,{value:a},o),()=>{const o=f.useContext(t);if(o===null)throw new Error(e);return o}]}function lc(e){return Array.isArray(e)?e:[e]}function sx(e,t){return r=>{if(typeof r!="string"||r.trim().length===0)throw new Error(t);return`${e}-${r}`}}const FA=()=>{};function VA(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||FA:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function zr(e,t){return r=>{e==null||e(r),t==null||t(r)}}function BA(){const[e,t]=f.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function UA({data:e}){const t=[],r=[],n=e.reduce((o,a,i)=>(a.group?o[a.group]?o[a.group].push(i):o[a.group]=[i]:r.push(i),o),{});return Object.keys(n).forEach(o=>{t.push(...n[o].map(a=>e[a]))}),t.push(...r.map(o=>e[o])),t}function WA(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const HA=typeof window<"u"?f.useLayoutEffect:f.useEffect;function qA(e){function t(n){const o=Object.keys(n).reduce((a,i)=>(a[`${e}:${i}`]=l=>n[i](l.detail),a),{});HA(()=>(Object.keys(o).forEach(a=>{window.removeEventListener(a,o[a]),window.addEventListener(a,o[a])}),()=>Object.keys(o).forEach(a=>{window.removeEventListener(a,o[a])})),[o])}function r(n){return(...o)=>WA(`${e}:${String(n)}`,o[0])}return[t,r]}function js(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==S.Fragment:!1}function ZC(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=ZC(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function eE(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=ZC(t))&&(n&&(n+=" "),n+=r);return n}const GA={dark:["#C1C2C5","#A6A7AB","#909296","#5c5f66","#373A40","#2C2E33","#25262b","#1A1B1E","#141517","#101113"],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"]};function QA(e){return()=>({fontFamily:e.fontFamily||"sans-serif"})}var KA=Object.defineProperty,lx=Object.getOwnPropertySymbols,YA=Object.prototype.hasOwnProperty,XA=Object.prototype.propertyIsEnumerable,cx=(e,t,r)=>t in e?KA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ux=(e,t)=>{for(var r in t||(t={}))YA.call(t,r)&&cx(e,r,t[r]);if(lx)for(var r of lx(t))XA.call(t,r)&&cx(e,r,t[r]);return e};function JA(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:ux({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),[t?t.replace(":focus",":focus:not(:focus-visible)"):"&:focus:not(:focus-visible)"]:ux({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function cc(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function Sy(e){const t=cc(e);return(r,n,o=!0,a=!0)=>{if(typeof r=="string"&&r.includes(".")){const[l,c]=r.split("."),u=parseInt(c,10);if(l in e.colors&&u>=0&&u<10)return e.colors[l][typeof n=="number"&&!a?n:u]}const i=typeof n=="number"?n:t();return r in e.colors?e.colors[r][i]:o?e.colors[e.primaryColor][i]:r}}function tE(e){let t="";for(let r=1;r<e.length-1;r+=1)t+=`${e[r]} ${r/(e.length-1)*100}%, `;return`${e[0]} 0%, ${t}${e[e.length-1]} 100%`}function ZA(e,...t){return`linear-gradient(${e}deg, ${tE(t)})`}function e9(...e){return`radial-gradient(circle, ${tE(e)})`}function rE(e){const t=Sy(e),r=cc(e);return n=>{const o={from:(n==null?void 0:n.from)||e.defaultGradient.from,to:(n==null?void 0:n.to)||e.defaultGradient.to,deg:(n==null?void 0:n.deg)||e.defaultGradient.deg};return`linear-gradient(${o.deg}deg, ${t(o.from,r(),!1)} 0%, ${t(o.to,r(),!1)} 100%)`}}function nE(e){return t=>{if(typeof t=="number")return`${t/16}${e}`;if(typeof t=="string"){const r=t.replace("px","");if(!Number.isNaN(Number(r)))return`${Number(r)/16}${e}`}return t}}const P=nE("rem"),nr=nE("em");function A({size:e,sizes:t,units:r}){return e in t?t[e]:typeof e=="number"?r==="em"?nr(e):P(e):e||t.md}function fr(e){return typeof e=="number"?e:typeof e=="string"&&e.includes("rem")?Number(e.replace("rem",""))*16:typeof e=="string"&&e.includes("em")?Number(e.replace("em",""))*16:Number(e)}function t9(e){return t=>`@media (min-width: ${nr(fr(A({size:t,sizes:e.breakpoints})))})`}function r9(e){return t=>`@media (max-width: ${nr(fr(A({size:t,sizes:e.breakpoints}))-1)})`}function n9(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function o9(e){let t=e.replace("#","");if(t.length===3){const i=t.split("");t=[i[0],i[0],i[1],i[1],i[2],i[2]].join("")}const r=parseInt(t,16),n=r>>16&255,o=r>>8&255,a=r&255;return{r:n,g:o,b:a,a:1}}function a9(e){const[t,r,n,o]=e.replace(/[^0-9,.]/g,"").split(",").map(Number);return{r:t,g:r,b:n,a:o||1}}function Py(e){return n9(e)?o9(e):e.startsWith("rgb")?a9(e):{r:0,g:0,b:0,a:1}}function ki(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(--"))return e;const{r,g:n,b:o}=Py(e);return`rgba(${r}, ${n}, ${o}, ${t})`}function i9(e=0){return{position:"absolute",top:P(e),right:P(e),left:P(e),bottom:P(e)}}function s9(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a}=Py(e),i=1-t,l=c=>Math.round(c*i);return`rgba(${l(r)}, ${l(n)}, ${l(o)}, ${a})`}function l9(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a}=Py(e),i=l=>Math.round(l+(255-l)*t);return`rgba(${i(r)}, ${i(n)}, ${i(o)}, ${a})`}function c9(e){return t=>{if(typeof t=="number")return P(t);const r=typeof e.defaultRadius=="number"?e.defaultRadius:e.radius[e.defaultRadius]||e.defaultRadius;return e.radius[t]||t||r}}function u9(e,t){if(typeof e=="string"&&e.includes(".")){const[r,n]=e.split("."),o=parseInt(n,10);if(r in t.colors&&o>=0&&o<10)return{isSplittedColor:!0,key:r,shade:o}}return{isSplittedColor:!1}}function d9(e){const t=Sy(e),r=cc(e),n=rE(e);return({variant:o,color:a,gradient:i,primaryFallback:l})=>{const c=u9(a,e);switch(o){case"light":return{border:"transparent",background:ki(t(a,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1),color:a==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(a,e.colorScheme==="dark"?2:r("light")),hover:ki(t(a,e.colorScheme==="dark"?7:1,l,!1),e.colorScheme==="dark"?.25:.65)};case"subtle":return{border:"transparent",background:"transparent",color:a==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(a,e.colorScheme==="dark"?2:r("light")),hover:ki(t(a,e.colorScheme==="dark"?8:0,l,!1),e.colorScheme==="dark"?.2:1)};case"outline":return{border:t(a,e.colorScheme==="dark"?5:r("light")),background:"transparent",color:t(a,e.colorScheme==="dark"?5:r("light")),hover:e.colorScheme==="dark"?ki(t(a,5,l,!1),.05):ki(t(a,0,l,!1),.35)};case"default":return{border:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4],background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,color:e.colorScheme==="dark"?e.white:e.black,hover:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]};case"white":return{border:"transparent",background:e.white,color:t(a,r()),hover:null};case"transparent":return{border:"transparent",color:a==="dark"?e.colorScheme==="dark"?e.colors.dark[0]:e.colors.dark[9]:t(a,e.colorScheme==="dark"?2:r("light")),background:"transparent",hover:null};case"gradient":return{background:n(i),color:e.white,border:"transparent",hover:null};default:{const u=r(),d=c.isSplittedColor?c.shade:u,p=c.isSplittedColor?c.key:a;return{border:"transparent",background:t(p,d,l),color:e.white,hover:t(p,d===9?8:d+1)}}}}}function f9(e){return t=>{const r=cc(e)(t);return e.colors[e.primaryColor][r]}}function p9(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function h9(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function m9(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const Nt={fontStyles:QA,themeColor:Sy,focusStyles:JA,linearGradient:ZA,radialGradient:e9,smallerThan:r9,largerThan:t9,rgba:ki,cover:i9,darken:s9,lighten:l9,radius:c9,variant:d9,primaryShade:cc,hover:p9,gradient:rE,primaryColor:f9,placeholderStyles:h9,dimmed:m9};var g9=Object.defineProperty,v9=Object.defineProperties,y9=Object.getOwnPropertyDescriptors,dx=Object.getOwnPropertySymbols,x9=Object.prototype.hasOwnProperty,w9=Object.prototype.propertyIsEnumerable,fx=(e,t,r)=>t in e?g9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b9=(e,t)=>{for(var r in t||(t={}))x9.call(t,r)&&fx(e,r,t[r]);if(dx)for(var r of dx(t))w9.call(t,r)&&fx(e,r,t[r]);return e},_9=(e,t)=>v9(e,y9(t));function oE(e){return _9(b9({},e),{fn:{fontStyles:Nt.fontStyles(e),themeColor:Nt.themeColor(e),focusStyles:Nt.focusStyles(e),largerThan:Nt.largerThan(e),smallerThan:Nt.smallerThan(e),radialGradient:Nt.radialGradient,linearGradient:Nt.linearGradient,gradient:Nt.gradient(e),rgba:Nt.rgba,cover:Nt.cover,lighten:Nt.lighten,darken:Nt.darken,primaryShade:Nt.primaryShade(e),radius:Nt.radius(e),variant:Nt.variant(e),hover:Nt.hover,primaryColor:Nt.primaryColor(e),placeholderStyles:Nt.placeholderStyles(e),dimmed:Nt.dimmed(e)}})}const aE=["xs","sm","md","lg","xl"],S9={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:GA,lineHeight:1.55,fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",primaryColor:"blue",respectReducedMotion:!0,cursorType:"default",defaultGradient:{from:"indigo",to:"cyan",deg:45},shadows:{xs:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)",sm:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem",md:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem",lg:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem",xl:"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem"},fontSizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem"},radius:{xs:"0.125rem",sm:"0.25rem",md:"0.5rem",lg:"1rem",xl:"2rem"},spacing:{xs:"0.625rem",sm:"0.75rem",md:"1rem",lg:"1.25rem",xl:"1.5rem"},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},headings:{fontFamily:"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",fontWeight:700,sizes:{h1:{fontSize:"2.125rem",lineHeight:1.3,fontWeight:void 0},h2:{fontSize:"1.625rem",lineHeight:1.35,fontWeight:void 0},h3:{fontSize:"1.375rem",lineHeight:1.4,fontWeight:void 0},h4:{fontSize:"1.125rem",lineHeight:1.45,fontWeight:void 0},h5:{fontSize:"1rem",lineHeight:1.5,fontWeight:void 0},h6:{fontSize:"0.875rem",lineHeight:1.5,fontWeight:void 0}}},other:{},components:{},activeStyles:{transform:"translateY(0.0625rem)"},datesLocale:"en",globalStyles:void 0,focusRingStyles:{styles:e=>({outlineOffset:"0.125rem",outline:`0.125rem solid ${e.colors[e.primaryColor][e.colorScheme==="dark"?7:5]}`}),resetStyles:()=>({outline:"none"}),inputStyles:e=>({outline:"none",borderColor:e.colors[e.primaryColor][typeof e.primaryShade=="object"?e.primaryShade[e.colorScheme]:e.primaryShade]})}},jy=oE(S9);function P9(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function j9(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var O9=function(){function e(r){var n=this;this._insertTag=function(o){var a;n.tags.length===0?n.insertionPoint?a=n.insertionPoint.nextSibling:n.prepend?a=n.container.firstChild:a=n.before:a=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,a),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(j9(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var a=P9(o);try{a.insertRule(n,a.cssRules.length)}catch{}}else o.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}(),Zt="-ms-",ud="-moz-",Fe="-webkit-",iE="comm",Oy="rule",Cy="decl",C9="@import",sE="@keyframes",E9="@layer",$9=Math.abs,ph=String.fromCharCode,k9=Object.assign;function R9(e,t){return qt(e,0)^45?(((t<<2^qt(e,0))<<2^qt(e,1))<<2^qt(e,2))<<2^qt(e,3):0}function lE(e){return e.trim()}function T9(e,t){return(e=t.exec(e))?e[0]:e}function Be(e,t,r){return e.replace(t,r)}function Lg(e,t){return e.indexOf(t)}function qt(e,t){return e.charCodeAt(t)|0}function Dl(e,t,r){return e.slice(t,r)}function Vn(e){return e.length}function Ey(e){return e.length}function Hc(e,t){return t.push(e),e}function I9(e,t){return e.map(t).join("")}var hh=1,is=1,cE=0,Cr=0,Tt=0,Os="";function mh(e,t,r,n,o,a,i){return{value:e,root:t,parent:r,type:n,props:o,children:a,line:hh,column:is,length:i,return:""}}function Ls(e,t){return k9(mh("",null,null,"",null,null,0),e,{length:-e.length},t)}function D9(){return Tt}function N9(){return Tt=Cr>0?qt(Os,--Cr):0,is--,Tt===10&&(is=1,hh--),Tt}function Vr(){return Tt=Cr<cE?qt(Os,Cr++):0,is++,Tt===10&&(is=1,hh++),Tt}function qn(){return qt(Os,Cr)}function Uu(){return Cr}function uc(e,t){return Dl(Os,e,t)}function Nl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function uE(e){return hh=is=1,cE=Vn(Os=e),Cr=0,[]}function dE(e){return Os="",e}function Wu(e){return lE(uc(Cr-1,zg(e===91?e+2:e===40?e+1:e)))}function A9(e){for(;(Tt=qn())&&Tt<33;)Vr();return Nl(e)>2||Nl(Tt)>3?"":" "}function M9(e,t){for(;--t&&Vr()&&!(Tt<48||Tt>102||Tt>57&&Tt<65||Tt>70&&Tt<97););return uc(e,Uu()+(t<6&&qn()==32&&Vr()==32))}function zg(e){for(;Vr();)switch(Tt){case e:return Cr;case 34:case 39:e!==34&&e!==39&&zg(Tt);break;case 40:e===41&&zg(e);break;case 92:Vr();break}return Cr}function L9(e,t){for(;Vr()&&e+Tt!==47+10;)if(e+Tt===42+42&&qn()===47)break;return"/*"+uc(t,Cr-1)+"*"+ph(e===47?e:Vr())}function z9(e){for(;!Nl(qn());)Vr();return uc(e,Cr)}function F9(e){return dE(Hu("",null,null,null,[""],e=uE(e),0,[0],e))}function Hu(e,t,r,n,o,a,i,l,c){for(var u=0,d=0,p=i,h=0,m=0,v=0,g=1,_=1,y=1,x=0,w="",b=o,O=a,C=n,j=w;_;)switch(v=x,x=Vr()){case 40:if(v!=108&&qt(j,p-1)==58){Lg(j+=Be(Wu(x),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:j+=Wu(x);break;case 9:case 10:case 13:case 32:j+=A9(v);break;case 92:j+=M9(Uu()-1,7);continue;case 47:switch(qn()){case 42:case 47:Hc(V9(L9(Vr(),Uu()),t,r),c);break;default:j+="/"}break;case 123*g:l[u++]=Vn(j)*y;case 125*g:case 59:case 0:switch(x){case 0:case 125:_=0;case 59+d:y==-1&&(j=Be(j,/\f/g,"")),m>0&&Vn(j)-p&&Hc(m>32?hx(j+";",n,r,p-1):hx(Be(j," ","")+";",n,r,p-2),c);break;case 59:j+=";";default:if(Hc(C=px(j,t,r,u,d,o,l,w,b=[],O=[],p),a),x===123)if(d===0)Hu(j,t,C,C,b,a,p,l,O);else switch(h===99&&qt(j,3)===110?100:h){case 100:case 108:case 109:case 115:Hu(e,C,C,n&&Hc(px(e,C,C,0,0,o,l,w,o,b=[],p),O),o,O,p,l,n?b:O);break;default:Hu(j,C,C,C,[""],O,0,l,O)}}u=d=m=0,g=y=1,w=j="",p=i;break;case 58:p=1+Vn(j),m=v;default:if(g<1){if(x==123)--g;else if(x==125&&g++==0&&N9()==125)continue}switch(j+=ph(x),x*g){case 38:y=d>0?1:(j+="\f",-1);break;case 44:l[u++]=(Vn(j)-1)*y,y=1;break;case 64:qn()===45&&(j+=Wu(Vr())),h=qn(),d=p=Vn(w=j+=z9(Uu())),x++;break;case 45:v===45&&Vn(j)==2&&(g=0)}}return a}function px(e,t,r,n,o,a,i,l,c,u,d){for(var p=o-1,h=o===0?a:[""],m=Ey(h),v=0,g=0,_=0;v<n;++v)for(var y=0,x=Dl(e,p+1,p=$9(g=i[v])),w=e;y<m;++y)(w=lE(g>0?h[y]+" "+x:Be(x,/&\f/g,h[y])))&&(c[_++]=w);return mh(e,t,r,o===0?Oy:l,c,u,d)}function V9(e,t,r){return mh(e,t,r,iE,ph(D9()),Dl(e,2,-2),0)}function hx(e,t,r,n){return mh(e,t,r,Cy,Dl(e,0,n),Dl(e,n+1,-1),n)}function Ki(e,t){for(var r="",n=Ey(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function B9(e,t,r,n){switch(e.type){case E9:if(e.children.length)break;case C9:case Cy:return e.return=e.return||e.value;case iE:return"";case sE:return e.return=e.value+"{"+Ki(e.children,n)+"}";case Oy:e.value=e.props.join(",")}return Vn(r=Ki(e.children,n))?e.return=e.value+"{"+r+"}":""}function U9(e){var t=Ey(e);return function(r,n,o,a){for(var i="",l=0;l<t;l++)i+=e[l](r,n,o,a)||"";return i}}function W9(e){return function(t){t.root||(t=t.return)&&e(t)}}var mx=function(t){var r=new WeakMap;return function(n){if(r.has(n))return r.get(n);var o=t(n);return r.set(n,o),o}};function H9(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var q9=function(t,r,n){for(var o=0,a=0;o=a,a=qn(),o===38&&a===12&&(r[n]=1),!Nl(a);)Vr();return uc(t,Cr)},G9=function(t,r){var n=-1,o=44;do switch(Nl(o)){case 0:o===38&&qn()===12&&(r[n]=1),t[n]+=q9(Cr-1,r,n);break;case 2:t[n]+=Wu(o);break;case 4:if(o===44){t[++n]=qn()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=ph(o)}while(o=Vr());return t},Q9=function(t,r){return dE(G9(uE(t),r))},gx=new WeakMap,K9=function(t){if(!(t.type!=="rule"||!t.parent||t.length<1)){for(var r=t.value,n=t.parent,o=t.column===n.column&&t.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(t.props.length===1&&r.charCodeAt(0)!==58&&!gx.get(n))&&!o){gx.set(t,!0);for(var a=[],i=Q9(r,a),l=n.props,c=0,u=0;c<i.length;c++)for(var d=0;d<l.length;d++,u++)t.props[u]=a[c]?i[c].replace(/&\f/g,l[d]):l[d]+" "+i[c]}}},Y9=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function fE(e,t){switch(R9(e,t)){case 5103:return Fe+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Fe+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Fe+e+ud+e+Zt+e+e;case 6828:case 4268:return Fe+e+Zt+e+e;case 6165:return Fe+e+Zt+"flex-"+e+e;case 5187:return Fe+e+Be(e,/(\w+).+(:[^]+)/,Fe+"box-$1$2"+Zt+"flex-$1$2")+e;case 5443:return Fe+e+Zt+"flex-item-"+Be(e,/flex-|-self/,"")+e;case 4675:return Fe+e+Zt+"flex-line-pack"+Be(e,/align-content|flex-|-self/,"")+e;case 5548:return Fe+e+Zt+Be(e,"shrink","negative")+e;case 5292:return Fe+e+Zt+Be(e,"basis","preferred-size")+e;case 6060:return Fe+"box-"+Be(e,"-grow","")+Fe+e+Zt+Be(e,"grow","positive")+e;case 4554:return Fe+Be(e,/([^-])(transform)/g,"$1"+Fe+"$2")+e;case 6187:return Be(Be(Be(e,/(zoom-|grab)/,Fe+"$1"),/(image-set)/,Fe+"$1"),e,"")+e;case 5495:case 3959:return Be(e,/(image-set\([^]*)/,Fe+"$1$`$1");case 4968:return Be(Be(e,/(.+:)(flex-)?(.*)/,Fe+"box-pack:$3"+Zt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Fe+e+e;case 4095:case 3583:case 4068:case 2532:return Be(e,/(.+)-inline(.+)/,Fe+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Vn(e)-1-t>6)switch(qt(e,t+1)){case 109:if(qt(e,t+4)!==45)break;case 102:return Be(e,/(.+:)(.+)-([^]+)/,"$1"+Fe+"$2-$3$1"+ud+(qt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Lg(e,"stretch")?fE(Be(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(qt(e,t+1)!==115)break;case 6444:switch(qt(e,Vn(e)-3-(~Lg(e,"!important")&&10))){case 107:return Be(e,":",":"+Fe)+e;case 101:return Be(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Fe+(qt(e,14)===45?"inline-":"")+"box$3$1"+Fe+"$2$3$1"+Zt+"$2box$3")+e}break;case 5936:switch(qt(e,t+11)){case 114:return Fe+e+Zt+Be(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Fe+e+Zt+Be(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Fe+e+Zt+Be(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Fe+e+Zt+e+e}return e}var X9=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case Cy:t.return=fE(t.value,t.length);break;case sE:return Ki([Ls(t,{value:Be(t.value,"@","@"+Fe)})],o);case Oy:if(t.length)return I9(t.props,function(a){switch(T9(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Ki([Ls(t,{props:[Be(a,/:(read-\w+)/,":"+ud+"$1")]})],o);case"::placeholder":return Ki([Ls(t,{props:[Be(a,/:(plac\w+)/,":"+Fe+"input-$1")]}),Ls(t,{props:[Be(a,/:(plac\w+)/,":"+ud+"$1")]}),Ls(t,{props:[Be(a,/:(plac\w+)/,Zt+"input-$1")]})],o)}return""})}},J9=[X9],pE=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(g){var _=g.getAttribute("data-emotion");_.indexOf(" ")!==-1&&(document.head.appendChild(g),g.setAttribute("data-s",""))})}var o=t.stylisPlugins||J9,a={},i,l=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(g){for(var _=g.getAttribute("data-emotion").split(" "),y=1;y<_.length;y++)a[_[y]]=!0;l.push(g)});var c,u=[K9,Y9];{var d,p=[B9,W9(function(g){d.insert(g)})],h=U9(u.concat(o,p)),m=function(_){return Ki(F9(_),h)};c=function(_,y,x,w){d=x,m(_?_+"{"+y.styles+"}":y.styles),w&&(v.inserted[y.name]=!0)}}var v={key:r,sheet:new O9({key:r,container:i,nonce:t.nonce,speedy:t.speedy,prepend:t.prepend,insertionPoint:t.insertionPoint}),nonce:t.nonce,inserted:a,registered:{},insert:c};return v.sheet.hydrate(l),v};function tt(){return tt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},tt.apply(this,arguments)}var hE={exports:{}},He={};/** @license React v16.13.1
58
+ * react-is.production.min.js
59
+ *
60
+ * Copyright (c) Facebook, Inc. and its affiliates.
61
+ *
62
+ * This source code is licensed under the MIT license found in the
63
+ * LICENSE file in the root directory of this source tree.
64
+ */var Bt=typeof Symbol=="function"&&Symbol.for,$y=Bt?Symbol.for("react.element"):60103,ky=Bt?Symbol.for("react.portal"):60106,gh=Bt?Symbol.for("react.fragment"):60107,vh=Bt?Symbol.for("react.strict_mode"):60108,yh=Bt?Symbol.for("react.profiler"):60114,xh=Bt?Symbol.for("react.provider"):60109,wh=Bt?Symbol.for("react.context"):60110,Ry=Bt?Symbol.for("react.async_mode"):60111,bh=Bt?Symbol.for("react.concurrent_mode"):60111,_h=Bt?Symbol.for("react.forward_ref"):60112,Sh=Bt?Symbol.for("react.suspense"):60113,Z9=Bt?Symbol.for("react.suspense_list"):60120,Ph=Bt?Symbol.for("react.memo"):60115,jh=Bt?Symbol.for("react.lazy"):60116,eM=Bt?Symbol.for("react.block"):60121,tM=Bt?Symbol.for("react.fundamental"):60117,rM=Bt?Symbol.for("react.responder"):60118,nM=Bt?Symbol.for("react.scope"):60119;function Hr(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case $y:switch(e=e.type,e){case Ry:case bh:case gh:case yh:case vh:case Sh:return e;default:switch(e=e&&e.$$typeof,e){case wh:case _h:case jh:case Ph:case xh:return e;default:return t}}case ky:return t}}}function mE(e){return Hr(e)===bh}He.AsyncMode=Ry;He.ConcurrentMode=bh;He.ContextConsumer=wh;He.ContextProvider=xh;He.Element=$y;He.ForwardRef=_h;He.Fragment=gh;He.Lazy=jh;He.Memo=Ph;He.Portal=ky;He.Profiler=yh;He.StrictMode=vh;He.Suspense=Sh;He.isAsyncMode=function(e){return mE(e)||Hr(e)===Ry};He.isConcurrentMode=mE;He.isContextConsumer=function(e){return Hr(e)===wh};He.isContextProvider=function(e){return Hr(e)===xh};He.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===$y};He.isForwardRef=function(e){return Hr(e)===_h};He.isFragment=function(e){return Hr(e)===gh};He.isLazy=function(e){return Hr(e)===jh};He.isMemo=function(e){return Hr(e)===Ph};He.isPortal=function(e){return Hr(e)===ky};He.isProfiler=function(e){return Hr(e)===yh};He.isStrictMode=function(e){return Hr(e)===vh};He.isSuspense=function(e){return Hr(e)===Sh};He.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===gh||e===bh||e===yh||e===vh||e===Sh||e===Z9||typeof e=="object"&&e!==null&&(e.$$typeof===jh||e.$$typeof===Ph||e.$$typeof===xh||e.$$typeof===wh||e.$$typeof===_h||e.$$typeof===tM||e.$$typeof===rM||e.$$typeof===nM||e.$$typeof===eM)};He.typeOf=Hr;hE.exports=He;var oM=hE.exports,gE=oM,aM={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},iM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},vE={};vE[gE.ForwardRef]=aM;vE[gE.Memo]=iM;var sM=!0;function lM(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):n+=o+" "}),n}var cM=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||sM===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},yE=function(t,r,n){cM(t,r,n);var o=t.key+"-"+r.name;if(t.inserted[r.name]===void 0){var a=r;do t.insert(r===a?"."+o:"",a,t.sheet,!0),a=a.next;while(a!==void 0)}};function uM(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var dM={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},fM=/[A-Z]|^ms/g,pM=/_EMO_([^_]+?)_([^]*?)_EMO_/g,xE=function(t){return t.charCodeAt(1)===45},vx=function(t){return t!=null&&typeof t!="boolean"},jm=H9(function(e){return xE(e)?e:e.replace(fM,"-$&").toLowerCase()}),yx=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(pM,function(n,o,a){return Bn={name:o,styles:a,next:Bn},o})}return dM[t]!==1&&!xE(t)&&typeof r=="number"&&r!==0?r+"px":r};function Al(e,t,r){if(r==null)return"";if(r.__emotion_styles!==void 0)return r;switch(typeof r){case"boolean":return"";case"object":{if(r.anim===1)return Bn={name:r.name,styles:r.styles,next:Bn},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)Bn={name:n.name,styles:n.styles,next:Bn},n=n.next;var o=r.styles+";";return o}return hM(e,t,r)}case"function":{if(e!==void 0){var a=Bn,i=r(e);return Bn=a,Al(e,t,i)}break}}if(t==null)return r;var l=t[r];return l!==void 0?l:r}function hM(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=Al(e,t,r[o])+";";else for(var a in r){var i=r[a];if(typeof i!="object")t!=null&&t[i]!==void 0?n+=a+"{"+t[i]+"}":vx(i)&&(n+=jm(a)+":"+yx(a,i)+";");else if(Array.isArray(i)&&typeof i[0]=="string"&&(t==null||t[i[0]]===void 0))for(var l=0;l<i.length;l++)vx(i[l])&&(n+=jm(a)+":"+yx(a,i[l])+";");else{var c=Al(e,t,i);switch(a){case"animation":case"animationName":{n+=jm(a)+":"+c+";";break}default:n+=a+"{"+c+"}"}}}return n}var xx=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Bn,Ty=function(t,r,n){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var o=!0,a="";Bn=void 0;var i=t[0];i==null||i.raw===void 0?(o=!1,a+=Al(n,r,i)):a+=i[0];for(var l=1;l<t.length;l++)a+=Al(n,r,t[l]),o&&(a+=i[l]);xx.lastIndex=0;for(var c="",u;(u=xx.exec(a))!==null;)c+="-"+u[1];var d=uM(a)+c;return{name:d,styles:a,next:Bn}},mM=Il["useInsertionEffect"]?Il["useInsertionEffect"]:!1,wx=mM||f.useLayoutEffect,wE=f.createContext(typeof HTMLElement<"u"?pE({key:"css"}):null);wE.Provider;var gM=function(t){return f.forwardRef(function(r,n){var o=f.useContext(wE);return t(r,o,n)})},Fg=f.createContext({}),vM=function(t,r){if(typeof r=="function"){var n=r(t);return n}return tt({},t,r)},yM=mx(function(e){return mx(function(t){return vM(e,t)})}),xM=function(t){var r=f.useContext(Fg);return t.theme!==r&&(r=yM(r)(t.theme)),f.createElement(Fg.Provider,{value:r},t.children)},dc=gM(function(e,t){var r=e.styles,n=Ty([r],void 0,f.useContext(Fg)),o=f.useRef();return wx(function(){var a=t.key+"-global",i=new t.sheet.constructor({key:a,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),l=!1,c=document.querySelector('style[data-emotion="'+a+" "+n.name+'"]');return t.sheet.tags.length&&(i.before=t.sheet.tags[0]),c!==null&&(l=!0,c.setAttribute("data-emotion",a),i.hydrate([c])),o.current=[i,l],function(){i.flush()}},[t]),wx(function(){var a=o.current,i=a[0],l=a[1];if(l){a[1]=!1;return}if(n.next!==void 0&&yE(t,n.next,!0),i.tags.length){var c=i.tags[i.tags.length-1].nextElementSibling;i.before=c,i.flush()}t.insert("",n,i,!1)},[t,n.name]),null});function wM(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ty(t)}var bM=Object.defineProperty,_M=Object.defineProperties,SM=Object.getOwnPropertyDescriptors,bx=Object.getOwnPropertySymbols,PM=Object.prototype.hasOwnProperty,jM=Object.prototype.propertyIsEnumerable,_x=(e,t,r)=>t in e?bM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OM=(e,t)=>{for(var r in t||(t={}))PM.call(t,r)&&_x(e,r,t[r]);if(bx)for(var r of bx(t))jM.call(t,r)&&_x(e,r,t[r]);return e},CM=(e,t)=>_M(e,SM(t));function EM({theme:e}){return S.createElement(dc,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:CM(OM({},e.fn.fontStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,fontSize:e.fontSizes.md,WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale"})}})}function zs(e,t,r,n=P){Object.keys(t).forEach(o=>{e[`--mantine-${r}-${o}`]=n(t[o])})}function $M({theme:e}){const t={"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-transition-timing-function":e.transitionTimingFunction,"--mantine-line-height":`${e.lineHeight}`,"--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}`};zs(t,e.shadows,"shadow"),zs(t,e.fontSizes,"font-size"),zs(t,e.radius,"radius"),zs(t,e.spacing,"spacing"),zs(t,e.breakpoints,"breakpoints",nr),Object.keys(e.colors).forEach(n=>{e.colors[n].forEach((o,a)=>{t[`--mantine-color-${n}-${a}`]=o})});const r=e.headings.sizes;return Object.keys(r).forEach(n=>{t[`--mantine-${n}-font-size`]=r[n].fontSize,t[`--mantine-${n}-line-height`]=`${r[n].lineHeight}`}),S.createElement(dc,{styles:{":root":t}})}var kM=Object.defineProperty,RM=Object.defineProperties,TM=Object.getOwnPropertyDescriptors,Sx=Object.getOwnPropertySymbols,IM=Object.prototype.hasOwnProperty,DM=Object.prototype.propertyIsEnumerable,Px=(e,t,r)=>t in e?kM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Nn=(e,t)=>{for(var r in t||(t={}))IM.call(t,r)&&Px(e,r,t[r]);if(Sx)for(var r of Sx(t))DM.call(t,r)&&Px(e,r,t[r]);return e},Om=(e,t)=>RM(e,TM(t));function NM(e,t){var r;if(!t)return e;const n=Object.keys(e).reduce((o,a)=>{if(a==="headings"&&t.headings){const i=t.headings.sizes?Object.keys(e.headings.sizes).reduce((l,c)=>(l[c]=Nn(Nn({},e.headings.sizes[c]),t.headings.sizes[c]),l),{}):e.headings.sizes;return Om(Nn({},o),{headings:Om(Nn(Nn({},e.headings),t.headings),{sizes:i})})}if(a==="breakpoints"&&t.breakpoints){const i=Nn(Nn({},e.breakpoints),t.breakpoints);return Om(Nn({},o),{breakpoints:Object.fromEntries(Object.entries(i).sort((l,c)=>fr(l[1])-fr(c[1])))})}return o[a]=typeof t[a]=="object"?Nn(Nn({},e[a]),t[a]):typeof t[a]=="number"||typeof t[a]=="boolean"||typeof t[a]=="function"?t[a]:t[a]||e[a],o},{});if(t!=null&&t.fontFamily&&!((r=t==null?void 0:t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),!(n.primaryColor in n.colors))throw new Error("MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color");return n}function AM(e,t){return oE(NM(e,t))}function bE(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}const MM={html:{fontFamily:"sans-serif",lineHeight:"1.15",textSizeAdjust:"100%"},body:{margin:0},"article, aside, footer, header, nav, section, figcaption, figure, main":{display:"block"},h1:{fontSize:"2em"},hr:{boxSizing:"content-box",height:0,overflow:"visible"},pre:{fontFamily:"monospace, monospace",fontSize:"1em"},a:{background:"transparent",textDecorationSkip:"objects"},"a:active, a:hover":{outlineWidth:0},"abbr[title]":{borderBottom:"none",textDecoration:"underline"},"b, strong":{fontWeight:"bolder"},"code, kbp, samp":{fontFamily:"monospace, monospace",fontSize:"1em"},dfn:{fontStyle:"italic"},mark:{backgroundColor:"#ff0",color:"#000"},small:{fontSize:"80%"},"sub, sup":{fontSize:"75%",lineHeight:0,position:"relative",verticalAlign:"baseline"},sup:{top:"-0.5em"},sub:{bottom:"-0.25em"},"audio, video":{display:"inline-block"},"audio:not([controls])":{display:"none",height:0},img:{borderStyle:"none",verticalAlign:"middle"},"svg:not(:root)":{overflow:"hidden"},"button, input, optgroup, select, textarea":{fontFamily:"sans-serif",fontSize:"100%",lineHeight:"1.15",margin:0},"button, input":{overflow:"visible"},"button, select":{textTransform:"none"},"button, [type=reset], [type=submit]":{WebkitAppearance:"button"},"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner":{borderStyle:"none",padding:0},"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring":{outline:`${P(1)} dotted ButtonText`},legend:{boxSizing:"border-box",color:"inherit",display:"table",maxWidth:"100%",padding:0,whiteSpace:"normal"},progress:{display:"inline-block",verticalAlign:"baseline"},textarea:{overflow:"auto"},"[type=checkbox], [type=radio]":{boxSizing:"border-box",padding:0},"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button":{height:"auto"},"[type=search]":{appearance:"none"},"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration":{appearance:"none"},"::-webkit-file-upload-button":{appearance:"button",font:"inherit"},"details, menu":{display:"block"},summary:{display:"list-item"},canvas:{display:"inline-block"},template:{display:"none"}};function LM(){return S.createElement(dc,{styles:MM})}var zM=Object.defineProperty,jx=Object.getOwnPropertySymbols,FM=Object.prototype.hasOwnProperty,VM=Object.prototype.propertyIsEnumerable,Ox=(e,t,r)=>t in e?zM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xl=(e,t)=>{for(var r in t||(t={}))FM.call(t,r)&&Ox(e,r,t[r]);if(jx)for(var r of jx(t))VM.call(t,r)&&Ox(e,r,t[r]);return e};const dd=f.createContext({theme:jy});function Kt(){var e;return((e=f.useContext(dd))==null?void 0:e.theme)||jy}function BM(e){const t=Kt(),r=n=>{var o,a,i,l;return{styles:((o=t.components[n])==null?void 0:o.styles)||{},classNames:((a=t.components[n])==null?void 0:a.classNames)||{},variants:(i=t.components[n])==null?void 0:i.variants,sizes:(l=t.components[n])==null?void 0:l.sizes}};return Array.isArray(e)?e.map(r):[r(e)]}function _E(){var e;return(e=f.useContext(dd))==null?void 0:e.emotionCache}function q(e,t,r){var n;const o=Kt(),a=(n=o.components[e])==null?void 0:n.defaultProps,i=typeof a=="function"?a(o):a;return xl(xl(xl({},t),i),bE(r))}function SE({theme:e,emotionCache:t,withNormalizeCSS:r=!1,withGlobalStyles:n=!1,withCSSVariables:o=!1,inherit:a=!1,children:i}){const l=f.useContext(dd),c=AM(jy,a?xl(xl({},l.theme),e):e);return S.createElement(xM,{theme:c},S.createElement(dd.Provider,{value:{theme:c,emotionCache:t}},r&&S.createElement(LM,null),n&&S.createElement(EM,{theme:c}),o&&S.createElement($M,{theme:c}),typeof c.globalStyles=="function"&&S.createElement(dc,{styles:c.globalStyles(c)}),i))}SE.displayName="@mantine/core/MantineProvider";const UM={app:100,modal:200,popover:300,overlay:400,max:9999};function Rn(e){return UM[e]}function WM(e,t){const r=f.useRef();return(!r.current||t.length!==r.current.prevDeps.length||r.current.prevDeps.map((n,o)=>n===t[o]).indexOf(!1)>=0)&&(r.current={v:e(),prevDeps:[...t]}),r.current.v}const HM=pE({key:"mantine",prepend:!0});function qM(){return _E()||HM}var GM=Object.defineProperty,Cx=Object.getOwnPropertySymbols,QM=Object.prototype.hasOwnProperty,KM=Object.prototype.propertyIsEnumerable,Ex=(e,t,r)=>t in e?GM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YM=(e,t)=>{for(var r in t||(t={}))QM.call(t,r)&&Ex(e,r,t[r]);if(Cx)for(var r of Cx(t))KM.call(t,r)&&Ex(e,r,t[r]);return e};const Cm="ref";function XM(e){let t;if(e.length!==1)return{args:e,ref:t};const[r]=e;if(!(r instanceof Object))return{args:e,ref:t};if(!(Cm in r))return{args:e,ref:t};t=r[Cm];const n=YM({},r);return delete n[Cm],{args:[n],ref:t}}const{cssFactory:JM}=(()=>{function e(r,n,o){const a=[],i=lM(r,a,o);return a.length<2?o:i+n(a)}function t(r){const{cache:n}=r,o=(...i)=>{const{ref:l,args:c}=XM(i),u=Ty(c,n.registered);return yE(n,u,!1),`${n.key}-${u.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(n.registered,o,eE(i))}}return{cssFactory:t}})();function PE(){const e=qM();return WM(()=>JM({cache:e}),[e])}function ZM({cx:e,classes:t,context:r,classNames:n,name:o,cache:a}){const i=r.reduce((l,c)=>(Object.keys(c.classNames).forEach(u=>{typeof l[u]!="string"?l[u]=`${c.classNames[u]}`:l[u]=`${l[u]} ${c.classNames[u]}`}),l),{});return Object.keys(t).reduce((l,c)=>(l[c]=e(t[c],i[c],n!=null&&n[c],Array.isArray(o)?o.filter(Boolean).map(u=>`${(a==null?void 0:a.key)||"mantine"}-${u}-${c}`).join(" "):o?`${(a==null?void 0:a.key)||"mantine"}-${o}-${c}`:null),l),{})}var eL=Object.defineProperty,$x=Object.getOwnPropertySymbols,tL=Object.prototype.hasOwnProperty,rL=Object.prototype.propertyIsEnumerable,kx=(e,t,r)=>t in e?eL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Em=(e,t)=>{for(var r in t||(t={}))tL.call(t,r)&&kx(e,r,t[r]);if($x)for(var r of $x(t))rL.call(t,r)&&kx(e,r,t[r]);return e};function Vg(e,t){return t&&Object.keys(t).forEach(r=>{e[r]?e[r]=Em(Em({},e[r]),t[r]):e[r]=Em({},t[r])}),e}function Rx(e,t,r,n){const o=a=>typeof a=="function"?a(t,r||{},n):a||{};return Array.isArray(e)?e.map(a=>o(a.styles)).reduce((a,i)=>Vg(a,i),{}):o(e)}function nL({ctx:e,theme:t,params:r,variant:n,size:o}){return e.reduce((a,i)=>(i.variants&&n in i.variants&&Vg(a,i.variants[n](t,r,{variant:n,size:o})),i.sizes&&o in i.sizes&&Vg(a,i.sizes[o](t,r,{variant:n,size:o})),a),{})}function W(e){const t=typeof e=="function"?e:()=>e;function r(n,o){const a=Kt(),i=BM(o==null?void 0:o.name),l=_E(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:u,cx:d}=PE(),p=t(a,n,c),h=Rx(o==null?void 0:o.styles,a,n,c),m=Rx(i,a,n,c),v=nL({ctx:i,theme:a,params:n,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),g=Object.fromEntries(Object.keys(p).map(_=>{const y=d({[u(p[_])]:!(o!=null&&o.unstyled)},u(v[_]),u(m[_]),u(h[_]));return[_,y]}));return{classes:ZM({cx:d,classes:g,context:i,classNames:o==null?void 0:o.classNames,name:o==null?void 0:o.name,cache:l}),cx:d,theme:a}}return r}function zt(e){return`___ref-${e||""}`}function jE({styles:e}){const t=Kt();return S.createElement(dc,{styles:wM(typeof e=="function"?e(t):e)})}var oL=Object.defineProperty,aL=Object.defineProperties,iL=Object.getOwnPropertyDescriptors,Tx=Object.getOwnPropertySymbols,sL=Object.prototype.hasOwnProperty,lL=Object.prototype.propertyIsEnumerable,Ix=(e,t,r)=>t in e?oL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fs=(e,t)=>{for(var r in t||(t={}))sL.call(t,r)&&Ix(e,r,t[r]);if(Tx)for(var r of Tx(t))lL.call(t,r)&&Ix(e,r,t[r]);return e},Vs=(e,t)=>aL(e,iL(t));const Bs={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${P(10)})`},transitionProperty:"transform, opacity"},qc={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},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(-${P(20)}) 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(${P(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${P(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${P(20)}) 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:Vs(Fs({},Bs),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Vs(Fs({},Bs),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Vs(Fs({},Bs),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Vs(Fs({},Bs),{common:{transformOrigin:"top left"}}),"pop-top-right":Vs(Fs({},Bs),{common:{transformOrigin:"top right"}})},Dx=["mousedown","touchstart"];function cL(e,t,r){const n=f.useRef();return f.useEffect(()=>{const o=a=>{const{target:i}=a??{};if(Array.isArray(r)){const l=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";r.every(u=>!!u&&!a.composedPath().includes(u))&&!l&&e()}else n.current&&!n.current.contains(i)&&e()};return(t||Dx).forEach(a=>document.addEventListener(a,o)),()=>{(t||Dx).forEach(a=>document.removeEventListener(a,o))}},[n,e,r]),n}function uL({timeout:e=2e3}={}){const[t,r]=f.useState(null),[n,o]=f.useState(!1),[a,i]=f.useState(null),l=d=>{clearTimeout(a),i(setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(p=>r(p)):r(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),r(null),clearTimeout(a)},error:t,copied:n}}function dL(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function fL(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function pL(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=f.useState(r?t:fL(e,t)),a=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return a.current=window.matchMedia(e),o(a.current.matches),dL(a.current,i=>o(i.matches))},[e]),n}const OE=typeof document<"u"?f.useLayoutEffect:f.useEffect;function on(e,t){const r=f.useRef(!1);f.useEffect(()=>()=>{r.current=!1},[]),f.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function CE({opened:e,shouldReturnFocus:t=!0}){const r=f.useRef(),n=()=>{var o;r.current&&"focus"in r.current&&typeof r.current.focus=="function"&&((o=r.current)==null||o.focus({preventScroll:!0}))};return on(()=>{let o=-1;const a=i=>{i.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",a),e?r.current=document.activeElement:t&&(o=window.setTimeout(n,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",a)}},[e,t]),n}const hL=/input|select|textarea|button|object/,EE="a, input, select, textarea, button, object, [tabindex]";function mL(e){return e.style.display==="none"}function gL(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let r=e;for(;r&&!(r===document.body||r.nodeType===11);){if(mL(r))return!1;r=r.parentNode}return!0}function $E(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Bg(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN($E(e));return(hL.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&gL(e)}function kE(e){const t=$E(e);return(Number.isNaN(t)||t>=0)&&Bg(e)}function vL(e){return Array.from(e.querySelectorAll(EE)).filter(kE)}function yL(e,t){const r=vL(e);if(!r.length){t.preventDefault();return}const n=r[t.shiftKey?0:r.length-1],o=e.getRootNode();if(!(n===o.activeElement||e===o.activeElement))return;t.preventDefault();const i=r[t.shiftKey?r.length-1:0];i&&i.focus()}function Oh(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function xL(e,t="body > :not(script)"){const r=Oh(),n=Array.from(document.querySelectorAll(t)).map(o=>{var a;if((a=o==null?void 0:o.shadowRoot)!=null&&a.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),l=o.getAttribute("data-hidden"),c=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",r),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!l&&!c&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:l||null}});return()=>{n.forEach(o=>{!o||r!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}function wL(e=!0){const t=f.useRef(),r=f.useRef(null),n=a=>{let i=a.querySelector("[data-autofocus]");if(!i){const l=Array.from(a.querySelectorAll(EE));i=l.find(kE)||l.find(Bg)||null,!i&&Bg(a)&&(i=a)}i&&i.focus({preventScroll:!0})},o=f.useCallback(a=>{if(e){if(a===null){r.current&&(r.current(),r.current=null);return}r.current=xL(a),t.current!==a&&(a?(setTimeout(()=>{a.getRootNode()&&n(a)}),t.current=a):t.current=null)}},[e]);return f.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const a=i=>{i.key==="Tab"&&t.current&&yL(t.current,i)};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),r.current&&r.current()}},[e]),o}const bL=e=>(e+1)%1e6;function _L(){const[,e]=f.useReducer(bL,0);return e}const SL=S["useId".toString()]||(()=>{});function PL(){const e=SL();return e?`mantine-${e.replace(/:/g,"")}`:""}function kr(e){const t=PL(),[r,n]=f.useState(t);return OE(()=>{n(Oh())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function Ug(e,t,r){f.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function RE(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function jL(...e){return t=>{e.forEach(r=>RE(r,t))}}function Cs(...e){return f.useCallback(jL(...e),e)}function Er({value:e,defaultValue:t,finalValue:r,onChange:n=()=>{}}){const[o,a]=f.useState(t!==void 0?t:r),i=l=>{a(l),n==null||n(l)};return e!==void 0?[e,n,!0]:[o,i,!1]}function No(e,t){const r=t-e+1;return Array.from({length:r},(n,o)=>o+e)}const Gc="dots";function OL({total:e,siblings:t=1,boundaries:r=1,page:n,initialPage:o=1,onChange:a}){const i=Math.max(Math.trunc(e),0),[l,c]=Er({value:n,onChange:a,defaultValue:o,finalValue:o}),u=g=>{g<=0?c(1):g>i?c(i):c(g)},d=()=>u(l+1),p=()=>u(l-1),h=()=>u(1),m=()=>u(i);return{range:f.useMemo(()=>{if(t*2+3+r*2>=i)return No(1,i);const _=Math.max(l-t,r),y=Math.min(l+t,i-r),x=_>r+2,w=y<i-(r+1);if(!x&&w){const b=t*2+r+2;return[...No(1,b),Gc,...No(i-(r-1),i)]}if(x&&!w){const b=r+1+2*t;return[...No(1,r),Gc,...No(i-b,i)]}return[...No(1,r),Gc,...No(_,y),Gc,...No(i-r+1,i)]},[i,t,l]),active:l,setPage:u,next:d,previous:p,first:h,last:m}}function CL({initialValues:e=[],limit:t}){const[{state:r,queue:n},o]=f.useState({state:e.slice(0,t),queue:e.slice(t)});return{state:r,queue:n,add:(...c)=>o(u=>{const d=[...u.state,...u.queue,...c];return{state:d.slice(0,t),queue:d.slice(t)}}),update:c=>o(u=>{const d=c([...u.state,...u.queue]);return{state:d.slice(0,t),queue:d.slice(t)}}),cleanQueue:()=>o(c=>({state:c.state,queue:[]}))}}function Ch(e,t){return pL("(prefers-reduced-motion: reduce)",e,t)}const EL=e=>e<.5?2*e*e:-1+(4-2*e)*e,$L=({axis:e,target:t,parent:r,alignment:n,offset:o,isList:a})=>{if(!t||!r&&typeof document>"u")return 0;const i=!!r,c=(r||document.body).getBoundingClientRect(),u=t.getBoundingClientRect(),d=p=>u[p]-c[p];if(e==="y"){const p=d("top");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.height*(a?0:1)||!a?m:0}const h=i?c.height:window.innerHeight;if(n==="end"){const m=p+o-h+u.height;return m>=-u.height*(a?0:1)||!a?m:0}return n==="center"?p-h/2+u.height/2:0}if(e==="x"){const p=d("left");if(p===0)return 0;if(n==="start"){const m=p-o;return m<=u.width||!a?m:0}const h=i?c.width:window.innerWidth;if(n==="end"){const m=p+o-h+u.width;return m>=-u.width||!a?m:0}return n==="center"?p-h/2+u.width/2:0}return 0},kL=({axis:e,parent:t})=>{if(!t&&typeof document>"u")return 0;const r=e==="y"?"scrollTop":"scrollLeft";if(t)return t[r];const{body:n,documentElement:o}=document;return n[r]+o[r]},RL=({axis:e,parent:t,distance:r})=>{if(!t&&typeof document>"u")return;const n=e==="y"?"scrollTop":"scrollLeft";if(t)t[n]=r;else{const{body:o,documentElement:a}=document;o[n]=r,a[n]=r}};function TL({duration:e=1250,axis:t="y",onScrollFinish:r,easing:n=EL,offset:o=0,cancelable:a=!0,isList:i=!1}={}){const l=f.useRef(0),c=f.useRef(0),u=f.useRef(!1),d=f.useRef(null),p=f.useRef(null),h=Ch(),m=()=>{l.current&&cancelAnimationFrame(l.current)},v=f.useCallback(({alignment:_="start"}={})=>{var y;u.current=!1,l.current&&m();const x=(y=kL({parent:d.current,axis:t}))!=null?y:0,w=$L({parent:d.current,target:p.current,axis:t,alignment:_,offset:o,isList:i})-(d.current?0:x);function b(){c.current===0&&(c.current=performance.now());const C=performance.now()-c.current,j=h||e===0?1:C/e,E=x+w*n(j);RL({parent:d.current,axis:t,distance:E}),!u.current&&j<1?l.current=requestAnimationFrame(b):(typeof r=="function"&&r(),c.current=0,l.current=0,m())}b()},[t,e,n,i,o,r,h]),g=()=>{a&&(u.current=!0)};return Ug("wheel",g,{passive:!0}),Ug("touchmove",g,{passive:!0}),f.useEffect(()=>m,[]),{scrollableRef:d,targetRef:p,scrollIntoView:v,cancel:m}}function IL(e=!1,t){const{onOpen:r,onClose:n}=t||{},[o,a]=f.useState(e),i=f.useCallback(()=>{a(u=>u||(r==null||r(),!0))},[r]),l=f.useCallback(()=>{a(u=>u&&(n==null||n(),!1))},[n]),c=f.useCallback(()=>{o?l():i()},[l,i,o]);return[o,{open:i,close:l,toggle:c}]}function Nx(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var Ax=Object.getOwnPropertySymbols,DL=Object.prototype.hasOwnProperty,NL=Object.prototype.propertyIsEnumerable,AL=(e,t)=>{var r={};for(var n in e)DL.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ax)for(var n of Ax(e))t.indexOf(n)<0&&NL.call(e,n)&&(r[n]=e[n]);return r};function Jn(e){const t=e,{m:r,mx:n,my:o,mt:a,mb:i,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:_,c:y,opacity:x,ff:w,fz:b,fw:O,lts:C,ta:j,lh:E,fs:T,tt:$,td:I,w:k,miw:D,maw:N,h:z,mih:H,mah:K,bgsz:R,bgp:M,bgr:B,bga:Q,pos:ne,top:Ee,left:ce,bottom:Le,right:Ie,inset:pt,display:rt}=t,nt=AL(t,["m","mx","my","mt","mb","ml","mr","p","px","py","pt","pb","pl","pr","bg","c","opacity","ff","fz","fw","lts","ta","lh","fs","tt","td","w","miw","maw","h","mih","mah","bgsz","bgp","bgr","bga","pos","top","left","bottom","right","inset","display"]);return{systemStyles:bE({m:r,mx:n,my:o,mt:a,mb:i,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:m,pl:v,pr:g,bg:_,c:y,opacity:x,ff:w,fz:b,fw:O,lts:C,ta:j,lh:E,fs:T,tt:$,td:I,w:k,miw:D,maw:N,h:z,mih:H,mah:K,bgsz:R,bgp:M,bgr:B,bga:Q,pos:ne,top:Ee,left:ce,bottom:Le,right:Ie,inset:pt,display:rt}),rest:nt}}function ML(e,t){const r=Object.keys(e).filter(n=>n!=="base").sort((n,o)=>fr(A({size:n,sizes:t.breakpoints}))-fr(A({size:o,sizes:t.breakpoints})));return"base"in e?["base",...r]:r}function LL({value:e,theme:t,getValue:r,property:n}){if(e==null)return;if(typeof e=="object")return ML(e,t).reduce((i,l)=>{if(l==="base"&&e.base!==void 0){const u=r(e.base,t);return Array.isArray(n)?(n.forEach(d=>{i[d]=u}),i):(i[n]=u,i)}const c=r(e[l],t);return Array.isArray(n)?(i[t.fn.largerThan(l)]={},n.forEach(u=>{i[t.fn.largerThan(l)][u]=c}),i):(i[t.fn.largerThan(l)]={[n]:c},i)},{});const o=r(e,t);return Array.isArray(n)?n.reduce((a,i)=>(a[i]=o,a),{}):{[n]:o}}function zL(e,t){return e==="dimmed"?t.colorScheme==="dark"?t.colors.dark[2]:t.colors.gray[6]:t.fn.variant({variant:"filled",color:e,primaryFallback:!1}).background}function FL(e){return P(e)}function VL(e){return e}function BL(e,t){return A({size:e,sizes:t.fontSizes})}const UL=["-xs","-sm","-md","-lg","-xl"];function WL(e,t){return UL.includes(e)?`calc(${A({size:e.replace("-",""),sizes:t.spacing})} * -1)`:A({size:e,sizes:t.spacing})}const HL={identity:VL,color:zL,size:FL,fontSize:BL,spacing:WL},qL={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"},mx:{type:"spacing",property:["marginRight","marginLeft"]},my:{type:"spacing",property:["marginTop","marginBottom"]},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"},px:{type:"spacing",property:["paddingRight","paddingLeft"]},py:{type:"spacing",property:["paddingTop","paddingBottom"]},bg:{type:"color",property:"background"},c:{type:"color",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"identity",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"identity",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:"identity",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"}};var GL=Object.defineProperty,Mx=Object.getOwnPropertySymbols,QL=Object.prototype.hasOwnProperty,KL=Object.prototype.propertyIsEnumerable,Lx=(e,t,r)=>t in e?GL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zx=(e,t)=>{for(var r in t||(t={}))QL.call(t,r)&&Lx(e,r,t[r]);if(Mx)for(var r of Mx(t))KL.call(t,r)&&Lx(e,r,t[r]);return e};function Wg(e,t,r=qL){return Object.keys(r).reduce((o,a)=>(a in e&&e[a]!==void 0&&o.push(LL({value:e[a],getValue:HL[r[a].type],property:r[a].property,theme:t})),o),[]).reduce((o,a)=>(Object.keys(a).forEach(i=>{typeof a[i]=="object"&&a[i]!==null&&i in o?o[i]=zx(zx({},o[i]),a[i]):o[i]=a[i]}),o),{})}function Fx(e,t){return typeof e=="function"?e(t):e}function YL(e,t,r){const n=Kt(),{css:o,cx:a}=PE();return Array.isArray(e)?a(r,o(Wg(t,n)),e.map(i=>o(Fx(i,n)))):a(r,o(Fx(e,n)),o(Wg(t,n)))}var XL=Object.defineProperty,fd=Object.getOwnPropertySymbols,TE=Object.prototype.hasOwnProperty,IE=Object.prototype.propertyIsEnumerable,Vx=(e,t,r)=>t in e?XL(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,JL=(e,t)=>{for(var r in t||(t={}))TE.call(t,r)&&Vx(e,r,t[r]);if(fd)for(var r of fd(t))IE.call(t,r)&&Vx(e,r,t[r]);return e},ZL=(e,t)=>{var r={};for(var n in e)TE.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&fd)for(var n of fd(e))t.indexOf(n)<0&&IE.call(e,n)&&(r[n]=e[n]);return r};const DE=f.forwardRef((e,t)=>{var r=e,{className:n,component:o,style:a,sx:i}=r,l=ZL(r,["className","component","style","sx"]);const{systemStyles:c,rest:u}=Jn(l),d=o||"div";return S.createElement(d,JL({ref:t,className:YL(i,c,n),style:a},u))});DE.displayName="@mantine/core/Box";const oe=DE;var ez=Object.defineProperty,tz=Object.defineProperties,rz=Object.getOwnPropertyDescriptors,Bx=Object.getOwnPropertySymbols,nz=Object.prototype.hasOwnProperty,oz=Object.prototype.propertyIsEnumerable,Ux=(e,t,r)=>t in e?ez(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wx=(e,t)=>{for(var r in t||(t={}))nz.call(t,r)&&Ux(e,r,t[r]);if(Bx)for(var r of Bx(t))oz.call(t,r)&&Ux(e,r,t[r]);return e},az=(e,t)=>tz(e,rz(t)),iz=W(e=>({root:az(Wx(Wx({},e.fn.focusStyles()),e.fn.fontStyles()),{cursor:"pointer",border:0,padding:0,appearance:"none",fontSize:e.fontSizes.md,backgroundColor:"transparent",textAlign:"left",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,textDecoration:"none",boxSizing:"border-box"})}));const sz=iz;var lz=Object.defineProperty,pd=Object.getOwnPropertySymbols,NE=Object.prototype.hasOwnProperty,AE=Object.prototype.propertyIsEnumerable,Hx=(e,t,r)=>t in e?lz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cz=(e,t)=>{for(var r in t||(t={}))NE.call(t,r)&&Hx(e,r,t[r]);if(pd)for(var r of pd(t))AE.call(t,r)&&Hx(e,r,t[r]);return e},uz=(e,t)=>{var r={};for(var n in e)NE.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pd)for(var n of pd(e))t.indexOf(n)<0&&AE.call(e,n)&&(r[n]=e[n]);return r};const ME=f.forwardRef((e,t)=>{const r=q("UnstyledButton",{},e),{className:n,component:o="button",unstyled:a,variant:i}=r,l=uz(r,["className","component","unstyled","variant"]),{classes:c,cx:u}=sz(null,{name:"UnstyledButton",unstyled:a,variant:i});return S.createElement(oe,cz({component:o,ref:t,className:u(c.root,n),type:o==="button"?"button":void 0},l))});ME.displayName="@mantine/core/UnstyledButton";const ho=ME;var LE={exports:{}},qr={},zE={exports:{}},FE={};/**
65
+ * @license React
66
+ * scheduler.production.min.js
67
+ *
68
+ * Copyright (c) Facebook, Inc. and its affiliates.
69
+ *
70
+ * This source code is licensed under the MIT license found in the
71
+ * LICENSE file in the root directory of this source tree.
72
+ */(function(e){function t(R,M){var B=R.length;R.push(M);e:for(;0<B;){var Q=B-1>>>1,ne=R[Q];if(0<o(ne,M))R[Q]=M,R[B]=ne,B=Q;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var M=R[0],B=R.pop();if(B!==M){R[0]=B;e:for(var Q=0,ne=R.length,Ee=ne>>>1;Q<Ee;){var ce=2*(Q+1)-1,Le=R[ce],Ie=ce+1,pt=R[Ie];if(0>o(Le,B))Ie<ne&&0>o(pt,Le)?(R[Q]=pt,R[Ie]=B,Q=Ie):(R[Q]=Le,R[ce]=B,Q=ce);else if(Ie<ne&&0>o(pt,B))R[Q]=pt,R[Ie]=B,Q=Ie;else break e}}return M}function o(R,M){var B=R.sortIndex-M.sortIndex;return B!==0?B:R.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var i=Date,l=i.now();e.unstable_now=function(){return i.now()-l}}var c=[],u=[],d=1,p=null,h=3,m=!1,v=!1,g=!1,_=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(R){for(var M=r(u);M!==null;){if(M.callback===null)n(u);else if(M.startTime<=R)n(u),M.sortIndex=M.expirationTime,t(c,M);else break;M=r(u)}}function b(R){if(g=!1,w(R),!v)if(r(c)!==null)v=!0,H(O);else{var M=r(u);M!==null&&K(b,M.startTime-R)}}function O(R,M){v=!1,g&&(g=!1,y(E),E=-1),m=!0;var B=h;try{for(w(M),p=r(c);p!==null&&(!(p.expirationTime>M)||R&&!I());){var Q=p.callback;if(typeof Q=="function"){p.callback=null,h=p.priorityLevel;var ne=Q(p.expirationTime<=M);M=e.unstable_now(),typeof ne=="function"?p.callback=ne:p===r(c)&&n(c),w(M)}else n(c);p=r(c)}if(p!==null)var Ee=!0;else{var ce=r(u);ce!==null&&K(b,ce.startTime-M),Ee=!1}return Ee}finally{p=null,h=B,m=!1}}var C=!1,j=null,E=-1,T=5,$=-1;function I(){return!(e.unstable_now()-$<T)}function k(){if(j!==null){var R=e.unstable_now();$=R;var M=!0;try{M=j(!0,R)}finally{M?D():(C=!1,j=null)}}else C=!1}var D;if(typeof x=="function")D=function(){x(k)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,z=N.port2;N.port1.onmessage=k,D=function(){z.postMessage(null)}}else D=function(){_(k,0)};function H(R){j=R,C||(C=!0,D())}function K(R,M){E=_(function(){R(e.unstable_now())},M)}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(R){R.callback=null},e.unstable_continueExecution=function(){v||m||(v=!0,H(O))},e.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<R?Math.floor(1e3/R):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return r(c)},e.unstable_next=function(R){switch(h){case 1:case 2:case 3:var M=3;break;default:M=h}var B=h;h=M;try{return R()}finally{h=B}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,M){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var B=h;h=R;try{return M()}finally{h=B}},e.unstable_scheduleCallback=function(R,M,B){var Q=e.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?Q+B:Q):B=Q,R){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=B+ne,R={id:d++,callback:M,priorityLevel:R,startTime:B,expirationTime:ne,sortIndex:-1},B>Q?(R.sortIndex=B,t(u,R),r(c)===null&&R===r(u)&&(g?(y(E),E=-1):g=!0,K(b,B-Q))):(R.sortIndex=ne,t(c,R),v||m||(v=!0,H(O))),R},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(R){var M=h;return function(){var B=h;h=M;try{return R.apply(this,arguments)}finally{h=B}}}})(FE);zE.exports=FE;var dz=zE.exports;/**
73
+ * @license React
74
+ * react-dom.production.min.js
75
+ *
76
+ * Copyright (c) Facebook, Inc. and its affiliates.
77
+ *
78
+ * This source code is licensed under the MIT license found in the
79
+ * LICENSE file in the root directory of this source tree.
80
+ */var VE=f,Wr=dz;function G(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var BE=new Set,Ml={};function ri(e,t){ss(e,t),ss(e+"Capture",t)}function ss(e,t){for(Ml[e]=t,e=0;e<t.length;e++)BE.add(t[e])}var mo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hg=Object.prototype.hasOwnProperty,fz=/^[: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]*$/,qx={},Gx={};function pz(e){return Hg.call(Gx,e)?!0:Hg.call(qx,e)?!1:fz.test(e)?Gx[e]=!0:(qx[e]=!0,!1)}function hz(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function mz(e,t,r,n){if(t===null||typeof t>"u"||hz(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function mr(e,t,r,n,o,a,i){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=a,this.removeEmptyString=i}var Qt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Qt[e]=new mr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Qt[t]=new mr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Qt[e]=new mr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Qt[e]=new mr(e,2,!1,e,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(e){Qt[e]=new mr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Qt[e]=new mr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Qt[e]=new mr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Qt[e]=new mr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Qt[e]=new mr(e,5,!1,e.toLowerCase(),null,!1,!1)});var Iy=/[\-:]([a-z])/g;function Dy(e){return e[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(e){var t=e.replace(Iy,Dy);Qt[t]=new mr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Iy,Dy);Qt[t]=new mr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Iy,Dy);Qt[t]=new mr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Qt[e]=new mr(e,1,!1,e.toLowerCase(),null,!1,!1)});Qt.xlinkHref=new mr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Qt[e]=new mr(e,1,!1,e.toLowerCase(),null,!0,!0)});function Ny(e,t,r,n){var o=Qt.hasOwnProperty(t)?Qt[t]:null;(o!==null?o.type!==0:n||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(mz(t,r,o,n)&&(r=null),n||o===null?pz(t)&&(r===null?e.removeAttribute(t):e.setAttribute(t,""+r)):o.mustUseProperty?e[o.propertyName]=r===null?o.type===3?!1:"":r:(t=o.attributeName,n=o.attributeNamespace,r===null?e.removeAttribute(t):(o=o.type,r=o===3||o===4&&r===!0?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}var jo=VE.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Qc=Symbol.for("react.element"),Ii=Symbol.for("react.portal"),Di=Symbol.for("react.fragment"),Ay=Symbol.for("react.strict_mode"),qg=Symbol.for("react.profiler"),UE=Symbol.for("react.provider"),WE=Symbol.for("react.context"),My=Symbol.for("react.forward_ref"),Gg=Symbol.for("react.suspense"),Qg=Symbol.for("react.suspense_list"),Ly=Symbol.for("react.memo"),zo=Symbol.for("react.lazy"),HE=Symbol.for("react.offscreen"),Qx=Symbol.iterator;function Us(e){return e===null||typeof e!="object"?null:(e=Qx&&e[Qx]||e["@@iterator"],typeof e=="function"?e:null)}var _t=Object.assign,$m;function fl(e){if($m===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);$m=t&&t[1]||""}return`
81
+ `+$m+e}var km=!1;function Rm(e,t){if(!e||km)return"";km=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var n=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){n=u}e.call(t.prototype)}else{try{throw Error()}catch(u){n=u}e()}}catch(u){if(u&&n&&typeof u.stack=="string"){for(var o=u.stack.split(`
82
+ `),a=n.stack.split(`
83
+ `),i=o.length-1,l=a.length-1;1<=i&&0<=l&&o[i]!==a[l];)l--;for(;1<=i&&0<=l;i--,l--)if(o[i]!==a[l]){if(i!==1||l!==1)do if(i--,l--,0>l||o[i]!==a[l]){var c=`
84
+ `+o[i].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=i&&0<=l);break}}}finally{km=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?fl(e):""}function gz(e){switch(e.tag){case 5:return fl(e.type);case 16:return fl("Lazy");case 13:return fl("Suspense");case 19:return fl("SuspenseList");case 0:case 2:case 15:return e=Rm(e.type,!1),e;case 11:return e=Rm(e.type.render,!1),e;case 1:return e=Rm(e.type,!0),e;default:return""}}function Kg(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Di:return"Fragment";case Ii:return"Portal";case qg:return"Profiler";case Ay:return"StrictMode";case Gg:return"Suspense";case Qg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case WE:return(e.displayName||"Context")+".Consumer";case UE:return(e._context.displayName||"Context")+".Provider";case My:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ly:return t=e.displayName||null,t!==null?t:Kg(e.type)||"Memo";case zo:t=e._payload,e=e._init;try{return Kg(e(t))}catch{}}return null}function vz(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Kg(t);case 8:return t===Ay?"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 t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function aa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qE(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function yz(e){var t=qE(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(i){n=""+i,a.call(this,i)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(i){n=""+i},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kc(e){e._valueTracker||(e._valueTracker=yz(e))}function GE(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=qE(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function hd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Yg(e,t){var r=t.checked;return _t({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Kx(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=aa(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function QE(e,t){t=t.checked,t!=null&&Ny(e,"checked",t,!1)}function Xg(e,t){QE(e,t);var r=aa(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Jg(e,t.type,r):t.hasOwnProperty("defaultValue")&&Jg(e,t.type,aa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Yx(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Jg(e,t,r){(t!=="number"||hd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var pl=Array.isArray;function Yi(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o<r.length;o++)t["$"+r[o]]=!0;for(r=0;r<e.length;r++)o=t.hasOwnProperty("$"+e[r].value),e[r].selected!==o&&(e[r].selected=o),o&&n&&(e[r].defaultSelected=!0)}else{for(r=""+aa(r),t=null,o=0;o<e.length;o++){if(e[o].value===r){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Zg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(G(91));return _t({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Xx(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(G(92));if(pl(r)){if(1<r.length)throw Error(G(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:aa(r)}}function KE(e,t){var r=aa(t.value),n=aa(t.defaultValue);r!=null&&(r=""+r,r!==e.value&&(e.value=r),t.defaultValue==null&&e.defaultValue!==r&&(e.defaultValue=r)),n!=null&&(e.defaultValue=""+n)}function Jx(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function YE(e){switch(e){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 ev(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?YE(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Yc,XE=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,r,n,o){MSApp.execUnsafeLocalFunction(function(){return e(t,r,n,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Yc=Yc||document.createElement("div"),Yc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Yc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ll(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var wl={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},xz=["Webkit","ms","Moz","O"];Object.keys(wl).forEach(function(e){xz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),wl[t]=wl[e]})});function JE(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||wl.hasOwnProperty(e)&&wl[e]?(""+t).trim():t+"px"}function ZE(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=JE(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var wz=_t({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 tv(e,t){if(t){if(wz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(G(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(G(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(G(61))}if(t.style!=null&&typeof t.style!="object")throw Error(G(62))}}function rv(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){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 nv=null;function zy(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ov=null,Xi=null,Ji=null;function Zx(e){if(e=hc(e)){if(typeof ov!="function")throw Error(G(280));var t=e.stateNode;t&&(t=Th(t),ov(e.stateNode,e.type,t))}}function e$(e){Xi?Ji?Ji.push(e):Ji=[e]:Xi=e}function t$(){if(Xi){var e=Xi,t=Ji;if(Ji=Xi=null,Zx(e),t)for(e=0;e<t.length;e++)Zx(t[e])}}function r$(e,t){return e(t)}function n$(){}var Tm=!1;function o$(e,t,r){if(Tm)return e(t,r);Tm=!0;try{return r$(e,t,r)}finally{Tm=!1,(Xi!==null||Ji!==null)&&(n$(),t$())}}function zl(e,t){var r=e.stateNode;if(r===null)return null;var n=Th(r);if(n===null)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(G(231,t,typeof r));return r}var av=!1;if(mo)try{var Ws={};Object.defineProperty(Ws,"passive",{get:function(){av=!0}}),window.addEventListener("test",Ws,Ws),window.removeEventListener("test",Ws,Ws)}catch{av=!1}function bz(e,t,r,n,o,a,i,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(r,u)}catch(d){this.onError(d)}}var bl=!1,md=null,gd=!1,iv=null,_z={onError:function(e){bl=!0,md=e}};function Sz(e,t,r,n,o,a,i,l,c){bl=!1,md=null,bz.apply(_z,arguments)}function Pz(e,t,r,n,o,a,i,l,c){if(Sz.apply(this,arguments),bl){if(bl){var u=md;bl=!1,md=null}else throw Error(G(198));gd||(gd=!0,iv=u)}}function ni(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(r=t.return),e=t.return;while(e)}return t.tag===3?r:null}function a$(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ew(e){if(ni(e)!==e)throw Error(G(188))}function jz(e){var t=e.alternate;if(!t){if(t=ni(e),t===null)throw Error(G(188));return t!==e?null:e}for(var r=e,n=t;;){var o=r.return;if(o===null)break;var a=o.alternate;if(a===null){if(n=o.return,n!==null){r=n;continue}break}if(o.child===a.child){for(a=o.child;a;){if(a===r)return ew(o),e;if(a===n)return ew(o),t;a=a.sibling}throw Error(G(188))}if(r.return!==n.return)r=o,n=a;else{for(var i=!1,l=o.child;l;){if(l===r){i=!0,r=o,n=a;break}if(l===n){i=!0,n=o,r=a;break}l=l.sibling}if(!i){for(l=a.child;l;){if(l===r){i=!0,r=a,n=o;break}if(l===n){i=!0,n=a,r=o;break}l=l.sibling}if(!i)throw Error(G(189))}}if(r.alternate!==n)throw Error(G(190))}if(r.tag!==3)throw Error(G(188));return r.stateNode.current===r?e:t}function i$(e){return e=jz(e),e!==null?s$(e):null}function s$(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=s$(e);if(t!==null)return t;e=e.sibling}return null}var l$=Wr.unstable_scheduleCallback,tw=Wr.unstable_cancelCallback,Oz=Wr.unstable_shouldYield,Cz=Wr.unstable_requestPaint,Et=Wr.unstable_now,Ez=Wr.unstable_getCurrentPriorityLevel,Fy=Wr.unstable_ImmediatePriority,c$=Wr.unstable_UserBlockingPriority,vd=Wr.unstable_NormalPriority,$z=Wr.unstable_LowPriority,u$=Wr.unstable_IdlePriority,Eh=null,Gn=null;function kz(e){if(Gn&&typeof Gn.onCommitFiberRoot=="function")try{Gn.onCommitFiberRoot(Eh,e,void 0,(e.current.flags&128)===128)}catch{}}var Pn=Math.clz32?Math.clz32:Iz,Rz=Math.log,Tz=Math.LN2;function Iz(e){return e>>>=0,e===0?32:31-(Rz(e)/Tz|0)|0}var Xc=64,Jc=4194304;function hl(e){switch(e&-e){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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function yd(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,a=e.pingedLanes,i=r&268435455;if(i!==0){var l=i&~o;l!==0?n=hl(l):(a&=i,a!==0&&(n=hl(a)))}else i=r&~o,i!==0?n=hl(i):a!==0&&(n=hl(a));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,a=t&-t,o>=a||o===16&&(a&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0<t;)r=31-Pn(t),o=1<<r,n|=e[r],t&=~o;return n}function Dz(e,t){switch(e){case 1:case 2:case 4:return t+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 t+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 Nz(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-Pn(a),l=1<<i,c=o[i];c===-1?(!(l&r)||l&n)&&(o[i]=Dz(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function sv(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function d$(){var e=Xc;return Xc<<=1,!(Xc&4194240)&&(Xc=64),e}function Im(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function fc(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Pn(t),e[t]=r}function Az(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var o=31-Pn(r),a=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~a}}function Vy(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-Pn(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var We=0;function f$(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var p$,By,h$,m$,g$,lv=!1,Zc=[],Yo=null,Xo=null,Jo=null,Fl=new Map,Vl=new Map,Uo=[],Mz="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 rw(e,t){switch(e){case"focusin":case"focusout":Yo=null;break;case"dragenter":case"dragleave":Xo=null;break;case"mouseover":case"mouseout":Jo=null;break;case"pointerover":case"pointerout":Fl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vl.delete(t.pointerId)}}function Hs(e,t,r,n,o,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:a,targetContainers:[o]},t!==null&&(t=hc(t),t!==null&&By(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Lz(e,t,r,n,o){switch(t){case"focusin":return Yo=Hs(Yo,e,t,r,n,o),!0;case"dragenter":return Xo=Hs(Xo,e,t,r,n,o),!0;case"mouseover":return Jo=Hs(Jo,e,t,r,n,o),!0;case"pointerover":var a=o.pointerId;return Fl.set(a,Hs(Fl.get(a)||null,e,t,r,n,o)),!0;case"gotpointercapture":return a=o.pointerId,Vl.set(a,Hs(Vl.get(a)||null,e,t,r,n,o)),!0}return!1}function v$(e){var t=Da(e.target);if(t!==null){var r=ni(t);if(r!==null){if(t=r.tag,t===13){if(t=a$(r),t!==null){e.blockedOn=t,g$(e.priority,function(){h$(r)});return}}else if(t===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=cv(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);nv=n,r.target.dispatchEvent(n),nv=null}else return t=hc(r),t!==null&&By(t),e.blockedOn=r,!1;t.shift()}return!0}function nw(e,t,r){qu(e)&&r.delete(t)}function zz(){lv=!1,Yo!==null&&qu(Yo)&&(Yo=null),Xo!==null&&qu(Xo)&&(Xo=null),Jo!==null&&qu(Jo)&&(Jo=null),Fl.forEach(nw),Vl.forEach(nw)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,lv||(lv=!0,Wr.unstable_scheduleCallback(Wr.unstable_NormalPriority,zz)))}function Bl(e){function t(o){return qs(o,e)}if(0<Zc.length){qs(Zc[0],e);for(var r=1;r<Zc.length;r++){var n=Zc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Yo!==null&&qs(Yo,e),Xo!==null&&qs(Xo,e),Jo!==null&&qs(Jo,e),Fl.forEach(t),Vl.forEach(t),r=0;r<Uo.length;r++)n=Uo[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Uo.length&&(r=Uo[0],r.blockedOn===null);)v$(r),r.blockedOn===null&&Uo.shift()}var Zi=jo.ReactCurrentBatchConfig,xd=!0;function Fz(e,t,r,n){var o=We,a=Zi.transition;Zi.transition=null;try{We=1,Uy(e,t,r,n)}finally{We=o,Zi.transition=a}}function Vz(e,t,r,n){var o=We,a=Zi.transition;Zi.transition=null;try{We=4,Uy(e,t,r,n)}finally{We=o,Zi.transition=a}}function Uy(e,t,r,n){if(xd){var o=cv(e,t,r,n);if(o===null)Um(e,t,n,wd,r),rw(e,n);else if(Lz(o,e,t,r,n))n.stopPropagation();else if(rw(e,n),t&4&&-1<Mz.indexOf(e)){for(;o!==null;){var a=hc(o);if(a!==null&&p$(a),a=cv(e,t,r,n),a===null&&Um(e,t,n,wd,r),a===o)break;o=a}o!==null&&n.stopPropagation()}else Um(e,t,n,null,r)}}var wd=null;function cv(e,t,r,n){if(wd=null,e=zy(n),e=Da(e),e!==null)if(t=ni(e),t===null)e=null;else if(r=t.tag,r===13){if(e=a$(t),e!==null)return e;e=null}else if(r===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return wd=e,null}function y$(e){switch(e){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(Ez()){case Fy:return 1;case c$:return 4;case vd:case $z:return 16;case u$:return 536870912;default:return 16}default:return 16}}var Ho=null,Wy=null,Gu=null;function x$(){if(Gu)return Gu;var e,t=Wy,r=t.length,n,o="value"in Ho?Ho.value:Ho.textContent,a=o.length;for(e=0;e<r&&t[e]===o[e];e++);var i=r-e;for(n=1;n<=i&&t[r-n]===o[a-n];n++);return Gu=o.slice(e,1<n?1-n:void 0)}function Qu(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function eu(){return!0}function ow(){return!1}function Gr(e){function t(r,n,o,a,i){this._reactName=r,this._targetInst=o,this.type=n,this.nativeEvent=a,this.target=i,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(r=e[l],this[l]=r?r(a):a[l]);return this.isDefaultPrevented=(a.defaultPrevented!=null?a.defaultPrevented:a.returnValue===!1)?eu:ow,this.isPropagationStopped=ow,this}return _t(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=eu)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=eu)},persist:function(){},isPersistent:eu}),t}var Es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Hy=Gr(Es),pc=_t({},Es,{view:0,detail:0}),Bz=Gr(pc),Dm,Nm,Gs,$h=_t({},pc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qy,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Gs&&(Gs&&e.type==="mousemove"?(Dm=e.screenX-Gs.screenX,Nm=e.screenY-Gs.screenY):Nm=Dm=0,Gs=e),Dm)},movementY:function(e){return"movementY"in e?e.movementY:Nm}}),aw=Gr($h),Uz=_t({},$h,{dataTransfer:0}),Wz=Gr(Uz),Hz=_t({},pc,{relatedTarget:0}),Am=Gr(Hz),qz=_t({},Es,{animationName:0,elapsedTime:0,pseudoElement:0}),Gz=Gr(qz),Qz=_t({},Es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kz=Gr(Qz),Yz=_t({},Es,{data:0}),iw=Gr(Yz),Xz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Jz={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"},Zz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function e6(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Zz[e])?!!t[e]:!1}function qy(){return e6}var t6=_t({},pc,{key:function(e){if(e.key){var t=Xz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Qu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Jz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qy,charCode:function(e){return e.type==="keypress"?Qu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Qu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),r6=Gr(t6),n6=_t({},$h,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sw=Gr(n6),o6=_t({},pc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qy}),a6=Gr(o6),i6=_t({},Es,{propertyName:0,elapsedTime:0,pseudoElement:0}),s6=Gr(i6),l6=_t({},$h,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),c6=Gr(l6),u6=[9,13,27,32],Gy=mo&&"CompositionEvent"in window,_l=null;mo&&"documentMode"in document&&(_l=document.documentMode);var d6=mo&&"TextEvent"in window&&!_l,w$=mo&&(!Gy||_l&&8<_l&&11>=_l),lw=String.fromCharCode(32),cw=!1;function b$(e,t){switch(e){case"keyup":return u6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _$(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ni=!1;function f6(e,t){switch(e){case"compositionend":return _$(t);case"keypress":return t.which!==32?null:(cw=!0,lw);case"textInput":return e=t.data,e===lw&&cw?null:e;default:return null}}function p6(e,t){if(Ni)return e==="compositionend"||!Gy&&b$(e,t)?(e=x$(),Gu=Wy=Ho=null,Ni=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return w$&&t.locale!=="ko"?null:t.data;default:return null}}var h6={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 uw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!h6[e.type]:t==="textarea"}function S$(e,t,r,n){e$(n),t=bd(t,"onChange"),0<t.length&&(r=new Hy("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Sl=null,Ul=null;function m6(e){D$(e,0)}function kh(e){var t=Li(e);if(GE(t))return e}function g6(e,t){if(e==="change")return t}var P$=!1;if(mo){var Mm;if(mo){var Lm="oninput"in document;if(!Lm){var dw=document.createElement("div");dw.setAttribute("oninput","return;"),Lm=typeof dw.oninput=="function"}Mm=Lm}else Mm=!1;P$=Mm&&(!document.documentMode||9<document.documentMode)}function fw(){Sl&&(Sl.detachEvent("onpropertychange",j$),Ul=Sl=null)}function j$(e){if(e.propertyName==="value"&&kh(Ul)){var t=[];S$(t,Ul,e,zy(e)),o$(m6,t)}}function v6(e,t,r){e==="focusin"?(fw(),Sl=t,Ul=r,Sl.attachEvent("onpropertychange",j$)):e==="focusout"&&fw()}function y6(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return kh(Ul)}function x6(e,t){if(e==="click")return kh(t)}function w6(e,t){if(e==="input"||e==="change")return kh(t)}function b6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var On=typeof Object.is=="function"?Object.is:b6;function Wl(e,t){if(On(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var o=r[n];if(!Hg.call(t,o)||!On(e[o],t[o]))return!1}return!0}function pw(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function hw(e,t){var r=pw(e);e=0;for(var n;r;){if(r.nodeType===3){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=pw(r)}}function O$(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?O$(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function C$(){for(var e=window,t=hd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=hd(e.document)}return t}function Qy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function _6(e){var t=C$(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&O$(r.ownerDocument.documentElement,r)){if(n!==null&&Qy(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,a=Math.min(n.start,o);n=n.end===void 0?a:Math.min(n.end,o),!e.extend&&a>n&&(o=n,n=a,a=o),o=hw(r,a);var i=hw(r,n);o&&i&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==i.node||e.focusOffset!==i.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),a>n?(e.addRange(t),e.extend(i.node,i.offset)):(t.setEnd(i.node,i.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<t.length;r++)e=t[r],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var S6=mo&&"documentMode"in document&&11>=document.documentMode,Ai=null,uv=null,Pl=null,dv=!1;function mw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;dv||Ai==null||Ai!==hd(n)||(n=Ai,"selectionStart"in n&&Qy(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),Pl&&Wl(Pl,n)||(Pl=n,n=bd(uv,"onSelect"),0<n.length&&(t=new Hy("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ai)))}function tu(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Mi={animationend:tu("Animation","AnimationEnd"),animationiteration:tu("Animation","AnimationIteration"),animationstart:tu("Animation","AnimationStart"),transitionend:tu("Transition","TransitionEnd")},zm={},E$={};mo&&(E$=document.createElement("div").style,"AnimationEvent"in window||(delete Mi.animationend.animation,delete Mi.animationiteration.animation,delete Mi.animationstart.animation),"TransitionEvent"in window||delete Mi.transitionend.transition);function Rh(e){if(zm[e])return zm[e];if(!Mi[e])return e;var t=Mi[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in E$)return zm[e]=t[r];return e}var $$=Rh("animationend"),k$=Rh("animationiteration"),R$=Rh("animationstart"),T$=Rh("transitionend"),I$=new Map,gw="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 fa(e,t){I$.set(e,t),ri(t,[e])}for(var Fm=0;Fm<gw.length;Fm++){var Vm=gw[Fm],P6=Vm.toLowerCase(),j6=Vm[0].toUpperCase()+Vm.slice(1);fa(P6,"on"+j6)}fa($$,"onAnimationEnd");fa(k$,"onAnimationIteration");fa(R$,"onAnimationStart");fa("dblclick","onDoubleClick");fa("focusin","onFocus");fa("focusout","onBlur");fa(T$,"onTransitionEnd");ss("onMouseEnter",["mouseout","mouseover"]);ss("onMouseLeave",["mouseout","mouseover"]);ss("onPointerEnter",["pointerout","pointerover"]);ss("onPointerLeave",["pointerout","pointerover"]);ri("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ri("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ri("onBeforeInput",["compositionend","keypress","textInput","paste"]);ri("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ri("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ri("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ml="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(" "),O6=new Set("cancel close invalid load scroll toggle".split(" ").concat(ml));function vw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,Pz(n,t,void 0,e),e.currentTarget=null}function D$(e,t){t=(t&4)!==0;for(var r=0;r<e.length;r++){var n=e[r],o=n.event;n=n.listeners;e:{var a=void 0;if(t)for(var i=n.length-1;0<=i;i--){var l=n[i],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==a&&o.isPropagationStopped())break e;vw(o,l,u),a=c}else for(i=0;i<n.length;i++){if(l=n[i],c=l.instance,u=l.currentTarget,l=l.listener,c!==a&&o.isPropagationStopped())break e;vw(o,l,u),a=c}}}if(gd)throw e=iv,gd=!1,iv=null,e}function ot(e,t){var r=t[gv];r===void 0&&(r=t[gv]=new Set);var n=e+"__bubble";r.has(n)||(N$(t,e,2,!1),r.add(n))}function Bm(e,t,r){var n=0;t&&(n|=4),N$(r,e,n,t)}var ru="_reactListening"+Math.random().toString(36).slice(2);function Hl(e){if(!e[ru]){e[ru]=!0,BE.forEach(function(r){r!=="selectionchange"&&(O6.has(r)||Bm(r,!1,e),Bm(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ru]||(t[ru]=!0,Bm("selectionchange",!1,t))}}function N$(e,t,r,n){switch(y$(t)){case 1:var o=Fz;break;case 4:o=Vz;break;default:o=Uy}r=o.bind(null,t,r,e),o=void 0,!av||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,r,{capture:!0,passive:o}):e.addEventListener(t,r,!0):o!==void 0?e.addEventListener(t,r,{passive:o}):e.addEventListener(t,r,!1)}function Um(e,t,r,n,o){var a=n;if(!(t&1)&&!(t&2)&&n!==null)e:for(;;){if(n===null)return;var i=n.tag;if(i===3||i===4){var l=n.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(i===4)for(i=n.return;i!==null;){var c=i.tag;if((c===3||c===4)&&(c=i.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;i=i.return}for(;l!==null;){if(i=Da(l),i===null)return;if(c=i.tag,c===5||c===6){n=a=i;continue e}l=l.parentNode}}n=n.return}o$(function(){var u=a,d=zy(r),p=[];e:{var h=I$.get(e);if(h!==void 0){var m=Hy,v=e;switch(e){case"keypress":if(Qu(r)===0)break e;case"keydown":case"keyup":m=r6;break;case"focusin":v="focus",m=Am;break;case"focusout":v="blur",m=Am;break;case"beforeblur":case"afterblur":m=Am;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=aw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Wz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=a6;break;case $$:case k$:case R$:m=Gz;break;case T$:m=s6;break;case"scroll":m=Bz;break;case"wheel":m=c6;break;case"copy":case"cut":case"paste":m=Kz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=sw}var g=(t&4)!==0,_=!g&&e==="scroll",y=g?h!==null?h+"Capture":null:h;g=[];for(var x=u,w;x!==null;){w=x;var b=w.stateNode;if(w.tag===5&&b!==null&&(w=b,y!==null&&(b=zl(x,y),b!=null&&g.push(ql(x,b,w)))),_)break;x=x.return}0<g.length&&(h=new m(h,v,null,r,d),p.push({event:h,listeners:g}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&r!==nv&&(v=r.relatedTarget||r.fromElement)&&(Da(v)||v[go]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(v=r.relatedTarget||r.toElement,m=u,v=v?Da(v):null,v!==null&&(_=ni(v),v!==_||v.tag!==5&&v.tag!==6)&&(v=null)):(m=null,v=u),m!==v)){if(g=aw,b="onMouseLeave",y="onMouseEnter",x="mouse",(e==="pointerout"||e==="pointerover")&&(g=sw,b="onPointerLeave",y="onPointerEnter",x="pointer"),_=m==null?h:Li(m),w=v==null?h:Li(v),h=new g(b,x+"leave",m,r,d),h.target=_,h.relatedTarget=w,b=null,Da(d)===u&&(g=new g(y,x+"enter",v,r,d),g.target=w,g.relatedTarget=_,b=g),_=b,m&&v)t:{for(g=m,y=v,x=0,w=g;w;w=bi(w))x++;for(w=0,b=y;b;b=bi(b))w++;for(;0<x-w;)g=bi(g),x--;for(;0<w-x;)y=bi(y),w--;for(;x--;){if(g===y||y!==null&&g===y.alternate)break t;g=bi(g),y=bi(y)}g=null}else g=null;m!==null&&yw(p,h,m,g,!1),v!==null&&_!==null&&yw(p,_,v,g,!0)}}e:{if(h=u?Li(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var O=g6;else if(uw(h))if(P$)O=w6;else{O=y6;var C=v6}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(O=x6);if(O&&(O=O(e,u))){S$(p,O,r,d);break e}C&&C(e,h,u),e==="focusout"&&(C=h._wrapperState)&&C.controlled&&h.type==="number"&&Jg(h,"number",h.value)}switch(C=u?Li(u):window,e){case"focusin":(uw(C)||C.contentEditable==="true")&&(Ai=C,uv=u,Pl=null);break;case"focusout":Pl=uv=Ai=null;break;case"mousedown":dv=!0;break;case"contextmenu":case"mouseup":case"dragend":dv=!1,mw(p,r,d);break;case"selectionchange":if(S6)break;case"keydown":case"keyup":mw(p,r,d)}var j;if(Gy)e:{switch(e){case"compositionstart":var E="onCompositionStart";break e;case"compositionend":E="onCompositionEnd";break e;case"compositionupdate":E="onCompositionUpdate";break e}E=void 0}else Ni?b$(e,r)&&(E="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(E="onCompositionStart");E&&(w$&&r.locale!=="ko"&&(Ni||E!=="onCompositionStart"?E==="onCompositionEnd"&&Ni&&(j=x$()):(Ho=d,Wy="value"in Ho?Ho.value:Ho.textContent,Ni=!0)),C=bd(u,E),0<C.length&&(E=new iw(E,e,null,r,d),p.push({event:E,listeners:C}),j?E.data=j:(j=_$(r),j!==null&&(E.data=j)))),(j=d6?f6(e,r):p6(e,r))&&(u=bd(u,"onBeforeInput"),0<u.length&&(d=new iw("onBeforeInput","beforeinput",null,r,d),p.push({event:d,listeners:u}),d.data=j))}D$(p,t)})}function ql(e,t,r){return{instance:e,listener:t,currentTarget:r}}function bd(e,t){for(var r=t+"Capture",n=[];e!==null;){var o=e,a=o.stateNode;o.tag===5&&a!==null&&(o=a,a=zl(e,r),a!=null&&n.unshift(ql(e,a,o)),a=zl(e,t),a!=null&&n.push(ql(e,a,o))),e=e.return}return n}function bi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yw(e,t,r,n,o){for(var a=t._reactName,i=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,o?(c=zl(r,a),c!=null&&i.unshift(ql(r,c,l))):o||(c=zl(r,a),c!=null&&i.push(ql(r,c,l)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var C6=/\r\n?/g,E6=/\u0000|\uFFFD/g;function xw(e){return(typeof e=="string"?e:""+e).replace(C6,`
85
+ `).replace(E6,"")}function nu(e,t,r){if(t=xw(t),xw(e)!==t&&r)throw Error(G(425))}function _d(){}var fv=null,pv=null;function hv(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var mv=typeof setTimeout=="function"?setTimeout:void 0,$6=typeof clearTimeout=="function"?clearTimeout:void 0,ww=typeof Promise=="function"?Promise:void 0,k6=typeof queueMicrotask=="function"?queueMicrotask:typeof ww<"u"?function(e){return ww.resolve(null).then(e).catch(R6)}:mv;function R6(e){setTimeout(function(){throw e})}function Wm(e,t){var r=t,n=0;do{var o=r.nextSibling;if(e.removeChild(r),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(n===0){e.removeChild(o),Bl(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=o}while(r);Bl(t)}function Zo(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function bw(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"){if(t===0)return e;t--}else r==="/$"&&t++}e=e.previousSibling}return null}var $s=Math.random().toString(36).slice(2),Wn="__reactFiber$"+$s,Gl="__reactProps$"+$s,go="__reactContainer$"+$s,gv="__reactEvents$"+$s,T6="__reactListeners$"+$s,I6="__reactHandles$"+$s;function Da(e){var t=e[Wn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[go]||r[Wn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=bw(e);e!==null;){if(r=e[Wn])return r;e=bw(e)}return t}e=r,r=e.parentNode}return null}function hc(e){return e=e[Wn]||e[go],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Li(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(G(33))}function Th(e){return e[Gl]||null}var vv=[],zi=-1;function pa(e){return{current:e}}function it(e){0>zi||(e.current=vv[zi],vv[zi]=null,zi--)}function Je(e,t){zi++,vv[zi]=e.current,e.current=t}var ia={},or=pa(ia),Pr=pa(!1),Ua=ia;function ls(e,t){var r=e.type.contextTypes;if(!r)return ia;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},a;for(a in r)o[a]=t[a];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function jr(e){return e=e.childContextTypes,e!=null}function Sd(){it(Pr),it(or)}function _w(e,t,r){if(or.current!==ia)throw Error(G(168));Je(or,t),Je(Pr,r)}function A$(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(G(108,vz(e)||"Unknown",o));return _t({},r,n)}function Pd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ia,Ua=or.current,Je(or,e),Je(Pr,Pr.current),!0}function Sw(e,t,r){var n=e.stateNode;if(!n)throw Error(G(169));r?(e=A$(e,t,Ua),n.__reactInternalMemoizedMergedChildContext=e,it(Pr),it(or),Je(or,e)):it(Pr),Je(Pr,r)}var ao=null,Ih=!1,Hm=!1;function M$(e){ao===null?ao=[e]:ao.push(e)}function D6(e){Ih=!0,M$(e)}function ha(){if(!Hm&&ao!==null){Hm=!0;var e=0,t=We;try{var r=ao;for(We=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}ao=null,Ih=!1}catch(o){throw ao!==null&&(ao=ao.slice(e+1)),l$(Fy,ha),o}finally{We=t,Hm=!1}}return null}var Fi=[],Vi=0,jd=null,Od=0,en=[],tn=0,Wa=null,so=1,lo="";function Ea(e,t){Fi[Vi++]=Od,Fi[Vi++]=jd,jd=e,Od=t}function L$(e,t,r){en[tn++]=so,en[tn++]=lo,en[tn++]=Wa,Wa=e;var n=so;e=lo;var o=32-Pn(n)-1;n&=~(1<<o),r+=1;var a=32-Pn(t)+o;if(30<a){var i=o-o%5;a=(n&(1<<i)-1).toString(32),n>>=i,o-=i,so=1<<32-Pn(t)+o|r<<o|n,lo=a+e}else so=1<<a|r<<o|n,lo=e}function Ky(e){e.return!==null&&(Ea(e,1),L$(e,1,0))}function Yy(e){for(;e===jd;)jd=Fi[--Vi],Fi[Vi]=null,Od=Fi[--Vi],Fi[Vi]=null;for(;e===Wa;)Wa=en[--tn],en[tn]=null,lo=en[--tn],en[tn]=null,so=en[--tn],en[tn]=null}var Br=null,Fr=null,ut=!1,_n=null;function z$(e,t){var r=rn(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,t=e.deletions,t===null?(e.deletions=[r],e.flags|=16):t.push(r)}function Pw(e,t){switch(e.tag){case 5:var r=e.type;return t=t.nodeType!==1||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Br=e,Fr=Zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Br=e,Fr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Wa!==null?{id:so,overflow:lo}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=rn(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Br=e,Fr=null,!0):!1;default:return!1}}function yv(e){return(e.mode&1)!==0&&(e.flags&128)===0}function xv(e){if(ut){var t=Fr;if(t){var r=t;if(!Pw(e,t)){if(yv(e))throw Error(G(418));t=Zo(r.nextSibling);var n=Br;t&&Pw(e,t)?z$(n,r):(e.flags=e.flags&-4097|2,ut=!1,Br=e)}}else{if(yv(e))throw Error(G(418));e.flags=e.flags&-4097|2,ut=!1,Br=e}}}function jw(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Br=e}function ou(e){if(e!==Br)return!1;if(!ut)return jw(e),ut=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!hv(e.type,e.memoizedProps)),t&&(t=Fr)){if(yv(e))throw F$(),Error(G(418));for(;t;)z$(e,t),t=Zo(t.nextSibling)}if(jw(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(G(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Fr=Zo(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Fr=null}}else Fr=Br?Zo(e.stateNode.nextSibling):null;return!0}function F$(){for(var e=Fr;e;)e=Zo(e.nextSibling)}function cs(){Fr=Br=null,ut=!1}function Xy(e){_n===null?_n=[e]:_n.push(e)}var N6=jo.ReactCurrentBatchConfig;function xn(e,t){if(e&&e.defaultProps){t=_t({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var Cd=pa(null),Ed=null,Bi=null,Jy=null;function Zy(){Jy=Bi=Ed=null}function e0(e){var t=Cd.current;it(Cd),e._currentValue=t}function wv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function es(e,t){Ed=e,Jy=Bi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(_r=!0),e.firstContext=null)}function cn(e){var t=e._currentValue;if(Jy!==e)if(e={context:e,memoizedValue:t,next:null},Bi===null){if(Ed===null)throw Error(G(308));Bi=e,Ed.dependencies={lanes:0,firstContext:e}}else Bi=Bi.next=e;return t}var Na=null;function t0(e){Na===null?Na=[e]:Na.push(e)}function V$(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,t0(t)):(r.next=o.next,o.next=r),t.interleaved=r,vo(e,n)}function vo(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Fo=!1;function r0(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function B$(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function co(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ea(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,Ae&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,vo(e,r)}return o=n.interleaved,o===null?(t.next=t,t0(n)):(t.next=o.next,o.next=t),n.interleaved=t,vo(e,r)}function Ku(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Vy(e,r)}}function Ow(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,a=null;if(r=r.firstBaseUpdate,r!==null){do{var i={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};a===null?o=a=i:a=a.next=i,r=r.next}while(r!==null);a===null?o=a=t:a=a.next=t}else o=a=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:a,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function $d(e,t,r,n){var o=e.updateQueue;Fo=!1;var a=o.firstBaseUpdate,i=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,i===null?a=u:i.next=u,i=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==i&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(a!==null){var p=o.baseState;i=0,d=u=c=null,l=a;do{var h=l.lane,m=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,g=l;switch(h=t,m=r,g.tag){case 1:if(v=g.payload,typeof v=="function"){p=v.call(m,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=g.payload,h=typeof v=="function"?v.call(m,p,h):v,h==null)break e;p=_t({},p,h);break e;case 2:Fo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=p):d=d.next=m,i|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(1);if(d===null&&(c=p),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do i|=o.lane,o=o.next;while(o!==t)}else a===null&&(o.shared.lanes=0);qa|=i,e.lanes=i,e.memoizedState=p}}function Cw(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],o=n.callback;if(o!==null){if(n.callback=null,n=r,typeof o!="function")throw Error(G(191,o));o.call(n)}}}var U$=new VE.Component().refs;function bv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:_t({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var Dh={isMounted:function(e){return(e=e._reactInternals)?ni(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=cr(),o=ra(e),a=co(n,o);a.payload=t,r!=null&&(a.callback=r),t=ea(e,a,o),t!==null&&(jn(t,e,o,n),Ku(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=cr(),o=ra(e),a=co(n,o);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ea(e,a,o),t!==null&&(jn(t,e,o,n),Ku(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=cr(),n=ra(e),o=co(r,n);o.tag=2,t!=null&&(o.callback=t),t=ea(e,o,n),t!==null&&(jn(t,e,n,r),Ku(t,e,n))}};function Ew(e,t,r,n,o,a,i){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,a,i):t.prototype&&t.prototype.isPureReactComponent?!Wl(r,n)||!Wl(o,a):!0}function W$(e,t,r){var n=!1,o=ia,a=t.contextType;return typeof a=="object"&&a!==null?a=cn(a):(o=jr(t)?Ua:or.current,n=t.contextTypes,a=(n=n!=null)?ls(e,o):ia),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Dh,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function $w(e,t,r,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(r,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&Dh.enqueueReplaceState(t,t.state,null)}function _v(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=U$,r0(e);var a=t.contextType;typeof a=="object"&&a!==null?o.context=cn(a):(a=jr(t)?Ua:or.current,o.context=ls(e,a)),o.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(bv(e,t,a,r),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Dh.enqueueReplaceState(o,o.state,null),$d(e,r,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Qs(e,t,r){if(e=r.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(G(309));var n=r.stateNode}if(!n)throw Error(G(147,e));var o=n,a=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===a?t.ref:(t=function(i){var l=o.refs;l===U$&&(l=o.refs={}),i===null?delete l[a]:l[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(G(284));if(!r._owner)throw Error(G(290,e))}return e}function au(e,t){throw e=Object.prototype.toString.call(t),Error(G(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function kw(e){var t=e._init;return t(e._payload)}function H$(e){function t(y,x){if(e){var w=y.deletions;w===null?(y.deletions=[x],y.flags|=16):w.push(x)}}function r(y,x){if(!e)return null;for(;x!==null;)t(y,x),x=x.sibling;return null}function n(y,x){for(y=new Map;x!==null;)x.key!==null?y.set(x.key,x):y.set(x.index,x),x=x.sibling;return y}function o(y,x){return y=na(y,x),y.index=0,y.sibling=null,y}function a(y,x,w){return y.index=w,e?(w=y.alternate,w!==null?(w=w.index,w<x?(y.flags|=2,x):w):(y.flags|=2,x)):(y.flags|=1048576,x)}function i(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,x,w,b){return x===null||x.tag!==6?(x=Jm(w,y.mode,b),x.return=y,x):(x=o(x,w),x.return=y,x)}function c(y,x,w,b){var O=w.type;return O===Di?d(y,x,w.props.children,b,w.key):x!==null&&(x.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===zo&&kw(O)===x.type)?(b=o(x,w.props),b.ref=Qs(y,x,w),b.return=y,b):(b=td(w.type,w.key,w.props,null,y.mode,b),b.ref=Qs(y,x,w),b.return=y,b)}function u(y,x,w,b){return x===null||x.tag!==4||x.stateNode.containerInfo!==w.containerInfo||x.stateNode.implementation!==w.implementation?(x=Zm(w,y.mode,b),x.return=y,x):(x=o(x,w.children||[]),x.return=y,x)}function d(y,x,w,b,O){return x===null||x.tag!==7?(x=Fa(w,y.mode,b,O),x.return=y,x):(x=o(x,w),x.return=y,x)}function p(y,x,w){if(typeof x=="string"&&x!==""||typeof x=="number")return x=Jm(""+x,y.mode,w),x.return=y,x;if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Qc:return w=td(x.type,x.key,x.props,null,y.mode,w),w.ref=Qs(y,null,x),w.return=y,w;case Ii:return x=Zm(x,y.mode,w),x.return=y,x;case zo:var b=x._init;return p(y,b(x._payload),w)}if(pl(x)||Us(x))return x=Fa(x,y.mode,w,null),x.return=y,x;au(y,x)}return null}function h(y,x,w,b){var O=x!==null?x.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return O!==null?null:l(y,x,""+w,b);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Qc:return w.key===O?c(y,x,w,b):null;case Ii:return w.key===O?u(y,x,w,b):null;case zo:return O=w._init,h(y,x,O(w._payload),b)}if(pl(w)||Us(w))return O!==null?null:d(y,x,w,b,null);au(y,w)}return null}function m(y,x,w,b,O){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(w)||null,l(x,y,""+b,O);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case Qc:return y=y.get(b.key===null?w:b.key)||null,c(x,y,b,O);case Ii:return y=y.get(b.key===null?w:b.key)||null,u(x,y,b,O);case zo:var C=b._init;return m(y,x,w,C(b._payload),O)}if(pl(b)||Us(b))return y=y.get(w)||null,d(x,y,b,O,null);au(x,b)}return null}function v(y,x,w,b){for(var O=null,C=null,j=x,E=x=0,T=null;j!==null&&E<w.length;E++){j.index>E?(T=j,j=null):T=j.sibling;var $=h(y,j,w[E],b);if($===null){j===null&&(j=T);break}e&&j&&$.alternate===null&&t(y,j),x=a($,x,E),C===null?O=$:C.sibling=$,C=$,j=T}if(E===w.length)return r(y,j),ut&&Ea(y,E),O;if(j===null){for(;E<w.length;E++)j=p(y,w[E],b),j!==null&&(x=a(j,x,E),C===null?O=j:C.sibling=j,C=j);return ut&&Ea(y,E),O}for(j=n(y,j);E<w.length;E++)T=m(j,y,E,w[E],b),T!==null&&(e&&T.alternate!==null&&j.delete(T.key===null?E:T.key),x=a(T,x,E),C===null?O=T:C.sibling=T,C=T);return e&&j.forEach(function(I){return t(y,I)}),ut&&Ea(y,E),O}function g(y,x,w,b){var O=Us(w);if(typeof O!="function")throw Error(G(150));if(w=O.call(w),w==null)throw Error(G(151));for(var C=O=null,j=x,E=x=0,T=null,$=w.next();j!==null&&!$.done;E++,$=w.next()){j.index>E?(T=j,j=null):T=j.sibling;var I=h(y,j,$.value,b);if(I===null){j===null&&(j=T);break}e&&j&&I.alternate===null&&t(y,j),x=a(I,x,E),C===null?O=I:C.sibling=I,C=I,j=T}if($.done)return r(y,j),ut&&Ea(y,E),O;if(j===null){for(;!$.done;E++,$=w.next())$=p(y,$.value,b),$!==null&&(x=a($,x,E),C===null?O=$:C.sibling=$,C=$);return ut&&Ea(y,E),O}for(j=n(y,j);!$.done;E++,$=w.next())$=m(j,y,E,$.value,b),$!==null&&(e&&$.alternate!==null&&j.delete($.key===null?E:$.key),x=a($,x,E),C===null?O=$:C.sibling=$,C=$);return e&&j.forEach(function(k){return t(y,k)}),ut&&Ea(y,E),O}function _(y,x,w,b){if(typeof w=="object"&&w!==null&&w.type===Di&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Qc:e:{for(var O=w.key,C=x;C!==null;){if(C.key===O){if(O=w.type,O===Di){if(C.tag===7){r(y,C.sibling),x=o(C,w.props.children),x.return=y,y=x;break e}}else if(C.elementType===O||typeof O=="object"&&O!==null&&O.$$typeof===zo&&kw(O)===C.type){r(y,C.sibling),x=o(C,w.props),x.ref=Qs(y,C,w),x.return=y,y=x;break e}r(y,C);break}else t(y,C);C=C.sibling}w.type===Di?(x=Fa(w.props.children,y.mode,b,w.key),x.return=y,y=x):(b=td(w.type,w.key,w.props,null,y.mode,b),b.ref=Qs(y,x,w),b.return=y,y=b)}return i(y);case Ii:e:{for(C=w.key;x!==null;){if(x.key===C)if(x.tag===4&&x.stateNode.containerInfo===w.containerInfo&&x.stateNode.implementation===w.implementation){r(y,x.sibling),x=o(x,w.children||[]),x.return=y,y=x;break e}else{r(y,x);break}else t(y,x);x=x.sibling}x=Zm(w,y.mode,b),x.return=y,y=x}return i(y);case zo:return C=w._init,_(y,x,C(w._payload),b)}if(pl(w))return v(y,x,w,b);if(Us(w))return g(y,x,w,b);au(y,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,x!==null&&x.tag===6?(r(y,x.sibling),x=o(x,w),x.return=y,y=x):(r(y,x),x=Jm(w,y.mode,b),x.return=y,y=x),i(y)):r(y,x)}return _}var us=H$(!0),q$=H$(!1),mc={},Qn=pa(mc),Ql=pa(mc),Kl=pa(mc);function Aa(e){if(e===mc)throw Error(G(174));return e}function n0(e,t){switch(Je(Kl,t),Je(Ql,e),Je(Qn,mc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ev(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ev(t,e)}it(Qn),Je(Qn,t)}function ds(){it(Qn),it(Ql),it(Kl)}function G$(e){Aa(Kl.current);var t=Aa(Qn.current),r=ev(t,e.type);t!==r&&(Je(Ql,e),Je(Qn,r))}function o0(e){Ql.current===e&&(it(Qn),it(Ql))}var wt=pa(0);function kd(e){for(var t=e;t!==null;){if(t.tag===13){var r=t.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var qm=[];function a0(){for(var e=0;e<qm.length;e++)qm[e]._workInProgressVersionPrimary=null;qm.length=0}var Yu=jo.ReactCurrentDispatcher,Gm=jo.ReactCurrentBatchConfig,Ha=0,bt=null,At=null,Lt=null,Rd=!1,jl=!1,Yl=0,A6=0;function Xt(){throw Error(G(321))}function i0(e,t){if(t===null)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!On(e[r],t[r]))return!1;return!0}function s0(e,t,r,n,o,a){if(Ha=a,bt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Yu.current=e===null||e.memoizedState===null?F6:V6,e=r(n,o),jl){a=0;do{if(jl=!1,Yl=0,25<=a)throw Error(G(301));a+=1,Lt=At=null,t.updateQueue=null,Yu.current=B6,e=r(n,o)}while(jl)}if(Yu.current=Td,t=At!==null&&At.next!==null,Ha=0,Lt=At=bt=null,Rd=!1,t)throw Error(G(300));return e}function l0(){var e=Yl!==0;return Yl=0,e}function zn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Lt===null?bt.memoizedState=Lt=e:Lt=Lt.next=e,Lt}function un(){if(At===null){var e=bt.alternate;e=e!==null?e.memoizedState:null}else e=At.next;var t=Lt===null?bt.memoizedState:Lt.next;if(t!==null)Lt=t,At=e;else{if(e===null)throw Error(G(310));At=e,e={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Lt===null?bt.memoizedState=Lt=e:Lt=Lt.next=e}return Lt}function Xl(e,t){return typeof t=="function"?t(e):t}function Qm(e){var t=un(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=At,o=n.baseQueue,a=r.pending;if(a!==null){if(o!==null){var i=o.next;o.next=a.next,a.next=i}n.baseQueue=o=a,r.pending=null}if(o!==null){a=o.next,n=n.baseState;var l=i=null,c=null,u=a;do{var d=u.lane;if((Ha&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:e(n,u.action);else{var p={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=p,i=n):c=c.next=p,bt.lanes|=d,qa|=d}u=u.next}while(u!==null&&u!==a);c===null?i=n:c.next=l,On(n,t.memoizedState)||(_r=!0),t.memoizedState=n,t.baseState=i,t.baseQueue=c,r.lastRenderedState=n}if(e=r.interleaved,e!==null){o=e;do a=o.lane,bt.lanes|=a,qa|=a,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Km(e){var t=un(),r=t.queue;if(r===null)throw Error(G(311));r.lastRenderedReducer=e;var n=r.dispatch,o=r.pending,a=t.memoizedState;if(o!==null){r.pending=null;var i=o=o.next;do a=e(a,i.action),i=i.next;while(i!==o);On(a,t.memoizedState)||(_r=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function Q$(){}function K$(e,t){var r=bt,n=un(),o=t(),a=!On(n.memoizedState,o);if(a&&(n.memoizedState=o,_r=!0),n=n.queue,c0(J$.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Lt!==null&&Lt.memoizedState.tag&1){if(r.flags|=2048,Jl(9,X$.bind(null,r,n,o,t),void 0,null),Ft===null)throw Error(G(349));Ha&30||Y$(r,t,o)}return o}function Y$(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=bt.updateQueue,t===null?(t={lastEffect:null,stores:null},bt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function X$(e,t,r,n){t.value=r,t.getSnapshot=n,Z$(t)&&e2(e)}function J$(e,t,r){return r(function(){Z$(t)&&e2(e)})}function Z$(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!On(e,r)}catch{return!0}}function e2(e){var t=vo(e,1);t!==null&&jn(t,e,1,-1)}function Rw(e){var t=zn();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xl,lastRenderedState:e},t.queue=e,e=e.dispatch=z6.bind(null,bt,e),[t.memoizedState,e]}function Jl(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=bt.updateQueue,t===null?(t={lastEffect:null,stores:null},bt.updateQueue=t,t.lastEffect=e.next=e):(r=t.lastEffect,r===null?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e)),e}function t2(){return un().memoizedState}function Xu(e,t,r,n){var o=zn();bt.flags|=e,o.memoizedState=Jl(1|t,r,void 0,n===void 0?null:n)}function Nh(e,t,r,n){var o=un();n=n===void 0?null:n;var a=void 0;if(At!==null){var i=At.memoizedState;if(a=i.destroy,n!==null&&i0(n,i.deps)){o.memoizedState=Jl(t,r,a,n);return}}bt.flags|=e,o.memoizedState=Jl(1|t,r,a,n)}function Tw(e,t){return Xu(8390656,8,e,t)}function c0(e,t){return Nh(2048,8,e,t)}function r2(e,t){return Nh(4,2,e,t)}function n2(e,t){return Nh(4,4,e,t)}function o2(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function a2(e,t,r){return r=r!=null?r.concat([e]):null,Nh(4,4,o2.bind(null,t,e),r)}function u0(){}function i2(e,t){var r=un();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&i0(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function s2(e,t){var r=un();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&i0(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function l2(e,t,r){return Ha&21?(On(r,t)||(r=d$(),bt.lanes|=r,qa|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,_r=!0),e.memoizedState=r)}function M6(e,t){var r=We;We=r!==0&&4>r?r:4,e(!0);var n=Gm.transition;Gm.transition={};try{e(!1),t()}finally{We=r,Gm.transition=n}}function c2(){return un().memoizedState}function L6(e,t,r){var n=ra(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},u2(e))d2(t,r);else if(r=V$(e,t,r,n),r!==null){var o=cr();jn(r,e,n,o),f2(r,t,n)}}function z6(e,t,r){var n=ra(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(u2(e))d2(t,o);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var i=t.lastRenderedState,l=a(i,r);if(o.hasEagerState=!0,o.eagerState=l,On(l,i)){var c=t.interleaved;c===null?(o.next=o,t0(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}r=V$(e,t,o,n),r!==null&&(o=cr(),jn(r,e,n,o),f2(r,t,n))}}function u2(e){var t=e.alternate;return e===bt||t!==null&&t===bt}function d2(e,t){jl=Rd=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function f2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,Vy(e,r)}}var Td={readContext:cn,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useInsertionEffect:Xt,useLayoutEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useMutableSource:Xt,useSyncExternalStore:Xt,useId:Xt,unstable_isNewReconciler:!1},F6={readContext:cn,useCallback:function(e,t){return zn().memoizedState=[e,t===void 0?null:t],e},useContext:cn,useEffect:Tw,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Xu(4194308,4,o2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Xu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Xu(4,2,e,t)},useMemo:function(e,t){var r=zn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=zn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=L6.bind(null,bt,e),[n.memoizedState,e]},useRef:function(e){var t=zn();return e={current:e},t.memoizedState=e},useState:Rw,useDebugValue:u0,useDeferredValue:function(e){return zn().memoizedState=e},useTransition:function(){var e=Rw(!1),t=e[0];return e=M6.bind(null,e[1]),zn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=bt,o=zn();if(ut){if(r===void 0)throw Error(G(407));r=r()}else{if(r=t(),Ft===null)throw Error(G(349));Ha&30||Y$(n,t,r)}o.memoizedState=r;var a={value:r,getSnapshot:t};return o.queue=a,Tw(J$.bind(null,n,a,e),[e]),n.flags|=2048,Jl(9,X$.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=zn(),t=Ft.identifierPrefix;if(ut){var r=lo,n=so;r=(n&~(1<<32-Pn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Yl++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=A6++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},V6={readContext:cn,useCallback:i2,useContext:cn,useEffect:c0,useImperativeHandle:a2,useInsertionEffect:r2,useLayoutEffect:n2,useMemo:s2,useReducer:Qm,useRef:t2,useState:function(){return Qm(Xl)},useDebugValue:u0,useDeferredValue:function(e){var t=un();return l2(t,At.memoizedState,e)},useTransition:function(){var e=Qm(Xl)[0],t=un().memoizedState;return[e,t]},useMutableSource:Q$,useSyncExternalStore:K$,useId:c2,unstable_isNewReconciler:!1},B6={readContext:cn,useCallback:i2,useContext:cn,useEffect:c0,useImperativeHandle:a2,useInsertionEffect:r2,useLayoutEffect:n2,useMemo:s2,useReducer:Km,useRef:t2,useState:function(){return Km(Xl)},useDebugValue:u0,useDeferredValue:function(e){var t=un();return At===null?t.memoizedState=e:l2(t,At.memoizedState,e)},useTransition:function(){var e=Km(Xl)[0],t=un().memoizedState;return[e,t]},useMutableSource:Q$,useSyncExternalStore:K$,useId:c2,unstable_isNewReconciler:!1};function fs(e,t){try{var r="",n=t;do r+=gz(n),n=n.return;while(n);var o=r}catch(a){o=`
86
+ Error generating stack: `+a.message+`
87
+ `+a.stack}return{value:e,source:t,stack:o,digest:null}}function Ym(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function Sv(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var U6=typeof WeakMap=="function"?WeakMap:Map;function p2(e,t,r){r=co(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Dd||(Dd=!0,Iv=n),Sv(e,t)},r}function h2(e,t,r){r=co(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var o=t.value;r.payload=function(){return n(o)},r.callback=function(){Sv(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){Sv(e,t),typeof n!="function"&&(ta===null?ta=new Set([this]):ta.add(this));var i=t.stack;this.componentDidCatch(t.value,{componentStack:i!==null?i:""})}),r}function Iw(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new U6;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(r)||(o.add(r),e=n7.bind(null,e,t,r),t.then(e,e))}function Dw(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Nw(e,t,r,n,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=co(-1,1),t.tag=2,ea(r,t,1))),r.lanes|=1),e)}var W6=jo.ReactCurrentOwner,_r=!1;function lr(e,t,r,n){t.child=e===null?q$(t,null,r,n):us(t,e.child,r,n)}function Aw(e,t,r,n,o){r=r.render;var a=t.ref;return es(t,o),n=s0(e,t,r,n,a,o),r=l0(),e!==null&&!_r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yo(e,t,o)):(ut&&r&&Ky(t),t.flags|=1,lr(e,t,n,o),t.child)}function Mw(e,t,r,n,o){if(e===null){var a=r.type;return typeof a=="function"&&!y0(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,m2(e,t,a,n,o)):(e=td(r.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!(e.lanes&o)){var i=a.memoizedProps;if(r=r.compare,r=r!==null?r:Wl,r(i,n)&&e.ref===t.ref)return yo(e,t,o)}return t.flags|=1,e=na(a,n),e.ref=t.ref,e.return=t,t.child=e}function m2(e,t,r,n,o){if(e!==null){var a=e.memoizedProps;if(Wl(a,n)&&e.ref===t.ref)if(_r=!1,t.pendingProps=n=a,(e.lanes&o)!==0)e.flags&131072&&(_r=!0);else return t.lanes=e.lanes,yo(e,t,o)}return Pv(e,t,r,n,o)}function g2(e,t,r){var n=t.pendingProps,o=n.children,a=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Je(Wi,Lr),Lr|=r;else{if(!(r&1073741824))return e=a!==null?a.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Je(Wi,Lr),Lr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Je(Wi,Lr),Lr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Je(Wi,Lr),Lr|=n;return lr(e,t,o,r),t.child}function v2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Pv(e,t,r,n,o){var a=jr(r)?Ua:or.current;return a=ls(t,a),es(t,o),r=s0(e,t,r,n,a,o),n=l0(),e!==null&&!_r?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,yo(e,t,o)):(ut&&n&&Ky(t),t.flags|=1,lr(e,t,r,o),t.child)}function Lw(e,t,r,n,o){if(jr(r)){var a=!0;Pd(t)}else a=!1;if(es(t,o),t.stateNode===null)Ju(e,t),W$(t,r,n),_v(t,r,n,o),n=!0;else if(e===null){var i=t.stateNode,l=t.memoizedProps;i.props=l;var c=i.context,u=r.contextType;typeof u=="object"&&u!==null?u=cn(u):(u=jr(r)?Ua:or.current,u=ls(t,u));var d=r.getDerivedStateFromProps,p=typeof d=="function"||typeof i.getSnapshotBeforeUpdate=="function";p||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==n||c!==u)&&$w(t,i,n,u),Fo=!1;var h=t.memoizedState;i.state=h,$d(t,n,i,o),c=t.memoizedState,l!==n||h!==c||Pr.current||Fo?(typeof d=="function"&&(bv(t,r,d,n),c=t.memoizedState),(l=Fo||Ew(t,r,l,n,h,c,u))?(p||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount()),typeof i.componentDidMount=="function"&&(t.flags|=4194308)):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=c),i.props=n,i.state=c,i.context=u,n=l):(typeof i.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{i=t.stateNode,B$(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:xn(t.type,l),i.props=u,p=t.pendingProps,h=i.context,c=r.contextType,typeof c=="object"&&c!==null?c=cn(c):(c=jr(r)?Ua:or.current,c=ls(t,c));var m=r.getDerivedStateFromProps;(d=typeof m=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==p||h!==c)&&$w(t,i,n,c),Fo=!1,h=t.memoizedState,i.state=h,$d(t,n,i,o);var v=t.memoizedState;l!==p||h!==v||Pr.current||Fo?(typeof m=="function"&&(bv(t,r,m,n),v=t.memoizedState),(u=Fo||Ew(t,r,u,n,h,v,c)||!1)?(d||typeof i.UNSAFE_componentWillUpdate!="function"&&typeof i.componentWillUpdate!="function"||(typeof i.componentWillUpdate=="function"&&i.componentWillUpdate(n,v,c),typeof i.UNSAFE_componentWillUpdate=="function"&&i.UNSAFE_componentWillUpdate(n,v,c)),typeof i.componentDidUpdate=="function"&&(t.flags|=4),typeof i.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),i.props=n,i.state=v,i.context=c,n=u):(typeof i.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof i.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return jv(e,t,r,n,a,o)}function jv(e,t,r,n,o,a){v2(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return o&&Sw(t,r,!1),yo(e,t,a);n=t.stateNode,W6.current=t;var l=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=us(t,e.child,null,a),t.child=us(t,null,l,a)):lr(e,t,l,a),t.memoizedState=n.state,o&&Sw(t,r,!0),t.child}function y2(e){var t=e.stateNode;t.pendingContext?_w(e,t.pendingContext,t.pendingContext!==t.context):t.context&&_w(e,t.context,!1),n0(e,t.containerInfo)}function zw(e,t,r,n,o){return cs(),Xy(o),t.flags|=256,lr(e,t,r,n),t.child}var Ov={dehydrated:null,treeContext:null,retryLane:0};function Cv(e){return{baseLanes:e,cachePool:null,transitions:null}}function x2(e,t,r){var n=t.pendingProps,o=wt.current,a=!1,i=(t.flags&128)!==0,l;if((l=i)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(a=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Je(wt,o&1),e===null)return xv(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(i=n.children,e=n.fallback,a?(n=t.mode,a=t.child,i={mode:"hidden",children:i},!(n&1)&&a!==null?(a.childLanes=0,a.pendingProps=i):a=Lh(i,n,0,null),e=Fa(e,n,r,null),a.return=t,e.return=t,a.sibling=e,t.child=a,t.child.memoizedState=Cv(r),t.memoizedState=Ov,e):d0(t,i));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return H6(e,t,i,n,l,o,r);if(a){a=n.fallback,i=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:n.children};return!(i&1)&&t.child!==o?(n=t.child,n.childLanes=0,n.pendingProps=c,t.deletions=null):(n=na(o,c),n.subtreeFlags=o.subtreeFlags&14680064),l!==null?a=na(l,a):(a=Fa(a,i,r,null),a.flags|=2),a.return=t,n.return=t,n.sibling=a,t.child=n,n=a,a=t.child,i=e.child.memoizedState,i=i===null?Cv(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~r,t.memoizedState=Ov,n}return a=e.child,e=a.sibling,n=na(a,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function d0(e,t){return t=Lh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function iu(e,t,r,n){return n!==null&&Xy(n),us(t,e.child,null,r),e=d0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function H6(e,t,r,n,o,a,i){if(r)return t.flags&256?(t.flags&=-257,n=Ym(Error(G(422))),iu(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,o=t.mode,n=Lh({mode:"visible",children:n.children},o,0,null),a=Fa(a,o,i,null),a.flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,t.mode&1&&us(t,e.child,null,i),t.child.memoizedState=Cv(i),t.memoizedState=Ov,a);if(!(t.mode&1))return iu(e,t,i,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(G(419)),n=Ym(a,n,void 0),iu(e,t,i,n)}if(l=(i&e.childLanes)!==0,_r||l){if(n=Ft,n!==null){switch(i&-i){case 4:o=2;break;case 16:o=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:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(n.suspendedLanes|i)?0:o,o!==0&&o!==a.retryLane&&(a.retryLane=o,vo(e,o),jn(n,e,o,-1))}return v0(),n=Ym(Error(G(421))),iu(e,t,i,n)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=o7.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Fr=Zo(o.nextSibling),Br=t,ut=!0,_n=null,e!==null&&(en[tn++]=so,en[tn++]=lo,en[tn++]=Wa,so=e.id,lo=e.overflow,Wa=t),t=d0(t,n.children),t.flags|=4096,t)}function Fw(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),wv(e.return,t,r)}function Xm(e,t,r,n,o){var a=e.memoizedState;a===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:o}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=n,a.tail=r,a.tailMode=o)}function w2(e,t,r){var n=t.pendingProps,o=n.revealOrder,a=n.tail;if(lr(e,t,n.children,r),n=wt.current,n&2)n=n&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Fw(e,r,t);else if(e.tag===19)Fw(e,r,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Je(wt,n),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(r=t.child,o=null;r!==null;)e=r.alternate,e!==null&&kd(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Xm(t,!1,o,r,a);break;case"backwards":for(r=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&kd(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Xm(t,!0,r,null,a);break;case"together":Xm(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ju(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function yo(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),qa|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(G(153));if(t.child!==null){for(e=t.child,r=na(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=na(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function q6(e,t,r){switch(t.tag){case 3:y2(t),cs();break;case 5:G$(t);break;case 1:jr(t.type)&&Pd(t);break;case 4:n0(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;Je(Cd,n._currentValue),n._currentValue=o;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Je(wt,wt.current&1),t.flags|=128,null):r&t.child.childLanes?x2(e,t,r):(Je(wt,wt.current&1),e=yo(e,t,r),e!==null?e.sibling:null);Je(wt,wt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return w2(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Je(wt,wt.current),n)break;return null;case 22:case 23:return t.lanes=0,g2(e,t,r)}return yo(e,t,r)}var b2,Ev,_2,S2;b2=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};Ev=function(){};_2=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,Aa(Qn.current);var a=null;switch(r){case"input":o=Yg(e,o),n=Yg(e,n),a=[];break;case"select":o=_t({},o,{value:void 0}),n=_t({},n,{value:void 0}),a=[];break;case"textarea":o=Zg(e,o),n=Zg(e,n),a=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=_d)}tv(r,n);var i;r=null;for(u in o)if(!n.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(i in l)l.hasOwnProperty(i)&&(r||(r={}),r[i]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Ml.hasOwnProperty(u)?a||(a=[]):(a=a||[]).push(u,null));for(u in n){var c=n[u];if(l=o!=null?o[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(i in l)!l.hasOwnProperty(i)||c&&c.hasOwnProperty(i)||(r||(r={}),r[i]="");for(i in c)c.hasOwnProperty(i)&&l[i]!==c[i]&&(r||(r={}),r[i]=c[i])}else r||(a||(a=[]),a.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(a=a||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(a=a||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Ml.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&ot("scroll",e),a||l===c||(a=[])):(a=a||[]).push(u,c))}r&&(a=a||[]).push("style",r);var u=a;(t.updateQueue=u)&&(t.flags|=4)}};S2=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ks(e,t){if(!ut)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Jt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var o=e.child;o!==null;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags&14680064,n|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)r|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function G6(e,t,r){var n=t.pendingProps;switch(Yy(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Jt(t),null;case 1:return jr(t.type)&&Sd(),Jt(t),null;case 3:return n=t.stateNode,ds(),it(Pr),it(or),a0(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(ou(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,_n!==null&&(Av(_n),_n=null))),Ev(e,t),Jt(t),null;case 5:o0(t);var o=Aa(Kl.current);if(r=t.type,e!==null&&t.stateNode!=null)_2(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(G(166));return Jt(t),null}if(e=Aa(Qn.current),ou(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Wn]=t,n[Gl]=a,e=(t.mode&1)!==0,r){case"dialog":ot("cancel",n),ot("close",n);break;case"iframe":case"object":case"embed":ot("load",n);break;case"video":case"audio":for(o=0;o<ml.length;o++)ot(ml[o],n);break;case"source":ot("error",n);break;case"img":case"image":case"link":ot("error",n),ot("load",n);break;case"details":ot("toggle",n);break;case"input":Kx(n,a),ot("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},ot("invalid",n);break;case"textarea":Xx(n,a),ot("invalid",n)}tv(r,a),o=null;for(var i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="children"?typeof l=="string"?n.textContent!==l&&(a.suppressHydrationWarning!==!0&&nu(n.textContent,l,e),o=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&nu(n.textContent,l,e),o=["children",""+l]):Ml.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&ot("scroll",n)}switch(r){case"input":Kc(n),Yx(n,a,!0);break;case"textarea":Kc(n),Jx(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=_d)}n=o,t.updateQueue=n,n!==null&&(t.flags|=4)}else{i=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=YE(r)),e==="http://www.w3.org/1999/xhtml"?r==="script"?(e=i.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=i.createElement(r,{is:n.is}):(e=i.createElement(r),r==="select"&&(i=e,n.multiple?i.multiple=!0:n.size&&(i.size=n.size))):e=i.createElementNS(e,r),e[Wn]=t,e[Gl]=n,b2(e,t,!1,!1),t.stateNode=e;e:{switch(i=rv(r,n),r){case"dialog":ot("cancel",e),ot("close",e),o=n;break;case"iframe":case"object":case"embed":ot("load",e),o=n;break;case"video":case"audio":for(o=0;o<ml.length;o++)ot(ml[o],e);o=n;break;case"source":ot("error",e),o=n;break;case"img":case"image":case"link":ot("error",e),ot("load",e),o=n;break;case"details":ot("toggle",e),o=n;break;case"input":Kx(e,n),o=Yg(e,n),ot("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=_t({},n,{value:void 0}),ot("invalid",e);break;case"textarea":Xx(e,n),o=Zg(e,n),ot("invalid",e);break;default:o=n}tv(r,o),l=o;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?ZE(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&XE(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&Ll(e,c):typeof c=="number"&&Ll(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Ml.hasOwnProperty(a)?c!=null&&a==="onScroll"&&ot("scroll",e):c!=null&&Ny(e,a,c,i))}switch(r){case"input":Kc(e),Yx(e,n,!1);break;case"textarea":Kc(e),Jx(e);break;case"option":n.value!=null&&e.setAttribute("value",""+aa(n.value));break;case"select":e.multiple=!!n.multiple,a=n.value,a!=null?Yi(e,!!n.multiple,a,!1):n.defaultValue!=null&&Yi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=_d)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Jt(t),null;case 6:if(e&&t.stateNode!=null)S2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(G(166));if(r=Aa(Kl.current),Aa(Qn.current),ou(t)){if(n=t.stateNode,r=t.memoizedProps,n[Wn]=t,(a=n.nodeValue!==r)&&(e=Br,e!==null))switch(e.tag){case 3:nu(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&nu(n.nodeValue,r,(e.mode&1)!==0)}a&&(t.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Wn]=t,t.stateNode=n}return Jt(t),null;case 13:if(it(wt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ut&&Fr!==null&&t.mode&1&&!(t.flags&128))F$(),cs(),t.flags|=98560,a=!1;else if(a=ou(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(G(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(G(317));a[Wn]=t}else cs(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jt(t),a=!1}else _n!==null&&(Av(_n),_n=null),a=!0;if(!a)return t.flags&65536?t:null}return t.flags&128?(t.lanes=r,t):(n=n!==null,n!==(e!==null&&e.memoizedState!==null)&&n&&(t.child.flags|=8192,t.mode&1&&(e===null||wt.current&1?Mt===0&&(Mt=3):v0())),t.updateQueue!==null&&(t.flags|=4),Jt(t),null);case 4:return ds(),Ev(e,t),e===null&&Hl(t.stateNode.containerInfo),Jt(t),null;case 10:return e0(t.type._context),Jt(t),null;case 17:return jr(t.type)&&Sd(),Jt(t),null;case 19:if(it(wt),a=t.memoizedState,a===null)return Jt(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)Ks(a,!1);else{if(Mt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=kd(e),i!==null){for(t.flags|=128,Ks(a,!1),n=i.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;r!==null;)a=r,e=n,a.flags&=14680066,i=a.alternate,i===null?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,a.type=i.type,e=i.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Je(wt,wt.current&1|2),t.child}e=e.sibling}a.tail!==null&&Et()>ps&&(t.flags|=128,n=!0,Ks(a,!1),t.lanes=4194304)}else{if(!n)if(e=kd(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ks(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!ut)return Jt(t),null}else 2*Et()-a.renderingStartTime>ps&&r!==1073741824&&(t.flags|=128,n=!0,Ks(a,!1),t.lanes=4194304);a.isBackwards?(i.sibling=t.child,t.child=i):(r=a.last,r!==null?r.sibling=i:t.child=i,a.last=i)}return a.tail!==null?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Et(),t.sibling=null,r=wt.current,Je(wt,n?r&1|2:r&1),t):(Jt(t),null);case 22:case 23:return g0(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Lr&1073741824&&(Jt(t),t.subtreeFlags&6&&(t.flags|=8192)):Jt(t),null;case 24:return null;case 25:return null}throw Error(G(156,t.tag))}function Q6(e,t){switch(Yy(t),t.tag){case 1:return jr(t.type)&&Sd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ds(),it(Pr),it(or),a0(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return o0(t),null;case 13:if(it(wt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(G(340));cs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return it(wt),null;case 4:return ds(),null;case 10:return e0(t.type._context),null;case 22:case 23:return g0(),null;case 24:return null;default:return null}}var su=!1,er=!1,K6=typeof WeakSet=="function"?WeakSet:Set,ae=null;function Ui(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){St(e,t,n)}else r.current=null}function $v(e,t,r){try{r()}catch(n){St(e,t,n)}}var Vw=!1;function Y6(e,t){if(fv=xd,e=C$(),Qy(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch{r=null;break e}var i=0,l=-1,c=-1,u=0,d=0,p=e,h=null;t:for(;;){for(var m;p!==r||o!==0&&p.nodeType!==3||(l=i+o),p!==a||n!==0&&p.nodeType!==3||(c=i+n),p.nodeType===3&&(i+=p.nodeValue.length),(m=p.firstChild)!==null;)h=p,p=m;for(;;){if(p===e)break t;if(h===r&&++u===o&&(l=i),h===a&&++d===n&&(c=i),(m=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=m}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(pv={focusedElem:e,selectionRange:r},xd=!1,ae=t;ae!==null;)if(t=ae,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ae=e;else for(;ae!==null;){t=ae;try{var v=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var g=v.memoizedProps,_=v.memoizedState,y=t.stateNode,x=y.getSnapshotBeforeUpdate(t.elementType===t.type?g:xn(t.type,g),_);y.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(G(163))}}catch(b){St(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ae=e;break}ae=t.return}return v=Vw,Vw=!1,v}function Ol(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var a=o.destroy;o.destroy=void 0,a!==void 0&&$v(t,r,a)}o=o.next}while(o!==n)}}function Ah(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function kv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function P2(e){var t=e.alternate;t!==null&&(e.alternate=null,P2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wn],delete t[Gl],delete t[gv],delete t[T6],delete t[I6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function j2(e){return e.tag===5||e.tag===3||e.tag===4}function Bw(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||j2(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Rv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=_d));else if(n!==4&&(e=e.child,e!==null))for(Rv(e,t,r),e=e.sibling;e!==null;)Rv(e,t,r),e=e.sibling}function Tv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Tv(e,t,r),e=e.sibling;e!==null;)Tv(e,t,r),e=e.sibling}var Wt=null,wn=!1;function Ao(e,t,r){for(r=r.child;r!==null;)O2(e,t,r),r=r.sibling}function O2(e,t,r){if(Gn&&typeof Gn.onCommitFiberUnmount=="function")try{Gn.onCommitFiberUnmount(Eh,r)}catch{}switch(r.tag){case 5:er||Ui(r,t);case 6:var n=Wt,o=wn;Wt=null,Ao(e,t,r),Wt=n,wn=o,Wt!==null&&(wn?(e=Wt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Wt.removeChild(r.stateNode));break;case 18:Wt!==null&&(wn?(e=Wt,r=r.stateNode,e.nodeType===8?Wm(e.parentNode,r):e.nodeType===1&&Wm(e,r),Bl(e)):Wm(Wt,r.stateNode));break;case 4:n=Wt,o=wn,Wt=r.stateNode.containerInfo,wn=!0,Ao(e,t,r),Wt=n,wn=o;break;case 0:case 11:case 14:case 15:if(!er&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var a=o,i=a.destroy;a=a.tag,i!==void 0&&(a&2||a&4)&&$v(r,t,i),o=o.next}while(o!==n)}Ao(e,t,r);break;case 1:if(!er&&(Ui(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){St(r,t,l)}Ao(e,t,r);break;case 21:Ao(e,t,r);break;case 22:r.mode&1?(er=(n=er)||r.memoizedState!==null,Ao(e,t,r),er=n):Ao(e,t,r);break;default:Ao(e,t,r)}}function Uw(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new K6),t.forEach(function(n){var o=a7.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function vn(e,t){var r=t.deletions;if(r!==null)for(var n=0;n<r.length;n++){var o=r[n];try{var a=e,i=t,l=i;e:for(;l!==null;){switch(l.tag){case 5:Wt=l.stateNode,wn=!1;break e;case 3:Wt=l.stateNode.containerInfo,wn=!0;break e;case 4:Wt=l.stateNode.containerInfo,wn=!0;break e}l=l.return}if(Wt===null)throw Error(G(160));O2(a,i,o),Wt=null,wn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){St(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)C2(t,e),t=t.sibling}function C2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vn(t,e),An(e),n&4){try{Ol(3,e,e.return),Ah(3,e)}catch(g){St(e,e.return,g)}try{Ol(5,e,e.return)}catch(g){St(e,e.return,g)}}break;case 1:vn(t,e),An(e),n&512&&r!==null&&Ui(r,r.return);break;case 5:if(vn(t,e),An(e),n&512&&r!==null&&Ui(r,r.return),e.flags&32){var o=e.stateNode;try{Ll(o,"")}catch(g){St(e,e.return,g)}}if(n&4&&(o=e.stateNode,o!=null)){var a=e.memoizedProps,i=r!==null?r.memoizedProps:a,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&a.type==="radio"&&a.name!=null&&QE(o,a),rv(l,i);var u=rv(l,a);for(i=0;i<c.length;i+=2){var d=c[i],p=c[i+1];d==="style"?ZE(o,p):d==="dangerouslySetInnerHTML"?XE(o,p):d==="children"?Ll(o,p):Ny(o,d,p,u)}switch(l){case"input":Xg(o,a);break;case"textarea":KE(o,a);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var m=a.value;m!=null?Yi(o,!!a.multiple,m,!1):h!==!!a.multiple&&(a.defaultValue!=null?Yi(o,!!a.multiple,a.defaultValue,!0):Yi(o,!!a.multiple,a.multiple?[]:"",!1))}o[Gl]=a}catch(g){St(e,e.return,g)}}break;case 6:if(vn(t,e),An(e),n&4){if(e.stateNode===null)throw Error(G(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(g){St(e,e.return,g)}}break;case 3:if(vn(t,e),An(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Bl(t.containerInfo)}catch(g){St(e,e.return,g)}break;case 4:vn(t,e),An(e);break;case 13:vn(t,e),An(e),o=e.child,o.flags&8192&&(a=o.memoizedState!==null,o.stateNode.isHidden=a,!a||o.alternate!==null&&o.alternate.memoizedState!==null||(h0=Et())),n&4&&Uw(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(er=(u=er)||d,vn(t,e),er=u):vn(t,e),An(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ae=e,d=e.child;d!==null;){for(p=ae=d;ae!==null;){switch(h=ae,m=h.child,h.tag){case 0:case 11:case 14:case 15:Ol(4,h,h.return);break;case 1:Ui(h,h.return);var v=h.stateNode;if(typeof v.componentWillUnmount=="function"){n=h,r=h.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){St(n,r,g)}}break;case 5:Ui(h,h.return);break;case 22:if(h.memoizedState!==null){Hw(p);continue}}m!==null?(m.return=h,ae=m):Hw(p)}d=d.sibling}e:for(d=null,p=e;;){if(p.tag===5){if(d===null){d=p;try{o=p.stateNode,u?(a=o.style,typeof a.setProperty=="function"?a.setProperty("display","none","important"):a.display="none"):(l=p.stateNode,c=p.memoizedProps.style,i=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=JE("display",i))}catch(g){St(e,e.return,g)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(g){St(e,e.return,g)}}else if((p.tag!==22&&p.tag!==23||p.memoizedState===null||p===e)&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break e;for(;p.sibling===null;){if(p.return===null||p.return===e)break e;d===p&&(d=null),p=p.return}d===p&&(d=null),p.sibling.return=p.return,p=p.sibling}}break;case 19:vn(t,e),An(e),n&4&&Uw(e);break;case 21:break;default:vn(t,e),An(e)}}function An(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(j2(r)){var n=r;break e}r=r.return}throw Error(G(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(Ll(o,""),n.flags&=-33);var a=Bw(e);Tv(e,a,o);break;case 3:case 4:var i=n.stateNode.containerInfo,l=Bw(e);Rv(e,l,i);break;default:throw Error(G(161))}}catch(c){St(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function X6(e,t,r){ae=e,E2(e)}function E2(e,t,r){for(var n=(e.mode&1)!==0;ae!==null;){var o=ae,a=o.child;if(o.tag===22&&n){var i=o.memoizedState!==null||su;if(!i){var l=o.alternate,c=l!==null&&l.memoizedState!==null||er;l=su;var u=er;if(su=i,(er=c)&&!u)for(ae=o;ae!==null;)i=ae,c=i.child,i.tag===22&&i.memoizedState!==null?qw(o):c!==null?(c.return=i,ae=c):qw(o);for(;a!==null;)ae=a,E2(a),a=a.sibling;ae=o,su=l,er=u}Ww(e)}else o.subtreeFlags&8772&&a!==null?(a.return=o,ae=a):Ww(e)}}function Ww(e){for(;ae!==null;){var t=ae;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:er||Ah(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!er)if(r===null)n.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:xn(t.type,r.memoizedProps);n.componentDidUpdate(o,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&Cw(t,a,n);break;case 3:var i=t.updateQueue;if(i!==null){if(r=null,t.child!==null)switch(t.child.tag){case 5:r=t.child.stateNode;break;case 1:r=t.child.stateNode}Cw(t,i,r)}break;case 5:var l=t.stateNode;if(r===null&&t.flags&4){r=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var p=d.dehydrated;p!==null&&Bl(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(G(163))}er||t.flags&512&&kv(t)}catch(h){St(t,t.return,h)}}if(t===e){ae=null;break}if(r=t.sibling,r!==null){r.return=t.return,ae=r;break}ae=t.return}}function Hw(e){for(;ae!==null;){var t=ae;if(t===e){ae=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ae=r;break}ae=t.return}}function qw(e){for(;ae!==null;){var t=ae;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Ah(4,t)}catch(c){St(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var o=t.return;try{n.componentDidMount()}catch(c){St(t,o,c)}}var a=t.return;try{kv(t)}catch(c){St(t,a,c)}break;case 5:var i=t.return;try{kv(t)}catch(c){St(t,i,c)}}}catch(c){St(t,t.return,c)}if(t===e){ae=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ae=l;break}ae=t.return}}var J6=Math.ceil,Id=jo.ReactCurrentDispatcher,f0=jo.ReactCurrentOwner,an=jo.ReactCurrentBatchConfig,Ae=0,Ft=null,It=null,Gt=0,Lr=0,Wi=pa(0),Mt=0,Zl=null,qa=0,Mh=0,p0=0,Cl=null,br=null,h0=0,ps=1/0,oo=null,Dd=!1,Iv=null,ta=null,lu=!1,qo=null,Nd=0,El=0,Dv=null,Zu=-1,ed=0;function cr(){return Ae&6?Et():Zu!==-1?Zu:Zu=Et()}function ra(e){return e.mode&1?Ae&2&&Gt!==0?Gt&-Gt:N6.transition!==null?(ed===0&&(ed=d$()),ed):(e=We,e!==0||(e=window.event,e=e===void 0?16:y$(e.type)),e):1}function jn(e,t,r,n){if(50<El)throw El=0,Dv=null,Error(G(185));fc(e,r,n),(!(Ae&2)||e!==Ft)&&(e===Ft&&(!(Ae&2)&&(Mh|=r),Mt===4&&Wo(e,Gt)),Or(e,n),r===1&&Ae===0&&!(t.mode&1)&&(ps=Et()+500,Ih&&ha()))}function Or(e,t){var r=e.callbackNode;Nz(e,t);var n=yd(e,e===Ft?Gt:0);if(n===0)r!==null&&tw(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(r!=null&&tw(r),t===1)e.tag===0?D6(Gw.bind(null,e)):M$(Gw.bind(null,e)),k6(function(){!(Ae&6)&&ha()}),r=null;else{switch(f$(n)){case 1:r=Fy;break;case 4:r=c$;break;case 16:r=vd;break;case 536870912:r=u$;break;default:r=vd}r=A2(r,$2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function $2(e,t){if(Zu=-1,ed=0,Ae&6)throw Error(G(327));var r=e.callbackNode;if(ts()&&e.callbackNode!==r)return null;var n=yd(e,e===Ft?Gt:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Ad(e,n);else{t=n;var o=Ae;Ae|=2;var a=R2();(Ft!==e||Gt!==t)&&(oo=null,ps=Et()+500,za(e,t));do try{t7();break}catch(l){k2(e,l)}while(1);Zy(),Id.current=a,Ae=o,It!==null?t=0:(Ft=null,Gt=0,t=Mt)}if(t!==0){if(t===2&&(o=sv(e),o!==0&&(n=o,t=Nv(e,o))),t===1)throw r=Zl,za(e,0),Wo(e,n),Or(e,Et()),r;if(t===6)Wo(e,n);else{if(o=e.current.alternate,!(n&30)&&!Z6(o)&&(t=Ad(e,n),t===2&&(a=sv(e),a!==0&&(n=a,t=Nv(e,a))),t===1))throw r=Zl,za(e,0),Wo(e,n),Or(e,Et()),r;switch(e.finishedWork=o,e.finishedLanes=n,t){case 0:case 1:throw Error(G(345));case 2:$a(e,br,oo);break;case 3:if(Wo(e,n),(n&130023424)===n&&(t=h0+500-Et(),10<t)){if(yd(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){cr(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=mv($a.bind(null,e,br,oo),t);break}$a(e,br,oo);break;case 4:if(Wo(e,n),(n&4194240)===n)break;for(t=e.eventTimes,o=-1;0<n;){var i=31-Pn(n);a=1<<i,i=t[i],i>o&&(o=i),n&=~a}if(n=o,n=Et()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*J6(n/1960))-n,10<n){e.timeoutHandle=mv($a.bind(null,e,br,oo),n);break}$a(e,br,oo);break;case 5:$a(e,br,oo);break;default:throw Error(G(329))}}}return Or(e,Et()),e.callbackNode===r?$2.bind(null,e):null}function Nv(e,t){var r=Cl;return e.current.memoizedState.isDehydrated&&(za(e,t).flags|=256),e=Ad(e,t),e!==2&&(t=br,br=r,t!==null&&Av(t)),e}function Av(e){br===null?br=e:br.push.apply(br,e)}function Z6(e){for(var t=e;;){if(t.flags&16384){var r=t.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var o=r[n],a=o.getSnapshot;o=o.value;try{if(!On(a(),o))return!1}catch{return!1}}}if(r=t.child,t.subtreeFlags&16384&&r!==null)r.return=t,t=r;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wo(e,t){for(t&=~p0,t&=~Mh,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-Pn(t),n=1<<r;e[r]=-1,t&=~n}}function Gw(e){if(Ae&6)throw Error(G(327));ts();var t=yd(e,0);if(!(t&1))return Or(e,Et()),null;var r=Ad(e,t);if(e.tag!==0&&r===2){var n=sv(e);n!==0&&(t=n,r=Nv(e,n))}if(r===1)throw r=Zl,za(e,0),Wo(e,t),Or(e,Et()),r;if(r===6)throw Error(G(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,$a(e,br,oo),Or(e,Et()),null}function m0(e,t){var r=Ae;Ae|=1;try{return e(t)}finally{Ae=r,Ae===0&&(ps=Et()+500,Ih&&ha())}}function Ga(e){qo!==null&&qo.tag===0&&!(Ae&6)&&ts();var t=Ae;Ae|=1;var r=an.transition,n=We;try{if(an.transition=null,We=1,e)return e()}finally{We=n,an.transition=r,Ae=t,!(Ae&6)&&ha()}}function g0(){Lr=Wi.current,it(Wi)}function za(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,$6(r)),It!==null)for(r=It.return;r!==null;){var n=r;switch(Yy(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Sd();break;case 3:ds(),it(Pr),it(or),a0();break;case 5:o0(n);break;case 4:ds();break;case 13:it(wt);break;case 19:it(wt);break;case 10:e0(n.type._context);break;case 22:case 23:g0()}r=r.return}if(Ft=e,It=e=na(e.current,null),Gt=Lr=t,Mt=0,Zl=null,p0=Mh=qa=0,br=Cl=null,Na!==null){for(t=0;t<Na.length;t++)if(r=Na[t],n=r.interleaved,n!==null){r.interleaved=null;var o=n.next,a=r.pending;if(a!==null){var i=a.next;a.next=o,n.next=i}r.pending=n}Na=null}return e}function k2(e,t){do{var r=It;try{if(Zy(),Yu.current=Td,Rd){for(var n=bt.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Rd=!1}if(Ha=0,Lt=At=bt=null,jl=!1,Yl=0,f0.current=null,r===null||r.return===null){Mt=1,Zl=t,It=null;break}e:{var a=e,i=r.return,l=r,c=t;if(t=Gt,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,p=d.tag;if(!(d.mode&1)&&(p===0||p===11||p===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=Dw(i);if(m!==null){m.flags&=-257,Nw(m,i,l,a,t),m.mode&1&&Iw(a,u,t),t=m,c=u;var v=t.updateQueue;if(v===null){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}else{if(!(t&1)){Iw(a,u,t),v0();break e}c=Error(G(426))}}else if(ut&&l.mode&1){var _=Dw(i);if(_!==null){!(_.flags&65536)&&(_.flags|=256),Nw(_,i,l,a,t),Xy(fs(c,l));break e}}a=c=fs(c,l),Mt!==4&&(Mt=2),Cl===null?Cl=[a]:Cl.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var y=p2(a,c,t);Ow(a,y);break e;case 1:l=c;var x=a.type,w=a.stateNode;if(!(a.flags&128)&&(typeof x.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ta===null||!ta.has(w)))){a.flags|=65536,t&=-t,a.lanes|=t;var b=h2(a,l,t);Ow(a,b);break e}}a=a.return}while(a!==null)}I2(r)}catch(O){t=O,It===r&&r!==null&&(It=r=r.return);continue}break}while(1)}function R2(){var e=Id.current;return Id.current=Td,e===null?Td:e}function v0(){(Mt===0||Mt===3||Mt===2)&&(Mt=4),Ft===null||!(qa&268435455)&&!(Mh&268435455)||Wo(Ft,Gt)}function Ad(e,t){var r=Ae;Ae|=2;var n=R2();(Ft!==e||Gt!==t)&&(oo=null,za(e,t));do try{e7();break}catch(o){k2(e,o)}while(1);if(Zy(),Ae=r,Id.current=n,It!==null)throw Error(G(261));return Ft=null,Gt=0,Mt}function e7(){for(;It!==null;)T2(It)}function t7(){for(;It!==null&&!Oz();)T2(It)}function T2(e){var t=N2(e.alternate,e,Lr);e.memoizedProps=e.pendingProps,t===null?I2(e):It=t,f0.current=null}function I2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=Q6(r,t),r!==null){r.flags&=32767,It=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Mt=6,It=null;return}}else if(r=G6(r,t,Lr),r!==null){It=r;return}if(t=t.sibling,t!==null){It=t;return}It=t=e}while(t!==null);Mt===0&&(Mt=5)}function $a(e,t,r){var n=We,o=an.transition;try{an.transition=null,We=1,r7(e,t,r,n)}finally{an.transition=o,We=n}return null}function r7(e,t,r,n){do ts();while(qo!==null);if(Ae&6)throw Error(G(327));r=e.finishedWork;var o=e.finishedLanes;if(r===null)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(G(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(Az(e,a),e===Ft&&(It=Ft=null,Gt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||lu||(lu=!0,A2(vd,function(){return ts(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=an.transition,an.transition=null;var i=We;We=1;var l=Ae;Ae|=4,f0.current=null,Y6(e,r),C2(r,e),_6(pv),xd=!!fv,pv=fv=null,e.current=r,X6(r),Cz(),Ae=l,We=i,an.transition=a}else e.current=r;if(lu&&(lu=!1,qo=e,Nd=o),a=e.pendingLanes,a===0&&(ta=null),kz(r.stateNode),Or(e,Et()),t!==null)for(n=e.onRecoverableError,r=0;r<t.length;r++)o=t[r],n(o.value,{componentStack:o.stack,digest:o.digest});if(Dd)throw Dd=!1,e=Iv,Iv=null,e;return Nd&1&&e.tag!==0&&ts(),a=e.pendingLanes,a&1?e===Dv?El++:(El=0,Dv=e):El=0,ha(),null}function ts(){if(qo!==null){var e=f$(Nd),t=an.transition,r=We;try{if(an.transition=null,We=16>e?16:e,qo===null)var n=!1;else{if(e=qo,qo=null,Nd=0,Ae&6)throw Error(G(331));var o=Ae;for(Ae|=4,ae=e.current;ae!==null;){var a=ae,i=a.child;if(ae.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ae=u;ae!==null;){var d=ae;switch(d.tag){case 0:case 11:case 15:Ol(8,d,a)}var p=d.child;if(p!==null)p.return=d,ae=p;else for(;ae!==null;){d=ae;var h=d.sibling,m=d.return;if(P2(d),d===u){ae=null;break}if(h!==null){h.return=m,ae=h;break}ae=m}}}var v=a.alternate;if(v!==null){var g=v.child;if(g!==null){v.child=null;do{var _=g.sibling;g.sibling=null,g=_}while(g!==null)}}ae=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,ae=i;else e:for(;ae!==null;){if(a=ae,a.flags&2048)switch(a.tag){case 0:case 11:case 15:Ol(9,a,a.return)}var y=a.sibling;if(y!==null){y.return=a.return,ae=y;break e}ae=a.return}}var x=e.current;for(ae=x;ae!==null;){i=ae;var w=i.child;if(i.subtreeFlags&2064&&w!==null)w.return=i,ae=w;else e:for(i=x;ae!==null;){if(l=ae,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Ah(9,l)}}catch(O){St(l,l.return,O)}if(l===i){ae=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,ae=b;break e}ae=l.return}}if(Ae=o,ha(),Gn&&typeof Gn.onPostCommitFiberRoot=="function")try{Gn.onPostCommitFiberRoot(Eh,e)}catch{}n=!0}return n}finally{We=r,an.transition=t}}return!1}function Qw(e,t,r){t=fs(r,t),t=p2(e,t,1),e=ea(e,t,1),t=cr(),e!==null&&(fc(e,1,t),Or(e,t))}function St(e,t,r){if(e.tag===3)Qw(e,e,r);else for(;t!==null;){if(t.tag===3){Qw(t,e,r);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(ta===null||!ta.has(n))){e=fs(r,e),e=h2(t,e,1),t=ea(t,e,1),e=cr(),t!==null&&(fc(t,1,e),Or(t,e));break}}t=t.return}}function n7(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=cr(),e.pingedLanes|=e.suspendedLanes&r,Ft===e&&(Gt&r)===r&&(Mt===4||Mt===3&&(Gt&130023424)===Gt&&500>Et()-h0?za(e,0):p0|=r),Or(e,t)}function D2(e,t){t===0&&(e.mode&1?(t=Jc,Jc<<=1,!(Jc&130023424)&&(Jc=4194304)):t=1);var r=cr();e=vo(e,t),e!==null&&(fc(e,t,r),Or(e,r))}function o7(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),D2(e,r)}function a7(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(G(314))}n!==null&&n.delete(t),D2(e,r)}var N2;N2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||Pr.current)_r=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return _r=!1,q6(e,t,r);_r=!!(e.flags&131072)}else _r=!1,ut&&t.flags&1048576&&L$(t,Od,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Ju(e,t),e=t.pendingProps;var o=ls(t,or.current);es(t,r),o=s0(null,t,n,e,o,r);var a=l0();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,jr(n)?(a=!0,Pd(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,r0(t),o.updater=Dh,t.stateNode=o,o._reactInternals=t,_v(t,n,e,r),t=jv(null,t,n,!0,a,r)):(t.tag=0,ut&&a&&Ky(t),lr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Ju(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=s7(n),e=xn(n,e),o){case 0:t=Pv(null,t,n,e,r);break e;case 1:t=Lw(null,t,n,e,r);break e;case 11:t=Aw(null,t,n,e,r);break e;case 14:t=Mw(null,t,n,xn(n.type,e),r);break e}throw Error(G(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:xn(n,o),Pv(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:xn(n,o),Lw(e,t,n,o,r);case 3:e:{if(y2(t),e===null)throw Error(G(387));n=t.pendingProps,a=t.memoizedState,o=a.element,B$(e,t),$d(t,n,null,r);var i=t.memoizedState;if(n=i.element,a.isDehydrated)if(a={element:n,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){o=fs(Error(G(423)),t),t=zw(e,t,n,r,o);break e}else if(n!==o){o=fs(Error(G(424)),t),t=zw(e,t,n,r,o);break e}else for(Fr=Zo(t.stateNode.containerInfo.firstChild),Br=t,ut=!0,_n=null,r=q$(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(cs(),n===o){t=yo(e,t,r);break e}lr(e,t,n,r)}t=t.child}return t;case 5:return G$(t),e===null&&xv(t),n=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,i=o.children,hv(n,o)?i=null:a!==null&&hv(n,a)&&(t.flags|=32),v2(e,t),lr(e,t,i,r),t.child;case 6:return e===null&&xv(t),null;case 13:return x2(e,t,r);case 4:return n0(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=us(t,null,n,r):lr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:xn(n,o),Aw(e,t,n,o,r);case 7:return lr(e,t,t.pendingProps,r),t.child;case 8:return lr(e,t,t.pendingProps.children,r),t.child;case 12:return lr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,a=t.memoizedProps,i=o.value,Je(Cd,n._currentValue),n._currentValue=i,a!==null)if(On(a.value,i)){if(a.children===o.children&&!Pr.current){t=yo(e,t,r);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){i=a.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(a.tag===1){c=co(-1,r&-r),c.tag=2;var u=a.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}a.lanes|=r,c=a.alternate,c!==null&&(c.lanes|=r),wv(a.return,r,t),l.lanes|=r;break}c=c.next}}else if(a.tag===10)i=a.type===t.type?null:a.child;else if(a.tag===18){if(i=a.return,i===null)throw Error(G(341));i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),wv(i,r,t),i=a.sibling}else i=a.child;if(i!==null)i.return=a;else for(i=a;i!==null;){if(i===t){i=null;break}if(a=i.sibling,a!==null){a.return=i.return,i=a;break}i=i.return}a=i}lr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,es(t,r),o=cn(o),n=n(o),t.flags|=1,lr(e,t,n,r),t.child;case 14:return n=t.type,o=xn(n,t.pendingProps),o=xn(n.type,o),Mw(e,t,n,o,r);case 15:return m2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:xn(n,o),Ju(e,t),t.tag=1,jr(n)?(e=!0,Pd(t)):e=!1,es(t,r),W$(t,n,o),_v(t,n,o,r),jv(null,t,n,!0,e,r);case 19:return w2(e,t,r);case 22:return g2(e,t,r)}throw Error(G(156,t.tag))};function A2(e,t){return l$(e,t)}function i7(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function rn(e,t,r,n){return new i7(e,t,r,n)}function y0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function s7(e){if(typeof e=="function")return y0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===My)return 11;if(e===Ly)return 14}return 2}function na(e,t){var r=e.alternate;return r===null?(r=rn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function td(e,t,r,n,o,a){var i=2;if(n=e,typeof e=="function")y0(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case Di:return Fa(r.children,o,a,t);case Ay:i=8,o|=8;break;case qg:return e=rn(12,r,t,o|2),e.elementType=qg,e.lanes=a,e;case Gg:return e=rn(13,r,t,o),e.elementType=Gg,e.lanes=a,e;case Qg:return e=rn(19,r,t,o),e.elementType=Qg,e.lanes=a,e;case HE:return Lh(r,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case UE:i=10;break e;case WE:i=9;break e;case My:i=11;break e;case Ly:i=14;break e;case zo:i=16,n=null;break e}throw Error(G(130,e==null?e:typeof e,""))}return t=rn(i,r,t,o),t.elementType=e,t.type=n,t.lanes=a,t}function Fa(e,t,r,n){return e=rn(7,e,n,t),e.lanes=r,e}function Lh(e,t,r,n){return e=rn(22,e,n,t),e.elementType=HE,e.lanes=r,e.stateNode={isHidden:!1},e}function Jm(e,t,r){return e=rn(6,e,null,t),e.lanes=r,e}function Zm(e,t,r){return t=rn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function l7(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Im(0),this.expirationTimes=Im(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Im(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function x0(e,t,r,n,o,a,i,l,c){return e=new l7(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=rn(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},r0(a),e}function c7(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ii,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function M2(e){if(!e)return ia;e=e._reactInternals;e:{if(ni(e)!==e||e.tag!==1)throw Error(G(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(jr(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(G(171))}if(e.tag===1){var r=e.type;if(jr(r))return A$(e,r,t)}return t}function L2(e,t,r,n,o,a,i,l,c){return e=x0(r,n,!0,e,o,a,i,l,c),e.context=M2(null),r=e.current,n=cr(),o=ra(r),a=co(n,o),a.callback=t??null,ea(r,a,o),e.current.lanes=o,fc(e,o,n),Or(e,n),e}function zh(e,t,r,n){var o=t.current,a=cr(),i=ra(o);return r=M2(r),t.context===null?t.context=r:t.pendingContext=r,t=co(a,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ea(o,t,i),e!==null&&(jn(e,o,i,a),Ku(e,o,i)),i}function Md(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kw(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function w0(e,t){Kw(e,t),(e=e.alternate)&&Kw(e,t)}function u7(){return null}var z2=typeof reportError=="function"?reportError:function(e){console.error(e)};function b0(e){this._internalRoot=e}Fh.prototype.render=b0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(G(409));zh(e,t,null,null)};Fh.prototype.unmount=b0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ga(function(){zh(null,e,null,null)}),t[go]=null}};function Fh(e){this._internalRoot=e}Fh.prototype.unstable_scheduleHydration=function(e){if(e){var t=m$();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Uo.length&&t!==0&&t<Uo[r].priority;r++);Uo.splice(r,0,e),r===0&&v$(e)}};function _0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Vh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Yw(){}function d7(e,t,r,n,o){if(o){if(typeof n=="function"){var a=n;n=function(){var u=Md(i);a.call(u)}}var i=L2(t,n,e,0,null,!1,!1,"",Yw);return e._reactRootContainer=i,e[go]=i.current,Hl(e.nodeType===8?e.parentNode:e),Ga(),i}for(;o=e.lastChild;)e.removeChild(o);if(typeof n=="function"){var l=n;n=function(){var u=Md(c);l.call(u)}}var c=x0(e,0,!1,null,null,!1,!1,"",Yw);return e._reactRootContainer=c,e[go]=c.current,Hl(e.nodeType===8?e.parentNode:e),Ga(function(){zh(t,c,r,n)}),c}function Bh(e,t,r,n,o){var a=r._reactRootContainer;if(a){var i=a;if(typeof o=="function"){var l=o;o=function(){var c=Md(i);l.call(c)}}zh(t,i,e,o)}else i=d7(r,t,e,o,n);return Md(i)}p$=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=hl(t.pendingLanes);r!==0&&(Vy(t,r|1),Or(t,Et()),!(Ae&6)&&(ps=Et()+500,ha()))}break;case 13:Ga(function(){var n=vo(e,1);if(n!==null){var o=cr();jn(n,e,1,o)}}),w0(e,1)}};By=function(e){if(e.tag===13){var t=vo(e,134217728);if(t!==null){var r=cr();jn(t,e,134217728,r)}w0(e,134217728)}};h$=function(e){if(e.tag===13){var t=ra(e),r=vo(e,t);if(r!==null){var n=cr();jn(r,e,t,n)}w0(e,t)}};m$=function(){return We};g$=function(e,t){var r=We;try{return We=e,t()}finally{We=r}};ov=function(e,t,r){switch(t){case"input":if(Xg(e,r),t=r.name,r.type==="radio"&&t!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var o=Th(n);if(!o)throw Error(G(90));GE(n),Xg(n,o)}}}break;case"textarea":KE(e,r);break;case"select":t=r.value,t!=null&&Yi(e,!!r.multiple,t,!1)}};r$=m0;n$=Ga;var f7={usingClientEntryPoint:!1,Events:[hc,Li,Th,e$,t$,m0]},Ys={findFiberByHostInstance:Da,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},p7={bundleType:Ys.bundleType,version:Ys.version,rendererPackageName:Ys.rendererPackageName,rendererConfig:Ys.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:jo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=i$(e),e===null?null:e.stateNode},findFiberByHostInstance:Ys.findFiberByHostInstance||u7,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 cu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!cu.isDisabled&&cu.supportsFiber)try{Eh=cu.inject(p7),Gn=cu}catch{}}qr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=f7;qr.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_0(t))throw Error(G(200));return c7(e,t,null,r)};qr.createRoot=function(e,t){if(!_0(e))throw Error(G(299));var r=!1,n="",o=z2;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=x0(e,1,!1,null,null,r,!1,n,o),e[go]=t.current,Hl(e.nodeType===8?e.parentNode:e),new b0(t)};qr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(G(188)):(e=Object.keys(e).join(","),Error(G(268,e)));return e=i$(t),e=e===null?null:e.stateNode,e};qr.flushSync=function(e){return Ga(e)};qr.hydrate=function(e,t,r){if(!Vh(t))throw Error(G(200));return Bh(null,e,t,!0,r)};qr.hydrateRoot=function(e,t,r){if(!_0(e))throw Error(G(405));var n=r!=null&&r.hydratedSources||null,o=!1,a="",i=z2;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=L2(t,null,e,1,r??null,o,!1,a,i),e[go]=t.current,Hl(e),n)for(e=0;e<n.length;e++)r=n[e],o=r._getVersion,o=o(r._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[r,o]:t.mutableSourceEagerHydrationData.push(r,o);return new Fh(t)};qr.render=function(e,t,r){if(!Vh(t))throw Error(G(200));return Bh(null,e,t,!1,r)};qr.unmountComponentAtNode=function(e){if(!Vh(e))throw Error(G(40));return e._reactRootContainer?(Ga(function(){Bh(null,null,e,!1,function(){e._reactRootContainer=null,e[go]=null})}),!0):!1};qr.unstable_batchedUpdates=m0;qr.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Vh(r))throw Error(G(200));if(e==null||e._reactInternals===void 0)throw Error(G(38));return Bh(e,t,r,!1,n)};qr.version="18.2.0-next-9e3b772b8-20220608";function F2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(F2)}catch(e){console.error(e)}}F2(),LE.exports=qr;var gc=LE.exports;const eg=yy(gc);var h7=Object.defineProperty,m7=Object.defineProperties,g7=Object.getOwnPropertyDescriptors,Xw=Object.getOwnPropertySymbols,v7=Object.prototype.hasOwnProperty,y7=Object.prototype.propertyIsEnumerable,Jw=(e,t,r)=>t in e?h7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mv=(e,t)=>{for(var r in t||(t={}))v7.call(t,r)&&Jw(e,r,t[r]);if(Xw)for(var r of Xw(t))y7.call(t,r)&&Jw(e,r,t[r]);return e},Zw=(e,t)=>m7(e,g7(t));const x7=["subtle","filled","outline","light","default","transparent","gradient"],uu={xs:P(18),sm:P(22),md:P(28),lg:P(34),xl:P(44)};function w7({variant:e,theme:t,color:r,gradient:n}){const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?{border:0,backgroundImage:o.background,color:o.color,"&:hover":t.fn.hover({backgroundSize:"200%"})}:x7.includes(e)?Mv({border:`${P(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var b7=W((e,{radius:t,color:r,gradient:n},{variant:o,size:a})=>({root:Zw(Mv({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:A({size:a,sizes:uu}),minHeight:A({size:a,sizes:uu}),width:A({size:a,sizes:uu}),minWidth:A({size:a,sizes:uu})},w7({variant:o,theme:e,color:r,gradient:n})),{"&:active":e.activeStyles,"& [data-action-icon-loader]":{maxWidth:"70%"},"&:disabled, &[data-disabled]":{color:e.colors.gray[e.colorScheme==="dark"?6:4],cursor:"not-allowed",backgroundColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),borderColor:o==="transparent"?void 0:e.fn.themeColor("gray",e.colorScheme==="dark"?8:1),backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":Zw(Mv({content:'""'},e.fn.cover(P(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}})}));const _7=b7;var S7=Object.defineProperty,Ld=Object.getOwnPropertySymbols,V2=Object.prototype.hasOwnProperty,B2=Object.prototype.propertyIsEnumerable,eb=(e,t,r)=>t in e?S7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tb=(e,t)=>{for(var r in t||(t={}))V2.call(t,r)&&eb(e,r,t[r]);if(Ld)for(var r of Ld(t))B2.call(t,r)&&eb(e,r,t[r]);return e},rb=(e,t)=>{var r={};for(var n in e)V2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ld)for(var n of Ld(e))t.indexOf(n)<0&&B2.call(e,n)&&(r[n]=e[n]);return r};function P7(e){var t=e,{size:r,color:n}=t,o=rb(t,["size","color"]);const a=o,{style:i}=a,l=rb(a,["style"]);return S.createElement("svg",tb({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:n,style:tb({width:r},i)},l),S.createElement("rect",{y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"30",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"60",width:"15",height:"140",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"90",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.25s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.25s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("rect",{x:"120",y:"10",width:"15",height:"120",rx:"6"},S.createElement("animate",{attributeName:"height",begin:"0.5s",dur:"1s",values:"120;110;100;90;80;70;60;50;40;140;120",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"y",begin:"0.5s",dur:"1s",values:"10;15;20;25;30;35;40;45;50;0;10",calcMode:"linear",repeatCount:"indefinite"})))}var j7=Object.defineProperty,zd=Object.getOwnPropertySymbols,U2=Object.prototype.hasOwnProperty,W2=Object.prototype.propertyIsEnumerable,nb=(e,t,r)=>t in e?j7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ob=(e,t)=>{for(var r in t||(t={}))U2.call(t,r)&&nb(e,r,t[r]);if(zd)for(var r of zd(t))W2.call(t,r)&&nb(e,r,t[r]);return e},ab=(e,t)=>{var r={};for(var n in e)U2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zd)for(var n of zd(e))t.indexOf(n)<0&&W2.call(e,n)&&(r[n]=e[n]);return r};function O7(e){var t=e,{size:r,color:n}=t,o=ab(t,["size","color"]);const a=o,{style:i}=a,l=ab(a,["style"]);return S.createElement("svg",ob({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:n,style:ob({width:r,height:r},i)},l),S.createElement("g",{fill:"none",fillRule:"evenodd"},S.createElement("g",{transform:"translate(2.5 2.5)",strokeWidth:"5"},S.createElement("circle",{strokeOpacity:".5",cx:"16",cy:"16",r:"16"}),S.createElement("path",{d:"M32 16c0-9.94-8.06-16-16-16"},S.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 16 16",to:"360 16 16",dur:"1s",repeatCount:"indefinite"})))))}var C7=Object.defineProperty,Fd=Object.getOwnPropertySymbols,H2=Object.prototype.hasOwnProperty,q2=Object.prototype.propertyIsEnumerable,ib=(e,t,r)=>t in e?C7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sb=(e,t)=>{for(var r in t||(t={}))H2.call(t,r)&&ib(e,r,t[r]);if(Fd)for(var r of Fd(t))q2.call(t,r)&&ib(e,r,t[r]);return e},lb=(e,t)=>{var r={};for(var n in e)H2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Fd)for(var n of Fd(e))t.indexOf(n)<0&&q2.call(e,n)&&(r[n]=e[n]);return r};function E7(e){var t=e,{size:r,color:n}=t,o=lb(t,["size","color"]);const a=o,{style:i}=a,l=lb(a,["style"]);return S.createElement("svg",sb({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:n,style:sb({width:r},i)},l),S.createElement("circle",{cx:"15",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"60",cy:"15",r:"9",fillOpacity:"0.3"},S.createElement("animate",{attributeName:"r",from:"9",to:"9",begin:"0s",dur:"0.8s",values:"9;15;9",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"0.5",to:"0.5",begin:"0s",dur:"0.8s",values:".5;1;.5",calcMode:"linear",repeatCount:"indefinite"})),S.createElement("circle",{cx:"105",cy:"15",r:"15"},S.createElement("animate",{attributeName:"r",from:"15",to:"15",begin:"0s",dur:"0.8s",values:"15;9;15",calcMode:"linear",repeatCount:"indefinite"}),S.createElement("animate",{attributeName:"fill-opacity",from:"1",to:"1",begin:"0s",dur:"0.8s",values:"1;.5;1",calcMode:"linear",repeatCount:"indefinite"})))}var $7=Object.defineProperty,Vd=Object.getOwnPropertySymbols,G2=Object.prototype.hasOwnProperty,Q2=Object.prototype.propertyIsEnumerable,cb=(e,t,r)=>t in e?$7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k7=(e,t)=>{for(var r in t||(t={}))G2.call(t,r)&&cb(e,r,t[r]);if(Vd)for(var r of Vd(t))Q2.call(t,r)&&cb(e,r,t[r]);return e},R7=(e,t)=>{var r={};for(var n in e)G2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vd)for(var n of Vd(e))t.indexOf(n)<0&&Q2.call(e,n)&&(r[n]=e[n]);return r};const tg={bars:P7,oval:O7,dots:E7},T7={xs:P(18),sm:P(22),md:P(36),lg:P(44),xl:P(58)},I7={size:"md"};function dn(e){const t=q("Loader",I7,e),{size:r,color:n,variant:o}=t,a=R7(t,["size","color","variant"]),i=Kt(),l=o in tg?o:i.loader;return S.createElement(oe,k7({role:"presentation",component:tg[l]||tg.bars,size:A({size:r,sizes:T7}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:n||i.primaryColor}).background},a))}dn.displayName="@mantine/core/Loader";var D7=Object.defineProperty,Bd=Object.getOwnPropertySymbols,K2=Object.prototype.hasOwnProperty,Y2=Object.prototype.propertyIsEnumerable,ub=(e,t,r)=>t in e?D7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,db=(e,t)=>{for(var r in t||(t={}))K2.call(t,r)&&ub(e,r,t[r]);if(Bd)for(var r of Bd(t))Y2.call(t,r)&&ub(e,r,t[r]);return e},N7=(e,t)=>{var r={};for(var n in e)K2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bd)for(var n of Bd(e))t.indexOf(n)<0&&Y2.call(e,n)&&(r[n]=e[n]);return r};const A7={color:"gray",size:"md",variant:"subtle"},X2=f.forwardRef((e,t)=>{const r=q("ActionIcon",A7,e),{className:n,color:o,children:a,radius:i,size:l,variant:c,gradient:u,disabled:d,loaderProps:p,loading:h,unstyled:m,__staticSelector:v}=r,g=N7(r,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:_,cx:y,theme:x}=_7({radius:i,color:o,gradient:u},{name:["ActionIcon",v],unstyled:m,size:l,variant:c}),w=S.createElement(dn,db({color:x.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},p));return S.createElement(ho,db({className:y(_.root,n),ref:t,disabled:d,"data-disabled":d||void 0,"data-loading":h||void 0,unstyled:m},g),h?w:a)});X2.displayName="@mantine/core/ActionIcon";const ur=X2;var M7=Object.defineProperty,L7=Object.defineProperties,z7=Object.getOwnPropertyDescriptors,Ud=Object.getOwnPropertySymbols,J2=Object.prototype.hasOwnProperty,Z2=Object.prototype.propertyIsEnumerable,fb=(e,t,r)=>t in e?M7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F7=(e,t)=>{for(var r in t||(t={}))J2.call(t,r)&&fb(e,r,t[r]);if(Ud)for(var r of Ud(t))Z2.call(t,r)&&fb(e,r,t[r]);return e},V7=(e,t)=>L7(e,z7(t)),B7=(e,t)=>{var r={};for(var n in e)J2.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ud)for(var n of Ud(e))t.indexOf(n)<0&&Z2.call(e,n)&&(r[n]=e[n]);return r};function S0(e){const t=q("Portal",{},e),{children:r,target:n,className:o,innerRef:a}=t,i=B7(t,["children","target","className","innerRef"]),l=Kt(),[c,u]=f.useState(!1),d=f.useRef();return OE(()=>(u(!0),d.current=n?typeof n=="string"?document.querySelector(n):n:document.createElement("div"),n||document.body.appendChild(d.current),()=>{!n&&document.body.removeChild(d.current)}),[n]),c?gc.createPortal(S.createElement("div",V7(F7({className:o,dir:l.dir},i),{ref:a}),r),d.current):null}S0.displayName="@mantine/core/Portal";var U7=Object.defineProperty,Wd=Object.getOwnPropertySymbols,ek=Object.prototype.hasOwnProperty,tk=Object.prototype.propertyIsEnumerable,pb=(e,t,r)=>t in e?U7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W7=(e,t)=>{for(var r in t||(t={}))ek.call(t,r)&&pb(e,r,t[r]);if(Wd)for(var r of Wd(t))tk.call(t,r)&&pb(e,r,t[r]);return e},H7=(e,t)=>{var r={};for(var n in e)ek.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wd)for(var n of Wd(e))t.indexOf(n)<0&&tk.call(e,n)&&(r[n]=e[n]);return r};function ks(e){var t=e,{withinPortal:r=!0,children:n}=t,o=H7(t,["withinPortal","children"]);return r?S.createElement(S0,W7({},o),n):S.createElement(S.Fragment,null,n)}ks.displayName="@mantine/core/OptionalPortal";var q7=Object.defineProperty,G7=Object.defineProperties,Q7=Object.getOwnPropertyDescriptors,hb=Object.getOwnPropertySymbols,K7=Object.prototype.hasOwnProperty,Y7=Object.prototype.propertyIsEnumerable,mb=(e,t,r)=>t in e?q7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rg=(e,t)=>{for(var r in t||(t={}))K7.call(t,r)&&mb(e,r,t[r]);if(hb)for(var r of hb(t))Y7.call(t,r)&&mb(e,r,t[r]);return e},gb=(e,t)=>G7(e,Q7(t));function X7({variant:e,color:t,theme:r}){if(e==="filled")return{backgroundColor:r.fn.variant({variant:"filled",color:t}).background,color:r.white};if(e==="outline"){const n=r.fn.variant({variant:"outline",color:t});return{color:n.color,borderColor:n.border,backgroundColor:r.colorScheme==="dark"?r.colors.dark[6]:r.white}}if(e==="light"){const n=r.fn.variant({variant:"light",color:t});return{backgroundColor:n.background,color:n.color}}return null}var J7=W((e,{radius:t,color:r},{variant:n})=>({root:rg(gb(rg({},e.fn.fontStyles()),{position:"relative",overflow:"hidden",paddingTop:e.spacing.sm,paddingBottom:e.spacing.sm,paddingLeft:e.spacing.md,paddingRight:e.spacing.sm,borderRadius:e.fn.radius(t),border:`${P(1)} solid transparent`}),X7({variant:n,color:r,theme:e})),wrapper:{display:"flex"},body:{flex:1},title:{boxSizing:"border-box",margin:0,marginBottom:e.spacing.xs,display:"flex",alignItems:"center",justifyContent:"space-between",lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,fontWeight:700,"&[data-with-close-button]":{paddingRight:e.spacing.md}},label:{display:"block",overflow:"hidden",textOverflow:"ellipsis"},icon:{lineHeight:1,width:P(20),height:P(20),display:"flex",alignItems:"center",justifyContent:"flex-start",marginRight:e.spacing.md,marginTop:1},message:gb(rg({},e.fn.fontStyles()),{lineHeight:e.lineHeight,textOverflow:"ellipsis",overflow:"hidden",fontSize:e.fontSizes.sm,color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}),closeButton:{width:P(10),height:P(10),color:n==="filled"?e.white:e.colorScheme==="dark"?n==="light"?e.white:e.colors.dark[0]:e.black}}));const Z7=J7;var e8=Object.defineProperty,Hd=Object.getOwnPropertySymbols,rk=Object.prototype.hasOwnProperty,nk=Object.prototype.propertyIsEnumerable,vb=(e,t,r)=>t in e?e8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yb=(e,t)=>{for(var r in t||(t={}))rk.call(t,r)&&vb(e,r,t[r]);if(Hd)for(var r of Hd(t))nk.call(t,r)&&vb(e,r,t[r]);return e},t8=(e,t)=>{var r={};for(var n in e)rk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hd)for(var n of Hd(e))t.indexOf(n)<0&&nk.call(e,n)&&(r[n]=e[n]);return r};function ok(e){const t=e,{width:r,height:n,style:o}=t,a=t8(t,["width","height","style"]);return S.createElement("svg",yb({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:yb({width:r,height:n},o)},a),S.createElement("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"}))}ok.displayName="@mantine/core/CloseIcon";var r8=Object.defineProperty,qd=Object.getOwnPropertySymbols,ak=Object.prototype.hasOwnProperty,ik=Object.prototype.propertyIsEnumerable,xb=(e,t,r)=>t in e?r8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n8=(e,t)=>{for(var r in t||(t={}))ak.call(t,r)&&xb(e,r,t[r]);if(qd)for(var r of qd(t))ik.call(t,r)&&xb(e,r,t[r]);return e},o8=(e,t)=>{var r={};for(var n in e)ak.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qd)for(var n of qd(e))t.indexOf(n)<0&&ik.call(e,n)&&(r[n]=e[n]);return r};const a8={xs:P(12),sm:P(16),md:P(20),lg:P(28),xl:P(34)},i8={size:"sm"},sk=f.forwardRef((e,t)=>{const r=q("CloseButton",i8,e),{iconSize:n,size:o,children:a}=r,i=o8(r,["iconSize","size","children"]),l=P(n||a8[o]);return S.createElement(ur,n8({ref:t,__staticSelector:"CloseButton",size:o},i),a||S.createElement(ok,{width:l,height:l}))});sk.displayName="@mantine/core/CloseButton";const vc=sk;var s8=Object.defineProperty,Gd=Object.getOwnPropertySymbols,lk=Object.prototype.hasOwnProperty,ck=Object.prototype.propertyIsEnumerable,wb=(e,t,r)=>t in e?s8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l8=(e,t)=>{for(var r in t||(t={}))lk.call(t,r)&&wb(e,r,t[r]);if(Gd)for(var r of Gd(t))ck.call(t,r)&&wb(e,r,t[r]);return e},c8=(e,t)=>{var r={};for(var n in e)lk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gd)for(var n of Gd(e))t.indexOf(n)<0&&ck.call(e,n)&&(r[n]=e[n]);return r};const u8={variant:"light"},yc=f.forwardRef((e,t)=>{const r=q("Alert",u8,e),{id:n,className:o,title:a,variant:i,children:l,color:c,classNames:u,icon:d,styles:p,onClose:h,radius:m,withCloseButton:v,closeButtonLabel:g,unstyled:_}=r,y=c8(r,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:x,cx:w}=Z7({color:c,radius:m},{classNames:u,styles:p,unstyled:_,variant:i,name:"Alert"}),b=kr(n),O=a&&`${b}-title`,C=`${b}-body`;return S.createElement(oe,l8({id:b,role:"alert","aria-labelledby":O,"aria-describedby":C,className:w(x.root,x[i],o),ref:t},y),S.createElement("div",{className:x.wrapper},d&&S.createElement("div",{className:x.icon},d),S.createElement("div",{className:x.body},a&&S.createElement("div",{className:x.title,"data-with-close-button":v||void 0},S.createElement("span",{id:O,className:x.label},a)),S.createElement("div",{id:C,className:x.message},l)),v&&S.createElement(vc,{className:x.closeButton,onClick:h,variant:"transparent",size:16,iconSize:16,"aria-label":g})))});yc.displayName="@mantine/core/Alert";var d8=Object.defineProperty,f8=Object.defineProperties,p8=Object.getOwnPropertyDescriptors,bb=Object.getOwnPropertySymbols,h8=Object.prototype.hasOwnProperty,m8=Object.prototype.propertyIsEnumerable,_b=(e,t,r)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,du=(e,t)=>{for(var r in t||(t={}))h8.call(t,r)&&_b(e,r,t[r]);if(bb)for(var r of bb(t))m8.call(t,r)&&_b(e,r,t[r]);return e},g8=(e,t)=>f8(e,p8(t));function v8({underline:e,strikethrough:t}){const r=[];return e&&r.push("underline"),t&&r.push("line-through"),r.length>0?r.join(" "):"none"}function y8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?e.fn.variant({variant:"filled",color:t}).background:t||"inherit"}function x8(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function w8({theme:e,truncate:t}){return t==="start"?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",direction:e.dir==="ltr"?"rtl":"ltr",textAlign:e.dir==="ltr"?"right":"left"}:t?{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}:null}var b8=W((e,{color:t,lineClamp:r,truncate:n,inline:o,inherit:a,underline:i,gradient:l,weight:c,transform:u,align:d,strikethrough:p,italic:h},{size:m})=>{const v=e.fn.variant({variant:"gradient",gradient:l});return{root:g8(du(du(du(du({},e.fn.fontStyles()),e.fn.focusStyles()),x8(r)),w8({theme:e,truncate:n})),{color:y8({color:t,theme:e}),fontFamily:a?"inherit":e.fontFamily,fontSize:a||m===void 0?"inherit":A({size:m,sizes:e.fontSizes}),lineHeight:a?"inherit":o?1:e.lineHeight,textDecoration:v8({underline:i,strikethrough:p}),WebkitTapHighlightColor:"transparent",fontWeight:a?"inherit":c,textTransform:u,textAlign:d,fontStyle:h?"italic":void 0}),gradient:{backgroundImage:v.background,WebkitBackgroundClip:"text",WebkitTextFillColor:"transparent"}}});const _8=b8;var S8=Object.defineProperty,Qd=Object.getOwnPropertySymbols,uk=Object.prototype.hasOwnProperty,dk=Object.prototype.propertyIsEnumerable,Sb=(e,t,r)=>t in e?S8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P8=(e,t)=>{for(var r in t||(t={}))uk.call(t,r)&&Sb(e,r,t[r]);if(Qd)for(var r of Qd(t))dk.call(t,r)&&Sb(e,r,t[r]);return e},j8=(e,t)=>{var r={};for(var n in e)uk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qd)for(var n of Qd(e))t.indexOf(n)<0&&dk.call(e,n)&&(r[n]=e[n]);return r};const O8={variant:"text"},fk=f.forwardRef((e,t)=>{const r=q("Text",O8,e),{className:n,size:o,weight:a,transform:i,color:l,align:c,variant:u,lineClamp:d,truncate:p,gradient:h,inline:m,inherit:v,underline:g,strikethrough:_,italic:y,classNames:x,styles:w,unstyled:b,span:O,__staticSelector:C}=r,j=j8(r,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:E,cx:T}=_8({color:l,lineClamp:d,truncate:p,inline:m,inherit:v,underline:g,strikethrough:_,italic:y,weight:a,transform:i,align:c,gradient:h},{unstyled:b,name:C||"Text",variant:u,size:o});return S.createElement(oe,P8({ref:t,className:T(E.root,{[E.gradient]:u==="gradient"},n),component:O?"span":"div"},j))});fk.displayName="@mantine/core/Text";const te=fk;var C8=Object.defineProperty,Pb=Object.getOwnPropertySymbols,E8=Object.prototype.hasOwnProperty,$8=Object.prototype.propertyIsEnumerable,jb=(e,t,r)=>t in e?C8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,k8=(e,t)=>{for(var r in t||(t={}))E8.call(t,r)&&jb(e,r,t[r]);if(Pb)for(var r of Pb(t))$8.call(t,r)&&jb(e,r,t[r]);return e};function R8({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():e.fn.themeColor(t||e.primaryColor,e.colorScheme==="dark"?4:7,!1,!0)}var T8=W((e,{color:t,underline:r})=>({root:k8({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:R8({theme:e,color:t})},e.fn.hover({textDecoration:r?"underline":"none"}))}));const I8=T8;var D8=Object.defineProperty,Kd=Object.getOwnPropertySymbols,pk=Object.prototype.hasOwnProperty,hk=Object.prototype.propertyIsEnumerable,Ob=(e,t,r)=>t in e?D8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cb=(e,t)=>{for(var r in t||(t={}))pk.call(t,r)&&Ob(e,r,t[r]);if(Kd)for(var r of Kd(t))hk.call(t,r)&&Ob(e,r,t[r]);return e},N8=(e,t)=>{var r={};for(var n in e)pk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Kd)for(var n of Kd(e))t.indexOf(n)<0&&hk.call(e,n)&&(r[n]=e[n]);return r};const A8={underline:!0},mk=f.forwardRef((e,t)=>{const r=q("Anchor",A8,e),{component:n,className:o,unstyled:a,variant:i,size:l,color:c,underline:u}=r,d=N8(r,["component","className","unstyled","variant","size","color","underline"]),{classes:p,cx:h}=I8({color:c,underline:u},{name:"Anchor",unstyled:a,variant:i,size:l}),m=n==="button"?{type:"button"}:null;return S.createElement(te,Cb(Cb({component:n||"a",ref:t,className:h(p.root,o),size:l},m),d))});mk.displayName="@mantine/core/Anchor";const Me=mk,gk=f.createContext({zIndex:1e3,fixed:!1,layout:"default"}),M8=gk.Provider;function vk(){return f.useContext(gk)}function Uh(e,t){if(!e)return[];const r=Object.keys(e).filter(n=>n!=="base").map(n=>[A({size:n,sizes:t.breakpoints,units:"em"}),e[n]]);return r.sort((n,o)=>fr(n[0])-fr(o[0])),r}var L8=Object.defineProperty,z8=Object.defineProperties,F8=Object.getOwnPropertyDescriptors,Eb=Object.getOwnPropertySymbols,V8=Object.prototype.hasOwnProperty,B8=Object.prototype.propertyIsEnumerable,$b=(e,t,r)=>t in e?L8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fu=(e,t)=>{for(var r in t||(t={}))V8.call(t,r)&&$b(e,r,t[r]);if(Eb)for(var r of Eb(t))B8.call(t,r)&&$b(e,r,t[r]);return e},kb=(e,t)=>z8(e,F8(t)),U8=W((e,{height:t,width:r,fixed:n,position:o,hiddenBreakpoint:a,zIndex:i,section:l,withBorder:c,layout:u})=>{const d=typeof r=="object"&&r!==null?Uh(r,e).reduce((h,[m,v])=>(h[`@media (min-width: ${nr(m)})`]={width:P(v),minWidth:P(v)},h),{}):null,p=c?{[l==="navbar"?"borderRight":"borderLeft"]:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`}:{};return{root:kb(fu(fu(kb(fu(fu({},e.fn.fontStyles()),o),{top:u==="alt"?0:(o==null?void 0:o.top)||"var(--mantine-header-height)",bottom:0,zIndex:i,height:t?P(t):u==="alt"?"auto":"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))",width:r!=null&&r.base?P(r==null?void 0:r.base):"100%",position:n?"fixed":"static",boxSizing:"border-box",display:"flex",flexDirection:"column",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),p),d),{"&[data-hidden]":{[`@media (max-width: ${nr(fr(A({size:a,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const W8=U8;var H8=Object.defineProperty,Yd=Object.getOwnPropertySymbols,yk=Object.prototype.hasOwnProperty,xk=Object.prototype.propertyIsEnumerable,Rb=(e,t,r)=>t in e?H8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tb=(e,t)=>{for(var r in t||(t={}))yk.call(t,r)&&Rb(e,r,t[r]);if(Yd)for(var r of Yd(t))xk.call(t,r)&&Rb(e,r,t[r]);return e},q8=(e,t)=>{var r={};for(var n in e)yk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yd)for(var n of Yd(e))t.indexOf(n)<0&&xk.call(e,n)&&(r[n]=e[n]);return r};const wk=f.forwardRef((e,t)=>{var r=e,{width:n,height:o,fixed:a=!1,position:i,zIndex:l,hiddenBreakpoint:c="md",hidden:u=!1,withBorder:d=!0,className:p,classNames:h,styles:m,children:v,section:g,__staticSelector:_,unstyled:y,variant:x}=r,w=q8(r,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const b=vk(),{classes:O,cx:C,theme:j}=W8({width:n,height:o,fixed:b.fixed||a,position:i,hiddenBreakpoint:c,zIndex:l||b.zIndex||Rn("app"),section:g,withBorder:d,layout:b.layout},{classNames:h,styles:m,name:_,unstyled:y,variant:x}),E=Uh(n,j).reduce((T,[$,I])=>(T[`@media (min-width: ${nr($)})`]={[`--mantine-${g}-width`]:P(I)},T),{});return S.createElement(oe,Tb({component:g==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:C(O.root,p)},w),v,S.createElement(jE,{styles:()=>({":root":Tb({[`--mantine-${g}-width`]:n!=null&&n.base?P(n.base):"0rem"},E)})}))});wk.displayName="@mantine/core/HorizontalSection";var G8=Object.defineProperty,Xd=Object.getOwnPropertySymbols,bk=Object.prototype.hasOwnProperty,_k=Object.prototype.propertyIsEnumerable,Ib=(e,t,r)=>t in e?G8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q8=(e,t)=>{for(var r in t||(t={}))bk.call(t,r)&&Ib(e,r,t[r]);if(Xd)for(var r of Xd(t))_k.call(t,r)&&Ib(e,r,t[r]);return e},K8=(e,t)=>{var r={};for(var n in e)bk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xd)for(var n of Xd(e))t.indexOf(n)<0&&_k.call(e,n)&&(r[n]=e[n]);return r};const Sk=f.forwardRef((e,t)=>{var r=e,{children:n,grow:o=!1,sx:a}=r,i=K8(r,["children","grow","sx"]);return S.createElement(oe,Q8({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...lc(a)]},i),n)});Sk.displayName="@mantine/core/Section";const Y8=Sk;var X8=Object.defineProperty,Db=Object.getOwnPropertySymbols,J8=Object.prototype.hasOwnProperty,Z8=Object.prototype.propertyIsEnumerable,Nb=(e,t,r)=>t in e?X8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eF=(e,t)=>{for(var r in t||(t={}))J8.call(t,r)&&Nb(e,r,t[r]);if(Db)for(var r of Db(t))Z8.call(t,r)&&Nb(e,r,t[r]);return e};const tF={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},$l=f.forwardRef((e,t)=>{const r=q("Navbar",tF,e);return S.createElement(wk,eF({section:"navbar",__staticSelector:"Navbar",ref:t},r))});$l.Section=Y8;$l.displayName="@mantine/core/Navbar";var rF=Object.defineProperty,nF=Object.defineProperties,oF=Object.getOwnPropertyDescriptors,Ab=Object.getOwnPropertySymbols,aF=Object.prototype.hasOwnProperty,iF=Object.prototype.propertyIsEnumerable,Mb=(e,t,r)=>t in e?rF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ng=(e,t)=>{for(var r in t||(t={}))aF.call(t,r)&&Mb(e,r,t[r]);if(Ab)for(var r of Ab(t))iF.call(t,r)&&Mb(e,r,t[r]);return e},Lb=(e,t)=>nF(e,oF(t)),sF=W((e,{height:t,fixed:r,position:n,zIndex:o,borderPosition:a,layout:i})=>{const l=typeof t=="object"&&t!==null?Uh(t,e).reduce((c,[u,d])=>(c[`@media (min-width: ${nr(u)})`]={height:P(d),minHeight:P(d)},c),{}):null;return{root:Lb(ng(Lb(ng(ng({},e.fn.fontStyles()),n),{zIndex:o,left:i==="alt"?"var(--mantine-navbar-width, 0)":0,right:i==="alt"?"var(--mantine-aside-width, 0)":0,height:typeof t=="object"?P(t==null?void 0:t.base)||"100%":P(t),maxHeight:typeof t=="object"?P(t==null?void 0:t.base)||"100%":P(t),position:r?"fixed":"static",boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white}),l),{borderBottom:a==="bottom"?`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0,borderTop:a==="top"?`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[2]}`:void 0})}});const lF=sF;var cF=Object.defineProperty,Jd=Object.getOwnPropertySymbols,Pk=Object.prototype.hasOwnProperty,jk=Object.prototype.propertyIsEnumerable,zb=(e,t,r)=>t in e?cF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fb=(e,t)=>{for(var r in t||(t={}))Pk.call(t,r)&&zb(e,r,t[r]);if(Jd)for(var r of Jd(t))jk.call(t,r)&&zb(e,r,t[r]);return e},uF=(e,t)=>{var r={};for(var n in e)Pk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jd)for(var n of Jd(e))t.indexOf(n)<0&&jk.call(e,n)&&(r[n]=e[n]);return r};const Ok=f.forwardRef((e,t)=>{var r=e,{children:n,className:o,classNames:a,styles:i,height:l,fixed:c=!1,withBorder:u=!0,position:d,zIndex:p,section:h,unstyled:m,__staticSelector:v,variant:g}=r,_=uF(r,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector","variant"]);const y=vk(),x=p||y.zIndex||Rn("app"),{classes:w,cx:b,theme:O}=lF({height:l,fixed:y.fixed||c,position:d,zIndex:typeof x=="number"&&y.layout==="default"?x+1:x,layout:y.layout,borderPosition:u?h==="header"?"bottom":"top":"none"},{name:v,classNames:a,styles:i,unstyled:m,variant:g}),C=typeof l=="object"&&l!==null?Uh(l,O).reduce((j,[E,T])=>(j[`@media (min-width: ${nr(E)})`]={[`--mantine-${h}-height`]:P(T)},j),{}):null;return S.createElement(oe,Fb({component:h==="header"?"header":"footer",className:b(w.root,o),ref:t},_),n,S.createElement(jE,{styles:()=>({":root":Fb({[`--mantine-${h}-height`]:typeof l=="object"?P(l==null?void 0:l.base)||"100%":P(l)},C)})}))});Ok.displayName="@mantine/core/VerticalSection";var dF=Object.defineProperty,fF=Object.defineProperties,pF=Object.getOwnPropertyDescriptors,Vb=Object.getOwnPropertySymbols,hF=Object.prototype.hasOwnProperty,mF=Object.prototype.propertyIsEnumerable,Bb=(e,t,r)=>t in e?dF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gF=(e,t)=>{for(var r in t||(t={}))hF.call(t,r)&&Bb(e,r,t[r]);if(Vb)for(var r of Vb(t))mF.call(t,r)&&Bb(e,r,t[r]);return e},vF=(e,t)=>fF(e,pF(t));const yF={fixed:!1,position:{top:0,left:0,right:0}},Ck=f.forwardRef((e,t)=>{const r=q("Header",yF,e);return S.createElement(Ok,vF(gF({section:"header",__staticSelector:"Header"},r),{ref:t}))});Ck.displayName="@mantine/core/Header";var xF=Object.defineProperty,Ub=Object.getOwnPropertySymbols,wF=Object.prototype.hasOwnProperty,bF=Object.prototype.propertyIsEnumerable,Wb=(e,t,r)=>t in e?xF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ek=(e,t)=>{for(var r in t||(t={}))wF.call(t,r)&&Wb(e,r,t[r]);if(Ub)for(var r of Ub(t))bF.call(t,r)&&Wb(e,r,t[r]);return e};function _F(e,t){const r=A({size:e.padding,sizes:t.spacing}),n=e.navbarOffsetBreakpoint?A({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?A({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;if(!e.fixed)return{padding:r};const a=fr(n),i=fr(o);return Ek({minHeight:"100vh",paddingTop:`calc(var(--mantine-header-height, 0px) + ${r})`,paddingBottom:`calc(var(--mantine-footer-height, 0px) + ${r})`,paddingLeft:`calc(var(--mantine-navbar-width, 0px) + ${r})`,paddingRight:`calc(var(--mantine-aside-width, 0px) + ${r})`},a===i?{[`@media (max-width: ${nr(a-1)})`]:{paddingLeft:r,paddingRight:r}}:{[`@media (max-width: ${nr(a-1)})`]:{paddingLeft:r},[`@media (max-width: ${nr(i-1)})`]:{paddingRight:r}})}var SF=W((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:Ek({flex:1,width:"100vw",boxSizing:"border-box"},_F(t,e))}));const PF=SF;var jF=Object.defineProperty,Zd=Object.getOwnPropertySymbols,$k=Object.prototype.hasOwnProperty,kk=Object.prototype.propertyIsEnumerable,Hb=(e,t,r)=>t in e?jF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OF=(e,t)=>{for(var r in t||(t={}))$k.call(t,r)&&Hb(e,r,t[r]);if(Zd)for(var r of Zd(t))kk.call(t,r)&&Hb(e,r,t[r]);return e},CF=(e,t)=>{var r={};for(var n in e)$k.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zd)for(var n of Zd(e))t.indexOf(n)<0&&kk.call(e,n)&&(r[n]=e[n]);return r};const EF={fixed:!0,padding:"md"},Rk=f.forwardRef((e,t)=>{const r=q("AppShell",EF,e),{children:n,navbar:o,header:a,footer:i,aside:l,fixed:c,zIndex:u,padding:d,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h,className:m,styles:v,classNames:g,unstyled:_,hidden:y,layout:x,variant:w}=r,b=CF(r,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout","variant"]),{classes:O,cx:C}=PF({padding:d,fixed:c,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h},{styles:v,classNames:g,unstyled:_,name:"AppShell",variant:w});return y?S.createElement(S.Fragment,null,n):S.createElement(M8,{value:{fixed:c,zIndex:u,layout:x}},S.createElement(oe,OF({className:C(O.root,m),ref:t},b),a,S.createElement("div",{className:O.body},o,S.createElement("main",{className:O.main},n),l),i))});Rk.displayName="@mantine/core/AppShell";const pu={xs:P(1),sm:P(2),md:P(3),lg:P(4),xl:P(5)};function hu(e,t){const r=e.fn.variant({variant:"outline",color:t}).border;return typeof t=="string"&&(t in e.colors||t.split(".")[0]in e.colors)?r:t===void 0?e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]:t}var $F=W((e,{color:t},{size:r,variant:n})=>({root:{},withLabel:{borderTop:"0 !important"},left:{"&::before":{display:"none"}},right:{"&::after":{display:"none"}},label:{display:"flex",alignItems:"center","&::before":{content:'""',flex:1,height:P(1),borderTop:`${A({size:r,sizes:pu})} ${n} ${hu(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${A({size:r,sizes:pu})} ${n} ${hu(e,t)}`,marginLeft:e.spacing.xs}},labelDefaultStyles:{color:t==="dark"?e.colors.dark[1]:e.fn.themeColor(t,e.colorScheme==="dark"?5:e.fn.primaryShade(),!1)},horizontal:{border:0,borderTopWidth:P(A({size:r,sizes:pu})),borderTopColor:hu(e,t),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:P(A({size:r,sizes:pu})),borderLeftColor:hu(e,t),borderLeftStyle:n}}));const kF=$F;var RF=Object.defineProperty,TF=Object.defineProperties,IF=Object.getOwnPropertyDescriptors,ef=Object.getOwnPropertySymbols,Tk=Object.prototype.hasOwnProperty,Ik=Object.prototype.propertyIsEnumerable,qb=(e,t,r)=>t in e?RF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gb=(e,t)=>{for(var r in t||(t={}))Tk.call(t,r)&&qb(e,r,t[r]);if(ef)for(var r of ef(t))Ik.call(t,r)&&qb(e,r,t[r]);return e},DF=(e,t)=>TF(e,IF(t)),NF=(e,t)=>{var r={};for(var n in e)Tk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ef)for(var n of ef(e))t.indexOf(n)<0&&Ik.call(e,n)&&(r[n]=e[n]);return r};const AF={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},wr=f.forwardRef((e,t)=>{const r=q("Divider",AF,e),{className:n,color:o,orientation:a,size:i,label:l,labelPosition:c,labelProps:u,variant:d,styles:p,classNames:h,unstyled:m}=r,v=NF(r,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:g,cx:_}=kF({color:o},{classNames:h,styles:p,unstyled:m,name:"Divider",variant:d,size:i}),y=a==="vertical",x=a==="horizontal",w=!!l&&x,b=!(u!=null&&u.color);return S.createElement(oe,Gb({ref:t,className:_(g.root,{[g.vertical]:y,[g.horizontal]:x,[g.withLabel]:w},n),role:"separator"},v),w&&S.createElement(te,DF(Gb({},u),{size:(u==null?void 0:u.size)||"xs",mt:P(2),className:_(g.label,g[c],{[g.labelDefaultStyles]:b})}),l))});wr.displayName="@mantine/core/Divider";var MF=Object.defineProperty,LF=Object.defineProperties,zF=Object.getOwnPropertyDescriptors,Qb=Object.getOwnPropertySymbols,FF=Object.prototype.hasOwnProperty,VF=Object.prototype.propertyIsEnumerable,Kb=(e,t,r)=>t in e?MF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yb=(e,t)=>{for(var r in t||(t={}))FF.call(t,r)&&Kb(e,r,t[r]);if(Qb)for(var r of Qb(t))VF.call(t,r)&&Kb(e,r,t[r]);return e},BF=(e,t)=>LF(e,zF(t)),UF=W((e,t,{size:r})=>({item:BF(Yb({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`,cursor:"pointer",fontSize:A({size:r,sizes:e.fontSizes}),color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,borderRadius:e.fn.radius(),"&[data-hovered]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[1]},"&[data-selected]":Yb({backgroundColor:e.fn.variant({variant:"filled"}).background,color:e.fn.variant({variant:"filled"}).color},e.fn.hover({backgroundColor:e.fn.variant({variant:"filled"}).hover})),"&[data-disabled]":{cursor:"default",color:e.colors.dark[2]}}),nothingFound:{boxSizing:"border-box",color:e.colors.gray[6],paddingTop:`calc(${A({size:r,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${A({size:r,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${A({size:r,sizes:e.spacing})} / 1.5) ${A({size:r,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const WF=UF;var HF=Object.defineProperty,Xb=Object.getOwnPropertySymbols,qF=Object.prototype.hasOwnProperty,GF=Object.prototype.propertyIsEnumerable,Jb=(e,t,r)=>t in e?HF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QF=(e,t)=>{for(var r in t||(t={}))qF.call(t,r)&&Jb(e,r,t[r]);if(Xb)for(var r of Xb(t))GF.call(t,r)&&Jb(e,r,t[r]);return e};function Dk({data:e,hovered:t,classNames:r,styles:n,isItemSelected:o,uuid:a,__staticSelector:i,onItemHover:l,onItemSelect:c,itemsRefs:u,itemComponent:d,size:p,nothingFound:h,creatable:m,createLabel:v,unstyled:g,variant:_}){const{classes:y}=WF(null,{classNames:r,styles:n,unstyled:g,name:i,variant:_,size:p}),x=[],w=[];let b=null;const O=(j,E)=>{const T=typeof o=="function"?o(j.value):!1;return S.createElement(d,QF({key:j.value,className:y.item,"data-disabled":j.disabled||void 0,"data-hovered":!j.disabled&&t===E||void 0,"data-selected":!j.disabled&&T||void 0,selected:T,onMouseEnter:()=>l(E),id:`${a}-${E}`,role:"option",tabIndex:-1,"aria-selected":t===E,ref:$=>{u&&u.current&&(u.current[j.value]=$)},onMouseDown:j.disabled?null:$=>{$.preventDefault(),c(j)},disabled:j.disabled,variant:_},j))};let C=null;if(e.forEach((j,E)=>{j.creatable?b=E:j.group?(C!==j.group&&(C=j.group,w.push(S.createElement("div",{className:y.separator,key:`__mantine-divider-${E}`},S.createElement(wr,{classNames:{label:y.separatorLabel},label:j.group})))),w.push(O(j,E))):x.push(O(j,E))}),m){const j=e[b];x.push(S.createElement("div",{key:Oh(),className:y.item,"data-hovered":t===b||void 0,onMouseEnter:()=>l(b),onMouseDown:E=>{E.preventDefault(),c(j)},tabIndex:-1,ref:E=>{u&&u.current&&(u.current[j.value]=E)}},v))}return w.length>0&&x.length>0&&x.unshift(S.createElement("div",{className:y.separator,key:"empty-group-separator"},S.createElement(wr,null))),w.length>0||x.length>0?S.createElement(S.Fragment,null,w,x):S.createElement(te,{size:p,unstyled:g,className:y.nothingFound},h)}Dk.displayName="@mantine/core/SelectItems";var KF=Object.defineProperty,tf=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Ak=Object.prototype.propertyIsEnumerable,Zb=(e,t,r)=>t in e?KF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YF=(e,t)=>{for(var r in t||(t={}))Nk.call(t,r)&&Zb(e,r,t[r]);if(tf)for(var r of tf(t))Ak.call(t,r)&&Zb(e,r,t[r]);return e},XF=(e,t)=>{var r={};for(var n in e)Nk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tf)for(var n of tf(e))t.indexOf(n)<0&&Ak.call(e,n)&&(r[n]=e[n]);return r};const Mk=f.forwardRef((e,t)=>{var r=e,{label:n,value:o}=r,a=XF(r,["label","value"]);return S.createElement("div",YF({ref:t},a),n||o)});Mk.displayName="@mantine/core/DefaultItem";function JF(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Lk(...e){return t=>e.forEach(r=>JF(r,t))}function oi(...e){return f.useCallback(Lk(...e),e)}const zk=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),a=o.find(eV);if(a){const i=a.props.children,l=o.map(c=>c===a?f.Children.count(i)>1?f.Children.only(null):f.isValidElement(i)?i.props.children:null:c);return f.createElement(Lv,tt({},n,{ref:t}),f.isValidElement(i)?f.cloneElement(i,void 0,l):null)}return f.createElement(Lv,tt({},n,{ref:t}),r)});zk.displayName="Slot";const Lv=f.forwardRef((e,t)=>{const{children:r,...n}=e;return f.isValidElement(r)?f.cloneElement(r,{...tV(n,r.props),ref:Lk(t,r.ref)}):f.Children.count(r)>1?f.Children.only(null):null});Lv.displayName="SlotClone";const ZF=({children:e})=>f.createElement(f.Fragment,null,e);function eV(e){return f.isValidElement(e)&&e.type===ZF}function tV(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...l)=>{a(...l),o(...l)}:o&&(r[n]=o):n==="style"?r[n]={...o,...a}:n==="className"&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const rV=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],xc=rV.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:a,...i}=n,l=a?zk:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(l,tt({},i,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),zv=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function nV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const wc=e=>{const{present:t,children:r}=e,n=oV(t),o=typeof r=="function"?r({present:n.isPresent}):f.Children.only(r),a=oi(n.ref,o.ref);return typeof r=="function"||n.isPresent?f.cloneElement(o,{ref:a}):null};wc.displayName="Presence";function oV(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),a=f.useRef("none"),i=e?"mounted":"unmounted",[l,c]=nV(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=mu(n.current);a.current=l==="mounted"?u:"none"},[l]),zv(()=>{const u=n.current,d=o.current;if(d!==e){const h=a.current,m=mu(u);e?c("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),zv(()=>{if(t){const u=p=>{const m=mu(n.current).includes(p.animationName);p.target===t&&m&&gc.flushSync(()=>c("ANIMATION_END"))},d=p=>{p.target===t&&(a.current=mu(n.current))};return t.addEventListener("animationstart",d),t.addEventListener("animationcancel",u),t.addEventListener("animationend",u),()=>{t.removeEventListener("animationstart",d),t.removeEventListener("animationcancel",u),t.removeEventListener("animationend",u)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{u&&(n.current=getComputedStyle(u)),r(u)},[])}}function mu(e){return(e==null?void 0:e.animationName)||"none"}function aV(e,t=[]){let r=[];function n(a,i){const l=f.createContext(i),c=r.length;r=[...r,i];function u(p){const{scope:h,children:m,...v}=p,g=(h==null?void 0:h[e][c])||l,_=f.useMemo(()=>v,Object.values(v));return f.createElement(g.Provider,{value:_},m)}function d(p,h){const m=(h==null?void 0:h[e][c])||l,v=f.useContext(m);if(v)return v;if(i!==void 0)return i;throw new Error(`\`${p}\` must be used within \`${a}\``)}return u.displayName=a+"Provider",[u,d]}const o=()=>{const a=r.map(i=>f.createContext(i));return function(l){const c=(l==null?void 0:l[e])||a;return f.useMemo(()=>({[`__scope${e}`]:{...l,[e]:c}}),[l,c])}};return o.scopeName=e,[n,iV(o,...t)]}function iV(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(a){const i=n.reduce((l,{useScope:c,scopeName:u})=>{const p=c(a)[`__scope${u}`];return{...l,...p}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:i}),[i])}};return r.scopeName=t.scopeName,r}function Ta(e){const t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...r)=>{var n;return(n=t.current)===null||n===void 0?void 0:n.call(t,...r)},[])}const sV=f.createContext(void 0);function lV(e){const t=f.useContext(sV);return e||t||"ltr"}function cV(e,[t,r]){return Math.min(r,Math.max(t,e))}function Va(e,t,{checkForDefaultPrevented:r=!0}={}){return function(o){if(e==null||e(o),r===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function uV(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const Fk="ScrollArea",[Vk,Ige]=aV(Fk),[dV,pn]=Vk(Fk),fV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,type:n="hover",dir:o,scrollHideDelay:a=600,...i}=e,[l,c]=f.useState(null),[u,d]=f.useState(null),[p,h]=f.useState(null),[m,v]=f.useState(null),[g,_]=f.useState(null),[y,x]=f.useState(0),[w,b]=f.useState(0),[O,C]=f.useState(!1),[j,E]=f.useState(!1),T=oi(t,I=>c(I)),$=lV(o);return f.createElement(dV,{scope:r,type:n,dir:$,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:p,onContentChange:h,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:O,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:_,scrollbarYEnabled:j,onScrollbarYEnabledChange:E,onCornerWidthChange:x,onCornerHeightChange:b},f.createElement(xc.div,tt({dir:$},i,{ref:T,style:{position:"relative","--radix-scroll-area-corner-width":y+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})))}),pV="ScrollAreaViewport",hV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,...o}=e,a=pn(pV,r),i=f.useRef(null),l=oi(t,i,a.onViewportChange);return f.createElement(f.Fragment,null,f.createElement("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"}}),f.createElement(xc.div,tt({"data-radix-scroll-area-viewport":""},o,{ref:l,style:{overflowX:a.scrollbarXEnabled?"scroll":"hidden",overflowY:a.scrollbarYEnabled?"scroll":"hidden",...e.style}}),f.createElement("div",{ref:a.onContentChange,style:{minWidth:"100%",display:"table"}},n)))}),Oo="ScrollAreaScrollbar",mV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pn(Oo,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,l=e.orientation==="horizontal";return f.useEffect(()=>(l?a(!0):i(!0),()=>{l?a(!1):i(!1)}),[l,a,i]),o.type==="hover"?f.createElement(gV,tt({},n,{ref:t,forceMount:r})):o.type==="scroll"?f.createElement(vV,tt({},n,{ref:t,forceMount:r})):o.type==="auto"?f.createElement(Bk,tt({},n,{ref:t,forceMount:r})):o.type==="always"?f.createElement(P0,tt({},n,{ref:t})):null}),gV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pn(Oo,e.__scopeScrollArea),[a,i]=f.useState(!1);return f.useEffect(()=>{const l=o.scrollArea;let c=0;if(l){const u=()=>{window.clearTimeout(c),i(!0)},d=()=>{c=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),f.createElement(wc,{present:r||a},f.createElement(Bk,tt({"data-state":a?"visible":"hidden"},n,{ref:t})))}),vV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=pn(Oo,e.__scopeScrollArea),a=e.orientation==="horizontal",i=Hh(()=>c("SCROLL_END"),100),[l,c]=uV("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return f.useEffect(()=>{if(l==="idle"){const u=window.setTimeout(()=>c("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[l,o.scrollHideDelay,c]),f.useEffect(()=>{const u=o.viewport,d=a?"scrollLeft":"scrollTop";if(u){let p=u[d];const h=()=>{const m=u[d];p!==m&&(c("SCROLL"),i()),p=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,a,c,i]),f.createElement(wc,{present:r||l!=="hidden"},f.createElement(P0,tt({"data-state":l==="hidden"?"hidden":"visible"},n,{ref:t,onPointerEnter:Va(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Va(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),Bk=f.forwardRef((e,t)=>{const r=pn(Oo,e.__scopeScrollArea),{forceMount:n,...o}=e,[a,i]=f.useState(!1),l=e.orientation==="horizontal",c=Hh(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;i(l?u:d)}},10);return hs(r.viewport,c),hs(r.content,c),f.createElement(wc,{present:n||a},f.createElement(P0,tt({"data-state":a?"visible":"hidden"},o,{ref:t})))}),P0=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=pn(Oo,e.__scopeScrollArea),a=f.useRef(null),i=f.useRef(0),[l,c]=f.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=qk(l.viewport,l.content),d={...n,sizes:l,onSizesChange:c,hasThumb:u>0&&u<1,onThumbChange:h=>a.current=h,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:h=>i.current=h};function p(h,m){return jV(h,i.current,l,m)}return r==="horizontal"?f.createElement(yV,tt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const h=o.viewport.scrollLeft,m=e_(h,l,o.dir);a.current.style.transform=`translate3d(${m}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=p(h,o.dir))}})):r==="vertical"?f.createElement(xV,tt({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const h=o.viewport.scrollTop,m=e_(h,l);a.current.style.transform=`translate3d(0, ${m}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}})):null}),yV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,a=pn(Oo,e.__scopeScrollArea),[i,l]=f.useState(),c=f.useRef(null),u=oi(t,c,a.onScrollbarXChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(Wk,tt({"data-orientation":"horizontal"},o,{ref:u,sizes:r,style:{bottom:0,left:a.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:a.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Wh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.x),onDragScroll:d=>e.onDragScroll(d.x),onWheelScroll:(d,p)=>{if(a.viewport){const h=a.viewport.scrollLeft+d.deltaX;e.onWheelScroll(h),Qk(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&i&&n({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:c.current.clientWidth,paddingStart:rf(i.paddingLeft),paddingEnd:rf(i.paddingRight)}})}}))}),xV=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,a=pn(Oo,e.__scopeScrollArea),[i,l]=f.useState(),c=f.useRef(null),u=oi(t,c,a.onScrollbarYChange);return f.useEffect(()=>{c.current&&l(getComputedStyle(c.current))},[c]),f.createElement(Wk,tt({"data-orientation":"vertical"},o,{ref:u,sizes:r,style:{top:0,right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Wh(r)+"px",...e.style},onThumbPointerDown:d=>e.onThumbPointerDown(d.y),onDragScroll:d=>e.onDragScroll(d.y),onWheelScroll:(d,p)=>{if(a.viewport){const h=a.viewport.scrollTop+d.deltaY;e.onWheelScroll(h),Qk(h,p)&&d.preventDefault()}},onResize:()=>{c.current&&a.viewport&&i&&n({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:c.current.clientHeight,paddingStart:rf(i.paddingTop),paddingEnd:rf(i.paddingBottom)}})}}))}),[wV,Uk]=Vk(Oo),Wk=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,sizes:n,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:l,onThumbPositionChange:c,onDragScroll:u,onWheelScroll:d,onResize:p,...h}=e,m=pn(Oo,r),[v,g]=f.useState(null),_=oi(t,T=>g(T)),y=f.useRef(null),x=f.useRef(""),w=m.viewport,b=n.content-n.viewport,O=Ta(d),C=Ta(c),j=Hh(p,10);function E(T){if(y.current){const $=T.clientX-y.current.left,I=T.clientY-y.current.top;u({x:$,y:I})}}return f.useEffect(()=>{const T=$=>{const I=$.target;(v==null?void 0:v.contains(I))&&O($,b)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[w,v,b,O]),f.useEffect(C,[n,C]),hs(v,j),hs(m.content,j),f.createElement(wV,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Ta(a),onThumbPointerUp:Ta(i),onThumbPositionChange:C,onThumbPointerDown:Ta(l)},f.createElement(xc.div,tt({},h,{ref:_,style:{position:"absolute",...h.style},onPointerDown:Va(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),y.current=v.getBoundingClientRect(),x.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",E(T))}),onPointerMove:Va(e.onPointerMove,E),onPointerUp:Va(e.onPointerUp,T=>{const $=T.target;$.hasPointerCapture(T.pointerId)&&$.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=x.current,y.current=null})})))}),Fv="ScrollAreaThumb",bV=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=Uk(Fv,e.__scopeScrollArea);return f.createElement(wc,{present:r||o.hasThumb},f.createElement(_V,tt({ref:t},n)))}),_V=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,a=pn(Fv,r),i=Uk(Fv,r),{onThumbPositionChange:l}=i,c=oi(t,p=>i.onThumbChange(p)),u=f.useRef(),d=Hh(()=>{u.current&&(u.current(),u.current=void 0)},100);return f.useEffect(()=>{const p=a.viewport;if(p){const h=()=>{if(d(),!u.current){const m=OV(p,l);u.current=m,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[a.viewport,d,l]),f.createElement(xc.div,tt({"data-state":i.hasThumb?"visible":"hidden"},o,{ref:c,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...n},onPointerDownCapture:Va(e.onPointerDownCapture,p=>{const m=p.target.getBoundingClientRect(),v=p.clientX-m.left,g=p.clientY-m.top;i.onThumbPointerDown({x:v,y:g})}),onPointerUp:Va(e.onPointerUp,i.onThumbPointerUp)}))}),Hk="ScrollAreaCorner",SV=f.forwardRef((e,t)=>{const r=pn(Hk,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.createElement(PV,tt({},e,{ref:t})):null}),PV=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=pn(Hk,r),[a,i]=f.useState(0),[l,c]=f.useState(0),u=!!(a&&l);return hs(o.scrollbarX,()=>{var d;const p=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),hs(o.scrollbarY,()=>{var d;const p=((d=o.scrollbarY)===null||d===void 0?void 0:d.offsetWidth)||0;o.onCornerWidthChange(p),i(p)}),u?f.createElement(xc.div,tt({},n,{ref:t,style:{width:a,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}})):null});function rf(e){return e?parseInt(e,10):0}function qk(e,t){const r=e/t;return isNaN(r)?0:r}function Wh(e){const t=qk(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function jV(e,t,r,n="ltr"){const o=Wh(r),a=o/2,i=t||a,l=o-i,c=r.scrollbar.paddingStart+i,u=r.scrollbar.size-r.scrollbar.paddingEnd-l,d=r.content-r.viewport,p=n==="ltr"?[0,d]:[d*-1,0];return Gk([c,u],p)(e)}function e_(e,t,r="ltr"){const n=Wh(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,l=a-n,c=r==="ltr"?[0,i]:[i*-1,0],u=cV(e,c);return Gk([0,i],[0,l])(u)}function Gk(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function Qk(e,t){return e>0&&e<t}const OV=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,l=r.top!==a.top;(i||l)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function Hh(e,t){const r=Ta(e),n=f.useRef(0);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),f.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function hs(e,t){const r=Ta(t);zv(()=>{let n=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(n),n=window.requestAnimationFrame(r)});return o.observe(e),()=>{window.cancelAnimationFrame(n),o.unobserve(e)}}},[e,r])}const CV=fV,EV=hV,t_=mV,r_=bV,$V=SV;var kV=W((e,{scrollbarSize:t,offsetScrollbars:r,scrollbarHovered:n,hidden:o})=>({root:{overflow:"hidden"},viewport:{width:"100%",height:"100%",paddingRight:r?P(t):void 0,paddingBottom:r?P(t):void 0},scrollbar:{display:o?"none":"flex",userSelect:"none",touchAction:"none",boxSizing:"border-box",padding:`calc(${P(t)} / 5)`,transition:"background-color 150ms ease, opacity 150ms ease","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0],[`& .${zt("thumb")}`]:{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.5):e.fn.rgba(e.black,.5)}},'&[data-orientation="vertical"]':{width:P(t)},'&[data-orientation="horizontal"]':{flexDirection:"column",height:P(t)},'&[data-state="hidden"]':{display:"none",opacity:0}},thumb:{ref:zt("thumb"),flex:1,backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.white,.4):e.fn.rgba(e.black,.4),borderRadius:P(t),position:"relative",transition:"background-color 150ms ease",display:o?"none":void 0,overflow:"hidden","&::before":{content:'""',position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"100%",height:"100%",minWidth:P(44),minHeight:P(44)}},corner:{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],transition:"opacity 150ms ease",opacity:n?1:0,display:o?"none":void 0}}));const RV=kV;var TV=Object.defineProperty,IV=Object.defineProperties,DV=Object.getOwnPropertyDescriptors,nf=Object.getOwnPropertySymbols,Kk=Object.prototype.hasOwnProperty,Yk=Object.prototype.propertyIsEnumerable,n_=(e,t,r)=>t in e?TV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vv=(e,t)=>{for(var r in t||(t={}))Kk.call(t,r)&&n_(e,r,t[r]);if(nf)for(var r of nf(t))Yk.call(t,r)&&n_(e,r,t[r]);return e},Xk=(e,t)=>IV(e,DV(t)),Jk=(e,t)=>{var r={};for(var n in e)Kk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nf)for(var n of nf(e))t.indexOf(n)<0&&Yk.call(e,n)&&(r[n]=e[n]);return r};const Zk={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},qh=f.forwardRef((e,t)=>{const r=q("ScrollArea",Zk,e),{children:n,className:o,classNames:a,styles:i,scrollbarSize:l,scrollHideDelay:c,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:m,unstyled:v,variant:g,viewportProps:_}=r,y=Jk(r,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[x,w]=f.useState(!1),b=Kt(),{classes:O,cx:C}=RV({scrollbarSize:l,offsetScrollbars:p,scrollbarHovered:x,hidden:u==="never"},{name:"ScrollArea",classNames:a,styles:i,unstyled:v,variant:g});return S.createElement(CV,{type:u==="never"?"always":u,scrollHideDelay:c,dir:d||b.dir,ref:t,asChild:!0},S.createElement(oe,Vv({className:C(O.root,o)},y),S.createElement(EV,Xk(Vv({},_),{className:O.viewport,ref:h,onScroll:typeof m=="function"?({currentTarget:j})=>m({x:j.scrollLeft,y:j.scrollTop}):void 0}),n),S.createElement(t_,{orientation:"horizontal",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},S.createElement(r_,{className:O.thumb})),S.createElement(t_,{orientation:"vertical",className:O.scrollbar,forceMount:!0,onMouseEnter:()=>w(!0),onMouseLeave:()=>w(!1)},S.createElement(r_,{className:O.thumb})),S.createElement($V,{className:O.corner})))}),eR=f.forwardRef((e,t)=>{const r=q("ScrollAreaAutosize",Zk,e),{children:n,classNames:o,styles:a,scrollbarSize:i,scrollHideDelay:l,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,sx:v,variant:g,viewportProps:_}=r,y=Jk(r,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return S.createElement(oe,Xk(Vv({},y),{ref:t,sx:[{display:"flex"},...lc(v)]}),S.createElement(oe,{sx:{display:"flex",flexDirection:"column",flex:1}},S.createElement(qh,{classNames:o,styles:a,scrollHideDelay:l,scrollbarSize:i,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:m,variant:g,viewportProps:_},n)))});eR.displayName="@mantine/core/ScrollAreaAutosize";qh.displayName="@mantine/core/ScrollArea";qh.Autosize=eR;const ai=qh;var NV=Object.defineProperty,AV=Object.defineProperties,MV=Object.getOwnPropertyDescriptors,of=Object.getOwnPropertySymbols,tR=Object.prototype.hasOwnProperty,rR=Object.prototype.propertyIsEnumerable,o_=(e,t,r)=>t in e?NV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a_=(e,t)=>{for(var r in t||(t={}))tR.call(t,r)&&o_(e,r,t[r]);if(of)for(var r of of(t))rR.call(t,r)&&o_(e,r,t[r]);return e},LV=(e,t)=>AV(e,MV(t)),zV=(e,t)=>{var r={};for(var n in e)tR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&of)for(var n of of(e))t.indexOf(n)<0&&rR.call(e,n)&&(r[n]=e[n]);return r};const j0=f.forwardRef((e,t)=>{var r=e,{style:n}=r,o=zV(r,["style"]);return S.createElement(ai,LV(a_({},o),{style:a_({width:"100%"},n),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});j0.displayName="@mantine/core/SelectScrollArea";var FV=W(()=>({dropdown:{},itemsWrapper:{padding:P(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const VV=FV,Cn=Math.min,tr=Math.max,af=Math.round,gu=Math.floor,sa=e=>({x:e,y:e}),BV={left:"right",right:"left",bottom:"top",top:"bottom"},UV={start:"end",end:"start"};function Bv(e,t,r){return tr(e,Cn(t,r))}function xo(e,t){return typeof e=="function"?e(t):e}function En(e){return e.split("-")[0]}function Rs(e){return e.split("-")[1]}function O0(e){return e==="x"?"y":"x"}function C0(e){return e==="y"?"height":"width"}function ii(e){return["top","bottom"].includes(En(e))?"y":"x"}function E0(e){return O0(ii(e))}function WV(e,t,r){r===void 0&&(r=!1);const n=Rs(e),o=E0(e),a=C0(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=sf(i)),[i,sf(i)]}function HV(e){const t=sf(e);return[Uv(e),t,Uv(t)]}function Uv(e){return e.replace(/start|end/g,t=>UV[t])}function qV(e,t,r){const n=["left","right"],o=["right","left"],a=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return r?t?o:n:t?n:o;case"left":case"right":return t?a:i;default:return[]}}function GV(e,t,r,n){const o=Rs(e);let a=qV(En(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Uv)))),a}function sf(e){return e.replace(/left|right|bottom|top/g,t=>BV[t])}function QV(e){return{top:0,right:0,bottom:0,left:0,...e}}function $0(e){return typeof e!="number"?QV(e):{top:e,right:e,bottom:e,left:e}}function ms(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function i_(e,t,r){let{reference:n,floating:o}=e;const a=ii(t),i=E0(t),l=C0(i),c=En(t),u=a==="y",d=n.x+n.width/2-o.width/2,p=n.y+n.height/2-o.height/2,h=n[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:n.y-o.height};break;case"bottom":m={x:d,y:n.y+n.height};break;case"right":m={x:n.x+n.width,y:p};break;case"left":m={x:n.x-o.width,y:p};break;default:m={x:n.x,y:n.y}}switch(Rs(t)){case"start":m[i]-=h*(r&&u?-1:1);break;case"end":m[i]+=h*(r&&u?-1:1);break}return m}const KV=async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,l=a.filter(Boolean),c=await(i.isRTL==null?void 0:i.isRTL(t));let u=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:p}=i_(u,n,c),h=n,m={},v=0;for(let g=0;g<l.length;g++){const{name:_,fn:y}=l[g],{x,y:w,data:b,reset:O}=await y({x:d,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:m,rects:u,platform:i,elements:{reference:e,floating:t}});if(d=x??d,p=w??p,m={...m,[_]:{...m[_],...b}},O&&v<=50){v++,typeof O=="object"&&(O.placement&&(h=O.placement),O.rects&&(u=O.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):O.rects),{x:d,y:p}=i_(u,h,c)),g=-1;continue}}return{x:d,y:p,placement:h,strategy:o,middlewareData:m}};async function k0(e,t){var r;t===void 0&&(t={});const{x:n,y:o,platform:a,rects:i,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:p="floating",altBoundary:h=!1,padding:m=0}=xo(t,e),v=$0(m),_=l[h?p==="floating"?"reference":"floating":p],y=ms(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(_)))==null||r?_:_.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),x=p==="floating"?{...i.floating,x:n,y:o}:i.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),b=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},O=ms(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:x,offsetParent:w,strategy:c}):x);return{top:(y.top-O.top+v.top)/b.y,bottom:(O.bottom-y.bottom+v.bottom)/b.y,left:(y.left-O.left+v.left)/b.x,right:(O.right-y.right+v.right)/b.x}}const s_=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=xo(e,t)||{};if(u==null)return{};const p=$0(d),h={x:r,y:n},m=E0(o),v=C0(m),g=await i.getDimensions(u),_=m==="y",y=_?"top":"left",x=_?"bottom":"right",w=_?"clientHeight":"clientWidth",b=a.reference[v]+a.reference[m]-h[m]-a.floating[v],O=h[m]-a.reference[m],C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(u));let j=C?C[w]:0;(!j||!await(i.isElement==null?void 0:i.isElement(C)))&&(j=l.floating[w]||a.floating[v]);const E=b/2-O/2,T=j/2-g[v]/2-1,$=Cn(p[y],T),I=Cn(p[x],T),k=$,D=j-g[v]-I,N=j/2-g[v]/2+E,z=Bv(k,N,D),H=!c.arrow&&Rs(o)!=null&&N!=z&&a.reference[v]/2-(N<k?$:I)-g[v]/2<0,K=H?N<k?N-k:N-D:0;return{[m]:h[m]+K,data:{[m]:z,centerOffset:N-z-K,...H&&{alignmentOffset:K}},reset:H}}}),nR=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:v="none",flipAlignment:g=!0,..._}=xo(e,t);if((r=a.arrow)!=null&&r.alignmentOffset)return{};const y=En(o),x=En(l)===l,w=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=h||(x||!g?[sf(l)]:HV(l));!h&&v!=="none"&&b.push(...GV(l,g,v,w));const O=[l,...b],C=await k0(t,_),j=[];let E=((n=a.flip)==null?void 0:n.overflows)||[];if(d&&j.push(C[y]),p){const k=WV(o,i,w);j.push(C[k[0]],C[k[1]])}if(E=[...E,{placement:o,overflows:j}],!j.every(k=>k<=0)){var T,$;const k=(((T=a.flip)==null?void 0:T.index)||0)+1,D=O[k];if(D)return{data:{index:k,overflows:E},reset:{placement:D}};let N=($=E.filter(z=>z.overflows[0]<=0).sort((z,H)=>z.overflows[1]-H.overflows[1])[0])==null?void 0:$.placement;if(!N)switch(m){case"bestFit":{var I;const z=(I=E.map(H=>[H.placement,H.overflows.filter(K=>K>0).reduce((K,R)=>K+R,0)]).sort((H,K)=>H[1]-K[1])[0])==null?void 0:I[0];z&&(N=z);break}case"initialPlacement":N=l;break}if(o!==N)return{reset:{placement:N}}}return{}}}};function oR(e){const t=Cn(...e.map(a=>a.left)),r=Cn(...e.map(a=>a.top)),n=tr(...e.map(a=>a.right)),o=tr(...e.map(a=>a.bottom));return{x:t,y:r,width:n-t,height:o-r}}function YV(e){const t=e.slice().sort((o,a)=>o.y-a.y),r=[];let n=null;for(let o=0;o<t.length;o++){const a=t[o];!n||a.y-n.y>n.height/2?r.push([a]):r[r.length-1].push(a),n=a}return r.map(o=>ms(oR(o)))}const aR=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:r,elements:n,rects:o,platform:a,strategy:i}=t,{padding:l=2,x:c,y:u}=xo(e,t),d=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(n.reference))||[]),p=YV(d),h=ms(oR(d)),m=$0(l);function v(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&u!=null)return p.find(_=>c>_.left-m.left&&c<_.right+m.right&&u>_.top-m.top&&u<_.bottom+m.bottom)||h;if(p.length>=2){if(ii(r)==="y"){const $=p[0],I=p[p.length-1],k=En(r)==="top",D=$.top,N=I.bottom,z=k?$.left:I.left,H=k?$.right:I.right,K=H-z,R=N-D;return{top:D,bottom:N,left:z,right:H,width:K,height:R,x:z,y:D}}const _=En(r)==="left",y=tr(...p.map($=>$.right)),x=Cn(...p.map($=>$.left)),w=p.filter($=>_?$.left===x:$.right===y),b=w[0].top,O=w[w.length-1].bottom,C=x,j=y,E=j-C,T=O-b;return{top:b,bottom:O,left:C,right:j,width:E,height:T,x:C,y:b}}return h}const g=await a.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:i});return o.reference.x!==g.reference.x||o.reference.y!==g.reference.y||o.reference.width!==g.reference.width||o.reference.height!==g.reference.height?{reset:{rects:g}}:{}}}};async function XV(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=En(r),l=Rs(r),c=ii(r)==="y",u=["left","top"].includes(i)?-1:1,d=a&&c?-1:1,p=xo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof v=="number"&&(m=l==="end"?v*-1:v),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const iR=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,o=await XV(t,e);return{x:r+o.x,y:n+o.y,data:o}}}},R0=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:l={fn:_=>{let{x:y,y:x}=_;return{x:y,y:x}}},...c}=xo(e,t),u={x:r,y:n},d=await k0(t,c),p=ii(En(o)),h=O0(p);let m=u[h],v=u[p];if(a){const _=h==="y"?"top":"left",y=h==="y"?"bottom":"right",x=m+d[_],w=m-d[y];m=Bv(x,m,w)}if(i){const _=p==="y"?"top":"left",y=p==="y"?"bottom":"right",x=v+d[_],w=v-d[y];v=Bv(x,v,w)}const g=l.fn({...t,[h]:m,[p]:v});return{...g,data:{x:g.x-r,y:g.y-n}}}}},JV=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=xo(e,t),d={x:r,y:n},p=ii(o),h=O0(p);let m=d[h],v=d[p];const g=xo(l,t),_=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(c){const w=h==="y"?"height":"width",b=a.reference[h]-a.floating[w]+_.mainAxis,O=a.reference[h]+a.reference[w]-_.mainAxis;m<b?m=b:m>O&&(m=O)}if(u){var y,x;const w=h==="y"?"width":"height",b=["top","left"].includes(En(o)),O=a.reference[p]-a.floating[w]+(b&&((y=i.offset)==null?void 0:y[p])||0)+(b?0:_.crossAxis),C=a.reference[p]+a.reference[w]+(b?0:((x=i.offset)==null?void 0:x[p])||0)-(b?_.crossAxis:0);v<O?v=O:v>C&&(v=C)}return{[h]:m,[p]:v}}}},ZV=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:r,rects:n,platform:o,elements:a}=t,{apply:i=()=>{},...l}=xo(e,t),c=await k0(t,l),u=En(r),d=Rs(r),p=ii(r)==="y",{width:h,height:m}=n.floating;let v,g;u==="top"||u==="bottom"?(v=u,g=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(g=u,v=d==="end"?"top":"bottom");const _=m-c[v],y=h-c[g],x=!t.middlewareData.shift;let w=_,b=y;if(p){const C=h-c.left-c.right;b=d||x?Cn(y,C):C}else{const C=m-c.top-c.bottom;w=d||x?Cn(_,C):C}if(x&&!d){const C=tr(c.left,0),j=tr(c.right,0),E=tr(c.top,0),T=tr(c.bottom,0);p?b=h-2*(C!==0||j!==0?C+j:tr(c.left,c.right)):w=m-2*(E!==0||T!==0?E+T:tr(c.top,c.bottom))}await i({...t,availableWidth:b,availableHeight:w});const O=await o.getDimensions(a.floating);return h!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}};function la(e){return sR(e)?(e.nodeName||"").toLowerCase():"#document"}function Ur(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(sR(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function sR(e){return e instanceof Node||e instanceof Ur(e).Node}function wo(e){return e instanceof Element||e instanceof Ur(e).Element}function Yn(e){return e instanceof HTMLElement||e instanceof Ur(e).HTMLElement}function l_(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ur(e).ShadowRoot}function bc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=fn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function eB(e){return["table","td","th"].includes(la(e))}function T0(e){const t=I0(),r=fn(e);return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(r.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(r.contain||"").includes(n))}function tB(e){let t=gs(e);for(;Yn(t)&&!Gh(t);){if(T0(t))return t;t=gs(t)}return null}function I0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Gh(e){return["html","body","#document"].includes(la(e))}function fn(e){return Ur(e).getComputedStyle(e)}function Qh(e){return wo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function gs(e){if(la(e)==="html")return e;const t=e.assignedSlot||e.parentNode||l_(e)&&e.host||Co(e);return l_(t)?t.host:t}function lR(e){const t=gs(e);return Gh(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yn(t)&&bc(t)?t:lR(t)}function uo(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const o=lR(e),a=o===((n=e.ownerDocument)==null?void 0:n.body),i=Ur(o);return a?t.concat(i,i.visualViewport||[],bc(o)?o:[],i.frameElement&&r?uo(i.frameElement):[]):t.concat(o,uo(o,[],r))}function cR(e){const t=fn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Yn(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=af(r)!==a||af(n)!==i;return l&&(r=a,n=i),{width:r,height:n,$:l}}function D0(e){return wo(e)?e:e.contextElement}function rs(e){const t=D0(e);if(!Yn(t))return sa(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=cR(t);let i=(a?af(r.width):r.width)/n,l=(a?af(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const rB=sa(0);function uR(e){const t=Ur(e);return!I0()||!t.visualViewport?rB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function nB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Ur(e)?!1:t}function Qa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=D0(e);let i=sa(1);t&&(n?wo(n)&&(i=rs(n)):i=rs(e));const l=nB(a,r,n)?uR(a):sa(0);let c=(o.left+l.x)/i.x,u=(o.top+l.y)/i.y,d=o.width/i.x,p=o.height/i.y;if(a){const h=Ur(a),m=n&&wo(n)?Ur(n):n;let v=h.frameElement;for(;v&&n&&m!==h;){const g=rs(v),_=v.getBoundingClientRect(),y=fn(v),x=_.left+(v.clientLeft+parseFloat(y.paddingLeft))*g.x,w=_.top+(v.clientTop+parseFloat(y.paddingTop))*g.y;c*=g.x,u*=g.y,d*=g.x,p*=g.y,c+=x,u+=w,v=Ur(v).frameElement}}return ms({width:d,height:p,x:c,y:u})}function oB(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=Yn(r),a=Co(r);if(r===a)return t;let i={scrollLeft:0,scrollTop:0},l=sa(1);const c=sa(0);if((o||!o&&n!=="fixed")&&((la(r)!=="body"||bc(a))&&(i=Qh(r)),Yn(r))){const u=Qa(r);l=rs(r),c.x=u.x+r.clientLeft,c.y=u.y+r.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-i.scrollLeft*l.x+c.x,y:t.y*l.y-i.scrollTop*l.y+c.y}}function aB(e){return Array.from(e.getClientRects())}function dR(e){return Qa(Co(e)).left+Qh(e).scrollLeft}function iB(e){const t=Co(e),r=Qh(e),n=e.ownerDocument.body,o=tr(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=tr(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+dR(e);const l=-r.scrollTop;return fn(n).direction==="rtl"&&(i+=tr(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:l}}function sB(e,t){const r=Ur(e),n=Co(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,l=0,c=0;if(o){a=o.width,i=o.height;const u=I0();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:l,y:c}}function lB(e,t){const r=Qa(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Yn(e)?rs(e):sa(1),i=e.clientWidth*a.x,l=e.clientHeight*a.y,c=o*a.x,u=n*a.y;return{width:i,height:l,x:c,y:u}}function c_(e,t,r){let n;if(t==="viewport")n=sB(e,r);else if(t==="document")n=iB(Co(e));else if(wo(t))n=lB(t,r);else{const o=uR(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return ms(n)}function fR(e,t){const r=gs(e);return r===t||!wo(r)||Gh(r)?!1:fn(r).position==="fixed"||fR(r,t)}function cB(e,t){const r=t.get(e);if(r)return r;let n=uo(e,[],!1).filter(l=>wo(l)&&la(l)!=="body"),o=null;const a=fn(e).position==="fixed";let i=a?gs(e):e;for(;wo(i)&&!Gh(i);){const l=fn(i),c=T0(i);!c&&l.position==="fixed"&&(o=null),(a?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||bc(i)&&!c&&fR(e,i))?n=n.filter(d=>d!==i):o=l,i=gs(i)}return t.set(e,n),n}function uB(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?cB(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((u,d)=>{const p=c_(t,d,o);return u.top=tr(p.top,u.top),u.right=Cn(p.right,u.right),u.bottom=Cn(p.bottom,u.bottom),u.left=tr(p.left,u.left),u},c_(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function dB(e){return cR(e)}function fB(e,t,r){const n=Yn(t),o=Co(t),a=r==="fixed",i=Qa(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=sa(0);if(n||!n&&!a)if((la(t)!=="body"||bc(o))&&(l=Qh(t)),n){const u=Qa(t,!0,a,t);c.x=u.x+t.clientLeft,c.y=u.y+t.clientTop}else o&&(c.x=dR(o));return{x:i.left+l.scrollLeft-c.x,y:i.top+l.scrollTop-c.y,width:i.width,height:i.height}}function u_(e,t){return!Yn(e)||fn(e).position==="fixed"?null:t?t(e):e.offsetParent}function pR(e,t){const r=Ur(e);if(!Yn(e))return r;let n=u_(e,t);for(;n&&eB(n)&&fn(n).position==="static";)n=u_(n,t);return n&&(la(n)==="html"||la(n)==="body"&&fn(n).position==="static"&&!T0(n))?r:n||tB(e)||r}const pB=async function(e){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||pR,a=this.getDimensions;return{reference:fB(t,await o(r),n),floating:{x:0,y:0,...await a(r)}}};function hB(e){return fn(e).direction==="rtl"}const mB={convertOffsetParentRelativeRectToViewportRelativeRect:oB,getDocumentElement:Co,getClippingRect:uB,getOffsetParent:pR,getElementRects:pB,getClientRects:aB,getDimensions:dB,getScale:rs,isElement:wo,isRTL:hB};function gB(e,t){let r=null,n;const o=Co(e);function a(){clearTimeout(n),r&&r.disconnect(),r=null}function i(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),a();const{left:u,top:d,width:p,height:h}=e.getBoundingClientRect();if(l||t(),!p||!h)return;const m=gu(d),v=gu(o.clientWidth-(u+p)),g=gu(o.clientHeight-(d+h)),_=gu(u),x={rootMargin:-m+"px "+-v+"px "+-g+"px "+-_+"px",threshold:tr(0,Cn(1,c))||1};let w=!0;function b(O){const C=O[0].intersectionRatio;if(C!==c){if(!w)return i();C?i(!1,C):n=setTimeout(()=>{i(!1,1e-7)},100)}w=!1}try{r=new IntersectionObserver(b,{...x,root:o.ownerDocument})}catch{r=new IntersectionObserver(b,x)}r.observe(e)}return i(!0),a}function vB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,u=D0(e),d=o||a?[...u?uo(u):[],...uo(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",r,{passive:!0}),a&&y.addEventListener("resize",r)});const p=u&&l?gB(u,r):null;let h=-1,m=null;i&&(m=new ResizeObserver(y=>{let[x]=y;x&&x.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{m&&m.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let v,g=c?Qa(e):null;c&&_();function _(){const y=Qa(e);g&&(y.x!==g.x||y.y!==g.y||y.width!==g.width||y.height!==g.height)&&r(),g=y,v=requestAnimationFrame(_)}return r(),()=>{d.forEach(y=>{o&&y.removeEventListener("scroll",r),a&&y.removeEventListener("resize",r)}),p&&p(),m&&m.disconnect(),m=null,c&&cancelAnimationFrame(v)}}const yB=(e,t,r)=>{const n=new Map,o={platform:mB,...r},a={...o.platform,_c:n};return KV(e,t,{...o,platform:a})},hR=e=>{const{element:t,padding:r}=e;function n(o){return Object.prototype.hasOwnProperty.call(o,"current")}return{name:"arrow",options:e,fn(o){return n(t)?t.current!=null?s_({element:t.current,padding:r}).fn(o):{}:t?s_({element:t,padding:r}).fn(o):{}}}};var rd=typeof document<"u"?f.useLayoutEffect:f.useEffect;function lf(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 r,n,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(n=r;n--!==0;)if(!lf(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(t,o[n]))return!1;for(n=r;n--!==0;){const a=o[n];if(!(a==="_owner"&&e.$$typeof)&&!lf(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function d_(e){const t=f.useRef(e);return rd(()=>{t.current=e}),t}function xB(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,whileElementsMounted:a,open:i}=e,[l,c]=f.useState({x:null,y:null,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[u,d]=f.useState(n);lf(u,n)||d(n);const p=f.useRef(null),h=f.useRef(null),m=f.useRef(l),v=d_(a),g=d_(o),[_,y]=f.useState(null),[x,w]=f.useState(null),b=f.useCallback($=>{p.current!==$&&(p.current=$,y($))},[]),O=f.useCallback($=>{h.current!==$&&(h.current=$,w($))},[]),C=f.useCallback(()=>{if(!p.current||!h.current)return;const $={placement:t,strategy:r,middleware:u};g.current&&($.platform=g.current),yB(p.current,h.current,$).then(I=>{const k={...I,isPositioned:!0};j.current&&!lf(m.current,k)&&(m.current=k,gc.flushSync(()=>{c(k)}))})},[u,t,r,g]);rd(()=>{i===!1&&m.current.isPositioned&&(m.current.isPositioned=!1,c($=>({...$,isPositioned:!1})))},[i]);const j=f.useRef(!1);rd(()=>(j.current=!0,()=>{j.current=!1}),[]),rd(()=>{if(_&&x){if(v.current)return v.current(_,x,C);C()}},[_,x,C,v]);const E=f.useMemo(()=>({reference:p,floating:h,setReference:b,setFloating:O}),[b,O]),T=f.useMemo(()=>({reference:_,floating:x}),[_,x]);return f.useMemo(()=>({...l,update:C,refs:E,elements:T,reference:b,floating:O}),[l,C,E,T,b,O])}var vs=typeof document<"u"?f.useLayoutEffect:f.useEffect;let og=!1,wB=0;const f_=()=>"floating-ui-"+wB++;function bB(){const[e,t]=f.useState(()=>og?f_():void 0);return vs(()=>{e==null&&t(f_())},[]),f.useEffect(()=>{og||(og=!0)},[]),e}const _B=Il["useId".toString()],p_=_B||bB;function SB(){const e=new Map;return{emit(t,r){var n;(n=e.get(t))==null||n.forEach(o=>o(r))},on(t,r){e.set(t,[...e.get(t)||[],r])},off(t,r){e.set(t,(e.get(t)||[]).filter(n=>n!==r))}}}const PB=f.createContext(null),jB=f.createContext(null),mR=()=>{var e;return((e=f.useContext(PB))==null?void 0:e.id)||null},N0=()=>f.useContext(jB);function Go(e){return(e==null?void 0:e.ownerDocument)||document}function OB(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function CB(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:r,version:n}=t;return r+"/"+n}).join(" "):navigator.userAgent}function A0(e){return Go(e).defaultView||window}function Hn(e){return e?e instanceof A0(e).Element:!1}function gR(e){return e?e instanceof A0(e).HTMLElement:!1}function EB(e){if(typeof ShadowRoot>"u")return!1;const t=A0(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function $B(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(OB())||t.test(CB()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function kB(e){return e.width===0&&e.height===0||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}function vR(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function h_(e){const t=f.useRef(e);return vs(()=>{t.current=e}),t}const m_="data-floating-ui-safe-polygon";function nd(e,t,r){return r&&!vR(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const RB=function(e,t){let{enabled:r=!0,delay:n=0,handleClose:o=null,mouseOnly:a=!1,restMs:i=0,move:l=!0}=t===void 0?{}:t;const{open:c,onOpenChange:u,dataRef:d,events:p,elements:{domReference:h,floating:m},refs:v}=e,g=N0(),_=mR(),y=h_(o),x=h_(n),w=f.useRef(),b=f.useRef(),O=f.useRef(),C=f.useRef(),j=f.useRef(!0),E=f.useRef(!1),T=f.useRef(()=>{}),$=f.useCallback(()=>{var N;const z=(N=d.current.openEvent)==null?void 0:N.type;return(z==null?void 0:z.includes("mouse"))&&z!=="mousedown"},[d]);f.useEffect(()=>{if(!r)return;function N(){clearTimeout(b.current),clearTimeout(C.current),j.current=!0}return p.on("dismiss",N),()=>{p.off("dismiss",N)}},[r,p]),f.useEffect(()=>{if(!r||!y.current||!c)return;function N(){$()&&u(!1)}const z=Go(m).documentElement;return z.addEventListener("mouseleave",N),()=>{z.removeEventListener("mouseleave",N)}},[m,c,u,r,y,d,$]);const I=f.useCallback(function(N){N===void 0&&(N=!0);const z=nd(x.current,"close",w.current);z&&!O.current?(clearTimeout(b.current),b.current=setTimeout(()=>u(!1),z)):N&&(clearTimeout(b.current),u(!1))},[x,u]),k=f.useCallback(()=>{T.current(),O.current=void 0},[]),D=f.useCallback(()=>{if(E.current){const N=Go(v.floating.current).body;N.style.pointerEvents="",N.removeAttribute(m_),E.current=!1}},[v]);return f.useEffect(()=>{if(!r)return;function N(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function z(R){if(clearTimeout(b.current),j.current=!1,a&&!vR(w.current)||i>0&&nd(x.current,"open")===0)return;d.current.openEvent=R;const M=nd(x.current,"open",w.current);M?b.current=setTimeout(()=>{u(!0)},M):u(!0)}function H(R){if(N())return;T.current();const M=Go(m);if(clearTimeout(C.current),y.current){c||clearTimeout(b.current),O.current=y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){D(),k(),I()}});const B=O.current;M.addEventListener("mousemove",B),T.current=()=>{M.removeEventListener("mousemove",B)};return}I()}function K(R){N()||y.current==null||y.current({...e,tree:g,x:R.clientX,y:R.clientY,onClose(){D(),k(),I()}})(R)}if(Hn(h)){const R=h;return c&&R.addEventListener("mouseleave",K),m==null||m.addEventListener("mouseleave",K),l&&R.addEventListener("mousemove",z,{once:!0}),R.addEventListener("mouseenter",z),R.addEventListener("mouseleave",H),()=>{c&&R.removeEventListener("mouseleave",K),m==null||m.removeEventListener("mouseleave",K),l&&R.removeEventListener("mousemove",z),R.removeEventListener("mouseenter",z),R.removeEventListener("mouseleave",H)}}},[h,m,r,e,a,i,l,I,k,D,u,c,g,x,y,d]),vs(()=>{var N;if(r&&c&&(N=y.current)!=null&&N.__options.blockPointerEvents&&$()){const K=Go(m).body;if(K.setAttribute(m_,""),K.style.pointerEvents="none",E.current=!0,Hn(h)&&m){var z,H;const R=h,M=g==null||(z=g.nodesRef.current.find(B=>B.id===_))==null||(H=z.context)==null?void 0:H.elements.floating;return M&&(M.style.pointerEvents=""),R.style.pointerEvents="auto",m.style.pointerEvents="auto",()=>{R.style.pointerEvents="",m.style.pointerEvents=""}}}},[r,c,_,m,h,g,y,d,$]),vs(()=>{c||(w.current=void 0,k(),D())},[c,k,D]),f.useEffect(()=>()=>{k(),clearTimeout(b.current),clearTimeout(C.current),D()},[r,k,D]),f.useMemo(()=>{if(!r)return{};function N(z){w.current=z.pointerType}return{reference:{onPointerDown:N,onPointerEnter:N,onMouseMove(){c||i===0||(clearTimeout(C.current),C.current=setTimeout(()=>{j.current||u(!0)},i))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),I(!1)}}}},[p,r,i,c,u,I])},yR=f.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),xR=()=>f.useContext(yR),TB=e=>{let{children:t,delay:r,timeoutMs:n=0}=e;const[o,a]=f.useReducer((c,u)=>({...c,...u}),{delay:r,timeoutMs:n,initialDelay:r,currentId:null,isInstantPhase:!1}),i=f.useRef(null),l=f.useCallback(c=>{a({currentId:c})},[]);return vs(()=>{o.currentId?i.current===null?i.current=o.currentId:a({isInstantPhase:!0}):(a({isInstantPhase:!1}),i.current=null)},[o.currentId]),f.createElement(yR.Provider,{value:f.useMemo(()=>({...o,setState:a,setCurrentId:l}),[o,a,l])},t)},IB=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:a,setCurrentId:i,initialDelay:l,setState:c,timeoutMs:u}=xR();f.useEffect(()=>{a&&(c({delay:{open:1,close:nd(l,"close")}}),a!==o&&n(!1))},[o,n,c,a,l]),f.useEffect(()=>{function d(){n(!1),c({delay:l,currentId:null})}if(!r&&a===o)if(u){const p=window.setTimeout(d,u);return()=>{clearTimeout(p)}}else d()},[r,c,a,o,n,l,u]),f.useEffect(()=>{r&&i(o)},[r,i,o])};function DB(e){let t=e.activeElement;for(;((r=t)==null||(n=r.shadowRoot)==null?void 0:n.activeElement)!=null;){var r,n;t=t.shadowRoot.activeElement}return t}function g_(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&EB(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function ag(e,t){let r=e.filter(o=>{var a;return o.parentId===t&&((a=o.context)==null?void 0:a.open)})||[],n=r;for(;n.length;)n=e.filter(o=>{var a;return(a=n)==null?void 0:a.some(i=>{var l;return o.parentId===i.id&&((l=o.context)==null?void 0:l.open)})})||[],r=r.concat(n);return r}function NB(e){return"composedPath"in e?e.composedPath()[0]:e.target}const AB=Il["useInsertionEffect".toString()],MB=AB||(e=>e());function wR(e){const t=f.useRef(()=>{});return MB(()=>{t.current=e}),f.useCallback(function(){for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];return t.current==null?void 0:t.current(...n)},[])}function od(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const r=e;return r.target!=null&&t.contains(r.target)}const LB={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},zB={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},FB=function(e){var t,r;return e===void 0&&(e=!0),{escapeKeyBubbles:typeof e=="boolean"?e:(t=e.escapeKey)!=null?t:!0,outsidePressBubbles:typeof e=="boolean"?e:(r=e.outsidePress)!=null?r:!0}},VB=function(e,t){let{open:r,onOpenChange:n,events:o,nodeId:a,elements:{reference:i,domReference:l,floating:c},dataRef:u}=e,{enabled:d=!0,escapeKey:p=!0,outsidePress:h=!0,outsidePressEvent:m="pointerdown",referencePress:v=!1,referencePressEvent:g="pointerdown",ancestorScroll:_=!1,bubbles:y=!0}=t===void 0?{}:t;const x=N0(),w=mR()!=null,b=wR(typeof h=="function"?h:()=>!1),O=typeof h=="function"?b:h,C=f.useRef(!1),{escapeKeyBubbles:j,outsidePressBubbles:E}=FB(y);return f.useEffect(()=>{if(!r||!d)return;u.current.__escapeKeyBubbles=j,u.current.__outsidePressBubbles=E;function T(N){if(N.key==="Escape"){const z=x?ag(x.nodesRef.current,a):[];if(z.length>0){let H=!0;if(z.forEach(K=>{var R;if((R=K.context)!=null&&R.open&&!K.context.dataRef.current.__escapeKeyBubbles){H=!1;return}}),!H)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function $(N){const z=C.current;if(C.current=!1,z||typeof O=="function"&&!O(N))return;const H=NB(N);if(gR(H)&&c){const M=c.ownerDocument.defaultView||window,B=H.scrollWidth>H.clientWidth,Q=H.scrollHeight>H.clientHeight;let ne=Q&&N.offsetX>H.clientWidth;if(Q&&M.getComputedStyle(H).direction==="rtl"&&(ne=N.offsetX<=H.offsetWidth-H.clientWidth),ne||B&&N.offsetY>H.clientHeight)return}const K=x&&ag(x.nodesRef.current,a).some(M=>{var B;return od(N,(B=M.context)==null?void 0:B.elements.floating)});if(od(N,c)||od(N,l)||K)return;const R=x?ag(x.nodesRef.current,a):[];if(R.length>0){let M=!0;if(R.forEach(B=>{var Q;if((Q=B.context)!=null&&Q.open&&!B.context.dataRef.current.__outsidePressBubbles){M=!1;return}}),!M)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:w?{preventScroll:!0}:$B(N)||kB(N)}}),n(!1)}function I(){n(!1)}const k=Go(c);p&&k.addEventListener("keydown",T),O&&k.addEventListener(m,$);let D=[];return _&&(Hn(l)&&(D=uo(l)),Hn(c)&&(D=D.concat(uo(c))),!Hn(i)&&i&&i.contextElement&&(D=D.concat(uo(i.contextElement)))),D=D.filter(N=>{var z;return N!==((z=k.defaultView)==null?void 0:z.visualViewport)}),D.forEach(N=>{N.addEventListener("scroll",I,{passive:!0})}),()=>{p&&k.removeEventListener("keydown",T),O&&k.removeEventListener(m,$),D.forEach(N=>{N.removeEventListener("scroll",I)})}},[u,c,l,i,p,O,m,o,x,a,r,n,_,d,j,E,w]),f.useEffect(()=>{C.current=!1},[O,m]),f.useMemo(()=>d?{reference:{[LB[g]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[zB[m]]:()=>{C.current=!0}}}:{},[d,o,v,m,g,n])},BB=function(e,t){let{open:r,onOpenChange:n,dataRef:o,events:a,refs:i,elements:{floating:l,domReference:c}}=e,{enabled:u=!0,keyboardOnly:d=!0}=t===void 0?{}:t;const p=f.useRef(""),h=f.useRef(!1),m=f.useRef();return f.useEffect(()=>{if(!u)return;const g=Go(l).defaultView||window;function _(){!r&&gR(c)&&c===DB(Go(c))&&(h.current=!0)}return g.addEventListener("blur",_),()=>{g.removeEventListener("blur",_)}},[l,c,r,u]),f.useEffect(()=>{if(!u)return;function v(g){(g.type==="referencePress"||g.type==="escapeKey")&&(h.current=!0)}return a.on("dismiss",v),()=>{a.off("dismiss",v)}},[a,u]),f.useEffect(()=>()=>{clearTimeout(m.current)},[]),f.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:g}=v;p.current=g,h.current=!!(g&&d)},onMouseLeave(){h.current=!1},onFocus(v){var g;h.current||v.type==="focus"&&((g=o.current.openEvent)==null?void 0:g.type)==="mousedown"&&o.current.openEvent&&od(o.current.openEvent,c)||(o.current.openEvent=v.nativeEvent,n(!0))},onBlur(v){h.current=!1;const g=v.relatedTarget,_=Hn(g)&&g.hasAttribute("data-floating-ui-focus-guard")&&g.getAttribute("data-type")==="outside";m.current=setTimeout(()=>{g_(i.floating.current,g)||g_(c,g)||_||n(!1)})}}}:{},[u,d,c,i,o,n])},UB=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const a=p_(),i=p_();return f.useMemo(()=>{const l={id:a,role:o};return n?o==="tooltip"?{reference:{"aria-describedby":r?a:void 0},floating:l}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":o==="alertdialog"?"dialog":o,"aria-controls":r?a:void 0,...o==="listbox"&&{role:"combobox"},...o==="menu"&&{id:i}},floating:{...l,...o==="menu"&&{"aria-labelledby":i}}}:{}},[n,o,r,a,i])};function M0(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=xB(e),a=N0(),i=f.useRef(null),l=f.useRef({}),c=f.useState(()=>SB())[0],[u,d]=f.useState(null),p=f.useCallback(y=>{const x=Hn(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;o.refs.setReference(x)},[o.refs]),h=f.useCallback(y=>{(Hn(y)||y===null)&&(i.current=y,d(y)),(Hn(o.refs.reference.current)||o.refs.reference.current===null||y!==null&&!Hn(y))&&o.refs.setReference(y)},[o.refs]),m=f.useMemo(()=>({...o.refs,setReference:h,setPositionReference:p,domReference:i}),[o.refs,h,p]),v=f.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),g=wR(r),_=f.useMemo(()=>({...o,refs:m,elements:v,dataRef:l,nodeId:n,events:c,open:t,onOpenChange:g}),[o,n,c,t,g,m,v]);return vs(()=>{const y=a==null?void 0:a.nodesRef.current.find(x=>x.id===n);y&&(y.context=_)}),f.useMemo(()=>({...o,context:_,refs:m,reference:h,positionReference:p}),[o,m,_,h,p])}function ig(e,t,r){const n=new Map;return{...r==="floating"&&{tabIndex:-1},...e,...t.map(o=>o?o[r]:null).concat(e).reduce((o,a)=>(a&&Object.entries(a).forEach(i=>{let[l,c]=i;if(l.indexOf("on")===0){if(n.has(l)||n.set(l,[]),typeof c=="function"){var u;(u=n.get(l))==null||u.push(c),o[l]=function(){for(var d,p=arguments.length,h=new Array(p),m=0;m<p;m++)h[m]=arguments[m];(d=n.get(l))==null||d.forEach(v=>v(...h))}}}else o[l]=c}),o),{})}}const WB=function(e){e===void 0&&(e=[]);const t=e,r=f.useCallback(a=>ig(a,e,"reference"),t),n=f.useCallback(a=>ig(a,e,"floating"),t),o=f.useCallback(a=>ig(a,e,"item"),e.map(a=>a==null?void 0:a.item));return f.useMemo(()=>({getReferenceProps:r,getFloatingProps:n,getItemProps:o}),[r,n,o])};function bR({opened:e,floating:t,position:r,positionDependencies:n}){const[o,a]=f.useState(0);f.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return vB(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),on(()=>{t.update()},n),on(()=>{a(i=>i+1)},[e])}function HB(e){const t=[iR(e.offset)];return e.middlewares.shift&&t.push(R0({limiter:JV()})),e.middlewares.flip&&t.push(nR()),e.middlewares.inline&&t.push(aR()),t.push(hR({element:e.arrowRef,padding:e.arrowOffset})),t}function qB(e){const[t,r]=Er({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),n=()=>{var i;(i=e.onClose)==null||i.call(e),r(!1)},o=()=>{var i,l;t?((i=e.onClose)==null||i.call(e),r(!1)):((l=e.onOpen)==null||l.call(e),r(!0))},a=M0({placement:e.position,middleware:[...HB(e),...e.width==="target"?[ZV({apply({rects:i}){var l,c;Object.assign((c=(l=a.refs.floating.current)==null?void 0:l.style)!=null?c:{},{width:`${i.reference.width}px`})}})]:[]]});return bR({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:a}),on(()=>{var i;(i=e.onPositionChange)==null||i.call(e,a.placement)},[a.placement]),on(()=>{var i,l;e.opened?(l=e.onOpen)==null||l.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:a,controlled:typeof e.opened=="boolean",opened:t,onClose:n,onToggle:o}}const _R={context:"Popover component was not found in the tree",children:"Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[GB,SR]=Po(_R.context);var QB=Object.defineProperty,KB=Object.defineProperties,YB=Object.getOwnPropertyDescriptors,cf=Object.getOwnPropertySymbols,PR=Object.prototype.hasOwnProperty,jR=Object.prototype.propertyIsEnumerable,v_=(e,t,r)=>t in e?QB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vu=(e,t)=>{for(var r in t||(t={}))PR.call(t,r)&&v_(e,r,t[r]);if(cf)for(var r of cf(t))jR.call(t,r)&&v_(e,r,t[r]);return e},XB=(e,t)=>KB(e,YB(t)),JB=(e,t)=>{var r={};for(var n in e)PR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&cf)for(var n of cf(e))t.indexOf(n)<0&&jR.call(e,n)&&(r[n]=e[n]);return r};const ZB={refProp:"ref",popupType:"dialog",shouldOverrideDefaultTargetId:!0},OR=f.forwardRef((e,t)=>{const r=q("PopoverTarget",ZB,e),{children:n,refProp:o,popupType:a,shouldOverrideDefaultTargetId:i}=r,l=JB(r,["children","refProp","popupType","shouldOverrideDefaultTargetId"]);if(!js(n))throw new Error(_R.children);const c=l,u=SR(),d=Cs(u.reference,n.ref,t),p=u.withRoles?{"aria-haspopup":a,"aria-expanded":u.opened,"aria-controls":u.getDropdownId(),id:i?u.getTargetId():n.props.id}:{};return f.cloneElement(n,vu(XB(vu(vu(vu({},c),p),u.targetProps),{className:eE(u.targetProps.className,c.className,n.props.className),[o]:d}),u.controlled?null:{onClick:u.onToggle}))});OR.displayName="@mantine/core/PopoverTarget";var eU=W((e,{radius:t,shadow:r})=>({dropdown:{position:"absolute",backgroundColor:e.white,background:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,padding:`${e.spacing.sm} ${e.spacing.md}`,boxShadow:e.shadows[r]||r||"none",borderRadius:e.fn.radius(t),"&:focus":{outline:0}},arrow:{backgroundColor:"inherit",border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`,zIndex:1}}));const tU=eU;var rU=Object.defineProperty,y_=Object.getOwnPropertySymbols,nU=Object.prototype.hasOwnProperty,oU=Object.prototype.propertyIsEnumerable,x_=(e,t,r)=>t in e?rU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_i=(e,t)=>{for(var r in t||(t={}))nU.call(t,r)&&x_(e,r,t[r]);if(y_)for(var r of y_(t))oU.call(t,r)&&x_(e,r,t[r]);return e};const w_={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function aU({transition:e,state:t,duration:r,timingFunction:n}){const o={transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in qc?_i(_i(_i({transitionProperty:qc[e].transitionProperty},o),qc[e].common),qc[e][w_[t]]):null:_i(_i(_i({transitionProperty:e.transitionProperty},o),e.common),e[w_[t]])}function iU({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:a,onEntered:i,onExited:l}){const c=Kt(),u=Ch(),d=c.respectReducedMotion?u:!1,[p,h]=f.useState(d?0:e),[m,v]=f.useState(n?"entered":"exited"),g=f.useRef(-1),_=y=>{const x=y?o:a,w=y?i:l;v(y?"pre-entering":"pre-exiting"),window.clearTimeout(g.current);const b=d?0:y?e:t;if(h(b),b===0)typeof x=="function"&&x(),typeof w=="function"&&w(),v(y?"entered":"exited");else{const O=window.setTimeout(()=>{typeof x=="function"&&x(),v(y?"entering":"exiting")},10);g.current=window.setTimeout(()=>{window.clearTimeout(O),typeof w=="function"&&w(),v(y?"entered":"exited")},b)}};return on(()=>{_(n)},[n]),f.useEffect(()=>()=>window.clearTimeout(g.current),[]),{transitionDuration:p,transitionStatus:m,transitionTimingFunction:r||c.transitionTimingFunction}}function si({keepMounted:e,transition:t,duration:r=250,exitDuration:n=r,mounted:o,children:a,timingFunction:i,onExit:l,onEntered:c,onEnter:u,onExited:d}){const{transitionDuration:p,transitionStatus:h,transitionTimingFunction:m}=iU({mounted:o,exitDuration:n,duration:r,timingFunction:i,onExit:l,onEntered:c,onEnter:u,onExited:d});return p===0?o?S.createElement(S.Fragment,null,a({})):e?a({display:"none"}):null:h==="exited"?e?a({display:"none"}):null:S.createElement(S.Fragment,null,a(aU({transition:t,duration:p,state:h,timingFunction:m})))}si.displayName="@mantine/core/Transition";function L0({children:e,active:t=!0,refProp:r="ref"}){const n=wL(t),o=Cs(n,e==null?void 0:e.ref);return js(e)?f.cloneElement(e,{[r]:o}):e}L0.displayName="@mantine/core/FocusTrap";var sU=Object.defineProperty,lU=Object.defineProperties,cU=Object.getOwnPropertyDescriptors,b_=Object.getOwnPropertySymbols,uU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,__=(e,t,r)=>t in e?sU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mo=(e,t)=>{for(var r in t||(t={}))uU.call(t,r)&&__(e,r,t[r]);if(b_)for(var r of b_(t))dU.call(t,r)&&__(e,r,t[r]);return e},yu=(e,t)=>lU(e,cU(t));function S_(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function P_(e,t,r,n,o){return e==="center"||n==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:r}:e==="start"?{[o==="ltr"?"left":"right"]:r}:{}}const fU={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function pU({position:e,arrowSize:t,arrowOffset:r,arrowRadius:n,arrowPosition:o,arrowX:a,arrowY:i,dir:l}){const[c,u="center"]=e.split("-"),d={width:P(t),height:P(t),transform:"rotate(45deg)",position:"absolute",[fU[c]]:P(n)},p=P(-t/2);return c==="left"?yu(Mo(Mo({},d),S_(u,i,r,o)),{right:p,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?yu(Mo(Mo({},d),S_(u,i,r,o)),{left:p,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?yu(Mo(Mo({},d),P_(u,a,r,o,l)),{bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?yu(Mo(Mo({},d),P_(u,a,r,o,l)),{top:p,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var hU=Object.defineProperty,mU=Object.defineProperties,gU=Object.getOwnPropertyDescriptors,uf=Object.getOwnPropertySymbols,CR=Object.prototype.hasOwnProperty,ER=Object.prototype.propertyIsEnumerable,j_=(e,t,r)=>t in e?hU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vU=(e,t)=>{for(var r in t||(t={}))CR.call(t,r)&&j_(e,r,t[r]);if(uf)for(var r of uf(t))ER.call(t,r)&&j_(e,r,t[r]);return e},yU=(e,t)=>mU(e,gU(t)),xU=(e,t)=>{var r={};for(var n in e)CR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&uf)for(var n of uf(e))t.indexOf(n)<0&&ER.call(e,n)&&(r[n]=e[n]);return r};const z0=f.forwardRef((e,t)=>{var r=e,{position:n,arrowSize:o,arrowOffset:a,arrowRadius:i,arrowPosition:l,visible:c,arrowX:u,arrowY:d}=r,p=xU(r,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const h=Kt();return c?S.createElement("div",yU(vU({},p),{ref:t,style:pU({position:n,arrowSize:o,arrowOffset:a,arrowRadius:i,arrowPosition:l,dir:h.dir,arrowX:u,arrowY:d})})):null});z0.displayName="@mantine/core/FloatingArrow";var wU=Object.defineProperty,bU=Object.defineProperties,_U=Object.getOwnPropertyDescriptors,df=Object.getOwnPropertySymbols,$R=Object.prototype.hasOwnProperty,kR=Object.prototype.propertyIsEnumerable,O_=(e,t,r)=>t in e?wU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Si=(e,t)=>{for(var r in t||(t={}))$R.call(t,r)&&O_(e,r,t[r]);if(df)for(var r of df(t))kR.call(t,r)&&O_(e,r,t[r]);return e},xu=(e,t)=>bU(e,_U(t)),SU=(e,t)=>{var r={};for(var n in e)$R.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&df)for(var n of df(e))t.indexOf(n)<0&&kR.call(e,n)&&(r[n]=e[n]);return r};const PU={};function RR(e){var t;const r=q("PopoverDropdown",PU,e),{style:n,className:o,children:a,onKeyDownCapture:i}=r,l=SU(r,["style","className","children","onKeyDownCapture"]),c=SR(),{classes:u,cx:d}=tU({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),p=CE({opened:c.opened,shouldReturnFocus:c.returnFocus}),h=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:S.createElement(ks,xu(Si({},c.portalProps),{withinPortal:c.withinPortal}),S.createElement(si,xu(Si({mounted:c.opened},c.transitionProps),{transition:c.transitionProps.transition||"fade",duration:(t=c.transitionProps.duration)!=null?t:150,keepMounted:c.keepMounted,exitDuration:typeof c.transitionProps.exitDuration=="number"?c.transitionProps.exitDuration:c.transitionProps.duration}),m=>{var v,g;return S.createElement(L0,{active:c.trapFocus},S.createElement(oe,Si(xu(Si({},h),{tabIndex:-1,ref:c.floating,style:xu(Si(Si({},n),m),{zIndex:c.zIndex,top:(v=c.y)!=null?v:0,left:(g=c.x)!=null?g:0,width:c.width==="target"?void 0:P(c.width)}),className:d(u.dropdown,o),onKeyDownCapture:VA(c.onClose,{active:c.closeOnEscape,onTrigger:p,onKeyDown:i}),"data-position":c.placement}),l),a,S.createElement(z0,{ref:c.arrowRef,arrowX:c.arrowX,arrowY:c.arrowY,visible:c.withArrow,position:c.placement,arrowSize:c.arrowSize,arrowRadius:c.arrowRadius,arrowOffset:c.arrowOffset,arrowPosition:c.arrowPosition,className:u.arrow})))}))}RR.displayName="@mantine/core/PopoverDropdown";function TR(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[r,n]=t.split("-"),o=r==="right"?"left":"right";return n===void 0?o:`${o}-${n}`}return t}var C_=Object.getOwnPropertySymbols,jU=Object.prototype.hasOwnProperty,OU=Object.prototype.propertyIsEnumerable,CU=(e,t)=>{var r={};for(var n in e)jU.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&C_)for(var n of C_(e))t.indexOf(n)<0&&OU.call(e,n)&&(r[n]=e[n]);return r};const EU={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:!1,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:Rn("popover"),__staticSelector:"Popover",width:"max-content"};function Eo(e){var t,r,n,o,a,i;const l=f.useRef(null),c=q("Popover",EU,e),{children:u,position:d,offset:p,onPositionChange:h,positionDependencies:m,opened:v,transitionProps:g,width:_,middlewares:y,withArrow:x,arrowSize:w,arrowOffset:b,arrowRadius:O,arrowPosition:C,unstyled:j,classNames:E,styles:T,closeOnClickOutside:$,withinPortal:I,portalProps:k,closeOnEscape:D,clickOutsideEvents:N,trapFocus:z,onClose:H,onOpen:K,onChange:R,zIndex:M,radius:B,shadow:Q,id:ne,defaultOpened:Ee,__staticSelector:ce,withRoles:Le,disabled:Ie,returnFocus:pt,variant:rt,keepMounted:nt}=c,Ir=CU(c,["children","position","offset","onPositionChange","positionDependencies","opened","transitionProps","width","middlewares","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","unstyled","classNames","styles","closeOnClickOutside","withinPortal","portalProps","closeOnEscape","clickOutsideEvents","trapFocus","onClose","onOpen","onChange","zIndex","radius","shadow","id","defaultOpened","__staticSelector","withRoles","disabled","returnFocus","variant","keepMounted"]),[Dr,ir]=f.useState(null),[hn,Dt]=f.useState(null),Nr=kr(ne),eo=Kt(),qe=qB({middlewares:y,width:_,position:TR(eo.dir,d),offset:typeof p=="number"?p+(x?w/2:0):p,arrowRef:l,arrowOffset:b,onPositionChange:h,positionDependencies:m,opened:v,defaultOpened:Ee,onChange:R,onOpen:K,onClose:H});cL(()=>qe.opened&&$&&qe.onClose(),N,[Dr,hn]);const Qr=f.useCallback(jt=>{ir(jt),qe.floating.reference(jt)},[qe.floating.reference]),Kr=f.useCallback(jt=>{Dt(jt),qe.floating.floating(jt)},[qe.floating.floating]);return S.createElement(GB,{value:{returnFocus:pt,disabled:Ie,controlled:qe.controlled,reference:Qr,floating:Kr,x:qe.floating.x,y:qe.floating.y,arrowX:(n=(r=(t=qe.floating)==null?void 0:t.middlewareData)==null?void 0:r.arrow)==null?void 0:n.x,arrowY:(i=(a=(o=qe.floating)==null?void 0:o.middlewareData)==null?void 0:a.arrow)==null?void 0:i.y,opened:qe.opened,arrowRef:l,transitionProps:g,width:_,withArrow:x,arrowSize:w,arrowOffset:b,arrowRadius:O,arrowPosition:C,placement:qe.floating.placement,trapFocus:z,withinPortal:I,portalProps:k,zIndex:M,radius:B,shadow:Q,closeOnEscape:D,onClose:qe.onClose,onToggle:qe.onToggle,getTargetId:()=>`${Nr}-target`,getDropdownId:()=>`${Nr}-dropdown`,withRoles:Le,targetProps:Ir,__staticSelector:ce,classNames:E,styles:T,unstyled:j,variant:rt,keepMounted:nt}},u)}Eo.Target=OR;Eo.Dropdown=RR;Eo.displayName="@mantine/core/Popover";var $U=Object.defineProperty,ff=Object.getOwnPropertySymbols,IR=Object.prototype.hasOwnProperty,DR=Object.prototype.propertyIsEnumerable,E_=(e,t,r)=>t in e?$U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kU=(e,t)=>{for(var r in t||(t={}))IR.call(t,r)&&E_(e,r,t[r]);if(ff)for(var r of ff(t))DR.call(t,r)&&E_(e,r,t[r]);return e},RU=(e,t)=>{var r={};for(var n in e)IR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ff)for(var n of ff(e))t.indexOf(n)<0&&DR.call(e,n)&&(r[n]=e[n]);return r};function TU(e){var t=e,{children:r,component:n="div",maxHeight:o=220,direction:a="column",id:i,innerRef:l,__staticSelector:c,styles:u,classNames:d,unstyled:p}=t,h=RU(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:m}=VV(null,{name:c,styles:u,classNames:d,unstyled:p});return S.createElement(Eo.Dropdown,kU({p:0,onMouseDown:v=>v.preventDefault()},h),S.createElement("div",{style:{maxHeight:P(o),display:"flex"}},S.createElement(oe,{component:n||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:v=>v.preventDefault(),style:{flex:1,overflowY:n!==j0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},S.createElement("div",{className:m.itemsWrapper,style:{flexDirection:a}},r))))}function kl({opened:e,transitionProps:t={transition:"fade",duration:0},shadow:r,withinPortal:n,portalProps:o,children:a,__staticSelector:i,onDirectionChange:l,switchDirectionOnFlip:c,zIndex:u,dropdownPosition:d,positionDependencies:p=[],classNames:h,styles:m,unstyled:v,readOnly:g,variant:_}){return S.createElement(Eo,{unstyled:v,classNames:h,styles:m,width:"target",withRoles:!1,opened:e,middlewares:{flip:d==="flip",shift:!1},position:d==="flip"?"bottom":d,positionDependencies:p,zIndex:u,__staticSelector:i,withinPortal:n,portalProps:o,transitionProps:t,shadow:r,disabled:g,onPositionChange:y=>c&&(l==null?void 0:l(y==="top"?"column-reverse":"column")),variant:_},a)}kl.Target=Eo.Target;kl.Dropdown=TU;var IU=Object.defineProperty,DU=Object.defineProperties,NU=Object.getOwnPropertyDescriptors,pf=Object.getOwnPropertySymbols,NR=Object.prototype.hasOwnProperty,AR=Object.prototype.propertyIsEnumerable,$_=(e,t,r)=>t in e?IU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wu=(e,t)=>{for(var r in t||(t={}))NR.call(t,r)&&$_(e,r,t[r]);if(pf)for(var r of pf(t))AR.call(t,r)&&$_(e,r,t[r]);return e},AU=(e,t)=>DU(e,NU(t)),MU=(e,t)=>{var r={};for(var n in e)NR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pf)for(var n of pf(e))t.indexOf(n)<0&&AR.call(e,n)&&(r[n]=e[n]);return r};function MR(e,t,r){const n=q(e,t,r),{label:o,description:a,error:i,required:l,classNames:c,styles:u,className:d,unstyled:p,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:_,wrapperProps:y,id:x,size:w,style:b,inputContainer:O,inputWrapperOrder:C,withAsterisk:j,variant:E}=n,T=MU(n,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),$=kr(x),{systemStyles:I,rest:k}=Jn(T),D=wu({label:o,description:a,error:i,required:l,classNames:c,className:d,__staticSelector:h,sx:m,errorProps:v,labelProps:g,descriptionProps:_,unstyled:p,styles:u,id:$,size:w,style:b,inputContainer:O,inputWrapperOrder:C,withAsterisk:j,variant:E},y);return AU(wu({},k),{classNames:c,styles:u,unstyled:p,wrapperProps:wu(wu({},D),I),inputProps:{required:l,classNames:c,styles:u,unstyled:p,id:$,size:w,__staticSelector:h,error:i,variant:E}})}var LU=W((e,t,{size:r})=>({label:{display:"inline-block",fontSize:A({size:r,sizes:e.fontSizes}),fontWeight:500,color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[9],wordBreak:"break-word",cursor:"default",WebkitTapHighlightColor:"transparent"},required:{color:e.fn.variant({variant:"filled",color:"red"}).background}}));const zU=LU;var FU=Object.defineProperty,hf=Object.getOwnPropertySymbols,LR=Object.prototype.hasOwnProperty,zR=Object.prototype.propertyIsEnumerable,k_=(e,t,r)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VU=(e,t)=>{for(var r in t||(t={}))LR.call(t,r)&&k_(e,r,t[r]);if(hf)for(var r of hf(t))zR.call(t,r)&&k_(e,r,t[r]);return e},BU=(e,t)=>{var r={};for(var n in e)LR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hf)for(var n of hf(e))t.indexOf(n)<0&&zR.call(e,n)&&(r[n]=e[n]);return r};const UU={labelElement:"label",size:"sm"},F0=f.forwardRef((e,t)=>{const r=q("InputLabel",UU,e),{labelElement:n,children:o,required:a,size:i,classNames:l,styles:c,unstyled:u,className:d,htmlFor:p,__staticSelector:h,variant:m,onMouseDown:v}=r,g=BU(r,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:_,cx:y}=zU(null,{name:["InputWrapper",h],classNames:l,styles:c,unstyled:u,variant:m,size:i});return S.createElement(oe,VU({component:n,ref:t,className:y(_.label,d),htmlFor:n==="label"?p:void 0,onMouseDown:x=>{v==null||v(x),!x.defaultPrevented&&x.detail>1&&x.preventDefault()}},g),o,a&&S.createElement("span",{className:_.required,"aria-hidden":!0}," *"))});F0.displayName="@mantine/core/InputLabel";var WU=W((e,t,{size:r})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${P(2)})`,lineHeight:1.2,display:"block"}}));const HU=WU;var qU=Object.defineProperty,mf=Object.getOwnPropertySymbols,FR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable,R_=(e,t,r)=>t in e?qU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GU=(e,t)=>{for(var r in t||(t={}))FR.call(t,r)&&R_(e,r,t[r]);if(mf)for(var r of mf(t))VR.call(t,r)&&R_(e,r,t[r]);return e},QU=(e,t)=>{var r={};for(var n in e)FR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&mf)for(var n of mf(e))t.indexOf(n)<0&&VR.call(e,n)&&(r[n]=e[n]);return r};const KU={size:"sm"},V0=f.forwardRef((e,t)=>{const r=q("InputError",KU,e),{children:n,className:o,classNames:a,styles:i,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=QU(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=HU(null,{name:["InputWrapper",u],classNames:a,styles:i,unstyled:l,variant:d,size:c});return S.createElement(te,GU({className:m(h.error,o),ref:t},p),n)});V0.displayName="@mantine/core/InputError";var YU=W((e,t,{size:r})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${P(2)})`,lineHeight:1.2,display:"block"}}));const XU=YU;var JU=Object.defineProperty,gf=Object.getOwnPropertySymbols,BR=Object.prototype.hasOwnProperty,UR=Object.prototype.propertyIsEnumerable,T_=(e,t,r)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZU=(e,t)=>{for(var r in t||(t={}))BR.call(t,r)&&T_(e,r,t[r]);if(gf)for(var r of gf(t))UR.call(t,r)&&T_(e,r,t[r]);return e},eW=(e,t)=>{var r={};for(var n in e)BR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gf)for(var n of gf(e))t.indexOf(n)<0&&UR.call(e,n)&&(r[n]=e[n]);return r};const tW={size:"sm"},B0=f.forwardRef((e,t)=>{const r=q("InputDescription",tW,e),{children:n,className:o,classNames:a,styles:i,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=eW(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:m}=XU(null,{name:["InputWrapper",u],classNames:a,styles:i,unstyled:l,variant:d,size:c});return S.createElement(te,ZU({color:"dimmed",className:m(h.description,o),ref:t,unstyled:l},p),n)});B0.displayName="@mantine/core/InputDescription";const WR=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),rW=WR.Provider,nW=()=>f.useContext(WR);function oW(e,{hasDescription:t,hasError:r}){const n=e.findIndex(c=>c==="input"),o=e[n-1],a=e[n+1];return{offsetBottom:t&&a==="description"||r&&a==="error",offsetTop:t&&o==="description"||r&&o==="error"}}var aW=Object.defineProperty,iW=Object.defineProperties,sW=Object.getOwnPropertyDescriptors,I_=Object.getOwnPropertySymbols,lW=Object.prototype.hasOwnProperty,cW=Object.prototype.propertyIsEnumerable,D_=(e,t,r)=>t in e?aW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uW=(e,t)=>{for(var r in t||(t={}))lW.call(t,r)&&D_(e,r,t[r]);if(I_)for(var r of I_(t))cW.call(t,r)&&D_(e,r,t[r]);return e},dW=(e,t)=>iW(e,sW(t)),fW=W(e=>({root:dW(uW({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const pW=fW;var hW=Object.defineProperty,mW=Object.defineProperties,gW=Object.getOwnPropertyDescriptors,vf=Object.getOwnPropertySymbols,HR=Object.prototype.hasOwnProperty,qR=Object.prototype.propertyIsEnumerable,N_=(e,t,r)=>t in e?hW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lo=(e,t)=>{for(var r in t||(t={}))HR.call(t,r)&&N_(e,r,t[r]);if(vf)for(var r of vf(t))qR.call(t,r)&&N_(e,r,t[r]);return e},A_=(e,t)=>mW(e,gW(t)),vW=(e,t)=>{var r={};for(var n in e)HR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&vf)for(var n of vf(e))t.indexOf(n)<0&&qR.call(e,n)&&(r[n]=e[n]);return r};const yW={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},GR=f.forwardRef((e,t)=>{const r=q("InputWrapper",yW,e),{className:n,label:o,children:a,required:i,id:l,error:c,description:u,labelElement:d,labelProps:p,descriptionProps:h,errorProps:m,classNames:v,styles:g,size:_,inputContainer:y,__staticSelector:x,unstyled:w,inputWrapperOrder:b,withAsterisk:O,variant:C}=r,j=vW(r,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:E,cx:T}=pW(null,{classNames:v,styles:g,name:["InputWrapper",x],unstyled:w,variant:C,size:_}),$={classNames:v,styles:g,unstyled:w,size:_,variant:C,__staticSelector:x},I=typeof O=="boolean"?O:i,k=l?`${l}-error`:m==null?void 0:m.id,D=l?`${l}-description`:h==null?void 0:h.id,z=`${!!c&&typeof c!="boolean"?k:""} ${u?D:""}`,H=z.trim().length>0?z.trim():void 0,K=o&&S.createElement(F0,Lo(Lo({key:"label",labelElement:d,id:l?`${l}-label`:void 0,htmlFor:l,required:I},$),p),o),R=u&&S.createElement(B0,A_(Lo(Lo({key:"description"},h),$),{size:(h==null?void 0:h.size)||$.size,id:(h==null?void 0:h.id)||D}),u),M=S.createElement(f.Fragment,{key:"input"},y(a)),B=typeof c!="boolean"&&c&&S.createElement(V0,A_(Lo(Lo({},m),$),{size:(m==null?void 0:m.size)||$.size,key:"error",id:(m==null?void 0:m.id)||k}),c),Q=b.map(ne=>{switch(ne){case"label":return K;case"input":return M;case"description":return R;case"error":return B;default:return null}});return S.createElement(rW,{value:Lo({describedBy:H},oW(b,{hasDescription:!!R,hasError:!!B}))},S.createElement(oe,Lo({className:T(E.root,n),ref:t},j),Q))});GR.displayName="@mantine/core/InputWrapper";var xW=Object.defineProperty,yf=Object.getOwnPropertySymbols,QR=Object.prototype.hasOwnProperty,KR=Object.prototype.propertyIsEnumerable,M_=(e,t,r)=>t in e?xW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wW=(e,t)=>{for(var r in t||(t={}))QR.call(t,r)&&M_(e,r,t[r]);if(yf)for(var r of yf(t))KR.call(t,r)&&M_(e,r,t[r]);return e},bW=(e,t)=>{var r={};for(var n in e)QR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yf)for(var n of yf(e))t.indexOf(n)<0&&KR.call(e,n)&&(r[n]=e[n]);return r};const _W={},YR=f.forwardRef((e,t)=>{const r=q("InputPlaceholder",_W,e),{sx:n}=r,o=bW(r,["sx"]);return S.createElement(oe,wW({component:"span",sx:[a=>a.fn.placeholderStyles(),...lc(n)],ref:t},o))});YR.displayName="@mantine/core/InputPlaceholder";var SW=Object.defineProperty,PW=Object.defineProperties,jW=Object.getOwnPropertyDescriptors,L_=Object.getOwnPropertySymbols,OW=Object.prototype.hasOwnProperty,CW=Object.prototype.propertyIsEnumerable,z_=(e,t,r)=>t in e?SW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bu=(e,t)=>{for(var r in t||(t={}))OW.call(t,r)&&z_(e,r,t[r]);if(L_)for(var r of L_(t))CW.call(t,r)&&z_(e,r,t[r]);return e},sg=(e,t)=>PW(e,jW(t));const Ct={xs:P(30),sm:P(36),md:P(42),lg:P(50),xl:P(60)},EW=["default","filled","unstyled"];function $W({theme:e,variant:t}){return EW.includes(t)?t==="default"?{border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,transition:"border-color 100ms ease","&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:t==="filled"?{border:`${P(1)} solid transparent`,backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],"&:focus, &:focus-within":e.focusRingStyles.inputStyles(e)}:{borderWidth:0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:"transparent",minHeight:P(28),outline:0,"&:focus, &:focus-within":{outline:"none",borderColor:"transparent"},"&:disabled":{backgroundColor:"transparent","&:focus, &:focus-within":{outline:"none",borderColor:"transparent"}}}:null}var kW=W((e,{multiline:t,radius:r,invalid:n,rightSectionWidth:o,withRightSection:a,iconWidth:i,offsetBottom:l,offsetTop:c,pointer:u},{variant:d,size:p})=>{const h=e.fn.variant({variant:"filled",color:"red"}).background,m=d==="default"||d==="filled"?{minHeight:A({size:p,sizes:Ct}),paddingLeft:`calc(${A({size:p,sizes:Ct})} / 3)`,paddingRight:a?o||A({size:p,sizes:Ct}):`calc(${A({size:p,sizes:Ct})} / 3)`,borderRadius:e.fn.radius(r)}:d==="unstyled"&&a?{paddingRight:o||A({size:p,sizes:Ct})}:null;return{wrapper:{position:"relative",marginTop:c?`calc(${e.spacing.xs} / 2)`:void 0,marginBottom:l?`calc(${e.spacing.xs} / 2)`:void 0,"&:has(input:disabled)":{"& .mantine-Input-rightSection":{display:"none"}}},input:sg(bu(bu(sg(bu({},e.fn.fontStyles()),{height:t?d==="unstyled"?void 0:"auto":A({size:p,sizes:Ct}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${A({size:p,sizes:Ct})} - ${P(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:A({size:p,sizes:e.fontSizes}),width:"100%",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"block",textAlign:"left",cursor:u?"pointer":void 0}),$W({theme:e,variant:d})),m),{"&:disabled, &[data-disabled]":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,cursor:"not-allowed",pointerEvents:"none","&::placeholder":{color:e.colors.dark[2]}},"&[data-invalid]":{color:h,borderColor:h,"&::placeholder":{opacity:1,color:h}},"&[data-with-icon]":{paddingLeft:typeof i=="number"?P(i):A({size:p,sizes:Ct})},"&::placeholder":sg(bu({},e.fn.placeholderStyles()),{opacity:1}),"&::-webkit-inner-spin-button, &::-webkit-outer-spin-button, &::-webkit-search-decoration, &::-webkit-search-cancel-button, &::-webkit-search-results-button, &::-webkit-search-results-decoration":{appearance:"none"},"&[type=number]":{MozAppearance:"textfield"}}),icon:{pointerEvents:"none",position:"absolute",zIndex:1,left:0,top:0,bottom:0,display:"flex",alignItems:"center",justifyContent:"center",width:i?P(i):A({size:p,sizes:Ct}),color:n?e.colors.red[e.colorScheme==="dark"?6:7]:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[5]},rightSection:{position:"absolute",top:0,bottom:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",width:o||A({size:p,sizes:Ct})}}});const RW=kW;var TW=Object.defineProperty,IW=Object.defineProperties,DW=Object.getOwnPropertyDescriptors,xf=Object.getOwnPropertySymbols,XR=Object.prototype.hasOwnProperty,JR=Object.prototype.propertyIsEnumerable,F_=(e,t,r)=>t in e?TW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_u=(e,t)=>{for(var r in t||(t={}))XR.call(t,r)&&F_(e,r,t[r]);if(xf)for(var r of xf(t))JR.call(t,r)&&F_(e,r,t[r]);return e},V_=(e,t)=>IW(e,DW(t)),NW=(e,t)=>{var r={};for(var n in e)XR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xf)for(var n of xf(e))t.indexOf(n)<0&&JR.call(e,n)&&(r[n]=e[n]);return r};const AW={size:"sm",variant:"default"},li=f.forwardRef((e,t)=>{const r=q("Input",AW,e),{className:n,error:o,required:a,disabled:i,variant:l,icon:c,style:u,rightSectionWidth:d,iconWidth:p,rightSection:h,rightSectionProps:m,radius:v,size:g,wrapperProps:_,classNames:y,styles:x,__staticSelector:w,multiline:b,sx:O,unstyled:C,pointer:j}=r,E=NW(r,["className","error","required","disabled","variant","icon","style","rightSectionWidth","iconWidth","rightSection","rightSectionProps","radius","size","wrapperProps","classNames","styles","__staticSelector","multiline","sx","unstyled","pointer"]),{offsetBottom:T,offsetTop:$,describedBy:I}=nW(),{classes:k,cx:D}=RW({radius:v,multiline:b,invalid:!!o,rightSectionWidth:d?P(d):void 0,iconWidth:p,withRightSection:!!h,offsetBottom:T,offsetTop:$,pointer:j},{classNames:y,styles:x,name:["Input",w],unstyled:C,variant:l,size:g}),{systemStyles:N,rest:z}=Jn(E);return S.createElement(oe,_u(_u({className:D(k.wrapper,n),sx:O,style:u},N),_),c&&S.createElement("div",{className:k.icon},c),S.createElement(oe,V_(_u({component:"input"},z),{ref:t,required:a,"aria-invalid":!!o,"aria-describedby":I,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:k.input})),h&&S.createElement("div",V_(_u({},m),{className:k.rightSection}),h))});li.displayName="@mantine/core/Input";li.Wrapper=GR;li.Label=F0;li.Description=B0;li.Error=V0;li.Placeholder=YR;const Vt=li;var MW=Object.defineProperty,wf=Object.getOwnPropertySymbols,ZR=Object.prototype.hasOwnProperty,eT=Object.prototype.propertyIsEnumerable,B_=(e,t,r)=>t in e?MW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LW=(e,t)=>{for(var r in t||(t={}))ZR.call(t,r)&&B_(e,r,t[r]);if(wf)for(var r of wf(t))eT.call(t,r)&&B_(e,r,t[r]);return e},zW=(e,t)=>{var r={};for(var n in e)ZR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wf)for(var n of wf(e))t.indexOf(n)<0&&eT.call(e,n)&&(r[n]=e[n]);return r};function FW(e){const t=e,{style:r}=t,n=zW(t,["style"]);return S.createElement("svg",LW({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r},n),S.createElement("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"}))}var VW=Object.defineProperty,BW=Object.defineProperties,UW=Object.getOwnPropertyDescriptors,U_=Object.getOwnPropertySymbols,WW=Object.prototype.hasOwnProperty,HW=Object.prototype.propertyIsEnumerable,W_=(e,t,r)=>t in e?VW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qW=(e,t)=>{for(var r in t||(t={}))WW.call(t,r)&&W_(e,r,t[r]);if(U_)for(var r of U_(t))HW.call(t,r)&&W_(e,r,t[r]);return e},GW=(e,t)=>BW(e,UW(t));const tT=f.createContext(null);function QW({spacing:e,children:t}){return S.createElement(tT.Provider,{value:{spacing:e}},t)}function KW(){const e=f.useContext(tT);return e?GW(qW({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var YW=W((e,{spacing:t})=>({root:{display:"flex",paddingLeft:A({size:t,sizes:e.spacing})}}));const XW=YW;var JW=Object.defineProperty,bf=Object.getOwnPropertySymbols,rT=Object.prototype.hasOwnProperty,nT=Object.prototype.propertyIsEnumerable,H_=(e,t,r)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZW=(e,t)=>{for(var r in t||(t={}))rT.call(t,r)&&H_(e,r,t[r]);if(bf)for(var r of bf(t))nT.call(t,r)&&H_(e,r,t[r]);return e},eH=(e,t)=>{var r={};for(var n in e)rT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bf)for(var n of bf(e))t.indexOf(n)<0&&nT.call(e,n)&&(r[n]=e[n]);return r};const tH={},oT=f.forwardRef((e,t)=>{const r=q("AvatarGroup",tH,e),{children:n,spacing:o="sm",unstyled:a,className:i,variant:l}=r,c=eH(r,["children","spacing","unstyled","className","variant"]),{classes:u,cx:d}=XW({spacing:o},{name:"AvatarGroup",unstyled:a,variant:l});return S.createElement(QW,{spacing:o},S.createElement(oe,ZW({ref:t,className:d(u.root,i)},c),n))});oT.displayName="@mantine/core/AvatarGroup";var rH=Object.defineProperty,nH=Object.defineProperties,oH=Object.getOwnPropertyDescriptors,q_=Object.getOwnPropertySymbols,aH=Object.prototype.hasOwnProperty,iH=Object.prototype.propertyIsEnumerable,G_=(e,t,r)=>t in e?rH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xs=(e,t)=>{for(var r in t||(t={}))aH.call(t,r)&&G_(e,r,t[r]);if(q_)for(var r of q_(t))iH.call(t,r)&&G_(e,r,t[r]);return e},Q_=(e,t)=>nH(e,oH(t));const sH=["filled","light","gradient","outline"],Su={xs:P(16),sm:P(26),md:P(38),lg:P(56),xl:P(84)};function lH({withinGroup:e,spacing:t,theme:r}){return e?{marginLeft:`calc(${A({size:t,sizes:r.spacing})} * -1)`,backgroundColor:`${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`,border:`${P(2)} solid ${r.colorScheme==="dark"?r.colors.dark[7]:r.white}`}:null}function cH({theme:e,variant:t,color:r,gradient:n}){const o=e.fn.variant({variant:t,color:r,gradient:n});return sH.includes(t)?{placeholder:{color:o.color,backgroundColor:o.background,backgroundImage:t==="gradient"?o.background:void 0,border:`${P(t==="gradient"?0:1)} solid ${o.border}`},placeholderIcon:{color:o.color}}:{}}var uH=W((e,{radius:t,withinGroup:r,spacing:n,color:o,gradient:a},{variant:i,size:l})=>{const c=cH({theme:e,color:o,gradient:a,variant:i});return{root:Xs(Q_(Xs({},e.fn.focusStyles()),{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",display:"block",userSelect:"none",overflow:"hidden",borderRadius:e.fn.radius(t),textDecoration:"none",border:0,backgroundColor:"transparent",padding:0,width:A({size:l,sizes:Su}),minWidth:A({size:l,sizes:Su}),height:A({size:l,sizes:Su})}),lH({withinGroup:r,spacing:n,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:Xs(Q_(Xs({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${A({size:l,sizes:Su})} / 2.5)`}),c.placeholder),placeholderIcon:Xs({width:"70%",height:"70%"},c.placeholderIcon)}});const dH=uH;var fH=Object.defineProperty,pH=Object.defineProperties,hH=Object.getOwnPropertyDescriptors,_f=Object.getOwnPropertySymbols,aT=Object.prototype.hasOwnProperty,iT=Object.prototype.propertyIsEnumerable,K_=(e,t,r)=>t in e?fH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Y_=(e,t)=>{for(var r in t||(t={}))aT.call(t,r)&&K_(e,r,t[r]);if(_f)for(var r of _f(t))iT.call(t,r)&&K_(e,r,t[r]);return e},mH=(e,t)=>pH(e,hH(t)),gH=(e,t)=>{var r={};for(var n in e)aT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_f)for(var n of _f(e))t.indexOf(n)<0&&iT.call(e,n)&&(r[n]=e[n]);return r};const vH={size:"md",color:"gray",variant:"light"},U0=f.forwardRef((e,t)=>{const r=q("Avatar",vH,e),{className:n,size:o,src:a,alt:i,radius:l,children:c,color:u,variant:d,gradient:p,classNames:h,styles:m,imageProps:v,unstyled:g}=r,_=gH(r,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),y=KW(),[x,w]=f.useState(!a),{classes:b,cx:O}=dH({color:u,radius:l,withinGroup:y.withinGroup,spacing:y.spacing,gradient:p},{classNames:h,styles:m,unstyled:g,name:"Avatar",variant:d,size:o});return f.useEffect(()=>{w(!a)},[a]),S.createElement(oe,Y_({component:"div",className:O(b.root,n),ref:t},_),x?S.createElement("div",{className:b.placeholder,title:i},c||S.createElement(FW,{className:b.placeholderIcon})):S.createElement("img",mH(Y_({},v),{className:b.image,src:a,alt:i,onError:()=>w(!0)})))});U0.displayName="@mantine/core/Avatar";U0.Group=oT;const Sf=U0;var yH=Object.defineProperty,xH=Object.defineProperties,wH=Object.getOwnPropertyDescriptors,X_=Object.getOwnPropertySymbols,bH=Object.prototype.hasOwnProperty,_H=Object.prototype.propertyIsEnumerable,J_=(e,t,r)=>t in e?yH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lg=(e,t)=>{for(var r in t||(t={}))bH.call(t,r)&&J_(e,r,t[r]);if(X_)for(var r of X_(t))_H.call(t,r)&&J_(e,r,t[r]);return e},SH=(e,t)=>xH(e,wH(t));const PH=["light","filled","outline","dot","gradient"],cg={xs:{fontSize:P(9),height:P(16)},sm:{fontSize:P(10),height:P(18)},md:{fontSize:P(11),height:P(20)},lg:{fontSize:P(13),height:P(26)},xl:{fontSize:P(16),height:P(32)}},jH={xs:P(4),sm:P(4),md:P(6),lg:P(8),xl:P(10)};function OH({theme:e,variant:t,color:r,size:n,gradient:o}){if(!PH.includes(t))return null;if(t==="dot"){const i=A({size:n,sizes:jH});return{backgroundColor:"transparent",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[3]}`,paddingLeft:`calc(${A({size:n,sizes:e.spacing})} / 1.5 - ${i} / 2)`,"&::before":{content:'""',display:"block",width:i,height:i,borderRadius:i,backgroundColor:e.fn.themeColor(r,e.colorScheme==="dark"?4:e.fn.primaryShade("light"),!0),marginRight:i}}}const a=e.fn.variant({color:r,variant:t,gradient:o});return{background:a.background,color:a.color,border:`${P(t==="gradient"?0:1)} solid ${a.border}`}}var CH=W((e,{color:t,radius:r,gradient:n,fullWidth:o},{variant:a,size:i})=>{const{fontSize:l,height:c}=i in cg?cg[i]:cg.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:lg(SH(lg(lg({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${P(2)})`,textDecoration:"none",padding:`0 calc(${A({size:i,sizes:e.spacing})} / 1.5)`,boxSizing:"border-box",display:o?"flex":"inline-flex",alignItems:"center",justifyContent:"center",width:o?"100%":"auto",textTransform:"uppercase",borderRadius:e.fn.radius(r),fontWeight:700,letterSpacing:P(.25),cursor:"inherit",textOverflow:"ellipsis",overflow:"hidden"}),OH({theme:e,variant:a,color:t,size:i,gradient:n}))}});const EH=CH;var $H=Object.defineProperty,Pf=Object.getOwnPropertySymbols,sT=Object.prototype.hasOwnProperty,lT=Object.prototype.propertyIsEnumerable,Z_=(e,t,r)=>t in e?$H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kH=(e,t)=>{for(var r in t||(t={}))sT.call(t,r)&&Z_(e,r,t[r]);if(Pf)for(var r of Pf(t))lT.call(t,r)&&Z_(e,r,t[r]);return e},RH=(e,t)=>{var r={};for(var n in e)sT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pf)for(var n of Pf(e))t.indexOf(n)<0&&lT.call(e,n)&&(r[n]=e[n]);return r};const TH={variant:"light",size:"md",radius:"xl"},cT=f.forwardRef((e,t)=>{const r=q("Badge",TH,e),{className:n,color:o,variant:a,fullWidth:i,children:l,size:c,leftSection:u,rightSection:d,radius:p,gradient:h,classNames:m,styles:v,unstyled:g}=r,_=RH(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:y,cx:x}=EH({fullWidth:i,color:o,radius:p,gradient:h},{classNames:m,styles:v,name:"Badge",unstyled:g,variant:a,size:c});return S.createElement(oe,kH({className:x(y.root,n),ref:t},_),u&&S.createElement("span",{className:y.leftSection},u),S.createElement("span",{className:y.inner},l),d&&S.createElement("span",{className:y.rightSection},d))});cT.displayName="@mantine/core/Badge";const IH=cT;var DH=Object.defineProperty,jf=Object.getOwnPropertySymbols,uT=Object.prototype.hasOwnProperty,dT=Object.prototype.propertyIsEnumerable,eS=(e,t,r)=>t in e?DH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tS=(e,t)=>{for(var r in t||(t={}))uT.call(t,r)&&eS(e,r,t[r]);if(jf)for(var r of jf(t))dT.call(t,r)&&eS(e,r,t[r]);return e},NH=(e,t)=>{var r={};for(var n in e)uT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jf)for(var n of jf(e))t.indexOf(n)<0&&dT.call(e,n)&&(r[n]=e[n]);return r};function AH(e){const t=e,{style:r}=t,n=NH(t,["style"]);return S.createElement("svg",tS({viewBox:"0 0 409.294 409.294",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:tS({width:P(20),height:P(20)},r)},n),S.createElement("path",{d:"M0 204.647v175.412h175.412V204.647H58.471c0-64.48 52.461-116.941 116.941-116.941V29.235C78.684 29.235 0 107.919 0 204.647zM409.294 87.706V29.235c-96.728 0-175.412 78.684-175.412 175.412v175.412h175.412V204.647H292.353c0-64.48 52.461-116.941 116.941-116.941z"}))}var MH=Object.defineProperty,LH=Object.defineProperties,zH=Object.getOwnPropertyDescriptors,rS=Object.getOwnPropertySymbols,FH=Object.prototype.hasOwnProperty,VH=Object.prototype.propertyIsEnumerable,nS=(e,t,r)=>t in e?MH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BH=(e,t)=>{for(var r in t||(t={}))FH.call(t,r)&&nS(e,r,t[r]);if(rS)for(var r of rS(t))VH.call(t,r)&&nS(e,r,t[r]);return e},UH=(e,t)=>LH(e,zH(t)),WH=W((e,{color:t})=>({root:UH(BH({},e.fn.fontStyles()),{fontSize:e.fontSizes.lg,lineHeight:e.lineHeight,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,margin:0,borderTopRightRadius:e.radius.sm,borderBottomRightRadius:e.radius.sm,padding:`${e.spacing.md} ${e.spacing.lg}`}),inner:{display:"flex"},body:{flex:1,overflow:"hidden",textOverflow:"ellipsis"},icon:{color:e.fn.variant({variant:"filled",color:t}).background,marginRight:e.spacing.lg,marginTop:P(2),width:P(22)},cite:{display:"block",fontSize:e.fontSizes.sm,marginTop:e.spacing.xs,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],overflow:"hidden",textOverflow:"ellipsis"}}));const HH=WH;var qH=Object.defineProperty,Of=Object.getOwnPropertySymbols,fT=Object.prototype.hasOwnProperty,pT=Object.prototype.propertyIsEnumerable,oS=(e,t,r)=>t in e?qH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GH=(e,t)=>{for(var r in t||(t={}))fT.call(t,r)&&oS(e,r,t[r]);if(Of)for(var r of Of(t))pT.call(t,r)&&oS(e,r,t[r]);return e},QH=(e,t)=>{var r={};for(var n in e)fT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Of)for(var n of Of(e))t.indexOf(n)<0&&pT.call(e,n)&&(r[n]=e[n]);return r};const KH={color:"gray",icon:S.createElement(AH,null)},hT=f.forwardRef((e,t)=>{const r=q("Blockquote",KH,e),{className:n,color:o,icon:a,cite:i,children:l,classNames:c,styles:u,unstyled:d,variant:p}=r,h=QH(r,["className","color","icon","cite","children","classNames","styles","unstyled","variant"]),{classes:m,cx:v}=HH({color:o},{classNames:c,styles:u,unstyled:d,name:"Blockquote",variant:p});return S.createElement(oe,GH({component:"blockquote",className:v(m.root,n),ref:t},h),S.createElement("div",{className:m.inner},a&&S.createElement("div",{className:m.icon},a),S.createElement("div",{className:m.body},l,i&&S.createElement("cite",{className:m.cite},i))))});hT.displayName="@mantine/core/Blockquote";var YH=W((e,{orientation:t,buttonBorderWidth:r})=>({root:{display:"flex",flexDirection:t==="vertical"?"column":"row","& [data-button]":{"&:first-of-type:not(:last-of-type)":{borderBottomRightRadius:0,[t==="vertical"?"borderBottomLeftRadius":"borderTopRightRadius"]:0,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${P(r)} / 2)`},"&:last-of-type:not(:first-of-type)":{borderTopLeftRadius:0,[t==="vertical"?"borderTopRightRadius":"borderBottomLeftRadius"]:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${P(r)} / 2)`},"&:not(:first-of-type):not(:last-of-type)":{borderRadius:0,[t==="vertical"?"borderTopWidth":"borderLeftWidth"]:`calc(${P(r)} / 2)`,[t==="vertical"?"borderBottomWidth":"borderRightWidth"]:`calc(${P(r)} / 2)`},"& + [data-button]":{[t==="vertical"?"marginTop":"marginLeft"]:`calc(${r} * -1)`,"@media (min-resolution: 192dpi)":{[t==="vertical"?"marginTop":"marginLeft"]:0}}}}}));const XH=YH;var JH=Object.defineProperty,Cf=Object.getOwnPropertySymbols,mT=Object.prototype.hasOwnProperty,gT=Object.prototype.propertyIsEnumerable,aS=(e,t,r)=>t in e?JH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZH=(e,t)=>{for(var r in t||(t={}))mT.call(t,r)&&aS(e,r,t[r]);if(Cf)for(var r of Cf(t))gT.call(t,r)&&aS(e,r,t[r]);return e},eq=(e,t)=>{var r={};for(var n in e)mT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cf)for(var n of Cf(e))t.indexOf(n)<0&&gT.call(e,n)&&(r[n]=e[n]);return r};const tq={orientation:"horizontal",buttonBorderWidth:1},vT=f.forwardRef((e,t)=>{const r=q("ButtonGroup",tq,e),{className:n,orientation:o,buttonBorderWidth:a,unstyled:i}=r,l=eq(r,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=XH({orientation:o,buttonBorderWidth:a},{name:"ButtonGroup",unstyled:i});return S.createElement(oe,ZH({className:u(c.root,n),ref:t},l))});vT.displayName="@mantine/core/ButtonGroup";var rq=Object.defineProperty,nq=Object.defineProperties,oq=Object.getOwnPropertyDescriptors,iS=Object.getOwnPropertySymbols,aq=Object.prototype.hasOwnProperty,iq=Object.prototype.propertyIsEnumerable,sS=(e,t,r)=>t in e?rq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,io=(e,t)=>{for(var r in t||(t={}))aq.call(t,r)&&sS(e,r,t[r]);if(iS)for(var r of iS(t))iq.call(t,r)&&sS(e,r,t[r]);return e},ad=(e,t)=>nq(e,oq(t));const sq=["filled","outline","light","white","default","subtle","gradient"],Wv={xs:{height:Ct.xs,paddingLeft:P(14),paddingRight:P(14)},sm:{height:Ct.sm,paddingLeft:P(18),paddingRight:P(18)},md:{height:Ct.md,paddingLeft:P(22),paddingRight:P(22)},lg:{height:Ct.lg,paddingLeft:P(26),paddingRight:P(26)},xl:{height:Ct.xl,paddingLeft:P(32),paddingRight:P(32)},"compact-xs":{height:P(22),paddingLeft:P(7),paddingRight:P(7)},"compact-sm":{height:P(26),paddingLeft:P(8),paddingRight:P(8)},"compact-md":{height:P(30),paddingLeft:P(10),paddingRight:P(10)},"compact-lg":{height:P(34),paddingLeft:P(12),paddingRight:P(12)},"compact-xl":{height:P(40),paddingLeft:P(14),paddingRight:P(14)}};function lq({compact:e,size:t,withLeftIcon:r,withRightIcon:n}){if(e)return Wv[`compact-${t}`];const o=Wv[t];return o?ad(io({},o),{paddingLeft:r?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:n?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const cq=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function uq({variant:e,theme:t,color:r,gradient:n}){if(!sq.includes(e))return null;const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?io({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):io({border:`${P(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var dq=W((e,{radius:t,fullWidth:r,compact:n,withLeftIcon:o,withRightIcon:a,color:i,gradient:l},{variant:c,size:u})=>({root:ad(io(ad(io(io(io(io({},lq({compact:n,size:u,withLeftIcon:o,withRightIcon:a})),e.fn.fontStyles()),e.fn.focusStyles()),cq(r)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:A({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),uq({variant:c,theme:e,color:i,gradient:l})),{"&:active":e.activeStyles,"&:disabled, &[data-disabled]":{borderColor:"transparent",backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5],cursor:"not-allowed",backgroundImage:"none",pointerEvents:"none","&:active":{transform:"none"}},"&[data-loading]":{pointerEvents:"none","&::before":ad(io({content:'""'},e.fn.cover(P(-1))),{backgroundColor:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[7],.5):"rgba(255, 255, 255, .5)",borderRadius:e.fn.radius(t),cursor:"not-allowed"})}}),icon:{display:"flex",alignItems:"center"},leftIcon:{marginRight:e.spacing.xs},rightIcon:{marginLeft:e.spacing.xs},centerLoader:{position:"absolute",left:"50%",transform:"translateX(-50%)",opacity:.5},inner:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",overflow:"visible"},label:{whiteSpace:"nowrap",height:"100%",overflow:"hidden",display:"flex",alignItems:"center"}}));const fq=dq;var pq=Object.defineProperty,Ef=Object.getOwnPropertySymbols,yT=Object.prototype.hasOwnProperty,xT=Object.prototype.propertyIsEnumerable,lS=(e,t,r)=>t in e?pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cS=(e,t)=>{for(var r in t||(t={}))yT.call(t,r)&&lS(e,r,t[r]);if(Ef)for(var r of Ef(t))xT.call(t,r)&&lS(e,r,t[r]);return e},hq=(e,t)=>{var r={};for(var n in e)yT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ef)for(var n of Ef(e))t.indexOf(n)<0&&xT.call(e,n)&&(r[n]=e[n]);return r};const mq={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},W0=f.forwardRef((e,t)=>{const r=q("Button",mq,e),{className:n,size:o,color:a,type:i,disabled:l,children:c,leftIcon:u,rightIcon:d,fullWidth:p,variant:h,radius:m,uppercase:v,compact:g,loading:_,loaderPosition:y,loaderProps:x,gradient:w,classNames:b,styles:O,unstyled:C}=r,j=hq(r,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:E,cx:T,theme:$}=fq({radius:m,color:a,fullWidth:p,compact:g,gradient:w,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:C,classNames:b,styles:O,variant:h,size:o}),I=$.fn.variant({color:a,variant:h}),k=S.createElement(dn,cS({color:I.color,size:`calc(${A({size:o,sizes:Wv}).height} / 2)`},x));return S.createElement(ho,cS({className:T(E.root,n),type:i,disabled:l,"data-button":!0,"data-disabled":l||void 0,"data-loading":_||void 0,ref:t,unstyled:C},j),S.createElement("div",{className:E.inner},(u||_&&y==="left")&&S.createElement("span",{className:T(E.icon,E.leftIcon)},_&&y==="left"?k:u),_&&y==="center"&&S.createElement("span",{className:E.centerLoader},k),S.createElement("span",{className:E.label,style:{textTransform:v?"uppercase":void 0}},c),(d||_&&y==="right")&&S.createElement("span",{className:T(E.icon,E.rightIcon)},_&&y==="right"?k:d)))});W0.displayName="@mantine/core/Button";W0.Group=vT;const re=W0;var gq=W((e,{radius:t,shadow:r})=>({root:{outline:0,WebkitTapHighlightColor:"transparent",display:"block",textDecoration:"none",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,boxSizing:"border-box",borderRadius:e.fn.radius(t),boxShadow:e.shadows[r]||r||"none","&[data-with-border]":{border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}}}));const vq=gq;var yq=Object.defineProperty,$f=Object.getOwnPropertySymbols,wT=Object.prototype.hasOwnProperty,bT=Object.prototype.propertyIsEnumerable,uS=(e,t,r)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xq=(e,t)=>{for(var r in t||(t={}))wT.call(t,r)&&uS(e,r,t[r]);if($f)for(var r of $f(t))bT.call(t,r)&&uS(e,r,t[r]);return e},wq=(e,t)=>{var r={};for(var n in e)wT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$f)for(var n of $f(e))t.indexOf(n)<0&&bT.call(e,n)&&(r[n]=e[n]);return r};const bq={},_T=f.forwardRef((e,t)=>{const r=q("Paper",bq,e),{className:n,children:o,radius:a,withBorder:i,shadow:l,unstyled:c,variant:u}=r,d=wq(r,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:p,cx:h}=vq({radius:a,shadow:l},{name:"Paper",unstyled:c,variant:u});return S.createElement(oe,xq({className:h(p.root,n),"data-with-border":i||void 0,ref:t},d),o)});_T.displayName="@mantine/core/Paper";const sn=_T;var _q=W((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const Sq=_q;var Pq=Object.defineProperty,kf=Object.getOwnPropertySymbols,ST=Object.prototype.hasOwnProperty,PT=Object.prototype.propertyIsEnumerable,dS=(e,t,r)=>t in e?Pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jq=(e,t)=>{for(var r in t||(t={}))ST.call(t,r)&&dS(e,r,t[r]);if(kf)for(var r of kf(t))PT.call(t,r)&&dS(e,r,t[r]);return e},Oq=(e,t)=>{var r={};for(var n in e)ST.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kf)for(var n of kf(e))t.indexOf(n)<0&&PT.call(e,n)&&(r[n]=e[n]);return r};const jT=f.forwardRef((e,t)=>{const r=q("Center",{},e),{inline:n,className:o,unstyled:a,variant:i}=r,l=Oq(r,["inline","className","unstyled","variant"]),{classes:c,cx:u}=Sq({inline:n},{name:"Center",unstyled:a,variant:i});return S.createElement(oe,jq({ref:t,className:u(c.root,o)},l))});jT.displayName="@mantine/core/Center";const rr=jT,OT=f.createContext(null),Cq=OT.Provider,Eq=()=>f.useContext(OT);var $q=Object.defineProperty,Rf=Object.getOwnPropertySymbols,CT=Object.prototype.hasOwnProperty,ET=Object.prototype.propertyIsEnumerable,fS=(e,t,r)=>t in e?$q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pS=(e,t)=>{for(var r in t||(t={}))CT.call(t,r)&&fS(e,r,t[r]);if(Rf)for(var r of Rf(t))ET.call(t,r)&&fS(e,r,t[r]);return e},kq=(e,t)=>{var r={};for(var n in e)CT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Rf)for(var n of Rf(e))t.indexOf(n)<0&&ET.call(e,n)&&(r[n]=e[n]);return r};const Rq={size:"sm"},$T=f.forwardRef((e,t)=>{const r=q("CheckboxGroup",Rq,e),{children:n,value:o,defaultValue:a,onChange:i,size:l,wrapperProps:c}=r,u=kq(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=Er({value:o,defaultValue:a,finalValue:[],onChange:i}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(Cq,{value:{value:d,onChange:h,size:l}},S.createElement(Vt.Wrapper,pS(pS({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),u),n))});$T.displayName="@mantine/core/CheckboxGroup";var Tq=Object.defineProperty,Tf=Object.getOwnPropertySymbols,kT=Object.prototype.hasOwnProperty,RT=Object.prototype.propertyIsEnumerable,hS=(e,t,r)=>t in e?Tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,If=(e,t)=>{for(var r in t||(t={}))kT.call(t,r)&&hS(e,r,t[r]);if(Tf)for(var r of Tf(t))RT.call(t,r)&&hS(e,r,t[r]);return e},TT=(e,t)=>{var r={};for(var n in e)kT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tf)for(var n of Tf(e))t.indexOf(n)<0&&RT.call(e,n)&&(r[n]=e[n]);return r};function IT(e){const t=e,{width:r,height:n,style:o}=t,a=TT(t,["width","height","style"]);return S.createElement("svg",If({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:If({width:r,height:n},o)},a),S.createElement("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 DT(e){var t=e,{indeterminate:r}=t,n=TT(t,["indeterminate"]);return r?S.createElement("svg",If({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6"},n),S.createElement("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})):S.createElement(IT,If({},n))}var Iq=Object.defineProperty,Dq=Object.defineProperties,Nq=Object.getOwnPropertyDescriptors,mS=Object.getOwnPropertySymbols,Aq=Object.prototype.hasOwnProperty,Mq=Object.prototype.propertyIsEnumerable,gS=(e,t,r)=>t in e?Iq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vS=(e,t)=>{for(var r in t||(t={}))Aq.call(t,r)&&gS(e,r,t[r]);if(mS)for(var r of mS(t))Mq.call(t,r)&&gS(e,r,t[r]);return e},yS=(e,t)=>Dq(e,Nq(t));const Lq={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)};var zq=W((e,{radius:t,color:r,transitionDuration:n,labelPosition:o,error:a,indeterminate:i},{size:l})=>{const c=A({size:l,sizes:Lq}),u=e.fn.variant({variant:"filled",color:r});return{icon:yS(vS({},e.fn.cover()),{ref:zt("icon"),color:i?"inherit":e.white,transform:i?"none":`translateY(${P(5)}) scale(0.5)`,opacity:i?1:0,transitionProperty:"opacity, transform",transitionTimingFunction:"ease",transitionDuration:`${n}ms`,pointerEvents:"none",width:"60%",position:"absolute",zIndex:1,margin:"auto","@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}}),inner:{position:"relative",width:c,height:c,order:o==="left"?2:1},input:yS(vS({},e.fn.focusStyles()),{appearance:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${P(1)} solid ${a?e.fn.variant({variant:"filled",color:"red"}).background:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,width:c,height:c,borderRadius:e.fn.radius(t),padding:0,display:"block",margin:0,transition:`border-color ${n}ms ease, background-color ${n}ms ease`,cursor:e.cursorType,"&:checked":{backgroundColor:u.background,borderColor:u.background,[`& + .${zt("icon")}`]:{opacity:1,color:e.white,transform:"translateY(0) scale(1)"}},"&:disabled":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[3],cursor:"not-allowed",pointerEvents:"none",[`& + .${zt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[5]}}})}});const Fq=zq;var Vq=Object.defineProperty,Bq=Object.defineProperties,Uq=Object.getOwnPropertyDescriptors,xS=Object.getOwnPropertySymbols,Wq=Object.prototype.hasOwnProperty,Hq=Object.prototype.propertyIsEnumerable,wS=(e,t,r)=>t in e?Vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qq=(e,t)=>{for(var r in t||(t={}))Wq.call(t,r)&&wS(e,r,t[r]);if(xS)for(var r of xS(t))Hq.call(t,r)&&wS(e,r,t[r]);return e},Gq=(e,t)=>Bq(e,Uq(t));const ug={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)};var Qq=W((e,{labelPosition:t},{size:r})=>({root:{},body:{display:"flex","&:has(input:disabled) label":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}},labelWrapper:Gq(qq({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:r in ug?A({size:r,sizes:e.fontSizes}):void 0,lineHeight:r in ug?A({size:r,sizes:ug}):void 0,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,cursor:e.cursorType,order:t==="left"?1:2}),description:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},error:{marginTop:`calc(${e.spacing.xs} / 2)`,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm},label:{cursor:e.cursorType,[t==="left"?"paddingRight":"paddingLeft"]:e.spacing.sm,"&:disabled, &[data-disabled]":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}));const Kq=Qq;var Yq=Object.defineProperty,Df=Object.getOwnPropertySymbols,NT=Object.prototype.hasOwnProperty,AT=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?Yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xq=(e,t)=>{for(var r in t||(t={}))NT.call(t,r)&&bS(e,r,t[r]);if(Df)for(var r of Df(t))AT.call(t,r)&&bS(e,r,t[r]);return e},Jq=(e,t)=>{var r={};for(var n in e)NT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Df)for(var n of Df(e))t.indexOf(n)<0&&AT.call(e,n)&&(r[n]=e[n]);return r};const Kh=f.forwardRef((e,t)=>{var r=e,{__staticSelector:n,className:o,classNames:a,styles:i,unstyled:l,children:c,label:u,description:d,id:p,disabled:h,error:m,size:v,labelPosition:g,variant:_}=r,y=Jq(r,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:x,cx:w}=Kq({labelPosition:g},{name:n,styles:i,classNames:a,unstyled:l,variant:_,size:v});return S.createElement(oe,Xq({className:w(x.root,o),ref:t},y),S.createElement("div",{className:w(x.body)},c,S.createElement("div",{className:x.labelWrapper},u!=null&&S.createElement("label",{className:x.label,"data-disabled":h||void 0,htmlFor:p},u),d&&S.createElement(Vt.Description,{className:x.description},d),m&&m!=="boolean"&&S.createElement(Vt.Error,{className:x.error},m))))});Kh.displayName="@mantine/core/InlineInput";var Zq=Object.defineProperty,Nf=Object.getOwnPropertySymbols,MT=Object.prototype.hasOwnProperty,LT=Object.prototype.propertyIsEnumerable,_S=(e,t,r)=>t in e?Zq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pu=(e,t)=>{for(var r in t||(t={}))MT.call(t,r)&&_S(e,r,t[r]);if(Nf)for(var r of Nf(t))LT.call(t,r)&&_S(e,r,t[r]);return e},eG=(e,t)=>{var r={};for(var n in e)MT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Nf)for(var n of Nf(e))t.indexOf(n)<0&&LT.call(e,n)&&(r[n]=e[n]);return r};const tG={size:"sm",transitionDuration:100,icon:DT,labelPosition:"right"},$n=f.forwardRef((e,t)=>{const r=q("Checkbox",tG,e),{className:n,style:o,sx:a,checked:i,disabled:l,color:c,label:u,indeterminate:d,id:p,size:h,radius:m,wrapperProps:v,children:g,classNames:_,styles:y,transitionDuration:x,icon:w,unstyled:b,labelPosition:O,description:C,error:j,variant:E}=r,T=eG(r,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),$=Eq(),I=kr(p),{systemStyles:k,rest:D}=Jn(T),{classes:N}=Fq({radius:m,color:c,transitionDuration:x,labelPosition:O,error:!!j,indeterminate:d},{name:"Checkbox",classNames:_,styles:y,unstyled:b,variant:E,size:($==null?void 0:$.size)||h}),z=$?{checked:$.value.includes(D.value),onChange:$.onChange}:{};return S.createElement(Kh,Pu(Pu({className:n,sx:a,style:o,id:I,size:($==null?void 0:$.size)||h,labelPosition:O,label:u,description:C,error:j,disabled:l,__staticSelector:"Checkbox",classNames:_,styles:y,unstyled:b,"data-checked":z.checked||void 0,variant:E},k),v),S.createElement("div",{className:N.inner},S.createElement("input",Pu(Pu({id:I,ref:t,type:"checkbox",className:N.input,checked:i,disabled:l},D),z)),S.createElement(w,{indeterminate:d,className:N.icon})))});$n.displayName="@mantine/core/Checkbox";$n.Group=$T;const zT=f.createContext(null),rG=zT.Provider,nG=()=>f.useContext(zT),oG={};function FT(e){const{value:t,defaultValue:r,onChange:n,multiple:o,children:a}=q("ChipGroup",oG,e),[i,l]=Er({value:t,defaultValue:r,finalValue:o?[]:null,onChange:n}),c=d=>Array.isArray(i)?i.includes(d):d===i,u=d=>{const p=d.currentTarget.value;Array.isArray(i)?l(i.includes(p)?i.filter(h=>h!==p):[...i,p]):l(p)};return S.createElement(rG,{value:{isChipSelected:c,onChange:u,multiple:o}},a)}FT.displayName="@mantine/core/ChipGroup";var aG=Object.defineProperty,iG=Object.defineProperties,sG=Object.getOwnPropertyDescriptors,SS=Object.getOwnPropertySymbols,lG=Object.prototype.hasOwnProperty,cG=Object.prototype.propertyIsEnumerable,PS=(e,t,r)=>t in e?aG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sn=(e,t)=>{for(var r in t||(t={}))lG.call(t,r)&&PS(e,r,t[r]);if(SS)for(var r of SS(t))cG.call(t,r)&&PS(e,r,t[r]);return e},gl=(e,t)=>iG(e,sG(t));const jS={xs:P(24),sm:P(28),md:P(32),lg:P(36),xl:P(40)},Js={xs:P(10),sm:P(12),md:P(14),lg:P(16),xl:P(18)},OS={xs:P(16),sm:P(20),md:P(24),lg:P(28),xl:P(32)},ju={xs:P(7.5),sm:P(10),md:P(11.5),lg:P(13),xl:P(15)};function uG(e,{color:t},r){const n=e.fn.variant({variant:"filled",color:t}),o=e.fn.variant({variant:"light",color:t});return r==="light"?{label:Sn({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:gl(Sn({color:o.color,backgroundColor:o.background},e.fn.hover({backgroundColor:o.hover})),{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:t}).background}})}:r==="filled"?{label:Sn({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:Sn({color:n.color,backgroundColor:n.background},e.fn.hover({backgroundColor:n.hover}))}:r==="outline"?{label:Sn({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]})),checked:{border:`${P(1)} solid ${n.background}`}}:{label:null,checked:null}}var dG=W((e,{radius:t,color:r},{size:n,variant:o})=>{const a=uG(e,{color:r},o);return{root:{},label:gl(Sn(gl(Sn({ref:zt("label")},e.fn.fontStyles()),{boxSizing:"border-box",color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"inline-flex",alignItems:"center",userSelect:"none",border:`${P(1)} solid transparent`,borderRadius:e.fn.radius(t),height:A({size:n,sizes:jS}),fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:`calc(${A({size:n,sizes:jS})} - ${P(2)})`,paddingLeft:A({size:n,sizes:OS}),paddingRight:A({size:n,sizes:OS}),cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 100ms ease",WebkitTapHighlightColor:"transparent"}),a.label),{"&[data-disabled]":gl(Sn({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})),{[`& .${zt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}),"&[data-checked]":{paddingLeft:A({size:n,sizes:ju}),paddingRight:A({size:n,sizes:ju}),"&:not([data-disabled])":a.checked}}),iconWrapper:{ref:zt("iconWrapper"),color:o==="filled"?e.white:e.fn.variant({variant:"filled",color:r}).background,width:`calc(${A({size:n,sizes:Js})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,maxWidth:`calc(${A({size:n,sizes:Js})} + (${A({size:n,sizes:e.spacing})} / 1.5))`,height:A({size:n,sizes:Js}),display:"inline-block",verticalAlign:"middle",overflow:"hidden"},checkIcon:{width:A({size:n,sizes:Js}),height:`calc(${A({size:n,sizes:Js})} / 1.1)`,display:"block"},input:{width:0,height:0,padding:0,opacity:0,margin:0,"&:disabled + label":gl(Sn({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})),{[`& .${zt("iconWrapper")}`]:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&[data-checked]":{paddingLeft:A({size:n,sizes:ju}),paddingRight:A({size:n,sizes:ju}),"&:not([data-disabled])":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}}),"&:focus":{outline:"none",[`& + .${zt("label")}`]:Sn({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${zt("label")}`]:Sn({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}}}});const fG=dG;var pG=Object.defineProperty,Af=Object.getOwnPropertySymbols,VT=Object.prototype.hasOwnProperty,BT=Object.prototype.propertyIsEnumerable,CS=(e,t,r)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ou=(e,t)=>{for(var r in t||(t={}))VT.call(t,r)&&CS(e,r,t[r]);if(Af)for(var r of Af(t))BT.call(t,r)&&CS(e,r,t[r]);return e},hG=(e,t)=>{var r={};for(var n in e)VT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Af)for(var n of Af(e))t.indexOf(n)<0&&BT.call(e,n)&&(r[n]=e[n]);return r};const mG={type:"checkbox",size:"sm",radius:"xl",variant:"outline"},Mf=f.forwardRef((e,t)=>{const r=q("Chip",mG,e),{radius:n,type:o,size:a,variant:i,disabled:l,id:c,color:u,children:d,className:p,classNames:h,style:m,styles:v,checked:g,defaultChecked:_,onChange:y,sx:x,wrapperProps:w,value:b,unstyled:O}=r,C=hG(r,["radius","type","size","variant","disabled","id","color","children","className","classNames","style","styles","checked","defaultChecked","onChange","sx","wrapperProps","value","unstyled"]),j=nG(),E=kr(c),{systemStyles:T,rest:$}=Jn(C),{classes:I,cx:k}=fG({radius:n,color:u},{classNames:h,styles:v,unstyled:O,name:"Chip",variant:i,size:a}),[D,N]=Er({value:g,defaultValue:_,finalValue:!1,onChange:y}),z=j?{checked:j.isChipSelected(b),onChange:j.onChange,type:j.multiple?"checkbox":"radio"}:{},H=z.checked||D;return S.createElement(oe,Ou(Ou({className:k(I.root,p),style:m,sx:x},T),w),S.createElement("input",Ou(Ou({type:o,className:I.input,checked:H,onChange:K=>N(K.currentTarget.checked),id:E,disabled:l,ref:t,value:b},z),$)),S.createElement("label",{htmlFor:E,"data-checked":H||void 0,"data-disabled":l||void 0,className:I.label},H&&S.createElement("span",{className:I.iconWrapper},S.createElement(IT,{className:I.checkIcon})),d))});Mf.displayName="@mantine/core/Chip";Mf.Group=FT;var gG=W((e,{fluid:t,sizes:r},{size:n})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":A({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const vG=gG;var yG=Object.defineProperty,Lf=Object.getOwnPropertySymbols,UT=Object.prototype.hasOwnProperty,WT=Object.prototype.propertyIsEnumerable,ES=(e,t,r)=>t in e?yG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xG=(e,t)=>{for(var r in t||(t={}))UT.call(t,r)&&ES(e,r,t[r]);if(Lf)for(var r of Lf(t))WT.call(t,r)&&ES(e,r,t[r]);return e},wG=(e,t)=>{var r={};for(var n in e)UT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Lf)for(var n of Lf(e))t.indexOf(n)<0&&WT.call(e,n)&&(r[n]=e[n]);return r};const bG={sizes:{xs:P(540),sm:P(720),md:P(960),lg:P(1140),xl:P(1320)}},HT=f.forwardRef((e,t)=>{const r=q("Container",bG,e),{className:n,fluid:o,size:a,unstyled:i,sizes:l,variant:c}=r,u=wG(r,["className","fluid","size","unstyled","sizes","variant"]),{classes:d,cx:p}=vG({fluid:o,sizes:l},{unstyled:i,name:"Container",variant:c,size:a});return S.createElement(oe,xG({className:p(d.root,n),ref:t},u))});HT.displayName="@mantine/core/Container";var _G=Object.defineProperty,zf=Object.getOwnPropertySymbols,qT=Object.prototype.hasOwnProperty,GT=Object.prototype.propertyIsEnumerable,$S=(e,t,r)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SG=(e,t)=>{for(var r in t||(t={}))qT.call(t,r)&&$S(e,r,t[r]);if(zf)for(var r of zf(t))GT.call(t,r)&&$S(e,r,t[r]);return e},PG=(e,t)=>{var r={};for(var n in e)qT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zf)for(var n of zf(e))t.indexOf(n)<0&&GT.call(e,n)&&(r[n]=e[n]);return r};const jG={timeout:1e3};function QT(e){const t=q("CopyButton",jG,e),{children:r,timeout:n,value:o}=t,a=PG(t,["children","timeout","value"]),i=uL({timeout:n}),l=()=>i.copy(o);return S.createElement(S.Fragment,null,r(SG({copy:l,copied:i.copied},a)))}QT.displayName="@mantine/core/CopyButton";const[OG,Ts]=Po("ModalBase component was not found in tree");var CG=W(()=>({close:{marginLeft:"auto",marginRight:0}}));const EG=CG;var $G=Object.defineProperty,Ff=Object.getOwnPropertySymbols,KT=Object.prototype.hasOwnProperty,YT=Object.prototype.propertyIsEnumerable,kS=(e,t,r)=>t in e?$G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kG=(e,t)=>{for(var r in t||(t={}))KT.call(t,r)&&kS(e,r,t[r]);if(Ff)for(var r of Ff(t))YT.call(t,r)&&kS(e,r,t[r]);return e},RG=(e,t)=>{var r={};for(var n in e)KT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ff)for(var n of Ff(e))t.indexOf(n)<0&&YT.call(e,n)&&(r[n]=e[n]);return r};const TG={size:"sm"},IG=f.forwardRef((e,t)=>{const r=Ts(),n=q(`${r.__staticSelector}CloseButton`,TG,e),{className:o}=n,a=RG(n,["className"]),{classes:i,cx:l}=EG(null,r.stylesApi);return S.createElement(vc,kG({className:l(i.close,o),ref:t,onClick:r.onClose},a))});var DG=W(()=>({overlay:{}}));const NG=DG;var AG=Object.defineProperty,MG=Object.defineProperties,LG=Object.getOwnPropertyDescriptors,RS=Object.getOwnPropertySymbols,zG=Object.prototype.hasOwnProperty,FG=Object.prototype.propertyIsEnumerable,TS=(e,t,r)=>t in e?AG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VG=(e,t)=>{for(var r in t||(t={}))zG.call(t,r)&&TS(e,r,t[r]);if(RS)for(var r of RS(t))FG.call(t,r)&&TS(e,r,t[r]);return e},BG=(e,t)=>MG(e,LG(t)),UG=W((e,{color:t,opacity:r,blur:n,radius:o,gradient:a,fixed:i,zIndex:l})=>({root:BG(VG({},e.fn.cover(0)),{position:i?"fixed":"absolute",backgroundColor:a?void 0:e.fn.rgba(t,r),backgroundImage:a,backdropFilter:n?`blur(${P(n)})`:void 0,borderRadius:e.fn.radius(o),zIndex:l,"&[data-center]":{display:"flex",alignItems:"center",justifyContent:"center"}})}));const WG=UG;var HG=Object.defineProperty,Vf=Object.getOwnPropertySymbols,XT=Object.prototype.hasOwnProperty,JT=Object.prototype.propertyIsEnumerable,IS=(e,t,r)=>t in e?HG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qG=(e,t)=>{for(var r in t||(t={}))XT.call(t,r)&&IS(e,r,t[r]);if(Vf)for(var r of Vf(t))JT.call(t,r)&&IS(e,r,t[r]);return e},GG=(e,t)=>{var r={};for(var n in e)XT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vf)for(var n of Vf(e))t.indexOf(n)<0&&JT.call(e,n)&&(r[n]=e[n]);return r};const QG={opacity:.6,color:"#000",zIndex:Rn("modal"),radius:0},ZT=f.forwardRef((e,t)=>{const r=q("Overlay",QG,e),{variant:n,opacity:o,color:a,blur:i,gradient:l,zIndex:c,radius:u,children:d,className:p,classNames:h,styles:m,unstyled:v,center:g,fixed:_}=r,y=GG(r,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:x,cx:w}=WG({color:a,opacity:o,blur:i,radius:u,gradient:l,fixed:_,zIndex:c},{name:"Overlay",classNames:h,styles:m,unstyled:v,variant:n});return S.createElement(oe,qG({ref:t,className:w(x.root,p),"data-center":g||void 0},y),d)});ZT.displayName="@mantine/core/Overlay";const eI=ZT;var KG=Object.defineProperty,YG=Object.defineProperties,XG=Object.getOwnPropertyDescriptors,Bf=Object.getOwnPropertySymbols,tI=Object.prototype.hasOwnProperty,rI=Object.prototype.propertyIsEnumerable,DS=(e,t,r)=>t in e?KG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zs=(e,t)=>{for(var r in t||(t={}))tI.call(t,r)&&DS(e,r,t[r]);if(Bf)for(var r of Bf(t))rI.call(t,r)&&DS(e,r,t[r]);return e},JG=(e,t)=>YG(e,XG(t)),ZG=(e,t)=>{var r={};for(var n in e)tI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bf)for(var n of Bf(e))t.indexOf(n)<0&&rI.call(e,n)&&(r[n]=e[n]);return r};const eQ={},tQ=f.forwardRef((e,t)=>{const r=Ts(),n=q(`${r.__staticSelector}Overlay`,eQ,e),{onClick:o,transitionProps:a,style:i,className:l}=n,c=ZG(n,["onClick","transitionProps","style","className"]),{classes:u,cx:d}=NG(null,r.stylesApi),p=h=>{o==null||o(h),r.closeOnClickOutside&&r.onClose()};return S.createElement(si,JG(Zs(Zs({mounted:r.opened},r.transitionProps),a),{transition:"fade"}),h=>S.createElement(eI,Zs({ref:t,onClick:p,fixed:!0,style:Zs(Zs({},i),h),className:d(u.overlay,l),zIndex:r.zIndex},c)))});var rQ=W((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const nQ=rQ;var oQ=Object.defineProperty,Uf=Object.getOwnPropertySymbols,nI=Object.prototype.hasOwnProperty,oI=Object.prototype.propertyIsEnumerable,NS=(e,t,r)=>t in e?oQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,el=(e,t)=>{for(var r in t||(t={}))nI.call(t,r)&&NS(e,r,t[r]);if(Uf)for(var r of Uf(t))oI.call(t,r)&&NS(e,r,t[r]);return e},aQ=(e,t)=>{var r={};for(var n in e)nI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Uf)for(var n of Uf(e))t.indexOf(n)<0&&oI.call(e,n)&&(r[n]=e[n]);return r};const iQ={},sQ=f.forwardRef((e,t)=>{const r=Ts(),n=q(`${r.__staticSelector}Content`,iQ,e),{className:o,transitionProps:a,style:i,onKeyDown:l}=n,c=aQ(n,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:d}=nQ({zIndex:r.zIndex},r.stylesApi),p=h=>{var m;((m=h.target)==null?void 0:m.getAttribute("data-mantine-stop-propagation"))!=="true"&&h.key==="Escape"&&r.closeOnEscape&&r.onClose(),l==null||l(h)};return S.createElement(si,el(el({mounted:r.opened,transition:"pop"},r.transitionProps),a),h=>S.createElement("div",{className:d(u.inner)},S.createElement(L0,{active:r.opened&&r.trapFocus},S.createElement(sn,el({component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":r.bodyMounted?r.getBodyId():void 0,"aria-labelledby":r.titleMounted?r.getTitleId():void 0,onKeyDown:p,ref:t,className:d(u.content,o),style:el(el({},i),h),shadow:r.shadow},c),c.children))))});var lQ=W((e,{padding:t})=>{const r=A({size:t,sizes:e.spacing});return{header:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:r,paddingRight:`calc(${r} - ${P(5)})`,position:"sticky",top:0,backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,zIndex:1e3}}});const cQ=lQ;var uQ=Object.defineProperty,Wf=Object.getOwnPropertySymbols,aI=Object.prototype.hasOwnProperty,iI=Object.prototype.propertyIsEnumerable,AS=(e,t,r)=>t in e?uQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dQ=(e,t)=>{for(var r in t||(t={}))aI.call(t,r)&&AS(e,r,t[r]);if(Wf)for(var r of Wf(t))iI.call(t,r)&&AS(e,r,t[r]);return e},fQ=(e,t)=>{var r={};for(var n in e)aI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wf)for(var n of Wf(e))t.indexOf(n)<0&&iI.call(e,n)&&(r[n]=e[n]);return r};const pQ={},hQ=f.forwardRef((e,t)=>{const r=Ts(),n=q(`${r.__staticSelector}Header`,pQ,e),{className:o}=n,a=fQ(n,["className"]),{classes:i,cx:l}=cQ({padding:r.padding},r.stylesApi);return S.createElement(oe,dQ({ref:t,className:l(i.header,o)},a))});var mQ=W(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const gQ=mQ;var vQ=Object.defineProperty,Hf=Object.getOwnPropertySymbols,sI=Object.prototype.hasOwnProperty,lI=Object.prototype.propertyIsEnumerable,MS=(e,t,r)=>t in e?vQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yQ=(e,t)=>{for(var r in t||(t={}))sI.call(t,r)&&MS(e,r,t[r]);if(Hf)for(var r of Hf(t))lI.call(t,r)&&MS(e,r,t[r]);return e},xQ=(e,t)=>{var r={};for(var n in e)sI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hf)for(var n of Hf(e))t.indexOf(n)<0&&lI.call(e,n)&&(r[n]=e[n]);return r};const wQ={},bQ=f.forwardRef((e,t)=>{const r=Ts(),n=q(`${r.__staticSelector}Title`,wQ,e),{className:o}=n,a=xQ(n,["className"]),{classes:i,cx:l}=gQ(null,r.stylesApi);return f.useEffect(()=>(r.setTitleMounted(!0),()=>r.setTitleMounted(!1)),[]),S.createElement(oe,yQ({component:"h2",id:r.getTitleId(),className:l(i.title,o),ref:t},a))});var _Q=W((e,{padding:t})=>({body:{padding:A({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const SQ=_Q;var PQ=Object.defineProperty,qf=Object.getOwnPropertySymbols,cI=Object.prototype.hasOwnProperty,uI=Object.prototype.propertyIsEnumerable,LS=(e,t,r)=>t in e?PQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jQ=(e,t)=>{for(var r in t||(t={}))cI.call(t,r)&&LS(e,r,t[r]);if(qf)for(var r of qf(t))uI.call(t,r)&&LS(e,r,t[r]);return e},OQ=(e,t)=>{var r={};for(var n in e)cI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qf)for(var n of qf(e))t.indexOf(n)<0&&uI.call(e,n)&&(r[n]=e[n]);return r};const CQ={},EQ=f.forwardRef((e,t)=>{const r=Ts(),n=q(`${r.__staticSelector}Body`,CQ,e),{className:o}=n,a=OQ(n,["className"]),{classes:i,cx:l}=SQ({padding:r.padding},r.stylesApi);return f.useEffect(()=>(r.setBodyMounted(!0),()=>r.setBodyMounted(!1)),[]),S.createElement(oe,jQ({id:r.getBodyId(),className:l(i.body,o),ref:t},a))});function $Q({children:e}){return S.createElement(S.Fragment,null,e)}function kQ({opened:e,transitionDuration:t}){const[r,n]=f.useState(e),o=f.useRef(),i=Ch()?0:t;return f.useEffect(()=>(e?(n(!0),window.clearTimeout(o.current)):i===0?n(!1):o.current=window.setTimeout(()=>n(!1),i),()=>window.clearTimeout(o.current)),[e,i]),r}var RQ=W(()=>({root:{}}));const TQ=RQ;var IQ=Object.defineProperty,DQ=Object.defineProperties,NQ=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,dI=Object.prototype.hasOwnProperty,fI=Object.prototype.propertyIsEnumerable,zS=(e,t,r)=>t in e?IQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dg=(e,t)=>{for(var r in t||(t={}))dI.call(t,r)&&zS(e,r,t[r]);if(Gf)for(var r of Gf(t))fI.call(t,r)&&zS(e,r,t[r]);return e},FS=(e,t)=>DQ(e,NQ(t)),AQ=(e,t)=>{var r={};for(var n in e)dI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gf)for(var n of Gf(e))t.indexOf(n)<0&&fI.call(e,n)&&(r[n]=e[n]);return r};const H0={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Rn("modal"),padding:"md",size:"md",shadow:"xl"};function $t(e){const t=q("ModalBase",H0,e),{opened:r,onClose:n,children:o,closeOnClickOutside:a,__staticSelector:i,transitionProps:l,withinPortal:c,portalProps:u,keepMounted:d,target:p,zIndex:h,lockScroll:m,trapFocus:v,closeOnEscape:g,returnFocus:_,padding:y,shadow:x,id:w,size:b,variant:O,classNames:C,unstyled:j,styles:E,className:T}=t,$=AQ(t,["opened","onClose","children","closeOnClickOutside","__staticSelector","transitionProps","withinPortal","portalProps","keepMounted","target","zIndex","lockScroll","trapFocus","closeOnEscape","returnFocus","padding","shadow","id","size","variant","classNames","unstyled","styles","className"]),{classes:I,cx:k}=TQ(null,{name:i,classNames:C,styles:E,unstyled:j,variant:O,size:b}),D=kr(w),[N,z]=f.useState(!1),[H,K]=f.useState(!1),R=typeof(l==null?void 0:l.duration)=="number"?l==null?void 0:l.duration:200,M=kQ({opened:r,transitionDuration:R});return Ug("keydown",B=>{!v&&B.key==="Escape"&&g&&n()}),CE({opened:r,shouldReturnFocus:v&&_}),S.createElement(ks,FS(dg({},u),{withinPortal:c,target:p}),S.createElement(OG,{value:{__staticSelector:i,opened:r,onClose:n,closeOnClickOutside:a,transitionProps:FS(dg({},l),{duration:R,keepMounted:d}),zIndex:h,padding:y,id:D,getTitleId:()=>`${D}-title`,getBodyId:()=>`${D}-body`,titleMounted:N,bodyMounted:H,setTitleMounted:z,setBodyMounted:K,trapFocus:v,closeOnEscape:g,shadow:x,stylesApi:{name:i,size:b,variant:O,classNames:C,styles:E,unstyled:j}}},S.createElement(NA,{enabled:M&&m},S.createElement(oe,dg({className:k(I.root,T)},$),o))))}$t.CloseButton=IG;$t.Overlay=tQ;$t.Content=sQ;$t.Header=hQ;$t.Title=bQ;$t.Body=EQ;$t.NativeScrollArea=$Q;const MQ={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 LQ=Object.defineProperty,zQ=Object.defineProperties,FQ=Object.getOwnPropertyDescriptors,Qf=Object.getOwnPropertySymbols,pI=Object.prototype.hasOwnProperty,hI=Object.prototype.propertyIsEnumerable,VS=(e,t,r)=>t in e?LQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,VQ=(e,t)=>{for(var r in t||(t={}))pI.call(t,r)&&VS(e,r,t[r]);if(Qf)for(var r of Qf(t))hI.call(t,r)&&VS(e,r,t[r]);return e},BQ=(e,t)=>zQ(e,FQ(t)),UQ=(e,t)=>{var r={};for(var n in e)pI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qf)for(var n of Qf(e))t.indexOf(n)<0&&hI.call(e,n)&&(r[n]=e[n]);return r};const WQ={},Kf=f.forwardRef((e,t)=>{const r=q("Flex",WQ,e),{gap:n,rowGap:o,columnGap:a,align:i,justify:l,wrap:c,direction:u,sx:d}=r,p=UQ(r,["gap","rowGap","columnGap","align","justify","wrap","direction","sx"]);return S.createElement(oe,BQ(VQ({},p),{sx:[{display:"flex"},h=>Wg({gap:n,rowGap:o,columnGap:a,align:i,justify:l,wrap:c,direction:u},h,MQ),...lc(d)],ref:t}))});Kf.displayName="@mantine/core/Flex";const[HQ,qQ]=Po("Grid component was not found in tree");var GQ=Object.defineProperty,BS=Object.getOwnPropertySymbols,QQ=Object.prototype.hasOwnProperty,KQ=Object.prototype.propertyIsEnumerable,US=(e,t,r)=>t in e?GQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YQ=(e,t)=>{for(var r in t||(t={}))QQ.call(t,r)&&US(e,r,t[r]);if(BS)for(var r of BS(t))KQ.call(t,r)&&US(e,r,t[r]);return e};const q0=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,mI=(e,t,r)=>r||e==="auto"||e==="content"?"unset":q0(e,t),gI=(e,t)=>{if(e)return e==="auto"||t?1:0},vI=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,yI=(e,t)=>typeof e<"u"?`calc(${A({size:e,sizes:t.spacing})} / 2)`:void 0;function XQ({sizes:e,offsets:t,orders:r,theme:n,columns:o,gutters:a,grow:i}){return aE.reduce((l,c)=>(l[`@media (min-width: ${nr(n.breakpoints[c])})`]={order:r[c],flexBasis:q0(e[c],o),padding:yI(a[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:mI(e[c],o,i),marginLeft:vI(t[c],o),flexGrow:gI(e[c],i)},l),{})}var JQ=W((e,{gutter:t,gutterXs:r,gutterSm:n,gutterMd:o,gutterLg:a,gutterXl:i,grow:l,offset:c,offsetXs:u,offsetSm:d,offsetMd:p,offsetLg:h,offsetXl:m,columns:v,span:g,xs:_,sm:y,md:x,lg:w,xl:b,order:O,orderXs:C,orderSm:j,orderMd:E,orderLg:T,orderXl:$})=>({col:YQ({boxSizing:"border-box",flexGrow:gI(g,l),order:O,padding:yI(t,e),marginLeft:vI(c,v),flexBasis:q0(g,v),flexShrink:0,width:g==="content"?"auto":void 0,maxWidth:mI(g,v,l)},XQ({sizes:{xs:_,sm:y,md:x,lg:w,xl:b},offsets:{xs:u,sm:d,md:p,lg:h,xl:m},orders:{xs:C,sm:j,md:E,lg:T,xl:$},gutters:{xs:r,sm:n,md:o,lg:a,xl:i},theme:e,columns:v,grow:l}))}));const ZQ=JQ;var eK=Object.defineProperty,Yf=Object.getOwnPropertySymbols,xI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,WS=(e,t,r)=>t in e?eK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tK=(e,t)=>{for(var r in t||(t={}))xI.call(t,r)&&WS(e,r,t[r]);if(Yf)for(var r of Yf(t))wI.call(t,r)&&WS(e,r,t[r]);return e},rK=(e,t)=>{var r={};for(var n in e)xI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yf)for(var n of Yf(e))t.indexOf(n)<0&&wI.call(e,n)&&(r[n]=e[n]);return r};const nK={};function oK(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const bI=f.forwardRef((e,t)=>{const r=q("GridCol",nK,e),{children:n,span:o,offset:a,offsetXs:i,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:_,orderXs:y,orderSm:x,orderMd:w,orderLg:b,orderXl:O,className:C,unstyled:j,variant:E}=r,T=rK(r,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","unstyled","variant"]),$=qQ(),I=o||$.columns,{classes:k,cx:D}=ZQ({gutter:$.gutter,gutterXs:$.gutterXs,gutterSm:$.gutterSm,gutterMd:$.gutterMd,gutterLg:$.gutterLg,gutterXl:$.gutterXl,offset:a,offsetXs:i,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:m,lg:v,xl:g,order:_,orderXs:y,orderSm:x,orderMd:w,orderLg:b,orderXl:O,grow:$.grow,columns:$.columns,span:I},{unstyled:j,name:"Grid",variant:E});return!oK(I)||I>$.columns?null:S.createElement(oe,tK({className:D(k.col,C),ref:t},T),n)});bI.displayName="@mantine/core/Col";var aK=Object.defineProperty,HS=Object.getOwnPropertySymbols,iK=Object.prototype.hasOwnProperty,sK=Object.prototype.propertyIsEnumerable,qS=(e,t,r)=>t in e?aK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lK=(e,t)=>{for(var r in t||(t={}))iK.call(t,r)&&qS(e,r,t[r]);if(HS)for(var r of HS(t))sK.call(t,r)&&qS(e,r,t[r]);return e};function cK(e,t){return aE.reduce((r,n)=>(typeof e[n]<"u"&&(r[`@media (min-width: ${t.breakpoints[n]})`]={margin:`calc(-${A({size:e[n],sizes:t.spacing})} / 2)`}),r),{})}var uK=W((e,{justify:t,align:r,gutter:n,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c})=>({root:lK({margin:`calc(-${A({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:r},cK({xs:o,sm:a,md:i,lg:l,xl:c},e))}));const dK=uK;var fK=Object.defineProperty,Xf=Object.getOwnPropertySymbols,_I=Object.prototype.hasOwnProperty,SI=Object.prototype.propertyIsEnumerable,GS=(e,t,r)=>t in e?fK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pK=(e,t)=>{for(var r in t||(t={}))_I.call(t,r)&&GS(e,r,t[r]);if(Xf)for(var r of Xf(t))SI.call(t,r)&&GS(e,r,t[r]);return e},hK=(e,t)=>{var r={};for(var n in e)_I.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Xf)for(var n of Xf(e))t.indexOf(n)<0&&SI.call(e,n)&&(r[n]=e[n]);return r};const mK={gutter:"md",justify:"flex-start",align:"stretch",columns:12},nn=f.forwardRef((e,t)=>{const r=q("Grid",mK,e),{gutter:n,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c,children:u,grow:d,justify:p,align:h,columns:m,className:v,unstyled:g,variant:_}=r,y=hK(r,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","unstyled","variant"]),{classes:x,cx:w}=dK({gutter:n,justify:p,align:h,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c},{unstyled:g,name:"Grid",variant:_});return S.createElement(HQ,{value:{gutter:n,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c,grow:d,columns:m}},S.createElement(oe,pK({className:w(x.root,v),ref:t},y),u))});nn.Col=bI;nn.displayName="@mantine/core/Grid";function gK(e){return f.Children.toArray(e).filter(Boolean)}const PI={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var vK=W((e,{spacing:t,position:r,noWrap:n,grow:o,align:a,count:i})=>({root:{boxSizing:"border-box",display:"flex",flexDirection:"row",alignItems:a||"center",flexWrap:n?"nowrap":"wrap",justifyContent:PI[r],gap:A({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/i}% - (${P(A({size:t,sizes:e.spacing}))} - ${A({size:t,sizes:e.spacing})} / ${i}))`:void 0,flexGrow:o?1:0}}}));const yK=vK;var xK=Object.defineProperty,Jf=Object.getOwnPropertySymbols,jI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,QS=(e,t,r)=>t in e?xK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wK=(e,t)=>{for(var r in t||(t={}))jI.call(t,r)&&QS(e,r,t[r]);if(Jf)for(var r of Jf(t))OI.call(t,r)&&QS(e,r,t[r]);return e},bK=(e,t)=>{var r={};for(var n in e)jI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jf)for(var n of Jf(e))t.indexOf(n)<0&&OI.call(e,n)&&(r[n]=e[n]);return r};const _K={position:"left",spacing:"md"},J=f.forwardRef((e,t)=>{const r=q("Group",_K,e),{className:n,position:o,align:a,children:i,noWrap:l,grow:c,spacing:u,unstyled:d,variant:p}=r,h=bK(r,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),m=gK(i),{classes:v,cx:g}=yK({align:a,grow:c,noWrap:l,spacing:u,position:o,count:m.length},{unstyled:d,name:"Group",variant:p});return S.createElement(oe,wK({className:g(v.root,n),ref:t},h),m)});J.displayName="@mantine/core/Group";function SK({open:e,close:t,openDelay:r,closeDelay:n}){const o=f.useRef(-1),a=f.useRef(-1),i=()=>{window.clearTimeout(o.current),window.clearTimeout(a.current)},l=()=>{i(),r===0?e():o.current=window.setTimeout(e,r)},c=()=>{i(),n===0?t():a.current=window.setTimeout(t,n)};return f.useEffect(()=>i,[]),{openDropdown:l,closeDropdown:c}}function KS(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var PK=W((e,t,{size:r})=>({input:{fontFamily:e.fontFamilyMonospace,fontSize:`calc(${A({size:r,sizes:e.fontSizes})} - ${P(2)})`}}));const jK=PK;function G0(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var OK=f.useLayoutEffect,CK=function(t){var r=f.useRef(t);return OK(function(){r.current=t}),r},YS=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},EK=function(t,r){var n=f.useRef();return f.useCallback(function(o){t.current=o,n.current&&YS(n.current,null),n.current=r,r&&YS(r,o)},[r])},XS={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},JS=function(t){Object.keys(XS).forEach(function(r){t.style.setProperty(r,XS[r],"important")})},Mr=null,$K=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function kK(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Mr||(Mr=document.createElement("textarea"),Mr.setAttribute("tabindex","-1"),Mr.setAttribute("aria-hidden","true"),JS(Mr)),Mr.parentNode===null&&document.body.appendChild(Mr);var o=e.paddingSize,a=e.borderSize,i=e.sizingStyle,l=i.boxSizing;Object.keys(i).forEach(function(h){var m=h;Mr.style[m]=i[m]}),JS(Mr),Mr.value=t;var c=$K(Mr,e);Mr.value="x";var u=Mr.scrollHeight-o,d=u*r;l==="border-box"&&(d=d+o+a),c=Math.max(d,c);var p=u*n;return l==="border-box"&&(p=p+o+a),c=Math.min(p,c),[c,u]}var ZS=function(){},RK=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},TK=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],IK=!!document.documentElement.currentStyle,DK=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=RK(TK,r),o=n.boxSizing;if(o==="")return null;IK&&o==="border-box"&&(n.width=parseFloat(n.width)+parseFloat(n.borderRightWidth)+parseFloat(n.borderLeftWidth)+parseFloat(n.paddingRight)+parseFloat(n.paddingLeft)+"px");var a=parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),i=parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth);return{sizingStyle:n,paddingSize:a,borderSize:i}},NK=function(t){var r=CK(t);f.useLayoutEffect(function(){var n=function(a){r.current(a)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[])},AK=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,a=t.minRows,i=t.onChange,l=i===void 0?ZS:i,c=t.onHeightChange,u=c===void 0?ZS:c,d=G0(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),p=d.value!==void 0,h=f.useRef(null),m=EK(h,r),v=f.useRef(0),g=f.useRef(),_=function(){var w=h.current,b=n&&g.current?g.current:DK(w);if(b){g.current=b;var O=kK(b,w.value||w.placeholder||"x",a,o),C=O[0],j=O[1];v.current!==C&&(v.current=C,w.style.setProperty("height",C+"px","important"),u(C,{rowHeight:j}))}},y=function(w){p||_(),l(w)};return f.useLayoutEffect(_),NK(_),f.createElement("textarea",tt({},d,{onChange:y,ref:m}))},MK=f.forwardRef(AK);const LK=MK;var zK=W(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const FK=zK;var VK=Object.defineProperty,BK=Object.defineProperties,UK=Object.getOwnPropertyDescriptors,Zf=Object.getOwnPropertySymbols,CI=Object.prototype.hasOwnProperty,EI=Object.prototype.propertyIsEnumerable,eP=(e,t,r)=>t in e?VK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pi=(e,t)=>{for(var r in t||(t={}))CI.call(t,r)&&eP(e,r,t[r]);if(Zf)for(var r of Zf(t))EI.call(t,r)&&eP(e,r,t[r]);return e},fg=(e,t)=>BK(e,UK(t)),WK=(e,t)=>{var r={};for(var n in e)CI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Zf)for(var n of Zf(e))t.indexOf(n)<0&&EI.call(e,n)&&(r[n]=e[n]);return r};const HK={autosize:!1,size:"sm",__staticSelector:"Textarea"},_c=f.forwardRef((e,t)=>{const r=q("Textarea",HK,e),{autosize:n,maxRows:o,minRows:a,label:i,error:l,description:c,id:u,className:d,required:p,style:h,wrapperProps:m,classNames:v,styles:g,size:_,__staticSelector:y,sx:x,errorProps:w,descriptionProps:b,labelProps:O,inputWrapperOrder:C,inputContainer:j,unstyled:E,withAsterisk:T,variant:$}=r,I=WK(r,["autosize","maxRows","minRows","label","error","description","id","className","required","style","wrapperProps","classNames","styles","size","__staticSelector","sx","errorProps","descriptionProps","labelProps","inputWrapperOrder","inputContainer","unstyled","withAsterisk","variant"]),k=kr(u),{classes:D,cx:N}=FK(),{systemStyles:z,rest:H}=Jn(I),K=Pi({required:p,ref:t,error:l,id:k,classNames:fg(Pi({},v),{input:N(D.input,v==null?void 0:v.input)}),styles:g,__staticSelector:y,size:_,multiline:!0,unstyled:E,variant:$},H);return S.createElement(Vt.Wrapper,Pi(Pi({label:i,error:l,id:k,description:c,required:p,style:h,className:d,classNames:v,styles:g,size:_,__staticSelector:y,sx:x,errorProps:w,labelProps:O,descriptionProps:b,inputContainer:j,inputWrapperOrder:C,unstyled:E,withAsterisk:T,variant:$},z),m),n?S.createElement(Vt,fg(Pi({},K),{component:LK,maxRows:o,minRows:a})):S.createElement(Vt,fg(Pi({},K),{component:"textarea",rows:a})))});_c.displayName="@mantine/core/Textarea";var qK=Object.defineProperty,GK=Object.defineProperties,QK=Object.getOwnPropertyDescriptors,ep=Object.getOwnPropertySymbols,$I=Object.prototype.hasOwnProperty,kI=Object.prototype.propertyIsEnumerable,tP=(e,t,r)=>t in e?qK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rP=(e,t)=>{for(var r in t||(t={}))$I.call(t,r)&&tP(e,r,t[r]);if(ep)for(var r of ep(t))kI.call(t,r)&&tP(e,r,t[r]);return e},KK=(e,t)=>GK(e,QK(t)),YK=(e,t)=>{var r={};for(var n in e)$I.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ep)for(var n of ep(e))t.indexOf(n)<0&&kI.call(e,n)&&(r[n]=e[n]);return r};const XK={formatOnBlur:!1,size:"sm",serialize:JSON.stringify,deserialize:JSON.parse},Is=f.forwardRef((e,t)=>{const r=q("JsonInput",XK,e),{value:n,defaultValue:o,onChange:a,onFocus:i,onBlur:l,error:c,formatOnBlur:u,size:d,validationError:p,classNames:h,unstyled:m,readOnly:v,variant:g,serialize:_,deserialize:y}=r,x=YK(r,["value","defaultValue","onChange","onFocus","onBlur","error","formatOnBlur","size","validationError","classNames","unstyled","readOnly","variant","serialize","deserialize"]),{classes:w,cx:b}=jK(null,{name:"JsonInput",unstyled:m,size:d,variant:g}),[O,C]=Er({value:n,defaultValue:o,finalValue:"",onChange:a}),[j,E]=f.useState(KS(O,y)),T=I=>{typeof i=="function"&&i(I),E(!0)},$=I=>{typeof l=="function"&&l(I);const k=KS(I.currentTarget.value,y);u&&!v&&k&&I.currentTarget.value.trim()!==""&&C(_(y(I.currentTarget.value),null,2)),E(k)};return S.createElement(_c,rP({value:O,onChange:I=>C(I.currentTarget.value),onFocus:T,onBlur:$,error:j?c:p||!0,__staticSelector:"JsonInput",classNames:KK(rP({},h),{input:b(w.input,h==null?void 0:h.input)}),autoComplete:"off",ref:t,unstyled:m,readOnly:v,size:d,variant:g},x))});Is.displayName="@mantine/core/JsonInput";const[JK,ZK]=Po("List component was not found in tree");var eY=W((e,{spacing:t,center:r})=>({itemWrapper:{ref:zt("itemWrapper"),display:"inline-flex",flexDirection:"column",whiteSpace:"normal"},item:{whiteSpace:"nowrap",lineHeight:r?1:e.lineHeight,"&:not(:first-of-type)":{marginTop:A({size:t,sizes:e.spacing})},"&[data-with-icon]":{listStyle:"none",[`& .${zt("itemWrapper")}`]:{display:"inline-flex",alignItems:r?"center":"flex-start",flexDirection:"row"}}},itemIcon:{display:"inline-block",verticalAlign:"middle",marginRight:e.spacing.sm}}));const tY=eY;var rY=Object.defineProperty,tp=Object.getOwnPropertySymbols,RI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,nP=(e,t,r)=>t in e?rY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nY=(e,t)=>{for(var r in t||(t={}))RI.call(t,r)&&nP(e,r,t[r]);if(tp)for(var r of tp(t))TI.call(t,r)&&nP(e,r,t[r]);return e},oY=(e,t)=>{var r={};for(var n in e)RI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&tp)for(var n of tp(e))t.indexOf(n)<0&&TI.call(e,n)&&(r[n]=e[n]);return r};const aY={},II=f.forwardRef((e,t)=>{const r=q("ListItem",aY,e),{className:n,children:o,icon:a}=r,i=oY(r,["className","children","icon"]),{icon:l,spacing:c,center:u,listStyleType:d,size:p,withPadding:h,classNames:m,styles:v,unstyled:g,variant:_}=ZK(),y=a||l,{classes:x,cx:w}=tY({withPadding:h,listStyleType:d,center:u,spacing:c},{classNames:m,styles:v,unstyled:g,name:"List",variant:_,size:p});return S.createElement(oe,nY({component:"li",className:w(x.item,n),"data-with-icon":!!y||void 0,ref:t},i),S.createElement("div",{className:x.itemWrapper},y&&S.createElement("span",{className:x.itemIcon},y),S.createElement("span",null,o)))});II.displayName="@mantine/core/ListItem";var iY=Object.defineProperty,sY=Object.defineProperties,lY=Object.getOwnPropertyDescriptors,oP=Object.getOwnPropertySymbols,cY=Object.prototype.hasOwnProperty,uY=Object.prototype.propertyIsEnumerable,aP=(e,t,r)=>t in e?iY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dY=(e,t)=>{for(var r in t||(t={}))cY.call(t,r)&&aP(e,r,t[r]);if(oP)for(var r of oP(t))uY.call(t,r)&&aP(e,r,t[r]);return e},fY=(e,t)=>sY(e,lY(t)),pY=W((e,{withPadding:t,listStyleType:r},{size:n})=>({root:fY(dY({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:A({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const hY=pY;var mY=Object.defineProperty,rp=Object.getOwnPropertySymbols,DI=Object.prototype.hasOwnProperty,NI=Object.prototype.propertyIsEnumerable,iP=(e,t,r)=>t in e?mY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gY=(e,t)=>{for(var r in t||(t={}))DI.call(t,r)&&iP(e,r,t[r]);if(rp)for(var r of rp(t))NI.call(t,r)&&iP(e,r,t[r]);return e},vY=(e,t)=>{var r={};for(var n in e)DI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&rp)for(var n of rp(e))t.indexOf(n)<0&&NI.call(e,n)&&(r[n]=e[n]);return r};const yY={type:"unordered",size:"md",spacing:0},Sr=f.forwardRef((e,t)=>{const r=q("List",yY,e),{children:n,type:o,size:a,listStyleType:i,withPadding:l,center:c,spacing:u,icon:d,className:p,styles:h,classNames:m,unstyled:v,variant:g}=r,_=vY(r,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:y,cx:x}=hY({withPadding:l,listStyleType:i,center:c,spacing:u},{classNames:m,styles:h,name:"List",unstyled:v,size:a,variant:g});return S.createElement(JK,{value:{spacing:u,center:c,icon:d,listStyleType:i,size:a,withPadding:l,classNames:m,styles:h,unstyled:v,variant:g}},S.createElement(oe,gY({component:o==="unordered"?"ul":"ol",className:x(y.root,p),ref:t},_),n))});Sr.Item=II;Sr.displayName="@mantine/core/List";var xY=Object.defineProperty,wY=Object.defineProperties,bY=Object.getOwnPropertyDescriptors,sP=Object.getOwnPropertySymbols,_Y=Object.prototype.hasOwnProperty,SY=Object.prototype.propertyIsEnumerable,lP=(e,t,r)=>t in e?xY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,PY=(e,t)=>{for(var r in t||(t={}))_Y.call(t,r)&&lP(e,r,t[r]);if(sP)for(var r of sP(t))SY.call(t,r)&&lP(e,r,t[r]);return e},jY=(e,t)=>wY(e,bY(t)),OY=W(e=>({root:jY(PY({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const CY=OY;var EY=Object.defineProperty,$Y=Object.defineProperties,kY=Object.getOwnPropertyDescriptors,np=Object.getOwnPropertySymbols,AI=Object.prototype.hasOwnProperty,MI=Object.prototype.propertyIsEnumerable,cP=(e,t,r)=>t in e?EY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cu=(e,t)=>{for(var r in t||(t={}))AI.call(t,r)&&cP(e,r,t[r]);if(np)for(var r of np(t))MI.call(t,r)&&cP(e,r,t[r]);return e},RY=(e,t)=>$Y(e,kY(t)),TY=(e,t)=>{var r={};for(var n in e)AI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&np)for(var n of np(e))t.indexOf(n)<0&&MI.call(e,n)&&(r[n]=e[n]);return r};const IY={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:Rn("overlay")},LI=f.forwardRef((e,t)=>{const r=q("LoadingOverlay",IY,e),{className:n,visible:o,loaderProps:a,overlayOpacity:i,overlayColor:l,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:p,loader:h,radius:m,overlayBlur:v,unstyled:g,variant:_,keepMounted:y}=r,x=TY(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:w,cx:b,theme:O}=CY(null,{name:"LoadingOverlay",unstyled:g,variant:_}),C=`calc(${d} + 1)`;return S.createElement(si,{keepMounted:y,duration:c,exitDuration:u,mounted:o,transition:"fade"},j=>S.createElement(oe,Cu({className:b(w.root,n),style:RY(Cu(Cu({},j),p),{zIndex:d}),ref:t},x),h?S.createElement("div",{style:{zIndex:C}},h):S.createElement(dn,Cu({style:{zIndex:C}},a)),S.createElement(eI,{opacity:i,zIndex:d,radius:m,blur:v,unstyled:g,color:l||(O.colorScheme==="dark"?O.colors.dark[5]:O.white)})))});LI.displayName="@mantine/core/LoadingOverlay";const zI={context:"Menu component was not found in the tree",children:"Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported"},[DY,Sc]=Po(zI.context);var NY=W(e=>({divider:{marginTop:P(4),marginBottom:P(4),borderTop:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const AY=NY;var MY=Object.defineProperty,op=Object.getOwnPropertySymbols,FI=Object.prototype.hasOwnProperty,VI=Object.prototype.propertyIsEnumerable,uP=(e,t,r)=>t in e?MY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LY=(e,t)=>{for(var r in t||(t={}))FI.call(t,r)&&uP(e,r,t[r]);if(op)for(var r of op(t))VI.call(t,r)&&uP(e,r,t[r]);return e},zY=(e,t)=>{var r={};for(var n in e)FI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&op)for(var n of op(e))t.indexOf(n)<0&&VI.call(e,n)&&(r[n]=e[n]);return r};const FY={},BI=f.forwardRef((e,t)=>{const r=q("MenuDivider",FY,e),{children:n,className:o}=r,a=zY(r,["children","className"]),{classNames:i,styles:l,unstyled:c,variant:u}=Sc(),{classes:d,cx:p}=AY(null,{name:"Menu",classNames:i,styles:l,unstyled:c,variant:u});return S.createElement(oe,LY({className:p(d.divider,o),ref:t},a))});BI.displayName="@mantine/core/MenuDivider";var VY=Object.defineProperty,ap=Object.getOwnPropertySymbols,UI=Object.prototype.hasOwnProperty,WI=Object.prototype.propertyIsEnumerable,dP=(e,t,r)=>t in e?VY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BY=(e,t)=>{for(var r in t||(t={}))UI.call(t,r)&&dP(e,r,t[r]);if(ap)for(var r of ap(t))WI.call(t,r)&&dP(e,r,t[r]);return e},UY=(e,t)=>{var r={};for(var n in e)UI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ap)for(var n of ap(e))t.indexOf(n)<0&&WI.call(e,n)&&(r[n]=e[n]);return r};const WY={};function HI(e){const t=q("MenuDropdown",WY,e),{children:r,onMouseEnter:n,onMouseLeave:o}=t,a=UY(t,["children","onMouseEnter","onMouseLeave"]),i=f.useRef(),l=Sc(),c=p=>{var h;(p.key==="ArrowUp"||p.key==="ArrowDown")&&(p.preventDefault(),(h=i.current.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||h.focus())},u=zr(n,()=>l.trigger==="hover"&&l.openDropdown()),d=zr(o,()=>l.trigger==="hover"&&l.closeDropdown());return S.createElement(Eo.Dropdown,BY({onMouseEnter:u,onMouseLeave:d,role:"menu","aria-orientation":"vertical"},a),S.createElement("div",{tabIndex:-1,"data-menu-dropdown":!0,"data-autofocus":!0,onKeyDown:c,ref:i,style:{outline:0}},r))}HI.displayName="@mantine/core/MenuDropdown";var HY=Object.defineProperty,qY=Object.defineProperties,GY=Object.getOwnPropertyDescriptors,fP=Object.getOwnPropertySymbols,QY=Object.prototype.hasOwnProperty,KY=Object.prototype.propertyIsEnumerable,pP=(e,t,r)=>t in e?HY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YY=(e,t)=>{for(var r in t||(t={}))QY.call(t,r)&&pP(e,r,t[r]);if(fP)for(var r of fP(t))KY.call(t,r)&&pP(e,r,t[r]);return e},XY=(e,t)=>qY(e,GY(t)),JY=W((e,{color:t,radius:r})=>({item:XY(YY({},e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",fontSize:e.fontSizes.sm,border:0,backgroundColor:"transparent",outline:0,width:"100%",textAlign:"left",textDecoration:"none",boxSizing:"border-box",padding:`${e.spacing.xs} ${e.spacing.sm}`,cursor:"pointer",borderRadius:e.fn.radius(r),color:t?e.fn.variant({variant:"filled",primaryFallback:!1,color:t}).background:e.colorScheme==="dark"?e.colors.dark[0]:e.black,display:"flex",alignItems:"center","&:disabled":{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5],pointerEvents:"none",userSelect:"none"},"&[data-hovered]":{backgroundColor:t?e.fn.variant({variant:"light",color:t}).background:e.colorScheme==="dark"?e.fn.rgba(e.colors.dark[3],.35):e.colors.gray[1]}}),itemLabel:{flex:1},itemIcon:{display:"flex",justifyContent:"center",alignItems:"center",marginRight:e.spacing.xs},itemRightSection:{}}));const ZY=JY;var eX=Object.defineProperty,tX=Object.defineProperties,rX=Object.getOwnPropertyDescriptors,ip=Object.getOwnPropertySymbols,qI=Object.prototype.hasOwnProperty,GI=Object.prototype.propertyIsEnumerable,hP=(e,t,r)=>t in e?eX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nX=(e,t)=>{for(var r in t||(t={}))qI.call(t,r)&&hP(e,r,t[r]);if(ip)for(var r of ip(t))GI.call(t,r)&&hP(e,r,t[r]);return e},oX=(e,t)=>tX(e,rX(t)),aX=(e,t)=>{var r={};for(var n in e)qI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ip)for(var n of ip(e))t.indexOf(n)<0&&GI.call(e,n)&&(r[n]=e[n]);return r};const iX={},QI=f.forwardRef((e,t)=>{const r=q("MenuItem",iX,e),{children:n,className:o,color:a,closeMenuOnClick:i,icon:l,rightSection:c}=r,u=aX(r,["children","className","color","closeMenuOnClick","icon","rightSection"]),d=Sc(),{classes:p,cx:h,theme:m}=ZY({radius:d.radius,color:a},{name:"Menu",classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),v=f.useRef(),g=d.getItemIndex(v.current),_=u,y=zr(_.onMouseLeave,()=>d.setHovered(-1)),x=zr(_.onMouseEnter,()=>d.setHovered(d.getItemIndex(v.current))),w=zr(_.onClick,()=>{typeof i=="boolean"?i&&d.closeDropdownImmediately():d.closeOnItemClick&&d.closeDropdownImmediately()}),b=zr(_.onFocus,()=>d.setHovered(d.getItemIndex(v.current)));return S.createElement(oe,oX(nX({component:"button",type:"button"},u),{tabIndex:-1,onFocus:b,className:h(p.item,o),ref:Cs(v,t),role:"menuitem","data-menu-item":!0,"data-hovered":d.hovered===g?!0:void 0,onMouseEnter:x,onMouseLeave:y,onClick:w,onKeyDown:JC({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:d.loop,dir:m.dir,orientation:"vertical",onKeyDown:_.onKeydown})}),l&&S.createElement("div",{className:p.itemIcon},l),n&&S.createElement("div",{className:p.itemLabel},n),c&&S.createElement("div",{className:p.itemRightSection},c))});QI.displayName="@mantine/core/MenuItem";const sX=QI;var lX=W(e=>({label:{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontWeight:500,fontSize:e.fontSizes.xs,padding:`calc(${e.spacing.xs} / 2) ${e.spacing.sm}`,cursor:"default"}}));const cX=lX;var uX=Object.defineProperty,sp=Object.getOwnPropertySymbols,KI=Object.prototype.hasOwnProperty,YI=Object.prototype.propertyIsEnumerable,mP=(e,t,r)=>t in e?uX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dX=(e,t)=>{for(var r in t||(t={}))KI.call(t,r)&&mP(e,r,t[r]);if(sp)for(var r of sp(t))YI.call(t,r)&&mP(e,r,t[r]);return e},fX=(e,t)=>{var r={};for(var n in e)KI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sp)for(var n of sp(e))t.indexOf(n)<0&&YI.call(e,n)&&(r[n]=e[n]);return r};const pX={},XI=f.forwardRef((e,t)=>{const r=q("MenuLabel",pX,e),{children:n,className:o}=r,a=fX(r,["children","className"]),{classNames:i,styles:l,unstyled:c,variant:u}=Sc(),{classes:d,cx:p}=cX(null,{name:"Menu",classNames:i,styles:l,unstyled:c,variant:u});return S.createElement(te,dX({className:p(d.label,o),ref:t},a),n)});XI.displayName="@mantine/core/MenuLabel";var hX=Object.defineProperty,lp=Object.getOwnPropertySymbols,JI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,gP=(e,t,r)=>t in e?hX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mX=(e,t)=>{for(var r in t||(t={}))JI.call(t,r)&&gP(e,r,t[r]);if(lp)for(var r of lp(t))ZI.call(t,r)&&gP(e,r,t[r]);return e},gX=(e,t)=>{var r={};for(var n in e)JI.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&lp)for(var n of lp(e))t.indexOf(n)<0&&ZI.call(e,n)&&(r[n]=e[n]);return r};const vX={refProp:"ref"},eD=f.forwardRef((e,t)=>{const r=q("MenuTarget",vX,e),{children:n,refProp:o}=r,a=gX(r,["children","refProp"]);if(!js(n))throw new Error(zI.children);const i=Sc(),l=zr(n.props.onClick,()=>i.trigger==="click"&&i.toggleDropdown()),c=zr(n.props.onMouseEnter,()=>i.trigger==="hover"&&i.openDropdown()),u=zr(n.props.onMouseLeave,()=>i.trigger==="hover"&&i.closeDropdown());return S.createElement(Eo.Target,mX({refProp:o,popupType:"menu",ref:t},a),f.cloneElement(n,{onClick:l,onMouseEnter:c,onMouseLeave:u,"data-expanded":i.opened?!0:void 0}))});eD.displayName="@mantine/core/MenuTarget";var yX=W({dropdown:{padding:P(4)}});const xX=yX;var wX=Object.defineProperty,bX=Object.defineProperties,_X=Object.getOwnPropertyDescriptors,cp=Object.getOwnPropertySymbols,tD=Object.prototype.hasOwnProperty,rD=Object.prototype.propertyIsEnumerable,vP=(e,t,r)=>t in e?wX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yP=(e,t)=>{for(var r in t||(t={}))tD.call(t,r)&&vP(e,r,t[r]);if(cp)for(var r of cp(t))rD.call(t,r)&&vP(e,r,t[r]);return e},xP=(e,t)=>bX(e,_X(t)),SX=(e,t)=>{var r={};for(var n in e)tD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&cp)for(var n of cp(e))t.indexOf(n)<0&&rD.call(e,n)&&(r[n]=e[n]);return r};const PX={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function X(e){const t=q("Menu",PX,e),{children:r,onOpen:n,onClose:o,opened:a,defaultOpened:i,onChange:l,closeOnItemClick:c,loop:u,closeOnEscape:d,trigger:p,openDelay:h,closeDelay:m,classNames:v,styles:g,unstyled:_,radius:y,variant:x}=t,w=SX(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:b,cx:O}=xX(),[C,{setHovered:j,resetHovered:E}]=BA(),[T,$]=Er({value:a,defaultValue:i,finalValue:!1,onChange:l}),I=()=>{$(!1),T&&(o==null||o())},k=()=>{$(!0),!T&&(n==null||n())},D=()=>T?I():k(),{openDropdown:N,closeDropdown:z}=SK({open:k,close:I,closeDelay:m,openDelay:h}),H=K=>zA("[data-menu-item]","[data-menu-dropdown]",K);return on(()=>{E()},[T]),S.createElement(DY,{value:{opened:T,toggleDropdown:D,getItemIndex:H,hovered:C,setHovered:j,closeOnItemClick:c,closeDropdown:p==="click"?I:z,openDropdown:p==="click"?k:N,closeDropdownImmediately:I,loop:u,trigger:p,radius:y,classNames:v,styles:g,unstyled:_,variant:x}},S.createElement(Eo,xP(yP({},w),{radius:y,opened:T,onChange:D,defaultOpened:i,trapFocus:p==="click",closeOnEscape:d&&p==="click",__staticSelector:"Menu",classNames:xP(yP({},v),{dropdown:O(b.dropdown,v==null?void 0:v.dropdown)}),styles:g,unstyled:_,variant:x}),r))}X.displayName="@mantine/core/Menu";X.Item=sX;X.Label=XI;X.Dropdown=HI;X.Target=eD;X.Divider=BI;const[jX,OX]=Po("Modal component was not found in tree"),CX={xs:P(320),sm:P(380),md:P(440),lg:P(620),xl:P(780)};var EX=W((e,{yOffset:t,xOffset:r,centered:n,fullScreen:o},{size:a})=>({content:{flex:o?"0 0 100%":`0 0 ${A({size:a,sizes:CX})}`,maxWidth:"100%",maxHeight:o?void 0:`calc(100dvh - (${P(t)} * 2))`,height:o?"100vh":void 0,borderRadius:o?0:void 0,overflowY:"auto"},inner:{paddingTop:o?0:t,paddingBottom:o?0:t,paddingLeft:o?0:r,paddingRight:o?0:r,display:"flex",justifyContent:"center",alignItems:n?"center":"flex-start"}}));const $X=EX;var kX=Object.defineProperty,RX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,nD=Object.prototype.hasOwnProperty,oD=Object.prototype.propertyIsEnumerable,wP=(e,t,r)=>t in e?kX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hv=(e,t)=>{for(var r in t||(t={}))nD.call(t,r)&&wP(e,r,t[r]);if(up)for(var r of up(t))oD.call(t,r)&&wP(e,r,t[r]);return e},aD=(e,t)=>RX(e,TX(t)),IX=(e,t)=>{var r={};for(var n in e)nD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&up)for(var n of up(e))t.indexOf(n)<0&&oD.call(e,n)&&(r[n]=e[n]);return r};const DX=aD(Hv({},H0),{yOffset:"5dvh",xOffset:"5vw"});function iD(e){const t=q("ModalRoot",DX,e),{classNames:r,variant:n,size:o,yOffset:a,xOffset:i,scrollAreaComponent:l,radius:c,centered:u,fullScreen:d}=t,p=IX(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:h,cx:m}=$X({yOffset:a,xOffset:i,centered:u,fullScreen:d},{name:"Modal",variant:n,size:o});return S.createElement(jX,{value:{yOffset:a,scrollAreaComponent:l,radius:c}},S.createElement($t,Hv({__staticSelector:"Modal",size:o,variant:n,classNames:aD(Hv({},r),{content:m(h.content,r==null?void 0:r.content),inner:m(h.inner,r==null?void 0:r.inner)})},p)))}var NX=Object.defineProperty,dp=Object.getOwnPropertySymbols,sD=Object.prototype.hasOwnProperty,lD=Object.prototype.propertyIsEnumerable,bP=(e,t,r)=>t in e?NX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AX=(e,t)=>{for(var r in t||(t={}))sD.call(t,r)&&bP(e,r,t[r]);if(dp)for(var r of dp(t))lD.call(t,r)&&bP(e,r,t[r]);return e},MX=(e,t)=>{var r={};for(var n in e)sD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&dp)for(var n of dp(e))t.indexOf(n)<0&&lD.call(e,n)&&(r[n]=e[n]);return r};const LX={shadow:"xl"},cD=f.forwardRef((e,t)=>{const r=q("ModalContent",LX,e),{children:n,scrollAreaComponent:o}=r,a=MX(r,["children","scrollAreaComponent"]),i=OX(),l=o||i.scrollAreaComponent||$t.NativeScrollArea;return S.createElement($t.Content,AX({ref:t,radius:i.radius},a),S.createElement(l,{style:{maxHeight:`calc(100dvh - (${P(i.yOffset)} * 2))`}},n))});var zX=Object.defineProperty,FX=Object.defineProperties,VX=Object.getOwnPropertyDescriptors,fp=Object.getOwnPropertySymbols,uD=Object.prototype.hasOwnProperty,dD=Object.prototype.propertyIsEnumerable,_P=(e,t,r)=>t in e?zX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,id=(e,t)=>{for(var r in t||(t={}))uD.call(t,r)&&_P(e,r,t[r]);if(fp)for(var r of fp(t))dD.call(t,r)&&_P(e,r,t[r]);return e},BX=(e,t)=>FX(e,VX(t)),UX=(e,t)=>{var r={};for(var n in e)uD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&fp)for(var n of fp(e))t.indexOf(n)<0&&dD.call(e,n)&&(r[n]=e[n]);return r};const WX=BX(id({},H0),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Rr(e){const t=q("Modal",WX,e),{title:r,withOverlay:n,overlayProps:o,withCloseButton:a,closeButtonProps:i,children:l}=t,c=UX(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!r||a;return S.createElement(iD,id({},c),n&&S.createElement($t.Overlay,id({},o)),S.createElement(cD,null,u&&S.createElement($t.Header,null,r&&S.createElement($t.Title,null,r),a&&S.createElement($t.CloseButton,id({},i))),S.createElement($t.Body,null,l)))}Rr.Root=iD;Rr.CloseButton=$t.CloseButton;Rr.Overlay=$t.Overlay;Rr.Content=cD;Rr.Header=$t.Header;Rr.Title=$t.Title;Rr.Body=$t.Body;Rr.NativeScrollArea=$t.NativeScrollArea;const fD={xs:P(16),sm:P(22),md:P(26),lg:P(30),xl:P(36)},HX={xs:P(10),sm:P(12),md:P(14),lg:P(16),xl:P(18)};var qX=W((e,{disabled:t,radius:r,readOnly:n},{size:o,variant:a})=>({defaultValue:{display:"flex",alignItems:"center",backgroundColor:t?e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3]:e.colorScheme==="dark"?e.colors.dark[7]:a==="filled"?e.white:e.colors.gray[1],color:t?e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],height:A({size:o,sizes:fD}),paddingLeft:`calc(${A({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||n?A({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:A({size:o,sizes:HX}),borderRadius:A({size:r,sizes:e.radius}),cursor:t?"not-allowed":"default",userSelect:"none",maxWidth:`calc(100% - ${P(10)})`},defaultValueRemove:{color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],marginLeft:`calc(${A({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),GX=Object.defineProperty,pp=Object.getOwnPropertySymbols,pD=Object.prototype.hasOwnProperty,hD=Object.prototype.propertyIsEnumerable,SP=(e,t,r)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QX=(e,t)=>{for(var r in t||(t={}))pD.call(t,r)&&SP(e,r,t[r]);if(pp)for(var r of pp(t))hD.call(t,r)&&SP(e,r,t[r]);return e},KX=(e,t)=>{var r={};for(var n in e)pD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pp)for(var n of pp(e))t.indexOf(n)<0&&hD.call(e,n)&&(r[n]=e[n]);return r};const YX={xs:16,sm:22,md:24,lg:26,xl:30};function mD(e){var t=e,{label:r,classNames:n,styles:o,className:a,onRemove:i,disabled:l,readOnly:c,size:u,radius:d="sm",variant:p,unstyled:h}=t,m=KX(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:v,cx:g}=qX({disabled:l,readOnly:c,radius:d},{name:"MultiSelect",classNames:n,styles:o,unstyled:h,size:u,variant:p});return S.createElement("div",QX({className:g(v.defaultValue,a)},m),S.createElement("span",{className:v.defaultValueLabel},r),!l&&!c&&S.createElement(vc,{"aria-hidden":!0,onMouseDown:i,size:YX[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:v.defaultValueRemove,tabIndex:-1,unstyled:h}))}mD.displayName="@mantine/core/MultiSelect/DefaultValue";function XX({data:e,searchable:t,limit:r,searchValue:n,filter:o,value:a,disableSelectedItemFiltering:i}){if(!t&&a.length===0)return e;if(!t){const c=[];for(let u=0;u<e.length;u+=1)(i||!a.some(d=>d===e[u].value&&!e[u].disabled))&&c.push(e[u]);return c}const l=[];for(let c=0;c<e.length&&(o(n,!i&&a.some(u=>u===e[c].value&&!e[c].disabled),e[c])&&l.push(e[c]),!(l.length>=r));c+=1);return l}var JX=Object.defineProperty,hp=Object.getOwnPropertySymbols,gD=Object.prototype.hasOwnProperty,vD=Object.prototype.propertyIsEnumerable,PP=(e,t,r)=>t in e?JX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jP=(e,t)=>{for(var r in t||(t={}))gD.call(t,r)&&PP(e,r,t[r]);if(hp)for(var r of hp(t))vD.call(t,r)&&PP(e,r,t[r]);return e},ZX=(e,t)=>{var r={};for(var n in e)gD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&hp)for(var n of hp(e))t.indexOf(n)<0&&vD.call(e,n)&&(r[n]=e[n]);return r};const eJ={xs:P(14),sm:P(18),md:P(20),lg:P(24),xl:P(28)};function tJ(e){var t=e,{size:r,error:n,style:o}=t,a=ZX(t,["size","error","style"]);const i=Kt(),l=A({size:r,sizes:eJ});return S.createElement("svg",jP({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:jP({color:n?i.colors.red[6]:i.colors.gray[6],width:l,height:l},o),"data-chevron":!0},a),S.createElement("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"}))}var rJ=Object.defineProperty,nJ=Object.defineProperties,oJ=Object.getOwnPropertyDescriptors,OP=Object.getOwnPropertySymbols,aJ=Object.prototype.hasOwnProperty,iJ=Object.prototype.propertyIsEnumerable,CP=(e,t,r)=>t in e?rJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sJ=(e,t)=>{for(var r in t||(t={}))aJ.call(t,r)&&CP(e,r,t[r]);if(OP)for(var r of OP(t))iJ.call(t,r)&&CP(e,r,t[r]);return e},lJ=(e,t)=>nJ(e,oJ(t));function yD({shouldClear:e,clearButtonProps:t,onClear:r,size:n,error:o}){return e?S.createElement(vc,lJ(sJ({},t),{variant:"transparent",onClick:r,size:n,onMouseDown:a=>a.preventDefault()})):S.createElement(tJ,{error:o,size:n})}yD.displayName="@mantine/core/SelectRightSection";var cJ=Object.defineProperty,uJ=Object.defineProperties,dJ=Object.getOwnPropertyDescriptors,mp=Object.getOwnPropertySymbols,xD=Object.prototype.hasOwnProperty,wD=Object.prototype.propertyIsEnumerable,EP=(e,t,r)=>t in e?cJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pg=(e,t)=>{for(var r in t||(t={}))xD.call(t,r)&&EP(e,r,t[r]);if(mp)for(var r of mp(t))wD.call(t,r)&&EP(e,r,t[r]);return e},$P=(e,t)=>uJ(e,dJ(t)),fJ=(e,t)=>{var r={};for(var n in e)xD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&mp)for(var n of mp(e))t.indexOf(n)<0&&wD.call(e,n)&&(r[n]=e[n]);return r};function bD(e){var t=e,{styles:r,rightSection:n,rightSectionWidth:o,theme:a}=t,i=fJ(t,["styles","rightSection","rightSectionWidth","theme"]);if(n)return{rightSection:n,rightSectionWidth:o,styles:r};const l=typeof r=="function"?r(a):r;return{rightSection:!i.readOnly&&!(i.disabled&&i.shouldClear)&&S.createElement(yD,pg({},i)),styles:$P(pg({},l),{rightSection:$P(pg({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var pJ=Object.defineProperty,hJ=Object.defineProperties,mJ=Object.getOwnPropertyDescriptors,kP=Object.getOwnPropertySymbols,gJ=Object.prototype.hasOwnProperty,vJ=Object.prototype.propertyIsEnumerable,RP=(e,t,r)=>t in e?pJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yJ=(e,t)=>{for(var r in t||(t={}))gJ.call(t,r)&&RP(e,r,t[r]);if(kP)for(var r of kP(t))vJ.call(t,r)&&RP(e,r,t[r]);return e},xJ=(e,t)=>hJ(e,mJ(t)),wJ=W((e,{invalid:t},{size:r})=>({wrapper:{position:"relative","&:has(input:disabled)":{cursor:"not-allowed",pointerEvents:"none","& .mantine-MultiSelect-input":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"& .mantine-MultiSelect-defaultValue":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[3],color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7]}}},values:{minHeight:`calc(${A({size:r,sizes:Ct})} - ${P(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:A({size:r,sizes:Ct})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${P(2)}) calc(${e.spacing.xs} / 2)`},searchInput:xJ(yJ({},e.fn.fontStyles()),{flex:1,minWidth:P(60),backgroundColor:"transparent",border:0,outline:0,fontSize:A({size:r,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:A({size:r,sizes:fD}),"&::placeholder":{opacity:1,color:t?e.colors.red[e.fn.primaryShade()]:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]},"&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}),searchInputEmpty:{width:"100%"},searchInputInputHidden:{flex:0,width:0,minWidth:0,margin:0,overflow:"hidden"},searchInputPointer:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}},input:{cursor:"pointer","&:disabled":{cursor:"not-allowed",pointerEvents:"none"}}}));const bJ=wJ;var _J=Object.defineProperty,SJ=Object.defineProperties,PJ=Object.getOwnPropertyDescriptors,gp=Object.getOwnPropertySymbols,_D=Object.prototype.hasOwnProperty,SD=Object.prototype.propertyIsEnumerable,TP=(e,t,r)=>t in e?_J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ji=(e,t)=>{for(var r in t||(t={}))_D.call(t,r)&&TP(e,r,t[r]);if(gp)for(var r of gp(t))SD.call(t,r)&&TP(e,r,t[r]);return e},IP=(e,t)=>SJ(e,PJ(t)),jJ=(e,t)=>{var r={};for(var n in e)_D.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gp)for(var n of gp(e))t.indexOf(n)<0&&SD.call(e,n)&&(r[n]=e[n]);return r};function OJ(e,t,r){return t?!1:r.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function CJ(e,t){return!!e&&!t.some(r=>r.value.toLowerCase()===e.toLowerCase())}function DP(e,t){if(!Array.isArray(e))return;if(t.length===0)return[];const r=t.map(n=>typeof n=="object"?n.value:n);return e.filter(n=>r.includes(n))}const EJ={size:"sm",valueComponent:mD,itemComponent:Mk,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:OJ,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:CJ,switchDirectionOnFlip:!1,zIndex:Rn("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},Yh=f.forwardRef((e,t)=>{const r=q("MultiSelect",EJ,e),{className:n,style:o,required:a,label:i,description:l,size:c,error:u,classNames:d,styles:p,wrapperProps:h,value:m,defaultValue:v,data:g,onChange:_,valueComponent:y,itemComponent:x,id:w,transitionProps:b,maxDropdownHeight:O,shadow:C,nothingFound:j,onFocus:E,onBlur:T,searchable:$,placeholder:I,filter:k,limit:D,clearSearchOnChange:N,clearable:z,clearSearchOnBlur:H,variant:K,onSearchChange:R,searchValue:M,disabled:B,initiallyOpened:Q,radius:ne,icon:Ee,rightSection:ce,rightSectionWidth:Le,creatable:Ie,getCreateLabel:pt,shouldCreate:rt,onCreate:nt,sx:Ir,dropdownComponent:Dr,onDropdownClose:ir,onDropdownOpen:hn,maxSelectedValues:Dt,withinPortal:Nr,portalProps:eo,switchDirectionOnFlip:qe,zIndex:Qr,selectOnBlur:Kr,name:jt,dropdownPosition:mi,errorProps:gi,labelProps:vi,descriptionProps:Z,form:he,positionDependencies:Qe,onKeyDown:ht,unstyled:mt,inputContainer:to,inputWrapperOrder:mn,readOnly:Ar,withAsterisk:To,clearButtonProps:xa,hoverOnSearchChange:L,disableSelectedItemFiltering:F}=r,U=jJ(r,["className","style","required","label","description","size","error","classNames","styles","wrapperProps","value","defaultValue","data","onChange","valueComponent","itemComponent","id","transitionProps","maxDropdownHeight","shadow","nothingFound","onFocus","onBlur","searchable","placeholder","filter","limit","clearSearchOnChange","clearable","clearSearchOnBlur","variant","onSearchChange","searchValue","disabled","initiallyOpened","radius","icon","rightSection","rightSectionWidth","creatable","getCreateLabel","shouldCreate","onCreate","sx","dropdownComponent","onDropdownClose","onDropdownOpen","maxSelectedValues","withinPortal","portalProps","switchDirectionOnFlip","zIndex","selectOnBlur","name","dropdownPosition","errorProps","labelProps","descriptionProps","form","positionDependencies","onKeyDown","unstyled","inputContainer","inputWrapperOrder","readOnly","withAsterisk","clearButtonProps","hoverOnSearchChange","disableSelectedItemFiltering"]),{classes:Y,cx:me,theme:ye}=bJ({invalid:!!u},{name:"MultiSelect",classNames:d,styles:p,unstyled:mt,size:c,variant:K}),{systemStyles:_e,rest:ge}=Jn(U),fe=f.useRef(),Ke=f.useRef({}),gt=kr(w),[xe,Se]=f.useState(Q),[vt,Yt]=f.useState(-1),[In,wa]=f.useState("column"),[gr,vr]=Er({value:M,defaultValue:"",finalValue:void 0,onChange:R}),[gn,ba]=f.useState(!1),{scrollIntoView:Io,targetRef:yi,scrollableRef:As}=TL({duration:0,offset:5,cancelable:!1,isList:!0}),ze=Ie&&typeof pt=="function";let sr=null;const Dn=g.map(ve=>typeof ve=="string"?{label:ve,value:ve}:ve),_a=UA({data:Dn}),[je,Yr]=Er({value:DP(m,g),defaultValue:DP(v,g),finalValue:[],onChange:_}),yr=f.useRef(!!Dt&&Dt<je.length),zc=ve=>{if(!Ar){const Xe=je.filter(Xr=>Xr!==ve);Yr(Xe),Dt&&Xe.length<Dt&&(yr.current=!1)}},O3=ve=>{vr(ve.currentTarget.value),!B&&!yr.current&&$&&Se(!0)},C3=ve=>{typeof E=="function"&&E(ve),!B&&!yr.current&&$&&Se(!0)},Ut=XX({data:_a,searchable:$,searchValue:gr,limit:D,filter:k,value:je,disableSelectedItemFiltering:F});ze&&rt(gr,_a)&&(sr=pt(gr),Ut.push({label:gr,value:gr,creatable:!0}));const Sa=Math.min(vt,Ut.length-1),J1=(ve,Xe,Xr)=>{let Do=ve;for(;Xr(Do);)if(Do=Xe(Do),!Ut[Do].disabled)return Do;return ve};on(()=>{Yt(L&&gr?0:-1)},[gr,L]),on(()=>{!B&&je.length>g.length&&Se(!1),Dt&&je.length<Dt&&(yr.current=!1),Dt&&je.length>=Dt&&(yr.current=!0,Se(!1))},[je]);const Fc=ve=>{if(!Ar)if(N&&vr(""),je.includes(ve.value))zc(ve.value);else{if(ve.creatable&&typeof nt=="function"){const Xe=nt(ve.value);typeof Xe<"u"&&Xe!==null&&Yr(typeof Xe=="string"?[...je,Xe]:[...je,Xe.value])}else Yr([...je,ve.value]);je.length===Dt-1&&(yr.current=!0,Se(!1)),Ut.length===1&&Se(!1)}},E3=ve=>{typeof T=="function"&&T(ve),Kr&&Ut[Sa]&&xe&&Fc(Ut[Sa]),H&&vr(""),Se(!1)},$3=ve=>{if(gn||(ht==null||ht(ve),Ar)||ve.key!=="Backspace"&&Dt&&yr.current)return;const Xe=In==="column",Xr=()=>{Yt(Pa=>{var ro;const Ms=J1(Pa,ja=>ja+1,ja=>ja<Ut.length-1);return xe&&(yi.current=Ke.current[(ro=Ut[Ms])==null?void 0:ro.value],Io({alignment:Xe?"end":"start"})),Ms})},Do=()=>{Yt(Pa=>{var ro;const Ms=J1(Pa,ja=>ja-1,ja=>ja>0);return xe&&(yi.current=Ke.current[(ro=Ut[Ms])==null?void 0:ro.value],Io({alignment:Xe?"start":"end"})),Ms})};switch(ve.key){case"ArrowUp":{ve.preventDefault(),Se(!0),Xe?Do():Xr();break}case"ArrowDown":{ve.preventDefault(),Se(!0),Xe?Xr():Do();break}case"Enter":{ve.preventDefault(),Ut[Sa]&&xe?Fc(Ut[Sa]):Se(!0);break}case" ":{$||(ve.preventDefault(),Ut[Sa]&&xe?Fc(Ut[Sa]):Se(!0));break}case"Backspace":{je.length>0&&gr.length===0&&(Yr(je.slice(0,-1)),Se(!0),Dt&&(yr.current=!1));break}case"Home":{if(!$){ve.preventDefault(),xe||Se(!0);const Pa=Ut.findIndex(ro=>!ro.disabled);Yt(Pa),Io({alignment:Xe?"end":"start"})}break}case"End":{if(!$){ve.preventDefault(),xe||Se(!0);const Pa=Ut.map(ro=>!!ro.disabled).lastIndexOf(!1);Yt(Pa),Io({alignment:Xe?"end":"start"})}break}case"Escape":Se(!1)}},k3=je.map(ve=>{let Xe=_a.find(Xr=>Xr.value===ve&&!Xr.disabled);return!Xe&&ze&&(Xe={value:ve,label:ve}),Xe}).filter(ve=>!!ve).map((ve,Xe)=>S.createElement(y,IP(ji({},ve),{variant:K,disabled:B,className:Y.value,readOnly:Ar,onRemove:Xr=>{Xr.preventDefault(),Xr.stopPropagation(),zc(ve.value)},key:ve.value,size:c,styles:p,classNames:d,radius:ne,index:Xe}))),R3=ve=>je.includes(ve),T3=()=>{var ve;vr(""),Yr([]),(ve=fe.current)==null||ve.focus(),Dt&&(yr.current=!1)},Vc=!Ar&&(Ut.length>0?xe:xe&&!!j);return on(()=>{const ve=Vc?hn:ir;typeof ve=="function"&&ve()},[Vc]),S.createElement(Vt.Wrapper,ji(ji({required:a,id:gt,label:i,error:u,description:l,size:c,className:n,style:o,classNames:d,styles:p,__staticSelector:"MultiSelect",sx:Ir,errorProps:gi,descriptionProps:Z,labelProps:vi,inputContainer:to,inputWrapperOrder:mn,unstyled:mt,withAsterisk:To,variant:K},_e),h),S.createElement(kl,{opened:Vc,transitionProps:b,shadow:"sm",withinPortal:Nr,portalProps:eo,__staticSelector:"MultiSelect",onDirectionChange:wa,switchDirectionOnFlip:qe,zIndex:Qr,dropdownPosition:mi,positionDependencies:[...Qe,gr],classNames:d,styles:p,unstyled:mt,variant:K},S.createElement(kl.Target,null,S.createElement("div",{className:Y.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":xe&&Vc?`${gt}-items`:null,"aria-controls":gt,"aria-expanded":xe,onMouseLeave:()=>Yt(-1),tabIndex:-1},S.createElement("input",{type:"hidden",name:jt,value:je.join(","),form:he,disabled:B}),S.createElement(Vt,ji({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:K,disabled:B,error:u,required:a,radius:ne,icon:Ee,unstyled:mt,onMouseDown:ve=>{var Xe;ve.preventDefault(),!B&&!yr.current&&Se(!xe),(Xe=fe.current)==null||Xe.focus()},classNames:IP(ji({},d),{input:me({[Y.input]:!$},d==null?void 0:d.input)})},bD({theme:ye,rightSection:ce,rightSectionWidth:Le,styles:p,size:c,shouldClear:z&&je.length>0,onClear:T3,error:u,disabled:B,clearButtonProps:xa,readOnly:Ar})),S.createElement("div",{className:Y.values,"data-clearable":z||void 0},k3,S.createElement("input",ji({ref:Cs(t,fe),type:"search",id:gt,className:me(Y.searchInput,{[Y.searchInputPointer]:!$,[Y.searchInputInputHidden]:!xe&&je.length>0||!$&&je.length>0,[Y.searchInputEmpty]:je.length===0}),onKeyDown:$3,value:gr,onChange:O3,onFocus:C3,onBlur:E3,readOnly:!$||yr.current||Ar,placeholder:je.length===0?I:void 0,disabled:B,"data-mantine-stop-propagation":xe,autoComplete:"off",onCompositionStart:()=>ba(!0),onCompositionEnd:()=>ba(!1)},ge)))))),S.createElement(kl.Dropdown,{component:Dr||j0,maxHeight:O,direction:In,id:gt,innerRef:As,__staticSelector:"MultiSelect",classNames:d,styles:p},S.createElement(Dk,{data:Ut,hovered:Sa,classNames:d,styles:p,uuid:gt,__staticSelector:"MultiSelect",onItemHover:Yt,onItemSelect:Fc,itemsRefs:Ke,itemComponent:x,size:c,nothingFound:j,isItemSelected:R3,creatable:Ie&&!!sr,createLabel:sr,unstyled:mt,variant:K}))))});Yh.displayName="@mantine/core/MultiSelect";var $J=Object.defineProperty,kJ=Object.defineProperties,RJ=Object.getOwnPropertyDescriptors,vp=Object.getOwnPropertySymbols,PD=Object.prototype.hasOwnProperty,jD=Object.prototype.propertyIsEnumerable,NP=(e,t,r)=>t in e?$J(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Eu=(e,t)=>{for(var r in t||(t={}))PD.call(t,r)&&NP(e,r,t[r]);if(vp)for(var r of vp(t))jD.call(t,r)&&NP(e,r,t[r]);return e},AP=(e,t)=>kJ(e,RJ(t)),TJ=(e,t)=>{var r={};for(var n in e)PD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&vp)for(var n of vp(e))t.indexOf(n)<0&&jD.call(e,n)&&(r[n]=e[n]);return r};const IJ={size:"sm"},ft=f.forwardRef((e,t)=>{const r=MR("NativeSelect",IJ,e),{inputProps:n,wrapperProps:o,data:a,onChange:i,value:l,classNames:c,styles:u,rightSection:d,rightSectionWidth:p}=r,h=TJ(r,["inputProps","wrapperProps","data","onChange","value","classNames","styles","rightSection","rightSectionWidth"]),m=Kt(),g=a.map(_=>typeof _=="string"?{label:_,value:_}:_).map(_=>S.createElement("option",{key:_.value,value:_.value,disabled:_.disabled},_.label));return S.createElement(Vt.Wrapper,AP(Eu({},o),{__staticSelector:"NativeSelect"}),S.createElement(Vt,Eu(AP(Eu(Eu({},n),h),{onChange:i,component:"select",ref:t,value:l===null?"":l,__staticSelector:"NativeSelect",pointer:m.cursorType==="pointer"}),bD({theme:m,rightSection:d,rightSectionWidth:p,styles:u,shouldClear:!1,size:n.size,error:o.error,readOnly:!1})),g))});ft.displayName="@mantine/core/NativeSelect";var DJ=W((e,{color:t,radius:r,withTitle:n})=>{const o=e.fn.radius(r),a=e.fn.variant({variant:"filled",color:t});return{closeButton:e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[8]:e.colors.gray[0]}),icon:{boxSizing:"border-box",marginRight:e.spacing.md,width:P(28),height:P(28),borderRadius:P(28),display:"flex",flex:"none",alignItems:"center",justifyContent:"center",backgroundColor:a.background,color:e.white},root:{overflow:"hidden",boxSizing:"border-box",position:"relative",display:"flex",alignItems:"center",paddingLeft:P(22),paddingRight:e.spacing.xs,paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs,borderRadius:o,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,boxShadow:e.shadows.lg,"&::before":{content:'""',display:"block",position:"absolute",width:P(6),top:o,bottom:o,left:P(4),borderRadius:o,backgroundColor:a.background},"&[data-with-icon]":{paddingLeft:e.spacing.xs,"&::before":{display:"none"}},"&[data-with-border]":{border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`}},body:{flex:1,overflow:"hidden",marginRight:e.spacing.xs},loader:{marginRight:e.spacing.md},title:{lineHeight:1.4,marginBottom:P(2),overflow:"hidden",textOverflow:"ellipsis",color:e.colorScheme==="dark"?e.white:e.colors.gray[9]},description:{color:n?e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:1.4,overflow:"hidden",textOverflow:"ellipsis"}}});const NJ=DJ;var AJ=Object.defineProperty,MJ=Object.defineProperties,LJ=Object.getOwnPropertyDescriptors,yp=Object.getOwnPropertySymbols,OD=Object.prototype.hasOwnProperty,CD=Object.prototype.propertyIsEnumerable,MP=(e,t,r)=>t in e?AJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LP=(e,t)=>{for(var r in t||(t={}))OD.call(t,r)&&MP(e,r,t[r]);if(yp)for(var r of yp(t))CD.call(t,r)&&MP(e,r,t[r]);return e},zJ=(e,t)=>MJ(e,LJ(t)),FJ=(e,t)=>{var r={};for(var n in e)OD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yp)for(var n of yp(e))t.indexOf(n)<0&&CD.call(e,n)&&(r[n]=e[n]);return r};const VJ={withCloseButton:!0},ED=f.forwardRef((e,t)=>{const r=q("Notification",VJ,e),{className:n,color:o,radius:a,loading:i,withCloseButton:l,withBorder:c,title:u,icon:d,children:p,onClose:h,closeButtonProps:m,classNames:v,styles:g,unstyled:_,variant:y}=r,x=FJ(r,["className","color","radius","loading","withCloseButton","withBorder","title","icon","children","onClose","closeButtonProps","classNames","styles","unstyled","variant"]),{classes:w,cx:b}=NJ({color:o,radius:a,withTitle:!!u},{name:"Notification",classNames:v,styles:g,unstyled:_,variant:y});return S.createElement(oe,LP({className:b(w.root,n),"data-with-icon":!!d||i||void 0,"data-with-border":c||void 0,role:"alert",ref:t},x),d&&!i&&S.createElement("div",{className:w.icon},d),i&&S.createElement(dn,{size:28,color:o,className:w.loader}),S.createElement("div",{className:w.body},u&&S.createElement(te,{className:w.title,size:"sm",weight:500},u),S.createElement(te,{color:"dimmed",className:w.description,size:"sm"},p)),l&&S.createElement(vc,zJ(LP({iconSize:16,color:"gray"},m),{onClick:h,className:w.closeButton})))});ED.displayName="@mantine/core/Notification";var BJ=Object.defineProperty,UJ=Object.defineProperties,WJ=Object.getOwnPropertyDescriptors,xp=Object.getOwnPropertySymbols,$D=Object.prototype.hasOwnProperty,kD=Object.prototype.propertyIsEnumerable,zP=(e,t,r)=>t in e?BJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hg=(e,t)=>{for(var r in t||(t={}))$D.call(t,r)&&zP(e,r,t[r]);if(xp)for(var r of xp(t))kD.call(t,r)&&zP(e,r,t[r]);return e},HJ=(e,t)=>UJ(e,WJ(t)),qJ=(e,t)=>{var r={};for(var n in e)$D.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&xp)for(var n of xp(e))t.indexOf(n)<0&&kD.call(e,n)&&(r[n]=e[n]);return r};const GJ={type:"text",size:"sm",__staticSelector:"TextInput"},se=f.forwardRef((e,t)=>{const r=MR("TextInput",GJ,e),{inputProps:n,wrapperProps:o}=r,a=qJ(r,["inputProps","wrapperProps"]);return S.createElement(Vt.Wrapper,hg({},o),S.createElement(Vt,HJ(hg(hg({},n),a),{ref:t})))});se.displayName="@mantine/core/TextInput";const[QJ,Xh]=Po("Pagination.Root component was not found in tree"),KJ={siblings:1,boundaries:1};function RD(e){const{total:t,value:r,defaultValue:n,onChange:o,disabled:a,children:i,siblings:l,boundaries:c,color:u,radius:d,onNextPage:p,onPreviousPage:h,onFirstPage:m,onLastPage:v,getItemProps:g,classNames:_,styles:y,unstyled:x,variant:w,size:b}=q("PaginationRoot",KJ,e),{range:O,setPage:C,next:j,previous:E,active:T,first:$,last:I}=OL({page:r,initialPage:n,onChange:o,total:t,siblings:l,boundaries:c}),k=zr(p,j),D=zr(h,E),N=zr(m,$),z=zr(v,I);return S.createElement(QJ,{value:{total:t,range:O,active:T,disabled:a,color:u,radius:d,getItemProps:g,onChange:C,onNext:k,onPrevious:D,onFirst:N,onLast:z,stylesApi:{name:"Pagination",classNames:_,styles:y,unstyled:x,variant:w,size:b}}},i)}const ec={xs:P(22),sm:P(26),md:P(32),lg:P(38),xl:P(44)};var YJ=W((e,{color:t,radius:r,withPadding:n},{size:o})=>{const a=e.fn.variant({color:t,variant:"filled"});return{control:{cursor:"pointer",userSelect:"none",display:"flex",alignItems:"center",justifyContent:"center",border:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,height:A({size:o,sizes:ec}),minWidth:A({size:o,sizes:ec}),padding:n?`0 calc(${A({size:o,sizes:e.spacing})} / 2)`:void 0,fontSize:A({size:o,sizes:e.fontSizes}),borderRadius:e.fn.radius(r),lineHeight:1,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,"&:not([data-disabled])":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]}),"&:active:not([data-disabled])":e.activeStyles,"&[data-disabled]":{opacity:.4,cursor:"not-allowed",pointerEvents:"none"},"&[data-active]":{borderColor:"transparent",color:a.color,backgroundColor:a.background,"&:not([data-disabled])":e.fn.hover({backgroundColor:a.hover})}}}});const XJ=YJ;var JJ=Object.defineProperty,ZJ=Object.defineProperties,eZ=Object.getOwnPropertyDescriptors,wp=Object.getOwnPropertySymbols,TD=Object.prototype.hasOwnProperty,ID=Object.prototype.propertyIsEnumerable,FP=(e,t,r)=>t in e?JJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tZ=(e,t)=>{for(var r in t||(t={}))TD.call(t,r)&&FP(e,r,t[r]);if(wp)for(var r of wp(t))ID.call(t,r)&&FP(e,r,t[r]);return e},rZ=(e,t)=>ZJ(e,eZ(t)),nZ=(e,t)=>{var r={};for(var n in e)TD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&wp)for(var n of wp(e))t.indexOf(n)<0&&ID.call(e,n)&&(r[n]=e[n]);return r};const oZ={withPadding:!0},Jh=f.forwardRef((e,t)=>{const r=q("PaginationControl",oZ,e),{active:n,className:o,disabled:a,withPadding:i}=r,l=nZ(r,["active","className","disabled","withPadding"]),c=Xh(),{classes:u,cx:d}=XJ({color:c.color,radius:c.radius,withPadding:i},c.stylesApi);return S.createElement(ho,rZ(tZ({},l),{disabled:a,"data-active":n||void 0,"data-disabled":a||void 0,ref:t,className:d(u.control,o)}))});Jh.displayName="@mantine/core/PaginationControl";var aZ=Object.defineProperty,iZ=Object.defineProperties,sZ=Object.getOwnPropertyDescriptors,bp=Object.getOwnPropertySymbols,DD=Object.prototype.hasOwnProperty,ND=Object.prototype.propertyIsEnumerable,VP=(e,t,r)=>t in e?aZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ka=(e,t)=>{for(var r in t||(t={}))DD.call(t,r)&&VP(e,r,t[r]);if(bp)for(var r of bp(t))ND.call(t,r)&&VP(e,r,t[r]);return e},Pc=(e,t)=>iZ(e,sZ(t)),lZ=(e,t)=>{var r={};for(var n in e)DD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&bp)for(var n of bp(e))t.indexOf(n)<0&&ND.call(e,n)&&(r[n]=e[n]);return r};function AD(e){return`calc(${A({size:e,sizes:ec})} / 2)`}function jc(e){var t=e,{size:r,style:n,children:o,path:a}=t,i=lZ(t,["size","style","children","path"]);return S.createElement("svg",Ka({viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:Ka({width:r,height:r},n)},i),S.createElement("path",{d:a,fill:"currentColor"}))}const cZ=e=>S.createElement(jc,Pc(Ka({},e),{path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"})),uZ=e=>S.createElement(jc,Pc(Ka({},e),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),dZ=e=>S.createElement(jc,Pc(Ka({},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"})),fZ=e=>S.createElement(jc,Pc(Ka({},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"})),pZ=e=>S.createElement(jc,Pc(Ka({},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"}));var hZ=W((e,t,{size:r})=>({dots:{height:A({size:r,sizes:ec}),minWidth:A({size:r,sizes:ec}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}}));const mZ=hZ;var gZ=Object.defineProperty,_p=Object.getOwnPropertySymbols,MD=Object.prototype.hasOwnProperty,LD=Object.prototype.propertyIsEnumerable,BP=(e,t,r)=>t in e?gZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vZ=(e,t)=>{for(var r in t||(t={}))MD.call(t,r)&&BP(e,r,t[r]);if(_p)for(var r of _p(t))LD.call(t,r)&&BP(e,r,t[r]);return e},yZ=(e,t)=>{var r={};for(var n in e)MD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&_p)for(var n of _p(e))t.indexOf(n)<0&&LD.call(e,n)&&(r[n]=e[n]);return r};const xZ={icon:pZ},Q0=f.forwardRef((e,t)=>{const r=q("PaginationDots",xZ,e),{className:n,icon:o}=r,a=yZ(r,["className","icon"]),i=Xh(),{classes:l,cx:c}=mZ(null,i.stylesApi);return S.createElement(oe,vZ({ref:t,className:c(l.dots,n)},a),S.createElement(o,{size:AD(i.stylesApi.size)}))});Q0.displayName="@mantine/core/PaginationDots";var wZ=Object.defineProperty,UP=Object.getOwnPropertySymbols,bZ=Object.prototype.hasOwnProperty,_Z=Object.prototype.propertyIsEnumerable,WP=(e,t,r)=>t in e?wZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SZ=(e,t)=>{for(var r in t||(t={}))bZ.call(t,r)&&WP(e,r,t[r]);if(UP)for(var r of UP(t))_Z.call(t,r)&&WP(e,r,t[r]);return e};function K0({dotsIcon:e}){const t=Xh(),r=t.range.map((n,o)=>{var a;return n==="dots"?S.createElement(Q0,{icon:e,key:o}):S.createElement(Jh,SZ({key:o,active:n===t.active,"aria-current":n===t.active?"page":void 0,onClick:()=>t.onChange(n),disabled:t.disabled},(a=t.getItemProps)==null?void 0:a.call(t,n)),n)});return S.createElement(S.Fragment,null,r)}K0.displayName="@mantine/core/PaginationItems";var PZ=W(e=>({icon:{transform:e.dir==="rtl"?"rotate(180deg)":"unset"}}));const jZ=PZ;var OZ=Object.defineProperty,Sp=Object.getOwnPropertySymbols,zD=Object.prototype.hasOwnProperty,FD=Object.prototype.propertyIsEnumerable,HP=(e,t,r)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,CZ=(e,t)=>{for(var r in t||(t={}))zD.call(t,r)&&HP(e,r,t[r]);if(Sp)for(var r of Sp(t))FD.call(t,r)&&HP(e,r,t[r]);return e},EZ=(e,t)=>{var r={};for(var n in e)zD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sp)for(var n of Sp(e))t.indexOf(n)<0&&FD.call(e,n)&&(r[n]=e[n]);return r};function Zh({icon:e,name:t,action:r,type:n}){const o={icon:e},a=f.forwardRef((i,l)=>{const c=q(t,o,i),{icon:u}=c,d=EZ(c,["icon"]),{classes:p}=jZ(),h=Xh(),m=n==="next"?h.active===h.total:h.active===1;return S.createElement(Jh,CZ({disabled:h.disabled||m,ref:l,onClick:h[r],withPadding:!1},d),S.createElement(u,{className:p.icon,size:AD(h.stylesApi.size)}))});return a.displayName=`@mantine/core/${t}`,a}const VD=Zh({icon:cZ,name:"PaginationNext",action:"onNext",type:"next"}),BD=Zh({icon:uZ,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),UD=Zh({icon:dZ,name:"PaginationFirst",action:"onFirst",type:"previous"}),WD=Zh({icon:fZ,name:"PaginationLast",action:"onLast",type:"next"});var $Z=Object.defineProperty,Pp=Object.getOwnPropertySymbols,HD=Object.prototype.hasOwnProperty,qD=Object.prototype.propertyIsEnumerable,qP=(e,t,r)=>t in e?$Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tl=(e,t)=>{for(var r in t||(t={}))HD.call(t,r)&&qP(e,r,t[r]);if(Pp)for(var r of Pp(t))qD.call(t,r)&&qP(e,r,t[r]);return e},kZ=(e,t)=>{var r={};for(var n in e)HD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Pp)for(var n of Pp(e))t.indexOf(n)<0&&qD.call(e,n)&&(r[n]=e[n]);return r};const RZ={withControls:!0,siblings:1,boundaries:1};function Zn(e){const t=q("Pagination",RZ,e),{withEdges:r,withControls:n,classNames:o,styles:a,unstyled:i,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:_,radius:y,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:O,getItemProps:C,getControlProps:j,spacing:E,nextIcon:T,previousIcon:$,lastIcon:I,firstIcon:k,dotsIcon:D}=t,N=kZ(t,["withEdges","withControls","classNames","styles","unstyled","variant","size","total","value","defaultValue","onChange","disabled","siblings","boundaries","color","radius","onNextPage","onPreviousPage","onFirstPage","onLastPage","getItemProps","getControlProps","spacing","nextIcon","previousIcon","lastIcon","firstIcon","dotsIcon"]),z=Kt();return u<=0?null:S.createElement(RD,{classNames:o,styles:a,unstyled:i,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:m,siblings:v,boundaries:g,color:_,radius:y,onNextPage:x,onPreviousPage:w,onFirstPage:b,onLastPage:O,getItemProps:C},S.createElement(J,tl({spacing:E??`calc(${A({size:c,sizes:z.spacing})} / 2)`},N),r&&S.createElement(UD,tl({icon:k},j==null?void 0:j("first"))),n&&S.createElement(BD,tl({icon:$},j==null?void 0:j("previous"))),S.createElement(K0,{dotsIcon:D}),n&&S.createElement(VD,tl({icon:T},j==null?void 0:j("next"))),r&&S.createElement(WD,tl({icon:I},j==null?void 0:j("last")))))}Zn.displayName="@mantine/core/Pagination";Zn.Root=RD;Zn.Items=K0;Zn.Control=Jh;Zn.Dots=Q0;Zn.Next=VD;Zn.Previous=BD;Zn.Last=WD;Zn.First=UD;const TZ=({reveal:e,size:t})=>S.createElement("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:t,height:t}},S.createElement("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 IZ=Object.defineProperty,DZ=Object.defineProperties,NZ=Object.getOwnPropertyDescriptors,GP=Object.getOwnPropertySymbols,AZ=Object.prototype.hasOwnProperty,MZ=Object.prototype.propertyIsEnumerable,QP=(e,t,r)=>t in e?IZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mg=(e,t)=>{for(var r in t||(t={}))AZ.call(t,r)&&QP(e,r,t[r]);if(GP)for(var r of GP(t))MZ.call(t,r)&&QP(e,r,t[r]);return e},KP=(e,t)=>DZ(e,NZ(t)),LZ=W((e,{rightSectionWidth:t},{size:r})=>({visibilityToggle:{},input:{position:"relative",overflow:"hidden"},innerInput:KP(mg(mg({},e.fn.fontStyles()),e.fn.cover(0)),{backgroundColor:"transparent",border:`${P(1)} solid transparent`,borderLeftWidth:0,borderRightWidth:0,boxSizing:"border-box",display:"block",width:`calc(100% - ${P(t)})`,paddingLeft:`calc(${A({size:r,sizes:Ct})} / 3)`,fontSize:A({size:r,sizes:e.fontSizes}),height:`calc(${A({size:r,sizes:Ct})} - ${P(2)})`,lineHeight:`calc(${A({size:r,sizes:Ct})} - ${P(4)})`,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,"&::-ms-reveal, &::-ms-clear":{display:"none"},"&:focus":{outline:0},"&:disabled":{cursor:"not-allowed",pointerEvents:"none",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[1],color:e.colors.dark[2],opacity:.6,"&::placeholder":{color:e.colors.dark[2]}},"&::placeholder":KP(mg({},e.fn.placeholderStyles()),{opacity:1}),"&[data-invalid]":{color:e.fn.variant({variant:"filled",color:"red"}).background,"&::placeholder":{opacity:1,color:e.fn.variant({variant:"filled",color:"red"}).background}},"&[data-with-icon]":{paddingLeft:A({size:r,sizes:Ct})}})}));const zZ=LZ;var FZ=Object.defineProperty,VZ=Object.defineProperties,BZ=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,GD=Object.prototype.hasOwnProperty,QD=Object.prototype.propertyIsEnumerable,YP=(e,t,r)=>t in e?FZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$u=(e,t)=>{for(var r in t||(t={}))GD.call(t,r)&&YP(e,r,t[r]);if(jp)for(var r of jp(t))QD.call(t,r)&&YP(e,r,t[r]);return e},UZ=(e,t)=>VZ(e,BZ(t)),WZ=(e,t)=>{var r={};for(var n in e)GD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jp)for(var n of jp(e))t.indexOf(n)<0&&QD.call(e,n)&&(r[n]=e[n]);return r};const HZ={xs:P(22),sm:P(26),md:P(28),lg:P(32),xl:P(40)},qZ={xs:P(12),sm:P(15),md:P(17),lg:P(19),xl:P(21)},GZ={xs:P(28),sm:P(32),md:P(34),lg:P(44),xl:P(54)},QZ={size:"sm",toggleTabIndex:-1,visibilityToggleIcon:TZ,__staticSelector:"PasswordInput"},fo=f.forwardRef((e,t)=>{const r=q("PasswordInput",QZ,e),{radius:n,disabled:o,size:a,toggleTabIndex:i,className:l,id:c,label:u,error:d,required:p,style:h,icon:m,description:v,wrapperProps:g,classNames:_,styles:y,variant:x,visibilityToggleIcon:w,__staticSelector:b,sx:O,labelProps:C,descriptionProps:j,errorProps:E,unstyled:T,visibilityToggleLabel:$,withAsterisk:I,inputContainer:k,iconWidth:D,inputWrapperOrder:N,visible:z,defaultVisible:H,onVisibilityChange:K}=r,R=WZ(r,["radius","disabled","size","toggleTabIndex","className","id","label","error","required","style","icon","description","wrapperProps","classNames","styles","variant","visibilityToggleIcon","__staticSelector","sx","labelProps","descriptionProps","errorProps","unstyled","visibilityToggleLabel","withAsterisk","inputContainer","iconWidth","inputWrapperOrder","visible","defaultVisible","onVisibilityChange"]),M=A({size:a,sizes:GZ}),{classes:B}=zZ({rightSectionWidth:M},{name:"PasswordInput",classNames:_,styles:y,unstyled:T,size:a,variant:x}),Q=kr(c),{systemStyles:ne,rest:Ee}=Jn(R),[ce,Le]=Er({value:z,defaultValue:H,finalValue:!1,onChange:K}),Ie=()=>Le(!ce),pt=S.createElement(ur,{className:B.visibilityToggle,tabIndex:i,radius:n,size:A({size:a,sizes:HZ}),"aria-hidden":!$,"aria-label":$,unstyled:T,onMouseDown:rt=>{rt.preventDefault(),Ie()},onKeyDown:rt=>{rt.key===" "&&(rt.preventDefault(),Ie())}},S.createElement(w,{reveal:ce,size:A({size:a,sizes:qZ})}));return S.createElement(Vt.Wrapper,$u($u({required:p,id:Q,label:u,error:d,description:v,size:a,className:l,style:h,classNames:_,styles:y,__staticSelector:b,sx:O,errorProps:E,descriptionProps:j,labelProps:C,unstyled:T,withAsterisk:I,inputWrapperOrder:N,inputContainer:k,variant:x},ne),g),S.createElement(Vt,{component:"div",error:d,icon:m,size:a,classNames:UZ($u({},_),{input:B.input}),styles:y,radius:n,disabled:o,__staticSelector:b,rightSectionWidth:M,rightSection:!o&&pt,variant:x,unstyled:T,iconWidth:D},S.createElement("input",$u({type:ce?"text":"password",required:p,"data-invalid":!!d||void 0,"data-with-icon":!!m||void 0,className:B.innerInput,disabled:o,id:Q,ref:t,autoComplete:"off"},Ee))))});fo.displayName="@mantine/core/PasswordInput";const KD=f.createContext(!1),KZ=KD.Provider,YZ=()=>f.useContext(KD);function YD({children:e,openDelay:t=0,closeDelay:r=0}){return S.createElement(KZ,{value:!0},S.createElement(TB,{delay:{open:t,close:r}},e))}YD.displayName="@mantine/core/TooltipGroup";var XZ=Object.defineProperty,JZ=Object.defineProperties,ZZ=Object.getOwnPropertyDescriptors,XP=Object.getOwnPropertySymbols,eee=Object.prototype.hasOwnProperty,tee=Object.prototype.propertyIsEnumerable,JP=(e,t,r)=>t in e?XZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZP=(e,t)=>{for(var r in t||(t={}))eee.call(t,r)&&JP(e,r,t[r]);if(XP)for(var r of XP(t))tee.call(t,r)&&JP(e,r,t[r]);return e},ree=(e,t)=>JZ(e,ZZ(t));function nee(e,t){if(!t)return{backgroundColor:e.colorScheme==="dark"?e.colors.gray[2]:e.colors.gray[9],color:e.colorScheme==="dark"?e.black:e.white};const r=e.fn.variant({variant:"filled",color:t,primaryFallback:!1});return{backgroundColor:r.background,color:r.color}}var oee=W((e,{color:t,radius:r,width:n,multiline:o})=>({tooltip:ree(ZP(ZP({},e.fn.fontStyles()),nee(e,t)),{lineHeight:e.lineHeight,fontSize:e.fontSizes.sm,borderRadius:e.fn.radius(r),padding:`calc(${e.spacing.xs} / 2) ${e.spacing.xs}`,position:"absolute",whiteSpace:o?"unset":"nowrap",pointerEvents:"none",width:n}),arrow:{backgroundColor:"inherit",border:0,zIndex:1}}));const XD=oee,JD={children:"Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported"};function aee({offset:e,position:t}){const[r,n]=f.useState(!1),o=f.useRef(),{x:a,y:i,reference:l,floating:c,refs:u,update:d,placement:p}=M0({placement:t,middleware:[R0({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?e*-1:0,m=p.includes("bottom")?e:t.includes("top")?e*-1:0,v=f.useCallback(({clientX:g,clientY:_})=>{l({getBoundingClientRect(){return{width:0,height:0,x:g,y:_,left:g+h,top:_+m,right:g,bottom:_}}})},[l]);return f.useEffect(()=>{if(u.floating.current){const g=o.current;g.addEventListener("mousemove",v);const _=uo(u.floating.current);return _.forEach(y=>{y.addEventListener("scroll",d)}),()=>{g.removeEventListener("mousemove",v),_.forEach(y=>{y.removeEventListener("scroll",d)})}}},[l,u.floating.current,d,v,r]),{handleMouseMove:v,x:a,y:i,opened:r,setOpened:n,boundaryRef:o,floating:c}}var iee=Object.defineProperty,see=Object.defineProperties,lee=Object.getOwnPropertyDescriptors,Op=Object.getOwnPropertySymbols,ZD=Object.prototype.hasOwnProperty,e5=Object.prototype.propertyIsEnumerable,ej=(e,t,r)=>t in e?iee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ku=(e,t)=>{for(var r in t||(t={}))ZD.call(t,r)&&ej(e,r,t[r]);if(Op)for(var r of Op(t))e5.call(t,r)&&ej(e,r,t[r]);return e},Ru=(e,t)=>see(e,lee(t)),cee=(e,t)=>{var r={};for(var n in e)ZD.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Op)for(var n of Op(e))t.indexOf(n)<0&&e5.call(e,n)&&(r[n]=e[n]);return r};const uee={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Rn("popover")};function t5(e){var t;const r=q("TooltipFloating",uee,e),{children:n,refProp:o,withinPortal:a,portalProps:i,style:l,className:c,classNames:u,styles:d,unstyled:p,radius:h,color:m,label:v,offset:g,position:_,multiline:y,width:x,zIndex:w,disabled:b,variant:O}=r,C=cee(r,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:j,x:E,y:T,opened:$,boundaryRef:I,floating:k,setOpened:D}=aee({offset:g,position:_}),{classes:N,cx:z}=XD({radius:h,color:m,multiline:y,width:x},{name:"TooltipFloating",classNames:u,styles:d,unstyled:p,variant:O});if(!js(n))throw new Error(JD.children);const H=Cs(I,n.ref),K=M=>{var B,Q;(Q=(B=n.props).onMouseEnter)==null||Q.call(B,M),j(M),D(!0)},R=M=>{var B,Q;(Q=(B=n.props).onMouseLeave)==null||Q.call(B,M),D(!1)};return S.createElement(S.Fragment,null,S.createElement(ks,Ru(ku({},i),{withinPortal:a}),S.createElement(oe,Ru(ku({},C),{ref:k,className:z(N.tooltip,c),style:Ru(ku({},l),{zIndex:w,display:!b&&$?"block":"none",top:T??"",left:(t=Math.round(E))!=null?t:""})}),v)),f.cloneElement(n,Ru(ku({},n.props),{[o]:H,onMouseEnter:K,onMouseLeave:R})))}t5.displayName="@mantine/core/TooltipFloating";function dee(e){const[t,r]=f.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,a=YZ(),i=kr(),{delay:l,currentId:c,setCurrentId:u}=xR(),d=f.useCallback(E=>{r(E),E&&u(i)},[u,i]),{x:p,y:h,reference:m,floating:v,context:g,refs:_,update:y,placement:x,middlewareData:{arrow:{x:w,y:b}={}}}=M0({placement:e.position,open:o,onOpenChange:d,middleware:[iR(e.offset),R0({padding:8}),nR(),hR({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[aR()]:[]]}),{getReferenceProps:O,getFloatingProps:C}=WB([RB(g,{enabled:e.events.hover,delay:a?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),BB(g,{enabled:e.events.focus,keyboardOnly:!0}),UB(g,{role:"tooltip"}),VB(g,{enabled:typeof e.opened===void 0}),IB(g,{id:i})]);return bR({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:_,update:y}}),on(()=>{var E;(E=e.onPositionChange)==null||E.call(e,x)},[x]),{x:p,y:h,arrowX:w,arrowY:b,reference:m,floating:v,getFloatingProps:C,getReferenceProps:O,isGroupPhase:o&&c&&c!==i,opened:o,placement:x}}var fee=Object.defineProperty,pee=Object.defineProperties,hee=Object.getOwnPropertyDescriptors,Cp=Object.getOwnPropertySymbols,r5=Object.prototype.hasOwnProperty,n5=Object.prototype.propertyIsEnumerable,tj=(e,t,r)=>t in e?fee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oa=(e,t)=>{for(var r in t||(t={}))r5.call(t,r)&&tj(e,r,t[r]);if(Cp)for(var r of Cp(t))n5.call(t,r)&&tj(e,r,t[r]);return e},gg=(e,t)=>pee(e,hee(t)),mee=(e,t)=>{var r={};for(var n in e)r5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Cp)for(var n of Cp(e))t.indexOf(n)<0&&n5.call(e,n)&&(r[n]=e[n]);return r};const gee={position:"top",refProp:"ref",withinPortal:!1,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},width:"auto",events:{hover:!0,focus:!1,touch:!1},zIndex:Rn("popover"),positionDependencies:[]},em=f.forwardRef((e,t)=>{var r;const n=f.useRef(null),o=q("Tooltip",gee,e),{children:a,position:i,refProp:l,label:c,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,withinPortal:m,portalProps:v,radius:g,color:_,classNames:y,styles:x,unstyled:w,style:b,className:O,withArrow:C,arrowSize:j,arrowOffset:E,arrowRadius:T,arrowPosition:$,offset:I,transitionProps:k,multiline:D,width:N,events:z,zIndex:H,disabled:K,positionDependencies:R,onClick:M,onMouseEnter:B,onMouseLeave:Q,inline:ne,variant:Ee,keepMounted:ce}=o,Le=mee(o,["children","position","refProp","label","openDelay","closeDelay","onPositionChange","opened","withinPortal","portalProps","radius","color","classNames","styles","unstyled","style","className","withArrow","arrowSize","arrowOffset","arrowRadius","arrowPosition","offset","transitionProps","multiline","width","events","zIndex","disabled","positionDependencies","onClick","onMouseEnter","onMouseLeave","inline","variant","keepMounted"]),{classes:Ie,cx:pt,theme:rt}=XD({radius:g,color:_,width:N,multiline:D},{name:"Tooltip",classNames:y,styles:x,unstyled:w,variant:Ee}),nt=dee({position:TR(rt.dir,i),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,events:z,arrowRef:n,arrowOffset:E,offset:I+(C?j/2:0),positionDependencies:[...R,a],inline:ne});if(!js(a))throw new Error(JD.children);const Ir=Cs(nt.reference,a.ref,t);return S.createElement(S.Fragment,null,S.createElement(ks,gg(Oa({},v),{withinPortal:m}),S.createElement(si,gg(Oa({keepMounted:ce,mounted:!K&&nt.opened},k),{transition:k.transition||"fade",duration:nt.isGroupPhase?10:(r=k.duration)!=null?r:100}),Dr=>{var ir,hn;return S.createElement(oe,Oa(Oa({},Le),nt.getFloatingProps({ref:nt.floating,className:Ie.tooltip,style:gg(Oa(Oa({},b),Dr),{zIndex:H,top:(ir=nt.y)!=null?ir:0,left:(hn=nt.x)!=null?hn:0})})),c,S.createElement(z0,{ref:n,arrowX:nt.arrowX,arrowY:nt.arrowY,visible:C,position:nt.placement,arrowSize:j,arrowOffset:E,arrowRadius:T,arrowPosition:$,className:Ie.arrow}))})),f.cloneElement(a,nt.getReferenceProps(Oa({onClick:M,onMouseEnter:B,onMouseLeave:Q,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[l]:Ir,className:pt(O,a.props.className)},a.props))))});em.Group=YD;em.Floating=t5;em.displayName="@mantine/core/Tooltip";const o5=em;var vee=Object.defineProperty,Ep=Object.getOwnPropertySymbols,a5=Object.prototype.hasOwnProperty,i5=Object.prototype.propertyIsEnumerable,rj=(e,t,r)=>t in e?vee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nj=(e,t)=>{for(var r in t||(t={}))a5.call(t,r)&&rj(e,r,t[r]);if(Ep)for(var r of Ep(t))i5.call(t,r)&&rj(e,r,t[r]);return e},yee=(e,t)=>{var r={};for(var n in e)a5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ep)for(var n of Ep(e))t.indexOf(n)<0&&i5.call(e,n)&&(r[n]=e[n]);return r};function xee(e){const t=e,{width:r,height:n,style:o}=t,a=yee(t,["width","height","style"]);return S.createElement("svg",nj({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:nj({width:r,height:n},o)},a),S.createElement("path",{fill:"currentColor",d:"M0 2.5a2.5 2.5 0 115 0 2.5 2.5 0 01-5 0z"}))}const s5=f.createContext(null),wee=s5.Provider,bee=()=>f.useContext(s5);var _ee=Object.defineProperty,$p=Object.getOwnPropertySymbols,l5=Object.prototype.hasOwnProperty,c5=Object.prototype.propertyIsEnumerable,oj=(e,t,r)=>t in e?_ee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aj=(e,t)=>{for(var r in t||(t={}))l5.call(t,r)&&oj(e,r,t[r]);if($p)for(var r of $p(t))c5.call(t,r)&&oj(e,r,t[r]);return e},See=(e,t)=>{var r={};for(var n in e)l5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&$p)for(var n of $p(e))t.indexOf(n)<0&&c5.call(e,n)&&(r[n]=e[n]);return r};const Pee={size:"sm"},u5=f.forwardRef((e,t)=>{const r=q("RadioGroup",Pee,e),{children:n,value:o,defaultValue:a,onChange:i,size:l,wrapperProps:c,unstyled:u,name:d}=r,p=See(r,["children","value","defaultValue","onChange","size","wrapperProps","unstyled","name"]),h=kr(d),[m,v]=Er({value:o,defaultValue:a,finalValue:"",onChange:i}),g=_=>v(_.currentTarget.value);return S.createElement(wee,{value:{value:m,onChange:g,size:l,name:h}},S.createElement(Vt.Wrapper,aj(aj({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:u},c),p),n))});u5.displayName="@mantine/core/RadioGroup";var jee=Object.defineProperty,Oee=Object.defineProperties,Cee=Object.getOwnPropertyDescriptors,ij=Object.getOwnPropertySymbols,Eee=Object.prototype.hasOwnProperty,$ee=Object.prototype.propertyIsEnumerable,sj=(e,t,r)=>t in e?jee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kee=(e,t)=>{for(var r in t||(t={}))Eee.call(t,r)&&sj(e,r,t[r]);if(ij)for(var r of ij(t))$ee.call(t,r)&&sj(e,r,t[r]);return e},Ree=(e,t)=>Oee(e,Cee(t));const vg={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)},Tu={xs:P(6),sm:P(8),md:P(10),lg:P(14),xl:P(16)};var Tee=W((e,{color:t,transitionDuration:r,labelPosition:n,error:o},{size:a})=>{const i=e.fn.variant({variant:"filled",color:t}),l=e.fn.variant({variant:"filled",color:"red"}).background;return{inner:{order:n==="left"?2:1,position:"relative",alignSelf:"flex-start"},icon:{ref:zt("icon"),color:e.white,opacity:0,transform:`scale(0.75) translateY(${P(2)})`,transition:`opacity ${r}ms ${e.transitionTimingFunction}`,pointerEvents:"none",width:A({sizes:Tu,size:a}),height:A({sizes:Tu,size:a}),position:"absolute",top:`calc(50% - ${A({sizes:Tu,size:a})} / 2)`,left:`calc(50% - ${A({sizes:Tu,size:a})} / 2)`},radio:Ree(kee({},e.fn.focusStyles()),{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${P(1)} solid ${o?l:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,position:"relative",appearance:"none",width:A({sizes:vg,size:a}),height:A({sizes:vg,size:a}),borderRadius:A({sizes:vg,size:a}),margin:0,display:"flex",alignItems:"center",justifyContent:"center",transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:`${r}ms`,cursor:e.cursorType,"&:checked":{background:i.background,borderColor:i.background,[`& + .${zt("icon")}`]:{opacity:1,transform:"scale(1)"}},"&:disabled":{borderColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[4],backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],[`& + .${zt("icon")}`]:{color:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[4]}}})}});const Iee=Tee;var Dee=Object.defineProperty,kp=Object.getOwnPropertySymbols,d5=Object.prototype.hasOwnProperty,f5=Object.prototype.propertyIsEnumerable,lj=(e,t,r)=>t in e?Dee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Iu=(e,t)=>{for(var r in t||(t={}))d5.call(t,r)&&lj(e,r,t[r]);if(kp)for(var r of kp(t))f5.call(t,r)&&lj(e,r,t[r]);return e},Nee=(e,t)=>{var r={};for(var n in e)d5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kp)for(var n of kp(e))t.indexOf(n)<0&&f5.call(e,n)&&(r[n]=e[n]);return r};const Aee={icon:xee,transitionDuration:100,size:"sm",labelPosition:"right"},Rp=f.forwardRef((e,t)=>{var r,n;const o=q("Radio",Aee,e),{className:a,style:i,id:l,label:c,size:u,title:d,disabled:p,color:h,classNames:m,styles:v,sx:g,icon:_,transitionDuration:y,wrapperProps:x,unstyled:w,labelPosition:b,description:O,error:C,variant:j}=o,E=Nee(o,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error","variant"]),T=bee(),$=(r=T==null?void 0:T.size)!=null?r:u,I=e.size?u:$,{classes:k}=Iee({color:h,transitionDuration:y,labelPosition:b,error:!!C},{name:"Radio",classNames:m,styles:v,unstyled:w,variant:j,size:I}),{systemStyles:D,rest:N}=Jn(E),z=kr(l),H=T?{checked:T.value===N.value,name:(n=N.name)!=null?n:T.name,onChange:T.onChange}:{};return S.createElement(Kh,Iu(Iu({className:a,sx:g,style:i,id:z,size:I,labelPosition:b,label:c,description:O,error:C,disabled:p,__staticSelector:"Radio",classNames:m,styles:v,unstyled:w,"data-checked":H.checked||void 0,variant:j},D),x),S.createElement("div",{className:k.inner},S.createElement("input",Iu(Iu({ref:t,className:k.radio,type:"radio",id:z,disabled:p},N),H)),S.createElement(_,{className:k.icon,"aria-hidden":!0})))});Rp.displayName="@mantine/core/Radio";Rp.Group=u5;function Mee({size:e,thickness:t,sum:r,value:n,root:o,offset:a}){const i=(e*.9-t*2)/2,l=Math.PI*i*2/100,c=o?`${(100-r)*l}, ${r*l}`:`${n*l}, ${(100-n)*l}`;return{strokeWidth:t,cx:e/2,cy:e/2,r:i,transform:o?`scale(1, -1) translate(0, -${e})`:null,strokeDasharray:c,strokeDashoffset:o?0:a}}var Lee=Object.defineProperty,zee=Object.defineProperties,Fee=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,p5=Object.prototype.hasOwnProperty,h5=Object.prototype.propertyIsEnumerable,cj=(e,t,r)=>t in e?Lee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uj=(e,t)=>{for(var r in t||(t={}))p5.call(t,r)&&cj(e,r,t[r]);if(Tp)for(var r of Tp(t))h5.call(t,r)&&cj(e,r,t[r]);return e},Vee=(e,t)=>zee(e,Fee(t)),Bee=(e,t)=>{var r={};for(var n in e)p5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Tp)for(var n of Tp(e))t.indexOf(n)<0&&h5.call(e,n)&&(r[n]=e[n]);return r};function m5(e){var t=e,{size:r,value:n,offset:o,sum:a,thickness:i,root:l,color:c,lineRoundCaps:u,tooltip:d}=t,p=Bee(t,["size","value","offset","sum","thickness","root","color","lineRoundCaps","tooltip"]);const h=Kt(),m=h.fn.themeColor(c||(h.colorScheme==="dark"?"dark":"gray"),c?h.fn.primaryShade():h.colorScheme==="dark"?4:1,!1);return S.createElement(o5.Floating,{disabled:!d,label:d},S.createElement("circle",uj(Vee(uj({},p),{fill:"none",strokeLinecap:u?"round":"butt",stroke:m}),Mee({sum:a,size:r,thickness:i,value:n,offset:o,root:l}))))}m5.displayName="@mantine/core/Curve";var Uee=Object.defineProperty,Wee=Object.defineProperties,Hee=Object.getOwnPropertyDescriptors,dj=Object.getOwnPropertySymbols,qee=Object.prototype.hasOwnProperty,Gee=Object.prototype.propertyIsEnumerable,fj=(e,t,r)=>t in e?Uee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rl=(e,t)=>{for(var r in t||(t={}))qee.call(t,r)&&fj(e,r,t[r]);if(dj)for(var r of dj(t))Gee.call(t,r)&&fj(e,r,t[r]);return e},nl=(e,t)=>Wee(e,Hee(t));function Qee({size:e,thickness:t,sections:r,renderRoundedLineCaps:n,rootColor:o}){const a=r.reduce((d,p)=>d+p.value,0),i=Math.PI*((e*.9-t*2)/2)*2;let l=i;const c=[],u=[];for(let d=0;d<r.length;d+=1)c.push({sum:a,offset:l,data:r[d],root:!1}),l-=r[d].value/100*i;if(c.push({sum:a,offset:l,data:{color:o},root:!0}),u.push(nl(rl({},c[c.length-1]),{lineRoundCaps:!1})),c.length>2){u.push(nl(rl({},c[0]),{lineRoundCaps:n})),u.push(nl(rl({},c[c.length-2]),{lineRoundCaps:n}));for(let d=1;d<=c.length-3;d+=1)u.push(nl(rl({},c[d]),{lineRoundCaps:!1}))}else u.push(nl(rl({},c[0]),{lineRoundCaps:n}));return u}var Kee=W({root:{position:"relative"},label:{position:"absolute",top:"50%",transform:"translateY(-50%)"}});const Yee=Kee;var Xee=Object.defineProperty,Jee=Object.defineProperties,Zee=Object.getOwnPropertyDescriptors,Ip=Object.getOwnPropertySymbols,g5=Object.prototype.hasOwnProperty,v5=Object.prototype.propertyIsEnumerable,pj=(e,t,r)=>t in e?Xee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yg=(e,t)=>{for(var r in t||(t={}))g5.call(t,r)&&pj(e,r,t[r]);if(Ip)for(var r of Ip(t))v5.call(t,r)&&pj(e,r,t[r]);return e},ete=(e,t)=>Jee(e,Zee(t)),tte=(e,t)=>{var r={};for(var n in e)g5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ip)for(var n of Ip(e))t.indexOf(n)<0&&v5.call(e,n)&&(r[n]=e[n]);return r};const rte={size:120,thickness:12},Y0=f.forwardRef((e,t)=>{const r=q("RingProgress",rte,e),{className:n,style:o,label:a,sections:i,size:l,thickness:c,classNames:u,styles:d,roundCaps:p,rootColor:h,unstyled:m,variant:v}=r,g=tte(r,["className","style","label","sections","size","thickness","classNames","styles","roundCaps","rootColor","unstyled","variant"]),{classes:_,cx:y}=Yee(null,{name:"RingProgress",classNames:u,styles:d,unstyled:m,variant:v}),x=Qee({size:l,thickness:c,sections:i,renderRoundedLineCaps:p,rootColor:h}).map(({data:w,sum:b,root:O,lineRoundCaps:C,offset:j},E)=>S.createElement(m5,ete(yg({},w),{key:E,size:l,thickness:c,sum:b,offset:j,color:w==null?void 0:w.color,root:O,lineRoundCaps:C})));return S.createElement(oe,yg({style:yg({width:l,height:l},o),className:y(_.root,n),ref:t},g),S.createElement("svg",{style:{width:l,height:l,transform:"rotate(-90deg)"}},x),a&&S.createElement("div",{className:_.label,style:{right:c*2,left:c*2}},a))});Y0.displayName="@mantine/core/RingProgress";function nte(e,t){if(t.length===0)return t;const r="maxWidth"in t[0]?"maxWidth":"minWidth",n=[...t].sort((o,a)=>fr(A({size:a[r],sizes:e.breakpoints}))-fr(A({size:o[r],sizes:e.breakpoints})));return r==="minWidth"?n.reverse():n}var ote=Object.defineProperty,hj=Object.getOwnPropertySymbols,ate=Object.prototype.hasOwnProperty,ite=Object.prototype.propertyIsEnumerable,mj=(e,t,r)=>t in e?ote(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ste=(e,t)=>{for(var r in t||(t={}))ate.call(t,r)&&mj(e,r,t[r]);if(hj)for(var r of hj(t))ite.call(t,r)&&mj(e,r,t[r]);return e},lte=W((e,{spacing:t,breakpoints:r,cols:n,verticalSpacing:o})=>{const a=o!=null,i=nte(e,r).reduce((l,c)=>{var u,d;const p="maxWidth"in c?"max-width":"min-width",h=A({size:p==="max-width"?c.maxWidth:c.minWidth,sizes:e.breakpoints,units:"em"}),m=fr(h)-(p==="max-width"?1:0);return l[`@media (${p}: ${nr(m)})`]={gridTemplateColumns:`repeat(${c.cols}, minmax(0, 1fr))`,gap:`${A({size:(u=c.verticalSpacing)!=null?u:a?o:t,sizes:e.spacing})} ${A({size:(d=c.spacing)!=null?d:t,sizes:e.spacing})}`},l},{});return{root:ste({boxSizing:"border-box",display:"grid",gridTemplateColumns:`repeat(${n}, minmax(0, 1fr))`,gap:`${A({size:a?o:t,sizes:e.spacing})} ${A({size:t,sizes:e.spacing})}`},i)}});const cte=lte;var ute=Object.defineProperty,Dp=Object.getOwnPropertySymbols,y5=Object.prototype.hasOwnProperty,x5=Object.prototype.propertyIsEnumerable,gj=(e,t,r)=>t in e?ute(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dte=(e,t)=>{for(var r in t||(t={}))y5.call(t,r)&&gj(e,r,t[r]);if(Dp)for(var r of Dp(t))x5.call(t,r)&&gj(e,r,t[r]);return e},fte=(e,t)=>{var r={};for(var n in e)y5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dp)for(var n of Dp(e))t.indexOf(n)<0&&x5.call(e,n)&&(r[n]=e[n]);return r};const pte={breakpoints:[],cols:1,spacing:"md"},w5=f.forwardRef((e,t)=>{const r=q("SimpleGrid",pte,e),{className:n,breakpoints:o,cols:a,spacing:i,verticalSpacing:l,children:c,unstyled:u,variant:d}=r,p=fte(r,["className","breakpoints","cols","spacing","verticalSpacing","children","unstyled","variant"]),{classes:h,cx:m}=cte({breakpoints:o,cols:a,spacing:i,verticalSpacing:l},{name:"SimpleGrid",unstyled:u,variant:d});return S.createElement(oe,dte({className:m(h.root,n),ref:t},p),c)});w5.displayName="@mantine/core/SimpleGrid";var hte=Object.defineProperty,Np=Object.getOwnPropertySymbols,b5=Object.prototype.hasOwnProperty,_5=Object.prototype.propertyIsEnumerable,vj=(e,t,r)=>t in e?hte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mte=(e,t)=>{for(var r in t||(t={}))b5.call(t,r)&&vj(e,r,t[r]);if(Np)for(var r of Np(t))_5.call(t,r)&&vj(e,r,t[r]);return e},gte=(e,t)=>{var r={};for(var n in e)b5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Np)for(var n of Np(e))t.indexOf(n)<0&&_5.call(e,n)&&(r[n]=e[n]);return r};const vte={w:0,h:0},tm=f.forwardRef((e,t)=>{const r=q("Space",vte,e),{w:n,h:o}=r,a=gte(r,["w","h"]);return S.createElement(oe,mte({ref:t,w:n,miw:n,h:o,mih:o},a))});tm.displayName="@mantine/core/Space";var yte=W((e,{spacing:t,align:r,justify:n})=>({root:{display:"flex",flexDirection:"column",alignItems:r,justifyContent:n,gap:A({size:t,sizes:e.spacing})}}));const xte=yte;var wte=Object.defineProperty,Ap=Object.getOwnPropertySymbols,S5=Object.prototype.hasOwnProperty,P5=Object.prototype.propertyIsEnumerable,yj=(e,t,r)=>t in e?wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bte=(e,t)=>{for(var r in t||(t={}))S5.call(t,r)&&yj(e,r,t[r]);if(Ap)for(var r of Ap(t))P5.call(t,r)&&yj(e,r,t[r]);return e},_te=(e,t)=>{var r={};for(var n in e)S5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ap)for(var n of Ap(e))t.indexOf(n)<0&&P5.call(e,n)&&(r[n]=e[n]);return r};const Ste={spacing:"md",align:"stretch",justify:"flex-start"},Oe=f.forwardRef((e,t)=>{const r=q("Stack",Ste,e),{spacing:n,className:o,align:a,justify:i,unstyled:l,variant:c}=r,u=_te(r,["spacing","className","align","justify","unstyled","variant"]),{classes:d,cx:p}=xte({spacing:n,align:a,justify:i},{name:"Stack",unstyled:l,variant:c});return S.createElement(oe,bte({className:p(d.root,o),ref:t},u))});Oe.displayName="@mantine/core/Stack";var Pte=Object.defineProperty,jte=Object.defineProperties,Ote=Object.getOwnPropertyDescriptors,xj=Object.getOwnPropertySymbols,Cte=Object.prototype.hasOwnProperty,Ete=Object.prototype.propertyIsEnumerable,wj=(e,t,r)=>t in e?Pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xg=(e,t)=>{for(var r in t||(t={}))Cte.call(t,r)&&wj(e,r,t[r]);if(xj)for(var r of xj(t))Ete.call(t,r)&&wj(e,r,t[r]);return e},$te=(e,t)=>jte(e,Ote(t));const j5={xs:P(34),sm:P(36),md:P(42),lg:P(48),xl:P(52)};var kte=W((e,{color:t,iconSize:r,radius:n,allowStepClick:o,iconPosition:a,orientation:i},{size:l})=>{const c=r?P(r):A({size:l,sizes:j5}),u=l==="xl"||l==="lg"?e.spacing.md:e.spacing.sm,d=e.fn.radius(n),p=e.fn.variant({variant:"filled",color:t||e.primaryColor,primaryFallback:!1}),h=`calc(${e.spacing.xs} / 2)`,m={step:{justifyContent:"flex-start",minHeight:`calc(${c} + ${e.spacing.xl} + ${h})`,marginTop:h,overflow:"hidden","&:first-of-type":{marginTop:0},[`&:last-of-type .${zt("verticalSeparator")}`]:{display:"none"}}};return{stepLoader:{},step:xg({display:"flex",flexDirection:a==="left"?"row":"row-reverse",cursor:o?"pointer":"default"},i==="vertical"?m.step:{alignItems:"center"}),stepWrapper:{position:"relative"},verticalSeparator:{top:`calc(${c} + ${h})`,left:`calc(${c} / 2)`,height:"100vh",position:"absolute",borderLeft:`${P(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,ref:zt("verticalSeparator")},verticalSeparatorActive:{borderColor:e.fn.variant({variant:"filled",color:t}).background},stepIcon:{boxSizing:"border-box",height:c,width:c,minWidth:c,borderRadius:d,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1],border:`${P(2)} solid ${e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]}`,transition:"background-color 150ms ease, border-color 150ms ease",position:"relative",fontWeight:700,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],fontSize:A({size:l,sizes:e.fontSizes}),"&[data-progress]":{borderColor:p.background},"&[data-completed]":{backgroundColor:p.background,borderColor:p.background,color:e.white}},stepCompletedIcon:$te(xg({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.white}),stepBody:xg({display:"flex",flexDirection:"column",marginLeft:a==="left"?u:void 0,marginRight:a==="right"?u:void 0},i==="vertical"?{marginTop:`calc(${r} / 4)`}:null),stepLabel:{textAlign:a,fontWeight:500,fontSize:A({size:l,sizes:e.fontSizes}),lineHeight:1},stepDescription:{textAlign:a,marginTop:`calc(${A({size:l,sizes:e.spacing})} / 3)`,marginBottom:`calc(${A({size:l,sizes:e.spacing})} / 3)`,fontSize:`calc(${A({size:l,sizes:e.fontSizes})} - ${P(2)})`,lineHeight:1}}});const Rte=kte;var Tte=Object.defineProperty,Mp=Object.getOwnPropertySymbols,O5=Object.prototype.hasOwnProperty,C5=Object.prototype.propertyIsEnumerable,bj=(e,t,r)=>t in e?Tte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wg=(e,t)=>{for(var r in t||(t={}))O5.call(t,r)&&bj(e,r,t[r]);if(Mp)for(var r of Mp(t))C5.call(t,r)&&bj(e,r,t[r]);return e},Ite=(e,t)=>{var r={};for(var n in e)O5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Mp)for(var n of Mp(e))t.indexOf(n)<0&&C5.call(e,n)&&(r[n]=e[n]);return r};const Dte={xs:16,sm:18,md:20,lg:22,xl:24},Nte={withIcon:!0,size:"md",radius:"xl",allowStepClick:!0,iconPosition:"left",__staticSelector:"Step"},Du=(e,t)=>typeof e=="function"?S.createElement(e,{step:t}):e,E5=f.forwardRef((e,t)=>{const r=q("StepperStep",Nte,e),{className:n,step:o,state:a,color:i,icon:l,completedIcon:c,progressIcon:u,label:d,description:p,withIcon:h,iconSize:m,size:v,radius:g,loading:_,allowStepClick:y,allowStepSelect:x,iconPosition:w,__staticSelector:b,classNames:O,styles:C,unstyled:j,orientation:E,variant:T}=r,$=Ite(r,["className","step","state","color","icon","completedIcon","progressIcon","label","description","withIcon","iconSize","size","radius","loading","allowStepClick","allowStepSelect","iconPosition","__staticSelector","classNames","styles","unstyled","orientation","variant"]),{classes:I,cx:k}=Rte({color:i,iconSize:m,radius:g,allowStepClick:y,iconPosition:w,orientation:E},{name:b,classNames:O,styles:C,unstyled:j,variant:T,size:v}),D=A({size:v,sizes:Dte}),N=a==="stepCompleted"?null:a==="stepProgress"?u:l,z={"data-progress":a==="stepProgress"||void 0,"data-completed":a==="stepCompleted"||void 0};return S.createElement(ho,wg(wg({className:k(I.step,n),tabIndex:y?0:-1,ref:t},z),$),h&&S.createElement("div",{className:I.stepWrapper},S.createElement("div",wg({className:I.stepIcon},z),S.createElement(si,{mounted:a==="stepCompleted",transition:"pop",duration:200},H=>S.createElement("div",{className:I.stepCompletedIcon,style:H},_?S.createElement(dn,{color:"#fff",size:D,className:I.stepLoader}):Du(c,o)||S.createElement(DT,{indeterminate:!1,width:D,height:D}))),a!=="stepCompleted"?_?S.createElement(dn,{size:D,color:i}):Du(N||l,o):null),E==="vertical"&&S.createElement("div",{className:k(I.verticalSeparator,{[I.verticalSeparatorActive]:a==="stepCompleted"})})),(d||p)&&S.createElement("div",{className:I.stepBody},d&&S.createElement(te,{className:I.stepLabel},Du(d,o)),p&&S.createElement(te,{className:I.stepDescription,color:"dimmed"},Du(p,o))))});E5.displayName="@mantine/core/Step";function Lp(e){return null}Lp.displayName="@mantine/core/StepCompleted";var Ate=Object.defineProperty,Mte=Object.defineProperties,Lte=Object.getOwnPropertyDescriptors,_j=Object.getOwnPropertySymbols,zte=Object.prototype.hasOwnProperty,Fte=Object.prototype.propertyIsEnumerable,Sj=(e,t,r)=>t in e?Ate(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ol=(e,t)=>{for(var r in t||(t={}))zte.call(t,r)&&Sj(e,r,t[r]);if(_j)for(var r of _j(t))Fte.call(t,r)&&Sj(e,r,t[r]);return e},Vte=(e,t)=>Mte(e,Lte(t)),Bte=W((e,{contentPadding:t,color:r,orientation:n,iconPosition:o,iconSize:a,breakpoint:i},{size:l})=>{const c=typeof i<"u",u=fr(A({size:i,sizes:e.breakpoints})),d=typeof a<"u"?`calc(${P(a)} / 2 - ${P(1)})`:`calc(${A({size:l,sizes:j5})} / 2 - ${P(1)})`,p={steps:{flexDirection:"column",alignItems:o==="left"?"flex-start":"flex-end"},separator:{width:P(2),minHeight:e.spacing.xl,marginLeft:o==="left"?d:0,marginRight:o==="right"?d:0,marginTop:`calc(${e.spacing.xs} / 2)`,marginBottom:`calc(${e.spacing.xs} - ${P(2)})`}},h={steps:{[`@media (max-width: ${nr(u-1)})`]:p.steps},separator:{[`@media (max-width: ${nr(u-1)})`]:p.separator}};return{root:{},steps:ol(ol({display:"flex",boxSizing:"border-box",alignItems:"center"},n==="vertical"?p.steps:null),c?h.steps:null),separator:ol(ol({boxSizing:"border-box",transition:"background-color 150ms ease",flex:1,height:P(2),backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],marginLeft:e.spacing.md,marginRight:e.spacing.md},n==="vertical"?p.separator:null),c?h.separator:null),separatorActive:{backgroundColor:e.fn.variant({variant:"filled",color:r||e.primaryColor,primaryFallback:!1}).background},content:Vte(ol({},e.fn.fontStyles()),{paddingTop:A({size:t,sizes:e.spacing})})}});const Ute=Bte;var Wte=Object.defineProperty,zp=Object.getOwnPropertySymbols,$5=Object.prototype.hasOwnProperty,k5=Object.prototype.propertyIsEnumerable,Pj=(e,t,r)=>t in e?Wte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hte=(e,t)=>{for(var r in t||(t={}))$5.call(t,r)&&Pj(e,r,t[r]);if(zp)for(var r of zp(t))k5.call(t,r)&&Pj(e,r,t[r]);return e},qte=(e,t)=>{var r={};for(var n in e)$5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&zp)for(var n of zp(e))t.indexOf(n)<0&&k5.call(e,n)&&(r[n]=e[n]);return r};const Gte={contentPadding:"md",size:"md",radius:"xl",orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0},tc=f.forwardRef((e,t)=>{var r,n,o;const a=q("Stepper",Gte,e),{className:i,children:l,onStepClick:c,active:u,icon:d,completedIcon:p,progressIcon:h,color:m,iconSize:v,contentPadding:g,size:_,radius:y,orientation:x,breakpoint:w,iconPosition:b,allowNextStepsSelect:O,classNames:C,styles:j,unstyled:E,variant:T}=a,$=qte(a,["className","children","onStepClick","active","icon","completedIcon","progressIcon","color","iconSize","contentPadding","size","radius","orientation","breakpoint","iconPosition","allowNextStepsSelect","classNames","styles","unstyled","variant"]),{classes:I,cx:k}=Ute({contentPadding:g,color:m,orientation:x,iconPosition:b,iconSize:v,breakpoint:w},{name:"Stepper",classNames:C,styles:j,unstyled:E,variant:T,size:_}),D=f.Children.toArray(l),N=D.filter(B=>B.type!==Lp),z=D.find(B=>B.type===Lp),H=N.reduce((B,Q,ne)=>{const Ee=u===ne?"stepProgress":u>ne?"stepCompleted":"stepInactive",Le=(()=>typeof c!="function"?!1:typeof Q.props.allowStepSelect=="boolean"?Q.props.allowStepSelect:Ee==="stepCompleted"||O)();return B.push(f.cloneElement(Q,{__staticSelector:"Stepper",icon:Q.props.icon||d||ne+1,key:ne,step:ne,variant:T,state:Ee,onClick:()=>Le&&c(ne),allowStepClick:Le,completedIcon:Q.props.completedIcon||p,progressIcon:Q.props.progressIcon||h,color:Q.props.color||m,iconSize:v,size:_,radius:y,classNames:C,styles:j,iconPosition:Q.props.iconPosition||b,orientation:x,unstyled:E})),x==="horizontal"&&ne!==N.length-1&&B.push(S.createElement("div",{className:k(I.separator,{[I.separatorActive]:ne<u}),key:`separator-${ne}`})),B},[]),K=(n=(r=N[u])==null?void 0:r.props)==null?void 0:n.children,R=(o=z==null?void 0:z.props)==null?void 0:o.children,M=u>N.length-1?R:K;return S.createElement(oe,Hte({className:k(I.root,i),ref:t},$),S.createElement("div",{className:I.steps},H),M&&S.createElement("div",{className:I.content},M))});tc.Step=E5;tc.Completed=Lp;tc.displayName="@mantine/core/Stepper";const R5=f.createContext(null),Qte=R5.Provider,Kte=()=>f.useContext(R5);var Yte=Object.defineProperty,Fp=Object.getOwnPropertySymbols,T5=Object.prototype.hasOwnProperty,I5=Object.prototype.propertyIsEnumerable,jj=(e,t,r)=>t in e?Yte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oj=(e,t)=>{for(var r in t||(t={}))T5.call(t,r)&&jj(e,r,t[r]);if(Fp)for(var r of Fp(t))I5.call(t,r)&&jj(e,r,t[r]);return e},Xte=(e,t)=>{var r={};for(var n in e)T5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Fp)for(var n of Fp(e))t.indexOf(n)<0&&I5.call(e,n)&&(r[n]=e[n]);return r};const Jte={size:"sm"},D5=f.forwardRef((e,t)=>{const r=q("SwitchGroup",Jte,e),{children:n,value:o,defaultValue:a,onChange:i,size:l,wrapperProps:c}=r,u=Xte(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=Er({value:o,defaultValue:a,finalValue:[],onChange:i}),h=m=>{const v=m.currentTarget.value;p(d.includes(v)?d.filter(g=>g!==v):[...d,v])};return S.createElement(Qte,{value:{value:d,onChange:h,size:l}},S.createElement(Vt.Wrapper,Oj(Oj({labelElement:"div",size:l,__staticSelector:"SwitchGroup",ref:t},c),u),n))});D5.displayName="@mantine/core/SwitchGroup";var Zte=Object.defineProperty,ere=Object.defineProperties,tre=Object.getOwnPropertyDescriptors,Cj=Object.getOwnPropertySymbols,rre=Object.prototype.hasOwnProperty,nre=Object.prototype.propertyIsEnumerable,Ej=(e,t,r)=>t in e?Zte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ore=(e,t)=>{for(var r in t||(t={}))rre.call(t,r)&&Ej(e,r,t[r]);if(Cj)for(var r of Cj(t))nre.call(t,r)&&Ej(e,r,t[r]);return e},are=(e,t)=>ere(e,tre(t));const ire={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)},sre={xs:P(32),sm:P(38),md:P(46),lg:P(56),xl:P(72)},lre={xs:P(12),sm:P(14),md:P(18),lg:P(22),xl:P(28)},cre={xs:P(5),sm:P(6),md:P(7),lg:P(9),xl:P(11)},ure={xs:P(4),sm:P(5),md:P(6),lg:P(8),xl:P(10)};var dre=W((e,{radius:t,color:r,labelPosition:n,error:o},{size:a})=>{const i=A({size:a,sizes:lre}),l=A({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:r}),u=A({size:a,sizes:sre}),d=P(a==="xs"?1:2),p=e.fn.variant({variant:"filled",color:"red"}).background;return{root:{position:"relative"},input:{height:0,width:0,overflow:"hidden",whiteSpace:"nowrap",padding:0,WebkitClipPath:"inset(50%)",clipPath:"inset(50%)",position:"absolute"},track:are(ore({},e.fn.focusStyles("input:focus + &")),{cursor:e.cursorType,overflow:"hidden",WebkitTapHighlightColor:"transparent",position:"relative",borderRadius:l,backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[2],border:`${P(1)} solid ${o?p:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`,height:A({size:a,sizes:ire}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:A({size:a,sizes:cre}),fontWeight:600,order:n==="left"?2:1,userSelect:"none",zIndex:0,lineHeight:0,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[6],transition:`color 150ms ${e.transitionTimingFunction}`,"input:checked + &":{backgroundColor:c.background,borderColor:c.background,color:e.white,transition:`color 150ms ${e.transitionTimingFunction}`},"input:disabled + &":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],cursor:"not-allowed",pointerEvents:"none"}}),thumb:{position:"absolute",zIndex:1,borderRadius:l,boxSizing:"border-box",display:"flex",backgroundColor:e.white,height:i,width:i,border:`${P(1)} solid ${e.colorScheme==="dark"?e.white:e.colors.gray[3]}`,left:d,transition:`left 150ms ${e.transitionTimingFunction}`,"& > *":{margin:"auto"},"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":""},"input:checked + * > &":{left:`calc(100% - ${i} - ${d})`,borderColor:e.white},"input:disabled + * > &":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2],backgroundColor:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[0]}},trackLabel:{height:"100%",display:"grid",placeContent:"center",minWidth:`calc(${u} - ${i})`,paddingInline:A({size:a,sizes:ure}),marginLeft:`calc(${i} + ${d})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${i} + ${d})`}}}});const fre=dre;var pre=Object.defineProperty,hre=Object.defineProperties,mre=Object.getOwnPropertyDescriptors,Vp=Object.getOwnPropertySymbols,N5=Object.prototype.hasOwnProperty,A5=Object.prototype.propertyIsEnumerable,$j=(e,t,r)=>t in e?pre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bg=(e,t)=>{for(var r in t||(t={}))N5.call(t,r)&&$j(e,r,t[r]);if(Vp)for(var r of Vp(t))A5.call(t,r)&&$j(e,r,t[r]);return e},gre=(e,t)=>hre(e,mre(t)),vre=(e,t)=>{var r={};for(var n in e)N5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Vp)for(var n of Vp(e))t.indexOf(n)<0&&A5.call(e,n)&&(r[n]=e[n]);return r};const yre={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},X0=f.forwardRef((e,t)=>{var r;const n=q("Switch",yre,e),{className:o,color:a,label:i,offLabel:l,onLabel:c,id:u,style:d,size:p,radius:h,wrapperProps:m,children:v,unstyled:g,styles:_,classNames:y,thumbIcon:x,sx:w,checked:b,defaultChecked:O,onChange:C,labelPosition:j,description:E,error:T,disabled:$,variant:I}=n,k=vre(n,["className","color","label","offLabel","onLabel","id","style","size","radius","wrapperProps","children","unstyled","styles","classNames","thumbIcon","sx","checked","defaultChecked","onChange","labelPosition","description","error","disabled","variant"]),D=Kte(),N=(D==null?void 0:D.size)||p,{classes:z,cx:H}=fre({color:a,radius:h,labelPosition:j,error:!!T},{name:"Switch",classNames:y,styles:_,unstyled:g,size:N,variant:I}),{systemStyles:K,rest:R}=Jn(k),M=kr(u),B=D?{checked:D.value.includes(R.value),onChange:D.onChange}:{},[Q,ne]=Er({value:(r=B.checked)!=null?r:b,defaultValue:O,finalValue:!1});return S.createElement(Kh,bg(bg({className:H(o,z.root),sx:w,style:d,id:M,size:(D==null?void 0:D.size)||p,labelPosition:j,label:i,description:E,error:T,disabled:$,__staticSelector:"Switch",classNames:y,styles:_,unstyled:g,"data-checked":B.checked||void 0,variant:I},K),m),S.createElement("input",gre(bg({},R),{disabled:$,checked:Q,onChange:Ee=>{D?B.onChange(Ee):C==null||C(Ee),ne(Ee.currentTarget.checked)},id:M,ref:t,type:"checkbox",className:z.input})),S.createElement("label",{htmlFor:M,className:z.track},S.createElement("div",{className:z.thumb},x),S.createElement("div",{className:z.trackLabel},Q?c:l)))});X0.displayName="@mantine/core/Switch";X0.Group=D5;var xre=Object.defineProperty,wre=Object.defineProperties,bre=Object.getOwnPropertyDescriptors,kj=Object.getOwnPropertySymbols,_re=Object.prototype.hasOwnProperty,Sre=Object.prototype.propertyIsEnumerable,Rj=(e,t,r)=>t in e?xre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pre=(e,t)=>{for(var r in t||(t={}))_re.call(t,r)&&Rj(e,r,t[r]);if(kj)for(var r of kj(t))Sre.call(t,r)&&Rj(e,r,t[r]);return e},jre=(e,t)=>wre(e,bre(t)),Ore=W((e,{captionSide:t,horizontalSpacing:r,verticalSpacing:n,fontSize:o,withBorder:a,withColumnBorders:i})=>{const l=`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]}`;return{root:jre(Pre({},e.fn.fontStyles()),{width:"100%",borderCollapse:"collapse",captionSide:t,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,lineHeight:e.lineHeight,border:a?l:void 0,"& > caption":{marginTop:t==="top"?0:e.spacing.xs,marginBottom:t==="bottom"?0:e.spacing.xs,fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]},"& > thead > tr > th, & > tfoot > tr > th, & > tbody > tr > th":{textAlign:"left",fontWeight:"bold",color:e.colorScheme==="dark"?e.colors.dark[0]:e.colors.gray[7],fontSize:A({size:o,sizes:e.fontSizes}),padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:l},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:l},"& > tbody > tr > td":{padding:`${A({size:n,sizes:e.spacing})} ${A({size:r,sizes:e.spacing})}`,borderTop:l,fontSize:A({size:o,sizes:e.fontSizes})},"& > tbody > tr:first-of-type > td, & > tbody > tr:first-of-type > th":{borderTop:"none"},"& > thead > tr > th, & > tbody > tr > td":{borderRight:i?l:"none","&:last-of-type":{borderRight:"none",borderLeft:i?l:"none"}},"& > tbody > tr > th":{borderRight:i?l:"none"},"&[data-striped] > tbody > tr:nth-of-type(odd)":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]},"&[data-hover] > tbody > tr":e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[1]})})}});const Cre=Ore;var Ere=Object.defineProperty,$re=Object.defineProperties,kre=Object.getOwnPropertyDescriptors,Bp=Object.getOwnPropertySymbols,M5=Object.prototype.hasOwnProperty,L5=Object.prototype.propertyIsEnumerable,Tj=(e,t,r)=>t in e?Ere(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rre=(e,t)=>{for(var r in t||(t={}))M5.call(t,r)&&Tj(e,r,t[r]);if(Bp)for(var r of Bp(t))L5.call(t,r)&&Tj(e,r,t[r]);return e},Tre=(e,t)=>$re(e,kre(t)),Ire=(e,t)=>{var r={};for(var n in e)M5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Bp)for(var n of Bp(e))t.indexOf(n)<0&&L5.call(e,n)&&(r[n]=e[n]);return r};const Dre={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},ci=f.forwardRef((e,t)=>{const r=q("Table",Dre,e),{className:n,children:o,striped:a,highlightOnHover:i,captionSide:l,horizontalSpacing:c,verticalSpacing:u,fontSize:d,unstyled:p,withBorder:h,withColumnBorders:m,variant:v}=r,g=Ire(r,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:_,cx:y}=Cre({captionSide:l,verticalSpacing:u,horizontalSpacing:c,fontSize:d,withBorder:h,withColumnBorders:m},{unstyled:p,name:"Table",variant:v});return S.createElement(oe,Tre(Rre({},g),{component:"table",ref:t,className:y(_.root,n),"data-striped":a||void 0,"data-hover":i||void 0}),o)});ci.displayName="@mantine/core/Table";const qv={context:"Tabs component was not found in the tree",value:"Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value"},[Nre,J0]=Po(qv.context);var Are=Object.defineProperty,Ij=Object.getOwnPropertySymbols,Mre=Object.prototype.hasOwnProperty,Lre=Object.prototype.propertyIsEnumerable,Dj=(e,t,r)=>t in e?Are(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zre=(e,t)=>{for(var r in t||(t={}))Mre.call(t,r)&&Dj(e,r,t[r]);if(Ij)for(var r of Ij(t))Lre.call(t,r)&&Dj(e,r,t[r]);return e};function Fre({orientation:e,inverted:t,placement:r},n,o){const a=e==="vertical";return o==="default"?{[a?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${P(2)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="outline"?{[a?r==="left"?"borderRight":"borderLeft":t?"borderTop":"borderBottom"]:`${P(1)} solid ${n.colorScheme==="dark"?n.colors.dark[4]:n.colors.gray[3]}`}:o==="pills"?{gap:`calc(${n.spacing.sm} / 2)`}:{}}var Vre=W((e,t,{variant:r})=>{const n=t.orientation==="vertical";return{tabsList:zre({display:"flex",flexWrap:"wrap",flexDirection:n?"column":"row",justifyContent:PI[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},Fre(t,e,r))}});const Bre=Vre;var Ure=Object.defineProperty,Wre=Object.defineProperties,Hre=Object.getOwnPropertyDescriptors,Up=Object.getOwnPropertySymbols,z5=Object.prototype.hasOwnProperty,F5=Object.prototype.propertyIsEnumerable,Nj=(e,t,r)=>t in e?Ure(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qre=(e,t)=>{for(var r in t||(t={}))z5.call(t,r)&&Nj(e,r,t[r]);if(Up)for(var r of Up(t))F5.call(t,r)&&Nj(e,r,t[r]);return e},Gre=(e,t)=>Wre(e,Hre(t)),Qre=(e,t)=>{var r={};for(var n in e)z5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Up)for(var n of Up(e))t.indexOf(n)<0&&F5.call(e,n)&&(r[n]=e[n]);return r};const Kre={grow:!1,position:"left"},V5=f.forwardRef((e,t)=>{const r=q("TabsList",Kre,e),{children:n,className:o,grow:a,position:i}=r,l=Qre(r,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:p,inverted:h,placement:m,classNames:v,styles:g,unstyled:_}=J0(),{classes:y,cx:x}=Bre({orientation:c,grow:a,color:d,position:i,radius:p,inverted:h,placement:m},{name:"Tabs",unstyled:_,classNames:v,styles:g,variant:u});return S.createElement(oe,Gre(qre({},l),{className:x(y.tabsList,o),ref:t,role:"tablist","aria-orientation":c}),n)});V5.displayName="@mantine/core/TabsList";var Yre=W((e,{orientation:t})=>({panel:{flex:t==="vertical"?1:void 0}}));const Xre=Yre;var Jre=Object.defineProperty,Zre=Object.defineProperties,ene=Object.getOwnPropertyDescriptors,Wp=Object.getOwnPropertySymbols,B5=Object.prototype.hasOwnProperty,U5=Object.prototype.propertyIsEnumerable,Aj=(e,t,r)=>t in e?Jre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tne=(e,t)=>{for(var r in t||(t={}))B5.call(t,r)&&Aj(e,r,t[r]);if(Wp)for(var r of Wp(t))U5.call(t,r)&&Aj(e,r,t[r]);return e},rne=(e,t)=>Zre(e,ene(t)),nne=(e,t)=>{var r={};for(var n in e)B5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Wp)for(var n of Wp(e))t.indexOf(n)<0&&U5.call(e,n)&&(r[n]=e[n]);return r};const one={},W5=f.forwardRef((e,t)=>{const r=q("TabsPanel",one,e),{value:n,children:o,sx:a,className:i}=r,l=nne(r,["value","children","sx","className"]),c=J0(),{classes:u,cx:d}=Xre({orientation:c.orientation,color:c.color,radius:c.radius,inverted:c.inverted,placement:c.placement},{name:"Tabs",unstyled:c.unstyled,classNames:c.classNames,styles:c.styles,variant:c.variant}),p=c.getPanelId(n),h=c.value===n,m=c.keepMounted||h?o:null;return f.useEffect(()=>(c.setMountedPanelIds(v=>[...v,p]),c.setMountedPanelIds(v=>v.filter(g=>g!==p))),[p]),S.createElement(oe,rne(tne({},l),{ref:t,sx:[{display:h?void 0:"none"},...lc(a)],className:d(u.panel,i),role:"tabpanel",id:p,"aria-labelledby":c.getTabId(n)}),m)});W5.displayName="@mantine/core/TabsPanel";var ane=Object.defineProperty,ine=Object.defineProperties,sne=Object.getOwnPropertyDescriptors,Mj=Object.getOwnPropertySymbols,lne=Object.prototype.hasOwnProperty,cne=Object.prototype.propertyIsEnumerable,Lj=(e,t,r)=>t in e?ane(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hi=(e,t)=>{for(var r in t||(t={}))lne.call(t,r)&&Lj(e,r,t[r]);if(Mj)for(var r of Mj(t))cne.call(t,r)&&Lj(e,r,t[r]);return e},zj=(e,t)=>ine(e,sne(t));function une(e,{orientation:t,color:r,radius:n,inverted:o,placement:a},i){const l=t==="vertical",c=e.fn.variant({color:r,variant:"filled"}),u=P(e.fn.radius(n)),d=t==="vertical"?a==="left"?`${u} 0 0 ${u}`:` 0 ${u} ${u} 0`:o?`0 0 ${u} ${u}`:`${u} ${u} 0 0`;return i==="default"?zj(Hi({[l?a==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:`${P(2)} solid transparent`,[l?a==="left"?"marginRight":"marginLeft":o?"marginTop":"marginBottom"]:P(-2),borderRadius:d},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3]})),{"&[data-active]":Hi({borderColor:c.background,color:e.colorScheme==="dark"?e.white:e.black},e.fn.hover({borderColor:c.background}))}):i==="outline"?{borderRadius:d,border:`${P(1)} solid transparent`,[l?a==="left"?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:"none","&[data-active]":{borderColor:e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[3],"&::before":{content:'""',backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,position:"absolute",bottom:l?0:o?"unset":P(-1),top:l?0:o?P(-1):"unset",[l?"width":"height"]:P(1),right:l?a==="left"?P(-1):"unset":0,left:l?a==="left"?"unset":P(-1):0}}}:i==="pills"?zj(Hi({borderRadius:e.fn.radius(n)},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Hi({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var dne=W((e,t,{variant:r})=>({tabLabel:{},tab:Hi({position:"relative",padding:`${e.spacing.xs} ${e.spacing.md}`,paddingLeft:t.withIcon?e.spacing.xs:void 0,paddingRight:t.withRightSection?e.spacing.xs:void 0,fontSize:e.fontSizes.sm,whiteSpace:"nowrap",zIndex:0,display:"flex",alignItems:"center",justifyContent:t.orientation==="horizontal"?"center":void 0,lineHeight:1,"&:disabled":Hi({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},une(e,t,r)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:P(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:P(7)}}}));const fne=dne;var pne=Object.defineProperty,hne=Object.defineProperties,mne=Object.getOwnPropertyDescriptors,Hp=Object.getOwnPropertySymbols,H5=Object.prototype.hasOwnProperty,q5=Object.prototype.propertyIsEnumerable,Fj=(e,t,r)=>t in e?pne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gne=(e,t)=>{for(var r in t||(t={}))H5.call(t,r)&&Fj(e,r,t[r]);if(Hp)for(var r of Hp(t))q5.call(t,r)&&Fj(e,r,t[r]);return e},vne=(e,t)=>hne(e,mne(t)),yne=(e,t)=>{var r={};for(var n in e)H5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Hp)for(var n of Hp(e))t.indexOf(n)<0&&q5.call(e,n)&&(r[n]=e[n]);return r};const xne={},G5=f.forwardRef((e,t)=>{const r=q("TabsTab",xne,e),{value:n,children:o,onKeyDown:a,onClick:i,className:l,icon:c,rightSection:u,color:d}=r,p=yne(r,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),h=J0(),m=!!c,v=!!u,{theme:g,classes:_,cx:y}=fne({withIcon:m||v&&!o,withRightSection:v||m&&!o,orientation:h.orientation,color:d||h.color,radius:h.radius,inverted:h.inverted,placement:h.placement},{name:"Tabs",unstyled:h.unstyled,classNames:h.classNames,styles:h.styles,variant:h.variant}),x=n===h.value,w=h.getPanelId(n),b=h.mountedPanelIds.includes(n)?w:void 0,O=C=>{h.onTabChange(h.allowTabDeactivation&&n===h.value?null:n),i==null||i(C)};return S.createElement(ho,vne(gne({},p),{unstyled:h.unstyled,className:y(_.tab,l),"data-active":x||void 0,ref:t,type:"button",role:"tab",id:h.getTabId(n),"aria-selected":x,tabIndex:x||h.value===null?0:-1,"aria-controls":b,onClick:O,onKeyDown:JC({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:h.activateTabWithKeyboard,loop:h.loop,dir:g.dir,orientation:h.orientation,onKeyDown:a})}),c&&S.createElement("span",{className:_.tabIcon},c),o&&S.createElement("span",{className:_.tabLabel},o),u&&S.createElement("span",{className:_.tabRightSection},u))});G5.displayName="@mantine/core/Tab";function Q5({defaultValue:e,value:t,onTabChange:r,orientation:n,children:o,loop:a,id:i,activateTabWithKeyboard:l,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,placement:m,keepMounted:v=!0,classNames:g,styles:_,unstyled:y}){const x=kr(i),[w,b]=f.useState([]),[O,C]=Er({value:t,defaultValue:e,finalValue:null,onChange:r});return S.createElement(Nre,{value:{placement:m,value:O,orientation:n,id:x,loop:a,activateTabWithKeyboard:l,getTabId:sx(`${x}-tab`,qv.value),getPanelId:sx(`${x}-panel`,qv.value),onTabChange:C,setMountedPanelIds:b,mountedPanelIds:w,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,keepMounted:v,classNames:g,styles:_,unstyled:y}},o)}Q5.displayName="@mantine/core/TabsProvider";var wne=W((e,{orientation:t,placement:r})=>({root:{display:t==="vertical"?"flex":void 0,flexDirection:r==="right"?"row-reverse":"row"}}));const bne=wne;var _ne=Object.defineProperty,Sne=Object.defineProperties,Pne=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,K5=Object.prototype.hasOwnProperty,Y5=Object.prototype.propertyIsEnumerable,Vj=(e,t,r)=>t in e?_ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jne=(e,t)=>{for(var r in t||(t={}))K5.call(t,r)&&Vj(e,r,t[r]);if(qp)for(var r of qp(t))Y5.call(t,r)&&Vj(e,r,t[r]);return e},One=(e,t)=>Sne(e,Pne(t)),Cne=(e,t)=>{var r={};for(var n in e)K5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qp)for(var n of qp(e))t.indexOf(n)<0&&Y5.call(e,n)&&(r[n]=e[n]);return r};const Ene={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},Ue=f.forwardRef((e,t)=>{const r=q("Tabs",Ene,e),{defaultValue:n,value:o,orientation:a,loop:i,activateTabWithKeyboard:l,allowTabDeactivation:c,children:u,id:d,onTabChange:p,variant:h,color:m,className:v,unstyled:g,classNames:_,styles:y,radius:x,inverted:w,keepMounted:b,placement:O}=r,C=Cne(r,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:j,cx:E}=bne({orientation:a,color:m,radius:x,inverted:w,placement:O},{unstyled:g,name:"Tabs",classNames:_,styles:y,variant:h});return S.createElement(Q5,{activateTabWithKeyboard:l,defaultValue:n,orientation:a,onTabChange:p,value:o,id:d,loop:i,allowTabDeactivation:c,color:m,variant:h,radius:x,inverted:w,keepMounted:b,placement:O,classNames:_,styles:y,unstyled:g},S.createElement(oe,One(jne({},C),{className:E(j.root,v),id:d,ref:t}),u))});Ue.List=V5;Ue.Tab=G5;Ue.Panel=W5;Ue.displayName="@mantine/core/Tabs";var $ne=Object.defineProperty,kne=Object.defineProperties,Rne=Object.getOwnPropertyDescriptors,Bj=Object.getOwnPropertySymbols,Tne=Object.prototype.hasOwnProperty,Ine=Object.prototype.propertyIsEnumerable,Uj=(e,t,r)=>t in e?$ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dne=(e,t)=>{for(var r in t||(t={}))Tne.call(t,r)&&Uj(e,r,t[r]);if(Bj)for(var r of Bj(t))Ine.call(t,r)&&Uj(e,r,t[r]);return e},Nne=(e,t)=>kne(e,Rne(t));function Ane(e,t,r){return typeof e<"u"?e in r.headings.sizes?r.headings.sizes[e].fontSize:P(e):r.headings.sizes[t].fontSize}function Mne(e,t,r){return typeof e<"u"&&e in r.headings.sizes?r.headings.sizes[e].lineHeight:r.headings.sizes[t].lineHeight}var Lne=W((e,{element:t,weight:r,inline:n},{size:o})=>({root:Nne(Dne({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:r||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:Ane(o,t,e),lineHeight:n?1:Mne(o,t,e),margin:0})}));const zne=Lne;var Fne=Object.defineProperty,Gp=Object.getOwnPropertySymbols,X5=Object.prototype.hasOwnProperty,J5=Object.prototype.propertyIsEnumerable,Wj=(e,t,r)=>t in e?Fne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Vne=(e,t)=>{for(var r in t||(t={}))X5.call(t,r)&&Wj(e,r,t[r]);if(Gp)for(var r of Gp(t))J5.call(t,r)&&Wj(e,r,t[r]);return e},Bne=(e,t)=>{var r={};for(var n in e)X5.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gp)for(var n of Gp(e))t.indexOf(n)<0&&J5.call(e,n)&&(r[n]=e[n]);return r};const Une={order:1},de=f.forwardRef((e,t)=>{const r=q("Title",Une,e),{className:n,order:o,children:a,unstyled:i,size:l,weight:c,inline:u,variant:d}=r,p=Bne(r,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:h,cx:m}=zne({element:`h${o}`,weight:c,inline:u},{name:"Title",unstyled:i,variant:d,size:l});return[1,2,3,4,5,6].includes(o)?S.createElement(te,Vne({variant:d,component:`h${o}`,ref:t,className:m(h.root,n)},p),a):null});de.displayName="@mantine/core/Title";function Gv(e,t){return Gv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Gv(e,t)}function Z5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Gv(e,t)}var eN={exports:{}},Wne="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Hne=Wne,qne=Hne;function tN(){}function rN(){}rN.resetWarningCache=tN;var Gne=function(){function e(n,o,a,i,l,c){if(c!==qne){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:rN,resetWarningCache:tN};return r.PropTypes=r,r};eN.exports=Gne();var Qne=eN.exports;const Te=yy(Qne),Hj={disabled:!1},Qp=S.createContext(null);var vl="unmounted",ka="exited",Ra="entering",Ri="entered",Qv="exiting",$o=function(e){Z5(t,e);function t(n,o){var a;a=e.call(this,n,o)||this;var i=o,l=i&&!i.isMounting?n.enter:n.appear,c;return a.appearStatus=null,n.in?l?(c=ka,a.appearStatus=Ra):c=Ri:n.unmountOnExit||n.mountOnEnter?c=vl:c=ka,a.state={status:c},a.nextCallback=null,a}t.getDerivedStateFromProps=function(o,a){var i=o.in;return i&&a.status===vl?{status:ka}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var a=null;if(o!==this.props){var i=this.state.status;this.props.in?i!==Ra&&i!==Ri&&(a=Ra):(i===Ra||i===Ri)&&(a=Qv)}this.updateStatus(!1,a)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,a,i,l;return a=i=l=o,o!=null&&typeof o!="number"&&(a=o.exit,i=o.enter,l=o.appear!==void 0?o.appear:i),{exit:a,enter:i,appear:l}},r.updateStatus=function(o,a){o===void 0&&(o=!1),a!==null?(this.cancelNextCallback(),a===Ra?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===ka&&this.setState({status:vl})},r.performEnter=function(o){var a=this,i=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[eg.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!i||Hj.disabled){this.safeSetState({status:Ri},function(){a.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Ra},function(){a.props.onEntering(u,d),a.onTransitionEnd(h,function(){a.safeSetState({status:Ri},function(){a.props.onEntered(u,d)})})})},r.performExit=function(){var o=this,a=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:eg.findDOMNode(this);if(!a||Hj.disabled){this.safeSetState({status:ka},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Qv},function(){o.props.onExiting(l),o.onTransitionEnd(i.exit,function(){o.safeSetState({status:ka},function(){o.props.onExited(l)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,a){a=this.setNextCallback(a),this.setState(o,a)},r.setNextCallback=function(o){var a=this,i=!0;return this.nextCallback=function(l){i&&(i=!1,a.nextCallback=null,o(l))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},r.onTransitionEnd=function(o,a){this.setNextCallback(a);var i=this.props.nodeRef?this.props.nodeRef.current:eg.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!i||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===vl)return null;var a=this.props,i=a.children;a.in,a.mountOnEnter,a.unmountOnExit,a.appear,a.enter,a.exit,a.timeout,a.addEndListener,a.onEnter,a.onEntering,a.onEntered,a.onExit,a.onExiting,a.onExited,a.nodeRef;var l=G0(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return S.createElement(Qp.Provider,{value:null},typeof i=="function"?i(o,l):S.cloneElement(S.Children.only(i),l))},t}(S.Component);$o.contextType=Qp;$o.propTypes={};function Oi(){}$o.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Oi,onEntering:Oi,onEntered:Oi,onExit:Oi,onExiting:Oi,onExited:Oi};$o.UNMOUNTED=vl;$o.EXITED=ka;$o.ENTERING=Ra;$o.ENTERED=Ri;$o.EXITING=Qv;const Kne=$o;function Yne(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Z0(e,t){var r=function(a){return t&&f.isValidElement(a)?t(a):a},n=Object.create(null);return e&&f.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function Xne(e,t){e=e||{},t=t||{};function r(d){return d in t?t[d]:e[d]}var n=Object.create(null),o=[];for(var a in e)a in t?o.length&&(n[a]=o,o=[]):o.push(a);var i,l={};for(var c in t){if(n[c])for(i=0;i<n[c].length;i++){var u=n[c][i];l[n[c][i]]=r(u)}l[c]=r(c)}for(i=0;i<o.length;i++)l[o[i]]=r(o[i]);return l}function Ma(e,t,r){return r[t]!=null?r[t]:e.props[t]}function Jne(e,t){return Z0(e.children,function(r){return f.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Ma(r,"appear",e),enter:Ma(r,"enter",e),exit:Ma(r,"exit",e)})})}function Zne(e,t,r){var n=Z0(e.children),o=Xne(t,n);return Object.keys(o).forEach(function(a){var i=o[a];if(f.isValidElement(i)){var l=a in t,c=a in n,u=t[a],d=f.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[a]=f.cloneElement(i,{onExited:r.bind(null,i),in:!0,exit:Ma(i,"exit",e),enter:Ma(i,"enter",e)}):!c&&l&&!d?o[a]=f.cloneElement(i,{in:!1}):c&&l&&f.isValidElement(u)&&(o[a]=f.cloneElement(i,{onExited:r.bind(null,i),in:u.props.in,exit:Ma(i,"exit",e),enter:Ma(i,"enter",e)}))}}),o}var eoe=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},toe={component:"div",childFactory:function(t){return t}},e1=function(e){Z5(t,e);function t(n,o){var a;a=e.call(this,n,o)||this;var i=a.handleExited.bind(Yne(a));return a.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},a}var r=t.prototype;return r.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},r.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,a){var i=a.children,l=a.handleExited,c=a.firstRender;return{children:c?Jne(o,l):Zne(o,i,l),firstRender:!1}},r.handleExited=function(o,a){var i=Z0(this.props.children);o.key in i||(o.props.onExited&&o.props.onExited(a),this.mounted&&this.setState(function(l){var c=tt({},l.children);return delete c[o.key],{children:c}}))},r.render=function(){var o=this.props,a=o.component,i=o.childFactory,l=G0(o,["component","childFactory"]),c=this.state.contextValue,u=eoe(this.state.children).map(i);return delete l.appear,delete l.enter,delete l.exit,a===null?S.createElement(Qp.Provider,{value:c},u):S.createElement(Qp.Provider,{value:c},S.createElement(a,l,u))},t}(S.Component);e1.propTypes={};e1.defaultProps=toe;const roe=e1,[noe,Oc]=qA("mantine-notifications"),pe=Oc("show"),ooe=Oc("hide"),aoe=Oc("clean"),ioe=Oc("cleanQueue"),yl=Oc("update"),po={show:pe,hide:ooe,clean:aoe,cleanQueue:ioe,update:yl};function soe([e,t],r){const n={};return e==="top"&&(n.top=r),e==="bottom"&&(n.bottom=r),t==="left"&&(n.left=r),t==="right"&&(n.right=r),t==="center"&&(n.left="50%",n.transform="translateX(-50%)"),n}var loe=Object.defineProperty,qj=Object.getOwnPropertySymbols,coe=Object.prototype.hasOwnProperty,uoe=Object.prototype.propertyIsEnumerable,Gj=(e,t,r)=>t in e?loe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qj=(e,t)=>{for(var r in t||(t={}))coe.call(t,r)&&Gj(e,r,t[r]);if(qj)for(var r of qj(t))uoe.call(t,r)&&Gj(e,r,t[r]);return e};const Kj={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},doe={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function foe({state:e,maxHeight:t,positioning:r,transitionDuration:n}){const[o,a]=r,i=a==="center"?`${o}-center`:a,l={opacity:0,maxHeight:t,transform:Kj[i],transitionDuration:`${n}ms, ${n}ms, ${n}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},c={opacity:1,transform:doe[i]},u={opacity:0,maxHeight:0,transform:Kj[i]},d={entering:c,entered:c,exiting:u,exited:u};return Qj(Qj({},l),d[e])}function poe(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}var hoe=Object.defineProperty,moe=Object.defineProperties,goe=Object.getOwnPropertyDescriptors,Kp=Object.getOwnPropertySymbols,nN=Object.prototype.hasOwnProperty,oN=Object.prototype.propertyIsEnumerable,Yj=(e,t,r)=>t in e?hoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xj=(e,t)=>{for(var r in t||(t={}))nN.call(t,r)&&Yj(e,r,t[r]);if(Kp)for(var r of Kp(t))oN.call(t,r)&&Yj(e,r,t[r]);return e},voe=(e,t)=>moe(e,goe(t)),Jj=(e,t)=>{var r={};for(var n in e)nN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Kp)for(var n of Kp(e))t.indexOf(n)<0&&oN.call(e,n)&&(r[n]=e[n]);return r};function aN(e){var t=e,{notification:r,autoClose:n,onHide:o,innerRef:a}=t,i=Jj(t,["notification","autoClose","onHide","innerRef"]);const l=r,{autoClose:c,message:u}=l,d=Jj(l,["autoClose","message"]),p=poe(n,c),h=f.useRef(),m=()=>{o(r.id),window.clearTimeout(h.current)},v=()=>{clearTimeout(h.current)},g=()=>{typeof p=="number"&&(h.current=window.setTimeout(m,p))};return f.useEffect(()=>{typeof r.onOpen=="function"&&r.onOpen(r)},[]),f.useEffect(()=>(g(),v),[n,r.autoClose]),S.createElement(ED,voe(Xj(Xj({},d),i),{onClose:m,onMouseEnter:v,onMouseLeave:g,ref:a}),u)}aN.displayName="@mantine/notifications/NotificationContainer";var yoe=W((e,{zIndex:t})=>({notifications:{width:`calc(100% - ${e.spacing.md} * 2)`,boxSizing:"border-box",position:"fixed",zIndex:t},notification:{"&:not(:first-of-type)":{marginTop:e.spacing.sm}}}));const xoe=yoe;var woe=Object.defineProperty,boe=Object.defineProperties,_oe=Object.getOwnPropertyDescriptors,Zj=Object.getOwnPropertySymbols,Soe=Object.prototype.hasOwnProperty,Poe=Object.prototype.propertyIsEnumerable,eO=(e,t,r)=>t in e?woe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,joe=(e,t)=>{for(var r in t||(t={}))Soe.call(t,r)&&eO(e,r,t[r]);if(Zj)for(var r of Zj(t))Poe.call(t,r)&&eO(e,r,t[r]);return e},Ooe=(e,t)=>boe(e,_oe(t));function Coe({limit:e}){const{state:t,queue:r,update:n,cleanQueue:o}=CL({initialValues:[],limit:e});return{notifications:t,queue:r,showNotification:u=>{const d=u.id||Oh();return n(p=>u.id&&p.some(h=>h.id===u.id)?p:[...p,Ooe(joe({},u),{id:d})]),d},updateNotification:u=>n(d=>{const p=d.findIndex(m=>m.id===u.id);if(p===-1)return d;const h=[...d];return h[p]=u,h}),hideNotification:u=>n(d=>d.filter(p=>p.id===u?(typeof p.onClose=="function"&&p.onClose(p),!1):!0)),cleanQueue:o,clean:()=>n(()=>[])}}var Eoe=Object.defineProperty,Yp=Object.getOwnPropertySymbols,iN=Object.prototype.hasOwnProperty,sN=Object.prototype.propertyIsEnumerable,tO=(e,t,r)=>t in e?Eoe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_g=(e,t)=>{for(var r in t||(t={}))iN.call(t,r)&&tO(e,r,t[r]);if(Yp)for(var r of Yp(t))sN.call(t,r)&&tO(e,r,t[r]);return e},$oe=(e,t)=>{var r={};for(var n in e)iN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yp)for(var n of Yp(e))t.indexOf(n)<0&&sN.call(e,n)&&(r[n]=e[n]);return r};const koe=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],ui=e=>{var t=e,{className:r,position:n="bottom-right",autoClose:o=4e3,transitionDuration:a=250,containerWidth:i=P(440),notificationMaxHeight:l=P(200),limit:c=5,zIndex:u=Rn("overlay"),style:d,children:p,target:h}=t,m=$oe(t,["className","position","autoClose","transitionDuration","containerWidth","notificationMaxHeight","limit","zIndex","style","children","target"]);const v=_L(),g=f.useRef({}),_=f.useRef(0),{notifications:y,showNotification:x,updateNotification:w,hideNotification:b,clean:O,cleanQueue:C}=Coe({limit:c}),{classes:j,cx:E,theme:T}=xoe({zIndex:u}),$=Ch(),k=(T.respectReducedMotion?$:!1)?1:a,D=(koe.includes(n)?n:"bottom-right").split("-");on(()=>{y.length>_.current&&setTimeout(()=>v(),0),_.current=y.length},[y]),noe({show:x,hide:b,update:w,clean:O,cleanQueue:C});const N=y.map(z=>S.createElement(Kne,{key:z.id,timeout:k,onEnter:()=>g.current[z.id].offsetHeight,nodeRef:{current:g.current[z.id]}},H=>S.createElement(aN,{innerRef:K=>{g.current[z.id]=K},notification:z,onHide:b,className:j.notification,autoClose:o,sx:[_g({},foe({state:H,positioning:D,transitionDuration:k,maxHeight:l})),...Array.isArray(z.sx)?z.sx:[z.sx]]})));return S.createElement(S0,{target:h},S.createElement(oe,_g({className:E(j.notifications,r),style:d,sx:_g({maxWidth:i},soe(D,T.spacing.md))},m),S.createElement(roe,null,N)))};ui.displayName="@mantine/notifications/Notifications";ui.show=po.show;ui.hide=po.hide;ui.update=po.update;ui.clean=po.clean;ui.cleanQueue=po.cleanQueue;var Roe=class{constructor(e,t){this.operator=e,this.child=t}toString(){return`${this.operator}(${this.child.toString()})`}},Cc=class{constructor(e,t,r){this.operator=e,this.left=t,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}},Toe=class{constructor(){this.prefixParselets={},this.infixParselets={}}registerInfix(e,t){return this.infixParselets[e]=t,this}registerPrefix(e,t){return this.prefixParselets[e]=t,this}prefix(e,t,r){return this.registerPrefix(e,{parse(n,o){let a=n.consumeAndParse(t);return r(o,a)}})}infixLeft(e,t,r){return this.registerInfix(e,{parse(n,o,a){let i=n.consumeAndParse(t);return r(o,a,i)},precedence:t})}construct(e){return new Ioe(e,this.prefixParselets,this.infixParselets)}},Ioe=class{constructor(e,t,r){this.tokens=e,this.prefixParselets=t,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(e){var t;return((t=this.peek())==null?void 0:t.id)!==e?!1:(this.consume(),!0)}consumeAndParse(e=1/0){let t=this.consume(),r=this.prefixParselets[t.id];if(!r)throw Error(`Parse error at "${t.value}" (line ${t.line}, column ${t.column}). No matching prefix parselet.`);let n=r.parse(this,t);for(;e>this.getPrecedence();){let o=this.consume();n=this.getInfixParselet(o).parse(this,n,o)}return n}getPrecedence(){let e=this.peek();if(!e)return 1/0;let t=this.getInfixParselet(e);return t?t.precedence:1/0}consume(e,t){var r,n;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(e&&((r=this.peek())==null?void 0:r.id)!==e){let o=this.peek();throw Error(`Expected ${e} but got "${o.id}" at line ${o.line} column ${o.column}.`)}if(t&&((n=this.peek())==null?void 0:n.value)!==t){let o=this.peek();throw Error(`Expected "${t}" but got "${o.value}" at line ${o.line} column ${o.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(e=>e.id!=="Comment")}getInfixParselet(e){return this.infixParselets[e.id==="Symbol"?e.value:e.id]}};function dt(e){let t=Ze(e),r=bo(e);return r===t?{reference:t}:{reference:t,display:r}}function Ze(e){return hi(e)?e.reference:`${e.resourceType}/${e.id}`}function t1(e){if(e)return hi(e)?e.reference.split("/")[1]:e.id}function Doe(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function bo(e){var t;if(Doe(e)){let r=Noe(e);if(r)return r}if(e.resourceType==="Device"){let r=Aoe(e);if(r)return r}return e.resourceType==="Observation"&&"code"in e&&((t=e.code)!=null&&t.text)?e.code.text:e.resourceType==="User"&&e.email?e.email:"name"in e&&e.name&&typeof e.name=="string"?e.name:Ze(e)}function Noe(e){let t=e.name;if(t&&t.length>0)return Ec(t[0])}function Aoe(e){let t=e.deviceName;if(t&&t.length>0)return t[0].name}function Moe(e){if(!("photo"in e))return;let t=e.photo;if(t)if(Array.isArray(t))for(let r of t){let n=rO(r);if(n)return n}else return rO(t)}function rO(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function lN(e,t){let r=new Date(e);r.setUTCHours(0,0,0,0);let n=t?new Date(t):new Date;n.setUTCHours(0,0,0,0);let o=r.getUTCFullYear(),a=r.getUTCMonth(),i=r.getUTCDate(),l=n.getUTCFullYear(),c=n.getUTCMonth(),u=n.getUTCDate(),d=l-o;(c<a||c===a&&u<i)&&d--;let p=l*12+c-(o*12+a);u<i&&p--;let h=Math.floor((n.getTime()-r.getTime())/(1e3*60*60*24));return{years:d,months:p,days:h}}function Loe(e,t){let{years:r,months:n,days:o}=lN(e,t);return r>=2?r.toString().padStart(3,"0")+"Y":n>=1?n.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function r1(e,...t){var n;let r=e;for(let o=0;o<t.length&&r;o++)r=(n=r==null?void 0:r.extension)==null?void 0:n.find(a=>a.url===t[o]);return r}function ar(e,t){return JSON.stringify(e,zoe,t?2:void 0)}function zoe(e,t){return!Foe(e)&&Qo(t)?void 0:t}function Foe(e){return!!/\d+$/.exec(e)}function Qo(e){if(e==null)return!0;let t=typeof e;return t==="string"&&e===""||t==="object"&&Object.keys(e).length===0}function rm(e,t,r){return e===t||Qo(e)&&Qo(t)?!0:Qo(e)||Qo(t)?!1:Array.isArray(e)&&Array.isArray(t)?Voe(e,t):Array.isArray(e)||Array.isArray(t)?!1:nO(e)&&nO(t)?Boe(e,t,r):!1}function Voe(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!rm(e[r],t[r]))return!1;return!0}function Boe(e,t,r){let n=new Set;Object.keys(e).forEach(o=>n.add(o)),Object.keys(t).forEach(o=>n.add(o)),r==="meta"&&(n.delete("versionId"),n.delete("lastUpdated"),n.delete("author"));for(let o of n){let a=e[o],i=t[o];if(!rm(a,i,o))return!1}return!0}function di(e){return JSON.parse(JSON.stringify(e))}function cN(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function nO(e){return e!==null&&typeof e=="object"}var uN=[];for(let e=0;e<256;e++)uN.push(e.toString(16).padStart(2,"0"));function Uoe(e){let t=new Uint8Array(e),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=uN[t[n]];return r.join("")}function Woe(e){let t=new Uint8Array(e),r=[];for(let n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return window.btoa(r.join(""))}function pr(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Hoe(e,t){var r,n;return(n=(r=e.coding)==null?void 0:r.find(o=>o.system===t))==null?void 0:n.code}var oO=e=>new Promise(t=>{setTimeout(t,e)});function qoe(e,t){let r=[];if(e.line&&r.push(...e.line),e.city||e.state||e.postalCode){let n=[];e.city&&n.push(e.city),e.state&&n.push(e.state),e.postalCode&&n.push(e.postalCode),r.push(n.join(", "))}return e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.join((t==null?void 0:t.lineSeparator)??", ").trim()}function Ec(e,t){let r=[];return e.prefix&&(t==null?void 0:t.prefix)!==!1&&r.push(...e.prefix),e.given&&r.push(...e.given),e.family&&r.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&r.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&r.push("["+e.use+"]"),r.length===0&&e.text?e.text:r.join(" ").trim()}function nm(e){return e instanceof Date&&!isNaN(e.getTime())}function Goe(e,t,r){if(!e)return"";let n=new Date("2000-01-01T"+e+"Z");return nm(n)?n.toLocaleTimeString(t,r):""}function $r(e,t,r){if(!e)return"";let n=new Date(e);return nm(n)?n.toLocaleString(t,r):""}function Qoe(e,t,r){return!e||!e.start&&!e.end?"":$r(e.start,t,r)+" - "+$r(e.end,t,r)}var Koe={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},Yoe={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},Xoe={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function dN(e){if(!e)return"";let t=[];return Joe(t,e.repeat),e.event&&t.push(e.event.map(r=>$r(r)).join(", ")),pr(t.join(" ").trim())}function Joe(e,t){if(!(t!=null&&t.periodUnit))return;let r=t.frequency??1,n=t.period??1,o=t.periodUnit;r===1&&n===1?e.push(Koe[o]):(r===1?e.push("once"):e.push(r+" times"),n===1?e.push("per "+Yoe[o]):e.push("per "+n+" "+Xoe[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(pr).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(a=>Goe(a)).join(", "))}function rc(e,t,r=!1){if(r&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");let n=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(n==null?void 0:n.value)!==void 0&&(o==null?void 0:o.value)===void 0?r&&t!==void 0?(n.value=tae(n.value,t),`> ${Vo(n,t)}`):`>= ${Vo(n,t)}`:(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)!==void 0?r&&t!==void 0?(o.value=eae(o.value,t),`< ${Vo(o,t)}`):`<= ${Vo(o,t)}`:((n==null?void 0:n.unit)===(o==null?void 0:o.unit)&&(n==null||delete n.unit),`${Vo(n,t)} - ${Vo(o,t)}`)}function Vo(e,t){if(!e)return"";let r=[];return e.comparator&&(r.push(e.comparator),r.push(" ")),e.value!==void 0&&(t!==void 0?r.push(e.value.toFixed(t)):r.push(e.value)),e.unit&&(e.unit!=="%"&&r[r.length-1]!==" "&&r.push(" "),r.push(e.unit)),r.join("").trim()}function Zoe(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ys(e){return e?e.text?e.text:e.coding?e.coding.map(t=>fi(t)).join(", "):"":""}function fi(e){return(e==null?void 0:e.display)??(e==null?void 0:e.code)??""}function fN(e){return e?"component"in e?e.component.map(t=>fN(t)).join(" / "):e.valueQuantity?Vo(e.valueQuantity):e.valueCodeableConcept?ys(e.valueCodeableConcept):e.valueString?e.valueString:"":""}function eae(e,t,r=1){return(pN(e,t)+r)*Math.pow(10,-t)}function tae(e,t,r=1){return(pN(e,t)-r)*Math.pow(10,-t)}function pN(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function rae(e){let t=e.max&&e.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:e.max;return{path:"",description:"",type:e.type??[],min:e.min??0,max:t??1,isArray:!!t&&t>1,constraints:[]}}function nae(e){let t=Object.create(null);for(let[r,n]of Object.entries(e))t[r]={name:r,elements:Object.fromEntries(Object.entries(n.elements).map(([o,a])=>[o,rae(a)])),constraints:[],innerTypes:[]};return t}var oae={Element:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},BackboneElement:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},Address:{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"}]}}},Age:{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"}]}}},Annotation:{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"}]}}},Attachment:{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"}]}}},CodeableConcept:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Coding:{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"}]}}},ContactDetail:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},ContactPoint:{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"}]}}},Contributor:{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"}]}}},Count:{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"}]}}},DataRequirement:{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"}]}}},Distance:{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"}]}}},Dosage:{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"}]},maxDosePerLifetime:{type:[{code:"Quantity"}]}}},Duration:{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"}]}}},ElementDefinition:{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"}]}}},Expression:{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"}]}}},Extension:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"string"}]},"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"}]}}},HumanName:{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"}]}}},Identifier:{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"]}]}}},MarketingStatus:{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"}]}}},Meta:{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"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},Money:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},Narrative:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},ParameterDefinition:{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"]}]}}},Period:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},Population:{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"}]}}},ProdCharacteristic:{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"}]}}},ProductShelfLife:{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"}]}}},Quantity:{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"}]}}},Range:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity"}]},high:{type:[{code:"Quantity"}]}}},Ratio:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},Reference:{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"}]}}},RelatedArtifact:{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"]}]}}},SampledData:{elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity"}]},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"}]}}},Signature:{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"}]}}},SubstanceAmount:{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"}]}}},Timing:{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"}]}}},TriggerDefinition:{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"}]}}},UsageContext:{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"]}]}}},MoneyQuantity:{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"}]}}},SimpleQuantity:{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"}]}}},MetadataResource:{elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},IdentityProvider:{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"}]}}}};function we(e){return[{type:V.boolean,value:e}]}function Xn(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:V.integer,value:e}:typeof e=="number"?{type:V.decimal,value:e}:typeof e=="boolean"?{type:V.boolean,value:e}:typeof e=="string"?{type:V.string,value:e}:ln(e)?{type:V.Quantity,value:e}:ko(e)?{type:e.resourceType,value:e}:{type:V.BackboneElement,value:e}}function Ko(e){return e.length===0?!1:!!e[0].value}function _o(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 dr(e,t){if(!e.value)return;let r=pi(e.type,t);return r?aae(e,t,r):iae(e,t)}function aae(e,t,r){let n=r.type;if(!n||n.length===0)return;let o,a="undefined";if(n.length===1)o=e.value[t],a=n[0].code;else for(let l of n){let c=t.replace("[x]","")+pr(l.code);if(c in e.value){o=e.value[c],a=l.code;break}}let i=e.value["_"+t];if(i&&(Array.isArray(o)?o=o.map((l,c)=>i[c]?lO(l??{},i[c]):l):o=lO(o??{},i)),!Qo(o))return(a==="Element"||a==="BackboneElement")&&(a=r.type[0].code),Array.isArray(o)?o.map(l=>aO(l,a)):aO(o,a)}function aO(e,t){return t==="Resource"&&ko(e)&&(t=e.resourceType),{type:t,value:e}}function iae(e,t){let r=e.value;if(!r||typeof r!="object")return;let n;if(t in r)n=r[t];else for(let o in V){let a=t+pr(o);if(a in r){n=r[a];break}}if(!Qo(n))return Array.isArray(n)?n.map(Xn):Xn(n)}function hN(e){let t=[];for(let r of e){let n=!1;for(let o of t)if(Ko(vN(r,o))){n=!0;break}n||t.push(r)}return t}function mN(e){return we(!Ko(e))}function gN(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?we(!1):we(e.every((r,n)=>Ko(vN(r,t[n]))))}function vN(e,t){var o,a;let r=(o=e.value)==null?void 0:o.valueOf(),n=(a=t.value)==null?void 0:a.valueOf();return typeof r=="number"&&typeof n=="number"?we(Math.abs(r-n)<1e-8):ln(r)&&ln(n)?we(wN(r,n)):we(typeof r=="object"&&typeof n=="object"?n1(e,t):r===n)}function yN(e,t){return e.length===0&&t.length===0?we(!0):e.length!==t.length?we(!1):(e.sort(iO),t.sort(iO),we(e.every((r,n)=>Ko(sae(r,t[n])))))}function sae(e,t){let{type:r,value:n}=e,{type:o,value:a}=t,i=n==null?void 0:n.valueOf(),l=a==null?void 0:a.valueOf();return typeof i=="number"&&typeof l=="number"?we(Math.abs(i-l)<.01):ln(i)&&ln(l)?we(wN(i,l)):we(r==="Coding"&&o==="Coding"?typeof i!="object"||typeof l!="object"?!1:i.code===l.code&&i.system===l.system:typeof i=="object"&&typeof l=="object"?n1({...i,id:void 0},{...l,id:void 0}):typeof i=="string"&&typeof l=="string"?i.toLowerCase()===l.toLowerCase():i===l)}function iO(e,t){var o,a;let r=(o=e.value)==null?void 0:o.valueOf(),n=(a=t.value)==null?void 0:a.valueOf();return typeof r=="number"&&typeof n=="number"?r-n:typeof r=="string"&&typeof n=="string"?r.localeCompare(n):0}function xN(e,t){let{value:r}=e;if(r==null)return!1;switch(t){case"Boolean":return typeof r=="boolean";case"Decimal":case"Integer":return typeof r=="number";case"Date":return typeof r=="string"&&!!/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r);case"DateTime":return typeof r=="string"&&!!/^\d{4}(-\d{2}(-\d{2})?)?T/.exec(r);case"Time":return typeof r=="string"&&!!/^T\d/.exec(r);case"Period":return lae(r);case"Quantity":return ln(r);default:return typeof r=="object"&&(r==null?void 0:r.resourceType)===t}}function lae(e){return!!(e&&typeof e=="object"&&"start"in e)}function ln(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function wN(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 n1(e,t){let r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o of r){let a=e[o],i=t[o];if(sO(a)&&sO(i)){if(!n1(a,i))return!1}else if(a!==i)return!1}return!0}function sO(e){return e!==null&&typeof e=="object"}function lO(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}var bN="ok",cae="created",uae="gone",dae="not-modified",fae="not-found",pae="forbidden",hae="accepted",mae={resourceType:"OperationOutcome",id:bN,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},gae={resourceType:"OperationOutcome",id:fae,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},vae={resourceType:"OperationOutcome",id:pae,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Ba(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},expression:t?[t]:void 0}]}}function kt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function yae(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function om(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function _N(e){return e.id===bN||e.id===cae||e.id===dae||e.id===hae}function xae(e){return e.id===uae}var De=class extends Error{constructor(e,t){super(SN(e)),this.outcome=e,this.cause=t}};function ct(e){return e instanceof De?e.outcome:om(e)?e:Ba(Ce(e))}function Ce(e){return e?typeof e=="string"?e:e instanceof Error?e.message:om(e)?SN(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function SN(e){var r;let t=((r=e.issue)==null?void 0:r.map(PN))??[];return t.length>0?t.join("; "):"Unknown error"}function PN(e){var r,n;let t;return(r=e.details)!=null&&r.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(n=e.expression)!=null&&n.length&&(t+=` (${e.expression.join(", ")})`),t}function wae(e){return new Pae(e).parse()}var nc=nae(oae);function bae(e){var r;let t=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];for(let n of t)_ae(n)}function _ae(e){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;let t=wae(e);nc[e.name]=t;for(let r of t.innerTypes)r.parentType=t,nc[r.name]=r}function Sae(e){return!!nc[e]}function o1(e){return nc[e]}function jN(e){let t=nc[e];if(!t)throw new De(yae(Error("Unknown data type: "+e)));return t}var Pae=class{constructor(e){var t;if(!((t=e.snapshot)!=null&&t.element)||e.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${e.name}'`);this.root=e.snapshot.element[0],this.elements=e.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:e.name,url:e.url,kind:e.kind,description:Cae(e),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var t,r,n,o,a;let e=this.next();for(;e;){if(e.sliceName)this.parseSliceStart(e);else if((t=e.id)!=null&&t.includes(":")){if((r=this.slicingContext)!=null&&r.current){let i=Sg(e,this.slicingContext.path);this.slicingContext.current.elements[i]=this.parseElementDefinition(e)}}else{let i=this.parseElementDefinition(e);this.checkFieldEnter(e,i);let l=this.backboneContext;for(;l;){if((n=e.path)!=null&&n.startsWith(l.path+".")){l.type.elements[Sg(e,l.path)]=i;break}l=l.parent}if(!l){let c=Sg(e,this.root.path);e.isSummary&&((o=this.resourceSchema.summaryProperties)==null||o.add(c.replace("[x]",""))),i.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(c.replace("[x]",""))),this.resourceSchema.elements[c]=i}this.checkFieldExit(e)}e=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(e,t){this.isInnerType(e)&&this.enterInnerType(e),e.slicing&&!this.slicingContext&&this.enterSlice(e,t)}enterInnerType(e){var t,r,n;for(;this.backboneContext&&!Ci((t=this.backboneContext)==null?void 0:t.path,e.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:dO(e),description:e.definition,elements:{},constraints:this.parseElementDefinition(e).constraints,innerTypes:[]},path:e.path??"",parent:Ci((r=this.backboneContext)==null?void 0:r.path,e.path)?this.backboneContext:(n=this.backboneContext)==null?void 0:n.parent}}enterSlice(e,t){var r,n,o,a;Oae(e)&&!((r=this.peek())!=null&&r.sliceName)||(t.slicing={discriminator:(((n=e.slicing)==null?void 0:n.discriminator)??[]).map(i=>{if(i.type!=="value"&&i.type!=="pattern"&&i.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${i.type}`);return{path:i.path,type:i.type}}),slices:[],ordered:((o=e.slicing)==null?void 0:o.ordered)??!1,rule:(a=e.slicing)==null?void 0:a.rules},this.slicingContext={field:t.slicing,path:e.path??""})}checkFieldExit(e=void 0){var t;if(this.backboneContext&&!Ci(this.backboneContext.path,e==null?void 0:e.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!Ci(this.backboneContext.path,e==null?void 0:e.path));else this.innerTypes.push(this.backboneContext.type),delete this.backboneContext;this.slicingContext&&!Ci(this.slicingContext.path,e==null?void 0:e.path)&&((t=this.slicingContext)!=null&&t.current&&this.slicingContext.field.slices.push(this.slicingContext.current),delete this.slicingContext)}next(){let e=this.peek();if(e)return this.index++,e}peek(){let e=this.elements[this.index];if(e){if(this.elementIndex[e.path??""]=e,e.contentReference){let t=this.elementIndex[e.contentReference.slice(e.contentReference.indexOf("#")+1)];return t?{...t,id:e.id,path:e.path,min:e.min??t.min,max:e.max??t.max,contentReference:e.contentReference,definition:e.definition}:void 0}return e}}isInnerType(e){var r;let t=this.peek();return!!(Ci(e==null?void 0:e.path,t==null?void 0:t.path)&&((r=e.type)!=null&&r.some(n=>["BackboneElement","Element"].includes(n.code))))}parseSliceStart(e){var t;if(!this.slicingContext)throw new Error("Invalid slice start before discriminator: "+e.sliceName);this.slicingContext.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={name:e.sliceName??"",type:(t=e.type)==null?void 0:t.map(r=>({code:r.code??"",targetProfile:r.targetProfile})),elements:{},min:e.min??0,max:e.max==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e.max,10)}}parseElementDefinition(e){var o,a;let t=cO(e.max),r=(o=e.base)!=null&&o.max?cO(e.base.max):t,n={type:"ElementDefinition",value:e};return{description:e.definition||"",path:e.path||((a=e.base)==null?void 0:a.path)||"",min:e.min??0,max:t,isArray:r>1,constraints:(e.constraint??[]).map(i=>({key:i.key??"",severity:i.severity??"error",expression:i.expression??"",description:i.human??""})),type:(e.type??[]).map(i=>({code:["BackboneElement","Element"].includes(i.code)?dO(e):i.code??"",targetProfile:i.targetProfile})),fixed:uO(dr(n,"fixed")),pattern:uO(dr(n,"pattern")),binding:e.binding}}};function cO(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Sg(e,t=""){return jae(e.path,t)}function jae(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ci(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function uO(e){return Array.isArray(e)&&e.length>0?e[0]:Qo(e)?void 0:e}function Oae(e){var r,n;let t=(r=e.slicing)==null?void 0:r.discriminator;return!!((n=e.type)!=null&&n.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function Cae(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}var V={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 Eae(e){for(let t of e.base??[]){let r=ca.types[t];r||(r={searchParamsDetails:{}},ca.types[t]=r),r.searchParams||(r.searchParams={_id:{base:[t],code:"_id",type:"token",expression:t+".id"},_lastUpdated:{base:[t],code:"_lastUpdated",type:"date",expression:t+".meta.lastUpdated"},_compartment:{base:[t],code:"_compartment",type:"reference",expression:t+".meta.compartment"},_profile:{base:[t],code:"_profile",type:"uri",expression:t+".meta.profile"},_security:{base:[t],code:"_security",type:"token",expression:t+".meta.security"},_source:{base:[t],code:"_source",type:"uri",expression:t+".meta.source"},_tag:{base:[t],code:"_tag",type:"token",expression:t+".meta.tag"}}),r.searchParams[e.code]=e}}function dO(e){var r,n,o,a;let t=(n=(r=e.type)==null?void 0:r[0])==null?void 0:n.code;return t==="BackboneElement"||t==="Element"?$ae((a=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:a.split(".")):t}function $ae(e){return e.length===1?e[0]:e.map(pr).join("")}function a1(e){var t;return(t=ca.types[e])==null?void 0:t.searchParams}function kae(e,t){var r,n;return(n=(r=ca.types[e])==null?void 0:r.searchParams)==null?void 0:n[t]}function Xp(e){return e.replaceAll("[x]","").split(".").pop().split(/(?=[A-Z])/).map(Tae).join(" ").replace("_"," ").replace(/\s+/g," ")}var Rae=new Set(["ID","IP","PKCE","JWKS","URI","URL"]);function Tae(e){let t=e.toUpperCase();return Rae.has(t)?t:t.charAt(0)+e.slice(1)}function pi(e,t){let r=o1(e);if(r)return r.elements[t]??r.elements[t+"[x]"]}function ko(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function hi(e){return!!(e&&typeof e=="object"&&"reference"in e)}var ca={types:{}};function sd(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}}var al=()=>[],xr={empty:(e,t)=>we(t.length===0),exists:(e,t,r)=>we(r?t.filter(n=>Ko(r.eval(e,[n]))).length>0:t.length>0),all:(e,t,r)=>we(t.every(n=>Ko(r.eval(e,[n])))),allTrue:(e,t)=>{for(let r of t)if(!r.value)return we(!1);return we(!0)},anyTrue:(e,t)=>{for(let r of t)if(r.value)return we(!0);return we(!1)},allFalse:(e,t)=>{for(let r of t)if(r.value)return we(!1);return we(!0)},anyFalse:(e,t)=>{for(let r of t)if(!r.value)return we(!0);return we(!1)},subsetOf:al,supersetOf:al,count:(e,t)=>[{type:V.integer,value:t.length}],distinct:(e,t)=>{let r=[];for(let n of t)r.some(o=>o.value===n.value)||r.push(n);return r},isDistinct:(e,t)=>we(t.length===xr.distinct(e,t).length),where:(e,t,r)=>t.filter(n=>Ko(r.eval(e,[n]))),select:(e,t,r)=>t.map(n=>r.eval(e,[n])).flat(),repeat:al,ofType:(e,t,r)=>t.filter(n=>n.type===r.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,r)=>{var o;let n=(o=r.eval(e,t)[0])==null?void 0:o.value;if(typeof n!="number")throw new Error("Expected a number for skip(num)");return n>=t.length?[]:n<=0?t:t.slice(n,t.length)},take:(e,t,r)=>{var o;let n=(o=r.eval(e,t)[0])==null?void 0:o.value;if(typeof n!="number")throw new Error("Expected a number for take(num)");return n>=t.length?t:n<=0?[]:t.slice(0,n)},intersect:(e,t,r)=>{if(!r)return t;let n=r.eval(e,t),o=[];for(let a of t)!o.some(i=>i.value===a.value)&&n.some(i=>i.value===a.value)&&o.push(a);return o},exclude:(e,t,r)=>{if(!r)return t;let n=r.eval(e,t),o=[];for(let a of t)n.some(i=>i.value===a.value)||o.push(a);return o},union:(e,t,r)=>{if(!r)return t;let n=r.eval(e,t);return hN([...t,...n])},combine:(e,t,r)=>{if(!r)return t;let n=r.eval(e,t);return[...t,...n]},htmlChecks:(e,t,r)=>[Xn(!0)],iif:(e,t,r,n,o)=>{let a=r.eval(e,t);if(a.length>1||a.length===1&&typeof a[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Ko(a)?n.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);if(typeof r=="boolean")return[{type:V.boolean,value:r}];if(typeof r=="number"&&(r===0||r===1))return we(!!r);if(typeof r=="string"){let n=r.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(n))return we(!0);if(["false","f","no","n","0","0.0"].includes(n))return we(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:we(xr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);return typeof r=="number"?[{type:V.integer,value:r}]:typeof r=="string"&&/^[+-]?\d+$/.exec(r)?[{type:V.integer,value:parseInt(r,10)}]:typeof r=="boolean"?[{type:V.integer,value:r?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:we(xr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:V.date,value:sd(r)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:we(xr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:V.dateTime,value:sd(r)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:we(xr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);return typeof r=="number"?[{type:V.decimal,value:r}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(r)?[{type:V.decimal,value:parseFloat(r)}]:typeof r=="boolean"?[{type:V.decimal,value:r?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:we(xr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);return ln(r)?[{type:V.Quantity,value:r}]:typeof r=="number"?[{type:V.Quantity,value:{value:r,unit:"1"}}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(r)?[{type:V.Quantity,value:{value:parseFloat(r),unit:"1"}}]:typeof r=="boolean"?[{type:V.Quantity,value:{value:r?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:we(xr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);return r==null?[]:ln(r)?[{type:V.string,value:`${r.value} '${r.unit}'`}]:[{type:V.string,value:r.toString()}]},convertsToString:(e,t)=>t.length===0?[]:we(xr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Fn(t,1);if(typeof r=="string"){let n=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(r);if(n)return[{type:V.time,value:sd("T"+n[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:we(xr.toTime(e,t).length===1),indexOf:(e,t,r)=>Jr((n,o)=>n.indexOf(o),e,t,r),substring:(e,t,r,n)=>Jr((o,a,i)=>{let l=a,c=i?l+i:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,r,n),startsWith:(e,t,r)=>Jr((n,o)=>n.startsWith(o),e,t,r),endsWith:(e,t,r)=>Jr((n,o)=>n.endsWith(o),e,t,r),contains:(e,t,r)=>Jr((n,o)=>n.includes(o),e,t,r),upper:(e,t)=>Jr(r=>r.toUpperCase(),e,t),lower:(e,t)=>Jr(r=>r.toLowerCase(),e,t),replace:(e,t,r,n)=>Jr((o,a,i)=>o.replaceAll(a,i),e,t,r,n),matches:(e,t,r)=>Jr((n,o)=>!!new RegExp(o).exec(n),e,t,r),replaceMatches:(e,t,r,n)=>Jr((o,a,i)=>o.replaceAll(a,i),e,t,r,n),length:(e,t)=>Jr(r=>r.length,e,t),toChars:(e,t)=>Jr(r=>r?r.split(""):void 0,e,t),abs:(e,t)=>Mn(Math.abs,e,t),ceiling:(e,t)=>Mn(Math.ceil,e,t),exp:(e,t)=>Mn(Math.exp,e,t),floor:(e,t)=>Mn(Math.floor,e,t),ln:(e,t)=>Mn(Math.log,e,t),log:(e,t,r)=>Mn((n,o)=>Math.log(n)/Math.log(o),e,t,r),power:(e,t,r)=>Mn(Math.pow,e,t,r),round:(e,t)=>Mn(Math.round,e,t),sqrt:(e,t)=>Mn(Math.sqrt,e,t),truncate:(e,t)=>Mn(r=>r|0,e,t),children:al,descendants:al,trace:(e,t,r)=>(console.log("trace",t,r),t),now:()=>[{type:V.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:V.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:V.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,r,n,o)=>{var u;let a=xr.toDateTime(e,r.eval(e,t));if(a.length===0)throw new Error("Invalid start date");let i=xr.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid end date");let l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");let c=lN(a[0].value,i[0].value);return[{type:V.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,r)=>{let n="";return r instanceof i1?n=r.name:r instanceof l1&&(n=r.left.name+"."+r.right.name),n?t.map(o=>({type:V.boolean,value:xN(o,n)})):[]},not:(e,t)=>xr.toBoolean(e,t).map(r=>({type:V.boolean,value:!r.value})),resolve:(e,t)=>t.map(r=>{let n=r.value,o;if(typeof n=="string")o=n;else if(typeof n=="object"){let a=n;if(a.resource)return Xn(a.resource);a.reference?o=a.reference:a.type&&a.identifier&&(o=`${a.type}?identifier=${a.identifier.system}|${a.identifier.value}`)}if(o!=null&&o.includes("?")){let[a]=o.split("?");return{type:a,value:{resourceType:a}}}if(o!=null&&o.includes("/")){let[a,i]=o.split("/");return{type:a,value:{resourceType:a,id:i}}}return{type:V.BackboneElement,value:void 0}}).filter(r=>!!r.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:r})=>typeof r=="boolean"?{type:V.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof r=="number"?{type:V.BackboneElement,value:{namespace:"System",name:"Integer"}}:ko(r)?{type:V.BackboneElement,value:{namespace:"FHIR",name:r.resourceType}}:{type:V.BackboneElement,value:null}),conformsTo:(e,t,r)=>{let n=r.eval(e,t)[0].value;if(!n.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");let o=n.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(a=>{var i;return{type:V.boolean,value:((i=a.value)==null?void 0:i.resourceType)===o}})}};function Jr(e,t,r,...n){if(r.length===0)return[];let[{value:o}]=Fn(r,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");let a=e(o,...n.map(i=>{var l;return(l=i==null?void 0:i.eval(t,r)[0])==null?void 0:l.value}));return a===void 0?[]:Array.isArray(a)?a.map(Xn):[Xn(a)]}function Mn(e,t,r,...n){if(r.length===0)return[];let[{value:o}]=Fn(r,1),a=ln(o),i=a?o.value:o;if(typeof i!="number")throw new Error("Math function cannot be called with non-number");let l=e(i,...n.map(d=>{var p;return(p=d.eval(t,r)[0])==null?void 0:p.value})),c=a?V.Quantity:r[0].type,u=a?{...o,value:l}:l;return[{type:c,value:u}]}function Fn(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(let r of e)if(r==null)throw new Error("Expected non-null argument");return e}var Iae=class{constructor(e,t){this.original=e,this.child=t}eval(e,t){try{return t.length>0?t.map(r=>this.child.eval(e,[r])).flat():this.child.eval(e,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`)}}toString(){return this.child.toString()}},Ei=class{constructor(e){this.value=e}eval(){return[this.value]}toString(){let e=this.value.value;return typeof e=="string"?`'${e}'`:e.toString()}},i1=class{constructor(e){this.name=e}eval(e,t){if(this.name==="$this")return t;if(this.name.startsWith("%")){let r=e.variables[this.name.slice(1)];if(!r)throw new Error(`Undefined variable ${this.name}`);return[r]}return t.flatMap(r=>this.evalValue(r)).filter(r=>(r==null?void 0:r.value)!==void 0)}evalValue(e){let t=e.value;if(!(!t||typeof t!="object"))return ko(t)&&t.resourceType===this.name?e:dr(e,this.name)}toString(){return this.name}},Dae=class{eval(){return[]}toString(){return"{}"}},Nae=class extends Roe{constructor(e,t,r){super(e,t),this.impl=r}eval(e,t){return this.impl(this.child.eval(e,t))}toString(){return this.operator+this.child.toString()}},s1=class extends Cc{constructor(e,t){super("as",e,t)}eval(e,t){return xr.ofType(e,this.left.eval(e,t),this.right)}},Tr=class extends Cc{},yn=class extends Tr{constructor(e,t,r,n){super(e,t,r),this.impl=n}eval(e,t){let r=this.left.eval(e,t);if(r.length!==1)return[];let n=this.right.eval(e,t);if(n.length!==1)return[];let o=r[0].value,a=n[0].value,i=ln(o)?o.value:o,l=ln(a)?a.value:a,c=this.impl(i,l);return typeof c=="boolean"?we(c):ln(o)?[{type:V.Quantity,value:{...o,value:c}}]:[Xn(c)]}},Aae=class extends Cc{constructor(e,t){super("&",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t),o=[...r,...n];return o.length>0&&o.every(a=>typeof a.value=="string")?[{type:V.string,value:o.map(a=>a.value).join("")}]:o}},Mae=class extends Tr{constructor(e,t){super("contains",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return we(r.some(o=>o.value===n[0].value))}},Lae=class extends Tr{constructor(e,t){super("in",e,t)}eval(e,t){let r=_o(this.left.eval(e,t)),n=this.right.eval(e,t);return r?we(n.some(o=>o.value===r.value)):[]}},l1=class extends Cc{constructor(e,t){super(".",e,t)}eval(e,t){return this.right.eval(e,this.left.eval(e,t))}toString(){return`${this.left.toString()}.${this.right.toString()}`}},ON=class extends Cc{constructor(e,t){super("|",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return hN([...r,...n])}},zae=class extends Tr{constructor(e,t){super("=",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return gN(r,n)}},Fae=class extends Tr{constructor(e,t){super("!=",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return mN(gN(r,n))}},Vae=class extends Tr{constructor(e,t){super("~",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return yN(r,n)}},Bae=class extends Tr{constructor(e,t){super("!~",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return mN(yN(r,n))}},c1=class extends Tr{constructor(e,t){super("is",e,t)}eval(e,t){let r=this.left.eval(e,t);if(r.length!==1)return[];let n=this.right.name;return we(xN(r[0],n))}},Uae=class extends Tr{constructor(e,t){super("and",e,t)}eval(e,t){let r=_o(this.left.eval(e,t),"boolean"),n=_o(this.right.eval(e,t),"boolean");return(r==null?void 0:r.value)===!0&&(n==null?void 0:n.value)===!0?we(!0):(r==null?void 0:r.value)===!1||(n==null?void 0:n.value)===!1?we(!1):[]}},Wae=class extends Tr{constructor(e,t){super("or",e,t)}eval(e,t){let r=_o(this.left.eval(e,t),"boolean"),n=_o(this.right.eval(e,t),"boolean");return(r==null?void 0:r.value)===!1&&(n==null?void 0:n.value)===!1?we(!1):r!=null&&r.value||n!=null&&n.value?we(!0):[]}},Hae=class extends Tr{constructor(e,t){super("xor",e,t)}eval(e,t){let r=_o(this.left.eval(e,t),"boolean"),n=_o(this.right.eval(e,t),"boolean");return!r||!n?[]:we(r.value!==n.value)}},qae=class extends Tr{constructor(e,t){super("implies",e,t)}eval(e,t){let r=_o(this.left.eval(e,t),"boolean"),n=_o(this.right.eval(e,t),"boolean");return(n==null?void 0:n.value)===!0||(r==null?void 0:r.value)===!1?we(!0):!r||!n?[]:we(!1)}},u1=class{constructor(e,t){this.name=e,this.args=t}eval(e,t){let r=xr[this.name];if(!r)throw new Error("Unrecognized function: "+this.name);return r(e,t,...this.args)}toString(){return`${this.name}(${this.args.map(e=>e.toString()).join(", ")})`}},d1=class{constructor(e,t){this.left=e,this.expr=t}eval(e,t){let r=this.expr.eval(e,t);if(r.length!==1)return[];let n=r[0].value;if(typeof n!="number")throw new Error("Invalid indexer expression: should return integer}");let o=this.left.eval(e,t);return n in o?[o[n]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}},Gae=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],Qae=class{constructor(e,t,r,n){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=e,this.keywords=t,this.operators=r,this.dateTimeLiterals=!!(n!=null&&n.dateTimeLiterals),this.symbolRegex=(n==null?void 0:n.symbolRegex)??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){let e=this.consumeToken();e&&this.result.push(e)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();let e=this.consumeToken();return this.reset(),e}consumeToken(){this.consumeWhitespace();let e=this.curr();if(!e)return;this.mark();let t=this.peek();return e==="/"&&t==="*"?this.consumeMultiLineComment():e==="/"&&t==="/"?this.consumeSingleLineComment():e==="'"||e==='"'?this.consumeString(e):e==="`"?this.consumeBacktickSymbol():e==="@"?this.consumeDateTime():/\d/.exec(e)?this.consumeNumber():/\w/.exec(e)?this.consumeSymbol():(e==="$"||e==="%")&&/\w/.exec(t)?this.consumeSymbol():this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){let e=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(e,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
88
+ `))}consumeString(e){this.advance();let t=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==e));return this.advance(),t}consumeBacktickSymbol(){this.advance();let e=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),e}consumeDateTime(){this.advance();let e=this.pos.index;return this.consumeWhile(()=>/[\d-]/.exec(this.curr())),this.curr()==="T"&&(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"?this.advance():(this.curr()==="+"||this.curr()==="-")&&(this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.buildToken("DateTime",this.str.substring(e,this.pos.index))}consumeNumber(){let e=this.pos.index,t="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=e-1,this.consumeDateTime()):(this.curr()===" "&&Kae(this.peekToken())&&(t="Quantity",this.consumeToken()),this.buildToken(t,this.str.substring(e,this.pos.index)))}consumeSymbol(){var t;let e=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((t=this.prevToken())==null?void 0:t.value)!=="."&&this.keywords.includes(e)?this.buildToken(e,e):this.buildToken("Symbol",e)}consumeOperator(){let e=this.curr(),t=this.peek(),r=e+t;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(e,e))}consumeWhile(e){let t=this.pos.index;for(;this.pos.index<this.str.length&&e();)this.advance();return this.str.substring(t,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(){let e=this.markStack.pop();if(!e)throw new Error("No mark to reset to");this.pos.index=e.index,this.pos.line=e.line,this.pos.column=e.column}advance(){this.pos.index++,this.curr()===`
89
+ `?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(e,t){let r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:e,value:t,...r}}};function Kae(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&Gae.includes(e.value)))}var Yae=["true","false"],f1=["!=","!~","<=",">=","{}","->"];function Xae(e){return new Qae(e,Yae,f1).tokenize()}var Ve={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,IntegerDivide: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,Arrow:100,Semicolon:200},Jae={parse(e){var r;let t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((r=e.peek())==null?void 0:r.value)+"`");return t}},Zae={parse(e,t){let r=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new d1(t,r)},precedence:Ve.Indexer},eie={parse(e,t){if(!(t instanceof i1))throw new Error("Unexpected parentheses");let r=[];for(;!e.match(")");)r.push(e.consumeAndParse()),e.match(",");return new u1(t.name,r)},precedence:Ve.FunctionCall};function tie(e){let t=e.split(" "),r=parseFloat(t[0]),n=t[1];return n!=null&&n.startsWith("'")&&n.endsWith("'")?n=n.substring(1,n.length-1):n="{"+n+"}",{value:r,unit:n}}function p1(){return new Toe().registerPrefix("String",{parse:(e,t)=>new Ei({type:V.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Ei({type:V.dateTime,value:sd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Ei({type:V.Quantity,value:tie(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Ei({type:V.decimal,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Ei({type:V.boolean,value:!0})}).registerPrefix("false",{parse:()=>new Ei({type:V.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new i1(t.value)}).registerPrefix("{}",{parse:()=>new Dae}).registerPrefix("(",Jae).registerInfix("[",Zae).registerInfix("(",eie).prefix("+",Ve.UnaryAdd,(e,t)=>new Nae("+",t,r=>r)).prefix("-",Ve.UnarySubtract,(e,t)=>new yn("-",t,t,(r,n)=>-n)).infixLeft(".",Ve.Dot,(e,t,r)=>new l1(e,r)).infixLeft("/",Ve.Divide,(e,t,r)=>new yn("/",e,r,(n,o)=>n/o)).infixLeft("*",Ve.Multiply,(e,t,r)=>new yn("*",e,r,(n,o)=>n*o)).infixLeft("+",Ve.Add,(e,t,r)=>new yn("+",e,r,(n,o)=>n+o)).infixLeft("-",Ve.Subtract,(e,t,r)=>new yn("-",e,r,(n,o)=>n-o)).infixLeft("|",Ve.Union,(e,t,r)=>new ON(e,r)).infixLeft("=",Ve.Equals,(e,t,r)=>new zae(e,r)).infixLeft("!=",Ve.NotEquals,(e,t,r)=>new Fae(e,r)).infixLeft("~",Ve.Equivalent,(e,t,r)=>new Vae(e,r)).infixLeft("!~",Ve.NotEquivalent,(e,t,r)=>new Bae(e,r)).infixLeft("<",Ve.LessThan,(e,t,r)=>new yn("<",e,r,(n,o)=>n<o)).infixLeft("<=",Ve.LessThanOrEquals,(e,t,r)=>new yn("<=",e,r,(n,o)=>n<=o)).infixLeft(">",Ve.GreaterThan,(e,t,r)=>new yn(">",e,r,(n,o)=>n>o)).infixLeft(">=",Ve.GreaterThanOrEquals,(e,t,r)=>new yn(">=",e,r,(n,o)=>n>=o)).infixLeft("&",Ve.Ampersand,(e,t,r)=>new Aae(e,r)).infixLeft("and",Ve.And,(e,t,r)=>new Uae(e,r)).infixLeft("as",Ve.As,(e,t,r)=>new s1(e,r)).infixLeft("contains",Ve.Contains,(e,t,r)=>new Mae(e,r)).infixLeft("div",Ve.Divide,(e,t,r)=>new yn("div",e,r,(n,o)=>n/o|0)).infixLeft("in",Ve.In,(e,t,r)=>new Lae(e,r)).infixLeft("is",Ve.Is,(e,t,r)=>new c1(e,r)).infixLeft("mod",Ve.Modulo,(e,t,r)=>new yn("mod",e,r,(n,o)=>n%o)).infixLeft("or",Ve.Or,(e,t,r)=>new Wae(e,r)).infixLeft("xor",Ve.Xor,(e,t,r)=>new Hae(e,r)).infixLeft("implies",Ve.Implies,(e,t,r)=>new qae(e,r))}var rie=p1();function CN(e){return new Iae(e,rie.construct(Xae(e)).consumeAndParse())}function nie(e,t){let r=Array.isArray(t)?t:[t];for(let n=0;n<r.length;n++){let o=r[n];typeof o=="object"&&"type"in o&&"value"in o||(r[n]=Xn(r[n]))}return h1(e,r).map(n=>n.value)}function h1(e,t,r){let n=r??{};return CN(e).eval({variables:n},t).map(o=>{var a;return{type:o.type,value:(a=o.value)==null?void 0:a.valueOf()}})}var Bo=(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))(Bo||{});function m1(e,t){var n,o;let r=(o=(n=ca.types[e])==null?void 0:n.searchParamsDetails)==null?void 0:o[t.code];return r||(r=aie(e,t)),r}function oie(e,t,r){let n=ca.types[e];n.searchParamsDetails||(n.searchParamsDetails={}),n.searchParamsDetails[t]=r}function aie(e,t){let r=t.code,n=lie(r),o=uie(e,t.expression),a={elementDefinitions:[],propertyTypes:new Set,array:!1};for(let l of o){let c=Rl(l);c.length===1&&c[0]instanceof Tr?a.propertyTypes.add("boolean"):EN(a,Rl(l),e,1)}let i={columnName:n,type:cie(t,a.propertyTypes),elementDefinitions:a.elementDefinitions,array:a.array};return oie(e,r,i),i}function EN(e,t,r,n){let o=t[n];if(o instanceof s1){e.propertyTypes.add(o.right.toString());return}if(o instanceof u1){iie(e,o);return}let a=o.toString(),i=pi(r,a);if(!i)throw new Error(`Element definition not found for ${r} ${a}`);let l=!1,c=n+1;if(c<t.length&&t[c]instanceof d1&&(l=!0,c++),i.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(i);for(let u of i.type)e.propertyTypes.add(u.code);return}for(let u of i.type){let d=u.code;sie(d)&&(d=i.type[0].code),EN(e,t,d,c)}}function iie(e,t){if(t.name==="as"){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 c1){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function sie(e){return e==="Element"||e==="BackboneElement"}function lie(e){return e.split("-").reduce((t,r,n)=>t+(n?pr(r):r),"")}function cie(e,t){switch(e.type){case"date":return t.size===1&&t.has(V.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(V.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(V.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function uie(e,t){let r=[],n=CN(t);return Kv(e,n.child,r),r}function Kv(e,t,r){t instanceof ON?(Kv(e,t.left,r),Kv(e,t.right,r)):t.toString().startsWith(e+".")&&r.push(t)}function Rl(e){return e instanceof s1||e instanceof d1?[Rl(e.left),e].flat():e instanceof Tr?[e]:e instanceof l1?[Rl(e.left),Rl(e.right)].flat():e instanceof u1&&e.name==="where"&&!(e.args[0]instanceof c1)?[]:[e]}var $c=20,ee=(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.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.IDENTIFIER="identifier",e.ITERATE="iterate",e))(ee||{}),$N={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"},g1={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function die(e){let t;for(let r of e.pathname.split("/"))r&&(t=r);return pie(t,e.searchParams.entries())}function fie(e){return die(new URL(e,"https://example.com/"))}function pie(e,t){let r={resourceType:e};for(let[n,o]of t)hie(r,n,o);return r}function hie(e,t,r){var i,l;let n,o,a=t.indexOf(":");if(a>=0?(n=t.substring(0,a),o=t.substring(a+1)):(n=t,o=""),n==="_has"||t.includes(".")){Pg(e,{code:t,operator:"eq",value:r});return}switch(n){case"_sort":mie(e,r);break;case"_count":e.count=parseInt(r,10);break;case"_offset":e.offset=parseInt(r,10);break;case"_total":e.total=r;break;case"_summary":r==="count"?(e.total="accurate",e.count=0):(r==="true"||r==="data"||r==="text")&&(e.summary=r);break;case"_include":{let c=fO(r);o==="iterate"&&(c.modifier="iterate"),e.include?e.include.push(c):e.include=[c];break}case"_revinclude":{let c=fO(r);o==="iterate"&&(c.modifier="iterate"),e.revInclude?e.revInclude.push(c):e.revInclude=[c];break}case"_fields":case"_elements":e.fields=r.split(",");break;default:{let c=(l=(i=ca.types[e.resourceType])==null?void 0:i.searchParams)==null?void 0:l[n];c?Pg(e,gie(c,o,r)):Pg(e,xie(n,o,r))}}}function mie(e,t){for(let r of t.split(",")){let n,o=!1;r.startsWith("-")?(n=r.substring(1),o=!0):n=r,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:n,descending:o})}}function gie(e,t,r){if(t==="missing")return{code:e.code,operator:"missing",value:r};switch(e.type){case"number":case"date":case"quantity":return vie(e,r);case"reference":case"string":case"token":case"uri":return yie(e,t,r);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function vie(e,t){let{operator:r,value:n}=wie(t);return{code:e.code,operator:r,value:n}}function yie(e,t,r){return{code:e.code,operator:bie(t),value:r}}function xie(e,t,r){var o;let n="eq";if(t)n=t;else if(r.length>=2){let a=r.substring(0,2);a in g1&&(r.length===2||(o=r.at(2))!=null&&o.match(/\d/))&&(n=a,r=r.substring(a.length))}return{code:e,operator:n,value:r}}function wie(e){let t=e.substring(0,2),r=g1[t];return r?{operator:r,value:e.substring(2)}:{operator:"eq",value:e}}function bie(e){return $N[e]??"eq"}function fO(e){let t=e.split(":");if(t.includes("*"))throw new De(Ba("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new De(Ba(`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 De(Ba(`Invalid include value '${e}'`))}function Pg(e,t){e.filters?e.filters.push(t):e.filters=[t]}function qi(e){let t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(r=>t.push(_ie(r))),e.sortRules&&e.sortRules.length>0&&t.push(Sie(e.sortRules)),e.offset!==void 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(r=>t.push(pO("_include",r))),e.revInclude&&e.revInclude.forEach(r=>t.push(pO("_revinclude",r))),t.length===0?"":(t.sort((r,n)=>r.localeCompare(n)),"?"+t.join("&"))}function _ie(e){let t=e.operator in $N?":"+e.operator:"",r=e.operator!=="eq"&&e.operator in g1?e.operator:"";return`${e.code}${t}=${r}${encodeURIComponent(e.value)}`}function Sie(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function pO(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}var Pie=(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))(Pie||{});function jie(e){if(typeof window<"u")return window.atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to decode base64")}function Oie(e){if(typeof window<"u")return window.btoa(e);if(typeof Buffer<"u")return Buffer.from(e,"binary").toString("base64");throw new Error("Unable to encode base64")}function hO(){let e=new Uint32Array(28);return crypto.getRandomValues(e),Uoe(e.buffer)}async function Cie(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function kN(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function RN(e){var o,a,i;let t={};e=di(e);for(let l of e.entry||[]){(o=l.resource)==null||delete o.meta;let c=(a=l.resource)==null?void 0:a.id;c&&(t[c]=kN(),l.fullUrl="urn:uuid:"+t[c],(i=l.resource)==null||delete i.id)}let r=e.entry,n=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:r==null?void 0:r.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>Eie(l,c,t),2);return $ie(JSON.parse(n))}function Eie(e,t,r){if(e==="reference"&&typeof t=="string"){let n;if(t.includes("/")?n=t.split("/")[1]:t.startsWith("urn:uuid:")?n=t.slice(9):t.startsWith("#")&&(n=t.slice(1)),n){let o=r[n];if(o)return"urn:uuid:"+o}}return t}function $ie(e){let t=Rie(e),{sorted:r,cycles:n}=kie(t),o={};for(let i of e.entry||[])i.fullUrl&&(o[i.fullUrl]=i);let a=r.map(i=>o[i]);for(let i of n)for(let l of i){let c=o[l],u={...c,request:{...c.request,method:"PUT"}};a.push(u)}return{...e,entry:a}}function kie(e){let t=[],r={},n=[];for(let a of Object.keys(e))r[a]=0;function o(a,i){if(r[a]===2)return!0;if(r[a]===1){let c=i.lastIndexOf(a);return c!==-1&&n.push(i.slice(c)),!0}r[a]=1,i.push(a);let l=!1;for(let c of e[a])o(c,i)||(l=!0);return r[a]=2,i.pop(),t.unshift(a),!l}for(let a in e)r[a]===0&&o(a,[]);return{sorted:t,cycles:n}}function TN(e,t){for(let r in e)if(e[r]&&typeof e[r]=="object"){let n=e[r];if(hi(n)){let o=n.reference;o.startsWith("urn:uuid:")&&t(o)}else TN(n,t)}}function Rie(e){let t={};for(let r of e.entry||[])r.fullUrl&&(t[r.fullUrl]=[]);for(let r of e.entry||[]){let n=r.fullUrl;r.resource&&TN(r.resource,o=>{t[o]&&t[o].push(n)})}return t}var Tie=class{constructor(e=10){this.max=e,this.cache=new Map}clear(){this.cache.clear()}get(e){let t=this.cache.get(e);return t&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(e,t)}delete(e){this.cache.delete(e)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}},Ht={CSS:"text/css",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",PNG:"image/png",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript"},IN=class{constructor(){this.listeners={}}addEventListener(e,t){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(t)}removeEventListener(e,t){let r=this.listeners[e];if(r){for(let n=0;n<r.length;n++)if(r[n]===t){r.splice(n,1);return}}}dispatchEvent(e){let t=this.listeners[e.type];if(t)for(let r of t)r.call(this,e);return!e.defaultPrevented}},Iie=class{constructor(){this.emitter=new IN}dispatchEvent(e){this.emitter.dispatchEvent(e)}addEventListener(e,t){this.emitter.addEventListener(e,t)}removeEventListener(e,t){this.emitter.removeEventListener(e,t)}},Yv={"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"},Die=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],v1=["DiagnosticReport-update"];function Nie(e){return v1.includes(e)}function Aie(e){if(v1.includes(e))throw new De(kt(`'context.version' is required for '${e}'.`))}var Mie={"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 Lie(e){return Die.includes(e)}function DN(e){return!!e.endpoint}function mO(e){if(!y1(e))throw new De(kt("subscriptionRequest must be an object conforming to SubscriptionRequest type."));let{channelType:t,mode:r,topic:n,events:o}=e,a={"hub.channel.type":t,"hub.mode":r,"hub.topic":n,"hub.events":o.join(",")};return DN(e)&&(a.endpoint=e.endpoint),new URLSearchParams(a).toString()}function y1(e){if(typeof e!="object")return!1;let{channelType:t,mode:r,topic:n,events:o}=e;if(!(t&&r&&n&&o)||typeof n!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||r!=="subscribe"&&r!=="unsubscribe")return!1;for(let a of o)if(!Yv[a])return!1;return!(DN(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function gO(e,t,r,n){if(typeof t!="object")throw new De(kt(`context[${r}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new De(kt(`context[${r}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new De(kt(`context[${r}] is invalid. Resource must contain a resource type. No resource type found.`));let o=n.resourceType;if(o!=="*"){if(!Lie(t.resourceType))throw new De(kt(`context[${r}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new De(kt(`context[${r}] is invalid. context[${r}] for the '${e}' event should contain resource of type ${o}.`))}}function zie(e,t,r,n,o){if(o.set(t.key,(o.get(t.key)??0)+1),!n.isArray)gO(e,t.resource,r,n);else{let{resources:a}=t;if(!a)throw new De(kt(`context[${r}] is invalid. context[${r}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(let i of a)gO(e,i,r,n)}}function Fie(e,t){let r=new Map,n=Mie[e];for(let o=0;o<t.length;o++){let a=t[o].key;if(!n[a])throw new De(kt(`Key '${a}' not found for event '${e}'. Make sure to add only valid keys.`));zie(e,t[o],o,n[a],r)}for(let[o,a]of Object.entries(n)){if(!(a.optional||r.has(o)))throw new De(kt(`Missing required key '${o}' on context for '${e}' event.`));if(!a.manyAllowed&&(r.get(o)||0)>1)throw new De(kt(`${r.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function vO(e,t,r,n){if(!(e&&typeof e=="string"))throw new De(kt("Must provide a topic."));if(!Yv[t])throw new De(kt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Yv).join(", ")}`));if(typeof r!="object")throw new De(kt("context must be a context object or array of context objects."));if(v1.includes(t)&&!n)throw new De(kt(`The '${t}' event must contain a 'context.versionId'.`));let o=Array.isArray(r)?r:[r];return Fie(t,o),{timestamp:new Date().toISOString(),id:kN(),event:{"hub.topic":e,"hub.event":t,context:o,...n?{"context.versionId":n}:{}}}}var Vie=class extends Iie{constructor(e){if(super(),this.subRequest=e,!e.endpoint)throw new De(kt("Subscription request should contain an endpoint."));if(!y1(e))throw new De(kt("Subscription request failed validation."));let t=new WebSocket(e.endpoint);t.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),t.addEventListener("message",r=>{let n=JSON.parse(r.data);if(n["hub.topic"])return;let o=n;this.dispatchEvent({type:"message",payload:o}),t.send(JSON.stringify({id:n==null?void 0:n.id,timestamp:new Date().toISOString()}))}),t.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=t}disconnect(){this.websocket.close()}};function Bie(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=jie(t),n=Array.from(r).reduce((a,i)=>{let l=("00"+i.charCodeAt(0).toString(16)).slice(-2);return`${a}%${l}`},""),o=decodeURIComponent(n);return JSON.parse(o)}function Uie(e){return e.split(".").length===3}function NN(e){let[t,r,n]=e.split(".");return Bie(r)}function Wie(e){try{return typeof NN(e).login_id=="string"}catch{return!1}}var AN,no=class{constructor(t){this[AN]="ReadablePromise",this.status="pending",this.suspender=t.then(r=>(this.status="success",this.response=r,r),r=>{throw this.status="error",this.error=r,r})}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,r){return this.suspender.then(t,r)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}};AN=Symbol.toStringTag;var Hie=class{constructor(){this.storage=typeof localStorage<"u"?localStorage:new qie}clear(){this.storage.clear()}getString(e){return this.storage.getItem(e)??void 0}setString(e,t){t?this.storage.setItem(e,t):this.storage.removeItem(e)}getObject(e){let t=this.getString(e);return t?JSON.parse(t):void 0}setObject(e,t){this.setString(e,t?ar(t):void 0)}},qie=class{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(e){return this.data.get(e)??null}setItem(e,t){t?this.data.set(e,t):this.data.delete(e)}removeItem(e){this.data.delete(e)}key(e){return Array.from(this.data.keys())[e]}},Gie="2.1.12-35ba0801",Qie=Ht.FHIR_JSON+", */*; q=0.1",Kie="https://api.medplum.com/",Yie=1e3,Xie=6e4,yO="Binary/",xO={resourceType:"Device",id:"system",deviceName:[{name:"System"}]},Jie=(e=>(e.ClientCredentials="client_credentials",e.AuthorizationCode="authorization_code",e.RefreshToken="refresh_token",e.JwtBearer="urn:ietf:params:oauth:grant-type:jwt-bearer",e.TokenExchange="urn:ietf:params:oauth:grant-type:token-exchange",e))(Jie||{}),Zie=(e=>(e.AccessToken="urn:ietf:params:oauth:token-type:access_token",e.RefreshToken="urn:ietf:params:oauth:token-type:refresh_token",e.IdToken="urn:ietf:params:oauth:token-type:id_token",e.Saml1Token="urn:ietf:params:oauth:token-type:saml1",e.Saml2Token="urn:ietf:params:oauth:token-type:saml2",e))(Zie||{}),ese=(e=>(e.ClientSecretBasic="client_secret_basic",e.ClientSecretPost="client_secret_post",e.ClientSecretJwt="client_secret_jwt",e.PrivateKeyJwt="private_key_jwt",e.None="none",e))(ese||{}),tse=(e=>(e.JwtBearer="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",e))(tse||{}),rse=class extends IN{constructor(e){if(super(),e!=null&&e.baseUrl&&!e.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");if(this.options=e??{},this.fetch=(e==null?void 0:e.fetch)??nse(),this.storage=(e==null?void 0:e.storage)??new Hie,this.createPdfImpl=e==null?void 0:e.createPdf,this.baseUrl=bO((e==null?void 0:e.baseUrl)??Kie),this.fhirBaseUrl=bO(Nu(this.baseUrl,(e==null?void 0:e.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=Nu(this.baseUrl,(e==null?void 0:e.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Nu(this.baseUrl,(e==null?void 0:e.tokenUrl)??"oauth2/token"),this.logoutUrl=Nu(this.baseUrl,(e==null?void 0:e.logoutUrl)??"oauth2/logout"),this.clientId=(e==null?void 0:e.clientId)??"",this.clientSecret=(e==null?void 0:e.clientSecret)??"",this.onUnauthenticated=e==null?void 0:e.onUnauthenticated,this.cacheTime=(e==null?void 0:e.cacheTime)??Xie,this.cacheTime>0?this.requestCache=new Tie((e==null?void 0:e.resourceCacheSize)??Yie):this.requestCache=void 0,e!=null&&e.autoBatchTime?(this.autoBatchTime=e.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),e==null?void 0:e.accessToken)this.setAccessToken(e.accessToken);else{let t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),this.refreshProfile().catch(console.log))}this.setupStorageListener()}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}clear(){this.storage.clear(),sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var e;this.storage.setString("activeLogin",void 0),(e=this.requestCache)==null||e.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(e){var t;e=e.toString(),(t=this.requestCache)==null||t.delete(e)}invalidateAll(){var e;(e=this.requestCache)==null||e.clear()}invalidateSearches(e){let t=this.fhirBaseUrl+e;if(this.requestCache)for(let r of this.requestCache.keys())(r.endsWith(t)||r.includes(t+"?"))&&this.requestCache.delete(r)}get(e,t={}){e=e.toString();let r=this.getCacheEntry(e,t);if(r)return r.value;let n;e.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue?n=new Promise((a,i)=>{this.autoBatchQueue.push({method:"GET",url:e.replace(this.fhirBaseUrl,""),options:t,resolve:a,reject:i}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):n=this.request("GET",e,t);let o=new no(n);return this.setCacheEntry(e,o),o}post(e,t,r,n={}){return e=e.toString(),this.setRequestBody(n,t),r&&this.setRequestContentType(n,r),this.invalidateUrl(e),this.request("POST",e,n)}put(e,t,r,n={}){return e=e.toString(),this.setRequestBody(n,t),r&&this.setRequestContentType(n,r),this.invalidateUrl(e),this.request("PUT",e,n)}patch(e,t,r={}){return e=e.toString(),this.setRequestBody(r,t),this.setRequestContentType(r,Ht.JSON_PATCH),this.invalidateUrl(e),this.request("PATCH",e,r)}delete(e,t){return e=e.toString(),this.invalidateUrl(e),this.request("DELETE",e,t)}async startNewUser(e,t){let{codeChallengeMethod:r,codeChallenge:n}=await this.startPkce();return this.post("auth/newuser",{...e,clientId:e.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:n},void 0,t)}async startNewProject(e,t){return this.post("auth/newproject",e,void 0,t)}async startNewPatient(e,t){return this.post("auth/newpatient",e,void 0,t)}async startLogin(e,t){return this.post("auth/login",{...await this.ensureCodeChallenge(e),clientId:e.clientId??this.clientId,scope:e.scope},void 0,t)}async startGoogleLogin(e,t){return this.post("auth/google",{...await this.ensureCodeChallenge(e),clientId:e.clientId??this.clientId,scope:e.scope},void 0,t)}async ensureCodeChallenge(e){return e.codeChallenge?e:{...e,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(e){let t=new URLSearchParams(window.location.search).get("code");if(t)return this.processCode(t);await this.requestAuthorization(e)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(e,t,r,n,o=!0){let a=n;o&&(a=await this.ensureCodeChallenge(n)),window.location.assign(this.getExternalAuthRedirectUri(e,t,r,a,o))}async exchangeExternalAccessToken(e,t){if(t=t??this.clientId,!t)throw new Error("MedplumClient is missing clientId");let 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",t),r.set("subject_token",e),this.fetchTokens(r)}getExternalAuthRedirectUri(e,t,r,n,o=!0){let a=new URL(e);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",t),a.searchParams.set("redirect_uri",r),a.searchParams.set("scope","openid profile email"),a.searchParams.set("state",JSON.stringify(n)),o){let{codeChallenge:i,codeChallengeMethod:l}=n;if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!i)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",l),a.searchParams.set("code_challenge",i)}return a.toString()}fhirUrl(...e){return new URL(e.join("/"),this.fhirBaseUrl)}fhirSearchUrl(e,t){let r=this.fhirUrl(e);return t&&(r.search=new URLSearchParams(t).toString()),r}search(e,t,r){let n=this.fhirSearchUrl(e,t),o=n.toString()+"-search",a=this.getCacheEntry(o,r);if(a)return a.value;let i=new no((async()=>{let l=await this.get(n,r);if(l.entry)for(let c of l.entry)this.cacheResource(c.resource);return l})());return this.setCacheEntry(o,i),i}searchOne(e,t,r){let n=this.fhirSearchUrl(e,t);n.searchParams.set("_count","1"),n.searchParams.sort();let o=n.toString()+"-searchOne",a=this.getCacheEntry(o,r);if(a)return a.value;let i=new no(this.search(e,n.searchParams,r).then(l=>{var c,u;return(u=(c=l.entry)==null?void 0:c[0])==null?void 0:u.resource}));return this.setCacheEntry(o,i),i}searchResources(e,t,r){let n=this.fhirSearchUrl(e,t).toString()+"-searchResources",o=this.getCacheEntry(n,r);if(o)return o.value;let a=new no(this.search(e,t,r).then(SO));return this.setCacheEntry(n,a),a}async*searchResourcePages(e,t,r){var o,a;let n=this.fhirSearchUrl(e,t);for(;n;){let i=new URL(n).searchParams,l=await this.search(e,i,r),c=(o=l.link)==null?void 0:o.find(u=>u.relation==="next");if(!((a=l.entry)!=null&&a.length)&&!c)break;yield SO(l),n=c!=null&&c.url?new URL(c.url):void 0}}searchValueSet(e,t,r){let n=this.fhirUrl("ValueSet","$expand");return n.searchParams.set("url",e),n.searchParams.set("filter",t),this.get(n.toString(),r)}getCached(e,t){var n,o;let r=(o=(n=this.requestCache)==null?void 0:n.get(this.fhirUrl(e,t).toString()))==null?void 0:o.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(e){let t=e.reference;if(!t)return;if(t==="system")return xO;let[r,n]=t.split("/");if(!(!r||!n))return this.getCached(r,n)}readResource(e,t,r){return this.get(this.fhirUrl(e,t),r)}readReference(e,t){let r=e.reference;if(!r)return new no(Promise.reject(new Error("Missing reference")));if(r==="system")return new no(Promise.resolve(xO));let[n,o]=r.split("/");return!n||!o?new no(Promise.reject(new Error("Invalid reference"))):this.readResource(n,o,t)}requestSchema(e){if(Sae(e))return Promise.resolve();let t=e+"-requestSchema",r=this.getCacheEntry(t,void 0);if(r)return r.value;let n=new no((async()=>{let o=`{
90
+ StructureDefinitionList(name: "${e}") {
91
+ resourceType,
92
+ name,
93
+ kind,
94
+ description,
95
+ snapshot {
96
+ element {
97
+ id,
98
+ path,
99
+ definition,
100
+ min,
101
+ max,
102
+ base {
103
+ path,
104
+ min,
105
+ max
106
+ },
107
+ contentReference,
108
+ type {
109
+ code,
110
+ targetProfile
111
+ },
112
+ binding {
113
+ strength,
114
+ valueSet
115
+ }
116
+ }
117
+ }
118
+ }
119
+ SearchParameterList(base: "${e}", _count: 100) {
120
+ base,
121
+ code,
122
+ type,
123
+ expression,
124
+ target
125
+ }
126
+ }`.replace(/\s+/g," "),a=await this.graphql(o);bae(a.data.StructureDefinitionList);for(let i of a.data.SearchParameterList)Eae(i)})());return this.setCacheEntry(t,n),n}readHistory(e,t,r){return this.get(this.fhirUrl(e,t,"_history"),r)}readVersion(e,t,r,n){return this.get(this.fhirUrl(e,t,"_history",r),n)}readPatientEverything(e,t){return this.get(this.fhirUrl("Patient",e,"$everything"),t)}createResource(e,t){if(!e.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(e.resourceType),this.post(this.fhirUrl(e.resourceType),e,void 0,t)}async createResourceIfNoneExist(e,t,r){return await this.searchOne(e.resourceType,t,r)??this.createResource(e,r)}async createAttachment(e,t,r,n){let o=await this.createBinary(e,t,r,n);return{contentType:r,url:o.url,title:t}}createBinary(e,t,r,n){let o=this.fhirUrl("Binary");return t&&o.searchParams.set("_filename",t),n?this.uploadwithProgress(o,e,r,n):this.post(o,e,r)}uploadwithProgress(e,t,r,n){return new Promise((o,a)=>{let i=new XMLHttpRequest;i.responseType="json",i.onabort=()=>a(new Error("Request aborted")),i.onerror=()=>a(new Error("Request error")),n&&(i.upload.onprogress=l=>n(l),i.upload.onload=l=>n(l)),i.onload=()=>{i.status>=200&&i.status<300?o(i.response):a(new De(ct(i.response||i.statusText)))},i.open("POST",e),i.withCredentials=!0,i.setRequestHeader("Authorization","Bearer "+this.accessToken),i.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),i.setRequestHeader("Content-Type",r),i.setRequestHeader("X-Medplum","extended"),i.send(t)})}async createPdf(e,t,r,n){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");let o=await this.createPdfImpl(e,r,n);return this.createBinary(o,t,"application/pdf")}createComment(e,t,r){let n=this.getProfile(),o,a;return e.resourceType==="Encounter"&&(o=dt(e),a=e.subject),e.resourceType==="ServiceRequest"&&(o=e.encounter,a=e.subject),e.resourceType==="Patient"&&(a=dt(e)),this.createResource({resourceType:"Communication",basedOn:[dt(e)],encounter:o,subject:a,sender:n?dt(n):void 0,sent:new Date().toISOString(),payload:[{contentString:t}]},r)}async updateResource(e,t){if(!e.resourceType)throw new Error("Missing resourceType");if(!e.id)throw new Error("Missing id");this.invalidateSearches(e.resourceType);let r=await this.put(this.fhirUrl(e.resourceType,e.id),e,void 0,t);return r||(r=e),this.cacheResource(r),r}patchResource(e,t,r,n){return this.invalidateSearches(e),this.patch(this.fhirUrl(e,t),r,n)}deleteResource(e,t,r){return this.deleteCacheEntry(this.fhirUrl(e,t).toString()),this.invalidateSearches(e),this.delete(this.fhirUrl(e,t),r)}validateResource(e,t){return this.post(this.fhirUrl(e.resourceType,"$validate"),e,void 0,t)}executeBot(e,t,r,n){let o;if(typeof e=="string"){let a=e;o=this.fhirUrl("Bot",a,"$execute")}else{let a=e;o=this.fhirUrl("Bot","$execute")+`?identifier=${a.system}|${a.value}`}return this.post(o,t,r,n)}executeBatch(e,t){return this.post(this.fhirBaseUrl.slice(0,-1),e,void 0,t)}sendEmail(e,t){return this.post("email/v1/send",e,Ht.JSON,t)}graphql(e,t,r,n){return this.post(this.fhirUrl("$graphql"),{query:e,operationName:t,variables:r},Ht.JSON,n)}readResourceGraph(e,t,r,n){return this.get(`${this.fhirUrl(e,t)}/$graph?graph=${r}`,n)}pushToAgent(e,t,r,n,o){return this.post(this.fhirUrl("Agent",t1(e),"$push"),{destination:Ze(t),body:r,contentType:n},Ht.FHIR_JSON,o)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(e){var t,r;(!((t=this.sessionDetails)!=null&&t.profile)||Ze(this.sessionDetails.profile)!==((r=e.profile)==null?void 0:r.reference))&&this.clearActiveLogin(),this.setAccessToken(e.accessToken,e.refreshToken),this.storage.setObject("activeLogin",e),this.addLogin(e),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}setAccessToken(e,t){this.accessToken=e,this.refreshToken=t,this.sessionDetails=void 0,this.medplumServer=Wie(e)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(e){let t=this.getLogins().filter(r=>{var n,o;return((n=r.profile)==null?void 0:n.reference)!==((o=e.profile)==null?void 0:o.reference)});t.push(e),this.storage.setObject("logins",t)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((e,t)=>{this.get("auth/me").then(r=>{var o,a;this.profilePromise=void 0;let n=((a=(o=this.sessionDetails)==null?void 0:o.profile)==null?void 0:a.id)!==r.profile.id;this.sessionDetails=r,n&&this.dispatchEvent({type:"change"}),e(r.profile)}).catch(t)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!!this.profilePromise}isSuperAdmin(){var e;return!!((e=this.sessionDetails)!=null&&e.project.superAdmin)}isProjectAdmin(){var e;return!!((e=this.sessionDetails)!=null&&e.membership.admin)}getProject(){var e;return(e=this.sessionDetails)==null?void 0:e.project}getProjectMembership(){var e;return(e=this.sessionDetails)==null?void 0:e.membership}getProfile(){var e;return(e=this.sessionDetails)==null?void 0:e.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var e;return(e=this.sessionDetails)==null?void 0:e.config}getAccessPolicy(){var e;return(e=this.sessionDetails)==null?void 0:e.accessPolicy}async download(e,t={}){this.refreshPromise&&await this.refreshPromise;let r=e.toString();return r.startsWith(yO)&&(e=this.fhirUrl(r)),this.addFetchOptionsDefaults(t),(await this.fetchWithRetry(e.toString(),t)).blob()}async uploadMedia(e,t,r,n,o){let a=await this.createBinary(e,r,t);return this.createResource({resourceType:"Media",status:"completed",content:{contentType:t,url:yO+a.id,title:r},...n},o)}async bulkExport(e="",t,r,n){let o=e&&`${e}/`,a=this.fhirUrl(`${o}$export`);return t&&a.searchParams.set("_type",t),r&&a.searchParams.set("_since",r),this.startAsyncRequest(a.toString(),n)}async startAsyncRequest(e,t={}){this.addFetchOptionsDefaults(t);let r=t.headers;r.Prefer="respond-async";let n=await this.fetchWithRetry(e,t);if(n.status===202){let o=await _O(n);if(o)return this.pollStatus(o)}return this.parseResponse(n,"POST",e)}getCacheEntry(e,t){if(!this.requestCache||(t==null?void 0:t.cache)==="no-cache"||(t==null?void 0:t.cache)==="reload")return;let r=this.requestCache.get(e);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(e,t){this.requestCache&&this.requestCache.set(e,{requestTime:Date.now(),value:t})}cacheResource(e){var t,r;e!=null&&e.id&&!((r=(t=e.meta)==null?void 0:t.tag)!=null&&r.some(n=>n.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(e.resourceType,e.id).toString(),new no(Promise.resolve(e)))}deleteCacheEntry(e){this.requestCache&&this.requestCache.delete(e)}async request(e,t,r={}){this.refreshPromise&&await this.refreshPromise,r.method=e,this.addFetchOptionsDefaults(r);let n=await this.fetchWithRetry(t,r);return this.parseResponse(n,e,t,r)}async parseResponse(e,t,r,n={}){var c;if(e.status===401)return this.handleUnauthenticated(t,r,n);if(e.status===204||e.status===304)return;let o=(c=e.headers.get("content-type"))==null?void 0:c.includes("json");if(e.status===404&&!o)throw new De(gae);let a=e.headers.get("content-location"),i=n.redirect??this.options.redirect;if(e.status===201&&a&&i==="follow")return this.request("GET",a,{...n,body:void 0});let l;if(o)try{l=await e.json()}catch(u){throw console.error("Error parsing response",e.status,u),u}else l=await e.text();if(e.status>=400)throw new De(ct(l));return l}async fetchWithRetry(e,t){e.startsWith("http")||(e=new URL(e,this.baseUrl).href);let r=3,n=200,o;for(let a=0;a<r;a++){try{if(this.options.verbose&&this.logRequest(e,t),o=await this.fetch(e,t),this.options.verbose&&this.logResponse(o),o.status<500)return o}catch(i){this.retryCatch(a,r,i)}await oO(n)}return o}logRequest(e,t){if(console.log(`> ${t.method} ${e}`),t.headers){let r=t.headers,n=Object.entries(r).sort((o,a)=>o[0].localeCompare(a[0]));for(let[o,a]of n)console.log(`> ${o}: ${a}`)}}logResponse(e){console.log(`< ${e.status} ${e.statusText}`),e.headers&&e.headers.forEach((t,r)=>console.log(`< ${r}: ${t}`))}async pollStatus(e){let t=!0,r,n=2e3;for(;t;){let o={};this.addFetchOptionsDefaults(o);let a=await this.fetchWithRetry(e,o);if(a.status!==202&&(t=!1,r=a,a.status===201)){let i=await _O(a);i&&(r=await this.fetchWithRetry(i,o))}await oO(n)}return this.parseResponse(r,"POST",e)}async executeAutoBatch(){var n,o;let e=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,e.length===1){let a=e[0];try{a.resolve(await this.request(a.method,this.fhirBaseUrl+a.url,a.options))}catch(i){a.reject(new De(ct(i)))}return}let t={resourceType:"Bundle",type:"batch",entry:e.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},r=await this.post(this.fhirBaseUrl.slice(0,-1),t);for(let a=0;a<e.length;a++){let i=e[a],l=(n=r.entry)==null?void 0:n[a];(o=l==null?void 0:l.response)!=null&&o.outcome&&!_N(l.response.outcome)?i.reject(new De(l.response.outcome)):i.resolve(l==null?void 0:l.resource)}}addFetchOptionsDefaults(e){let t=e.headers;t||(t={},e.headers=t),t.Accept||(t.Accept=Qie),t["X-Medplum"]="extended",e.body&&!t["Content-Type"]&&(t["Content-Type"]=Ht.FHIR_JSON),this.accessToken?t.Authorization="Bearer "+this.accessToken:this.basicAuth&&(t.Authorization="Basic "+this.basicAuth),e.cache||(e.cache="no-cache"),e.credentials||(e.credentials="include")}setRequestContentType(e,t){e.headers||(e.headers={});let r=e.headers;r["Content-Type"]=t}setRequestBody(e,t){typeof t=="string"||typeof Blob<"u"&&t instanceof Blob||typeof File<"u"&&t instanceof File||typeof Uint8Array<"u"&&t instanceof Uint8Array?e.body=t:t&&(e.body=JSON.stringify(t))}handleUnauthenticated(e,t,r){return this.refresh()?this.request(e,t,r):(this.clearActiveLogin(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new Error("Unauthenticated")))}async startPkce(){let e=hO();sessionStorage.setItem("pkceState",e);let t=hO();sessionStorage.setItem("codeVerifier",t);let r=await Cie(t),n=Woe(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",n),{codeChallengeMethod:"S256",codeChallenge:n}}async requestAuthorization(e){let t=await this.ensureCodeChallenge(e??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",t.clientId??this.clientId),r.searchParams.set("redirect_uri",t.redirectUri??wO()),r.searchParams.set("code_challenge_method",t.codeChallengeMethod),r.searchParams.set("code_challenge",t.codeChallenge),r.searchParams.set("scope",t.scope??"openid profile"),window.location.assign(r.toString())}processCode(e,t){let r=new URLSearchParams;if(r.set("grant_type","authorization_code"),r.set("code",e),r.set("client_id",(t==null?void 0:t.clientId)??this.clientId),r.set("redirect_uri",(t==null?void 0:t.redirectUri)??wO()),typeof sessionStorage<"u"){let n=sessionStorage.getItem("codeVerifier");n&&r.set("code_verifier",n)}return this.fetchTokens(r)}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){let e=new URLSearchParams;return e.set("grant_type","refresh_token"),e.set("client_id",this.clientId),e.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(e),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(e,t){this.clientId=e,this.clientSecret=t;let r=new URLSearchParams;return r.set("grant_type","client_credentials"),r.set("client_id",e),r.set("client_secret",t),this.fetchTokens(r)}async startJwtBearerLogin(e,t,r){this.clientId=e;let n=new URLSearchParams;return n.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),n.set("client_id",e),n.set("assertion",t),n.set("scope",r),this.fetchTokens(n)}async startJwtAssertionLogin(e){let t=new URLSearchParams;return t.append("grant_type","client_credentials"),t.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),t.append("client_assertion",e),this.fetchTokens(t)}setBasicAuth(e,t){this.clientId=e,this.clientSecret=t,this.basicAuth=Oie(e+":"+t)}async fhircastSubscribe(e,t){if(!(typeof e=="string"&&e!==""))throw new De(kt("Invalid topic provided. Topic must be a valid string."));if(!(typeof t=="object"&&Array.isArray(t)&&t.length>0))throw new De(kt("Invalid events provided. Events must be an array of event names containing at least one event."));let r={channelType:"websocket",mode:"subscribe",topic:e,events:t},n=(await this.post("/fhircast/STU3",mO(r),Ht.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!n)throw new Error("Invalid response!");return r.endpoint=n,r}async fhircastUnsubscribe(e){if(!y1(e))throw new De(kt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(e.endpoint&&typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))throw new De(kt("Provided subscription request must have an endpoint in order to unsubscribe."));e.mode="unsubscribe",await this.post("/fhircast/STU3",mO(e),Ht.FORM_URL_ENCODED)}fhircastConnect(e){return new Vie(e)}async fhircastPublish(e,t,r,n){return Nie(t)?this.post(`/fhircast/STU3/${e}`,vO(e,t,r,n),Ht.JSON):(Aie(t),this.post(`/fhircast/STU3/${e}`,vO(e,t,r),Ht.JSON))}async invite(e,t){return this.post("admin/projects/"+e+"/invite",t)}async fetchTokens(e){let t={method:"POST",headers:{"Content-Type":Ht.FORM_URL_ENCODED},body:e.toString(),credentials:"include"},r=t.headers;this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let n=await this.fetchWithRetry(this.tokenUrl,t);if(!n.ok){this.clearActiveLogin();try{let a=await n.json();throw new De(Ba(a.error_description))}catch(a){throw new De(Ba("Failed to fetch tokens"),a)}}let o=await n.json();return await this.verifyTokens(o),this.getProfile()}async verifyTokens(e){let t=e.access_token;if(Uie(t)){let r=NN(t);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:t,refreshToken:e.refresh_token,project:e.project,profile:e.profile})}setupStorageListener(){try{window.addEventListener("storage",e=>{(e.key===null||e.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(e,t,r){if(r.message==="Failed to fetch"&&e===1&&this.dispatchEvent({type:"offline"}),e>=t-1)throw r}};function nse(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function wO(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function bO(e){return e.endsWith("/")?e:e+"/"}function Nu(e,t){return new URL(t,e).toString()}async function _O(e){var o,a;let t=e.headers.get("content-location");if(t)return t;let r=e.headers.get("location");if(r)return r;let n=await e.json();if(om(n)&&((a=(o=n.issue)==null?void 0:o[0])!=null&&a.diagnostics))return n.issue[0].diagnostics}function SO(e){var r;let t=((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];return Object.assign(t,{bundle:e})}[...f1];p1().registerInfix("->",{precedence:Ve.Arrow}).registerInfix(";",{precedence:Ve.Semicolon});[...f1];p1();var MN=f.createContext(void 0);function am(){return f.useContext(MN)}function ie(){return am().medplum}function im(){return am().navigate}function LN(){return am().profile}function ose(e){let t=e.medplum,r=e.navigate??ase,[n,o]=f.useState({profile:t.getProfile(),loading:!1});f.useEffect(()=>{function i(){o({...n,profile:t.getProfile()})}return t.addEventListener("change",i),()=>t.removeEventListener("change",i)},[t,n]);let a=f.useMemo(()=>({...n,medplum:t,navigate:r}),[n,t,r]);return S.createElement(MN.Provider,{value:a},e.children)}function ase(e){window.location.assign(e)}function Ye(e,t){let r=ie(),[n,o]=f.useState(PO(r,e)),a=f.useCallback(i=>{rm(i,n)||o(i)},[n,o]);return f.useEffect(()=>{a(PO(r,e))},[r,e,a]),f.useEffect(()=>{let i=!0;return hi(e)&&r.readReference(e).then(l=>{i&&a(l)}).catch(l=>{i&&(a(void 0),t&&t(ct(l)))}),()=>i=!1},[r,n,e,a,t]),n}function PO(e,t){if(t){if(ko(t))return t;if(hi(t))return e.getCachedReference(t)}}function ise(e,t){return zN("searchOne",e,t)}function xs(e,t){return zN("searchResources",e,t)}function zN(e,t,r){let n=ie(),[o,a]=f.useState(),[i,l]=f.useState(!1),[c,u]=f.useState(),[d,p]=f.useState();return f.useEffect(()=>{let h=n.fhirSearchUrl(t,r).toString();h!==o&&(a(h),n[e](t,r).then(m=>{l(!1),u(m),p(mae)}).catch(m=>{l(!1),u(void 0),p(ct(m))}))},[n,e,t,r,o,u]),[c,i,d]}function sse(e){const t=e.value;return t?s.jsx(s.Fragment,{children:qoe(t)}):null}function jO(e,t){return e.line&&e.line.length>t?e.line[t]:""}function OO(e,t,r){const n=e.line||[];for(;n.length<=t;)n.push("");return n[t]=r,{...e,line:n}}function lse(e){const[t,r]=f.useState(e.defaultValue||{}),n=f.useRef();n.current=t;function o(h){r(h),e.onChange&&e.onChange(h)}function a(h){o({...n.current,use:h})}function i(h){o({...n.current,type:h})}function l(h){o(OO(n.current||{},0,h))}function c(h){o(OO(n.current||{},1,h))}function u(h){o({...n.current,city:h})}function d(h){o({...n.current,state:h})}function p(h){o({...n.current,postalCode:h})}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>a(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(ft,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>i(h.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(se,{placeholder:"Line 1",defaultValue:jO(t,0),onChange:h=>l(h.currentTarget.value)}),s.jsx(se,{placeholder:"Line 2",defaultValue:jO(t,1),onChange:h=>c(h.currentTarget.value)}),s.jsx(se,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.jsx(se,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.jsx(se,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>p(h.currentTarget.value)})]})}function cse(e){const t=LN(),[r,n]=f.useState(e.defaultValue||{}),o=f.useRef();o.current=r;function a(i){const l=i?{text:i,authorReference:t&&dt(t),time:new Date().toISOString()}:{};n(l),e.onChange&&e.onChange(l)}return s.jsx(se,{name:e.name,placeholder:"Annotation text",defaultValue:r.text,onChange:i=>a(i.currentTarget.value)})}var use={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"},dse=Object.defineProperty,fse=Object.defineProperties,pse=Object.getOwnPropertyDescriptors,Jp=Object.getOwnPropertySymbols,FN=Object.prototype.hasOwnProperty,VN=Object.prototype.propertyIsEnumerable,CO=(e,t,r)=>t in e?dse(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,EO=(e,t)=>{for(var r in t||(t={}))FN.call(t,r)&&CO(e,r,t[r]);if(Jp)for(var r of Jp(t))VN.call(t,r)&&CO(e,r,t[r]);return e},hse=(e,t)=>fse(e,pse(t)),mse=(e,t)=>{var r={};for(var n in e)FN.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Jp)for(var n of Jp(e))t.indexOf(n)<0&&VN.call(e,n)&&(r[n]=e[n]);return r},le=(e,t,r)=>{const n=f.forwardRef((o,a)=>{var i=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=i,p=mse(i,["color","size","stroke","children"]);return f.createElement("svg",EO(hse(EO({ref:a},use),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,m])=>f.createElement(h,m)),...d||[]])});return n.propTypes={color:Te.string,size:Te.oneOfType([Te.string,Te.number]),stroke:Te.oneOfType([Te.string,Te.number])},n.displayName=`${t}`,n},gse=le("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"}]]),sm=le("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"}]]),vse=le("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"}]]),yse=le("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"}]]),xse=le("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"}]]),wse=le("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"}]]),bse=le("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"}]]),_se=le("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"}]]),Sse=le("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"}]]),Pse=le("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"}]]),jse=le("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"}]]),Ose=le("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"}]]),Ca=le("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"}]]),lm=le("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),Cse=le("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"}]]),Ese=le("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),Zp=le("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"}]]),x1=le("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"}]]),w1=le("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"}]]),$se=le("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"}]]),kse=le("copy","IconCopy",[["path",{d:"M8 8m0 2a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M16 8v-2a2 2 0 0 0 -2 -2h-8a2 2 0 0 0 -2 2v8a2 2 0 0 0 2 2h2",key:"svg-1"}]]),Rse=le("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"}]]),Tse=le("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"}]]),Ise=le("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"}]]),Dse=le("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"}]]),cm=le("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"}]]),um=le("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),$O=le("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"}]]),Nse=le("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"}]]),Ase=le("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"}]]),Mse=le("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"}]]),Lse=le("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"}]]),zse=le("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"}]]),Fse=le("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"}]]),Vse=le("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"}]]),Bse=le("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"}]]),BN=le("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),UN=le("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),Use=le("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"}]]),Wse=le("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"}]]),Hse=le("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"}]]),qse=le("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"}]]),Gse=le("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"}]]),Qse=le("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),Kse=le("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),Yse=le("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"}]]),Xse=le("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"}]]),Jse=le("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"}]]),Zse=le("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"}]]),Xv=le("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"}]]),b1=le("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"}]]),_1=le("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"}]]),ele=le("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"}]]),tle=le("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"}]]),rle=le("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"}]]),nle=le("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"}]]),WN=le("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"}]]),kO=le("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"}]]),ole=le("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"}]]),eh=le("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);class HN extends S.Component{constructor(t){super(t),this.state={}}static getDerivedStateFromError(t){return{error:t}}componentDidCatch(t,r){console.error("Uncaught error:",t,r)}render(){return this.state.error?s.jsx(yc,{icon:s.jsx(sm,{size:16}),title:"Something went wrong",color:"red",children:Ce(this.state.error)}):this.props.children}}function kn(){return s.jsx(rr,{style:{width:"100%",height:"100vh"},children:s.jsx(dn,{})})}function S1(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Ec(t,e.options)}):null}function st(e){e.preventDefault(),e.stopPropagation()}function qN(e){if(RO(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&RO(t[0]))return!0}return!1}function RO(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function ke(e){const t=im(),{to:r,suffix:n,label:o,onClick:a,children:i,...l}=e;let c=ale(r);return n&&(c+="/"+n),s.jsx(Me,{href:c,"aria-label":o,onClick:u=>{st(u),a?a(u):r&&t(c)},...l,children:i})}function ale(e){if(e){if(typeof e=="string")return ile(e);if(ko(e))return sle(e);if(hi(e))return lle(e)}return"#"}function ile(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function sle(e){return`/${e.resourceType}/${e.id}`}function lle(e){return`/${e.reference}`}function ua(e){const t=Ye(e.value),r=t?bo(t):e.alt??"",n=(t&&Moe(t))??e.src,o=e.radius??"xl",a={...e};return delete a.value,delete a.link,e.link?s.jsx(ke,{to:t,children:s.jsx(Sf,{src:n,alt:r,radius:o,...a})}):s.jsx(Sf,{src:n,alt:r,radius:o,...a})}function P1(e){const{defaultValue:t,toKey:r,toOption:n,loadOptions:o,onChange:a,onCreate:i,creatable:l,...c}=e,u=cle(t),d=f.useRef(null),[p,h]=f.useState(),[m,v]=f.useState(),[g,_]=f.useState(),[y,x]=f.useState(),[w,b]=f.useState(u.map(n)),[O,C]=f.useState([]),j=f.useRef();j.current=p;const E=f.useRef();E.current=m;const T=f.useRef();T.current=g;const $=f.useRef();$.current=y;const I=f.useRef();I.current=O;const k=f.useCallback(()=>{var B;v(void 0);const R=((B=d.current)==null?void 0:B.value.trim())||"";if(R===j.current)return;h(R);const M=new AbortController;_(M),o(R,M.signal).then(Q=>{M.signal.aborted||(C(Q.map(n)),_(void 0),$.current&&(Q.length>0&&a(Q.slice(0,1)),x(!1)))}).catch(Q=>{M.signal.aborted||Q.message.includes("aborted")||pe({color:"red",message:Ce(Q)})})},[o,a,n]),D=f.useCallback(()=>{T.current&&(T.current.abort(),_(void 0)),E.current!==void 0&&window.clearTimeout(E.current);const R=window.setTimeout(()=>k(),100);v(R)},[k]),N=f.useCallback(R=>{var Q;const M=[],B=[];for(const ne of R){let Ee=(Q=I.current)==null?void 0:Q.find(Le=>Le.value===ne),ce=Ee==null?void 0:Ee.resource;!ce&&l!==!1&&i&&(ce=i(ne),Ee=n(ce)),ce&&M.push(ce),Ee&&B.push(Ee)}a(M),b(B)},[l,a,i,n]),z=f.useCallback(R=>{R.key==="Enter"&&(!E.current&&!T.current?(st(R),I.current&&I.current.length>0&&(C(I.current.slice(0,1)),N([I.current[0].value]))):x(!0))},[N]),H=f.useCallback(R=>{const M=n(i(R));return C([...I.current,M]),M},[i,C,n]),K=f.useCallback((R,M)=>!M,[]);return f.useEffect(()=>()=>{T.current&&T.current.abort()},[]),s.jsx(Yh,{...c,ref:d,defaultValue:u.map(r),searchable:!0,onKeyDown:z,onSearchChange:D,data:[...w,...O],onFocus:k,onChange:N,onCreate:H,rightSectionWidth:40,rightSection:g?s.jsx(dn,{size:16}):null,filter:K,creatable:!0,withinPortal:!0})}function cle(e){return e?Array.isArray(e)?e:[e]:[]}const ule=W(()=>({searchInput:{input:{width:220,transition:"width 0.2s"},"input:focus":{width:400},"@media (max-width: 800px)":{input:{width:150},"input:focus":{width:150}}}}));function dle(e){return e.id}function fle(e){return{value:e.id,label:bo(e),resource:e}}function ple(e){const{classes:t}=ule(),r=im(),n=ie(),o=f.useCallback(async(i,l)=>{const c=mle(i),u={signal:l},d=await n.graphql(c,void 0,void 0,u);return gle(d,i)},[n]),a=f.useCallback(i=>{i.length>0&&r(`/${Ze(i[0])}`)},[r]);return s.jsx(P1,{size:"sm",radius:"md",className:t.searchInput,icon:s.jsx(Zse,{size:16}),placeholder:"Search",itemComponent:hle,toKey:dle,toOption:fle,onChange:a,loadOptions:o,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const hle=f.forwardRef(({resource:e,...t},r)=>{var o;let n;return e.resourceType==="Patient"?n=e.birthDate:e.resourceType==="ServiceRequest"&&(n=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:r,...t,children:s.jsxs(J,{noWrap:!0,children:[s.jsx(ua,{value:e}),s.jsxs("div",{children:[s.jsx(te,{children:bo(e)}),s.jsx(te,{size:"xs",color:"dimmed",children:n})]})]})})});function mle(e){const t=JSON.stringify(e);return cN(e)?`{
127
+ Patients1: PatientList(_id: ${t}, _count: 1) {
128
+ resourceType
129
+ id
130
+ identifier {
131
+ system
132
+ value
133
+ }
134
+ name {
135
+ given
136
+ family
137
+ }
138
+ birthDate
139
+ }
140
+ ServiceRequestList(_id: ${t}, _count: 1) {
141
+ resourceType
142
+ id
143
+ identifier {
144
+ system
145
+ value
146
+ }
147
+ subject {
148
+ display
149
+ }
150
+ }
151
+ }`.replace(/\s+/g," "):`{
152
+ Patients1: PatientList(name: ${t}, _count: 5) {
153
+ resourceType
154
+ id
155
+ identifier {
156
+ system
157
+ value
158
+ }
159
+ name {
160
+ given
161
+ family
162
+ }
163
+ birthDate
164
+ }
165
+ Patients2: PatientList(identifier: ${t}, _count: 5) {
166
+ resourceType
167
+ id
168
+ identifier {
169
+ system
170
+ value
171
+ }
172
+ name {
173
+ given
174
+ family
175
+ }
176
+ birthDate
177
+ }
178
+ ServiceRequestList(identifier: ${t}, _count: 5) {
179
+ resourceType
180
+ id
181
+ identifier {
182
+ system
183
+ value
184
+ }
185
+ subject {
186
+ display
187
+ }
188
+ }
189
+ }`.replace(/\s+/g," ")}function gle(e,t){const r=[];return e.data.Patients1&&r.push(...e.data.Patients1),e.data.Patients2&&r.push(...e.data.Patients2),e.data.ServiceRequestList&&r.push(...e.data.ServiceRequestList),yle(vle(r),t).slice(0,5)}function vle(e){const t=new Set,r=[];for(const n of e)t.has(n.id)||(t.add(n.id),r.push(n));return r}function yle(e,t){return e.sort((r,n)=>TO(n,t)-TO(r,t))}function TO(e,t){let r=0;if(e.identifier)for(const n of e.identifier)r=Math.max(r,IO(n.value,t));if(e.resourceType==="Patient"&&e.name)for(const n of e.name)r=Math.max(r,IO(Ec(n),t));return r}function IO(e,t){if(!e)return 0;const r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?0:100-r}const xle=W(e=>({logoButton:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},user:{padding:`${e.spacing.xs} ${e.spacing.sm}`,borderRadius:e.radius.sm,transition:"background-color 100ms ease","&:hover":{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}},userName:{fontWeight:500,lineHeight:1,marginRight:3,[e.fn.smallerThan("xs")]:{display:"none"}},userActive:{backgroundColor:e.fn.lighten(e.fn.variant({variant:"filled",color:e.primaryColor}).background,.8)}}));function wle(e){var d,p,h,m;const t=am(),{medplum:r,profile:n,navigate:o}=t,a=r.getLogins(),{classes:i,cx:l}=xle(),[c,u]=f.useState(!1);return s.jsx(Ck,{height:60,p:8,style:{zIndex:101},children:s.jsxs(J,{position:"apart",children:[s.jsxs(J,{spacing:"xs",children:[s.jsx(ho,{className:i.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(ple,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(X,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:c,onClose:()=>u(!1),children:[s.jsx(X.Target,{children:s.jsx(ho,{className:l(i.user,{[i.userActive]:c}),onClick:()=>u(v=>!v),children:s.jsxs(J,{spacing:7,children:[s.jsx(ua,{value:n,radius:"xl",size:24}),s.jsx(te,{size:"sm",className:i.userName,children:Ec((d=n==null?void 0:n.name)==null?void 0:d[0])}),s.jsx(Ese,{size:12,stroke:1.5})]})})}),s.jsxs(X.Dropdown,{children:[s.jsxs(Oe,{align:"center",p:"xl",children:[s.jsx(ua,{size:"xl",radius:100,value:t.profile}),s.jsx(S1,{value:(h=(p=t.profile)==null?void 0:p.name)==null?void 0:h[0]}),s.jsx(te,{color:"dimmed",size:"xs",children:(m=r.getActiveLogin())==null?void 0:m.project.display})]}),a.length>1&&s.jsx(X.Divider,{}),a.map(v=>v.profile.reference!==Ze(t.profile)&&s.jsx(X.Item,{onClick:()=>{r.setActiveLogin(v).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(J,{children:[s.jsx(Sf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(te,{size:"sm",weight:500,children:v.profile.display}),s.jsx(te,{color:"dimmed",size:"xs",children:v.project.display})]})]})},v.profile.reference)),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(rle,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(X.Item,{icon:s.jsx(Xv,{size:14,stroke:1.5}),onClick:()=>o(`/${Ze(n)}`),children:"Account settings"}),s.jsx(X.Item,{icon:s.jsx(Bse,{size:14,stroke:1.5}),onClick:async()=>{await r.signOut(),o("/signin")},children:"Sign out"}),s.jsx(te,{size:"xs",color:"dimmed",align:"center",children:e.version})]})]})]})})}function ble(e){const t={};for(const r of Array.from(e.elements))r instanceof HTMLInputElement?_le(t,r):r instanceof HTMLTextAreaElement?t[r.name]=r.value:r instanceof HTMLSelectElement&&Sle(t,r);return t}function _le(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function Sle(e,t){e[t.name]=t.value}function Ne(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const r=ble(t.target);e.onSubmit&&e.onSubmit(r)},children:e.children})}function Ple(e){const t=ie(),r=t.getUserConfiguration();function n(o){var d,p;const{menuname:a,bookmarkname:i}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=di(r),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===a);(p=u==null?void 0:u.link)==null||p.push({name:i,target:l}),t.updateResource(c).then(h=>{r.menu=h.menu,t.dispatchEvent({type:"change"}),pe({color:"green",message:"Success"}),e.onOk()}).catch(h=>{pe({color:"red",message:Ce(h)})})}return s.jsx(Rr,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(Ne,{onSubmit:n,children:s.jsxs(Oe,{children:[s.jsx(jle,{config:r}),s.jsx(se,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(J,{position:"right",children:s.jsx(re,{mt:"sm",type:"submit",children:"OK"})})]})})})}function jle(e){function t(n){var o;return(o=n==null?void 0:n.menu)==null?void 0:o.map(a=>a.title)}const r=t(e.config);return s.jsx(ft,{name:"menuname",defaultValue:r[0],label:"Select Menu Option",placeholder:"Menu",data:r,withAsterisk:!0})}function j1(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function Ole(e){return typeof e.display=="string"?e.display:j1(e)}function Cle(e){return{value:j1(e),label:Ole(e),resource:e}}function Ele(e){return{code:e,display:e}}function O1(e){const t=ie(),{binding:r,creatable:n,clearable:o,...a}=e,i=f.useCallback(async(l,c)=>{var h;if(!r)return[];const d=(h=(await t.searchValueSet(r,l,{signal:c})).expansion)==null?void 0:h.contains,p=[];for(const m of d)m.code&&!p.some(v=>v.code===m.code)&&p.push(m);return p},[t,r]);return s.jsx(P1,{...a,creatable:n??!0,clearable:o??!0,toKey:j1,toOption:Cle,loadOptions:i,onCreate:Ele,getCreateLabel:n===!1?void 0:l=>`+ Create ${l}`})}function GN(e){const[t,r]=f.useState(e.defaultValue);function n(o){const a=o[0],i=kle(a);r(i),e.onChange&&e.onChange(i)}return s.jsx(O1,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:$le(t),onChange:n,creatable:e.creatable,maxSelectedValues:e.maxSelectedValues??1,clearSearchOnChange:e.clearSearchOnChange,clearable:e.clearable})}function $le(e){return e?{code:e}:void 0}function kle(e){return e==null?void 0:e.code}function C1(e){const[t,r]=f.useState(e.defaultValue),n=e.onChange,o=f.useCallback(a=>{r(a),n&&n(a)},[n]);return s.jsx(GN,{"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})}const QN=W(e=>({menuTitle:{margin:"20px 0 4px 6px",fontSize:"9px",fontWeight:"normal",textTransform:"uppercase",letterSpacing:"2px"},link:{...e.fn.focusStyles(),display:"flex",alignItems:"center",textDecoration:"none",fontSize:e.fontSizes.sm,color:e.colorScheme==="dark"?e.colors.dark[1]:e.colors.gray[7],padding:"8px 12px",borderRadius:e.radius.sm,fontWeight:500,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0],color:e.colorScheme==="dark"?e.white:e.black,textDecoration:"none","& svg":{color:e.colorScheme==="dark"?e.white:e.black}},"& svg":{color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],marginRight:e.spacing.sm,strokeWidth:1.5,width:18,height:18}},linkActive:{"&, &:hover":{backgroundColor:e.fn.variant({variant:"light",color:e.primaryColor}).background,color:e.fn.variant({variant:"light",color:e.primaryColor}).color,"& svg":{color:e.fn.variant({variant:"light",color:e.primaryColor}).color}}}}));function Rle(e){var c;const{classes:t}=QN(),r=im(),n=Dle(e.pathname,e.searchParams,e.menus),[o,a]=f.useState(!1);function i(u,d){u.stopPropagation(),u.preventDefault(),r(d),window.innerWidth<768&&e.closeNavbar()}function l(u){u&&r(`/${u}`)}return s.jsxs(s.Fragment,{children:[s.jsx($l,{width:{sm:250},p:"xs",children:s.jsxs(ai,{children:[!e.resourceTypeSearchDisabled&&s.jsx($l.Section,{mb:"sm",children:s.jsx(C1,{name:"resourceType",placeholder:"Resource Type",onChange:u=>l(u)},window.location.pathname)}),s.jsxs($l.Section,{grow:!0,children:[(c=e.menus)==null?void 0:c.map(u=>{var d;return s.jsxs(S.Fragment,{children:[s.jsx(te,{className:t.menuTitle,children:u.title}),(d=u.links)==null?void 0:d.map(p=>s.jsxs(Tle,{to:p.href,active:p.href===(n==null?void 0:n.href),onClick:h=>i(h,p.href),children:[s.jsx(Ile,{to:p.href,icon:p.icon}),s.jsx("span",{children:p.label})]},p.href))]},`menu-${u.title}`)}),e.displayAddBookmark&&s.jsx(re,{variant:"subtle",size:"xs",mt:"xl",leftIcon:s.jsx(Kse,{size:"0.75rem"}),onClick:()=>a(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(Ple,{pathname:e.pathname,searchParams:e.searchParams,visible:o,onOk:()=>a(!1),onCancel:()=>a(!1)})]})}function Tle(e){const{classes:t,cx:r}=QN();return s.jsx(ke,{onClick:e.onClick,to:e.to,className:r(t.link,{[t.linkActive]:e.active}),children:e.children})}function Ile(e){return e.icon?e.icon:s.jsx(tm,{w:30})}function Dle(e,t,r){if(!e||!t||!r)return;let n,o=0;for(const a of r)if(a.links)for(const i of a.links){const l=Nle(e,t,i.href);l>o&&(o=l,n=i)}return n}function Nle(e,t,r){const n=new URL(r,"https://example.com");if(e!==n.pathname)return 0;const o=["_count","_offset"];for(const[i,l]of n.searchParams.entries())if(!o.includes(i)&&t.get(i)!==l)return 0;let a=1;for(const[i,l]of t.entries())o.includes(i)||n.searchParams.get(i)===l&&a++;return a}function Ale(e){var u;const t=Kt(),[r,n]=f.useState(localStorage.navbarOpen==="true"),o=ie(),a=LN();f.useEffect(()=>{function d(){pe({color:"red",message:"No connection to server",autoClose:!1})}return o.addEventListener("offline",d),()=>o.removeEventListener("offline",d)},[o]);function i(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){i(!1)}function c(){i(!r)}return o.isLoading()?s.jsx(kn,{}):s.jsx(Rk,{styles:{main:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.colors.gray[0]}},padding:0,fixed:!0,header:a&&s.jsx(wle,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:c}),navbar:a&&r?s.jsx(Rle,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,children:s.jsx(HN,{children:s.jsx(f.Suspense,{fallback:s.jsx(kn,{}),children:e.children})},`${e.pathname}?${(u=e.searchParams)==null?void 0:u.toString()}`)})}function kc(e){const{contentType:t,url:r,title:n}=e.value??{};return r?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:r,alt:n}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:r})}),t==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:r+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Me,{href:r,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:Mle(n),children:n||"Download"})})]}):null}function Mle(e){return e!=null&&e.includes(".")?e:void 0}function Lle(e){var t;return s.jsx("div",{children:(t=e.values)==null?void 0:t.map((r,n)=>s.jsx("div",{children:s.jsx(kc,{value:r,maxWidth:e.maxWidth})},"attatchment-"+n))})}function E1(e){const t=ie(),r=f.useRef(null);function n(i){var l;st(i),(l=r.current)==null||l.click()}function o(i){st(i);const l=i.target.files;l&&Array.from(l).forEach(a)}function a(i){if(!i||!i.name)return;e.onUploadStart&&e.onUploadStart();const c=i.name,u=i.type||"application/octet-stream";t.createBinary(i,c,u,e.onUploadProgress).then(d=>{e.onUpload({contentType:d.contentType,url:d.url,title:c})}).catch(d=>{e.onUploadError&&e.onUploadError(ct(d))})}return s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:r,onChange:i=>o(i)}),e.children({onClick:n})]})}function zle(e){const[t,r]=f.useState(e.defaultValue??[]),n=f.useRef();n.current=t;function o(a){r(a),e.onChange&&e.onChange(a)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((a,i)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(kc,{value:a,maxWidth:200})}),s.jsx("td",{children:s.jsx(ur,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=t.slice();c.splice(i,1),o(c)},children:s.jsx(Zp,{})})})]},`${i}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(E1,{onUpload:a=>{o([...n.current,a])},children:a=>s.jsx(ur,{...a,title:"Add",size:"sm",color:"green",children:s.jsx(w1,{size:16})})})})]})]})]})}function KN(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(kc,{value:t,maxWidth:200}),s.jsx(re,{onClick:o=>{st(o),n(void 0)},children:"Remove"})]}):s.jsx(E1,{onUpload:n,children:o=>s.jsx(re,{...o,children:"Upload..."})})}const YN=["meta","implicitRules","language","text","contained","extension","modifierExtension"],Fle=W(e=>({root:{display:"grid",gridTemplateColumns:"30% 70%",margin:0,"& > dt, & > dd":{padding:`${e.spacing.sm} ${e.spacing.sm}`,borderTop:`0.1px solid ${e.colors.gray[3]}`,margin:0}},compact:{gridTemplateColumns:"20% 80%","& > dt, & > dd":{padding:`0 ${e.spacing.xs} ${e.spacing.xs} 0`,border:0}}}));function $1(e){const{children:t,compact:r}=e,{classes:n,cx:o}=Fle();return s.jsx("dl",{className:o(n.root,{[n.compact]:r}),children:t})}function ns(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function Kn(e){return s.jsx(s.Fragment,{children:ys(e.value)})}function Vle(e){return s.jsx(s.Fragment,{children:fi(e.value)})}function XN(e){const t=e.value;if(!t)return null;const r=[];return t.value&&r.push(t.value),(t.use||t.system)&&(r.push(" ["),t.use&&r.push(t.use),t.use&&t.system&&r.push(" "),t.system&&r.push(t.system),r.push("]")),s.jsx(s.Fragment,{children:r.join("").trim()})}function Ble(e){var r;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(r=t.telecom)==null?void 0:r.map(n=>s.jsx(XN,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function Ule(e){var t,r;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(r=e.value)==null?void 0:r.value]})}function Wle(e){return s.jsx(s.Fragment,{children:Zoe(e.value)})}function oc(e){return s.jsx(s.Fragment,{children:Vo(e.value)})}function k1(e){return s.jsx(s.Fragment,{children:rc(e.value)})}function Hle(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(oc,{value:t.numerator})," / ",s.jsx(oc,{value:t.denominator})]}):null}function th(e){if(!e.value)return null;const t=e.value.display||e.value.reference||ar(e.value);return e.link!==!1&&e.value.reference?s.jsx(ke,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function qle(e){const{property:t,values:r}=e,n=t.type[0].code;return e.values?s.jsx(s.Fragment,{children:r.map((o,a)=>s.jsx("div",{children:s.jsx(So,{arrayElement:!0,property:t,propertyType:n,value:o,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${a}-${r.length}`))}):s.jsx(s.Fragment,{})}function So(e){var a;const{property:t,propertyType:r,value:n}=e;if((a=t==null?void 0:t.path)==null?void 0:a.endsWith(".id"))return s.jsxs(oe,{component:"div",sx:{display:"flex",gap:3,alignItems:"center"},children:[n,s.jsx(QT,{value:n,timeout:2e3,children:({copied:i,copy:l})=>s.jsx(o5,{label:i?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(ur,{color:i?"teal":"gray",onClick:l,children:i?s.jsx(lm,{size:"1rem"}):s.jsx(kse,{size:"1rem"})})})})]});if(t!=null&&t.max&&t.max>1&&!e.arrayElement)return r===V.Attachment?s.jsx(Lle,{values:n,maxWidth:e.maxWidth}):s.jsx(qle,{property:t,values:n,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(r){case V.boolean:return s.jsx(s.Fragment,{children:n===void 0?"":(!!n).toString()});case V.SystemString:case V.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:n});case V.code:case V.date:case V.decimal:case V.integer:case V.positiveInt:case V.unsignedInt:case V.uri:case V.url:return s.jsx(s.Fragment,{children:n});case V.canonical:return s.jsx(th,{value:{reference:n},link:e.link});case V.dateTime:case V.instant:return s.jsx(s.Fragment,{children:$r(n)});case V.markdown:return s.jsx("pre",{children:n});case V.Address:return s.jsx(sse,{value:n});case V.Annotation:return s.jsx(s.Fragment,{children:n==null?void 0:n.text});case V.Attachment:return s.jsx(kc,{value:n,maxWidth:e.maxWidth});case V.CodeableConcept:return s.jsx(Kn,{value:n});case V.Coding:return s.jsx(Vle,{value:n});case V.ContactDetail:return s.jsx(Ble,{value:n});case V.ContactPoint:return s.jsx(XN,{value:n});case V.HumanName:return s.jsx(S1,{value:n});case V.Identifier:return s.jsx(Ule,{value:n});case V.Money:return s.jsx(Wle,{value:n});case V.Period:return s.jsx(s.Fragment,{children:Qoe(n)});case V.Quantity:case V.Duration:return s.jsx(oc,{value:n});case V.Range:return s.jsx(k1,{value:n});case V.Ratio:return s.jsx(Hle,{value:n});case V.Reference:return s.jsx(th,{value:n,link:e.link});case V.Timing:return s.jsx(s.Fragment,{children:dN(n)});case V.Dosage:case V.UsageContext:return s.jsx(Jv,{value:{type:r,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);return s.jsx(Jv,{value:{type:t.type[0].code,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function Ya(e,t){const r=dr(e,t);return r?Array.isArray(r)?[r.map(n=>n.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function Jv(e){const t=e.value,r=t.value;if(!r)return null;const n=t.type,o=o1(n);return o?typeof r=="object"&&"name"in r&&Object.keys(r).length===1&&typeof r.name=="string"?s.jsx("div",{children:r.name}):s.jsx($1,{compact:e.compact,children:Object.entries(o.elements).map(a=>{const[i,l]=a;if(YN.includes(i))return null;const[c,u]=Ya(t,i);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:s.jsx(ns,{term:Xp(i),children:s.jsx(So,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},i)})}):s.jsxs("div",{children:[n," not implemented"]})}function JN(e){return s.jsxs(J,{noWrap:!0,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Vt.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,children:(()=>null)()})})]})}function lt(e,t){var r,n,o;return(o=(n=(r=e==null?void 0:e.issue)==null?void 0:r.filter(a=>{var i;return ZN((i=a.expression)==null?void 0:i[0],t)}))==null?void 0:n.map(a=>{var i;return(i=a.details)==null?void 0:i.text}))==null?void 0:o.join(`
190
+ `)}function R1(e,t){var r;return(r=e==null?void 0:e.issue)==null?void 0:r.filter(n=>{var o;return ZN((o=n.expression)==null?void 0:o[0],t)})}function ZN(e,t){if(e===t)return!0;if(!e||!t)return!1;const r=e.indexOf(".");if(r>=0&&e.substring(r+1)===t)return!0;const n=t.indexOf(".");return n>=0&&t.substring(n+1)===e}function et(e){return s.jsx(Vt.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,error:lt(e.outcome,e.htmlFor),children:e.children})}function Zv(e,t,r,n,o){const a=n.type;if(a.length>1)for(const i of a){const l=t.replace("[x]",pr(i.code));l in e&&delete e[l]}return e[r]=o,e}function Gle(e){const[t,r]=f.useState(e.defaultValue);function n(o){const a=Kle(o);r(a),e.onChange&&e.onChange(a)}return s.jsx(O1,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&Qle(t),maxSelectedValues:1,onChange:n})}function Qle(e){var t;return(t=e.coding)==null?void 0:t.map(r=>({system:r.system,code:r.code,display:r.display}))}function Kle(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function e4(e){const[t,r]=f.useState(e.defaultValue);function n(o){const a=o[0],i=a&&Xle(a);r(i),e.onChange&&e.onChange(i)}return s.jsx(O1,{binding:e.binding,name:e.name,placeholder:e.placeholder,defaultValue:t&&Yle(t),maxSelectedValues:1,onChange:n})}function Yle(e){return{system:e.system,code:e.code,display:e.display}}function Xle(e){return{system:e.system,code:e.code,display:e.display}}function t4(e){const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){c&&Object.keys(c).length===0&&(c=void 0),r(c),e.onChange&&e.onChange(c)}function a(c){const u={...n.current,system:c};c||delete u.system,o(u)}function i(c){const u={...n.current,use:c};c||delete u.use,o(u)}function l(c){const u={...n.current,value:c};c||delete u.value,o(u)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{"data-testid":"system",defaultValue:t==null?void 0:t.system,onChange:c=>a(c.currentTarget.value),data:["","email","phone","fax","pager","sms","other"]}),s.jsx(ft,{"data-testid":"use",defaultValue:t==null?void 0:t.use,onChange:c=>i(c.currentTarget.value),data:["","home","work","temp","old","mobile"]}),s.jsx(se,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:c=>l(c.currentTarget.value)})]})}function Jle(e){var l;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(c){r(c),e.onChange&&e.onChange(c)}function a(c){const u={...n.current,name:c};c||delete u.name,o(u)}function i(c){const u={...n.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(se,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>a(c.currentTarget.value)}),s.jsx(t4,{name:e.name+"-telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:i})]})}function Zle(e){if(!e)return"";const t=new Date(e);return nm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function r4(e){if(!e)return"";const t=new Date(e);return nm(t)?t.toISOString():""}function Xa(e){return s.jsx(se,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:ece(),defaultValue:Zle(e.defaultValue),autoFocus:e.autoFocus,error:lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const r=t.currentTarget.value;e.onChange(r4(r))}}})}function ece(){return{}.NODE_ENV==="test"?"text":"datetime-local"}function tce(e){return s.jsx(Is,{id:e.name,name:e.name,"data-testid":"extension-input",defaultValue:ar(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function rce(e){var d,p,h;const[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(m){r(m),e.onChange&&e.onChange(m)}function a(m){o({...n.current,use:m||void 0})}function i(m){o({...n.current,prefix:m?m.split(" "):void 0})}function l(m){o({...n.current,given:m?m.split(" "):void 0})}function c(m){o({...n.current,family:m||void 0})}function u(m){o({...n.current,suffix:m?m.split(" "):void 0})}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{defaultValue:t==null?void 0:t.use,name:e.name+"-use","data-testid":"use",onChange:m=>a(m.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"]}),s.jsx(se,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(d=t==null?void 0:t.prefix)==null?void 0:d.join(" "),onChange:m=>i(m.currentTarget.value)}),s.jsx(se,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=t==null?void 0:t.given)==null?void 0:p.join(" "),onChange:m=>l(m.currentTarget.value)}),s.jsx(se,{name:e.name+"-family",placeholder:"Family",defaultValue:t==null?void 0:t.family,onChange:m=>c(m.currentTarget.value)}),s.jsx(se,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(h=t==null?void 0:t.suffix)==null?void 0:h.join(" "),onChange:m=>u(m.currentTarget.value)})]})}function nce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(se,{placeholder:"System",defaultValue:t==null?void 0:t.system,onChange:o=>n({...t,system:o.currentTarget.value})}),s.jsx(se,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:o=>n({...t,value:o.currentTarget.value})})]})}const oce=["USD","EUR","CAD","GBP","AUD"];function ace(e){var c;const{onChange:t}=e,[r,n]=f.useState(e.defaultValue),o=f.useCallback(u=>{n(u),t&&t(u)},[t]),a=f.useCallback(u=>{o({...r,currency:u.currentTarget.value})},[r,o]),i=f.useCallback(u=>{o({...r,value:u.currentTarget.valueAsNumber})},[r,o]),l=s.jsx(ft,{defaultValue:r==null?void 0:r.currency,data:oce,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:a});return s.jsx(se,{type:"number",label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=r==null?void 0:r.value)==null?void 0:c.toString())??"USD",icon:s.jsx(Rse,{size:14}),rightSection:l,rightSectionWidth:92,onChange:i})}function ice(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(Xa,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>n({...t,start:o})}),s.jsx(Xa,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>n({...t,end:o})})]})}function Ja(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>n({...t,comparator:o.currentTarget.value})}),s.jsx(se,{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:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{n({...t,value:sce(o.currentTarget.value)})}}),s.jsx(se,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>n({...t,unit:o.currentTarget.value})})]})}function sce(e){if(e)return parseFloat(e)}function T1(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(Ja,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>n({...t,low:o})}),s.jsx(Ja,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>n({...t,high:o})})]})}function lce(e){const[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(Ja,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>n({...t,numerator:o})}),s.jsx(Ja,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>n({...t,denominator:o})})]})}const cce={Observation:"code",User:"email:contains"},uce=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function dce(e){return{value:Ze(e),label:bo(e),resource:e}}function Ds(e){const t=ie(),r=e.resourceType,[n,o]=f.useState(),a=Ye(e.defaultValue,o),i=e.onChange,l=f.useCallback(async(u,d)=>{const p=pce(r),h=new URLSearchParams({[p]:u,_count:"10"});return await t.searchResources(r,h,{signal:d})},[t,r]),c=f.useCallback(u=>{i&&i(u[0])},[i]);return e.defaultValue&&!n&&!a?null:s.jsx(P1,{name:e.name,required:e.required,itemComponent:fce,defaultValue:a,placeholder:e.placeholder,maxSelectedValues:1,toKey:Ze,toOption:dce,loadOptions:l,onChange:c,clearable:!0})}const fce=f.forwardRef(({label:e,resource:t,...r},n)=>s.jsx("div",{ref:n,...r,children:s.jsxs(J,{noWrap:!0,children:[s.jsx(ua,{value:t}),s.jsxs("div",{children:[s.jsx(te,{children:e}),s.jsx(te,{size:"xs",color:"dimmed",children:t.birthDate})]})]})}));function pce(e){return cce[e]??(uce.includes(e)?"name":"_id")}function dm(e){const t=hce(e.targetTypes),r=mce(e.defaultValue,t),[n,o]=f.useState(e.defaultValue),[a,i]=f.useState(r);function l(c){o(c),e.onChange&&e.onChange(c)}return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[t&&t.length>1&&s.jsx(ft,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:a,autoFocus:e.autoFocus,onChange:c=>i(c.currentTarget.value),data:t}),!t&&s.jsx(C1,{autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:a,onChange:i,name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Ds,{resourceType:a,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:n,onChange:c=>{l(c?dt(c):void 0)}})]})}function hce(e){if(!(!e||e.length===0||e.length===1&&e[0]==="Resource"))return e}function mce(e,t){var n;const r=(n=e==null?void 0:e.reference)==null?void 0:n.split("/")[0];if(r)return r;if(t&&t.length>0)return t[0]}function gce(e){const[t,r]=f.useState(e.defaultValue&&Array.isArray(e.defaultValue)?e.defaultValue:[]),n=f.useRef();n.current=t;function o(a){r(a),e.onChange&&e.onChange(a)}return s.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((a,i)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Za,{arrayElement:!0,property:e.property,name:e.name+"."+i,defaultValue:a,onChange:l=>{const c=[...n.current];c[i]=l,o(c)}})}),s.jsx("td",{style:{textAlign:"right"},children:s.jsx(ur,{title:"Remove",size:"sm",onClick:l=>{st(l);const c=[...n.current];c.splice(i,1),o(c)},children:s.jsx(Zp,{})})})]},`${i}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{textAlign:"right"},children:s.jsx(ur,{title:"Add",size:"sm",color:"green",onClick:a=>{st(a);const i=[...n.current];i.push(void 0),o(i)},children:s.jsx(x1,{})})})]})]})]})}const vce=["sun","mon","tue","wed","thu","fri","sat"];function yce(e){const[t,r]=f.useState(e.defaultValue),[n,o]=f.useState(!1),a=f.useRef();return a.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx("span",{children:dN(a.current)||"No repeat"}),s.jsx(re,{onClick:()=>o(!0),children:"Edit"})]}),s.jsx(xce,{visible:n,defaultValue:a.current,onOk:i=>{e.onChange&&e.onChange(i),r(i),o(!1)},onCancel:()=>o(!1)})]})}const DO={repeat:{period:1,periodUnit:"d"}};function xce(e){const[t,r]=f.useState(e.defaultValue||DO),n=f.useRef();n.current=t;function o(u){r({...n.current,event:[u]})}function a(u){r({...n.current,repeat:u})}function i(u){var d;a({...(d=n.current)==null?void 0:d.repeat,period:u})}function l(u){var d;a({...(d=n.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;a({...(d=n.current)==null?void 0:d.repeat,dayOfWeek:u})}return s.jsx(Rr,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(Oe,{children:[s.jsx(et,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(Xa,{name:"timing-dialog-start",onChange:u=>o(u)})}),s.jsx(X0,{label:"Repeat",checked:!!t.repeat,onChange:u=>a(u.currentTarget.checked?DO.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(et,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(se,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>i(parseInt(u.currentTarget.value,10)||1)}),s.jsx(ft,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.currentTarget.value),data:[{label:"second",value:"s"},{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&s.jsx(et,{title:"Repeat on",children:s.jsx(Mf.Group,{multiple:!0,onChange:c,children:s.jsx(J,{position:"apart",mt:"md",spacing:"xs",children:vce.map(u=>s.jsx(Mf,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),s.jsx(J,{position:"right",children:s.jsx(re,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Za(e){const t=e.property,r=e.defaultPropertyType??t.type[0].code,n=e.name,o=e.defaultValue;if(t.max>1&&!e.arrayElement)return r===V.Attachment?s.jsx(zle,{name:n,defaultValue:o,onChange:e.onChange}):s.jsx(gce,{property:t,name:n,defaultValue:o,onChange:e.onChange});const a=t.type;return a.length>1?s.jsx(wce,{elementDefinitionTypes:a,...e}):s.jsx(n4,{elementDefinitionType:a[0],...e})}function wce(e){const t=e.elementDefinitionTypes;let r;e.defaultPropertyType&&(r=t.find(a=>a.code===e.defaultPropertyType)),r||(r=t[0]);const[n,o]=f.useState(r);return s.jsxs(J,{spacing:"xs",grow:!0,noWrap:!0,children:[s.jsx(ft,{style:{width:"200px"},defaultValue:n.code,onChange:a=>{o(t.find(i=>i.code===a.currentTarget.value))},data:t.map(a=>({value:a.code,label:a.code}))}),s.jsx(n4,{...e,elementDefinitionType:n,onChange:a=>{e.onChange&&e.onChange(a,e.name.replace("[x]",pr(n.code)))}})]})}function n4(e){var i,l,c;const t=e.property,r=e.elementDefinitionType.code,n=e.name,o=e.defaultValue,a=t.min!==void 0&&t.min>0;switch(r){case V.SystemString:case V.canonical:case V.string:case V.time:case V.uri:case V.url:return s.jsx(se,{id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case V.date:return s.jsx(se,{type:"date",id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)},error:lt(e.outcome,n)});case V.dateTime:case V.instant:return s.jsx(Xa,{name:n,defaultValue:o,onChange:e.onChange,outcome:e.outcome});case V.decimal:case V.integer:case V.positiveInt:case V.unsignedInt:return s.jsx(se,{type:"number",step:r===V.decimal?"any":"1",id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.valueAsNumber)}});case V.code:return s.jsx(GN,{binding:(i=t.binding)==null?void 0:i.valueSet,name:n,defaultValue:o,onChange:e.onChange});case V.boolean:return s.jsx($n,{id:n,name:n,"data-testid":n,defaultChecked:!!o,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.checked)}});case V.markdown:return s.jsx(_c,{id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:u=>{e.onChange&&e.onChange(u.currentTarget.value)}});case V.Address:return s.jsx(lse,{name:n,defaultValue:o,onChange:e.onChange});case V.Annotation:return s.jsx(cse,{name:n,defaultValue:o,onChange:e.onChange});case V.Attachment:return s.jsx(KN,{name:n,defaultValue:o,onChange:e.onChange});case V.CodeableConcept:return s.jsx(Gle,{binding:(l=t.binding)==null?void 0:l.valueSet,name:n,defaultValue:o,onChange:e.onChange});case V.Coding:return s.jsx(e4,{binding:(c=t.binding)==null?void 0:c.valueSet,name:n,defaultValue:o,onChange:e.onChange});case V.ContactDetail:return s.jsx(Jle,{name:n,defaultValue:o,onChange:e.onChange});case V.ContactPoint:return s.jsx(t4,{name:n,defaultValue:o,onChange:e.onChange});case V.Extension:return s.jsx(tce,{name:n,defaultValue:o,onChange:e.onChange});case V.HumanName:return s.jsx(rce,{name:n,defaultValue:o,onChange:e.onChange});case V.Identifier:return s.jsx(nce,{name:n,defaultValue:o,onChange:e.onChange});case V.Money:return s.jsx(ace,{name:n,defaultValue:o,onChange:e.onChange});case V.Period:return s.jsx(ice,{name:n,defaultValue:o,onChange:e.onChange});case V.Duration:case V.Quantity:return s.jsx(Ja,{name:n,defaultValue:o,onChange:e.onChange});case V.Range:return s.jsx(T1,{name:n,defaultValue:o,onChange:e.onChange});case V.Ratio:return s.jsx(lce,{name:n,defaultValue:o,onChange:e.onChange});case V.Reference:return s.jsx(dm,{name:n,defaultValue:o,targetTypes:bce(t),onChange:e.onChange});case V.Timing:return s.jsx(yce,{name:n,defaultValue:o,onChange:e.onChange});case V.Dosage:case V.UsageContext:return s.jsx(ey,{typeName:r,defaultValue:o,onChange:e.onChange,outcome:e.outcome});default:return s.jsx(ey,{typeName:t.type[0].code,defaultValue:o,onChange:e.onChange,outcome:e.outcome})}}function bce(e){var t,r,n;return(n=(r=(t=e==null?void 0:e.type)==null?void 0:t[0])==null?void 0:r.targetProfile)==null?void 0:n.map(o=>o.split("/").pop())}function ey(e){const[t,r]=f.useState(e.defaultValue??{});function n(l){r(l),e.onChange&&e.onChange(l)}const o=e.typeName,a=o1(o);if(!a)return s.jsxs("div",{children:[o," not implemented"]});const i={type:o,value:t};return s.jsx(Oe,{children:Object.entries(a.elements).map(([l,c])=>{if(l==="id"||YN.includes(l)||!c.type)return null;const[u,d]=Ya(i,l),p=c.min!==void 0&&c.min>0;return c.type.length===1&&c.type[0].code==="boolean"?s.jsx(JN,{title:Xp(l),description:c.description,htmlFor:l,children:s.jsx(Za,{property:c,name:l,defaultValue:u,defaultPropertyType:d,outcome:e.outcome,onChange:(h,m)=>{n(Zv(t,l,m??l,c,h))}})},l):s.jsx(et,{title:Xp(l),description:c.description,withAsterisk:p,htmlFor:l,outcome:e.outcome,children:s.jsx(Za,{property:c,name:l,defaultValue:u,defaultPropertyType:d,onChange:(h,m)=>{n(Zv(t,l,m??l,c,h))}})},l)})})}const _ce=W(()=>({root:{"@media (max-width: 800px)":{paddingLeft:4,paddingRight:4}}}));function Rc(e){const{children:t,...r}=e,{classes:n}=_ce();return s.jsx(HT,{className:n.root,...r,children:t})}const Sce=W(e=>({noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));function o4({value:e}){const{classes:t}=Sce();return e?s.jsx(Oe,{justify:"flex-start",spacing:"xs",children:e.map(r=>{var n;return r.text&&s.jsx(hT,{classNames:{cite:t.noteCite,body:t.noteBody,root:t.noteRoot},cite:((n=r.authorReference)==null?void 0:n.display)||r.authorString,icon:null,children:r.text},`note-${r.text}`)})}):null}function Tc(e){const{value:t,link:r,...n}=e,[o,a]=f.useState(),i=Ye(t,a);let l;if(o&&!_N(o))l=`[${Ce(o)}]`;else if(i)l=bo(i);else return null;return r?s.jsx(ke,{to:t,...n,children:l}):s.jsx(te,{component:"span",...n,children:l})}function os(e){return s.jsxs(J,{spacing:"xs",children:[s.jsx(ua,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Tc,{value:e.value,link:e.link})]})}const Pce={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"};function a4(e){return s.jsx(IH,{color:Pce[e.status],children:e.status})}const i4=W(e=>({table:{border:`0.1px solid ${e.colors.gray[5]}`,borderCollapse:"collapse","& td, & th":{border:`0.1px solid ${e.colors.gray[5]}`,padding:4}},criticalRow:{background:e.colorScheme==="dark"?e.colors.red[7]:e.colors.red[1],border:`0.1px solid ${e.colors.red[5]}`,color:e.colors.red[5],fontWeight:500,"& td":{border:`0.1px solid ${e.colors.red[5]}`}},noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));I1.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function I1(e){var i;const t=ie(),r=Ye(e.value),[n,o]=f.useState();if(f.useEffect(()=>{r!=null&&r.specimen&&Promise.allSettled(r.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,r]),!r)return null;const a=(n==null?void 0:n.flatMap(l=>l.note||[]))||[];if(r.presentedForm&&r.presentedForm.length>0){const l=r.presentedForm[0];(i=l.contentType)!=null&&i.startsWith("text/plain")&&l.data&&a.push({text:window.atob(l.data)})}return s.jsxs(Oe,{children:[s.jsx(de,{children:"Diagnostic Report"}),s.jsx(jce,{value:r}),n&&!e.hideSpecimenInfo&&Oce(n),r.result&&s.jsx(Cce,{hideObservationNotes:e.hideObservationNotes,value:r.result}),a.length>0&&s.jsx(o4,{value:a})]})}function jce({value:e}){var t,r;return s.jsxs(J,{mt:"md",spacing:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(te,{size:"xs",transform:"uppercase",color:"dimmed",children:"Subject"}),s.jsx(te,{children:s.jsx(os,{value:e.subject,link:!0})})]}),(t=e.resultsInterpreter)==null?void 0:t.map(n=>s.jsxs("div",{children:[s.jsx(te,{size:"xs",transform:"uppercase",color:"dimmed",children:"Interpreter"}),s.jsx(te,{children:s.jsx(os,{value:n,link:!0})})]},n.reference)),(r=e.performer)==null?void 0:r.map(n=>s.jsxs("div",{children:[s.jsx(te,{size:"xs",transform:"uppercase",color:"dimmed",children:"Performer"}),s.jsx(te,{children:s.jsx(os,{value:n,link:!0})})]},n.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(te,{size:"xs",transform:"uppercase",color:"dimmed",children:"Issued"}),s.jsx(te,{children:$r(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(te,{size:"xs",transform:"uppercase",color:"dimmed",children:"Status"}),s.jsx(te,{children:pr(e.status)})]})]})}function Oce(e){return s.jsxs(Oe,{spacing:"xs",children:[s.jsx(de,{order:2,size:"h6",children:"Specimens"}),s.jsx(Sr,{type:"ordered",children:e==null?void 0:e.map(t=>{var r;return s.jsx(Sr.Item,{ml:"sm",children:s.jsxs(J,{spacing:20,children:[s.jsxs(J,{spacing:5,children:[s.jsx(te,{fw:500,children:"Collected:"})," ",$r((r=t.collection)==null?void 0:r.collectedDateTime)]}),s.jsxs(J,{spacing:5,children:[s.jsx(te,{fw:500,children:"Received:"})," ",$r(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function Cce(e){const{classes:t}=i4();return s.jsxs("table",{className:t.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(s4,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function s4(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(r=>s.jsx(Ece,{value:r,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${hi(r)?r.reference:r.id}`))})}function Ece(e){var i,l;const{classes:t,cx:r}=i4(),n=Ye(e.value);if(!n||(i=e.ancestorIds)!=null&&i.includes(n.id))return null;const o=!e.hideObservationNotes&&n.note,a=Rce(n);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:r({[t.criticalRow]:a}),children:[s.jsx("td",{rowSpan:o?2:1,children:s.jsx(ke,{to:n,children:s.jsx(Kn,{value:n.code})})}),s.jsx("td",{children:s.jsx($ce,{value:n})}),s.jsx("td",{children:s.jsx(kce,{value:n.referenceRange})}),s.jsx("td",{children:n.interpretation&&n.interpretation.length>0&&s.jsx(Kn,{value:n.interpretation[0]})}),s.jsx("td",{children:n.category&&n.category.length>0&&s.jsx(s.Fragment,{children:n.category.map(c=>s.jsx("div",{children:s.jsx(Kn,{value:c})},`category-${ys(c)}`))})}),s.jsx("td",{children:(l=n.performer)==null?void 0:l.map(c=>s.jsx(th,{value:c},c.reference))}),s.jsx("td",{children:n.status&&s.jsx(a4,{status:n.status})})]}),n.hasMember&&s.jsx(s4,{value:n.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,n.id]:[n.id],hideObservationNotes:e.hideObservationNotes}),o&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(o4,{value:n.note})})})]})}function $ce(e){const t=e.value;return s.jsx(s.Fragment,{children:fN(t)})}function kce(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(k1,{value:t}):null}function Rce(e){var r,n,o,a;const t=(a=(o=(n=(r=e.interpretation)==null?void 0:r[0])==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:a.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const Tce=W((e,{width:t,fill:r})=>({paper:{maxWidth:t,margin:`${e.spacing.xl} auto`,padding:r?0:e.spacing.md,"@media (max-width: 800px)":{padding:r?0:8},"& img":{width:"100%",maxWidth:"100%"},"& video":{width:"100%",maxWidth:"100%"}}})),Ice={shadow:"xs",radius:"md",withBorder:!0};function D1(e){const{className:t,children:r,width:n,fill:o,unstyled:a,...i}=q("Panel",Ice,e),{classes:l,cx:c}=Tce({width:n,fill:o},{name:"Panel",unstyled:a});return s.jsx(sn,{className:c(l.paper,t),...i,children:r})}const Dce=W(e=>({root:{borderCollapse:"collapse",width:"100%","& tr":{borderTop:`0.1px solid ${e.colors.gray[3]}`},"& th, & td":{padding:`${e.spacing.sm} ${e.spacing.sm}`,verticalAlign:"top"}},removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Nce(e){const{classes:t}=Dce(),r=ie(),[n,o]=f.useState(!1);if(f.useEffect(()=>{r.requestSchema(e.original.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.original.resourceType]),!n)return null;const a=jN(e.original.resourceType);return s.jsxs("table",{className:t.root,children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:"30%"}}),s.jsx("col",{style:{width:"35%"}}),s.jsx("col",{style:{width:"35%"}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Property"}),s.jsx("th",{children:"Before"}),s.jsx("th",{children:"After"})]})}),s.jsx("tbody",{children:Object.entries(a.elements).map(([i,l])=>{if(i==="id"||i==="meta")return null;const[c,u]=Ya(Xn(e.original),i),[d,p]=Ya(Xn(e.revised),i);return NO(c)&&NO(d)||ar(c)===ar(d)?null:s.jsxs("tr",{children:[s.jsx("td",{children:Xp(i)}),s.jsx("td",{className:t.removed,children:s.jsx(So,{property:l,propertyType:u,value:c,ignoreMissingValues:!0})}),s.jsx("td",{className:t.added,children:s.jsx(So,{property:l,propertyType:p,value:d,ignoreMissingValues:!0})})]},i)})})]})}function NO(e){return!e||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0}function N1(e){const t=ie(),r=Ye(e.value),[n,o]=f.useState(!1);return f.useEffect(()=>{r&&t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log)},[t,r]),!n||!r?null:s.jsx(Jv,{value:{type:r.resourceType,value:e.forceUseInput?e.value:r},ignoreMissingValues:e.ignoreMissingValues})}function Ace(e){return s.jsx(Rc,{children:e.children})}function ei(e){var c,u;const{resource:t,profile:r,padding:n,popupMenuItems:o,...a}=e,i=r??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(D1,{"data-testid":"timeline-item",fill:!0,...a,children:[s.jsxs(J,{position:"apart",spacing:8,mx:"xs",my:"sm",children:[s.jsx(ua,{value:i,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(te,{size:"sm",children:s.jsx(Tc,{color:"dark",weight:500,value:i,link:!0})}),s.jsxs(te,{size:"xs",children:[s.jsx(ke,{color:"dimmed",to:e.resource,children:$r(l)}),s.jsx(te,{component:"span",color:"dimmed",mx:8,children:"·"}),s.jsx(ke,{color:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(X,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(X.Target,{children:s.jsx(ur,{radius:"xl","aria-label":`Actions for ${Ze(e.resource)}`,children:s.jsx(Ise,{})})}),o]})]}),s.jsxs(HN,{children:[n&&s.jsx("div",{style:{padding:"0 16px 16px 16px"},children:e.children}),!n&&s.jsx(s.Fragment,{children:e.children})]})]})}function l4(e,t){e.sort((r,n)=>{const o=AO(r,t),a=AO(n,t);return o>a?1:o<a?-1:MO(r,t)-MO(n,t)})}function AO(e,t){if(!c4(e,t)){const r=e.priority;if(typeof r=="string")return{stat:4,asap:3,urgent:2}[r]??0}return 0}function MO(e,t){var n;if(!c4(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 r=(n=e.meta)==null?void 0:n.lastUpdated;return r?new Date(r).getTime():0}function c4(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const Mce=W(e=>({pinnedComment:{backgroundColor:e.colors.blue[0]}}));function fm(e){const t=ie(),r=im(),n=t.getProfile(),o=f.useRef(null),a=Ye(e.value),[i,l]=f.useState(),[c,u]=f.useState([]),d=e.loadTimelineResources,p=f.useRef(c);p.current=c;const h=f.useCallback(k=>{l4(k,a),k.reverse(),u(k)},[a]),m=f.useCallback(k=>{const D=[];for(const N of k){if(N.status!=="fulfilled")continue;const z=N.value;if(z.type==="history"&&l(z),z.entry)for(const H of z.entry)D.push(H.resource)}h(D)},[h]),v=f.useCallback(k=>h([...p.current,k]),[h]),g=f.useCallback(()=>{var N;let k,D;"resourceType"in e.value?(k=e.value.resourceType,D=e.value.id):[k,D]=(N=e.value.reference)==null?void 0:N.split("/"),d(t,k,D).then(m).catch(console.log)},[t,e.value,d,m]);f.useEffect(()=>g(),[g]);function _(k){!a||!e.createCommunication||t.createResource(e.createCommunication(a,n,k)).then(D=>v(D)).catch(console.log)}function y(k){!a||!e.createMedia||t.createResource(e.createMedia(a,n,k)).then(D=>v(D)).then(()=>yl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(lm,{size:16}),autoClose:2e3})).catch(D=>yl({id:"upload-notification",color:"red",title:"Upload error",message:Ce(D),icon:s.jsx($O,{size:16}),autoClose:2e3}))}function x(k,D){return t.updateResource({...k,priority:D})}function w(k){x(k,"stat").then(g).catch(console.log)}function b(k){x(k,"routine").then(g).catch(console.log)}function O(k){r(`/${k.resourceType}/${k.id}`)}function C(k){r(`/${k.resourceType}/${k.id}/edit`)}function j(k){r(`/${k.resourceType}/${k.id}/delete`)}function E(k){var D;r(`/${k.resourceType}/${k.id}/_history/${(D=k.meta)==null?void 0:D.versionId}`)}function T(){pe({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function $(k){yl({id:"upload-notification",loading:!0,title:"Uploading...",message:Wce(k),autoClose:!1,withCloseButton:!1})}function I(k){yl({id:"upload-notification",color:"red",title:"Upload error",message:Ce(k),icon:s.jsx($O,{size:16}),autoClose:2e3})}return a?s.jsxs(Ace,{children:[e.createCommunication&&s.jsx(D1,{children:s.jsx(Ne,{testid:"timeline-form",onSubmit:k=>{_(k.text);const D=o.current;D&&(D.value="",D.focus())},children:s.jsxs(J,{spacing:"xs",noWrap:!0,style:{width:"100%"},children:[s.jsx(ua,{value:n}),s.jsx(se,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(ur,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(Use,{size:16})}),s.jsx(E1,{onUpload:y,onUploadStart:T,onUploadProgress:$,onUploadError:I,children:k=>s.jsx(ur,{...k,radius:"xl",color:"blue",variant:"filled",children:s.jsx(w1,{size:16})})})]})})}),c.map(k=>{var N;if(!k)return null;const D=`${k.resourceType}/${k.id}/${(N=k.meta)==null?void 0:N.versionId}`;if(k.resourceType===a.resourceType&&k.id===a.id)return s.jsx(Lce,{history:i,resource:k,onDetails:E},D);switch(k.resourceType){case"AuditEvent":return s.jsx(Bce,{resource:k,onDetails:O},D);case"Communication":return s.jsx(Fce,{resource:k,onPin:k.priority!=="stat"?w:void 0,onUnpin:k.priority==="stat"?b:void 0,onDetails:O,onEdit:C,onDelete:j},D);case"DiagnosticReport":return s.jsx(Uce,{resource:k,onDetails:O,onEdit:C,onDelete:j},D);case"Media":return s.jsx(Vce,{resource:k,onDetails:O,onEdit:C,onDelete:j},D);default:return s.jsx(ei,{resource:k,padding:!0,children:s.jsx(N1,{value:k,ignoreMissingValues:!0})},D)}})]}):s.jsx(rr,{style:{width:"100%",height:"100%"},children:s.jsx(dn,{})})}function ws(e){return s.jsxs(X.Dropdown,{children:[s.jsx(X.Label,{children:"Resource"}),e.onPin&&s.jsx(X.Item,{icon:s.jsx(qse,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${Ze(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(X.Item,{icon:s.jsx(Gse,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${Ze(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(X.Item,{icon:s.jsx(zse,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${Ze(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(X.Item,{icon:s.jsx(Dse,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${Ze(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Label,{children:"Danger zone"}),s.jsx(X.Item,{color:"red",icon:s.jsx(WN,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${Ze(e.resource)}`,children:"Delete"})]})]})}function Lce(e){const t=zce(e.history,e.resource);return t?s.jsx(ei,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(ws,{...e}),children:s.jsx(Nce,{original:t,revised:e.resource})}):s.jsxs(ei,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(ws,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(N1,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function zce(e,t){const r=e.entry,n=r.findIndex(o=>{var a,i,l;return((i=(a=o.resource)==null?void 0:a.meta)==null?void 0:i.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(n>=r.length-1))return r[n+1].resource}function Fce(e){var o,a;const{classes:t}=Mce(),n=!e.resource.priority||e.resource.priority==="routine"?void 0:t.pinnedComment;return s.jsx(ei,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(ws,{...e}),children:s.jsx("p",{children:(a=(o=e.resource.payload)==null?void 0:o[0])==null?void 0:a.contentString})})}function Vce(e){var n;const t=(n=e.resource.content)==null?void 0:n.contentType,r=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(ei,{resource:e.resource,padding:!!r,popupMenuItems:s.jsx(ws,{...e}),children:s.jsx(kc,{value:e.resource.content})})}function Bce(e){return s.jsx(ei,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(ws,{...e}),children:s.jsx(ai,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function Uce(e){return s.jsx(ei,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(ws,{...e}),children:s.jsx(I1,{value:e.resource})})}function Wce(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${jg(e.loaded)} / ${jg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${jg(e.loaded)}`}function jg(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 Hce(e){return s.jsx(fm,{value:e.resource,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,a=100;return Promise.allSettled([t.readHistory(r,n),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:a})])}})}function be(e){const{children:t,...r}=e;return s.jsx(Rc,{children:s.jsx(D1,{...r,children:t})})}function qce(e){return s.jsx(fm,{value:e.encounter,loadTimelineResources:async(t,r,n)=>Promise.allSettled([t.readHistory("Encounter",n),t.search("Communication","encounter=Encounter/"+n),t.search("Media","encounter=Encounter/"+n)]),createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",encounter:dt(t),subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",encounter:dt(t),subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function Gce(e){let t;try{t=nie(e.path,e.resource)}catch(r){return console.warn("FhirPathDisplay:",r),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return s.jsx(So,{value:t[0]||"",propertyType:e.propertyType})}function Qce(e){return s.jsxs(Rr,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(oe,{display:"flex",sx:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(LO,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(LO,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(te,{sx:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function LO(e){return s.jsx(re,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const Kce={string:[ee.EQUALS,ee.NOT,ee.CONTAINS,ee.EXACT],fulltext:[ee.EQUALS,ee.NOT,ee.CONTAINS,ee.EXACT],token:[ee.EQUALS,ee.NOT],reference:[ee.EQUALS,ee.NOT],numeric:[ee.EQUALS,ee.NOT_EQUALS,ee.GREATER_THAN,ee.LESS_THAN,ee.GREATER_THAN_OR_EQUALS,ee.LESS_THAN_OR_EQUALS],quantity:[ee.EQUALS,ee.NOT_EQUALS,ee.GREATER_THAN,ee.LESS_THAN,ee.GREATER_THAN_OR_EQUALS,ee.LESS_THAN_OR_EQUALS],date:[ee.EQUALS,ee.NOT_EQUALS,ee.GREATER_THAN,ee.LESS_THAN,ee.GREATER_THAN_OR_EQUALS,ee.LESS_THAN_OR_EQUALS,ee.STARTS_AFTER,ee.ENDS_BEFORE,ee.APPROXIMATELY],datetime:[ee.EQUALS,ee.NOT_EQUALS,ee.GREATER_THAN,ee.LESS_THAN,ee.GREATER_THAN_OR_EQUALS,ee.LESS_THAN_OR_EQUALS,ee.STARTS_AFTER,ee.ENDS_BEFORE,ee.APPROXIMATELY]},Yce={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",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",identifier:"identifier",iterate:"iterate"};function A1(e,t){return{...e,filters:t,offset:0,name:void 0}}function M1(e,t){return A1(e,(e.filters??[]).filter(r=>r.code!==t))}function pm(e,t,r,n,o){o&&(e=M1(e,t));const a=[];return e.filters&&a.push(...e.filters),a.push({code:t,operator:r,value:n??""}),A1(e,a)}function Xce(e,t){if(!e.filters)return e;const r=[...e.filters];return r.splice(t,1),{...e,filters:r,name:void 0}}function Jce(e,t){return L1(e,t,-1)}function Zce(e,t){return L1(e,t,0)}function eue(e,t){return L1(e,t,1)}function L1(e,t,r){const n=new Date;n.setDate(n.getDate()+r),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),F1(e,t,n,o)}function tue(e,t){return z1(e,t,-1)}function rue(e,t){return z1(e,t,0)}function nue(e,t){return z1(e,t,1)}function z1(e,t,r){const n=new Date;n.setMonth(n.getMonth()+r),n.setDate(1),n.setHours(0,0,0,0);const o=new Date(n.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),F1(e,t,n,o)}function oue(e,t){const r=new Date;return r.setMonth(0),r.setDate(1),r.setHours(0,0,0,0),F1(e,t,r,new Date)}function F1(e,t,r,n){return e=M1(e,t),e=zO(e,t,ee.GREATER_THAN_OR_EQUALS,r),e=zO(e,t,ee.LESS_THAN_OR_EQUALS,n),e}function zO(e,t,r,n){return pm(e,t,r,n.toISOString())}function FO(e,t,r=!0){return pm(e,t,ee.MISSING,r.toString())}function aue(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function iue(e,t){const r=e.count??$c,n=(t-1)*r;return aue(e,n)}function sue(e,t,r){return t===lue(e)&&r!==void 0&&r===cue(e)?e:{...e,sortRules:[{code:t,descending:!!r}],name:void 0}}function lue(e){const t=e.sortRules;if(!t||t.length===0)return;const r=t[0].code;return r.startsWith("-")?r.substr(1):r}function cue(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function uue(e){return Kce[e.type]}function V1(e){return Yce[e]??""}function da(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(pr).join(" "))}function due(e,t){var n,o;const r=t.name;return r==="id"?e.id:r==="meta.versionId"?(n=e.meta)==null?void 0:n.versionId:r==="_lastUpdated"?$r((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?fue(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?pue(e,t.searchParams[0]):null}function fue(e,t){var a,i,l;const r=((l=(i=(a=t.path)==null?void 0:a.split("."))==null?void 0:i.pop())==null?void 0:l.replaceAll("[x]",""))??"",[n,o]=Ya({type:e.resourceType,value:e},r);return n?s.jsx(So,{property:t,propertyType:o,value:n,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function pue(e,t){const r=h1(t.expression,[{type:e.resourceType,value:e}]);return!r||r.length===0?null:s.jsx(s.Fragment,{children:r.map((n,o)=>s.jsx(So,{propertyType:n.type,value:n.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${r.length}`))})}function hue(e){const t=f.useRef(!1),[r,n]=f.useState({search:JSON.parse(ar(e.search))}),[o,a]=f.useState(!1);f.useEffect(()=>{n({search:e.search})},[e.search]);const i=f.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=jN(c),d=a1(c);return mue(u,d).sort((p,h)=>p.localeCompare(h)).map(p=>({value:p,label:da(p)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){n({search:{...r.search,fields:c}})}return s.jsx(Rr,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs(Oe,{children:[s.jsx(Yh,{withinPortal:!0,style:{width:550},placeholder:"Select fields to display",data:i,value:r.search.fields??[],onChange:l,onDropdownOpen:()=>a(!0),onDropdownClose:()=>a(!1),maxDropdownHeight:"250px",dropdownPosition:"bottom",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(J,{position:"right",children:s.jsx(re,{onClick:()=>e.onOk(r.search),children:"OK"})})]})})}function mue(e,t){const r=[],n=new Set,o=new Set;for(const a of Object.keys(e.elements))r.push(a),n.add(a.toLowerCase()),o.add(da(a));if(t)for(const a of Object.keys(t)){const i=da(a);!n.has(a)&&!o.has(i)&&(r.push(a),n.add(a),o.add(i))}return r}function u4(e){var o;const{resourceType:t,filter:r}=e,n=(o=ca.types[t].searchParams)==null?void 0:o[r.code];if(n){if(n.type==="reference"&&(r.operator===ee.EQUALS||r.operator===ee.NOT_EQUALS))return s.jsx(Tc,{value:{reference:r.value}});const a=m1(t,n);if(r.code==="_lastUpdated"||a.type===Bo.DATETIME)return s.jsx(s.Fragment,{children:$r(r.value)})}return s.jsx(s.Fragment,{children:r.value})}function d4(e){const t=m1(e.resourceType,e.searchParam),r="filter-value";switch(t.type){case Bo.REFERENCE:return s.jsx(dm,{name:r,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(n.reference):e.onChange("")}});case Bo.BOOLEAN:return s.jsx($n,{name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.checked.toString())});case Bo.DATE:return s.jsx(se,{type:"date",name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value)});case Bo.DATETIME:return s.jsx(Xa,{name:r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Bo.NUMBER:return s.jsx(se,{type:"number",name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value)});case Bo.QUANTITY:return s.jsx(Ja,{name:r,defaultValue:gue(e.defaultValue),autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(`${n.value}`):e.onChange("")}});default:return s.jsx(se,{name:r,"data-autofocus":e.autoFocus,"data-testid":r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:n=>e.onChange(n.currentTarget.value),placeholder:"Search value"})}}function gue(e){if(e){const[t,r,n]=e.split("|");if(t)return{value:parseFloat(t),system:r,unit:n}}}function vue(e){const[t,r]=f.useState(JSON.parse(ar(e.search))),[n,o]=f.useState(-1),a=f.useRef(t);a.current=t,f.useEffect(()=>{r(JSON.parse(ar(e.search)))},[e.search]);function i(d){r(pm(a.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=a1(l)??{},u=t.filters||[];return s.jsxs(Rr,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,p)=>p===n?s.jsx(VO,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[p]=h,r(A1(a.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(yue,{resourceType:l,searchParams:c,filter:d,onEdit:()=>o(p),onDelete:()=>r(Xce(a.current,p))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(VO,{resourceType:l,searchParams:c,okText:"Add",onOk:i})]})]})}),s.jsx(J,{position:"right",mt:"xl",children:s.jsx(re,{onClick:()=>e.onOk(a.current),children:"OK"})})]})}function yue(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:da(t.code)}),s.jsx("td",{children:V1(t.operator)}),s.jsx("td",{children:s.jsx(u4,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(re,{compact:!0,variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(re,{compact:!0,variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function VO(e){const[t,r]=f.useState(e.defaultValue??{}),n=f.useRef(t);n.current=t;function o(u){r({...n.current,code:u})}function a(u){r({...n.current,operator:u})}function i(u){r({...n.current,value:u})}const l=e.searchParams[t.code],c=l&&uue(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(ft,{"data-testid":"filter-field",defaultValue:n.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:da(u)}))]})}),s.jsx("td",{children:c&&s.jsx(ft,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>a(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:V1(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(d4,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:i})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(re,{compact:!0,variant:"outline",onClick:()=>{e.onOk(n.current),r({})},children:e.okText}),e.onCancel&&s.jsx(re,{compact:!0,variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function xue(e){const[t,r]=f.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function n(){e.onOk({...e.filter,value:t})}return s.jsx(Rr,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(Ne,{onSubmit:n,children:s.jsxs(nn,{children:[s.jsx(nn.Col,{span:10,children:s.jsx(d4,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:r})}),s.jsx(nn.Col,{span:2,children:s.jsx(re,{onClick:n,fullWidth:!0,children:"OK"})})]})})})}function wue(e){if(!e.searchParams)return null;function t(a,i){o(sue(e.search,a.code,i))}function r(a){o(M1(e.search,a.code))}function n(a,i){e.onPrompt(a,{code:a.code,operator:i,value:""})}function o(a){e.onChange(a)}return e.searchParams.length===1?s.jsx(bue,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:n,onChange:o,onClear:r}):s.jsx(X.Dropdown,{children:e.searchParams.map(a=>s.jsx(X.Item,{children:da(a.code)},a.code))})}function bue(e){switch(e.searchParam.type){case"date":return s.jsx(_ue,{...e});case"number":case"quantity":return s.jsx(Sue,{...e});case"reference":return s.jsx(Pue,{...e});case"string":case"token":case"uri":return s.jsx(jue,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function _ue(e){const{searchParam:t}=e,r=t.code;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(b1,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(X.Item,{icon:s.jsx(_1,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(um,{size:14}),onClick:()=>e.onPrompt(t,ee.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(cm,{size:14}),onClick:()=>e.onPrompt(t,ee.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(UN,{size:14}),onClick:()=>e.onPrompt(t,ee.ENDS_BEFORE),children:"Before..."}),s.jsx(X.Item,{icon:s.jsx(BN,{size:14}),onClick:()=>e.onPrompt(t,ee.STARTS_AFTER),children:"After..."}),s.jsx(X.Item,{icon:s.jsx(_se,{size:14}),onClick:()=>e.onPrompt(t,ee.EQUALS),children:"Between..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(eue(e.search,r)),children:"Tomorrow"}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(Zce(e.search,r)),children:"Today"}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(Jce(e.search,r)),children:"Yesterday"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(nue(e.search,r)),children:"Next Month"}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(rue(e.search,r)),children:"This Month"}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(tue(e.search,r)),children:"Last Month"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(Ca,{size:14}),onClick:()=>e.onChange(oue(e.search,r)),children:"Year to date"}),s.jsx(hm,{...e})]})}function Sue(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(b1,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(X.Item,{icon:s.jsx(_1,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(um,{size:14}),onClick:()=>e.onPrompt(t,ee.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(cm,{size:14}),onClick:()=>e.onPrompt(t,ee.NOT_EQUALS),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(BN,{size:14}),onClick:()=>e.onPrompt(t,ee.GREATER_THAN),children:"Greater than..."}),s.jsx(X.Item,{icon:s.jsx(Xv,{size:14}),onClick:()=>e.onPrompt(t,ee.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(X.Item,{icon:s.jsx(UN,{size:14}),onClick:()=>e.onPrompt(t,ee.LESS_THAN),children:"Less than..."}),s.jsx(X.Item,{icon:s.jsx(Xv,{size:14}),onClick:()=>e.onPrompt(t,ee.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(hm,{...e})]})}function Pue(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(um,{size:14}),onClick:()=>e.onPrompt(t,ee.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(cm,{size:14}),onClick:()=>e.onPrompt(t,ee.NOT),children:"Does not equal..."}),s.jsx(hm,{...e})]})}function jue(e){const{searchParam:t}=e;return s.jsxs(X.Dropdown,{children:[s.jsx(X.Item,{icon:s.jsx(b1,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(X.Item,{icon:s.jsx(_1,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(um,{size:14}),onClick:()=>e.onPrompt(t,ee.EQUALS),children:"Equals..."}),s.jsx(X.Item,{icon:s.jsx(cm,{size:14}),onClick:()=>e.onPrompt(t,ee.NOT),children:"Does not equal..."}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(jse,{size:14}),onClick:()=>e.onPrompt(t,ee.CONTAINS),children:"Contains..."}),s.jsx(X.Item,{icon:s.jsx(Pse,{size:14}),onClick:()=>e.onPrompt(t,ee.EQUALS),children:"Does not contain..."}),s.jsx(hm,{...e})]})}function hm(e){const{searchParam:t}=e,r=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(wse,{size:14}),onClick:()=>e.onChange(FO(e.search,r)),children:"Missing"}),s.jsx(X.Item,{icon:s.jsx(xse,{size:14}),onClick:()=>e.onChange(FO(e.search,r,!1)),children:"Not missing"}),s.jsx(X.Divider,{}),s.jsx(X.Item,{icon:s.jsx(eh,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function Oue(e){const t=e.resourceType,r=[];for(const n of e.fields||["id","_lastUpdated"])r.push(Cue(t,n));return r}function Cue(e,t){var o;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const r=pi(e,t),n=kae(e,t.toLowerCase());if(r&&n)return{name:t,elementDefinition:r,searchParams:[n]};if(r){const a=a1(e);let i;if(a){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);i=Object.values(a).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),i.length===0&&(i=void 0)}return{name:t,elementDefinition:r,searchParams:i}}if(n){const a=m1(e,n);return{name:t,elementDefinition:(o=a.elementDefinitions)==null?void 0:o[0],searchParams:[n]}}return{name:t}}class Eue extends Event{constructor(t){super("change"),this.definition=t}}class $ue extends Event{constructor(t){super("load"),this.response=t}}class rh extends Event{constructor(t,r){super("click"),this.resource=t,this.browserEvent=r}}const kue=W(e=>({root:{maxWidth:"100%",overflow:"auto",textAlign:"left",marginBottom:"20px"},table:{cursor:"pointer"},tr:{"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.colors.gray[0]}},th:{padding:"0 !important"},control:{width:"100%",padding:`${e.spacing.xs} ${e.spacing.md}`,"&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]}},icon:{width:21,height:21,borderRadius:21}}));function Rue(e){var z,H,K;const{classes:t}=kue(),r=ie(),[n,o]=f.useState(!1),[a,i]=f.useState(),{search:l,onLoad:c}=e,[u,d]=f.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),p=f.useRef(u);p.current=u;const h=l.total??"accurate",m=f.useCallback(R=>{i(void 0),r.search(l.resourceType,qi({...l,total:h,fields:void 0}),R).then(M=>{d({...p.current,searchResponse:M}),c&&c(new $ue(M))}).catch(M=>{d({...p.current,searchResponse:void 0}),i(M)})},[r,l,h,c]),v=f.useCallback(()=>{d({...p.current,searchResponse:void 0}),m({cache:"reload"})},[m]);f.useEffect(()=>{m()},[m]);function g(R,M){R.stopPropagation();const Q=R.target.checked,ne={...p.current.selected};Q?ne[M]=!0:delete ne[M],d({...p.current,selected:ne})}function _(R){R.stopPropagation();const B=R.target.checked,Q={},ne=p.current.searchResponse;B&&(ne!=null&&ne.entry)&&ne.entry.forEach(Ee=>{var ce;(ce=Ee.resource)!=null&&ce.id&&(Q[Ee.resource.id]=!0)}),d({...p.current,selected:Q})}function y(){var M,B;const R=p.current;if(!((M=R.searchResponse)!=null&&M.entry)||R.searchResponse.entry.length===0)return!1;for(const Q of R.searchResponse.entry)if((B=Q.resource)!=null&&B.id&&!R.selected[Q.resource.id])return!1;return!0}function x(R){e.onChange&&e.onChange(new Eue(R))}function w(R,M){if(qN(R.target)||R.button===2)return;st(R);const B=R.button===1||R.ctrlKey||R.metaKey;!B&&e.onClick&&e.onClick(new rh(M,R)),B&&e.onAuxClick&&e.onAuxClick(new rh(M,R))}function b(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(f.useEffect(()=>{o(!1),r.requestSchema(e.search.resourceType).then(()=>o(!0)).catch(console.log)},[r,e.search.resourceType]),!n)return s.jsx(rr,{style:{width:"100%",height:"100%"},children:s.jsx(dn,{})});const O=e.checkboxesEnabled,C=Oue(l),j=l.resourceType,E=u.searchResponse,T=E==null?void 0:E.entry,$=T==null?void 0:T.map(R=>R.resource),I="subtle",k="gray",D=16,N=window.innerWidth<768;return s.jsxs("div",{className:t.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(J,{position:"apart",mb:"xl",children:[s.jsxs(J,{spacing:2,children:[s.jsx(re,{compact:!0,variant:I,color:k,leftIcon:s.jsx($se,{size:D}),onClick:()=>d({...p.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(re,{compact:!0,variant:I,color:k,leftIcon:s.jsx(Ase,{size:D}),onClick:()=>d({...p.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(re,{compact:!0,variant:I,color:k,leftIcon:s.jsx(Nse,{size:D}),onClick:e.onNew,children:"New..."}),!N&&b()&&s.jsx(re,{compact:!0,variant:I,color:k,leftIcon:s.jsx(nle,{size:D}),onClick:e.onExport?e.onExport:()=>d({...p.current,exportDialogVisible:!0}),children:"Export..."}),!N&&e.onDelete&&s.jsx(re,{compact:!0,variant:I,color:k,leftIcon:s.jsx(WN,{size:D}),onClick:()=>e.onDelete(Object.keys(u.selected)),children:"Delete..."}),!N&&e.onBulk&&s.jsx(re,{compact:!0,variant:I,color:k,leftIcon:s.jsx(bse,{size:D}),onClick:()=>e.onBulk(Object.keys(u.selected)),children:"Bulk..."})]}),s.jsxs(J,{spacing:2,children:[E&&s.jsxs(te,{size:"xs",color:"dimmed",children:[Nue(l,E.total),"-",Aue(l,E.total)," of"," ",`${h==="estimate"?"~":""}${(z=E.total)==null?void 0:z.toLocaleString()}`]}),s.jsx(ur,{title:"Refresh",onClick:v,children:s.jsx(Xse,{size:"1.125rem"})})]})]}),s.jsxs(ci,{className:t.table,children:[s.jsxs("thead",{children:[s.jsxs("tr",{children:[O&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:y(),onChange:R=>_(R)})}),C.map(R=>s.jsx("th",{children:s.jsxs(X,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(X.Target,{children:s.jsx(ho,{className:t.control,children:s.jsxs(J,{position:"apart",noWrap:!0,children:[s.jsx(te,{weight:500,size:"sm",children:da(R.name)}),s.jsx(rr,{className:t.icon,children:s.jsx(gse,{size:14,stroke:1.5})})]})})}),s.jsx(wue,{search:e.search,searchParams:R.searchParams,onPrompt:(M,B)=>{d({...p.current,filterDialogVisible:!0,filterDialogSearchParam:M,filterDialogFilter:B})},onChange:M=>{x(M)}})]})},R.name))]}),!e.hideFilters&&s.jsxs("tr",{children:[O&&s.jsx("th",{}),C.map(R=>s.jsx("th",{children:R.searchParams&&s.jsx(Tue,{resourceType:j,searchParams:R.searchParams,filters:e.search.filters})},R.name))]})]}),s.jsx("tbody",{children:$==null?void 0:$.map(R=>R&&s.jsxs("tr",{className:t.tr,"data-testid":"search-control-row",onClick:M=>w(M,R),onAuxClick:M=>w(M,R),children:[O&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!u.selected[R.id],onChange:M=>g(M,R.id)})}),C.map(M=>s.jsx("td",{children:due(R,M)},M.name))]},R.id))})]}),($==null?void 0:$.length)===0&&s.jsx(Rc,{children:s.jsx(rr,{style:{height:150},children:s.jsx(te,{size:"xl",color:"dimmed",children:"No results"})})}),(E==null?void 0:E.total)!==void 0&&E.total>0&&s.jsx(rr,{m:"md",p:"md",children:s.jsx(Zn,{value:Iue(l),total:Due(l,E.total),onChange:R=>x(iue(l,R)),getControlProps:R=>{switch(R){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),a&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(a,void 0,2)})}),s.jsx(hue,{search:e.search,visible:p.current.fieldEditorVisible,onOk:R=>{x(R),d({...p.current,fieldEditorVisible:!1})},onCancel:()=>{d({...p.current,fieldEditorVisible:!1})}}),s.jsx(vue,{search:e.search,visible:p.current.filterEditorVisible,onOk:R=>{x(R),d({...p.current,filterEditorVisible:!1})},onCancel:()=>{d({...p.current,filterEditorVisible:!1})}}),s.jsx(Qce,{visible:p.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{d({...p.current,exportDialogVisible:!1})}}),s.jsx(xue,{visible:p.current.filterDialogVisible,title:(H=u.filterDialogSearchParam)!=null&&H.code?da(u.filterDialogSearchParam.code):"",resourceType:j,searchParam:u.filterDialogSearchParam,filter:u.filterDialogFilter,defaultValue:"",onOk:R=>{x(pm(e.search,R.code,R.operator,R.value)),d({...p.current,filterDialogVisible:!1})},onCancel:()=>{d({...p.current,filterDialogVisible:!1})}},(K=u.filterDialogSearchParam)==null?void 0:K.code)]})}const Ic=S.memo(Rue);function Tue(e){const t=(e.filters??[]).filter(r=>e.searchParams.find(n=>n.code===r.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(r=>s.jsxs("div",{children:[V1(r.operator)," ",s.jsx(u4,{resourceType:e.resourceType,filter:r})]},`filter-${r.code}-${r.operator}-${r.value}`))})}function Iue(e){return Math.floor((e.offset??0)/(e.count??$c))+1}function Due(e,t){const r=e.count??$c;return Math.ceil(t/r)}function Nue(e,t){return Math.min(t,(e.offset??0)+1)}function Aue(e,t){return Math.min(t,((e.offset??0)+1)*(e.count??$c))}function Mue(e){const t=ie(),[r,n]=f.useState(!1),[o,a]=f.useState(),{query:i,fields:l}=e,[c,u]=f.useState(),[d,p]=f.useState({}),h=f.useRef();h.current=c;const m=f.useRef({});m.current=d,f.useEffect(()=>{a(void 0),t.graphql(i).then(u).catch(w=>a(ct(w)))},[t,i]);function v(w,b){w.stopPropagation();const C=w.target.checked,j={...m.current};C?j[b]=!0:delete j[b],p(j)}function g(w){var E;w.stopPropagation();const O=w.target.checked,C={},j=(E=h.current)==null?void 0:E.data.ResourceList;O&&j&&j.forEach(T=>{T.id&&(C[T.id]=!0)}),p(C)}function _(){var b;const w=(b=h.current)==null?void 0:b.data.ResourceList;if(!w||w.length===0)return!1;for(const O of w)if(O.id&&!m.current[O.id])return!1;return!0}function y(w,b){qN(w.target)||(st(w),w.button!==1&&e.onClick&&e.onClick(new rh(b,w)),w.button===1&&e.onAuxClick&&e.onAuxClick(new rh(b,w)))}if(f.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>n(!0)).catch(console.log)},[t,e.resourceType]),!r)return s.jsx(dn,{});const x=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:w=>st(w),"data-testid":"search-control",children:[s.jsxs(ci,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[x&&s.jsx("th",{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:_(),onChange:w=>g(w)})}),l.map(w=>s.jsx("th",{children:w.name},w.name))]})}),s.jsx("tbody",{children:c==null?void 0:c.data.ResourceList.map(w=>w&&s.jsxs("tr",{"data-testid":"search-control-row",onClick:b=>y(b,w),onAuxClick:b=>y(b,w),children:[x&&s.jsx("td",{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${w.id}`,checked:!!d[w.id],onChange:b=>v(b,w.id)})}),l.map(b=>s.jsx("td",{children:s.jsx(Gce,{propertyType:b.propertyType,path:b.fhirPath,resource:w})},b.name))]},w.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(re,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const Lue=S.memo(Mue);function Tn(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function zue(e){const{group:t}=e;return s.jsx(sn,{withBorder:!0,radius:"md",p:"xs",display:"flex",sx:{alignItems:"center",justifyContent:"center"},children:s.jsxs(J,{children:[t.measureScore&&s.jsx(Bue,{group:t}),!t.measureScore&&s.jsx(Vue,{group:t})]})})}function Fue(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(te,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(te,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function Vue(e){const{group:t}=e,r=t.population,n=r==null?void 0:r.find(c=>ys(c.code)==="numerator"),o=r==null?void 0:r.find(c=>ys(c.code)==="denominator"),a=n==null?void 0:n.count,i=o==null?void 0:o.count;if(i===0)return s.jsxs(oe,{children:[s.jsx(de,{order:3,children:"Not Applicable"}),s.jsx(te,{children:`Denominator: ${i}`})]});if(a===void 0||i===void 0)return s.jsxs(oe,{children:[s.jsx(de,{order:3,children:"Insufficient Data"}),s.jsx(te,{children:`Numerator: ${a}`}),s.jsx(te,{children:`Denominator: ${i}`})]});const l=a/i*100;return s.jsx(Y0,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:f4(l)}],label:s.jsx(Kf,{justify:"center",children:s.jsxs(te,{fw:700,fz:18,children:[a," / ",i]})})})}function Bue(e){var n,o,a;const{group:t}=e,r=((n=t.measureScore)==null?void 0:n.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:r==="%"?s.jsx(Y0,{size:120,thickness:12,roundCaps:!0,sections:[{value:Uue(t),color:f4(((a=t==null?void 0:t.measureScore)==null?void 0:a.value)??0)}],label:s.jsx(Kf,{justify:"center",children:s.jsx(te,{fw:700,fz:18,children:s.jsx(oc,{value:t.measureScore})})})}):s.jsx(Kf,{h:120,align:"center",children:s.jsx(de,{order:3,children:s.jsx(oc,{value:t.measureScore})})})})}function Uue(e){var n,o;const t=(n=e.measureScore)==null?void 0:n.value,r=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&r==="%"?t*100:t:0}function f4(e){return e<=33?"red":e<=67?"yellow":"green"}function Wue(e){var n;const t=Ye(e.measureReport),[r]=ise("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(oe,{children:[r&&s.jsx(Fue,{measure:r}),s.jsx(w5,{cols:3,breakpoints:[{maxWidth:"48rem",cols:2,spacing:"md"},{maxWidth:"36rem",cols:1,spacing:"sm"}],spacing:"md",children:(n=t.group)==null?void 0:n.map((o,a)=>s.jsx(zue,{group:o},o.id??a))})]}):null}function ma(e){var r;const t=((r=e.outcome)==null?void 0:r.issue)||e.issues;return!t||t.length===0?null:s.jsx(yc,{icon:s.jsx(sm,{size:16}),color:"red",children:t.map(n=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:PN(n)},(o=n.details)==null?void 0:o.text)})})}function Hue(e){const t=f.useCallback((r,n,o)=>{const a=`${n}/${o}`,i=100;return Promise.allSettled([r.readHistory("Patient",o),r.search("Communication",{subject:a,_count:i}),r.search("Device",{patient:a,_count:i}),r.search("DeviceRequest",{patient:a,_count:i}),r.search("DiagnosticReport",{subject:a,_count:i}),r.search("Media",{subject:a,_count:i}),r.search("ServiceRequest",{subject:a,_count:i}),r.search("Task",{subject:a,_count:i})])},[]);return s.jsx(fm,{value:e.patient,loadTimelineResources:t,createCommunication:(r,n,o)=>({resourceType:"Communication",status:"completed",subject:dt(r),sender:dt(n),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,n,o)=>({resourceType:"Media",status:"completed",subject:dt(r),operator:dt(n),issued:new Date().toISOString(),content:o})})}const p4=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}}}));function que(e){const t=ie(),r=Ye(e.value),[n,o]=f.useState(!1),[a,i]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){c(void 0)}function h(){i(void 0)}const m=f.useRef();if(m.current=u,f.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(d(Jue(r??{resourceType:"PlanDefinition"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!u)return null;function v(g,_){d({...m.current,[g]:_})}return s.jsx("div",{children:s.jsxs(Ne,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(se,{label:"Plan Title",defaultValue:u.title,onChange:g=>v("title",g.currentTarget.value)}),s.jsx(h4,{actions:u.action||[],selectedKey:a,setSelectedKey:i,hoverKey:l,setHoverKey:c,onChange:g=>v("action",g)}),s.jsx(re,{type:"submit",children:"Save"})]})})}function h4(e){const{classes:t}=p4(),r=f.useRef();r.current=e.actions;function n(i){e.onChange(r.current.map(l=>l.id===i.id?i:l))}function o(i){e.onChange([...r.current,i]),e.setSelectedKey(i.id)}function a(i){e.onChange(r.current.filter(l=>l!==i))}return s.jsxs("div",{className:t.section,children:[e.actions.map(i=>s.jsx("div",{children:s.jsx(Gue,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>a(i)})},i.id)),s.jsx("div",{className:t.bottomActions,children:s.jsx(Me,{href:"#",onClick:i=>{st(i),o({id:g4()})},children:"Add action"})})]})}function Gue(e){const{classes:t,cx:r}=p4(),{action:n}=e,o=Xue(n),a=e.selectedKey===e.action.id,i=e.hoverKey===e.action.id;function l(d){d.stopPropagation(),e.setSelectedKey(e.action.id)}function c(d){st(d),e.setHoverKey(e.action.id)}const u=r(t.section,{[t.editing]:a,[t.hovering]:i&&!a});return s.jsxs("div",{"data-testid":n.id,className:u,onClick:l,onMouseOver:c,children:[a?s.jsx(Kue,{action:n,actionType:o,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(Que,{action:n,actionType:o}),s.jsx("div",{className:t.bottomActions,children:s.jsx(Me,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()},children:"Remove"})})]})}const ty={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function Que(e){const{action:t,actionType:r}=e,[n,o]=m4(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",r&&`(${r})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(th,{value:{reference:t.definitionCanonical}})}),n&&s.jsx("div",{children:s.jsx(So,{property:ty,propertyType:o,value:n})})]})}function Kue(e){const{action:t}=e,[r,n]=f.useState(e.actionType);function o(a,i){e.onChange({...t,[a]:i})}return s.jsxs(Oe,{spacing:"xl",children:[s.jsx(se,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:a=>o("title",a.currentTarget.value)}),s.jsx(se,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:a=>o("description",a.currentTarget.value)}),s.jsx(ft,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:r,onChange:a=>n(a.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(h4,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:a=>o("action",a)}),(()=>{switch(r){case"appointment":return s.jsx(Au,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(Au,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(Au,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(Au,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(et,{title:"Timing",description:"When the action should take place.",children:s.jsx(Yue,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Au(e){const{id:t,definitionCanonical:r}=e.action,n=r!=null&&r.startsWith(e.resourceType+"/")?{reference:r}:void 0;return s.jsx(Ds,{name:t,resourceType:e.resourceType,defaultValue:n,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:Ze(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function Yue(e){const t=e.action,r="timing",[n,o]=m4(t);return s.jsx(Za,{property:ty,name:"timing[x]",defaultValue:n,defaultPropertyType:o,onChange:(a,i)=>{e.onChange(Zv(t,r,i??r,ty,a))}})}function Xue(e){var t,r,n;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((r=e.definitionCanonical)!=null&&r.startsWith("Questionnaire/"))return"questionnaire";if((n=e.definitionCanonical)!=null&&n.startsWith("ActivityDefinition/"))return"task"}function m4(e){return Ya({type:"PlanDefinitionAction",value:e},"timing")}let Og=1;function g4(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Og=Math.max(Og,t+1))}return e}return"id-"+Og++}function Jue(e){return{...e,action:v4(e.action)}}function v4(e){if(e)return e.map(t=>({...t,id:g4(t.id),action:v4(t.action)}))}var at=(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))(at||{});function Zue(e){return e.type==="choice"||e.type==="open-choice"}function ede(e,t){if(!e.enableWhen)return!0;const r=e.enableBehavior??"any";for(const n of e.enableWhen){const o=y4(t,n.question);if(n.operator==="exists"&&!n.answerBoolean&&!(o!=null&&o.length)){if(r==="any")return!0;continue}const{anyMatch:a,allMatch:i}=nde(n,o,r);if(r==="any"&&a)return!0;if(r==="all"&&!i)return!1}return r!=="any"}function tde(e,t,r){return e.map(n=>{var i;const o=(i=r.answerOption)==null?void 0:i.find(l=>fi(l.valueCoding)===n||l[t]===n),a=dr({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:a==null?void 0:a.value}})}function y4(e,t){if(e)for(const r of e){if(r.linkId===t)return r.answer;if(r.item){const n=y4(r.item,t);if(n)return n}}}function rde(e,t,r){if(r==="exists")return!!e===t.value;if(e){const n=r==="="||r==="!="?r==null?void 0:r.replace("=","~"):r,[{value:o}]=h1(`%actualAnswer ${n} %expectedAnswer`,[e],{actualAnswer:e,expectedAnswer:t});return o}else return!1}function nde(e,t,r){const n=t||[],o=dr({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let a=!1,i=!0;for(const l of n){const c=dr({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(rde(c,o,u)?a=!0:i=!1,r==="any"&&a)break}return{anyMatch:a,allMatch:i}}function x4(e){var r,n;const t=r1(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(n=(r=t.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:n.map(o=>o.code)}}function Cg(e,t){var o;const r=di(e);let n=r1(r,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(n&&(r.extension=(o=r.extension)==null?void 0:o.filter(a=>a!==n)),r):(n||(r.extension||(r.extension=[]),n={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},r.extension.push(n)),t.length===1?(n.valueCode=t[0],delete n.valueCodeableConcept):(n.valueCodeableConcept={coding:t.map(a=>({code:a}))},delete n.valueCode),r)}function ode(e){return{resourceType:"QuestionnaireResponse",questionnaire:Ze(e),item:w4(e.item)}}function w4(e){return(e==null?void 0:e.map(b4))??[]}function b4(e){var t;return{id:ide(),linkId:e.linkId,text:e.text,item:w4(e.item),answer:((t=e.initial)==null?void 0:t.map(sde))??[]}}let ade=1;function ide(){return"id-"+ade++}function sde(e){return{...e}}function lde(e){return e.value.display||e.value.reference||ar(e.value)}function cde(e){var r,n,o,a;const t=(r=e==null?void 0:e.item)==null?void 0:r[0];if(t){const i=r1(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((a=(o=(n=i==null?void 0:i.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:a.code)==="page")return e.item.length}return 1}function ry(e){const t=e.item,r=e.response;function n(c){var d,p,h,m;let u;Array.isArray(c)?u=c:e.index>=(((p=(d=e.response)==null?void 0:d.answer)==null?void 0:p.length)??0)?u=(((h=e.response)==null?void 0:h.answer)??[]).concat([c]):u=(((m=e.response)==null?void 0:m.answer)??[]).map((g,_)=>_===e.index?c:g)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:t.text,answer:u})}const o=t.type;if(!o)return null;const a=t.linkId;if(!a)return null;const i=t.initial&&t.initial.length>0?t.initial[0]:void 0,l=B1(r,e.index)??dr({type:"QuestionnaireItemInitial",value:i},"value");switch(o){case at.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case at.boolean:return s.jsx(JN,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx($n,{id:e.item.linkId,name:e.item.linkId,defaultChecked:l==null?void 0:l.value,onChange:c=>n({valueBoolean:c.currentTarget.checked})})},e.item.linkId);case at.decimal:return s.jsx(se,{type:"number",step:"any",id:a,name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDecimal:c.currentTarget.valueAsNumber})});case at.integer:return s.jsx(se,{type:"number",step:1,id:a,name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueInteger:c.currentTarget.valueAsNumber})});case at.date:return s.jsx(se,{type:"date",id:a,name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDate:c.currentTarget.value})});case at.dateTime:return s.jsx(Xa,{name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueDateTime:c})});case at.time:return s.jsx(se,{type:"time",id:a,name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueTime:c.currentTarget.value})});case at.string:case at.url:return s.jsx(se,{id:a,name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case at.text:return s.jsx(_c,{id:a,name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueString:c.currentTarget.value})});case at.attachment:return s.jsx(J,{py:4,children:s.jsx(KN,{name:a,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueAttachment:c})})});case at.reference:return s.jsx(dm,{name:a,required:t.required,targetTypes:x4(t),defaultValue:l==null?void 0:l.value,onChange:c=>n({valueReference:c})});case at.quantity:return s.jsx(Ja,{name:a,required:t.required,defaultValue:l==null?void 0:l.value,onChange:c=>n({valueQuantity:c}),disableWheel:!0});case at.choice:case at.openChoice:return mde(t)&&!t.answerValueSet?s.jsx(ude,{name:a,item:t,initial:i,response:r,onChangeAnswer:c=>n(c)}):s.jsx(dde,{name:a,item:t,initial:i,response:r,onChangeAnswer:c=>n(c)});default:return null}}function ude(e){var c;const{name:t,item:r,initial:n,response:o}=e;if(!((c=r.answerOption)!=null&&c.length))return s.jsx(_4,{});const a=dr({type:"QuestionnaireItemInitial",value:n},"value"),i=[""];for(const u of r.answerOption){const d=dr({type:"QuestionnaireItemAnswerOption",value:u},"value");i.push(BO(d))}const l=B1(o)??a;if(r.repeats){const{propertyName:u,data:d}=gde(e.item),p=pde(o);return s.jsx(Yh,{data:d,placeholder:"Select items",searchable:!0,defaultValue:p||[BO(a)],onChange:h=>{const m=tde(h,u,r);e.onChangeAnswer(m)}})}return s.jsx(ft,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const p=r.answerOption[d-1],h=dr({type:"QuestionnaireItemAnswerOption",value:p},"value"),m="value"+pr(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:fi(l==null?void 0:l.value)||(l==null?void 0:l.value),data:i})}function dde(e){var i;const{name:t,item:r,initial:n,onChangeAnswer:o,response:a}=e;return!((i=r.answerOption)!=null&&i.length)&&!r.answerValueSet?s.jsx(_4,{}):r.answerValueSet?s.jsx(e4,{name:t,binding:r.answerValueSet,onChange:l=>o({valueCoding:l})}):s.jsx(fde,{name:(a==null?void 0:a.id)??t,item:r,initial:n,response:a,onChangeAnswer:o})}function fde(e){const{name:t,item:r,initial:n,onChangeAnswer:o,response:a}=e,i=pi("QuestionnaireItemAnswerOption","value[x]"),l=dr({type:"QuestionnaireItemInitial",value:n},"value"),c=[];let u;if(r.answerOption)for(let h=0;h<r.answerOption.length;h++){const m=r.answerOption[h],v=`${t}-option-${h}`,g=dr({type:"QuestionnaireItemAnswerOption",value:m},"value");l&&ar(g)===ar(l)&&(u=v),c.push([v,g])}const d=B1(a),p=hde(c,d);return s.jsx(Rp.Group,{name:t,value:p??u,onChange:h=>{const m=c.find(v=>v[0]===h);if(m){const v=m[1],g="value"+pr(v.type);o({[g]:v.value})}},children:c.map(([h,m])=>s.jsx(Rp,{id:h,value:h,py:4,label:s.jsx(So,{property:i,propertyType:m.type,value:m.value})},h))})}function _4(){return s.jsx(se,{disabled:!0,placeholder:"No Answers Defined"})}function S4(e){return dr({type:"QuestionnaireItemAnswer",value:e},"value")}function B1(e,t=0){const r=e.answer;return S4((r==null?void 0:r[t])??{})}function pde(e){const t=e.answer;return t?t.map(n=>S4(n)).map(n=>fi(n==null?void 0:n.value)||(n==null?void 0:n.value)):[]}function hde(e,t){var r;return(r=e.find(n=>rm(n[1].value,t==null?void 0:t.value)))==null?void 0:r[0]}function BO(e){if(e)return e.type==="CodeableConcept"?ys(e.value):e.type==="Coding"?fi(e.value):e.type==="Reference"?lde(e):e.value.toString()}function mde(e){var t;return!!((t=e.extension)!=null&&t.some(r=>{var n,o,a;return r.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((a=(o=(n=r.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:a.code)==="drop-down"}))}function gde(e){var a;if(((a=e.answerOption)==null?void 0:a.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],r=dr({type:"QuestionnaireItemAnswerOption",value:t},"value"),n="value"+pr(r.type),o=(e.answerOption??[]).map(i=>({value:UO(i,n),label:UO(i,n)}));return{propertyName:n,data:o}}function UO(e,t){var r;return fi(e.valueCoding)||((r=e[t])==null?void 0:r.toString())}const vde=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[1]}`,borderRadius:e.radius.sm,transition:"all 0.1s"},hovering:{border:`1.5px solid ${e.colors.blue[5]}`},editing:{border:`1.5px solid ${e.colors.gray[1]}`,borderLeft:`4px solid ${e.colors.blue[5]}`},questionBody:{maxWidth:600},topActions:{position:"absolute",right:32,top:1,padding:4,color:e.colors.gray[5],fontSize:e.fontSizes.xs},bottomActions:{position:"absolute",right:4,bottom:0,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementActions:{position:"absolute",right:8,top:0,paddingTop:8,fontSize:e.fontSizes.xs,"& a":{marginLeft:8}},movementIcons:{color:e.colors.gray[5]},columnAlignment:{display:"flex",flexDirection:"column"},linkIdInput:{width:100,marginBottom:4},typeSelect:{width:100}}));function yde(e){const t=ie(),r=Ye(e.questionnaire),[n,o]=f.useState(!1),[a,i]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){d(void 0)}function h(){c(void 0)}return f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>(i(_de(r??{resourceType:"Questionnaire"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!a?null:s.jsx("div",{children:s.jsxs(Ne,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(a),children:[s.jsx(P4,{item:a,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:i}),s.jsx(re,{type:"submit",children:"Save"})]})})}function P4(e){var O;const{classes:t,cx:r}=vde(),n=e.item,o=e.item,a=ko(e.item),i=a||o.type===at.group,l=o.linkId??"[untitled]",c=e.selectedKey===e.item.id,u=e.hoverKey===e.item.id,d=f.useRef();d.current=e.item;function p(C){st(C),e.setSelectedKey(e.item.id)}function h(C){st(C),e.setHoverKey(e.item.id)}function m(C){var E;const j=d.current;e.onChange({...j,item:(E=j.item)==null?void 0:E.map(T=>T.id===C.id?C:T)})}function v(C){e.onChange({...e.item,item:[...e.item.item??[],C]})}function g(C){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.filter(E=>E!==C)})}function _(C,j){e.onChange({...d.current,[C]:j})}function y(C){e.onChange({...e.item,...C})}function x(C){var j;e.onChange({...e.item,item:(j=e.item.item)==null?void 0:j.map(E=>E===C?{...E,repeats:!E.repeats}:E)})}function w(C,j){const E=jde(e.item.item,C,j);e.onChange({...e.item,item:E})}const b=r(t.section,{[t.editing]:c,[t.hovering]:u&&!c});return s.jsxs("div",{"data-testid":o.linkId,className:b,onClick:p,onMouseOver:h,children:[s.jsx("div",{className:t.questionBody,children:c?s.jsxs(s.Fragment,{children:[a&&s.jsx(se,{size:"xl",defaultValue:n.title,onChange:C=>_("title",C.currentTarget.value)}),!a&&s.jsx(_c,{autosize:!0,minRows:2,defaultValue:o.text,onChange:C=>_("text",C.currentTarget.value)}),o.type==="reference"&&s.jsx(bde,{item:o,onChange:y}),Zue(o)&&s.jsx(xde,{item:o,onChange:C=>y(C)})]}):s.jsxs(s.Fragment,{children:[n.title&&s.jsx(de,{children:n.title}),o.text&&s.jsx("div",{children:o.text}),!i&&s.jsx(ry,{item:o,index:0,onChange:()=>{},response:{}})]})}),(O=o.item)==null?void 0:O.map((C,j)=>s.jsx("div",{children:s.jsx(P4,{item:C,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:j===0,isLast:j===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:m,onRemove:()=>g(C),onRepeatable:x,onMoveUp:()=>w(j,-1),onMoveDown:()=>w(j,1)})},C.id)),!i&&s.jsx("div",{className:t.topActions,children:c?s.jsxs(s.Fragment,{children:[s.jsx(se,{size:"xs",className:t.linkIdInput,defaultValue:o.linkId,onChange:C=>_("linkId",C.currentTarget.value)}),!i&&s.jsx(ft,{size:"xs",className:t.typeSelect,defaultValue:o.type,onChange:C=>_("type",C.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):s.jsx("div",{children:l})}),!a&&s.jsx(oe,{className:t.movementActions,children:s.jsxs(oe,{className:t.columnAlignment,children:[!e.isFirst&&s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(yse,{"data-testid":"up-button",size:15,className:t.movementIcons})}),!e.isLast&&s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(vse,{"data-testid":"down-button",size:15,className:t.movementIcons})})]})}),s.jsxs("div",{className:t.bottomActions,children:[i&&s.jsxs(s.Fragment,{children:[s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),v({id:ti(),linkId:ay("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),v({id:ti(),linkId:ay("g"),type:"group",text:"Group"})},children:"Add group"})]}),a&&s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),v(Pde())},children:"Add Page"}),c&&!a&&s.jsxs(s.Fragment,{children:[s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),e.onRepeatable&&e.onRepeatable(o)},children:o.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Me,{href:"#",onClick:C=>{C.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function xde(e){const t=pi("QuestionnaireItemAnswerOption","value[x]"),r=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(se,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:n=>e.onChange({...e.item,answerValueSet:n.target.value})}):s.jsx(wde,{options:r,property:t,item:e.item,onChange:e.onChange}),s.jsxs(oe,{display:"flex",children:[s.jsx(Me,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...r,{id:ti()}]})},children:"Add choice"}),s.jsx(tm,{w:"lg"}),s.jsx(Me,{href:"#",onClick:n=>{st(n),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function wde(e){return s.jsx("div",{children:e.options.map(t=>{const[r,n]=Ya({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(Za,{name:"value[x]",property:e.property,defaultPropertyType:n,defaultValue:r,onChange:(o,a)=>{const i=[...e.options],l=i.findIndex(c=>c.id===t.id);i[l]={id:t.id,[a]:o},e.onChange({...e.item,answerOption:i})}},t.id)}),s.jsx("div",{children:s.jsx(Me,{href:"#",onClick:o=>{st(o),e.onChange({...e.item,answerOption:e.options.filter(a=>a.id!==t.id)})},children:"Remove"})})]},t.id)})})}function bde(e){const t=x4(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((r,n)=>s.jsxs(J,{children:[s.jsx(C1,{name:"resourceType",placeholder:"Resource Type",defaultValue:r,onChange:o=>{e.onChange(Cg(e.item,t.map(a=>a===r?o:a)))}}),s.jsx(Me,{href:"#",onClick:o=>{st(o),e.onChange(Cg(e.item,t.filter(a=>a!==r)))},children:"Remove"})]},`${r}-${n}`)),s.jsx(Me,{href:"#",onClick:r=>{st(r),e.onChange(Cg(e.item,[...t,""]))},children:"Add Resource Type"})]})}let ny=1,oy=1;function ay(e){return e+ny++}function ti(){return"id-"+oy++}function _de(e){return{...e,id:e.id||ti(),item:j4(e.item)}}function j4(e){if(e)return e.forEach(t=>{var r,n;(r=t.id)!=null&&r.match(/^id-\d+$/)&&(oy=Math.max(oy,parseInt(t.id.substring(3),10)+1)),(n=t.linkId)!=null&&n.match(/^q\d+$/)&&(ny=Math.max(ny,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||ti(),item:j4(t.item),answerOption:Sde(t.answerOption)}))}function Sde(e){if(e)return e.map(t=>({...t,id:t.id||ti()}))}function Pde(){return{id:ti(),linkId:ay("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 jde(e,t,r){const n=e??[],o=t+r;if(o<0||o>=n.length)return n;const a=[...n];return[a[t],a[o]]=[a[o],a[t]],a}function O4(e){const{item:t,response:r,onChange:n}=e,[o,a]=f.useState(Ode(t,r??{}));if(!e.checkForQuestionEnabled(t)||!r)return null;if(t.type===at.display)return s.jsx("p",{children:t.text},t.linkId);const i=(t==null?void 0:t.repeats)&&t.type!==at.choice&&t.type!==at.openChoice;return t.type===at.boolean?s.jsx(ry,{item:t,response:r,onChange:l=>n([l]),index:0},t.linkId):s.jsxs(et,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(ry,{item:t,response:r,onChange:u=>n([u]),index:c},`${t.linkId}-${c}`)),i&&s.jsx(Me,{onClick:()=>a(l=>l+1),children:"Add Item"})]},e.item.linkId)}function Ode(e,t){if(e.type===at.choice||e.type===at.openChoice)return 1;const r=t.answer;return r!=null&&r.length?r.length:1}function C4(e){const[t,r]=f.useState(e.response);if(t.length===0)return null;function n(a,i){const l=t.map((c,u)=>u===i?a[0]:c);r(l),e.onChange(l)}function o(){const a=b4(e.item);r([...t,a])}return s.jsxs(s.Fragment,{children:[t.map((a,i)=>s.jsx(E4,{item:e.item,response:a,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>n(l,i)},a.id)),e.item.repeats&&s.jsx(Me,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function E4(e){var a;const{response:t,checkForQuestionEnabled:r,onChange:n}=e;function o(i){var d;const l=(d=t.item)==null?void 0:d.map(p=>i.find(m=>m.id===p.id)??p),c=l==null?void 0:l.concat(i.slice(1)),u={...t,item:c};n([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(de,{order:3,mb:"md",children:e.item.text}),s.jsx(Oe,{children:(a=e.item.item)==null?void 0:a.map(i=>{var l,c,u;return i.type===at.group?i.repeats?s.jsx(C4,{item:i,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===i.linkId))??[],checkForQuestionEnabled:r,onChange:o},i.linkId):s.jsx(E4,{item:i,checkForQuestionEnabled:r,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===i.linkId))??{},onChange:o},i.linkId):s.jsx(O4,{item:i,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===i.linkId),onChange:o,checkForQuestionEnabled:r},i.linkId)})})]},e.item.linkId):null}function Cde(e){const{items:t,response:r,activePage:n,onChange:o,nextStep:a,prevStep:i,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,p=t.map(h=>{var g;const m=((g=r==null?void 0:r.item)==null?void 0:g.filter(_=>_.linkId===h.linkId))??[],v=h.type===at.group?s.jsx(C4,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(O4,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(tc.Step,{label:h.text,children:v},h.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(tc,{active:n??0,allowNextStepsSelect:!1,p:6,children:p}),!c&&s.jsx(Oe,{children:p}),s.jsx(Ede,{activePage:n??0,numberOfPages:l,nextStep:a,prevStep:i,submitButtonText:u})]})}function Ede(e){const t=e.activePage>0,r=e.activePage<e.numberOfPages-1,n=e.activePage===e.numberOfPages-1;return s.jsxs(J,{position:"right",mt:"xl",spacing:"xs",children:[t&&s.jsx(re,{onClick:e.prevStep,children:"Back"}),r&&s.jsx(re,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),n&&s.jsx(re,{type:"submit",children:e.submitButtonText??"Submit"})]})}function $4(e){const t=ie(),r=t.getProfile(),[n,o]=f.useState(!1),a=Ye(e.questionnaire),[i,l]=f.useState(),[c,u]=f.useState(0);f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),f.useEffect(()=>{l(a?ode(a):void 0)},[a]);function d(g){const _=(i==null?void 0:i.item)??[],x={resourceType:"QuestionnaireResponse",item:k4(_,Array.isArray(g)?g:[g])};l(x)}function p(g){return ede(g,(i==null?void 0:i.item)??[])}if(!n||!a)return null;const h=cde(a),m=()=>u(g=>g+1),v=()=>u(g=>g-1);return s.jsxs(Ne,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&i&&e.onSubmit({...i,questionnaire:Ze(a),subject:e.subject,source:dt(r),authored:new Date().toISOString(),status:"completed"})},children:[a.title&&s.jsx(de,{children:a.title}),s.jsx(Cde,{items:a.item??[],response:i,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:p,nextStep:m,prevStep:v})]})}function $de(e,t){const r=k4(e.item??[],t.item??[]);return{...t,item:r.length>0?r:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function k4(e,t){const r=[],n=new Set;for(const o of e){const a=o.id,i=t.find(l=>l.id===a);i?(r.push($de(o,i)),n.add(i.id)):r.push(o)}for(const o of t)n.has(o.id)||r.push(o);return r}const kde=W(e=>({section:{position:"relative",margin:"4px 4px 8px 0",padding:"6px 12px 16px 6px",border:`1.5px solid ${e.colors.gray[3]}`,borderRadius:e.radius.sm,transition:"all 0.1s"}})),Rde=["gender","age","gestationalAge","context","appliesTo","category"],Tde={definition:{resourceType:"ObservationDefinition"},onSubmit:()=>{}};function Ide(e){e=Object.assign(Tde,e);const t=e.definition,[r,n]=f.useState([]),[o,a]=f.useState(1),[i,l]=f.useState(1);return f.useEffect(()=>{const v=Ade(t,l);n(Mde(v.qualifiedInterval||[],a))},[t]),s.jsxs(Ne,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(Oe,{children:r.map(v=>{var g;return s.jsx(Dde,{unit:zde((g=t.quantitativeDetails)==null?void 0:g.unit),onChange:p,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:v},`group-${v.id}`)})}),s.jsx(ur,{title:"Add Group",size:"sm",onClick:v=>{st(v),u({id:`group-id-${o}`,filters:{},intervals:[]}),a(g=>g+1)},children:s.jsx(x1,{})}),s.jsx(J,{position:"right",children:s.jsx(re,{type:"submit",children:"Save"})})]});function c(){const v=r.flatMap(g=>g.intervals).filter(g=>!Fde(g));e.onSubmit({...t,qualifiedInterval:v})}function u(v){n(g=>[...g,v])}function d(v){n(g=>g.filter(_=>_.id!==v.id))}function p(v,g){n(_=>{_=[..._];const y=_.find(w=>w.id===v),x=y==null?void 0:y.intervals.findIndex(w=>w.id===g.id);return x!==void 0&&(y!=null&&y.intervals[x])&&(y.intervals[x]=g),_})}function h(v,g){g.id===void 0&&(g.id=`id-${i}`,l(_=>_+1)),n(_=>{_=[..._];const y=_.findIndex(x=>x.id===v);if(y!==-1){const x={..._[y]};g={...g,...x.filters},x.intervals=[...x.intervals,g],_[y]=x}return _})}function m(v,g){n(_=>{_=[..._];const y=_.find(x=>x.id===v);return y&&(y.intervals=y.intervals.filter(x=>x.id!==g.id)),_})}}function Dde(e){const{intervalGroup:t,unit:r}=e,{classes:n}=kde();return s.jsx(Rc,{"data-testid":t.id,className:n.section,children:s.jsxs(Oe,{spacing:"lg",children:[s.jsx(J,{position:"right",children:s.jsx(ur,{title:"Remove Group","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:o=>{st(o),e.onRemoveGroup(t)},children:s.jsx(Zp,{})},`remove-group-button-${t.id}`)}),s.jsx(Nde,{intervalGroup:t,onChange:e.onChange}),s.jsx(wr,{}),t.intervals.map(o=>s.jsxs(Oe,{spacing:"xs",children:[s.jsxs(J,{children:[s.jsx(se,{"data-testid":`condition-${o.id}`,defaultValue:o.condition,label:"Condition: ",size:"sm",onChange:a=>{st(a),e.onChange(t.id,{...o,condition:a.currentTarget.value.trim()})}},`condition-${o.id}`),s.jsx(ur,{title:"Remove Interval",size:"sm","data-testid":`remove-interval-${o.id}`,onClick:a=>{st(a),e.onRemove(t.id,o)},children:s.jsx(Zp,{})},`remove-interval-${o.id}`)]}),s.jsx(T1,{onChange:a=>{e.onChange(t.id,{...o,range:a})},name:`range-${o.id}`,defaultValue:o.range},`range-${o.id}`)]},`interval-${o.id}`)),s.jsx(ur,{title:"Add Interval",size:"sm",onClick:o=>{st(o),e.onAdd(t.id,{range:{low:{unit:r},high:{unit:r}}})},children:s.jsx(x1,{})})]})})}function Nde(e){var n,o;const{intervalGroup:t,onChange:r}=e;t.filters.age||(t.filters.age={});for(const a of["low","high"])(n=t.filters.age[a])!=null&&n.unit||(t.filters.age[a]={...t.filters.age[a],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs(Oe,{style:{maxWidth:"50%"},children:[s.jsx(J,{children:s.jsx(ft,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:a=>{for(const i of t.intervals){let l=a.currentTarget.value;l===""&&(l=void 0),r(t.id,{...i,gender:l})}}})}),s.jsxs(J,{spacing:"xs",children:[s.jsx(te,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(T1,{name:`age-${t.id}`,defaultValue:t.filters.age,onChange:a=>{for(const i of t.intervals)r(t.id,{...i,age:a})}},`age-${t.id}`)})]}),s.jsx(ft,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:a=>{for(const i of t.intervals){let l=a.currentTarget.value;l===""?(l=void 0,r(t.id,{...i,context:void 0})):r(t.id,{...i,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(ft,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:a=>{for(const i of t.intervals){const l=a.currentTarget.value;l===""?r(t.id,{...i,category:void 0}):r(t.id,{...i,category:l})}}})]})}function Ade(e,t){const r=e.qualifiedInterval||[];let n=Math.max(...r.map(o=>{var i;const a=parseInt(((i=o.id)==null?void 0:i.substring(3))||"",10);return isNaN(a)?Number.NEGATIVE_INFINITY:a}))+1;return Number.isFinite(n)||(n=1),e={...e,qualifiedInterval:r.map(o=>({...o,id:o.id||`id-${n++}`}))},t(n),e}function Mde(e,t){let r=1;const n={};for(const o of e){const a=Lde(o);a in n||(n[a]={id:`group-id-${r++}`,filters:Object.fromEntries(Rde.map(i=>[i,o[i]])),intervals:[]}),n[a].intervals.push(o)}return t(r),Object.values(n)}function Lde(e){var r,n;return[`gender=${e.gender}`,`age=${rc(e.age)}`,`gestationalAge=${rc(e.gestationalAge)}`,`context=${(r=e.context)==null?void 0:r.text}`,`appliesTo=${(n=e.appliesTo)==null?void 0:n.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function zde(e){return e&&(Hoe(e,"http://unitsofmeasure.org")||e.text)}function Fde(e){var t,r,n,o;return((r=(t=e.range)==null?void 0:t.low)==null?void 0:r.value)===void 0&&((o=(n=e.range)==null?void 0:n.high)==null?void 0:o.value)===void 0}function Vde(e){var u;const t=ie(),r=Ye(e.value),[n,o]=f.useState(!1),[a,i]=f.useState();if(f.useEffect(()=>{r&&!n&&(t.executeBatch(l(r)).then(i).catch(console.log),o(!0))},[t,r,n]),!r||!a)return null;return s.jsx(nn,{children:(u=r.action)==null?void 0:u.map((d,p)=>{var g,_,y,x,w,b;const h=d.resource&&c(d.resource),m=(_=(g=h==null?void 0:h.input)==null?void 0:g[0])==null?void 0:_.valueReference,v=(x=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:x.valueReference;return s.jsxs(S.Fragment,{children:[s.jsx(nn.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(Cse,{}):s.jsx(ele,{color:"gray"})}),s.jsxs(nn.Col,{span:9,p:"xs",children:[s.jsx(te,{weight:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Tc,{value:(w=h==null?void 0:h.meta)==null?void 0:w.author})," on ",$r((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(a4,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(nn.Col,{span:2,p:"md",children:[m&&!v&&s.jsx(re,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&v&&s.jsx(re,{onClick:()=>e.onEdit(h,m,v),children:"Edit"})]})]},`action-${p}`)})});function l(d){var h;const p=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&p.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:p}}function c(d){for(const p of a==null?void 0:a.entry)if(p.resource&&d.reference===Ze(p.resource))return p.resource}}function R4(e,t){const r=Bde(e,t);return Ude(r,e,t)}function Bde(e,t){const r=e.length,n=t.length,o=r+n+1,a=1+2*o,i=a/2|0,l=new Array(a);l[i+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=i+u,p=d+1,h=d-1,m=l[p],v=l[h];let g,_=0;u===-c||u!==c&&v.i<m.i?(_=m.i,g=m):(_=v.i+1,g=v),l[h]=void 0;let y=_-u,x={i:_,j:y,prev:Wde(g),snake:!1};for(;_<r&&y<n&&e[_]===t[y];)_++,y++;if(_>x.i&&(x={i:_,j:y,prev:x,snake:!0}),l[d]=x,_>=r&&y>=n)return l[d]}l[i+c-1]=void 0}}function Ude(e,t,r){const n=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const a=o.i,i=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,a)},d={position:c,lines:r.slice(c,i)};let p;u.lines.length===0&&d.lines.length>0?p="insert":u.lines.length>0&&d.lines.length===0?p="delete":p="change",n.push({original:u,revised:d,type:p}),o.snake&&(o=o.prev)}return n}function Wde(e){return e&&!e.snake&&e.prev?e.prev:e}function Hde(e){const t=e.entry.filter(n=>!!n.resource).map(n=>{var o;return{meta:(o=n.resource)==null?void 0:o.meta,lines:ar(n.resource,!0).match(/[^\r\n]+/g)}}).sort((n,o)=>n.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),r=t[0].lines.map(n=>({id:t[0].meta.versionId,meta:t[0].meta,value:n,span:1}));return qde(r,t),Gde(r),r}function qde(e,t){for(let r=1;r<t.length;r++){const n=R4(t[r-1].lines,t[r].lines);for(const o of n){const a=o.original.position,i=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(a,i.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(a+c,0,{id:t[r].meta.versionId,meta:t[r].meta,value:l[c],span:1})}}}function Gde(e){let t=0;for(;t<e.length;){let r=t;for(;r<e.length&&e[r].id===e[t].id;)e[r].span=-1,r++;e[t].span=r-t,t=r}}function Qde(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Kde(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),r=Math.floor(t/31536e3);if(r>0)return $i(r,"year");const n=Math.floor(t/2592e3);if(n>0)return $i(n,"month");const o=Math.floor(t/86400);if(o>0)return $i(o,"day");const a=Math.floor(t/3600);if(a>0)return $i(a,"hour");const i=Math.floor(t/60);return i>0?$i(i,"minute"):$i(t,"second")}function $i(e,t){return`${e} ${e===1?t:t+"s"} ago`}const Yde=W(e=>({container:{overflowX:"auto"},root:{border:`0.1px solid ${e.colors.gray[3]}`,borderCollapse:"collapse",borderRadius:e.radius.sm,borderSpacing:0,fontSize:e.fontSizes.xs,width:"100%","& td":{padding:"2px 4px 0 4px",verticalAlign:"top",whiteSpace:"nowrap"}},startRow:{borderTop:`0.1px solid ${e.colors.gray[3]}`},normalRow:{borderTop:0},author:{lineHeight:"10px"},dateTime:{borderRight:`0.1px solid ${e.colors.gray[3]}`,lineHeight:"20px"},lineNumber:{backgroundColor:e.colors.gray[1],border:0,color:e.colors.gray[5],fontFamily:e.fontFamilyMonospace,padding:`${e.spacing.xs} ${e.spacing.sm}`,textAlign:"right"},line:{fontFamily:e.fontFamilyMonospace,fontSize:e.fontSizes.sm,padding:`${e.spacing.xs} ${e.spacing.sm}`},pre:{margin:0}}));function Xde(e){var l,c;const{classes:t}=Yde(),r=ie(),[n,o]=f.useState(e.history);if(f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&r.readHistory(e.resourceType,e.id).then(o).catch(console.log)},[r,e.history,e.resourceType,e.id]),!n)return s.jsx("div",{children:"Loading..."});const a=(c=(l=n.entry)==null?void 0:l[0])==null?void 0:c.resource;if(!a)return null;const i=Hde(n);return s.jsx("div",{className:t.container,children:s.jsx("table",{className:t.root,children:s.jsx("tbody",{children:i.map((u,d)=>s.jsxs("tr",{className:u.span>0?t.startRow:t.normalRow,children:[u.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:t.author,rowSpan:u.span,children:s.jsx(os,{value:u.meta.author,link:!0})}),s.jsx("td",{className:t.dateTime,rowSpan:u.span,children:s.jsx(ke,{to:Qde(a,u.meta.versionId),children:Kde(u.meta.lastUpdated)})})]}),s.jsx("td",{className:t.lineNumber,children:d+1}),s.jsx("td",{className:t.line,children:s.jsx("pre",{className:t.pre,children:u.value})})]},"row-"+d))})})})}const Jde=W(e=>({removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Zde(e){let t=e.original,r=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},r={...r,meta:void 0});const n=ar(t,!0).match(/[^\r\n]+/g),o=ar(r,!0).match(/[^\r\n]+/g),a=R4(n,o);return s.jsx("pre",{style:{color:"gray"},children:a.map((i,l)=>s.jsx(efe,{delta:i},"delta"+l))})}function efe(e){const{classes:t}=Jde();return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:t.removed,children:e.delta.original.lines.join(`
191
+ `)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:t.added,children:e.delta.revised.lines.join(`
192
+ `)}),"...",s.jsx("br",{})]})}function T4(e){const t=ie(),r=Ye(e.defaultValue),[n,o]=f.useState(!1),[a,i]=f.useState();return f.useEffect(()=>{r&&(i(di(r)),t.requestSchema(r.resourceType).then(()=>o(!0)).catch(console.log))},[t,r]),!n||!a?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.onSubmit&&e.onSubmit(a)},children:[s.jsxs(Oe,{mb:"xl",children:[s.jsx(et,{title:"Resource Type",htmlFor:"resourceType",outcome:e.outcome,children:s.jsx(se,{name:"resourceType",defaultValue:a.resourceType,disabled:!0})}),s.jsx(et,{title:"ID",htmlFor:"id",outcome:e.outcome,children:s.jsx(se,{name:"id",defaultValue:a.id,disabled:!0})})]}),s.jsx(ey,{typeName:a.resourceType,defaultValue:a,outcome:e.outcome,onChange:i}),s.jsxs(J,{position:"right",mt:"xl",children:[s.jsx(re,{type:"submit",children:"OK"}),e.onDelete&&s.jsx(re,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(a)},children:"Delete"})]})]})}function tfe(e){var o;const t=ie(),[r,n]=f.useState(e.history);return f.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(n).catch(console.log)},[t,e.history,e.resourceType,e.id]),r?s.jsxs(ci,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Author"}),s.jsx("th",{children:"Date"}),s.jsx("th",{children:"Version"})]})}),s.jsx("tbody",{children:(o=r.entry)==null?void 0:o.map((a,i)=>s.jsx(rfe,{entry:a},"entry-"+i))})]}):s.jsx("div",{children:"Loading..."})}function rfe(e){var n,o,a;const{response:t,resource:r}=e.entry;return r?s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(os,{value:(n=r.meta)==null?void 0:n.author,link:!0})}),s.jsx("td",{children:$r((o=r.meta)==null?void 0:o.lastUpdated)}),s.jsx("td",{children:s.jsx(ke,{to:nfe(r),children:(a=r.meta)==null?void 0:a.versionId})})]}):s.jsx("tr",{children:s.jsx("td",{colSpan:3,children:Ce(t==null?void 0:t.outcome)})})}function nfe(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function ofe(e){return s.jsx(fm,{value:e.serviceRequest,loadTimelineResources:async(t,r,n)=>{const o=`${r}/${n}`,a=100;return Promise.allSettled([t.readHistory("ServiceRequest",n),t.search("Communication",{"based-on":o,_count:a}),t.search("DiagnosticReport",{"based-on":o,_count:a}),t.search("Media",{"based-on":o,_count:a}),t.search("DocumentReference",{related:o,_count:a}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:a})])},createCommunication:(t,r,n)=>({resourceType:"Communication",status:"completed",basedOn:[dt(t)],subject:t.subject,sender:dt(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",basedOn:[dt(t)],subject:t.subject,operator:dt(r),issued:new Date().toISOString(),content:n})})}function I4(e){const t=ie(),[r,n]=f.useState();return s.jsxs(Ne,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(a){n(ct(a))}},children:[s.jsxs(rr,{sx:{flexDirection:"column"},children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Create project"})]}),s.jsxs(Oe,{spacing:"xl",children:[s.jsx(se,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:lt(r,"firstName")}),s.jsxs(te,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Me,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Me,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(J,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"Create project"})})]})}function D4(e,t){const r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.async=!0,n.src=e,n.onload=t??null,r.appendChild(n)}function N4(e){const t=ie(),{googleClientId:r,handleGoogleCredential:n}=e,o=f.useRef(null),[a,i]=f.useState(typeof google<"u"),[l,c]=f.useState(!1),[u,d]=f.useState(!1);return f.useEffect(()=>{if(typeof google>"u"){D4("https://accounts.google.com/gsi/client",()=>i(!0));return}l||(google.accounts.id.initialize({client_id:r,callback:n}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,r,l,a,o,u,n]),r?s.jsx("div",{ref:o}):null}function A4(e){var t;if(e)return e;if(typeof window<"u"){const r=window.location.protocol+"//"+window.location.host;if((((t={}.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(r))return"__GOOGLE_CLIENT_ID__"}}function M4(e){typeof grecaptcha>"u"&&D4("https://www.google.com/recaptcha/api.js?render="+e)}function L4(e){return new Promise((t,r)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(n){r(n)}})})}function afe(e){const t=A4(e.googleClientId),r=e.recaptchaSiteKey,n=ie(),[o,a]=f.useState(),i=R1(o,void 0);return f.useEffect(()=>{r&&M4(r)},[r]),s.jsxs(Ne,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";r&&(c=await L4(r)),e.handleAuthResponse(await n.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:r,recaptchaToken:c}))}catch(c){a(ct(c))}},children:[s.jsx(rr,{sx:{flexDirection:"column"},children:e.children}),s.jsx(ma,{issues:i}),t&&s.jsxs(s.Fragment,{children:[s.jsx(J,{position:"center",p:"xl",style:{height:70},children:s.jsx(N4,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await n.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){a(ct(c))}}})}),s.jsx(wr,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(Oe,{spacing:"xl",children:[s.jsx(se,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:lt(o,"firstName")}),s.jsx(se,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:lt(o,"lastName")}),s.jsx(se,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:lt(o,"email")}),s.jsx(fo,{name:"password",label:"Password",autoComplete:"off",required:!0,error:lt(o,"password")}),s.jsxs(te,{color:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Me,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Me,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(te,{color:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Me,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Me,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(J,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx($n,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(re,{type:"submit",children:"Create account"})]})]})}function ife(e){const{type:t,projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:a,onSuccess:i}=e,l=ie(),[c,u]=f.useState(),[d,p]=f.useState();f.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:r}).then(m=>l.processCode(m.code)).then(()=>i()).catch(m=>p(ct(m)))},[l,t,r,c,i]);function h(m){m.code?l.processCode(m.code).then(()=>i()).catch(console.log):m.login&&u(m.login)}return s.jsxs(be,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(afe,{projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:a,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(I4,{login:c,handleAuthResponse:h})]})}function sfe(e){const[t,r]=f.useState();return t?s.jsx(cfe,{email:t,...e}):s.jsx(lfe,{setEmail:r,...e})}function lfe(e){const{setEmail:t,onRegister:r,handleAuthResponse:n,children:o,disableEmailAuth:a,...i}=e,l=ie(),c=!e.disableGoogleAuth&&A4(e.googleClientId),u=f.useCallback(async h=>{if(!h.authorizeUrl)return!1;const m=JSON.stringify({...await l.ensureCodeChallenge(i),domain:h.domain}),v=new URL(h.authorizeUrl);return v.searchParams.set("state",m),window.location.assign(v.toString()),!0},[l,i]),d=f.useCallback(async h=>{const m=await l.post("auth/method",{email:h.email});await u(m)||t(h.email)},[l,u,t]),p=f.useCallback(async h=>{const m=await l.startGoogleLogin({...i,googleCredential:h.credential});await u(m)||n(m)},[l,i,u,n]);return s.jsxs(Ne,{style:{maxWidth:400},onSubmit:d,children:[s.jsx(rr,{sx:{flexDirection:"column"},children:o}),c&&s.jsxs(s.Fragment,{children:[s.jsx(J,{position:"center",p:"xl",style:{height:70},children:s.jsx(N4,{googleClientId:c,handleGoogleCredential:p})}),!a&&s.jsx(wr,{label:"or",labelPosition:"center",my:"lg"})]}),!a&&s.jsx(se,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0}),s.jsxs(J,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[s.jsx("div",{children:r&&s.jsx(Me,{component:"button",type:"button",color:"dimmed",onClick:r,size:"xs",children:"Register"})}),!a&&s.jsx(re,{type:"submit",children:"Next"})]})]})}function cfe(e){const{onForgotPassword:t,handleAuthResponse:r,children:n,...o}=e,a=ie(),[i,l]=f.useState(),c=R1(i,void 0),u=f.useCallback(d=>{a.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(r).catch(p=>l(ct(p)))},[a,o,r]);return s.jsxs(Ne,{style:{maxWidth:400},onSubmit:u,children:[s.jsx(rr,{sx:{flexDirection:"column"},children:n}),s.jsx(ma,{issues:c}),s.jsx(Oe,{spacing:"xl",children:s.jsx(fo,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:lt(i,"password")})}),s.jsxs(J,{position:"apart",mt:"xl",spacing:0,noWrap:!0,children:[t&&s.jsx(Me,{component:"button",type:"button",color:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx($n,{id:"remember",name:"remember",label:"Remember me",size:"xs",sx:{lineHeight:1}}),s.jsx(re,{type:"submit",children:"Sign in"})]})]})}function ufe(e){const t=ie(),[r,n]=f.useState();return s.jsxs(Oe,{children:[s.jsxs(rr,{sx:{flexDirection:"column"},children:[s.jsx(Tn,{size:32}),s.jsx(de,{order:3,children:"Choose profile"})]}),s.jsx(ma,{outcome:r}),e.memberships.map(o=>{var a,i;return s.jsx(ho,{onClick:()=>{t.post("auth/profile",{login:e.login,profile:o.id}).then(e.handleAuthResponse).catch(l=>n(ct(l)))},children:s.jsxs(J,{children:[s.jsx(Sf,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(te,{size:"sm",weight:500,children:(a=o.profile)==null?void 0:a.display}),s.jsx(te,{color:"dimmed",size:"xs",children:(i=o.project)==null?void 0:i.display})]})]})},o.id)})]})}function dfe(e){const t=ie();return s.jsx(Ne,{style:{maxWidth:400},onSubmit:r=>{t.post("auth/scope",{login:e.login,scope:Object.keys(r).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs(Oe,{children:[s.jsxs(rr,{sx:{flexDirection:"column"},children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Choose scope"})]}),s.jsx(Oe,{children:(e.scope??"openid").split(" ").map(r=>s.jsx($n,{id:r,name:r,label:r,defaultChecked:!0},r))}),s.jsx(J,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Set scope"})})]})})}function ffe(e){const t=ie(),[r,n]=f.useState();return s.jsx(Ne,{style:{maxWidth:400},onSubmit:o=>{n(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(a=>n(Ce(a)))},children:s.jsxs(Oe,{children:[s.jsxs(rr,{sx:{flexDirection:"column"},children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Enter MFA code"})]}),r&&s.jsx(yc,{icon:s.jsx(sm,{size:16}),title:"Error",color:"red",children:r}),s.jsx(Oe,{children:s.jsx(se,{name:"token",label:"MFA code",required:!0})}),s.jsx(J,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Submit code"})})]})})}function z4(e){const{login:t,chooseScopes:r,onSuccess:n,onForgotPassword:o,onRegister:a,onCode:i,...l}=e,c=ie(),[u,d]=f.useState(),[p,h]=f.useState(!1),[m,v]=f.useState(),g=f.useCallback(x=>{i?i(x):c.processCode(x).then(()=>{n&&n()}).catch(w=>pe({color:"red",message:Ce(w)}))},[c,i,n]),_=f.useCallback(x=>{h(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&v(x.memberships),x.code&&(r?v(void 0):g(x.code))},[r,g]),y=f.useCallback(x=>{g(x.code)},[g]);return f.useEffect(()=>{t&&!u&&c.get("auth/login/"+t).then(_).catch(x=>pe({color:"red",message:Ce(x)}))},[c,t,u,_]),s.jsx(be,{width:450,children:(()=>u?p?s.jsx(ffe,{login:u,handleAuthResponse:_}):m?s.jsx(ufe,{login:u,memberships:m,handleAuthResponse:_}):e.projectId==="new"?s.jsx(I4,{login:u,handleAuthResponse:_}):e.chooseScopes?s.jsx(dfe,{login:u,scope:e.scope,handleAuthResponse:y}):s.jsx("div",{children:"Success"}):s.jsx(sfe,{onForgotPassword:o,onRegister:a,handleAuthResponse:_,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children}))()})}var F4,WO=gc;F4=WO.createRoot,WO.hydrateRoot;/**
193
+ * @remix-run/router v1.9.0
194
+ *
195
+ * Copyright (c) Remix Software Inc.
196
+ *
197
+ * This source code is licensed under the MIT license found in the
198
+ * LICENSE.md file in the root directory of this source tree.
199
+ *
200
+ * @license MIT
201
+ */function xt(){return xt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},xt.apply(this,arguments)}var Rt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Rt||(Rt={}));const HO="popstate";function pfe(e){e===void 0&&(e={});function t(n,o){let{pathname:a,search:i,hash:l}=n.location;return ac("",{pathname:a,search:i,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function r(n,o){return typeof o=="string"?o:Dc(o)}return mfe(t,r,null,e)}function $e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function bs(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hfe(){return Math.random().toString(36).substr(2,8)}function qO(e,t){return{usr:e.state,key:e.key,idx:t}}function ac(e,t,r,n){return r===void 0&&(r=null),xt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Ro(t):t,{state:r,key:t&&t.key||n||hfe()})}function Dc(e){let{pathname:t="/",search:r="",hash:n=""}=e;return r&&r!=="?"&&(t+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function Ro(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substr(r),e=e.substr(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substr(n),e=e.substr(0,n)),e&&(t.pathname=e)}return t}function mfe(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,l=Rt.Pop,c=null,u=d();u==null&&(u=0,i.replaceState(xt({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function p(){l=Rt.Pop;let _=d(),y=_==null?null:_-u;u=_,c&&c({action:l,location:g.location,delta:y})}function h(_,y){l=Rt.Push;let x=ac(g.location,_,y);r&&r(x,_),u=d()+1;let w=qO(x,u),b=g.createHref(x);try{i.pushState(w,"",b)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;o.location.assign(b)}a&&c&&c({action:l,location:g.location,delta:1})}function m(_,y){l=Rt.Replace;let x=ac(g.location,_,y);r&&r(x,_),u=d();let w=qO(x,u),b=g.createHref(x);i.replaceState(w,"",b),a&&c&&c({action:l,location:g.location,delta:0})}function v(_){let y=o.location.origin!=="null"?o.location.origin:o.location.href,x=typeof _=="string"?_:Dc(_);return $e(y,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,y)}let g={get action(){return l},get location(){return e(o,i)},listen(_){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(HO,p),c=_,()=>{o.removeEventListener(HO,p),c=null}},createHref(_){return t(o,_)},createURL:v,encodeLocation(_){let y=v(_);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(_){return i.go(_)}};return g}var Ot;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ot||(Ot={}));const gfe=new Set(["lazy","caseSensitive","path","id","index","children"]);function vfe(e){return e.index===!0}function iy(e,t,r,n){return r===void 0&&(r=[]),n===void 0&&(n={}),e.map((o,a)=>{let i=[...r,a],l=typeof o.id=="string"?o.id:i.join("-");if($e(o.index!==!0||!o.children,"Cannot specify children on an index route"),$e(!n[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),vfe(o)){let c=xt({},o,t(o),{id:l});return n[l]=c,c}else{let c=xt({},o,t(o),{id:l,children:void 0});return n[l]=c,o.children&&(c.children=iy(o.children,t,i,n)),c}})}function Gi(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?Ro(t):t,o=Nc(n.pathname||"/",r);if(o==null)return null;let a=V4(e);xfe(a);let i=null;for(let l=0;i==null&&l<a.length;++l)i=Efe(a[l],Rfe(o));return i}function yfe(e,t){let{route:r,pathname:n,params:o}=e;return{id:r.id,pathname:n,params:o,data:t[r.id],handle:r.handle}}function V4(e,t,r,n){t===void 0&&(t=[]),r===void 0&&(r=[]),n===void 0&&(n="");let o=(a,i,l)=>{let c={relativePath:l===void 0?a.path||"":l,caseSensitive:a.caseSensitive===!0,childrenIndex:i,route:a};c.relativePath.startsWith("/")&&($e(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=oa([n,c.relativePath]),d=r.concat(c);a.children&&a.children.length>0&&($e(a.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),V4(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Ofe(u,a.index),routesMeta:d})};return e.forEach((a,i)=>{var l;if(a.path===""||!((l=a.path)!=null&&l.includes("?")))o(a,i);else for(let c of B4(a.path))o(a,i,c)}),t}function B4(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,o=r.endsWith("?"),a=r.replace(/\?$/,"");if(n.length===0)return o?[a,""]:[a];let i=B4(n.join("/")),l=[];return l.push(...i.map(c=>c===""?a:[a,c].join("/"))),o&&l.push(...i),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function xfe(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Cfe(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const wfe=/^:\w+$/,bfe=3,_fe=2,Sfe=1,Pfe=10,jfe=-2,GO=e=>e==="*";function Ofe(e,t){let r=e.split("/"),n=r.length;return r.some(GO)&&(n+=jfe),t&&(n+=_fe),r.filter(o=>!GO(o)).reduce((o,a)=>o+(wfe.test(a)?bfe:a===""?Sfe:Pfe),n)}function Cfe(e,t){return e.length===t.length&&e.slice(0,-1).every((n,o)=>n===t[o])?e[e.length-1]-t[t.length-1]:0}function Efe(e,t){let{routesMeta:r}=e,n={},o="/",a=[];for(let i=0;i<r.length;++i){let l=r[i],c=i===r.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=$fe({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(n,d.params);let p=l.route;a.push({params:n,pathname:oa([o,d.pathname]),pathnameBase:Nfe(oa([o,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(o=oa([o,d.pathnameBase]))}return a}function $fe(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=kfe(e.path,e.caseSensitive,e.end),o=t.match(r);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:n.reduce((u,d,p)=>{if(d==="*"){let h=l[p]||"";i=a.slice(0,a.length-h.length).replace(/(.)\/+$/,"$1")}return u[d]=Tfe(l[p]||"",d),u},{}),pathname:a,pathnameBase:i,pattern:e}}function kfe(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),bs(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 n=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^$?{}|()[\]]/g,"\\$&").replace(/\/:(\w+)/g,(i,l)=>(n.push(l),"/([^\\/]+)"));return e.endsWith("*")?(n.push("*"),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),n]}function Rfe(e){try{return decodeURI(e)}catch(t){return bs(!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 Tfe(e,t){try{return decodeURIComponent(e)}catch(r){return bs(!1,'The value for the URL param "'+t+'" will not be decoded because'+(' the string "'+e+'" is a malformed URL segment. This is probably')+(" due to a bad percent encoding ("+r+").")),e}}function Nc(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function Ife(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?Ro(e):e;return{pathname:r?r.startsWith("/")?r:Dfe(r,t):t,search:Afe(n),hash:Mfe(o)}}function Dfe(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function Eg(e,t,r,n){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function U1(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function U4(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=Ro(e):(o=xt({},e),$e(!o.pathname||!o.pathname.includes("?"),Eg("?","pathname","search",o)),$e(!o.pathname||!o.pathname.includes("#"),Eg("#","pathname","hash",o)),$e(!o.search||!o.search.includes("#"),Eg("#","search","hash",o)));let a=e===""||o.pathname==="",i=a?"/":o.pathname,l;if(n||i==null)l=r;else{let p=t.length-1;if(i.startsWith("..")){let h=i.split("/");for(;h[0]==="..";)h.shift(),p-=1;o.pathname=h.join("/")}l=p>=0?t[p]:"/"}let c=Ife(o,l),u=i&&i!=="/"&&i.endsWith("/"),d=(a||i===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const oa=e=>e.join("/").replace(/\/\/+/g,"/"),Nfe=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Afe=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Mfe=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class W1{constructor(t,r,n,o){o===void 0&&(o=!1),this.status=t,this.statusText=r||"",this.internal=o,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}}function W4(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const H4=["post","put","patch","delete"],Lfe=new Set(H4),zfe=["get",...H4],Ffe=new Set(zfe),Vfe=new Set([301,302,303,307,308]),Bfe=new Set([307,308]),$g={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Ufe={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},il={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},q4=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Wfe=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function Hfe(e){const t=e.window?e.window:typeof window<"u"?window:void 0,r=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",n=!r;$e(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let L=e.detectErrorBoundary;o=F=>({hasErrorBoundary:L(F)})}else o=Wfe;let a={},i=iy(e.routes,o,void 0,a),l,c=e.basename||"/",u=xt({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),d=null,p=new Set,h=null,m=null,v=null,g=e.hydrationData!=null,_=Gi(i,e.history.location,c),y=null;if(_==null){let L=Zr(404,{pathname:e.history.location.pathname}),{matches:F,route:U}=tC(i);_=F,y={[U.id]:L}}let x=!_.some(L=>L.route.lazy)&&(!_.some(L=>L.route.loader)||e.hydrationData!=null),w,b={historyAction:e.history.action,location:e.history.location,matches:_,initialized:x,navigation:$g,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||y,fetchers:new Map,blockers:new Map},O=Rt.Pop,C=!1,j,E=!1,T=!1,$=[],I=[],k=new Map,D=0,N=-1,z=new Map,H=new Set,K=new Map,R=new Map,M=new Map,B=!1;function Q(){return d=e.history.listen(L=>{let{action:F,location:U,delta:Y}=L;if(B){B=!1;return}bs(M.size===0||Y!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let me=ht({currentLocation:b.location,nextLocation:U,historyAction:F});if(me&&Y!=null){B=!0,e.history.go(Y*-1),Qe(me,{state:"blocked",location:U,proceed(){Qe(me,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),e.history.go(Y)},reset(){let ye=new Map(b.blockers);ye.set(me,il),ce({blockers:ye})}});return}return rt(F,U)}),b.initialized||rt(Rt.Pop,b.location),w}function ne(){d&&d(),p.clear(),j&&j.abort(),b.fetchers.forEach((L,F)=>Kr(F)),b.blockers.forEach((L,F)=>he(F))}function Ee(L){return p.add(L),()=>p.delete(L)}function ce(L){b=xt({},b,L),p.forEach(F=>F(b))}function Le(L,F){var U,Y;let me=b.actionData!=null&&b.navigation.formMethod!=null&&bn(b.navigation.formMethod)&&b.navigation.state==="loading"&&((U=L.state)==null?void 0:U._isRedirect)!==!0,ye;F.actionData?Object.keys(F.actionData).length>0?ye=F.actionData:ye=null:me?ye=b.actionData:ye=null;let _e=F.loaderData?eC(b.loaderData,F.loaderData,F.matches||[],F.errors):b.loaderData,ge=b.blockers;ge.size>0&&(ge=new Map(ge),ge.forEach((Ke,gt)=>ge.set(gt,il)));let fe=C===!0||b.navigation.formMethod!=null&&bn(b.navigation.formMethod)&&((Y=L.state)==null?void 0:Y._isRedirect)!==!0;l&&(i=l,l=void 0),E||O===Rt.Pop||(O===Rt.Push?e.history.push(L,L.state):O===Rt.Replace&&e.history.replace(L,L.state)),ce(xt({},F,{actionData:ye,loaderData:_e,historyAction:O,location:L,initialized:!0,navigation:$g,revalidation:"idle",restoreScrollPosition:To(L,F.matches||b.matches),preventScrollReset:fe,blockers:ge})),O=Rt.Pop,C=!1,E=!1,T=!1,$=[],I=[]}async function Ie(L,F){if(typeof L=="number"){e.history.go(L);return}let U=sy(b.location,b.matches,c,u.v7_prependBasename,L,F==null?void 0:F.fromRouteId,F==null?void 0:F.relative),{path:Y,submission:me,error:ye}=QO(u.v7_normalizeFormMethod,!1,U,F),_e=b.location,ge=ac(b.location,Y,F&&F.state);ge=xt({},ge,e.history.encodeLocation(ge));let fe=F&&F.replace!=null?F.replace:void 0,Ke=Rt.Push;fe===!0?Ke=Rt.Replace:fe===!1||me!=null&&bn(me.formMethod)&&me.formAction===b.location.pathname+b.location.search&&(Ke=Rt.Replace);let gt=F&&"preventScrollReset"in F?F.preventScrollReset===!0:void 0,xe=ht({currentLocation:_e,nextLocation:ge,historyAction:Ke});if(xe){Qe(xe,{state:"blocked",location:ge,proceed(){Qe(xe,{state:"proceeding",proceed:void 0,reset:void 0,location:ge}),Ie(L,F)},reset(){let Se=new Map(b.blockers);Se.set(xe,il),ce({blockers:Se})}});return}return await rt(Ke,ge,{submission:me,pendingError:ye,preventScrollReset:gt,replace:F&&F.replace})}function pt(){if(qe(),ce({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){rt(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}rt(O||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation})}}async function rt(L,F,U){j&&j.abort(),j=null,O=L,E=(U&&U.startUninterruptedRevalidation)===!0,Ar(b.location,b.matches),C=(U&&U.preventScrollReset)===!0;let Y=l||i,me=U&&U.overrideNavigation,ye=Gi(Y,F,c);if(!ye){let Se=Zr(404,{pathname:F.pathname}),{matches:vt,route:Yt}=tC(Y);mt(),Le(F,{matches:vt,loaderData:{},errors:{[Yt.id]:Se}});return}if(b.initialized&&!T&&Yfe(b.location,F)&&!(U&&U.submission&&bn(U.submission.formMethod))){Le(F,{matches:ye});return}j=new AbortController;let _e=ll(e.history,F,j.signal,U&&U.submission),ge,fe;if(U&&U.pendingError)fe={[Qi(ye).route.id]:U.pendingError};else if(U&&U.submission&&bn(U.submission.formMethod)){let Se=await nt(_e,F,U.submission,ye,{replace:U.replace});if(Se.shortCircuited)return;ge=Se.pendingActionData,fe=Se.pendingActionError,me=kg(F,U.submission),_e=new Request(_e.url,{signal:_e.signal})}let{shortCircuited:Ke,loaderData:gt,errors:xe}=await Ir(_e,F,ye,me,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,ge,fe);Ke||(j=null,Le(F,xt({matches:ye},ge?{actionData:ge}:{},{loaderData:gt,errors:xe})))}async function nt(L,F,U,Y,me){me===void 0&&(me={}),qe();let ye=epe(F,U);ce({navigation:ye});let _e,ge=cy(Y,F);if(!ge.route.action&&!ge.route.lazy)_e={type:Ot.error,error:Zr(405,{method:L.method,pathname:F.pathname,routeId:ge.route.id})};else if(_e=await sl("action",L,ge,Y,a,o,c),L.signal.aborted)return{shortCircuited:!0};if(as(_e)){let fe;return me&&me.replace!=null?fe=me.replace:fe=_e.location===b.location.pathname+b.location.search,await Nr(b,_e,{submission:U,replace:fe}),{shortCircuited:!0}}if(Tl(_e)){let fe=Qi(Y,ge.route.id);return(me&&me.replace)!==!0&&(O=Rt.Push),{pendingActionData:{},pendingActionError:{[fe.route.id]:_e.error}}}if(La(_e))throw Zr(400,{type:"defer-action"});return{pendingActionData:{[ge.route.id]:_e.data}}}async function Ir(L,F,U,Y,me,ye,_e,ge,fe){let Ke=Y||kg(F,me),gt=me||ye||oC(Ke),xe=l||i,[Se,vt]=KO(e.history,b,U,gt,F,T,$,I,K,H,xe,c,ge,fe);if(mt(ze=>!(U&&U.some(sr=>sr.route.id===ze))||Se&&Se.some(sr=>sr.route.id===ze)),N=++D,Se.length===0&&vt.length===0){let ze=gi();return Le(F,xt({matches:U,loaderData:{},errors:fe||null},ge?{actionData:ge}:{},ze?{fetchers:new Map(b.fetchers)}:{})),{shortCircuited:!0}}if(!E){vt.forEach(sr=>{let Dn=b.fetchers.get(sr.key),_a=cl(void 0,Dn?Dn.data:void 0);b.fetchers.set(sr.key,_a)});let ze=ge||b.actionData;ce(xt({navigation:Ke},ze?Object.keys(ze).length===0?{actionData:null}:{actionData:ze}:{},vt.length>0?{fetchers:new Map(b.fetchers)}:{}))}vt.forEach(ze=>{k.has(ze.key)&&jt(ze.key),ze.controller&&k.set(ze.key,ze.controller)});let Yt=()=>vt.forEach(ze=>jt(ze.key));j&&j.signal.addEventListener("abort",Yt);let{results:In,loaderResults:wa,fetcherResults:gr}=await eo(b.matches,U,Se,vt,L);if(L.signal.aborted)return{shortCircuited:!0};j&&j.signal.removeEventListener("abort",Yt),vt.forEach(ze=>k.delete(ze.key));let vr=rC(In);if(vr){if(vr.idx>=Se.length){let ze=vt[vr.idx-Se.length].key;H.add(ze)}return await Nr(b,vr.result,{replace:_e}),{shortCircuited:!0}}let{loaderData:gn,errors:ba}=ZO(b,U,Se,wa,fe,vt,gr,R);R.forEach((ze,sr)=>{ze.subscribe(Dn=>{(Dn||ze.done)&&R.delete(sr)})});let Io=gi(),yi=vi(N),As=Io||yi||vt.length>0;return xt({loaderData:gn,errors:ba},As?{fetchers:new Map(b.fetchers)}:{})}function Dr(L){return b.fetchers.get(L)||Ufe}function ir(L,F,U,Y){if(n)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.");k.has(L)&&jt(L);let me=l||i,ye=sy(b.location,b.matches,c,u.v7_prependBasename,U,F,Y==null?void 0:Y.relative),_e=Gi(me,ye,c);if(!_e){Qr(L,F,Zr(404,{pathname:ye}));return}let{path:ge,submission:fe,error:Ke}=QO(u.v7_normalizeFormMethod,!0,ye,Y);if(Ke){Qr(L,F,Ke);return}let gt=cy(_e,ge);if(C=(Y&&Y.preventScrollReset)===!0,fe&&bn(fe.formMethod)){hn(L,F,ge,gt,_e,fe);return}K.set(L,{routeId:F,path:ge}),Dt(L,F,ge,gt,_e,fe)}async function hn(L,F,U,Y,me,ye){if(qe(),K.delete(L),!Y.route.action&&!Y.route.lazy){let je=Zr(405,{method:ye.formMethod,pathname:U,routeId:F});Qr(L,F,je);return}let _e=b.fetchers.get(L),ge=tpe(ye,_e);b.fetchers.set(L,ge),ce({fetchers:new Map(b.fetchers)});let fe=new AbortController,Ke=ll(e.history,U,fe.signal,ye);k.set(L,fe);let gt=D,xe=await sl("action",Ke,Y,me,a,o,c);if(Ke.signal.aborted){k.get(L)===fe&&k.delete(L);return}if(as(xe))if(k.delete(L),N>gt){let je=Ti(void 0);b.fetchers.set(L,je),ce({fetchers:new Map(b.fetchers)});return}else{H.add(L);let je=cl(ye);return b.fetchers.set(L,je),ce({fetchers:new Map(b.fetchers)}),Nr(b,xe,{fetcherSubmission:ye})}if(Tl(xe)){Qr(L,F,xe.error);return}if(La(xe))throw Zr(400,{type:"defer-action"});let Se=b.navigation.location||b.location,vt=ll(e.history,Se,fe.signal),Yt=l||i,In=b.navigation.state!=="idle"?Gi(Yt,b.navigation.location,c):b.matches;$e(In,"Didn't find any matches after fetcher action");let wa=++D;z.set(L,wa);let gr=cl(ye,xe.data);b.fetchers.set(L,gr);let[vr,gn]=KO(e.history,b,In,ye,Se,T,$,I,K,H,Yt,c,{[Y.route.id]:xe.data},void 0);gn.filter(je=>je.key!==L).forEach(je=>{let Yr=je.key,yr=b.fetchers.get(Yr),zc=cl(void 0,yr?yr.data:void 0);b.fetchers.set(Yr,zc),k.has(Yr)&&jt(Yr),je.controller&&k.set(Yr,je.controller)}),ce({fetchers:new Map(b.fetchers)});let ba=()=>gn.forEach(je=>jt(je.key));fe.signal.addEventListener("abort",ba);let{results:Io,loaderResults:yi,fetcherResults:As}=await eo(b.matches,In,vr,gn,vt);if(fe.signal.aborted)return;fe.signal.removeEventListener("abort",ba),z.delete(L),k.delete(L),gn.forEach(je=>k.delete(je.key));let ze=rC(Io);if(ze){if(ze.idx>=vr.length){let je=gn[ze.idx-vr.length].key;H.add(je)}return Nr(b,ze.result)}let{loaderData:sr,errors:Dn}=ZO(b,b.matches,vr,yi,void 0,gn,As,R);if(b.fetchers.has(L)){let je=Ti(xe.data);b.fetchers.set(L,je)}let _a=vi(wa);b.navigation.state==="loading"&&wa>N?($e(O,"Expected pending action"),j&&j.abort(),Le(b.navigation.location,{matches:In,loaderData:sr,errors:Dn,fetchers:new Map(b.fetchers)})):(ce(xt({errors:Dn,loaderData:eC(b.loaderData,sr,In,Dn)},_a||gn.length>0?{fetchers:new Map(b.fetchers)}:{})),T=!1)}async function Dt(L,F,U,Y,me,ye){let _e=b.fetchers.get(L),ge=cl(ye,_e?_e.data:void 0);b.fetchers.set(L,ge),ce({fetchers:new Map(b.fetchers)});let fe=new AbortController,Ke=ll(e.history,U,fe.signal);k.set(L,fe);let gt=D,xe=await sl("loader",Ke,Y,me,a,o,c);if(La(xe)&&(xe=await K4(xe,Ke.signal,!0)||xe),k.get(L)===fe&&k.delete(L),Ke.signal.aborted)return;if(as(xe))if(N>gt){let vt=Ti(void 0);b.fetchers.set(L,vt),ce({fetchers:new Map(b.fetchers)});return}else{H.add(L),await Nr(b,xe);return}if(Tl(xe)){let vt=Qi(b.matches,F);b.fetchers.delete(L),ce({fetchers:new Map(b.fetchers),errors:{[vt.route.id]:xe.error}});return}$e(!La(xe),"Unhandled fetcher deferred data");let Se=Ti(xe.data);b.fetchers.set(L,Se),ce({fetchers:new Map(b.fetchers)})}async function Nr(L,F,U){let{submission:Y,fetcherSubmission:me,replace:ye}=U===void 0?{}:U;F.revalidate&&(T=!0);let _e=ac(L.location,F.location,{_isRedirect:!0});if($e(_e,"Expected a location on the redirect navigation"),r){let Se=!1;if(F.reloadDocument)Se=!0;else if(q4.test(F.location)){const vt=e.history.createURL(F.location);Se=vt.origin!==t.location.origin||Nc(vt.pathname,c)==null}if(Se){ye?t.location.replace(F.location):t.location.assign(F.location);return}}j=null;let ge=ye===!0?Rt.Replace:Rt.Push,{formMethod:fe,formAction:Ke,formEncType:gt}=L.navigation;!Y&&!me&&fe&&Ke&&gt&&(Y=oC(L.navigation));let xe=Y||me;if(Bfe.has(F.status)&&xe&&bn(xe.formMethod))await rt(ge,_e,{submission:xt({},xe,{formAction:F.location}),preventScrollReset:C});else{let Se=kg(_e,Y);await rt(ge,_e,{overrideNavigation:Se,fetcherSubmission:me,preventScrollReset:C})}}async function eo(L,F,U,Y,me){let ye=await Promise.all([...U.map(fe=>sl("loader",me,fe,F,a,o,c)),...Y.map(fe=>fe.matches&&fe.match&&fe.controller?sl("loader",ll(e.history,fe.path,fe.controller.signal),fe.match,fe.matches,a,o,c):{type:Ot.error,error:Zr(404,{pathname:fe.path})})]),_e=ye.slice(0,U.length),ge=ye.slice(U.length);return await Promise.all([nC(L,U,_e,_e.map(()=>me.signal),!1,b.loaderData),nC(L,Y.map(fe=>fe.match),ge,Y.map(fe=>fe.controller?fe.controller.signal:null),!0)]),{results:ye,loaderResults:_e,fetcherResults:ge}}function qe(){T=!0,$.push(...mt()),K.forEach((L,F)=>{k.has(F)&&(I.push(F),jt(F))})}function Qr(L,F,U){let Y=Qi(b.matches,F);Kr(L),ce({errors:{[Y.route.id]:U},fetchers:new Map(b.fetchers)})}function Kr(L){let F=b.fetchers.get(L);k.has(L)&&!(F&&F.state==="loading"&&z.has(L))&&jt(L),K.delete(L),z.delete(L),H.delete(L),b.fetchers.delete(L)}function jt(L){let F=k.get(L);$e(F,"Expected fetch controller: "+L),F.abort(),k.delete(L)}function mi(L){for(let F of L){let U=Dr(F),Y=Ti(U.data);b.fetchers.set(F,Y)}}function gi(){let L=[],F=!1;for(let U of H){let Y=b.fetchers.get(U);$e(Y,"Expected fetcher: "+U),Y.state==="loading"&&(H.delete(U),L.push(U),F=!0)}return mi(L),F}function vi(L){let F=[];for(let[U,Y]of z)if(Y<L){let me=b.fetchers.get(U);$e(me,"Expected fetcher: "+U),me.state==="loading"&&(jt(U),z.delete(U),F.push(U))}return mi(F),F.length>0}function Z(L,F){let U=b.blockers.get(L)||il;return M.get(L)!==F&&M.set(L,F),U}function he(L){b.blockers.delete(L),M.delete(L)}function Qe(L,F){let U=b.blockers.get(L)||il;$e(U.state==="unblocked"&&F.state==="blocked"||U.state==="blocked"&&F.state==="blocked"||U.state==="blocked"&&F.state==="proceeding"||U.state==="blocked"&&F.state==="unblocked"||U.state==="proceeding"&&F.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+F.state);let Y=new Map(b.blockers);Y.set(L,F),ce({blockers:Y})}function ht(L){let{currentLocation:F,nextLocation:U,historyAction:Y}=L;if(M.size===0)return;M.size>1&&bs(!1,"A router only supports one blocker at a time");let me=Array.from(M.entries()),[ye,_e]=me[me.length-1],ge=b.blockers.get(ye);if(!(ge&&ge.state==="proceeding")&&_e({currentLocation:F,nextLocation:U,historyAction:Y}))return ye}function mt(L){let F=[];return R.forEach((U,Y)=>{(!L||L(Y))&&(U.cancel(),F.push(Y),R.delete(Y))}),F}function to(L,F,U){if(h=L,v=F,m=U||null,!g&&b.navigation===$g){g=!0;let Y=To(b.location,b.matches);Y!=null&&ce({restoreScrollPosition:Y})}return()=>{h=null,v=null,m=null}}function mn(L,F){return m&&m(L,F.map(Y=>yfe(Y,b.loaderData)))||L.key}function Ar(L,F){if(h&&v){let U=mn(L,F);h[U]=v()}}function To(L,F){if(h){let U=mn(L,F),Y=h[U];if(typeof Y=="number")return Y}return null}function xa(L){a={},l=iy(L,o,void 0,a)}return w={get basename(){return c},get state(){return b},get routes(){return i},initialize:Q,subscribe:Ee,enableScrollRestoration:to,navigate:Ie,fetch:ir,revalidate:pt,createHref:L=>e.history.createHref(L),encodeLocation:L=>e.history.encodeLocation(L),getFetcher:Dr,deleteFetcher:Kr,dispose:ne,getBlocker:Z,deleteBlocker:he,_internalFetchControllers:k,_internalActiveDeferreds:R,_internalSetRoutes:xa},w}function qfe(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function sy(e,t,r,n,o,a,i){let l,c;if(a!=null&&i!=="path"){l=[];for(let d of t)if(l.push(d),d.route.id===a){c=d;break}}else l=t,c=t[t.length-1];let u=U4(o||".",U1(l).map(d=>d.pathnameBase),Nc(e.pathname,r)||e.pathname,i==="path");return o==null&&(u.search=e.search,u.hash=e.hash),(o==null||o===""||o===".")&&c&&c.route.index&&!H1(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:oa([r,u.pathname])),Dc(u)}function QO(e,t,r,n){if(!n||!qfe(n))return{path:r};if(n.formMethod&&!Zfe(n.formMethod))return{path:r,error:Zr(405,{method:n.formMethod})};let o=()=>({path:r,error:Zr(400,{type:"invalid-body"})}),a=n.formMethod||"get",i=e?a.toUpperCase():a.toLowerCase(),l=Q4(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!bn(i))return o();let h=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((m,v)=>{let[g,_]=v;return""+m+g+"="+_+`
202
+ `},""):String(n.body);return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:void 0,text:h}}}else if(n.formEncType==="application/json"){if(!bn(i))return o();try{let h=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:r,submission:{formMethod:i,formAction:l,formEncType:n.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}$e(typeof FormData=="function","FormData is not available in this environment");let c,u;if(n.formData)c=ly(n.formData),u=n.formData;else if(n.body instanceof FormData)c=ly(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=JO(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=JO(c)}catch{return o()}let d={formMethod:i,formAction:l,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(bn(d.formMethod))return{path:r,submission:d};let p=Ro(r);return t&&p.search&&H1(p.search)&&c.append("index",""),p.search="?"+c,{path:Dc(p),submission:d}}function Gfe(e,t){let r=e;if(t){let n=e.findIndex(o=>o.route.id===t);n>=0&&(r=e.slice(0,n))}return r}function KO(e,t,r,n,o,a,i,l,c,u,d,p,h,m){let v=m?Object.values(m)[0]:h?Object.values(h)[0]:void 0,g=e.createURL(t.location),_=e.createURL(o),y=m?Object.keys(m)[0]:void 0,w=Gfe(r,y).filter((O,C)=>{if(O.route.lazy)return!0;if(O.route.loader==null)return!1;if(Qfe(t.loaderData,t.matches[C],O)||i.some(T=>T===O.route.id))return!0;let j=t.matches[C],E=O;return YO(O,xt({currentUrl:g,currentParams:j.params,nextUrl:_,nextParams:E.params},n,{actionResult:v,defaultShouldRevalidate:a||g.pathname+g.search===_.pathname+_.search||g.search!==_.search||G4(j,E)}))}),b=[];return c.forEach((O,C)=>{if(!r.some(I=>I.route.id===O.routeId))return;let j=Gi(d,O.path,p);if(!j){b.push({key:C,routeId:O.routeId,path:O.path,matches:null,match:null,controller:null});return}let E=t.fetchers.get(C),T=cy(j,O.path),$=!1;u.has(C)?$=!1:l.includes(C)?$=!0:E&&E.state!=="idle"&&E.data===void 0?$=a:$=YO(T,xt({currentUrl:g,currentParams:t.matches[t.matches.length-1].params,nextUrl:_,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:a})),$&&b.push({key:C,routeId:O.routeId,path:O.path,matches:j,match:T,controller:new AbortController})}),[w,b]}function Qfe(e,t,r){let n=!t||r.route.id!==t.route.id,o=e[r.route.id]===void 0;return n||o}function G4(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function YO(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function XO(e,t,r){if(!e.lazy)return;let n=await e.lazy();if(!e.lazy)return;let o=r[e.id];$e(o,"No route found in manifest");let a={};for(let i in n){let c=o[i]!==void 0&&i!=="hasErrorBoundary";bs(!c,'Route "'+o.id+'" has a static property "'+i+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+i+'" will be ignored.')),!c&&!gfe.has(i)&&(a[i]=n[i])}Object.assign(o,a),Object.assign(o,xt({},t(o),{lazy:void 0}))}async function sl(e,t,r,n,o,a,i,l){l===void 0&&(l={});let c,u,d,p=v=>{let g,_=new Promise((y,x)=>g=x);return d=()=>g(),t.signal.addEventListener("abort",d),Promise.race([v({request:t,params:r.params,context:l.requestContext}),_])};try{let v=r.route[e];if(r.route.lazy)if(v){let g,_=await Promise.all([p(v).catch(y=>{g=y}),XO(r.route,a,o)]);if(g)throw g;u=_[0]}else if(await XO(r.route,a,o),v=r.route[e],v)u=await p(v);else if(e==="action"){let g=new URL(t.url),_=g.pathname+g.search;throw Zr(405,{method:t.method,pathname:_,routeId:r.route.id})}else return{type:Ot.data,data:void 0};else if(v)u=await p(v);else{let g=new URL(t.url),_=g.pathname+g.search;throw Zr(404,{pathname:_})}$e(u!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+r.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(v){c=Ot.error,u=v}finally{d&&t.signal.removeEventListener("abort",d)}if(Jfe(u)){let v=u.status;if(Vfe.has(v)){let y=u.headers.get("Location");if($e(y,"Redirects returned/thrown from loaders/actions must have a Location header"),!q4.test(y))y=sy(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,y);else if(!l.isStaticRequest){let x=new URL(t.url),w=y.startsWith("//")?new URL(x.protocol+y):new URL(y),b=Nc(w.pathname,i)!=null;w.origin===x.origin&&b&&(y=w.pathname+w.search+w.hash)}if(l.isStaticRequest)throw u.headers.set("Location",y),u;return{type:Ot.redirect,status:v,location:y,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===Ot.error?Ot.error:Ot.data,response:u};let g,_=u.headers.get("Content-Type");return _&&/\bapplication\/json\b/.test(_)?g=await u.json():g=await u.text(),c===Ot.error?{type:c,error:new W1(v,u.statusText,g),headers:u.headers}:{type:Ot.data,data:g,statusCode:u.status,headers:u.headers}}if(c===Ot.error)return{type:c,error:u};if(Xfe(u)){var h,m;return{type:Ot.deferred,deferredData:u,statusCode:(h=u.init)==null?void 0:h.status,headers:((m=u.init)==null?void 0:m.headers)&&new Headers(u.init.headers)}}return{type:Ot.data,data:u}}function ll(e,t,r,n){let o=e.createURL(Q4(t)).toString(),a={signal:r};if(n&&bn(n.formMethod)){let{formMethod:i,formEncType:l}=n;a.method=i.toUpperCase(),l==="application/json"?(a.headers=new Headers({"Content-Type":l}),a.body=JSON.stringify(n.json)):l==="text/plain"?a.body=n.text:l==="application/x-www-form-urlencoded"&&n.formData?a.body=ly(n.formData):a.body=n.formData}return new Request(o,a)}function ly(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function JO(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function Kfe(e,t,r,n,o){let a={},i=null,l,c=!1,u={};return r.forEach((d,p)=>{let h=t[p].route.id;if($e(!as(d),"Cannot handle redirect results in processLoaderData"),Tl(d)){let m=Qi(e,h),v=d.error;n&&(v=Object.values(n)[0],n=void 0),i=i||{},i[m.route.id]==null&&(i[m.route.id]=v),a[h]=void 0,c||(c=!0,l=W4(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else La(d)?(o.set(h,d.deferredData),a[h]=d.deferredData.data):a[h]=d.data,d.statusCode!=null&&d.statusCode!==200&&!c&&(l=d.statusCode),d.headers&&(u[h]=d.headers)}),n&&(i=n,a[Object.keys(n)[0]]=void 0),{loaderData:a,errors:i,statusCode:l||200,loaderHeaders:u}}function ZO(e,t,r,n,o,a,i,l){let{loaderData:c,errors:u}=Kfe(t,r,n,o,l);for(let d=0;d<a.length;d++){let{key:p,match:h,controller:m}=a[d];$e(i!==void 0&&i[d]!==void 0,"Did not find corresponding fetcher result");let v=i[d];if(!(m&&m.signal.aborted))if(Tl(v)){let g=Qi(e.matches,h==null?void 0:h.route.id);u&&u[g.route.id]||(u=xt({},u,{[g.route.id]:v.error})),e.fetchers.delete(p)}else if(as(v))$e(!1,"Unhandled fetcher revalidation redirect");else if(La(v))$e(!1,"Unhandled fetcher deferred data");else{let g=Ti(v.data);e.fetchers.set(p,g)}}return{loaderData:c,errors:u}}function eC(e,t,r,n){let o=xt({},t);for(let a of r){let i=a.route.id;if(t.hasOwnProperty(i)?t[i]!==void 0&&(o[i]=t[i]):e[i]!==void 0&&a.route.loader&&(o[i]=e[i]),n&&n.hasOwnProperty(i))break}return o}function Qi(e,t){return(t?e.slice(0,e.findIndex(n=>n.route.id===t)+1):[...e]).reverse().find(n=>n.route.hasErrorBoundary===!0)||e[0]}function tC(e){let t=e.find(r=>r.index||!r.path||r.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Zr(e,t){let{pathname:r,routeId:n,method:o,type:a}=t===void 0?{}:t,i="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(i="Bad Request",o&&r&&n?l="You made a "+o+' request to "'+r+'" but '+('did not provide a `loader` for route "'+n+'", ')+"so there is no way to handle the request.":a==="defer-action"?l="defer() is not supported in actions":a==="invalid-body"&&(l="Unable to encode submission body")):e===403?(i="Forbidden",l='Route "'+n+'" does not match URL "'+r+'"'):e===404?(i="Not Found",l='No route matches URL "'+r+'"'):e===405&&(i="Method Not Allowed",o&&r&&n?l="You made a "+o.toUpperCase()+' request to "'+r+'" but '+('did not provide an `action` for route "'+n+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new W1(e||500,i,new Error(l),!0)}function rC(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(as(r))return{result:r,idx:t}}}function Q4(e){let t=typeof e=="string"?Ro(e):e;return Dc(xt({},t,{hash:""}))}function Yfe(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function La(e){return e.type===Ot.deferred}function Tl(e){return e.type===Ot.error}function as(e){return(e&&e.type)===Ot.redirect}function Xfe(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 Jfe(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Zfe(e){return Ffe.has(e.toLowerCase())}function bn(e){return Lfe.has(e.toLowerCase())}async function nC(e,t,r,n,o,a){for(let i=0;i<r.length;i++){let l=r[i],c=t[i];if(!c)continue;let u=e.find(p=>p.route.id===c.route.id),d=u!=null&&!G4(u,c)&&(a&&a[c.route.id])!==void 0;if(La(l)&&(o||d)){let p=n[i];$e(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await K4(l,p,o).then(h=>{h&&(r[i]=h||r[i])})}}}async function K4(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:Ot.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Ot.error,error:o}}return{type:Ot.data,data:e.deferredData.data}}}function H1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function cy(e,t){let r=typeof t=="string"?Ro(t).search:t.search;if(e[e.length-1].route.index&&H1(r||""))return e[e.length-1];let n=U1(e);return n[n.length-1]}function oC(e){let{formMethod:t,formAction:r,formEncType:n,text:o,formData:a,json:i}=e;if(!(!t||!r||!n)){if(o!=null)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:void 0,text:o};if(a!=null)return{formMethod:t,formAction:r,formEncType:n,formData:a,json:void 0,text:void 0};if(i!==void 0)return{formMethod:t,formAction:r,formEncType:n,formData:void 0,json:i,text:void 0}}}function kg(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 epe(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 cl(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 tpe(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 Ti(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}/**
203
+ * React Router v6.16.0
204
+ *
205
+ * Copyright (c) Remix Software Inc.
206
+ *
207
+ * This source code is licensed under the MIT license found in the
208
+ * LICENSE.md file in the root directory of this source tree.
209
+ *
210
+ * @license MIT
211
+ */function nh(){return nh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nh.apply(this,arguments)}const mm=f.createContext(null),Y4=f.createContext(null),gm=f.createContext(null),vm=f.createContext(null),ga=f.createContext({outlet:null,matches:[],isDataRoute:!1}),X4=f.createContext(null);function ym(){return f.useContext(vm)!=null}function va(){return ym()||$e(!1),f.useContext(vm).location}function J4(e){f.useContext(gm).static||f.useLayoutEffect(e)}function Pt(){let{isDataRoute:e}=f.useContext(ga);return e?mpe():rpe()}function rpe(){ym()||$e(!1);let e=f.useContext(mm),{basename:t,navigator:r}=f.useContext(gm),{matches:n}=f.useContext(ga),{pathname:o}=va(),a=JSON.stringify(U1(n).map(c=>c.pathnameBase)),i=f.useRef(!1);return J4(()=>{i.current=!0}),f.useCallback(function(c,u){if(u===void 0&&(u={}),!i.current)return;if(typeof c=="number"){r.go(c);return}let d=U4(c,JSON.parse(a),o,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:oa([t,d.pathname])),(u.replace?r.replace:r.push)(d,u.state,u)},[t,r,a,o,e])}const npe=f.createContext(null);function ope(e){let t=f.useContext(ga).outlet;return t&&f.createElement(npe.Provider,{value:e},t)}function Ge(){let{matches:e}=f.useContext(ga),t=e[e.length-1];return t?t.params:{}}function ape(e,t){return Z4(e,t)}function Z4(e,t,r){ym()||$e(!1);let{navigator:n}=f.useContext(gm),{matches:o}=f.useContext(ga),a=o[o.length-1],i=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=va(),u;if(t){var d;let g=typeof t=="string"?Ro(t):t;l==="/"||(d=g.pathname)!=null&&d.startsWith(l)||$e(!1),u=g}else u=c;let p=u.pathname||"/",h=l==="/"?p:p.slice(l.length)||"/",m=Gi(e,{pathname:h}),v=upe(m&&m.map(g=>Object.assign({},g,{params:Object.assign({},i,g.params),pathname:oa([l,n.encodeLocation?n.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?l:oa([l,n.encodeLocation?n.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),o,r);return t&&v?f.createElement(vm.Provider,{value:{location:nh({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:Rt.Pop}},v):v}function ipe(){let e=hpe(),t=W4(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"},a=null;return f.createElement(f.Fragment,null,f.createElement("h2",null,"Unexpected Application Error!"),f.createElement("h3",{style:{fontStyle:"italic"}},t),r?f.createElement("pre",{style:o},r):null,a)}const spe=f.createElement(ipe,null);class lpe extends f.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,r){return r.location!==t.location||r.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error||r.error,location:r.location,revalidation:t.revalidation||r.revalidation}}componentDidCatch(t,r){console.error("React Router caught the following error during render",t,r)}render(){return this.state.error?f.createElement(ga.Provider,{value:this.props.routeContext},f.createElement(X4.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function cpe(e){let{routeContext:t,match:r,children:n}=e,o=f.useContext(mm);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(ga.Provider,{value:t},n)}function upe(e,t,r){var n;if(t===void 0&&(t=[]),r===void 0&&(r=null),e==null){var o;if((o=r)!=null&&o.errors)e=r.matches;else return null}let a=e,i=(n=r)==null?void 0:n.errors;if(i!=null){let l=a.findIndex(c=>c.route.id&&(i==null?void 0:i[c.route.id]));l>=0||$e(!1),a=a.slice(0,Math.min(a.length,l+1))}return a.reduceRight((l,c,u)=>{let d=c.route.id?i==null?void 0:i[c.route.id]:null,p=null;r&&(p=c.route.errorElement||spe);let h=t.concat(a.slice(0,u+1)),m=()=>{let v;return d?v=p:c.route.Component?v=f.createElement(c.route.Component,null):c.route.element?v=c.route.element:v=l,f.createElement(cpe,{match:c,routeContext:{outlet:l,matches:h,isDataRoute:r!=null},children:v})};return r&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?f.createElement(lpe,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:m(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):m()},null)}var e3=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(e3||{}),oh=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}(oh||{});function dpe(e){let t=f.useContext(mm);return t||$e(!1),t}function fpe(e){let t=f.useContext(Y4);return t||$e(!1),t}function ppe(e){let t=f.useContext(ga);return t||$e(!1),t}function t3(e){let t=ppe(),r=t.matches[t.matches.length-1];return r.route.id||$e(!1),r.route.id}function hpe(){var e;let t=f.useContext(X4),r=fpe(oh.UseRouteError),n=t3(oh.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function mpe(){let{router:e}=dpe(e3.UseNavigateStable),t=t3(oh.UseNavigateStable),r=f.useRef(!1);return J4(()=>{r.current=!0}),f.useCallback(function(o,a){a===void 0&&(a={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,nh({fromRouteId:t},a)))},[e,t])}const gpe="startTransition",aC=Il[gpe];function vpe(e){let{fallbackElement:t,router:r,future:n}=e,[o,a]=f.useState(r.state),{v7_startTransition:i}=n||{},l=f.useCallback(p=>{i&&aC?aC(()=>a(p)):a(p)},[a,i]);f.useLayoutEffect(()=>r.subscribe(l),[r,l]);let c=f.useMemo(()=>({createHref:r.createHref,encodeLocation:r.encodeLocation,go:p=>r.navigate(p),push:(p,h,m)=>r.navigate(p,{state:h,preventScrollReset:m==null?void 0:m.preventScrollReset}),replace:(p,h,m)=>r.navigate(p,{replace:!0,state:h,preventScrollReset:m==null?void 0:m.preventScrollReset})}),[r]),u=r.basename||"/",d=f.useMemo(()=>({router:r,navigator:c,static:!1,basename:u}),[r,c,u]);return f.createElement(f.Fragment,null,f.createElement(mm.Provider,{value:d},f.createElement(Y4.Provider,{value:o},f.createElement(xpe,{basename:u,location:o.location,navigationType:o.historyAction,navigator:c},o.initialized?f.createElement(ype,{routes:r.routes,state:o}):t))),null)}function ype(e){let{routes:t,state:r}=e;return Z4(t,void 0,r)}function q1(e){return ope(e.context)}function ue(e){$e(!1)}function xpe(e){let{basename:t="/",children:r=null,location:n,navigationType:o=Rt.Pop,navigator:a,static:i=!1}=e;ym()&&$e(!1);let l=t.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:l,navigator:a,static:i}),[l,a,i]);typeof n=="string"&&(n=Ro(n));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:m="default"}=n,v=f.useMemo(()=>{let g=Nc(u,l);return g==null?null:{location:{pathname:g,search:d,hash:p,state:h,key:m},navigationType:o}},[l,u,d,p,h,m,o]);return v==null?null:f.createElement(gm.Provider,{value:c},f.createElement(vm.Provider,{children:r,value:v}))}function wpe(e){let{children:t,location:r}=e;return ape(uy(t),r)}new Promise(()=>{});function uy(e,t){t===void 0&&(t=[]);let r=[];return f.Children.forEach(e,(n,o)=>{if(!f.isValidElement(n))return;let a=[...t,o];if(n.type===f.Fragment){r.push.apply(r,uy(n.props.children,a));return}n.type!==ue&&$e(!1),!n.props.index||!n.props.children||$e(!1);let i={id:n.props.id||a.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(i.children=uy(n.props.children,a)),r.push(i)}),r}function bpe(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:f.createElement(e.Component),Component:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:f.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
212
+ * React Router DOM v6.16.0
213
+ *
214
+ * Copyright (c) Remix Software Inc.
215
+ *
216
+ * This source code is licensed under the MIT license found in the
217
+ * LICENSE.md file in the root directory of this source tree.
218
+ *
219
+ * @license MIT
220
+ */function ah(){return ah=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},ah.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,r)=>{let n=e[r];return t.concat(Array.isArray(n)?n.map(o=>[r,o]):[[r,n]])},[]))}function _pe(e,t){let r=dy(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(a=>{r.append(o,a)})}),r}function Spe(e,t){return Hfe({basename:t==null?void 0:t.basename,future:ah({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:pfe({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Ppe(),routes:e,mapRouteProperties:bpe}).initialize()}function Ppe(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ah({},t,{errors:jpe(t.errors)})),t}function jpe(e){if(!e)return null;let t=Object.entries(e),r={};for(let[n,o]of t)if(o&&o.__type==="RouteErrorResponse")r[n]=new W1(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let a=window[o.__subType];if(typeof a=="function")try{let i=new a(o.message);i.stack="",r[n]=i}catch{}}if(r[n]==null){let a=new Error(o.message);a.stack="",r[n]=a}}else r[n]=o;return r}var iC;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(iC||(iC={}));var sC;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(sC||(sC={}));function G1(e){let t=f.useRef(dy(e)),r=f.useRef(!1),n=va(),o=f.useMemo(()=>_pe(n.search,r.current?null:t.current),[n.search]),a=Pt(),i=f.useCallback((l,c)=>{const u=dy(typeof l=="function"?l(o):l);r.current=!0,a("?"+u,c)},[a,o]);return[o,i]}var Ope=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Ac(e,t){var r=Cpe(e);if(typeof r.path!="string"){var n=e.webkitRelativePath;Object.defineProperty(r,"path",{value:typeof t=="string"?t:typeof n=="string"&&n.length>0?n:e.name,writable:!1,configurable:!1,enumerable:!0})}return r}function Cpe(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=Ope.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Epe=[".DS_Store","Thumbs.db"];function $pe(e){return Ss(this,void 0,void 0,function(){return Ps(this,function(t){return ih(e)&&kpe(e.dataTransfer)?[2,Dpe(e.dataTransfer,e.type)]:Rpe(e)?[2,Tpe(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,Ipe(e)]:[2,[]]})})}function kpe(e){return ih(e)}function Rpe(e){return ih(e)&&ih(e.target)}function ih(e){return typeof e=="object"&&e!==null}function Tpe(e){return fy(e.target.files).map(function(t){return Ac(t)})}function Ipe(e){return Ss(this,void 0,void 0,function(){var t;return Ps(this,function(r){switch(r.label){case 0:return[4,Promise.all(e.map(function(n){return n.getFile()}))];case 1:return t=r.sent(),[2,t.map(function(n){return Ac(n)})]}})})}function Dpe(e,t){return Ss(this,void 0,void 0,function(){var r,n;return Ps(this,function(o){switch(o.label){case 0:return e.items?(r=fy(e.items).filter(function(a){return a.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(Npe))]):[3,2];case 1:return n=o.sent(),[2,lC(r3(n))];case 2:return[2,lC(fy(e.files).map(function(a){return Ac(a)}))]}})})}function lC(e){return e.filter(function(t){return Epe.indexOf(t.name)===-1})}function fy(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(n)}return t}function Npe(e){if(typeof e.webkitGetAsEntry!="function")return cC(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?n3(t):cC(e)}function r3(e){return e.reduce(function(t,r){return Ag(Ag([],rx(t),!1),rx(Array.isArray(r)?r3(r):[r]),!1)},[])}function cC(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var r=Ac(t);return Promise.resolve(r)}function Ape(e){return Ss(this,void 0,void 0,function(){return Ps(this,function(t){return[2,e.isDirectory?n3(e):Mpe(e)]})})}function n3(e){var t=e.createReader();return new Promise(function(r,n){var o=[];function a(){var i=this;t.readEntries(function(l){return Ss(i,void 0,void 0,function(){var c,u,d;return Ps(this,function(p){switch(p.label){case 0:if(l.length)return[3,5];p.label=1;case 1:return p.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return c=p.sent(),r(c),[3,4];case 3:return u=p.sent(),n(u),[3,4];case 4:return[3,6];case 5:d=Promise.all(l.map(Ape)),o.push(d),a(),p.label=6;case 6:return[2]}})})},function(l){n(l)})}a()})}function Mpe(e){return Ss(this,void 0,void 0,function(){return Ps(this,function(t){return[2,new Promise(function(r,n){e.file(function(o){var a=Ac(o,e.fullPath);r(a)},function(o){n(o)})})]})})}var Lpe=function(e,t){if(e&&t){var r=Array.isArray(t)?t:t.split(","),n=e.name||"",o=(e.type||"").toLowerCase(),a=o.replace(/\/.*$/,"");return r.some(function(i){var l=i.trim().toLowerCase();return l.charAt(0)==="."?n.toLowerCase().endsWith(l):l.endsWith("/*")?a===l.replace(/\/.*$/,""):o===l})}return!0};function uC(e){return Vpe(e)||Fpe(e)||a3(e)||zpe()}function zpe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
221
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fpe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Vpe(e){if(Array.isArray(e))return py(e)}function dC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function fC(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?dC(Object(r),!0).forEach(function(n){o3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):dC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function o3(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ic(e,t){return Wpe(e)||Upe(e,t)||a3(e,t)||Bpe()}function Bpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
222
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a3(e,t){if(e){if(typeof e=="string")return py(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return py(e,t)}}function py(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Upe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,l;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(c){a=!0,l=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw l}}return n}}function Wpe(e){if(Array.isArray(e))return e}var Hpe="file-invalid-type",qpe="file-too-large",Gpe="file-too-small",Qpe="too-many-files",Kpe=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var r=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:Hpe,message:"File type must be ".concat(r)}},pC=function(t){return{code:qpe,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},hC=function(t){return{code:Gpe,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Ype={code:Qpe,message:"Too many files"};function i3(e,t){var r=e.type==="application/x-moz-file"||Lpe(e,t);return[r,r?null:Kpe(t)]}function s3(e,t,r){if(Ia(e.size))if(Ia(t)&&Ia(r)){if(e.size>r)return[!1,pC(r)];if(e.size<t)return[!1,hC(t)]}else{if(Ia(t)&&e.size<t)return[!1,hC(t)];if(Ia(r)&&e.size>r)return[!1,pC(r)]}return[!0,null]}function Ia(e){return e!=null}function Xpe(e){var t=e.files,r=e.accept,n=e.minSize,o=e.maxSize,a=e.multiple,i=e.maxFiles,l=e.validator;return!a&&t.length>1||a&&i>=1&&t.length>i?!1:t.every(function(c){var u=i3(c,r),d=ic(u,1),p=d[0],h=s3(c,n,o),m=ic(h,1),v=m[0],g=l?l(c):null;return p&&v&&!g})}function sh(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mu(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function mC(e){e.preventDefault()}function Jpe(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Zpe(e){return e.indexOf("Edge/")!==-1}function ehe(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Jpe(e)||Zpe(e)}function Ln(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(n){for(var o=arguments.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=arguments[i];return t.some(function(l){return!sh(n)&&l&&l.apply(void 0,[n].concat(a)),sh(n)})}}function the(){return"showOpenFilePicker"in window}function rhe(e){if(Ia(e)){var t=Object.entries(e).filter(function(r){var n=ic(r,2),o=n[0],a=n[1],i=!0;return l3(o)||(console.warn('Skipped "'.concat(o,'" 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(a)||!a.every(c3))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),i=!1),i}).reduce(function(r,n){var o=ic(n,2),a=o[0],i=o[1];return fC(fC({},r),{},o3({},a,i))},{});return[{description:"Files",accept:t}]}return e}function nhe(e){if(Ia(e))return Object.entries(e).reduce(function(t,r){var n=ic(r,2),o=n[0],a=n[1];return[].concat(uC(t),[o],uC(a))},[]).filter(function(t){return l3(t)||c3(t)}).join(",")}function ohe(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function ahe(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function l3(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function c3(e){return/^.*\.[\w]+$/.test(e)}var ihe=["children"],she=["open"],lhe=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],che=["refKey","onChange","onClick"];function uhe(e){return phe(e)||fhe(e)||u3(e)||dhe()}function dhe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
223
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fhe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function phe(e){if(Array.isArray(e))return hy(e)}function Rg(e,t){return ghe(e)||mhe(e,t)||u3(e,t)||hhe()}function hhe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
224
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u3(e,t){if(e){if(typeof e=="string")return hy(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return hy(e,t)}}function hy(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mhe(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n=[],o=!0,a=!1,i,l;try{for(r=r.call(e);!(o=(i=r.next()).done)&&(n.push(i.value),!(t&&n.length===t));o=!0);}catch(c){a=!0,l=c}finally{try{!o&&r.return!=null&&r.return()}finally{if(a)throw l}}return n}}function ghe(e){if(Array.isArray(e))return e}function gC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function yt(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gC(Object(r),!0).forEach(function(n){my(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gC(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function my(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function lh(e,t){if(e==null)return{};var r=vhe(e,t),n,o;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)n=a[o],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function vhe(e,t){if(e==null)return{};var r={},n=Object.keys(e),o,a;for(a=0;a<n.length;a++)o=n[a],!(t.indexOf(o)>=0)&&(r[o]=e[o]);return r}var Q1=f.forwardRef(function(e,t){var r=e.children,n=lh(e,ihe),o=f3(n),a=o.open,i=lh(o,she);return f.useImperativeHandle(t,function(){return{open:a}},[a]),S.createElement(f.Fragment,null,r(yt(yt({},i),{},{open:a})))});Q1.displayName="Dropzone";var d3={disabled:!1,getFilesFromEvent:$pe,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};Q1.defaultProps=d3;Q1.propTypes={children:Te.func,accept:Te.objectOf(Te.arrayOf(Te.string)),multiple:Te.bool,preventDropOnDocument:Te.bool,noClick:Te.bool,noKeyboard:Te.bool,noDrag:Te.bool,noDragEventsBubbling:Te.bool,minSize:Te.number,maxSize:Te.number,maxFiles:Te.number,disabled:Te.bool,getFilesFromEvent:Te.func,onFileDialogCancel:Te.func,onFileDialogOpen:Te.func,useFsAccessApi:Te.bool,autoFocus:Te.bool,onDragEnter:Te.func,onDragLeave:Te.func,onDragOver:Te.func,onDrop:Te.func,onDropAccepted:Te.func,onDropRejected:Te.func,onError:Te.func,validator:Te.func};var gy={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function f3(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=yt(yt({},d3),e),r=t.accept,n=t.disabled,o=t.getFilesFromEvent,a=t.maxSize,i=t.minSize,l=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,p=t.onDragOver,h=t.onDrop,m=t.onDropAccepted,v=t.onDropRejected,g=t.onFileDialogCancel,_=t.onFileDialogOpen,y=t.useFsAccessApi,x=t.autoFocus,w=t.preventDropOnDocument,b=t.noClick,O=t.noKeyboard,C=t.noDrag,j=t.noDragEventsBubbling,E=t.onError,T=t.validator,$=f.useMemo(function(){return nhe(r)},[r]),I=f.useMemo(function(){return rhe(r)},[r]),k=f.useMemo(function(){return typeof _=="function"?_:vC},[_]),D=f.useMemo(function(){return typeof g=="function"?g:vC},[g]),N=f.useRef(null),z=f.useRef(null),H=f.useReducer(yhe,gy),K=Rg(H,2),R=K[0],M=K[1],B=R.isFocused,Q=R.isFileDialogActive,ne=f.useRef(typeof window<"u"&&window.isSecureContext&&y&&the()),Ee=function(){!ne.current&&Q&&setTimeout(function(){if(z.current){var he=z.current.files;he.length||(M({type:"closeDialog"}),D())}},300)};f.useEffect(function(){return window.addEventListener("focus",Ee,!1),function(){window.removeEventListener("focus",Ee,!1)}},[z,Q,D,ne]);var ce=f.useRef([]),Le=function(he){N.current&&N.current.contains(he.target)||(he.preventDefault(),ce.current=[])};f.useEffect(function(){return w&&(document.addEventListener("dragover",mC,!1),document.addEventListener("drop",Le,!1)),function(){w&&(document.removeEventListener("dragover",mC),document.removeEventListener("drop",Le))}},[N,w]),f.useEffect(function(){return!n&&x&&N.current&&N.current.focus(),function(){}},[N,x,n]);var Ie=f.useCallback(function(Z){E?E(Z):console.error(Z)},[E]),pt=f.useCallback(function(Z){Z.preventDefault(),Z.persist(),jt(Z),ce.current=[].concat(uhe(ce.current),[Z.target]),Mu(Z)&&Promise.resolve(o(Z)).then(function(he){if(!(sh(Z)&&!j)){var Qe=he.length,ht=Qe>0&&Xpe({files:he,accept:$,minSize:i,maxSize:a,multiple:l,maxFiles:c,validator:T}),mt=Qe>0&&!ht;M({isDragAccept:ht,isDragReject:mt,isDragActive:!0,type:"setDraggedFiles"}),u&&u(Z)}}).catch(function(he){return Ie(he)})},[o,u,Ie,j,$,i,a,l,c,T]),rt=f.useCallback(function(Z){Z.preventDefault(),Z.persist(),jt(Z);var he=Mu(Z);if(he&&Z.dataTransfer)try{Z.dataTransfer.dropEffect="copy"}catch{}return he&&p&&p(Z),!1},[p,j]),nt=f.useCallback(function(Z){Z.preventDefault(),Z.persist(),jt(Z);var he=ce.current.filter(function(ht){return N.current&&N.current.contains(ht)}),Qe=he.indexOf(Z.target);Qe!==-1&&he.splice(Qe,1),ce.current=he,!(he.length>0)&&(M({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mu(Z)&&d&&d(Z))},[N,d,j]),Ir=f.useCallback(function(Z,he){var Qe=[],ht=[];Z.forEach(function(mt){var to=i3(mt,$),mn=Rg(to,2),Ar=mn[0],To=mn[1],xa=s3(mt,i,a),L=Rg(xa,2),F=L[0],U=L[1],Y=T?T(mt):null;if(Ar&&F&&!Y)Qe.push(mt);else{var me=[To,U];Y&&(me=me.concat(Y)),ht.push({file:mt,errors:me.filter(function(ye){return ye})})}}),(!l&&Qe.length>1||l&&c>=1&&Qe.length>c)&&(Qe.forEach(function(mt){ht.push({file:mt,errors:[Ype]})}),Qe.splice(0)),M({acceptedFiles:Qe,fileRejections:ht,type:"setFiles"}),h&&h(Qe,ht,he),ht.length>0&&v&&v(ht,he),Qe.length>0&&m&&m(Qe,he)},[M,l,$,i,a,c,h,m,v,T]),Dr=f.useCallback(function(Z){Z.preventDefault(),Z.persist(),jt(Z),ce.current=[],Mu(Z)&&Promise.resolve(o(Z)).then(function(he){sh(Z)&&!j||Ir(he,Z)}).catch(function(he){return Ie(he)}),M({type:"reset"})},[o,Ir,Ie,j]),ir=f.useCallback(function(){if(ne.current){M({type:"openDialog"}),k();var Z={multiple:l,types:I};window.showOpenFilePicker(Z).then(function(he){return o(he)}).then(function(he){Ir(he,null),M({type:"closeDialog"})}).catch(function(he){ohe(he)?(D(he),M({type:"closeDialog"})):ahe(he)?(ne.current=!1,z.current?(z.current.value=null,z.current.click()):Ie(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Ie(he)});return}z.current&&(M({type:"openDialog"}),k(),z.current.value=null,z.current.click())},[M,k,D,y,Ir,Ie,I,l]),hn=f.useCallback(function(Z){!N.current||!N.current.isEqualNode(Z.target)||(Z.key===" "||Z.key==="Enter"||Z.keyCode===32||Z.keyCode===13)&&(Z.preventDefault(),ir())},[N,ir]),Dt=f.useCallback(function(){M({type:"focus"})},[]),Nr=f.useCallback(function(){M({type:"blur"})},[]),eo=f.useCallback(function(){b||(ehe()?setTimeout(ir,0):ir())},[b,ir]),qe=function(he){return n?null:he},Qr=function(he){return O?null:qe(he)},Kr=function(he){return C?null:qe(he)},jt=function(he){j&&he.stopPropagation()},mi=f.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=Z.refKey,Qe=he===void 0?"ref":he,ht=Z.role,mt=Z.onKeyDown,to=Z.onFocus,mn=Z.onBlur,Ar=Z.onClick,To=Z.onDragEnter,xa=Z.onDragOver,L=Z.onDragLeave,F=Z.onDrop,U=lh(Z,lhe);return yt(yt(my({onKeyDown:Qr(Ln(mt,hn)),onFocus:Qr(Ln(to,Dt)),onBlur:Qr(Ln(mn,Nr)),onClick:qe(Ln(Ar,eo)),onDragEnter:Kr(Ln(To,pt)),onDragOver:Kr(Ln(xa,rt)),onDragLeave:Kr(Ln(L,nt)),onDrop:Kr(Ln(F,Dr)),role:typeof ht=="string"&&ht!==""?ht:"presentation"},Qe,N),!n&&!O?{tabIndex:0}:{}),U)}},[N,hn,Dt,Nr,eo,pt,rt,nt,Dr,O,C,n]),gi=f.useCallback(function(Z){Z.stopPropagation()},[]),vi=f.useMemo(function(){return function(){var Z=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=Z.refKey,Qe=he===void 0?"ref":he,ht=Z.onChange,mt=Z.onClick,to=lh(Z,che),mn=my({accept:$,multiple:l,type:"file",style:{display:"none"},onChange:qe(Ln(ht,Dr)),onClick:qe(Ln(mt,gi)),tabIndex:-1},Qe,z);return yt(yt({},mn),to)}},[z,r,l,Dr,n]);return yt(yt({},R),{},{isFocused:B&&!n,getRootProps:mi,getInputProps:vi,rootRef:N,inputRef:z,open:qe(ir)})}function yhe(e,t){switch(t.type){case"focus":return yt(yt({},e),{},{isFocused:!0});case"blur":return yt(yt({},e),{},{isFocused:!1});case"openDialog":return yt(yt({},gy),{},{isFileDialogActive:!0});case"closeDialog":return yt(yt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return yt(yt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return yt(yt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return yt({},gy);default:return e}}function vC(){}const[xhe,whe]=Po("Dropzone component was not found in tree");var yC=Object.getOwnPropertySymbols,bhe=Object.prototype.hasOwnProperty,_he=Object.prototype.propertyIsEnumerable,She=(e,t)=>{var r={};for(var n in e)bhe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&yC)for(var n of yC(e))t.indexOf(n)<0&&_he.call(e,n)&&(r[n]=e[n]);return r};function K1(e){const t=r=>{const n=q(`Dropzone${Nx(e)}`,{},r),{children:o}=n,a=She(n,["children"]),i=whe(),l=js(o)?o:S.createElement("span",null,o);return i[e]?f.cloneElement(l,a):null};return t.displayName=`@mantine/dropzone/${Nx(e)}`,t}const Phe=K1("accept"),jhe=K1("reject"),Ohe=K1("idle");var Che=Object.defineProperty,Ehe=Object.defineProperties,$he=Object.getOwnPropertyDescriptors,xC=Object.getOwnPropertySymbols,khe=Object.prototype.hasOwnProperty,Rhe=Object.prototype.propertyIsEnumerable,wC=(e,t,r)=>t in e?Che(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bC=(e,t)=>{for(var r in t||(t={}))khe.call(t,r)&&wC(e,r,t[r]);if(xC)for(var r of xC(t))Rhe.call(t,r)&&wC(e,r,t[r]);return e},The=(e,t)=>Ehe(e,$he(t)),Ihe=W((e,{padding:t,radius:r})=>{const n=e.fn.variant({color:"red",variant:"light"}),o=e.fn.variant({color:e.primaryColor,variant:"light"});return{root:The(bC(bC({},e.fn.fontStyles()),e.fn.focusStyles()),{boxSizing:"border-box",backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white,border:`${P(2)} dashed ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[4]}`,padding:A({size:t,sizes:e.spacing}),borderRadius:e.fn.radius(r),cursor:"pointer",userSelect:"none",transition:"background-color 150ms ease",position:"relative","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[5]:e.colors.gray[0]},"&[data-loading]":{cursor:"default","&:hover":{backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.white}},"&[data-accept]":{backgroundColor:e.colorScheme==="dark"?o.background:e.colors[e.primaryColor][0],borderColor:e.colorScheme==="dark"?o.border:e.colors[e.primaryColor][4],"&:hover":{backgroundColor:e.colorScheme==="dark"?o.background:e.colors[e.primaryColor][0]}},"&[data-reject]":{backgroundColor:e.colorScheme==="dark"?n.background:e.colors.red[0],borderColor:e.colorScheme==="dark"?n.border:e.colors.red[4],"&:hover":{backgroundColor:e.colorScheme==="dark"?n.background:e.colors.red[0]}}}),inner:{pointerEvents:"none",userSelect:"none"}}});const Dhe=Ihe;var Nhe=Object.defineProperty,Ahe=Object.defineProperties,Mhe=Object.getOwnPropertyDescriptors,ch=Object.getOwnPropertySymbols,p3=Object.prototype.hasOwnProperty,h3=Object.prototype.propertyIsEnumerable,_C=(e,t,r)=>t in e?Nhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ul=(e,t)=>{for(var r in t||(t={}))p3.call(t,r)&&_C(e,r,t[r]);if(ch)for(var r of ch(t))h3.call(t,r)&&_C(e,r,t[r]);return e},Tg=(e,t)=>Ahe(e,Mhe(t)),Lhe=(e,t)=>{var r={};for(var n in e)p3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ch)for(var n of ch(e))t.indexOf(n)<0&&h3.call(e,n)&&(r[n]=e[n]);return r};const zhe={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0};function Ns(e){const t=q("Dropzone",zhe,e),{className:r,padding:n,radius:o,disabled:a,classNames:i,styles:l,loading:c,multiple:u,maxSize:d,accept:p,children:h,onDropAny:m,onDrop:v,onReject:g,openRef:_,name:y,unstyled:x,maxFiles:w,autoFocus:b,activateOnClick:O,activateOnDrag:C,dragEventsBubbling:j,activateOnKeyboard:E,onDragEnter:T,onDragLeave:$,onDragOver:I,onFileDialogCancel:k,onFileDialogOpen:D,preventDropOnDocument:N,useFsAccessApi:z,getFilesFromEvent:H,validator:K,variant:R}=t,M=Lhe(t,["className","padding","radius","disabled","classNames","styles","loading","multiple","maxSize","accept","children","onDropAny","onDrop","onReject","openRef","name","unstyled","maxFiles","autoFocus","activateOnClick","activateOnDrag","dragEventsBubbling","activateOnKeyboard","onDragEnter","onDragLeave","onDragOver","onFileDialogCancel","onFileDialogOpen","preventDropOnDocument","useFsAccessApi","getFilesFromEvent","validator","variant"]),{classes:B,cx:Q}=Dhe({radius:o,padding:n},{name:"Dropzone",classNames:i,styles:l,unstyled:x,variant:R}),{getRootProps:ne,getInputProps:Ee,isDragAccept:ce,isDragReject:Le,open:Ie}=f3(ul({onDrop:m,onDropAccepted:v,onDropRejected:g,disabled:a||c,accept:Array.isArray(p)?p.reduce((rt,nt)=>Tg(ul({},rt),{[nt]:[]}),{}):p,multiple:u,maxSize:d,maxFiles:w,autoFocus:b,noClick:!O,noDrag:!C,noDragEventsBubbling:!j,noKeyboard:!E,onDragEnter:T,onDragLeave:$,onDragOver:I,onFileDialogCancel:k,onFileDialogOpen:D,preventDropOnDocument:N,useFsAccessApi:z,validator:K},H?{getFilesFromEvent:H}:null));RE(_,Ie);const pt=!ce&&!Le;return S.createElement(xhe,{value:{accept:ce,reject:Le,idle:pt}},S.createElement(oe,Tg(ul(ul({},M),ne()),{"data-accept":ce||void 0,"data-reject":Le||void 0,"data-idle":pt||void 0,"data-loading":c||void 0,className:Q(B.root,r)}),S.createElement(LI,{visible:c,radius:o,unstyled:x}),S.createElement("input",Tg(ul({},Ee()),{name:y})),S.createElement("div",{className:B.inner},h)))}Ns.displayName="@mantine/dropzone/Dropzone";Ns.Accept=Phe;Ns.Reject=jhe;Ns.Idle=Ohe;const m3=Ns;var Fhe=Object.defineProperty,Vhe=Object.defineProperties,Bhe=Object.getOwnPropertyDescriptors,SC=Object.getOwnPropertySymbols,Uhe=Object.prototype.hasOwnProperty,Whe=Object.prototype.propertyIsEnumerable,PC=(e,t,r)=>t in e?Fhe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hhe=(e,t)=>{for(var r in t||(t={}))Uhe.call(t,r)&&PC(e,r,t[r]);if(SC)for(var r of SC(t))Whe.call(t,r)&&PC(e,r,t[r]);return e},qhe=(e,t)=>Vhe(e,Bhe(t)),Ghe=W(e=>({wrapper:qhe(Hhe({},e.fn.cover(0)),{position:"fixed",backgroundColor:e.colorScheme==="dark"?e.colors.dark[7]:e.white,display:"flex",padding:e.spacing.xs,transition:"opacity 100ms ease"}),dropzone:{flex:1}}));const Qhe=Ghe;var Khe=Object.defineProperty,Yhe=Object.defineProperties,Xhe=Object.getOwnPropertyDescriptors,uh=Object.getOwnPropertySymbols,g3=Object.prototype.hasOwnProperty,v3=Object.prototype.propertyIsEnumerable,jC=(e,t,r)=>t in e?Khe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ig=(e,t)=>{for(var r in t||(t={}))g3.call(t,r)&&jC(e,r,t[r]);if(uh)for(var r of uh(t))v3.call(t,r)&&jC(e,r,t[r]);return e},Dg=(e,t)=>Yhe(e,Xhe(t)),Jhe=(e,t)=>{var r={};for(var n in e)g3.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&uh)for(var n of uh(e))t.indexOf(n)<0&&v3.call(e,n)&&(r[n]=e[n]);return r};const Zhe={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Rn("max"),withinPortal:!0};function y3(e){const t=q("DropzoneFullScreen",Zhe,e),{classNames:r,styles:n,sx:o,className:a,style:i,unstyled:l,active:c,onDrop:u,onReject:d,zIndex:p,withinPortal:h,portalProps:m}=t,v=Jhe(t,["classNames","styles","sx","className","style","unstyled","active","onDrop","onReject","zIndex","withinPortal","portalProps"]),[g,_]=S.useState(0),[y,{open:x,close:w}]=IL(!1),{classes:b,cx:O}=Qhe(null,{name:"DropzoneFullScreen",classNames:r,styles:n,unstyled:l}),C=E=>{E.dataTransfer.types.includes("Files")&&(_(T=>T+1),x())},j=()=>{_(E=>E-1)};return f.useEffect(()=>{g===0&&w()},[g]),f.useEffect(()=>{if(c)return document.addEventListener("dragenter",C,!1),document.addEventListener("dragleave",j,!1),()=>{document.removeEventListener("dragenter",C,!1),document.removeEventListener("dragleave",j,!1)}},[c]),S.createElement(ks,Dg(Ig({},m),{withinPortal:h}),S.createElement(oe,{className:O(b.wrapper,a),sx:o,style:Dg(Ig({},i),{opacity:y?1:0,pointerEvents:y?"all":"none",zIndex:p})},S.createElement(Ns,Dg(Ig({},v),{classNames:r,styles:n,unstyled:l,className:b.dropzone,onDrop:E=>{u==null||u(E),w()},onReject:E=>{d==null||d(E),w()}}))))}y3.displayName="@mantine/dropzone/DropzoneFullScreen";m3.FullScreen=y3;const Lu=m3,eme='{"resourceType": "Bundle"}';function Ng({id:e,title:t,message:r,color:n,icon:o,withCloseButton:a=!1,method:i="show"}){po[i]({id:e,loading:!0,title:t,message:r,color:n,icon:o,withCloseButton:a,autoClose:!1})}function tme(){const e=Kt(),t=ie(),[r,n]=f.useState({}),o=f.useCallback(async(l,c)=>{const u="batch-upload";Ng({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show"});try{n({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=RN(d));const p=await t.executeBatch(d);n(h=>({...h,[c]:p})),Ng({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(lm,{size:"1rem"}),withCloseButton:!0})}catch(d){Ng({id:u,title:"Batch Upload Failed",color:"red",message:Ce(d),method:"update",icon:s.jsx(eh,{size:"1rem"}),withCloseButton:!0})}},[t]),a=f.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var p;return o((p=d.target)==null?void 0:p.result,c.name)},u.readAsText(c)}},[o]),i=f.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return s.jsxs(be,{children:[s.jsx(de,{children:"Batch Create"}),s.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",s.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(r).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(Ue,{defaultValue:"upload",children:[s.jsxs(Ue.List,{children:[s.jsx(Ue.Tab,{value:"upload",children:"File Upload"}),s.jsx(Ue.Tab,{value:"json",children:"JSON"})]}),s.jsx(Ue.Panel,{value:"upload",pt:"xs",children:s.jsx(Lu,{onDrop:a,accept:["application/json"],children:s.jsxs(J,{position:"center",spacing:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(Lu.Accept,{children:s.jsx(kO,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(Lu.Reject,{children:s.jsx(eh,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(Lu.Idle,{children:s.jsx(kO,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(te,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(te,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Ue.Panel,{value:"json",pt:"xs",children:s.jsxs(Ne,{onSubmit:i,children:[s.jsx(Is,{"data-testid":"batch-input",name:"input",minRows:20,defaultValue:eme,deserialize:JSON.parse}),s.jsx(J,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(r).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Ue,{defaultValue:Object.keys(r)[0],children:[s.jsx(Ue.List,{children:Object.keys(r).map(l=>s.jsx(Ue.Tab,{value:l,children:l},l))}),Object.keys(r).map(l=>s.jsx(Ue.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(r[l],void 0,2)})},l))]}),s.jsx(J,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{onClick:()=>n({}),children:"Start over"})})]})]})}function rme(){const{resourceType:e}=Ge(),r=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[n]=xs("Questionnaire",`subject-type=${e}`);return n?n.length===0?s.jsxs(be,{children:[s.jsxs(de,{children:["No apps for ",e]}),s.jsx(ke,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(be,{children:s.jsx("div",{children:n.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(ke,{to:`/forms/${o.id}?subject=`+r.map(a=>`${e}/${a}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(kn,{})}function nme(){const e=ie(),[t,r]=f.useState(),[n,o]=f.useState(!1);return s.jsx(be,{width:450,children:s.jsxs(Ne,{style:{maxWidth:400},onSubmit:a=>{r(void 0),e.post("auth/changepassword",a).then(()=>o(!0)).catch(i=>r(ct(i)))},children:[s.jsxs(rr,{sx:{flexDirection:"column"},children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Change password"})]}),!n&&s.jsxs(Oe,{spacing:"xl",mt:"xl",children:[s.jsx(fo,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:lt(t,"oldPassword")}),s.jsx(fo,{name:"newPassword",label:"New password",required:!0,error:lt(t,"newPassword")}),s.jsx(fo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:lt(t,"confirmPassword")}),s.jsx(J,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"Change password"})})]}),n&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const x3=["Form","JSON"],ome=x3[0].toLowerCase();function ame(){const e=Pt(),{resourceType:t}=Ge(),r=window.location.pathname.split("/").pop(),[n,o]=f.useState(r??ome);function a(i){o(i),e(`/${t}/new/${i}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(sn,{children:[s.jsxs(te,{p:"md",weight:500,children:["New ",t]}),s.jsx(ai,{children:s.jsx(Ue,{defaultValue:"form",value:n,onTabChange:a,children:s.jsx(Ue.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:x3.map(i=>s.jsx(Ue.Tab,{value:i.toLowerCase(),px:"md",children:i},i))})})})]}),s.jsx(q1,{})]})}function ime(){return s.jsx(be,{children:s.jsxs(Oe,{children:[s.jsx(de,{order:1,children:"Unexpected Error"}),s.jsx(te,{children:"We're sorry, something went wrong."}),s.jsxs(te,{children:["Please contact ",s.jsx(Me,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const xm=W(e=>({root:{display:"flex",flexDirection:"row",alignItems:"center",padding:"8px 10px"},entry:{display:"inline-block",margin:"5px 20px 5px 5px"},key:{color:e.colors.gray[6],textTransform:"uppercase",fontSize:e.fontSizes.xs,whiteSpace:"nowrap"},value:{fontSize:e.fontSizes.md,fontWeight:600,marginLeft:0,whiteSpace:"nowrap"}}));function Pe(e){const{classes:t}=xm();return s.jsx(ai,{children:s.jsx("div",{className:t.root,children:e.children})})}Pe.Entry=function(t){const{classes:r}=xm();return s.jsx("div",{className:r.entry,children:t.children})};Pe.Key=function(t){const{classes:r}=xm();return s.jsx("div",{className:r.key,children:t.children})};Pe.Value=function(t){const{classes:r}=xm();return s.jsx("div",{className:r.value,children:t.children})};function sme(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function w3(e){var r,n;const t=Ye(e.patient);return t?s.jsxs(Pe,{children:[s.jsx(ua,{value:t,size:"lg",color:sme(t)}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Name"}),s.jsx(Pe.Value,{children:s.jsx(ke,{to:t,children:t.name?s.jsx(S1,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"DoB"}),s.jsx(Pe.Value,{children:t.birthDate})]}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Age"}),s.jsx(Pe.Value,{children:Loe(t.birthDate)})]})]}),t.gender&&s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Gender"}),s.jsx(Pe.Value,{children:t.gender})]}),t.address&&s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"State"}),s.jsx(Pe.Value,{children:(r=t.address[0])==null?void 0:r.state})]}),(n=t.identifier)==null?void 0:n.map(o=>s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:o==null?void 0:o.system}),s.jsx(Pe.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function b3(e){const t=Ye(e.resource);if(!t)return null;const r=[{key:"Type",value:s.jsx(ke,{to:`/${t.resourceType}`,children:t.resourceType})}];function n(l,c){l&&c&&r.push({key:l,value:c})}function o(l){l&&n(l.system,l.value)}function a(l,c){Array.isArray(c)?c.forEach(u=>a(l,u)):typeof c=="string"?n(l,c):c&&(Array.isArray(c.coding)?n(l,c.coding.map(u=>u.display||u.code).join(", ")):n(l,c.text))}const i=bo(t);return i!==Ze(t)&&n("Name",i),"category"in t&&a("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&a("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),r.length===1&&r.push({key:"ID",value:t.id}),s.jsx(Pe,{children:r.map(l=>s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:l.key}),s.jsx(Pe.Value,{children:l.value})]},`${l.key}-${l.value}`))})}function Y1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function lme(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 ld(e,t){return new Promise((r,n)=>{var a;const o=new MessageChannel;o.port1.onmessage=({data:i})=>{o.port1.close(),i.error?n(i.error):r(i.result)},(a=e.contentWindow)==null||a.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function ya(e){var t;return t1((t=e.getActiveLogin())==null?void 0:t.project)}function cme(e,t){const r=new Blob([e],{type:Ht.JSON}),n=URL.createObjectURL(r),o=document.createElement("a");o.href=n;const a=t??new Date().toISOString().replace(/\D/g,"");o.download=`${a}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(n)}function ume(){const{id:e}=Ge(),t=va(),n=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=ie(),[a,i]=f.useState(!0),[l,c]=f.useState(),[u,d]=f.useState(),[p,h]=f.useState(),[m,v]=f.useState(),[g,_]=f.useState();if(f.useEffect(()=>{const w={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(n){const b=n.split(",").filter(O=>!!O);b.length===1&&w.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(w).then(b=>{var O,C,j,E,T,$,I;((j=(C=(O=b.entry)==null?void 0:O[0])==null?void 0:C.response)==null?void 0:j.status)!=="200"?v((T=(E=b.entry)==null?void 0:E[0])==null?void 0:T.response):(c(($=b.entry[0])==null?void 0:$.resource),h((I=b.entry[1])==null?void 0:I.resource)),i(!1)}).catch(b=>{v(b),i(!1)})},[o,e,n]),m)return s.jsx(be,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(g)return s.jsxs(be,{children:[s.jsx(de,{children:l==null?void 0:l.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[g.length===1&&s.jsx("li",{children:s.jsx(ke,{to:g[0],children:"Review your answers"})}),g.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:g.map(w=>s.jsx("li",{children:s.jsx(ke,{to:w,children:Ze(w)})},w.id))})]}),p&&s.jsx("li",{children:s.jsxs(ke,{to:p,children:["Back to ",bo(p)]})}),s.jsx("li",{children:s.jsx(ke,{to:"/",children:"Go back home"})})]})]});if(a||!l)return s.jsx(kn,{});const y=p&&Y1(p);return s.jsxs(s.Fragment,{children:[y&&s.jsx(w3,{patient:y}),p&&p.resourceType!=="Patient"&&s.jsx(b3,{resource:p}),s.jsx(sn,{p:"xl",shadow:"xs",radius:0,children:s.jsxs(te,{children:[bo(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})}),s.jsx(be,{children:s.jsx($4,{questionnaire:l,subject:p&&dt(p),onSubmit:x})})]});async function x(w){const b=[];if(!u||u.length===0)b.push(await o.createResource(w));else for(const O of u)b.push(await o.createResource({...w,subject:{reference:O}}));_(b)}}const dme={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function _3(e,t){const r=e.resourceType||fme(t),n=e.fields??pme(r),o=e.filters??(e.resourceType?void 0:hme(r)),a=e.sortRules??mme(r),i=e.offset??0,l=e.count??$c;return{...e,resourceType:r,fields:n,filters:o,sortRules:a,offset:i,count:l}}function fme(e){var t,r;return localStorage.getItem("defaultResourceType")??((r=(t=e==null?void 0:e.option)==null?void 0:t.find(n=>n.id==="defaultResourceType"))==null?void 0:r.valueString)??"Patient"}function pme(e){const t=X1(e);if(t!=null&&t.fields)return t.fields;const r=["id","_lastUpdated"];switch(e){case"Patient":r.push("name","birthDate","gender");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":r.push("name");break;case"CodeSystem":case"ValueSet":r.push("name","title","status");break;case"Condition":r.push("subject","code","clinicalStatus");break;case"Device":r.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":r.push("manufacturer[x]","deviceName");break;case"DeviceRequest":r.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":r.push("subject","code","status");break;case"Encounter":r.push("subject");break;case"ServiceRequest":r.push("subject","code","status","orderDetail");break;case"Subscription":r.push("criteria");break;case"User":r.push("email");break}return r}function hme(e){var t;return(t=X1(e))==null?void 0:t.filters}function mme(e){const t=X1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function X1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function gme(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function vme(e,t){const r={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},n=_3(r,t.getUserConfiguration()),o=await t.search(n.resourceType,qi({...n,total:"accurate",fields:void 0}));return RN(o)}const yme=W(e=>({paper:{[`@media (max-width: ${e.breakpoints.sm})`]:{margin:2,padding:4}}}));function OC(){const{classes:e}=yme(),t=ie(),r=Pt(),n=va(),[o,a]=f.useState();return f.useEffect(()=>{const i=fie(n.pathname+n.search),l=_3(i,t.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===qi(l)?(gme(l),a(l)):r(`/${l.resourceType}${qi(l)}`)},[t,r,n]),!(o!=null&&o.resourceType)||!o.fields||o.fields.length===0?s.jsx(kn,{}):s.jsx(sn,{shadow:"xs",m:"md",p:"xs",className:e.paper,children:s.jsx(Ic,{checkboxesEnabled:!0,search:o,userConfig:t.getUserConfiguration(),onClick:i=>r(`/${i.resource.resourceType}/${i.resource.id}`),onAuxClick:i=>window.open(`/${i.resource.resourceType}/${i.resource.id}`,"_blank"),onChange:i=>{r(`/${o.resourceType}${qi(i.definition)}`)},onNew:()=>{r(dme[o.resourceType]??`/${o.resourceType}/new`)},onExportCsv:()=>{const i=t.fhirUrl(o.resourceType,"$csv")+qi(o);t.download(i).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>pe({color:"red",message:Ce(l)}))},onExportTransactionBundle:async()=>{vme(o,t).then(i=>cme(JSON.stringify(i,void 0,2))).catch(i=>pe({color:"red",message:Ce(i)}))},onDelete:i=>{window.confirm("Are you sure you want to delete these resources?")&&(t.invalidateSearches(o.resourceType),t.executeBatch({resourceType:"Bundle",type:"batch",entry:i.map(l=>({request:{method:"DELETE",url:`${o.resourceType}/${l}`}}))}).then(()=>a({...o})).catch(l=>pe({color:"red",message:Ce(l)})))},onBulk:i=>{r(`/bulk/${o.resourceType}?ids=${i.join(",")}`)}})})}function xme(){const e=ie(),[t,r]=f.useState(),[n,o]=f.useState(void 0);f.useEffect(()=>{e.get("auth/mfa/status").then(l=>{const c=new URL("https://chart.googleapis.com/chart");c.searchParams.set("chs","300x300"),c.searchParams.set("cht","qr"),c.searchParams.set("chl",l.enrollUri),c.searchParams.set("choe","UTF-8"),r(c.toString()),o(l.enrolled)}).catch(l=>pe({color:"red",message:Ce(l)}))},[e]);const a=f.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),pe({color:"green",message:"Success"})}).catch(c=>pe({color:"red",message:Ce(c)}))},[e]),i=f.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return n===void 0?null:n?s.jsx(be,{children:s.jsxs(J,{children:[s.jsx(de,{children:"MFA is enabled"}),s.jsx(re,{onClick:i,children:"Disable MFA"})]})}):s.jsx(be,{width:400,children:s.jsxs(Ne,{onSubmit:a,children:[s.jsx(de,{children:"Multi Factor Auth Setup"}),s.jsx(rr,{children:s.jsx("img",{src:t})}),s.jsx(se,{name:"token",label:"Code"}),s.jsx(J,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Enroll"})})]})})}const wme={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function Mc(){return wme}function bme(){const e=Pt(),[t]=G1(),r=t.get("client_id");if(!r)return null;const n=t.get("scope")||"openid";function o(a){const i=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&i.searchParams.set(l,t.get(l));i.searchParams.set("code",a),window.location.assign(i.toString())}return s.jsxs(z4,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Mc().googleClientId,clientId:r||void 0,scope:n,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:n!=="openid",children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Sign in to Medplum"})]})}function _me(){const e=ie(),t=Pt(),r=Mc();return f.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),s.jsxs(ife,{type:"project",onSuccess:()=>t("/"),googleClientId:r.googleClientId,recaptchaSiteKey:r.recaptchaSiteKey,children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Create a new account"})]})}function Sme(){const e=Pt(),t=ie(),[r,n]=f.useState(),[o,a]=f.useState(!1),i=Mc().recaptchaSiteKey;return f.useEffect(()=>{M4(i)},[i]),s.jsx(be,{width:450,children:s.jsxs(Ne,{style:{maxWidth:400},onSubmit:async l=>{let c="";c=await L4(i),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>a(!0)).catch(u=>n(ct(u)))},children:[s.jsxs(Oe,{spacing:"lg",mb:"xl",align:"center",children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Medplum Password Reset"})]}),s.jsxs(Oe,{spacing:"xl",children:[s.jsx(ma,{issues:R1(r,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(se,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:lt(r,"email")}),s.jsxs(J,{position:"apart",mt:"xl",noWrap:!0,children:[s.jsx(Me,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(re,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function Pme(){var a;const e=Pt(),t=ie(),[r,n]=f.useState();f.useEffect(()=>{t.get("auth/me").then(n).catch(i=>pe({color:"red",message:Ce(i)}))},[t]);function o(i){t.post("auth/revoke",{loginId:i}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(n).then(()=>pe({color:"green",message:"Login revoked"})).catch(l=>pe({color:"red",message:Ce(l)}))}return r?s.jsxs(s.Fragment,{children:[s.jsxs(be,{children:[s.jsx(de,{children:"Security"}),s.jsxs($1,{children:[s.jsx(ns,{term:"ID",children:s.jsx(Me,{href:`/${Ze(r.profile)}`,children:r.profile.id})}),s.jsx(ns,{term:"Resource Type",children:r.profile.resourceType}),s.jsx(ns,{term:"Name",children:Ec((a=r.profile.name)==null?void 0:a[0])})]})]}),s.jsxs(be,{children:[s.jsx(de,{children:"Sessions"}),s.jsxs(ci,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:r.security.sessions.map(i=>s.jsxs("tr",{children:[s.jsx("td",{children:i.os}),s.jsx("td",{children:i.browser}),s.jsx("td",{children:i.remoteAddress}),s.jsx("td",{children:i.authMethod}),s.jsx("td",{children:$r(i.lastUpdated)}),s.jsx("td",{children:s.jsx(Me,{href:"#",onClick:()=>o(i.id),children:"Revoke"})})]},i.id))})]})]}),s.jsxs(be,{children:[s.jsx(de,{children:"Password"}),s.jsx(re,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(be,{children:[s.jsx(de,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",r.security.mfaEnrolled.toString()]}),!r.security.mfaEnrolled&&s.jsx(re,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function jme(){const{id:e,secret:t}=Ge(),r=ie(),[n,o]=f.useState(),[a,i]=f.useState(!1);return s.jsx(be,{width:450,children:s.jsxs(Ne,{style:{maxWidth:400},onSubmit:l=>{if(l.password!==l.confirmPassword){o(Ba("Passwords do not match","confirmPassword"));return}o(void 0);const c={id:e,secret:t,password:l.password};r.post("auth/setpassword",c).then(()=>i(!0)).catch(u=>o(ct(u)))},children:[s.jsxs(rr,{sx:{flexDirection:"column"},children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Set password"})]}),!a&&s.jsxs(Oe,{children:[s.jsx(fo,{name:"password",label:"New password",required:!0,error:lt(n,"password")}),s.jsx(fo,{name:"confirmPassword",label:"Confirm new password",required:!0,error:lt(n,"confirmPassword")}),s.jsx(J,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Set password"})})]}),a&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(ke,{to:"/signin",children:"sign in"}),"."]})]})})}function Ome(){const e=Pt(),[t]=G1(),r=Mc();return s.jsxs(z4,{onSuccess:()=>e(t.get("next")||"/"),onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:r.googleClientId,login:t.get("login")||void 0,projectId:t.get("project")||void 0,children:[s.jsx(Tn,{size:32}),s.jsx(de,{children:"Sign in to Medplum"}),t.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function Cme(){const e=Pt(),t=va(),[r,n]=f.useState(),[o,a]=f.useState(),[i,l]=f.useState();return f.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());n(c.resourceType),a(c.query),l(JSON.parse(c.fields))},[t]),!r||!o||!i?null:s.jsx(Lue,{resourceType:r,checkboxesEnabled:!0,query:o,fields:i,onClick:c=>e(`/${r}/${c.resource.id}`),onAuxClick:c=>window.open(`/${r}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${r}?ids=${c.join(",")}`)}})}function wm(e){const t=ie(),r=ya(t),n=Pt(),[o,a]=f.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ee.EQUALS,value:"Project/"+r},{code:"profile-type",operator:ee.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(Ic,{search:o,onClick:i=>n(`/admin/members/${i.resource.id}`),onChange:i=>a(i.definition),hideFilters:!0,hideToolbar:!0})}function Eme(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Bots"}),s.jsx(wm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(J,{position:"right",children:s.jsx(ke,{to:"/admin/bots/new",children:"Create new bot"})})]})}function $me(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Clients"}),s.jsx(wm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(J,{position:"right",children:s.jsx(ke,{to:"/admin/clients/new",children:"Create new client"})})]})}function bm(e){return s.jsx(Ds,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{ko(t)?e.onChange(dt(t)):e.onChange(void 0)}})}function kme(){const e=ie(),t=ya(e),[r,n]=f.useState(""),[o,a]=f.useState(""),[i,l]=f.useState(),[c,u]=f.useState(),[d,p]=f.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Create new Bot"}),s.jsxs(Ne,{onSubmit:()=>{const h={name:r,description:o,accessPolicy:i};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),p(m),pe({color:"green",message:"Bot created"})}).catch(m=>{pe({color:"red",message:Ce(m)}),u(ct(m))})},children:[!d&&s.jsxs(Oe,{children:[s.jsx(et,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(se,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>n(h.currentTarget.value),error:lt(c,"name")})}),s.jsx(et,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(se,{id:"description",name:"description",onChange:h=>a(h.currentTarget.value),error:lt(c,"description")})}),s.jsx(et,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(bm,{name:"accessPolicy",onChange:l})}),s.jsx(J,{position:"right",children:s.jsx(re,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(te,{children:"Bot created"}),s.jsxs(Sr,{children:[s.jsx(Sr.Item,{children:s.jsx(ke,{to:d,children:"Go to new bot"})}),s.jsx(Sr.Item,{children:s.jsx(ke,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function Rme(){const e=ie(),t=ya(e),[r,n]=f.useState(""),[o,a]=f.useState(""),[i,l]=f.useState(""),[c,u]=f.useState(),[d,p]=f.useState(),[h,m]=f.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Create new Client"}),s.jsxs(Ne,{onSubmit:()=>{const v={name:r,description:o,redirectUri:i,accessPolicy:c};e.post("admin/projects/"+t+"/client",v).then(g=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(g),pe({color:"green",message:"Client created"})}).catch(g=>{pe({color:"red",message:Ce(g)}),p(ct(g))})},children:[!h&&s.jsxs(Oe,{children:[s.jsx(et,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(se,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>n(v.currentTarget.value),error:lt(d,"name")})}),s.jsx(et,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(se,{id:"description",name:"description",onChange:v=>a(v.currentTarget.value),error:lt(d,"description")})}),s.jsx(et,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(se,{id:"redirectUri",name:"redirectUri",onChange:v=>l(v.currentTarget.value),error:lt(d,"redirectUri")})}),s.jsx(et,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(bm,{name:"accessPolicy",onChange:u})}),s.jsx(J,{position:"right",children:s.jsx(re,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(te,{children:"Client created"}),s.jsxs(Sr,{children:[s.jsx(Sr.Item,{children:s.jsx(ke,{to:h,children:"Go to new client"})}),s.jsx(Sr.Item,{children:s.jsx(ke,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function Tme(e){return s.jsx(Ds,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{ko(t)?e.onChange(dt(t)):e.onChange(void 0)}})}function Ime(){const{membershipId:e}=Ge(),t=ie(),r=ya(t),n=Pt(),o=t.get(`admin/projects/${r}/members/${e}`).read(),[a,i]=f.useState(o.accessPolicy),[l,c]=f.useState(o.userConfiguration),[u,d]=f.useState(o.admin),[p,h]=f.useState(),[m,v]=f.useState(!1);function g(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${r}/members/${e}`).then(()=>t.get(`admin/projects/${r}`,{cache:"no-cache"})).then(()=>n("/admin/project")).catch(_=>h(ct(_)))}return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(os,{value:o.profile,link:!0})}),s.jsxs(Ne,{onSubmit:()=>{const _={...o,accessPolicy:a,userConfiguration:l,admin:u};t.post(`admin/projects/${r}/members/${e}`,_).then(()=>v(!0)).catch(y=>h(ct(y)))},children:[!m&&s.jsxs(Oe,{children:[s.jsx(et,{title:"Access Policy",htmlFor:"accessPolicy",outcome:p,children:s.jsx(bm,{name:"accessPolicy",defaultValue:a,onChange:i})}),s.jsx(et,{title:"User Configuration",htmlFor:"userConfiguration",outcome:p,children:s.jsx(Tme,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(et,{title:"Admin",htmlFor:"admin",outcome:p,children:s.jsx($n,{id:"admin",name:"admin",defaultChecked:u,onChange:_=>d(_.currentTarget.checked)})}),s.jsxs(J,{position:"right",mt:"xl",children:[s.jsx(re,{type:"submit",children:"Save"}),s.jsx(re,{type:"button",color:"red",variant:"outline",onClick:g,children:"Remove user"})]})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(p,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(ke,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Dme(){const e=ie(),[t,r]=f.useState(e.getProject()),[n,o]=f.useState(),[a,i]=f.useState(),[l,c]=f.useState(!1),[u,d]=f.useState(void 0),p=f.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:n,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(v=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),om(v)?i(v):d(v),c(m.sendEmail??!1),pe({color:"green",message:"Invite success"})}).catch(v=>{pe({color:"red",message:Ce(v)}),i(ct(v))})},[e,t,n]);return s.jsxs(Ne,{onSubmit:p,children:[!u&&!a&&s.jsxs(Oe,{children:[s.jsx(de,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(et,{title:"Project",htmlFor:"project",outcome:a,children:s.jsx(Ds,{resourceType:"Project",name:"project",defaultValue:t,onChange:r})}),s.jsx(ft,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:lt(a,"resourceType")}),s.jsx(se,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:lt(a,"firstName")}),s.jsx(se,{name:"lastName",label:"Last Name",required:!0,error:lt(a,"lastName")}),s.jsx(se,{name:"email",type:"email",label:"Email",required:!0,error:lt(a,"email")}),s.jsx(et,{title:"Access Policy",htmlFor:"accessPolicy",outcome:a,children:s.jsx(bm,{name:"accessPolicy",onChange:o})}),s.jsx($n,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx($n,{name:"isAdmin",label:"Admin"}),s.jsx(J,{position:"right",children:s.jsx(re,{type:"submit",children:"Invite"})})]}),a&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(ke,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(te,{children:"User created"}),l&&s.jsx(te,{children:"Email sent"}),s.jsxs(Sr,{children:[s.jsx(Sr.Item,{children:s.jsx(ke,{to:u,children:"Go to new membership"})}),s.jsx(Sr.Item,{children:s.jsx(ke,{to:u.profile,children:"Go to new profile"})}),s.jsx(Sr.Item,{children:s.jsx(ke,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Nme(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Patients"}),s.jsx(wm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(J,{position:"right",children:s.jsx(ke,{to:"/admin/invite",children:"Invite new patient"})})]})}function CC(){const e=ie(),t=ya(e),r=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Details"}),s.jsxs($1,{children:[s.jsx(ns,{term:"ID",children:r.project.id}),s.jsx(ns,{term:"Name",children:r.project.name})]})]})}const EC=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function Ame(){const e=Pt(),r=va().pathname.replace("/admin/","")||EC[0],n=ie(),o=ya(n),a=f.useMemo(()=>n.get("admin/projects/"+o).read(),[n,o]);function i(l){e(`/admin/${l}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(sn,{children:[s.jsx(Pe,{children:s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Project"}),s.jsx(Pe.Value,{children:a.project.name})]})}),s.jsx(ai,{children:s.jsx(Ue,{value:r.toLowerCase(),onTabChange:i,children:s.jsx(Ue.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:EC.map(l=>s.jsx(Ue.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(be,{children:s.jsx(q1,{})})]})}function Mme(){const e=ie(),t=ya(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(!1),[a,i]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),f.useEffect(()=>{r&&i(di(r.project.secret||[]))},[e,r]),!n||!a?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,a).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>pe({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(de,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Za,{property:pi("Project","secret"),name:"secret",defaultValue:a,onChange:i}),s.jsx(re,{type:"submit",children:"Save"})]})}function Lme(){const e=ie(),t=ya(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(!1),[a,i]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),f.useEffect(()=>{r&&i(di(r.project.site||[]))},[e,r]),!n||!a?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,a).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>pe({color:"green",message:"Saved"})).catch(c=>{var d,p,h,m;const u=ct(c);pe({color:"red",message:`Error ${(p=(d=u.issue)==null?void 0:d[0].details)==null?void 0:p.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`})})},children:[s.jsx(de,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Za,{property:pi("Project","site"),name:"site",defaultValue:a,onChange:i}),s.jsx(re,{type:"submit",children:"Save"})]})}function zme(){const e=ie();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(ma,{outcome:vae});function t(){dl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function r(){dl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function n(){dl(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){dl(e,"Reindexing Resources","admin/super/reindex",u)}function a(u){dl(e,"Rebuilding Compartments","admin/super/compartments",u)}function i(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>pe({color:"green",message:"Done"})).catch(d=>pe({color:"red",message:Ce(d)}))}function l(u){e.post("admin/super/purge",{...u,before:r4(u.before)}).then(()=>pe({color:"green",message:"Done"})).catch(d=>pe({color:"red",message:Ce(d)}))}function c(u){e.post("admin/super/setpassword",u).then(()=>pe({color:"green",message:"Done"})).catch(d=>pe({color:"red",message:Ce(d)}))}return s.jsxs(be,{width:600,children:[s.jsx(de,{order:1,children:"Super Admin"}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Structure Definitions"}),s.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),s.jsx(Ne,{children:s.jsx(re,{onClick:t,children:"Rebuild StructureDefinitions"})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Search Parameters"}),s.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),s.jsx(Ne,{children:s.jsx(re,{onClick:r,children:"Rebuild SearchParameters"})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Value Sets"}),s.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),s.jsx(Ne,{children:s.jsx(re,{onClick:n,children:"Rebuild ValueSets"})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(Ne,{onSubmit:o,children:s.jsxs(Oe,{children:[s.jsx(et,{title:"Resource Type",children:s.jsx(se,{name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(re,{type:"submit",children:"Reindex"})]})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Rebuild Compartments"}),s.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),s.jsx(Ne,{onSubmit:a,children:s.jsxs(Oe,{children:[s.jsx(et,{title:"Resource Type",children:s.jsx(se,{name:"resourceType",placeholder:"Compartments Resource Type"})}),s.jsx(re,{type:"submit",children:"Rebuild Compartments"})]})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(Ne,{onSubmit:l,children:s.jsxs(Oe,{children:[s.jsx(et,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(ft,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(et,{title:"Purge Before",htmlFor:"before",children:s.jsx(Xa,{name:"before",placeholder:"Before Date"})}),s.jsx(re,{type:"submit",children:"Purge"})]})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(Ne,{onSubmit:i,children:s.jsxs(Oe,{children:[s.jsx(et,{title:"Bot ID",children:s.jsx(se,{name:"botId",placeholder:"Bot Id"})}),s.jsx(re,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(wr,{my:"lg"}),s.jsx(de,{order:2,children:"Force Set Password"}),s.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),s.jsx(Ne,{onSubmit:c,children:s.jsxs(Oe,{children:[s.jsx(se,{name:"email",label:"Email",required:!0}),s.jsx(fo,{name:"password",label:"Password",required:!0}),s.jsx(se,{name:"projectId",label:"Project ID"}),s.jsx(re,{type:"submit",children:"Force Set Password"})]})})]})}function dl(e,t,r,n){po.show({id:r,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST"};n&&(o.body=JSON.stringify(n)),e.startAsyncRequest(r,o).then(()=>{po.update({id:r,color:"green",title:t,message:"Done",icon:s.jsx(lm,{size:"1rem"}),autoClose:!1,withCloseButton:!0})}).catch(a=>{po.update({id:r,color:"red",title:t,message:Ce(a),icon:s.jsx(eh,{size:"1rem"}),autoClose:!1,withCloseButton:!0})})}function Fme(){return s.jsxs(s.Fragment,{children:[s.jsx(de,{children:"Users"}),s.jsx(wm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(J,{position:"right",children:s.jsx(ke,{to:"/admin/invite",children:"Invite new user"})})]})}function Vme(){const[e]=xs("ObservationDefinition","_count=100");return e?s.jsxs(ci,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var r,n,o,a;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Kn,{value:(r=t.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(Kn,{value:t.code})}),s.jsx("td",{children:s.jsx(Kn,{value:t.method})}),s.jsx("td",{children:(o=(n=t.quantitativeDetails)==null?void 0:n.unit)==null?void 0:o.text}),s.jsx("td",{children:(a=t.quantitativeDetails)==null?void 0:a.decimalPrecision}),s.jsx("td",{children:s.jsx(vy,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(kn,{})}function vy(e){const{ranges:t}=e;if(!t)return null;const r=$C(t.map(o=>o.gender));if(r.length>1)return r.sort((o,a)=>o.localeCompare(a)),s.jsx(s.Fragment,{children:r.map(o=>{var a;return s.jsxs(f.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:pr(o)})}),s.jsx(vy,{ranges:(a=e.ranges)==null?void 0:a.filter(i=>i.gender===o)})]},o)})});const n=$C(t.map(o=>o.age&&rc(o.age)));return n.length>1?(n.sort((o,a)=>o.localeCompare(a)),s.jsx(s.Fragment,{children:n.map(o=>{var a;return s.jsxs(f.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:pr(o)})}),s.jsx(vy,{ranges:(a=e.ranges)==null?void 0:a.filter(i=>rc(i.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(k1,{value:o.range})})]})})},`range-${o.condition}`))})}function $C(e){return[...new Set(e.filter(t=>!!t))]}function Bme(){const[e]=xs("ActivityDefinition","_count=100"),[t]=xs("ObservationDefinition","_count=100");return!e||!t?s.jsx(kn,{}):s.jsxs(ci,{withBorder:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(r=>s.jsx("th",{children:r.name},r.id))]})}),s.jsx("tbody",{children:t.map(r=>{var n;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Kn,{value:(n=r.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(Kn,{value:r.code})}),e.map(o=>{var a;return s.jsx("td",{children:(a=o.observationResultRequirement)!=null&&a.find(i=>{var l;return(l=i.reference)==null?void 0:l.includes(r.id)})?"✅":""},o.id)})]},r.id)})})]})}function Ume(e){var i;const t=ie(),[r,n]=f.useState(),[o,a]=f.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(ke,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(ke,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(Ne,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueReference:r}]}).then(a).catch(console.log)},children:s.jsxs(Oe,{children:[s.jsxs(de,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(te,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(te,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(i=e.planDefinition.action)==null?void 0:i.map((l,c)=>{var u;return s.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&s.jsx(s.Fragment,{children:l.title}),l.code&&s.jsx(Kn,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(et,{title:"Subject",children:s.jsx(dm,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:r,onChange:n})}),s.jsx(J,{position:"right",mt:"xl",children:s.jsx(re,{type:"submit",children:"Go"})})]})})}function Wme(){const{resourceType:e,id:t}=Ge(),r=Ye({reference:e+"/"+t});return r?s.jsx(be,{children:s.jsx(Ume,{planDefinition:r})}):null}function Hme(){const e=ie(),{resourceType:t,id:r}=Ge(),n=Ye({reference:t+"/"+r}),[o,a]=xs("Questionnaire","subject-type="+t),[i,l]=xs("ClientApplication",{_count:1e3});if(!n||a||l)return s.jsx(kn,{});const c=i==null?void 0:i.filter(d=>qme(t)&&!!d.launchUri);if((!o||o.length===0)&&(!c||c.length===0))return s.jsxs(be,{children:[s.jsx(de,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});function u(d){if(!n)return;const p={resourceType:"SmartAppLaunch"};switch(n.resourceType){case"Patient":p.patient=dt(n);break;case"Encounter":p.patient=n.subject,p.encounter=dt(n);break}e.createResource(p).then(h=>{const m=new URL(d.launchUri);m.searchParams.set("iss",e.getBaseUrl()+"fhir/R4"),m.searchParams.set("launch",h.id),window.location.assign(m.toString())}).catch(h=>pe({color:"red",message:Ce(h)}))}return s.jsxs(be,{children:[o==null?void 0:o.map(d=>s.jsxs("div",{children:[s.jsx(de,{order:3,children:s.jsx(ke,{to:`/forms/${d.id}?subject=${Ze(n)}`,children:d.title||d.name})}),s.jsx(te,{children:d.description})]},d.id)),c==null?void 0:c.map(d=>s.jsxs("div",{children:[s.jsx(de,{order:3,children:s.jsx(Me,{onClick:()=>u(d),children:d.name})}),s.jsx(te,{children:d.description})]},d.id))]})}function qme(e){return e==="Patient"||e==="Encounter"}function Gme(){const{resourceType:e,id:t}=Ge(),r=Pt(),[n,o]=f.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ee.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(be,{children:s.jsx(Ic,{search:n,onClick:a=>r(`/${a.resource.resourceType}/${a.resource.id}`),onChange:a=>o(a.definition),hideFilters:!0})})}function Qme(){const e=ie(),{resourceType:t,id:r}=Ge(),n=e.readHistory(t,r).read();return s.jsx(be,{children:s.jsx(Xde,{history:n})})}function Kme(e){const t="https://codeeditor.medplum.com/bot-runner.html";return s.jsx("iframe",{frameBorder:"0",src:t,className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Yme(e){const t=e.defaultValue,r=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&r.searchParams.set("module",e.module),s.jsx("iframe",{frameBorder:"0",src:r.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:n=>{ld(n.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Xme=`{
225
+ "resourceType": "Patient",
226
+ "name": [
227
+ {
228
+ "given": [
229
+ "Alice"
230
+ ],
231
+ "family": "Smith"
232
+ }
233
+ ]
234
+ }`,Jme="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-",Zme=W(()=>({hl7Input:{fontFamily:"monospace",fontSize:"12px",lineHeight:1.55,padding:"10px 12px",whiteSpace:"nowrap",width:"100%"}}));function ege(){const e=ie(),{id:t}=Ge(),[r,n]=f.useState(),[o,a]=f.useState(),[i,l]=f.useState(Xme),[c,u]=f.useState(Jme),[d,p]=f.useState(Ht.FHIR_JSON),{classes:h}=Zme(),m=f.useRef(null),v=f.useRef(null),[g,_]=f.useState(!1);f.useEffect(()=>{e.readResource("Bot",t).then(async j=>{n(j),a(await tge(e,j))}).catch(j=>pe({color:"red",message:Ce(j)}))},[e,t]);const y=f.useCallback(()=>ld(m.current,{command:"getValue"}),[]),x=f.useCallback(()=>ld(m.current,{command:"getOutput"}),[]),w=f.useCallback(async()=>d===Ht.FHIR_JSON?JSON.parse(i):c,[d,i,c]),b=f.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),_(!0);try{const E=await y(),T=await e.createAttachment(E,"index.ts","text/typescript"),$=[];r!=null&&r.sourceCode?$.push({op:"replace",path:"/sourceCode",value:T}):$.push({op:"add",path:"/sourceCode",value:T}),await e.patchResource("Bot",t,$),pe({color:"green",message:"Saved"})}catch(E){pe({color:"red",message:Ce(E)})}finally{_(!1)}},[e,t,r,y]),O=f.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),_(!0);try{const E=await x();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:E}),pe({color:"green",message:"Deployed"})}catch(E){pe({color:"red",message:Ce(E)})}finally{_(!1)}},[e,t,x]),C=f.useCallback(async j=>{j.preventDefault(),j.stopPropagation(),_(!0);try{const E=await w(),T=await e.post(e.fhirUrl("Bot",t,"$execute"),E,d);await ld(v.current,{command:"setValue",value:T}),pe({color:"green",message:"Success"})}catch(E){pe({color:"red",message:Ce(E)})}finally{_(!1)}},[e,t,w,d]);return!r||o===void 0?null:s.jsxs(nn,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(nn.Col,{span:8,children:s.jsxs(sn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(Yme,{iframeRef:m,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(J,{position:"right",spacing:"xs",children:[s.jsx(re,{type:"button",onClick:b,loading:g,leftIcon:s.jsx(Tse,{size:"1rem"}),children:"Save"}),s.jsx(re,{type:"button",onClick:O,loading:g,leftIcon:s.jsx(w1,{size:"1rem"}),children:"Deploy"}),s.jsx(re,{type:"button",onClick:C,loading:g,leftIcon:s.jsx(Qse,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(nn.Col,{span:4,children:[s.jsxs(sn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(ft,{data:[{label:"FHIR",value:Ht.FHIR_JSON},{label:"HL7",value:Ht.HL7_V2}],onChange:j=>p(j.currentTarget.value)}),d===Ht.FHIR_JSON?s.jsx(Is,{value:i,onChange:j=>l(j),minRows:15}):s.jsx("textarea",{className:h.hl7Input,value:c,onChange:j=>u(j.currentTarget.value),rows:15})]}),s.jsx(sn,{m:2,p:"xs",shadow:"md",children:s.jsx(Kme,{iframeRef:v,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function tge(e,t){var r,n,o;if((r=t.sourceCode)!=null&&r.url){const a=(o=(n=t.sourceCode.url)==null?void 0:n.split("/"))==null?void 0:o.find(cN);return(await e.download(e.fhirUrl("Binary",a))).text()}return t.code??""}function Lc(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function rge(){const e=ie(),{resourceType:t,id:r}=Ge(),n={reference:t+"/"+r},o=f.useCallback(a=>{e.updateResource(Lc(a)).then(()=>{pe({color:"green",message:"Success"})}).catch(i=>{pe({color:"red",message:Ce(i)})})},[e]);switch(t){case"PlanDefinition":return s.jsx(be,{children:s.jsx(que,{value:n,onSubmit:o})});case"Questionnaire":return s.jsx(be,{children:s.jsx(yde,{questionnaire:n,onSubmit:o})});default:return null}}function nge(){const{resourceType:e,id:t}=Ge(),r=Ye({reference:e+"/"+t}),n=Pt();return r?s.jsx(be,{children:s.jsx(Vde,{value:r,onStart:(o,a)=>n(`/forms/${t1(a)}`),onEdit:(o,a,i)=>n(`/${i.reference}}`)})}):null}function oge(){const e=ie(),{resourceType:t,id:r}=Ge(),n=Pt();return s.jsxs(be,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(re,{color:"red",onClick:()=>{e.deleteResource(t,r).then(()=>n(`/${t}`)).catch(o=>pe({color:"red",message:Ce(o)}))},children:"Delete"})]})}function age(){const{resourceType:e,id:t}=Ge(),r=Ye({reference:e+"/"+t});return r?s.jsx(be,{children:s.jsx(N1,{value:r})}):null}function ige(){const e=ie(),{resourceType:t,id:r}=Ge(),[n,o]=f.useState(),a=Pt(),[i,l]=f.useState();f.useEffect(()=>{e.readResource(t,r).then(d=>o(di(d))).catch(d=>{l(ct(d)),pe({color:"red",message:Ce(d)})})},[e,t,r]);const c=f.useCallback(d=>{l(void 0),e.updateResource(Lc(d)).then(()=>{a(`/${t}/${r}/details`),pe({color:"green",message:"Success"})}).catch(p=>{l(ct(p)),pe({color:"red",message:Ce(p)})})},[e,t,r,a]),u=f.useCallback(()=>a(`/${t}/${r}/delete`),[a,t,r]);return n?s.jsx(be,{children:s.jsx(T4,{defaultValue:n,onSubmit:c,onDelete:u,outcome:i})}):null}function sge(){const e=ie(),{resourceType:t,id:r}=Ge(),n=e.readHistory(t,r).read();return s.jsx(be,{children:s.jsx(tfe,{history:n})})}function lge(){const e=ie(),{resourceType:t,id:r}=Ge(),n=Ye({reference:t+"/"+r}),o=Pt(),[a,i]=f.useState(),l=f.useCallback(c=>{e.updateResource(Lc(JSON.parse(c.resource))).then(()=>{i(void 0),o(`/${t}/${r}/details`),pe({color:"green",message:"Success"})}).catch(u=>{pe({color:"red",message:Ce(u)})})},[e,t,r,o]);return n?s.jsxs(be,{children:[a&&s.jsx(ma,{outcome:a}),s.jsxs(Ne,{onSubmit:l,children:[s.jsx(Is,{name:"resource","data-testid":"resource-json",minRows:24,defaultValue:ar(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(J,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"OK"})})]})]}):null}function cge(){const{resourceType:e,id:t}=Ge();return Ye({reference:e+"/"+t})?s.jsxs(be,{children:[s.jsxs(yc,{icon:s.jsx(sm,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Me,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx($4,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function uge(){const e=ie(),{id:t}=Ge(),[r,n]=f.useState(),[o,a]=f.useState(0),i=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>dge(c,t));function l(){r&&e.createResource({resourceType:"Subscription",status:"active",reason:r.name,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:Ze(r)}}).then(()=>{n(void 0),a(Date.now()),e.invalidateSearches("Subscription"),pe({color:"green",message:"Success"})}).catch(c=>pe({color:"red",message:Ce(c)}))}return s.jsxs(be,{children:[s.jsx(de,{children:"Bots"}),i.length===0&&s.jsx("p",{children:"No bots found."}),i.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Tc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(de,{children:"Connect to bot"}),s.jsxs(J,{children:[s.jsx(Ds,{name:"bot",resourceType:"Bot",onChange:n}),s.jsx(re,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function dge(e,t){var o;const r=e.criteria||"",n=((o=e.channel)==null?void 0:o.endpoint)||"";return r.startsWith("QuestionnaireResponse?")&&r.includes(t)&&n.startsWith("Bot/")}function fge(){const{id:e}=Ge(),t=Pt(),[r,n]=f.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ee.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(be,{children:s.jsx(Ic,{search:r,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>n(o.definition),hideFilters:!0,hideToolbar:!0})})}function pge(){const e=ie(),{resourceType:t,id:r}=Ge(),n=Ye({reference:t+"/"+r}),o=f.useCallback(a=>{e.updateResource(Lc(a)).then(()=>{pe({color:"green",message:"Success"})}).catch(i=>{pe({color:"red",message:Ce(i)})})},[e]);return n?s.jsx(be,{children:s.jsx(Ide,{onSubmit:o,definition:n})}):null}function hge(){const{resourceType:e,id:t}=Ge(),r=Ye({reference:e+"/"+t});return r?s.jsx(be,{children:e==="MeasureReport"?s.jsx(Wue,{measureReport:r}):s.jsx(I1,{value:r})}):null}const mge=W(e=>({container:{position:"fixed",top:300,left:0,width:160,zIndex:5,fontSize:e.fontSizes.xs,"@media (max-width: 700px)":{display:"none"}},entry:{textAlign:"center",width:150,backgroundColor:e.colors.gray[0],border:`1px solid ${e.colors.gray[3]}`},active:{width:160,backgroundColor:e.colors.yellow[0],border:`1px solid ${e.colors.yellow[5]}`}}));function gge(e){const{classes:t,cx:r}=mge(),n=ie(),o=Ye(e.value),[a,i]=f.useState();return f.useEffect(()=>{if(!o)return;const l=Y1(o);if(!l)return;const c="reference"in l?l.reference:Ze(l);n.search("ServiceRequest","subject="+c).then(u=>{const p=u.entry.map(h=>h.resource);l4(p),p.reverse(),i(p)}).catch(u=>pe({color:"red",message:Ce(u)}))},[n,o]),a?s.jsx("div",{"data-testid":"quick-service-requests",className:t.container,children:a.map(l=>{var c,u,d,p,h,m,v;return s.jsxs("div",{className:r(t.entry,{[t.active]:l.id===(o==null?void 0:o.id)}),children:[s.jsx("p",{children:s.jsx(ke,{to:l,children:vge(l)})}),((u=(c=l.category)==null?void 0:c[0])==null?void 0:u.text)&&s.jsx("p",{children:(d=l.category[0])==null?void 0:d.text}),((m=(h=(p=l.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:m.code)&&s.jsx("p",{children:(v=l.code.coding[0])==null?void 0:v.code}),s.jsx("p",{children:yge(l)})]},l.id)})}):null}function vge(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function yge(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const xge=W(()=>({container:{position:"absolute",top:65,right:5,width:200,height:50,zIndex:15}}));function wge(e){var a,i,l,c;const{classes:t}=xge(),r=Ye(e.valueSet);if(!r)return null;const n=[""],o=(c=(l=(i=(a=r.compose)==null?void 0:a.include)==null?void 0:i[0])==null?void 0:l.concept)==null?void 0:c.map(u=>u.code);return o&&n.push(...o),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:t.container,children:s.jsx(ft,{defaultValue:e.defaultValue,onChange:u=>e.onChange(u.currentTarget.value),data:n})})}function bge(e){var r,n;const t=Ye(e.specimen);return t?s.jsxs(Pe,{children:[s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Type"}),s.jsx(Pe.Value,{children:"Specimen"})]}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Collected"}),s.jsx(Pe.Value,{children:$r((r=t.collection)==null?void 0:r.collectedDateTime)})]}),s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Specimen Age"}),s.jsx(Pe.Value,{children:_ge(t)})]}),(n=t.collection)!=null&&n.collectedDateTime&&t.receivedTime?s.jsxs(Pe.Entry,{children:[s.jsx(Pe.Key,{children:"Specimen Stability"}),s.jsx(Pe.Value,{children:Sge(t)})]}):s.jsx(s.Fragment,{})]}):null}function _ge(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const r=new Date(t);return S3(P3(r,new Date))}function Sge(e){var n;if(!((n=e.collection)!=null&&n.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),r=new Date(e.receivedTime);return S3(P3(t,r))}function S3(e){return e.toString().padStart(3,"0")+"D"}function P3(e,t){const r=t.getTime()-e.getTime();return Math.floor(r/(1e3*3600*24))}function Pge(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"),t.push("Details","Edit","Event","History","Blame","JSON","Apps"),t}function jge(){var b,O,C,j,E,T,$;const e=ie(),{resourceType:t,id:r}=Ge(),n={reference:t+"/"+r},o=Pt(),[a,i]=f.useState(),l=Ye(n,i),c=Pge(t),u=c[0].toLowerCase(),d=window.location.pathname.split("/").pop(),[p,h]=f.useState(d??u);async function m(){var D,N;const k=(N=(D=(await e.readHistory(t,r)).entry)==null?void 0:D.find(z=>!!z.resource))==null?void 0:N.resource;k?v(k):pe({color:"red",message:"No history to restore"})}function v(I){e.updateResource(Lc(I)).then(()=>{i(void 0),pe({color:"green",message:"Success"})}).catch(k=>{pe({color:"red",message:Ce(k)})})}if(a)return xae(a)?s.jsxs(be,{children:[s.jsx(de,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(re,{color:"red",onClick:m,children:"Restore"})]}):s.jsx(ma,{outcome:a});function g(I){h(I),o(`/${t}/${r}/${I}`)}function _(I){const k=l,D=k.orderDetail||[];D.length===0&&D.push({}),D[0].text!==I&&(D[0].text=I,v({...k,orderDetail:D}))}const y=l&&Y1(l),x=l&&lme(l),w=(C=(O=(b=e.getUserConfiguration())==null?void 0:b.option)==null?void 0:O.find(I=>I.id==="statusValueSet"))==null?void 0:C.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&w&&s.jsx(wge,{valueSet:{reference:w},defaultValue:(E=(j=l.orderDetail)==null?void 0:j[0])==null?void 0:E.text,onChange:_},Ze(l)+"-"+(($=(T=l.orderDetail)==null?void 0:T[0])==null?void 0:$.text)),l&&s.jsx(gge,{value:l}),l&&s.jsxs(sn,{children:[y&&s.jsx(w3,{patient:y}),x&&s.jsx(bge,{specimen:x}),t!=="Patient"&&s.jsx(b3,{resource:n}),s.jsx(ai,{children:s.jsx(Ue,{value:p.toLowerCase(),onTabChange:g,children:s.jsx(Ue.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(I=>s.jsx(Ue.Tab,{value:I.toLowerCase(),children:I},I))})})})]}),s.jsx(q1,{})]})}function kC(){var y,x,w,b;const e=Pt(),{resourceType:t,id:r,versionId:n,tab:o}=Ge(),a=ie(),[i,l]=f.useState(!0),[c,u]=f.useState(),[d,p]=f.useState();if(f.useEffect(()=>{p(void 0),l(!0),a.readHistory(t,r).then(O=>u(O)).then(()=>l(!1)).catch(O=>{p(O),l(!1)})},[a,t,r]),i)return s.jsx(kn,{});if(!c)return s.jsxs(be,{children:[s.jsx(de,{children:"Resource not found"}),s.jsx(ke,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(O=>{var C,j;return((j=(C=O.resource)==null?void 0:C.meta)==null?void 0:j.versionId)===n});if(m===-1)return s.jsxs(be,{children:[s.jsx(de,{children:"Version not found"}),s.jsx(ke,{to:`/${t}/${r}`,children:"Return to resource"})]});const v=h[m].resource,g=m<h.length-1?h[m+1].resource:void 0,_="diff";return s.jsx(s.Fragment,{children:s.jsxs(Ue,{value:o||_,onTabChange:O=>e(`/${t}/${r}/_history/${n}/${O}`),children:[s.jsxs(sn,{children:[s.jsx(Rc,{fluid:!0,p:"md",children:s.jsx(te,{children:`${t} ${r}`})}),s.jsxs(Ue.List,{children:[s.jsx(Ue.Tab,{value:"diff",children:"Diff"}),s.jsx(Ue.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(be,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(Ue.Panel,{value:"diff",children:g?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=v.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(ke,{to:`/${t}/${r}/_history/${(x=g.meta)==null?void 0:x.versionId}`,children:(w=g.meta)==null?void 0:w.versionId})]})]}),s.jsx(Zde,{original:g,revised:v})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(b=v.meta)==null?void 0:b.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(v,void 0,2)})]})}),s.jsx(Ue.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(v,void 0,2)})})]})]})})}function Oge(){const{resourceType:e,id:t}=Ge(),r=Pt(),[n,o]=f.useState({resourceType:"Subscription",filters:[{code:"url",operator:ee.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(be,{children:s.jsx(Ic,{search:n,onClick:a=>r(`/${a.resource.resourceType}/${a.resource.id}`),onChange:a=>o(a.definition),hideFilters:!0})})}function RC(){const{resourceType:e,id:t}=Ge(),r={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(qce,{encounter:r});case"Patient":return s.jsx(Hue,{patient:r});case"ServiceRequest":return s.jsx(ofe,{serviceRequest:r});default:return s.jsx(Hce,{resource:r})}}function j3(e,t){const r=ie(),n=Pt();return{defaultValue:{resourceType:e},handleSubmit:i=>{t&&t(void 0),r.createResource(i).then(l=>n("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ct(l))})}}}function TC(){const{resourceType:e}=Ge(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=j3(e,r);return s.jsx(be,{children:s.jsx(T4,{defaultValue:n,onSubmit:o,outcome:t})})}function Cge(){const{resourceType:e}=Ge(),[t,r]=f.useState(),{defaultValue:n,handleSubmit:o}=j3(e,r),a=f.useCallback(i=>{o(JSON.parse(i["new-resource"]))},[o]);return s.jsxs(be,{children:[t&&s.jsx(ma,{outcome:t}),s.jsxs(Ne,{onSubmit:a,children:[s.jsx(Is,{name:"new-resource","data-testid":"create-resource-json",minRows:24,defaultValue:ar(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(J,{position:"right",mt:"xl",noWrap:!0,children:s.jsx(re,{type:"submit",children:"OK"})})]})]})}function Ege(){return s.jsx(wpe,{children:s.jsxs(ue,{errorElement:s.jsx(ime,{}),children:[s.jsx(ue,{path:"/signin",element:s.jsx(Ome,{})}),s.jsx(ue,{path:"/oauth",element:s.jsx(bme,{})}),s.jsx(ue,{path:"/resetpassword",element:s.jsx(Sme,{})}),s.jsx(ue,{path:"/setpassword/:id/:secret",element:s.jsx(jme,{})}),s.jsx(ue,{path:"/register",element:s.jsx(_me,{})}),s.jsx(ue,{path:"/changepassword",element:s.jsx(nme,{})}),s.jsx(ue,{path:"/security",element:s.jsx(Pme,{})}),s.jsx(ue,{path:"/mfa",element:s.jsx(xme,{})}),s.jsx(ue,{path:"/batch",element:s.jsx(tme,{})}),s.jsx(ue,{path:"/bulk/:resourceType",element:s.jsx(rme,{})}),s.jsx(ue,{path:"/smart",element:s.jsx(Cme,{})}),s.jsx(ue,{path:"/forms/:id",element:s.jsx(ume,{})}),s.jsx(ue,{path:"/admin/super",element:s.jsx(zme,{})}),s.jsxs(ue,{path:"/admin",element:s.jsx(Ame,{}),children:[s.jsx(ue,{path:"patients",element:s.jsx(Nme,{})}),s.jsx(ue,{path:"bots/new",element:s.jsx(kme,{})}),s.jsx(ue,{path:"bots",element:s.jsx(Eme,{})}),s.jsx(ue,{path:"clients/new",element:s.jsx(Rme,{})}),s.jsx(ue,{path:"clients",element:s.jsx($me,{})}),s.jsx(ue,{path:"details",element:s.jsx(CC,{})}),s.jsx(ue,{path:"invite",element:s.jsx(Dme,{})}),s.jsx(ue,{path:"users",element:s.jsx(Fme,{})}),s.jsx(ue,{path:"project",element:s.jsx(CC,{})}),s.jsx(ue,{path:"secrets",element:s.jsx(Mme,{})}),s.jsx(ue,{path:"sites",element:s.jsx(Lme,{})}),s.jsx(ue,{path:"members/:membershipId",element:s.jsx(Ime,{})})]}),s.jsx(ue,{path:"/lab/assays",element:s.jsx(Vme,{})}),s.jsx(ue,{path:"/lab/panels",element:s.jsx(Bme,{})}),s.jsx(ue,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(kC,{})}),s.jsx(ue,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(kC,{})}),s.jsxs(ue,{path:"/:resourceType/new",element:s.jsx(ame,{}),children:[s.jsx(ue,{index:!0,element:s.jsx(TC,{})}),s.jsx(ue,{path:"form",element:s.jsx(TC,{})}),s.jsx(ue,{path:"json",element:s.jsx(Cge,{})})]}),s.jsxs(ue,{path:"/:resourceType/:id",element:s.jsx(jge,{}),children:[s.jsx(ue,{index:!0,element:s.jsx(RC,{})}),s.jsx(ue,{path:"apply",element:s.jsx(Wme,{})}),s.jsx(ue,{path:"apps",element:s.jsx(Hme,{})}),s.jsx(ue,{path:"event",element:s.jsx(Gme,{})}),s.jsx(ue,{path:"blame",element:s.jsx(Qme,{})}),s.jsx(ue,{path:"bots",element:s.jsx(uge,{})}),s.jsx(ue,{path:"builder",element:s.jsx(rge,{})}),s.jsx(ue,{path:"checklist",element:s.jsx(nge,{})}),s.jsx(ue,{path:"delete",element:s.jsx(oge,{})}),s.jsx(ue,{path:"details",element:s.jsx(age,{})}),s.jsx(ue,{path:"edit",element:s.jsx(ige,{})}),s.jsx(ue,{path:"editor",element:s.jsx(ege,{})}),s.jsx(ue,{path:"history",element:s.jsx(sge,{})}),s.jsx(ue,{path:"json",element:s.jsx(lge,{})}),s.jsx(ue,{path:"preview",element:s.jsx(cge,{})}),s.jsx(ue,{path:"responses",element:s.jsx(fge,{})}),s.jsx(ue,{path:"report",element:s.jsx(hge,{})}),s.jsx(ue,{path:"ranges",element:s.jsx(pge,{})}),s.jsx(ue,{path:"subscriptions",element:s.jsx(Oge,{})}),s.jsx(ue,{path:"timeline",element:s.jsx(RC,{})})]}),s.jsx(ue,{path:"/:resourceType",element:s.jsx(OC,{})}),s.jsx(ue,{path:"/",element:s.jsx(OC,{})})]})})}function $ge(){const e=ie(),t=e.getUserConfiguration(),r=va(),[n]=G1();return e.isLoading()?s.jsx(kn,{}):s.jsx(Ale,{logo:s.jsx(Tn,{size:24}),pathname:r.pathname,searchParams:n,version:Gie,menus:kge(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(f.Suspense,{fallback:s.jsx(kn,{}),children:s.jsx(Ege,{})})})}function kge(e){var r;const t=((r=e==null?void 0:e.menu)==null?void 0:r.map(n=>{var o;return{title:n.title,links:((o=n.link)==null?void 0:o.map(a=>({label:a.name,href:a.target,icon:Rge(a.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(Vse,{})}]}),t}const IC={Patient:tle,Practitioner:Lse,Organization:Ose,ServiceRequest:Yse,DiagnosticReport:Jse,Questionnaire:Mse,admin:Sse,AccessPolicy:Fse,Subscription:ole,batch:Hse,Observation:Wse};function Rge(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in IC){const r=IC[t];return s.jsx(r,{})}}catch{}return s.jsx(tm,{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 Tge(){const e=Mc(),t=new rse({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))}}),r={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:500,lineHeight:2}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},n=Spe([{path:"*",element:s.jsx($ge,{})}]),o=i=>n.navigate(i);F4(document.getElementById("root")).render(s.jsx(S.StrictMode,{children:s.jsx(ose,{medplum:t,navigate:o,children:s.jsxs(SE,{theme:r,withGlobalStyles:!0,withNormalizeCSS:!0,children:[s.jsx(ui,{position:"bottom-right"}),s.jsx(vpe,{router:n})]})})}))}Tge().catch(console.error);
235
+ //# sourceMappingURL=index-705b710f.js.map