@medplum/app 2.1.0 → 2.1.1
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,244 @@
|
|
|
1
|
+
function R3(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 Zv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var XO={exports:{}},Jp={},JO={exports:{}},Te={};/**
|
|
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 Ys=Symbol.for("react.element"),T3=Symbol.for("react.portal"),I3=Symbol.for("react.fragment"),D3=Symbol.for("react.strict_mode"),N3=Symbol.for("react.profiler"),A3=Symbol.for("react.provider"),M3=Symbol.for("react.context"),z3=Symbol.for("react.forward_ref"),L3=Symbol.for("react.suspense"),F3=Symbol.for("react.memo"),V3=Symbol.for("react.lazy"),k1=Symbol.iterator;function B3(e){return e===null||typeof e!="object"?null:(e=k1&&e[k1]||e["@@iterator"],typeof e=="function"?e:null)}var ZO={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},e$=Object.assign,t$={};function hl(e,t,r){this.props=e,this.context=t,this.refs=t$,this.updater=r||ZO}hl.prototype.isReactComponent={};hl.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")};hl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function r$(){}r$.prototype=hl.prototype;function ey(e,t,r){this.props=e,this.context=t,this.refs=t$,this.updater=r||ZO}var ty=ey.prototype=new r$;ty.constructor=ey;e$(ty,hl.prototype);ty.isPureReactComponent=!0;var j1=Array.isArray,n$=Object.prototype.hasOwnProperty,ry={current:null},o$={key:!0,ref:!0,__self:!0,__source:!0};function a$(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)n$.call(t,n)&&!o$.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:Ys,type:e,key:a,ref:i,props:o,_owner:ry.current}}function U3(e,t){return{$$typeof:Ys,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ny(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ys}function W3(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(r){return t[r]})}var R1=/\/+/g;function sh(e,t){return typeof e=="object"&&e!==null&&e.key!=null?W3(""+e.key):t.toString(36)}function ju(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 Ys:case T3:i=!0}}if(i)return i=e,o=o(i),e=n===""?"."+sh(i,0):n,j1(o)?(r="",e!=null&&(r=e.replace(R1,"$&/")+"/"),ju(o,t,r,"",function(u){return u})):o!=null&&(ny(o)&&(o=U3(o,r+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(R1,"$&/")+"/")+e)),t.push(o)),1;if(i=0,n=n===""?".":n+":",j1(e))for(var l=0;l<e.length;l++){a=e[l];var c=n+sh(a,l);i+=ju(a,t,r,c,o)}else if(c=B3(e),typeof c=="function")for(e=c.call(e),l=0;!(a=e.next()).done;)a=a.value,c=n+sh(a,l++),i+=ju(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 Tc(e,t,r){if(e==null)return e;var n=[],o=0;return ju(e,n,"","",function(a){return t.call(r,a,o++)}),n}function H3(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 ur={current:null},Ru={transition:null},q3={ReactCurrentDispatcher:ur,ReactCurrentBatchConfig:Ru,ReactCurrentOwner:ry};Te.Children={map:Tc,forEach:function(e,t,r){Tc(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return Tc(e,function(){t++}),t},toArray:function(e){return Tc(e,function(t){return t})||[]},only:function(e){if(!ny(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Te.Component=hl;Te.Fragment=I3;Te.Profiler=N3;Te.PureComponent=ey;Te.StrictMode=D3;Te.Suspense=L3;Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=q3;Te.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=e$({},e.props),o=e.key,a=e.ref,i=e._owner;if(t!=null){if(t.ref!==void 0&&(a=t.ref,i=ry.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)n$.call(t,c)&&!o$.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:Ys,type:e.type,key:o,ref:a,props:n,_owner:i}};Te.createContext=function(e){return e={$$typeof:M3,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:A3,_context:e},e.Consumer=e};Te.createElement=a$;Te.createFactory=function(e){var t=a$.bind(null,e);return t.type=e,t};Te.createRef=function(){return{current:null}};Te.forwardRef=function(e){return{$$typeof:z3,render:e}};Te.isValidElement=ny;Te.lazy=function(e){return{$$typeof:V3,_payload:{_status:-1,_result:e},_init:H3}};Te.memo=function(e,t){return{$$typeof:F3,type:e,compare:t===void 0?null:t}};Te.startTransition=function(e){var t=Ru.transition;Ru.transition={};try{e()}finally{Ru.transition=t}};Te.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Te.useCallback=function(e,t){return ur.current.useCallback(e,t)};Te.useContext=function(e){return ur.current.useContext(e)};Te.useDebugValue=function(){};Te.useDeferredValue=function(e){return ur.current.useDeferredValue(e)};Te.useEffect=function(e,t){return ur.current.useEffect(e,t)};Te.useId=function(){return ur.current.useId()};Te.useImperativeHandle=function(e,t,r){return ur.current.useImperativeHandle(e,t,r)};Te.useInsertionEffect=function(e,t){return ur.current.useInsertionEffect(e,t)};Te.useLayoutEffect=function(e,t){return ur.current.useLayoutEffect(e,t)};Te.useMemo=function(e,t){return ur.current.useMemo(e,t)};Te.useReducer=function(e,t,r){return ur.current.useReducer(e,t,r)};Te.useRef=function(e){return ur.current.useRef(e)};Te.useState=function(e){return ur.current.useState(e)};Te.useSyncExternalStore=function(e,t,r){return ur.current.useSyncExternalStore(e,t,r)};Te.useTransition=function(){return ur.current.useTransition()};Te.version="18.2.0";JO.exports=Te;var f=JO.exports;const s=Zv(f),Ss=R3({__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 G3=f,Q3=Symbol.for("react.element"),K3=Symbol.for("react.fragment"),Y3=Object.prototype.hasOwnProperty,X3=G3.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,J3={key:!0,ref:!0,__self:!0,__source:!0};function i$(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)Y3.call(t,n)&&!J3.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:Q3,type:e,key:a,ref:i,props:o,_owner:X3.current}}Jp.Fragment=K3;Jp.jsx=i$;Jp.jsxs=i$;XO.exports=Jp;var m=XO.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 l$(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 gl(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 vl(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 T1(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 yg(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 Tu="right-scroll-bar-position",Iu="width-before-scroll-bar",Z3="with-scroll-bars-hidden",e4="--removed-body-scroll-bar-size";function t4(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function r4(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 n4(e,t){return r4(t||null,function(r){return e.forEach(function(n){return t4(n,r)})})}function o4(e){return e}function a4(e,t){t===void 0&&(t=o4);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 i4(e){e===void 0&&(e={});var t=a4(null);return t.options=Un({async:!0,ssr:!1},e),t}var s$=function(e){var t=e.sideCar,r=l$(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))};s$.isSideCarExport=!0;function l4(e,t){return e.useMedium(t),s$}var c$=i4(),ch=function(){},Zp=f.forwardRef(function(e,t){var r=f.useRef(null),n=f.useState({onScrollCapture:ch,onWheelCapture:ch,onTouchMoveCapture:ch}),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,g=e.noIsolation,v=e.inert,w=e.allowPinchZoom,E=e.as,_=E===void 0?"div":E,y=e.gapMode,x=l$(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,S=n4([r,t]),$=Un(Un({},x),o);return f.createElement(f.Fragment,null,d&&f.createElement(b,{sideCar:c$,removeScrollBar:u,shards:p,noIsolation:g,inert:v,setCallbacks:a,allowPinchZoom:!!w,lockRef:r,gapMode:y}),i?f.cloneElement(f.Children.only(l),Un(Un({},$),{ref:S})):f.createElement(_,Un({},$,{className:c,ref:S}),l))});Zp.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Zp.classNames={fullWidth:Iu,zeroRight:Tu};var I1,s4=function(){if(I1)return I1;if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function c4(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=s4();return t&&e.setAttribute("nonce",t),e}function u4(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function d4(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var f4=function(){var e=0,t=null;return{add:function(r){e==0&&(t=c4())&&(u4(t,r),d4(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},p4=function(){var e=f4();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},u$=function(){var e=p4(),t=function(r){var n=r.styles,o=r.dynamic;return e(n,o),null};return t},m4={left:0,top:0,right:0,gap:0},uh=function(e){return parseInt(e||"",10)||0},h4=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[uh(r),uh(n),uh(o)]},g4=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return m4;var t=h4(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])}},v4=u$(),y4=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(Z3,` {
|
|
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(Tu,` {
|
|
36
|
+
right: `).concat(l,"px ").concat(n,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(Iu,` {
|
|
40
|
+
margin-right: `).concat(l,"px ").concat(n,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(Tu," .").concat(Tu,` {
|
|
44
|
+
right: 0 `).concat(n,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(Iu," .").concat(Iu,` {
|
|
48
|
+
margin-right: 0 `).concat(n,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body {
|
|
52
|
+
`).concat(e4,": ").concat(l,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},w4=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=n===void 0?"margin":n,a=f.useMemo(function(){return g4(o)},[o]);return f.createElement(v4,{styles:y4(a,!t,o,r?"":"!important")})},wg=!1;if(typeof window<"u")try{var Ic=Object.defineProperty({},"passive",{get:function(){return wg=!0,!0}});window.addEventListener("test",Ic,Ic),window.removeEventListener("test",Ic,Ic)}catch{wg=!1}var hi=wg?{passive:!1}:!1,_4=function(e){return e.tagName==="TEXTAREA"},d$=function(e,t){var r=window.getComputedStyle(e);return r[t]!=="hidden"&&!(r.overflowY===r.overflowX&&!_4(e)&&r[t]==="visible")},b4=function(e){return d$(e,"overflowY")},x4=function(e){return d$(e,"overflowX")},D1=function(e,t){var r=t.ownerDocument,n=t;do{typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host);var o=f$(e,n);if(o){var a=p$(e,n),i=a[1],l=a[2];if(i>l)return!0}n=n.parentNode}while(n&&n!==r.body);return!1},E4=function(e){var t=e.scrollTop,r=e.scrollHeight,n=e.clientHeight;return[t,r,n]},S4=function(e){var t=e.scrollLeft,r=e.scrollWidth,n=e.clientWidth;return[t,r,n]},f$=function(e,t){return e==="v"?b4(t):x4(t)},p$=function(e,t){return e==="v"?E4(t):S4(t)},P4=function(e,t){return e==="h"&&t==="rtl"?-1:1},O4=function(e,t,r,n,o){var a=P4(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 g=p$(e,l),v=g[0],w=g[1],E=g[2],_=w-E-a*v;(v||_)&&f$(e,l)&&(p+=_,h+=v),l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(o&&p===0||!o&&i>p)||!d&&(o&&h===0||!o&&-i>h))&&(u=!0),u},Dc=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},N1=function(e){return[e.deltaX,e.deltaY]},A1=function(e){return e&&"current"in e?e.current:e},$4=function(e,t){return e[0]===t[0]&&e[1]===t[1]},C4=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},k4=0,gi=[];function j4(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(k4++)[0],a=f.useState(u$)[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 w=yg([e.lockRef.current],(e.shards||[]).map(A1),!0).filter(Boolean);return w.forEach(function(E){return E.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),w.forEach(function(E){return E.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=f.useCallback(function(w,E){if("touches"in w&&w.touches.length===2)return!i.current.allowPinchZoom;var _=Dc(w),y=r.current,x="deltaX"in w?w.deltaX:y[0]-_[0],b="deltaY"in w?w.deltaY:y[1]-_[1],S,$=w.target,O=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in w&&O==="h"&&$.type==="range")return!1;var C=D1(O,$);if(!C)return!0;if(C?S=O:(S=O==="v"?"h":"v",C=D1(O,$)),!C)return!1;if(!n.current&&"changedTouches"in w&&(x||b)&&(n.current=S),!S)return!0;var T=n.current||S;return O4(T,E,w,T==="h"?x:b,!0)},[]),c=f.useCallback(function(w){var E=w;if(!(!gi.length||gi[gi.length-1]!==a)){var _="deltaY"in E?N1(E):Dc(E),y=t.current.filter(function(S){return S.name===E.type&&S.target===E.target&&$4(S.delta,_)})[0];if(y&&y.should){E.cancelable&&E.preventDefault();return}if(!y){var x=(i.current.shards||[]).map(A1).filter(Boolean).filter(function(S){return S.contains(E.target)}),b=x.length>0?l(E,x[0]):!i.current.noIsolation;b&&E.cancelable&&E.preventDefault()}}},[]),u=f.useCallback(function(w,E,_,y){var x={name:w,delta:E,target:_,should:y};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),d=f.useCallback(function(w){r.current=Dc(w),n.current=void 0},[]),p=f.useCallback(function(w){u(w.type,N1(w),w.target,l(w,e.lockRef.current))},[]),h=f.useCallback(function(w){u(w.type,Dc(w),w.target,l(w,e.lockRef.current))},[]);f.useEffect(function(){return gi.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,hi),document.addEventListener("touchmove",c,hi),document.addEventListener("touchstart",d,hi),function(){gi=gi.filter(function(w){return w!==a}),document.removeEventListener("wheel",c,hi),document.removeEventListener("touchmove",c,hi),document.removeEventListener("touchstart",d,hi)}},[]);var g=e.removeScrollBar,v=e.inert;return f.createElement(f.Fragment,null,v?f.createElement(a,{styles:C4(o)}):null,g?f.createElement(w4,{gapMode:e.gapMode}):null)}const R4=l4(c$,j4);var m$=f.forwardRef(function(e,t){return f.createElement(Zp,Un({},e,{ref:t,sideCar:R4}))});m$.classNames=Zp.classNames;const T4=m$;function td(e,t){let r=e;for(;(r=r.parentElement)&&!r.matches(t););return r}function I4(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 D4(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 N4(e,t,r){return td(e,r)===td(t,r)}function h$({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=td(l.currentTarget,e))==null?void 0:c.querySelectorAll(t))||[]).filter(w=>N4(l.currentTarget,w,e)),d=u.findIndex(w=>l.currentTarget===w),p=D4(d,u,n),h=I4(d,u,n),g=a==="rtl"?h:p,v=a==="rtl"?p:h;switch(l.key){case"ArrowRight":{i==="horizontal"&&(l.stopPropagation(),l.preventDefault(),u[g].focus(),o&&u[g].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 w=u.length-1;!u[w].disabled&&u[w].focus();break}}}}function A4(e,t,r){var n;return r?Array.from(((n=td(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 em(e){return Array.isArray(e)?e:[e]}function M1(e,t){return r=>{if(typeof r!="string"||r.trim().length===0)throw new Error(t);return`${e}-${r}`}}const M4=()=>{};function z4(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||M4:r=>{var n;r.key==="Escape"&&(e(r),(n=t.onTrigger)==null||n.call(t))}}function Ar(e,t){return r=>{e==null||e(r),t==null||t(r)}}function L4(){const[e,t]=f.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function F4({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 V4(e,t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}const B4=typeof window<"u"?f.useLayoutEffect:f.useEffect;function U4(e){function t(n){const o=Object.keys(n).reduce((a,i)=>(a[`${e}:${i}`]=l=>n[i](l.detail),a),{});B4(()=>(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)=>V4(`${e}:${String(n)}`,o[0])}return[t,r]}function yl(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==s.Fragment:!1}function g$(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=g$(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function v$(){for(var e=0,t,r,n="";e<arguments.length;)(t=arguments[e++])&&(r=g$(t))&&(n&&(n+=" "),n+=r);return n}const W4={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 H4(e){return()=>({fontFamily:e.fontFamily||"sans-serif"})}var q4=Object.defineProperty,z1=Object.getOwnPropertySymbols,G4=Object.prototype.hasOwnProperty,Q4=Object.prototype.propertyIsEnumerable,L1=(e,t,r)=>t in e?q4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,F1=(e,t)=>{for(var r in t||(t={}))G4.call(t,r)&&L1(e,r,t[r]);if(z1)for(var r of z1(t))Q4.call(t,r)&&L1(e,r,t[r]);return e};function K4(e){return t=>({WebkitTapHighlightColor:"transparent",[t||"&:focus"]:F1({},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)"]:F1({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)})}function Xs(e){return t=>typeof e.primaryShade=="number"?e.primaryShade:e.primaryShade[t||e.colorScheme]}function oy(e){const t=Xs(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 y$(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 Y4(e,...t){return`linear-gradient(${e}deg, ${y$(t)})`}function X4(...e){return`radial-gradient(circle, ${y$(e)})`}function w$(e){const t=oy(e),r=Xs(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 _$(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=_$("rem"),ir=_$("em");function M({size:e,sizes:t,units:r}){return e in t?t[e]:typeof e=="number"?r==="em"?ir(e):P(e):e||t.md}function ln(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 J4(e){return t=>`@media (min-width: ${ir(ln(M({size:t,sizes:e.breakpoints})))})`}function Z4(e){return t=>`@media (max-width: ${ir(ln(M({size:t,sizes:e.breakpoints}))-1)})`}function eA(e){return/^#?([0-9A-F]{3}){1,2}$/i.test(e)}function tA(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 rA(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 ay(e){return eA(e)?tA(e):e.startsWith("rgb")?rA(e):{r:0,g:0,b:0,a:1}}function Pi(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}=ay(e);return`rgba(${r}, ${n}, ${o}, ${t})`}function nA(e=0){return{position:"absolute",top:P(e),right:P(e),left:P(e),bottom:P(e)}}function oA(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a}=ay(e),i=1-t,l=c=>Math.round(c*i);return`rgba(${l(r)}, ${l(n)}, ${l(o)}, ${a})`}function aA(e,t){if(typeof e=="string"&&e.startsWith("var(--"))return e;const{r,g:n,b:o,a}=ay(e),i=l=>Math.round(l+(255-l)*t);return`rgba(${i(r)}, ${i(n)}, ${i(o)}, ${a})`}function iA(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 lA(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 sA(e){const t=oy(e),r=Xs(e),n=w$(e);return({variant:o,color:a,gradient:i,primaryFallback:l})=>{const c=lA(a,e);switch(o){case"light":return{border:"transparent",background:Pi(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:Pi(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:Pi(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"?Pi(t(a,5,l,!1),.05):Pi(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 cA(e){return t=>{const r=Xs(e)(t);return e.colors[e.primaryColor][r]}}function uA(e){return{"@media (hover: hover)":{"&:hover":e},"@media (hover: none)":{"&:active":e}}}function dA(e){return()=>({userSelect:"none",color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]})}function fA(e){return()=>e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6]}const It={fontStyles:H4,themeColor:oy,focusStyles:K4,linearGradient:Y4,radialGradient:X4,smallerThan:Z4,largerThan:J4,rgba:Pi,cover:nA,darken:oA,lighten:aA,radius:iA,variant:sA,primaryShade:Xs,hover:uA,gradient:w$,primaryColor:cA,placeholderStyles:dA,dimmed:fA};var pA=Object.defineProperty,mA=Object.defineProperties,hA=Object.getOwnPropertyDescriptors,V1=Object.getOwnPropertySymbols,gA=Object.prototype.hasOwnProperty,vA=Object.prototype.propertyIsEnumerable,B1=(e,t,r)=>t in e?pA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yA=(e,t)=>{for(var r in t||(t={}))gA.call(t,r)&&B1(e,r,t[r]);if(V1)for(var r of V1(t))vA.call(t,r)&&B1(e,r,t[r]);return e},wA=(e,t)=>mA(e,hA(t));function b$(e){return wA(yA({},e),{fn:{fontStyles:It.fontStyles(e),themeColor:It.themeColor(e),focusStyles:It.focusStyles(e),largerThan:It.largerThan(e),smallerThan:It.smallerThan(e),radialGradient:It.radialGradient,linearGradient:It.linearGradient,gradient:It.gradient(e),rgba:It.rgba,cover:It.cover,lighten:It.lighten,darken:It.darken,primaryShade:It.primaryShade(e),radius:It.radius(e),variant:It.variant(e),hover:It.hover,primaryColor:It.primaryColor(e),placeholderStyles:It.placeholderStyles(e),dimmed:It.dimmed(e)}})}const x$=["xs","sm","md","lg","xl"],_A={dir:"ltr",primaryShade:{light:6,dark:8},focusRing:"auto",loader:"oval",colorScheme:"light",white:"#fff",black:"#000",defaultRadius:"sm",transitionTimingFunction:"ease",colors:W4,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]})}},iy=b$(_A);function bA(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 xA(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 EA=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(xA(this));var o=this.tags[this.tags.length-1];if(this.isSpeedy){var a=bA(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}(),Yt="-ms-",rd="-moz-",Le="-webkit-",E$="comm",ly="rule",sy="decl",SA="@import",S$="@keyframes",PA="@layer",OA=Math.abs,tm=String.fromCharCode,$A=Object.assign;function CA(e,t){return Wt(e,0)^45?(((t<<2^Wt(e,0))<<2^Wt(e,1))<<2^Wt(e,2))<<2^Wt(e,3):0}function P$(e){return e.trim()}function kA(e,t){return(e=t.exec(e))?e[0]:e}function Ve(e,t,r){return e.replace(t,r)}function _g(e,t){return e.indexOf(t)}function Wt(e,t){return e.charCodeAt(t)|0}function Ps(e,t,r){return e.slice(t,r)}function Fn(e){return e.length}function cy(e){return e.length}function Nc(e,t){return t.push(e),e}function jA(e,t){return e.map(t).join("")}var rm=1,tl=1,O$=0,Er=0,jt=0,wl="";function nm(e,t,r,n,o,a,i){return{value:e,root:t,parent:r,type:n,props:o,children:a,line:rm,column:tl,length:i,return:""}}function Tl(e,t){return $A(nm("",null,null,"",null,null,0),e,{length:-e.length},t)}function RA(){return jt}function TA(){return jt=Er>0?Wt(wl,--Er):0,tl--,jt===10&&(tl=1,rm--),jt}function zr(){return jt=Er<O$?Wt(wl,Er++):0,tl++,jt===10&&(tl=1,rm++),jt}function qn(){return Wt(wl,Er)}function Du(){return Er}function Js(e,t){return Ps(wl,e,t)}function Os(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 $$(e){return rm=tl=1,O$=Fn(wl=e),Er=0,[]}function C$(e){return wl="",e}function Nu(e){return P$(Js(Er-1,bg(e===91?e+2:e===40?e+1:e)))}function IA(e){for(;(jt=qn())&&jt<33;)zr();return Os(e)>2||Os(jt)>3?"":" "}function DA(e,t){for(;--t&&zr()&&!(jt<48||jt>102||jt>57&&jt<65||jt>70&&jt<97););return Js(e,Du()+(t<6&&qn()==32&&zr()==32))}function bg(e){for(;zr();)switch(jt){case e:return Er;case 34:case 39:e!==34&&e!==39&&bg(jt);break;case 40:e===41&&bg(e);break;case 92:zr();break}return Er}function NA(e,t){for(;zr()&&e+jt!==47+10;)if(e+jt===42+42&&qn()===47)break;return"/*"+Js(t,Er-1)+"*"+tm(e===47?e:zr())}function AA(e){for(;!Os(qn());)zr();return Js(e,Er)}function MA(e){return C$(Au("",null,null,null,[""],e=$$(e),0,[0],e))}function Au(e,t,r,n,o,a,i,l,c){for(var u=0,d=0,p=i,h=0,g=0,v=0,w=1,E=1,_=1,y=0,x="",b=o,S=a,$=n,O=x;E;)switch(v=y,y=zr()){case 40:if(v!=108&&Wt(O,p-1)==58){_g(O+=Ve(Nu(y),"&","&\f"),"&\f")!=-1&&(_=-1);break}case 34:case 39:case 91:O+=Nu(y);break;case 9:case 10:case 13:case 32:O+=IA(v);break;case 92:O+=DA(Du()-1,7);continue;case 47:switch(qn()){case 42:case 47:Nc(zA(NA(zr(),Du()),t,r),c);break;default:O+="/"}break;case 123*w:l[u++]=Fn(O)*_;case 125*w:case 59:case 0:switch(y){case 0:case 125:E=0;case 59+d:_==-1&&(O=Ve(O,/\f/g,"")),g>0&&Fn(O)-p&&Nc(g>32?W1(O+";",n,r,p-1):W1(Ve(O," ","")+";",n,r,p-2),c);break;case 59:O+=";";default:if(Nc($=U1(O,t,r,u,d,o,l,x,b=[],S=[],p),a),y===123)if(d===0)Au(O,t,$,$,b,a,p,l,S);else switch(h===99&&Wt(O,3)===110?100:h){case 100:case 108:case 109:case 115:Au(e,$,$,n&&Nc(U1(e,$,$,0,0,o,l,x,o,b=[],p),S),o,S,p,l,n?b:S);break;default:Au(O,$,$,$,[""],S,0,l,S)}}u=d=g=0,w=_=1,x=O="",p=i;break;case 58:p=1+Fn(O),g=v;default:if(w<1){if(y==123)--w;else if(y==125&&w++==0&&TA()==125)continue}switch(O+=tm(y),y*w){case 38:_=d>0?1:(O+="\f",-1);break;case 44:l[u++]=(Fn(O)-1)*_,_=1;break;case 64:qn()===45&&(O+=Nu(zr())),h=qn(),d=p=Fn(x=O+=AA(Du())),y++;break;case 45:v===45&&Fn(O)==2&&(w=0)}}return a}function U1(e,t,r,n,o,a,i,l,c,u,d){for(var p=o-1,h=o===0?a:[""],g=cy(h),v=0,w=0,E=0;v<n;++v)for(var _=0,y=Ps(e,p+1,p=OA(w=i[v])),x=e;_<g;++_)(x=P$(w>0?h[_]+" "+y:Ve(y,/&\f/g,h[_])))&&(c[E++]=x);return nm(e,t,r,o===0?ly:l,c,u,d)}function zA(e,t,r){return nm(e,t,r,E$,tm(RA()),Ps(e,2,-2),0)}function W1(e,t,r,n){return nm(e,t,r,sy,Ps(e,0,n),Ps(e,n+1,-1),n)}function Wi(e,t){for(var r="",n=cy(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function LA(e,t,r,n){switch(e.type){case PA:if(e.children.length)break;case SA:case sy:return e.return=e.return||e.value;case E$:return"";case S$:return e.return=e.value+"{"+Wi(e.children,n)+"}";case ly:e.value=e.props.join(",")}return Fn(r=Wi(e.children,n))?e.return=e.value+"{"+r+"}":""}function FA(e){var t=cy(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 VA(e){return function(t){t.root||(t=t.return)&&e(t)}}var H1=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 BA(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var UA=function(t,r,n){for(var o=0,a=0;o=a,a=qn(),o===38&&a===12&&(r[n]=1),!Os(a);)zr();return Js(t,Er)},WA=function(t,r){var n=-1,o=44;do switch(Os(o)){case 0:o===38&&qn()===12&&(r[n]=1),t[n]+=UA(Er-1,r,n);break;case 2:t[n]+=Nu(o);break;case 4:if(o===44){t[++n]=qn()===58?"&\f":"",r[n]=t[n].length;break}default:t[n]+=tm(o)}while(o=zr());return t},HA=function(t,r){return C$(WA($$(t),r))},q1=new WeakMap,qA=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&&!q1.get(n))&&!o){q1.set(t,!0);for(var a=[],i=HA(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]}}},GA=function(t){if(t.type==="decl"){var r=t.value;r.charCodeAt(0)===108&&r.charCodeAt(2)===98&&(t.return="",t.value="")}};function k$(e,t){switch(CA(e,t)){case 5103:return Le+"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 Le+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Le+e+rd+e+Yt+e+e;case 6828:case 4268:return Le+e+Yt+e+e;case 6165:return Le+e+Yt+"flex-"+e+e;case 5187:return Le+e+Ve(e,/(\w+).+(:[^]+)/,Le+"box-$1$2"+Yt+"flex-$1$2")+e;case 5443:return Le+e+Yt+"flex-item-"+Ve(e,/flex-|-self/,"")+e;case 4675:return Le+e+Yt+"flex-line-pack"+Ve(e,/align-content|flex-|-self/,"")+e;case 5548:return Le+e+Yt+Ve(e,"shrink","negative")+e;case 5292:return Le+e+Yt+Ve(e,"basis","preferred-size")+e;case 6060:return Le+"box-"+Ve(e,"-grow","")+Le+e+Yt+Ve(e,"grow","positive")+e;case 4554:return Le+Ve(e,/([^-])(transform)/g,"$1"+Le+"$2")+e;case 6187:return Ve(Ve(Ve(e,/(zoom-|grab)/,Le+"$1"),/(image-set)/,Le+"$1"),e,"")+e;case 5495:case 3959:return Ve(e,/(image-set\([^]*)/,Le+"$1$`$1");case 4968:return Ve(Ve(e,/(.+:)(flex-)?(.*)/,Le+"box-pack:$3"+Yt+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Le+e+e;case 4095:case 3583:case 4068:case 2532:return Ve(e,/(.+)-inline(.+)/,Le+"$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(Fn(e)-1-t>6)switch(Wt(e,t+1)){case 109:if(Wt(e,t+4)!==45)break;case 102:return Ve(e,/(.+:)(.+)-([^]+)/,"$1"+Le+"$2-$3$1"+rd+(Wt(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~_g(e,"stretch")?k$(Ve(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Wt(e,t+1)!==115)break;case 6444:switch(Wt(e,Fn(e)-3-(~_g(e,"!important")&&10))){case 107:return Ve(e,":",":"+Le)+e;case 101:return Ve(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Le+(Wt(e,14)===45?"inline-":"")+"box$3$1"+Le+"$2$3$1"+Yt+"$2box$3")+e}break;case 5936:switch(Wt(e,t+11)){case 114:return Le+e+Yt+Ve(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Le+e+Yt+Ve(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Le+e+Yt+Ve(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Le+e+Yt+e+e}return e}var QA=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case sy:t.return=k$(t.value,t.length);break;case S$:return Wi([Tl(t,{value:Ve(t.value,"@","@"+Le)})],o);case ly:if(t.length)return jA(t.props,function(a){switch(kA(a,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Wi([Tl(t,{props:[Ve(a,/:(read-\w+)/,":"+rd+"$1")]})],o);case"::placeholder":return Wi([Tl(t,{props:[Ve(a,/:(plac\w+)/,":"+Le+"input-$1")]}),Tl(t,{props:[Ve(a,/:(plac\w+)/,":"+rd+"$1")]}),Tl(t,{props:[Ve(a,/:(plac\w+)/,Yt+"input-$1")]})],o)}return""})}},KA=[QA],j$=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(w){var E=w.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var o=t.stylisPlugins||KA,a={},i,l=[];i=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(w){for(var E=w.getAttribute("data-emotion").split(" "),_=1;_<E.length;_++)a[E[_]]=!0;l.push(w)});var c,u=[qA,GA];{var d,p=[LA,VA(function(w){d.insert(w)})],h=FA(u.concat(o,p)),g=function(E){return Wi(MA(E),h)};c=function(E,_,y,x){d=y,g(E?E+"{"+_.styles+"}":_.styles),x&&(v.inserted[_.name]=!0)}}var v={key:r,sheet:new EA({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 Je(){return Je=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},Je.apply(this,arguments)}var R$={exports:{}},We={};/** @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 Vt=typeof Symbol=="function"&&Symbol.for,uy=Vt?Symbol.for("react.element"):60103,dy=Vt?Symbol.for("react.portal"):60106,om=Vt?Symbol.for("react.fragment"):60107,am=Vt?Symbol.for("react.strict_mode"):60108,im=Vt?Symbol.for("react.profiler"):60114,lm=Vt?Symbol.for("react.provider"):60109,sm=Vt?Symbol.for("react.context"):60110,fy=Vt?Symbol.for("react.async_mode"):60111,cm=Vt?Symbol.for("react.concurrent_mode"):60111,um=Vt?Symbol.for("react.forward_ref"):60112,dm=Vt?Symbol.for("react.suspense"):60113,YA=Vt?Symbol.for("react.suspense_list"):60120,fm=Vt?Symbol.for("react.memo"):60115,pm=Vt?Symbol.for("react.lazy"):60116,XA=Vt?Symbol.for("react.block"):60121,JA=Vt?Symbol.for("react.fundamental"):60117,ZA=Vt?Symbol.for("react.responder"):60118,eM=Vt?Symbol.for("react.scope"):60119;function Br(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case uy:switch(e=e.type,e){case fy:case cm:case om:case im:case am:case dm:return e;default:switch(e=e&&e.$$typeof,e){case sm:case um:case pm:case fm:case lm:return e;default:return t}}case dy:return t}}}function T$(e){return Br(e)===cm}We.AsyncMode=fy;We.ConcurrentMode=cm;We.ContextConsumer=sm;We.ContextProvider=lm;We.Element=uy;We.ForwardRef=um;We.Fragment=om;We.Lazy=pm;We.Memo=fm;We.Portal=dy;We.Profiler=im;We.StrictMode=am;We.Suspense=dm;We.isAsyncMode=function(e){return T$(e)||Br(e)===fy};We.isConcurrentMode=T$;We.isContextConsumer=function(e){return Br(e)===sm};We.isContextProvider=function(e){return Br(e)===lm};We.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===uy};We.isForwardRef=function(e){return Br(e)===um};We.isFragment=function(e){return Br(e)===om};We.isLazy=function(e){return Br(e)===pm};We.isMemo=function(e){return Br(e)===fm};We.isPortal=function(e){return Br(e)===dy};We.isProfiler=function(e){return Br(e)===im};We.isStrictMode=function(e){return Br(e)===am};We.isSuspense=function(e){return Br(e)===dm};We.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===om||e===cm||e===im||e===am||e===dm||e===YA||typeof e=="object"&&e!==null&&(e.$$typeof===pm||e.$$typeof===fm||e.$$typeof===lm||e.$$typeof===sm||e.$$typeof===um||e.$$typeof===JA||e.$$typeof===ZA||e.$$typeof===eM||e.$$typeof===XA)};We.typeOf=Br;R$.exports=We;var tM=R$.exports,I$=tM,rM={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},nM={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},D$={};D$[I$.ForwardRef]=rM;D$[I$.Memo]=nM;var oM=!0;function aM(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):n+=o+" "}),n}var iM=function(t,r,n){var o=t.key+"-"+r.name;(n===!1||oM===!1)&&t.registered[o]===void 0&&(t.registered[o]=r.styles)},N$=function(t,r,n){iM(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 lM(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 sM={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},cM=/[A-Z]|^ms/g,uM=/_EMO_([^_]+?)_([^]*?)_EMO_/g,A$=function(t){return t.charCodeAt(1)===45},G1=function(t){return t!=null&&typeof t!="boolean"},dh=BA(function(e){return A$(e)?e:e.replace(cM,"-$&").toLowerCase()}),Q1=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(uM,function(n,o,a){return Vn={name:o,styles:a,next:Vn},o})}return sM[t]!==1&&!A$(t)&&typeof r=="number"&&r!==0?r+"px":r};function $s(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 Vn={name:r.name,styles:r.styles,next:Vn},r.name;if(r.styles!==void 0){var n=r.next;if(n!==void 0)for(;n!==void 0;)Vn={name:n.name,styles:n.styles,next:Vn},n=n.next;var o=r.styles+";";return o}return dM(e,t,r)}case"function":{if(e!==void 0){var a=Vn,i=r(e);return Vn=a,$s(e,t,i)}break}}if(t==null)return r;var l=t[r];return l!==void 0?l:r}function dM(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=$s(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]+"}":G1(i)&&(n+=dh(a)+":"+Q1(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++)G1(i[l])&&(n+=dh(a)+":"+Q1(a,i[l])+";");else{var c=$s(e,t,i);switch(a){case"animation":case"animationName":{n+=dh(a)+":"+c+";";break}default:n+=a+"{"+c+"}"}}}return n}var K1=/label:\s*([^\s;\n{]+)\s*(;|$)/g,Vn,py=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="";Vn=void 0;var i=t[0];i==null||i.raw===void 0?(o=!1,a+=$s(n,r,i)):a+=i[0];for(var l=1;l<t.length;l++)a+=$s(n,r,t[l]),o&&(a+=i[l]);K1.lastIndex=0;for(var c="",u;(u=K1.exec(a))!==null;)c+="-"+u[1];var d=lM(a)+c;return{name:d,styles:a,next:Vn}},fM=Ss["useInsertionEffect"]?Ss["useInsertionEffect"]:!1,Y1=fM||f.useLayoutEffect,M$=f.createContext(typeof HTMLElement<"u"?j$({key:"css"}):null);M$.Provider;var pM=function(t){return f.forwardRef(function(r,n){var o=f.useContext(M$);return t(r,o,n)})},xg=f.createContext({}),mM=function(t,r){if(typeof r=="function"){var n=r(t);return n}return Je({},t,r)},hM=H1(function(e){return H1(function(t){return mM(e,t)})}),gM=function(t){var r=f.useContext(xg);return t.theme!==r&&(r=hM(r)(t.theme)),f.createElement(xg.Provider,{value:r},t.children)},Zs=pM(function(e,t){var r=e.styles,n=py([r],void 0,f.useContext(xg)),o=f.useRef();return Y1(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]),Y1(function(){var a=o.current,i=a[0],l=a[1];if(l){a[1]=!1;return}if(n.next!==void 0&&N$(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 vM(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return py(t)}var yM=Object.defineProperty,wM=Object.defineProperties,_M=Object.getOwnPropertyDescriptors,X1=Object.getOwnPropertySymbols,bM=Object.prototype.hasOwnProperty,xM=Object.prototype.propertyIsEnumerable,J1=(e,t,r)=>t in e?yM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,EM=(e,t)=>{for(var r in t||(t={}))bM.call(t,r)&&J1(e,r,t[r]);if(X1)for(var r of X1(t))xM.call(t,r)&&J1(e,r,t[r]);return e},SM=(e,t)=>wM(e,_M(t));function PM({theme:e}){return s.createElement(Zs,{styles:{"*, *::before, *::after":{boxSizing:"border-box"},html:{colorScheme:e.colorScheme==="dark"?"dark":"light"},body:SM(EM({},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 Il(e,t,r,n=P){Object.keys(t).forEach(o=>{e[`--mantine-${r}-${o}`]=n(t[o])})}function OM({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}`};Il(t,e.shadows,"shadow"),Il(t,e.fontSizes,"font-size"),Il(t,e.radius,"radius"),Il(t,e.spacing,"spacing"),Il(t,e.breakpoints,"breakpoints",ir),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(Zs,{styles:{":root":t}})}var $M=Object.defineProperty,CM=Object.defineProperties,kM=Object.getOwnPropertyDescriptors,Z1=Object.getOwnPropertySymbols,jM=Object.prototype.hasOwnProperty,RM=Object.prototype.propertyIsEnumerable,ew=(e,t,r)=>t in e?$M(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dn=(e,t)=>{for(var r in t||(t={}))jM.call(t,r)&&ew(e,r,t[r]);if(Z1)for(var r of Z1(t))RM.call(t,r)&&ew(e,r,t[r]);return e},fh=(e,t)=>CM(e,kM(t));function TM(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]=Dn(Dn({},e.headings.sizes[c]),t.headings.sizes[c]),l),{}):e.headings.sizes;return fh(Dn({},o),{headings:fh(Dn(Dn({},e.headings),t.headings),{sizes:i})})}if(a==="breakpoints"&&t.breakpoints){const i=Dn(Dn({},e.breakpoints),t.breakpoints);return fh(Dn({},o),{breakpoints:Object.fromEntries(Object.entries(i).sort((l,c)=>ln(l[1])-ln(c[1])))})}return o[a]=typeof t[a]=="object"?Dn(Dn({},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 IM(e,t){return b$(TM(e,t))}function z$(e){return Object.keys(e).reduce((t,r)=>(e[r]!==void 0&&(t[r]=e[r]),t),{})}const DM={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 NM(){return s.createElement(Zs,{styles:DM})}var AM=Object.defineProperty,tw=Object.getOwnPropertySymbols,MM=Object.prototype.hasOwnProperty,zM=Object.prototype.propertyIsEnumerable,rw=(e,t,r)=>t in e?AM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,us=(e,t)=>{for(var r in t||(t={}))MM.call(t,r)&&rw(e,r,t[r]);if(tw)for(var r of tw(t))zM.call(t,r)&&rw(e,r,t[r]);return e};const nd=f.createContext({theme:iy});function tr(){var e;return((e=f.useContext(nd))==null?void 0:e.theme)||iy}function LM(e){const t=tr(),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 L$(){var e;return(e=f.useContext(nd))==null?void 0:e.emotionCache}function H(e,t,r){var n;const o=tr(),a=(n=o.components[e])==null?void 0:n.defaultProps,i=typeof a=="function"?a(o):a;return us(us(us({},t),i),z$(r))}function F$({theme:e,emotionCache:t,withNormalizeCSS:r=!1,withGlobalStyles:n=!1,withCSSVariables:o=!1,inherit:a=!1,children:i}){const l=f.useContext(nd),c=IM(iy,a?us(us({},l.theme),e):e);return s.createElement(gM,{theme:c},s.createElement(nd.Provider,{value:{theme:c,emotionCache:t}},r&&s.createElement(NM,null),n&&s.createElement(PM,{theme:c}),o&&s.createElement(OM,{theme:c}),typeof c.globalStyles=="function"&&s.createElement(Zs,{styles:c.globalStyles(c)}),i))}F$.displayName="@mantine/core/MantineProvider";const FM={app:100,modal:200,popover:300,overlay:400,max:9999};function jn(e){return FM[e]}function VM(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 BM=j$({key:"mantine",prepend:!0});function UM(){return L$()||BM}var WM=Object.defineProperty,nw=Object.getOwnPropertySymbols,HM=Object.prototype.hasOwnProperty,qM=Object.prototype.propertyIsEnumerable,ow=(e,t,r)=>t in e?WM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,GM=(e,t)=>{for(var r in t||(t={}))HM.call(t,r)&&ow(e,r,t[r]);if(nw)for(var r of nw(t))qM.call(t,r)&&ow(e,r,t[r]);return e};const ph="ref";function QM(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(!(ph in r))return{args:e,ref:t};t=r[ph];const n=GM({},r);return delete n[ph],{args:[n],ref:t}}const{cssFactory:KM}=(()=>{function e(r,n,o){const a=[],i=aM(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}=QM(i),u=py(c,n.registered);return N$(n,u,!1),`${n.key}-${u.name}${l===void 0?"":` ${l}`}`};return{css:o,cx:(...i)=>e(n.registered,o,v$(i))}}return{cssFactory:t}})();function V$(){const e=UM();return VM(()=>KM({cache:e}),[e])}function YM({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 XM=Object.defineProperty,aw=Object.getOwnPropertySymbols,JM=Object.prototype.hasOwnProperty,ZM=Object.prototype.propertyIsEnumerable,iw=(e,t,r)=>t in e?XM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mh=(e,t)=>{for(var r in t||(t={}))JM.call(t,r)&&iw(e,r,t[r]);if(aw)for(var r of aw(t))ZM.call(t,r)&&iw(e,r,t[r]);return e};function Eg(e,t){return t&&Object.keys(t).forEach(r=>{e[r]?e[r]=mh(mh({},e[r]),t[r]):e[r]=mh({},t[r])}),e}function lw(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)=>Eg(a,i),{}):o(e)}function e6({ctx:e,theme:t,params:r,variant:n,size:o}){return e.reduce((a,i)=>(i.variants&&n in i.variants&&Eg(a,i.variants[n](t,r,{variant:n,size:o})),i.sizes&&o in i.sizes&&Eg(a,i.sizes[o](t,r,{variant:n,size:o})),a),{})}function U(e){const t=typeof e=="function"?e:()=>e;function r(n,o){const a=tr(),i=LM(o==null?void 0:o.name),l=L$(),c={variant:o==null?void 0:o.variant,size:o==null?void 0:o.size},{css:u,cx:d}=V$(),p=t(a,n,c),h=lw(o==null?void 0:o.styles,a,n,c),g=lw(i,a,n,c),v=e6({ctx:i,theme:a,params:n,variant:o==null?void 0:o.variant,size:o==null?void 0:o.size}),w=Object.fromEntries(Object.keys(p).map(E=>{const _=d({[u(p[E])]:!(o!=null&&o.unstyled)},u(v[E]),u(g[E]),u(h[E]));return[E,_]}));return{classes:YM({cx:d,classes:w,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 B$({styles:e}){const t=tr();return s.createElement(Zs,{styles:vM(typeof e=="function"?e(t):e)})}var t6=Object.defineProperty,r6=Object.defineProperties,n6=Object.getOwnPropertyDescriptors,sw=Object.getOwnPropertySymbols,o6=Object.prototype.hasOwnProperty,a6=Object.prototype.propertyIsEnumerable,cw=(e,t,r)=>t in e?t6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Dl=(e,t)=>{for(var r in t||(t={}))o6.call(t,r)&&cw(e,r,t[r]);if(sw)for(var r of sw(t))a6.call(t,r)&&cw(e,r,t[r]);return e},Nl=(e,t)=>r6(e,n6(t));const Al={in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${P(10)})`},transitionProperty:"transform, opacity"},Ac={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:Nl(Dl({},Al),{common:{transformOrigin:"center center"}}),"pop-bottom-left":Nl(Dl({},Al),{common:{transformOrigin:"bottom left"}}),"pop-bottom-right":Nl(Dl({},Al),{common:{transformOrigin:"bottom right"}}),"pop-top-left":Nl(Dl({},Al),{common:{transformOrigin:"top left"}}),"pop-top-right":Nl(Dl({},Al),{common:{transformOrigin:"top right"}})},uw=["mousedown","touchstart"];function i6(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||uw).forEach(a=>document.addEventListener(a,o)),()=>{(t||uw).forEach(a=>document.removeEventListener(a,o))}},[n,e,r]),n}function l6({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 s6(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function c6(e,t){return typeof t=="boolean"?t:typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function u6(e,t,{getInitialValueInEffect:r}={getInitialValueInEffect:!0}){const[n,o]=f.useState(r?t:c6(e,t)),a=f.useRef();return f.useEffect(()=>{if("matchMedia"in window)return a.current=window.matchMedia(e),o(a.current.matches),s6(a.current,i=>o(i.matches))},[e]),n}const U$=typeof document<"u"?f.useLayoutEffect:f.useEffect;function nn(e,t){const r=f.useRef(!1);f.useEffect(()=>()=>{r.current=!1},[]),f.useEffect(()=>{if(r.current)return e();r.current=!0},t)}function W$({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 nn(()=>{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 d6=/input|select|textarea|button|object/,H$="a, input, select, textarea, button, object, [tabindex]";function f6(e){return e.style.display==="none"}function p6(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(f6(r))return!1;r=r.parentNode}return!0}function q$(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Sg(e){const t=e.nodeName.toLowerCase(),r=!Number.isNaN(q$(e));return(d6.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||r)&&p6(e)}function G$(e){const t=q$(e);return(Number.isNaN(t)||t>=0)&&Sg(e)}function m6(e){return Array.from(e.querySelectorAll(H$)).filter(G$)}function h6(e,t){const r=m6(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 mm(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function g6(e,t="body > :not(script)"){const r=mm(),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 v6(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(H$));i=l.find(G$)||l.find(Sg)||null,!i&&Sg(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=g6(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&&h6(t.current,i)};return document.addEventListener("keydown",a),()=>{document.removeEventListener("keydown",a),r.current&&r.current()}},[e]),o}const y6=e=>(e+1)%1e6;function w6(){const[,e]=f.useReducer(y6,0);return e}const _6=s["useId".toString()]||(()=>{});function b6(){const e=_6();return e?`mantine-${e.replace(/:/g,"")}`:""}function $r(e){const t=b6(),[r,n]=f.useState(t);return U$(()=>{n(mm())},[]),typeof e=="string"?e:typeof window>"u"?t:r}function Pg(e,t,r){f.useEffect(()=>(window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)),[e,t])}function Q$(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function x6(...e){return t=>{e.forEach(r=>Q$(r,t))}}function _l(...e){return f.useCallback(x6(...e),e)}function Sr({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 Ao(e,t){const r=t-e+1;return Array.from({length:r},(n,o)=>o+e)}const Mc="dots";function E6({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]=Sr({value:n,onChange:a,defaultValue:o,finalValue:o}),u=w=>{w<=0?c(1):w>i?c(i):c(w)},d=()=>u(l+1),p=()=>u(l-1),h=()=>u(1),g=()=>u(i);return{range:f.useMemo(()=>{if(t*2+3+r*2>=i)return Ao(1,i);const E=Math.max(l-t,r),_=Math.min(l+t,i-r),y=E>r+2,x=_<i-(r+1);if(!y&&x){const b=t*2+r+2;return[...Ao(1,b),Mc,...Ao(i-(r-1),i)]}if(y&&!x){const b=r+1+2*t;return[...Ao(1,r),Mc,...Ao(i-b,i)]}return[...Ao(1,r),Mc,...Ao(E,_),Mc,...Ao(i-r+1,i)]},[i,t,l]),active:l,setPage:u,next:d,previous:p,first:h,last:g}}function S6({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 hm(e,t){return u6("(prefers-reduced-motion: reduce)",e,t)}const P6=e=>e<.5?2*e*e:-1+(4-2*e)*e,O6=({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 g=p-o;return g<=u.height*(a?0:1)||!a?g:0}const h=i?c.height:window.innerHeight;if(n==="end"){const g=p+o-h+u.height;return g>=-u.height*(a?0:1)||!a?g: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 g=p-o;return g<=u.width||!a?g:0}const h=i?c.width:window.innerWidth;if(n==="end"){const g=p+o-h+u.width;return g>=-u.width||!a?g:0}return n==="center"?p-h/2+u.width/2:0}return 0},$6=({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]},C6=({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 k6({duration:e=1250,axis:t="y",onScrollFinish:r,easing:n=P6,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=hm(),g=()=>{l.current&&cancelAnimationFrame(l.current)},v=f.useCallback(({alignment:E="start"}={})=>{var _;u.current=!1,l.current&&g();const y=(_=$6({parent:d.current,axis:t}))!=null?_:0,x=O6({parent:d.current,target:p.current,axis:t,alignment:E,offset:o,isList:i})-(d.current?0:y);function b(){c.current===0&&(c.current=performance.now());const $=performance.now()-c.current,O=h||e===0?1:$/e,C=y+x*n(O);C6({parent:d.current,axis:t,distance:C}),!u.current&&O<1?l.current=requestAnimationFrame(b):(typeof r=="function"&&r(),c.current=0,l.current=0,g())}b()},[t,e,n,i,o,r,h]),w=()=>{a&&(u.current=!0)};return Pg("wheel",w,{passive:!0}),Pg("touchmove",w,{passive:!0}),f.useEffect(()=>g,[]),{scrollableRef:d,targetRef:p,scrollIntoView:v,cancel:g}}function j6(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 dw(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}var fw=Object.getOwnPropertySymbols,R6=Object.prototype.hasOwnProperty,T6=Object.prototype.propertyIsEnumerable,I6=(e,t)=>{var r={};for(var n in e)R6.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&fw)for(var n of fw(e))t.indexOf(n)<0&&T6.call(e,n)&&(r[n]=e[n]);return r};function Zn(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:g,pl:v,pr:w,bg:E,c:_,opacity:y,ff:x,fz:b,fw:S,lts:$,ta:O,lh:C,fs:T,tt:j,td:k,w:I,miw:z,maw:N,h:F,mih:q,mah:ee,bgsz:R,bgp:D,bgr:V,bga:G,pos:ie,top:Oe,left:ce,bottom:Ae,right:Ie,inset:ft,display:Ge}=t,tt=I6(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:z$({m:r,mx:n,my:o,mt:a,mb:i,ml:l,mr:c,p:u,px:d,py:p,pt:h,pb:g,pl:v,pr:w,bg:E,c:_,opacity:y,ff:x,fz:b,fw:S,lts:$,ta:O,lh:C,fs:T,tt:j,td:k,w:I,miw:z,maw:N,h:F,mih:q,mah:ee,bgsz:R,bgp:D,bgr:V,bga:G,pos:ie,top:Oe,left:ce,bottom:Ae,right:Ie,inset:ft,display:Ge}),rest:tt}}function D6(e,t){const r=Object.keys(e).filter(n=>n!=="base").sort((n,o)=>ln(M({size:n,sizes:t.breakpoints}))-ln(M({size:o,sizes:t.breakpoints})));return"base"in e?["base",...r]:r}function N6({value:e,theme:t,getValue:r,property:n}){if(e==null)return;if(typeof e=="object")return D6(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 A6(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 M6(e){return P(e)}function z6(e){return e}function L6(e,t){return M({size:e,sizes:t.fontSizes})}const F6=["-xs","-sm","-md","-lg","-xl"];function V6(e,t){return F6.includes(e)?`calc(${M({size:e.replace("-",""),sizes:t.spacing})} * -1)`:M({size:e,sizes:t.spacing})}const B6={identity:z6,color:A6,size:M6,fontSize:L6,spacing:V6},U6={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 W6=Object.defineProperty,pw=Object.getOwnPropertySymbols,H6=Object.prototype.hasOwnProperty,q6=Object.prototype.propertyIsEnumerable,mw=(e,t,r)=>t in e?W6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hw=(e,t)=>{for(var r in t||(t={}))H6.call(t,r)&&mw(e,r,t[r]);if(pw)for(var r of pw(t))q6.call(t,r)&&mw(e,r,t[r]);return e};function gw(e,t,r=U6){return Object.keys(r).reduce((o,a)=>(a in e&&e[a]!==void 0&&o.push(N6({value:e[a],getValue:B6[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]=hw(hw({},o[i]),a[i]):o[i]=a[i]}),o),{})}function vw(e,t){return typeof e=="function"?e(t):e}function G6(e,t,r){const n=tr(),{css:o,cx:a}=V$();return Array.isArray(e)?a(r,o(gw(t,n)),e.map(i=>o(vw(i,n)))):a(r,o(vw(e,n)),o(gw(t,n)))}var Q6=Object.defineProperty,od=Object.getOwnPropertySymbols,K$=Object.prototype.hasOwnProperty,Y$=Object.prototype.propertyIsEnumerable,yw=(e,t,r)=>t in e?Q6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K6=(e,t)=>{for(var r in t||(t={}))K$.call(t,r)&&yw(e,r,t[r]);if(od)for(var r of od(t))Y$.call(t,r)&&yw(e,r,t[r]);return e},Y6=(e,t)=>{var r={};for(var n in e)K$.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&od)for(var n of od(e))t.indexOf(n)<0&&Y$.call(e,n)&&(r[n]=e[n]);return r};const X$=f.forwardRef((e,t)=>{var r=e,{className:n,component:o,style:a,sx:i}=r,l=Y6(r,["className","component","style","sx"]);const{systemStyles:c,rest:u}=Zn(l),d=o||"div";return s.createElement(d,K6({ref:t,className:G6(i,c,n),style:a},u))});X$.displayName="@mantine/core/Box";const se=X$;var X6=Object.defineProperty,J6=Object.defineProperties,Z6=Object.getOwnPropertyDescriptors,ww=Object.getOwnPropertySymbols,ez=Object.prototype.hasOwnProperty,tz=Object.prototype.propertyIsEnumerable,_w=(e,t,r)=>t in e?X6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bw=(e,t)=>{for(var r in t||(t={}))ez.call(t,r)&&_w(e,r,t[r]);if(ww)for(var r of ww(t))tz.call(t,r)&&_w(e,r,t[r]);return e},rz=(e,t)=>J6(e,Z6(t)),nz=U(e=>({root:rz(bw(bw({},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 oz=nz;var az=Object.defineProperty,ad=Object.getOwnPropertySymbols,J$=Object.prototype.hasOwnProperty,Z$=Object.prototype.propertyIsEnumerable,xw=(e,t,r)=>t in e?az(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iz=(e,t)=>{for(var r in t||(t={}))J$.call(t,r)&&xw(e,r,t[r]);if(ad)for(var r of ad(t))Z$.call(t,r)&&xw(e,r,t[r]);return e},lz=(e,t)=>{var r={};for(var n in e)J$.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ad)for(var n of ad(e))t.indexOf(n)<0&&Z$.call(e,n)&&(r[n]=e[n]);return r};const eC=f.forwardRef((e,t)=>{const r=H("UnstyledButton",{},e),{className:n,component:o="button",unstyled:a,variant:i}=r,l=lz(r,["className","component","unstyled","variant"]),{classes:c,cx:u}=oz(null,{name:"UnstyledButton",unstyled:a,variant:i});return s.createElement(se,iz({component:o,ref:t,className:u(c.root,n),type:o==="button"?"button":void 0},l))});eC.displayName="@mantine/core/UnstyledButton";const ho=eC;var tC={exports:{}},Ur={},rC={exports:{}},nC={};/**
|
|
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,D){var V=R.length;R.push(D);e:for(;0<V;){var G=V-1>>>1,ie=R[G];if(0<o(ie,D))R[G]=D,R[V]=ie,V=G;else break e}}function r(R){return R.length===0?null:R[0]}function n(R){if(R.length===0)return null;var D=R[0],V=R.pop();if(V!==D){R[0]=V;e:for(var G=0,ie=R.length,Oe=ie>>>1;G<Oe;){var ce=2*(G+1)-1,Ae=R[ce],Ie=ce+1,ft=R[Ie];if(0>o(Ae,V))Ie<ie&&0>o(ft,Ae)?(R[G]=ft,R[Ie]=V,G=Ie):(R[G]=Ae,R[ce]=V,G=ce);else if(Ie<ie&&0>o(ft,V))R[G]=ft,R[Ie]=V,G=Ie;else break e}}return D}function o(R,D){var V=R.sortIndex-D.sortIndex;return V!==0?V:R.id-D.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,g=!1,v=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(R){for(var D=r(u);D!==null;){if(D.callback===null)n(u);else if(D.startTime<=R)n(u),D.sortIndex=D.expirationTime,t(c,D);else break;D=r(u)}}function b(R){if(w=!1,x(R),!v)if(r(c)!==null)v=!0,q(S);else{var D=r(u);D!==null&&ee(b,D.startTime-R)}}function S(R,D){v=!1,w&&(w=!1,_(C),C=-1),g=!0;var V=h;try{for(x(D),p=r(c);p!==null&&(!(p.expirationTime>D)||R&&!k());){var G=p.callback;if(typeof G=="function"){p.callback=null,h=p.priorityLevel;var ie=G(p.expirationTime<=D);D=e.unstable_now(),typeof ie=="function"?p.callback=ie:p===r(c)&&n(c),x(D)}else n(c);p=r(c)}if(p!==null)var Oe=!0;else{var ce=r(u);ce!==null&&ee(b,ce.startTime-D),Oe=!1}return Oe}finally{p=null,h=V,g=!1}}var $=!1,O=null,C=-1,T=5,j=-1;function k(){return!(e.unstable_now()-j<T)}function I(){if(O!==null){var R=e.unstable_now();j=R;var D=!0;try{D=O(!0,R)}finally{D?z():($=!1,O=null)}}else $=!1}var z;if(typeof y=="function")z=function(){y(I)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,F=N.port2;N.port1.onmessage=I,z=function(){F.postMessage(null)}}else z=function(){E(I,0)};function q(R){O=R,$||($=!0,z())}function ee(R,D){C=E(function(){R(e.unstable_now())},D)}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||g||(v=!0,q(S))},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 D=3;break;default:D=h}var V=h;h=D;try{return R()}finally{h=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(R,D){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var V=h;h=R;try{return D()}finally{h=V}},e.unstable_scheduleCallback=function(R,D,V){var G=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?G+V:G):V=G,R){case 1:var ie=-1;break;case 2:ie=250;break;case 5:ie=1073741823;break;case 4:ie=1e4;break;default:ie=5e3}return ie=V+ie,R={id:d++,callback:D,priorityLevel:R,startTime:V,expirationTime:ie,sortIndex:-1},V>G?(R.sortIndex=V,t(u,R),r(c)===null&&R===r(u)&&(w?(_(C),C=-1):w=!0,ee(b,V-G))):(R.sortIndex=ie,t(c,R),v||g||(v=!0,q(S))),R},e.unstable_shouldYield=k,e.unstable_wrapCallback=function(R){var D=h;return function(){var V=h;h=D;try{return R.apply(this,arguments)}finally{h=V}}}})(nC);rC.exports=nC;var sz=rC.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 oC=f,Vr=sz;function W(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 aC=new Set,Cs={};function ri(e,t){rl(e,t),rl(e+"Capture",t)}function rl(e,t){for(Cs[e]=t,e=0;e<t.length;e++)aC.add(t[e])}var go=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Og=Object.prototype.hasOwnProperty,cz=/^[: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]*$/,Ew={},Sw={};function uz(e){return Og.call(Sw,e)?!0:Og.call(Ew,e)?!1:cz.test(e)?Sw[e]=!0:(Ew[e]=!0,!1)}function dz(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 fz(e,t,r,n){if(t===null||typeof t>"u"||dz(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 dr(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 dr(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 dr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){qt[e]=new dr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){qt[e]=new dr(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 dr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){qt[e]=new dr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){qt[e]=new dr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){qt[e]=new dr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){qt[e]=new dr(e,5,!1,e.toLowerCase(),null,!1,!1)});var my=/[\-:]([a-z])/g;function hy(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(my,hy);qt[t]=new dr(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(my,hy);qt[t]=new dr(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(my,hy);qt[t]=new dr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){qt[e]=new dr(e,1,!1,e.toLowerCase(),null,!1,!1)});qt.xlinkHref=new dr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){qt[e]=new dr(e,1,!1,e.toLowerCase(),null,!0,!0)});function gy(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")&&(fz(t,r,o,n)&&(r=null),n||o===null?uz(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 Oo=oC.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,zc=Symbol.for("react.element"),Ci=Symbol.for("react.portal"),ki=Symbol.for("react.fragment"),vy=Symbol.for("react.strict_mode"),$g=Symbol.for("react.profiler"),iC=Symbol.for("react.provider"),lC=Symbol.for("react.context"),yy=Symbol.for("react.forward_ref"),Cg=Symbol.for("react.suspense"),kg=Symbol.for("react.suspense_list"),wy=Symbol.for("react.memo"),Fo=Symbol.for("react.lazy"),sC=Symbol.for("react.offscreen"),Pw=Symbol.iterator;function Ml(e){return e===null||typeof e!="object"?null:(e=Pw&&e[Pw]||e["@@iterator"],typeof e=="function"?e:null)}var yt=Object.assign,hh;function os(e){if(hh===void 0)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);hh=t&&t[1]||""}return`
|
|
81
|
+
`+hh+e}var gh=!1;function vh(e,t){if(!e||gh)return"";gh=!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{gh=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?os(e):""}function pz(e){switch(e.tag){case 5:return os(e.type);case 16:return os("Lazy");case 13:return os("Suspense");case 19:return os("SuspenseList");case 0:case 2:case 15:return e=vh(e.type,!1),e;case 11:return e=vh(e.type.render,!1),e;case 1:return e=vh(e.type,!0),e;default:return""}}function jg(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 ki:return"Fragment";case Ci:return"Portal";case $g:return"Profiler";case vy:return"StrictMode";case Cg:return"Suspense";case kg:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lC:return(e.displayName||"Context")+".Consumer";case iC:return(e._context.displayName||"Context")+".Provider";case yy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case wy:return t=e.displayName||null,t!==null?t:jg(e.type)||"Memo";case Fo:t=e._payload,e=e._init;try{return jg(e(t))}catch{}}return null}function mz(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 jg(t);case 8:return t===vy?"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 cC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function hz(e){var t=cC(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 Lc(e){e._valueTracker||(e._valueTracker=hz(e))}function uC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=cC(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function id(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 Rg(e,t){var r=t.checked;return yt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Ow(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 dC(e,t){t=t.checked,t!=null&&gy(e,"checked",t,!1)}function Tg(e,t){dC(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")?Ig(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ig(e,t.type,aa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function $w(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 Ig(e,t,r){(t!=="number"||id(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var as=Array.isArray;function Hi(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 Dg(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(W(91));return yt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Cw(e,t){var r=t.value;if(r==null){if(r=t.children,t=t.defaultValue,r!=null){if(t!=null)throw Error(W(92));if(as(r)){if(1<r.length)throw Error(W(93));r=r[0]}t=r}t==null&&(t=""),r=t}e._wrapperState={initialValue:aa(r)}}function fC(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 kw(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function pC(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 Ng(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?pC(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fc,mC=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(Fc=Fc||document.createElement("div"),Fc.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fc.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ks(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ds={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},gz=["Webkit","ms","Moz","O"];Object.keys(ds).forEach(function(e){gz.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ds[t]=ds[e]})});function hC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ds.hasOwnProperty(e)&&ds[e]?(""+t).trim():t+"px"}function gC(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=hC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var vz=yt({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 Ag(e,t){if(t){if(vz[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(W(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(W(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(W(61))}if(t.style!=null&&typeof t.style!="object")throw Error(W(62))}}function Mg(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 zg=null;function _y(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Lg=null,qi=null,Gi=null;function jw(e){if(e=rc(e)){if(typeof Lg!="function")throw Error(W(280));var t=e.stateNode;t&&(t=_m(t),Lg(e.stateNode,e.type,t))}}function vC(e){qi?Gi?Gi.push(e):Gi=[e]:qi=e}function yC(){if(qi){var e=qi,t=Gi;if(Gi=qi=null,jw(e),t)for(e=0;e<t.length;e++)jw(t[e])}}function wC(e,t){return e(t)}function _C(){}var yh=!1;function bC(e,t,r){if(yh)return e(t,r);yh=!0;try{return wC(e,t,r)}finally{yh=!1,(qi!==null||Gi!==null)&&(_C(),yC())}}function js(e,t){var r=e.stateNode;if(r===null)return null;var n=_m(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(W(231,t,typeof r));return r}var Fg=!1;if(go)try{var zl={};Object.defineProperty(zl,"passive",{get:function(){Fg=!0}}),window.addEventListener("test",zl,zl),window.removeEventListener("test",zl,zl)}catch{Fg=!1}function yz(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 fs=!1,ld=null,sd=!1,Vg=null,wz={onError:function(e){fs=!0,ld=e}};function _z(e,t,r,n,o,a,i,l,c){fs=!1,ld=null,yz.apply(wz,arguments)}function bz(e,t,r,n,o,a,i,l,c){if(_z.apply(this,arguments),fs){if(fs){var u=ld;fs=!1,ld=null}else throw Error(W(198));sd||(sd=!0,Vg=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 xC(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 Rw(e){if(ni(e)!==e)throw Error(W(188))}function xz(e){var t=e.alternate;if(!t){if(t=ni(e),t===null)throw Error(W(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 Rw(o),e;if(a===n)return Rw(o),t;a=a.sibling}throw Error(W(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(W(189))}}if(r.alternate!==n)throw Error(W(190))}if(r.tag!==3)throw Error(W(188));return r.stateNode.current===r?e:t}function EC(e){return e=xz(e),e!==null?SC(e):null}function SC(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=SC(e);if(t!==null)return t;e=e.sibling}return null}var PC=Vr.unstable_scheduleCallback,Tw=Vr.unstable_cancelCallback,Ez=Vr.unstable_shouldYield,Sz=Vr.unstable_requestPaint,St=Vr.unstable_now,Pz=Vr.unstable_getCurrentPriorityLevel,by=Vr.unstable_ImmediatePriority,OC=Vr.unstable_UserBlockingPriority,cd=Vr.unstable_NormalPriority,Oz=Vr.unstable_LowPriority,$C=Vr.unstable_IdlePriority,gm=null,Gn=null;function $z(e){if(Gn&&typeof Gn.onCommitFiberRoot=="function")try{Gn.onCommitFiberRoot(gm,e,void 0,(e.current.flags&128)===128)}catch{}}var En=Math.clz32?Math.clz32:jz,Cz=Math.log,kz=Math.LN2;function jz(e){return e>>>=0,e===0?32:31-(Cz(e)/kz|0)|0}var Vc=64,Bc=4194304;function is(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 ud(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=is(l):(a&=i,a!==0&&(n=is(a)))}else i=r&~o,i!==0?n=is(i):a!==0&&(n=is(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-En(t),o=1<<r,n|=e[r],t&=~o;return n}function Rz(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 Tz(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,a=e.pendingLanes;0<a;){var i=31-En(a),l=1<<i,c=o[i];c===-1?(!(l&r)||l&n)&&(o[i]=Rz(l,t)):c<=t&&(e.expiredLanes|=l),a&=~l}}function Bg(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function CC(){var e=Vc;return Vc<<=1,!(Vc&4194240)&&(Vc=64),e}function wh(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function ec(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-En(t),e[t]=r}function Iz(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-En(r),a=1<<o;t[o]=0,n[o]=-1,e[o]=-1,r&=~a}}function xy(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-En(r),o=1<<n;o&t|e[n]&t&&(e[n]|=t),r&=~o}}var Ue=0;function kC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var jC,Ey,RC,TC,IC,Ug=!1,Uc=[],Yo=null,Xo=null,Jo=null,Rs=new Map,Ts=new Map,Wo=[],Dz="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 Iw(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":Rs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ts.delete(t.pointerId)}}function Ll(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=rc(t),t!==null&&Ey(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function Nz(e,t,r,n,o){switch(t){case"focusin":return Yo=Ll(Yo,e,t,r,n,o),!0;case"dragenter":return Xo=Ll(Xo,e,t,r,n,o),!0;case"mouseover":return Jo=Ll(Jo,e,t,r,n,o),!0;case"pointerover":var a=o.pointerId;return Rs.set(a,Ll(Rs.get(a)||null,e,t,r,n,o)),!0;case"gotpointercapture":return a=o.pointerId,Ts.set(a,Ll(Ts.get(a)||null,e,t,r,n,o)),!0}return!1}function DC(e){var t=Ia(e.target);if(t!==null){var r=ni(t);if(r!==null){if(t=r.tag,t===13){if(t=xC(r),t!==null){e.blockedOn=t,IC(e.priority,function(){RC(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 Mu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var r=Wg(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(r===null){r=e.nativeEvent;var n=new r.constructor(r.type,r);zg=n,r.target.dispatchEvent(n),zg=null}else return t=rc(r),t!==null&&Ey(t),e.blockedOn=r,!1;t.shift()}return!0}function Dw(e,t,r){Mu(e)&&r.delete(t)}function Az(){Ug=!1,Yo!==null&&Mu(Yo)&&(Yo=null),Xo!==null&&Mu(Xo)&&(Xo=null),Jo!==null&&Mu(Jo)&&(Jo=null),Rs.forEach(Dw),Ts.forEach(Dw)}function Fl(e,t){e.blockedOn===t&&(e.blockedOn=null,Ug||(Ug=!0,Vr.unstable_scheduleCallback(Vr.unstable_NormalPriority,Az)))}function Is(e){function t(o){return Fl(o,e)}if(0<Uc.length){Fl(Uc[0],e);for(var r=1;r<Uc.length;r++){var n=Uc[r];n.blockedOn===e&&(n.blockedOn=null)}}for(Yo!==null&&Fl(Yo,e),Xo!==null&&Fl(Xo,e),Jo!==null&&Fl(Jo,e),Rs.forEach(t),Ts.forEach(t),r=0;r<Wo.length;r++)n=Wo[r],n.blockedOn===e&&(n.blockedOn=null);for(;0<Wo.length&&(r=Wo[0],r.blockedOn===null);)DC(r),r.blockedOn===null&&Wo.shift()}var Qi=Oo.ReactCurrentBatchConfig,dd=!0;function Mz(e,t,r,n){var o=Ue,a=Qi.transition;Qi.transition=null;try{Ue=1,Sy(e,t,r,n)}finally{Ue=o,Qi.transition=a}}function zz(e,t,r,n){var o=Ue,a=Qi.transition;Qi.transition=null;try{Ue=4,Sy(e,t,r,n)}finally{Ue=o,Qi.transition=a}}function Sy(e,t,r,n){if(dd){var o=Wg(e,t,r,n);if(o===null)kh(e,t,n,fd,r),Iw(e,n);else if(Nz(o,e,t,r,n))n.stopPropagation();else if(Iw(e,n),t&4&&-1<Dz.indexOf(e)){for(;o!==null;){var a=rc(o);if(a!==null&&jC(a),a=Wg(e,t,r,n),a===null&&kh(e,t,n,fd,r),a===o)break;o=a}o!==null&&n.stopPropagation()}else kh(e,t,n,null,r)}}var fd=null;function Wg(e,t,r,n){if(fd=null,e=_y(n),e=Ia(e),e!==null)if(t=ni(e),t===null)e=null;else if(r=t.tag,r===13){if(e=xC(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 fd=e,null}function NC(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(Pz()){case by:return 1;case OC:return 4;case cd:case Oz:return 16;case $C:return 536870912;default:return 16}default:return 16}}var qo=null,Py=null,zu=null;function AC(){if(zu)return zu;var e,t=Py,r=t.length,n,o="value"in qo?qo.value:qo.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 zu=o.slice(e,1<n?1-n:void 0)}function Lu(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 Wc(){return!0}function Nw(){return!1}function Wr(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)?Wc:Nw,this.isPropagationStopped=Nw,this}return yt(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=Wc)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Wc)},persist:function(){},isPersistent:Wc}),t}var bl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Oy=Wr(bl),tc=yt({},bl,{view:0,detail:0}),Lz=Wr(tc),_h,bh,Vl,vm=yt({},tc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:$y,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!==Vl&&(Vl&&e.type==="mousemove"?(_h=e.screenX-Vl.screenX,bh=e.screenY-Vl.screenY):bh=_h=0,Vl=e),_h)},movementY:function(e){return"movementY"in e?e.movementY:bh}}),Aw=Wr(vm),Fz=yt({},vm,{dataTransfer:0}),Vz=Wr(Fz),Bz=yt({},tc,{relatedTarget:0}),xh=Wr(Bz),Uz=yt({},bl,{animationName:0,elapsedTime:0,pseudoElement:0}),Wz=Wr(Uz),Hz=yt({},bl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),qz=Wr(Hz),Gz=yt({},bl,{data:0}),Mw=Wr(Gz),Qz={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Kz={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"},Yz={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xz(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Yz[e])?!!t[e]:!1}function $y(){return Xz}var Jz=yt({},tc,{key:function(e){if(e.key){var t=Qz[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Lu(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Kz[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:$y,charCode:function(e){return e.type==="keypress"?Lu(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Lu(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Zz=Wr(Jz),eL=yt({},vm,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zw=Wr(eL),tL=yt({},tc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:$y}),rL=Wr(tL),nL=yt({},bl,{propertyName:0,elapsedTime:0,pseudoElement:0}),oL=Wr(nL),aL=yt({},vm,{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}),iL=Wr(aL),lL=[9,13,27,32],Cy=go&&"CompositionEvent"in window,ps=null;go&&"documentMode"in document&&(ps=document.documentMode);var sL=go&&"TextEvent"in window&&!ps,MC=go&&(!Cy||ps&&8<ps&&11>=ps),Lw=String.fromCharCode(32),Fw=!1;function zC(e,t){switch(e){case"keyup":return lL.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function LC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ji=!1;function cL(e,t){switch(e){case"compositionend":return LC(t);case"keypress":return t.which!==32?null:(Fw=!0,Lw);case"textInput":return e=t.data,e===Lw&&Fw?null:e;default:return null}}function uL(e,t){if(ji)return e==="compositionend"||!Cy&&zC(e,t)?(e=AC(),zu=Py=qo=null,ji=!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 MC&&t.locale!=="ko"?null:t.data;default:return null}}var dL={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 Vw(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dL[e.type]:t==="textarea"}function FC(e,t,r,n){vC(n),t=pd(t,"onChange"),0<t.length&&(r=new Oy("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var ms=null,Ds=null;function fL(e){XC(e,0)}function ym(e){var t=Ii(e);if(uC(t))return e}function pL(e,t){if(e==="change")return t}var VC=!1;if(go){var Eh;if(go){var Sh="oninput"in document;if(!Sh){var Bw=document.createElement("div");Bw.setAttribute("oninput","return;"),Sh=typeof Bw.oninput=="function"}Eh=Sh}else Eh=!1;VC=Eh&&(!document.documentMode||9<document.documentMode)}function Uw(){ms&&(ms.detachEvent("onpropertychange",BC),Ds=ms=null)}function BC(e){if(e.propertyName==="value"&&ym(Ds)){var t=[];FC(t,Ds,e,_y(e)),bC(fL,t)}}function mL(e,t,r){e==="focusin"?(Uw(),ms=t,Ds=r,ms.attachEvent("onpropertychange",BC)):e==="focusout"&&Uw()}function hL(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ym(Ds)}function gL(e,t){if(e==="click")return ym(t)}function vL(e,t){if(e==="input"||e==="change")return ym(t)}function yL(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var On=typeof Object.is=="function"?Object.is:yL;function Ns(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(!Og.call(t,o)||!On(e[o],t[o]))return!1}return!0}function Ww(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hw(e,t){var r=Ww(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=Ww(r)}}function UC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?UC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function WC(){for(var e=window,t=id();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=id(e.document)}return t}function ky(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 wL(e){var t=WC(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&UC(r.ownerDocument.documentElement,r)){if(n!==null&&ky(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 _L=go&&"documentMode"in document&&11>=document.documentMode,Ri=null,Hg=null,hs=null,qg=!1;function qw(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;qg||Ri==null||Ri!==id(n)||(n=Ri,"selectionStart"in n&&ky(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}),hs&&Ns(hs,n)||(hs=n,n=pd(Hg,"onSelect"),0<n.length&&(t=new Oy("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=Ri)))}function Hc(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var Ti={animationend:Hc("Animation","AnimationEnd"),animationiteration:Hc("Animation","AnimationIteration"),animationstart:Hc("Animation","AnimationStart"),transitionend:Hc("Transition","TransitionEnd")},Ph={},HC={};go&&(HC=document.createElement("div").style,"AnimationEvent"in window||(delete Ti.animationend.animation,delete Ti.animationiteration.animation,delete Ti.animationstart.animation),"TransitionEvent"in window||delete Ti.transitionend.transition);function wm(e){if(Ph[e])return Ph[e];if(!Ti[e])return e;var t=Ti[e],r;for(r in t)if(t.hasOwnProperty(r)&&r in HC)return Ph[e]=t[r];return e}var qC=wm("animationend"),GC=wm("animationiteration"),QC=wm("animationstart"),KC=wm("transitionend"),YC=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){YC.set(e,t),ri(t,[e])}for(var Oh=0;Oh<Gw.length;Oh++){var $h=Gw[Oh],bL=$h.toLowerCase(),xL=$h[0].toUpperCase()+$h.slice(1);fa(bL,"on"+xL)}fa(qC,"onAnimationEnd");fa(GC,"onAnimationIteration");fa(QC,"onAnimationStart");fa("dblclick","onDoubleClick");fa("focusin","onFocus");fa("focusout","onBlur");fa(KC,"onTransitionEnd");rl("onMouseEnter",["mouseout","mouseover"]);rl("onMouseLeave",["mouseout","mouseover"]);rl("onPointerEnter",["pointerout","pointerover"]);rl("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 ls="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(" "),EL=new Set("cancel close invalid load scroll toggle".split(" ").concat(ls));function Qw(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,bz(n,t,void 0,e),e.currentTarget=null}function XC(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;Qw(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;Qw(o,l,u),a=c}}}if(sd)throw e=Vg,sd=!1,Vg=null,e}function rt(e,t){var r=t[Xg];r===void 0&&(r=t[Xg]=new Set);var n=e+"__bubble";r.has(n)||(JC(t,e,2,!1),r.add(n))}function Ch(e,t,r){var n=0;t&&(n|=4),JC(r,e,n,t)}var qc="_reactListening"+Math.random().toString(36).slice(2);function As(e){if(!e[qc]){e[qc]=!0,aC.forEach(function(r){r!=="selectionchange"&&(EL.has(r)||Ch(r,!1,e),Ch(r,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qc]||(t[qc]=!0,Ch("selectionchange",!1,t))}}function JC(e,t,r,n){switch(NC(t)){case 1:var o=Mz;break;case 4:o=zz;break;default:o=Sy}r=o.bind(null,t,r,e),o=void 0,!Fg||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 kh(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=Ia(l),i===null)return;if(c=i.tag,c===5||c===6){n=a=i;continue e}l=l.parentNode}}n=n.return}bC(function(){var u=a,d=_y(r),p=[];e:{var h=YC.get(e);if(h!==void 0){var g=Oy,v=e;switch(e){case"keypress":if(Lu(r)===0)break e;case"keydown":case"keyup":g=Zz;break;case"focusin":v="focus",g=xh;break;case"focusout":v="blur",g=xh;break;case"beforeblur":case"afterblur":g=xh;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":g=Aw;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Vz;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=rL;break;case qC:case GC:case QC:g=Wz;break;case KC:g=oL;break;case"scroll":g=Lz;break;case"wheel":g=iL;break;case"copy":case"cut":case"paste":g=qz;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=zw}var w=(t&4)!==0,E=!w&&e==="scroll",_=w?h!==null?h+"Capture":null:h;w=[];for(var y=u,x;y!==null;){x=y;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,_!==null&&(b=js(y,_),b!=null&&w.push(Ms(y,b,x)))),E)break;y=y.return}0<w.length&&(h=new g(h,v,null,r,d),p.push({event:h,listeners:w}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",h&&r!==zg&&(v=r.relatedTarget||r.fromElement)&&(Ia(v)||v[vo]))break e;if((g||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,g?(v=r.relatedTarget||r.toElement,g=u,v=v?Ia(v):null,v!==null&&(E=ni(v),v!==E||v.tag!==5&&v.tag!==6)&&(v=null)):(g=null,v=u),g!==v)){if(w=Aw,b="onMouseLeave",_="onMouseEnter",y="mouse",(e==="pointerout"||e==="pointerover")&&(w=zw,b="onPointerLeave",_="onPointerEnter",y="pointer"),E=g==null?h:Ii(g),x=v==null?h:Ii(v),h=new w(b,y+"leave",g,r,d),h.target=E,h.relatedTarget=x,b=null,Ia(d)===u&&(w=new w(_,y+"enter",v,r,d),w.target=x,w.relatedTarget=E,b=w),E=b,g&&v)t:{for(w=g,_=v,y=0,x=w;x;x=vi(x))y++;for(x=0,b=_;b;b=vi(b))x++;for(;0<y-x;)w=vi(w),y--;for(;0<x-y;)_=vi(_),x--;for(;y--;){if(w===_||_!==null&&w===_.alternate)break t;w=vi(w),_=vi(_)}w=null}else w=null;g!==null&&Kw(p,h,g,w,!1),v!==null&&E!==null&&Kw(p,E,v,w,!0)}}e:{if(h=u?Ii(u):window,g=h.nodeName&&h.nodeName.toLowerCase(),g==="select"||g==="input"&&h.type==="file")var S=pL;else if(Vw(h))if(VC)S=vL;else{S=hL;var $=mL}else(g=h.nodeName)&&g.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(S=gL);if(S&&(S=S(e,u))){FC(p,S,r,d);break e}$&&$(e,h,u),e==="focusout"&&($=h._wrapperState)&&$.controlled&&h.type==="number"&&Ig(h,"number",h.value)}switch($=u?Ii(u):window,e){case"focusin":(Vw($)||$.contentEditable==="true")&&(Ri=$,Hg=u,hs=null);break;case"focusout":hs=Hg=Ri=null;break;case"mousedown":qg=!0;break;case"contextmenu":case"mouseup":case"dragend":qg=!1,qw(p,r,d);break;case"selectionchange":if(_L)break;case"keydown":case"keyup":qw(p,r,d)}var O;if(Cy)e:{switch(e){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else ji?zC(e,r)&&(C="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(C="onCompositionStart");C&&(MC&&r.locale!=="ko"&&(ji||C!=="onCompositionStart"?C==="onCompositionEnd"&&ji&&(O=AC()):(qo=d,Py="value"in qo?qo.value:qo.textContent,ji=!0)),$=pd(u,C),0<$.length&&(C=new Mw(C,e,null,r,d),p.push({event:C,listeners:$}),O?C.data=O:(O=LC(r),O!==null&&(C.data=O)))),(O=sL?cL(e,r):uL(e,r))&&(u=pd(u,"onBeforeInput"),0<u.length&&(d=new Mw("onBeforeInput","beforeinput",null,r,d),p.push({event:d,listeners:u}),d.data=O))}XC(p,t)})}function Ms(e,t,r){return{instance:e,listener:t,currentTarget:r}}function pd(e,t){for(var r=t+"Capture",n=[];e!==null;){var o=e,a=o.stateNode;o.tag===5&&a!==null&&(o=a,a=js(e,r),a!=null&&n.unshift(Ms(e,a,o)),a=js(e,t),a!=null&&n.push(Ms(e,a,o))),e=e.return}return n}function vi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Kw(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=js(r,a),c!=null&&i.unshift(Ms(r,c,l))):o||(c=js(r,a),c!=null&&i.push(Ms(r,c,l)))),r=r.return}i.length!==0&&e.push({event:t,listeners:i})}var SL=/\r\n?/g,PL=/\u0000|\uFFFD/g;function Yw(e){return(typeof e=="string"?e:""+e).replace(SL,`
|
|
85
|
+
`).replace(PL,"")}function Gc(e,t,r){if(t=Yw(t),Yw(e)!==t&&r)throw Error(W(425))}function md(){}var Gg=null,Qg=null;function Kg(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 Yg=typeof setTimeout=="function"?setTimeout:void 0,OL=typeof clearTimeout=="function"?clearTimeout:void 0,Xw=typeof Promise=="function"?Promise:void 0,$L=typeof queueMicrotask=="function"?queueMicrotask:typeof Xw<"u"?function(e){return Xw.resolve(null).then(e).catch(CL)}:Yg;function CL(e){setTimeout(function(){throw e})}function jh(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),Is(t);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=o}while(r);Is(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 Jw(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 xl=Math.random().toString(36).slice(2),Wn="__reactFiber$"+xl,zs="__reactProps$"+xl,vo="__reactContainer$"+xl,Xg="__reactEvents$"+xl,kL="__reactListeners$"+xl,jL="__reactHandles$"+xl;function Ia(e){var t=e[Wn];if(t)return t;for(var r=e.parentNode;r;){if(t=r[vo]||r[Wn]){if(r=t.alternate,t.child!==null||r!==null&&r.child!==null)for(e=Jw(e);e!==null;){if(r=e[Wn])return r;e=Jw(e)}return t}e=r,r=e.parentNode}return null}function rc(e){return e=e[Wn]||e[vo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ii(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(W(33))}function _m(e){return e[zs]||null}var Jg=[],Di=-1;function pa(e){return{current:e}}function nt(e){0>Di||(e.current=Jg[Di],Jg[Di]=null,Di--)}function Ye(e,t){Di++,Jg[Di]=e.current,e.current=t}var ia={},er=pa(ia),_r=pa(!1),Ua=ia;function nl(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 br(e){return e=e.childContextTypes,e!=null}function hd(){nt(_r),nt(er)}function Zw(e,t,r){if(er.current!==ia)throw Error(W(168));Ye(er,t),Ye(_r,r)}function ZC(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(W(108,mz(e)||"Unknown",o));return yt({},r,n)}function gd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ia,Ua=er.current,Ye(er,e),Ye(_r,_r.current),!0}function e_(e,t,r){var n=e.stateNode;if(!n)throw Error(W(169));r?(e=ZC(e,t,Ua),n.__reactInternalMemoizedMergedChildContext=e,nt(_r),nt(er),Ye(er,e)):nt(_r),Ye(_r,r)}var io=null,bm=!1,Rh=!1;function e2(e){io===null?io=[e]:io.push(e)}function RL(e){bm=!0,e2(e)}function ma(){if(!Rh&&io!==null){Rh=!0;var e=0,t=Ue;try{var r=io;for(Ue=1;e<r.length;e++){var n=r[e];do n=n(!0);while(n!==null)}io=null,bm=!1}catch(o){throw io!==null&&(io=io.slice(e+1)),PC(by,ma),o}finally{Ue=t,Rh=!1}}return null}var Ni=[],Ai=0,vd=null,yd=0,Xr=[],Jr=0,Wa=null,so=1,co="";function $a(e,t){Ni[Ai++]=yd,Ni[Ai++]=vd,vd=e,yd=t}function t2(e,t,r){Xr[Jr++]=so,Xr[Jr++]=co,Xr[Jr++]=Wa,Wa=e;var n=so;e=co;var o=32-En(n)-1;n&=~(1<<o),r+=1;var a=32-En(t)+o;if(30<a){var i=o-o%5;a=(n&(1<<i)-1).toString(32),n>>=i,o-=i,so=1<<32-En(t)+o|r<<o|n,co=a+e}else so=1<<a|r<<o|n,co=e}function jy(e){e.return!==null&&($a(e,1),t2(e,1,0))}function Ry(e){for(;e===vd;)vd=Ni[--Ai],Ni[Ai]=null,yd=Ni[--Ai],Ni[Ai]=null;for(;e===Wa;)Wa=Xr[--Jr],Xr[Jr]=null,co=Xr[--Jr],Xr[Jr]=null,so=Xr[--Jr],Xr[Jr]=null}var Lr=null,Mr=null,st=!1,bn=null;function r2(e,t){var r=en(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 t_(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,Lr=e,Mr=Zo(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Lr=e,Mr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(r=Wa!==null?{id:so,overflow:co}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},r=en(18,null,null,0),r.stateNode=t,r.return=e,e.child=r,Lr=e,Mr=null,!0):!1;default:return!1}}function Zg(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ev(e){if(st){var t=Mr;if(t){var r=t;if(!t_(e,t)){if(Zg(e))throw Error(W(418));t=Zo(r.nextSibling);var n=Lr;t&&t_(e,t)?r2(n,r):(e.flags=e.flags&-4097|2,st=!1,Lr=e)}}else{if(Zg(e))throw Error(W(418));e.flags=e.flags&-4097|2,st=!1,Lr=e}}}function r_(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Lr=e}function Qc(e){if(e!==Lr)return!1;if(!st)return r_(e),st=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Kg(e.type,e.memoizedProps)),t&&(t=Mr)){if(Zg(e))throw n2(),Error(W(418));for(;t;)r2(e,t),t=Zo(t.nextSibling)}if(r_(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(W(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"){if(t===0){Mr=Zo(e.nextSibling);break e}t--}else r!=="$"&&r!=="$!"&&r!=="$?"||t++}e=e.nextSibling}Mr=null}}else Mr=Lr?Zo(e.stateNode.nextSibling):null;return!0}function n2(){for(var e=Mr;e;)e=Zo(e.nextSibling)}function ol(){Mr=Lr=null,st=!1}function Ty(e){bn===null?bn=[e]:bn.push(e)}var TL=Oo.ReactCurrentBatchConfig;function yn(e,t){if(e&&e.defaultProps){t=yt({},t),e=e.defaultProps;for(var r in e)t[r]===void 0&&(t[r]=e[r]);return t}return t}var wd=pa(null),_d=null,Mi=null,Iy=null;function Dy(){Iy=Mi=_d=null}function Ny(e){var t=wd.current;nt(wd),e._currentValue=t}function tv(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 Ki(e,t){_d=e,Iy=Mi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(yr=!0),e.firstContext=null)}function sn(e){var t=e._currentValue;if(Iy!==e)if(e={context:e,memoizedValue:t,next:null},Mi===null){if(_d===null)throw Error(W(308));Mi=e,_d.dependencies={lanes:0,firstContext:e}}else Mi=Mi.next=e;return t}var Da=null;function Ay(e){Da===null?Da=[e]:Da.push(e)}function o2(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,Ay(t)):(r.next=o.next,o.next=r),t.interleaved=r,yo(e,n)}function yo(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 Vo=!1;function My(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function a2(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 uo(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,De&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,yo(e,r)}return o=n.interleaved,o===null?(t.next=t,Ay(n)):(t.next=o.next,o.next=t),n.interleaved=t,yo(e,r)}function Fu(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,xy(e,r)}}function n_(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 bd(e,t,r,n){var o=e.updateQueue;Vo=!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,g=l.eventTime;if((n&h)===h){d!==null&&(d=d.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,w=l;switch(h=t,g=r,w.tag){case 1:if(v=w.payload,typeof v=="function"){p=v.call(g,p,h);break e}p=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=w.payload,h=typeof v=="function"?v.call(g,p,h):v,h==null)break e;p=yt({},p,h);break e;case 2:Vo=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else g={eventTime:g,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=g,c=p):d=d.next=g,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 o_(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(W(191,o));o.call(n)}}}var i2=new oC.Component().refs;function rv(e,t,r,n){t=e.memoizedState,r=r(n,t),r=r==null?t:yt({},t,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var xm={isMounted:function(e){return(e=e._reactInternals)?ni(e)===e:!1},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=lr(),o=ra(e),a=uo(n,o);a.payload=t,r!=null&&(a.callback=r),t=ea(e,a,o),t!==null&&(Sn(t,e,o,n),Fu(t,e,o))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=lr(),o=ra(e),a=uo(n,o);a.tag=1,a.payload=t,r!=null&&(a.callback=r),t=ea(e,a,o),t!==null&&(Sn(t,e,o,n),Fu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=lr(),n=ra(e),o=uo(r,n);o.tag=2,t!=null&&(o.callback=t),t=ea(e,o,n),t!==null&&(Sn(t,e,n,r),Fu(t,e,n))}};function a_(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?!Ns(r,n)||!Ns(o,a):!0}function l2(e,t,r){var n=!1,o=ia,a=t.contextType;return typeof a=="object"&&a!==null?a=sn(a):(o=br(t)?Ua:er.current,n=t.contextTypes,a=(n=n!=null)?nl(e,o):ia),t=new t(r,a),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xm,e.stateNode=t,t._reactInternals=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=a),t}function i_(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&&xm.enqueueReplaceState(t,t.state,null)}function nv(e,t,r,n){var o=e.stateNode;o.props=r,o.state=e.memoizedState,o.refs=i2,My(e);var a=t.contextType;typeof a=="object"&&a!==null?o.context=sn(a):(a=br(t)?Ua:er.current,o.context=nl(e,a)),o.state=e.memoizedState,a=t.getDerivedStateFromProps,typeof a=="function"&&(rv(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&&xm.enqueueReplaceState(o,o.state,null),bd(e,r,o,n),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Bl(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(W(309));var n=r.stateNode}if(!n)throw Error(W(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===i2&&(l=o.refs={}),i===null?delete l[a]:l[a]=i},t._stringRef=a,t)}if(typeof e!="string")throw Error(W(284));if(!r._owner)throw Error(W(290,e))}return e}function Kc(e,t){throw e=Object.prototype.toString.call(t),Error(W(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function l_(e){var t=e._init;return t(e._payload)}function s2(e){function t(_,y){if(e){var x=_.deletions;x===null?(_.deletions=[y],_.flags|=16):x.push(y)}}function r(_,y){if(!e)return null;for(;y!==null;)t(_,y),y=y.sibling;return null}function n(_,y){for(_=new Map;y!==null;)y.key!==null?_.set(y.key,y):_.set(y.index,y),y=y.sibling;return _}function o(_,y){return _=na(_,y),_.index=0,_.sibling=null,_}function a(_,y,x){return _.index=x,e?(x=_.alternate,x!==null?(x=x.index,x<y?(_.flags|=2,y):x):(_.flags|=2,y)):(_.flags|=1048576,y)}function i(_){return e&&_.alternate===null&&(_.flags|=2),_}function l(_,y,x,b){return y===null||y.tag!==6?(y=zh(x,_.mode,b),y.return=_,y):(y=o(y,x),y.return=_,y)}function c(_,y,x,b){var S=x.type;return S===ki?d(_,y,x.props.children,b,x.key):y!==null&&(y.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fo&&l_(S)===y.type)?(b=o(y,x.props),b.ref=Bl(_,y,x),b.return=_,b):(b=qu(x.type,x.key,x.props,null,_.mode,b),b.ref=Bl(_,y,x),b.return=_,b)}function u(_,y,x,b){return y===null||y.tag!==4||y.stateNode.containerInfo!==x.containerInfo||y.stateNode.implementation!==x.implementation?(y=Lh(x,_.mode,b),y.return=_,y):(y=o(y,x.children||[]),y.return=_,y)}function d(_,y,x,b,S){return y===null||y.tag!==7?(y=Fa(x,_.mode,b,S),y.return=_,y):(y=o(y,x),y.return=_,y)}function p(_,y,x){if(typeof y=="string"&&y!==""||typeof y=="number")return y=zh(""+y,_.mode,x),y.return=_,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case zc:return x=qu(y.type,y.key,y.props,null,_.mode,x),x.ref=Bl(_,null,y),x.return=_,x;case Ci:return y=Lh(y,_.mode,x),y.return=_,y;case Fo:var b=y._init;return p(_,b(y._payload),x)}if(as(y)||Ml(y))return y=Fa(y,_.mode,x,null),y.return=_,y;Kc(_,y)}return null}function h(_,y,x,b){var S=y!==null?y.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return S!==null?null:l(_,y,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case zc:return x.key===S?c(_,y,x,b):null;case Ci:return x.key===S?u(_,y,x,b):null;case Fo:return S=x._init,h(_,y,S(x._payload),b)}if(as(x)||Ml(x))return S!==null?null:d(_,y,x,b,null);Kc(_,x)}return null}function g(_,y,x,b,S){if(typeof b=="string"&&b!==""||typeof b=="number")return _=_.get(x)||null,l(y,_,""+b,S);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case zc:return _=_.get(b.key===null?x:b.key)||null,c(y,_,b,S);case Ci:return _=_.get(b.key===null?x:b.key)||null,u(y,_,b,S);case Fo:var $=b._init;return g(_,y,x,$(b._payload),S)}if(as(b)||Ml(b))return _=_.get(x)||null,d(y,_,b,S,null);Kc(y,b)}return null}function v(_,y,x,b){for(var S=null,$=null,O=y,C=y=0,T=null;O!==null&&C<x.length;C++){O.index>C?(T=O,O=null):T=O.sibling;var j=h(_,O,x[C],b);if(j===null){O===null&&(O=T);break}e&&O&&j.alternate===null&&t(_,O),y=a(j,y,C),$===null?S=j:$.sibling=j,$=j,O=T}if(C===x.length)return r(_,O),st&&$a(_,C),S;if(O===null){for(;C<x.length;C++)O=p(_,x[C],b),O!==null&&(y=a(O,y,C),$===null?S=O:$.sibling=O,$=O);return st&&$a(_,C),S}for(O=n(_,O);C<x.length;C++)T=g(O,_,C,x[C],b),T!==null&&(e&&T.alternate!==null&&O.delete(T.key===null?C:T.key),y=a(T,y,C),$===null?S=T:$.sibling=T,$=T);return e&&O.forEach(function(k){return t(_,k)}),st&&$a(_,C),S}function w(_,y,x,b){var S=Ml(x);if(typeof S!="function")throw Error(W(150));if(x=S.call(x),x==null)throw Error(W(151));for(var $=S=null,O=y,C=y=0,T=null,j=x.next();O!==null&&!j.done;C++,j=x.next()){O.index>C?(T=O,O=null):T=O.sibling;var k=h(_,O,j.value,b);if(k===null){O===null&&(O=T);break}e&&O&&k.alternate===null&&t(_,O),y=a(k,y,C),$===null?S=k:$.sibling=k,$=k,O=T}if(j.done)return r(_,O),st&&$a(_,C),S;if(O===null){for(;!j.done;C++,j=x.next())j=p(_,j.value,b),j!==null&&(y=a(j,y,C),$===null?S=j:$.sibling=j,$=j);return st&&$a(_,C),S}for(O=n(_,O);!j.done;C++,j=x.next())j=g(O,_,C,j.value,b),j!==null&&(e&&j.alternate!==null&&O.delete(j.key===null?C:j.key),y=a(j,y,C),$===null?S=j:$.sibling=j,$=j);return e&&O.forEach(function(I){return t(_,I)}),st&&$a(_,C),S}function E(_,y,x,b){if(typeof x=="object"&&x!==null&&x.type===ki&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case zc:e:{for(var S=x.key,$=y;$!==null;){if($.key===S){if(S=x.type,S===ki){if($.tag===7){r(_,$.sibling),y=o($,x.props.children),y.return=_,_=y;break e}}else if($.elementType===S||typeof S=="object"&&S!==null&&S.$$typeof===Fo&&l_(S)===$.type){r(_,$.sibling),y=o($,x.props),y.ref=Bl(_,$,x),y.return=_,_=y;break e}r(_,$);break}else t(_,$);$=$.sibling}x.type===ki?(y=Fa(x.props.children,_.mode,b,x.key),y.return=_,_=y):(b=qu(x.type,x.key,x.props,null,_.mode,b),b.ref=Bl(_,y,x),b.return=_,_=b)}return i(_);case Ci:e:{for($=x.key;y!==null;){if(y.key===$)if(y.tag===4&&y.stateNode.containerInfo===x.containerInfo&&y.stateNode.implementation===x.implementation){r(_,y.sibling),y=o(y,x.children||[]),y.return=_,_=y;break e}else{r(_,y);break}else t(_,y);y=y.sibling}y=Lh(x,_.mode,b),y.return=_,_=y}return i(_);case Fo:return $=x._init,E(_,y,$(x._payload),b)}if(as(x))return v(_,y,x,b);if(Ml(x))return w(_,y,x,b);Kc(_,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,y!==null&&y.tag===6?(r(_,y.sibling),y=o(y,x),y.return=_,_=y):(r(_,y),y=zh(x,_.mode,b),y.return=_,_=y),i(_)):r(_,y)}return E}var al=s2(!0),c2=s2(!1),nc={},Qn=pa(nc),Ls=pa(nc),Fs=pa(nc);function Na(e){if(e===nc)throw Error(W(174));return e}function zy(e,t){switch(Ye(Fs,t),Ye(Ls,e),Ye(Qn,nc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ng(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Ng(t,e)}nt(Qn),Ye(Qn,t)}function il(){nt(Qn),nt(Ls),nt(Fs)}function u2(e){Na(Fs.current);var t=Na(Qn.current),r=Ng(t,e.type);t!==r&&(Ye(Ls,e),Ye(Qn,r))}function Ly(e){Ls.current===e&&(nt(Qn),nt(Ls))}var gt=pa(0);function xd(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 Th=[];function Fy(){for(var e=0;e<Th.length;e++)Th[e]._workInProgressVersionPrimary=null;Th.length=0}var Vu=Oo.ReactCurrentDispatcher,Ih=Oo.ReactCurrentBatchConfig,Ha=0,vt=null,Dt=null,Mt=null,Ed=!1,gs=!1,Vs=0,IL=0;function Qt(){throw Error(W(321))}function Vy(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 By(e,t,r,n,o,a){if(Ha=a,vt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Vu.current=e===null||e.memoizedState===null?ML:zL,e=r(n,o),gs){a=0;do{if(gs=!1,Vs=0,25<=a)throw Error(W(301));a+=1,Mt=Dt=null,t.updateQueue=null,Vu.current=LL,e=r(n,o)}while(gs)}if(Vu.current=Sd,t=Dt!==null&&Dt.next!==null,Ha=0,Mt=Dt=vt=null,Ed=!1,t)throw Error(W(300));return e}function Uy(){var e=Vs!==0;return Vs=0,e}function zn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Mt===null?vt.memoizedState=Mt=e:Mt=Mt.next=e,Mt}function cn(){if(Dt===null){var e=vt.alternate;e=e!==null?e.memoizedState:null}else e=Dt.next;var t=Mt===null?vt.memoizedState:Mt.next;if(t!==null)Mt=t,Dt=e;else{if(e===null)throw Error(W(310));Dt=e,e={memoizedState:Dt.memoizedState,baseState:Dt.baseState,baseQueue:Dt.baseQueue,queue:Dt.queue,next:null},Mt===null?vt.memoizedState=Mt=e:Mt=Mt.next=e}return Mt}function Bs(e,t){return typeof t=="function"?t(e):t}function Dh(e){var t=cn(),r=t.queue;if(r===null)throw Error(W(311));r.lastRenderedReducer=e;var n=Dt,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,vt.lanes|=d,qa|=d}u=u.next}while(u!==null&&u!==a);c===null?i=n:c.next=l,On(n,t.memoizedState)||(yr=!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,vt.lanes|=a,qa|=a,o=o.next;while(o!==e)}else o===null&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Nh(e){var t=cn(),r=t.queue;if(r===null)throw Error(W(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)||(yr=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function d2(){}function f2(e,t){var r=vt,n=cn(),o=t(),a=!On(n.memoizedState,o);if(a&&(n.memoizedState=o,yr=!0),n=n.queue,Wy(h2.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||Mt!==null&&Mt.memoizedState.tag&1){if(r.flags|=2048,Us(9,m2.bind(null,r,n,o,t),void 0,null),Lt===null)throw Error(W(349));Ha&30||p2(r,t,o)}return o}function p2(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},t=vt.updateQueue,t===null?(t={lastEffect:null,stores:null},vt.updateQueue=t,t.stores=[e]):(r=t.stores,r===null?t.stores=[e]:r.push(e))}function m2(e,t,r,n){t.value=r,t.getSnapshot=n,g2(t)&&v2(e)}function h2(e,t,r){return r(function(){g2(t)&&v2(e)})}function g2(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!On(e,r)}catch{return!0}}function v2(e){var t=yo(e,1);t!==null&&Sn(t,e,1,-1)}function s_(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:Bs,lastRenderedState:e},t.queue=e,e=e.dispatch=AL.bind(null,vt,e),[t.memoizedState,e]}function Us(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},t=vt.updateQueue,t===null?(t={lastEffect:null,stores:null},vt.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 y2(){return cn().memoizedState}function Bu(e,t,r,n){var o=zn();vt.flags|=e,o.memoizedState=Us(1|t,r,void 0,n===void 0?null:n)}function Em(e,t,r,n){var o=cn();n=n===void 0?null:n;var a=void 0;if(Dt!==null){var i=Dt.memoizedState;if(a=i.destroy,n!==null&&Vy(n,i.deps)){o.memoizedState=Us(t,r,a,n);return}}vt.flags|=e,o.memoizedState=Us(1|t,r,a,n)}function c_(e,t){return Bu(8390656,8,e,t)}function Wy(e,t){return Em(2048,8,e,t)}function w2(e,t){return Em(4,2,e,t)}function _2(e,t){return Em(4,4,e,t)}function b2(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 x2(e,t,r){return r=r!=null?r.concat([e]):null,Em(4,4,b2.bind(null,t,e),r)}function Hy(){}function E2(e,t){var r=cn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Vy(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function S2(e,t){var r=cn();t=t===void 0?null:t;var n=r.memoizedState;return n!==null&&t!==null&&Vy(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function P2(e,t,r){return Ha&21?(On(r,t)||(r=CC(),vt.lanes|=r,qa|=r,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,yr=!0),e.memoizedState=r)}function DL(e,t){var r=Ue;Ue=r!==0&&4>r?r:4,e(!0);var n=Ih.transition;Ih.transition={};try{e(!1),t()}finally{Ue=r,Ih.transition=n}}function O2(){return cn().memoizedState}function NL(e,t,r){var n=ra(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},$2(e))C2(t,r);else if(r=o2(e,t,r,n),r!==null){var o=lr();Sn(r,e,n,o),k2(r,t,n)}}function AL(e,t,r){var n=ra(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if($2(e))C2(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,Ay(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}r=o2(e,t,o,n),r!==null&&(o=lr(),Sn(r,e,n,o),k2(r,t,n))}}function $2(e){var t=e.alternate;return e===vt||t!==null&&t===vt}function C2(e,t){gs=Ed=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function k2(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,xy(e,r)}}var Sd={readContext:sn,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useInsertionEffect:Qt,useLayoutEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useMutableSource:Qt,useSyncExternalStore:Qt,useId:Qt,unstable_isNewReconciler:!1},ML={readContext:sn,useCallback:function(e,t){return zn().memoizedState=[e,t===void 0?null:t],e},useContext:sn,useEffect:c_,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Bu(4194308,4,b2.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Bu(4194308,4,e,t)},useInsertionEffect:function(e,t){return Bu(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=NL.bind(null,vt,e),[n.memoizedState,e]},useRef:function(e){var t=zn();return e={current:e},t.memoizedState=e},useState:s_,useDebugValue:Hy,useDeferredValue:function(e){return zn().memoizedState=e},useTransition:function(){var e=s_(!1),t=e[0];return e=DL.bind(null,e[1]),zn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=vt,o=zn();if(st){if(r===void 0)throw Error(W(407));r=r()}else{if(r=t(),Lt===null)throw Error(W(349));Ha&30||p2(n,t,r)}o.memoizedState=r;var a={value:r,getSnapshot:t};return o.queue=a,c_(h2.bind(null,n,a,e),[e]),n.flags|=2048,Us(9,m2.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=zn(),t=Lt.identifierPrefix;if(st){var r=co,n=so;r=(n&~(1<<32-En(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=Vs++,0<r&&(t+="H"+r.toString(32)),t+=":"}else r=IL++,t=":"+t+"r"+r.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},zL={readContext:sn,useCallback:E2,useContext:sn,useEffect:Wy,useImperativeHandle:x2,useInsertionEffect:w2,useLayoutEffect:_2,useMemo:S2,useReducer:Dh,useRef:y2,useState:function(){return Dh(Bs)},useDebugValue:Hy,useDeferredValue:function(e){var t=cn();return P2(t,Dt.memoizedState,e)},useTransition:function(){var e=Dh(Bs)[0],t=cn().memoizedState;return[e,t]},useMutableSource:d2,useSyncExternalStore:f2,useId:O2,unstable_isNewReconciler:!1},LL={readContext:sn,useCallback:E2,useContext:sn,useEffect:Wy,useImperativeHandle:x2,useInsertionEffect:w2,useLayoutEffect:_2,useMemo:S2,useReducer:Nh,useRef:y2,useState:function(){return Nh(Bs)},useDebugValue:Hy,useDeferredValue:function(e){var t=cn();return Dt===null?t.memoizedState=e:P2(t,Dt.memoizedState,e)},useTransition:function(){var e=Nh(Bs)[0],t=cn().memoizedState;return[e,t]},useMutableSource:d2,useSyncExternalStore:f2,useId:O2,unstable_isNewReconciler:!1};function ll(e,t){try{var r="",n=t;do r+=pz(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 Ah(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function ov(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var FL=typeof WeakMap=="function"?WeakMap:Map;function j2(e,t,r){r=uo(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Od||(Od=!0,mv=n),ov(e,t)},r}function R2(e,t,r){r=uo(-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(){ov(e,t)}}var a=e.stateNode;return a!==null&&typeof a.componentDidCatch=="function"&&(r.callback=function(){ov(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 u_(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new FL;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=e8.bind(null,e,t,r),t.then(e,e))}function d_(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 f_(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=uo(-1,1),t.tag=2,ea(r,t,1))),r.lanes|=1),e)}var VL=Oo.ReactCurrentOwner,yr=!1;function ar(e,t,r,n){t.child=e===null?c2(t,null,r,n):al(t,e.child,r,n)}function p_(e,t,r,n,o){r=r.render;var a=t.ref;return Ki(t,o),n=By(e,t,r,n,a,o),r=Uy(),e!==null&&!yr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,wo(e,t,o)):(st&&r&&jy(t),t.flags|=1,ar(e,t,n,o),t.child)}function m_(e,t,r,n,o){if(e===null){var a=r.type;return typeof a=="function"&&!Zy(a)&&a.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=a,T2(e,t,a,n,o)):(e=qu(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:Ns,r(i,n)&&e.ref===t.ref)return wo(e,t,o)}return t.flags|=1,e=na(a,n),e.ref=t.ref,e.return=t,t.child=e}function T2(e,t,r,n,o){if(e!==null){var a=e.memoizedProps;if(Ns(a,n)&&e.ref===t.ref)if(yr=!1,t.pendingProps=n=a,(e.lanes&o)!==0)e.flags&131072&&(yr=!0);else return t.lanes=e.lanes,wo(e,t,o)}return av(e,t,r,n,o)}function I2(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},Ye(Li,Nr),Nr|=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,Ye(Li,Nr),Nr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=a!==null?a.baseLanes:r,Ye(Li,Nr),Nr|=n}else a!==null?(n=a.baseLanes|r,t.memoizedState=null):n=r,Ye(Li,Nr),Nr|=n;return ar(e,t,o,r),t.child}function D2(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function av(e,t,r,n,o){var a=br(r)?Ua:er.current;return a=nl(t,a),Ki(t,o),r=By(e,t,r,n,a,o),n=Uy(),e!==null&&!yr?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,wo(e,t,o)):(st&&n&&jy(t),t.flags|=1,ar(e,t,r,o),t.child)}function h_(e,t,r,n,o){if(br(r)){var a=!0;gd(t)}else a=!1;if(Ki(t,o),t.stateNode===null)Uu(e,t),l2(t,r,n),nv(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=sn(u):(u=br(r)?Ua:er.current,u=nl(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)&&i_(t,i,n,u),Vo=!1;var h=t.memoizedState;i.state=h,bd(t,n,i,o),c=t.memoizedState,l!==n||h!==c||_r.current||Vo?(typeof d=="function"&&(rv(t,r,d,n),c=t.memoizedState),(l=Vo||a_(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,a2(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:yn(t.type,l),i.props=u,p=t.pendingProps,h=i.context,c=r.contextType,typeof c=="object"&&c!==null?c=sn(c):(c=br(r)?Ua:er.current,c=nl(t,c));var g=r.getDerivedStateFromProps;(d=typeof g=="function"||typeof i.getSnapshotBeforeUpdate=="function")||typeof i.UNSAFE_componentWillReceiveProps!="function"&&typeof i.componentWillReceiveProps!="function"||(l!==p||h!==c)&&i_(t,i,n,c),Vo=!1,h=t.memoizedState,i.state=h,bd(t,n,i,o);var v=t.memoizedState;l!==p||h!==v||_r.current||Vo?(typeof g=="function"&&(rv(t,r,g,n),v=t.memoizedState),(u=Vo||a_(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 iv(e,t,r,n,a,o)}function iv(e,t,r,n,o,a){D2(e,t);var i=(t.flags&128)!==0;if(!n&&!i)return o&&e_(t,r,!1),wo(e,t,a);n=t.stateNode,VL.current=t;var l=i&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&i?(t.child=al(t,e.child,null,a),t.child=al(t,null,l,a)):ar(e,t,l,a),t.memoizedState=n.state,o&&e_(t,r,!0),t.child}function N2(e){var t=e.stateNode;t.pendingContext?Zw(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Zw(e,t.context,!1),zy(e,t.containerInfo)}function g_(e,t,r,n,o){return ol(),Ty(o),t.flags|=256,ar(e,t,r,n),t.child}var lv={dehydrated:null,treeContext:null,retryLane:0};function sv(e){return{baseLanes:e,cachePool:null,transitions:null}}function A2(e,t,r){var n=t.pendingProps,o=gt.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),Ye(gt,o&1),e===null)return ev(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=Om(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=sv(r),t.memoizedState=lv,e):qy(t,i));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return BL(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?sv(r):{baseLanes:i.baseLanes|r,cachePool:null,transitions:i.transitions},a.memoizedState=i,a.childLanes=e.childLanes&~r,t.memoizedState=lv,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 qy(e,t){return t=Om({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Yc(e,t,r,n){return n!==null&&Ty(n),al(t,e.child,null,r),e=qy(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function BL(e,t,r,n,o,a,i){if(r)return t.flags&256?(t.flags&=-257,n=Ah(Error(W(422))),Yc(e,t,i,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(a=n.fallback,o=t.mode,n=Om({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&&al(t,e.child,null,i),t.child.memoizedState=sv(i),t.memoizedState=lv,a);if(!(t.mode&1))return Yc(e,t,i,null);if(o.data==="$!"){if(n=o.nextSibling&&o.nextSibling.dataset,n)var l=n.dgst;return n=l,a=Error(W(419)),n=Ah(a,n,void 0),Yc(e,t,i,n)}if(l=(i&e.childLanes)!==0,yr||l){if(n=Lt,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,yo(e,o),Sn(n,e,o,-1))}return Jy(),n=Ah(Error(W(421))),Yc(e,t,i,n)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=t8.bind(null,e),o._reactRetry=t,null):(e=a.treeContext,Mr=Zo(o.nextSibling),Lr=t,st=!0,bn=null,e!==null&&(Xr[Jr++]=so,Xr[Jr++]=co,Xr[Jr++]=Wa,so=e.id,co=e.overflow,Wa=t),t=qy(t,n.children),t.flags|=4096,t)}function v_(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),tv(e.return,t,r)}function Mh(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 M2(e,t,r){var n=t.pendingProps,o=n.revealOrder,a=n.tail;if(ar(e,t,n.children,r),n=gt.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&&v_(e,r,t);else if(e.tag===19)v_(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(Ye(gt,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&&xd(e)===null&&(o=r),r=r.sibling;r=o,r===null?(o=t.child,t.child=null):(o=r.sibling,r.sibling=null),Mh(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&&xd(e)===null){t.child=o;break}e=o.sibling,o.sibling=r,r=o,o=e}Mh(t,!0,r,null,a);break;case"together":Mh(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Uu(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function wo(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(W(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 UL(e,t,r){switch(t.tag){case 3:N2(t),ol();break;case 5:u2(t);break;case 1:br(t.type)&&gd(t);break;case 4:zy(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,o=t.memoizedProps.value;Ye(wd,n._currentValue),n._currentValue=o;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(Ye(gt,gt.current&1),t.flags|=128,null):r&t.child.childLanes?A2(e,t,r):(Ye(gt,gt.current&1),e=wo(e,t,r),e!==null?e.sibling:null);Ye(gt,gt.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return M2(e,t,r);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Ye(gt,gt.current),n)break;return null;case 22:case 23:return t.lanes=0,I2(e,t,r)}return wo(e,t,r)}var z2,cv,L2,F2;z2=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}};cv=function(){};L2=function(e,t,r,n){var o=e.memoizedProps;if(o!==n){e=t.stateNode,Na(Qn.current);var a=null;switch(r){case"input":o=Rg(e,o),n=Rg(e,n),a=[];break;case"select":o=yt({},o,{value:void 0}),n=yt({},n,{value:void 0}),a=[];break;case"textarea":o=Dg(e,o),n=Dg(e,n),a=[];break;default:typeof o.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=md)}Ag(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"&&(Cs.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"&&(Cs.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&rt("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)}};F2=function(e,t,r,n){r!==n&&(t.flags|=4)};function Ul(e,t){if(!st)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 Kt(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 WL(e,t,r){var n=t.pendingProps;switch(Ry(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Kt(t),null;case 1:return br(t.type)&&hd(),Kt(t),null;case 3:return n=t.stateNode,il(),nt(_r),nt(er),Fy(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Qc(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,bn!==null&&(vv(bn),bn=null))),cv(e,t),Kt(t),null;case 5:Ly(t);var o=Na(Fs.current);if(r=t.type,e!==null&&t.stateNode!=null)L2(e,t,r,n,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(W(166));return Kt(t),null}if(e=Na(Qn.current),Qc(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[Wn]=t,n[zs]=a,e=(t.mode&1)!==0,r){case"dialog":rt("cancel",n),rt("close",n);break;case"iframe":case"object":case"embed":rt("load",n);break;case"video":case"audio":for(o=0;o<ls.length;o++)rt(ls[o],n);break;case"source":rt("error",n);break;case"img":case"image":case"link":rt("error",n),rt("load",n);break;case"details":rt("toggle",n);break;case"input":Ow(n,a),rt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},rt("invalid",n);break;case"textarea":Cw(n,a),rt("invalid",n)}Ag(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&&Gc(n.textContent,l,e),o=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(a.suppressHydrationWarning!==!0&&Gc(n.textContent,l,e),o=["children",""+l]):Cs.hasOwnProperty(i)&&l!=null&&i==="onScroll"&&rt("scroll",n)}switch(r){case"input":Lc(n),$w(n,a,!0);break;case"textarea":Lc(n),kw(n);break;case"select":case"option":break;default:typeof a.onClick=="function"&&(n.onclick=md)}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=pC(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[zs]=n,z2(e,t,!1,!1),t.stateNode=e;e:{switch(i=Mg(r,n),r){case"dialog":rt("cancel",e),rt("close",e),o=n;break;case"iframe":case"object":case"embed":rt("load",e),o=n;break;case"video":case"audio":for(o=0;o<ls.length;o++)rt(ls[o],e);o=n;break;case"source":rt("error",e),o=n;break;case"img":case"image":case"link":rt("error",e),rt("load",e),o=n;break;case"details":rt("toggle",e),o=n;break;case"input":Ow(e,n),o=Rg(e,n),rt("invalid",e);break;case"option":o=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},o=yt({},n,{value:void 0}),rt("invalid",e);break;case"textarea":Cw(e,n),o=Dg(e,n),rt("invalid",e);break;default:o=n}Ag(r,o),l=o;for(a in l)if(l.hasOwnProperty(a)){var c=l[a];a==="style"?gC(e,c):a==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&mC(e,c)):a==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&ks(e,c):typeof c=="number"&&ks(e,""+c):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Cs.hasOwnProperty(a)?c!=null&&a==="onScroll"&&rt("scroll",e):c!=null&&gy(e,a,c,i))}switch(r){case"input":Lc(e),$w(e,n,!1);break;case"textarea":Lc(e),kw(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?Hi(e,!!n.multiple,a,!1):n.defaultValue!=null&&Hi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=md)}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 Kt(t),null;case 6:if(e&&t.stateNode!=null)F2(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(W(166));if(r=Na(Fs.current),Na(Qn.current),Qc(t)){if(n=t.stateNode,r=t.memoizedProps,n[Wn]=t,(a=n.nodeValue!==r)&&(e=Lr,e!==null))switch(e.tag){case 3:Gc(n.nodeValue,r,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Gc(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 Kt(t),null;case 13:if(nt(gt),n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(st&&Mr!==null&&t.mode&1&&!(t.flags&128))n2(),ol(),t.flags|=98560,a=!1;else if(a=Qc(t),n!==null&&n.dehydrated!==null){if(e===null){if(!a)throw Error(W(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(W(317));a[Wn]=t}else ol(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Kt(t),a=!1}else bn!==null&&(vv(bn),bn=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||gt.current&1?Nt===0&&(Nt=3):Jy())),t.updateQueue!==null&&(t.flags|=4),Kt(t),null);case 4:return il(),cv(e,t),e===null&&As(t.stateNode.containerInfo),Kt(t),null;case 10:return Ny(t.type._context),Kt(t),null;case 17:return br(t.type)&&hd(),Kt(t),null;case 19:if(nt(gt),a=t.memoizedState,a===null)return Kt(t),null;if(n=(t.flags&128)!==0,i=a.rendering,i===null)if(n)Ul(a,!1);else{if(Nt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(i=xd(e),i!==null){for(t.flags|=128,Ul(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 Ye(gt,gt.current&1|2),t.child}e=e.sibling}a.tail!==null&&St()>sl&&(t.flags|=128,n=!0,Ul(a,!1),t.lanes=4194304)}else{if(!n)if(e=xd(i),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Ul(a,!0),a.tail===null&&a.tailMode==="hidden"&&!i.alternate&&!st)return Kt(t),null}else 2*St()-a.renderingStartTime>sl&&r!==1073741824&&(t.flags|=128,n=!0,Ul(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=St(),t.sibling=null,r=gt.current,Ye(gt,n?r&1|2:r&1),t):(Kt(t),null);case 22:case 23:return Xy(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?Nr&1073741824&&(Kt(t),t.subtreeFlags&6&&(t.flags|=8192)):Kt(t),null;case 24:return null;case 25:return null}throw Error(W(156,t.tag))}function HL(e,t){switch(Ry(t),t.tag){case 1:return br(t.type)&&hd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return il(),nt(_r),nt(er),Fy(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ly(t),null;case 13:if(nt(gt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(W(340));ol()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return nt(gt),null;case 4:return il(),null;case 10:return Ny(t.type._context),null;case 22:case 23:return Xy(),null;case 24:return null;default:return null}}var Xc=!1,Xt=!1,qL=typeof WeakSet=="function"?WeakSet:Set,ne=null;function zi(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){wt(e,t,n)}else r.current=null}function uv(e,t,r){try{r()}catch(n){wt(e,t,n)}}var y_=!1;function GL(e,t){if(Gg=dd,e=WC(),ky(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 g;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),(g=p.firstChild)!==null;)h=p,p=g;for(;;){if(p===e)break t;if(h===r&&++u===o&&(l=i),h===a&&++d===n&&(c=i),(g=p.nextSibling)!==null)break;p=h,h=p.parentNode}p=g}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Qg={focusedElem:e,selectionRange:r},dd=!1,ne=t;ne!==null;)if(t=ne,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ne=e;else for(;ne!==null;){t=ne;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 w=v.memoizedProps,E=v.memoizedState,_=t.stateNode,y=_.getSnapshotBeforeUpdate(t.elementType===t.type?w:yn(t.type,w),E);_.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(b){wt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ne=e;break}ne=t.return}return v=y_,y_=!1,v}function vs(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&&uv(t,r,a)}o=o.next}while(o!==n)}}function Sm(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 dv(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 V2(e){var t=e.alternate;t!==null&&(e.alternate=null,V2(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Wn],delete t[zs],delete t[Xg],delete t[kL],delete t[jL])),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 B2(e){return e.tag===5||e.tag===3||e.tag===4}function w_(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||B2(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 fv(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=md));else if(n!==4&&(e=e.child,e!==null))for(fv(e,t,r),e=e.sibling;e!==null;)fv(e,t,r),e=e.sibling}function pv(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(pv(e,t,r),e=e.sibling;e!==null;)pv(e,t,r),e=e.sibling}var Ut=null,wn=!1;function Mo(e,t,r){for(r=r.child;r!==null;)U2(e,t,r),r=r.sibling}function U2(e,t,r){if(Gn&&typeof Gn.onCommitFiberUnmount=="function")try{Gn.onCommitFiberUnmount(gm,r)}catch{}switch(r.tag){case 5:Xt||zi(r,t);case 6:var n=Ut,o=wn;Ut=null,Mo(e,t,r),Ut=n,wn=o,Ut!==null&&(wn?(e=Ut,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ut.removeChild(r.stateNode));break;case 18:Ut!==null&&(wn?(e=Ut,r=r.stateNode,e.nodeType===8?jh(e.parentNode,r):e.nodeType===1&&jh(e,r),Is(e)):jh(Ut,r.stateNode));break;case 4:n=Ut,o=wn,Ut=r.stateNode.containerInfo,wn=!0,Mo(e,t,r),Ut=n,wn=o;break;case 0:case 11:case 14:case 15:if(!Xt&&(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)&&uv(r,t,i),o=o.next}while(o!==n)}Mo(e,t,r);break;case 1:if(!Xt&&(zi(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){wt(r,t,l)}Mo(e,t,r);break;case 21:Mo(e,t,r);break;case 22:r.mode&1?(Xt=(n=Xt)||r.memoizedState!==null,Mo(e,t,r),Xt=n):Mo(e,t,r);break;default:Mo(e,t,r)}}function __(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new qL),t.forEach(function(n){var o=r8.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function gn(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:Ut=l.stateNode,wn=!1;break e;case 3:Ut=l.stateNode.containerInfo,wn=!0;break e;case 4:Ut=l.stateNode.containerInfo,wn=!0;break e}l=l.return}if(Ut===null)throw Error(W(160));U2(a,i,o),Ut=null,wn=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){wt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)W2(t,e),t=t.sibling}function W2(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(gn(t,e),Nn(e),n&4){try{vs(3,e,e.return),Sm(3,e)}catch(w){wt(e,e.return,w)}try{vs(5,e,e.return)}catch(w){wt(e,e.return,w)}}break;case 1:gn(t,e),Nn(e),n&512&&r!==null&&zi(r,r.return);break;case 5:if(gn(t,e),Nn(e),n&512&&r!==null&&zi(r,r.return),e.flags&32){var o=e.stateNode;try{ks(o,"")}catch(w){wt(e,e.return,w)}}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&&dC(o,a),Mg(l,i);var u=Mg(l,a);for(i=0;i<c.length;i+=2){var d=c[i],p=c[i+1];d==="style"?gC(o,p):d==="dangerouslySetInnerHTML"?mC(o,p):d==="children"?ks(o,p):gy(o,d,p,u)}switch(l){case"input":Tg(o,a);break;case"textarea":fC(o,a);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!a.multiple;var g=a.value;g!=null?Hi(o,!!a.multiple,g,!1):h!==!!a.multiple&&(a.defaultValue!=null?Hi(o,!!a.multiple,a.defaultValue,!0):Hi(o,!!a.multiple,a.multiple?[]:"",!1))}o[zs]=a}catch(w){wt(e,e.return,w)}}break;case 6:if(gn(t,e),Nn(e),n&4){if(e.stateNode===null)throw Error(W(162));o=e.stateNode,a=e.memoizedProps;try{o.nodeValue=a}catch(w){wt(e,e.return,w)}}break;case 3:if(gn(t,e),Nn(e),n&4&&r!==null&&r.memoizedState.isDehydrated)try{Is(t.containerInfo)}catch(w){wt(e,e.return,w)}break;case 4:gn(t,e),Nn(e);break;case 13:gn(t,e),Nn(e),o=e.child,o.flags&8192&&(a=o.memoizedState!==null,o.stateNode.isHidden=a,!a||o.alternate!==null&&o.alternate.memoizedState!==null||(Ky=St())),n&4&&__(e);break;case 22:if(d=r!==null&&r.memoizedState!==null,e.mode&1?(Xt=(u=Xt)||d,gn(t,e),Xt=u):gn(t,e),Nn(e),n&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ne=e,d=e.child;d!==null;){for(p=ne=d;ne!==null;){switch(h=ne,g=h.child,h.tag){case 0:case 11:case 14:case 15:vs(4,h,h.return);break;case 1:zi(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(w){wt(n,r,w)}}break;case 5:zi(h,h.return);break;case 22:if(h.memoizedState!==null){x_(p);continue}}g!==null?(g.return=h,ne=g):x_(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=hC("display",i))}catch(w){wt(e,e.return,w)}}}else if(p.tag===6){if(d===null)try{p.stateNode.nodeValue=u?"":p.memoizedProps}catch(w){wt(e,e.return,w)}}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:gn(t,e),Nn(e),n&4&&__(e);break;case 21:break;default:gn(t,e),Nn(e)}}function Nn(e){var t=e.flags;if(t&2){try{e:{for(var r=e.return;r!==null;){if(B2(r)){var n=r;break e}r=r.return}throw Error(W(160))}switch(n.tag){case 5:var o=n.stateNode;n.flags&32&&(ks(o,""),n.flags&=-33);var a=w_(e);pv(e,a,o);break;case 3:case 4:var i=n.stateNode.containerInfo,l=w_(e);fv(e,l,i);break;default:throw Error(W(161))}}catch(c){wt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function QL(e,t,r){ne=e,H2(e)}function H2(e,t,r){for(var n=(e.mode&1)!==0;ne!==null;){var o=ne,a=o.child;if(o.tag===22&&n){var i=o.memoizedState!==null||Xc;if(!i){var l=o.alternate,c=l!==null&&l.memoizedState!==null||Xt;l=Xc;var u=Xt;if(Xc=i,(Xt=c)&&!u)for(ne=o;ne!==null;)i=ne,c=i.child,i.tag===22&&i.memoizedState!==null?E_(o):c!==null?(c.return=i,ne=c):E_(o);for(;a!==null;)ne=a,H2(a),a=a.sibling;ne=o,Xc=l,Xt=u}b_(e)}else o.subtreeFlags&8772&&a!==null?(a.return=o,ne=a):b_(e)}}function b_(e){for(;ne!==null;){var t=ne;if(t.flags&8772){var r=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Xt||Sm(5,t);break;case 1:var n=t.stateNode;if(t.flags&4&&!Xt)if(r===null)n.componentDidMount();else{var o=t.elementType===t.type?r.memoizedProps:yn(t.type,r.memoizedProps);n.componentDidUpdate(o,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;a!==null&&o_(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}o_(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&&Is(p)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(W(163))}Xt||t.flags&512&&dv(t)}catch(h){wt(t,t.return,h)}}if(t===e){ne=null;break}if(r=t.sibling,r!==null){r.return=t.return,ne=r;break}ne=t.return}}function x_(e){for(;ne!==null;){var t=ne;if(t===e){ne=null;break}var r=t.sibling;if(r!==null){r.return=t.return,ne=r;break}ne=t.return}}function E_(e){for(;ne!==null;){var t=ne;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{Sm(4,t)}catch(c){wt(t,r,c)}break;case 1:var n=t.stateNode;if(typeof n.componentDidMount=="function"){var o=t.return;try{n.componentDidMount()}catch(c){wt(t,o,c)}}var a=t.return;try{dv(t)}catch(c){wt(t,a,c)}break;case 5:var i=t.return;try{dv(t)}catch(c){wt(t,i,c)}}}catch(c){wt(t,t.return,c)}if(t===e){ne=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ne=l;break}ne=t.return}}var KL=Math.ceil,Pd=Oo.ReactCurrentDispatcher,Gy=Oo.ReactCurrentOwner,on=Oo.ReactCurrentBatchConfig,De=0,Lt=null,Rt=null,Ht=0,Nr=0,Li=pa(0),Nt=0,Ws=null,qa=0,Pm=0,Qy=0,ys=null,vr=null,Ky=0,sl=1/0,ao=null,Od=!1,mv=null,ta=null,Jc=!1,Go=null,$d=0,ws=0,hv=null,Wu=-1,Hu=0;function lr(){return De&6?St():Wu!==-1?Wu:Wu=St()}function ra(e){return e.mode&1?De&2&&Ht!==0?Ht&-Ht:TL.transition!==null?(Hu===0&&(Hu=CC()),Hu):(e=Ue,e!==0||(e=window.event,e=e===void 0?16:NC(e.type)),e):1}function Sn(e,t,r,n){if(50<ws)throw ws=0,hv=null,Error(W(185));ec(e,r,n),(!(De&2)||e!==Lt)&&(e===Lt&&(!(De&2)&&(Pm|=r),Nt===4&&Ho(e,Ht)),xr(e,n),r===1&&De===0&&!(t.mode&1)&&(sl=St()+500,bm&&ma()))}function xr(e,t){var r=e.callbackNode;Tz(e,t);var n=ud(e,e===Lt?Ht: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?RL(S_.bind(null,e)):e2(S_.bind(null,e)),$L(function(){!(De&6)&&ma()}),r=null;else{switch(kC(n)){case 1:r=by;break;case 4:r=OC;break;case 16:r=cd;break;case 536870912:r=$C;break;default:r=cd}r=Z2(r,q2.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function q2(e,t){if(Wu=-1,Hu=0,De&6)throw Error(W(327));var r=e.callbackNode;if(Yi()&&e.callbackNode!==r)return null;var n=ud(e,e===Lt?Ht:0);if(n===0)return null;if(n&30||n&e.expiredLanes||t)t=Cd(e,n);else{t=n;var o=De;De|=2;var a=Q2();(Lt!==e||Ht!==t)&&(ao=null,sl=St()+500,La(e,t));do try{JL();break}catch(l){G2(e,l)}while(1);Dy(),Pd.current=a,De=o,Rt!==null?t=0:(Lt=null,Ht=0,t=Nt)}if(t!==0){if(t===2&&(o=Bg(e),o!==0&&(n=o,t=gv(e,o))),t===1)throw r=Ws,La(e,0),Ho(e,n),xr(e,St()),r;if(t===6)Ho(e,n);else{if(o=e.current.alternate,!(n&30)&&!YL(o)&&(t=Cd(e,n),t===2&&(a=Bg(e),a!==0&&(n=a,t=gv(e,a))),t===1))throw r=Ws,La(e,0),Ho(e,n),xr(e,St()),r;switch(e.finishedWork=o,e.finishedLanes=n,t){case 0:case 1:throw Error(W(345));case 2:Ca(e,vr,ao);break;case 3:if(Ho(e,n),(n&130023424)===n&&(t=Ky+500-St(),10<t)){if(ud(e,0)!==0)break;if(o=e.suspendedLanes,(o&n)!==n){lr(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Yg(Ca.bind(null,e,vr,ao),t);break}Ca(e,vr,ao);break;case 4:if(Ho(e,n),(n&4194240)===n)break;for(t=e.eventTimes,o=-1;0<n;){var i=31-En(n);a=1<<i,i=t[i],i>o&&(o=i),n&=~a}if(n=o,n=St()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*KL(n/1960))-n,10<n){e.timeoutHandle=Yg(Ca.bind(null,e,vr,ao),n);break}Ca(e,vr,ao);break;case 5:Ca(e,vr,ao);break;default:throw Error(W(329))}}}return xr(e,St()),e.callbackNode===r?q2.bind(null,e):null}function gv(e,t){var r=ys;return e.current.memoizedState.isDehydrated&&(La(e,t).flags|=256),e=Cd(e,t),e!==2&&(t=vr,vr=r,t!==null&&vv(t)),e}function vv(e){vr===null?vr=e:vr.push.apply(vr,e)}function YL(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 Ho(e,t){for(t&=~Qy,t&=~Pm,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-En(t),n=1<<r;e[r]=-1,t&=~n}}function S_(e){if(De&6)throw Error(W(327));Yi();var t=ud(e,0);if(!(t&1))return xr(e,St()),null;var r=Cd(e,t);if(e.tag!==0&&r===2){var n=Bg(e);n!==0&&(t=n,r=gv(e,n))}if(r===1)throw r=Ws,La(e,0),Ho(e,t),xr(e,St()),r;if(r===6)throw Error(W(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ca(e,vr,ao),xr(e,St()),null}function Yy(e,t){var r=De;De|=1;try{return e(t)}finally{De=r,De===0&&(sl=St()+500,bm&&ma())}}function Ga(e){Go!==null&&Go.tag===0&&!(De&6)&&Yi();var t=De;De|=1;var r=on.transition,n=Ue;try{if(on.transition=null,Ue=1,e)return e()}finally{Ue=n,on.transition=r,De=t,!(De&6)&&ma()}}function Xy(){Nr=Li.current,nt(Li)}function La(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(r!==-1&&(e.timeoutHandle=-1,OL(r)),Rt!==null)for(r=Rt.return;r!==null;){var n=r;switch(Ry(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&hd();break;case 3:il(),nt(_r),nt(er),Fy();break;case 5:Ly(n);break;case 4:il();break;case 13:nt(gt);break;case 19:nt(gt);break;case 10:Ny(n.type._context);break;case 22:case 23:Xy()}r=r.return}if(Lt=e,Rt=e=na(e.current,null),Ht=Nr=t,Nt=0,Ws=null,Qy=Pm=qa=0,vr=ys=null,Da!==null){for(t=0;t<Da.length;t++)if(r=Da[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}Da=null}return e}function G2(e,t){do{var r=Rt;try{if(Dy(),Vu.current=Sd,Ed){for(var n=vt.memoizedState;n!==null;){var o=n.queue;o!==null&&(o.pending=null),n=n.next}Ed=!1}if(Ha=0,Mt=Dt=vt=null,gs=!1,Vs=0,Gy.current=null,r===null||r.return===null){Nt=1,Ws=t,Rt=null;break}e:{var a=e,i=r.return,l=r,c=t;if(t=Ht,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 g=d_(i);if(g!==null){g.flags&=-257,f_(g,i,l,a,t),g.mode&1&&u_(a,u,t),t=g,c=u;var v=t.updateQueue;if(v===null){var w=new Set;w.add(c),t.updateQueue=w}else v.add(c);break e}else{if(!(t&1)){u_(a,u,t),Jy();break e}c=Error(W(426))}}else if(st&&l.mode&1){var E=d_(i);if(E!==null){!(E.flags&65536)&&(E.flags|=256),f_(E,i,l,a,t),Ty(ll(c,l));break e}}a=c=ll(c,l),Nt!==4&&(Nt=2),ys===null?ys=[a]:ys.push(a),a=i;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t;var _=j2(a,c,t);n_(a,_);break e;case 1:l=c;var y=a.type,x=a.stateNode;if(!(a.flags&128)&&(typeof y.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(ta===null||!ta.has(x)))){a.flags|=65536,t&=-t,a.lanes|=t;var b=R2(a,l,t);n_(a,b);break e}}a=a.return}while(a!==null)}Y2(r)}catch(S){t=S,Rt===r&&r!==null&&(Rt=r=r.return);continue}break}while(1)}function Q2(){var e=Pd.current;return Pd.current=Sd,e===null?Sd:e}function Jy(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),Lt===null||!(qa&268435455)&&!(Pm&268435455)||Ho(Lt,Ht)}function Cd(e,t){var r=De;De|=2;var n=Q2();(Lt!==e||Ht!==t)&&(ao=null,La(e,t));do try{XL();break}catch(o){G2(e,o)}while(1);if(Dy(),De=r,Pd.current=n,Rt!==null)throw Error(W(261));return Lt=null,Ht=0,Nt}function XL(){for(;Rt!==null;)K2(Rt)}function JL(){for(;Rt!==null&&!Ez();)K2(Rt)}function K2(e){var t=J2(e.alternate,e,Nr);e.memoizedProps=e.pendingProps,t===null?Y2(e):Rt=t,Gy.current=null}function Y2(e){var t=e;do{var r=t.alternate;if(e=t.return,t.flags&32768){if(r=HL(r,t),r!==null){r.flags&=32767,Rt=r;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Nt=6,Rt=null;return}}else if(r=WL(r,t,Nr),r!==null){Rt=r;return}if(t=t.sibling,t!==null){Rt=t;return}Rt=t=e}while(t!==null);Nt===0&&(Nt=5)}function Ca(e,t,r){var n=Ue,o=on.transition;try{on.transition=null,Ue=1,ZL(e,t,r,n)}finally{on.transition=o,Ue=n}return null}function ZL(e,t,r,n){do Yi();while(Go!==null);if(De&6)throw Error(W(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(W(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(Iz(e,a),e===Lt&&(Rt=Lt=null,Ht=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Jc||(Jc=!0,Z2(cd,function(){return Yi(),null})),a=(r.flags&15990)!==0,r.subtreeFlags&15990||a){a=on.transition,on.transition=null;var i=Ue;Ue=1;var l=De;De|=4,Gy.current=null,GL(e,r),W2(r,e),wL(Qg),dd=!!Gg,Qg=Gg=null,e.current=r,QL(r),Sz(),De=l,Ue=i,on.transition=a}else e.current=r;if(Jc&&(Jc=!1,Go=e,$d=o),a=e.pendingLanes,a===0&&(ta=null),$z(r.stateNode),xr(e,St()),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(Od)throw Od=!1,e=mv,mv=null,e;return $d&1&&e.tag!==0&&Yi(),a=e.pendingLanes,a&1?e===hv?ws++:(ws=0,hv=e):ws=0,ma(),null}function Yi(){if(Go!==null){var e=kC($d),t=on.transition,r=Ue;try{if(on.transition=null,Ue=16>e?16:e,Go===null)var n=!1;else{if(e=Go,Go=null,$d=0,De&6)throw Error(W(331));var o=De;for(De|=4,ne=e.current;ne!==null;){var a=ne,i=a.child;if(ne.flags&16){var l=a.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ne=u;ne!==null;){var d=ne;switch(d.tag){case 0:case 11:case 15:vs(8,d,a)}var p=d.child;if(p!==null)p.return=d,ne=p;else for(;ne!==null;){d=ne;var h=d.sibling,g=d.return;if(V2(d),d===u){ne=null;break}if(h!==null){h.return=g,ne=h;break}ne=g}}}var v=a.alternate;if(v!==null){var w=v.child;if(w!==null){v.child=null;do{var E=w.sibling;w.sibling=null,w=E}while(w!==null)}}ne=a}}if(a.subtreeFlags&2064&&i!==null)i.return=a,ne=i;else e:for(;ne!==null;){if(a=ne,a.flags&2048)switch(a.tag){case 0:case 11:case 15:vs(9,a,a.return)}var _=a.sibling;if(_!==null){_.return=a.return,ne=_;break e}ne=a.return}}var y=e.current;for(ne=y;ne!==null;){i=ne;var x=i.child;if(i.subtreeFlags&2064&&x!==null)x.return=i,ne=x;else e:for(i=y;ne!==null;){if(l=ne,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Sm(9,l)}}catch(S){wt(l,l.return,S)}if(l===i){ne=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,ne=b;break e}ne=l.return}}if(De=o,ma(),Gn&&typeof Gn.onPostCommitFiberRoot=="function")try{Gn.onPostCommitFiberRoot(gm,e)}catch{}n=!0}return n}finally{Ue=r,on.transition=t}}return!1}function P_(e,t,r){t=ll(r,t),t=j2(e,t,1),e=ea(e,t,1),t=lr(),e!==null&&(ec(e,1,t),xr(e,t))}function wt(e,t,r){if(e.tag===3)P_(e,e,r);else for(;t!==null;){if(t.tag===3){P_(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=ll(r,e),e=R2(t,e,1),t=ea(t,e,1),e=lr(),t!==null&&(ec(t,1,e),xr(t,e));break}}t=t.return}}function e8(e,t,r){var n=e.pingCache;n!==null&&n.delete(t),t=lr(),e.pingedLanes|=e.suspendedLanes&r,Lt===e&&(Ht&r)===r&&(Nt===4||Nt===3&&(Ht&130023424)===Ht&&500>St()-Ky?La(e,0):Qy|=r),xr(e,t)}function X2(e,t){t===0&&(e.mode&1?(t=Bc,Bc<<=1,!(Bc&130023424)&&(Bc=4194304)):t=1);var r=lr();e=yo(e,t),e!==null&&(ec(e,t,r),xr(e,r))}function t8(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),X2(e,r)}function r8(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(W(314))}n!==null&&n.delete(t),X2(e,r)}var J2;J2=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||_r.current)yr=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return yr=!1,UL(e,t,r);yr=!!(e.flags&131072)}else yr=!1,st&&t.flags&1048576&&t2(t,yd,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Uu(e,t),e=t.pendingProps;var o=nl(t,er.current);Ki(t,r),o=By(null,t,n,e,o,r);var a=Uy();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,br(n)?(a=!0,gd(t)):a=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,My(t),o.updater=xm,t.stateNode=o,o._reactInternals=t,nv(t,n,e,r),t=iv(null,t,n,!0,a,r)):(t.tag=0,st&&a&&jy(t),ar(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Uu(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=o8(n),e=yn(n,e),o){case 0:t=av(null,t,n,e,r);break e;case 1:t=h_(null,t,n,e,r);break e;case 11:t=p_(null,t,n,e,r);break e;case 14:t=m_(null,t,n,yn(n.type,e),r);break e}throw Error(W(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:yn(n,o),av(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:yn(n,o),h_(e,t,n,o,r);case 3:e:{if(N2(t),e===null)throw Error(W(387));n=t.pendingProps,a=t.memoizedState,o=a.element,a2(e,t),bd(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=ll(Error(W(423)),t),t=g_(e,t,n,r,o);break e}else if(n!==o){o=ll(Error(W(424)),t),t=g_(e,t,n,r,o);break e}else for(Mr=Zo(t.stateNode.containerInfo.firstChild),Lr=t,st=!0,bn=null,r=c2(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(ol(),n===o){t=wo(e,t,r);break e}ar(e,t,n,r)}t=t.child}return t;case 5:return u2(t),e===null&&ev(t),n=t.type,o=t.pendingProps,a=e!==null?e.memoizedProps:null,i=o.children,Kg(n,o)?i=null:a!==null&&Kg(n,a)&&(t.flags|=32),D2(e,t),ar(e,t,i,r),t.child;case 6:return e===null&&ev(t),null;case 13:return A2(e,t,r);case 4:return zy(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=al(t,null,n,r):ar(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:yn(n,o),p_(e,t,n,o,r);case 7:return ar(e,t,t.pendingProps,r),t.child;case 8:return ar(e,t,t.pendingProps.children,r),t.child;case 12:return ar(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,Ye(wd,n._currentValue),n._currentValue=i,a!==null)if(On(a.value,i)){if(a.children===o.children&&!_r.current){t=wo(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=uo(-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),tv(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(W(341));i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),tv(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}ar(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,Ki(t,r),o=sn(o),n=n(o),t.flags|=1,ar(e,t,n,r),t.child;case 14:return n=t.type,o=yn(n,t.pendingProps),o=yn(n.type,o),m_(e,t,n,o,r);case 15:return T2(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:yn(n,o),Uu(e,t),t.tag=1,br(n)?(e=!0,gd(t)):e=!1,Ki(t,r),l2(t,n,o),nv(t,n,o,r),iv(null,t,n,!0,e,r);case 19:return M2(e,t,r);case 22:return I2(e,t,r)}throw Error(W(156,t.tag))};function Z2(e,t){return PC(e,t)}function n8(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 en(e,t,r,n){return new n8(e,t,r,n)}function Zy(e){return e=e.prototype,!(!e||!e.isReactComponent)}function o8(e){if(typeof e=="function")return Zy(e)?1:0;if(e!=null){if(e=e.$$typeof,e===yy)return 11;if(e===wy)return 14}return 2}function na(e,t){var r=e.alternate;return r===null?(r=en(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 qu(e,t,r,n,o,a){var i=2;if(n=e,typeof e=="function")Zy(e)&&(i=1);else if(typeof e=="string")i=5;else e:switch(e){case ki:return Fa(r.children,o,a,t);case vy:i=8,o|=8;break;case $g:return e=en(12,r,t,o|2),e.elementType=$g,e.lanes=a,e;case Cg:return e=en(13,r,t,o),e.elementType=Cg,e.lanes=a,e;case kg:return e=en(19,r,t,o),e.elementType=kg,e.lanes=a,e;case sC:return Om(r,o,a,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iC:i=10;break e;case lC:i=9;break e;case yy:i=11;break e;case wy:i=14;break e;case Fo:i=16,n=null;break e}throw Error(W(130,e==null?e:typeof e,""))}return t=en(i,r,t,o),t.elementType=e,t.type=n,t.lanes=a,t}function Fa(e,t,r,n){return e=en(7,e,n,t),e.lanes=r,e}function Om(e,t,r,n){return e=en(22,e,n,t),e.elementType=sC,e.lanes=r,e.stateNode={isHidden:!1},e}function zh(e,t,r){return e=en(6,e,null,t),e.lanes=r,e}function Lh(e,t,r){return t=en(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function a8(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=wh(0),this.expirationTimes=wh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wh(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function e0(e,t,r,n,o,a,i,l,c){return e=new a8(e,t,r,l,c),t===1?(t=1,a===!0&&(t|=8)):t=0,a=en(3,null,null,t),e.current=a,a.stateNode=e,a.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},My(a),e}function i8(e,t,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ci,key:n==null?null:""+n,children:e,containerInfo:t,implementation:r}}function ek(e){if(!e)return ia;e=e._reactInternals;e:{if(ni(e)!==e||e.tag!==1)throw Error(W(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(br(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(W(171))}if(e.tag===1){var r=e.type;if(br(r))return ZC(e,r,t)}return t}function tk(e,t,r,n,o,a,i,l,c){return e=e0(r,n,!0,e,o,a,i,l,c),e.context=ek(null),r=e.current,n=lr(),o=ra(r),a=uo(n,o),a.callback=t??null,ea(r,a,o),e.current.lanes=o,ec(e,o,n),xr(e,n),e}function $m(e,t,r,n){var o=t.current,a=lr(),i=ra(o);return r=ek(r),t.context===null?t.context=r:t.pendingContext=r,t=uo(a,i),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),e=ea(o,t,i),e!==null&&(Sn(e,o,i,a),Fu(e,o,i)),i}function kd(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 O_(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<t?r:t}}function t0(e,t){O_(e,t),(e=e.alternate)&&O_(e,t)}function l8(){return null}var rk=typeof reportError=="function"?reportError:function(e){console.error(e)};function r0(e){this._internalRoot=e}Cm.prototype.render=r0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(W(409));$m(e,t,null,null)};Cm.prototype.unmount=r0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ga(function(){$m(null,e,null,null)}),t[vo]=null}};function Cm(e){this._internalRoot=e}Cm.prototype.unstable_scheduleHydration=function(e){if(e){var t=TC();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Wo.length&&t!==0&&t<Wo[r].priority;r++);Wo.splice(r,0,e),r===0&&DC(e)}};function n0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function km(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function $_(){}function s8(e,t,r,n,o){if(o){if(typeof n=="function"){var a=n;n=function(){var u=kd(i);a.call(u)}}var i=tk(t,n,e,0,null,!1,!1,"",$_);return e._reactRootContainer=i,e[vo]=i.current,As(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=kd(c);l.call(u)}}var c=e0(e,0,!1,null,null,!1,!1,"",$_);return e._reactRootContainer=c,e[vo]=c.current,As(e.nodeType===8?e.parentNode:e),Ga(function(){$m(t,c,r,n)}),c}function jm(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=kd(i);l.call(c)}}$m(t,i,e,o)}else i=s8(r,t,e,o,n);return kd(i)}jC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=is(t.pendingLanes);r!==0&&(xy(t,r|1),xr(t,St()),!(De&6)&&(sl=St()+500,ma()))}break;case 13:Ga(function(){var n=yo(e,1);if(n!==null){var o=lr();Sn(n,e,1,o)}}),t0(e,1)}};Ey=function(e){if(e.tag===13){var t=yo(e,134217728);if(t!==null){var r=lr();Sn(t,e,134217728,r)}t0(e,134217728)}};RC=function(e){if(e.tag===13){var t=ra(e),r=yo(e,t);if(r!==null){var n=lr();Sn(r,e,t,n)}t0(e,t)}};TC=function(){return Ue};IC=function(e,t){var r=Ue;try{return Ue=e,t()}finally{Ue=r}};Lg=function(e,t,r){switch(t){case"input":if(Tg(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=_m(n);if(!o)throw Error(W(90));uC(n),Tg(n,o)}}}break;case"textarea":fC(e,r);break;case"select":t=r.value,t!=null&&Hi(e,!!r.multiple,t,!1)}};wC=Yy;_C=Ga;var c8={usingClientEntryPoint:!1,Events:[rc,Ii,_m,vC,yC,Yy]},Wl={findFiberByHostInstance:Ia,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},u8={bundleType:Wl.bundleType,version:Wl.version,rendererPackageName:Wl.rendererPackageName,rendererConfig:Wl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Oo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=EC(e),e===null?null:e.stateNode},findFiberByHostInstance:Wl.findFiberByHostInstance||l8,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 Zc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Zc.isDisabled&&Zc.supportsFiber)try{gm=Zc.inject(u8),Gn=Zc}catch{}}Ur.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=c8;Ur.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!n0(t))throw Error(W(200));return i8(e,t,null,r)};Ur.createRoot=function(e,t){if(!n0(e))throw Error(W(299));var r=!1,n="",o=rk;return t!=null&&(t.unstable_strictMode===!0&&(r=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=e0(e,1,!1,null,null,r,!1,n,o),e[vo]=t.current,As(e.nodeType===8?e.parentNode:e),new r0(t)};Ur.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(W(188)):(e=Object.keys(e).join(","),Error(W(268,e)));return e=EC(t),e=e===null?null:e.stateNode,e};Ur.flushSync=function(e){return Ga(e)};Ur.hydrate=function(e,t,r){if(!km(t))throw Error(W(200));return jm(null,e,t,!0,r)};Ur.hydrateRoot=function(e,t,r){if(!n0(e))throw Error(W(405));var n=r!=null&&r.hydratedSources||null,o=!1,a="",i=rk;if(r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(a=r.identifierPrefix),r.onRecoverableError!==void 0&&(i=r.onRecoverableError)),t=tk(t,null,e,1,r??null,o,!1,a,i),e[vo]=t.current,As(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 Cm(t)};Ur.render=function(e,t,r){if(!km(t))throw Error(W(200));return jm(null,e,t,!1,r)};Ur.unmountComponentAtNode=function(e){if(!km(e))throw Error(W(40));return e._reactRootContainer?(Ga(function(){jm(null,null,e,!1,function(){e._reactRootContainer=null,e[vo]=null})}),!0):!1};Ur.unstable_batchedUpdates=Yy;Ur.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!km(r))throw Error(W(200));if(e==null||e._reactInternals===void 0)throw Error(W(38));return jm(e,t,r,!1,n)};Ur.version="18.2.0-next-9e3b772b8-20220608";function nk(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(nk)}catch(e){console.error(e)}}nk(),tC.exports=Ur;var oc=tC.exports;const Fh=Zv(oc);var d8=Object.defineProperty,f8=Object.defineProperties,p8=Object.getOwnPropertyDescriptors,C_=Object.getOwnPropertySymbols,m8=Object.prototype.hasOwnProperty,h8=Object.prototype.propertyIsEnumerable,k_=(e,t,r)=>t in e?d8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yv=(e,t)=>{for(var r in t||(t={}))m8.call(t,r)&&k_(e,r,t[r]);if(C_)for(var r of C_(t))h8.call(t,r)&&k_(e,r,t[r]);return e},j_=(e,t)=>f8(e,p8(t));const g8=["subtle","filled","outline","light","default","transparent","gradient"],eu={xs:P(18),sm:P(22),md:P(28),lg:P(34),xl:P(44)};function v8({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%"})}:g8.includes(e)?yv({border:`${P(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover})):null}var y8=U((e,{radius:t,color:r,gradient:n},{variant:o,size:a})=>({root:j_(yv({position:"relative",borderRadius:e.fn.radius(t),padding:0,lineHeight:1,display:"flex",alignItems:"center",justifyContent:"center",height:M({size:a,sizes:eu}),minHeight:M({size:a,sizes:eu}),width:M({size:a,sizes:eu}),minWidth:M({size:a,sizes:eu})},v8({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":j_(yv({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 w8=y8;var _8=Object.defineProperty,jd=Object.getOwnPropertySymbols,ok=Object.prototype.hasOwnProperty,ak=Object.prototype.propertyIsEnumerable,R_=(e,t,r)=>t in e?_8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,T_=(e,t)=>{for(var r in t||(t={}))ok.call(t,r)&&R_(e,r,t[r]);if(jd)for(var r of jd(t))ak.call(t,r)&&R_(e,r,t[r]);return e},I_=(e,t)=>{var r={};for(var n in e)ok.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&&ak.call(e,n)&&(r[n]=e[n]);return r};function b8(e){var t=e,{size:r,color:n}=t,o=I_(t,["size","color"]);const a=o,{style:i}=a,l=I_(a,["style"]);return s.createElement("svg",T_({viewBox:"0 0 135 140",xmlns:"http://www.w3.org/2000/svg",fill:n,style:T_({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 x8=Object.defineProperty,Rd=Object.getOwnPropertySymbols,ik=Object.prototype.hasOwnProperty,lk=Object.prototype.propertyIsEnumerable,D_=(e,t,r)=>t in e?x8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,N_=(e,t)=>{for(var r in t||(t={}))ik.call(t,r)&&D_(e,r,t[r]);if(Rd)for(var r of Rd(t))lk.call(t,r)&&D_(e,r,t[r]);return e},A_=(e,t)=>{var r={};for(var n in e)ik.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Rd)for(var n of Rd(e))t.indexOf(n)<0&&lk.call(e,n)&&(r[n]=e[n]);return r};function E8(e){var t=e,{size:r,color:n}=t,o=A_(t,["size","color"]);const a=o,{style:i}=a,l=A_(a,["style"]);return s.createElement("svg",N_({viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg",stroke:n,style:N_({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 S8=Object.defineProperty,Td=Object.getOwnPropertySymbols,sk=Object.prototype.hasOwnProperty,ck=Object.prototype.propertyIsEnumerable,M_=(e,t,r)=>t in e?S8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z_=(e,t)=>{for(var r in t||(t={}))sk.call(t,r)&&M_(e,r,t[r]);if(Td)for(var r of Td(t))ck.call(t,r)&&M_(e,r,t[r]);return e},L_=(e,t)=>{var r={};for(var n in e)sk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Td)for(var n of Td(e))t.indexOf(n)<0&&ck.call(e,n)&&(r[n]=e[n]);return r};function P8(e){var t=e,{size:r,color:n}=t,o=L_(t,["size","color"]);const a=o,{style:i}=a,l=L_(a,["style"]);return s.createElement("svg",z_({viewBox:"0 0 120 30",xmlns:"http://www.w3.org/2000/svg",fill:n,style:z_({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 O8=Object.defineProperty,Id=Object.getOwnPropertySymbols,uk=Object.prototype.hasOwnProperty,dk=Object.prototype.propertyIsEnumerable,F_=(e,t,r)=>t in e?O8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$8=(e,t)=>{for(var r in t||(t={}))uk.call(t,r)&&F_(e,r,t[r]);if(Id)for(var r of Id(t))dk.call(t,r)&&F_(e,r,t[r]);return e},C8=(e,t)=>{var r={};for(var n in e)uk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Id)for(var n of Id(e))t.indexOf(n)<0&&dk.call(e,n)&&(r[n]=e[n]);return r};const Vh={bars:b8,oval:E8,dots:P8},k8={xs:P(18),sm:P(22),md:P(36),lg:P(44),xl:P(58)},j8={size:"md"};function un(e){const t=H("Loader",j8,e),{size:r,color:n,variant:o}=t,a=C8(t,["size","color","variant"]),i=tr(),l=o in Vh?o:i.loader;return s.createElement(se,$8({role:"presentation",component:Vh[l]||Vh.bars,size:M({size:r,sizes:k8}),color:i.fn.variant({variant:"filled",primaryFallback:!1,color:n||i.primaryColor}).background},a))}un.displayName="@mantine/core/Loader";var R8=Object.defineProperty,Dd=Object.getOwnPropertySymbols,fk=Object.prototype.hasOwnProperty,pk=Object.prototype.propertyIsEnumerable,V_=(e,t,r)=>t in e?R8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,B_=(e,t)=>{for(var r in t||(t={}))fk.call(t,r)&&V_(e,r,t[r]);if(Dd)for(var r of Dd(t))pk.call(t,r)&&V_(e,r,t[r]);return e},T8=(e,t)=>{var r={};for(var n in e)fk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Dd)for(var n of Dd(e))t.indexOf(n)<0&&pk.call(e,n)&&(r[n]=e[n]);return r};const I8={color:"gray",size:"md",variant:"subtle"},mk=f.forwardRef((e,t)=>{const r=H("ActionIcon",I8,e),{className:n,color:o,children:a,radius:i,size:l,variant:c,gradient:u,disabled:d,loaderProps:p,loading:h,unstyled:g,__staticSelector:v}=r,w=T8(r,["className","color","children","radius","size","variant","gradient","disabled","loaderProps","loading","unstyled","__staticSelector"]),{classes:E,cx:_,theme:y}=w8({radius:i,color:o,gradient:u},{name:["ActionIcon",v],unstyled:g,size:l,variant:c}),x=s.createElement(un,B_({color:y.fn.variant({color:o,variant:c}).color,size:"100%","data-action-icon-loader":!0},p));return s.createElement(ho,B_({className:_(E.root,n),ref:t,disabled:d,"data-disabled":d||void 0,"data-loading":h||void 0,unstyled:g},w),h?x:a)});mk.displayName="@mantine/core/ActionIcon";const sr=mk;var D8=Object.defineProperty,N8=Object.defineProperties,A8=Object.getOwnPropertyDescriptors,Nd=Object.getOwnPropertySymbols,hk=Object.prototype.hasOwnProperty,gk=Object.prototype.propertyIsEnumerable,U_=(e,t,r)=>t in e?D8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,M8=(e,t)=>{for(var r in t||(t={}))hk.call(t,r)&&U_(e,r,t[r]);if(Nd)for(var r of Nd(t))gk.call(t,r)&&U_(e,r,t[r]);return e},z8=(e,t)=>N8(e,A8(t)),L8=(e,t)=>{var r={};for(var n in e)hk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Nd)for(var n of Nd(e))t.indexOf(n)<0&&gk.call(e,n)&&(r[n]=e[n]);return r};function o0(e){const t=H("Portal",{},e),{children:r,target:n,className:o,innerRef:a}=t,i=L8(t,["children","target","className","innerRef"]),l=tr(),[c,u]=f.useState(!1),d=f.useRef();return U$(()=>(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?oc.createPortal(s.createElement("div",z8(M8({className:o,dir:l.dir},i),{ref:a}),r),d.current):null}o0.displayName="@mantine/core/Portal";var F8=Object.defineProperty,Ad=Object.getOwnPropertySymbols,vk=Object.prototype.hasOwnProperty,yk=Object.prototype.propertyIsEnumerable,W_=(e,t,r)=>t in e?F8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,V8=(e,t)=>{for(var r in t||(t={}))vk.call(t,r)&&W_(e,r,t[r]);if(Ad)for(var r of Ad(t))yk.call(t,r)&&W_(e,r,t[r]);return e},B8=(e,t)=>{var r={};for(var n in e)vk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ad)for(var n of Ad(e))t.indexOf(n)<0&&yk.call(e,n)&&(r[n]=e[n]);return r};function El(e){var t=e,{withinPortal:r=!0,children:n}=t,o=B8(t,["withinPortal","children"]);return r?s.createElement(o0,V8({},o),n):s.createElement(s.Fragment,null,n)}El.displayName="@mantine/core/OptionalPortal";var U8=Object.defineProperty,W8=Object.defineProperties,H8=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,q8=Object.prototype.hasOwnProperty,G8=Object.prototype.propertyIsEnumerable,q_=(e,t,r)=>t in e?U8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bh=(e,t)=>{for(var r in t||(t={}))q8.call(t,r)&&q_(e,r,t[r]);if(H_)for(var r of H_(t))G8.call(t,r)&&q_(e,r,t[r]);return e},G_=(e,t)=>W8(e,H8(t));function Q8({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 K8=U((e,{radius:t,color:r},{variant:n})=>({root:Bh(G_(Bh({},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`}),Q8({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:G_(Bh({},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 Y8=K8;var X8=Object.defineProperty,Md=Object.getOwnPropertySymbols,wk=Object.prototype.hasOwnProperty,_k=Object.prototype.propertyIsEnumerable,Q_=(e,t,r)=>t in e?X8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,K_=(e,t)=>{for(var r in t||(t={}))wk.call(t,r)&&Q_(e,r,t[r]);if(Md)for(var r of Md(t))_k.call(t,r)&&Q_(e,r,t[r]);return e},J8=(e,t)=>{var r={};for(var n in e)wk.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Md)for(var n of Md(e))t.indexOf(n)<0&&_k.call(e,n)&&(r[n]=e[n]);return r};function bk(e){const t=e,{width:r,height:n,style:o}=t,a=J8(t,["width","height","style"]);return s.createElement("svg",K_({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:K_({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"}))}bk.displayName="@mantine/core/CloseIcon";var Z8=Object.defineProperty,zd=Object.getOwnPropertySymbols,xk=Object.prototype.hasOwnProperty,Ek=Object.prototype.propertyIsEnumerable,Y_=(e,t,r)=>t in e?Z8(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,e7=(e,t)=>{for(var r in t||(t={}))xk.call(t,r)&&Y_(e,r,t[r]);if(zd)for(var r of zd(t))Ek.call(t,r)&&Y_(e,r,t[r]);return e},t7=(e,t)=>{var r={};for(var n in e)xk.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&&Ek.call(e,n)&&(r[n]=e[n]);return r};const r7={xs:P(12),sm:P(16),md:P(20),lg:P(28),xl:P(34)},n7={size:"sm"},Sk=f.forwardRef((e,t)=>{const r=H("CloseButton",n7,e),{iconSize:n,size:o,children:a}=r,i=t7(r,["iconSize","size","children"]),l=P(n||r7[o]);return s.createElement(sr,e7({ref:t,__staticSelector:"CloseButton",size:o},i),a||s.createElement(bk,{width:l,height:l}))});Sk.displayName="@mantine/core/CloseButton";const ac=Sk;var o7=Object.defineProperty,Ld=Object.getOwnPropertySymbols,Pk=Object.prototype.hasOwnProperty,Ok=Object.prototype.propertyIsEnumerable,X_=(e,t,r)=>t in e?o7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,a7=(e,t)=>{for(var r in t||(t={}))Pk.call(t,r)&&X_(e,r,t[r]);if(Ld)for(var r of Ld(t))Ok.call(t,r)&&X_(e,r,t[r]);return e},i7=(e,t)=>{var r={};for(var n in e)Pk.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&&Ok.call(e,n)&&(r[n]=e[n]);return r};const l7={variant:"light"},ic=f.forwardRef((e,t)=>{const r=H("Alert",l7,e),{id:n,className:o,title:a,variant:i,children:l,color:c,classNames:u,icon:d,styles:p,onClose:h,radius:g,withCloseButton:v,closeButtonLabel:w,unstyled:E}=r,_=i7(r,["id","className","title","variant","children","color","classNames","icon","styles","onClose","radius","withCloseButton","closeButtonLabel","unstyled"]),{classes:y,cx:x}=Y8({color:c,radius:g},{classNames:u,styles:p,unstyled:E,variant:i,name:"Alert"}),b=$r(n),S=a&&`${b}-title`,$=`${b}-body`;return s.createElement(se,a7({id:b,role:"alert","aria-labelledby":S,"aria-describedby":$,className:x(y.root,y[i],o),ref:t},_),s.createElement("div",{className:y.wrapper},d&&s.createElement("div",{className:y.icon},d),s.createElement("div",{className:y.body},a&&s.createElement("div",{className:y.title,"data-with-close-button":v||void 0},s.createElement("span",{id:S,className:y.label},a)),s.createElement("div",{id:$,className:y.message},l)),v&&s.createElement(ac,{className:y.closeButton,onClick:h,variant:"transparent",size:16,iconSize:16,"aria-label":w})))});ic.displayName="@mantine/core/Alert";var s7=Object.defineProperty,c7=Object.defineProperties,u7=Object.getOwnPropertyDescriptors,J_=Object.getOwnPropertySymbols,d7=Object.prototype.hasOwnProperty,f7=Object.prototype.propertyIsEnumerable,Z_=(e,t,r)=>t in e?s7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tu=(e,t)=>{for(var r in t||(t={}))d7.call(t,r)&&Z_(e,r,t[r]);if(J_)for(var r of J_(t))f7.call(t,r)&&Z_(e,r,t[r]);return e},p7=(e,t)=>c7(e,u7(t));function m7({underline:e,strikethrough:t}){const r=[];return e&&r.push("underline"),t&&r.push("line-through"),r.length>0?r.join(" "):"none"}function h7({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 g7(e){return typeof e=="number"?{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:e,WebkitBoxOrient:"vertical"}:null}function v7({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 y7=U((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:g})=>{const v=e.fn.variant({variant:"gradient",gradient:l});return{root:p7(tu(tu(tu(tu({},e.fn.fontStyles()),e.fn.focusStyles()),g7(r)),v7({theme:e,truncate:n})),{color:h7({color:t,theme:e}),fontFamily:a?"inherit":e.fontFamily,fontSize:a||g===void 0?"inherit":M({size:g,sizes:e.fontSizes}),lineHeight:a?"inherit":o?1:e.lineHeight,textDecoration:m7({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 w7=y7;var _7=Object.defineProperty,Fd=Object.getOwnPropertySymbols,$k=Object.prototype.hasOwnProperty,Ck=Object.prototype.propertyIsEnumerable,eb=(e,t,r)=>t in e?_7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,b7=(e,t)=>{for(var r in t||(t={}))$k.call(t,r)&&eb(e,r,t[r]);if(Fd)for(var r of Fd(t))Ck.call(t,r)&&eb(e,r,t[r]);return e},x7=(e,t)=>{var r={};for(var n in e)$k.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&&Ck.call(e,n)&&(r[n]=e[n]);return r};const E7={variant:"text"},kk=f.forwardRef((e,t)=>{const r=H("Text",E7,e),{className:n,size:o,weight:a,transform:i,color:l,align:c,variant:u,lineClamp:d,truncate:p,gradient:h,inline:g,inherit:v,underline:w,strikethrough:E,italic:_,classNames:y,styles:x,unstyled:b,span:S,__staticSelector:$}=r,O=x7(r,["className","size","weight","transform","color","align","variant","lineClamp","truncate","gradient","inline","inherit","underline","strikethrough","italic","classNames","styles","unstyled","span","__staticSelector"]),{classes:C,cx:T}=w7({color:l,lineClamp:d,truncate:p,inline:g,inherit:v,underline:w,strikethrough:E,italic:_,weight:a,transform:i,align:c,gradient:h},{unstyled:b,name:$||"Text",variant:u,size:o});return s.createElement(se,b7({ref:t,className:T(C.root,{[C.gradient]:u==="gradient"},n),component:S?"span":"div"},O))});kk.displayName="@mantine/core/Text";const ae=kk;var S7=Object.defineProperty,tb=Object.getOwnPropertySymbols,P7=Object.prototype.hasOwnProperty,O7=Object.prototype.propertyIsEnumerable,rb=(e,t,r)=>t in e?S7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$7=(e,t)=>{for(var r in t||(t={}))P7.call(t,r)&&rb(e,r,t[r]);if(tb)for(var r of tb(t))O7.call(t,r)&&rb(e,r,t[r]);return e};function C7({theme:e,color:t}){return t==="dimmed"?e.fn.dimmed():e.fn.themeColor(t||e.primaryColor,e.colorScheme==="dark"?4:7,!1,!0)}var k7=U((e,{color:t,underline:r})=>({root:$7({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:C7({theme:e,color:t})},e.fn.hover({textDecoration:r?"underline":"none"}))}));const j7=k7;var R7=Object.defineProperty,Vd=Object.getOwnPropertySymbols,jk=Object.prototype.hasOwnProperty,Rk=Object.prototype.propertyIsEnumerable,nb=(e,t,r)=>t in e?R7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ob=(e,t)=>{for(var r in t||(t={}))jk.call(t,r)&&nb(e,r,t[r]);if(Vd)for(var r of Vd(t))Rk.call(t,r)&&nb(e,r,t[r]);return e},T7=(e,t)=>{var r={};for(var n in e)jk.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&&Rk.call(e,n)&&(r[n]=e[n]);return r};const I7={underline:!0},Tk=f.forwardRef((e,t)=>{const r=H("Anchor",I7,e),{component:n,className:o,unstyled:a,variant:i,size:l,color:c,underline:u}=r,d=T7(r,["component","className","unstyled","variant","size","color","underline"]),{classes:p,cx:h}=j7({color:c,underline:u},{name:"Anchor",unstyled:a,variant:i,size:l}),g=n==="button"?{type:"button"}:null;return s.createElement(ae,ob(ob({component:n||"a",ref:t,className:h(p.root,o),size:l},g),d))});Tk.displayName="@mantine/core/Anchor";const Be=Tk,Ik=f.createContext({zIndex:1e3,fixed:!1,layout:"default"}),D7=Ik.Provider;function Dk(){return f.useContext(Ik)}function Rm(e,t){if(!e)return[];const r=Object.keys(e).filter(n=>n!=="base").map(n=>[M({size:n,sizes:t.breakpoints,units:"em"}),e[n]]);return r.sort((n,o)=>ln(n[0])-ln(o[0])),r}var N7=Object.defineProperty,A7=Object.defineProperties,M7=Object.getOwnPropertyDescriptors,ab=Object.getOwnPropertySymbols,z7=Object.prototype.hasOwnProperty,L7=Object.prototype.propertyIsEnumerable,ib=(e,t,r)=>t in e?N7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ru=(e,t)=>{for(var r in t||(t={}))z7.call(t,r)&&ib(e,r,t[r]);if(ab)for(var r of ab(t))L7.call(t,r)&&ib(e,r,t[r]);return e},lb=(e,t)=>A7(e,M7(t)),F7=U((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?Rm(r,e).reduce((h,[g,v])=>(h[`@media (min-width: ${ir(g)})`]={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:lb(ru(ru(lb(ru(ru({},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: ${ir(ln(M({size:a,sizes:e.breakpoints}))-1)})`]:{display:"none"}}})}});const V7=F7;var B7=Object.defineProperty,Bd=Object.getOwnPropertySymbols,Nk=Object.prototype.hasOwnProperty,Ak=Object.prototype.propertyIsEnumerable,sb=(e,t,r)=>t in e?B7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cb=(e,t)=>{for(var r in t||(t={}))Nk.call(t,r)&&sb(e,r,t[r]);if(Bd)for(var r of Bd(t))Ak.call(t,r)&&sb(e,r,t[r]);return e},U7=(e,t)=>{var r={};for(var n in e)Nk.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&&Ak.call(e,n)&&(r[n]=e[n]);return r};const Mk=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:g,children:v,section:w,__staticSelector:E,unstyled:_,variant:y}=r,x=U7(r,["width","height","fixed","position","zIndex","hiddenBreakpoint","hidden","withBorder","className","classNames","styles","children","section","__staticSelector","unstyled","variant"]);const b=Dk(),{classes:S,cx:$,theme:O}=V7({width:n,height:o,fixed:b.fixed||a,position:i,hiddenBreakpoint:c,zIndex:l||b.zIndex||jn("app"),section:w,withBorder:d,layout:b.layout},{classNames:h,styles:g,name:E,unstyled:_,variant:y}),C=Rm(n,O).reduce((T,[j,k])=>(T[`@media (min-width: ${ir(j)})`]={[`--mantine-${w}-width`]:P(k)},T),{});return s.createElement(se,cb({component:w==="navbar"?"nav":"aside",ref:t,"data-hidden":u||void 0,className:$(S.root,p)},x),v,s.createElement(B$,{styles:()=>({":root":cb({[`--mantine-${w}-width`]:n!=null&&n.base?P(n.base):"0rem"},C)})}))});Mk.displayName="@mantine/core/HorizontalSection";var W7=Object.defineProperty,Ud=Object.getOwnPropertySymbols,zk=Object.prototype.hasOwnProperty,Lk=Object.prototype.propertyIsEnumerable,ub=(e,t,r)=>t in e?W7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H7=(e,t)=>{for(var r in t||(t={}))zk.call(t,r)&&ub(e,r,t[r]);if(Ud)for(var r of Ud(t))Lk.call(t,r)&&ub(e,r,t[r]);return e},q7=(e,t)=>{var r={};for(var n in e)zk.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&&Lk.call(e,n)&&(r[n]=e[n]);return r};const Fk=f.forwardRef((e,t)=>{var r=e,{children:n,grow:o=!1,sx:a}=r,i=q7(r,["children","grow","sx"]);return s.createElement(se,H7({ref:t,sx:[{flex:o?1:0,boxSizing:"border-box"},...em(a)]},i),n)});Fk.displayName="@mantine/core/Section";const G7=Fk;var Q7=Object.defineProperty,db=Object.getOwnPropertySymbols,K7=Object.prototype.hasOwnProperty,Y7=Object.prototype.propertyIsEnumerable,fb=(e,t,r)=>t in e?Q7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,X7=(e,t)=>{for(var r in t||(t={}))K7.call(t,r)&&fb(e,r,t[r]);if(db)for(var r of db(t))Y7.call(t,r)&&fb(e,r,t[r]);return e};const J7={fixed:!1,position:{top:0,left:0},hiddenBreakpoint:"md",hidden:!1},_s=f.forwardRef((e,t)=>{const r=H("Navbar",J7,e);return s.createElement(Mk,X7({section:"navbar",__staticSelector:"Navbar",ref:t},r))});_s.Section=G7;_s.displayName="@mantine/core/Navbar";var Z7=Object.defineProperty,e9=Object.defineProperties,t9=Object.getOwnPropertyDescriptors,pb=Object.getOwnPropertySymbols,r9=Object.prototype.hasOwnProperty,n9=Object.prototype.propertyIsEnumerable,mb=(e,t,r)=>t in e?Z7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uh=(e,t)=>{for(var r in t||(t={}))r9.call(t,r)&&mb(e,r,t[r]);if(pb)for(var r of pb(t))n9.call(t,r)&&mb(e,r,t[r]);return e},hb=(e,t)=>e9(e,t9(t)),o9=U((e,{height:t,fixed:r,position:n,zIndex:o,borderPosition:a,layout:i})=>{const l=typeof t=="object"&&t!==null?Rm(t,e).reduce((c,[u,d])=>(c[`@media (min-width: ${ir(u)})`]={height:P(d),minHeight:P(d)},c),{}):null;return{root:hb(Uh(hb(Uh(Uh({},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 a9=o9;var i9=Object.defineProperty,Wd=Object.getOwnPropertySymbols,Vk=Object.prototype.hasOwnProperty,Bk=Object.prototype.propertyIsEnumerable,gb=(e,t,r)=>t in e?i9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vb=(e,t)=>{for(var r in t||(t={}))Vk.call(t,r)&&gb(e,r,t[r]);if(Wd)for(var r of Wd(t))Bk.call(t,r)&&gb(e,r,t[r]);return e},l9=(e,t)=>{var r={};for(var n in e)Vk.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&&Bk.call(e,n)&&(r[n]=e[n]);return r};const Uk=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:g,__staticSelector:v,variant:w}=r,E=l9(r,["children","className","classNames","styles","height","fixed","withBorder","position","zIndex","section","unstyled","__staticSelector","variant"]);const _=Dk(),y=p||_.zIndex||jn("app"),{classes:x,cx:b,theme:S}=a9({height:l,fixed:_.fixed||c,position:d,zIndex:typeof y=="number"&&_.layout==="default"?y+1:y,layout:_.layout,borderPosition:u?h==="header"?"bottom":"top":"none"},{name:v,classNames:a,styles:i,unstyled:g,variant:w}),$=typeof l=="object"&&l!==null?Rm(l,S).reduce((O,[C,T])=>(O[`@media (min-width: ${ir(C)})`]={[`--mantine-${h}-height`]:P(T)},O),{}):null;return s.createElement(se,vb({component:h==="header"?"header":"footer",className:b(x.root,o),ref:t},E),n,s.createElement(B$,{styles:()=>({":root":vb({[`--mantine-${h}-height`]:typeof l=="object"?P(l==null?void 0:l.base)||"100%":P(l)},$)})}))});Uk.displayName="@mantine/core/VerticalSection";var s9=Object.defineProperty,c9=Object.defineProperties,u9=Object.getOwnPropertyDescriptors,yb=Object.getOwnPropertySymbols,d9=Object.prototype.hasOwnProperty,f9=Object.prototype.propertyIsEnumerable,wb=(e,t,r)=>t in e?s9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p9=(e,t)=>{for(var r in t||(t={}))d9.call(t,r)&&wb(e,r,t[r]);if(yb)for(var r of yb(t))f9.call(t,r)&&wb(e,r,t[r]);return e},m9=(e,t)=>c9(e,u9(t));const h9={fixed:!1,position:{top:0,left:0,right:0}},Wk=f.forwardRef((e,t)=>{const r=H("Header",h9,e);return s.createElement(Uk,m9(p9({section:"header",__staticSelector:"Header"},r),{ref:t}))});Wk.displayName="@mantine/core/Header";var g9=Object.defineProperty,_b=Object.getOwnPropertySymbols,v9=Object.prototype.hasOwnProperty,y9=Object.prototype.propertyIsEnumerable,bb=(e,t,r)=>t in e?g9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hk=(e,t)=>{for(var r in t||(t={}))v9.call(t,r)&&bb(e,r,t[r]);if(_b)for(var r of _b(t))y9.call(t,r)&&bb(e,r,t[r]);return e};function w9(e,t){const r=M({size:e.padding,sizes:t.spacing}),n=e.navbarOffsetBreakpoint?M({size:e.navbarOffsetBreakpoint,sizes:t.breakpoints}):null,o=e.asideOffsetBreakpoint?M({size:e.asideOffsetBreakpoint,sizes:t.breakpoints}):null;if(!e.fixed)return{padding:r};const a=ln(n),i=ln(o);return Hk({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: ${ir(a-1)})`]:{paddingLeft:r,paddingRight:r}}:{[`@media (max-width: ${ir(a-1)})`]:{paddingLeft:r},[`@media (max-width: ${ir(i-1)})`]:{paddingRight:r}})}var _9=U((e,t)=>({root:{boxSizing:"border-box"},body:{display:"flex",boxSizing:"border-box"},main:Hk({flex:1,width:"100vw",boxSizing:"border-box"},w9(t,e))}));const b9=_9;var x9=Object.defineProperty,Hd=Object.getOwnPropertySymbols,qk=Object.prototype.hasOwnProperty,Gk=Object.prototype.propertyIsEnumerable,xb=(e,t,r)=>t in e?x9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,E9=(e,t)=>{for(var r in t||(t={}))qk.call(t,r)&&xb(e,r,t[r]);if(Hd)for(var r of Hd(t))Gk.call(t,r)&&xb(e,r,t[r]);return e},S9=(e,t)=>{var r={};for(var n in e)qk.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&&Gk.call(e,n)&&(r[n]=e[n]);return r};const P9={fixed:!0,padding:"md"},Qk=f.forwardRef((e,t)=>{const r=H("AppShell",P9,e),{children:n,navbar:o,header:a,footer:i,aside:l,fixed:c,zIndex:u,padding:d,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h,className:g,styles:v,classNames:w,unstyled:E,hidden:_,layout:y,variant:x}=r,b=S9(r,["children","navbar","header","footer","aside","fixed","zIndex","padding","navbarOffsetBreakpoint","asideOffsetBreakpoint","className","styles","classNames","unstyled","hidden","layout","variant"]),{classes:S,cx:$}=b9({padding:d,fixed:c,navbarOffsetBreakpoint:p,asideOffsetBreakpoint:h},{styles:v,classNames:w,unstyled:E,name:"AppShell",variant:x});return _?s.createElement(s.Fragment,null,n):s.createElement(D7,{value:{fixed:c,zIndex:u,layout:y}},s.createElement(se,E9({className:$(S.root,g),ref:t},b),a,s.createElement("div",{className:S.body},o,s.createElement("main",{className:S.main},n),l),i))});Qk.displayName="@mantine/core/AppShell";const nu={xs:P(1),sm:P(2),md:P(3),lg:P(4),xl:P(5)};function ou(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 O9=U((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:`${M({size:r,sizes:nu})} ${n} ${ou(e,t)}`,marginRight:e.spacing.xs},"&::after":{content:'""',flex:1,borderTop:`${M({size:r,sizes:nu})} ${n} ${ou(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(M({size:r,sizes:nu})),borderTopColor:ou(e,t),borderTopStyle:n,margin:0},vertical:{border:0,alignSelf:"stretch",height:"auto",borderLeftWidth:P(M({size:r,sizes:nu})),borderLeftColor:ou(e,t),borderLeftStyle:n}}));const $9=O9;var C9=Object.defineProperty,k9=Object.defineProperties,j9=Object.getOwnPropertyDescriptors,qd=Object.getOwnPropertySymbols,Kk=Object.prototype.hasOwnProperty,Yk=Object.prototype.propertyIsEnumerable,Eb=(e,t,r)=>t in e?C9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Sb=(e,t)=>{for(var r in t||(t={}))Kk.call(t,r)&&Eb(e,r,t[r]);if(qd)for(var r of qd(t))Yk.call(t,r)&&Eb(e,r,t[r]);return e},R9=(e,t)=>k9(e,j9(t)),T9=(e,t)=>{var r={};for(var n in e)Kk.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&&Yk.call(e,n)&&(r[n]=e[n]);return r};const I9={orientation:"horizontal",size:"xs",labelPosition:"left",variant:"solid"},gr=f.forwardRef((e,t)=>{const r=H("Divider",I9,e),{className:n,color:o,orientation:a,size:i,label:l,labelPosition:c,labelProps:u,variant:d,styles:p,classNames:h,unstyled:g}=r,v=T9(r,["className","color","orientation","size","label","labelPosition","labelProps","variant","styles","classNames","unstyled"]),{classes:w,cx:E}=$9({color:o},{classNames:h,styles:p,unstyled:g,name:"Divider",variant:d,size:i}),_=a==="vertical",y=a==="horizontal",x=!!l&&y,b=!(u!=null&&u.color);return s.createElement(se,Sb({ref:t,className:E(w.root,{[w.vertical]:_,[w.horizontal]:y,[w.withLabel]:x},n),role:"separator"},v),x&&s.createElement(ae,R9(Sb({},u),{size:(u==null?void 0:u.size)||"xs",mt:P(2),className:E(w.label,w[c],{[w.labelDefaultStyles]:b})}),l))});gr.displayName="@mantine/core/Divider";var D9=Object.defineProperty,N9=Object.defineProperties,A9=Object.getOwnPropertyDescriptors,Pb=Object.getOwnPropertySymbols,M9=Object.prototype.hasOwnProperty,z9=Object.prototype.propertyIsEnumerable,Ob=(e,t,r)=>t in e?D9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$b=(e,t)=>{for(var r in t||(t={}))M9.call(t,r)&&Ob(e,r,t[r]);if(Pb)for(var r of Pb(t))z9.call(t,r)&&Ob(e,r,t[r]);return e},L9=(e,t)=>N9(e,A9(t)),F9=U((e,t,{size:r})=>({item:L9($b({},e.fn.fontStyles()),{boxSizing:"border-box",wordBreak:"break-all",textAlign:"left",width:"100%",padding:`calc(${M({size:r,sizes:e.spacing})} / 1.5) ${M({size:r,sizes:e.spacing})}`,cursor:"pointer",fontSize:M({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]":$b({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(${M({size:r,sizes:e.spacing})} / 2)`,paddingBottom:`calc(${M({size:r,sizes:e.spacing})} / 2)`,textAlign:"center"},separator:{boxSizing:"border-box",textAlign:"left",width:"100%",padding:`calc(${M({size:r,sizes:e.spacing})} / 1.5) ${M({size:r,sizes:e.spacing})}`},separatorLabel:{color:e.colorScheme==="dark"?e.colors.dark[3]:e.colors.gray[5]}}));const V9=F9;var B9=Object.defineProperty,Cb=Object.getOwnPropertySymbols,U9=Object.prototype.hasOwnProperty,W9=Object.prototype.propertyIsEnumerable,kb=(e,t,r)=>t in e?B9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H9=(e,t)=>{for(var r in t||(t={}))U9.call(t,r)&&kb(e,r,t[r]);if(Cb)for(var r of Cb(t))W9.call(t,r)&&kb(e,r,t[r]);return e};function Xk({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:g,createLabel:v,unstyled:w,variant:E}){const{classes:_}=V9(null,{classNames:r,styles:n,unstyled:w,name:i,variant:E,size:p}),y=[],x=[];let b=null;const S=(O,C)=>{const T=typeof o=="function"?o(O.value):!1;return s.createElement(d,H9({key:O.value,className:_.item,"data-disabled":O.disabled||void 0,"data-hovered":!O.disabled&&t===C||void 0,"data-selected":!O.disabled&&T||void 0,selected:T,onMouseEnter:()=>l(C),id:`${a}-${C}`,role:"option",tabIndex:-1,"aria-selected":t===C,ref:j=>{u&&u.current&&(u.current[O.value]=j)},onMouseDown:O.disabled?null:j=>{j.preventDefault(),c(O)},disabled:O.disabled,variant:E},O))};let $=null;if(e.forEach((O,C)=>{O.creatable?b=C:O.group?($!==O.group&&($=O.group,x.push(s.createElement("div",{className:_.separator,key:`__mantine-divider-${C}`},s.createElement(gr,{classNames:{label:_.separatorLabel},label:O.group})))),x.push(S(O,C))):y.push(S(O,C))}),g){const O=e[b];y.push(s.createElement("div",{key:mm(),className:_.item,"data-hovered":t===b||void 0,onMouseEnter:()=>l(b),onMouseDown:C=>{C.preventDefault(),c(O)},tabIndex:-1,ref:C=>{u&&u.current&&(u.current[O.value]=C)}},v))}return x.length>0&&y.length>0&&y.unshift(s.createElement("div",{className:_.separator,key:"empty-group-separator"},s.createElement(gr,null))),x.length>0||y.length>0?s.createElement(s.Fragment,null,x,y):s.createElement(ae,{size:p,unstyled:w,className:_.nothingFound},h)}Xk.displayName="@mantine/core/SelectItems";var q9=Object.defineProperty,Gd=Object.getOwnPropertySymbols,Jk=Object.prototype.hasOwnProperty,Zk=Object.prototype.propertyIsEnumerable,jb=(e,t,r)=>t in e?q9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G9=(e,t)=>{for(var r in t||(t={}))Jk.call(t,r)&&jb(e,r,t[r]);if(Gd)for(var r of Gd(t))Zk.call(t,r)&&jb(e,r,t[r]);return e},Q9=(e,t)=>{var r={};for(var n in e)Jk.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&&Zk.call(e,n)&&(r[n]=e[n]);return r};const ej=f.forwardRef((e,t)=>{var r=e,{label:n,value:o}=r,a=Q9(r,["label","value"]);return s.createElement("div",G9({ref:t},a),n||o)});ej.displayName="@mantine/core/DefaultItem";function K9(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function tj(...e){return t=>e.forEach(r=>K9(r,t))}function oi(...e){return f.useCallback(tj(...e),e)}const rj=f.forwardRef((e,t)=>{const{children:r,...n}=e,o=f.Children.toArray(r),a=o.find(X9);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(wv,Je({},n,{ref:t}),f.isValidElement(i)?f.cloneElement(i,void 0,l):null)}return f.createElement(wv,Je({},n,{ref:t}),r)});rj.displayName="Slot";const wv=f.forwardRef((e,t)=>{const{children:r,...n}=e;return f.isValidElement(r)?f.cloneElement(r,{...J9(n,r.props),ref:tj(t,r.ref)}):f.Children.count(r)>1?f.Children.only(null):null});wv.displayName="SlotClone";const Y9=({children:e})=>f.createElement(f.Fragment,null,e);function X9(e){return f.isValidElement(e)&&e.type===Y9}function J9(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 Z9=["a","button","div","h2","h3","img","label","li","nav","ol","p","span","svg","ul"],lc=Z9.reduce((e,t)=>{const r=f.forwardRef((n,o)=>{const{asChild:a,...i}=n,l=a?rj:t;return f.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),f.createElement(l,Je({},i,{ref:o}))});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),_v=globalThis!=null&&globalThis.document?f.useLayoutEffect:()=>{};function eF(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const sc=e=>{const{present:t,children:r}=e,n=tF(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};sc.displayName="Presence";function tF(e){const[t,r]=f.useState(),n=f.useRef({}),o=f.useRef(e),a=f.useRef("none"),i=e?"mounted":"unmounted",[l,c]=eF(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=au(n.current);a.current=l==="mounted"?u:"none"},[l]),_v(()=>{const u=n.current,d=o.current;if(d!==e){const h=a.current,g=au(u);e?c("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),_v(()=>{if(t){const u=p=>{const g=au(n.current).includes(p.animationName);p.target===t&&g&&oc.flushSync(()=>c("ANIMATION_END"))},d=p=>{p.target===t&&(a.current=au(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 au(e){return(e==null?void 0:e.animationName)||"none"}function rF(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:g,...v}=p,w=(h==null?void 0:h[e][c])||l,E=f.useMemo(()=>v,Object.values(v));return f.createElement(w.Provider,{value:E},g)}function d(p,h){const g=(h==null?void 0:h[e][c])||l,v=f.useContext(g);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,nF(o,...t)]}function nF(...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 Ra(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 oF=f.createContext(void 0);function aF(e){const t=f.useContext(oF);return e||t||"ltr"}function iF(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 lF(e,t){return f.useReducer((r,n)=>{const o=t[r][n];return o??r},e)}const nj="ScrollArea",[oj,Ome]=rF(nj),[sF,fn]=oj(nj),cF=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),[g,v]=f.useState(null),[w,E]=f.useState(null),[_,y]=f.useState(0),[x,b]=f.useState(0),[S,$]=f.useState(!1),[O,C]=f.useState(!1),T=oi(t,k=>c(k)),j=aF(o);return f.createElement(sF,{scope:r,type:n,dir:j,scrollHideDelay:a,scrollArea:l,viewport:u,onViewportChange:d,content:p,onContentChange:h,scrollbarX:g,onScrollbarXChange:v,scrollbarXEnabled:S,onScrollbarXEnabledChange:$,scrollbarY:w,onScrollbarYChange:E,scrollbarYEnabled:O,onScrollbarYEnabledChange:C,onCornerWidthChange:y,onCornerHeightChange:b},f.createElement(lc.div,Je({dir:j},i,{ref:T,style:{position:"relative","--radix-scroll-area-corner-width":_+"px","--radix-scroll-area-corner-height":x+"px",...e.style}})))}),uF="ScrollAreaViewport",dF=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,children:n,...o}=e,a=fn(uF,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(lc.div,Je({"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)))}),$o="ScrollAreaScrollbar",fF=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=fn($o,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(pF,Je({},n,{ref:t,forceMount:r})):o.type==="scroll"?f.createElement(mF,Je({},n,{ref:t,forceMount:r})):o.type==="auto"?f.createElement(aj,Je({},n,{ref:t,forceMount:r})):o.type==="always"?f.createElement(a0,Je({},n,{ref:t})):null}),pF=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=fn($o,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(sc,{present:r||a},f.createElement(aj,Je({"data-state":a?"visible":"hidden"},n,{ref:t})))}),mF=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=fn($o,e.__scopeScrollArea),a=e.orientation==="horizontal",i=Im(()=>c("SCROLL_END"),100),[l,c]=lF("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 g=u[d];p!==g&&(c("SCROLL"),i()),p=g};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,a,c,i]),f.createElement(sc,{present:r||l!=="hidden"},f.createElement(a0,Je({"data-state":l==="hidden"?"hidden":"visible"},n,{ref:t,onPointerEnter:Va(e.onPointerEnter,()=>c("POINTER_ENTER")),onPointerLeave:Va(e.onPointerLeave,()=>c("POINTER_LEAVE"))})))}),aj=f.forwardRef((e,t)=>{const r=fn($o,e.__scopeScrollArea),{forceMount:n,...o}=e,[a,i]=f.useState(!1),l=e.orientation==="horizontal",c=Im(()=>{if(r.viewport){const u=r.viewport.offsetWidth<r.viewport.scrollWidth,d=r.viewport.offsetHeight<r.viewport.scrollHeight;i(l?u:d)}},10);return cl(r.viewport,c),cl(r.content,c),f.createElement(sc,{present:n||a},f.createElement(a0,Je({"data-state":a?"visible":"hidden"},o,{ref:t})))}),a0=f.forwardRef((e,t)=>{const{orientation:r="vertical",...n}=e,o=fn($o,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=cj(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,g){return xF(h,i.current,l,g)}return r==="horizontal"?f.createElement(hF,Je({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const h=o.viewport.scrollLeft,g=Rb(h,l,o.dir);a.current.style.transform=`translate3d(${g}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(gF,Je({},d,{ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const h=o.viewport.scrollTop,g=Rb(h,l);a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=p(h))}})):null}),hF=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,a=fn($o,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(lj,Je({"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":Tm(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),dj(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:Qd(i.paddingLeft),paddingEnd:Qd(i.paddingRight)}})}}))}),gF=f.forwardRef((e,t)=>{const{sizes:r,onSizesChange:n,...o}=e,a=fn($o,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(lj,Je({"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":Tm(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),dj(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:Qd(i.paddingTop),paddingEnd:Qd(i.paddingBottom)}})}}))}),[vF,ij]=oj($o),lj=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,g=fn($o,r),[v,w]=f.useState(null),E=oi(t,T=>w(T)),_=f.useRef(null),y=f.useRef(""),x=g.viewport,b=n.content-n.viewport,S=Ra(d),$=Ra(c),O=Im(p,10);function C(T){if(_.current){const j=T.clientX-_.current.left,k=T.clientY-_.current.top;u({x:j,y:k})}}return f.useEffect(()=>{const T=j=>{const k=j.target;(v==null?void 0:v.contains(k))&&S(j,b)};return document.addEventListener("wheel",T,{passive:!1}),()=>document.removeEventListener("wheel",T,{passive:!1})},[x,v,b,S]),f.useEffect($,[n,$]),cl(v,O),cl(g.content,O),f.createElement(vF,{scope:r,scrollbar:v,hasThumb:o,onThumbChange:Ra(a),onThumbPointerUp:Ra(i),onThumbPositionChange:$,onThumbPointerDown:Ra(l)},f.createElement(lc.div,Je({},h,{ref:E,style:{position:"absolute",...h.style},onPointerDown:Va(e.onPointerDown,T=>{T.button===0&&(T.target.setPointerCapture(T.pointerId),_.current=v.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",C(T))}),onPointerMove:Va(e.onPointerMove,C),onPointerUp:Va(e.onPointerUp,T=>{const j=T.target;j.hasPointerCapture(T.pointerId)&&j.releasePointerCapture(T.pointerId),document.body.style.webkitUserSelect=y.current,_.current=null})})))}),bv="ScrollAreaThumb",yF=f.forwardRef((e,t)=>{const{forceMount:r,...n}=e,o=ij(bv,e.__scopeScrollArea);return f.createElement(sc,{present:r||o.hasThumb},f.createElement(wF,Je({ref:t},n)))}),wF=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,style:n,...o}=e,a=fn(bv,r),i=ij(bv,r),{onThumbPositionChange:l}=i,c=oi(t,p=>i.onThumbChange(p)),u=f.useRef(),d=Im(()=>{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 g=EF(p,l);u.current=g,l()}};return l(),p.addEventListener("scroll",h),()=>p.removeEventListener("scroll",h)}},[a.viewport,d,l]),f.createElement(lc.div,Je({"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 g=p.target.getBoundingClientRect(),v=p.clientX-g.left,w=p.clientY-g.top;i.onThumbPointerDown({x:v,y:w})}),onPointerUp:Va(e.onPointerUp,i.onThumbPointerUp)}))}),sj="ScrollAreaCorner",_F=f.forwardRef((e,t)=>{const r=fn(sj,e.__scopeScrollArea),n=!!(r.scrollbarX&&r.scrollbarY);return r.type!=="scroll"&&n?f.createElement(bF,Je({},e,{ref:t})):null}),bF=f.forwardRef((e,t)=>{const{__scopeScrollArea:r,...n}=e,o=fn(sj,r),[a,i]=f.useState(0),[l,c]=f.useState(0),u=!!(a&&l);return cl(o.scrollbarX,()=>{var d;const p=((d=o.scrollbarX)===null||d===void 0?void 0:d.offsetHeight)||0;o.onCornerHeightChange(p),c(p)}),cl(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(lc.div,Je({},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 Qd(e){return e?parseInt(e,10):0}function cj(e,t){const r=e/t;return isNaN(r)?0:r}function Tm(e){const t=cj(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function xF(e,t,r,n="ltr"){const o=Tm(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 uj([c,u],p)(e)}function Rb(e,t,r="ltr"){const n=Tm(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=iF(e,c);return uj([0,i],[0,l])(u)}function uj(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 dj(e,t){return e>0&&e<t}const EF=(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 Im(e,t){const r=Ra(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 cl(e,t){const r=Ra(t);_v(()=>{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 SF=cF,PF=dF,Tb=fF,Ib=yF,OF=_F;var $F=U((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 CF=$F;var kF=Object.defineProperty,jF=Object.defineProperties,RF=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertySymbols,fj=Object.prototype.hasOwnProperty,pj=Object.prototype.propertyIsEnumerable,Db=(e,t,r)=>t in e?kF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xv=(e,t)=>{for(var r in t||(t={}))fj.call(t,r)&&Db(e,r,t[r]);if(Kd)for(var r of Kd(t))pj.call(t,r)&&Db(e,r,t[r]);return e},mj=(e,t)=>jF(e,RF(t)),hj=(e,t)=>{var r={};for(var n in e)fj.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&&pj.call(e,n)&&(r[n]=e[n]);return r};const gj={scrollbarSize:12,scrollHideDelay:1e3,type:"hover",offsetScrollbars:!1},Dm=f.forwardRef((e,t)=>{const r=H("ScrollArea",gj,e),{children:n,className:o,classNames:a,styles:i,scrollbarSize:l,scrollHideDelay:c,type:u,dir:d,offsetScrollbars:p,viewportRef:h,onScrollPositionChange:g,unstyled:v,variant:w,viewportProps:E}=r,_=hj(r,["children","className","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","variant","viewportProps"]),[y,x]=f.useState(!1),b=tr(),{classes:S,cx:$}=CF({scrollbarSize:l,offsetScrollbars:p,scrollbarHovered:y,hidden:u==="never"},{name:"ScrollArea",classNames:a,styles:i,unstyled:v,variant:w});return s.createElement(SF,{type:u==="never"?"always":u,scrollHideDelay:c,dir:d||b.dir,ref:t,asChild:!0},s.createElement(se,xv({className:$(S.root,o)},_),s.createElement(PF,mj(xv({},E),{className:S.viewport,ref:h,onScroll:typeof g=="function"?({currentTarget:O})=>g({x:O.scrollLeft,y:O.scrollTop}):void 0}),n),s.createElement(Tb,{orientation:"horizontal",className:S.scrollbar,forceMount:!0,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)},s.createElement(Ib,{className:S.thumb})),s.createElement(Tb,{orientation:"vertical",className:S.scrollbar,forceMount:!0,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1)},s.createElement(Ib,{className:S.thumb})),s.createElement(OF,{className:S.corner})))}),vj=f.forwardRef((e,t)=>{const r=H("ScrollAreaAutosize",gj,e),{children:n,classNames:o,styles:a,scrollbarSize:i,scrollHideDelay:l,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:g,sx:v,variant:w,viewportProps:E}=r,_=hj(r,["children","classNames","styles","scrollbarSize","scrollHideDelay","type","dir","offsetScrollbars","viewportRef","onScrollPositionChange","unstyled","sx","variant","viewportProps"]);return s.createElement(se,mj(xv({},_),{ref:t,sx:[{display:"flex"},...em(v)]}),s.createElement(se,{sx:{display:"flex",flexDirection:"column",flex:1}},s.createElement(Dm,{classNames:o,styles:a,scrollHideDelay:l,scrollbarSize:i,type:c,dir:u,offsetScrollbars:d,viewportRef:p,onScrollPositionChange:h,unstyled:g,variant:w,viewportProps:E},n)))});vj.displayName="@mantine/core/ScrollAreaAutosize";Dm.displayName="@mantine/core/ScrollArea";Dm.Autosize=vj;const Sl=Dm;var TF=Object.defineProperty,IF=Object.defineProperties,DF=Object.getOwnPropertyDescriptors,Yd=Object.getOwnPropertySymbols,yj=Object.prototype.hasOwnProperty,wj=Object.prototype.propertyIsEnumerable,Nb=(e,t,r)=>t in e?TF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ab=(e,t)=>{for(var r in t||(t={}))yj.call(t,r)&&Nb(e,r,t[r]);if(Yd)for(var r of Yd(t))wj.call(t,r)&&Nb(e,r,t[r]);return e},NF=(e,t)=>IF(e,DF(t)),AF=(e,t)=>{var r={};for(var n in e)yj.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&&wj.call(e,n)&&(r[n]=e[n]);return r};const i0=f.forwardRef((e,t)=>{var r=e,{style:n}=r,o=AF(r,["style"]);return s.createElement(Sl,NF(Ab({},o),{style:Ab({width:"100%"},n),viewportProps:{tabIndex:-1},viewportRef:t}),o.children)});i0.displayName="@mantine/core/SelectScrollArea";var MF=U(()=>({dropdown:{},itemsWrapper:{padding:P(4),display:"flex",width:"100%",boxSizing:"border-box"}}));const zF=MF,$n=Math.min,Jt=Math.max,Xd=Math.round,iu=Math.floor,la=e=>({x:e,y:e}),LF={left:"right",right:"left",bottom:"top",top:"bottom"},FF={start:"end",end:"start"};function Ev(e,t,r){return Jt(e,$n(t,r))}function _o(e,t){return typeof e=="function"?e(t):e}function Cn(e){return e.split("-")[0]}function Pl(e){return e.split("-")[1]}function l0(e){return e==="x"?"y":"x"}function s0(e){return e==="y"?"height":"width"}function ai(e){return["top","bottom"].includes(Cn(e))?"y":"x"}function c0(e){return l0(ai(e))}function VF(e,t,r){r===void 0&&(r=!1);const n=Pl(e),o=c0(e),a=s0(o);let i=o==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Jd(i)),[i,Jd(i)]}function BF(e){const t=Jd(e);return[Sv(e),t,Sv(t)]}function Sv(e){return e.replace(/start|end/g,t=>FF[t])}function UF(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 WF(e,t,r,n){const o=Pl(e);let a=UF(Cn(e),r==="start",n);return o&&(a=a.map(i=>i+"-"+o),t&&(a=a.concat(a.map(Sv)))),a}function Jd(e){return e.replace(/left|right|bottom|top/g,t=>LF[t])}function HF(e){return{top:0,right:0,bottom:0,left:0,...e}}function u0(e){return typeof e!="number"?HF(e):{top:e,right:e,bottom:e,left:e}}function ul(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function Mb(e,t,r){let{reference:n,floating:o}=e;const a=ai(t),i=c0(t),l=s0(i),c=Cn(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 g;switch(c){case"top":g={x:d,y:n.y-o.height};break;case"bottom":g={x:d,y:n.y+n.height};break;case"right":g={x:n.x+n.width,y:p};break;case"left":g={x:n.x-o.width,y:p};break;default:g={x:n.x,y:n.y}}switch(Pl(t)){case"start":g[i]-=h*(r&&u?-1:1);break;case"end":g[i]+=h*(r&&u?-1:1);break}return g}const qF=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}=Mb(u,n,c),h=n,g={},v=0;for(let w=0;w<l.length;w++){const{name:E,fn:_}=l[w],{x:y,y:x,data:b,reset:S}=await _({x:d,y:p,initialPlacement:n,placement:h,strategy:o,middlewareData:g,rects:u,platform:i,elements:{reference:e,floating:t}});if(d=y??d,p=x??p,g={...g,[E]:{...g[E],...b}},S&&v<=50){v++,typeof S=="object"&&(S.placement&&(h=S.placement),S.rects&&(u=S.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):S.rects),{x:d,y:p}=Mb(u,h,c)),w=-1;continue}}return{x:d,y:p,placement:h,strategy:o,middlewareData:g}};async function d0(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:g=0}=_o(t,e),v=u0(g),E=l[h?p==="floating"?"reference":"floating":p],_=ul(await a.getClippingRect({element:(r=await(a.isElement==null?void 0:a.isElement(E)))==null||r?E:E.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),y=p==="floating"?{...i.floating,x:n,y:o}:i.reference,x=await(a.getOffsetParent==null?void 0:a.getOffsetParent(l.floating)),b=await(a.isElement==null?void 0:a.isElement(x))?await(a.getScale==null?void 0:a.getScale(x))||{x:1,y:1}:{x:1,y:1},S=ul(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:y,offsetParent:x,strategy:c}):y);return{top:(_.top-S.top+v.top)/b.y,bottom:(S.bottom-_.bottom+v.bottom)/b.y,left:(_.left-S.left+v.left)/b.x,right:(S.right-_.right+v.right)/b.x}}const zb=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:l}=t,{element:c,padding:u=0}=_o(e,t)||{};if(c==null)return{};const d=u0(u),p={x:r,y:n},h=c0(o),g=s0(h),v=await i.getDimensions(c),w=h==="y",E=w?"top":"left",_=w?"bottom":"right",y=w?"clientHeight":"clientWidth",x=a.reference[g]+a.reference[h]-p[h]-a.floating[g],b=p[h]-a.reference[h],S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c));let $=S?S[y]:0;(!$||!await(i.isElement==null?void 0:i.isElement(S)))&&($=l.floating[y]||a.floating[g]);const O=x/2-b/2,C=$/2-v[g]/2-1,T=$n(d[E],C),j=$n(d[_],C),k=T,I=$-v[g]-j,z=$/2-v[g]/2+O,N=Ev(k,z,I),q=Pl(o)!=null&&z!=N&&a.reference[g]/2-(z<k?T:j)-v[g]/2<0?z<k?k-z:I-z:0;return{[h]:p[h]-q,data:{[h]:N,centerOffset:z-N+q}}}}),_j=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var r;const{placement:n,middlewareData:o,rects:a,initialPlacement:i,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...w}=_o(e,t),E=Cn(n),_=Cn(i)===i,y=await(l.isRTL==null?void 0:l.isRTL(c.floating)),x=p||(_||!v?[Jd(i)]:BF(i));!p&&g!=="none"&&x.push(...WF(i,v,g,y));const b=[i,...x],S=await d0(t,w),$=[];let O=((r=o.flip)==null?void 0:r.overflows)||[];if(u&&$.push(S[E]),d){const k=VF(n,a,y);$.push(S[k[0]],S[k[1]])}if(O=[...O,{placement:n,overflows:$}],!$.every(k=>k<=0)){var C,T;const k=(((C=o.flip)==null?void 0:C.index)||0)+1,I=b[k];if(I)return{data:{index:k,overflows:O},reset:{placement:I}};let z=(T=O.filter(N=>N.overflows[0]<=0).sort((N,F)=>N.overflows[1]-F.overflows[1])[0])==null?void 0:T.placement;if(!z)switch(h){case"bestFit":{var j;const N=(j=O.map(F=>[F.placement,F.overflows.filter(q=>q>0).reduce((q,ee)=>q+ee,0)]).sort((F,q)=>F[1]-q[1])[0])==null?void 0:j[0];N&&(z=N);break}case"initialPlacement":z=i;break}if(n!==z)return{reset:{placement:z}}}return{}}}};function bj(e){const t=$n(...e.map(a=>a.left)),r=$n(...e.map(a=>a.top)),n=Jt(...e.map(a=>a.right)),o=Jt(...e.map(a=>a.bottom));return{x:t,y:r,width:n-t,height:o-r}}function GF(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=>ul(bj(o)))}const xj=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}=_o(e,t),d=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(n.reference))||[]),p=GF(d),h=ul(bj(d)),g=u0(l);function v(){if(p.length===2&&p[0].left>p[1].right&&c!=null&&u!=null)return p.find(E=>c>E.left-g.left&&c<E.right+g.right&&u>E.top-g.top&&u<E.bottom+g.bottom)||h;if(p.length>=2){if(ai(r)==="y"){const j=p[0],k=p[p.length-1],I=Cn(r)==="top",z=j.top,N=k.bottom,F=I?j.left:k.left,q=I?j.right:k.right,ee=q-F,R=N-z;return{top:z,bottom:N,left:F,right:q,width:ee,height:R,x:F,y:z}}const E=Cn(r)==="left",_=Jt(...p.map(j=>j.right)),y=$n(...p.map(j=>j.left)),x=p.filter(j=>E?j.left===y:j.right===_),b=x[0].top,S=x[x.length-1].bottom,$=y,O=_,C=O-$,T=S-b;return{top:b,bottom:S,left:$,right:O,width:C,height:T,x:$,y:b}}return h}const w=await a.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:i});return o.reference.x!==w.reference.x||o.reference.y!==w.reference.y||o.reference.width!==w.reference.width||o.reference.height!==w.reference.height?{reset:{rects:w}}:{}}}};async function QF(e,t){const{placement:r,platform:n,elements:o}=e,a=await(n.isRTL==null?void 0:n.isRTL(o.floating)),i=Cn(r),l=Pl(r),c=ai(r)==="y",u=["left","top"].includes(i)?-1:1,d=a&&c?-1:1,p=_o(t,e);let{mainAxis:h,crossAxis:g,alignmentAxis:v}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return l&&typeof v=="number"&&(g=l==="end"?v*-1:v),c?{x:g*d,y:h*u}:{x:h*u,y:g*d}}const Ej=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){const{x:r,y:n}=t,o=await QF(t,e);return{x:r+o.x,y:n+o.y,data:o}}}},f0=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:E=>{let{x:_,y}=E;return{x:_,y}}},...c}=_o(e,t),u={x:r,y:n},d=await d0(t,c),p=ai(Cn(o)),h=l0(p);let g=u[h],v=u[p];if(a){const E=h==="y"?"top":"left",_=h==="y"?"bottom":"right",y=g+d[E],x=g-d[_];g=Ev(y,g,x)}if(i){const E=p==="y"?"top":"left",_=p==="y"?"bottom":"right",y=v+d[E],x=v-d[_];v=Ev(y,v,x)}const w=l.fn({...t,[h]:g,[p]:v});return{...w,data:{x:w.x-r,y:w.y-n}}}}},KF=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}=_o(e,t),d={x:r,y:n},p=ai(o),h=l0(p);let g=d[h],v=d[p];const w=_o(l,t),E=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(c){const x=h==="y"?"height":"width",b=a.reference[h]-a.floating[x]+E.mainAxis,S=a.reference[h]+a.reference[x]-E.mainAxis;g<b?g=b:g>S&&(g=S)}if(u){var _,y;const x=h==="y"?"width":"height",b=["top","left"].includes(Cn(o)),S=a.reference[p]-a.floating[x]+(b&&((_=i.offset)==null?void 0:_[p])||0)+(b?0:E.crossAxis),$=a.reference[p]+a.reference[x]+(b?0:((y=i.offset)==null?void 0:y[p])||0)-(b?E.crossAxis:0);v<S?v=S:v>$&&(v=$)}return{[h]:g,[p]:v}}}},YF=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}=_o(e,t),c=await d0(t,l),u=Cn(r),d=Pl(r),p=ai(r)==="y",{width:h,height:g}=n.floating;let v,w;u==="top"||u==="bottom"?(v=u,w=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(w=u,v=d==="end"?"top":"bottom");const E=g-c[v],_=h-c[w],y=!t.middlewareData.shift;let x=E,b=_;if(p){const $=h-c.left-c.right;b=d||y?$n(_,$):$}else{const $=g-c.top-c.bottom;x=d||y?$n(E,$):$}if(y&&!d){const $=Jt(c.left,0),O=Jt(c.right,0),C=Jt(c.top,0),T=Jt(c.bottom,0);p?b=h-2*($!==0||O!==0?$+O:Jt(c.left,c.right)):x=g-2*(C!==0||T!==0?C+T:Jt(c.top,c.bottom))}await i({...t,availableWidth:b,availableHeight:x});const S=await o.getDimensions(a.floating);return h!==S.width||g!==S.height?{reset:{rects:!0}}:{}}}};function sa(e){return Sj(e)?(e.nodeName||"").toLowerCase():"#document"}function Fr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Co(e){var t;return(t=(Sj(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Sj(e){return e instanceof Node||e instanceof Fr(e).Node}function bo(e){return e instanceof Element||e instanceof Fr(e).Element}function Xn(e){return e instanceof HTMLElement||e instanceof Fr(e).HTMLElement}function Lb(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Fr(e).ShadowRoot}function cc(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=dn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function XF(e){return["table","td","th"].includes(sa(e))}function p0(e){const t=m0(),r=dn(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 JF(e){let t=dl(e);for(;Xn(t)&&!Nm(t);){if(p0(t))return t;t=dl(t)}return null}function m0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Nm(e){return["html","body","#document"].includes(sa(e))}function dn(e){return Fr(e).getComputedStyle(e)}function Am(e){return bo(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function dl(e){if(sa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Lb(e)&&e.host||Co(e);return Lb(t)?t.host:t}function Pj(e){const t=dl(e);return Nm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Xn(t)&&cc(t)?t:Pj(t)}function fo(e,t){var r;t===void 0&&(t=[]);const n=Pj(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),a=Fr(n);return o?t.concat(a,a.visualViewport||[],cc(n)?n:[],a.frameElement?fo(a.frameElement):[]):t.concat(n,fo(n))}function Oj(e){const t=dn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Xn(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,l=Xd(r)!==a||Xd(n)!==i;return l&&(r=a,n=i),{width:r,height:n,$:l}}function h0(e){return bo(e)?e:e.contextElement}function Xi(e){const t=h0(e);if(!Xn(t))return la(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=Oj(t);let i=(a?Xd(r.width):r.width)/n,l=(a?Xd(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!l||!Number.isFinite(l))&&(l=1),{x:i,y:l}}const ZF=la(0);function $j(e){const t=Fr(e);return!m0()||!t.visualViewport?ZF:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function eV(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Fr(e)?!1:t}function Qa(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const o=e.getBoundingClientRect(),a=h0(e);let i=la(1);t&&(n?bo(n)&&(i=Xi(n)):i=Xi(e));const l=eV(a,r,n)?$j(a):la(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=Fr(a),g=n&&bo(n)?Fr(n):n;let v=h.frameElement;for(;v&&n&&g!==h;){const w=Xi(v),E=v.getBoundingClientRect(),_=dn(v),y=E.left+(v.clientLeft+parseFloat(_.paddingLeft))*w.x,x=E.top+(v.clientTop+parseFloat(_.paddingTop))*w.y;c*=w.x,u*=w.y,d*=w.x,p*=w.y,c+=y,u+=x,v=Fr(v).frameElement}}return ul({width:d,height:p,x:c,y:u})}function tV(e){let{rect:t,offsetParent:r,strategy:n}=e;const o=Xn(r),a=Co(r);if(r===a)return t;let i={scrollLeft:0,scrollTop:0},l=la(1);const c=la(0);if((o||!o&&n!=="fixed")&&((sa(r)!=="body"||cc(a))&&(i=Am(r)),Xn(r))){const u=Qa(r);l=Xi(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 rV(e){return Array.from(e.getClientRects())}function Cj(e){return Qa(Co(e)).left+Am(e).scrollLeft}function nV(e){const t=Co(e),r=Am(e),n=e.ownerDocument.body,o=Jt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=Jt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+Cj(e);const l=-r.scrollTop;return dn(n).direction==="rtl"&&(i+=Jt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:l}}function oV(e,t){const r=Fr(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=m0();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:a,height:i,x:l,y:c}}function aV(e,t){const r=Qa(e,!0,t==="fixed"),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Xn(e)?Xi(e):la(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 Fb(e,t,r){let n;if(t==="viewport")n=oV(e,r);else if(t==="document")n=nV(Co(e));else if(bo(t))n=aV(t,r);else{const o=$j(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return ul(n)}function kj(e,t){const r=dl(e);return r===t||!bo(r)||Nm(r)?!1:dn(r).position==="fixed"||kj(r,t)}function iV(e,t){const r=t.get(e);if(r)return r;let n=fo(e).filter(l=>bo(l)&&sa(l)!=="body"),o=null;const a=dn(e).position==="fixed";let i=a?dl(e):e;for(;bo(i)&&!Nm(i);){const l=dn(i),c=p0(i);!c&&l.position==="fixed"&&(o=null),(a?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||cc(i)&&!c&&kj(e,i))?n=n.filter(d=>d!==i):o=l,i=dl(i)}return t.set(e,n),n}function lV(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const i=[...r==="clippingAncestors"?iV(t,this._c):[].concat(r),n],l=i[0],c=i.reduce((u,d)=>{const p=Fb(t,d,o);return u.top=Jt(p.top,u.top),u.right=$n(p.right,u.right),u.bottom=$n(p.bottom,u.bottom),u.left=Jt(p.left,u.left),u},Fb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function sV(e){return Oj(e)}function cV(e,t,r){const n=Xn(t),o=Co(t),a=r==="fixed",i=Qa(e,!0,a,t);let l={scrollLeft:0,scrollTop:0};const c=la(0);if(n||!n&&!a)if((sa(t)!=="body"||cc(o))&&(l=Am(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=Cj(o));return{x:i.left+l.scrollLeft-c.x,y:i.top+l.scrollTop-c.y,width:i.width,height:i.height}}function Vb(e,t){return!Xn(e)||dn(e).position==="fixed"?null:t?t(e):e.offsetParent}function jj(e,t){const r=Fr(e);if(!Xn(e))return r;let n=Vb(e,t);for(;n&&XF(n)&&dn(n).position==="static";)n=Vb(n,t);return n&&(sa(n)==="html"||sa(n)==="body"&&dn(n).position==="static"&&!p0(n))?r:n||JF(e)||r}const uV=async function(e){let{reference:t,floating:r,strategy:n}=e;const o=this.getOffsetParent||jj,a=this.getDimensions;return{reference:cV(t,await o(r),n),floating:{x:0,y:0,...await a(r)}}};function dV(e){return dn(e).direction==="rtl"}const fV={convertOffsetParentRelativeRectToViewportRelativeRect:tV,getDocumentElement:Co,getClippingRect:lV,getOffsetParent:jj,getElementRects:uV,getClientRects:rV,getDimensions:sV,getScale:Xi,isElement:bo,isRTL:dV};function pV(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 g=iu(d),v=iu(o.clientWidth-(u+p)),w=iu(o.clientHeight-(d+h)),E=iu(u),y={rootMargin:-g+"px "+-v+"px "+-w+"px "+-E+"px",threshold:Jt(0,$n(1,c))||1};let x=!0;function b(S){const $=S[0].intersectionRatio;if($!==c){if(!x)return i();$?i(!1,$):n=setTimeout(()=>{i(!1,1e-7)},100)}x=!1}try{r=new IntersectionObserver(b,{...y,root:o.ownerDocument})}catch{r=new IntersectionObserver(b,y)}r.observe(e)}return i(!0),a}function mV(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=h0(e),d=o||a?[...u?fo(u):[],...fo(t)]:[];d.forEach(_=>{o&&_.addEventListener("scroll",r,{passive:!0}),a&&_.addEventListener("resize",r)});const p=u&&l?pV(u,r):null;let h=-1,g=null;i&&(g=new ResizeObserver(_=>{let[y]=_;y&&y.target===u&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{g&&g.observe(t)})),r()}),u&&!c&&g.observe(u),g.observe(t));let v,w=c?Qa(e):null;c&&E();function E(){const _=Qa(e);w&&(_.x!==w.x||_.y!==w.y||_.width!==w.width||_.height!==w.height)&&r(),w=_,v=requestAnimationFrame(E)}return r(),()=>{d.forEach(_=>{o&&_.removeEventListener("scroll",r),a&&_.removeEventListener("resize",r)}),p&&p(),g&&g.disconnect(),g=null,c&&cancelAnimationFrame(v)}}const hV=(e,t,r)=>{const n=new Map,o={platform:fV,...r},a={...o.platform,_c:n};return qF(e,t,{...o,platform:a})},Rj=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?zb({element:t.current,padding:r}).fn(o):{}:t?zb({element:t,padding:r}).fn(o):{}}}};var Gu=typeof document<"u"?f.useLayoutEffect:f.useEffect;function Zd(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(!Zd(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)&&!Zd(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Bb(e){const t=f.useRef(e);return Gu(()=>{t.current=e}),t}function gV(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);Zd(u,n)||d(n);const p=f.useRef(null),h=f.useRef(null),g=f.useRef(l),v=Bb(a),w=Bb(o),[E,_]=f.useState(null),[y,x]=f.useState(null),b=f.useCallback(j=>{p.current!==j&&(p.current=j,_(j))},[]),S=f.useCallback(j=>{h.current!==j&&(h.current=j,x(j))},[]),$=f.useCallback(()=>{if(!p.current||!h.current)return;const j={placement:t,strategy:r,middleware:u};w.current&&(j.platform=w.current),hV(p.current,h.current,j).then(k=>{const I={...k,isPositioned:!0};O.current&&!Zd(g.current,I)&&(g.current=I,oc.flushSync(()=>{c(I)}))})},[u,t,r,w]);Gu(()=>{i===!1&&g.current.isPositioned&&(g.current.isPositioned=!1,c(j=>({...j,isPositioned:!1})))},[i]);const O=f.useRef(!1);Gu(()=>(O.current=!0,()=>{O.current=!1}),[]),Gu(()=>{if(E&&y){if(v.current)return v.current(E,y,$);$()}},[E,y,$,v]);const C=f.useMemo(()=>({reference:p,floating:h,setReference:b,setFloating:S}),[b,S]),T=f.useMemo(()=>({reference:E,floating:y}),[E,y]);return f.useMemo(()=>({...l,update:$,refs:C,elements:T,reference:b,floating:S}),[l,$,C,T,b,S])}var fl=typeof document<"u"?f.useLayoutEffect:f.useEffect;let Wh=!1,vV=0;const Ub=()=>"floating-ui-"+vV++;function yV(){const[e,t]=f.useState(()=>Wh?Ub():void 0);return fl(()=>{e==null&&t(Ub())},[]),f.useEffect(()=>{Wh||(Wh=!0)},[]),e}const wV=Ss["useId".toString()],Wb=wV||yV;function _V(){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 bV=f.createContext(null),xV=f.createContext(null),Tj=()=>{var e;return((e=f.useContext(bV))==null?void 0:e.id)||null},g0=()=>f.useContext(xV);function Qo(e){return(e==null?void 0:e.ownerDocument)||document}function EV(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function SV(){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 v0(e){return Qo(e).defaultView||window}function Hn(e){return e?e instanceof v0(e).Element:!1}function Ij(e){return e?e instanceof v0(e).HTMLElement:!1}function PV(e){if(typeof ShadowRoot>"u")return!1;const t=v0(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function OV(e){if(e.mozInputSource===0&&e.isTrusted)return!0;const t=/Android/i;return(t.test(EV())||t.test(SV()))&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function $V(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 Dj(e,t){const r=["mouse","pen"];return t||r.push("",void 0),r.includes(e)}function Hb(e){const t=f.useRef(e);return fl(()=>{t.current=e}),t}const qb="data-floating-ui-safe-polygon";function Qu(e,t,r){return r&&!Dj(r)?0:typeof e=="number"?e:e==null?void 0:e[t]}const CV=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:g},refs:v}=e,w=g0(),E=Tj(),_=Hb(o),y=Hb(n),x=f.useRef(),b=f.useRef(),S=f.useRef(),$=f.useRef(),O=f.useRef(!0),C=f.useRef(!1),T=f.useRef(()=>{}),j=f.useCallback(()=>{var N;const F=(N=d.current.openEvent)==null?void 0:N.type;return(F==null?void 0:F.includes("mouse"))&&F!=="mousedown"},[d]);f.useEffect(()=>{if(!r)return;function N(){clearTimeout(b.current),clearTimeout($.current),O.current=!0}return p.on("dismiss",N),()=>{p.off("dismiss",N)}},[r,p]),f.useEffect(()=>{if(!r||!_.current||!c)return;function N(){j()&&u(!1)}const F=Qo(g).documentElement;return F.addEventListener("mouseleave",N),()=>{F.removeEventListener("mouseleave",N)}},[g,c,u,r,_,d,j]);const k=f.useCallback(function(N){N===void 0&&(N=!0);const F=Qu(y.current,"close",x.current);F&&!S.current?(clearTimeout(b.current),b.current=setTimeout(()=>u(!1),F)):N&&(clearTimeout(b.current),u(!1))},[y,u]),I=f.useCallback(()=>{T.current(),S.current=void 0},[]),z=f.useCallback(()=>{if(C.current){const N=Qo(v.floating.current).body;N.style.pointerEvents="",N.removeAttribute(qb),C.current=!1}},[v]);return f.useEffect(()=>{if(!r)return;function N(){return d.current.openEvent?["click","mousedown"].includes(d.current.openEvent.type):!1}function F(R){if(clearTimeout(b.current),O.current=!1,a&&!Dj(x.current)||i>0&&Qu(y.current,"open")===0)return;d.current.openEvent=R;const D=Qu(y.current,"open",x.current);D?b.current=setTimeout(()=>{u(!0)},D):u(!0)}function q(R){if(N())return;T.current();const D=Qo(g);if(clearTimeout($.current),_.current){c||clearTimeout(b.current),S.current=_.current({...e,tree:w,x:R.clientX,y:R.clientY,onClose(){z(),I(),k()}});const V=S.current;D.addEventListener("mousemove",V),T.current=()=>{D.removeEventListener("mousemove",V)};return}k()}function ee(R){N()||_.current==null||_.current({...e,tree:w,x:R.clientX,y:R.clientY,onClose(){z(),I(),k()}})(R)}if(Hn(h)){const R=h;return c&&R.addEventListener("mouseleave",ee),g==null||g.addEventListener("mouseleave",ee),l&&R.addEventListener("mousemove",F,{once:!0}),R.addEventListener("mouseenter",F),R.addEventListener("mouseleave",q),()=>{c&&R.removeEventListener("mouseleave",ee),g==null||g.removeEventListener("mouseleave",ee),l&&R.removeEventListener("mousemove",F),R.removeEventListener("mouseenter",F),R.removeEventListener("mouseleave",q)}}},[h,g,r,e,a,i,l,k,I,z,u,c,w,y,_,d]),fl(()=>{var N;if(r&&c&&(N=_.current)!=null&&N.__options.blockPointerEvents&&j()){const ee=Qo(g).body;if(ee.setAttribute(qb,""),ee.style.pointerEvents="none",C.current=!0,Hn(h)&&g){var F,q;const R=h,D=w==null||(F=w.nodesRef.current.find(V=>V.id===E))==null||(q=F.context)==null?void 0:q.elements.floating;return D&&(D.style.pointerEvents=""),R.style.pointerEvents="auto",g.style.pointerEvents="auto",()=>{R.style.pointerEvents="",g.style.pointerEvents=""}}}},[r,c,E,g,h,w,_,d,j]),fl(()=>{c||(x.current=void 0,I(),z())},[c,I,z]),f.useEffect(()=>()=>{I(),clearTimeout(b.current),clearTimeout($.current),z()},[r,I,z]),f.useMemo(()=>{if(!r)return{};function N(F){x.current=F.pointerType}return{reference:{onPointerDown:N,onPointerEnter:N,onMouseMove(){c||i===0||(clearTimeout($.current),$.current=setTimeout(()=>{O.current||u(!0)},i))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(){p.emit("dismiss",{type:"mouseLeave",data:{returnFocus:!1}}),k(!1)}}}},[p,r,i,c,u,k])},Nj=f.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Aj=()=>f.useContext(Nj),kV=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 fl(()=>{o.currentId?i.current===null?i.current=o.currentId:a({isInstantPhase:!0}):(a({isInstantPhase:!1}),i.current=null)},[o.currentId]),f.createElement(Nj.Provider,{value:f.useMemo(()=>({...o,setState:a,setCurrentId:l}),[o,a,l])},t)},jV=(e,t)=>{let{open:r,onOpenChange:n}=e,{id:o}=t;const{currentId:a,setCurrentId:i,initialDelay:l,setState:c,timeoutMs:u}=Aj();f.useEffect(()=>{a&&(c({delay:{open:1,close:Qu(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 RV(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 Gb(e,t){if(!e||!t)return!1;const r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&PV(r)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}function Hh(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 TV(e){return"composedPath"in e?e.composedPath()[0]:e.target}const IV=Ss["useInsertionEffect".toString()],DV=IV||(e=>e());function Mj(e){const t=f.useRef(()=>{});return DV(()=>{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 Ku(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 NV={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},AV={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},MV=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}},zV=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:g="pointerdown",referencePress:v=!1,referencePressEvent:w="pointerdown",ancestorScroll:E=!1,bubbles:_=!0}=t===void 0?{}:t;const y=g0(),x=Tj()!=null,b=Mj(typeof h=="function"?h:()=>!1),S=typeof h=="function"?b:h,$=f.useRef(!1),{escapeKeyBubbles:O,outsidePressBubbles:C}=MV(_);return f.useEffect(()=>{if(!r||!d)return;u.current.__escapeKeyBubbles=O,u.current.__outsidePressBubbles=C;function T(N){if(N.key==="Escape"){const F=y?Hh(y.nodesRef.current,a):[];if(F.length>0){let q=!0;if(F.forEach(ee=>{var R;if((R=ee.context)!=null&&R.open&&!ee.context.dataRef.current.__escapeKeyBubbles){q=!1;return}}),!q)return}o.emit("dismiss",{type:"escapeKey",data:{returnFocus:{preventScroll:!1}}}),n(!1)}}function j(N){const F=$.current;if($.current=!1,F||typeof S=="function"&&!S(N))return;const q=TV(N);if(Ij(q)&&c){const D=c.ownerDocument.defaultView||window,V=q.scrollWidth>q.clientWidth,G=q.scrollHeight>q.clientHeight;let ie=G&&N.offsetX>q.clientWidth;if(G&&D.getComputedStyle(q).direction==="rtl"&&(ie=N.offsetX<=q.offsetWidth-q.clientWidth),ie||V&&N.offsetY>q.clientHeight)return}const ee=y&&Hh(y.nodesRef.current,a).some(D=>{var V;return Ku(N,(V=D.context)==null?void 0:V.elements.floating)});if(Ku(N,c)||Ku(N,l)||ee)return;const R=y?Hh(y.nodesRef.current,a):[];if(R.length>0){let D=!0;if(R.forEach(V=>{var G;if((G=V.context)!=null&&G.open&&!V.context.dataRef.current.__outsidePressBubbles){D=!1;return}}),!D)return}o.emit("dismiss",{type:"outsidePress",data:{returnFocus:x?{preventScroll:!0}:OV(N)||$V(N)}}),n(!1)}function k(){n(!1)}const I=Qo(c);p&&I.addEventListener("keydown",T),S&&I.addEventListener(g,j);let z=[];return E&&(Hn(l)&&(z=fo(l)),Hn(c)&&(z=z.concat(fo(c))),!Hn(i)&&i&&i.contextElement&&(z=z.concat(fo(i.contextElement)))),z=z.filter(N=>{var F;return N!==((F=I.defaultView)==null?void 0:F.visualViewport)}),z.forEach(N=>{N.addEventListener("scroll",k,{passive:!0})}),()=>{p&&I.removeEventListener("keydown",T),S&&I.removeEventListener(g,j),z.forEach(N=>{N.removeEventListener("scroll",k)})}},[u,c,l,i,p,S,g,o,y,a,r,n,E,d,O,C,x]),f.useEffect(()=>{$.current=!1},[S,g]),f.useMemo(()=>d?{reference:{[NV[w]]:()=>{v&&(o.emit("dismiss",{type:"referencePress",data:{returnFocus:!1}}),n(!1))}},floating:{[AV[g]]:()=>{$.current=!0}}}:{},[d,o,v,g,w,n])},LV=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),g=f.useRef();return f.useEffect(()=>{if(!u)return;const w=Qo(l).defaultView||window;function E(){!r&&Ij(c)&&c===RV(Qo(c))&&(h.current=!0)}return w.addEventListener("blur",E),()=>{w.removeEventListener("blur",E)}},[l,c,r,u]),f.useEffect(()=>{if(!u)return;function v(w){(w.type==="referencePress"||w.type==="escapeKey")&&(h.current=!0)}return a.on("dismiss",v),()=>{a.off("dismiss",v)}},[a,u]),f.useEffect(()=>()=>{clearTimeout(g.current)},[]),f.useMemo(()=>u?{reference:{onPointerDown(v){let{pointerType:w}=v;p.current=w,h.current=!!(w&&d)},onMouseLeave(){h.current=!1},onFocus(v){var w;h.current||v.type==="focus"&&((w=o.current.openEvent)==null?void 0:w.type)==="mousedown"&&o.current.openEvent&&Ku(o.current.openEvent,c)||(o.current.openEvent=v.nativeEvent,n(!0))},onBlur(v){h.current=!1;const w=v.relatedTarget,E=Hn(w)&&w.hasAttribute("data-floating-ui-focus-guard")&&w.getAttribute("data-type")==="outside";g.current=setTimeout(()=>{Gb(i.floating.current,w)||Gb(c,w)||E||n(!1)})}}}:{},[u,d,c,i,o,n])},FV=function(e,t){let{open:r}=e,{enabled:n=!0,role:o="dialog"}=t===void 0?{}:t;const a=Wb(),i=Wb();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 y0(e){e===void 0&&(e={});const{open:t=!1,onOpenChange:r,nodeId:n}=e,o=gV(e),a=g0(),i=f.useRef(null),l=f.useRef({}),c=f.useState(()=>_V())[0],[u,d]=f.useState(null),p=f.useCallback(_=>{const y=Hn(_)?{getBoundingClientRect:()=>_.getBoundingClientRect(),contextElement:_}:_;o.refs.setReference(y)},[o.refs]),h=f.useCallback(_=>{(Hn(_)||_===null)&&(i.current=_,d(_)),(Hn(o.refs.reference.current)||o.refs.reference.current===null||_!==null&&!Hn(_))&&o.refs.setReference(_)},[o.refs]),g=f.useMemo(()=>({...o.refs,setReference:h,setPositionReference:p,domReference:i}),[o.refs,h,p]),v=f.useMemo(()=>({...o.elements,domReference:u}),[o.elements,u]),w=Mj(r),E=f.useMemo(()=>({...o,refs:g,elements:v,dataRef:l,nodeId:n,events:c,open:t,onOpenChange:w}),[o,n,c,t,w,g,v]);return fl(()=>{const _=a==null?void 0:a.nodesRef.current.find(y=>y.id===n);_&&(_.context=E)}),f.useMemo(()=>({...o,context:E,refs:g,reference:h,positionReference:p}),[o,g,E,h,p])}function qh(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),g=0;g<p;g++)h[g]=arguments[g];(d=n.get(l))==null||d.forEach(v=>v(...h))}}}else o[l]=c}),o),{})}}const VV=function(e){e===void 0&&(e=[]);const t=e,r=f.useCallback(a=>qh(a,e,"reference"),t),n=f.useCallback(a=>qh(a,e,"floating"),t),o=f.useCallback(a=>qh(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 zj({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 mV(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,r]),nn(()=>{t.update()},n),nn(()=>{a(i=>i+1)},[e])}function BV(e){const t=[Ej(e.offset)];return e.middlewares.shift&&t.push(f0({limiter:KF()})),e.middlewares.flip&&t.push(_j()),e.middlewares.inline&&t.push(xj()),t.push(Rj({element:e.arrowRef,padding:e.arrowOffset})),t}function UV(e){const[t,r]=Sr({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=y0({placement:e.position,middleware:[...BV(e),...e.width==="target"?[YF({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 zj({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies,floating:a}),nn(()=>{var i;(i=e.onPositionChange)==null||i.call(e,a.placement)},[a.placement]),nn(()=>{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 Lj={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"},[WV,Fj]=Po(Lj.context);var HV=Object.defineProperty,qV=Object.defineProperties,GV=Object.getOwnPropertyDescriptors,ef=Object.getOwnPropertySymbols,Vj=Object.prototype.hasOwnProperty,Bj=Object.prototype.propertyIsEnumerable,Qb=(e,t,r)=>t in e?HV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lu=(e,t)=>{for(var r in t||(t={}))Vj.call(t,r)&&Qb(e,r,t[r]);if(ef)for(var r of ef(t))Bj.call(t,r)&&Qb(e,r,t[r]);return e},QV=(e,t)=>qV(e,GV(t)),KV=(e,t)=>{var r={};for(var n in e)Vj.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&&Bj.call(e,n)&&(r[n]=e[n]);return r};const YV={refProp:"ref",popupType:"dialog"},Uj=f.forwardRef((e,t)=>{const r=H("PopoverTarget",YV,e),{children:n,refProp:o,popupType:a}=r,i=KV(r,["children","refProp","popupType"]);if(!yl(n))throw new Error(Lj.children);const l=i,c=Fj(),u=_l(c.reference,n.ref,t),d=c.withRoles?{"aria-haspopup":a,"aria-expanded":c.opened,"aria-controls":c.getDropdownId(),id:c.getTargetId()}:{};return f.cloneElement(n,lu(QV(lu(lu(lu({},l),d),c.targetProps),{className:v$(c.targetProps.className,l.className,n.props.className),[o]:u}),c.controlled?null:{onClick:c.onToggle}))});Uj.displayName="@mantine/core/PopoverTarget";var XV=U((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 JV=XV;var ZV=Object.defineProperty,Kb=Object.getOwnPropertySymbols,eB=Object.prototype.hasOwnProperty,tB=Object.prototype.propertyIsEnumerable,Yb=(e,t,r)=>t in e?ZV(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yi=(e,t)=>{for(var r in t||(t={}))eB.call(t,r)&&Yb(e,r,t[r]);if(Kb)for(var r of Kb(t))tB.call(t,r)&&Yb(e,r,t[r]);return e};const Xb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function rB({transition:e,state:t,duration:r,timingFunction:n}){const o={transitionDuration:`${r}ms`,transitionTimingFunction:n};return typeof e=="string"?e in Ac?yi(yi(yi({transitionProperty:Ac[e].transitionProperty},o),Ac[e].common),Ac[e][Xb[t]]):null:yi(yi(yi({transitionProperty:e.transitionProperty},o),e.common),e[Xb[t]])}function nB({duration:e,exitDuration:t,timingFunction:r,mounted:n,onEnter:o,onExit:a,onEntered:i,onExited:l}){const c=tr(),u=hm(),d=c.respectReducedMotion?u:!1,[p,h]=f.useState(d?0:e),[g,v]=f.useState(n?"entered":"exited"),w=f.useRef(-1),E=_=>{const y=_?o:a,x=_?i:l;v(_?"pre-entering":"pre-exiting"),window.clearTimeout(w.current);const b=d?0:_?e:t;if(h(b),b===0)typeof y=="function"&&y(),typeof x=="function"&&x(),v(_?"entered":"exited");else{const S=window.setTimeout(()=>{typeof y=="function"&&y(),v(_?"entering":"exiting")},10);w.current=window.setTimeout(()=>{window.clearTimeout(S),typeof x=="function"&&x(),v(_?"entered":"exited")},b)}};return nn(()=>{E(n)},[n]),f.useEffect(()=>()=>window.clearTimeout(w.current),[]),{transitionDuration:p,transitionStatus:g,transitionTimingFunction:r||c.transitionTimingFunction}}function ii({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:g}=nB({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(rB({transition:t,duration:p,state:h,timingFunction:g})))}ii.displayName="@mantine/core/Transition";function w0({children:e,active:t=!0,refProp:r="ref"}){const n=v6(t),o=_l(n,e==null?void 0:e.ref);return yl(e)?f.cloneElement(e,{[r]:o}):e}w0.displayName="@mantine/core/FocusTrap";var oB=Object.defineProperty,aB=Object.defineProperties,iB=Object.getOwnPropertyDescriptors,Jb=Object.getOwnPropertySymbols,lB=Object.prototype.hasOwnProperty,sB=Object.prototype.propertyIsEnumerable,Zb=(e,t,r)=>t in e?oB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zo=(e,t)=>{for(var r in t||(t={}))lB.call(t,r)&&Zb(e,r,t[r]);if(Jb)for(var r of Jb(t))sB.call(t,r)&&Zb(e,r,t[r]);return e},su=(e,t)=>aB(e,iB(t));function ex(e,t,r,n){return e==="center"||n==="center"?{top:t}:e==="end"?{bottom:r}:e==="start"?{top:r}:{}}function tx(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 cB={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function uB({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",[cB[c]]:P(n)},p=P(-t/2);return c==="left"?su(zo(zo({},d),ex(u,i,r,o)),{right:p,borderLeftColor:"transparent",borderBottomColor:"transparent"}):c==="right"?su(zo(zo({},d),ex(u,i,r,o)),{left:p,borderRightColor:"transparent",borderTopColor:"transparent"}):c==="top"?su(zo(zo({},d),tx(u,a,r,o,l)),{bottom:p,borderTopColor:"transparent",borderLeftColor:"transparent"}):c==="bottom"?su(zo(zo({},d),tx(u,a,r,o,l)),{top:p,borderBottomColor:"transparent",borderRightColor:"transparent"}):{}}var dB=Object.defineProperty,fB=Object.defineProperties,pB=Object.getOwnPropertyDescriptors,tf=Object.getOwnPropertySymbols,Wj=Object.prototype.hasOwnProperty,Hj=Object.prototype.propertyIsEnumerable,rx=(e,t,r)=>t in e?dB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mB=(e,t)=>{for(var r in t||(t={}))Wj.call(t,r)&&rx(e,r,t[r]);if(tf)for(var r of tf(t))Hj.call(t,r)&&rx(e,r,t[r]);return e},hB=(e,t)=>fB(e,pB(t)),gB=(e,t)=>{var r={};for(var n in e)Wj.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&&Hj.call(e,n)&&(r[n]=e[n]);return r};const _0=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=gB(r,["position","arrowSize","arrowOffset","arrowRadius","arrowPosition","visible","arrowX","arrowY"]);const h=tr();return c?s.createElement("div",hB(mB({},p),{ref:t,style:uB({position:n,arrowSize:o,arrowOffset:a,arrowRadius:i,arrowPosition:l,dir:h.dir,arrowX:u,arrowY:d})})):null});_0.displayName="@mantine/core/FloatingArrow";var vB=Object.defineProperty,yB=Object.defineProperties,wB=Object.getOwnPropertyDescriptors,rf=Object.getOwnPropertySymbols,qj=Object.prototype.hasOwnProperty,Gj=Object.prototype.propertyIsEnumerable,nx=(e,t,r)=>t in e?vB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wi=(e,t)=>{for(var r in t||(t={}))qj.call(t,r)&&nx(e,r,t[r]);if(rf)for(var r of rf(t))Gj.call(t,r)&&nx(e,r,t[r]);return e},cu=(e,t)=>yB(e,wB(t)),_B=(e,t)=>{var r={};for(var n in e)qj.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&&Gj.call(e,n)&&(r[n]=e[n]);return r};const bB={};function Qj(e){var t;const r=H("PopoverDropdown",bB,e),{style:n,className:o,children:a,onKeyDownCapture:i}=r,l=_B(r,["style","className","children","onKeyDownCapture"]),c=Fj(),{classes:u,cx:d}=JV({radius:c.radius,shadow:c.shadow},{name:c.__staticSelector,classNames:c.classNames,styles:c.styles,unstyled:c.unstyled,variant:c.variant}),p=W$({opened:c.opened,shouldReturnFocus:c.returnFocus}),h=c.withRoles?{"aria-labelledby":c.getTargetId(),id:c.getDropdownId(),role:"dialog"}:{};return c.disabled?null:s.createElement(El,cu(wi({},c.portalProps),{withinPortal:c.withinPortal}),s.createElement(ii,cu(wi({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}),g=>{var v,w;return s.createElement(w0,{active:c.trapFocus},s.createElement(se,wi(cu(wi({},h),{tabIndex:-1,ref:c.floating,style:cu(wi(wi({},n),g),{zIndex:c.zIndex,top:(v=c.y)!=null?v:0,left:(w=c.x)!=null?w:0,width:c.width==="target"?void 0:P(c.width)}),className:d(u.dropdown,o),onKeyDownCapture:z4(c.onClose,{active:c.closeOnEscape,onTrigger:p,onKeyDown:i}),"data-position":c.placement}),l),a,s.createElement(_0,{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})))}))}Qj.displayName="@mantine/core/PopoverDropdown";function Kj(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 ox=Object.getOwnPropertySymbols,xB=Object.prototype.hasOwnProperty,EB=Object.prototype.propertyIsEnumerable,SB=(e,t)=>{var r={};for(var n in e)xB.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&ox)for(var n of ox(e))t.indexOf(n)<0&&EB.call(e,n)&&(r[n]=e[n]);return r};const PB={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:jn("popover"),__staticSelector:"Popover",width:"max-content"};function ko(e){var t,r,n,o,a,i;const l=f.useRef(null),c=H("Popover",PB,e),{children:u,position:d,offset:p,onPositionChange:h,positionDependencies:g,opened:v,transitionProps:w,width:E,middlewares:_,withArrow:y,arrowSize:x,arrowOffset:b,arrowRadius:S,arrowPosition:$,unstyled:O,classNames:C,styles:T,closeOnClickOutside:j,withinPortal:k,portalProps:I,closeOnEscape:z,clickOutsideEvents:N,trapFocus:F,onClose:q,onOpen:ee,onChange:R,zIndex:D,radius:V,shadow:G,id:ie,defaultOpened:Oe,__staticSelector:ce,withRoles:Ae,disabled:Ie,returnFocus:ft,variant:Ge,keepMounted:tt}=c,jr=SB(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"]),[Rr,rr]=f.useState(null),[pn,Tt]=f.useState(null),Tr=$r(ie),to=tr(),He=UV({middlewares:_,width:E,position:Kj(to.dir,d),offset:typeof p=="number"?p+(y?x/2:0):p,arrowRef:l,arrowOffset:b,onPositionChange:h,positionDependencies:g,opened:v,defaultOpened:Oe,onChange:R,onOpen:ee,onClose:q});i6(()=>He.opened&&j&&He.onClose(),N,[Rr,pn]);const Hr=f.useCallback(bt=>{rr(bt),He.floating.reference(bt)},[He.floating.reference]),qr=f.useCallback(bt=>{Tt(bt),He.floating.floating(bt)},[He.floating.floating]);return s.createElement(WV,{value:{returnFocus:ft,disabled:Ie,controlled:He.controlled,reference:Hr,floating:qr,x:He.floating.x,y:He.floating.y,arrowX:(n=(r=(t=He.floating)==null?void 0:t.middlewareData)==null?void 0:r.arrow)==null?void 0:n.x,arrowY:(i=(a=(o=He.floating)==null?void 0:o.middlewareData)==null?void 0:a.arrow)==null?void 0:i.y,opened:He.opened,arrowRef:l,transitionProps:w,width:E,withArrow:y,arrowSize:x,arrowOffset:b,arrowRadius:S,arrowPosition:$,placement:He.floating.placement,trapFocus:F,withinPortal:k,portalProps:I,zIndex:D,radius:V,shadow:G,closeOnEscape:z,onClose:He.onClose,onToggle:He.onToggle,getTargetId:()=>`${Tr}-target`,getDropdownId:()=>`${Tr}-dropdown`,withRoles:Ae,targetProps:jr,__staticSelector:ce,classNames:C,styles:T,unstyled:O,variant:Ge,keepMounted:tt}},u)}ko.Target=Uj;ko.Dropdown=Qj;ko.displayName="@mantine/core/Popover";var OB=Object.defineProperty,nf=Object.getOwnPropertySymbols,Yj=Object.prototype.hasOwnProperty,Xj=Object.prototype.propertyIsEnumerable,ax=(e,t,r)=>t in e?OB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$B=(e,t)=>{for(var r in t||(t={}))Yj.call(t,r)&&ax(e,r,t[r]);if(nf)for(var r of nf(t))Xj.call(t,r)&&ax(e,r,t[r]);return e},CB=(e,t)=>{var r={};for(var n in e)Yj.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&&Xj.call(e,n)&&(r[n]=e[n]);return r};function kB(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=CB(t,["children","component","maxHeight","direction","id","innerRef","__staticSelector","styles","classNames","unstyled"]);const{classes:g}=zF(null,{name:c,styles:u,classNames:d,unstyled:p});return s.createElement(ko.Dropdown,$B({p:0,onMouseDown:v=>v.preventDefault()},h),s.createElement("div",{style:{maxHeight:P(o),display:"flex"}},s.createElement(se,{component:n||"div",id:`${i}-items`,"aria-labelledby":`${i}-label`,role:"listbox",onMouseDown:v=>v.preventDefault(),style:{flex:1,overflowY:n!==i0?"auto":void 0},"data-combobox-popover":!0,tabIndex:-1,ref:l},s.createElement("div",{className:g.itemsWrapper,style:{flexDirection:a}},r))))}function bs({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:g,unstyled:v,readOnly:w,variant:E}){return s.createElement(ko,{unstyled:v,classNames:h,styles:g,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:w,onPositionChange:_=>c&&(l==null?void 0:l(_==="top"?"column-reverse":"column")),variant:E},a)}bs.Target=ko.Target;bs.Dropdown=kB;var jB=Object.defineProperty,RB=Object.defineProperties,TB=Object.getOwnPropertyDescriptors,of=Object.getOwnPropertySymbols,Jj=Object.prototype.hasOwnProperty,Zj=Object.prototype.propertyIsEnumerable,ix=(e,t,r)=>t in e?jB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,uu=(e,t)=>{for(var r in t||(t={}))Jj.call(t,r)&&ix(e,r,t[r]);if(of)for(var r of of(t))Zj.call(t,r)&&ix(e,r,t[r]);return e},IB=(e,t)=>RB(e,TB(t)),DB=(e,t)=>{var r={};for(var n in e)Jj.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&&Zj.call(e,n)&&(r[n]=e[n]);return r};function eR(e,t,r){const n=H(e,t,r),{label:o,description:a,error:i,required:l,classNames:c,styles:u,className:d,unstyled:p,__staticSelector:h,sx:g,errorProps:v,labelProps:w,descriptionProps:E,wrapperProps:_,id:y,size:x,style:b,inputContainer:S,inputWrapperOrder:$,withAsterisk:O,variant:C}=n,T=DB(n,["label","description","error","required","classNames","styles","className","unstyled","__staticSelector","sx","errorProps","labelProps","descriptionProps","wrapperProps","id","size","style","inputContainer","inputWrapperOrder","withAsterisk","variant"]),j=$r(y),{systemStyles:k,rest:I}=Zn(T),z=uu({label:o,description:a,error:i,required:l,classNames:c,className:d,__staticSelector:h,sx:g,errorProps:v,labelProps:w,descriptionProps:E,unstyled:p,styles:u,id:j,size:x,style:b,inputContainer:S,inputWrapperOrder:$,withAsterisk:O,variant:C},_);return IB(uu({},I),{classNames:c,styles:u,unstyled:p,wrapperProps:uu(uu({},z),k),inputProps:{required:l,classNames:c,styles:u,unstyled:p,id:j,size:x,__staticSelector:h,error:i,variant:C}})}var NB=U((e,t,{size:r})=>({label:{display:"inline-block",fontSize:M({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 AB=NB;var MB=Object.defineProperty,af=Object.getOwnPropertySymbols,tR=Object.prototype.hasOwnProperty,rR=Object.prototype.propertyIsEnumerable,lx=(e,t,r)=>t in e?MB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zB=(e,t)=>{for(var r in t||(t={}))tR.call(t,r)&&lx(e,r,t[r]);if(af)for(var r of af(t))rR.call(t,r)&&lx(e,r,t[r]);return e},LB=(e,t)=>{var r={};for(var n in e)tR.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&&rR.call(e,n)&&(r[n]=e[n]);return r};const FB={labelElement:"label",size:"sm"},b0=f.forwardRef((e,t)=>{const r=H("InputLabel",FB,e),{labelElement:n,children:o,required:a,size:i,classNames:l,styles:c,unstyled:u,className:d,htmlFor:p,__staticSelector:h,variant:g,onMouseDown:v}=r,w=LB(r,["labelElement","children","required","size","classNames","styles","unstyled","className","htmlFor","__staticSelector","variant","onMouseDown"]),{classes:E,cx:_}=AB(null,{name:["InputWrapper",h],classNames:l,styles:c,unstyled:u,variant:g,size:i});return s.createElement(se,zB({component:n,ref:t,className:_(E.label,d),htmlFor:n==="label"?p:void 0,onMouseDown:y=>{v==null||v(y),!y.defaultPrevented&&y.detail>1&&y.preventDefault()}},w),o,a&&s.createElement("span",{className:E.required,"aria-hidden":!0}," *"))});b0.displayName="@mantine/core/InputLabel";var VB=U((e,t,{size:r})=>({error:{wordBreak:"break-word",color:e.fn.variant({variant:"filled",color:"red"}).background,fontSize:`calc(${M({size:r,sizes:e.fontSizes})} - ${P(2)})`,lineHeight:1.2,display:"block"}}));const BB=VB;var UB=Object.defineProperty,lf=Object.getOwnPropertySymbols,nR=Object.prototype.hasOwnProperty,oR=Object.prototype.propertyIsEnumerable,sx=(e,t,r)=>t in e?UB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,WB=(e,t)=>{for(var r in t||(t={}))nR.call(t,r)&&sx(e,r,t[r]);if(lf)for(var r of lf(t))oR.call(t,r)&&sx(e,r,t[r]);return e},HB=(e,t)=>{var r={};for(var n in e)nR.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&&oR.call(e,n)&&(r[n]=e[n]);return r};const qB={size:"sm"},x0=f.forwardRef((e,t)=>{const r=H("InputError",qB,e),{children:n,className:o,classNames:a,styles:i,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=HB(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:g}=BB(null,{name:["InputWrapper",u],classNames:a,styles:i,unstyled:l,variant:d,size:c});return s.createElement(ae,WB({className:g(h.error,o),ref:t},p),n)});x0.displayName="@mantine/core/InputError";var GB=U((e,t,{size:r})=>({description:{wordBreak:"break-word",color:e.colorScheme==="dark"?e.colors.dark[2]:e.colors.gray[6],fontSize:`calc(${M({size:r,sizes:e.fontSizes})} - ${P(2)})`,lineHeight:1.2,display:"block"}}));const QB=GB;var KB=Object.defineProperty,sf=Object.getOwnPropertySymbols,aR=Object.prototype.hasOwnProperty,iR=Object.prototype.propertyIsEnumerable,cx=(e,t,r)=>t in e?KB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YB=(e,t)=>{for(var r in t||(t={}))aR.call(t,r)&&cx(e,r,t[r]);if(sf)for(var r of sf(t))iR.call(t,r)&&cx(e,r,t[r]);return e},XB=(e,t)=>{var r={};for(var n in e)aR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&sf)for(var n of sf(e))t.indexOf(n)<0&&iR.call(e,n)&&(r[n]=e[n]);return r};const JB={size:"sm"},E0=f.forwardRef((e,t)=>{const r=H("InputDescription",JB,e),{children:n,className:o,classNames:a,styles:i,unstyled:l,size:c,__staticSelector:u,variant:d}=r,p=XB(r,["children","className","classNames","styles","unstyled","size","__staticSelector","variant"]),{classes:h,cx:g}=QB(null,{name:["InputWrapper",u],classNames:a,styles:i,unstyled:l,variant:d,size:c});return s.createElement(ae,YB({color:"dimmed",className:g(h.description,o),ref:t,unstyled:l},p),n)});E0.displayName="@mantine/core/InputDescription";const lR=f.createContext({offsetBottom:!1,offsetTop:!1,describedBy:void 0}),ZB=lR.Provider,eU=()=>f.useContext(lR);function tU(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 rU=Object.defineProperty,nU=Object.defineProperties,oU=Object.getOwnPropertyDescriptors,ux=Object.getOwnPropertySymbols,aU=Object.prototype.hasOwnProperty,iU=Object.prototype.propertyIsEnumerable,dx=(e,t,r)=>t in e?rU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lU=(e,t)=>{for(var r in t||(t={}))aU.call(t,r)&&dx(e,r,t[r]);if(ux)for(var r of ux(t))iU.call(t,r)&&dx(e,r,t[r]);return e},sU=(e,t)=>nU(e,oU(t)),cU=U(e=>({root:sU(lU({},e.fn.fontStyles()),{lineHeight:e.lineHeight})}));const uU=cU;var dU=Object.defineProperty,fU=Object.defineProperties,pU=Object.getOwnPropertyDescriptors,cf=Object.getOwnPropertySymbols,sR=Object.prototype.hasOwnProperty,cR=Object.prototype.propertyIsEnumerable,fx=(e,t,r)=>t in e?dU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Lo=(e,t)=>{for(var r in t||(t={}))sR.call(t,r)&&fx(e,r,t[r]);if(cf)for(var r of cf(t))cR.call(t,r)&&fx(e,r,t[r]);return e},px=(e,t)=>fU(e,pU(t)),mU=(e,t)=>{var r={};for(var n in e)sR.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&&cR.call(e,n)&&(r[n]=e[n]);return r};const hU={labelElement:"label",size:"sm",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},uR=f.forwardRef((e,t)=>{const r=H("InputWrapper",hU,e),{className:n,label:o,children:a,required:i,id:l,error:c,description:u,labelElement:d,labelProps:p,descriptionProps:h,errorProps:g,classNames:v,styles:w,size:E,inputContainer:_,__staticSelector:y,unstyled:x,inputWrapperOrder:b,withAsterisk:S,variant:$}=r,O=mU(r,["className","label","children","required","id","error","description","labelElement","labelProps","descriptionProps","errorProps","classNames","styles","size","inputContainer","__staticSelector","unstyled","inputWrapperOrder","withAsterisk","variant"]),{classes:C,cx:T}=uU(null,{classNames:v,styles:w,name:["InputWrapper",y],unstyled:x,variant:$,size:E}),j={classNames:v,styles:w,unstyled:x,size:E,variant:$,__staticSelector:y},k=typeof S=="boolean"?S:i,I=l?`${l}-error`:g==null?void 0:g.id,z=l?`${l}-description`:h==null?void 0:h.id,F=`${!!c&&typeof c!="boolean"?I:""} ${u?z:""}`,q=F.trim().length>0?F.trim():void 0,ee=o&&s.createElement(b0,Lo(Lo({key:"label",labelElement:d,id:l?`${l}-label`:void 0,htmlFor:l,required:k},j),p),o),R=u&&s.createElement(E0,px(Lo(Lo({key:"description"},h),j),{size:(h==null?void 0:h.size)||j.size,id:(h==null?void 0:h.id)||z}),u),D=s.createElement(f.Fragment,{key:"input"},_(a)),V=typeof c!="boolean"&&c&&s.createElement(x0,px(Lo(Lo({},g),j),{size:(g==null?void 0:g.size)||j.size,key:"error",id:(g==null?void 0:g.id)||I}),c),G=b.map(ie=>{switch(ie){case"label":return ee;case"input":return D;case"description":return R;case"error":return V;default:return null}});return s.createElement(ZB,{value:Lo({describedBy:q},tU(b,{hasDescription:!!R,hasError:!!V}))},s.createElement(se,Lo({className:T(C.root,n),ref:t},O),G))});uR.displayName="@mantine/core/InputWrapper";var gU=Object.defineProperty,uf=Object.getOwnPropertySymbols,dR=Object.prototype.hasOwnProperty,fR=Object.prototype.propertyIsEnumerable,mx=(e,t,r)=>t in e?gU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vU=(e,t)=>{for(var r in t||(t={}))dR.call(t,r)&&mx(e,r,t[r]);if(uf)for(var r of uf(t))fR.call(t,r)&&mx(e,r,t[r]);return e},yU=(e,t)=>{var r={};for(var n in e)dR.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&&fR.call(e,n)&&(r[n]=e[n]);return r};const wU={},pR=f.forwardRef((e,t)=>{const r=H("InputPlaceholder",wU,e),{sx:n}=r,o=yU(r,["sx"]);return s.createElement(se,vU({component:"span",sx:[a=>a.fn.placeholderStyles(),...em(n)],ref:t},o))});pR.displayName="@mantine/core/InputPlaceholder";var _U=Object.defineProperty,bU=Object.defineProperties,xU=Object.getOwnPropertyDescriptors,hx=Object.getOwnPropertySymbols,EU=Object.prototype.hasOwnProperty,SU=Object.prototype.propertyIsEnumerable,gx=(e,t,r)=>t in e?_U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,du=(e,t)=>{for(var r in t||(t={}))EU.call(t,r)&&gx(e,r,t[r]);if(hx)for(var r of hx(t))SU.call(t,r)&&gx(e,r,t[r]);return e},Gh=(e,t)=>bU(e,xU(t));const Et={xs:P(30),sm:P(36),md:P(42),lg:P(50),xl:P(60)},PU=["default","filled","unstyled"];function OU({theme:e,variant:t}){return PU.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 $U=U((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,g=d==="default"||d==="filled"?{minHeight:M({size:p,sizes:Et}),paddingLeft:`calc(${M({size:p,sizes:Et})} / 3)`,paddingRight:a?o||M({size:p,sizes:Et}):`calc(${M({size:p,sizes:Et})} / 3)`,borderRadius:e.fn.radius(r)}:d==="unstyled"&&a?{paddingRight:o||M({size:p,sizes:Et})}: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:Gh(du(du(Gh(du({},e.fn.fontStyles()),{height:t?d==="unstyled"?void 0:"auto":M({size:p,sizes:Et}),WebkitTapHighlightColor:"transparent",lineHeight:t?e.lineHeight:`calc(${M({size:p,sizes:Et})} - ${P(2)})`,appearance:"none",resize:"none",boxSizing:"border-box",fontSize:M({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}),OU({theme:e,variant:d})),g),{"&: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):M({size:p,sizes:Et})},"&::placeholder":Gh(du({},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):M({size:p,sizes:Et}),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||M({size:p,sizes:Et})}}}),CU=Object.defineProperty,kU=Object.defineProperties,jU=Object.getOwnPropertyDescriptors,df=Object.getOwnPropertySymbols,mR=Object.prototype.hasOwnProperty,hR=Object.prototype.propertyIsEnumerable,vx=(e,t,r)=>t in e?CU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fu=(e,t)=>{for(var r in t||(t={}))mR.call(t,r)&&vx(e,r,t[r]);if(df)for(var r of df(t))hR.call(t,r)&&vx(e,r,t[r]);return e},yx=(e,t)=>kU(e,jU(t)),RU=(e,t)=>{var r={};for(var n in e)mR.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&&hR.call(e,n)&&(r[n]=e[n]);return r};const TU={size:"sm",variant:"default"},li=f.forwardRef((e,t)=>{const r=H("Input",TU,e),{className:n,error:o,required:a,disabled:i,variant:l,icon:c,style:u,rightSectionWidth:d,iconWidth:p,rightSection:h,rightSectionProps:g,radius:v,size:w,wrapperProps:E,classNames:_,styles:y,__staticSelector:x,multiline:b,sx:S,unstyled:$,pointer:O}=r,C=RU(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:j,describedBy:k}=eU(),{classes:I,cx:z}=$U({radius:v,multiline:b,invalid:!!o,rightSectionWidth:d?P(d):void 0,iconWidth:p,withRightSection:!!h,offsetBottom:T,offsetTop:j,pointer:O},{classNames:_,styles:y,name:["Input",x],unstyled:$,variant:l,size:w}),{systemStyles:N,rest:F}=Zn(C);return s.createElement(se,fu(fu({className:z(I.wrapper,n),sx:S,style:u},N),E),c&&s.createElement("div",{className:I.icon},c),s.createElement(se,yx(fu({component:"input"},F),{ref:t,required:a,"aria-invalid":!!o,"aria-describedby":k,disabled:i,"data-disabled":i||void 0,"data-with-icon":!!c||void 0,"data-invalid":!!o||void 0,className:I.input})),h&&s.createElement("div",yx(fu({},g),{className:I.rightSection}),h))});li.displayName="@mantine/core/Input";li.Wrapper=uR;li.Label=b0;li.Description=E0;li.Error=x0;li.Placeholder=pR;const Ft=li;var IU=Object.defineProperty,ff=Object.getOwnPropertySymbols,gR=Object.prototype.hasOwnProperty,vR=Object.prototype.propertyIsEnumerable,wx=(e,t,r)=>t in e?IU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,DU=(e,t)=>{for(var r in t||(t={}))gR.call(t,r)&&wx(e,r,t[r]);if(ff)for(var r of ff(t))vR.call(t,r)&&wx(e,r,t[r]);return e},NU=(e,t)=>{var r={};for(var n in e)gR.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&&vR.call(e,n)&&(r[n]=e[n]);return r};function AU(e){const t=e,{style:r}=t,n=NU(t,["style"]);return s.createElement("svg",DU({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 MU=Object.defineProperty,zU=Object.defineProperties,LU=Object.getOwnPropertyDescriptors,_x=Object.getOwnPropertySymbols,FU=Object.prototype.hasOwnProperty,VU=Object.prototype.propertyIsEnumerable,bx=(e,t,r)=>t in e?MU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,BU=(e,t)=>{for(var r in t||(t={}))FU.call(t,r)&&bx(e,r,t[r]);if(_x)for(var r of _x(t))VU.call(t,r)&&bx(e,r,t[r]);return e},UU=(e,t)=>zU(e,LU(t));const yR=f.createContext(null);function WU({spacing:e,children:t}){return s.createElement(yR.Provider,{value:{spacing:e}},t)}function HU(){const e=f.useContext(yR);return e?UU(BU({},e),{withinGroup:!0}):{spacing:null,withinGroup:!1}}var qU=U((e,{spacing:t})=>({root:{display:"flex",paddingLeft:M({size:t,sizes:e.spacing})}}));const GU=qU;var QU=Object.defineProperty,pf=Object.getOwnPropertySymbols,wR=Object.prototype.hasOwnProperty,_R=Object.prototype.propertyIsEnumerable,xx=(e,t,r)=>t in e?QU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,KU=(e,t)=>{for(var r in t||(t={}))wR.call(t,r)&&xx(e,r,t[r]);if(pf)for(var r of pf(t))_R.call(t,r)&&xx(e,r,t[r]);return e},YU=(e,t)=>{var r={};for(var n in e)wR.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&&_R.call(e,n)&&(r[n]=e[n]);return r};const XU={},bR=f.forwardRef((e,t)=>{const r=H("AvatarGroup",XU,e),{children:n,spacing:o="sm",unstyled:a,className:i,variant:l}=r,c=YU(r,["children","spacing","unstyled","className","variant"]),{classes:u,cx:d}=GU({spacing:o},{name:"AvatarGroup",unstyled:a,variant:l});return s.createElement(WU,{spacing:o},s.createElement(se,KU({ref:t,className:d(u.root,i)},c),n))});bR.displayName="@mantine/core/AvatarGroup";var JU=Object.defineProperty,ZU=Object.defineProperties,eW=Object.getOwnPropertyDescriptors,Ex=Object.getOwnPropertySymbols,tW=Object.prototype.hasOwnProperty,rW=Object.prototype.propertyIsEnumerable,Sx=(e,t,r)=>t in e?JU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Hl=(e,t)=>{for(var r in t||(t={}))tW.call(t,r)&&Sx(e,r,t[r]);if(Ex)for(var r of Ex(t))rW.call(t,r)&&Sx(e,r,t[r]);return e},Px=(e,t)=>ZU(e,eW(t));const nW=["filled","light","gradient","outline"],pu={xs:P(16),sm:P(26),md:P(38),lg:P(56),xl:P(84)};function oW({withinGroup:e,spacing:t,theme:r}){return e?{marginLeft:`calc(${M({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 aW({theme:e,variant:t,color:r,gradient:n}){const o=e.fn.variant({variant:t,color:r,gradient:n});return nW.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 iW=U((e,{radius:t,withinGroup:r,spacing:n,color:o,gradient:a},{variant:i,size:l})=>{const c=aW({theme:e,color:o,gradient:a,variant:i});return{root:Hl(Px(Hl({},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:M({size:l,sizes:pu}),minWidth:M({size:l,sizes:pu}),height:M({size:l,sizes:pu})}),oW({withinGroup:r,spacing:n,theme:e})),image:{objectFit:"cover",width:"100%",height:"100%",display:"block"},placeholder:Hl(Px(Hl({},e.fn.fontStyles()),{fontWeight:700,display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",userSelect:"none",borderRadius:e.fn.radius(t),fontSize:`calc(${M({size:l,sizes:pu})} / 2.5)`}),c.placeholder),placeholderIcon:Hl({width:"70%",height:"70%"},c.placeholderIcon)}});const lW=iW;var sW=Object.defineProperty,cW=Object.defineProperties,uW=Object.getOwnPropertyDescriptors,mf=Object.getOwnPropertySymbols,xR=Object.prototype.hasOwnProperty,ER=Object.prototype.propertyIsEnumerable,Ox=(e,t,r)=>t in e?sW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$x=(e,t)=>{for(var r in t||(t={}))xR.call(t,r)&&Ox(e,r,t[r]);if(mf)for(var r of mf(t))ER.call(t,r)&&Ox(e,r,t[r]);return e},dW=(e,t)=>cW(e,uW(t)),fW=(e,t)=>{var r={};for(var n in e)xR.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&&ER.call(e,n)&&(r[n]=e[n]);return r};const pW={size:"md",color:"gray",variant:"light"},S0=f.forwardRef((e,t)=>{const r=H("Avatar",pW,e),{className:n,size:o,src:a,alt:i,radius:l,children:c,color:u,variant:d,gradient:p,classNames:h,styles:g,imageProps:v,unstyled:w}=r,E=fW(r,["className","size","src","alt","radius","children","color","variant","gradient","classNames","styles","imageProps","unstyled"]),_=HU(),[y,x]=f.useState(!a),{classes:b,cx:S}=lW({color:u,radius:l,withinGroup:_.withinGroup,spacing:_.spacing,gradient:p},{classNames:h,styles:g,unstyled:w,name:"Avatar",variant:d,size:o});return f.useEffect(()=>{x(!a)},[a]),s.createElement(se,$x({component:"div",className:S(b.root,n),ref:t},E),y?s.createElement("div",{className:b.placeholder,title:i},c||s.createElement(AU,{className:b.placeholderIcon})):s.createElement("img",dW($x({},v),{className:b.image,src:a,alt:i,onError:()=>x(!0)})))});S0.displayName="@mantine/core/Avatar";S0.Group=bR;const hf=S0;var mW=Object.defineProperty,hW=Object.defineProperties,gW=Object.getOwnPropertyDescriptors,Cx=Object.getOwnPropertySymbols,vW=Object.prototype.hasOwnProperty,yW=Object.prototype.propertyIsEnumerable,kx=(e,t,r)=>t in e?mW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qh=(e,t)=>{for(var r in t||(t={}))vW.call(t,r)&&kx(e,r,t[r]);if(Cx)for(var r of Cx(t))yW.call(t,r)&&kx(e,r,t[r]);return e},wW=(e,t)=>hW(e,gW(t));const _W=["light","filled","outline","dot","gradient"],Kh={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)}},bW={xs:P(4),sm:P(4),md:P(6),lg:P(8),xl:P(10)};function xW({theme:e,variant:t,color:r,size:n,gradient:o}){if(!_W.includes(t))return null;if(t==="dot"){const i=M({size:n,sizes:bW});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(${M({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 EW=U((e,{color:t,radius:r,gradient:n,fullWidth:o},{variant:a,size:i})=>{const{fontSize:l,height:c}=i in Kh?Kh[i]:Kh.md;return{leftSection:{marginRight:`calc(${e.spacing.xs} / 2)`},rightSection:{marginLeft:`calc(${e.spacing.xs} / 2)`},inner:{whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},root:Qh(wW(Qh(Qh({},e.fn.focusStyles()),e.fn.fontStyles()),{fontSize:l,height:c,WebkitTapHighlightColor:"transparent",lineHeight:`calc(${c} - ${P(2)})`,textDecoration:"none",padding:`0 calc(${M({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"}),xW({theme:e,variant:a,color:t,size:i,gradient:n}))}});const SW=EW;var PW=Object.defineProperty,gf=Object.getOwnPropertySymbols,SR=Object.prototype.hasOwnProperty,PR=Object.prototype.propertyIsEnumerable,jx=(e,t,r)=>t in e?PW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OW=(e,t)=>{for(var r in t||(t={}))SR.call(t,r)&&jx(e,r,t[r]);if(gf)for(var r of gf(t))PR.call(t,r)&&jx(e,r,t[r]);return e},$W=(e,t)=>{var r={};for(var n in e)SR.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&&PR.call(e,n)&&(r[n]=e[n]);return r};const CW={variant:"light",size:"md",radius:"xl"},OR=f.forwardRef((e,t)=>{const r=H("Badge",CW,e),{className:n,color:o,variant:a,fullWidth:i,children:l,size:c,leftSection:u,rightSection:d,radius:p,gradient:h,classNames:g,styles:v,unstyled:w}=r,E=$W(r,["className","color","variant","fullWidth","children","size","leftSection","rightSection","radius","gradient","classNames","styles","unstyled"]),{classes:_,cx:y}=SW({fullWidth:i,color:o,radius:p,gradient:h},{classNames:g,styles:v,name:"Badge",unstyled:w,variant:a,size:c});return s.createElement(se,OW({className:y(_.root,n),ref:t},E),u&&s.createElement("span",{className:_.leftSection},u),s.createElement("span",{className:_.inner},l),d&&s.createElement("span",{className:_.rightSection},d))});OR.displayName="@mantine/core/Badge";const kW=OR;var jW=Object.defineProperty,vf=Object.getOwnPropertySymbols,$R=Object.prototype.hasOwnProperty,CR=Object.prototype.propertyIsEnumerable,Rx=(e,t,r)=>t in e?jW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Tx=(e,t)=>{for(var r in t||(t={}))$R.call(t,r)&&Rx(e,r,t[r]);if(vf)for(var r of vf(t))CR.call(t,r)&&Rx(e,r,t[r]);return e},RW=(e,t)=>{var r={};for(var n in e)$R.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&&CR.call(e,n)&&(r[n]=e[n]);return r};function TW(e){const t=e,{style:r}=t,n=RW(t,["style"]);return s.createElement("svg",Tx({viewBox:"0 0 409.294 409.294",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",style:Tx({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 IW=Object.defineProperty,DW=Object.defineProperties,NW=Object.getOwnPropertyDescriptors,Ix=Object.getOwnPropertySymbols,AW=Object.prototype.hasOwnProperty,MW=Object.prototype.propertyIsEnumerable,Dx=(e,t,r)=>t in e?IW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zW=(e,t)=>{for(var r in t||(t={}))AW.call(t,r)&&Dx(e,r,t[r]);if(Ix)for(var r of Ix(t))MW.call(t,r)&&Dx(e,r,t[r]);return e},LW=(e,t)=>DW(e,NW(t)),FW=U((e,{color:t})=>({root:LW(zW({},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 VW=FW;var BW=Object.defineProperty,yf=Object.getOwnPropertySymbols,kR=Object.prototype.hasOwnProperty,jR=Object.prototype.propertyIsEnumerable,Nx=(e,t,r)=>t in e?BW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UW=(e,t)=>{for(var r in t||(t={}))kR.call(t,r)&&Nx(e,r,t[r]);if(yf)for(var r of yf(t))jR.call(t,r)&&Nx(e,r,t[r]);return e},WW=(e,t)=>{var r={};for(var n in e)kR.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&&jR.call(e,n)&&(r[n]=e[n]);return r};const HW={color:"gray",icon:s.createElement(TW,null)},RR=f.forwardRef((e,t)=>{const r=H("Blockquote",HW,e),{className:n,color:o,icon:a,cite:i,children:l,classNames:c,styles:u,unstyled:d,variant:p}=r,h=WW(r,["className","color","icon","cite","children","classNames","styles","unstyled","variant"]),{classes:g,cx:v}=VW({color:o},{classNames:c,styles:u,unstyled:d,name:"Blockquote",variant:p});return s.createElement(se,UW({component:"blockquote",className:v(g.root,n),ref:t},h),s.createElement("div",{className:g.inner},a&&s.createElement("div",{className:g.icon},a),s.createElement("div",{className:g.body},l,i&&s.createElement("cite",{className:g.cite},i))))});RR.displayName="@mantine/core/Blockquote";var qW=U((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 GW=qW;var QW=Object.defineProperty,wf=Object.getOwnPropertySymbols,TR=Object.prototype.hasOwnProperty,IR=Object.prototype.propertyIsEnumerable,Ax=(e,t,r)=>t in e?QW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,KW=(e,t)=>{for(var r in t||(t={}))TR.call(t,r)&&Ax(e,r,t[r]);if(wf)for(var r of wf(t))IR.call(t,r)&&Ax(e,r,t[r]);return e},YW=(e,t)=>{var r={};for(var n in e)TR.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&&IR.call(e,n)&&(r[n]=e[n]);return r};const XW={orientation:"horizontal",buttonBorderWidth:1},DR=f.forwardRef((e,t)=>{const r=H("ButtonGroup",XW,e),{className:n,orientation:o,buttonBorderWidth:a,unstyled:i}=r,l=YW(r,["className","orientation","buttonBorderWidth","unstyled"]),{classes:c,cx:u}=GW({orientation:o,buttonBorderWidth:a},{name:"ButtonGroup",unstyled:i});return s.createElement(se,KW({className:u(c.root,n),ref:t},l))});DR.displayName="@mantine/core/ButtonGroup";var JW=Object.defineProperty,ZW=Object.defineProperties,eH=Object.getOwnPropertyDescriptors,Mx=Object.getOwnPropertySymbols,tH=Object.prototype.hasOwnProperty,rH=Object.prototype.propertyIsEnumerable,zx=(e,t,r)=>t in e?JW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lo=(e,t)=>{for(var r in t||(t={}))tH.call(t,r)&&zx(e,r,t[r]);if(Mx)for(var r of Mx(t))rH.call(t,r)&&zx(e,r,t[r]);return e},Yu=(e,t)=>ZW(e,eH(t));const nH=["filled","outline","light","white","default","subtle","gradient"],Pv={xs:{height:Et.xs,paddingLeft:P(14),paddingRight:P(14)},sm:{height:Et.sm,paddingLeft:P(18),paddingRight:P(18)},md:{height:Et.md,paddingLeft:P(22),paddingRight:P(22)},lg:{height:Et.lg,paddingLeft:P(26),paddingRight:P(26)},xl:{height:Et.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 oH({compact:e,size:t,withLeftIcon:r,withRightIcon:n}){if(e)return Pv[`compact-${t}`];const o=Pv[t];return o?Yu(lo({},o),{paddingLeft:r?`calc(${o.paddingLeft} / 1.5)`:o.paddingLeft,paddingRight:n?`calc(${o.paddingRight} / 1.5)`:o.paddingRight}):{}}const aH=e=>({display:e?"block":"inline-block",width:e?"100%":"auto"});function iH({variant:e,theme:t,color:r,gradient:n}){if(!nH.includes(e))return null;const o=t.fn.variant({color:r,variant:e,gradient:n});return e==="gradient"?lo({border:0,backgroundImage:o.background,color:o.color},t.fn.hover({backgroundSize:"200%"})):lo({border:`${P(1)} solid ${o.border}`,backgroundColor:o.background,color:o.color},t.fn.hover({backgroundColor:o.hover}))}var lH=U((e,{radius:t,fullWidth:r,compact:n,withLeftIcon:o,withRightIcon:a,color:i,gradient:l},{variant:c,size:u})=>({root:Yu(lo(Yu(lo(lo(lo(lo({},oH({compact:n,size:u,withLeftIcon:o,withRightIcon:a})),e.fn.fontStyles()),e.fn.focusStyles()),aH(r)),{borderRadius:e.fn.radius(t),fontWeight:600,position:"relative",lineHeight:1,fontSize:M({size:u,sizes:e.fontSizes}),userSelect:"none",cursor:"pointer"}),iH({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":Yu(lo({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 sH=lH;var cH=Object.defineProperty,_f=Object.getOwnPropertySymbols,NR=Object.prototype.hasOwnProperty,AR=Object.prototype.propertyIsEnumerable,Lx=(e,t,r)=>t in e?cH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fx=(e,t)=>{for(var r in t||(t={}))NR.call(t,r)&&Lx(e,r,t[r]);if(_f)for(var r of _f(t))AR.call(t,r)&&Lx(e,r,t[r]);return e},uH=(e,t)=>{var r={};for(var n in e)NR.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&&AR.call(e,n)&&(r[n]=e[n]);return r};const dH={size:"sm",type:"button",variant:"filled",loaderPosition:"left"},P0=f.forwardRef((e,t)=>{const r=H("Button",dH,e),{className:n,size:o,color:a,type:i,disabled:l,children:c,leftIcon:u,rightIcon:d,fullWidth:p,variant:h,radius:g,uppercase:v,compact:w,loading:E,loaderPosition:_,loaderProps:y,gradient:x,classNames:b,styles:S,unstyled:$}=r,O=uH(r,["className","size","color","type","disabled","children","leftIcon","rightIcon","fullWidth","variant","radius","uppercase","compact","loading","loaderPosition","loaderProps","gradient","classNames","styles","unstyled"]),{classes:C,cx:T,theme:j}=sH({radius:g,color:a,fullWidth:p,compact:w,gradient:x,withLeftIcon:!!u,withRightIcon:!!d},{name:"Button",unstyled:$,classNames:b,styles:S,variant:h,size:o}),k=j.fn.variant({color:a,variant:h}),I=s.createElement(un,Fx({color:k.color,size:`calc(${M({size:o,sizes:Pv}).height} / 2)`},y));return s.createElement(ho,Fx({className:T(C.root,n),type:i,disabled:l,"data-button":!0,"data-disabled":l||void 0,"data-loading":E||void 0,ref:t,unstyled:$},O),s.createElement("div",{className:C.inner},(u||E&&_==="left")&&s.createElement("span",{className:T(C.icon,C.leftIcon)},E&&_==="left"?I:u),E&&_==="center"&&s.createElement("span",{className:C.centerLoader},I),s.createElement("span",{className:C.label,style:{textTransform:v?"uppercase":void 0}},c),(d||E&&_==="right")&&s.createElement("span",{className:T(C.icon,C.rightIcon)},E&&_==="right"?I:d)))});P0.displayName="@mantine/core/Button";P0.Group=DR;const Y=P0;var fH=U((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 pH=fH;var mH=Object.defineProperty,bf=Object.getOwnPropertySymbols,MR=Object.prototype.hasOwnProperty,zR=Object.prototype.propertyIsEnumerable,Vx=(e,t,r)=>t in e?mH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hH=(e,t)=>{for(var r in t||(t={}))MR.call(t,r)&&Vx(e,r,t[r]);if(bf)for(var r of bf(t))zR.call(t,r)&&Vx(e,r,t[r]);return e},gH=(e,t)=>{var r={};for(var n in e)MR.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&&zR.call(e,n)&&(r[n]=e[n]);return r};const vH={},LR=f.forwardRef((e,t)=>{const r=H("Paper",vH,e),{className:n,children:o,radius:a,withBorder:i,shadow:l,unstyled:c,variant:u}=r,d=gH(r,["className","children","radius","withBorder","shadow","unstyled","variant"]),{classes:p,cx:h}=pH({radius:a,shadow:l},{name:"Paper",unstyled:c,variant:u});return s.createElement(se,hH({className:h(p.root,n),"data-with-border":i||void 0,ref:t},d),o)});LR.displayName="@mantine/core/Paper";const Pn=LR;var yH=U((e,{inline:t})=>({root:{display:t?"inline-flex":"flex",alignItems:"center",justifyContent:"center"}}));const wH=yH;var _H=Object.defineProperty,xf=Object.getOwnPropertySymbols,FR=Object.prototype.hasOwnProperty,VR=Object.prototype.propertyIsEnumerable,Bx=(e,t,r)=>t in e?_H(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bH=(e,t)=>{for(var r in t||(t={}))FR.call(t,r)&&Bx(e,r,t[r]);if(xf)for(var r of xf(t))VR.call(t,r)&&Bx(e,r,t[r]);return e},xH=(e,t)=>{var r={};for(var n in e)FR.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&&VR.call(e,n)&&(r[n]=e[n]);return r};const BR=f.forwardRef((e,t)=>{const r=H("Center",{},e),{inline:n,className:o,unstyled:a,variant:i}=r,l=xH(r,["inline","className","unstyled","variant"]),{classes:c,cx:u}=wH({inline:n},{name:"Center",unstyled:a,variant:i});return s.createElement(se,bH({ref:t,className:u(c.root,o)},l))});BR.displayName="@mantine/core/Center";const Zt=BR,UR=f.createContext(null),EH=UR.Provider,SH=()=>f.useContext(UR);var PH=Object.defineProperty,Ef=Object.getOwnPropertySymbols,WR=Object.prototype.hasOwnProperty,HR=Object.prototype.propertyIsEnumerable,Ux=(e,t,r)=>t in e?PH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Wx=(e,t)=>{for(var r in t||(t={}))WR.call(t,r)&&Ux(e,r,t[r]);if(Ef)for(var r of Ef(t))HR.call(t,r)&&Ux(e,r,t[r]);return e},OH=(e,t)=>{var r={};for(var n in e)WR.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&&HR.call(e,n)&&(r[n]=e[n]);return r};const $H={size:"sm"},qR=f.forwardRef((e,t)=>{const r=H("CheckboxGroup",$H,e),{children:n,value:o,defaultValue:a,onChange:i,size:l,wrapperProps:c}=r,u=OH(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=Sr({value:o,defaultValue:a,finalValue:[],onChange:i}),h=g=>{const v=g.currentTarget.value;p(d.includes(v)?d.filter(w=>w!==v):[...d,v])};return s.createElement(EH,{value:{value:d,onChange:h,size:l}},s.createElement(Ft.Wrapper,Wx(Wx({labelElement:"div",size:l,__staticSelector:"CheckboxGroup",ref:t},c),u),n))});qR.displayName="@mantine/core/CheckboxGroup";var CH=Object.defineProperty,Sf=Object.getOwnPropertySymbols,GR=Object.prototype.hasOwnProperty,QR=Object.prototype.propertyIsEnumerable,Hx=(e,t,r)=>t in e?CH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pf=(e,t)=>{for(var r in t||(t={}))GR.call(t,r)&&Hx(e,r,t[r]);if(Sf)for(var r of Sf(t))QR.call(t,r)&&Hx(e,r,t[r]);return e},KR=(e,t)=>{var r={};for(var n in e)GR.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Sf)for(var n of Sf(e))t.indexOf(n)<0&&QR.call(e,n)&&(r[n]=e[n]);return r};function YR(e){const t=e,{width:r,height:n,style:o}=t,a=KR(t,["width","height","style"]);return s.createElement("svg",Pf({viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:Pf({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 XR(e){var t=e,{indeterminate:r}=t,n=KR(t,["indeterminate"]);return r?s.createElement("svg",Pf({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(YR,Pf({},n))}var kH=Object.defineProperty,jH=Object.defineProperties,RH=Object.getOwnPropertyDescriptors,qx=Object.getOwnPropertySymbols,TH=Object.prototype.hasOwnProperty,IH=Object.prototype.propertyIsEnumerable,Gx=(e,t,r)=>t in e?kH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Qx=(e,t)=>{for(var r in t||(t={}))TH.call(t,r)&&Gx(e,r,t[r]);if(qx)for(var r of qx(t))IH.call(t,r)&&Gx(e,r,t[r]);return e},Kx=(e,t)=>jH(e,RH(t));const DH={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)};var NH=U((e,{radius:t,color:r,transitionDuration:n,labelPosition:o,error:a,indeterminate:i},{size:l})=>{const c=M({size:l,sizes:DH}),u=e.fn.variant({variant:"filled",color:r});return{icon:Kx(Qx({},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:Kx(Qx({},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 AH=NH;var MH=Object.defineProperty,zH=Object.defineProperties,LH=Object.getOwnPropertyDescriptors,Yx=Object.getOwnPropertySymbols,FH=Object.prototype.hasOwnProperty,VH=Object.prototype.propertyIsEnumerable,Xx=(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)&&Xx(e,r,t[r]);if(Yx)for(var r of Yx(t))VH.call(t,r)&&Xx(e,r,t[r]);return e},UH=(e,t)=>zH(e,LH(t));const Yh={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)};var WH=U((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:UH(BH({},e.fn.fontStyles()),{display:"inline-flex",flexDirection:"column",WebkitTapHighlightColor:"transparent",fontSize:r in Yh?M({size:r,sizes:e.fontSizes}):void 0,lineHeight:r in Yh?M({size:r,sizes:Yh}):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 HH=WH;var qH=Object.defineProperty,Of=Object.getOwnPropertySymbols,JR=Object.prototype.hasOwnProperty,ZR=Object.prototype.propertyIsEnumerable,Jx=(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={}))JR.call(t,r)&&Jx(e,r,t[r]);if(Of)for(var r of Of(t))ZR.call(t,r)&&Jx(e,r,t[r]);return e},QH=(e,t)=>{var r={};for(var n in e)JR.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&&ZR.call(e,n)&&(r[n]=e[n]);return r};const Mm=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:g,size:v,labelPosition:w,variant:E}=r,_=QH(r,["__staticSelector","className","classNames","styles","unstyled","children","label","description","id","disabled","error","size","labelPosition","variant"]);const{classes:y,cx:x}=HH({labelPosition:w},{name:n,styles:i,classNames:a,unstyled:l,variant:E,size:v});return s.createElement(se,GH({className:x(y.root,o),ref:t},_),s.createElement("div",{className:x(y.body)},c,s.createElement("div",{className:y.labelWrapper},u&&s.createElement("label",{className:y.label,"data-disabled":h||void 0,htmlFor:p},u),d&&s.createElement(Ft.Description,{className:y.description},d),g&&g!=="boolean"&&s.createElement(Ft.Error,{className:y.error},g))))});Mm.displayName="@mantine/core/InlineInput";var KH=Object.defineProperty,$f=Object.getOwnPropertySymbols,eT=Object.prototype.hasOwnProperty,tT=Object.prototype.propertyIsEnumerable,Zx=(e,t,r)=>t in e?KH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mu=(e,t)=>{for(var r in t||(t={}))eT.call(t,r)&&Zx(e,r,t[r]);if($f)for(var r of $f(t))tT.call(t,r)&&Zx(e,r,t[r]);return e},YH=(e,t)=>{var r={};for(var n in e)eT.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&&tT.call(e,n)&&(r[n]=e[n]);return r};const XH={size:"sm",transitionDuration:100,icon:XR,labelPosition:"right"},kn=f.forwardRef((e,t)=>{const r=H("Checkbox",XH,e),{className:n,style:o,sx:a,checked:i,disabled:l,color:c,label:u,indeterminate:d,id:p,size:h,radius:g,wrapperProps:v,children:w,classNames:E,styles:_,transitionDuration:y,icon:x,unstyled:b,labelPosition:S,description:$,error:O,variant:C}=r,T=YH(r,["className","style","sx","checked","disabled","color","label","indeterminate","id","size","radius","wrapperProps","children","classNames","styles","transitionDuration","icon","unstyled","labelPosition","description","error","variant"]),j=SH(),k=$r(p),{systemStyles:I,rest:z}=Zn(T),{classes:N}=AH({radius:g,color:c,transitionDuration:y,labelPosition:S,error:!!O,indeterminate:d},{name:"Checkbox",classNames:E,styles:_,unstyled:b,variant:C,size:(j==null?void 0:j.size)||h}),F=j?{checked:j.value.includes(z.value),onChange:j.onChange}:{};return s.createElement(Mm,mu(mu({className:n,sx:a,style:o,id:k,size:(j==null?void 0:j.size)||h,labelPosition:S,label:u,description:$,error:O,disabled:l,__staticSelector:"Checkbox",classNames:E,styles:_,unstyled:b,"data-checked":F.checked||void 0,variant:C},I),v),s.createElement("div",{className:N.inner},s.createElement("input",mu(mu({id:k,ref:t,type:"checkbox",className:N.input,checked:i,disabled:l},z),F)),s.createElement(x,{indeterminate:d,className:N.icon})))});kn.displayName="@mantine/core/Checkbox";kn.Group=qR;const rT=f.createContext(null),JH=rT.Provider,ZH=()=>f.useContext(rT),eq={};function nT(e){const{value:t,defaultValue:r,onChange:n,multiple:o,children:a}=H("ChipGroup",eq,e),[i,l]=Sr({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(JH,{value:{isChipSelected:c,onChange:u,multiple:o}},a)}nT.displayName="@mantine/core/ChipGroup";var tq=Object.defineProperty,rq=Object.defineProperties,nq=Object.getOwnPropertyDescriptors,eE=Object.getOwnPropertySymbols,oq=Object.prototype.hasOwnProperty,aq=Object.prototype.propertyIsEnumerable,tE=(e,t,r)=>t in e?tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,xn=(e,t)=>{for(var r in t||(t={}))oq.call(t,r)&&tE(e,r,t[r]);if(eE)for(var r of eE(t))aq.call(t,r)&&tE(e,r,t[r]);return e},ss=(e,t)=>rq(e,nq(t));const rE={xs:P(24),sm:P(28),md:P(32),lg:P(36),xl:P(40)},ql={xs:P(10),sm:P(12),md:P(14),lg:P(16),xl:P(18)},nE={xs:P(16),sm:P(20),md:P(24),lg:P(28),xl:P(32)},hu={xs:P(7.5),sm:P(10),md:P(11.5),lg:P(13),xl:P(15)};function iq(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:xn({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:ss(xn({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:xn({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:xn({color:n.color,backgroundColor:n.background},e.fn.hover({backgroundColor:n.hover}))}:r==="outline"?{label:xn({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 lq=U((e,{radius:t,color:r},{size:n,variant:o})=>{const a=iq(e,{color:r},o);return{root:{},label:ss(xn(ss(xn({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:M({size:n,sizes:rE}),fontSize:M({size:n,sizes:e.fontSizes}),lineHeight:`calc(${M({size:n,sizes:rE})} - ${P(2)})`,paddingLeft:M({size:n,sizes:nE}),paddingRight:M({size:n,sizes:nE}),cursor:"pointer",whiteSpace:"nowrap",transition:"background-color 100ms ease",WebkitTapHighlightColor:"transparent"}),a.label),{"&[data-disabled]":ss(xn({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:M({size:n,sizes:hu}),paddingRight:M({size:n,sizes:hu}),"&:not([data-disabled])":a.checked}}),iconWrapper:{ref:zt("iconWrapper"),color:o==="filled"?e.white:e.fn.variant({variant:"filled",color:r}).background,width:`calc(${M({size:n,sizes:ql})} + (${M({size:n,sizes:e.spacing})} / 1.5))`,maxWidth:`calc(${M({size:n,sizes:ql})} + (${M({size:n,sizes:e.spacing})} / 1.5))`,height:M({size:n,sizes:ql}),display:"inline-block",verticalAlign:"middle",overflow:"hidden"},checkIcon:{width:M({size:n,sizes:ql}),height:`calc(${M({size:n,sizes:ql})} / 1.1)`,display:"block"},input:{width:0,height:0,padding:0,opacity:0,margin:0,"&:disabled + label":ss(xn({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:M({size:n,sizes:hu}),paddingRight:M({size:n,sizes:hu}),"&: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")}`]:xn({},e.focusRing==="always"||e.focusRing==="auto"?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{[`& + .${zt("label")}`]:xn({},e.focusRing==="auto"||e.focusRing==="never"?e.focusRingStyles.resetStyles(e):null)}}}}});const sq=lq;var cq=Object.defineProperty,Cf=Object.getOwnPropertySymbols,oT=Object.prototype.hasOwnProperty,aT=Object.prototype.propertyIsEnumerable,oE=(e,t,r)=>t in e?cq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gu=(e,t)=>{for(var r in t||(t={}))oT.call(t,r)&&oE(e,r,t[r]);if(Cf)for(var r of Cf(t))aT.call(t,r)&&oE(e,r,t[r]);return e},uq=(e,t)=>{var r={};for(var n in e)oT.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&&aT.call(e,n)&&(r[n]=e[n]);return r};const dq={type:"checkbox",size:"sm",radius:"xl",variant:"outline"},kf=f.forwardRef((e,t)=>{const r=H("Chip",dq,e),{radius:n,type:o,size:a,variant:i,disabled:l,id:c,color:u,children:d,className:p,classNames:h,style:g,styles:v,checked:w,defaultChecked:E,onChange:_,sx:y,wrapperProps:x,value:b,unstyled:S}=r,$=uq(r,["radius","type","size","variant","disabled","id","color","children","className","classNames","style","styles","checked","defaultChecked","onChange","sx","wrapperProps","value","unstyled"]),O=ZH(),C=$r(c),{systemStyles:T,rest:j}=Zn($),{classes:k,cx:I}=sq({radius:n,color:u},{classNames:h,styles:v,unstyled:S,name:"Chip",variant:i,size:a}),[z,N]=Sr({value:w,defaultValue:E,finalValue:!1,onChange:_}),F=O?{checked:O.isChipSelected(b),onChange:O.onChange,type:O.multiple?"checkbox":"radio"}:{},q=F.checked||z;return s.createElement(se,gu(gu({className:I(k.root,p),style:g,sx:y},T),x),s.createElement("input",gu(gu({type:o,className:k.input,checked:q,onChange:ee=>N(ee.currentTarget.checked),id:C,disabled:l,ref:t,value:b},F),j)),s.createElement("label",{htmlFor:C,"data-checked":q||void 0,"data-disabled":l||void 0,className:k.label},q&&s.createElement("span",{className:k.iconWrapper},s.createElement(YR,{className:k.checkIcon})),d))});kf.displayName="@mantine/core/Chip";kf.Group=nT;var fq=U((e,{fluid:t,sizes:r},{size:n})=>({root:{paddingLeft:e.spacing.md,paddingRight:e.spacing.md,maxWidth:t?"100%":M({size:n,sizes:r}),marginLeft:"auto",marginRight:"auto"}}));const pq=fq;var mq=Object.defineProperty,jf=Object.getOwnPropertySymbols,iT=Object.prototype.hasOwnProperty,lT=Object.prototype.propertyIsEnumerable,aE=(e,t,r)=>t in e?mq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hq=(e,t)=>{for(var r in t||(t={}))iT.call(t,r)&&aE(e,r,t[r]);if(jf)for(var r of jf(t))lT.call(t,r)&&aE(e,r,t[r]);return e},gq=(e,t)=>{var r={};for(var n in e)iT.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&&lT.call(e,n)&&(r[n]=e[n]);return r};const vq={sizes:{xs:P(540),sm:P(720),md:P(960),lg:P(1140),xl:P(1320)}},sT=f.forwardRef((e,t)=>{const r=H("Container",vq,e),{className:n,fluid:o,size:a,unstyled:i,sizes:l,variant:c}=r,u=gq(r,["className","fluid","size","unstyled","sizes","variant"]),{classes:d,cx:p}=pq({fluid:o,sizes:l},{unstyled:i,name:"Container",variant:c,size:a});return s.createElement(se,hq({className:p(d.root,n),ref:t},u))});sT.displayName="@mantine/core/Container";var yq=Object.defineProperty,Rf=Object.getOwnPropertySymbols,cT=Object.prototype.hasOwnProperty,uT=Object.prototype.propertyIsEnumerable,iE=(e,t,r)=>t in e?yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wq=(e,t)=>{for(var r in t||(t={}))cT.call(t,r)&&iE(e,r,t[r]);if(Rf)for(var r of Rf(t))uT.call(t,r)&&iE(e,r,t[r]);return e},_q=(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&&uT.call(e,n)&&(r[n]=e[n]);return r};const bq={timeout:1e3};function dT(e){const t=H("CopyButton",bq,e),{children:r,timeout:n,value:o}=t,a=_q(t,["children","timeout","value"]),i=l6({timeout:n}),l=()=>i.copy(o);return s.createElement(s.Fragment,null,r(wq({copy:l,copied:i.copied},a)))}dT.displayName="@mantine/core/CopyButton";const[xq,Ol]=Po("ModalBase component was not found in tree");var Eq=U(()=>({close:{marginLeft:"auto",marginRight:0}}));const Sq=Eq;var Pq=Object.defineProperty,Tf=Object.getOwnPropertySymbols,fT=Object.prototype.hasOwnProperty,pT=Object.prototype.propertyIsEnumerable,lE=(e,t,r)=>t in e?Pq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Oq=(e,t)=>{for(var r in t||(t={}))fT.call(t,r)&&lE(e,r,t[r]);if(Tf)for(var r of Tf(t))pT.call(t,r)&&lE(e,r,t[r]);return e},$q=(e,t)=>{var r={};for(var n in e)fT.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&&pT.call(e,n)&&(r[n]=e[n]);return r};const Cq={size:"sm"},kq=f.forwardRef((e,t)=>{const r=Ol(),n=H(`${r.__staticSelector}CloseButton`,Cq,e),{className:o}=n,a=$q(n,["className"]),{classes:i,cx:l}=Sq(null,r.stylesApi);return s.createElement(ac,Oq({className:l(i.close,o),ref:t,onClick:r.onClose},a))});var jq=U(()=>({overlay:{}}));const Rq=jq;var Tq=Object.defineProperty,Iq=Object.defineProperties,Dq=Object.getOwnPropertyDescriptors,sE=Object.getOwnPropertySymbols,Nq=Object.prototype.hasOwnProperty,Aq=Object.prototype.propertyIsEnumerable,cE=(e,t,r)=>t in e?Tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mq=(e,t)=>{for(var r in t||(t={}))Nq.call(t,r)&&cE(e,r,t[r]);if(sE)for(var r of sE(t))Aq.call(t,r)&&cE(e,r,t[r]);return e},zq=(e,t)=>Iq(e,Dq(t)),Lq=U((e,{color:t,opacity:r,blur:n,radius:o,gradient:a,fixed:i,zIndex:l})=>({root:zq(Mq({},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 Fq=Lq;var Vq=Object.defineProperty,If=Object.getOwnPropertySymbols,mT=Object.prototype.hasOwnProperty,hT=Object.prototype.propertyIsEnumerable,uE=(e,t,r)=>t in e?Vq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Bq=(e,t)=>{for(var r in t||(t={}))mT.call(t,r)&&uE(e,r,t[r]);if(If)for(var r of If(t))hT.call(t,r)&&uE(e,r,t[r]);return e},Uq=(e,t)=>{var r={};for(var n in e)mT.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&If)for(var n of If(e))t.indexOf(n)<0&&hT.call(e,n)&&(r[n]=e[n]);return r};const Wq={opacity:.6,color:"#000",zIndex:jn("modal"),radius:0},gT=f.forwardRef((e,t)=>{const r=H("Overlay",Wq,e),{variant:n,opacity:o,color:a,blur:i,gradient:l,zIndex:c,radius:u,children:d,className:p,classNames:h,styles:g,unstyled:v,center:w,fixed:E}=r,_=Uq(r,["variant","opacity","color","blur","gradient","zIndex","radius","children","className","classNames","styles","unstyled","center","fixed"]),{classes:y,cx:x}=Fq({color:a,opacity:o,blur:i,radius:u,gradient:l,fixed:E,zIndex:c},{name:"Overlay",classNames:h,styles:g,unstyled:v,variant:n});return s.createElement(se,Bq({ref:t,className:x(y.root,p),"data-center":w||void 0},_),d)});gT.displayName="@mantine/core/Overlay";const vT=gT;var Hq=Object.defineProperty,qq=Object.defineProperties,Gq=Object.getOwnPropertyDescriptors,Df=Object.getOwnPropertySymbols,yT=Object.prototype.hasOwnProperty,wT=Object.prototype.propertyIsEnumerable,dE=(e,t,r)=>t in e?Hq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Gl=(e,t)=>{for(var r in t||(t={}))yT.call(t,r)&&dE(e,r,t[r]);if(Df)for(var r of Df(t))wT.call(t,r)&&dE(e,r,t[r]);return e},Qq=(e,t)=>qq(e,Gq(t)),Kq=(e,t)=>{var r={};for(var n in e)yT.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&&wT.call(e,n)&&(r[n]=e[n]);return r};const Yq={},Xq=f.forwardRef((e,t)=>{const r=Ol(),n=H(`${r.__staticSelector}Overlay`,Yq,e),{onClick:o,transitionProps:a,style:i,className:l}=n,c=Kq(n,["onClick","transitionProps","style","className"]),{classes:u,cx:d}=Rq(null,r.stylesApi),p=h=>{o==null||o(h),r.closeOnClickOutside&&r.onClose()};return s.createElement(ii,Qq(Gl(Gl({mounted:r.opened},r.transitionProps),a),{transition:"fade"}),h=>s.createElement(vT,Gl({ref:t,onClick:p,fixed:!0,style:Gl(Gl({},i),h),className:d(u.overlay,l),zIndex:r.zIndex},c)))});var Jq=U((e,{zIndex:t})=>({inner:{position:"fixed",width:"100%",top:0,bottom:0,maxHeight:"100%",zIndex:t,pointerEvents:"none"},content:{pointerEvents:"all"}}));const Zq=Jq;var eG=Object.defineProperty,Nf=Object.getOwnPropertySymbols,_T=Object.prototype.hasOwnProperty,bT=Object.prototype.propertyIsEnumerable,fE=(e,t,r)=>t in e?eG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ql=(e,t)=>{for(var r in t||(t={}))_T.call(t,r)&&fE(e,r,t[r]);if(Nf)for(var r of Nf(t))bT.call(t,r)&&fE(e,r,t[r]);return e},tG=(e,t)=>{var r={};for(var n in e)_T.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&&bT.call(e,n)&&(r[n]=e[n]);return r};const rG={},nG=f.forwardRef((e,t)=>{const r=Ol(),n=H(`${r.__staticSelector}Content`,rG,e),{className:o,transitionProps:a,style:i,onKeyDown:l}=n,c=tG(n,["className","transitionProps","style","onKeyDown"]),{classes:u,cx:d}=Zq({zIndex:r.zIndex},r.stylesApi),p=h=>{var g;((g=h.target)==null?void 0:g.getAttribute("data-mantine-stop-propagation"))!=="true"&&h.key==="Escape"&&r.closeOnEscape&&r.onClose(),l==null||l(h)};return s.createElement(ii,Ql(Ql({mounted:r.opened,transition:"pop"},r.transitionProps),a),h=>s.createElement("div",{className:d(u.inner)},s.createElement(w0,{active:r.opened&&r.trapFocus},s.createElement(Pn,Ql({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:Ql(Ql({},i),h),shadow:r.shadow},c),c.children))))});var oG=U((e,{padding:t})=>{const r=M({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 aG=oG;var iG=Object.defineProperty,Af=Object.getOwnPropertySymbols,xT=Object.prototype.hasOwnProperty,ET=Object.prototype.propertyIsEnumerable,pE=(e,t,r)=>t in e?iG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lG=(e,t)=>{for(var r in t||(t={}))xT.call(t,r)&&pE(e,r,t[r]);if(Af)for(var r of Af(t))ET.call(t,r)&&pE(e,r,t[r]);return e},sG=(e,t)=>{var r={};for(var n in e)xT.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&&ET.call(e,n)&&(r[n]=e[n]);return r};const cG={},uG=f.forwardRef((e,t)=>{const r=Ol(),n=H(`${r.__staticSelector}Header`,cG,e),{className:o}=n,a=sG(n,["className"]),{classes:i,cx:l}=aG({padding:r.padding},r.stylesApi);return s.createElement(se,lG({ref:t,className:l(i.header,o)},a))});var dG=U(e=>({title:{lineHeight:1,padding:0,margin:0,fontWeight:400,fontSize:e.fontSizes.md}}));const fG=dG;var pG=Object.defineProperty,Mf=Object.getOwnPropertySymbols,ST=Object.prototype.hasOwnProperty,PT=Object.prototype.propertyIsEnumerable,mE=(e,t,r)=>t in e?pG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mG=(e,t)=>{for(var r in t||(t={}))ST.call(t,r)&&mE(e,r,t[r]);if(Mf)for(var r of Mf(t))PT.call(t,r)&&mE(e,r,t[r]);return e},hG=(e,t)=>{var r={};for(var n in e)ST.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&&PT.call(e,n)&&(r[n]=e[n]);return r};const gG={},vG=f.forwardRef((e,t)=>{const r=Ol(),n=H(`${r.__staticSelector}Title`,gG,e),{className:o}=n,a=hG(n,["className"]),{classes:i,cx:l}=fG(null,r.stylesApi);return f.useEffect(()=>(r.setTitleMounted(!0),()=>r.setTitleMounted(!1)),[]),s.createElement(se,mG({component:"h2",id:r.getTitleId(),className:l(i.title,o),ref:t},a))});var yG=U((e,{padding:t})=>({body:{padding:M({size:t,sizes:e.spacing}),"&:not(:only-child)":{paddingTop:0}}}));const wG=yG;var _G=Object.defineProperty,zf=Object.getOwnPropertySymbols,OT=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,hE=(e,t,r)=>t in e?_G(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bG=(e,t)=>{for(var r in t||(t={}))OT.call(t,r)&&hE(e,r,t[r]);if(zf)for(var r of zf(t))$T.call(t,r)&&hE(e,r,t[r]);return e},xG=(e,t)=>{var r={};for(var n in e)OT.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&&$T.call(e,n)&&(r[n]=e[n]);return r};const EG={},SG=f.forwardRef((e,t)=>{const r=Ol(),n=H(`${r.__staticSelector}Body`,EG,e),{className:o}=n,a=xG(n,["className"]),{classes:i,cx:l}=wG({padding:r.padding},r.stylesApi);return f.useEffect(()=>(r.setBodyMounted(!0),()=>r.setBodyMounted(!1)),[]),s.createElement(se,bG({id:r.getBodyId(),className:l(i.body,o),ref:t},a))});function PG({children:e}){return s.createElement(s.Fragment,null,e)}function OG({opened:e,transitionDuration:t}){const[r,n]=f.useState(e),o=f.useRef(),i=hm()?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 $G=U(()=>({root:{}}));const CG=$G;var kG=Object.defineProperty,jG=Object.defineProperties,RG=Object.getOwnPropertyDescriptors,Lf=Object.getOwnPropertySymbols,CT=Object.prototype.hasOwnProperty,kT=Object.prototype.propertyIsEnumerable,gE=(e,t,r)=>t in e?kG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xh=(e,t)=>{for(var r in t||(t={}))CT.call(t,r)&&gE(e,r,t[r]);if(Lf)for(var r of Lf(t))kT.call(t,r)&&gE(e,r,t[r]);return e},vE=(e,t)=>jG(e,RG(t)),TG=(e,t)=>{var r={};for(var n in e)CT.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&&kT.call(e,n)&&(r[n]=e[n]);return r};const O0={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:jn("modal"),padding:"md",size:"md",shadow:"xl"};function Pt(e){const t=H("ModalBase",O0,e),{opened:r,onClose:n,children:o,closeOnClickOutside:a,__staticSelector:i,transitionProps:l,withinPortal:c,portalProps:u,keepMounted:d,target:p,zIndex:h,lockScroll:g,trapFocus:v,closeOnEscape:w,returnFocus:E,padding:_,shadow:y,id:x,size:b,variant:S,classNames:$,unstyled:O,styles:C,className:T}=t,j=TG(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:k,cx:I}=CG(null,{name:i,classNames:$,styles:C,unstyled:O,variant:S,size:b}),z=$r(x),[N,F]=f.useState(!1),[q,ee]=f.useState(!1),R=typeof(l==null?void 0:l.duration)=="number"?l==null?void 0:l.duration:200,D=OG({opened:r,transitionDuration:R});return Pg("keydown",V=>{!v&&V.key==="Escape"&&w&&n()}),W$({opened:r,shouldReturnFocus:v&&E}),s.createElement(El,vE(Xh({},u),{withinPortal:c,target:p}),s.createElement(xq,{value:{__staticSelector:i,opened:r,onClose:n,closeOnClickOutside:a,transitionProps:vE(Xh({},l),{duration:R,keepMounted:d}),zIndex:h,padding:_,id:z,getTitleId:()=>`${z}-title`,getBodyId:()=>`${z}-body`,titleMounted:N,bodyMounted:q,setTitleMounted:F,setBodyMounted:ee,trapFocus:v,closeOnEscape:w,shadow:y,stylesApi:{name:i,size:b,variant:S,classNames:$,styles:C,unstyled:O}}},s.createElement(T4,{enabled:D&&g},s.createElement(se,Xh({className:I(k.root,T)},j),o))))}Pt.CloseButton=kq;Pt.Overlay=Xq;Pt.Content=nG;Pt.Header=uG;Pt.Title=vG;Pt.Body=SG;Pt.NativeScrollArea=PG;const[IG,DG]=Po("Grid component was not found in tree");var NG=Object.defineProperty,yE=Object.getOwnPropertySymbols,AG=Object.prototype.hasOwnProperty,MG=Object.prototype.propertyIsEnumerable,wE=(e,t,r)=>t in e?NG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zG=(e,t)=>{for(var r in t||(t={}))AG.call(t,r)&&wE(e,r,t[r]);if(yE)for(var r of yE(t))MG.call(t,r)&&wE(e,r,t[r]);return e};const $0=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,jT=(e,t,r)=>r||e==="auto"||e==="content"?"unset":$0(e,t),RT=(e,t)=>{if(e)return e==="auto"||t?1:0},TT=(e,t)=>e===0?0:e?`${100/(t/e)}%`:void 0,IT=(e,t)=>typeof e<"u"?`calc(${M({size:e,sizes:t.spacing})} / 2)`:void 0;function LG({sizes:e,offsets:t,orders:r,theme:n,columns:o,gutters:a,grow:i}){return x$.reduce((l,c)=>(l[`@media (min-width: ${ir(n.breakpoints[c])})`]={order:r[c],flexBasis:$0(e[c],o),padding:IT(a[c],n),flexShrink:0,width:e[c]==="content"?"auto":void 0,maxWidth:jT(e[c],o,i),marginLeft:TT(t[c],o),flexGrow:RT(e[c],i)},l),{})}var FG=U((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:g,columns:v,span:w,xs:E,sm:_,md:y,lg:x,xl:b,order:S,orderXs:$,orderSm:O,orderMd:C,orderLg:T,orderXl:j})=>({col:zG({boxSizing:"border-box",flexGrow:RT(w,l),order:S,padding:IT(t,e),marginLeft:TT(c,v),flexBasis:$0(w,v),flexShrink:0,width:w==="content"?"auto":void 0,maxWidth:jT(w,v,l)},LG({sizes:{xs:E,sm:_,md:y,lg:x,xl:b},offsets:{xs:u,sm:d,md:p,lg:h,xl:g},orders:{xs:$,sm:O,md:C,lg:T,xl:j},gutters:{xs:r,sm:n,md:o,lg:a,xl:i},theme:e,columns:v,grow:l}))}));const VG=FG;var BG=Object.defineProperty,Ff=Object.getOwnPropertySymbols,DT=Object.prototype.hasOwnProperty,NT=Object.prototype.propertyIsEnumerable,_E=(e,t,r)=>t in e?BG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UG=(e,t)=>{for(var r in t||(t={}))DT.call(t,r)&&_E(e,r,t[r]);if(Ff)for(var r of Ff(t))NT.call(t,r)&&_E(e,r,t[r]);return e},WG=(e,t)=>{var r={};for(var n in e)DT.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&&NT.call(e,n)&&(r[n]=e[n]);return r};const HG={};function qG(e){return e==="auto"||e==="content"?!0:typeof e=="number"&&e>0&&e%1===0}const AT=f.forwardRef((e,t)=>{const r=H("GridCol",HG,e),{children:n,span:o,offset:a,offsetXs:i,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:g,lg:v,xl:w,order:E,orderXs:_,orderSm:y,orderMd:x,orderLg:b,orderXl:S,className:$,id:O,unstyled:C,variant:T}=r,j=WG(r,["children","span","offset","offsetXs","offsetSm","offsetMd","offsetLg","offsetXl","xs","sm","md","lg","xl","order","orderXs","orderSm","orderMd","orderLg","orderXl","className","id","unstyled","variant"]),k=DG(),I=o||k.columns,{classes:z,cx:N}=VG({gutter:k.gutter,gutterXs:k.gutterXs,gutterSm:k.gutterSm,gutterMd:k.gutterMd,gutterLg:k.gutterLg,gutterXl:k.gutterXl,offset:a,offsetXs:i,offsetSm:l,offsetMd:c,offsetLg:u,offsetXl:d,xs:p,sm:h,md:g,lg:v,xl:w,order:E,orderXs:_,orderSm:y,orderMd:x,orderLg:b,orderXl:S,grow:k.grow,columns:k.columns,span:I},{unstyled:C,name:"Grid",variant:T});return!qG(I)||I>k.columns?null:s.createElement(se,UG({className:N(z.col,$),ref:t},j),n)});AT.displayName="@mantine/core/Col";var GG=Object.defineProperty,bE=Object.getOwnPropertySymbols,QG=Object.prototype.hasOwnProperty,KG=Object.prototype.propertyIsEnumerable,xE=(e,t,r)=>t in e?GG(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,YG=(e,t)=>{for(var r in t||(t={}))QG.call(t,r)&&xE(e,r,t[r]);if(bE)for(var r of bE(t))KG.call(t,r)&&xE(e,r,t[r]);return e};function XG(e,t){return x$.reduce((r,n)=>(typeof e[n]<"u"&&(r[`@media (min-width: ${t.breakpoints[n]})`]={margin:`calc(-${M({size:e[n],sizes:t.spacing})} / 2)`}),r),{})}var JG=U((e,{justify:t,align:r,gutter:n,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c})=>({root:YG({margin:`calc(-${M({size:n,sizes:e.spacing})} / 2)`,display:"flex",flexWrap:"wrap",justifyContent:t,alignItems:r},XG({xs:o,sm:a,md:i,lg:l,xl:c},e))}));const ZG=JG;var eQ=Object.defineProperty,Vf=Object.getOwnPropertySymbols,MT=Object.prototype.hasOwnProperty,zT=Object.prototype.propertyIsEnumerable,EE=(e,t,r)=>t in e?eQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tQ=(e,t)=>{for(var r in t||(t={}))MT.call(t,r)&&EE(e,r,t[r]);if(Vf)for(var r of Vf(t))zT.call(t,r)&&EE(e,r,t[r]);return e},rQ=(e,t)=>{var r={};for(var n in e)MT.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&&zT.call(e,n)&&(r[n]=e[n]);return r};const nQ={gutter:"md",justify:"flex-start",align:"stretch",columns:12},tn=f.forwardRef((e,t)=>{const r=H("Grid",nQ,e),{gutter:n,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c,children:u,grow:d,justify:p,align:h,columns:g,className:v,id:w,unstyled:E,variant:_}=r,y=rQ(r,["gutter","gutterXs","gutterSm","gutterMd","gutterLg","gutterXl","children","grow","justify","align","columns","className","id","unstyled","variant"]),{classes:x,cx:b}=ZG({gutter:n,justify:p,align:h,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c},{unstyled:E,name:"Grid",variant:_});return s.createElement(IG,{value:{gutter:n,gutterXs:o,gutterSm:a,gutterMd:i,gutterLg:l,gutterXl:c,grow:d,columns:g}},s.createElement(se,tQ({className:b(x.root,v),ref:t},y),u))});tn.Col=AT;tn.displayName="@mantine/core/Grid";function oQ(e){return f.Children.toArray(e).filter(Boolean)}const LT={left:"flex-start",center:"center",right:"flex-end",apart:"space-between"};var aQ=U((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:LT[r],gap:M({size:t,sizes:e.spacing}),"& > *":{boxSizing:"border-box",maxWidth:o?`calc(${100/i}% - (${P(M({size:t,sizes:e.spacing}))} - ${M({size:t,sizes:e.spacing})} / ${i}))`:void 0,flexGrow:o?1:0}}}));const iQ=aQ;var lQ=Object.defineProperty,Bf=Object.getOwnPropertySymbols,FT=Object.prototype.hasOwnProperty,VT=Object.prototype.propertyIsEnumerable,SE=(e,t,r)=>t in e?lQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,sQ=(e,t)=>{for(var r in t||(t={}))FT.call(t,r)&&SE(e,r,t[r]);if(Bf)for(var r of Bf(t))VT.call(t,r)&&SE(e,r,t[r]);return e},cQ=(e,t)=>{var r={};for(var n in e)FT.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&&VT.call(e,n)&&(r[n]=e[n]);return r};const uQ={position:"left",spacing:"md"},Z=f.forwardRef((e,t)=>{const r=H("Group",uQ,e),{className:n,position:o,align:a,children:i,noWrap:l,grow:c,spacing:u,unstyled:d,variant:p}=r,h=cQ(r,["className","position","align","children","noWrap","grow","spacing","unstyled","variant"]),g=oQ(i),{classes:v,cx:w}=iQ({align:a,grow:c,noWrap:l,spacing:u,position:o,count:g.length},{unstyled:d,name:"Group",variant:p});return s.createElement(se,sQ({className:w(v.root,n),ref:t},h),g)});Z.displayName="@mantine/core/Group";function dQ({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 PE(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}var fQ=U((e,t,{size:r})=>({input:{fontFamily:e.fontFamilyMonospace,fontSize:`calc(${M({size:r,sizes:e.fontSizes})} - ${P(2)})`}}));const pQ=fQ;function C0(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 mQ=f.useLayoutEffect,hQ=function(t){var r=f.useRef(t);return mQ(function(){r.current=t}),r},OE=function(t,r){if(typeof t=="function"){t(r);return}t.current=r},gQ=function(t,r){var n=f.useRef();return f.useCallback(function(o){t.current=o,n.current&&OE(n.current,null),n.current=r,r&&OE(r,o)},[r])},$E={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},CE=function(t){Object.keys($E).forEach(function(r){t.style.setProperty(r,$E[r],"important")})},Dr=null,vQ=function(t,r){var n=t.scrollHeight;return r.sizingStyle.boxSizing==="border-box"?n+r.borderSize:n-r.paddingSize};function yQ(e,t,r,n){r===void 0&&(r=1),n===void 0&&(n=1/0),Dr||(Dr=document.createElement("textarea"),Dr.setAttribute("tabindex","-1"),Dr.setAttribute("aria-hidden","true"),CE(Dr)),Dr.parentNode===null&&document.body.appendChild(Dr);var o=e.paddingSize,a=e.borderSize,i=e.sizingStyle,l=i.boxSizing;Object.keys(i).forEach(function(h){var g=h;Dr.style[g]=i[g]}),CE(Dr),Dr.value=t;var c=vQ(Dr,e);Dr.value="x";var u=Dr.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 kE=function(){},wQ=function(t,r){return t.reduce(function(n,o){return n[o]=r[o],n},{})},_Q=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],bQ=!!document.documentElement.currentStyle,xQ=function(t){var r=window.getComputedStyle(t);if(r===null)return null;var n=wQ(_Q,r),o=n.boxSizing;if(o==="")return null;bQ&&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}},EQ=function(t){var r=hQ(t);f.useLayoutEffect(function(){var n=function(a){r.current(a)};return window.addEventListener("resize",n),function(){window.removeEventListener("resize",n)}},[])},SQ=function(t,r){var n=t.cacheMeasurements,o=t.maxRows,a=t.minRows,i=t.onChange,l=i===void 0?kE:i,c=t.onHeightChange,u=c===void 0?kE:c,d=C0(t,["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"]),p=d.value!==void 0,h=f.useRef(null),g=gQ(h,r),v=f.useRef(0),w=f.useRef(),E=function(){var x=h.current,b=n&&w.current?w.current:xQ(x);if(b){w.current=b;var S=yQ(b,x.value||x.placeholder||"x",a,o),$=S[0],O=S[1];v.current!==$&&(v.current=$,x.style.setProperty("height",$+"px","important"),u($,{rowHeight:O}))}},_=function(x){p||E(),l(x)};return f.useLayoutEffect(E),EQ(E),f.createElement("textarea",Je({},d,{onChange:_,ref:g}))},PQ=f.forwardRef(SQ);const OQ=PQ;var $Q=U(e=>({input:{paddingTop:e.spacing.xs,paddingBottom:e.spacing.xs}}));const CQ=$Q;var kQ=Object.defineProperty,jQ=Object.defineProperties,RQ=Object.getOwnPropertyDescriptors,Uf=Object.getOwnPropertySymbols,BT=Object.prototype.hasOwnProperty,UT=Object.prototype.propertyIsEnumerable,jE=(e,t,r)=>t in e?kQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_i=(e,t)=>{for(var r in t||(t={}))BT.call(t,r)&&jE(e,r,t[r]);if(Uf)for(var r of Uf(t))UT.call(t,r)&&jE(e,r,t[r]);return e},Jh=(e,t)=>jQ(e,RQ(t)),TQ=(e,t)=>{var r={};for(var n in e)BT.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&&UT.call(e,n)&&(r[n]=e[n]);return r};const IQ={autosize:!1,size:"sm",__staticSelector:"Textarea"},uc=f.forwardRef((e,t)=>{const r=H("Textarea",IQ,e),{autosize:n,maxRows:o,minRows:a,label:i,error:l,description:c,id:u,className:d,required:p,style:h,wrapperProps:g,classNames:v,styles:w,size:E,__staticSelector:_,sx:y,errorProps:x,descriptionProps:b,labelProps:S,inputWrapperOrder:$,inputContainer:O,unstyled:C,withAsterisk:T,variant:j}=r,k=TQ(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"]),I=$r(u),{classes:z,cx:N}=CQ(),{systemStyles:F,rest:q}=Zn(k),ee=_i({required:p,ref:t,error:l,id:I,classNames:Jh(_i({},v),{input:N(z.input,v==null?void 0:v.input)}),styles:w,__staticSelector:_,size:E,multiline:!0,unstyled:C,variant:j},q);return s.createElement(Ft.Wrapper,_i(_i({label:i,error:l,id:I,description:c,required:p,style:h,className:d,classNames:v,styles:w,size:E,__staticSelector:_,sx:y,errorProps:x,labelProps:S,descriptionProps:b,inputContainer:O,inputWrapperOrder:$,unstyled:C,withAsterisk:T,variant:j},F),g),n?s.createElement(Ft,Jh(_i({},ee),{component:OQ,maxRows:o,minRows:a})):s.createElement(Ft,Jh(_i({},ee),{component:"textarea",rows:a})))});uc.displayName="@mantine/core/Textarea";var DQ=Object.defineProperty,NQ=Object.defineProperties,AQ=Object.getOwnPropertyDescriptors,Wf=Object.getOwnPropertySymbols,WT=Object.prototype.hasOwnProperty,HT=Object.prototype.propertyIsEnumerable,RE=(e,t,r)=>t in e?DQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,TE=(e,t)=>{for(var r in t||(t={}))WT.call(t,r)&&RE(e,r,t[r]);if(Wf)for(var r of Wf(t))HT.call(t,r)&&RE(e,r,t[r]);return e},MQ=(e,t)=>NQ(e,AQ(t)),zQ=(e,t)=>{var r={};for(var n in e)WT.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&&HT.call(e,n)&&(r[n]=e[n]);return r};const LQ={formatOnBlur:!1,size:"sm",serialize:JSON.stringify,deserialize:JSON.parse},dc=f.forwardRef((e,t)=>{const r=H("JsonInput",LQ,e),{value:n,defaultValue:o,onChange:a,onFocus:i,onBlur:l,error:c,formatOnBlur:u,size:d,validationError:p,classNames:h,unstyled:g,readOnly:v,variant:w,serialize:E,deserialize:_}=r,y=zQ(r,["value","defaultValue","onChange","onFocus","onBlur","error","formatOnBlur","size","validationError","classNames","unstyled","readOnly","variant","serialize","deserialize"]),{classes:x,cx:b}=pQ(null,{name:"JsonInput",unstyled:g,size:d,variant:w}),[S,$]=Sr({value:n,defaultValue:o,finalValue:"",onChange:a}),[O,C]=f.useState(PE(S,_)),T=k=>{typeof i=="function"&&i(k),C(!0)},j=k=>{typeof l=="function"&&l(k);const I=PE(k.currentTarget.value,_);u&&!v&&I&&k.currentTarget.value.trim()!==""&&$(E(_(k.currentTarget.value),null,2)),C(I)};return s.createElement(uc,TE({value:S,onChange:k=>$(k.currentTarget.value),onFocus:T,onBlur:j,error:O?c:p||!0,__staticSelector:"JsonInput",classNames:MQ(TE({},h),{input:b(x.input,h==null?void 0:h.input)}),autoComplete:"off",ref:t,unstyled:g,readOnly:v,size:d,variant:w},y))});dc.displayName="@mantine/core/JsonInput";const[FQ,VQ]=Po("List component was not found in tree");var BQ=U((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:M({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 UQ=BQ;var WQ=Object.defineProperty,Hf=Object.getOwnPropertySymbols,qT=Object.prototype.hasOwnProperty,GT=Object.prototype.propertyIsEnumerable,IE=(e,t,r)=>t in e?WQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,HQ=(e,t)=>{for(var r in t||(t={}))qT.call(t,r)&&IE(e,r,t[r]);if(Hf)for(var r of Hf(t))GT.call(t,r)&&IE(e,r,t[r]);return e},qQ=(e,t)=>{var r={};for(var n in e)qT.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&>.call(e,n)&&(r[n]=e[n]);return r};const GQ={},QT=f.forwardRef((e,t)=>{const r=H("ListItem",GQ,e),{className:n,children:o,icon:a}=r,i=qQ(r,["className","children","icon"]),{icon:l,spacing:c,center:u,listStyleType:d,size:p,withPadding:h,classNames:g,styles:v,unstyled:w,variant:E}=VQ(),_=a||l,{classes:y,cx:x}=UQ({withPadding:h,listStyleType:d,center:u,spacing:c},{classNames:g,styles:v,unstyled:w,name:"List",variant:E,size:p});return s.createElement(se,HQ({component:"li",className:x(y.item,n),"data-with-icon":!!_||void 0,ref:t},i),s.createElement("div",{className:y.itemWrapper},_&&s.createElement("span",{className:y.itemIcon},_),s.createElement("span",null,o)))});QT.displayName="@mantine/core/ListItem";var QQ=Object.defineProperty,KQ=Object.defineProperties,YQ=Object.getOwnPropertyDescriptors,DE=Object.getOwnPropertySymbols,XQ=Object.prototype.hasOwnProperty,JQ=Object.prototype.propertyIsEnumerable,NE=(e,t,r)=>t in e?QQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZQ=(e,t)=>{for(var r in t||(t={}))XQ.call(t,r)&&NE(e,r,t[r]);if(DE)for(var r of DE(t))JQ.call(t,r)&&NE(e,r,t[r]);return e},eK=(e,t)=>KQ(e,YQ(t)),tK=U((e,{withPadding:t,listStyleType:r},{size:n})=>({root:eK(ZQ({},e.fn.fontStyles()),{listStyleType:r,color:e.colorScheme==="dark"?e.colors.dark[0]:e.black,fontSize:M({size:n,sizes:e.fontSizes}),lineHeight:e.lineHeight,margin:0,paddingLeft:t?e.spacing.xl:0,listStylePosition:"inside"})}));const rK=tK;var nK=Object.defineProperty,qf=Object.getOwnPropertySymbols,KT=Object.prototype.hasOwnProperty,YT=Object.prototype.propertyIsEnumerable,AE=(e,t,r)=>t in e?nK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oK=(e,t)=>{for(var r in t||(t={}))KT.call(t,r)&&AE(e,r,t[r]);if(qf)for(var r of qf(t))YT.call(t,r)&&AE(e,r,t[r]);return e},aK=(e,t)=>{var r={};for(var n in e)KT.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&&YT.call(e,n)&&(r[n]=e[n]);return r};const iK={type:"unordered",size:"md",spacing:0},wr=f.forwardRef((e,t)=>{const r=H("List",iK,e),{children:n,type:o,size:a,listStyleType:i,withPadding:l,center:c,spacing:u,icon:d,className:p,styles:h,classNames:g,unstyled:v,variant:w}=r,E=aK(r,["children","type","size","listStyleType","withPadding","center","spacing","icon","className","styles","classNames","unstyled","variant"]),{classes:_,cx:y}=rK({withPadding:l,listStyleType:i,center:c,spacing:u},{classNames:g,styles:h,name:"List",unstyled:v,size:a,variant:w});return s.createElement(FQ,{value:{spacing:u,center:c,icon:d,listStyleType:i,size:a,withPadding:l,classNames:g,styles:h,unstyled:v,variant:w}},s.createElement(se,oK({component:o==="unordered"?"ul":"ol",className:y(_.root,p),ref:t},E),n))});wr.Item=QT;wr.displayName="@mantine/core/List";var lK=Object.defineProperty,sK=Object.defineProperties,cK=Object.getOwnPropertyDescriptors,ME=Object.getOwnPropertySymbols,uK=Object.prototype.hasOwnProperty,dK=Object.prototype.propertyIsEnumerable,zE=(e,t,r)=>t in e?lK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fK=(e,t)=>{for(var r in t||(t={}))uK.call(t,r)&&zE(e,r,t[r]);if(ME)for(var r of ME(t))dK.call(t,r)&&zE(e,r,t[r]);return e},pK=(e,t)=>sK(e,cK(t)),mK=U(e=>({root:pK(fK({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})}));const hK=mK;var gK=Object.defineProperty,vK=Object.defineProperties,yK=Object.getOwnPropertyDescriptors,Gf=Object.getOwnPropertySymbols,XT=Object.prototype.hasOwnProperty,JT=Object.prototype.propertyIsEnumerable,LE=(e,t,r)=>t in e?gK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vu=(e,t)=>{for(var r in t||(t={}))XT.call(t,r)&&LE(e,r,t[r]);if(Gf)for(var r of Gf(t))JT.call(t,r)&&LE(e,r,t[r]);return e},wK=(e,t)=>vK(e,yK(t)),_K=(e,t)=>{var r={};for(var n in e)XT.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&&JT.call(e,n)&&(r[n]=e[n]);return r};const bK={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:jn("overlay")},ZT=f.forwardRef((e,t)=>{const r=H("LoadingOverlay",bK,e),{className:n,visible:o,loaderProps:a,overlayOpacity:i,overlayColor:l,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:p,loader:h,radius:g,overlayBlur:v,unstyled:w,variant:E,keepMounted:_}=r,y=_K(r,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:x,cx:b,theme:S}=hK(null,{name:"LoadingOverlay",unstyled:w,variant:E}),$=`calc(${d} + 1)`;return s.createElement(ii,{keepMounted:_,duration:c,exitDuration:u,mounted:o,transition:"fade"},O=>s.createElement(se,vu({className:b(x.root,n),style:wK(vu(vu({},O),p),{zIndex:d}),ref:t},y),h?s.createElement("div",{style:{zIndex:$}},h):s.createElement(un,vu({style:{zIndex:$}},a)),s.createElement(vT,{opacity:i,zIndex:d,radius:g,blur:v,unstyled:w,color:l||(S.colorScheme==="dark"?S.colors.dark[5]:S.white)})))});ZT.displayName="@mantine/core/LoadingOverlay";const eI={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"},[xK,fc]=Po(eI.context);var EK=U(e=>({divider:{marginTop:P(4),marginBottom:P(4),borderTop:`${P(1)} solid ${e.colorScheme==="dark"?e.colors.dark[4]:e.colors.gray[2]}`}}));const SK=EK;var PK=Object.defineProperty,Qf=Object.getOwnPropertySymbols,tI=Object.prototype.hasOwnProperty,rI=Object.prototype.propertyIsEnumerable,FE=(e,t,r)=>t in e?PK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,OK=(e,t)=>{for(var r in t||(t={}))tI.call(t,r)&&FE(e,r,t[r]);if(Qf)for(var r of Qf(t))rI.call(t,r)&&FE(e,r,t[r]);return e},$K=(e,t)=>{var r={};for(var n in e)tI.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&&rI.call(e,n)&&(r[n]=e[n]);return r};const CK={},nI=f.forwardRef((e,t)=>{const r=H("MenuDivider",CK,e),{children:n,className:o}=r,a=$K(r,["children","className"]),{classNames:i,styles:l,unstyled:c,variant:u}=fc(),{classes:d,cx:p}=SK(null,{name:"Menu",classNames:i,styles:l,unstyled:c,variant:u});return s.createElement(se,OK({className:p(d.divider,o),ref:t},a))});nI.displayName="@mantine/core/MenuDivider";var kK=Object.defineProperty,Kf=Object.getOwnPropertySymbols,oI=Object.prototype.hasOwnProperty,aI=Object.prototype.propertyIsEnumerable,VE=(e,t,r)=>t in e?kK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,jK=(e,t)=>{for(var r in t||(t={}))oI.call(t,r)&&VE(e,r,t[r]);if(Kf)for(var r of Kf(t))aI.call(t,r)&&VE(e,r,t[r]);return e},RK=(e,t)=>{var r={};for(var n in e)oI.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&&aI.call(e,n)&&(r[n]=e[n]);return r};const TK={};function iI(e){const t=H("MenuDropdown",TK,e),{children:r,onMouseEnter:n,onMouseLeave:o}=t,a=RK(t,["children","onMouseEnter","onMouseLeave"]),i=f.useRef(),l=fc(),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=Ar(n,()=>l.trigger==="hover"&&l.openDropdown()),d=Ar(o,()=>l.trigger==="hover"&&l.closeDropdown());return s.createElement(ko.Dropdown,jK({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))}iI.displayName="@mantine/core/MenuDropdown";var IK=Object.defineProperty,DK=Object.defineProperties,NK=Object.getOwnPropertyDescriptors,BE=Object.getOwnPropertySymbols,AK=Object.prototype.hasOwnProperty,MK=Object.prototype.propertyIsEnumerable,UE=(e,t,r)=>t in e?IK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,zK=(e,t)=>{for(var r in t||(t={}))AK.call(t,r)&&UE(e,r,t[r]);if(BE)for(var r of BE(t))MK.call(t,r)&&UE(e,r,t[r]);return e},LK=(e,t)=>DK(e,NK(t)),FK=U((e,{color:t,radius:r})=>({item:LK(zK({},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 VK=FK;var BK=Object.defineProperty,UK=Object.defineProperties,WK=Object.getOwnPropertyDescriptors,Yf=Object.getOwnPropertySymbols,lI=Object.prototype.hasOwnProperty,sI=Object.prototype.propertyIsEnumerable,WE=(e,t,r)=>t in e?BK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,HK=(e,t)=>{for(var r in t||(t={}))lI.call(t,r)&&WE(e,r,t[r]);if(Yf)for(var r of Yf(t))sI.call(t,r)&&WE(e,r,t[r]);return e},qK=(e,t)=>UK(e,WK(t)),GK=(e,t)=>{var r={};for(var n in e)lI.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&&sI.call(e,n)&&(r[n]=e[n]);return r};const QK={},cI=f.forwardRef((e,t)=>{const r=H("MenuItem",QK,e),{children:n,className:o,color:a,closeMenuOnClick:i,icon:l,rightSection:c}=r,u=GK(r,["children","className","color","closeMenuOnClick","icon","rightSection"]),d=fc(),{classes:p,cx:h,theme:g}=VK({radius:d.radius,color:a},{name:"Menu",classNames:d.classNames,styles:d.styles,unstyled:d.unstyled,variant:d.variant}),v=f.useRef(),w=d.getItemIndex(v.current),E=u,_=Ar(E.onMouseLeave,()=>d.setHovered(-1)),y=Ar(E.onMouseEnter,()=>d.setHovered(d.getItemIndex(v.current))),x=Ar(E.onClick,()=>{typeof i=="boolean"?i&&d.closeDropdownImmediately():d.closeOnItemClick&&d.closeDropdownImmediately()}),b=Ar(E.onFocus,()=>d.setHovered(d.getItemIndex(v.current)));return s.createElement(se,qK(HK({component:"button",type:"button"},u),{tabIndex:-1,onFocus:b,className:h(p.item,o),ref:_l(v,t),role:"menuitem","data-menu-item":!0,"data-hovered":d.hovered===w?!0:void 0,onMouseEnter:y,onMouseLeave:_,onClick:x,onKeyDown:h$({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:d.loop,dir:g.dir,orientation:"vertical",onKeyDown:E.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))});cI.displayName="@mantine/core/MenuItem";const KK=cI;var YK=U(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 XK=YK;var JK=Object.defineProperty,Xf=Object.getOwnPropertySymbols,uI=Object.prototype.hasOwnProperty,dI=Object.prototype.propertyIsEnumerable,HE=(e,t,r)=>t in e?JK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ZK=(e,t)=>{for(var r in t||(t={}))uI.call(t,r)&&HE(e,r,t[r]);if(Xf)for(var r of Xf(t))dI.call(t,r)&&HE(e,r,t[r]);return e},eY=(e,t)=>{var r={};for(var n in e)uI.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&&dI.call(e,n)&&(r[n]=e[n]);return r};const tY={},fI=f.forwardRef((e,t)=>{const r=H("MenuLabel",tY,e),{children:n,className:o}=r,a=eY(r,["children","className"]),{classNames:i,styles:l,unstyled:c,variant:u}=fc(),{classes:d,cx:p}=XK(null,{name:"Menu",classNames:i,styles:l,unstyled:c,variant:u});return s.createElement(ae,ZK({className:p(d.label,o),ref:t},a),n)});fI.displayName="@mantine/core/MenuLabel";var rY=Object.defineProperty,Jf=Object.getOwnPropertySymbols,pI=Object.prototype.hasOwnProperty,mI=Object.prototype.propertyIsEnumerable,qE=(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={}))pI.call(t,r)&&qE(e,r,t[r]);if(Jf)for(var r of Jf(t))mI.call(t,r)&&qE(e,r,t[r]);return e},oY=(e,t)=>{var r={};for(var n in e)pI.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&&mI.call(e,n)&&(r[n]=e[n]);return r};const aY={refProp:"ref"},hI=f.forwardRef((e,t)=>{const r=H("MenuTarget",aY,e),{children:n,refProp:o}=r,a=oY(r,["children","refProp"]);if(!yl(n))throw new Error(eI.children);const i=fc(),l=Ar(n.props.onClick,()=>i.trigger==="click"&&i.toggleDropdown()),c=Ar(n.props.onMouseEnter,()=>i.trigger==="hover"&&i.openDropdown()),u=Ar(n.props.onMouseLeave,()=>i.trigger==="hover"&&i.closeDropdown());return s.createElement(ko.Target,nY({refProp:o,popupType:"menu",ref:t},a),f.cloneElement(n,{onClick:l,onMouseEnter:c,onMouseLeave:u,"data-expanded":i.opened?!0:void 0}))});hI.displayName="@mantine/core/MenuTarget";var iY=U({dropdown:{padding:P(4)}});const lY=iY;var sY=Object.defineProperty,cY=Object.defineProperties,uY=Object.getOwnPropertyDescriptors,Zf=Object.getOwnPropertySymbols,gI=Object.prototype.hasOwnProperty,vI=Object.prototype.propertyIsEnumerable,GE=(e,t,r)=>t in e?sY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QE=(e,t)=>{for(var r in t||(t={}))gI.call(t,r)&&GE(e,r,t[r]);if(Zf)for(var r of Zf(t))vI.call(t,r)&&GE(e,r,t[r]);return e},KE=(e,t)=>cY(e,uY(t)),dY=(e,t)=>{var r={};for(var n in e)gI.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&&vI.call(e,n)&&(r[n]=e[n]);return r};const fY={closeOnItemClick:!0,loop:!0,trigger:"click",openDelay:0,closeDelay:100};function Q(e){const t=H("Menu",fY,e),{children:r,onOpen:n,onClose:o,opened:a,defaultOpened:i,onChange:l,closeOnItemClick:c,loop:u,closeOnEscape:d,trigger:p,openDelay:h,closeDelay:g,classNames:v,styles:w,unstyled:E,radius:_,variant:y}=t,x=dY(t,["children","onOpen","onClose","opened","defaultOpened","onChange","closeOnItemClick","loop","closeOnEscape","trigger","openDelay","closeDelay","classNames","styles","unstyled","radius","variant"]),{classes:b,cx:S}=lY(),[$,{setHovered:O,resetHovered:C}]=L4(),[T,j]=Sr({value:a,defaultValue:i,finalValue:!1,onChange:l}),k=()=>{j(!1),T&&(o==null||o())},I=()=>{j(!0),!T&&(n==null||n())},z=()=>T?k():I(),{openDropdown:N,closeDropdown:F}=dQ({open:I,close:k,closeDelay:g,openDelay:h}),q=ee=>A4("[data-menu-item]","[data-menu-dropdown]",ee);return nn(()=>{C()},[T]),s.createElement(xK,{value:{opened:T,toggleDropdown:z,getItemIndex:q,hovered:$,setHovered:O,closeOnItemClick:c,closeDropdown:p==="click"?k:F,openDropdown:p==="click"?I:N,closeDropdownImmediately:k,loop:u,trigger:p,radius:_,classNames:v,styles:w,unstyled:E,variant:y}},s.createElement(ko,KE(QE({},x),{radius:_,opened:T,onChange:z,defaultOpened:i,trapFocus:p==="click",closeOnEscape:d&&p==="click",__staticSelector:"Menu",classNames:KE(QE({},v),{dropdown:S(b.dropdown,v==null?void 0:v.dropdown)}),styles:w,unstyled:E,variant:y}),r))}Q.displayName="@mantine/core/Menu";Q.Item=KK;Q.Label=fI;Q.Dropdown=iI;Q.Target=hI;Q.Divider=nI;const[pY,mY]=Po("Modal component was not found in tree"),hY={xs:P(320),sm:P(380),md:P(440),lg:P(620),xl:P(780)};var gY=U((e,{yOffset:t,xOffset:r,centered:n,fullScreen:o},{size:a})=>({content:{flex:o?"0 0 100%":`0 0 ${M({size:a,sizes:hY})}`,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 vY=gY;var yY=Object.defineProperty,wY=Object.defineProperties,_Y=Object.getOwnPropertyDescriptors,ep=Object.getOwnPropertySymbols,yI=Object.prototype.hasOwnProperty,wI=Object.prototype.propertyIsEnumerable,YE=(e,t,r)=>t in e?yY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ov=(e,t)=>{for(var r in t||(t={}))yI.call(t,r)&&YE(e,r,t[r]);if(ep)for(var r of ep(t))wI.call(t,r)&&YE(e,r,t[r]);return e},_I=(e,t)=>wY(e,_Y(t)),bY=(e,t)=>{var r={};for(var n in e)yI.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&&wI.call(e,n)&&(r[n]=e[n]);return r};const xY=_I(Ov({},O0),{yOffset:"5dvh",xOffset:"5vw"});function bI(e){const t=H("ModalRoot",xY,e),{classNames:r,variant:n,size:o,yOffset:a,xOffset:i,scrollAreaComponent:l,radius:c,centered:u,fullScreen:d}=t,p=bY(t,["classNames","variant","size","yOffset","xOffset","scrollAreaComponent","radius","centered","fullScreen"]),{classes:h,cx:g}=vY({yOffset:a,xOffset:i,centered:u,fullScreen:d},{name:"Modal",variant:n,size:o});return s.createElement(pY,{value:{yOffset:a,scrollAreaComponent:l,radius:c}},s.createElement(Pt,Ov({__staticSelector:"Modal",size:o,variant:n,classNames:_I(Ov({},r),{content:g(h.content,r==null?void 0:r.content),inner:g(h.inner,r==null?void 0:r.inner)})},p)))}var EY=Object.defineProperty,tp=Object.getOwnPropertySymbols,xI=Object.prototype.hasOwnProperty,EI=Object.prototype.propertyIsEnumerable,XE=(e,t,r)=>t in e?EY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SY=(e,t)=>{for(var r in t||(t={}))xI.call(t,r)&&XE(e,r,t[r]);if(tp)for(var r of tp(t))EI.call(t,r)&&XE(e,r,t[r]);return e},PY=(e,t)=>{var r={};for(var n in e)xI.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&&EI.call(e,n)&&(r[n]=e[n]);return r};const OY={shadow:"xl"},SI=f.forwardRef((e,t)=>{const r=H("ModalContent",OY,e),{children:n,scrollAreaComponent:o}=r,a=PY(r,["children","scrollAreaComponent"]),i=mY(),l=o||i.scrollAreaComponent||Pt.NativeScrollArea;return s.createElement(Pt.Content,SY({ref:t,radius:i.radius},a),s.createElement(l,{style:{maxHeight:`calc(100dvh - (${P(i.yOffset)} * 2))`}},n))});var $Y=Object.defineProperty,CY=Object.defineProperties,kY=Object.getOwnPropertyDescriptors,rp=Object.getOwnPropertySymbols,PI=Object.prototype.hasOwnProperty,OI=Object.prototype.propertyIsEnumerable,JE=(e,t,r)=>t in e?$Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xu=(e,t)=>{for(var r in t||(t={}))PI.call(t,r)&&JE(e,r,t[r]);if(rp)for(var r of rp(t))OI.call(t,r)&&JE(e,r,t[r]);return e},jY=(e,t)=>CY(e,kY(t)),RY=(e,t)=>{var r={};for(var n in e)PI.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&&OI.call(e,n)&&(r[n]=e[n]);return r};const TY=jY(Xu({},O0),{transitionProps:{duration:200,transition:"pop"},withOverlay:!0,withCloseButton:!0});function Cr(e){const t=H("Modal",TY,e),{title:r,withOverlay:n,overlayProps:o,withCloseButton:a,closeButtonProps:i,children:l}=t,c=RY(t,["title","withOverlay","overlayProps","withCloseButton","closeButtonProps","children"]),u=!!r||a;return s.createElement(bI,Xu({},c),n&&s.createElement(Pt.Overlay,Xu({},o)),s.createElement(SI,null,u&&s.createElement(Pt.Header,null,r&&s.createElement(Pt.Title,null,r),a&&s.createElement(Pt.CloseButton,Xu({},i))),s.createElement(Pt.Body,null,l)))}Cr.Root=bI;Cr.CloseButton=Pt.CloseButton;Cr.Overlay=Pt.Overlay;Cr.Content=SI;Cr.Header=Pt.Header;Cr.Title=Pt.Title;Cr.Body=Pt.Body;Cr.NativeScrollArea=Pt.NativeScrollArea;const $I={xs:P(16),sm:P(22),md:P(26),lg:P(30),xl:P(36)},IY={xs:P(10),sm:P(12),md:P(14),lg:P(16),xl:P(18)};var DY=U((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:M({size:o,sizes:$I}),paddingLeft:`calc(${M({size:o,sizes:e.spacing})} / 1.5)`,paddingRight:t||n?M({size:o,sizes:e.spacing}):0,fontWeight:500,fontSize:M({size:o,sizes:IY}),borderRadius:M({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(${M({size:o,sizes:e.spacing})} / 6)`},defaultValueLabel:{display:"block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}})),NY=Object.defineProperty,np=Object.getOwnPropertySymbols,CI=Object.prototype.hasOwnProperty,kI=Object.prototype.propertyIsEnumerable,ZE=(e,t,r)=>t in e?NY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,AY=(e,t)=>{for(var r in t||(t={}))CI.call(t,r)&&ZE(e,r,t[r]);if(np)for(var r of np(t))kI.call(t,r)&&ZE(e,r,t[r]);return e},MY=(e,t)=>{var r={};for(var n in e)CI.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&&kI.call(e,n)&&(r[n]=e[n]);return r};const zY={xs:16,sm:22,md:24,lg:26,xl:30};function jI(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,g=MY(t,["label","classNames","styles","className","onRemove","disabled","readOnly","size","radius","variant","unstyled"]);const{classes:v,cx:w}=DY({disabled:l,readOnly:c,radius:d},{name:"MultiSelect",classNames:n,styles:o,unstyled:h,size:u,variant:p});return s.createElement("div",AY({className:w(v.defaultValue,a)},g),s.createElement("span",{className:v.defaultValueLabel},r),!l&&!c&&s.createElement(ac,{"aria-hidden":!0,onMouseDown:i,size:zY[u],radius:2,color:"blue",variant:"transparent",iconSize:"70%",className:v.defaultValueRemove,tabIndex:-1,unstyled:h}))}jI.displayName="@mantine/core/MultiSelect/DefaultValue";function LY({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 FY=Object.defineProperty,op=Object.getOwnPropertySymbols,RI=Object.prototype.hasOwnProperty,TI=Object.prototype.propertyIsEnumerable,eS=(e,t,r)=>t in e?FY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tS=(e,t)=>{for(var r in t||(t={}))RI.call(t,r)&&eS(e,r,t[r]);if(op)for(var r of op(t))TI.call(t,r)&&eS(e,r,t[r]);return e},VY=(e,t)=>{var r={};for(var n in e)RI.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&&TI.call(e,n)&&(r[n]=e[n]);return r};const BY={xs:P(14),sm:P(18),md:P(20),lg:P(24),xl:P(28)};function UY(e){var t=e,{size:r,error:n,style:o}=t,a=VY(t,["size","error","style"]);const i=tr(),l=M({size:r,sizes:BY});return s.createElement("svg",tS({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:tS({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 WY=Object.defineProperty,HY=Object.defineProperties,qY=Object.getOwnPropertyDescriptors,rS=Object.getOwnPropertySymbols,GY=Object.prototype.hasOwnProperty,QY=Object.prototype.propertyIsEnumerable,nS=(e,t,r)=>t in e?WY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,KY=(e,t)=>{for(var r in t||(t={}))GY.call(t,r)&&nS(e,r,t[r]);if(rS)for(var r of rS(t))QY.call(t,r)&&nS(e,r,t[r]);return e},YY=(e,t)=>HY(e,qY(t));function II({shouldClear:e,clearButtonProps:t,onClear:r,size:n,error:o}){return e?s.createElement(ac,YY(KY({},t),{variant:"transparent",onClick:r,size:n,onMouseDown:a=>a.preventDefault()})):s.createElement(UY,{error:o,size:n})}II.displayName="@mantine/core/SelectRightSection";var XY=Object.defineProperty,JY=Object.defineProperties,ZY=Object.getOwnPropertyDescriptors,ap=Object.getOwnPropertySymbols,DI=Object.prototype.hasOwnProperty,NI=Object.prototype.propertyIsEnumerable,oS=(e,t,r)=>t in e?XY(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zh=(e,t)=>{for(var r in t||(t={}))DI.call(t,r)&&oS(e,r,t[r]);if(ap)for(var r of ap(t))NI.call(t,r)&&oS(e,r,t[r]);return e},aS=(e,t)=>JY(e,ZY(t)),eX=(e,t)=>{var r={};for(var n in e)DI.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&&NI.call(e,n)&&(r[n]=e[n]);return r};function AI(e){var t=e,{styles:r,rightSection:n,rightSectionWidth:o,theme:a}=t,i=eX(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(II,Zh({},i)),styles:aS(Zh({},l),{rightSection:aS(Zh({},l==null?void 0:l.rightSection),{pointerEvents:i.shouldClear?void 0:"none"})})}}var tX=Object.defineProperty,rX=Object.defineProperties,nX=Object.getOwnPropertyDescriptors,iS=Object.getOwnPropertySymbols,oX=Object.prototype.hasOwnProperty,aX=Object.prototype.propertyIsEnumerable,lS=(e,t,r)=>t in e?tX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iX=(e,t)=>{for(var r in t||(t={}))oX.call(t,r)&&lS(e,r,t[r]);if(iS)for(var r of iS(t))aX.call(t,r)&&lS(e,r,t[r]);return e},lX=(e,t)=>rX(e,nX(t)),sX=U((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(${M({size:r,sizes:Et})} - ${P(2)})`,display:"flex",alignItems:"center",flexWrap:"wrap",marginLeft:`calc(-${e.spacing.xs} / 2)`,boxSizing:"border-box","&[data-clearable]":{marginRight:M({size:r,sizes:Et})}},value:{margin:`calc(${e.spacing.xs} / 2 - ${P(2)}) calc(${e.spacing.xs} / 2)`},searchInput:lX(iX({},e.fn.fontStyles()),{flex:1,minWidth:P(60),backgroundColor:"transparent",border:0,outline:0,fontSize:M({size:r,sizes:e.fontSizes}),padding:0,marginLeft:`calc(${e.spacing.xs} / 2)`,appearance:"none",color:"inherit",maxHeight:M({size:r,sizes:$I}),"&::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 cX=sX;var uX=Object.defineProperty,dX=Object.defineProperties,fX=Object.getOwnPropertyDescriptors,ip=Object.getOwnPropertySymbols,MI=Object.prototype.hasOwnProperty,zI=Object.prototype.propertyIsEnumerable,sS=(e,t,r)=>t in e?uX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bi=(e,t)=>{for(var r in t||(t={}))MI.call(t,r)&&sS(e,r,t[r]);if(ip)for(var r of ip(t))zI.call(t,r)&&sS(e,r,t[r]);return e},cS=(e,t)=>dX(e,fX(t)),pX=(e,t)=>{var r={};for(var n in e)MI.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&&zI.call(e,n)&&(r[n]=e[n]);return r};function mX(e,t,r){return t?!1:r.label.toLowerCase().trim().includes(e.toLowerCase().trim())}function hX(e,t){return!!e&&!t.some(r=>r.value.toLowerCase()===e.toLowerCase())}function uS(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 gX={size:"sm",valueComponent:jI,itemComponent:ej,transitionProps:{transition:"fade",duration:0},maxDropdownHeight:220,shadow:"sm",searchable:!1,filter:mX,limit:1/0,clearSearchOnChange:!0,clearable:!1,clearSearchOnBlur:!1,disabled:!1,initiallyOpened:!1,creatable:!1,shouldCreate:hX,switchDirectionOnFlip:!1,zIndex:jn("popover"),selectOnBlur:!1,positionDependencies:[],dropdownPosition:"flip"},k0=f.forwardRef((e,t)=>{const r=H("MultiSelect",gX,e),{className:n,style:o,required:a,label:i,description:l,size:c,error:u,classNames:d,styles:p,wrapperProps:h,value:g,defaultValue:v,data:w,onChange:E,valueComponent:_,itemComponent:y,id:x,transitionProps:b,maxDropdownHeight:S,shadow:$,nothingFound:O,onFocus:C,onBlur:T,searchable:j,placeholder:k,filter:I,limit:z,clearSearchOnChange:N,clearable:F,clearSearchOnBlur:q,variant:ee,onSearchChange:R,searchValue:D,disabled:V,initiallyOpened:G,radius:ie,icon:Oe,rightSection:ce,rightSectionWidth:Ae,creatable:Ie,getCreateLabel:ft,shouldCreate:Ge,onCreate:tt,sx:jr,dropdownComponent:Rr,onDropdownClose:rr,onDropdownOpen:pn,maxSelectedValues:Tt,withinPortal:Tr,portalProps:to,switchDirectionOnFlip:He,zIndex:Hr,selectOnBlur:qr,name:bt,dropdownPosition:di,errorProps:fi,labelProps:pi,descriptionProps:J,form:pe,positionDependencies:qe,onKeyDown:pt,unstyled:mt,inputContainer:ro,inputWrapperOrder:mn,readOnly:Ir,withAsterisk:Io,clearButtonProps:ya,hoverOnSearchChange:A,disableSelectedItemFiltering:L}=r,B=pX(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:K,cx:ge,theme:ve}=cX({invalid:!!u},{name:"MultiSelect",classNames:d,styles:p,unstyled:mt,size:c,variant:ee}),{systemStyles:we,rest:me}=Zn(B),le=f.useRef(),Me=f.useRef({}),it=$r(x),[be,ke]=f.useState(G),[Ct,Gt]=f.useState(-1),[Tn,wa]=f.useState("column"),[fr,pr]=Sr({value:D,defaultValue:"",finalValue:void 0,onChange:R}),[hn,_a]=f.useState(!1),{scrollIntoView:Do,targetRef:mi,scrollableRef:jl}=k6({duration:0,offset:5,cancelable:!1,isList:!0}),ze=Ie&&typeof ft=="function";let nr=null;const In=w.map(he=>typeof he=="string"?{label:he,value:he}:he),ba=F4({data:In}),[Se,Gr]=Sr({value:uS(g,w),defaultValue:uS(v,w),finalValue:[],onChange:E}),mr=f.useRef(!!Tt&&Tt<Se.length),kc=he=>{if(!Ir){const Qe=Se.filter(Qr=>Qr!==he);Gr(Qe),Tt&&Qe.length<Tt&&(mr.current=!1)}},S3=he=>{pr(he.currentTarget.value),!V&&!mr.current&&j&&ke(!0)},P3=he=>{typeof C=="function"&&C(he),!V&&!mr.current&&j&&ke(!0)},Bt=LY({data:ba,searchable:j,searchValue:fr,limit:z,filter:I,value:Se,disableSelectedItemFiltering:L});ze&&Ge(fr,ba)&&(nr=ft(fr),Bt.push({label:fr,value:fr,creatable:!0}));const xa=Math.min(Ct,Bt.length-1),C1=(he,Qe,Qr)=>{let No=he;for(;Qr(No);)if(No=Qe(No),!Bt[No].disabled)return No;return he};nn(()=>{Gt(A&&fr?0:-1)},[fr,A]),nn(()=>{!V&&Se.length>w.length&&ke(!1),Tt&&Se.length<Tt&&(mr.current=!1),Tt&&Se.length>=Tt&&(mr.current=!0,ke(!1))},[Se]);const jc=he=>{if(!Ir)if(N&&pr(""),Se.includes(he.value))kc(he.value);else{if(he.creatable&&typeof tt=="function"){const Qe=tt(he.value);typeof Qe<"u"&&Qe!==null&&Gr(typeof Qe=="string"?[...Se,Qe]:[...Se,Qe.value])}else Gr([...Se,he.value]);Se.length===Tt-1&&(mr.current=!0,ke(!1)),Bt.length===1&&ke(!1)}},O3=he=>{typeof T=="function"&&T(he),qr&&Bt[xa]&&be&&jc(Bt[xa]),q&&pr(""),ke(!1)},$3=he=>{if(hn||(pt==null||pt(he),Ir)||he.key!=="Backspace"&&Tt&&mr.current)return;const Qe=Tn==="column",Qr=()=>{Gt(Ea=>{var no;const Rl=C1(Ea,Sa=>Sa+1,Sa=>Sa<Bt.length-1);return be&&(mi.current=Me.current[(no=Bt[Rl])==null?void 0:no.value],Do({alignment:Qe?"end":"start"})),Rl})},No=()=>{Gt(Ea=>{var no;const Rl=C1(Ea,Sa=>Sa-1,Sa=>Sa>0);return be&&(mi.current=Me.current[(no=Bt[Rl])==null?void 0:no.value],Do({alignment:Qe?"start":"end"})),Rl})};switch(he.key){case"ArrowUp":{he.preventDefault(),ke(!0),Qe?No():Qr();break}case"ArrowDown":{he.preventDefault(),ke(!0),Qe?Qr():No();break}case"Enter":{he.preventDefault(),Bt[xa]&&be?jc(Bt[xa]):ke(!0);break}case" ":{j||(he.preventDefault(),Bt[xa]&&be?jc(Bt[xa]):ke(!0));break}case"Backspace":{Se.length>0&&fr.length===0&&(Gr(Se.slice(0,-1)),ke(!0),Tt&&(mr.current=!1));break}case"Home":{if(!j){he.preventDefault(),be||ke(!0);const Ea=Bt.findIndex(no=>!no.disabled);Gt(Ea),Do({alignment:Qe?"end":"start"})}break}case"End":{if(!j){he.preventDefault(),be||ke(!0);const Ea=Bt.map(no=>!!no.disabled).lastIndexOf(!1);Gt(Ea),Do({alignment:Qe?"end":"start"})}break}case"Escape":ke(!1)}},C3=Se.map(he=>{let Qe=ba.find(Qr=>Qr.value===he&&!Qr.disabled);return!Qe&&ze&&(Qe={value:he,label:he}),Qe}).filter(he=>!!he).map((he,Qe)=>s.createElement(_,cS(bi({},he),{variant:ee,disabled:V,className:K.value,readOnly:Ir,onRemove:Qr=>{Qr.preventDefault(),Qr.stopPropagation(),kc(he.value)},key:he.value,size:c,styles:p,classNames:d,radius:ie,index:Qe}))),k3=he=>Se.includes(he),j3=()=>{var he;pr(""),Gr([]),(he=le.current)==null||he.focus(),Tt&&(mr.current=!1)},Rc=!Ir&&(Bt.length>0?be:be&&!!O);return nn(()=>{const he=Rc?pn:rr;typeof he=="function"&&he()},[Rc]),s.createElement(Ft.Wrapper,bi(bi({required:a,id:it,label:i,error:u,description:l,size:c,className:n,style:o,classNames:d,styles:p,__staticSelector:"MultiSelect",sx:jr,errorProps:fi,descriptionProps:J,labelProps:pi,inputContainer:ro,inputWrapperOrder:mn,unstyled:mt,withAsterisk:Io,variant:ee},we),h),s.createElement(bs,{opened:Rc,transitionProps:b,shadow:"sm",withinPortal:Tr,portalProps:to,__staticSelector:"MultiSelect",onDirectionChange:wa,switchDirectionOnFlip:He,zIndex:Hr,dropdownPosition:di,positionDependencies:[...qe,fr],classNames:d,styles:p,unstyled:mt,variant:ee},s.createElement(bs.Target,null,s.createElement("div",{className:K.wrapper,role:"combobox","aria-haspopup":"listbox","aria-owns":be&&Rc?`${it}-items`:null,"aria-controls":it,"aria-expanded":be,onMouseLeave:()=>Gt(-1),tabIndex:-1},s.createElement("input",{type:"hidden",name:bt,value:Se.join(","),form:pe,disabled:V}),s.createElement(Ft,bi({__staticSelector:"MultiSelect",style:{overflow:"hidden"},component:"div",multiline:!0,size:c,variant:ee,disabled:V,error:u,required:a,radius:ie,icon:Oe,unstyled:mt,onMouseDown:he=>{var Qe;he.preventDefault(),!V&&!mr.current&&ke(!be),(Qe=le.current)==null||Qe.focus()},classNames:cS(bi({},d),{input:ge({[K.input]:!j},d==null?void 0:d.input)})},AI({theme:ve,rightSection:ce,rightSectionWidth:Ae,styles:p,size:c,shouldClear:F&&Se.length>0,onClear:j3,error:u,disabled:V,clearButtonProps:ya,readOnly:Ir})),s.createElement("div",{className:K.values,"data-clearable":F||void 0},C3,s.createElement("input",bi({ref:_l(t,le),type:"search",id:it,className:ge(K.searchInput,{[K.searchInputPointer]:!j,[K.searchInputInputHidden]:!be&&Se.length>0||!j&&Se.length>0,[K.searchInputEmpty]:Se.length===0}),onKeyDown:$3,value:fr,onChange:S3,onFocus:P3,onBlur:O3,readOnly:!j||mr.current||Ir,placeholder:Se.length===0?k:void 0,disabled:V,"data-mantine-stop-propagation":be,autoComplete:"off",onCompositionStart:()=>_a(!0),onCompositionEnd:()=>_a(!1)},me)))))),s.createElement(bs.Dropdown,{component:Rr||i0,maxHeight:S,direction:Tn,id:it,innerRef:jl,__staticSelector:"MultiSelect",classNames:d,styles:p},s.createElement(Xk,{data:Bt,hovered:xa,classNames:d,styles:p,uuid:it,__staticSelector:"MultiSelect",onItemHover:Gt,onItemSelect:jc,itemsRefs:Me,itemComponent:y,size:c,nothingFound:O,isItemSelected:k3,creatable:Ie&&!!nr,createLabel:nr,unstyled:mt,variant:ee}))))});k0.displayName="@mantine/core/MultiSelect";var vX=Object.defineProperty,yX=Object.defineProperties,wX=Object.getOwnPropertyDescriptors,lp=Object.getOwnPropertySymbols,LI=Object.prototype.hasOwnProperty,FI=Object.prototype.propertyIsEnumerable,dS=(e,t,r)=>t in e?vX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yu=(e,t)=>{for(var r in t||(t={}))LI.call(t,r)&&dS(e,r,t[r]);if(lp)for(var r of lp(t))FI.call(t,r)&&dS(e,r,t[r]);return e},fS=(e,t)=>yX(e,wX(t)),_X=(e,t)=>{var r={};for(var n in e)LI.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&&FI.call(e,n)&&(r[n]=e[n]);return r};const bX={size:"sm"},dt=f.forwardRef((e,t)=>{const r=eR("NativeSelect",bX,e),{inputProps:n,wrapperProps:o,data:a,onChange:i,value:l,classNames:c,styles:u,rightSection:d,rightSectionWidth:p}=r,h=_X(r,["inputProps","wrapperProps","data","onChange","value","classNames","styles","rightSection","rightSectionWidth"]),g=tr(),w=a.map(E=>typeof E=="string"?{label:E,value:E}:E).map(E=>s.createElement("option",{key:E.value,value:E.value,disabled:E.disabled},E.label));return s.createElement(Ft.Wrapper,fS(yu({},o),{__staticSelector:"NativeSelect"}),s.createElement(Ft,yu(fS(yu(yu({},n),h),{onChange:i,component:"select",ref:t,value:l===null?"":l,__staticSelector:"NativeSelect",pointer:g.cursorType==="pointer"}),AI({theme:g,rightSection:d,rightSectionWidth:p,styles:u,shouldClear:!1,size:n.size,error:o.error,readOnly:!1})),w))});dt.displayName="@mantine/core/NativeSelect";var xX=U((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 EX=xX;var SX=Object.defineProperty,PX=Object.defineProperties,OX=Object.getOwnPropertyDescriptors,sp=Object.getOwnPropertySymbols,VI=Object.prototype.hasOwnProperty,BI=Object.prototype.propertyIsEnumerable,pS=(e,t,r)=>t in e?SX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,mS=(e,t)=>{for(var r in t||(t={}))VI.call(t,r)&&pS(e,r,t[r]);if(sp)for(var r of sp(t))BI.call(t,r)&&pS(e,r,t[r]);return e},$X=(e,t)=>PX(e,OX(t)),CX=(e,t)=>{var r={};for(var n in e)VI.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&&BI.call(e,n)&&(r[n]=e[n]);return r};const kX={withCloseButton:!0},UI=f.forwardRef((e,t)=>{const r=H("Notification",kX,e),{className:n,color:o,radius:a,loading:i,withCloseButton:l,withBorder:c,title:u,icon:d,children:p,onClose:h,closeButtonProps:g,classNames:v,styles:w,unstyled:E,variant:_}=r,y=CX(r,["className","color","radius","loading","withCloseButton","withBorder","title","icon","children","onClose","closeButtonProps","classNames","styles","unstyled","variant"]),{classes:x,cx:b}=EX({color:o,radius:a,withTitle:!!u},{name:"Notification",classNames:v,styles:w,unstyled:E,variant:_});return s.createElement(se,mS({className:b(x.root,n),"data-with-icon":!!d||i||void 0,"data-with-border":c||void 0,role:"alert",ref:t},y),d&&!i&&s.createElement("div",{className:x.icon},d),i&&s.createElement(un,{size:28,color:o,className:x.loader}),s.createElement("div",{className:x.body},u&&s.createElement(ae,{className:x.title,size:"sm",weight:500},u),s.createElement(ae,{color:"dimmed",className:x.description,size:"sm"},p)),l&&s.createElement(ac,$X(mS({iconSize:16,color:"gray"},g),{onClick:h,className:x.closeButton})))});UI.displayName="@mantine/core/Notification";var jX=Object.defineProperty,RX=Object.defineProperties,TX=Object.getOwnPropertyDescriptors,cp=Object.getOwnPropertySymbols,WI=Object.prototype.hasOwnProperty,HI=Object.prototype.propertyIsEnumerable,hS=(e,t,r)=>t in e?jX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eg=(e,t)=>{for(var r in t||(t={}))WI.call(t,r)&&hS(e,r,t[r]);if(cp)for(var r of cp(t))HI.call(t,r)&&hS(e,r,t[r]);return e},IX=(e,t)=>RX(e,TX(t)),DX=(e,t)=>{var r={};for(var n in e)WI.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&&HI.call(e,n)&&(r[n]=e[n]);return r};const NX={type:"text",size:"sm",__staticSelector:"TextInput"},oe=f.forwardRef((e,t)=>{const r=eR("TextInput",NX,e),{inputProps:n,wrapperProps:o}=r,a=DX(r,["inputProps","wrapperProps"]);return s.createElement(Ft.Wrapper,eg({},o),s.createElement(Ft,IX(eg(eg({},n),a),{ref:t})))});oe.displayName="@mantine/core/TextInput";const[AX,zm]=Po("Pagination.Root component was not found in tree"),MX={siblings:1,boundaries:1};function qI(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:g,onLastPage:v,getItemProps:w,classNames:E,styles:_,unstyled:y,variant:x,size:b}=H("PaginationRoot",MX,e),{range:S,setPage:$,next:O,previous:C,active:T,first:j,last:k}=E6({page:r,initialPage:n,onChange:o,total:t,siblings:l,boundaries:c}),I=Ar(p,O),z=Ar(h,C),N=Ar(g,j),F=Ar(v,k);return s.createElement(AX,{value:{total:t,range:S,active:T,disabled:a,color:u,radius:d,getItemProps:w,onChange:$,onNext:I,onPrevious:z,onFirst:N,onLast:F,stylesApi:{name:"Pagination",classNames:E,styles:_,unstyled:y,variant:x,size:b}}},i)}const Hs={xs:P(22),sm:P(26),md:P(32),lg:P(38),xl:P(44)};var zX=U((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:M({size:o,sizes:Hs}),minWidth:M({size:o,sizes:Hs}),padding:n?`0 calc(${M({size:o,sizes:e.spacing})} / 2)`:void 0,fontSize:M({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 LX=zX;var FX=Object.defineProperty,VX=Object.defineProperties,BX=Object.getOwnPropertyDescriptors,up=Object.getOwnPropertySymbols,GI=Object.prototype.hasOwnProperty,QI=Object.prototype.propertyIsEnumerable,gS=(e,t,r)=>t in e?FX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UX=(e,t)=>{for(var r in t||(t={}))GI.call(t,r)&&gS(e,r,t[r]);if(up)for(var r of up(t))QI.call(t,r)&&gS(e,r,t[r]);return e},WX=(e,t)=>VX(e,BX(t)),HX=(e,t)=>{var r={};for(var n in e)GI.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&&QI.call(e,n)&&(r[n]=e[n]);return r};const qX={withPadding:!0},Lm=f.forwardRef((e,t)=>{const r=H("PaginationControl",qX,e),{active:n,className:o,disabled:a,withPadding:i}=r,l=HX(r,["active","className","disabled","withPadding"]),c=zm(),{classes:u,cx:d}=LX({color:c.color,radius:c.radius,withPadding:i},c.stylesApi);return s.createElement(ho,WX(UX({},l),{disabled:a,"data-active":n||void 0,"data-disabled":a||void 0,ref:t,className:d(u.control,o)}))});Lm.displayName="@mantine/core/PaginationControl";var GX=Object.defineProperty,QX=Object.defineProperties,KX=Object.getOwnPropertyDescriptors,dp=Object.getOwnPropertySymbols,KI=Object.prototype.hasOwnProperty,YI=Object.prototype.propertyIsEnumerable,vS=(e,t,r)=>t in e?GX(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ka=(e,t)=>{for(var r in t||(t={}))KI.call(t,r)&&vS(e,r,t[r]);if(dp)for(var r of dp(t))YI.call(t,r)&&vS(e,r,t[r]);return e},pc=(e,t)=>QX(e,KX(t)),YX=(e,t)=>{var r={};for(var n in e)KI.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&&YI.call(e,n)&&(r[n]=e[n]);return r};function XI(e){return`calc(${M({size:e,sizes:Hs})} / 2)`}function mc(e){var t=e,{size:r,style:n,children:o,path:a}=t,i=YX(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 XX=e=>s.createElement(mc,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"})),JX=e=>s.createElement(mc,pc(Ka({},e),{path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"})),ZX=e=>s.createElement(mc,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"})),eJ=e=>s.createElement(mc,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"})),tJ=e=>s.createElement(mc,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 rJ=U((e,t,{size:r})=>({dots:{height:M({size:r,sizes:Hs}),minWidth:M({size:r,sizes:Hs}),display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"}}));const nJ=rJ;var oJ=Object.defineProperty,fp=Object.getOwnPropertySymbols,JI=Object.prototype.hasOwnProperty,ZI=Object.prototype.propertyIsEnumerable,yS=(e,t,r)=>t in e?oJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aJ=(e,t)=>{for(var r in t||(t={}))JI.call(t,r)&&yS(e,r,t[r]);if(fp)for(var r of fp(t))ZI.call(t,r)&&yS(e,r,t[r]);return e},iJ=(e,t)=>{var r={};for(var n in e)JI.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&&ZI.call(e,n)&&(r[n]=e[n]);return r};const lJ={icon:tJ},j0=f.forwardRef((e,t)=>{const r=H("PaginationDots",lJ,e),{className:n,icon:o}=r,a=iJ(r,["className","icon"]),i=zm(),{classes:l,cx:c}=nJ(null,i.stylesApi);return s.createElement(se,aJ({ref:t,className:c(l.dots,n)},a),s.createElement(o,{size:XI(i.stylesApi.size)}))});j0.displayName="@mantine/core/PaginationDots";var sJ=Object.defineProperty,wS=Object.getOwnPropertySymbols,cJ=Object.prototype.hasOwnProperty,uJ=Object.prototype.propertyIsEnumerable,_S=(e,t,r)=>t in e?sJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dJ=(e,t)=>{for(var r in t||(t={}))cJ.call(t,r)&&_S(e,r,t[r]);if(wS)for(var r of wS(t))uJ.call(t,r)&&_S(e,r,t[r]);return e};function R0({dotsIcon:e}){const t=zm(),r=t.range.map((n,o)=>{var a;return n==="dots"?s.createElement(j0,{icon:e,key:o}):s.createElement(Lm,dJ({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)}R0.displayName="@mantine/core/PaginationItems";var fJ=U(e=>({icon:{transform:e.dir==="rtl"?"rotate(180deg)":"unset"}}));const pJ=fJ;var mJ=Object.defineProperty,pp=Object.getOwnPropertySymbols,eD=Object.prototype.hasOwnProperty,tD=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?mJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hJ=(e,t)=>{for(var r in t||(t={}))eD.call(t,r)&&bS(e,r,t[r]);if(pp)for(var r of pp(t))tD.call(t,r)&&bS(e,r,t[r]);return e},gJ=(e,t)=>{var r={};for(var n in e)eD.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&&tD.call(e,n)&&(r[n]=e[n]);return r};function Fm({icon:e,name:t,action:r,type:n}){const o={icon:e},a=f.forwardRef((i,l)=>{const c=H(t,o,i),{icon:u}=c,d=gJ(c,["icon"]),{classes:p}=pJ(),h=zm(),g=n==="next"?h.active===h.total:h.active===1;return s.createElement(Lm,hJ({disabled:h.disabled||g,ref:l,onClick:h[r],withPadding:!1},d),s.createElement(u,{className:p.icon,size:XI(h.stylesApi.size)}))});return a.displayName=`@mantine/core/${t}`,a}const rD=Fm({icon:XX,name:"PaginationNext",action:"onNext",type:"next"}),nD=Fm({icon:JX,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),oD=Fm({icon:ZX,name:"PaginationFirst",action:"onFirst",type:"previous"}),aD=Fm({icon:eJ,name:"PaginationLast",action:"onLast",type:"next"});var vJ=Object.defineProperty,mp=Object.getOwnPropertySymbols,iD=Object.prototype.hasOwnProperty,lD=Object.prototype.propertyIsEnumerable,xS=(e,t,r)=>t in e?vJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kl=(e,t)=>{for(var r in t||(t={}))iD.call(t,r)&&xS(e,r,t[r]);if(mp)for(var r of mp(t))lD.call(t,r)&&xS(e,r,t[r]);return e},yJ=(e,t)=>{var r={};for(var n in e)iD.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&&lD.call(e,n)&&(r[n]=e[n]);return r};const wJ={withControls:!0,siblings:1,boundaries:1};function eo(e){const t=H("Pagination",wJ,e),{withEdges:r,withControls:n,classNames:o,styles:a,unstyled:i,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:g,siblings:v,boundaries:w,color:E,radius:_,onNextPage:y,onPreviousPage:x,onFirstPage:b,onLastPage:S,getItemProps:$,getControlProps:O,spacing:C,nextIcon:T,previousIcon:j,lastIcon:k,firstIcon:I,dotsIcon:z}=t,N=yJ(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"]),F=tr();return u<=0?null:s.createElement(qI,{classNames:o,styles:a,unstyled:i,variant:l,size:c,total:u,value:d,defaultValue:p,onChange:h,disabled:g,siblings:v,boundaries:w,color:E,radius:_,onNextPage:y,onPreviousPage:x,onFirstPage:b,onLastPage:S,getItemProps:$},s.createElement(Z,Kl({spacing:C??`calc(${M({size:c,sizes:F.spacing})} / 2)`},N),r&&s.createElement(oD,Kl({icon:I},O==null?void 0:O("first"))),n&&s.createElement(nD,Kl({icon:j},O==null?void 0:O("previous"))),s.createElement(R0,{dotsIcon:z}),n&&s.createElement(rD,Kl({icon:T},O==null?void 0:O("next"))),r&&s.createElement(aD,Kl({icon:k},O==null?void 0:O("last")))))}eo.displayName="@mantine/core/Pagination";eo.Root=qI;eo.Items=R0;eo.Control=Lm;eo.Dots=j0;eo.Next=rD;eo.Previous=nD;eo.Last=aD;eo.First=oD;const _J=({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 bJ=Object.defineProperty,xJ=Object.defineProperties,EJ=Object.getOwnPropertyDescriptors,ES=Object.getOwnPropertySymbols,SJ=Object.prototype.hasOwnProperty,PJ=Object.prototype.propertyIsEnumerable,SS=(e,t,r)=>t in e?bJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tg=(e,t)=>{for(var r in t||(t={}))SJ.call(t,r)&&SS(e,r,t[r]);if(ES)for(var r of ES(t))PJ.call(t,r)&&SS(e,r,t[r]);return e},PS=(e,t)=>xJ(e,EJ(t)),OJ=U((e,{rightSectionWidth:t},{size:r})=>({visibilityToggle:{},input:{position:"relative",overflow:"hidden"},innerInput:PS(tg(tg({},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(${M({size:r,sizes:Et})} / 3)`,fontSize:M({size:r,sizes:e.fontSizes}),height:`calc(${M({size:r,sizes:Et})} - ${P(2)})`,lineHeight:`calc(${M({size:r,sizes:Et})} - ${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":PS(tg({},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:M({size:r,sizes:Et})}})}));const $J=OJ;var CJ=Object.defineProperty,kJ=Object.defineProperties,jJ=Object.getOwnPropertyDescriptors,hp=Object.getOwnPropertySymbols,sD=Object.prototype.hasOwnProperty,cD=Object.prototype.propertyIsEnumerable,OS=(e,t,r)=>t in e?CJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wu=(e,t)=>{for(var r in t||(t={}))sD.call(t,r)&&OS(e,r,t[r]);if(hp)for(var r of hp(t))cD.call(t,r)&&OS(e,r,t[r]);return e},RJ=(e,t)=>kJ(e,jJ(t)),TJ=(e,t)=>{var r={};for(var n in e)sD.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&&cD.call(e,n)&&(r[n]=e[n]);return r};const IJ={xs:P(22),sm:P(26),md:P(28),lg:P(32),xl:P(40)},DJ={xs:P(12),sm:P(15),md:P(17),lg:P(19),xl:P(21)},NJ={xs:P(28),sm:P(32),md:P(34),lg:P(44),xl:P(54)},AJ={size:"sm",toggleTabIndex:-1,visibilityToggleIcon:_J,__staticSelector:"PasswordInput"},po=f.forwardRef((e,t)=>{const r=H("PasswordInput",AJ,e),{radius:n,disabled:o,size:a,toggleTabIndex:i,className:l,id:c,label:u,error:d,required:p,style:h,icon:g,description:v,wrapperProps:w,classNames:E,styles:_,variant:y,visibilityToggleIcon:x,__staticSelector:b,sx:S,labelProps:$,descriptionProps:O,errorProps:C,unstyled:T,visibilityToggleLabel:j,withAsterisk:k,inputContainer:I,iconWidth:z,inputWrapperOrder:N,visible:F,defaultVisible:q,onVisibilityChange:ee}=r,R=TJ(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"]),D=M({size:a,sizes:NJ}),{classes:V}=$J({rightSectionWidth:D},{name:"PasswordInput",classNames:E,styles:_,unstyled:T,size:a,variant:y}),G=$r(c),{systemStyles:ie,rest:Oe}=Zn(R),[ce,Ae]=Sr({value:F,defaultValue:q,finalValue:!1,onChange:ee}),Ie=()=>Ae(!ce),ft=s.createElement(sr,{className:V.visibilityToggle,tabIndex:i,radius:n,size:M({size:a,sizes:IJ}),"aria-hidden":!j,"aria-label":j,unstyled:T,onMouseDown:Ge=>{Ge.preventDefault(),Ie()},onKeyDown:Ge=>{Ge.key===" "&&(Ge.preventDefault(),Ie())}},s.createElement(x,{reveal:ce,size:M({size:a,sizes:DJ})}));return s.createElement(Ft.Wrapper,wu(wu({required:p,id:G,label:u,error:d,description:v,size:a,className:l,style:h,classNames:E,styles:_,__staticSelector:b,sx:S,errorProps:C,descriptionProps:O,labelProps:$,unstyled:T,withAsterisk:k,inputWrapperOrder:N,inputContainer:I,variant:y},ie),w),s.createElement(Ft,{component:"div",error:d,icon:g,size:a,classNames:RJ(wu({},E),{input:V.input}),styles:_,radius:n,disabled:o,__staticSelector:b,rightSectionWidth:D,rightSection:!o&&ft,variant:y,unstyled:T,iconWidth:z},s.createElement("input",wu({type:ce?"text":"password",required:p,"data-invalid":!!d||void 0,"data-with-icon":!!g||void 0,className:V.innerInput,disabled:o,id:G,ref:t},Oe))))});po.displayName="@mantine/core/PasswordInput";const uD=f.createContext(!1),MJ=uD.Provider,zJ=()=>f.useContext(uD);function dD({children:e,openDelay:t=0,closeDelay:r=0}){return s.createElement(MJ,{value:!0},s.createElement(kV,{delay:{open:t,close:r}},e))}dD.displayName="@mantine/core/TooltipGroup";var LJ=Object.defineProperty,FJ=Object.defineProperties,VJ=Object.getOwnPropertyDescriptors,$S=Object.getOwnPropertySymbols,BJ=Object.prototype.hasOwnProperty,UJ=Object.prototype.propertyIsEnumerable,CS=(e,t,r)=>t in e?LJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,kS=(e,t)=>{for(var r in t||(t={}))BJ.call(t,r)&&CS(e,r,t[r]);if($S)for(var r of $S(t))UJ.call(t,r)&&CS(e,r,t[r]);return e},WJ=(e,t)=>FJ(e,VJ(t));function HJ(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 qJ=U((e,{color:t,radius:r,width:n,multiline:o})=>({tooltip:WJ(kS(kS({},e.fn.fontStyles()),HJ(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 fD=qJ,pD={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 GJ({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}=y0({placement:t,middleware:[f0({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=p.includes("right")?e:t.includes("left")?e*-1:0,g=p.includes("bottom")?e:t.includes("top")?e*-1:0,v=f.useCallback(({clientX:w,clientY:E})=>{l({getBoundingClientRect(){return{width:0,height:0,x:w,y:E,left:w+h,top:E+g,right:w,bottom:E}}})},[l]);return f.useEffect(()=>{if(u.floating.current){const w=o.current;w.addEventListener("mousemove",v);const E=fo(u.floating.current);return E.forEach(_=>{_.addEventListener("scroll",d)}),()=>{w.removeEventListener("mousemove",v),E.forEach(_=>{_.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 QJ=Object.defineProperty,KJ=Object.defineProperties,YJ=Object.getOwnPropertyDescriptors,gp=Object.getOwnPropertySymbols,mD=Object.prototype.hasOwnProperty,hD=Object.prototype.propertyIsEnumerable,jS=(e,t,r)=>t in e?QJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_u=(e,t)=>{for(var r in t||(t={}))mD.call(t,r)&&jS(e,r,t[r]);if(gp)for(var r of gp(t))hD.call(t,r)&&jS(e,r,t[r]);return e},bu=(e,t)=>KJ(e,YJ(t)),XJ=(e,t)=>{var r={};for(var n in e)mD.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&&hD.call(e,n)&&(r[n]=e[n]);return r};const JJ={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:jn("popover")};function gD(e){var t;const r=H("TooltipFloating",JJ,e),{children:n,refProp:o,withinPortal:a,portalProps:i,style:l,className:c,classNames:u,styles:d,unstyled:p,radius:h,color:g,label:v,offset:w,position:E,multiline:_,width:y,zIndex:x,disabled:b,variant:S}=r,$=XJ(r,["children","refProp","withinPortal","portalProps","style","className","classNames","styles","unstyled","radius","color","label","offset","position","multiline","width","zIndex","disabled","variant"]),{handleMouseMove:O,x:C,y:T,opened:j,boundaryRef:k,floating:I,setOpened:z}=GJ({offset:w,position:E}),{classes:N,cx:F}=fD({radius:h,color:g,multiline:_,width:y},{name:"TooltipFloating",classNames:u,styles:d,unstyled:p,variant:S});if(!yl(n))throw new Error(pD.children);const q=_l(k,n.ref),ee=D=>{var V,G;(G=(V=n.props).onMouseEnter)==null||G.call(V,D),O(D),z(!0)},R=D=>{var V,G;(G=(V=n.props).onMouseLeave)==null||G.call(V,D),z(!1)};return s.createElement(s.Fragment,null,s.createElement(El,bu(_u({},i),{withinPortal:a}),s.createElement(se,bu(_u({},$),{ref:I,className:F(N.tooltip,c),style:bu(_u({},l),{zIndex:x,display:!b&&j?"block":"none",top:T??"",left:(t=Math.round(C))!=null?t:""})}),v)),f.cloneElement(n,bu(_u({},n.props),{[o]:q,onMouseEnter:ee,onMouseLeave:R})))}gD.displayName="@mantine/core/TooltipFloating";function ZJ(e){const[t,r]=f.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,a=zJ(),i=$r(),{delay:l,currentId:c,setCurrentId:u}=Aj(),d=f.useCallback(C=>{r(C),C&&u(i)},[u,i]),{x:p,y:h,reference:g,floating:v,context:w,refs:E,update:_,placement:y,middlewareData:{arrow:{x,y:b}={}}}=y0({placement:e.position,open:o,onOpenChange:d,middleware:[Ej(e.offset),f0({padding:8}),_j(),Rj({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[xj()]:[]]}),{getReferenceProps:S,getFloatingProps:$}=VV([CV(w,{enabled:e.events.hover,delay:a?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events.touch}),LV(w,{enabled:e.events.focus,keyboardOnly:!0}),FV(w,{role:"tooltip"}),zV(w,{enabled:typeof e.opened===void 0}),jV(w,{id:i})]);return zj({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:E,update:_}}),nn(()=>{var C;(C=e.onPositionChange)==null||C.call(e,y)},[y]),{x:p,y:h,arrowX:x,arrowY:b,reference:g,floating:v,getFloatingProps:$,getReferenceProps:S,isGroupPhase:o&&c&&c!==i,opened:o,placement:y}}var eZ=Object.defineProperty,tZ=Object.defineProperties,rZ=Object.getOwnPropertyDescriptors,vp=Object.getOwnPropertySymbols,vD=Object.prototype.hasOwnProperty,yD=Object.prototype.propertyIsEnumerable,RS=(e,t,r)=>t in e?eZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Pa=(e,t)=>{for(var r in t||(t={}))vD.call(t,r)&&RS(e,r,t[r]);if(vp)for(var r of vp(t))yD.call(t,r)&&RS(e,r,t[r]);return e},rg=(e,t)=>tZ(e,rZ(t)),nZ=(e,t)=>{var r={};for(var n in e)vD.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&&yD.call(e,n)&&(r[n]=e[n]);return r};const oZ={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:jn("popover"),positionDependencies:[]},Vm=f.forwardRef((e,t)=>{var r;const n=f.useRef(null),o=H("Tooltip",oZ,e),{children:a,position:i,refProp:l,label:c,openDelay:u,closeDelay:d,onPositionChange:p,opened:h,withinPortal:g,portalProps:v,radius:w,color:E,classNames:_,styles:y,unstyled:x,style:b,className:S,withArrow:$,arrowSize:O,arrowOffset:C,arrowRadius:T,arrowPosition:j,offset:k,transitionProps:I,multiline:z,width:N,events:F,zIndex:q,disabled:ee,positionDependencies:R,onClick:D,onMouseEnter:V,onMouseLeave:G,inline:ie,variant:Oe,keepMounted:ce}=o,Ae=nZ(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:ft,theme:Ge}=fD({radius:w,color:E,width:N,multiline:z},{name:"Tooltip",classNames:_,styles:y,unstyled:x,variant:Oe}),tt=ZJ({position:Kj(Ge.dir,i),closeDelay:d,openDelay:u,onPositionChange:p,opened:h,events:F,arrowRef:n,arrowOffset:C,offset:k+($?O/2:0),positionDependencies:[...R,a],inline:ie});if(!yl(a))throw new Error(pD.children);const jr=_l(tt.reference,a.ref,t);return s.createElement(s.Fragment,null,s.createElement(El,rg(Pa({},v),{withinPortal:g}),s.createElement(ii,rg(Pa({keepMounted:ce,mounted:!ee&&tt.opened},I),{transition:I.transition||"fade",duration:tt.isGroupPhase?10:(r=I.duration)!=null?r:100}),Rr=>{var rr,pn;return s.createElement(se,Pa(Pa({},Ae),tt.getFloatingProps({ref:tt.floating,className:Ie.tooltip,style:rg(Pa(Pa({},b),Rr),{zIndex:q,top:(rr=tt.y)!=null?rr:0,left:(pn=tt.x)!=null?pn:0})})),c,s.createElement(_0,{ref:n,arrowX:tt.arrowX,arrowY:tt.arrowY,visible:$,position:tt.placement,arrowSize:O,arrowOffset:C,arrowRadius:T,arrowPosition:j,className:Ie.arrow}))})),f.cloneElement(a,tt.getReferenceProps(Pa({onClick:D,onMouseEnter:V,onMouseLeave:G,onMouseMove:e.onMouseMove,onPointerDown:e.onPointerDown,onPointerEnter:e.onPointerEnter,[l]:jr,className:ft(S,a.props.className)},a.props))))});Vm.Group=dD;Vm.Floating=gD;Vm.displayName="@mantine/core/Tooltip";const aZ=Vm;var iZ=Object.defineProperty,yp=Object.getOwnPropertySymbols,wD=Object.prototype.hasOwnProperty,_D=Object.prototype.propertyIsEnumerable,TS=(e,t,r)=>t in e?iZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,IS=(e,t)=>{for(var r in t||(t={}))wD.call(t,r)&&TS(e,r,t[r]);if(yp)for(var r of yp(t))_D.call(t,r)&&TS(e,r,t[r]);return e},lZ=(e,t)=>{var r={};for(var n in e)wD.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&&_D.call(e,n)&&(r[n]=e[n]);return r};function sZ(e){const t=e,{width:r,height:n,style:o}=t,a=lZ(t,["width","height","style"]);return s.createElement("svg",IS({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:IS({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 bD=f.createContext(null),cZ=bD.Provider,uZ=()=>f.useContext(bD);var dZ=Object.defineProperty,wp=Object.getOwnPropertySymbols,xD=Object.prototype.hasOwnProperty,ED=Object.prototype.propertyIsEnumerable,DS=(e,t,r)=>t in e?dZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,NS=(e,t)=>{for(var r in t||(t={}))xD.call(t,r)&&DS(e,r,t[r]);if(wp)for(var r of wp(t))ED.call(t,r)&&DS(e,r,t[r]);return e},fZ=(e,t)=>{var r={};for(var n in e)xD.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&&ED.call(e,n)&&(r[n]=e[n]);return r};const pZ={size:"sm"},SD=f.forwardRef((e,t)=>{const r=H("RadioGroup",pZ,e),{children:n,value:o,defaultValue:a,onChange:i,size:l,wrapperProps:c,unstyled:u,name:d}=r,p=fZ(r,["children","value","defaultValue","onChange","size","wrapperProps","unstyled","name"]),h=$r(d),[g,v]=Sr({value:o,defaultValue:a,finalValue:"",onChange:i}),w=E=>v(E.currentTarget.value);return s.createElement(cZ,{value:{value:g,onChange:w,size:l,name:h}},s.createElement(Ft.Wrapper,NS(NS({labelElement:"div",size:l,__staticSelector:"RadioGroup",ref:t,unstyled:u},c),p),n))});SD.displayName="@mantine/core/RadioGroup";var mZ=Object.defineProperty,hZ=Object.defineProperties,gZ=Object.getOwnPropertyDescriptors,AS=Object.getOwnPropertySymbols,vZ=Object.prototype.hasOwnProperty,yZ=Object.prototype.propertyIsEnumerable,MS=(e,t,r)=>t in e?mZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wZ=(e,t)=>{for(var r in t||(t={}))vZ.call(t,r)&&MS(e,r,t[r]);if(AS)for(var r of AS(t))yZ.call(t,r)&&MS(e,r,t[r]);return e},_Z=(e,t)=>hZ(e,gZ(t));const ng={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)},xu={xs:P(6),sm:P(8),md:P(10),lg:P(14),xl:P(16)};var bZ=U((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:M({sizes:xu,size:a}),height:M({sizes:xu,size:a}),position:"absolute",top:`calc(50% - ${M({sizes:xu,size:a})} / 2)`,left:`calc(50% - ${M({sizes:xu,size:a})} / 2)`},radio:_Z(wZ({},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:M({sizes:ng,size:a}),height:M({sizes:ng,size:a}),borderRadius:M({sizes:ng,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 xZ=bZ;var EZ=Object.defineProperty,_p=Object.getOwnPropertySymbols,PD=Object.prototype.hasOwnProperty,OD=Object.prototype.propertyIsEnumerable,zS=(e,t,r)=>t in e?EZ(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)&&zS(e,r,t[r]);if(_p)for(var r of _p(t))OD.call(t,r)&&zS(e,r,t[r]);return e},SZ=(e,t)=>{var r={};for(var n in e)PD.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&&OD.call(e,n)&&(r[n]=e[n]);return r};const PZ={icon:sZ,transitionDuration:100,size:"sm",labelPosition:"right"},bp=f.forwardRef((e,t)=>{var r,n;const o=H("Radio",PZ,e),{className:a,style:i,id:l,label:c,size:u,title:d,disabled:p,color:h,classNames:g,styles:v,sx:w,icon:E,transitionDuration:_,wrapperProps:y,unstyled:x,labelPosition:b,description:S,error:$,variant:O}=o,C=SZ(o,["className","style","id","label","size","title","disabled","color","classNames","styles","sx","icon","transitionDuration","wrapperProps","unstyled","labelPosition","description","error","variant"]),T=uZ(),j=(r=T==null?void 0:T.size)!=null?r:u,k=e.size?u:j,{classes:I}=xZ({color:h,transitionDuration:_,labelPosition:b,error:!!$},{name:"Radio",classNames:g,styles:v,unstyled:x,variant:O,size:k}),{systemStyles:z,rest:N}=Zn(C),F=$r(l),q=T?{checked:T.value===N.value,name:(n=N.name)!=null?n:T.name,onChange:T.onChange}:{};return s.createElement(Mm,Eu(Eu({className:a,sx:w,style:i,id:F,size:k,labelPosition:b,label:c,description:S,error:$,disabled:p,__staticSelector:"Radio",classNames:g,styles:v,unstyled:x,"data-checked":q.checked||void 0,variant:O},z),y),s.createElement("div",{className:I.inner},s.createElement("input",Eu(Eu({ref:t,className:I.radio,type:"radio",id:F,disabled:p},N),q)),s.createElement(E,{className:I.icon,"aria-hidden":!0})))});bp.displayName="@mantine/core/Radio";bp.Group=SD;var OZ=Object.defineProperty,xp=Object.getOwnPropertySymbols,$D=Object.prototype.hasOwnProperty,CD=Object.prototype.propertyIsEnumerable,LS=(e,t,r)=>t in e?OZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$Z=(e,t)=>{for(var r in t||(t={}))$D.call(t,r)&&LS(e,r,t[r]);if(xp)for(var r of xp(t))CD.call(t,r)&&LS(e,r,t[r]);return e},CZ=(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&&CD.call(e,n)&&(r[n]=e[n]);return r};const kZ={w:0,h:0},Bm=f.forwardRef((e,t)=>{const r=H("Space",kZ,e),{w:n,h:o}=r,a=CZ(r,["w","h"]);return s.createElement(se,$Z({ref:t,w:n,miw:n,h:o,mih:o},a))});Bm.displayName="@mantine/core/Space";var jZ=U((e,{spacing:t,align:r,justify:n})=>({root:{display:"flex",flexDirection:"column",alignItems:r,justifyContent:n,gap:M({size:t,sizes:e.spacing})}}));const RZ=jZ;var TZ=Object.defineProperty,Ep=Object.getOwnPropertySymbols,kD=Object.prototype.hasOwnProperty,jD=Object.prototype.propertyIsEnumerable,FS=(e,t,r)=>t in e?TZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,IZ=(e,t)=>{for(var r in t||(t={}))kD.call(t,r)&&FS(e,r,t[r]);if(Ep)for(var r of Ep(t))jD.call(t,r)&&FS(e,r,t[r]);return e},DZ=(e,t)=>{var r={};for(var n in e)kD.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&&jD.call(e,n)&&(r[n]=e[n]);return r};const NZ={spacing:"md",align:"stretch",justify:"flex-start"},je=f.forwardRef((e,t)=>{const r=H("Stack",NZ,e),{spacing:n,className:o,align:a,justify:i,unstyled:l,variant:c}=r,u=DZ(r,["spacing","className","align","justify","unstyled","variant"]),{classes:d,cx:p}=RZ({spacing:n,align:a,justify:i},{name:"Stack",unstyled:l,variant:c});return s.createElement(se,IZ({className:p(d.root,o),ref:t},u))});je.displayName="@mantine/core/Stack";var AZ=Object.defineProperty,MZ=Object.defineProperties,zZ=Object.getOwnPropertyDescriptors,VS=Object.getOwnPropertySymbols,LZ=Object.prototype.hasOwnProperty,FZ=Object.prototype.propertyIsEnumerable,BS=(e,t,r)=>t in e?AZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,og=(e,t)=>{for(var r in t||(t={}))LZ.call(t,r)&&BS(e,r,t[r]);if(VS)for(var r of VS(t))FZ.call(t,r)&&BS(e,r,t[r]);return e},VZ=(e,t)=>MZ(e,zZ(t));const RD={xs:P(34),sm:P(36),md:P(42),lg:P(48),xl:P(52)};var BZ=U((e,{color:t,iconSize:r,radius:n,allowStepClick:o,iconPosition:a,orientation:i},{size:l})=>{const c=r?P(r):M({size:l,sizes:RD}),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)`,g={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:og({display:"flex",flexDirection:a==="left"?"row":"row-reverse",cursor:o?"pointer":"default"},i==="vertical"?g.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:M({size:l,sizes:e.fontSizes}),"&[data-progress]":{borderColor:p.background},"&[data-completed]":{backgroundColor:p.background,borderColor:p.background,color:e.white}},stepCompletedIcon:VZ(og({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:e.white}),stepBody:og({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:M({size:l,sizes:e.fontSizes}),lineHeight:1},stepDescription:{textAlign:a,marginTop:`calc(${M({size:l,sizes:e.spacing})} / 3)`,marginBottom:`calc(${M({size:l,sizes:e.spacing})} / 3)`,fontSize:`calc(${M({size:l,sizes:e.fontSizes})} - ${P(2)})`,lineHeight:1}}});const UZ=BZ;var WZ=Object.defineProperty,Sp=Object.getOwnPropertySymbols,TD=Object.prototype.hasOwnProperty,ID=Object.prototype.propertyIsEnumerable,US=(e,t,r)=>t in e?WZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ag=(e,t)=>{for(var r in t||(t={}))TD.call(t,r)&&US(e,r,t[r]);if(Sp)for(var r of Sp(t))ID.call(t,r)&&US(e,r,t[r]);return e},HZ=(e,t)=>{var r={};for(var n in e)TD.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&&ID.call(e,n)&&(r[n]=e[n]);return r};const qZ={xs:16,sm:18,md:20,lg:22,xl:24},GZ={withIcon:!0,size:"md",radius:"xl",allowStepClick:!0,iconPosition:"left",__staticSelector:"Step"},Su=(e,t)=>typeof e=="function"?s.createElement(e,{step:t}):e,DD=f.forwardRef((e,t)=>{const r=H("StepperStep",GZ,e),{className:n,step:o,state:a,color:i,icon:l,completedIcon:c,progressIcon:u,label:d,description:p,withIcon:h,iconSize:g,size:v,radius:w,loading:E,allowStepClick:_,allowStepSelect:y,iconPosition:x,__staticSelector:b,classNames:S,styles:$,unstyled:O,orientation:C,variant:T}=r,j=HZ(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:k,cx:I}=UZ({color:i,iconSize:g,radius:w,allowStepClick:_,iconPosition:x,orientation:C},{name:b,classNames:S,styles:$,unstyled:O,variant:T,size:v}),z=M({size:v,sizes:qZ}),N=a==="stepCompleted"?null:a==="stepProgress"?u:l,F={"data-progress":a==="stepProgress"||void 0,"data-completed":a==="stepCompleted"||void 0};return s.createElement(ho,ag(ag({className:I(k.step,n),tabIndex:_?0:-1,ref:t},F),j),h&&s.createElement("div",{className:k.stepWrapper},s.createElement("div",ag({className:k.stepIcon},F),s.createElement(ii,{mounted:a==="stepCompleted",transition:"pop",duration:200},q=>s.createElement("div",{className:k.stepCompletedIcon,style:q},E?s.createElement(un,{color:"#fff",size:z,className:k.stepLoader}):Su(c,o)||s.createElement(XR,{indeterminate:!1,width:z,height:z}))),a!=="stepCompleted"?E?s.createElement(un,{size:z,color:i}):Su(N||l,o):null),C==="vertical"&&s.createElement("div",{className:I(k.verticalSeparator,{[k.verticalSeparatorActive]:a==="stepCompleted"})})),(d||p)&&s.createElement("div",{className:k.stepBody},d&&s.createElement(ae,{className:k.stepLabel},Su(d,o)),p&&s.createElement(ae,{className:k.stepDescription,color:"dimmed"},Su(p,o))))});DD.displayName="@mantine/core/Step";function Pp(e){return null}Pp.displayName="@mantine/core/StepCompleted";var QZ=Object.defineProperty,KZ=Object.defineProperties,YZ=Object.getOwnPropertyDescriptors,WS=Object.getOwnPropertySymbols,XZ=Object.prototype.hasOwnProperty,JZ=Object.prototype.propertyIsEnumerable,HS=(e,t,r)=>t in e?QZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Yl=(e,t)=>{for(var r in t||(t={}))XZ.call(t,r)&&HS(e,r,t[r]);if(WS)for(var r of WS(t))JZ.call(t,r)&&HS(e,r,t[r]);return e},ZZ=(e,t)=>KZ(e,YZ(t)),eee=U((e,{contentPadding:t,color:r,orientation:n,iconPosition:o,iconSize:a,breakpoint:i},{size:l})=>{const c=typeof i<"u",u=ln(M({size:i,sizes:e.breakpoints})),d=typeof a<"u"?`calc(${P(a)} / 2 - ${P(1)})`:`calc(${M({size:l,sizes:RD})} / 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: ${ir(u-1)})`]:p.steps},separator:{[`@media (max-width: ${ir(u-1)})`]:p.separator}};return{root:{},steps:Yl(Yl({display:"flex",boxSizing:"border-box",alignItems:"center"},n==="vertical"?p.steps:null),c?h.steps:null),separator:Yl(Yl({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:ZZ(Yl({},e.fn.fontStyles()),{paddingTop:M({size:t,sizes:e.spacing})})}});const tee=eee;var ree=Object.defineProperty,Op=Object.getOwnPropertySymbols,ND=Object.prototype.hasOwnProperty,AD=Object.prototype.propertyIsEnumerable,qS=(e,t,r)=>t in e?ree(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nee=(e,t)=>{for(var r in t||(t={}))ND.call(t,r)&&qS(e,r,t[r]);if(Op)for(var r of Op(t))AD.call(t,r)&&qS(e,r,t[r]);return e},oee=(e,t)=>{var r={};for(var n in e)ND.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&&AD.call(e,n)&&(r[n]=e[n]);return r};const aee={contentPadding:"md",size:"md",radius:"xl",orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0},qs=f.forwardRef((e,t)=>{var r,n,o;const a=H("Stepper",aee,e),{className:i,children:l,onStepClick:c,active:u,icon:d,completedIcon:p,progressIcon:h,color:g,iconSize:v,contentPadding:w,size:E,radius:_,orientation:y,breakpoint:x,iconPosition:b,allowNextStepsSelect:S,classNames:$,styles:O,unstyled:C,variant:T}=a,j=oee(a,["className","children","onStepClick","active","icon","completedIcon","progressIcon","color","iconSize","contentPadding","size","radius","orientation","breakpoint","iconPosition","allowNextStepsSelect","classNames","styles","unstyled","variant"]),{classes:k,cx:I}=tee({contentPadding:w,color:g,orientation:y,iconPosition:b,iconSize:v,breakpoint:x},{name:"Stepper",classNames:$,styles:O,unstyled:C,variant:T,size:E}),z=f.Children.toArray(l),N=z.filter(V=>V.type!==Pp),F=z.find(V=>V.type===Pp),q=N.reduce((V,G,ie)=>{const Oe=u===ie?"stepProgress":u>ie?"stepCompleted":"stepInactive",Ae=(()=>typeof c!="function"?!1:typeof G.props.allowStepSelect=="boolean"?G.props.allowStepSelect:Oe==="stepCompleted"||S)();return V.push(f.cloneElement(G,{__staticSelector:"Stepper",icon:G.props.icon||d||ie+1,key:ie,step:ie,variant:T,state:Oe,onClick:()=>Ae&&c(ie),allowStepClick:Ae,completedIcon:G.props.completedIcon||p,progressIcon:G.props.progressIcon||h,color:G.props.color||g,iconSize:v,size:E,radius:_,classNames:$,styles:O,iconPosition:G.props.iconPosition||b,orientation:y,unstyled:C})),y==="horizontal"&&ie!==N.length-1&&V.push(s.createElement("div",{className:I(k.separator,{[k.separatorActive]:ie<u}),key:`separator-${ie}`})),V},[]),ee=(n=(r=N[u])==null?void 0:r.props)==null?void 0:n.children,R=(o=F==null?void 0:F.props)==null?void 0:o.children,D=u>N.length-1?R:ee;return s.createElement(se,nee({className:I(k.root,i),ref:t},j),s.createElement("div",{className:k.steps},q),D&&s.createElement("div",{className:k.content},D))});qs.Step=DD;qs.Completed=Pp;qs.displayName="@mantine/core/Stepper";const MD=f.createContext(null),iee=MD.Provider,lee=()=>f.useContext(MD);var see=Object.defineProperty,$p=Object.getOwnPropertySymbols,zD=Object.prototype.hasOwnProperty,LD=Object.prototype.propertyIsEnumerable,GS=(e,t,r)=>t in e?see(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,QS=(e,t)=>{for(var r in t||(t={}))zD.call(t,r)&&GS(e,r,t[r]);if($p)for(var r of $p(t))LD.call(t,r)&&GS(e,r,t[r]);return e},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&&$p)for(var n of $p(e))t.indexOf(n)<0&&LD.call(e,n)&&(r[n]=e[n]);return r};const uee={size:"sm"},FD=f.forwardRef((e,t)=>{const r=H("SwitchGroup",uee,e),{children:n,value:o,defaultValue:a,onChange:i,size:l,wrapperProps:c}=r,u=cee(r,["children","value","defaultValue","onChange","size","wrapperProps"]),[d,p]=Sr({value:o,defaultValue:a,finalValue:[],onChange:i}),h=g=>{const v=g.currentTarget.value;p(d.includes(v)?d.filter(w=>w!==v):[...d,v])};return s.createElement(iee,{value:{value:d,onChange:h,size:l}},s.createElement(Ft.Wrapper,QS(QS({labelElement:"div",size:l,__staticSelector:"SwitchGroup",ref:t},c),u),n))});FD.displayName="@mantine/core/SwitchGroup";var dee=Object.defineProperty,fee=Object.defineProperties,pee=Object.getOwnPropertyDescriptors,KS=Object.getOwnPropertySymbols,mee=Object.prototype.hasOwnProperty,hee=Object.prototype.propertyIsEnumerable,YS=(e,t,r)=>t in e?dee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gee=(e,t)=>{for(var r in t||(t={}))mee.call(t,r)&&YS(e,r,t[r]);if(KS)for(var r of KS(t))hee.call(t,r)&&YS(e,r,t[r]);return e},vee=(e,t)=>fee(e,pee(t));const yee={xs:P(16),sm:P(20),md:P(24),lg:P(30),xl:P(36)},wee={xs:P(32),sm:P(38),md:P(46),lg:P(56),xl:P(72)},_ee={xs:P(12),sm:P(14),md:P(18),lg:P(22),xl:P(28)},bee={xs:P(5),sm:P(6),md:P(7),lg:P(9),xl:P(11)},xee={xs:P(4),sm:P(5),md:P(6),lg:P(8),xl:P(10)};var Eee=U((e,{radius:t,color:r,labelPosition:n,error:o},{size:a})=>{const i=M({size:a,sizes:_ee}),l=M({size:t,sizes:e.radius}),c=e.fn.variant({variant:"filled",color:r}),u=M({size:a,sizes:wee}),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:vee(gee({},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:M({size:a,sizes:yee}),minWidth:u,margin:0,transitionProperty:"background-color, border-color",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"150ms",boxSizing:"border-box",appearance:"none",display:"flex",alignItems:"center",fontSize:M({size:a,sizes:bee}),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:M({size:a,sizes:xee}),marginLeft:`calc(${i} + ${d})`,transition:`margin 150ms ${e.transitionTimingFunction}`,"input:checked + * > &":{marginLeft:0,marginRight:`calc(${i} + ${d})`}}}});const See=Eee;var Pee=Object.defineProperty,Oee=Object.defineProperties,$ee=Object.getOwnPropertyDescriptors,Cp=Object.getOwnPropertySymbols,VD=Object.prototype.hasOwnProperty,BD=Object.prototype.propertyIsEnumerable,XS=(e,t,r)=>t in e?Pee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ig=(e,t)=>{for(var r in t||(t={}))VD.call(t,r)&&XS(e,r,t[r]);if(Cp)for(var r of Cp(t))BD.call(t,r)&&XS(e,r,t[r]);return e},Cee=(e,t)=>Oee(e,$ee(t)),kee=(e,t)=>{var r={};for(var n in e)VD.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&&BD.call(e,n)&&(r[n]=e[n]);return r};const jee={offLabel:"",onLabel:"",size:"sm",radius:"xl",error:!1},T0=f.forwardRef((e,t)=>{var r;const n=H("Switch",jee,e),{className:o,color:a,label:i,offLabel:l,onLabel:c,id:u,style:d,size:p,radius:h,wrapperProps:g,children:v,unstyled:w,styles:E,classNames:_,thumbIcon:y,sx:x,checked:b,defaultChecked:S,onChange:$,labelPosition:O,description:C,error:T,disabled:j,variant:k}=n,I=kee(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"]),z=lee(),N=(z==null?void 0:z.size)||p,{classes:F,cx:q}=See({color:a,radius:h,labelPosition:O,error:!!T},{name:"Switch",classNames:_,styles:E,unstyled:w,size:N,variant:k}),{systemStyles:ee,rest:R}=Zn(I),D=$r(u),V=z?{checked:z.value.includes(R.value),onChange:z.onChange}:{},[G,ie]=Sr({value:(r=V.checked)!=null?r:b,defaultValue:S,finalValue:!1});return s.createElement(Mm,ig(ig({className:q(o,F.root),sx:x,style:d,id:D,size:(z==null?void 0:z.size)||p,labelPosition:O,label:i,description:C,error:T,disabled:j,__staticSelector:"Switch",classNames:_,styles:E,unstyled:w,"data-checked":V.checked||void 0,variant:k},ee),g),s.createElement("input",Cee(ig({},R),{disabled:j,checked:G,onChange:Oe=>{z?V.onChange(Oe):$==null||$(Oe),ie(Oe.currentTarget.checked)},id:D,ref:t,type:"checkbox",className:F.input})),s.createElement("label",{htmlFor:D,className:F.track},s.createElement("div",{className:F.thumb},y),s.createElement("div",{className:F.trackLabel},G?c:l)))});T0.displayName="@mantine/core/Switch";T0.Group=FD;var Ree=Object.defineProperty,Tee=Object.defineProperties,Iee=Object.getOwnPropertyDescriptors,JS=Object.getOwnPropertySymbols,Dee=Object.prototype.hasOwnProperty,Nee=Object.prototype.propertyIsEnumerable,ZS=(e,t,r)=>t in e?Ree(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Aee=(e,t)=>{for(var r in t||(t={}))Dee.call(t,r)&&ZS(e,r,t[r]);if(JS)for(var r of JS(t))Nee.call(t,r)&&ZS(e,r,t[r]);return e},Mee=(e,t)=>Tee(e,Iee(t)),zee=U((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:Mee(Aee({},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:M({size:o,sizes:e.fontSizes}),padding:`${M({size:n,sizes:e.spacing})} ${M({size:r,sizes:e.spacing})}`},"& > thead > tr > th":{borderBottom:l},"& > tfoot > tr > th, & > tbody > tr > th":{borderTop:l},"& > tbody > tr > td":{padding:`${M({size:n,sizes:e.spacing})} ${M({size:r,sizes:e.spacing})}`,borderTop:l,fontSize:M({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 Lee=zee;var Fee=Object.defineProperty,Vee=Object.defineProperties,Bee=Object.getOwnPropertyDescriptors,kp=Object.getOwnPropertySymbols,UD=Object.prototype.hasOwnProperty,WD=Object.prototype.propertyIsEnumerable,eP=(e,t,r)=>t in e?Fee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Uee=(e,t)=>{for(var r in t||(t={}))UD.call(t,r)&&eP(e,r,t[r]);if(kp)for(var r of kp(t))WD.call(t,r)&&eP(e,r,t[r]);return e},Wee=(e,t)=>Vee(e,Bee(t)),Hee=(e,t)=>{var r={};for(var n in e)UD.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&&WD.call(e,n)&&(r[n]=e[n]);return r};const qee={striped:!1,highlightOnHover:!1,captionSide:"top",horizontalSpacing:"xs",fontSize:"sm",verticalSpacing:7,withBorder:!1,withColumnBorders:!1},si=f.forwardRef((e,t)=>{const r=H("Table",qee,e),{className:n,children:o,striped:a,highlightOnHover:i,captionSide:l,horizontalSpacing:c,verticalSpacing:u,fontSize:d,unstyled:p,withBorder:h,withColumnBorders:g,variant:v}=r,w=Hee(r,["className","children","striped","highlightOnHover","captionSide","horizontalSpacing","verticalSpacing","fontSize","unstyled","withBorder","withColumnBorders","variant"]),{classes:E,cx:_}=Lee({captionSide:l,verticalSpacing:u,horizontalSpacing:c,fontSize:d,withBorder:h,withColumnBorders:g},{unstyled:p,name:"Table",variant:v});return s.createElement(se,Wee(Uee({},w),{component:"table",ref:t,className:_(E.root,n),"data-striped":a||void 0,"data-hover":i||void 0}),o)});si.displayName="@mantine/core/Table";const $v={context:"Tabs component was not found in the tree",value:"Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value"},[Gee,I0]=Po($v.context);var Qee=Object.defineProperty,tP=Object.getOwnPropertySymbols,Kee=Object.prototype.hasOwnProperty,Yee=Object.prototype.propertyIsEnumerable,rP=(e,t,r)=>t in e?Qee(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xee=(e,t)=>{for(var r in t||(t={}))Kee.call(t,r)&&rP(e,r,t[r]);if(tP)for(var r of tP(t))Yee.call(t,r)&&rP(e,r,t[r]);return e};function Jee({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 Zee=U((e,t,{variant:r})=>{const n=t.orientation==="vertical";return{tabsList:Xee({display:"flex",flexWrap:"wrap",flexDirection:n?"column":"row",justifyContent:LT[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},Jee(t,e,r))}});const ete=Zee;var tte=Object.defineProperty,rte=Object.defineProperties,nte=Object.getOwnPropertyDescriptors,jp=Object.getOwnPropertySymbols,HD=Object.prototype.hasOwnProperty,qD=Object.prototype.propertyIsEnumerable,nP=(e,t,r)=>t in e?tte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ote=(e,t)=>{for(var r in t||(t={}))HD.call(t,r)&&nP(e,r,t[r]);if(jp)for(var r of jp(t))qD.call(t,r)&&nP(e,r,t[r]);return e},ate=(e,t)=>rte(e,nte(t)),ite=(e,t)=>{var r={};for(var n in e)HD.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 lte={grow:!1,position:"left"},GD=f.forwardRef((e,t)=>{const r=H("TabsList",lte,e),{children:n,className:o,grow:a,position:i}=r,l=ite(r,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:p,inverted:h,placement:g,classNames:v,styles:w,unstyled:E}=I0(),{classes:_,cx:y}=ete({orientation:c,grow:a,color:d,position:i,radius:p,inverted:h,placement:g},{name:"Tabs",unstyled:E,classNames:v,styles:w,variant:u});return s.createElement(se,ate(ote({},l),{className:y(_.tabsList,o),ref:t,role:"tablist","aria-orientation":c}),n)});GD.displayName="@mantine/core/TabsList";var ste=U((e,{orientation:t})=>({panel:{flex:t==="vertical"?1:void 0}}));const cte=ste;var ute=Object.defineProperty,dte=Object.defineProperties,fte=Object.getOwnPropertyDescriptors,Rp=Object.getOwnPropertySymbols,QD=Object.prototype.hasOwnProperty,KD=Object.prototype.propertyIsEnumerable,oP=(e,t,r)=>t in e?ute(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pte=(e,t)=>{for(var r in t||(t={}))QD.call(t,r)&&oP(e,r,t[r]);if(Rp)for(var r of Rp(t))KD.call(t,r)&&oP(e,r,t[r]);return e},mte=(e,t)=>dte(e,fte(t)),hte=(e,t)=>{var r={};for(var n in e)QD.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&&KD.call(e,n)&&(r[n]=e[n]);return r};const gte={},YD=f.forwardRef((e,t)=>{const r=H("TabsPanel",gte,e),{value:n,children:o,sx:a,className:i}=r,l=hte(r,["value","children","sx","className"]),c=I0(),{classes:u,cx:d}=cte({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,g=c.keepMounted||h?o:null;return f.useEffect(()=>(c.setMountedPanelIds(v=>[...v,p]),c.setMountedPanelIds(v=>v.filter(w=>w!==p))),[p]),s.createElement(se,mte(pte({},l),{ref:t,sx:[{display:h?void 0:"none"},...em(a)],className:d(u.panel,i),role:"tabpanel",id:p,"aria-labelledby":c.getTabId(n)}),g)});YD.displayName="@mantine/core/TabsPanel";var vte=Object.defineProperty,yte=Object.defineProperties,wte=Object.getOwnPropertyDescriptors,aP=Object.getOwnPropertySymbols,_te=Object.prototype.hasOwnProperty,bte=Object.prototype.propertyIsEnumerable,iP=(e,t,r)=>t in e?vte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Fi=(e,t)=>{for(var r in t||(t={}))_te.call(t,r)&&iP(e,r,t[r]);if(aP)for(var r of aP(t))bte.call(t,r)&&iP(e,r,t[r]);return e},lP=(e,t)=>yte(e,wte(t));function xte(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"?lP(Fi({[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]":Fi({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"?lP(Fi({borderRadius:e.fn.radius(n)},e.fn.hover({backgroundColor:e.colorScheme==="dark"?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":Fi({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var Ete=U((e,t,{variant:r})=>({tabLabel:{},tab:Fi({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":Fi({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},xte(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 Ste=Ete;var Pte=Object.defineProperty,Ote=Object.defineProperties,$te=Object.getOwnPropertyDescriptors,Tp=Object.getOwnPropertySymbols,XD=Object.prototype.hasOwnProperty,JD=Object.prototype.propertyIsEnumerable,sP=(e,t,r)=>t in e?Pte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Cte=(e,t)=>{for(var r in t||(t={}))XD.call(t,r)&&sP(e,r,t[r]);if(Tp)for(var r of Tp(t))JD.call(t,r)&&sP(e,r,t[r]);return e},kte=(e,t)=>Ote(e,$te(t)),jte=(e,t)=>{var r={};for(var n in e)XD.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&&JD.call(e,n)&&(r[n]=e[n]);return r};const Rte={},ZD=f.forwardRef((e,t)=>{const r=H("TabsTab",Rte,e),{value:n,children:o,onKeyDown:a,onClick:i,className:l,icon:c,rightSection:u,color:d}=r,p=jte(r,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),h=I0(),g=!!c,v=!!u,{theme:w,classes:E,cx:_}=Ste({withIcon:g||v&&!o,withRightSection:v||g&&!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}),y=n===h.value,x=h.getPanelId(n),b=h.mountedPanelIds.includes(n)?x:void 0,S=$=>{h.onTabChange(h.allowTabDeactivation&&n===h.value?null:n),i==null||i($)};return s.createElement(ho,kte(Cte({},p),{unstyled:h.unstyled,className:_(E.tab,l),"data-active":y||void 0,ref:t,type:"button",role:"tab",id:h.getTabId(n),"aria-selected":y,tabIndex:y||h.value===null?0:-1,"aria-controls":b,onClick:S,onKeyDown:h$({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:h.activateTabWithKeyboard,loop:h.loop,dir:w.dir,orientation:h.orientation,onKeyDown:a})}),c&&s.createElement("span",{className:E.tabIcon},c),o&&s.createElement("span",{className:E.tabLabel},o),u&&s.createElement("span",{className:E.tabRightSection},u))});ZD.displayName="@mantine/core/Tab";function e5({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:g,keepMounted:v=!0,classNames:w,styles:E,unstyled:_}){const y=$r(i),[x,b]=f.useState([]),[S,$]=Sr({value:t,defaultValue:e,finalValue:null,onChange:r});return s.createElement(Gee,{value:{placement:g,value:S,orientation:n,id:y,loop:a,activateTabWithKeyboard:l,getTabId:M1(`${y}-tab`,$v.value),getPanelId:M1(`${y}-panel`,$v.value),onTabChange:$,setMountedPanelIds:b,mountedPanelIds:x,allowTabDeactivation:c,variant:u,color:d,radius:p,inverted:h,keepMounted:v,classNames:w,styles:E,unstyled:_}},o)}e5.displayName="@mantine/core/TabsProvider";var Tte=U((e,{orientation:t,placement:r})=>({root:{display:t==="vertical"?"flex":void 0,flexDirection:r==="right"?"row-reverse":"row"}}));const Ite=Tte;var Dte=Object.defineProperty,Nte=Object.defineProperties,Ate=Object.getOwnPropertyDescriptors,Ip=Object.getOwnPropertySymbols,t5=Object.prototype.hasOwnProperty,r5=Object.prototype.propertyIsEnumerable,cP=(e,t,r)=>t in e?Dte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mte=(e,t)=>{for(var r in t||(t={}))t5.call(t,r)&&cP(e,r,t[r]);if(Ip)for(var r of Ip(t))r5.call(t,r)&&cP(e,r,t[r]);return e},zte=(e,t)=>Nte(e,Ate(t)),Lte=(e,t)=>{var r={};for(var n in e)t5.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&&r5.call(e,n)&&(r[n]=e[n]);return r};const Fte={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},Ke=f.forwardRef((e,t)=>{const r=H("Tabs",Fte,e),{defaultValue:n,value:o,orientation:a,loop:i,activateTabWithKeyboard:l,allowTabDeactivation:c,children:u,id:d,onTabChange:p,variant:h,color:g,className:v,unstyled:w,classNames:E,styles:_,radius:y,inverted:x,keepMounted:b,placement:S}=r,$=Lte(r,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:O,cx:C}=Ite({orientation:a,color:g,radius:y,inverted:x,placement:S},{unstyled:w,name:"Tabs",classNames:E,styles:_,variant:h});return s.createElement(e5,{activateTabWithKeyboard:l,defaultValue:n,orientation:a,onTabChange:p,value:o,id:d,loop:i,allowTabDeactivation:c,color:g,variant:h,radius:y,inverted:x,keepMounted:b,placement:S,classNames:E,styles:_,unstyled:w},s.createElement(se,zte(Mte({},$),{className:C(O.root,v),id:d,ref:t}),u))});Ke.List=GD;Ke.Tab=ZD;Ke.Panel=YD;Ke.displayName="@mantine/core/Tabs";var Vte=Object.defineProperty,Bte=Object.defineProperties,Ute=Object.getOwnPropertyDescriptors,uP=Object.getOwnPropertySymbols,Wte=Object.prototype.hasOwnProperty,Hte=Object.prototype.propertyIsEnumerable,dP=(e,t,r)=>t in e?Vte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,qte=(e,t)=>{for(var r in t||(t={}))Wte.call(t,r)&&dP(e,r,t[r]);if(uP)for(var r of uP(t))Hte.call(t,r)&&dP(e,r,t[r]);return e},Gte=(e,t)=>Bte(e,Ute(t));function Qte(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 Kte(e,t,r){return typeof e<"u"&&e in r.headings.sizes?r.headings.sizes[e].lineHeight:r.headings.sizes[t].lineHeight}var Yte=U((e,{element:t,weight:r,inline:n},{size:o})=>({root:Gte(qte({},e.fn.fontStyles()),{fontFamily:e.headings.fontFamily,fontWeight:r||e.headings.sizes[t].fontWeight||e.headings.fontWeight,fontSize:Qte(o,t,e),lineHeight:n?1:Kte(o,t,e),margin:0})}));const Xte=Yte;var Jte=Object.defineProperty,Dp=Object.getOwnPropertySymbols,n5=Object.prototype.hasOwnProperty,o5=Object.prototype.propertyIsEnumerable,fP=(e,t,r)=>t in e?Jte(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zte=(e,t)=>{for(var r in t||(t={}))n5.call(t,r)&&fP(e,r,t[r]);if(Dp)for(var r of Dp(t))o5.call(t,r)&&fP(e,r,t[r]);return e},ere=(e,t)=>{var r={};for(var n in e)n5.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&&o5.call(e,n)&&(r[n]=e[n]);return r};const tre={order:1},fe=f.forwardRef((e,t)=>{const r=H("Title",tre,e),{className:n,order:o,children:a,unstyled:i,size:l,weight:c,inline:u,variant:d}=r,p=ere(r,["className","order","children","unstyled","size","weight","inline","variant"]),{classes:h,cx:g}=Xte({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(ae,Zte({variant:d,component:`h${o}`,ref:t,className:g(h.root,n)},p),a):null});fe.displayName="@mantine/core/Title";function Cv(e,t){return Cv=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,o){return n.__proto__=o,n},Cv(e,t)}function a5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Cv(e,t)}var i5={exports:{}},rre="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",nre=rre,ore=nre;function l5(){}function s5(){}s5.resetWarningCache=l5;var are=function(){function e(n,o,a,i,l,c){if(c!==ore){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:s5,resetWarningCache:l5};return r.PropTypes=r,r};i5.exports=are();var ire=i5.exports;const Pe=Zv(ire),pP={disabled:!1},Np=s.createContext(null);var cs="unmounted",ka="exited",ja="entering",Oi="entered",kv="exiting",jo=function(e){a5(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=ja):c=Oi:n.unmountOnExit||n.mountOnEnter?c=cs:c=ka,a.state={status:c},a.nextCallback=null,a}t.getDerivedStateFromProps=function(o,a){var i=o.in;return i&&a.status===cs?{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!==ja&&i!==Oi&&(a=ja):(i===ja||i===Oi)&&(a=kv)}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===ja?this.performEnter(o):this.performExit()):this.props.unmountOnExit&&this.state.status===ka&&this.setState({status:cs})},r.performEnter=function(o){var a=this,i=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[Fh.findDOMNode(this),l],u=c[0],d=c[1],p=this.getTimeouts(),h=l?p.appear:p.enter;if(!o&&!i||pP.disabled){this.safeSetState({status:Oi},function(){a.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ja},function(){a.props.onEntering(u,d),a.onTransitionEnd(h,function(){a.safeSetState({status:Oi},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:Fh.findDOMNode(this);if(!a||pP.disabled){this.safeSetState({status:ka},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:kv},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:Fh.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===cs)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=C0(a,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return s.createElement(Np.Provider,{value:null},typeof i=="function"?i(o,l):s.cloneElement(s.Children.only(i),l))},t}(s.Component);jo.contextType=Np;jo.propTypes={};function xi(){}jo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:xi,onEntering:xi,onEntered:xi,onExit:xi,onExiting:xi,onExited:xi};jo.UNMOUNTED=cs;jo.EXITED=ka;jo.ENTERING=ja;jo.ENTERED=Oi;jo.EXITING=kv;const lre=jo;function sre(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function D0(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 cre(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 Aa(e,t,r){return r[t]!=null?r[t]:e.props[t]}function ure(e,t){return D0(e.children,function(r){return f.cloneElement(r,{onExited:t.bind(null,r),in:!0,appear:Aa(r,"appear",e),enter:Aa(r,"enter",e),exit:Aa(r,"exit",e)})})}function dre(e,t,r){var n=D0(e.children),o=cre(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:Aa(i,"exit",e),enter:Aa(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:Aa(i,"exit",e),enter:Aa(i,"enter",e)}))}}),o}var fre=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},pre={component:"div",childFactory:function(t){return t}},N0=function(e){a5(t,e);function t(n,o){var a;a=e.call(this,n,o)||this;var i=a.handleExited.bind(sre(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?ure(o,l):dre(o,i,l),firstRender:!1}},r.handleExited=function(o,a){var i=D0(this.props.children);o.key in i||(o.props.onExited&&o.props.onExited(a),this.mounted&&this.setState(function(l){var c=Je({},l.children);return delete c[o.key],{children:c}}))},r.render=function(){var o=this.props,a=o.component,i=o.childFactory,l=C0(o,["component","childFactory"]),c=this.state.contextValue,u=fre(this.state.children).map(i);return delete l.appear,delete l.enter,delete l.exit,a===null?s.createElement(Np.Provider,{value:c},u):s.createElement(Np.Provider,{value:c},s.createElement(a,l,u))},t}(s.Component);N0.propTypes={};N0.defaultProps=pre;const mre=N0,[hre,hc]=U4("mantine-notifications"),de=hc("show"),gre=hc("hide"),vre=hc("clean"),yre=hc("cleanQueue"),Ju=hc("update"),mo={show:de,hide:gre,clean:vre,cleanQueue:yre,update:Ju};function wre([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 _re=Object.defineProperty,mP=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,xre=Object.prototype.propertyIsEnumerable,hP=(e,t,r)=>t in e?_re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gP=(e,t)=>{for(var r in t||(t={}))bre.call(t,r)&&hP(e,r,t[r]);if(mP)for(var r of mP(t))xre.call(t,r)&&hP(e,r,t[r]);return e};const vP={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},Ere={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function Sre({state:e,maxHeight:t,positioning:r,transitionDuration:n}){const[o,a]=r,i=a==="center"?`${o}-center`:a,l={opacity:0,maxHeight:t,transform:vP[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:Ere[i]},u={opacity:0,maxHeight:0,transform:vP[i]},d={entering:c,entered:c,exiting:u,exited:u};return gP(gP({},l),d[e])}function Pre(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}var Ore=Object.defineProperty,$re=Object.defineProperties,Cre=Object.getOwnPropertyDescriptors,Ap=Object.getOwnPropertySymbols,c5=Object.prototype.hasOwnProperty,u5=Object.prototype.propertyIsEnumerable,yP=(e,t,r)=>t in e?Ore(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wP=(e,t)=>{for(var r in t||(t={}))c5.call(t,r)&&yP(e,r,t[r]);if(Ap)for(var r of Ap(t))u5.call(t,r)&&yP(e,r,t[r]);return e},kre=(e,t)=>$re(e,Cre(t)),_P=(e,t)=>{var r={};for(var n in e)c5.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&&u5.call(e,n)&&(r[n]=e[n]);return r};function d5(e){var t=e,{notification:r,autoClose:n,onHide:o,innerRef:a}=t,i=_P(t,["notification","autoClose","onHide","innerRef"]);const l=r,{autoClose:c,message:u}=l,d=_P(l,["autoClose","message"]),p=Pre(n,c),h=f.useRef(),g=()=>{o(r.id),window.clearTimeout(h.current)},v=()=>{clearTimeout(h.current)},w=()=>{typeof p=="number"&&(h.current=window.setTimeout(g,p))};return f.useEffect(()=>{typeof r.onOpen=="function"&&r.onOpen(r)},[]),f.useEffect(()=>(w(),v),[n,r.autoClose]),s.createElement(UI,kre(wP(wP({},d),i),{onClose:g,onMouseEnter:v,onMouseLeave:w,ref:a}),u)}d5.displayName="@mantine/notifications/NotificationContainer";var jre=U((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 Rre=jre;var Tre=Object.defineProperty,Ire=Object.defineProperties,Dre=Object.getOwnPropertyDescriptors,bP=Object.getOwnPropertySymbols,Nre=Object.prototype.hasOwnProperty,Are=Object.prototype.propertyIsEnumerable,xP=(e,t,r)=>t in e?Tre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mre=(e,t)=>{for(var r in t||(t={}))Nre.call(t,r)&&xP(e,r,t[r]);if(bP)for(var r of bP(t))Are.call(t,r)&&xP(e,r,t[r]);return e},zre=(e,t)=>Ire(e,Dre(t));function Lre({limit:e}){const{state:t,queue:r,update:n,cleanQueue:o}=S6({initialValues:[],limit:e});return{notifications:t,queue:r,showNotification:u=>{const d=u.id||mm();return n(p=>u.id&&p.some(h=>h.id===u.id)?p:[...p,zre(Mre({},u),{id:d})]),d},updateNotification:u=>n(d=>{const p=d.findIndex(g=>g.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 Fre=Object.defineProperty,Mp=Object.getOwnPropertySymbols,f5=Object.prototype.hasOwnProperty,p5=Object.prototype.propertyIsEnumerable,EP=(e,t,r)=>t in e?Fre(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lg=(e,t)=>{for(var r in t||(t={}))f5.call(t,r)&&EP(e,r,t[r]);if(Mp)for(var r of Mp(t))p5.call(t,r)&&EP(e,r,t[r]);return e},Vre=(e,t)=>{var r={};for(var n in e)f5.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&&p5.call(e,n)&&(r[n]=e[n]);return r};const Bre=["top-left","top-right","top-center","bottom-left","bottom-right","bottom-center"],ci=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=jn("overlay"),style:d,children:p,target:h}=t,g=Vre(t,["className","position","autoClose","transitionDuration","containerWidth","notificationMaxHeight","limit","zIndex","style","children","target"]);const v=w6(),w=f.useRef({}),E=f.useRef(0),{notifications:_,showNotification:y,updateNotification:x,hideNotification:b,clean:S,cleanQueue:$}=Lre({limit:c}),{classes:O,cx:C,theme:T}=Rre({zIndex:u}),j=hm(),I=(T.respectReducedMotion?j:!1)?1:a,z=(Bre.includes(n)?n:"bottom-right").split("-");nn(()=>{_.length>E.current&&setTimeout(()=>v(),0),E.current=_.length},[_]),hre({show:y,hide:b,update:x,clean:S,cleanQueue:$});const N=_.map(F=>s.createElement(lre,{key:F.id,timeout:I,onEnter:()=>w.current[F.id].offsetHeight,nodeRef:{current:w.current[F.id]}},q=>s.createElement(d5,{innerRef:ee=>{w.current[F.id]=ee},notification:F,onHide:b,className:O.notification,autoClose:o,sx:[lg({},Sre({state:q,positioning:z,transitionDuration:I,maxHeight:l})),...Array.isArray(F.sx)?F.sx:[F.sx]]})));return s.createElement(o0,{target:h},s.createElement(se,lg({className:C(O.notifications,r),style:d,sx:lg({maxWidth:i},wre(z,T.spacing.md))},g),s.createElement(mre,null,N)))};ci.displayName="@mantine/notifications/Notifications";ci.show=mo.show;ci.hide=mo.hide;ci.update=mo.update;ci.clean=mo.clean;ci.cleanQueue=mo.cleanQueue;var Ure="ok",Wre="created",Hre="gone",qre="not-modified",Gre="not-found",Qre="forbidden",Kre="accepted",Yre={resourceType:"OperationOutcome",id:Gre,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Xre={resourceType:"OperationOutcome",id:Qre,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 Um(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function m5(e){return e.id===Ure||e.id===Wre||e.id===qre||e.id===Kre}function Jre(e){return e.id===Hre}var Bn=class extends Error{constructor(e,t){super(h5(e)),this.outcome=e,this.cause=t}};function _t(e){return e instanceof Bn?e.outcome:Um(e)?e:Ba(Ce(e))}function Ce(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Um(e)?h5(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function h5(e){var r;let t=((r=e.issue)==null?void 0:r.map(Zre))??[];return t.length>0?t.join("; "):"Unknown error"}function Zre(e){var r,n;let t=((r=e.details)==null?void 0:r.text)??e.diagnostics??"Unknown error";return(n=e.expression)!=null&&n.length&&(t+=` (${e.expression.join(", ")})`),t}var ene={types:{Element:{display:"Element",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]}}},BackboneElement:{display:"BackboneElement",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]}}},Address:{display:"Address",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:"*",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:{display:"Age",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Annotation:{display:"Annotation",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"Attachment",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"CodeableConcept",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},coding:{max:"*",type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},Coding:{display:"Coding",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},ContactDetail:{display:"ContactDetail",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:"*",type:[{code:"ContactPoint"}]}}},ContactPoint:{display:"ContactPoint",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},Contributor:{display:"Contributor",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:"*",type:[{code:"ContactDetail"}]}}},Count:{display:"Count",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},DataRequirement:{display:"DataRequirement",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:"*",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:"*",type:[{code:"string"}]},codeFilter:{max:"*",type:[{code:"Element"}]},dateFilter:{max:"*",type:[{code:"Element"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:"*",type:[{code:"Element"}]}}},DataRequirementCodeFilter:{display:"DataRequirementCodeFilter",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:"*",type:[{code:"Coding"}]}}},DataRequirementDateFilter:{display:"DataRequirementDateFilter",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},DataRequirementSort:{display:"DataRequirementSort",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},Distance:{display:"Distance",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},Dosage:{display:"Dosage",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:"*",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:"*",type:[{code:"Element"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},maxDosePerLifetime:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},DosageDoseAndRate:{display:"DosageDoseAndRate",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Duration:{display:"Duration",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},ElementDefinition:{display:"ElementDefinition",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:"*",type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:"*",type:[{code:"Coding"}]},slicing:{type:[{code:"Element"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:"*",type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"Element"}]},contentReference:{type:[{code:"uri"}]},type:{max:"*",type:[{code:"Element"}]},"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:"*",type:[{code:"Element"}]},"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:"*",type:[{code:"id"}]},constraint:{max:"*",type:[{code:"Element"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"Element"}]},mapping:{max:"*",type:[{code:"Element"}]}}},ElementDefinitionSlicing:{display:"ElementDefinitionSlicing",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},discriminator:{max:"*",type:[{code:"Element"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},ElementDefinitionSlicingDiscriminator:{display:"ElementDefinitionSlicingDiscriminator",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},ElementDefinitionBase:{display:"ElementDefinitionBase",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},ElementDefinitionType:{display:"ElementDefinitionType",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:"*",type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:"*",type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:"*",type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},ElementDefinitionExample:{display:"ElementDefinitionExample",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},ElementDefinitionConstraint:{display:"ElementDefinitionConstraint",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},ElementDefinitionBinding:{display:"ElementDefinitionBinding",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},ElementDefinitionMapping:{display:"ElementDefinitionMapping",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},Expression:{display:"Expression",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"Extension",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"HumanName",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:"*",type:[{code:"string"}]},prefix:{max:"*",type:[{code:"string"}]},suffix:{max:"*",type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},Identifier:{display:"Identifier",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"MarketingStatus",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",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:{display:"Meta",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:"*",type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:"*",type:[{code:"Coding"}]},tag:{max:"*",type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},compartment:{max:"*",type:[{code:"Reference"}]}}},Money:{display:"Money",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},Narrative:{display:"Narrative",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},ParameterDefinition:{display:"ParameterDefinition",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"Period",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},Population:{display:"Population",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},ProdCharacteristic:{display:"ProdCharacteristic",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",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:"*",type:[{code:"string"}]},imprint:{max:"*",type:[{code:"string"}]},image:{max:"*",type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},ProductShelfLife:{display:"ProductShelfLife",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:"*",type:[{code:"CodeableConcept"}]}}},Quantity:{display:"Quantity",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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"}]}}},Range:{display:"Range",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Ratio:{display:"Ratio",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},Reference:{display:"Reference",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},RelatedArtifact:{display:"RelatedArtifact",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:{display:"SampledData",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},Signature:{display:"Signature",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},type:{min:1,max:"*",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:{display:"SubstanceAmount",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"Element"}]}}},SubstanceAmountReferenceRange:{display:"SubstanceAmountReferenceRange",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},Timing:{display:"Timing",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",type:[{code:"Extension"}]},event:{max:"*",type:[{code:"dateTime"}]},repeat:{type:[{code:"Element"}]},code:{type:[{code:"CodeableConcept"}]}}},TimingRepeat:{display:"TimingRepeat",properties:{id:{type:[{code:"string"}]},extension:{max:"*",type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:"*",type:[{code:"code"}]},timeOfDay:{max:"*",type:[{code:"time"}]},when:{max:"*",type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},TriggerDefinition:{display:"TriggerDefinition",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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:"*",type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},UsageContext:{display:"UsageContext",properties:{id:{type:[{code:"string"}]},extension:{max:"*",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"]}]}}},MetadataResource:{display:"MetadataResource",properties:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:"*",type:[{code:"Resource"}]},extension:{max:"*",type:[{code:"Extension"}]},modifierExtension:{max:"*",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:"*",type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:"*",type:[{code:"UsageContext"}]},jurisdiction:{max:"*",type:[{code:"CodeableConcept"}]}}},IdentityProvider:{display:"IdentityProvider",properties:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},useSubject:{type:[{code:"boolean"}]}}}}};function tne(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 gc(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.join(" ").trim()}function Wm(e){return e instanceof Date&&!isNaN(e.getTime())}function rne(e,t,r){if(!e)return"";let n=new Date("2000-01-01T"+e+"Z");return Wm(n)?n.toLocaleTimeString(t,r):""}function Pr(e,t,r){if(!e)return"";let n=new Date(e);return Wm(n)?n.toLocaleString(t,r):""}function nne(e,t,r){return!e||!e.start&&!e.end?"":Pr(e.start,t,r)+" - "+Pr(e.end,t,r)}var one={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},ane={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},ine={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function g5(e){if(!e)return"";let t=[];return lne(t,e.repeat),e.event&&t.push(e.event.map(r=>Pr(r)).join(", ")),cr(t.join(" ").trim())}function lne(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(one[o]):(r===1?e.push("once"):e.push(r+" times"),n===1?e.push("per "+ane[o]):e.push("per "+n+" "+ine[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(cr).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(a=>rne(a)).join(", "))}function Gs(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=une(n.value,t),`> ${Bo(n,t)}`):`>= ${Bo(n,t)}`:(n==null?void 0:n.value)===void 0&&(o==null?void 0:o.value)!==void 0?r&&t!==void 0?(o.value=cne(o.value,t),`< ${Bo(o,t)}`):`<= ${Bo(o,t)}`:((n==null?void 0:n.unit)===(o==null?void 0:o.unit)&&(n==null||delete n.unit),`${Bo(n,t)} - ${Bo(o,t)}`)}function Bo(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 sne(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function A0(e){return e?e.text?e.text:e.coding?e.coding.map(t=>M0(t)).join(", "):"":""}function M0(e){return(e==null?void 0:e.display)??(e==null?void 0:e.code)??""}function v5(e){return e?"component"in e?e.component.map(t=>v5(t)).join(" / "):e.valueQuantity?Bo(e.valueQuantity):e.valueCodeableConcept?A0(e.valueCodeableConcept):e.valueString?e.valueString:"":""}function cne(e,t,r=1){return(y5(e,t)+r)*Math.pow(10,-t)}function une(e,t,r=1){return(y5(e,t)-r)*Math.pow(10,-t)}function y5(e,t){return t===void 0?e:Math.round(e*Math.pow(10,t))}function ut(e){let t=ct(e),r=xo(e);return r===t?{reference:t}:{reference:t,display:r}}function ct(e){return e.resourceType+"/"+e.id}function w5(e){var t;return(t=e==null?void 0:e.reference)==null?void 0:t.split("/")[1]}function dne(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function xo(e){var t;if(dne(e)){let r=fne(e);if(r)return r}if(e.resourceType==="Device"){let r=pne(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:ct(e)}function fne(e){let t=e.name;if(t&&t.length>0)return gc(t[0])}function pne(e){let t=e.deviceName;if(t&&t.length>0)return t[0].name}function mne(e){if(!("photo"in e))return;let t=e.photo;if(t)if(Array.isArray(t))for(let r of t){let n=SP(r);if(n)return n}else return SP(t)}function SP(e){if(e.url&&e.contentType&&e.contentType.startsWith("image/"))return e.url}function _5(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 hne(e,t){let{years:r,months:n,days:o}=_5(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 gne(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 Or(e,t){return JSON.stringify(e,vne,t?2:void 0)}function vne(e,t){return!yne(e)&&Ma(t)?void 0:t}function yne(e){return!!/\d+$/.exec(e)}function Ma(e){if(e==null)return!0;let t=typeof e;return t==="string"&&e===""||t==="object"&&Object.keys(e).length===0}function z0(e,t,r){return e===t||Ma(e)&&Ma(t)?!0:Ma(e)||Ma(t)?!1:Array.isArray(e)&&Array.isArray(t)?wne(e,t):Array.isArray(e)||Array.isArray(t)?!1:PP(e)&&PP(t)?_ne(e,t,r):!1}function wne(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!z0(e[r],t[r]))return!1;return!0}function _ne(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(!z0(a,i,o))return!1}return!0}function $l(e){return JSON.parse(JSON.stringify(e))}function b5(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function PP(e){return e!==null&&typeof e=="object"}var x5=[];for(let e=0;e<256;e++)x5.push(e.toString(16).padStart(2,"0"));function bne(e){let t=new Uint8Array(e),r=new Array(t.length);for(let n=0;n<t.length;n++)r[n]=x5[t[n]];return r.join("")}function xne(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 cr(e){return e.charAt(0).toUpperCase()+e.substring(1)}function Ene(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 OP=e=>new Promise(t=>{setTimeout(t,e)}),X=(e=>(e.Address="Address",e.Age="Age",e.Annotation="Annotation",e.Attachment="Attachment",e.BackboneElement="BackboneElement",e.CodeableConcept="CodeableConcept",e.Coding="Coding",e.ContactDetail="ContactDetail",e.ContactPoint="ContactPoint",e.Contributor="Contributor",e.Count="Count",e.DataRequirement="DataRequirement",e.Distance="Distance",e.Dosage="Dosage",e.Duration="Duration",e.Expression="Expression",e.Extension="Extension",e.HumanName="HumanName",e.Identifier="Identifier",e.MarketingStatus="MarketingStatus",e.Meta="Meta",e.Money="Money",e.Narrative="Narrative",e.ParameterDefinition="ParameterDefinition",e.Period="Period",e.Population="Population",e.ProdCharacteristic="ProdCharacteristic",e.ProductShelfLife="ProductShelfLife",e.Quantity="Quantity",e.Range="Range",e.Ratio="Ratio",e.Reference="Reference",e.RelatedArtifact="RelatedArtifact",e.SampledData="SampledData",e.Signature="Signature",e.SubstanceAmount="SubstanceAmount",e.SystemString="http://hl7.org/fhirpath/System.String",e.Timing="Timing",e.TriggerDefinition="TriggerDefinition",e.UsageContext="UsageContext",e.base64Binary="base64Binary",e.boolean="boolean",e.canonical="canonical",e.code="code",e.date="date",e.dateTime="dateTime",e.decimal="decimal",e.id="id",e.instant="instant",e.integer="integer",e.markdown="markdown",e.oid="oid",e.positiveInt="positiveInt",e.string="string",e.time="time",e.unsignedInt="unsignedInt",e.uri="uri",e.url="url",e.uuid="uuid",e))(X||{});function Sne(e){var r;if(!e.name)return;let t=(r=e.snapshot)==null?void 0:r.element;if(t){for(let n of t)Pne(e,n);for(let n of t)One(e,n)}}function Pne(e,t){var l,c;let r=t.path,n=(c=(l=t.type)==null?void 0:l[0])==null?void 0:c.code;if(n!==void 0&&n!=="Element"&&n!=="BackboneElement")return;let o=r.split(".");o[0]=e.name;let a=Ya(o),i=Ot.types[a];i||(Ot.types[a]=i={}),i.parentType=i.parentType??Ya(o.slice(0,o.length-1)),i.display=i.display??a,i.structureDefinition=i.structureDefinition??e,i.elementDefinition=i.elementDefinition??t,i.description=i.description??t.definition,i.properties=i.properties??{}}function One(e,t){let r=t.path.split(".");if(r.length===1)return;r[0]=e.name;let n=Ya(r.slice(0,r.length-1)),o=Ot.types[n];if(!o)return;let a=r[r.length-1];o.properties[a]=t}function $ne(e){for(let t of e.base??[]){let r=Ot.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 E5(e){var r,n,o;let t=(n=(r=e.type)==null?void 0:r[0])==null?void 0:n.code;return t==="BackboneElement"||t==="Element"?Ya((o=e.path)==null?void 0:o.split(".")):t}function Ya(e){return e.length===1?e[0]:e.map(cr).join("")}function zp(e){return e.replaceAll("[x]","").split(".").pop().split(/(?=[A-Z])/).map(kne).join(" ").replace("_"," ").replace(/\s+/g," ")}var Cne=new Set(["ID","IP","PKCE","JWKS","URI","URL"]);function kne(e){let t=e.toUpperCase();return Cne.has(t)?t:t.charAt(0)+e.slice(1)}function L0(e,t){let r=Ot.types[e];if(!r)return;let n=r.properties[t]??r.properties[t+"[x]"];if(n){if(n.contentReference){let o=n.contentReference.substring(1).split("."),a=o.pop(),i=Ya(o);return L0(i,a)}return n}}function Ro(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function vc(e){return!!(e&&typeof e=="object"&&"reference"in e)}var Ot=ene,yc=20,te=(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))(te||{}),S5={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"},F0={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function jne(e){let t=e.pathname.split("/").filter(Boolean).pop();return Tne(t,e.searchParams.entries())}function Rne(e){return jne(new URL(e,"https://example.com/"))}function Tne(e,t){let r={resourceType:e};for(let[n,o]of t)Ine(r,n,o);return r}function Ine(e,t,r){var i,l;let n,o,a=t.indexOf(":");switch(a>=0?(n=t.substring(0,a),o=t.substring(a+1)):(n=t,o=""),n){case"_sort":Dne(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=$P(r);o==="iterate"&&(c.modifier="iterate"),e.include?e.include.push(c):e.include=[c];break}case"_revinclude":{let c=$P(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=Ot.types[e.resourceType])==null?void 0:i.searchParams)==null?void 0:l[n];c?Nne(e,c,o,r):zne(e,n,o,r)}}}function Dne(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 Nne(e,t,r,n){if(r==="missing"){Hm(e,{code:t.code,operator:"missing",value:n});return}switch(t.type){case"number":case"date":case"quantity":Ane(e,t,n);break;case"reference":case"string":case"token":case"uri":Mne(e,t,r,n);break}}function Ane(e,t,r){let{operator:n,value:o}=Lne(r);Hm(e,{code:t.code,operator:n,value:o})}function Mne(e,t,r,n){Hm(e,{code:t.code,operator:Fne(r),value:n})}function zne(e,t,r,n){var a;let o="eq";if(r)o=r;else if(n.length>=2){let i=n.substring(0,2);i in F0&&(n.length===2||(a=n.at(2))!=null&&a.match(/\d/))&&(o=i,n=n.substring(i.length))}Hm(e,{code:t,operator:o,value:n})}function Lne(e){let t=e.substring(0,2),r=F0[t];return r?{operator:r,value:e.substring(2)}:{operator:"eq",value:e}}function Fne(e){return S5[e]??"eq"}function $P(e){let t=e.split(":");if(t.forEach(r=>{if(r==="*")throw new Bn(Ba("'*' is not supported as a value for search inclusion parameters"))}),t.length===1)throw new Bn(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 Bn(Ba(`Invalid include value '${e}'`))}function Hm(e,t){e.filters?e.filters.push(t):e.filters=[t]}function Vi(e){let t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(r=>t.push(Vne(r))),e.sortRules&&e.sortRules.length>0&&t.push(Bne(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(CP("_include",r))),e.revInclude&&e.revInclude.forEach(r=>t.push(CP("_revinclude",r))),t.length===0?"":(t.sort((r,n)=>r.localeCompare(n)),"?"+t.join("&"))}function Vne(e){let t=e.operator in S5?":"+e.operator:"",r=e.operator!=="eq"&&e.operator in F0?e.operator:"";return`${e.code}${t}=${r}${encodeURIComponent(e.value)}`}function Bne(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function CP(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}var Une=class{constructor(t,r){this.operator=t,this.child=r}toString(){return`${this.operator}(${this.child.toString()})`}},wc=class{constructor(e,t,r){this.operator=e,this.left=t,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}},Wne=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 Hne(e,this.prefixParselets,this.infixParselets)}},Hne=class{constructor(t,r,n){this.tokens=t,this.prefixParselets=r,this.infixParselets=n}hasMore(){return this.tokens.length>0}match(t){var r;return((r=this.peek())==null?void 0:r.id)!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){let r=this.consume(),n=this.prefixParselets[r.id];if(!n)throw Error(`Parse error at "${r.value}" (line ${r.line}, column ${r.column}). No matching prefix parselet.`);let o=n.parse(this,r);for(;t>this.getPrecedence();){let a=this.consume();o=this.getInfixParselet(a).parse(this,o,a)}return o}getPrecedence(){let t=this.peek();if(!t)return 1/0;let r=this.getInfixParselet(t);return r?r.precedence:1/0}consume(t,r){var n,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((n=this.peek())==null?void 0:n.id)!==t){let a=this.peek();throw Error(`Expected ${t} but got "${a.id}" at line ${a.line} column ${a.column}.`)}if(r&&((o=this.peek())==null?void 0:o.value)!==r){let a=this.peek();throw Error(`Expected "${r}" but got "${a.value}" at line ${a.line} column ${a.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}},qne=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],Gne=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()===" "&&Qne(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 Qne(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&qne.includes(e.value)))}function Zu(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}}function ye(e){return[{type:"boolean",value:e}]}function Jn(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:"integer",value:e}:typeof e=="number"?{type:"decimal",value:e}:typeof e=="boolean"?{type:"boolean",value:e}:typeof e=="string"?{type:"string",value:e}:an(e)?{type:"Quantity",value:e}:Ro(e)?{type:e.resourceType,value:e}:{type:"BackboneElement",value:e}}function Ko(e){return e.length===0?!1:!!e[0].value}function Eo(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 rn(e,t){if(!e.value)return;let r=L0(e.type,t);return r?Kne(e,t,r):Yne(e,t)}function Kne(e,t,r){var l;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 c of n){let u=t.replace("[x]","")+cr(c.code);if(u in e.value){o=e.value[u],a=c.code;break}}let i=e.value["_"+t];if(i&&(Array.isArray(o)?o=o.map((c,u)=>i[u]?TP(c??{},i[u]):c):o=TP(o??{},i)),!Ma(o))return(a==="Element"||a==="BackboneElement")&&(a=Ya((l=r.path)==null?void 0:l.split("."))),Array.isArray(o)?o.map(c=>kP(c,a)):kP(o,a)}function kP(e,t){return t==="Resource"&&Ro(e)&&(t=e.resourceType),{type:t,value:e}}function Yne(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 X){let a=t+cr(o);if(a in r){n=r[a];break}}if(!Ma(n))return Array.isArray(n)?n.map(Jn):Jn(n)}function P5(e){let t=[];for(let r of e){let n=!1;for(let o of t)if(Ko(C5(r,o))){n=!0;break}n||t.push(r)}return t}function O5(e){return ye(!Ko(e))}function $5(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?ye(!1):ye(e.every((r,n)=>Ko(C5(r,t[n]))))}function C5(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"?ye(Math.abs(r-n)<1e-8):an(r)&&an(n)?ye(R5(r,n)):ye(typeof r=="object"&&typeof n=="object"?V0(e,t):r===n)}function k5(e,t){return e.length===0&&t.length===0?ye(!0):e.length!==t.length?ye(!1):(e.sort(jP),t.sort(jP),ye(e.every((r,n)=>Ko(Xne(r,t[n])))))}function Xne(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"?ye(Math.abs(i-l)<.01):an(i)&&an(l)?ye(R5(i,l)):ye(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"?V0({...i,id:void 0},{...l,id:void 0}):typeof i=="string"&&typeof l=="string"?i.toLowerCase()===l.toLowerCase():i===l)}function jP(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 j5(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 Jne(r);case"Quantity":return an(r);default:return typeof r=="object"&&(r==null?void 0:r.resourceType)===t}}function Jne(e){return!!(e&&typeof e=="object"&&"start"in e)}function an(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function R5(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 V0(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(RP(a)&&RP(i)){if(!V0(a,i))return!1}else if(a!==i)return!1}return!0}function RP(e){return e!==null&&typeof e=="object"}function TP(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}var Xl=()=>[],hr={empty:(e,t)=>ye(t.length===0),exists:(e,t,r)=>ye(r?t.filter(n=>Ko(r.eval(e,[n]))).length>0:t.length>0),all:(e,t,r)=>ye(t.every(n=>Ko(r.eval(e,[n])))),allTrue:(e,t)=>{for(let r of t)if(!r.value)return ye(!1);return ye(!0)},anyTrue:(e,t)=>{for(let r of t)if(r.value)return ye(!0);return ye(!1)},allFalse:(e,t)=>{for(let r of t)if(r.value)return ye(!1);return ye(!0)},anyFalse:(e,t)=>{for(let r of t)if(!r.value)return ye(!0);return ye(!1)},subsetOf:Xl,supersetOf:Xl,count:(e,t)=>[{type:"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)=>ye(t.length===hr.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:Xl,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 P5([...t,...n])},combine:(e,t,r)=>{if(!r)return t;let n=r.eval(e,t);return[...t,...n]},htmlChecks:(e,t,r)=>[Jn(!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}]=Ln(t,1);if(typeof r=="boolean")return[{type:"boolean",value:r}];if(typeof r=="number"&&(r===0||r===1))return ye(!!r);if(typeof r=="string"){let n=r.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(n))return ye(!0);if(["false","f","no","n","0","0.0"].includes(n))return ye(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:ye(hr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);return typeof r=="number"?[{type:"integer",value:r}]:typeof r=="string"&&/^[+-]?\d+$/.exec(r)?[{type:"integer",value:parseInt(r,10)}]:typeof r=="boolean"?[{type:"integer",value:r?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:ye(hr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:"date",value:Zu(r)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:ye(hr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);return typeof r=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(r)?[{type:"dateTime",value:Zu(r)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:ye(hr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);return typeof r=="number"?[{type:"decimal",value:r}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(r)?[{type:"decimal",value:parseFloat(r)}]:typeof r=="boolean"?[{type:"decimal",value:r?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:ye(hr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);return an(r)?[{type:"Quantity",value:r}]:typeof r=="number"?[{type:"Quantity",value:{value:r,unit:"1"}}]:typeof r=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(r)?[{type:"Quantity",value:{value:parseFloat(r),unit:"1"}}]:typeof r=="boolean"?[{type:"Quantity",value:{value:r?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:ye(hr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);return r==null?[]:an(r)?[{type:"string",value:`${r.value} '${r.unit}'`}]:[{type:"string",value:r.toString()}]},convertsToString:(e,t)=>t.length===0?[]:ye(hr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];let[{value:r}]=Ln(t,1);if(typeof r=="string"){let n=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(r);if(n)return[{type:"time",value:Zu("T"+n[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:ye(hr.toTime(e,t).length===1),indexOf:(e,t,r)=>Kr((n,o)=>n.indexOf(o),e,t,r),substring:(e,t,r,n)=>Kr((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)=>Kr((n,o)=>n.startsWith(o),e,t,r),endsWith:(e,t,r)=>Kr((n,o)=>n.endsWith(o),e,t,r),contains:(e,t,r)=>Kr((n,o)=>n.includes(o),e,t,r),upper:(e,t)=>Kr(r=>r.toUpperCase(),e,t),lower:(e,t)=>Kr(r=>r.toLowerCase(),e,t),replace:(e,t,r,n)=>Kr((o,a,i)=>o.replaceAll(a,i),e,t,r,n),matches:(e,t,r)=>Kr((n,o)=>!!new RegExp(o).exec(n),e,t,r),replaceMatches:(e,t,r,n)=>Kr((o,a,i)=>o.replaceAll(a,i),e,t,r,n),length:(e,t)=>Kr(r=>r.length,e,t),toChars:(e,t)=>Kr(r=>r?r.split(""):void 0,e,t),abs:(e,t)=>An(Math.abs,e,t),ceiling:(e,t)=>An(Math.ceil,e,t),exp:(e,t)=>An(Math.exp,e,t),floor:(e,t)=>An(Math.floor,e,t),ln:(e,t)=>An(Math.log,e,t),log:(e,t,r)=>An((n,o)=>Math.log(n)/Math.log(o),e,t,r),power:(e,t,r)=>An(Math.pow,e,t,r),round:(e,t)=>An(Math.round,e,t),sqrt:(e,t)=>An(Math.sqrt,e,t),truncate:(e,t)=>An(r=>r|0,e,t),children:Xl,descendants:Xl,trace:(e,t,r)=>(console.log("trace",t,r),t),now:()=>[{type:"dateTime",value:new Date().toISOString()}],timeOfDay:()=>[{type:"time",value:new Date().toISOString().substring(11)}],today:()=>[{type:"date",value:new Date().toISOString().substring(0,10)}],between:(e,t,r,n,o)=>{var u;let a=hr.toDateTime(e,r.eval(e,t));if(a.length===0)throw new Error("Invalid start date");let i=hr.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");return[{type:"Quantity",value:{value:_5(a[0].value,i[0].value)[l],unit:l}}]},is:(e,t,r)=>{let n="";return r instanceof B0?n=r.name:r instanceof W0&&(n=r.left.name+"."+r.right.name),n?t.map(o=>({type:"boolean",value:j5(o,n)})):[]},not:(e,t)=>hr.toBoolean(e,t).map(r=>({type:"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 Jn(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:"BackboneElement",value:void 0}}).filter(r=>!!r.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:r})=>typeof r=="boolean"?{type:"BackboneElement",value:{namespace:"System",name:"Boolean"}}:typeof r=="number"?{type:"BackboneElement",value:{namespace:"System",name:"Integer"}}:Ro(r)?{type:"BackboneElement",value:{namespace:"FHIR",name:r.resourceType}}:{type:"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:"boolean",value:((i=a.value)==null?void 0:i.resourceType)===o}})}};function Kr(e,t,r,...n){if(r.length===0)return[];let[{value:o}]=Ln(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(Jn):[Jn(a)]}function An(e,t,r,...n){if(r.length===0)return[];let[{value:o}]=Ln(r,1),a=an(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?"Quantity":r[0].type,u=a?{...o,value:l}:l;return[{type:c,value:u}]}function Ln(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 Zne=class{constructor(t,r){this.original=t,this.child=r}eval(t,r){try{return r.length>0?r.map(n=>this.child.eval(t,[n])).flat():this.child.eval(t,[])}catch(n){throw new Error(`FhirPathError on "${this.original}": ${n}`)}}toString(){return this.child.toString()}},Ei=class{constructor(t){this.value=t}eval(){return[this.value]}toString(){let t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}},B0=class{constructor(t){this.name=t}eval(t,r){if(this.name==="$this")return r;if(this.name.startsWith("%")){let n=t.variables[this.name.slice(1)];if(!n)throw new Error(`Undefined variable ${this.name}`);return[n]}return r.flatMap(n=>this.evalValue(n)).filter(n=>(n==null?void 0:n.value)!==void 0)}evalValue(t){let r=t.value;if(!(!r||typeof r!="object"))return Ro(r)&&r.resourceType===this.name?t:rn(t,this.name)}toString(){return this.name}},eoe=class{eval(){return[]}toString(){return"{}"}},toe=class extends Une{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()}},U0=class extends wc{constructor(e,t){super("as",e,t)}eval(e,t){return hr.ofType(e,this.left.eval(e,t),this.right)}},kr=class extends wc{},vn=class extends kr{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=an(o)?o.value:o,l=an(a)?a.value:a,c=this.impl(i,l);return typeof c=="boolean"?ye(c):an(o)?[{type:"Quantity",value:{...o,value:c}}]:[Jn(c)]}},roe=class extends wc{constructor(t,r){super("&",t,r)}eval(t,r){let n=this.left.eval(t,r),o=this.right.eval(t,r),a=[...n,...o];return a.length>0&&a.every(i=>typeof i.value=="string")?[{type:"string",value:a.map(i=>i.value).join("")}]:a}},noe=class extends kr{constructor(t,r){super("contains",t,r)}eval(t,r){let n=this.left.eval(t,r),o=this.right.eval(t,r);return ye(n.some(a=>a.value===o[0].value))}},ooe=class extends kr{constructor(e,t){super("in",e,t)}eval(e,t){let r=Eo(this.left.eval(e,t)),n=this.right.eval(e,t);return r?ye(n.some(o=>o.value===r.value)):[]}},W0=class extends wc{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()}`}},T5=class extends wc{constructor(e,t){super("|",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return P5([...r,...n])}},aoe=class extends kr{constructor(t,r){super("=",t,r)}eval(t,r){let n=this.left.eval(t,r),o=this.right.eval(t,r);return $5(n,o)}},ioe=class extends kr{constructor(e,t){super("!=",e,t)}eval(e,t){let r=this.left.eval(e,t),n=this.right.eval(e,t);return O5($5(r,n))}},loe=class extends kr{constructor(t,r){super("~",t,r)}eval(t,r){let n=this.left.eval(t,r),o=this.right.eval(t,r);return k5(n,o)}},soe=class extends kr{constructor(t,r){super("!~",t,r)}eval(t,r){let n=this.left.eval(t,r),o=this.right.eval(t,r);return O5(k5(n,o))}},H0=class extends kr{constructor(t,r){super("is",t,r)}eval(t,r){let n=this.left.eval(t,r);if(n.length!==1)return[];let o=this.right.name;return ye(j5(n[0],o))}},coe=class extends kr{constructor(e,t){super("and",e,t)}eval(e,t){let r=Eo(this.left.eval(e,t),"boolean"),n=Eo(this.right.eval(e,t),"boolean");return(r==null?void 0:r.value)===!0&&(n==null?void 0:n.value)===!0?ye(!0):(r==null?void 0:r.value)===!1||(n==null?void 0:n.value)===!1?ye(!1):[]}},uoe=class extends kr{constructor(t,r){super("or",t,r)}eval(t,r){let n=Eo(this.left.eval(t,r),"boolean"),o=Eo(this.right.eval(t,r),"boolean");return(n==null?void 0:n.value)===!1&&(o==null?void 0:o.value)===!1?ye(!1):n!=null&&n.value||o!=null&&o.value?ye(!0):[]}},doe=class extends kr{constructor(e,t){super("xor",e,t)}eval(e,t){let r=Eo(this.left.eval(e,t),"boolean"),n=Eo(this.right.eval(e,t),"boolean");return!r||!n?[]:ye(r.value!==n.value)}},foe=class extends kr{constructor(t,r){super("implies",t,r)}eval(t,r){let n=Eo(this.left.eval(t,r),"boolean"),o=Eo(this.right.eval(t,r),"boolean");return(o==null?void 0:o.value)===!0||(n==null?void 0:n.value)===!1?ye(!0):!n||!o?[]:ye(!1)}},q0=class{constructor(e,t){this.name=e,this.args=t}eval(e,t){let r=hr[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(", ")})`}},G0=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()}]`}},poe=["true","false"],Q0=["!=","!~","<=",">=","{}","->"];function moe(e){return new Gne(e,poe,Q0).tokenize()}var Fe={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},hoe={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}},goe={parse(e,t){let r=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new G0(t,r)},precedence:Fe.Indexer},voe={parse(e,t){if(!(t instanceof B0))throw new Error("Unexpected parentheses");let r=[];for(;!e.match(")");)r.push(e.consumeAndParse()),e.match(",");return new q0(t.name,r)},precedence:Fe.FunctionCall};function yoe(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 K0(){return new Wne().registerPrefix("String",{parse:(e,t)=>new Ei({type:"string",value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new Ei({type:"dateTime",value:Zu(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new Ei({type:"Quantity",value:yoe(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new Ei({type:"decimal",value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new Ei({type:"boolean",value:!0})}).registerPrefix("false",{parse:()=>new Ei({type:"boolean",value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new B0(t.value)}).registerPrefix("{}",{parse:()=>new eoe}).registerPrefix("(",hoe).registerInfix("[",goe).registerInfix("(",voe).prefix("+",Fe.UnaryAdd,(e,t)=>new toe("+",t,r=>r)).prefix("-",Fe.UnarySubtract,(e,t)=>new vn("-",t,t,(r,n)=>-n)).infixLeft(".",Fe.Dot,(e,t,r)=>new W0(e,r)).infixLeft("/",Fe.Divide,(e,t,r)=>new vn("/",e,r,(n,o)=>n/o)).infixLeft("*",Fe.Multiply,(e,t,r)=>new vn("*",e,r,(n,o)=>n*o)).infixLeft("+",Fe.Add,(e,t,r)=>new vn("+",e,r,(n,o)=>n+o)).infixLeft("-",Fe.Subtract,(e,t,r)=>new vn("-",e,r,(n,o)=>n-o)).infixLeft("|",Fe.Union,(e,t,r)=>new T5(e,r)).infixLeft("=",Fe.Equals,(e,t,r)=>new aoe(e,r)).infixLeft("!=",Fe.NotEquals,(e,t,r)=>new ioe(e,r)).infixLeft("~",Fe.Equivalent,(e,t,r)=>new loe(e,r)).infixLeft("!~",Fe.NotEquivalent,(e,t,r)=>new soe(e,r)).infixLeft("<",Fe.LessThan,(e,t,r)=>new vn("<",e,r,(n,o)=>n<o)).infixLeft("<=",Fe.LessThanOrEquals,(e,t,r)=>new vn("<=",e,r,(n,o)=>n<=o)).infixLeft(">",Fe.GreaterThan,(e,t,r)=>new vn(">",e,r,(n,o)=>n>o)).infixLeft(">=",Fe.GreaterThanOrEquals,(e,t,r)=>new vn(">=",e,r,(n,o)=>n>=o)).infixLeft("&",Fe.Ampersand,(e,t,r)=>new roe(e,r)).infixLeft("and",Fe.And,(e,t,r)=>new coe(e,r)).infixLeft("as",Fe.As,(e,t,r)=>new U0(e,r)).infixLeft("contains",Fe.Contains,(e,t,r)=>new noe(e,r)).infixLeft("div",Fe.Divide,(e,t,r)=>new vn("div",e,r,(n,o)=>n/o|0)).infixLeft("in",Fe.In,(e,t,r)=>new ooe(e,r)).infixLeft("is",Fe.Is,(e,t,r)=>new H0(e,r)).infixLeft("mod",Fe.Modulo,(e,t,r)=>new vn("mod",e,r,(n,o)=>n%o)).infixLeft("or",Fe.Or,(e,t,r)=>new uoe(e,r)).infixLeft("xor",Fe.Xor,(e,t,r)=>new doe(e,r)).infixLeft("implies",Fe.Implies,(e,t,r)=>new foe(e,r))}var woe=K0();function I5(e){return new Zne(e,woe.construct(moe(e)).consumeAndParse())}function _oe(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]=Jn(r[n]))}return Y0(e,r).map(n=>n.value)}function Y0(e,t,r){let n=r??{};return I5(e).eval({variables:n},t).map(o=>{var a;return{type:o.type,value:(a=o.value)==null?void 0:a.valueOf()}})}var Uo=(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))(Uo||{});function X0(e,t){var n;let r=(n=Ot.types[e].searchParamsDetails)==null?void 0:n[t.code];return r||(r=xoe(e,t)),r}function boe(e,t,r){let n=Ot.types[e];n.searchParamsDetails||(n.searchParamsDetails={}),n.searchParamsDetails[t]=r}function xoe(e,t){let r=t.code,n=Poe(r),o=$oe(e,t.expression),a={elementDefinitions:[],propertyTypes:new Set,array:!1};for(let l of o){let c=xs(l);c.length===1&&c[0]instanceof kr?a.propertyTypes.add("boolean"):D5(a,xs(l),e,1)}let i={columnName:n,type:Ooe(t,a.propertyTypes),elementDefinitions:a.elementDefinitions,array:a.array};return boe(e,r,i),i}function D5(e,t,r,n){var u;let o=t[n];if(o instanceof U0){e.propertyTypes.add(o.right.toString());return}if(o instanceof q0){Eoe(e,o);return}let a=o.toString(),i=L0(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 G0&&(l=!0,c++),i.max!=="0"&&i.max!=="1"&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(i);for(let d of i.type)e.propertyTypes.add(d.code);return}for(let d of i.type){let p=d.code;Soe(p)&&(p=Ya((u=i.path)==null?void 0:u.split("."))),D5(e,t,p,c)}}function Eoe(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 H0){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function Soe(e){return e==="Element"||e==="BackboneElement"}function Poe(e){return e.split("-").reduce((t,r,n)=>t+(n?cr(r):r),"")}function Ooe(e,t){switch(e.type){case"date":return t.size===1&&t.has("date")?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has("canonical")?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has("boolean")?"BOOLEAN":"TEXT";default:return"TEXT"}}function $oe(e,t){let r=[],n=I5(t);return jv(e,n.child,r),r}function jv(e,t,r){t instanceof T5?(jv(e,t.left,r),jv(e,t.right,r)):t.toString().startsWith(e+".")&&r.push(t)}function xs(e){return e instanceof U0||e instanceof G0?[xs(e.left),e].flat():e instanceof kr?[e]:e instanceof W0?[xs(e.left),xs(e.right)].flat():e instanceof q0&&e.name==="where"&&!(e.args[0]instanceof H0)?[]:[e]}var Coe=(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))(Coe||{});function koe(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 joe(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 IP(){let e=new Uint32Array(28);return crypto.getRandomValues(e),bne(e.buffer)}async function Roe(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function Toe(){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 N5(e){var o,a,i;let t={};e=$l(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]=Toe(),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)=>Ioe(l,c,t),2);return Doe(JSON.parse(n))}function Ioe(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)return"urn:uuid:"+r[n]}return t}function Doe(e){let t=Aoe(e),{sorted:r,cycles:n}=Noe(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 Noe(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 A5(e,t){for(let r in e)if(e[r]&&typeof e[r]=="object"){let n=e[r];if(vc(n)){let o=n.reference;o.startsWith("urn:uuid:")&&t(o)}else A5(n,t)}}function Aoe(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&&A5(r.resource,o=>{t[o]&&t[o].push(n)})}return t}var Moe=class{constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){let r=this.cache.get(t);return r&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,r)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}},Zr={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"},zoe=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];return t&&t.forEach(r=>r.call(this,e)),!e.defaultPrevented}};function Loe(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=koe(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 Foe(e){return e.split(".").length===3}function M5(e){let[t,r,n]=e.split(".");return Loe(r)}function Voe(e){try{return typeof M5(e).login_id=="string"}catch{return!1}}var z5,oo=class{constructor(e){this[z5]="ReadablePromise",this.status="pending",this.suspender=e.then(t=>(this.status="success",this.response=t,t),t=>{throw this.status="error",this.error=t,t})}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(e,t){return this.suspender.then(e,t)}catch(e){return this.suspender.catch(e)}finally(e){return this.suspender.finally(e)}};z5=Symbol.toStringTag;var Boe=class{constructor(){this.storage=typeof localStorage<"u"?localStorage:new Uoe}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,r){r?this.storage.setItem(t,r):this.storage.removeItem(t)}getObject(t){let r=this.getString(t);return r?JSON.parse(r):void 0}setObject(t,r){this.setString(t,r?Or(r):void 0)}},Uoe=class{constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,r){r?this.data.set(t,r):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}},Woe="2.1.1-6579d66",Hoe="https://api.medplum.com/",qoe=1e3,Goe=6e4,DP="Binary/",NP={resourceType:"Device",id:"system",deviceName:[{name:"System"}]},Qoe=(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))(Qoe||{}),Koe=(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))(Koe||{}),Yoe=(e=>(e.JwtBearer="urn:ietf:params:oauth:client-assertion-type:jwt-bearer",e))(Yoe||{}),Xoe=class extends zoe{constructor(e){if(super(),e!=null&&e.baseUrl&&!e.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=e??{},this.fetch=(e==null?void 0:e.fetch)??Joe(),this.storage=(e==null?void 0:e.storage)??new Boe,this.createPdfImpl=e==null?void 0:e.createPdf,this.baseUrl=MP((e==null?void 0:e.baseUrl)??Hoe),this.fhirBaseUrl=MP(Pu(this.baseUrl,(e==null?void 0:e.fhirUrlPath)??"fhir/R4/")),this.authorizeUrl=Pu(this.baseUrl,(e==null?void 0:e.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Pu(this.baseUrl,(e==null?void 0:e.tokenUrl)??"oauth2/token"),this.logoutUrl=Pu(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)??Goe,this.cacheTime>0?this.requestCache=new Moe((e==null?void 0:e.resourceCacheSize)??qoe):this.requestCache=void 0,e!=null&&e.autoBatchTime?(this.autoBatchTime=e.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0);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(),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 oo(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,Zr.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){let o=await this.ensureCodeChallenge(n);window.location.assign(this.getExternalAuthRedirectUri(e,t,r,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){let{codeChallenge:o,codeChallengeMethod:a}=n;if(!a)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!o)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");let i=new URL(e);return i.searchParams.set("response_type","code"),i.searchParams.set("client_id",t),i.searchParams.set("redirect_uri",r),i.searchParams.set("scope","openid profile email"),i.searchParams.set("state",JSON.stringify(n)),i.searchParams.set("code_challenge_method",a),i.searchParams.set("code_challenge",o),i.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 oo((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 oo(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 oo(this.search(e,t,r).then(LP));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 LP(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 NP;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 oo(Promise.reject(new Error("Missing reference")));if(r==="system")return new oo(Promise.resolve(NP));let[n,o]=r.split("/");return!n||!o?new oo(Promise.reject(new Error("Invalid reference"))):this.readResource(n,o,t)}getSchema(){return Ot}requestSchema(e){if(e in Ot.types)return Promise.resolve(Ot);let t=e+"-requestSchema",r=this.getCacheEntry(t,void 0);if(r)return r.value;let n=new oo((async()=>{let o=`{
|
|
90
|
+
StructureDefinitionList(name: "${e}") {
|
|
91
|
+
name,
|
|
92
|
+
description,
|
|
93
|
+
snapshot {
|
|
94
|
+
element {
|
|
95
|
+
id,
|
|
96
|
+
path,
|
|
97
|
+
min,
|
|
98
|
+
max,
|
|
99
|
+
type {
|
|
100
|
+
code,
|
|
101
|
+
targetProfile
|
|
102
|
+
},
|
|
103
|
+
binding {
|
|
104
|
+
valueSet
|
|
105
|
+
},
|
|
106
|
+
definition
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
SearchParameterList(base: "${e}", _count: 100) {
|
|
111
|
+
base,
|
|
112
|
+
code,
|
|
113
|
+
type,
|
|
114
|
+
expression,
|
|
115
|
+
target
|
|
116
|
+
}
|
|
117
|
+
}`.replace(/\s+/g," "),a=await this.graphql(o);for(let i of a.data.StructureDefinitionList)Sne(i);for(let i of a.data.SearchParameterList)$ne(i);return Ot})());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 Error(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=ut(e),a=e.subject),e.resourceType==="ServiceRequest"&&(o=e.encounter,a=e.subject),e.resourceType==="Patient"&&(a=ut(e)),this.createResource({resourceType:"Communication",basedOn:[ut(e)],encounter:o,subject:a,sender:n?ut(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,Zr.JSON,t)}graphql(e,t,r,n){return this.post(this.fhirUrl("$graphql"),{query:e,operationName:t,variables:r},Zr.JSON,n)}readResourceGraph(e,t,r,n){return this.get(`${this.fhirUrl(e,t)}/$graph?graph=${r}`,n)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(e){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=Voe(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=>{this.profilePromise=void 0,this.sessionDetails=r,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&&await this.profilePromise,this.getProfile()}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(DP)&&(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({...n,resourceType:"Media",content:{contentType:t,url:DP+a.id,title:r}},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 zP(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 oo(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 Bn(Yre);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 Bn(_t(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 OP(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 zP(a);i&&(r=await this.fetchWithRetry(i,o))}await OP(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 Bn(_t(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&&!m5(l.response.outcome)?i.reject(new Bn(l.response.outcome)):i.resolve(l==null?void 0:l.resource)}}addFetchOptionsDefaults(e){let t=e.headers;t||(t={},e.headers=t),t.Accept=Zr.FHIR_JSON,t["X-Medplum"]="extended",e.body&&!t["Content-Type"]&&(t["Content-Type"]=Zr.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=IP();sessionStorage.setItem("pkceState",e);let t=IP();sessionStorage.setItem("codeVerifier",t);let r=await Roe(t),n=xne(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??AP()),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)??AP()),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=joe(e+":"+t)}async invite(e,t){return this.post("admin/projects/"+e+"/invite",t)}async fetchTokens(e){let t={method:"POST",headers:{"Content-Type":Zr.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 Bn(Ba(a.error_description))}catch(a){throw new Bn(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(Foe(t)){let r=M5(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 Joe(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function AP(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}function MP(e){return e.endsWith("/")?e:e+"/"}function Pu(e,t){return new URL(t,e).toString()}async function zP(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(Um(n)&&((a=(o=n.issue)==null?void 0:o[0])!=null&&a.diagnostics))return n.issue[0].diagnostics}function LP(e){var r;let t=((r=e.entry)==null?void 0:r.map(n=>n.resource))??[];return Object.assign(t,{bundle:e})}[...Q0];K0().registerInfix("->",{precedence:Fe.Arrow}).registerInfix(";",{precedence:Fe.Semicolon});[...Q0];K0();function Zoe(e){let t=e.value;return t?s.createElement(s.Fragment,null,tne(t)):null}function FP(e,t){return e.line&&e.line.length>t?e.line[t]:""}function VP(e,t,r){let n=e.line||[];for(;n.length<=t;)n.push("");return n[t]=r,{...e,line:n}}function eae(e){let[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(VP(n.current||{},0,h))}function c(h){o(VP(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.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(dt,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>a(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.createElement(dt,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>i(h.currentTarget.value),data:["","postal","physical","both"]}),s.createElement(oe,{placeholder:"Line 1",defaultValue:FP(t,0),onChange:h=>l(h.currentTarget.value)}),s.createElement(oe,{placeholder:"Line 2",defaultValue:FP(t,1),onChange:h=>c(h.currentTarget.value)}),s.createElement(oe,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.createElement(oe,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.createElement(oe,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>p(h.currentTarget.value)}))}var L5=f.createContext(void 0);function tae(e){let t=e.medplum,r=e.navigate??rae,[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]),f.useEffect(()=>{function i(){de({color:"red",message:"No connection to server",autoClose:!1})}return t.addEventListener("offline",i),()=>t.removeEventListener("offline",i)},[t]);let a=f.useMemo(()=>({...n,medplum:t,navigate:r}),[n,t,r]);return s.createElement(L5.Provider,{value:a},e.children)}function qm(){return f.useContext(L5)}function re(){return qm().medplum}function Gm(){return qm().navigate}function F5(){return qm().profile}function rae(e){window.location.assign(e)}function nae(e){let t=F5(),[r,n]=f.useState(e.defaultValue||{}),o=f.useRef();o.current=r;function a(i){let l=i?{text:i,authorReference:t&&ut(t),time:new Date().toISOString()}:{};n(l),e.onChange&&e.onChange(l)}return s.createElement(oe,{name:e.name,placeholder:"Annotation text",defaultValue:r.text,onChange:i=>a(i.currentTarget.value)})}var oae={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"},aae=Object.defineProperty,iae=Object.defineProperties,lae=Object.getOwnPropertyDescriptors,Lp=Object.getOwnPropertySymbols,V5=Object.prototype.hasOwnProperty,B5=Object.prototype.propertyIsEnumerable,BP=(e,t,r)=>t in e?aae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,UP=(e,t)=>{for(var r in t||(t={}))V5.call(t,r)&&BP(e,r,t[r]);if(Lp)for(var r of Lp(t))B5.call(t,r)&&BP(e,r,t[r]);return e},sae=(e,t)=>iae(e,lae(t)),cae=(e,t)=>{var r={};for(var n in e)V5.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&&B5.call(e,n)&&(r[n]=e[n]);return r},Ee=(e,t,r)=>{let n=f.forwardRef((o,a)=>{var i=o,{color:l="currentColor",size:c=24,stroke:u=2,children:d}=i,p=cae(i,["color","size","stroke","children"]);return f.createElement("svg",UP(sae(UP({ref:a},oae),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,g])=>f.createElement(h,g)),...d||[]])});return n.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number]),stroke:Pe.oneOfType([Pe.string,Pe.number])},n.displayName=`${t}`,n},uae=Ee("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"}]]),J0=Ee("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"}]]),dae=Ee("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"}]]),fae=Ee("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"}]]),pae=Ee("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"}]]),mae=Ee("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"}]]),hae=Ee("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"}]]),gae=Ee("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"}]]),Oa=Ee("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"}]]),U5=Ee("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),vae=Ee("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"}]]),yae=Ee("chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]),Fp=Ee("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"}]]),Z0=Ee("circle-plus","IconCirclePlus",[["path",{d:"M20.987 12.497a9 9 0 1 0 -8.467 8.489",key:"svg-0"}],["path",{d:"M16 19h6",key:"svg-1"}],["path",{d:"M19 16v6",key:"svg-2"}]]),W5=Ee("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"}]]),wae=Ee("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"}]]),_ae=Ee("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"}]]),bae=Ee("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"}]]),xae=Ee("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"}]]),Eae=Ee("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"}]]),Qm=Ee("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"}]]),Km=Ee("equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]),Sae=Ee("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"}]]),Pae=Ee("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"}]]),Oae=Ee("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"}]]),$ae=Ee("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"}]]),Cae=Ee("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"}]]),H5=Ee("math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]),q5=Ee("math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]),kae=Ee("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"}]]),jae=Ee("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"}]]),Rae=Ee("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"}]]),Tae=Ee("plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]),Iae=Ee("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"}]]),Dae=Ee("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"}]]),Rv=Ee("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"}]]),e1=Ee("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"}]]),t1=Ee("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"}]]),Nae=Ee("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"}]]),Aae=Ee("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"}]]),Mae=Ee("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"}]]),G5=Ee("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"}]]),zae=Ee("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),Q5=class extends s.Component{constructor(e){super(e),this.state={}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error("Uncaught error:",e,t)}render(){return this.state.error?s.createElement(ic,{icon:s.createElement(J0,{size:16}),title:"Something went wrong",color:"red"},Ce(this.state.error)):this.props.children}};function ca(){return s.createElement(Zt,{style:{width:"100%",height:"100vh"}},s.createElement(un,null))}function r1(e){let t=e.value;return t?s.createElement(s.Fragment,null,gc(t,e.options)):null}function ot(e){e.preventDefault(),e.stopPropagation()}function K5(e){if(WP(e))return!0;if(e instanceof HTMLTableCellElement){let t=e.children;if(t.length===1&&WP(t[0]))return!0}return!1}function WP(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function Re(e){let t=Gm(),{to:r,suffix:n,label:o,onClick:a,children:i,...l}=e,c=Lae(r);return n&&(c+="/"+n),s.createElement(Be,{href:c,"aria-label":o,onClick:u=>{ot(u),a?a(u):r&&t(c)},...l},i)}function Lae(e){if(e){if(typeof e=="string")return Fae(e);if(Ro(e))return Vae(e);if(vc(e))return Bae(e)}return"#"}function Fae(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Vae(e){return`/${e.resourceType}/${e.id}`}function Bae(e){return`/${e.reference}`}function Ze(e,t){let r=re(),[n,o]=f.useState(HP(r,e)),a=f.useCallback(i=>{z0(i,n)||o(i)},[n,o]);return f.useEffect(()=>{a(HP(r,e))},[r,e,a]),f.useEffect(()=>{let i=!0;return vc(e)&&r.readReference(e).then(l=>{i&&a(l)}).catch(l=>{i&&(a(void 0),t&&t(_t(l)))}),()=>i=!1},[r,n,e,a,t]),n}function HP(e,t){if(t){if(Ro(t))return t;if(vc(t))return e.getCachedReference(t)}}function ua(e){let t=Ze(e.value),r=t?xo(t):e.alt??"",n=(t&&mne(t))??e.src,o=e.radius??"xl",a={...e};return delete a.value,delete a.link,e.link?s.createElement(Re,{to:t},s.createElement(hf,{src:n,alt:r,radius:o,...a})):s.createElement(hf,{src:n,alt:r,radius:o,...a})}function n1(e){let{defaultValue:t,toKey:r,toOption:n,loadOptions:o,onChange:a,onCreate:i,creatable:l,...c}=e,u=Uae(t),d=f.useRef(null),[p,h]=f.useState(void 0),[g,v]=f.useState(),[w,E]=f.useState(),[_,y]=f.useState(),[x,b]=f.useState(u.map(n)),[S,$]=f.useState([]),O=f.useRef();O.current=p;let C=f.useRef();C.current=g;let T=f.useRef();T.current=w;let j=f.useRef();j.current=_;let k=f.useRef();k.current=S;let I=f.useCallback(()=>{var V;v(void 0);let R=((V=d.current)==null?void 0:V.value.trim())||"";if(R===O.current)return;h(R);let D=new AbortController;E(D),o(R,D.signal).then(G=>{D.signal.aborted||($(G.map(n)),E(void 0),j.current&&(G.length>0&&a(G.slice(0,1)),y(!1)))}).catch(G=>{D.signal.aborted||G.message.includes("aborted")||de({color:"red",message:Ce(G)})})},[o,a,n]),z=f.useCallback(()=>{T.current&&(T.current.abort(),E(void 0)),C.current!==void 0&&window.clearTimeout(C.current);let R=window.setTimeout(()=>I(),100);v(R)},[I]),N=f.useCallback(R=>{var G;let D=[],V=[];for(let ie of R){let Oe=(G=k.current)==null?void 0:G.find(Ae=>Ae.value===ie),ce=Oe==null?void 0:Oe.resource;!ce&&l!==!1&&i&&(ce=i(ie),Oe=n(ce)),ce&&D.push(ce),Oe&&V.push(Oe)}a(D),b(V)},[l,a,i,n]),F=f.useCallback(R=>{R.key==="Enter"&&(!C.current&&!T.current?(ot(R),k.current&&k.current.length>0&&($(k.current.slice(0,1)),N([k.current[0].value]))):y(!0))},[N]),q=f.useCallback(R=>{let D=n(i(R));return $([...k.current,D]),D},[i,$,n]),ee=f.useCallback((R,D)=>!D,[]);return f.useEffect(()=>()=>{T.current&&T.current.abort()},[]),s.createElement(k0,{...c,ref:d,defaultValue:u.map(r),searchable:!0,onKeyDown:F,onSearchChange:z,data:[...x,...S],onFocus:I,onChange:N,onCreate:q,rightSectionWidth:40,rightSection:w?s.createElement(un,{size:16}):null,filter:ee,creatable:!0})}function Uae(e){return e?Array.isArray(e)?e:[e]:[]}var Wae=U(()=>({searchInput:{input:{width:220,transition:"width 0.2s"},"input:focus":{width:400},"@media (max-width: 800px)":{input:{width:150},"input:focus":{width:150}}}}));function Hae(e){return e.id}function qae(e){return{value:e.id,label:xo(e),resource:e}}function Gae(e){let{classes:t}=Wae(),r=Gm(),n=re(),o=f.useCallback(async(i,l)=>{let c=Kae(i),u={signal:l},d=await n.graphql(c,void 0,void 0,u);return Yae(d,i)},[n]),a=f.useCallback(i=>{i.length>0&&r(`/${ct(i[0])}`)},[r]);return s.createElement(n1,{key:`${e.pathname}?${e.searchParams}`,size:"sm",radius:"md",className:t.searchInput,icon:s.createElement(Dae,{size:16}),placeholder:"Search",itemComponent:Qae,toKey:Hae,toOption:qae,onChange:a,loadOptions:o,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})}var Qae=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.createElement("div",{ref:r,...t},s.createElement(Z,{noWrap:!0},s.createElement(ua,{value:e}),s.createElement("div",null,s.createElement(ae,null,xo(e)),s.createElement(ae,{size:"xs",color:"dimmed"},n))))});function Kae(e){let t=JSON.stringify(e);return b5(e)?`{
|
|
118
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
119
|
+
resourceType
|
|
120
|
+
id
|
|
121
|
+
identifier {
|
|
122
|
+
system
|
|
123
|
+
value
|
|
124
|
+
}
|
|
125
|
+
name {
|
|
126
|
+
given
|
|
127
|
+
family
|
|
128
|
+
}
|
|
129
|
+
birthDate
|
|
130
|
+
}
|
|
131
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
132
|
+
resourceType
|
|
133
|
+
id
|
|
134
|
+
identifier {
|
|
135
|
+
system
|
|
136
|
+
value
|
|
137
|
+
}
|
|
138
|
+
subject {
|
|
139
|
+
display
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}`.replace(/\s+/g," "):`{
|
|
143
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
144
|
+
resourceType
|
|
145
|
+
id
|
|
146
|
+
identifier {
|
|
147
|
+
system
|
|
148
|
+
value
|
|
149
|
+
}
|
|
150
|
+
name {
|
|
151
|
+
given
|
|
152
|
+
family
|
|
153
|
+
}
|
|
154
|
+
birthDate
|
|
155
|
+
}
|
|
156
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
157
|
+
resourceType
|
|
158
|
+
id
|
|
159
|
+
identifier {
|
|
160
|
+
system
|
|
161
|
+
value
|
|
162
|
+
}
|
|
163
|
+
name {
|
|
164
|
+
given
|
|
165
|
+
family
|
|
166
|
+
}
|
|
167
|
+
birthDate
|
|
168
|
+
}
|
|
169
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
170
|
+
resourceType
|
|
171
|
+
id
|
|
172
|
+
identifier {
|
|
173
|
+
system
|
|
174
|
+
value
|
|
175
|
+
}
|
|
176
|
+
subject {
|
|
177
|
+
display
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}`.replace(/\s+/g," ")}function Yae(e,t){let 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),Jae(Xae(r),t).slice(0,5)}function Xae(e){let t=new Set,r=[];for(let n of e)t.has(n.id)||(t.add(n.id),r.push(n));return r}function Jae(e,t){return e.sort((r,n)=>qP(n,t)-qP(r,t))}function qP(e,t){let r=0;if(e.identifier)for(let n of e.identifier)r=Math.max(r,GP(n.value,t));if(e.resourceType==="Patient"&&e.name)for(let n of e.name)r=Math.max(r,GP(gc(n),t));return r}function GP(e,t){if(!e)return 0;let r=e.toLowerCase().indexOf(t.toLowerCase());return r<0?0:100-r}var Zae=U(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 eie(e){var d,p,h,g;let t=qm(),{medplum:r,profile:n,navigate:o}=t,a=r.getLogins(),{classes:i,cx:l}=Zae(),[c,u]=f.useState(!1);return s.createElement(Wk,{height:60,p:8,style:{zIndex:101}},s.createElement(Z,{position:"apart"},s.createElement(Z,{spacing:"xs"},s.createElement(ho,{className:i.logoButton,onClick:e.navbarToggle},e.logo),s.createElement(Gae,{pathname:e.pathname,searchParams:e.searchParams})),s.createElement(Q,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:c,onClose:()=>u(!1)},s.createElement(Q.Target,null,s.createElement(ho,{className:l(i.user,{[i.userActive]:c}),onClick:()=>u(v=>!v)},s.createElement(Z,{spacing:7},s.createElement(ua,{value:n,radius:"xl",size:24}),s.createElement(ae,{size:"sm",className:i.userName},gc((d=n==null?void 0:n.name)==null?void 0:d[0])),s.createElement(yae,{size:12,stroke:1.5})))),s.createElement(Q.Dropdown,null,s.createElement(je,{align:"center",p:"xl"},s.createElement(ua,{size:"xl",radius:100,value:t.profile}),s.createElement(r1,{value:(h=(p=t.profile)==null?void 0:p.name)==null?void 0:h[0]}),s.createElement(ae,{color:"dimmed",size:"xs"},(g=r.getActiveLogin())==null?void 0:g.project.display)),a.length>1&&s.createElement(Q.Divider,null),a.map(v=>v.profile.reference!==ct(t.profile)&&s.createElement(Q.Item,{key:v.profile.reference,onClick:()=>{r.setActiveLogin(v).then(()=>window.location.reload()).catch(console.log)}},s.createElement(Z,null,s.createElement(hf,{radius:"xl"}),s.createElement("div",{style:{flex:1}},s.createElement(ae,{size:"sm",weight:500},v.profile.display),s.createElement(ae,{color:"dimmed",size:"xs"},v.project.display))))),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Aae,{size:14,stroke:1.5}),onClick:()=>o("/signin")},"Add another account"),s.createElement(Q.Item,{icon:s.createElement(Rv,{size:14,stroke:1.5}),onClick:()=>o(`/${ct(n)}`)},"Account settings"),s.createElement(Q.Item,{icon:s.createElement(Cae,{size:14,stroke:1.5}),onClick:async()=>{await r.signOut(),o("/signin")}},"Sign out"),s.createElement(ae,{size:"xs",color:"dimmed",align:"center"},e.version)))))}function tie(e){let t={};for(let r of Array.from(e.elements))r instanceof HTMLInputElement?rie(t,r):r instanceof HTMLTextAreaElement?t[r.name]=r.value:r instanceof HTMLSelectElement&&nie(t,r);return t}function rie(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function nie(e,t){e[t.name]=t.value}function Ne(e){return s.createElement("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();let r=tie(t.target);e.onSubmit&&e.onSubmit(r)}},e.children)}function oie(e){let t=re(),r=t.getUserConfiguration();function n(o){var u,d,p;let{menuname:a,bookmarkname:i}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=$l(r);(p=(d=(u=c.menu)==null?void 0:u.find(({title:h})=>h===a))==null?void 0:d.link)==null||p.push({name:i,target:l}),t.updateResource(c).then(h=>{r.menu=h.menu,t.dispatchEvent({type:"change"}),de({color:"green",message:"Success"}),e.onOk()}).catch(h=>{de({color:"red",message:Ce(h)})})}return s.createElement(Cr,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel},s.createElement(Ne,{onSubmit:n},s.createElement(je,null,s.createElement(aie,{config:r}),s.createElement(oe,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"bookmark name",withAsterisk:!0}),s.createElement(Z,{position:"right"},s.createElement(Y,{mt:"sm",type:"submit"},"OK")))))}function aie(e){function t(n){var o;return(o=n==null?void 0:n.menu)==null?void 0:o.map(a=>a.title)}let r=t(e.config);return s.createElement(dt,{name:"menuname",defaultValue:r[0],label:"Select Menu Option",placeholder:"Menu",data:r,withAsterisk:!0})}function o1(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function iie(e){return typeof e.display=="string"?e.display:o1(e)}function lie(e){return{value:o1(e),label:iie(e),resource:e}}function sie(e){return{code:e,display:e}}function Ym(e){let t=re(),{elementDefinition:r,creatable:n,clearable:o,...a}=e,i=f.useCallback(async(l,c)=>{var h;if(!r.binding)return[];let u=r.binding.valueSet,d=(h=(await t.searchValueSet(u,l,{signal:c})).expansion)==null?void 0:h.contains,p=[];for(let g of d)g.code&&!p.some(v=>v.code===g.code)&&p.push(g);return p},[t,r]);return s.createElement(n1,{...a,creatable:n??!0,clearable:o??!0,toKey:o1,toOption:lie,loadOptions:i,onCreate:sie,getCreateLabel:n===!1?void 0:l=>`+ Create ${l}`})}function Y5(e){let[t,r]=f.useState(e.defaultValue);function n(o){let a=o[0],i=uie(a);r(i),e.onChange&&e.onChange(i)}return s.createElement(Ym,{elementDefinition:e.property,name:e.name,placeholder:e.placeholder,defaultValue:cie(t),onChange:n,creatable:e.creatable,maxSelectedValues:e.maxSelectedValues??1,clearSearchOnChange:e.clearSearchOnChange,clearable:e.clearable})}function cie(e){return e?{code:e}:void 0}function uie(e){return e==null?void 0:e.code}var X5=U(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 die(e){var c;let{classes:t}=X5(),r=Gm(),n=mie(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.createElement(s.Fragment,null,s.createElement(_s,{width:{sm:250},p:"xs"},s.createElement(Sl,null,s.createElement(_s.Section,{mb:"sm"},s.createElement(Y5,{key:window.location.pathname,name:"resourceType",placeholder:"Resource Type",property:{binding:{valueSet:"https://medplum.com/fhir/ValueSet/resource-types"}},onChange:u=>l(u),creatable:!1,maxSelectedValues:0,clearSearchOnChange:!0,clearable:!1})),s.createElement(_s.Section,{grow:!0},(c=e.menus)==null?void 0:c.map(u=>{var d;return s.createElement(s.Fragment,{key:`menu-${u.title}`},s.createElement(ae,{className:t.menuTitle},u.title),(d=u.links)==null?void 0:d.map(p=>s.createElement(fie,{key:p.href,to:p.href,active:p.href===(n==null?void 0:n.href),onClick:h=>i(h,p.href)},s.createElement(pie,{to:p.href,icon:p.icon}),s.createElement("span",null,p.label))))}),e.displayAddBookmark&&s.createElement(Y,{variant:"subtle",size:"xs",mt:"xl",leftIcon:s.createElement(Tae,{size:"0.75rem"}),onClick:()=>a(!0)},"Add Bookmark")))),e.pathname&&e.searchParams&&s.createElement(oie,{pathname:e.pathname,searchParams:e.searchParams,visible:o,onOk:()=>a(!1),onCancel:()=>a(!1)}))}function fie(e){let{classes:t,cx:r}=X5();return s.createElement(Re,{onClick:e.onClick,to:e.to,className:r(t.link,{[t.linkActive]:e.active})},e.children)}function pie(e){return e.icon?e.icon:s.createElement(Bm,{w:30})}function mie(e,t,r){if(!e||!t||!r)return;let n,o=0;for(let a of r)if(a.links)for(let i of a.links){let l=hie(e,t,i.href);l>o&&(o=l,n=i)}return n}function hie(e,t,r){let n=new URL(r,"https://example.com");if(e!==n.pathname)return 0;let o=["_count","_offset"];for(let[i,l]of n.searchParams.entries())if(!o.includes(i)&&t.get(i)!==l)return 0;let a=1;for(let[i,l]of t.entries())o.includes(i)||n.searchParams.get(i)===l&&a++;return a}function gie(e){var u;let t=tr(),[r,n]=f.useState(localStorage.navbarOpen==="true"),o=re(),a=F5();function i(d){localStorage.navbarOpen=d.toString(),n(d)}function l(){i(!1)}function c(){i(!r)}return o.isLoading()?s.createElement(ca,null):s.createElement(Qk,{styles:{main:{background:t.colorScheme==="dark"?t.colors.dark[8]:t.colors.gray[0]}},padding:0,fixed:!0,header:a&&s.createElement(eie,{pathname:e.pathname,searchParams:e.searchParams,logo:e.logo,version:e.version,navbarToggle:c}),navbar:a&&r?s.createElement(die,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:l,displayAddBookmark:e.displayAddBookmark}):void 0},s.createElement(Q5,{key:`${e.pathname}?${(u=e.searchParams)==null?void 0:u.toString()}`},s.createElement(f.Suspense,{fallback:s.createElement(ca,null)},e.children)))}function _c(e){let t=e.value,{contentType:r,url:n,title:o}=t??{};return n?s.createElement("div",{"data-testid":"attachment-display"},(r==null?void 0:r.startsWith("image/"))&&s.createElement("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:n,alt:t==null?void 0:t.title}),(r==null?void 0:r.startsWith("video/"))&&s.createElement("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0},s.createElement("source",{type:r,src:n})),r==="application/pdf"&&!(o!=null&&o.endsWith(".pdf"))&&s.createElement("div",{"data-testid":"attachment-pdf",style:{maxWidth:e.maxWidth,minHeight:400}},s.createElement("iframe",{width:"100%",height:"400",src:n+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})),s.createElement("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"}},s.createElement(Be,{href:t==null?void 0:t.url,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer"},(t==null?void 0:t.title)||"Download"))):null}function vie(e){var t;return s.createElement("div",null,(t=e.values)==null?void 0:t.map((r,n)=>s.createElement("div",{key:"attatchment-"+n},s.createElement(_c,{value:r,maxWidth:e.maxWidth}))))}function a1(e){let t=re(),r=f.useRef(null);function n(i){var l;ot(i),(l=r.current)==null||l.click()}function o(i){ot(i);let l=i.target.files;l&&Array.from(l).forEach(a)}function a(i){if(!i||!i.name)return;e.onUploadStart&&e.onUploadStart();let l=i.name,c=i.type||"application/octet-stream";t.createBinary(i,l,c,e.onUploadProgress).then(u=>{e.onUpload({contentType:u.contentType,url:u.url,title:l})}).catch(u=>{var d,p,h;alert((h=(p=(d=u.issue)==null?void 0:d[0])==null?void 0:p.details)==null?void 0:h.text)})}return s.createElement(s.Fragment,null,s.createElement("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:r,onChange:i=>o(i)}),e.children({onClick:n}))}function yie(e){let[t,r]=f.useState(e.defaultValue??[]),n=f.useRef();n.current=t;function o(a){r(a),e.onChange&&e.onChange(a)}return s.createElement("table",{style:{width:"100%"}},s.createElement("colgroup",null,s.createElement("col",{width:"97%"}),s.createElement("col",{width:"3%"})),s.createElement("tbody",null,t.map((a,i)=>s.createElement("tr",{key:`${i}-${t.length}`},s.createElement("td",null,s.createElement(_c,{value:a,maxWidth:200})),s.createElement("td",null,s.createElement(sr,{title:"Remove",size:"sm",onClick:l=>{ot(l);let c=t.slice();c.splice(i,1),o(c)}},s.createElement(Fp,null))))),s.createElement("tr",null,s.createElement("td",null),s.createElement("td",null,s.createElement(a1,{onUpload:a=>{o([...n.current,a])}},a=>s.createElement(sr,{...a,title:"Add",size:"sm",color:"green"},s.createElement(W5,{size:16})))))))}function J5(e){let[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return t?s.createElement(s.Fragment,null,s.createElement(_c,{value:t,maxWidth:200}),s.createElement(Y,{onClick:o=>{ot(o),n(void 0)}},"Remove")):s.createElement(a1,{onUpload:n},o=>s.createElement(Y,{...o},"Upload..."))}var Z5=["meta","implicitRules","language","text","contained","extension","modifierExtension"],wie=U(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 i1(e){let{children:t,compact:r}=e,{classes:n,cx:o}=wie();return s.createElement("dl",{className:o(n.root,{[n.compact]:r})},t)}function Ji(e){return s.createElement(s.Fragment,null,s.createElement("dt",null,e.term),s.createElement("dd",null,e.children))}function Kn(e){return s.createElement(s.Fragment,null,A0(e.value))}function _ie(e){return s.createElement(s.Fragment,null,M0(e.value))}function eN(e){let t=e.value;if(!t)return null;let 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.createElement(s.Fragment,null,r.join("").trim())}function bie(e){var r;let t=e.value;return t?s.createElement(s.Fragment,null,t.name,t.name&&": ",(r=t.telecom)==null?void 0:r.map(n=>s.createElement(eN,{key:`telecom-${t.name}-${n.value}`,value:n}))):null}function xie(e){var t,r;return s.createElement("div",null,(t=e.value)==null?void 0:t.system,": ",(r=e.value)==null?void 0:r.value)}function Eie(e){return s.createElement(s.Fragment,null,sne(e.value))}function Tv(e){return s.createElement(s.Fragment,null,Bo(e.value))}function l1(e){return s.createElement(s.Fragment,null,Gs(e.value))}function Sie(e){let t=e.value;return t?s.createElement(s.Fragment,null,s.createElement(Tv,{value:t.numerator})," / ",s.createElement(Tv,{value:t.denominator})):null}function Vp(e){if(!e.value)return null;let t=e.value.display||e.value.reference||Or(e.value);return e.link!==!1&&e.value.reference?s.createElement(Re,{to:e.value},t):s.createElement(s.Fragment,null,t)}function Pie(e){var o,a;let t=e.property,r=e.values??[],n=(a=(o=t.type)==null?void 0:o[0])==null?void 0:a.code;return s.createElement(s.Fragment,null,r.map((i,l)=>s.createElement("div",{key:`${l}-${r.length}`},s.createElement(So,{arrayElement:!0,property:t,propertyType:n,value:i,ignoreMissingValues:e.ignoreMissingValues,link:e.link}))))}function So(e){var o;let{property:t,propertyType:r,value:n}=e;if((o=t==null?void 0:t.path)!=null&&o.endsWith(".id"))return s.createElement(se,{component:"div",sx:{display:"flex",gap:3,alignItems:"center"}},n,s.createElement(dT,{value:n,timeout:2e3},({copied:a,copy:i})=>s.createElement(aZ,{label:a?"Copied":"Copy",withArrow:!0,position:"right"},s.createElement(sr,{color:a?"teal":"gray",onClick:i},a?s.createElement(U5,{size:"1rem"}):s.createElement(_ae,{size:"1rem"})))));if((t==null?void 0:t.max)==="*"&&!e.arrayElement)return r===X.Attachment?s.createElement(vie,{values:n,maxWidth:e.maxWidth}):s.createElement(Pie,{property:t,values:n,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(r){case X.boolean:return s.createElement(s.Fragment,null,n===void 0?"":(!!n).toString());case X.SystemString:case X.string:return s.createElement("div",{style:{whiteSpace:"pre-wrap"}},n);case X.code:case X.date:case X.decimal:case X.integer:case X.positiveInt:case X.unsignedInt:case X.uri:case X.url:return s.createElement(s.Fragment,null,n);case X.canonical:return s.createElement(Vp,{value:{reference:n},link:e.link});case X.dateTime:case X.instant:return s.createElement(s.Fragment,null,Pr(n));case X.markdown:return s.createElement("pre",null,n);case X.Address:return s.createElement(Zoe,{value:n});case X.Annotation:return s.createElement(s.Fragment,null,n==null?void 0:n.text);case X.Attachment:return s.createElement(_c,{value:n,maxWidth:e.maxWidth});case X.CodeableConcept:return s.createElement(Kn,{value:n});case X.Coding:return s.createElement(_ie,{value:n});case X.ContactDetail:return s.createElement(bie,{value:n});case X.ContactPoint:return s.createElement(eN,{value:n});case X.HumanName:return s.createElement(r1,{value:n});case X.Identifier:return s.createElement(xie,{value:n});case X.Money:return s.createElement(Eie,{value:n});case X.Period:return s.createElement(s.Fragment,null,nne(n));case X.Quantity:case X.Duration:return s.createElement(Tv,{value:n});case X.Range:return s.createElement(l1,{value:n});case X.Ratio:return s.createElement(Sie,{value:n});case X.Reference:return s.createElement(Vp,{value:n,link:e.link});case X.Timing:return s.createElement(s.Fragment,null,g5(n));case X.Dosage:case X.UsageContext:return s.createElement(Iv,{value:{type:r,value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues});default:if(!(t!=null&&t.path))throw Error(`Displaying property of type ${e.propertyType} requires element definition path`);return s.createElement(Iv,{value:{type:E5(t),value:n},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function Xa(e,t){let r=rn(e,t);return r?Array.isArray(r)?[r.map(n=>n.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function Iv(e){let t=e.value,r=t.value;if(!r)return null;let n=t.type,o=Ot.types[n];return o?typeof r=="object"&&"name"in r&&Object.keys(r).length===1&&typeof r.name=="string"?s.createElement("div",null,r.name):s.createElement(i1,{compact:e.compact},Object.entries(o.properties).map(a=>{let i=a[0];if(Z5.includes(i))return null;let l=a[1];l.path||(l.path=n+"."+i);let[c,u]=Xa(t,i);return e.ignoreMissingValues&&(!c||Array.isArray(c)&&c.length===0)?null:s.createElement(Ji,{key:i,term:zp(i)},s.createElement(So,{property:l,propertyType:u,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link}))})):s.createElement("div",null,n," not implemented")}function tN(e){return s.createElement(Z,{noWrap:!0},s.createElement("div",null,e.children),s.createElement("div",null,s.createElement(Ft.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk},(()=>null)())))}function at(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 rN((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(`
|
|
181
|
+
`)}function s1(e,t){var r;return(r=e==null?void 0:e.issue)==null?void 0:r.filter(n=>{var o;return rN((o=n.expression)==null?void 0:o[0],t)})}function rN(e,t){if(e===t)return!0;if(!e||!t)return!1;let r=e.indexOf(".");if(r>=0&&e.substring(r+1)===t)return!0;let n=t.indexOf(".");return n>=0&&t.substring(n+1)===e}function Xe(e){return s.createElement(Ft.Wrapper,{id:e.htmlFor,label:e.title,description:e.description,withAsterisk:e.withAsterisk,error:at(e.outcome,e.htmlFor)},e.children)}function nN(e){let t=re(),r=Ze(e.defaultValue),[n,o]=f.useState(),[a,i]=f.useState();return f.useEffect(()=>{r&&(i($l(r)),t.requestSchema(r.resourceType).then(o).catch(console.log))},[t,r]),!n||!a?s.createElement("div",null,"Loading..."):s.createElement("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.onSubmit&&e.onSubmit(a)}},s.createElement(je,{mb:"xl"},s.createElement(Xe,{title:"Resource Type",htmlFor:"resourceType",outcome:e.outcome},s.createElement(oe,{name:"resourceType",defaultValue:a.resourceType,disabled:!0})),s.createElement(Xe,{title:"ID",htmlFor:"id",outcome:e.outcome},s.createElement(oe,{name:"id",defaultValue:a.id,disabled:!0}))),s.createElement(Nv,{typeName:a.resourceType,defaultValue:a,outcome:e.outcome,onChange:i}),s.createElement(Z,{position:"right",mt:"xl"},s.createElement(Y,{type:"submit"},"OK"),e.onDelete&&s.createElement(Y,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(a)}},"Delete")))}function Dv(e,t,r,n,o){let a=n.type;if(a.length>1)for(let i of a){let l=t.replace("[x]",cr(i.code));l in e&&delete e[l]}return e[r]=o,e}function Oie(e){let[t,r]=f.useState(e.defaultValue);function n(o){let a=Cie(o);r(a),e.onChange&&e.onChange(a)}return s.createElement(Ym,{elementDefinition:e.property,name:e.name,placeholder:e.placeholder,defaultValue:t&&$ie(t),maxSelectedValues:1,onChange:n})}function $ie(e){var t;return(t=e.coding)==null?void 0:t.map(r=>({system:r.system,code:r.code,display:r.display}))}function Cie(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function kie(e){let[t,r]=f.useState(e.defaultValue);function n(o){let a=o[0],i=a&&Rie(a);r(i),e.onChange&&e.onChange(i)}return s.createElement(Ym,{elementDefinition:e.property,name:e.name,placeholder:e.placeholder,defaultValue:t&&jie(t),maxSelectedValues:1,onChange:n})}function jie(e){return{system:e.system,code:e.code,display:e.display}}function Rie(e){return{system:e.system,code:e.code,display:e.display}}function oN(e){let[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){let u={...n.current,system:c};c||delete u.system,o(u)}function i(c){let u={...n.current,use:c};c||delete u.use,o(u)}function l(c){let u={...n.current,value:c};c||delete u.value,o(u)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(dt,{"data-testid":"system",defaultValue:t==null?void 0:t.system,onChange:c=>a(c.currentTarget.value),data:["","email","phone","fax","pager","sms","other"]}),s.createElement(dt,{"data-testid":"use",defaultValue:t==null?void 0:t.use,onChange:c=>i(c.currentTarget.value),data:["","home","work","temp","old","mobile"]}),s.createElement(oe,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:c=>l(c.currentTarget.value)}))}function Tie(e){var l;let[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){let u={...n.current,name:c};c||delete u.name,o(u)}function i(c){let u={...n.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(oe,{"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.createElement(oN,{name:e.name+"-telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:i}))}function Ja(e){return s.createElement(oe,{id:e.name,name:e.name,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:Die(),defaultValue:Iie(e.defaultValue),autoFocus:e.autoFocus,error:at(e.outcome,e.name),onChange:t=>{if(e.onChange){let r=t.currentTarget.value;e.onChange(aN(r))}}})}function Iie(e){if(!e)return"";let t=new Date(e);return Wm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function aN(e){if(!e)return"";let t=new Date(e);return Wm(t)?t.toISOString():""}function Die(){return"datetime-local"}function Nie(e){return s.createElement(dc,{id:e.name,name:e.name,"data-testid":"extension-input",defaultValue:Or(e.defaultValue),deserialize:JSON.parse,onChange:t=>{e.onChange&&e.onChange(JSON.parse(t))}})}function Aie(e){var d,p,h;let[t,r]=f.useState(e.defaultValue),n=f.useRef();n.current=t;function o(g){r(g),e.onChange&&e.onChange(g)}function a(g){o({...n.current,use:g||void 0})}function i(g){o({...n.current,prefix:g?g.split(" "):void 0})}function l(g){o({...n.current,given:g?g.split(" "):void 0})}function c(g){o({...n.current,family:g||void 0})}function u(g){o({...n.current,suffix:g?g.split(" "):void 0})}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(dt,{defaultValue:t==null?void 0:t.use,name:e.name+"-use","data-testid":"use",onChange:g=>a(g.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"]}),s.createElement(oe,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(d=t==null?void 0:t.prefix)==null?void 0:d.join(" "),onChange:g=>i(g.currentTarget.value)}),s.createElement(oe,{placeholder:"Given",name:e.name+"-given",defaultValue:(p=t==null?void 0:t.given)==null?void 0:p.join(" "),onChange:g=>l(g.currentTarget.value)}),s.createElement(oe,{name:e.name+"-family",placeholder:"Family",defaultValue:t==null?void 0:t.family,onChange:g=>c(g.currentTarget.value)}),s.createElement(oe,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(h=t==null?void 0:t.suffix)==null?void 0:h.join(" "),onChange:g=>u(g.currentTarget.value)}))}function Mie(e){let[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(oe,{placeholder:"System",defaultValue:t==null?void 0:t.system,onChange:o=>n({...t,system:o.currentTarget.value})}),s.createElement(oe,{placeholder:"Value",defaultValue:t==null?void 0:t.value,onChange:o=>n({...t,value:o.currentTarget.value})}))}var zie=["USD","EUR","CAD","GBP","AUD"];function Lie(e){var c;let{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.createElement(dt,{defaultValue:r==null?void 0:r.currency,data:zie,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:a});return s.createElement(oe,{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.createElement(bae,{size:14}),rightSection:l,rightSectionWidth:92,onChange:i})}function Fie(e){let[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(Ja,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>n({...t,start:o})}),s.createElement(Ja,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>n({...t,end:o})}))}function Za(e){let[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(dt,{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.createElement(oe,{id:e.name,name:e.name,"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:Vie(o.currentTarget.value)})}}),s.createElement(oe,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>n({...t,unit:o.currentTarget.value})}))}function Vie(e){if(e)return parseFloat(e)}function c1(e){let[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(Za,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>n({...t,low:o})}),s.createElement(Za,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>n({...t,high:o})}))}function Bie(e){let[t,r]=f.useState(e.defaultValue);function n(o){r(o),e.onChange&&e.onChange(o)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(Za,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>n({...t,numerator:o})}),s.createElement(Za,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>n({...t,denominator:o})}))}var Uie={Observation:"code",User:"email:contains"},Wie=["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 Hie(e){return{value:ct(e),label:xo(e),resource:e}}function Cl(e){let t=re(),r=e.resourceType,[n,o]=f.useState(),a=Ze(e.defaultValue,o),i=e.onChange,l=f.useCallback(async(u,d)=>{let p=Gie(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.createElement(n1,{name:e.name,itemComponent:qie,defaultValue:a,placeholder:e.placeholder,maxSelectedValues:1,toKey:ct,toOption:Hie,loadOptions:l,onChange:c,clearable:!0})}var qie=f.forwardRef(({label:e,resource:t,...r},n)=>s.createElement("div",{ref:n,...r},s.createElement(Z,{noWrap:!0},s.createElement(ua,{value:t}),s.createElement("div",null,s.createElement(ae,null,e),s.createElement(ae,{size:"xs",color:"dimmed"},t.birthDate)))));function Gie(e){return Uie[e]??(Wie.includes(e)?"name":"_id")}function Xm(e){let t=Qie(e.targetTypes),r=Kie(e.defaultValue,t),[n,o]=f.useState(e.defaultValue),[a,i]=f.useState(r),l=f.useRef();l.current=n;let c=f.useRef();c.current=a;function u(d){o(d),e.onChange&&e.onChange(d)}return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},t?s.createElement(dt,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:a,autoFocus:e.autoFocus,onChange:d=>i(d.currentTarget.value),data:t}):s.createElement(oe,{"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-input",defaultValue:a,autoFocus:e.autoFocus,onChange:d=>i(d.currentTarget.value)}),s.createElement(Cl,{resourceType:a,name:e.name+"-id",placeholder:e.placeholder,defaultValue:n,onChange:d=>{u(d?ut(d):void 0)}}))}function Qie(e){if(!(!e||e.length===0||e.length===1&&e[0]==="Resource"))return e}function Kie(e,t){var n;let 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 Yie(e){let[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.createElement("table",{style:{width:"100%",borderCollapse:"collapse"}},s.createElement("colgroup",null,s.createElement("col",{width:"97%"}),s.createElement("col",{width:"3%"})),s.createElement("tbody",null,t.map((a,i)=>s.createElement("tr",{key:`${i}-${t.length}`},s.createElement("td",null,s.createElement(ei,{arrayElement:!0,property:e.property,name:e.name+"."+i,defaultValue:a,onChange:l=>{let c=[...n.current];c[i]=l,o(c)}})),s.createElement("td",{style:{textAlign:"right"}},s.createElement(sr,{title:"Remove",size:"sm",onClick:l=>{ot(l);let c=[...n.current];c.splice(i,1),o(c)}},s.createElement(Fp,null))))),s.createElement("tr",null,s.createElement("td",null),s.createElement("td",{style:{textAlign:"right"}},s.createElement(sr,{title:"Add",size:"sm",color:"green",onClick:a=>{ot(a);let i=[...n.current];i.push(void 0),o(i)}},s.createElement(Z0,null))))))}var Xie=["sun","mon","tue","wed","thu","fri","sat"];function Jie(e){let[t,r]=f.useState(e.defaultValue),[n,o]=f.useState(!1),a=f.useRef();return a.current=t,s.createElement(s.Fragment,null,s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement("span",null,g5(a.current)||"No repeat"),s.createElement(Y,{onClick:()=>o(!0)},"Edit")),s.createElement(Zie,{visible:n,defaultValue:a.current,onOk:i=>{e.onChange&&e.onChange(i),r(i),o(!1)},onCancel:()=>o(!1)}))}var QP={repeat:{period:1,periodUnit:"d"}};function Zie(e){let[t,r]=f.useState(e.defaultValue||QP),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.createElement(Cr,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel()},s.createElement(je,null,s.createElement(Xe,{title:"Starts on",htmlFor:"timing-dialog-start"},s.createElement(Ja,{name:"timing-dialog-start",onChange:u=>o(u)})),s.createElement(T0,{label:"Repeat",checked:!!t.repeat,onChange:u=>a(u.currentTarget.checked?QP.repeat:void 0)}),t.repeat&&s.createElement(s.Fragment,null,s.createElement(Xe,{title:"Repeat every",htmlFor:"timing-dialog-period"},s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(oe,{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.createElement(dt,{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.createElement(Xe,{title:"Repeat on"},s.createElement(kf.Group,{multiple:!0,onChange:c},s.createElement(Z,{position:"apart",mt:"md",spacing:"xs"},Xie.map(u=>s.createElement(kf,{key:u,value:u,size:"xs",radius:"xl"},u.charAt(0).toUpperCase())))))),s.createElement(Z,{position:"right"},s.createElement(Y,{onClick:()=>e.onOk(t)},"OK"))))}function ei(e){var i,l;let t=e.property,r=e.defaultPropertyType??((l=(i=t.type)==null?void 0:i[0])==null?void 0:l.code),n=e.name,o=e.defaultValue;if(t.max==="*"&&!e.arrayElement)return r===X.Attachment?s.createElement(yie,{name:n,defaultValue:o,onChange:e.onChange}):s.createElement(Yie,{property:t,name:n,defaultValue:o,onChange:e.onChange});let a=t.type;return a.length>1?s.createElement(ele,{elementDefinitionTypes:a,...e}):s.createElement(iN,{elementDefinitionType:a[0],...e})}function ele(e){let t=e.elementDefinitionTypes,r;e.defaultPropertyType&&(r=t.find(a=>a.code===e.defaultPropertyType)),r||(r=t[0]);let[n,o]=f.useState(r);return s.createElement(Z,{spacing:"xs",grow:!0,noWrap:!0},s.createElement(dt,{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.createElement(iN,{...e,elementDefinitionType:n,onChange:a=>{e.onChange&&e.onChange(a,e.name.replace("[x]",cr(n.code)))}}))}function iN(e){let t=e.property,r=e.elementDefinitionType.code,n=e.name,o=e.defaultValue,a=t.min!==void 0&&t.min>0;switch(r){case X.SystemString:case X.canonical:case X.string:case X.time:case X.uri:case X.url:return s.createElement(oe,{id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:i=>{e.onChange&&e.onChange(i.currentTarget.value)},error:at(e.outcome,n)});case X.date:return s.createElement(oe,{type:"date",id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:i=>{e.onChange&&e.onChange(i.currentTarget.value)},error:at(e.outcome,n)});case X.dateTime:case X.instant:return s.createElement(Ja,{name:n,defaultValue:o,onChange:e.onChange,outcome:e.outcome});case X.decimal:case X.integer:case X.positiveInt:case X.unsignedInt:return s.createElement(oe,{type:"number",step:r===X.decimal?"any":"1",id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:i=>{e.onChange&&e.onChange(i.currentTarget.valueAsNumber)}});case X.code:return s.createElement(Y5,{property:t,name:n,defaultValue:o,onChange:e.onChange});case X.boolean:return s.createElement(kn,{id:n,name:n,"data-testid":n,defaultChecked:!!o,onChange:i=>{e.onChange&&e.onChange(i.currentTarget.checked)}});case X.markdown:return s.createElement(uc,{id:n,name:n,"data-testid":n,defaultValue:o,required:a,onChange:i=>{e.onChange&&e.onChange(i.currentTarget.value)}});case X.Address:return s.createElement(eae,{name:n,defaultValue:o,onChange:e.onChange});case X.Annotation:return s.createElement(nae,{name:n,defaultValue:o,onChange:e.onChange});case X.Attachment:return s.createElement(J5,{name:n,defaultValue:o,onChange:e.onChange});case X.CodeableConcept:return s.createElement(Oie,{property:t,name:n,defaultValue:o,onChange:e.onChange});case X.Coding:return s.createElement(kie,{property:t,name:n,defaultValue:o,onChange:e.onChange});case X.ContactDetail:return s.createElement(Tie,{name:n,defaultValue:o,onChange:e.onChange});case X.ContactPoint:return s.createElement(oN,{name:n,defaultValue:o,onChange:e.onChange});case X.Extension:return s.createElement(Nie,{name:n,defaultValue:o,onChange:e.onChange});case X.HumanName:return s.createElement(Aie,{name:n,defaultValue:o,onChange:e.onChange});case X.Identifier:return s.createElement(Mie,{name:n,defaultValue:o,onChange:e.onChange});case X.Money:return s.createElement(Lie,{name:n,defaultValue:o,onChange:e.onChange});case X.Period:return s.createElement(Fie,{name:n,defaultValue:o,onChange:e.onChange});case X.Duration:case X.Quantity:return s.createElement(Za,{name:n,defaultValue:o,onChange:e.onChange});case X.Range:return s.createElement(c1,{name:n,defaultValue:o,onChange:e.onChange});case X.Ratio:return s.createElement(Bie,{name:n,defaultValue:o,onChange:e.onChange});case X.Reference:return s.createElement(Xm,{name:n,defaultValue:o,targetTypes:tle(t),onChange:e.onChange});case X.Timing:return s.createElement(Jie,{name:n,defaultValue:o,onChange:e.onChange});case X.Dosage:case X.UsageContext:return s.createElement(Nv,{typeName:r,defaultValue:o,onChange:e.onChange,outcome:e.outcome});default:return s.createElement(Nv,{typeName:E5(t),defaultValue:o,onChange:e.onChange,outcome:e.outcome})}}function tle(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 Nv(e){let[t,r]=f.useState(e.defaultValue??{});function n(l){r(l),e.onChange&&e.onChange(l)}let o=e.typeName,a=Ot.types[o];if(!a)return s.createElement("div",null,o," not implemented");let i={type:o,value:t};return s.createElement(je,null,Object.entries(a.properties).map(l=>{let c=l[0];if(c==="id"||Z5.includes(c))return null;let u=l[1];if(!u.type)return null;let[d,p]=Xa(i,c),h=u.min!==void 0&&u.min>0;return u.type.length===1&&u.type[0].code==="boolean"?s.createElement(tN,{key:c,title:zp(c),description:u.definition,htmlFor:c},s.createElement(ei,{property:u,name:c,defaultValue:d,defaultPropertyType:p,outcome:e.outcome,onChange:(g,v)=>{n(Dv(t,c,v??c,l[1],g))}})):s.createElement(Xe,{key:c,title:zp(c),description:u.definition,withAsterisk:h,htmlFor:c,outcome:e.outcome},s.createElement(ei,{property:u,name:c,defaultValue:d,defaultPropertyType:p,onChange:(g,v)=>{n(Dv(t,c,v??c,l[1],g))}}))}))}var rle=U(()=>({root:{"@media (max-width: 800px)":{paddingLeft:4,paddingRight:4}}}));function bc(e){let{children:t,...r}=e,{classes:n}=rle();return s.createElement(sT,{className:n.root,...r},t)}var nle=U(e=>({noteBody:{fontSize:e.fontSizes.sm},noteCite:{fontSize:e.fontSizes.xs,marginBlockStart:3},noteRoot:{padding:5}}));function lN({value:e}){let{classes:t}=nle();return e?s.createElement(je,{justify:"flex-start",spacing:"xs"},e.map(r=>{var n;return r.text&&s.createElement(RR,{key:`note-${r.text}`,classNames:{cite:t.noteCite,body:t.noteBody,root:t.noteRoot},cite:((n=r.authorReference)==null?void 0:n.display)||r.authorString,icon:null},r.text)})):null}function xc(e){let{value:t,link:r,...n}=e,[o,a]=f.useState(),i=Ze(t,a),l;if(o&&!m5(o))l=`[${Ce(o)}]`;else if(i)l=xo(i);else return null;return r?s.createElement(Re,{to:t,...n},l):s.createElement(ae,{component:"span",...n},l)}function Zi(e){return s.createElement(Z,{spacing:"xs"},s.createElement(ua,{size:24,radius:12,value:e.value,link:e.link}),s.createElement(xc,{value:e.value,link:e.link}))}var ole={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 sN(e){return s.createElement(kW,{color:ole[e.status]},e.status)}var cN=U(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}}));u1.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function u1(e){var i;let t=re(),r=Ze(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;let a=(n==null?void 0:n.flatMap(l=>l.note||[]))||[];if(r.presentedForm&&r.presentedForm.length>0){let l=r.presentedForm[0];(i=l.contentType)!=null&&i.startsWith("text/plain")&&l.data&&a.push({text:window.atob(l.data)})}return s.createElement(je,null,s.createElement(fe,null,"Diagnostic Report"),s.createElement(ale,{value:r}),!e.hideSpecimenInfo&&ile(n),r.result&&s.createElement(lle,{hideObservationNotes:e.hideObservationNotes,value:r.result}),a.length>0&&s.createElement(lN,{value:a}))}function ale({value:e}){var t,r;return s.createElement(Z,{mt:"md",spacing:30},e.subject&&s.createElement("div",null,s.createElement(ae,{size:"xs",transform:"uppercase",color:"dimmed"},"Subject"),s.createElement(ae,null,s.createElement(Zi,{value:e.subject,link:!0}))),(t=e.resultsInterpreter)==null?void 0:t.map(n=>s.createElement("div",{key:n.reference},s.createElement(ae,{size:"xs",transform:"uppercase",color:"dimmed"},"Interpreter"),s.createElement(ae,null,s.createElement(Zi,{value:n,link:!0})))),(r=e.performer)==null?void 0:r.map(n=>s.createElement("div",{key:n.reference},s.createElement(ae,{size:"xs",transform:"uppercase",color:"dimmed"},"Performer"),s.createElement(ae,null,s.createElement(Zi,{value:n,link:!0})))),e.issued&&s.createElement("div",null,s.createElement(ae,{size:"xs",transform:"uppercase",color:"dimmed"},"Issued"),s.createElement(ae,null,Pr(e.issued))),e.status&&s.createElement("div",null,s.createElement(ae,{size:"xs",transform:"uppercase",color:"dimmed"},"Status"),s.createElement(ae,null,cr(e.status))))}function ile(e){return s.createElement(je,{spacing:"xs"},s.createElement(fe,{order:2,size:"h6"},"Specimens"),s.createElement(wr,{type:"ordered"},e==null?void 0:e.map(t=>{var r;return s.createElement(wr.Item,{ml:"sm",key:`specimen-${t.id}`},s.createElement(Z,{spacing:20},s.createElement(Z,{spacing:5},s.createElement(ae,{fw:500},"Collected:")," ",Pr((r=t.collection)==null?void 0:r.collectedDateTime)),s.createElement(Z,{spacing:5},s.createElement(ae,{fw:500},"Received:")," ",Pr(t.receivedTime))))})))}function lle(e){let{classes:t}=cN();return s.createElement("table",{className:t.table},s.createElement("thead",null,s.createElement("tr",null,s.createElement("th",null,"Test"),s.createElement("th",null,"Value"),s.createElement("th",null,"Reference Range"),s.createElement("th",null,"Interpretation"),s.createElement("th",null,"Category"),s.createElement("th",null,"Performer"),s.createElement("th",null,"Status"))),s.createElement("tbody",null,s.createElement(uN,{value:e.value,hideObservationNotes:e.hideObservationNotes})))}function uN(e){var t;return s.createElement(s.Fragment,null,(t=e.value)==null?void 0:t.map(r=>s.createElement(sle,{key:`obs-${vc(r)?r.reference:r.id}`,hideObservationNotes:e.hideObservationNotes,value:r})))}function sle(e){var i;let{classes:t,cx:r}=cN(),n=Ze(e.value);if(!n)return null;let o=!e.hideObservationNotes&&n.note,a=dle(n);return s.createElement(s.Fragment,null,s.createElement("tr",{className:r({[t.criticalRow]:a})},s.createElement("td",{rowSpan:o?2:1},s.createElement(Re,{to:n},s.createElement(Kn,{value:n.code}))),s.createElement("td",null,s.createElement(cle,{value:n})),s.createElement("td",null,s.createElement(ule,{value:n.referenceRange})),s.createElement("td",null,n.interpretation&&n.interpretation.length>0&&s.createElement(Kn,{value:n.interpretation[0]})),s.createElement("td",null,n.category&&n.category.length>0&&s.createElement(s.Fragment,null,n.category.map(l=>s.createElement("div",{key:`category-${A0(l)}`},s.createElement(Kn,{value:l}))))),s.createElement("td",null,(i=n.performer)==null?void 0:i.map(l=>s.createElement(Vp,{key:l.reference,value:l}))),s.createElement("td",null,n.status&&s.createElement(sN,{status:n.status}))),n.hasMember&&s.createElement(uN,{value:n.hasMember,hideObservationNotes:e.hideObservationNotes}),o&&s.createElement("tr",null,s.createElement("td",{colSpan:6},s.createElement(lN,{value:n.note}))))}function cle(e){let t=e.value;return s.createElement(s.Fragment,null,v5(t))}function ule(e){let t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.createElement(s.Fragment,null,t.text):s.createElement(l1,{value:t}):null}function dle(e){var r,n,o,a;let 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"}var fle=U((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%"}}})),ple={shadow:"xs",radius:"md",withBorder:!0};function d1(e){let{className:t,children:r,width:n,fill:o,unstyled:a,...i}=H("Panel",ple,e),{classes:l,cx:c}=fle({width:n,fill:o},{name:"Panel",unstyled:a});return s.createElement(Pn,{className:c(l.paper,t),...i},r)}var mle=U(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 hle(e){let{classes:t}=mle(),r=re(),[n,o]=f.useState();if(f.useEffect(()=>{r.requestSchema(e.original.resourceType).then(o).catch(console.log)},[r,e.original.resourceType]),!n)return null;let a=n.types[e.original.resourceType];return a?s.createElement("table",{className:t.root},s.createElement("colgroup",null,s.createElement("col",{style:{width:"30%"}}),s.createElement("col",{style:{width:"35%"}}),s.createElement("col",{style:{width:"35%"}})),s.createElement("thead",null,s.createElement("tr",null,s.createElement("th",null,"Property"),s.createElement("th",null,"Before"),s.createElement("th",null,"After"))),s.createElement("tbody",null,Object.entries(a.properties).map(i=>{let l=i[0];if(l==="id"||l==="meta")return null;let c=i[1],[u,d]=Xa(Jn(e.original),l),[p,h]=Xa(Jn(e.revised),l);return KP(u)&&KP(p)||Or(u)===Or(p)?null:s.createElement("tr",{key:l},s.createElement("td",null,zp(l)),s.createElement("td",{className:t.removed},s.createElement(So,{property:c,propertyType:d,value:u,ignoreMissingValues:!0})),s.createElement("td",{className:t.added},s.createElement(So,{property:c,propertyType:h,value:p,ignoreMissingValues:!0})))}))):null}function KP(e){return!e||Array.isArray(e)&&e.length===0||typeof e=="object"&&Object.keys(e).length===0}function f1(e){let t=re(),r=Ze(e.value),[n,o]=f.useState();return f.useEffect(()=>{r&&t.requestSchema(r.resourceType).then(o).catch(console.log)},[t,r]),!n||!r?null:s.createElement(Iv,{value:{type:r.resourceType,value:e.forceUseInput?e.value:r},ignoreMissingValues:e.ignoreMissingValues})}function gle(e){return s.createElement(bc,null,e.children)}function ti(e){var c,u;let{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.createElement(d1,{"data-testid":"timeline-item",fill:!0,...a},s.createElement(Z,{position:"apart",spacing:8,mx:"xs",my:"sm"},s.createElement(ua,{value:i,link:!0,size:"md"}),s.createElement("div",{style:{flex:1}},s.createElement(ae,{size:"sm"},s.createElement(xc,{color:"dark",weight:500,value:i,link:!0})),s.createElement(ae,{size:"xs"},s.createElement(Re,{color:"dimmed",to:e.resource},Pr(l)),s.createElement(ae,{component:"span",color:"dimmed",mx:8},"·"),s.createElement(Re,{color:"dimmed",to:e.resource},e.resource.resourceType))),o&&s.createElement(Q,{position:"bottom-end",shadow:"md",width:200},s.createElement(Q.Target,null,s.createElement(sr,{radius:"xl","aria-label":`Actions for ${ct(e.resource)}`},s.createElement(xae,null))),o)),s.createElement(Q5,null,n&&s.createElement("div",{style:{padding:"0 16px 16px 16px"}},e.children),!n&&s.createElement(s.Fragment,null,e.children)))}function dN(e,t){e.sort((r,n)=>{let o=YP(r,t),a=YP(n,t);return o>a?1:o<a?-1:XP(r,t)-XP(n,t)})}function YP(e,t){if(!fN(e,t)){let r=e.priority;if(typeof r=="string")return{stat:4,asap:3,urgent:2}[r]??0}return 0}function XP(e,t){var n;if(!fN(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()}let r=(n=e.meta)==null?void 0:n.lastUpdated;return r?new Date(r).getTime():0}function fN(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}var vle=U(e=>({pinnedComment:{backgroundColor:e.colors.blue[0]}}));function Jm(e){let t=re(),r=Gm(),n=t.getProfile(),o=f.useRef(null),a=Ze(e.value),[i,l]=f.useState(),[c,u]=f.useState([]),d=e.loadTimelineResources,p=f.useRef(c);p.current=c;let h=f.useCallback(k=>{dN(k,a),k.reverse(),u(k)},[a]),g=f.useCallback(k=>{let I=[];for(let z of k){if(z.status!=="fulfilled")continue;let N=z.value;if(N.type==="history"&&l(N),N.entry)for(let F of N.entry)I.push(F.resource)}h(I)},[h]),v=f.useCallback(k=>h([...p.current,k]),[h]),w=f.useCallback(()=>{var z;let k,I;"resourceType"in e.value?(k=e.value.resourceType,I=e.value.id):[k,I]=(z=e.value.reference)==null?void 0:z.split("/"),d(t,k,I).then(g).catch(console.log)},[t,e.value,d,g]);f.useEffect(()=>w(),[w]);function E(k){!a||!e.createCommunication||t.createResource(e.createCommunication(a,n,k)).then(I=>v(I)).catch(console.log)}function _(k){!a||!e.createMedia||t.createResource(e.createMedia(a,n,k)).then(I=>v(I)).then(()=>Ju({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.createElement(U5,{size:16}),autoClose:2e3})).catch(I=>Ju({id:"upload-notification",color:"red",title:"Upload error",message:Ce(I),icon:s.createElement(Sae,{size:16}),autoClose:2e3}))}function y(k,I){return t.updateResource({...k,priority:I})}function x(k){y(k,"stat").then(w).catch(console.log)}function b(k){y(k,"routine").then(w).catch(console.log)}function S(k){r(`/${k.resourceType}/${k.id}`)}function $(k){r(`/${k.resourceType}/${k.id}/edit`)}function O(k){r(`/${k.resourceType}/${k.id}/delete`)}function C(k){var I;r(`/${k.resourceType}/${k.id}/_history/${(I=k.meta)==null?void 0:I.versionId}`)}function T(){de({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function j(k){Ju({id:"upload-notification",loading:!0,title:"Uploading...",message:Sle(k),autoClose:!1,withCloseButton:!1})}return a?s.createElement(gle,null,e.createCommunication&&s.createElement(d1,null,s.createElement(Ne,{testid:"timeline-form",onSubmit:k=>{E(k.text);let I=o.current;I&&(I.value="",I.focus())}},s.createElement(Z,{spacing:"xs",noWrap:!0,style:{width:"100%"}},s.createElement(ua,{value:n}),s.createElement(oe,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.createElement(sr,{type:"submit",radius:"xl",color:"blue",variant:"filled"},s.createElement(kae,{size:16})),s.createElement(a1,{onUpload:_,onUploadStart:T,onUploadProgress:j},k=>s.createElement(sr,{...k,radius:"xl",color:"blue",variant:"filled"},s.createElement(W5,{size:16})))))),c.map(k=>{var z;if(!k)return null;let I=`${k.resourceType}/${k.id}/${(z=k.meta)==null?void 0:z.versionId}`;if(k.resourceType===a.resourceType&&k.id===a.id)return s.createElement(yle,{key:I,history:i,resource:k,onDetails:C});switch(k.resourceType){case"AuditEvent":return s.createElement(xle,{key:I,resource:k,onDetails:S});case"Communication":return s.createElement(_le,{key:I,resource:k,onPin:k.priority!=="stat"?x:void 0,onUnpin:k.priority==="stat"?b:void 0,onDetails:S,onEdit:$,onDelete:O});case"DiagnosticReport":return s.createElement(Ele,{key:I,resource:k,onDetails:S,onEdit:$,onDelete:O});case"Media":return s.createElement(ble,{key:I,resource:k,onDetails:S,onEdit:$,onDelete:O});default:return s.createElement(ti,{key:I,resource:k,padding:!0},s.createElement(f1,{value:k,ignoreMissingValues:!0}))}})):s.createElement(Zt,{style:{width:"100%",height:"100%"}},s.createElement(un,null))}function pl(e){return s.createElement(Q.Dropdown,null,s.createElement(Q.Label,null,"Resource"),e.onPin&&s.createElement(Q.Item,{icon:s.createElement(jae,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${ct(e.resource)}`},"Pin"),e.onUnpin&&s.createElement(Q.Item,{icon:s.createElement(Rae,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${ct(e.resource)}`},"Unpin"),e.onDetails&&s.createElement(Q.Item,{icon:s.createElement($ae,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${ct(e.resource)}`},"Details"),e.onEdit&&s.createElement(Q.Item,{icon:s.createElement(Eae,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${ct(e.resource)}`},"Edit"),e.onDelete&&s.createElement(s.Fragment,null,s.createElement(Q.Divider,null),s.createElement(Q.Label,null,"Danger zone"),s.createElement(Q.Item,{color:"red",icon:s.createElement(G5,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${ct(e.resource)}`},"Delete")))}function yle(e){let t=wle(e.history,e.resource);return t?s.createElement(ti,{resource:e.resource,padding:!0,popupMenuItems:s.createElement(pl,{...e})},s.createElement(hle,{original:t,revised:e.resource})):s.createElement(ti,{resource:e.resource,padding:!0,popupMenuItems:s.createElement(pl,{...e})},s.createElement("h3",null,"Created"),s.createElement(f1,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0}))}function wle(e,t){let 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 _le(e){var n,o;let{classes:t}=vle(),r=!e.resource.priority||e.resource.priority==="routine"?void 0:t.pinnedComment;return s.createElement(ti,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:r,popupMenuItems:s.createElement(pl,{...e})},s.createElement("p",null,(o=(n=e.resource.payload)==null?void 0:n[0])==null?void 0:o.contentString))}function ble(e){var n;let t=(n=e.resource.content)==null?void 0:n.contentType,r=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.createElement(ti,{resource:e.resource,padding:!!r,popupMenuItems:s.createElement(pl,{...e})},s.createElement(_c,{value:e.resource.content}))}function xle(e){return s.createElement(ti,{resource:e.resource,padding:!0,popupMenuItems:s.createElement(pl,{...e})},s.createElement(Sl,null,s.createElement("pre",null,e.resource.outcomeDesc)))}function Ele(e){return s.createElement(ti,{resource:e.resource,padding:!0,popupMenuItems:s.createElement(pl,{...e})},s.createElement(u1,{value:e.resource}))}function Sle(e){if(e.lengthComputable){let t=100*e.loaded/e.total;return`Uploaded: ${sg(e.loaded)} / ${sg(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${sg(e.loaded)}`}function sg(e){if(e===0)return"0.00 B";let t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function Ple(e){return s.createElement(Jm,{value:e.resource,loadTimelineResources:async(t,r,n)=>{let 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 _e(e){let{children:t,...r}=e;return s.createElement(bc,null,s.createElement(d1,{...r},t))}function Ole(e){return s.createElement(Jm,{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:ut(t),subject:t.subject,sender:ut(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",encounter:ut(t),subject:t.subject,operator:ut(r),issued:new Date().toISOString(),content:n})})}function $le(e){let t;try{t=_oe(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.createElement(So,{value:t[0]||"",propertyType:e.propertyType})}function Cle(e){return s.createElement(Cr,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel},s.createElement(se,{display:"flex",sx:{justifyContent:"space-between"}},e.exportCsv&&s.createElement(JP,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.createElement(JP,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})),s.createElement(ae,{sx:{marginTop:"10px",marginLeft:"2px"}},"Limited to 1000 records"))}function JP(e){return s.createElement(Y,{onClick:()=>{e.exportLogic(),e.onCancel()}},`Export as ${e.text}`)}var kle={string:[te.EQUALS,te.NOT,te.CONTAINS,te.EXACT],fulltext:[te.EQUALS,te.NOT,te.CONTAINS,te.EXACT],token:[te.EQUALS,te.NOT],reference:[te.EQUALS,te.NOT],numeric:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS],quantity:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS],date:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS,te.STARTS_AFTER,te.ENDS_BEFORE,te.APPROXIMATELY],datetime:[te.EQUALS,te.NOT_EQUALS,te.GREATER_THAN,te.LESS_THAN,te.GREATER_THAN_OR_EQUALS,te.LESS_THAN_OR_EQUALS,te.STARTS_AFTER,te.ENDS_BEFORE,te.APPROXIMATELY]},jle={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 p1(e,t){return{...e,filters:t,offset:0,name:void 0}}function m1(e,t){return p1(e,(e.filters??[]).filter(r=>r.code!==t))}function Zm(e,t,r,n,o){o&&(e=m1(e,t));let a=[];return e.filters&&a.push(...e.filters),a.push({code:t,operator:r,value:n??""}),p1(e,a)}function Rle(e,t){if(!e.filters)return e;let r=[...e.filters];return r.splice(t,1),{...e,filters:r,name:void 0}}function Tle(e,t){return h1(e,t,-1)}function Ile(e,t){return h1(e,t,0)}function Dle(e,t){return h1(e,t,1)}function h1(e,t,r){let n=new Date;n.setDate(n.getDate()+r),n.setHours(0,0,0,0);let o=new Date(n.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),v1(e,t,n,o)}function Nle(e,t){return g1(e,t,-1)}function Ale(e,t){return g1(e,t,0)}function Mle(e,t){return g1(e,t,1)}function g1(e,t,r){let n=new Date;n.setMonth(n.getMonth()+r),n.setDate(1),n.setHours(0,0,0,0);let 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),v1(e,t,n,o)}function zle(e,t){let r=new Date;return r.setMonth(0),r.setDate(1),r.setHours(0,0,0,0),v1(e,t,r,new Date)}function v1(e,t,r,n){return e=m1(e,t),e=ZP(e,t,te.GREATER_THAN_OR_EQUALS,r),e=ZP(e,t,te.LESS_THAN_OR_EQUALS,n),e}function ZP(e,t,r,n){return Zm(e,t,r,n.toISOString())}function eO(e,t,r=!0){return Zm(e,t,te.MISSING,r.toString())}function Lle(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function Fle(e,t){let r=e.count??yc,n=(t-1)*r;return Lle(e,n)}function Vle(e,t,r){return t===Ble(e)&&r!==void 0&&r===Ule(e)?e:{...e,sortRules:[{code:t,descending:!!r}],name:void 0}}function Ble(e){let t=e.sortRules;if(!t||t.length===0)return;let r=t[0].code;return r.startsWith("-")?r.substr(1):r}function Ule(e){let t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function Wle(e){return kle[e.type]}function y1(e){return jle[e]??""}function Yn(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="id"?"ID":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.split(/\s/).map(cr).join(" "))}function Hle(e,t){var n,o;let r=t.name;return r==="id"?e.id:r==="meta.versionId"?(n=e.meta)==null?void 0:n.versionId:r==="_lastUpdated"?Pr((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?qle(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?Gle(e,t.searchParams[0]):null}function qle(e,t){var a,i,l;let r=((l=(i=(a=t.path)==null?void 0:a.split("."))==null?void 0:i.pop())==null?void 0:l.replaceAll("[x]",""))??"",[n,o]=Xa({type:e.resourceType,value:e},r);return n?s.createElement(So,{property:t,propertyType:o,value:n,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function Gle(e,t){let r=Y0(t.expression,[{type:e.resourceType,value:e}]);return!r||r.length===0?null:s.createElement(s.Fragment,null,r.map((n,o)=>s.createElement(So,{key:`${o}-${r.length}`,propertyType:n.type,value:n.value,maxWidth:200,ignoreMissingValues:!0,link:!1})))}function Qle(e){let[t,r]=f.useState({search:JSON.parse(Or(e.search))}),n=f.useRef(null),o=f.useRef(null);f.useEffect(()=>{r({search:e.search})},[e.search]);function a(y){y.key==="Enter"&&u()}function i(){u()}function l(y){y.key==="Enter"&&d()}function c(){d()}function u(){var b;let y=t.search.fields??[],x=(b=n.current)==null?void 0:b.value;if(x){let S=[...y,x];r({search:{...t.search,fields:S}})}}function d(){var b;let y=t.search.fields??[],x=(b=o.current)==null?void 0:b.value;if(x){let S=[...y];S.splice(S.indexOf(x),1),r({search:{...t.search,fields:S}})}}function p(){var $;let y=t.search.fields??[],x=($=o.current)==null?void 0:$.value;if(!x)return;let b=[...y],S=b.indexOf(x);S<=0||(g(b,S,S-1),r({search:{...t.search,fields:b}}))}function h(){var $;let y=t.search.fields??[],x=($=o.current)==null?void 0:$.value;if(!x)return;let b=[...y],S=b.indexOf(x);S>=b.length-1||(g(b,S,S+1),r({search:{...t.search,fields:b}}))}function g(y,x,b){let S=y[x];y[x]=y[b],y[b]=S}if(!e.visible)return null;let v=e.search.resourceType,w=Ot.types[v],E=t.search.fields??[],_=Kle(w).filter(y=>!E.includes(y)).sort((y,x)=>y.localeCompare(x));return s.createElement(Cr,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel},s.createElement("div",null,s.createElement("table",{style:{margin:"auto"}},s.createElement("thead",null,s.createElement("tr",null,s.createElement("th",{colSpan:2,align:"center"},"Available"),s.createElement("th",{colSpan:2,align:"center"},"Selected"))),s.createElement("tbody",null,s.createElement("tr",null,s.createElement("td",{colSpan:2,align:"center"},s.createElement("select",{ref:n,size:15,tabIndex:1,style:{width:"200px"},onKeyDown:y=>a(y),onDoubleClick:()=>i(),"data-testid":"available"},_.map(y=>s.createElement("option",{key:y,value:y},Yn(y))))),s.createElement("td",{colSpan:2,align:"center"},s.createElement("select",{ref:o,size:15,tabIndex:4,style:{width:"200px"},onKeyDown:y=>l(y),onDoubleClick:()=>c(),"data-testid":"selected"},E.map(y=>s.createElement("option",{key:y,value:y},Yn(y))))))),s.createElement("tfoot",null,s.createElement("tr",null,s.createElement("td",{align:"center"},s.createElement(Y,{compact:!0,variant:"outline",onClick:u},"Add")),s.createElement("td",{align:"center"},s.createElement(Y,{compact:!0,variant:"outline",onClick:d},"Remove")),s.createElement("td",{align:"center"},s.createElement(Y,{compact:!0,variant:"outline",onClick:p},"Up")),s.createElement("td",{align:"center"},s.createElement(Y,{compact:!0,variant:"outline",onClick:h},"Down")))))),s.createElement(Y,{onClick:()=>e.onOk(t.search)},"OK"))}function Kle(e){let t=[],r=new Set,n=new Set;for(let o of Object.keys(e.properties))t.push(o),r.add(o.toLowerCase()),n.add(Yn(o));if(e.searchParams)for(let o of Object.keys(e.searchParams)){let a=Yn(o);!r.has(o)&&!n.has(a)&&(t.push(o),r.add(o),n.add(Yn(o)))}return t}function pN(e){var o;let{resourceType:t,filter:r}=e,n=(o=Ot.types[t].searchParams)==null?void 0:o[r.code];if(n){if(n.type==="reference"&&(r.operator===te.EQUALS||r.operator===te.NOT_EQUALS))return s.createElement(xc,{value:{reference:r.value}});let a=X0(t,n);if(r.code==="_lastUpdated"||a.type===Uo.DATETIME)return s.createElement(s.Fragment,null,Pr(r.value))}return s.createElement(s.Fragment,null,r.value)}function mN(e){let t=X0(e.resourceType,e.searchParam),r="filter-value";switch(t.type){case Uo.REFERENCE:return s.createElement(Xm,{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 Uo.BOOLEAN:return s.createElement(kn,{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 Uo.DATE:return s.createElement(oe,{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 Uo.DATETIME:return s.createElement(Ja,{name:r,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case Uo.NUMBER:return s.createElement(oe,{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 Uo.QUANTITY:return s.createElement(Za,{name:r,defaultValue:Yle(e.defaultValue),autoFocus:e.autoFocus,onChange:n=>{n?e.onChange(`${n.value}`):e.onChange("")}});default:return s.createElement(oe,{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 Yle(e){if(e){let[t,r,n]=e.split("|");if(t)return{value:parseFloat(t),system:r,unit:n}}}function Xle(e){let[t,r]=f.useState(JSON.parse(Or(e.search))),[n,o]=f.useState(-1),a=f.useRef(t);a.current=t,f.useEffect(()=>{r(JSON.parse(Or(e.search)))},[e.search]);function i(d){r(Zm(a.current,d.code,d.operator,d.value))}if(!e.visible)return null;let l=e.search.resourceType,c=Ot.types[l].searchParams??{},u=t.filters||[];return s.createElement(Cr,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel},s.createElement("div",null,s.createElement("table",null,s.createElement("colgroup",null,s.createElement("col",{style:{width:200}}),s.createElement("col",{style:{width:200}}),s.createElement("col",{style:{width:380}}),s.createElement("col",{style:{width:120}})),s.createElement("thead",null,s.createElement("tr",null,s.createElement("th",null,"Field"),s.createElement("th",null,"Operation"),s.createElement("th",null,"Value"),s.createElement("th",null,"Actions"))),s.createElement("tbody",null,u.map((d,p)=>p===n?s.createElement(tO,{key:`filter-${d.code}-${d.operator}-${d.value}-input`,resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{let g=[...u];g[p]=h,r(p1(a.current,g)),o(-1)},onCancel:()=>o(-1)}):s.createElement(Jle,{key:`filter-${d.code}-${d.operator}-${d.value}-display`,resourceType:l,searchParams:c,filter:d,onEdit:()=>o(p),onDelete:()=>r(Rle(a.current,p))})),s.createElement(tO,{resourceType:l,searchParams:c,okText:"Add",onOk:i})))),s.createElement(Z,{position:"right",mt:"xl"},s.createElement(Y,{onClick:()=>e.onOk(a.current)},"OK")))}function Jle(e){let{filter:t}=e;return s.createElement("tr",null,s.createElement("td",null,Yn(t.code)),s.createElement("td",null,y1(t.operator)),s.createElement("td",null,s.createElement(pN,{resourceType:e.resourceType,filter:t})),s.createElement("td",null,s.createElement(Y,{compact:!0,variant:"outline",onClick:e.onEdit},"Edit"),s.createElement(Y,{compact:!0,variant:"outline",onClick:e.onDelete},"Delete")))}function tO(e){let[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})}let l=e.searchParams[t.code],c=l&&Wle(l);return s.createElement("tr",null,s.createElement("td",null,s.createElement(dt,{"data-testid":"filter-field",defaultValue:n.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Yn(u)}))]})),s.createElement("td",null,c&&s.createElement(dt,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>a(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:y1(u)}))]})),s.createElement("td",null,l&&t.operator&&s.createElement(mN,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:i})),s.createElement("td",null,t.code&&t.operator&&t.value&&s.createElement(Y,{compact:!0,variant:"outline",onClick:()=>{e.onOk(n.current),r({})}},e.okText),e.onCancel&&s.createElement(Y,{compact:!0,variant:"outline",onClick:e.onCancel},"Cancel")))}function Zle(e){let[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.createElement(Cr,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel},s.createElement(Ne,{onSubmit:n},s.createElement(tn,null,s.createElement(tn.Col,{span:10},s.createElement(mN,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:r})),s.createElement(tn.Col,{span:2},s.createElement(Y,{onClick:n,fullWidth:!0},"OK")))))}function ese(e){if(!e.searchParams)return null;function t(a,i){o(Vle(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.createElement(tse,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:n,onChange:o,onClear:r}):s.createElement(Q.Dropdown,null,e.searchParams.map(a=>s.createElement(Q.Item,{key:a.code},Yn(a.code))))}function tse(e){switch(e.searchParam.type){case"date":return s.createElement(rse,{...e});case"number":case"quantity":return s.createElement(nse,{...e});case"reference":return s.createElement(ose,{...e});case"string":case"token":case"uri":return s.createElement(ase,{...e});default:return s.createElement(s.Fragment,null,"Unknown search param type: ",e.searchParam.type)}}function rse(e){let{searchParam:t}=e,r=t.code;return s.createElement(Q.Dropdown,null,s.createElement(Q.Item,{icon:s.createElement(e1,{size:14}),onClick:()=>e.onSort(t,!1)},"Sort Oldest to Newest"),s.createElement(Q.Item,{icon:s.createElement(t1,{size:14}),onClick:()=>e.onSort(t,!0)},"Sort Newest to Oldest"),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Km,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS)},"Equals..."),s.createElement(Q.Item,{icon:s.createElement(Qm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS)},"Does not equal..."),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(q5,{size:14}),onClick:()=>e.onPrompt(t,te.ENDS_BEFORE)},"Before..."),s.createElement(Q.Item,{icon:s.createElement(H5,{size:14}),onClick:()=>e.onPrompt(t,te.STARTS_AFTER)},"After..."),s.createElement(Q.Item,{icon:s.createElement(mae,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS)},"Between..."),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(Dle(e.search,r))},"Tomorrow"),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(Ile(e.search,r))},"Today"),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(Tle(e.search,r))},"Yesterday"),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(Mle(e.search,r))},"Next Month"),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(Ale(e.search,r))},"This Month"),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(Nle(e.search,r))},"Last Month"),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Oa,{size:14}),onClick:()=>e.onChange(zle(e.search,r))},"Year to date"),s.createElement(eh,{...e}))}function nse(e){let{searchParam:t}=e;return s.createElement(Q.Dropdown,null,s.createElement(Q.Item,{icon:s.createElement(e1,{size:14}),onClick:()=>e.onSort(t,!1)},"Sort Smallest to Largest"),s.createElement(Q.Item,{icon:s.createElement(t1,{size:14}),onClick:()=>e.onSort(t,!0)},"Sort Largest to Smallest"),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Km,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS)},"Equals..."),s.createElement(Q.Item,{icon:s.createElement(Qm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT_EQUALS)},"Does not equal..."),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(H5,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN)},"Greater than..."),s.createElement(Q.Item,{icon:s.createElement(Rv,{size:14}),onClick:()=>e.onPrompt(t,te.GREATER_THAN_OR_EQUALS)},"Greater than or equal to..."),s.createElement(Q.Item,{icon:s.createElement(q5,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN)},"Less than..."),s.createElement(Q.Item,{icon:s.createElement(Rv,{size:14}),onClick:()=>e.onPrompt(t,te.LESS_THAN_OR_EQUALS)},"Less than or equal to..."),s.createElement(eh,{...e}))}function ose(e){let{searchParam:t}=e;return s.createElement(Q.Dropdown,null,s.createElement(Q.Item,{icon:s.createElement(Km,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS)},"Equals..."),s.createElement(Q.Item,{icon:s.createElement(Qm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT)},"Does not equal..."),s.createElement(eh,{...e}))}function ase(e){let{searchParam:t}=e;return s.createElement(Q.Dropdown,null,s.createElement(Q.Item,{icon:s.createElement(e1,{size:14}),onClick:()=>e.onSort(t,!1)},"Sort A to Z"),s.createElement(Q.Item,{icon:s.createElement(t1,{size:14}),onClick:()=>e.onSort(t,!0)},"Sort Z to A"),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(Km,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS)},"Equals..."),s.createElement(Q.Item,{icon:s.createElement(Qm,{size:14}),onClick:()=>e.onPrompt(t,te.NOT)},"Does not equal..."),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(gae,{size:14}),onClick:()=>e.onPrompt(t,te.CONTAINS)},"Contains..."),s.createElement(Q.Item,{icon:s.createElement(hae,{size:14}),onClick:()=>e.onPrompt(t,te.EQUALS)},"Does not contain..."),s.createElement(eh,{...e}))}function eh(e){let{searchParam:t}=e,r=t.code;return s.createElement(s.Fragment,null,s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(fae,{size:14}),onClick:()=>e.onChange(eO(e.search,r))},"Missing"),s.createElement(Q.Item,{icon:s.createElement(dae,{size:14}),onClick:()=>e.onChange(eO(e.search,r,!1))},"Not missing"),s.createElement(Q.Divider,null),s.createElement(Q.Item,{icon:s.createElement(zae,{size:14}),onClick:()=>e.onClear(t)},"Clear filters"))}function ise(e){let t=e.resourceType,r=[];for(let n of e.fields||["id","_lastUpdated"])r.push(lse(t,n));return r}function lse(e,t){var a,i;if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};let r=Ot.types[e],n=r.properties[t],o=(a=r.searchParams)==null?void 0:a[t.toLowerCase()];if(n&&o)return{name:t,elementDefinition:n,searchParams:[o]};if(n){let l;if(r.searchParams){let c=`${e}.${t.replaceAll("[x]","")}`;l=Object.values(r.searchParams).filter(u=>{var d;return(d=u.expression)==null?void 0:d.includes(c)}),l.length===0&&(l=void 0)}return{name:t,elementDefinition:n,searchParams:l}}if(o){let l=X0(e,o);return{name:t,elementDefinition:(i=l.elementDefinitions)==null?void 0:i[0],searchParams:[o]}}return{name:t}}var sse=class extends Event{constructor(e){super("change"),this.definition=e}},cse=class extends Event{constructor(e){super("load"),this.response=e}},Bp=class extends Event{constructor(e,t){super("click"),this.resource=e,this.browserEvent=t}},use=U(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 dse(e){var N,F,q,ee;let{classes:t}=use(),r=re(),[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;let h=l.total??"accurate",g=f.useCallback(R=>{i(void 0),r.search(l.resourceType,Vi({...l,total:h,fields:void 0}),R).then(D=>{d({...p.current,searchResponse:D}),c&&c(new cse(D))}).catch(D=>{d({...p.current,searchResponse:void 0}),i(D)})},[r,l,h,c]),v=f.useCallback(()=>{d({...p.current,searchResponse:void 0}),g({cache:"reload"})},[g]);f.useEffect(()=>{g()},[g]);function w(R,D){R.stopPropagation();let V=R.target.checked,G={...p.current.selected};V?G[D]=!0:delete G[D],d({...p.current,selected:G})}function E(R){R.stopPropagation();let D=R.target.checked,V={},G=p.current.searchResponse;D&&(G!=null&&G.entry)&&G.entry.forEach(ie=>{var Oe;(Oe=ie.resource)!=null&&Oe.id&&(V[ie.resource.id]=!0)}),d({...p.current,selected:V})}function _(){var D,V;let R=p.current;if(!((D=R.searchResponse)!=null&&D.entry)||R.searchResponse.entry.length===0)return!1;for(let G of R.searchResponse.entry)if((V=G.resource)!=null&&V.id&&!R.selected[G.resource.id])return!1;return!0}function y(R){e.onChange&&e.onChange(new sse(R))}function x(R,D){if(K5(R.target)||R.button===2)return;ot(R);let V=R.button===1||R.ctrlKey||R.metaKey;!V&&e.onClick&&e.onClick(new Bp(D,R)),V&&e.onAuxClick&&e.onAuxClick(new Bp(D,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&&Ot.types[e.search.resourceType]))return s.createElement(Zt,{style:{width:"100%",height:"100%"}},s.createElement(un,null));let S=e.checkboxesEnabled,$=ise(l),O=l.resourceType,C=u.searchResponse,T=(N=C==null?void 0:C.entry)==null?void 0:N.map(R=>R.resource),j="subtle",k="gray",I=16,z=window.innerWidth<768;return s.createElement("div",{className:t.root,"data-testid":"search-control"},!e.hideToolbar&&s.createElement(Z,{position:"apart",mb:"xl"},s.createElement(Z,{spacing:2},s.createElement(Y,{compact:!0,variant:j,color:k,leftIcon:s.createElement(wae,{size:I}),onClick:()=>d({...p.current,fieldEditorVisible:!0})},"Fields"),s.createElement(Y,{compact:!0,variant:j,color:k,leftIcon:s.createElement(Oae,{size:I}),onClick:()=>d({...p.current,filterEditorVisible:!0})},"Filters"),e.onNew&&s.createElement(Y,{compact:!0,variant:j,color:k,leftIcon:s.createElement(Pae,{size:I}),onClick:e.onNew},"New..."),!z&&b()&&s.createElement(Y,{compact:!0,variant:j,color:k,leftIcon:s.createElement(Mae,{size:I}),onClick:e.onExport?e.onExport:()=>d({...p.current,exportDialogVisible:!0})},"Export..."),!z&&e.onDelete&&s.createElement(Y,{compact:!0,variant:j,color:k,leftIcon:s.createElement(G5,{size:I}),onClick:()=>e.onDelete(Object.keys(u.selected))},"Delete..."),!z&&e.onBulk&&s.createElement(Y,{compact:!0,variant:j,color:k,leftIcon:s.createElement(pae,{size:I}),onClick:()=>e.onBulk(Object.keys(u.selected))},"Bulk...")),s.createElement(Z,{spacing:2},C&&s.createElement(ae,{size:"xs",color:"dimmed"},hse(l,C.total),"-",gse(l,C.total)," of"," ",`${h==="estimate"?"~":""}${(F=C.total)==null?void 0:F.toLocaleString()}`),s.createElement(sr,{title:"Refresh",onClick:v},s.createElement(Iae,{size:"1.125rem"})))),s.createElement(si,{className:t.table},s.createElement("thead",null,s.createElement("tr",null,S&&s.createElement("th",null,s.createElement("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:_(),onChange:R=>E(R)})),$.map(R=>s.createElement("th",{key:R.name},s.createElement(Q,{shadow:"md",width:240,position:"bottom-end"},s.createElement(Q.Target,null,s.createElement(ho,{className:t.control},s.createElement(Z,{position:"apart",noWrap:!0},s.createElement(ae,{weight:500,size:"sm"},Yn(R.name)),s.createElement(Zt,{className:t.icon},s.createElement(uae,{size:14,stroke:1.5}))))),s.createElement(ese,{search:e.search,searchParams:R.searchParams,onPrompt:(D,V)=>{d({...p.current,filterDialogVisible:!0,filterDialogSearchParam:D,filterDialogFilter:V})},onChange:D=>{y(D)}}))))),!e.hideFilters&&s.createElement("tr",null,S&&s.createElement("th",null),$.map(R=>s.createElement("th",{key:R.name},R.searchParams&&s.createElement(fse,{resourceType:O,searchParams:R.searchParams,filters:e.search.filters}))))),s.createElement("tbody",null,T==null?void 0:T.map(R=>R&&s.createElement("tr",{key:R.id,className:t.tr,"data-testid":"search-control-row",onClick:D=>x(D,R),onAuxClick:D=>x(D,R)},S&&s.createElement("td",null,s.createElement("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!u.selected[R.id],onChange:D=>w(D,R.id)})),$.map(D=>s.createElement("td",{key:D.name},Hle(R,D))))))),(T==null?void 0:T.length)===0&&s.createElement(bc,null,s.createElement(Zt,{style:{height:150}},s.createElement(ae,{size:"xl",color:"dimmed"},"No results"))),(C==null?void 0:C.total)!==void 0&&C.total>0&&s.createElement(Zt,{m:"md",p:"md"},s.createElement(eo,{value:pse(l),total:mse(l,C.total),onChange:R=>y(Fle(l,R)),getControlProps:R=>{switch(R){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})),a&&s.createElement("div",{"data-testid":"search-error"},s.createElement("pre",{style:{textAlign:"left"}},JSON.stringify(a,void 0,2))),s.createElement(Qle,{search:e.search,visible:p.current.fieldEditorVisible,onOk:R=>{y(R),d({...p.current,fieldEditorVisible:!1})},onCancel:()=>{d({...p.current,fieldEditorVisible:!1})}}),s.createElement(Xle,{search:e.search,visible:p.current.filterEditorVisible,onOk:R=>{y(R),d({...p.current,filterEditorVisible:!1})},onCancel:()=>{d({...p.current,filterEditorVisible:!1})}}),s.createElement(Cle,{visible:p.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{d({...p.current,exportDialogVisible:!1})}}),s.createElement(Zle,{key:(q=u.filterDialogSearchParam)==null?void 0:q.code,visible:p.current.filterDialogVisible,title:(ee=u.filterDialogSearchParam)!=null&&ee.code?Yn(u.filterDialogSearchParam.code):"",resourceType:O,searchParam:u.filterDialogSearchParam,filter:u.filterDialogFilter,defaultValue:"",onOk:R=>{y(Zm(e.search,R.code,R.operator,R.value)),d({...p.current,filterDialogVisible:!1})},onCancel:()=>{d({...p.current,filterDialogVisible:!1})}}))}var Ec=s.memo(dse);function fse(e){let t=(e.filters??[]).filter(r=>e.searchParams.find(n=>n.code===r.code));return t.length===0?s.createElement("span",null,"no filters"):s.createElement(s.Fragment,null,t.map(r=>s.createElement("div",{key:`filter-${r.code}-${r.operator}-${r.value}`},y1(r.operator)," ",s.createElement(pN,{resourceType:e.resourceType,filter:r}))))}function pse(e){return Math.floor((e.offset??0)/(e.count??yc))+1}function mse(e,t){let r=e.count??yc;return Math.ceil(t/r)}function hse(e,t){return Math.min(t,(e.offset??0)+1)}function gse(e,t){return Math.min(t,((e.offset??0)+1)*(e.count??yc))}function vse(e){let t=re(),[r,n]=f.useState(),[o,a]=f.useState(),{query:i,fields:l}=e,[c,u]=f.useState(),[d,p]=f.useState({}),h=f.useRef();h.current=c;let g=f.useRef({});g.current=d,f.useEffect(()=>{a(void 0),t.graphql(i).then(u).catch(x=>a(_t(x)))},[t,i]);function v(x,b){x.stopPropagation();let S=x.target.checked,$={...g.current};S?$[b]=!0:delete $[b],p($)}function w(x){var O;x.stopPropagation();let b=x.target.checked,S={},$=(O=h.current)==null?void 0:O.data.ResourceList;b&&$&&$.forEach(C=>{C.id&&(S[C.id]=!0)}),p(S)}function E(){var b;let x=(b=h.current)==null?void 0:b.data.ResourceList;if(!x||x.length===0)return!1;for(let S of x)if(S.id&&!g.current[S.id])return!1;return!0}function _(x,b){K5(x.target)||(ot(x),x.button!==1&&e.onClick&&e.onClick(new Bp(b,x)),x.button===1&&e.onAuxClick&&e.onAuxClick(new Bp(b,x)))}if(f.useEffect(()=>{t.requestSchema(e.resourceType).then(x=>{n({...x})}).catch(console.log)},[t,e.resourceType]),!(r!=null&&r.types[e.resourceType]))return s.createElement(un,null);let y=e.checkboxesEnabled;return s.createElement("div",{onContextMenu:x=>ot(x),"data-testid":"search-control"},s.createElement(si,null,s.createElement("thead",null,s.createElement("tr",null,y&&s.createElement("th",null,s.createElement("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:E(),onChange:x=>w(x)})),l.map(x=>s.createElement("th",{key:x.name},x.name)))),s.createElement("tbody",null,c==null?void 0:c.data.ResourceList.map(x=>x&&s.createElement("tr",{key:x.id,"data-testid":"search-control-row",onClick:b=>_(b,x),onAuxClick:b=>_(b,x)},y&&s.createElement("td",null,s.createElement("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${x.id}`,checked:!!d[x.id],onChange:b=>v(b,x.id)})),l.map(b=>s.createElement("td",{key:b.name},s.createElement($le,{propertyType:b.propertyType,path:b.fhirPath,resource:x}))))))),(c==null?void 0:c.data.ResourceList.length)===0&&s.createElement("div",{"data-testid":"empty-search"},"No results"),o&&s.createElement("div",{"data-testid":"search-error"},s.createElement("pre",{style:{textAlign:"left"}},JSON.stringify(o,void 0,2))),e.onBulk&&s.createElement(Y,{onClick:()=>e.onBulk(Object.keys(g.current))},"Bulk..."))}var yse=s.memo(vse);function Rn(e){return s.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size}},s.createElement("title",null,"Medplum Logo"),s.createElement("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.createElement("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.createElement("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.createElement("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.createElement("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"}))}function ui(e){var r;let t=((r=e.outcome)==null?void 0:r.issue)||e.issues;return!t||t.length===0?null:s.createElement(ic,{icon:s.createElement(J0,{size:16}),color:"red"},t.map(n=>{var o,a;return s.createElement("div",{"data-testid":"text-field-error",key:(o=n.details)==null?void 0:o.text},(a=n.details)==null?void 0:a.text)}))}function wse(e){let t=f.useCallback((r,n,o)=>{let 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.createElement(Jm,{value:e.patient,loadTimelineResources:t,createCommunication:(r,n,o)=>({resourceType:"Communication",status:"completed",subject:ut(r),sender:ut(n),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(r,n,o)=>({resourceType:"Media",status:"completed",subject:ut(r),operator:ut(n),issued:new Date().toISOString(),content:o})})}var hN=U(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 _se(e){let t=re(),r=Ze(e.value),[n,o]=f.useState(void 0),[a,i]=f.useState(),[l,c]=f.useState(),[u,d]=f.useState();function p(){c(void 0)}function h(){i(void 0)}let g=f.useRef();if(g.current=u,f.useEffect(()=>{t.requestSchema("PlanDefinition").then(o).catch(console.log)},[t]),f.useEffect(()=>(d(Ose(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(w,E){d({...g.current,[w]:E})}return s.createElement("div",null,s.createElement(Ne,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u)},s.createElement(oe,{label:"Plan Title",defaultValue:u.title,onChange:w=>v("title",w.currentTarget.value)}),s.createElement(gN,{actions:u.action||[],selectedKey:a,setSelectedKey:i,hoverKey:l,setHoverKey:c,onChange:w=>v("action",w)}),s.createElement(Y,{type:"submit"},"Save")))}function gN(e){let{classes:t}=hN(),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.createElement("div",{className:t.section},e.actions.map(i=>s.createElement("div",{key:i.id},s.createElement(bse,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>a(i)}))),s.createElement("div",{className:t.bottomActions},s.createElement(Be,{href:"#",onClick:i=>{ot(i),o({id:yN()})}},"Add action")))}function bse(e){let{classes:t,cx:r}=hN(),{action:n}=e,o=Pse(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){ot(d),e.setHoverKey(e.action.id)}let u=r(t.section,{[t.editing]:a,[t.hovering]:i&&!a});return s.createElement("div",{"data-testid":n.id,className:u,onClick:l,onMouseOver:c},a?s.createElement(Ese,{action:n,actionType:o,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.createElement(xse,{action:n,actionType:o}),s.createElement("div",{className:t.bottomActions},s.createElement(Be,{href:"#",onClick:d=>{d.preventDefault(),e.onRemove()}},"Remove")))}var Av={path:"PlanDefinition.action.timing[x]",min:0,max:"1",type:[{code:"dateTime"},{code:"Period"},{code:"Range"},{code:"Timing"}]};function xse(e){let{action:t,actionType:r}=e,[n,o]=vN(t);return s.createElement("div",null,s.createElement("div",null,t.title||"Untitled"," ",r&&`(${r})`),t.definitionCanonical&&s.createElement("div",null,s.createElement(Vp,{value:{reference:t.definitionCanonical}})),n&&s.createElement("div",null,s.createElement(So,{property:Av,propertyType:o,value:n})))}function Ese(e){let{action:t}=e,[r,n]=f.useState(e.actionType);function o(a,i){e.onChange({...t,[a]:i})}return s.createElement(je,{spacing:"xl"},s.createElement(oe,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:a=>o("title",a.currentTarget.value)}),s.createElement(oe,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:a=>o("description",a.currentTarget.value)}),s.createElement(dt,{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.createElement(gN,{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.createElement(Ou,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.createElement(Ou,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.createElement(Ou,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.createElement(Ou,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.createElement(Xe,{title:"Timing",description:"When the action should take place."},s.createElement(Sse,{name:"timing-"+t.id,action:t,onChange:e.onChange})))}function Ou(e){let{id:t,definitionCanonical:r}=e.action,n=r!=null&&r.startsWith(e.resourceType+"/")?{reference:r}:void 0;return s.createElement(Cl,{name:t,resourceType:e.resourceType,defaultValue:n,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:ct(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function Sse(e){let t=e.action,r="timing",[n,o]=vN(t);return s.createElement(ei,{property:Av,name:"timing[x]",defaultValue:n,defaultPropertyType:o,onChange:(a,i)=>{e.onChange(Dv(t,r,i??r,Av,a))}})}function Pse(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 vN(e){return Xa({type:"PlanDefinitionAction",value:e},"timing")}var cg=1;function yN(e){if(e){if(e.startsWith("id-")){let t=parseInt(e.substring(3),10);isNaN(t)||(cg=Math.max(cg,t+1))}return e}return"id-"+cg++}function Ose(e){return{...e,action:wN(e.action)}}function wN(e){if(e)return e.map(t=>({...t,id:yN(t.id),action:wN(t.action)}))}var $se=(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))($se||{});function Cse(e){return e.type==="choice"||e.type==="open-choice"}function kse(e,t){if(!e.enableWhen)return!0;let r=e.enableBehavior??"any";for(let n of e.enableWhen){let o=_N(t,n.question);if(n.operator==="exists"&&!n.answerBoolean&&!(o!=null&&o.length)){if(r==="any")return!0;continue}let{anyMatch:a,allMatch:i}=Rse(n,o,r);if(r==="any"&&a)return!0;if(r==="all"&&!i)return!1}return r!=="any"}function _N(e,t){if(!Array.isArray(e))return;let r=e.find(n=>n.linkId===t);if(r)return r.answer;for(let n of e)if(n.item){let o=_N(n.item,t);if(o)return o}}function jse(e,t,r){if(r==="exists")return!!e===t.value;if(e){let n=r==="="||r==="!="?r==null?void 0:r.replace("=","~"):r,[{value:o}]=Y0(`%actualAnswer ${n} %expectedAnswer`,[e],{actualAnswer:e,expectedAnswer:t});return o}else return!1}function Rse(e,t,r){let n=t||[],o=rn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]"),a=!1,i=!0;for(let l of n){let c=rn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(jse(c,o,u)?a=!0:i=!1,r==="any"&&a)break}return{anyMatch:a,allMatch:i}}function bN(e){let t=e.item,r=e.index;function n(l,c){var h,g;let u=c??0,d=((h=e.currentResponseItems)==null?void 0:h.filter(v=>v.linkId===t.linkId))??[],p;Array.isArray(l)?p=l:p=Nse(((g=d[0])==null?void 0:g.answer)??[],u,l),e.onChange({id:d[0].id,linkId:t.linkId,text:t.text,answer:p})}let o=t.type;if(!o)return null;let a=t.linkId;if(!a)return null;let i=t.initial&&t.initial.length>0?t.initial[0]:void 0;switch(o){case"boolean":return s.createElement(tN,{key:e.item.linkId,title:e.item.text,htmlFor:e.item.linkId},s.createElement(kn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueBoolean),onChange:l=>n({valueBoolean:l.currentTarget.checked},r)}));case"decimal":return s.createElement(oe,{type:"number",step:"any",id:a,name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueDecimal),onChange:l=>n({valueDecimal:l.currentTarget.valueAsNumber},r)});case"integer":return s.createElement(oe,{type:"number",step:1,id:a,name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueInteger),onChange:l=>n({valueInteger:l.currentTarget.valueAsNumber},r)});case"date":return s.createElement(oe,{type:"date",id:a,name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueDate),onChange:l=>n({valueDate:l.currentTarget.value},r)});case"dateTime":return s.createElement(Ja,{name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueDateTime),onChange:l=>n({valueDateTime:l},r)});case"time":return s.createElement(oe,{type:"time",id:a,name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueTime),onChange:l=>n({valueTime:l.currentTarget.value},r)});case"string":case"url":return s.createElement(oe,{id:a,name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueString),onChange:l=>n({valueString:l.currentTarget.value},r)});case"text":return s.createElement(uc,{id:a,name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueString),onChange:l=>n({valueString:l.currentTarget.value},r)});case"attachment":return s.createElement(J5,{name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueAttachment),onChange:l=>n({valueAttachment:l},r)});case"reference":return s.createElement(Xm,{name:a,targetTypes:Ase(t),defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueReference),onChange:l=>n({valueReference:l},r)});case"quantity":return s.createElement(Za,{name:a,defaultValue:or(e.allResponses,t,r,e.groupSequence)??(i==null?void 0:i.valueQuantity),onChange:l=>n({valueQuantity:l},r),disableWheel:!0});case"choice":case"open-choice":return Mse(t)?s.createElement(Tse,{name:a,item:t,initial:i,allResponses:e.allResponses,index:r,groupSequence:e.groupSequence,onChangeAnswer:l=>n(l,r)}):s.createElement(Ise,{name:a,item:t,initial:i,allResponses:e.allResponses,onChangeAnswer:l=>n(l,r)});default:return null}}function Tse(e){let{name:t,item:r,initial:n}=e,o=rn({type:"QuestionnaireItemInitial",value:n},"value"),a=[""];if(r.answerOption)for(let i of r.answerOption){let l=rn({type:"QuestionnaireItemAnswerOption",value:i},"value");a.push(ug(l))}if(r.repeats){let{propertyName:i,data:l}=zse(e.item),c=or(e.allResponses,r,e.index,e.groupSequence,!0)?or(e.allResponses,r,e.index,e.groupSequence,!0):[ug(o)];return s.createElement(k0,{data:l,placeholder:"Select items",searchable:!0,defaultValue:c,onChange:u=>{let d=u.map(p=>{var v;let h=(v=r.answerOption)==null?void 0:v.find(w=>w[i]===p),g=rn({type:"QuestionnaireItemAnswerOption",value:h},"value");return{[i]:g.value}});e.onChangeAnswer(d)}})}return s.createElement(dt,{id:t,name:t,onChange:i=>{let l=i.currentTarget.selectedIndex;if(l===0){e.onChangeAnswer({});return}let c=r.answerOption[l-1],u=rn({type:"QuestionnaireItemAnswerOption",value:c},"value"),d="value"+cr(u.type);e.onChangeAnswer({[d]:u.value})},defaultValue:or(e.allResponses,r,e.index,e.groupSequence)??ug(o),data:a})}function Ise(e){let{name:t,item:r,initial:n,onChangeAnswer:o,allResponses:a}=e;return r.answerValueSet?s.createElement(Ym,{elementDefinition:{binding:{valueSet:r.answerValueSet}},onChange:o}):s.createElement(Dse,{name:t,item:r,initial:n,allResponses:a,onChangeAnswer:o})}function Dse(e){var p;let{name:t,item:r,initial:n,onChangeAnswer:o}=e,a=Ot.types.QuestionnaireItemAnswerOption.properties["value[x]"],i=rn({type:"QuestionnaireItemInitial",value:n},"value"),l=[],c;if(r.answerOption)for(let h=0;h<r.answerOption.length;h++){let g=r.answerOption[h],v=`${t}-option-${h}`,w=rn({type:"QuestionnaireItemAnswerOption",value:g},"value");i&&Or(w)===Or(i)&&(c=v),l.push([v,w])}let u=or(e.allResponses,r,e.index,e.groupSequence),d=(p=l.find(h=>h[1].value===u))==null?void 0:p[0];return s.createElement(bp.Group,{name:t,value:d??c,onChange:h=>{let g=l.find(v=>v[0]===h);if(g){let v=g[1],w="value"+cr(v.type);o({[w]:v.value})}}},l.map(([h,g])=>s.createElement(bp,{key:h,id:h,value:h,label:s.createElement(So,{property:a,propertyType:g.type,value:g.value})})))}function Nse(e,t,r){if(t<e.length)return e[t]=r,e;for(let n=e.length;n<t;n++)e.push({});return e.push(r),e}function Ase(e){var r;if(e.type!=="reference")return[];let t=(r=e.extension)==null?void 0:r.filter(n=>n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?[]:t.map(n=>{var o,a,i;return(i=(a=(o=n.valueCodeableConcept)==null?void 0:o.coding)==null?void 0:a[0])==null?void 0:i.code})}function Mse(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 zse(e){var a;if(((a=e.answerOption)==null?void 0:a.length)===0)return{propertyName:"",data:[]};let t=e.answerOption[0],r=rn({type:"QuestionnaireItemAnswerOption",value:t},"value"),n="value"+cr(r.type),o=(e.answerOption??[]).map(i=>{var l;return{value:i[n],label:n==="valueCoding"?(l=i.valueCoding)==null?void 0:l.display:i[n]}});return{propertyName:n,data:o}}function ug(e){if(e)return e.type==="CodeableConcept"?e.value.coding[0].display:e.type==="Coding"?e.value.display:e.value.toString()}function xN(e,t){let r=[];for(let n of e)n.linkId===t&&r.push(n),n.item&&(r=r.concat(xN(n.item,t)));return r}function rO(e){let t=rn({type:"QuestionnaireItemAnswerOption",value:e},"value");return M0(t==null?void 0:t.value)||(t==null?void 0:t.value)}function or(e,t,r=0,n=0,o=!1){var i;let a=(i=xN(e,t.linkId??"")[n])==null?void 0:i.answer;return o?a==null?void 0:a.map(l=>rO(l)):rO((a==null?void 0:a[r])??{})}var Lse=U(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:4,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}},linkIdInput:{width:100,marginBottom:4},typeSelect:{width:100}}));function Fse(e){let t=re(),r=Ze(e.questionnaire),[n,o]=f.useState(),[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).catch(console.log)},[t]),f.useEffect(()=>(i(Wse(r??{resourceType:"Questionnaire"})),document.addEventListener("mouseover",p),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",p),document.removeEventListener("click",h)}),[r]),!n||!a?null:s.createElement("div",null,s.createElement(Ne,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(a)},s.createElement(EN,{item:a,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:i}),s.createElement(Y,{type:"submit"},"Save")))}function EN(e){var b;let{classes:t,cx:r}=Lse(),n=e.item,o=e.item,a=Ro(e.item),i=a||o.type==="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(S){ot(S),e.setSelectedKey(e.item.id)}function h(S){ot(S),e.setHoverKey(e.item.id)}function g(S){var O;let $=d.current;e.onChange({...$,item:(O=$.item)==null?void 0:O.map(C=>C.id===S.id?S:C)})}function v(S){e.onChange({...e.item,item:[...e.item.item??[],S]})}function w(S){var $;e.onChange({...e.item,item:($=e.item.item)==null?void 0:$.filter(O=>O!==S)})}function E(S,$){e.onChange({...d.current,[S]:$})}function _(S){e.onChange({...e.item,...S})}function y(S){var $;e.onChange({...e.item,item:($=e.item.item)==null?void 0:$.map(O=>O===S?{...O,repeats:!O.repeats}:O)})}let x=r(t.section,{[t.editing]:c,[t.hovering]:u&&!c});return s.createElement("div",{"data-testid":o.linkId,className:x,onClick:p,onMouseOver:h},s.createElement("div",{className:t.questionBody},c?s.createElement(s.Fragment,null,a&&s.createElement(oe,{size:"xl",defaultValue:n.title,onChange:S=>E("title",S.currentTarget.value)}),!a&&s.createElement(uc,{autosize:!0,minRows:2,defaultValue:o.text,onChange:S=>E("text",S.currentTarget.value)}),o.type==="reference"&&s.createElement(Use,{item:o,onChange:S=>E("extension",S)}),Cse(o)&&s.createElement(Vse,{item:o,onChange:S=>_(S)})):s.createElement(s.Fragment,null,n.title&&s.createElement(fe,null,n.title),o.text&&s.createElement("div",null,o.text),!i&&s.createElement(bN,{item:o,index:0,allResponses:[],onChange:()=>{}}))),(b=o.item)==null?void 0:b.map(S=>s.createElement("div",{key:S.id},s.createElement(EN,{item:S,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>w(S),onRepeatable:y}))),!i&&s.createElement("div",{className:t.topActions},c?s.createElement(s.Fragment,null,s.createElement(oe,{size:"xs",className:t.linkIdInput,defaultValue:o.linkId,onChange:S=>E("linkId",S.currentTarget.value)}),!i&&s.createElement(dt,{size:"xs",className:t.typeSelect,defaultValue:o.type,onChange:S=>E("type",S.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.createElement("div",null,l)),s.createElement("div",{className:t.bottomActions},i&&s.createElement(s.Fragment,null,s.createElement(Be,{href:"#",onClick:S=>{S.preventDefault(),v({id:da(),linkId:Lv("q"),type:"string",text:"Question"})}},"Add item"),s.createElement(Be,{href:"#",onClick:S=>{S.preventDefault(),v({id:da(),linkId:Lv("g"),type:"group",text:"Group"})}},"Add group")),a&&s.createElement(Be,{href:"#",onClick:S=>{S.preventDefault(),v(qse())}},"Add Page"),c&&!a&&s.createElement(s.Fragment,null,s.createElement(Be,{href:"#",onClick:S=>{S.preventDefault(),e.onRepeatable&&e.onRepeatable(o)}},o.repeats?"Remove Repeatable":"Make Repeatable"),s.createElement(Be,{href:"#",onClick:S=>{S.preventDefault(),e.onRemove&&e.onRemove()}},"Remove"))))}function Vse(e){let t=Ot.types.QuestionnaireItemAnswerOption.properties["value[x]"],r=e.item.answerOption??[];return s.createElement("div",null,e.item.answerValueSet!==void 0?s.createElement(oe,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:n=>e.onChange({...e.item,answerValueSet:n.target.value})}):s.createElement(Bse,{options:r,property:t,item:e.item,onChange:e.onChange}),s.createElement(se,{display:"flex"},s.createElement(Be,{href:"#",onClick:n=>{ot(n),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...r,{id:da()}]})}},"Add choice"),s.createElement(Bm,{w:"lg"}),s.createElement(Be,{href:"#",onClick:n=>{ot(n),e.onChange({...e.item,answerOption:[],answerValueSet:""})}},"Add value set")))}function Bse(e){return s.createElement("div",null,e.options.map(t=>{let[r,n]=Xa({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.createElement("div",{key:t.id,style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"}},s.createElement("div",null,s.createElement(ei,{key:t.id,name:"value[x]",property:e.property,defaultPropertyType:n,defaultValue:r,onChange:(o,a)=>{let i=[...e.options],l=i.findIndex(c=>c.id===t.id);i[l]={id:t.id,[a]:o},e.onChange({...e.item,answerOption:i})}})),s.createElement("div",null,s.createElement(Be,{href:"#",onClick:o=>{ot(o),e.onChange({...e.item,answerOption:e.options.filter(a=>a.id!==t.id)})}},"Remove")))}))}function Use(e){let t=e.item.extension??[],r=t.filter(n=>n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource")??[];return s.createElement(s.Fragment,null,r.map(n=>{var o,a;return s.createElement("div",{key:n.id},s.createElement("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"}},s.createElement("div",null,s.createElement(oe,{key:n.id,name:"value[x]",value:((a=(o=n.valueCodeableConcept)==null?void 0:o.coding)==null?void 0:a[0].code)??"",onChange:i=>{var d,p;i.preventDefault();let l=[...t],c=l.findIndex(h=>h.id===n.id),u=((p=(d=l[c].valueCodeableConcept)==null?void 0:d.coding)==null?void 0:p[0])??[];u.display=i.target.value,u.code=i.target.value,e.onChange(l)}}))),s.createElement("div",null,s.createElement(Be,{href:"#",onClick:i=>{ot(i),e.onChange(t.filter(l=>l.id!==n.id))}},"Remove")))}),s.createElement(Be,{href:"#",onClick:n=>{ot(n),e.onChange([...t,{id:da(),url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/fhir-types",display:"",code:""}]}}])}},"Add Resource"))}var Mv=1,zv=1;function Lv(e){return e+Mv++}function da(){return"id-"+zv++}function Wse(e){return{...e,id:e.id||da(),item:SN(e.item)}}function SN(e){if(e)return e.forEach(t=>{var r,n;(r=t.id)!=null&&r.match(/^id-\d+$/)&&(zv=Math.max(zv,parseInt(t.id.substring(3),10)+1)),(n=t.linkId)!=null&&n.match(/^q\d+$/)&&(Mv=Math.max(Mv,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||da(),item:SN(t.item),answerOption:Hse(t.answerOption)}))}function Hse(e){if(e)return e.map(t=>({...t,id:t.id||da()}))}function qse(){return{id:da(),linkId:Lv("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 PN(e){let t=re(),r=t.getProfile(),[n,o]=f.useState(),a=Ze(e.questionnaire),[i,l]=f.useState(),[c,u]=f.useState(0),d=Jse((a==null?void 0:a.item)??[]),p=()=>u(v=>v>=d?v:v+1),h=()=>u(v=>v<=0?v:v-1);f.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(o).catch(console.log)},[t]),f.useEffect(()=>{l(a?Qse(a):void 0)},[a]);function g(v){l({resourceType:"QuestionnaireResponse",item:v})}return!n||!a?null:s.createElement(Ne,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&i&&e.onSubmit({...i,questionnaire:ct(a),subject:e.subject,source:ut(r),authored:new Date().toISOString(),status:"completed"})}},a.title&&s.createElement(fe,null,a.title),a.item&&s.createElement(ON,{items:a.item??[],allResponses:(i==null?void 0:i.item)??[],onChange:g,renderPages:d>1,activePage:c}),s.createElement(Z,{position:"right",mt:"xl"},s.createElement(Gse,{activePage:c,numberOfPages:d,nextStep:p,prevStep:h,submitButtonText:e.submitButtonText})))}function ON(e){let[t,r]=f.useState(w1(e.items));function n(a,i){let l=t.some(u=>u.id===a),c;l?c=t.map(u=>u.id===a?i:u):c=[...t,i],r(c),e.onChange(c)}let o=e.items.map((a,i)=>e.renderPages?s.createElement(qs.Step,{label:a.text,key:a.linkId},s.createElement(nO,{key:`${a.linkId}-${i}`,item:a,index:i,allResponses:e.allResponses,currentResponseItems:t,groupSequence:e.groupSequence,setResponseItem:n})):s.createElement(nO,{key:`${a.linkId}-${i}`,item:a,index:i,groupSequence:e.groupSequence,allResponses:e.allResponses,currentResponseItems:t,setResponseItem:n}));return e.renderPages?s.createElement(qs,{active:e.activePage??0,allowNextStepsSelect:!1,p:6},o):s.createElement(je,null,o)}function nO(e){return kse(e.item,e.allResponses)?e.item.type==="display"?s.createElement("p",{key:e.item.linkId},e.item.text):e.item.type==="group"?s.createElement(oO,{key:e.item.linkId,item:e.item,allResponses:e.allResponses,currentResponseItems:e.currentResponseItems,groupSequence:e.groupSequence,onChange:t=>e.setResponseItem(t.id,t)}):s.createElement(Xe,{key:e.item.linkId,htmlFor:e.item.linkId,title:e.item.text??""},s.createElement(oO,{item:e.item,allResponses:e.allResponses,currentResponseItems:e.currentResponseItems,groupSequence:e.groupSequence,onChange:t=>e.setResponseItem(t.id,t)})):null}function oO(e){let t=e.item;function r(n,o){let a=o??0,i=e.currentResponseItems.filter(l=>l.linkId===t.linkId);e.onChange({id:tce(i,a),linkId:t.linkId,text:t.text,item:n})}return t.type==="group"?s.createElement(Zse,{key:e.item.linkId,text:t.text??"",item:t??[],allResponses:e.allResponses,onChange:r}):s.createElement(ece,{item:e.item,key:e.item.linkId},({index:n})=>s.createElement(bN,{...e,index:n}))}function Gse(e){return e.activePage===0&&e.numberOfPages<=0?s.createElement(Y,{type:"submit"},e.submitButtonText??"OK"):e.activePage>=e.numberOfPages?s.createElement(s.Fragment,null,s.createElement(Y,{onClick:e.prevStep},"Back"),s.createElement(Y,{onClick:e.nextStep,type:"submit"},e.submitButtonText??"OK")):e.activePage===0?s.createElement(s.Fragment,null,s.createElement(Y,{onClick:e.nextStep},"Next")):s.createElement(s.Fragment,null,s.createElement(Y,{onClick:e.prevStep},"Back"),s.createElement(Y,{onClick:e.nextStep},"Next"))}function Qse(e){return{resourceType:"QuestionnaireResponse",questionnaire:ct(e),item:w1(e.item)}}function w1(e){return(e==null?void 0:e.map(Kse))??[]}function Kse(e){var t;return{id:$N(),linkId:e.linkId,text:e.text,item:w1(e.item),answer:((t=e.initial)==null?void 0:t.map(Xse))??[]}}var Yse=1;function $N(){return"id-"+Yse++}function Xse(e){return{...e}}function Jse(e){return e.filter(t=>{var r,n,o,a;return((a=(o=(n=(r=gne(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"))==null?void 0:r.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:o[0])==null?void 0:a.code)==="page"}).length>0?e.length:0}function Zse(e){let[t,r]=f.useState(rce(e.item,e.allResponses)),n=e.item;return s.createElement(s.Fragment,null,[...Array(t)].map((o,a)=>s.createElement("div",{key:a},s.createElement("h3",null,e.text),s.createElement(ON,{items:n.item??[],allResponses:e.allResponses,groupSequence:a,onChange:i=>e.onChange(i,a)}))),e.item.repeats&&s.createElement(Be,{onClick:()=>r(o=>o+1)},"Add Group"))}function ece(e){var o;let[t,r]=f.useState(1),n=((o=e.item)==null?void 0:o.repeats)&&e.item.type!=="choice"&&e.item.type!=="open-choice";return s.createElement(s.Fragment,null,[...Array(t)].map((a,i)=>s.createElement(s.Fragment,{key:`${e.item.linkId}-${i}`},e.children({index:i}))),n&&s.createElement(Be,{onClick:()=>r(a=>a+1)},"Add Item"))}function tce(e,t){return e.length===0||e.length<t+1?$N():e[t].id}function rce(e,t){let r=t.filter(n=>n.linkId===e.linkId).length;return r>0?r:1}var nce=U(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"}})),oce=["gender","age","gestationalAge","context","appliesTo","category"],ace={definition:{resourceType:"ObservationDefinition"},onSubmit:()=>{}};function ice(e){e=Object.assign(ace,e);let t=e.definition,[r,n]=f.useState([]),[o,a]=f.useState(1),[i,l]=f.useState(1);return f.useEffect(()=>{let v=cce(t,l);n(uce(v.qualifiedInterval||[],a))},[t]),s.createElement(Ne,{testid:"reference-range-editor",onSubmit:c},s.createElement(je,null,r.map(v=>{var w;return s.createElement(lce,{unit:fce((w=t.quantitativeDetails)==null?void 0:w.unit),onChange:p,onAdd:h,onRemove:g,onRemoveGroup:d,key:`group-${v.id}`,intervalGroup:v})})),s.createElement(sr,{title:"Add Group",size:"sm",onClick:v=>{ot(v),u({id:`group-id-${o}`,filters:{},intervals:[]}),a(w=>w+1)}},s.createElement(Z0,null)),s.createElement(Z,{position:"right"},s.createElement(Y,{type:"submit"},"Save")));function c(){let v=r.flatMap(w=>w.intervals).filter(w=>!pce(w));e.onSubmit({...t,qualifiedInterval:v})}function u(v){n(w=>[...w,v])}function d(v){n(w=>w.filter(E=>E.id!==v.id))}function p(v,w){n(E=>{E=[...E];let _=E.find(x=>x.id===v),y=_==null?void 0:_.intervals.findIndex(x=>x.id===w.id);return y!==void 0&&(_!=null&&_.intervals[y])&&(_.intervals[y]=w),E})}function h(v,w){w.id===void 0&&(w.id=`id-${i}`,l(E=>E+1)),n(E=>{E=[...E];let _=E.findIndex(y=>y.id===v);if(_!==-1){let y={...E[_]};w={...w,...y.filters},y.intervals=[...y.intervals,w],E[_]=y}return E})}function g(v,w){n(E=>{E=[...E];let _=E.find(y=>y.id===v);return _&&(_.intervals=_.intervals.filter(y=>y.id!==w.id)),E})}}function lce(e){let{intervalGroup:t,unit:r}=e,{classes:n}=nce();return s.createElement(bc,{"data-testid":t.id,className:n.section},s.createElement(je,{spacing:"lg"},s.createElement(Z,{position:"right"},s.createElement(sr,{title:"Remove Group","data-testid":`remove-group-button-${t.id}`,key:`remove-group-button-${t.id}`,size:"sm",onClick:o=>{ot(o),e.onRemoveGroup(t)}},s.createElement(Fp,null))),s.createElement(sce,{intervalGroup:t,onChange:e.onChange}),s.createElement(gr,null),t.intervals.map(o=>s.createElement(je,{key:`interval-${o.id}`,spacing:"xs"},s.createElement(Z,null,s.createElement(oe,{key:`condition-${o.id}`,"data-testid":`condition-${o.id}`,defaultValue:o.condition,label:"Condition: ",size:"sm",onChange:a=>{ot(a),e.onChange(t.id,{...o,condition:a.currentTarget.value.trim()})}}),s.createElement(sr,{title:"Remove Interval",size:"sm",key:`remove-interval-${o.id}`,"data-testid":`remove-interval-${o.id}`,onClick:a=>{ot(a),e.onRemove(t.id,o)}},s.createElement(Fp,null))),s.createElement(c1,{onChange:a=>{e.onChange(t.id,{...o,range:a})},key:`range-${o.id}`,name:`range-${o.id}`,defaultValue:o.range}))),s.createElement(sr,{title:"Add Interval",size:"sm",onClick:o=>{ot(o),e.onAdd(t.id,{range:{low:{unit:r},high:{unit:r}}})}},s.createElement(Z0,null))))}function sce(e){var n,o;let{intervalGroup:t,onChange:r}=e;t.filters.age||(t.filters.age={});for(let 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.createElement(je,{style:{maxWidth:"50%"}},s.createElement(Z,null,s.createElement(dt,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:a=>{for(let i of t.intervals){let l=a.currentTarget.value;l===""&&(l=void 0),r(t.id,{...i,gender:l})}}})),s.createElement(Z,{spacing:"xs"},s.createElement(ae,{component:"label",htmlFor:`div-age-${t.id}`},"Age:"),s.createElement("div",{id:`div-age-${t.id}`},s.createElement(c1,{key:`age-${t.id}`,name:`age-${t.id}`,defaultValue:t.filters.age,onChange:a=>{for(let i of t.intervals)r(t.id,{...i,age:a})}}))),s.createElement(dt,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:a=>{for(let 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.createElement(dt,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:a=>{for(let i of t.intervals){let l=a.currentTarget.value;l===""?r(t.id,{...i,category:void 0}):r(t.id,{...i,category:l})}}}))}function cce(e,t){let r=e.qualifiedInterval||[],n=Math.max(...r.map(o=>{var i;let 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 uce(e,t){let r=1,n={};for(let o of e){let a=dce(o);a in n||(n[a]={id:`group-id-${r++}`,filters:Object.fromEntries(oce.map(i=>[i,o[i]])),intervals:[]}),n[a].intervals.push(o)}return t(r),Object.values(n)}function dce(e){var t,r;return[`gender=${e.gender}`,`age=${Gs(e.age)}`,`gestationalAge=${Gs(e.gestationalAge)}`,`context=${(t=e.context)==null?void 0:t.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function fce(e){return e&&(Ene(e,"http://unitsofmeasure.org")||e.text)}function pce(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 mce(e){var u;let t=re(),r=Ze(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.createElement(tn,null,(u=r.action)==null?void 0:u.map((d,p)=>{var w,E,_,y,x,b;let h=d.resource&&c(d.resource),g=(E=(w=h==null?void 0:h.input)==null?void 0:w[0])==null?void 0:E.valueReference,v=(y=(_=h==null?void 0:h.output)==null?void 0:_[0])==null?void 0:y.valueReference;return s.createElement(s.Fragment,{key:`action-${p}`},s.createElement(tn.Col,{span:1,p:"md"},(h==null?void 0:h.status)==="completed"?s.createElement(vae,null):s.createElement(Nae,{color:"gray"})),s.createElement(tn.Col,{span:9,p:"xs"},s.createElement(ae,{weight:500},d.title),d.description&&s.createElement("div",null,d.description),s.createElement("div",null,"Last edited by ",s.createElement(xc,{value:(x=h==null?void 0:h.meta)==null?void 0:x.author})," on ",Pr((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)),s.createElement("div",null,"Status: ",s.createElement(sN,{status:(h==null?void 0:h.status)||"unknown"}))),s.createElement(tn.Col,{span:2,p:"md"},g&&!v&&s.createElement(Y,{onClick:()=>e.onStart(h,g)},"Start"),g&&v&&s.createElement(Y,{onClick:()=>e.onEdit(h,g,v)},"Edit")))}));function l(d){var h;let p=[];if(d.action)for(let g of d.action)(h=g.resource)!=null&&h.reference&&p.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:p}}function c(d){for(let p of a==null?void 0:a.entry)if(p.resource&&d.reference===ct(p.resource))return p.resource}}function CN(e,t){let r=hce(e,t);return gce(r,e,t)}function hce(e,t){let 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){let d=i+u,p=d+1,h=d-1,g=l[p],v=l[h],w,E=0;u===-c||u!==c&&v.i<g.i?(E=g.i,w=g):(E=v.i+1,w=v),l[h]=void 0;let _=E-u,y={i:E,j:_,prev:vce(w),snake:!1};for(;E<r&&_<n&&e[E]===t[_];)E++,_++;if(E>y.i&&(y={i:E,j:_,prev:y,snake:!0}),l[d]=y,E>=r&&_>=n)return l[d]}l[i+c-1]=void 0}}function gce(e,t,r){let n=[],o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){let a=o.i,i=o.j;o=o.prev;let l=o.i,c=o.j,u={position:l,lines:t.slice(l,a)},d={position:c,lines:r.slice(c,i)},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 vce(e){return e&&!e.snake&&e.prev?e.prev:e}function yce(e){let t=e.entry.filter(n=>!!n.resource).map(n=>{var o;return{meta:(o=n.resource)==null?void 0:o.meta,lines:Or(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 wce(r,t),_ce(r),r}function wce(e,t){for(let r=1;r<t.length;r++){let n=CN(t[r-1].lines,t[r].lines);for(let o of n){let 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 _ce(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}}var bce=U(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 xce(e){var l,c;let{classes:t}=bce(),r=re(),[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.createElement("div",null,"Loading...");let a=(c=(l=n.entry)==null?void 0:l[0])==null?void 0:c.resource;if(!a)return null;let i=yce(n);return s.createElement("div",{className:t.container},s.createElement("table",{className:t.root},s.createElement("tbody",null,i.map((u,d)=>s.createElement("tr",{key:"row-"+d,className:u.span>0?t.startRow:t.normalRow},u.span>0&&s.createElement(s.Fragment,null,s.createElement("td",{className:t.author,rowSpan:u.span},s.createElement(Zi,{value:u.meta.author,link:!0})),s.createElement("td",{className:t.dateTime,rowSpan:u.span},s.createElement(Re,{to:Ece(a,u.meta.versionId)},Sce(u.meta.lastUpdated)))),s.createElement("td",{className:t.lineNumber},d+1),s.createElement("td",{className:t.line},s.createElement("pre",{className:t.pre},u.value)))))))}function Ece(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function Sce(e){let t=Math.floor((Date.now()-Date.parse(e))/1e3),r=Math.floor(t/31536e3);if(r>0)return Si(r,"year");let n=Math.floor(t/2592e3);if(n>0)return Si(n,"month");let o=Math.floor(t/86400);if(o>0)return Si(o,"day");let a=Math.floor(t/3600);if(a>0)return Si(a,"hour");let i=Math.floor(t/60);return i>0?Si(i,"minute"):Si(t,"second")}function Si(e,t){return`${e} ${e===1?t:t+"s"} ago`}var Pce=U(e=>({removed:{color:e.colors.red[7],textDecoration:"line-through"},added:{color:e.colors.green[7]}}));function Oce(e){let t=e.original,r=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},r={...r,meta:void 0});let n=Or(t,!0).match(/[^\r\n]+/g),o=Or(r,!0).match(/[^\r\n]+/g),a=CN(n,o);return s.createElement("pre",{style:{color:"gray"}},a.map((i,l)=>s.createElement($ce,{key:"delta"+l,delta:i})))}function $ce(e){let{classes:t}=Pce();return s.createElement(s.Fragment,null,"...",s.createElement("br",null),e.delta.original.lines.length>0&&s.createElement("div",{className:t.removed},e.delta.original.lines.join(`
|
|
182
|
+
`)),e.delta.revised.lines.length>0&&s.createElement("div",{className:t.added},e.delta.revised.lines.join(`
|
|
183
|
+
`)),"...",s.createElement("br",null))}function Cce(e){var o;let t=re(),[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.createElement(si,{withBorder:!0,withColumnBorders:!0},s.createElement("thead",null,s.createElement("tr",null,s.createElement("th",null,"Author"),s.createElement("th",null,"Date"),s.createElement("th",null,"Version"))),s.createElement("tbody",null,(o=r.entry)==null?void 0:o.map((a,i)=>s.createElement(kce,{key:"entry-"+i,entry:a})))):s.createElement("div",null,"Loading...")}function kce(e){var n,o,a;let{response:t,resource:r}=e.entry;return r?s.createElement("tr",null,s.createElement("td",null,s.createElement(Zi,{value:(n=r.meta)==null?void 0:n.author,link:!0})),s.createElement("td",null,Pr((o=r.meta)==null?void 0:o.lastUpdated)),s.createElement("td",null,s.createElement(Re,{to:jce(r)},(a=r.meta)==null?void 0:a.versionId))):s.createElement("tr",null,s.createElement("td",{colSpan:3},Ce(t==null?void 0:t.outcome)))}function jce(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function Rce(e){return s.createElement(Jm,{value:e.serviceRequest,loadTimelineResources:async(t,r,n)=>{let 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:[ut(t)],subject:t.subject,sender:ut(r),sent:new Date().toISOString(),payload:[{contentString:n}]}),createMedia:(t,r,n)=>({resourceType:"Media",status:"completed",basedOn:[ut(t)],subject:t.subject,operator:ut(r),issued:new Date().toISOString(),content:n})})}function kN(e){let t=re(),[r,n]=f.useState();return s.createElement(Ne,{style:{maxWidth:400},onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(a){n(_t(a))}}},s.createElement(Zt,{sx:{flexDirection:"column"}},s.createElement(Rn,{size:32}),s.createElement(fe,null,"Create project")),s.createElement(je,{spacing:"xl"},s.createElement(oe,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:at(r,"firstName")}),s.createElement(ae,{color:"dimmed",size:"xs"},"By clicking submit you agree to the Medplum"," ",s.createElement(Be,{href:"https://www.medplum.com/privacy"},"Privacy Policy")," and ",s.createElement(Be,{href:"https://www.medplum.com/terms"},"Terms of Service"),".")),s.createElement(Z,{position:"right",mt:"xl",noWrap:!0},s.createElement(Y,{type:"submit"},"Create project")))}function jN(e,t){let r=document.getElementsByTagName("head")[0],n=document.createElement("script");n.async=!0,n.src=e,n.onload=t??null,r.appendChild(n)}function RN(e){let t=re(),{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"){jN("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.createElement("div",{ref:o}):null}function TN(e){if(e)return e;if(typeof window<"u"){let t=window.location.protocol+"//"+window.location.host;if(("undefined".split(",")??[]).includes(t))return"__GOOGLE_CLIENT_ID__"}}function IN(e){typeof grecaptcha>"u"&&jN("https://www.google.com/recaptcha/api.js?render="+e)}function DN(e){return new Promise((t,r)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(n){r(n)}})})}function Tce(e){let t=TN(e.googleClientId),r=e.recaptchaSiteKey,n=re(),[o,a]=f.useState(),i=s1(o,void 0);return f.useEffect(()=>{r&&IN(r)},[r]),s.createElement(Ne,{style:{maxWidth:400},onSubmit:async l=>{try{let c="";r&&(c=await DN(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(_t(c))}}},s.createElement(Zt,{sx:{flexDirection:"column"}},e.children),s.createElement(ui,{issues:i}),t&&s.createElement(s.Fragment,null,s.createElement(Z,{position:"center",p:"xl",style:{height:70}},s.createElement(RN,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await n.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,createUser:!0}))}catch(c){a(_t(c))}}})),s.createElement(gr,{label:"or",labelPosition:"center",my:"lg"})),s.createElement(je,{spacing:"xl"},s.createElement(oe,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:at(o,"firstName")}),s.createElement(oe,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:at(o,"lastName")}),s.createElement(oe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:at(o,"email")}),s.createElement(po,{name:"password",label:"Password",autoComplete:"off",required:!0,error:at(o,"password")}),s.createElement(ae,{color:"dimmed",size:"xs"},"By clicking submit you agree to the Medplum"," ",s.createElement(Be,{href:"https://www.medplum.com/privacy"},"Privacy Policy")," and ",s.createElement(Be,{href:"https://www.medplum.com/terms"},"Terms of Service"),"."),s.createElement(ae,{color:"dimmed",size:"xs"},"This site is protected by reCAPTCHA and the Google"," ",s.createElement(Be,{href:"https://policies.google.com/privacy"},"Privacy Policy")," and ",s.createElement(Be,{href:"https://policies.google.com/terms"},"Terms of Service")," apply.")),s.createElement(Z,{position:"apart",mt:"xl",noWrap:!0},s.createElement(kn,{name:"remember",label:"Remember me",size:"xs"}),s.createElement(Y,{type:"submit"},"Create account")))}function Ice(e){let{type:t,projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:a,onSuccess:i}=e,l=re(),[c,u]=f.useState(void 0),[d,p]=f.useState();f.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:r}).then(g=>l.processCode(g.code)).then(()=>i()).catch(g=>p(_t(g)))},[l,t,r,c,i]);function h(g){g.code?l.processCode(g.code).then(()=>i()).catch(console.log):g.login&&u(g.login)}return s.createElement(_e,{width:450},d&&s.createElement("pre",null,JSON.stringify(d,null,2)),!c&&s.createElement(Tce,{projectId:r,clientId:n,googleClientId:o,recaptchaSiteKey:a,handleAuthResponse:h},e.children),c&&t==="project"&&s.createElement(kN,{login:c,handleAuthResponse:h}))}function Dce(e){let[t,r]=f.useState();return t?s.createElement(Ace,{email:t,...e}):s.createElement(Nce,{setEmail:r,...e})}function Nce(e){let{setEmail:t,onRegister:r,handleAuthResponse:n,children:o,disableEmailAuth:a,...i}=e,l=re(),c=!e.disableGoogleAuth&&TN(e.googleClientId),u=f.useCallback(async h=>{if(!h.authorizeUrl)return!1;let g=JSON.stringify({...await l.ensureCodeChallenge(i),domain:h.domain}),v=new URL(h.authorizeUrl);return v.searchParams.set("state",g),window.location.assign(v.toString()),!0},[l,i]),d=f.useCallback(async h=>{let g=await l.post("auth/method",{email:h.email});await u(g)||t(h.email)},[l,u,t]),p=f.useCallback(async h=>{let g=await l.startGoogleLogin({...i,googleCredential:h.credential});await u(g)||n(g)},[l,i,u,n]);return s.createElement(Ne,{style:{maxWidth:400},onSubmit:d},s.createElement(Zt,{sx:{flexDirection:"column"}},o),c&&s.createElement(s.Fragment,null,s.createElement(Z,{position:"center",p:"xl",style:{height:70}},s.createElement(RN,{googleClientId:c,handleGoogleCredential:p})),!a&&s.createElement(gr,{label:"or",labelPosition:"center",my:"lg"})),!a&&s.createElement(oe,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0}),s.createElement(Z,{position:"apart",mt:"xl",spacing:0,noWrap:!0},s.createElement("div",null,r&&s.createElement(Be,{component:"button",type:"button",color:"dimmed",onClick:r,size:"xs"},"Register")),!a&&s.createElement(Y,{type:"submit"},"Next")))}function Ace(e){let{onForgotPassword:t,handleAuthResponse:r,children:n,...o}=e,a=re(),[i,l]=f.useState(),c=s1(i,void 0),u=f.useCallback(d=>{a.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(r).catch(p=>l(_t(p)))},[a,o,r]);return s.createElement(Ne,{style:{maxWidth:400},onSubmit:u},s.createElement(Zt,{sx:{flexDirection:"column"}},n),s.createElement(ui,{issues:c}),s.createElement(je,{spacing:"xl"},s.createElement(po,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:at(i,"password")})),s.createElement(Z,{position:"apart",mt:"xl",spacing:0,noWrap:!0},t&&s.createElement(Be,{component:"button",type:"button",color:"dimmed",onClick:t,size:"xs"},"Forgot password"),s.createElement(kn,{id:"remember",name:"remember",label:"Remember me",size:"xs",sx:{lineHeight:1}}),s.createElement(Y,{type:"submit"},"Sign in")))}function Mce(e){let t=re(),[r,n]=f.useState();return s.createElement(je,null,s.createElement(Zt,{sx:{flexDirection:"column"}},s.createElement(Rn,{size:32}),s.createElement(fe,{order:3},"Choose profile")),s.createElement(ui,{outcome:r}),e.memberships.map(o=>{var a,i;return s.createElement(ho,{key:o.id,onClick:()=>{t.post("auth/profile",{login:e.login,profile:o.id}).then(e.handleAuthResponse).catch(l=>n(_t(l)))}},s.createElement(Z,null,s.createElement(hf,{radius:"xl"}),s.createElement("div",{style:{flex:1}},s.createElement(ae,{size:"sm",weight:500},(a=o.profile)==null?void 0:a.display),s.createElement(ae,{color:"dimmed",size:"xs"},(i=o.project)==null?void 0:i.display))))}))}function zce(e){let t=re();return s.createElement(Ne,{style:{maxWidth:400},onSubmit:r=>{t.post("auth/scope",{login:e.login,scope:Object.keys(r).join(" ")}).then(e.handleAuthResponse).catch(console.log)}},s.createElement(je,null,s.createElement(Zt,{sx:{flexDirection:"column"}},s.createElement(Rn,{size:32}),s.createElement(fe,null,"Choose scope")),s.createElement(je,null,(e.scope??"openid").split(" ").map(r=>s.createElement(kn,{key:r,id:r,name:r,label:r,defaultChecked:!0}))),s.createElement(Z,{position:"right",mt:"xl"},s.createElement(Y,{type:"submit"},"Set scope"))))}function Lce(e){let t=re(),[r,n]=f.useState(void 0);return s.createElement(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)))}},s.createElement(je,null,s.createElement(Zt,{sx:{flexDirection:"column"}},s.createElement(Rn,{size:32}),s.createElement(fe,null,"Enter MFA code")),r&&s.createElement(ic,{icon:s.createElement(J0,{size:16}),title:"Error",color:"red"},r),s.createElement(je,null,s.createElement(oe,{name:"token",label:"MFA code",required:!0})),s.createElement(Z,{position:"right",mt:"xl"},s.createElement(Y,{type:"submit"},"Submit code"))))}function NN(e){let{login:t,chooseScopes:r,onSuccess:n,onForgotPassword:o,onRegister:a,onCode:i,...l}=e,c=re(),[u,d]=f.useState(void 0),[p,h]=f.useState(!1),[g,v]=f.useState(void 0),w=f.useCallback(y=>{i?i(y):c.processCode(y).then(()=>{n&&n()}).catch(x=>de({color:"red",message:Ce(x)}))},[c,i,n]),E=f.useCallback(y=>{h(!!y.mfaRequired),y.login&&d(y.login),y.memberships&&v(y.memberships),y.code&&(r?v(void 0):w(y.code))},[r,w]),_=f.useCallback(y=>{w(y.code)},[w]);return f.useEffect(()=>{t&&!u&&c.get("auth/login/"+t).then(E).catch(y=>de({color:"red",message:Ce(y)}))},[c,t,u,E]),s.createElement(_e,{width:450},(()=>u?p?s.createElement(Lce,{login:u,handleAuthResponse:E}):g?s.createElement(Mce,{login:u,memberships:g,handleAuthResponse:E}):e.projectId==="new"?s.createElement(kN,{login:u,handleAuthResponse:E}):e.chooseScopes?s.createElement(zce,{login:u,scope:e.scope,handleAuthResponse:_}):s.createElement("div",null,"Success"):s.createElement(Dce,{onForgotPassword:o,onRegister:a,handleAuthResponse:E,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l},e.children))())}var AN,aO=oc;AN=aO.createRoot,aO.hydrateRoot;/**
|
|
184
|
+
* @remix-run/router v1.8.0
|
|
185
|
+
*
|
|
186
|
+
* Copyright (c) Remix Software Inc.
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the MIT license found in the
|
|
189
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
190
|
+
*
|
|
191
|
+
* @license MIT
|
|
192
|
+
*/function lt(){return lt=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},lt.apply(this,arguments)}var kt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(kt||(kt={}));const iO="popstate";function Fce(e){e===void 0&&(e={});function t(n,o){let{pathname:a,search:i,hash:l}=n.location;return Qs("",{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:Sc(o)}return Bce(t,r,null,e)}function $e(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ml(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Vce(){return Math.random().toString(36).substr(2,8)}function lO(e,t){return{usr:e.state,key:e.key,idx:t}}function Qs(e,t,r,n){return r===void 0&&(r=null),lt({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?To(t):t,{state:r,key:t&&t.key||n||Vce()})}function Sc(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 To(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 Bce(e,t,r,n){n===void 0&&(n={});let{window:o=document.defaultView,v5Compat:a=!1}=n,i=o.history,l=kt.Pop,c=null,u=d();u==null&&(u=0,i.replaceState(lt({},i.state,{idx:u}),""));function d(){return(i.state||{idx:null}).idx}function p(){l=kt.Pop;let E=d(),_=E==null?null:E-u;u=E,c&&c({action:l,location:w.location,delta:_})}function h(E,_){l=kt.Push;let y=Qs(w.location,E,_);r&&r(y,E),u=d()+1;let x=lO(y,u),b=w.createHref(y);try{i.pushState(x,"",b)}catch(S){if(S instanceof DOMException&&S.name==="DataCloneError")throw S;o.location.assign(b)}a&&c&&c({action:l,location:w.location,delta:1})}function g(E,_){l=kt.Replace;let y=Qs(w.location,E,_);r&&r(y,E),u=d();let x=lO(y,u),b=w.createHref(y);i.replaceState(x,"",b),a&&c&&c({action:l,location:w.location,delta:0})}function v(E){let _=o.location.origin!=="null"?o.location.origin:o.location.href,y=typeof E=="string"?E:Sc(E);return $e(_,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,_)}let w={get action(){return l},get location(){return e(o,i)},listen(E){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(iO,p),c=E,()=>{o.removeEventListener(iO,p),c=null}},createHref(E){return t(o,E)},createURL:v,encodeLocation(E){let _=v(E);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:h,replace:g,go(E){return i.go(E)}};return w}var xt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(xt||(xt={}));const Uce=new Set(["lazy","caseSensitive","path","id","index","children"]);function Wce(e){return e.index===!0}function Fv(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`),Wce(o)){let c=lt({},o,t(o),{id:l});return n[l]=c,c}else{let c=lt({},o,t(o),{id:l,children:void 0});return n[l]=c,o.children&&(c.children=Fv(o.children,t,i,n)),c}})}function Bi(e,t,r){r===void 0&&(r="/");let n=typeof t=="string"?To(t):t,o=Pc(n.pathname||"/",r);if(o==null)return null;let a=MN(e);Hce(a);let i=null;for(let l=0;i==null&&l<a.length;++l)i=eue(a[l],nue(o));return i}function MN(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+'".')),MN(a.children,t,d,u)),!(a.path==null&&!a.index)&&t.push({path:u,score:Jce(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 zN(a.path))o(a,i,c)}),t}function zN(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=zN(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 Hce(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:Zce(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const qce=/^:\w+$/,Gce=3,Qce=2,Kce=1,Yce=10,Xce=-2,sO=e=>e==="*";function Jce(e,t){let r=e.split("/"),n=r.length;return r.some(sO)&&(n+=Xce),t&&(n+=Qce),r.filter(o=>!sO(o)).reduce((o,a)=>o+(qce.test(a)?Gce:a===""?Kce:Yce),n)}function Zce(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 eue(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=tue({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:lue(oa([o,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(o=oa([o,d.pathnameBase]))}return a}function tue(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=rue(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]=oue(l[p]||"",d),u},{}),pathname:a,pathnameBase:i,pattern:e}}function rue(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!0),ml(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let 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 nue(e){try{return decodeURI(e)}catch(t){return ml(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function oue(e,t){try{return decodeURIComponent(e)}catch(r){return ml(!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 Pc(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 aue(e,t){t===void 0&&(t="/");let{pathname:r,search:n="",hash:o=""}=typeof e=="string"?To(e):e;return{pathname:r?r.startsWith("/")?r:iue(r,t):t,search:sue(n),hash:cue(o)}}function iue(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 dg(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 _1(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function LN(e,t,r,n){n===void 0&&(n=!1);let o;typeof e=="string"?o=To(e):(o=lt({},e),$e(!o.pathname||!o.pathname.includes("?"),dg("?","pathname","search",o)),$e(!o.pathname||!o.pathname.includes("#"),dg("#","pathname","hash",o)),$e(!o.search||!o.search.includes("#"),dg("#","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=aue(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,"/"),lue=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),sue=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,cue=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class b1{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 FN(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const VN=["post","put","patch","delete"],uue=new Set(VN),due=["get",...VN],fue=new Set(due),pue=new Set([301,302,303,307,308]),mue=new Set([307,308]),fg={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},hue={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Jl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},BN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,gue=e=>({hasErrorBoundary:!!e.hasErrorBoundary});function vue(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 A=e.detectErrorBoundary;o=L=>({hasErrorBoundary:A(L)})}else o=gue;let a={},i=Fv(e.routes,o,void 0,a),l,c=e.basename||"/",u=lt({v7_normalizeFormMethod:!1,v7_prependBasename:!1},e.future),d=null,p=new Set,h=null,g=null,v=null,w=e.hydrationData!=null,E=Bi(i,e.history.location,c),_=null;if(E==null){let A=Yr(404,{pathname:e.history.location.pathname}),{matches:L,route:B}=gO(i);E=L,_={[B.id]:A}}let y=!E.some(A=>A.route.lazy)&&(!E.some(A=>A.route.loader)||e.hydrationData!=null),x,b={historyAction:e.history.action,location:e.history.location,matches:E,initialized:y,navigation:fg,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||_,fetchers:new Map,blockers:new Map},S=kt.Pop,$=!1,O,C=!1,T=!1,j=[],k=[],I=new Map,z=0,N=-1,F=new Map,q=new Set,ee=new Map,R=new Map,D=new Map,V=!1;function G(){return d=e.history.listen(A=>{let{action:L,location:B,delta:K}=A;if(V){V=!1;return}ml(D.size===0||K!=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 ge=pt({currentLocation:b.location,nextLocation:B,historyAction:L});if(ge&&K!=null){V=!0,e.history.go(K*-1),qe(ge,{state:"blocked",location:B,proceed(){qe(ge,{state:"proceeding",proceed:void 0,reset:void 0,location:B}),e.history.go(K)},reset(){let ve=new Map(b.blockers);ve.set(ge,Jl),ce({blockers:ve})}});return}return Ge(L,B)}),b.initialized||Ge(kt.Pop,b.location),x}function ie(){d&&d(),p.clear(),O&&O.abort(),b.fetchers.forEach((A,L)=>qr(L)),b.blockers.forEach((A,L)=>pe(L))}function Oe(A){return p.add(A),()=>p.delete(A)}function ce(A){b=lt({},b,A),p.forEach(L=>L(b))}function Ae(A,L){var B,K;let ge=b.actionData!=null&&b.navigation.formMethod!=null&&_n(b.navigation.formMethod)&&b.navigation.state==="loading"&&((B=A.state)==null?void 0:B._isRedirect)!==!0,ve;L.actionData?Object.keys(L.actionData).length>0?ve=L.actionData:ve=null:ge?ve=b.actionData:ve=null;let we=L.loaderData?hO(b.loaderData,L.loaderData,L.matches||[],L.errors):b.loaderData,me=b.blockers;me.size>0&&(me=new Map(me),me.forEach((Me,it)=>me.set(it,Jl)));let le=$===!0||b.navigation.formMethod!=null&&_n(b.navigation.formMethod)&&((K=A.state)==null?void 0:K._isRedirect)!==!0;l&&(i=l,l=void 0),C||S===kt.Pop||(S===kt.Push?e.history.push(A,A.state):S===kt.Replace&&e.history.replace(A,A.state)),ce(lt({},L,{actionData:ve,loaderData:we,historyAction:S,location:A,initialized:!0,navigation:fg,revalidation:"idle",restoreScrollPosition:Io(A,L.matches||b.matches),preventScrollReset:le,blockers:me})),S=kt.Pop,$=!1,C=!1,T=!1,j=[],k=[]}async function Ie(A,L){if(typeof A=="number"){e.history.go(A);return}let B=Vv(b.location,b.matches,c,u.v7_prependBasename,A,L==null?void 0:L.fromRouteId,L==null?void 0:L.relative),{path:K,submission:ge,error:ve}=cO(u.v7_normalizeFormMethod,!1,B,L),we=b.location,me=Qs(b.location,K,L&&L.state);me=lt({},me,e.history.encodeLocation(me));let le=L&&L.replace!=null?L.replace:void 0,Me=kt.Push;le===!0?Me=kt.Replace:le===!1||ge!=null&&_n(ge.formMethod)&&ge.formAction===b.location.pathname+b.location.search&&(Me=kt.Replace);let it=L&&"preventScrollReset"in L?L.preventScrollReset===!0:void 0,be=pt({currentLocation:we,nextLocation:me,historyAction:Me});if(be){qe(be,{state:"blocked",location:me,proceed(){qe(be,{state:"proceeding",proceed:void 0,reset:void 0,location:me}),Ie(A,L)},reset(){let ke=new Map(b.blockers);ke.set(be,Jl),ce({blockers:ke})}});return}return await Ge(Me,me,{submission:ge,pendingError:ve,preventScrollReset:it,replace:L&&L.replace})}function ft(){if(He(),ce({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){Ge(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}Ge(S||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation})}}async function Ge(A,L,B){O&&O.abort(),O=null,S=A,C=(B&&B.startUninterruptedRevalidation)===!0,Ir(b.location,b.matches),$=(B&&B.preventScrollReset)===!0;let K=l||i,ge=B&&B.overrideNavigation,ve=Bi(K,L,c);if(!ve){let ke=Yr(404,{pathname:L.pathname}),{matches:Ct,route:Gt}=gO(K);mt(),Ae(L,{matches:Ct,loaderData:{},errors:{[Gt.id]:ke}});return}if(b.initialized&&!T&&xue(b.location,L)&&!(B&&B.submission&&_n(B.submission.formMethod))){Ae(L,{matches:ve});return}O=new AbortController;let we=es(e.history,L,O.signal,B&&B.submission),me,le;if(B&&B.pendingError)le={[Ui(ve).route.id]:B.pendingError};else if(B&&B.submission&&_n(B.submission.formMethod)){let ke=await tt(we,L,B.submission,ve,{replace:B.replace});if(ke.shortCircuited)return;me=ke.pendingActionData,le=ke.pendingActionError,ge=$u(L,B.submission),we=new Request(we.url,{signal:we.signal})}let{shortCircuited:Me,loaderData:it,errors:be}=await jr(we,L,ve,ge,B&&B.submission,B&&B.fetcherSubmission,B&&B.replace,me,le);Me||(O=null,Ae(L,lt({matches:ve},me?{actionData:me}:{},{loaderData:it,errors:be})))}async function tt(A,L,B,K,ge){ge===void 0&&(ge={}),He();let ve=$ue(L,B);ce({navigation:ve});let we,me=Uv(K,L);if(!me.route.action&&!me.route.lazy)we={type:xt.error,error:Yr(405,{method:A.method,pathname:L.pathname,routeId:me.route.id})};else if(we=await Zl("action",A,me,K,a,o,c),A.signal.aborted)return{shortCircuited:!0};if(el(we)){let le;return ge&&ge.replace!=null?le=ge.replace:le=we.location===b.location.pathname+b.location.search,await Tr(b,we,{submission:B,replace:le}),{shortCircuited:!0}}if(Es(we)){let le=Ui(K,me.route.id);return(ge&&ge.replace)!==!0&&(S=kt.Push),{pendingActionData:{},pendingActionError:{[le.route.id]:we.error}}}if(za(we))throw Yr(400,{type:"defer-action"});return{pendingActionData:{[me.route.id]:we.data}}}async function jr(A,L,B,K,ge,ve,we,me,le){let Me=K||$u(L,ge),it=ge||ve||wO(Me),be=l||i,[ke,Ct]=uO(e.history,b,B,it,L,T,j,k,ee,q,be,c,me,le);if(mt(ze=>!(B&&B.some(nr=>nr.route.id===ze))||ke&&ke.some(nr=>nr.route.id===ze)),N=++z,ke.length===0&&Ct.length===0){let ze=fi();return Ae(L,lt({matches:B,loaderData:{},errors:le||null},me?{actionData:me}:{},ze?{fetchers:new Map(b.fetchers)}:{})),{shortCircuited:!0}}if(!C){Ct.forEach(nr=>{let In=b.fetchers.get(nr.key),ba=ts(void 0,In?In.data:void 0);b.fetchers.set(nr.key,ba)});let ze=me||b.actionData;ce(lt({navigation:Me},ze?Object.keys(ze).length===0?{actionData:null}:{actionData:ze}:{},Ct.length>0?{fetchers:new Map(b.fetchers)}:{}))}Ct.forEach(ze=>{I.has(ze.key)&&bt(ze.key),ze.controller&&I.set(ze.key,ze.controller)});let Gt=()=>Ct.forEach(ze=>bt(ze.key));O&&O.signal.addEventListener("abort",Gt);let{results:Tn,loaderResults:wa,fetcherResults:fr}=await to(b.matches,B,ke,Ct,A);if(A.signal.aborted)return{shortCircuited:!0};O&&O.signal.removeEventListener("abort",Gt),Ct.forEach(ze=>I.delete(ze.key));let pr=vO(Tn);if(pr){if(pr.idx>=ke.length){let ze=Ct[pr.idx-ke.length].key;q.add(ze)}return await Tr(b,pr.result,{replace:we}),{shortCircuited:!0}}let{loaderData:hn,errors:_a}=mO(b,B,ke,wa,le,Ct,fr,R);R.forEach((ze,nr)=>{ze.subscribe(In=>{(In||ze.done)&&R.delete(nr)})});let Do=fi(),mi=pi(N),jl=Do||mi||Ct.length>0;return lt({loaderData:hn,errors:_a},jl?{fetchers:new Map(b.fetchers)}:{})}function Rr(A){return b.fetchers.get(A)||hue}function rr(A,L,B,K){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.");I.has(A)&&bt(A);let ge=l||i,ve=Vv(b.location,b.matches,c,u.v7_prependBasename,B,L,K==null?void 0:K.relative),we=Bi(ge,ve,c);if(!we){Hr(A,L,Yr(404,{pathname:ve}));return}let{path:me,submission:le,error:Me}=cO(u.v7_normalizeFormMethod,!0,ve,K);if(Me){Hr(A,L,Me);return}let it=Uv(we,me);if($=(K&&K.preventScrollReset)===!0,le&&_n(le.formMethod)){pn(A,L,me,it,we,le);return}ee.set(A,{routeId:L,path:me}),Tt(A,L,me,it,we,le)}async function pn(A,L,B,K,ge,ve){if(He(),ee.delete(A),!K.route.action&&!K.route.lazy){let Se=Yr(405,{method:ve.formMethod,pathname:B,routeId:L});Hr(A,L,Se);return}let we=b.fetchers.get(A),me=Cue(ve,we);b.fetchers.set(A,me),ce({fetchers:new Map(b.fetchers)});let le=new AbortController,Me=es(e.history,B,le.signal,ve);I.set(A,le);let it=z,be=await Zl("action",Me,K,ge,a,o,c);if(Me.signal.aborted){I.get(A)===le&&I.delete(A);return}if(el(be))if(I.delete(A),N>it){let Se=$i(void 0);b.fetchers.set(A,Se),ce({fetchers:new Map(b.fetchers)});return}else{q.add(A);let Se=ts(ve);return b.fetchers.set(A,Se),ce({fetchers:new Map(b.fetchers)}),Tr(b,be,{submission:ve,isFetchActionRedirect:!0})}if(Es(be)){Hr(A,L,be.error);return}if(za(be))throw Yr(400,{type:"defer-action"});let ke=b.navigation.location||b.location,Ct=es(e.history,ke,le.signal),Gt=l||i,Tn=b.navigation.state!=="idle"?Bi(Gt,b.navigation.location,c):b.matches;$e(Tn,"Didn't find any matches after fetcher action");let wa=++z;F.set(A,wa);let fr=ts(ve,be.data);b.fetchers.set(A,fr);let[pr,hn]=uO(e.history,b,Tn,ve,ke,T,j,k,ee,q,Gt,c,{[K.route.id]:be.data},void 0);hn.filter(Se=>Se.key!==A).forEach(Se=>{let Gr=Se.key,mr=b.fetchers.get(Gr),kc=ts(void 0,mr?mr.data:void 0);b.fetchers.set(Gr,kc),I.has(Gr)&&bt(Gr),Se.controller&&I.set(Gr,Se.controller)}),ce({fetchers:new Map(b.fetchers)});let _a=()=>hn.forEach(Se=>bt(Se.key));le.signal.addEventListener("abort",_a);let{results:Do,loaderResults:mi,fetcherResults:jl}=await to(b.matches,Tn,pr,hn,Ct);if(le.signal.aborted)return;le.signal.removeEventListener("abort",_a),F.delete(A),I.delete(A),hn.forEach(Se=>I.delete(Se.key));let ze=vO(Do);if(ze){if(ze.idx>=pr.length){let Se=hn[ze.idx-pr.length].key;q.add(Se)}return Tr(b,ze.result)}let{loaderData:nr,errors:In}=mO(b,b.matches,pr,mi,void 0,hn,jl,R);if(b.fetchers.has(A)){let Se=$i(be.data);b.fetchers.set(A,Se)}let ba=pi(wa);b.navigation.state==="loading"&&wa>N?($e(S,"Expected pending action"),O&&O.abort(),Ae(b.navigation.location,{matches:Tn,loaderData:nr,errors:In,fetchers:new Map(b.fetchers)})):(ce(lt({errors:In,loaderData:hO(b.loaderData,nr,Tn,In)},ba||hn.length>0?{fetchers:new Map(b.fetchers)}:{})),T=!1)}async function Tt(A,L,B,K,ge,ve){let we=b.fetchers.get(A),me=ts(ve,we?we.data:void 0);b.fetchers.set(A,me),ce({fetchers:new Map(b.fetchers)});let le=new AbortController,Me=es(e.history,B,le.signal);I.set(A,le);let it=z,be=await Zl("loader",Me,K,ge,a,o,c);if(za(be)&&(be=await HN(be,Me.signal,!0)||be),I.get(A)===le&&I.delete(A),Me.signal.aborted)return;if(el(be))if(N>it){let Ct=$i(void 0);b.fetchers.set(A,Ct),ce({fetchers:new Map(b.fetchers)});return}else{q.add(A),await Tr(b,be);return}if(Es(be)){let Ct=Ui(b.matches,L);b.fetchers.delete(A),ce({fetchers:new Map(b.fetchers),errors:{[Ct.route.id]:be.error}});return}$e(!za(be),"Unhandled fetcher deferred data");let ke=$i(be.data);b.fetchers.set(A,ke),ce({fetchers:new Map(b.fetchers)})}async function Tr(A,L,B){let{submission:K,replace:ge,isFetchActionRedirect:ve}=B===void 0?{}:B;L.revalidate&&(T=!0);let we=Qs(A.location,L.location,lt({_isRedirect:!0},ve?{_isFetchActionRedirect:!0}:{}));if($e(we,"Expected a location on the redirect navigation"),r){let Me=!1;if(L.reloadDocument)Me=!0;else if(BN.test(L.location)){const it=e.history.createURL(L.location);Me=it.origin!==t.location.origin||Pc(it.pathname,c)==null}if(Me){ge?t.location.replace(L.location):t.location.assign(L.location);return}}O=null;let me=ge===!0?kt.Replace:kt.Push,le=K||wO(A.navigation);if(mue.has(L.status)&&le&&_n(le.formMethod))await Ge(me,we,{submission:lt({},le,{formAction:L.location}),preventScrollReset:$});else if(ve)await Ge(me,we,{overrideNavigation:$u(we),fetcherSubmission:le,preventScrollReset:$});else{let Me=$u(we,le);await Ge(me,we,{overrideNavigation:Me,preventScrollReset:$})}}async function to(A,L,B,K,ge){let ve=await Promise.all([...B.map(le=>Zl("loader",ge,le,L,a,o,c)),...K.map(le=>le.matches&&le.match&&le.controller?Zl("loader",es(e.history,le.path,le.controller.signal),le.match,le.matches,a,o,c):{type:xt.error,error:Yr(404,{pathname:le.path})})]),we=ve.slice(0,B.length),me=ve.slice(B.length);return await Promise.all([yO(A,B,we,we.map(()=>ge.signal),!1,b.loaderData),yO(A,K.map(le=>le.match),me,K.map(le=>le.controller?le.controller.signal:null),!0)]),{results:ve,loaderResults:we,fetcherResults:me}}function He(){T=!0,j.push(...mt()),ee.forEach((A,L)=>{I.has(L)&&(k.push(L),bt(L))})}function Hr(A,L,B){let K=Ui(b.matches,L);qr(A),ce({errors:{[K.route.id]:B},fetchers:new Map(b.fetchers)})}function qr(A){let L=b.fetchers.get(A);I.has(A)&&!(L&&L.state==="loading"&&F.has(A))&&bt(A),ee.delete(A),F.delete(A),q.delete(A),b.fetchers.delete(A)}function bt(A){let L=I.get(A);$e(L,"Expected fetch controller: "+A),L.abort(),I.delete(A)}function di(A){for(let L of A){let B=Rr(L),K=$i(B.data);b.fetchers.set(L,K)}}function fi(){let A=[],L=!1;for(let B of q){let K=b.fetchers.get(B);$e(K,"Expected fetcher: "+B),K.state==="loading"&&(q.delete(B),A.push(B),L=!0)}return di(A),L}function pi(A){let L=[];for(let[B,K]of F)if(K<A){let ge=b.fetchers.get(B);$e(ge,"Expected fetcher: "+B),ge.state==="loading"&&(bt(B),F.delete(B),L.push(B))}return di(L),L.length>0}function J(A,L){let B=b.blockers.get(A)||Jl;return D.get(A)!==L&&D.set(A,L),B}function pe(A){b.blockers.delete(A),D.delete(A)}function qe(A,L){let B=b.blockers.get(A)||Jl;$e(B.state==="unblocked"&&L.state==="blocked"||B.state==="blocked"&&L.state==="blocked"||B.state==="blocked"&&L.state==="proceeding"||B.state==="blocked"&&L.state==="unblocked"||B.state==="proceeding"&&L.state==="unblocked","Invalid blocker state transition: "+B.state+" -> "+L.state);let K=new Map(b.blockers);K.set(A,L),ce({blockers:K})}function pt(A){let{currentLocation:L,nextLocation:B,historyAction:K}=A;if(D.size===0)return;D.size>1&&ml(!1,"A router only supports one blocker at a time");let ge=Array.from(D.entries()),[ve,we]=ge[ge.length-1],me=b.blockers.get(ve);if(!(me&&me.state==="proceeding")&&we({currentLocation:L,nextLocation:B,historyAction:K}))return ve}function mt(A){let L=[];return R.forEach((B,K)=>{(!A||A(K))&&(B.cancel(),L.push(K),R.delete(K))}),L}function ro(A,L,B){if(h=A,v=L,g=B||null,!w&&b.navigation===fg){w=!0;let K=Io(b.location,b.matches);K!=null&&ce({restoreScrollPosition:K})}return()=>{h=null,v=null,g=null}}function mn(A,L){return g&&g(A,L.map(K=>Oue(K,b.loaderData)))||A.key}function Ir(A,L){if(h&&v){let B=mn(A,L);h[B]=v()}}function Io(A,L){if(h){let B=mn(A,L),K=h[B];if(typeof K=="number")return K}return null}function ya(A){a={},l=Fv(A,o,void 0,a)}return x={get basename(){return c},get state(){return b},get routes(){return i},initialize:G,subscribe:Oe,enableScrollRestoration:ro,navigate:Ie,fetch:rr,revalidate:ft,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:Rr,deleteFetcher:qr,dispose:ie,getBlocker:J,deleteBlocker:pe,_internalFetchControllers:I,_internalActiveDeferreds:R,_internalSetRoutes:ya},x}function yue(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Vv(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=LN(o||".",_1(l).map(d=>d.pathnameBase),Pc(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&&!x1(u.search)&&(u.search=u.search?u.search.replace(/^\?/,"?index&"):"?index"),n&&r!=="/"&&(u.pathname=u.pathname==="/"?r:oa([r,u.pathname])),Sc(u)}function cO(e,t,r,n){if(!n||!yue(n))return{path:r};if(n.formMethod&&!Pue(n.formMethod))return{path:r,error:Yr(405,{method:n.formMethod})};let o=()=>({path:r,error:Yr(400,{type:"invalid-body"})}),a=n.formMethod||"get",i=e?a.toUpperCase():a.toLowerCase(),l=WN(r);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!_n(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((g,v)=>{let[w,E]=v;return""+g+w+"="+E+`
|
|
193
|
+
`},""):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(!_n(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=Bv(n.formData),u=n.formData;else if(n.body instanceof FormData)c=Bv(n.body),u=n.body;else if(n.body instanceof URLSearchParams)c=n.body,u=pO(c);else if(n.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(n.body),u=pO(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(_n(d.formMethod))return{path:r,submission:d};let p=To(r);return t&&p.search&&x1(p.search)&&c.append("index",""),p.search="?"+c,{path:Sc(p),submission:d}}function wue(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 uO(e,t,r,n,o,a,i,l,c,u,d,p,h,g){let v=g?Object.values(g)[0]:h?Object.values(h)[0]:void 0,w=e.createURL(t.location),E=e.createURL(o),_=g?Object.keys(g)[0]:void 0,x=wue(r,_).filter((S,$)=>{if(S.route.lazy)return!0;if(S.route.loader==null)return!1;if(_ue(t.loaderData,t.matches[$],S)||i.some(T=>T===S.route.id))return!0;let O=t.matches[$],C=S;return dO(S,lt({currentUrl:w,currentParams:O.params,nextUrl:E,nextParams:C.params},n,{actionResult:v,defaultShouldRevalidate:a||w.pathname+w.search===E.pathname+E.search||w.search!==E.search||UN(O,C)}))}),b=[];return c.forEach((S,$)=>{if(!r.some(k=>k.route.id===S.routeId))return;let O=Bi(d,S.path,p);if(!O){b.push({key:$,routeId:S.routeId,path:S.path,matches:null,match:null,controller:null});return}let C=t.fetchers.get($),T=Uv(O,S.path),j=!1;u.has($)?j=!1:l.includes($)?j=!0:C&&C.state!=="idle"&&C.data===void 0?j=a:j=dO(T,lt({currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:E,nextParams:r[r.length-1].params},n,{actionResult:v,defaultShouldRevalidate:a})),j&&b.push({key:$,routeId:S.routeId,path:S.path,matches:O,match:T,controller:new AbortController})}),[x,b]}function _ue(e,t,r){let n=!t||r.route.id!==t.route.id,o=e[r.route.id]===void 0;return n||o}function UN(e,t){let r=e.route.path;return e.pathname!==t.pathname||r!=null&&r.endsWith("*")&&e.params["*"]!==t.params["*"]}function dO(e,t){if(e.route.shouldRevalidate){let r=e.route.shouldRevalidate(t);if(typeof r=="boolean")return r}return t.defaultShouldRevalidate}async function fO(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";ml(!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&&!Uce.has(i)&&(a[i]=n[i])}Object.assign(o,a),Object.assign(o,lt({},t(o),{lazy:void 0}))}async function Zl(e,t,r,n,o,a,i,l){l===void 0&&(l={});let c,u,d,p=v=>{let w,E=new Promise((_,y)=>w=y);return d=()=>w(),t.signal.addEventListener("abort",d),Promise.race([v({request:t,params:r.params,context:l.requestContext}),E])};try{let v=r.route[e];if(r.route.lazy)if(v)u=(await Promise.all([p(v),fO(r.route,a,o)]))[0];else if(await fO(r.route,a,o),v=r.route[e],v)u=await p(v);else if(e==="action"){let w=new URL(t.url),E=w.pathname+w.search;throw Yr(405,{method:t.method,pathname:E,routeId:r.route.id})}else return{type:xt.data,data:void 0};else if(v)u=await p(v);else{let w=new URL(t.url),E=w.pathname+w.search;throw Yr(404,{pathname:E})}$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=xt.error,u=v}finally{d&&t.signal.removeEventListener("abort",d)}if(Sue(u)){let v=u.status;if(pue.has(v)){let _=u.headers.get("Location");if($e(_,"Redirects returned/thrown from loaders/actions must have a Location header"),!BN.test(_))_=Vv(new URL(t.url),n.slice(0,n.indexOf(r)+1),i,!0,_);else if(!l.isStaticRequest){let y=new URL(t.url),x=_.startsWith("//")?new URL(y.protocol+_):new URL(_),b=Pc(x.pathname,i)!=null;x.origin===y.origin&&b&&(_=x.pathname+x.search+x.hash)}if(l.isStaticRequest)throw u.headers.set("Location",_),u;return{type:xt.redirect,status:v,location:_,revalidate:u.headers.get("X-Remix-Revalidate")!==null,reloadDocument:u.headers.get("X-Remix-Reload-Document")!==null}}if(l.isRouteRequest)throw{type:c===xt.error?xt.error:xt.data,response:u};let w,E=u.headers.get("Content-Type");return E&&/\bapplication\/json\b/.test(E)?w=await u.json():w=await u.text(),c===xt.error?{type:c,error:new b1(v,u.statusText,w),headers:u.headers}:{type:xt.data,data:w,statusCode:u.status,headers:u.headers}}if(c===xt.error)return{type:c,error:u};if(Eue(u)){var h,g;return{type:xt.deferred,deferredData:u,statusCode:(h=u.init)==null?void 0:h.status,headers:((g=u.init)==null?void 0:g.headers)&&new Headers(u.init.headers)}}return{type:xt.data,data:u}}function es(e,t,r,n){let o=e.createURL(WN(t)).toString(),a={signal:r};if(n&&_n(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=Bv(n.formData):a.body=n.formData}return new Request(o,a)}function Bv(e){let t=new URLSearchParams;for(let[r,n]of e.entries())t.append(r,typeof n=="string"?n:n.name);return t}function pO(e){let t=new FormData;for(let[r,n]of e.entries())t.append(r,n);return t}function bue(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(!el(d),"Cannot handle redirect results in processLoaderData"),Es(d)){let g=Ui(e,h),v=d.error;n&&(v=Object.values(n)[0],n=void 0),i=i||{},i[g.route.id]==null&&(i[g.route.id]=v),a[h]=void 0,c||(c=!0,l=FN(d.error)?d.error.status:500),d.headers&&(u[h]=d.headers)}else za(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 mO(e,t,r,n,o,a,i,l){let{loaderData:c,errors:u}=bue(t,r,n,o,l);for(let d=0;d<a.length;d++){let{key:p,match:h,controller:g}=a[d];$e(i!==void 0&&i[d]!==void 0,"Did not find corresponding fetcher result");let v=i[d];if(!(g&&g.signal.aborted))if(Es(v)){let w=Ui(e.matches,h==null?void 0:h.route.id);u&&u[w.route.id]||(u=lt({},u,{[w.route.id]:v.error})),e.fetchers.delete(p)}else if(el(v))$e(!1,"Unhandled fetcher revalidation redirect");else if(za(v))$e(!1,"Unhandled fetcher deferred data");else{let w=$i(v.data);e.fetchers.set(p,w)}}return{loaderData:c,errors:u}}function hO(e,t,r,n){let o=lt({},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 Ui(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 gO(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 Yr(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 b1(e||500,i,new Error(l),!0)}function vO(e){for(let t=e.length-1;t>=0;t--){let r=e[t];if(el(r))return{result:r,idx:t}}}function WN(e){let t=typeof e=="string"?To(e):e;return Sc(lt({},t,{hash:""}))}function xue(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function za(e){return e.type===xt.deferred}function Es(e){return e.type===xt.error}function el(e){return(e&&e.type)===xt.redirect}function Eue(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 Sue(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function Pue(e){return fue.has(e.toLowerCase())}function _n(e){return uue.has(e.toLowerCase())}async function yO(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&&!UN(u,c)&&(a&&a[c.route.id])!==void 0;if(za(l)&&(o||d)){let p=n[i];$e(p,"Expected an AbortSignal for revalidating fetcher deferred result"),await HN(l,p,o).then(h=>{h&&(r[i]=h||r[i])})}}}async function HN(e,t,r){if(r===void 0&&(r=!1),!await e.deferredData.resolveData(t)){if(r)try{return{type:xt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:xt.error,error:o}}return{type:xt.data,data:e.deferredData.data}}}function x1(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Oue(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 Uv(e,t){let r=typeof t=="string"?To(t).search:t.search;if(e[e.length-1].route.index&&x1(r||""))return e[e.length-1];let n=_1(e);return n[n.length-1]}function wO(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 $u(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 $ue(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 ts(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," _hasFetcherDoneAnything ":!0}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t," _hasFetcherDoneAnything ":!0}}function Cue(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," _hasFetcherDoneAnything ":!0}}function $i(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e," _hasFetcherDoneAnything ":!0}}/**
|
|
194
|
+
* React Router v6.15.0
|
|
195
|
+
*
|
|
196
|
+
* Copyright (c) Remix Software Inc.
|
|
197
|
+
*
|
|
198
|
+
* This source code is licensed under the MIT license found in the
|
|
199
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
200
|
+
*
|
|
201
|
+
* @license MIT
|
|
202
|
+
*/function Up(){return Up=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},Up.apply(this,arguments)}const th=f.createContext(null),qN=f.createContext(null),rh=f.createContext(null),nh=f.createContext(null),ha=f.createContext({outlet:null,matches:[],isDataRoute:!1}),GN=f.createContext(null);function oh(){return f.useContext(nh)!=null}function ga(){return oh()||$e(!1),f.useContext(nh).location}function QN(e){f.useContext(rh).static||f.useLayoutEffect(e)}function $t(){let{isDataRoute:e}=f.useContext(ha);return e?Bue():kue()}function kue(){oh()||$e(!1);let e=f.useContext(th),{basename:t,navigator:r}=f.useContext(rh),{matches:n}=f.useContext(ha),{pathname:o}=ga(),a=JSON.stringify(_1(n).map(c=>c.pathnameBase)),i=f.useRef(!1);return QN(()=>{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=LN(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 jue=f.createContext(null);function Rue(e){let t=f.useContext(ha).outlet;return t&&f.createElement(jue.Provider,{value:e},t)}function et(){let{matches:e}=f.useContext(ha),t=e[e.length-1];return t?t.params:{}}function Tue(e,t){return KN(e,t)}function KN(e,t,r){oh()||$e(!1);let{navigator:n}=f.useContext(rh),{matches:o}=f.useContext(ha),a=o[o.length-1],i=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let c=ga(),u;if(t){var d;let w=typeof t=="string"?To(t):t;l==="/"||(d=w.pathname)!=null&&d.startsWith(l)||$e(!1),u=w}else u=c;let p=u.pathname||"/",h=l==="/"?p:p.slice(l.length)||"/",g=Bi(e,{pathname:h}),v=Mue(g&&g.map(w=>Object.assign({},w,{params:Object.assign({},i,w.params),pathname:oa([l,n.encodeLocation?n.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?l:oa([l,n.encodeLocation?n.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,r);return t&&v?f.createElement(nh.Provider,{value:{location:Up({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:kt.Pop}},v):v}function Iue(){let e=Vue(),t=FN(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 Due=f.createElement(Iue,null);class Nue 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(ha.Provider,{value:this.props.routeContext},f.createElement(GN.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Aue(e){let{routeContext:t,match:r,children:n}=e,o=f.useContext(th);return o&&o.static&&o.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=r.route.id),f.createElement(ha.Provider,{value:t},n)}function Mue(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||Due);let h=t.concat(a.slice(0,u+1)),g=()=>{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(Aue,{match:c,routeContext:{outlet:l,matches:h,isDataRoute:r!=null},children:v})};return r&&(c.route.ErrorBoundary||c.route.errorElement||u===0)?f.createElement(Nue,{location:r.location,revalidation:r.revalidation,component:p,error:d,children:g(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):g()},null)}var YN=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(YN||{}),Wp=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}(Wp||{});function zue(e){let t=f.useContext(th);return t||$e(!1),t}function Lue(e){let t=f.useContext(qN);return t||$e(!1),t}function Fue(e){let t=f.useContext(ha);return t||$e(!1),t}function XN(e){let t=Fue(),r=t.matches[t.matches.length-1];return r.route.id||$e(!1),r.route.id}function Vue(){var e;let t=f.useContext(GN),r=Lue(Wp.UseRouteError),n=XN(Wp.UseRouteError);return t||((e=r.errors)==null?void 0:e[n])}function Bue(){let{router:e}=zue(YN.UseNavigateStable),t=XN(Wp.UseNavigateStable),r=f.useRef(!1);return QN(()=>{r.current=!0}),f.useCallback(function(o,a){a===void 0&&(a={}),r.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Up({fromRouteId:t},a)))},[e,t])}const Uue="startTransition",_O=Ss[Uue];function Wue(e){let{fallbackElement:t,router:r,future:n}=e,[o,a]=f.useState(r.state),{v7_startTransition:i}=n||{},l=f.useCallback(p=>{i&&_O?_O(()=>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,g)=>r.navigate(p,{state:h,preventScrollReset:g==null?void 0:g.preventScrollReset}),replace:(p,h,g)=>r.navigate(p,{replace:!0,state:h,preventScrollReset:g==null?void 0:g.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(th.Provider,{value:d},f.createElement(qN.Provider,{value:o},f.createElement(que,{basename:u,location:o.location,navigationType:o.historyAction,navigator:c},o.initialized?f.createElement(Hue,{routes:r.routes,state:o}):t))),null)}function Hue(e){let{routes:t,state:r}=e;return KN(t,void 0,r)}function JN(e){return Rue(e.context)}function ue(e){$e(!1)}function que(e){let{basename:t="/",children:r=null,location:n,navigationType:o=kt.Pop,navigator:a,static:i=!1}=e;oh()&&$e(!1);let l=t.replace(/^\/*/,"/"),c=f.useMemo(()=>({basename:l,navigator:a,static:i}),[l,a,i]);typeof n=="string"&&(n=To(n));let{pathname:u="/",search:d="",hash:p="",state:h=null,key:g="default"}=n,v=f.useMemo(()=>{let w=Pc(u,l);return w==null?null:{location:{pathname:w,search:d,hash:p,state:h,key:g},navigationType:o}},[l,u,d,p,h,g,o]);return v==null?null:f.createElement(rh.Provider,{value:c},f.createElement(nh.Provider,{children:r,value:v}))}function Gue(e){let{children:t,location:r}=e;return Tue(Wv(t),r)}new Promise(()=>{});function Wv(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,Wv(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=Wv(n.props.children,a)),r.push(i)}),r}function Que(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}/**
|
|
203
|
+
* React Router DOM v6.15.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 Hp(){return Hp=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},Hp.apply(this,arguments)}function Hv(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 Kue(e,t){let r=Hv(e);return t&&t.forEach((n,o)=>{r.has(o)||t.getAll(o).forEach(a=>{r.append(o,a)})}),r}function Yue(e,t){return vue({basename:t==null?void 0:t.basename,future:Hp({},t==null?void 0:t.future,{v7_prependBasename:!0}),history:Fce({window:t==null?void 0:t.window}),hydrationData:(t==null?void 0:t.hydrationData)||Xue(),routes:e,mapRouteProperties:Que}).initialize()}function Xue(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Hp({},t,{errors:Jue(t.errors)})),t}function Jue(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 b1(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 bO;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher"})(bO||(bO={}));var xO;(function(e){e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(xO||(xO={}));function E1(e){let t=f.useRef(Hv(e)),r=f.useRef(!1),n=ga(),o=f.useMemo(()=>Kue(n.search,r.current?null:t.current),[n.search]),a=$t(),i=f.useCallback((l,c)=>{const u=Hv(typeof l=="function"?l(o):l);r.current=!0,a("?"+u,c)},[a,o]);return[o,i]}var Zue={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"},ede=Object.defineProperty,tde=Object.defineProperties,rde=Object.getOwnPropertyDescriptors,qp=Object.getOwnPropertySymbols,ZN=Object.prototype.hasOwnProperty,e3=Object.prototype.propertyIsEnumerable,EO=(e,t,r)=>t in e?ede(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,SO=(e,t)=>{for(var r in t||(t={}))ZN.call(t,r)&&EO(e,r,t[r]);if(qp)for(var r of qp(t))e3.call(t,r)&&EO(e,r,t[r]);return e},nde=(e,t)=>tde(e,rde(t)),ode=(e,t)=>{var r={};for(var n in e)ZN.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&&e3.call(e,n)&&(r[n]=e[n]);return r},At=(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=ode(i,["color","size","stroke","children"]);return f.createElement("svg",SO(nde(SO({ref:a},Zue),{width:c,height:c,stroke:l,strokeWidth:u,className:`tabler-icon tabler-icon-${e}`}),p),[...r.map(([h,g])=>f.createElement(h,g)),...d||[]])});return n.propTypes={color:Pe.string,size:Pe.oneOfType([Pe.string,Pe.number]),stroke:Pe.oneOfType([Pe.string,Pe.number])},n.displayName=`${t}`,n},ade=At("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"}]]),ide=At("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"}]]),lde=At("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"}]]),t3=At("check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]),sde=At("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"}]]),cde=At("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"}]]),ude=At("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"}]]),dde=At("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"}]]),fde=At("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"}]]),pde=At("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"}]]),mde=At("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"}]]),hde=At("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"}]]),gde=At("player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]),vde=At("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"}]]),yde=At("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"}]]),wde=At("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"}]]),PO=At("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"}]]),_de=At("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"}]]),qv=At("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]),bde=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 Oc(e,t){var r=xde(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 xde(e){var t=e.name,r=t&&t.lastIndexOf(".")!==-1;if(r&&!e.type){var n=t.split(".").pop().toLowerCase(),o=bde.get(n);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Ede=[".DS_Store","Thumbs.db"];function Sde(e){return gl(this,void 0,void 0,function(){return vl(this,function(t){return Gp(e)&&Pde(e.dataTransfer)?[2,kde(e.dataTransfer,e.type)]:Ode(e)?[2,$de(e)]:Array.isArray(e)&&e.every(function(r){return"getFile"in r&&typeof r.getFile=="function"})?[2,Cde(e)]:[2,[]]})})}function Pde(e){return Gp(e)}function Ode(e){return Gp(e)&&Gp(e.target)}function Gp(e){return typeof e=="object"&&e!==null}function $de(e){return Gv(e.target.files).map(function(t){return Oc(t)})}function Cde(e){return gl(this,void 0,void 0,function(){var t;return vl(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 Oc(n)})]}})})}function kde(e,t){return gl(this,void 0,void 0,function(){var r,n;return vl(this,function(o){switch(o.label){case 0:return e.items?(r=Gv(e.items).filter(function(a){return a.kind==="file"}),t!=="drop"?[2,r]:[4,Promise.all(r.map(jde))]):[3,2];case 1:return n=o.sent(),[2,OO(r3(n))];case 2:return[2,OO(Gv(e.files).map(function(a){return Oc(a)}))]}})})}function OO(e){return e.filter(function(t){return Ede.indexOf(t.name)===-1})}function Gv(e){if(e===null)return[];for(var t=[],r=0;r<e.length;r++){var n=e[r];t.push(n)}return t}function jde(e){if(typeof e.webkitGetAsEntry!="function")return $O(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?n3(t):$O(e)}function r3(e){return e.reduce(function(t,r){return yg(yg([],T1(t),!1),T1(Array.isArray(r)?r3(r):[r]),!1)},[])}function $O(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var r=Oc(t);return Promise.resolve(r)}function Rde(e){return gl(this,void 0,void 0,function(){return vl(this,function(t){return[2,e.isDirectory?n3(e):Tde(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 gl(i,void 0,void 0,function(){var c,u,d;return vl(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(Rde)),o.push(d),a(),p.label=6;case 6:return[2]}})})},function(l){n(l)})}a()})}function Tde(e){return gl(this,void 0,void 0,function(){return vl(this,function(t){return[2,new Promise(function(r,n){e.file(function(o){var a=Oc(o,e.fullPath);r(a)},function(o){n(o)})})]})})}var Ide=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 CO(e){return Ade(e)||Nde(e)||a3(e)||Dde()}function Dde(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
212
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nde(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ade(e){if(Array.isArray(e))return Qv(e)}function kO(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 jO(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?kO(Object(r),!0).forEach(function(n){o3(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kO(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 Ks(e,t){return Lde(e)||zde(e,t)||a3(e,t)||Mde()}function Mde(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
213
|
+
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 Qv(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 Qv(e,t)}}function Qv(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 zde(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 Lde(e){if(Array.isArray(e))return e}var Fde="file-invalid-type",Vde="file-too-large",Bde="file-too-small",Ude="too-many-files",Wde=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:Fde,message:"File type must be ".concat(r)}},RO=function(t){return{code:Vde,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},TO=function(t){return{code:Bde,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Hde={code:Ude,message:"Too many files"};function i3(e,t){var r=e.type==="application/x-moz-file"||Ide(e,t);return[r,r?null:Wde(t)]}function l3(e,t,r){if(Ta(e.size))if(Ta(t)&&Ta(r)){if(e.size>r)return[!1,RO(r)];if(e.size<t)return[!1,TO(t)]}else{if(Ta(t)&&e.size<t)return[!1,TO(t)];if(Ta(r)&&e.size>r)return[!1,RO(r)]}return[!0,null]}function Ta(e){return e!=null}function qde(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=Ks(u,1),p=d[0],h=l3(c,n,o),g=Ks(h,1),v=g[0],w=l?l(c):null;return p&&v&&!w})}function Qp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Cu(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 IO(e){e.preventDefault()}function Gde(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function Qde(e){return e.indexOf("Edge/")!==-1}function Kde(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return Gde(e)||Qde(e)}function Mn(){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!Qp(n)&&l&&l.apply(void 0,[n].concat(a)),Qp(n)})}}function Yde(){return"showOpenFilePicker"in window}function Xde(e){if(Ta(e)){var t=Object.entries(e).filter(function(r){var n=Ks(r,2),o=n[0],a=n[1],i=!0;return s3(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=Ks(n,2),a=o[0],i=o[1];return jO(jO({},r),{},o3({},a,i))},{});return[{description:"Files",accept:t}]}return e}function Jde(e){if(Ta(e))return Object.entries(e).reduce(function(t,r){var n=Ks(r,2),o=n[0],a=n[1];return[].concat(CO(t),[o],CO(a))},[]).filter(function(t){return s3(t)||c3(t)}).join(",")}function Zde(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function efe(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function s3(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function c3(e){return/^.*\.[\w]+$/.test(e)}var tfe=["children"],rfe=["open"],nfe=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],ofe=["refKey","onChange","onClick"];function afe(e){return sfe(e)||lfe(e)||u3(e)||ife()}function ife(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
214
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lfe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sfe(e){if(Array.isArray(e))return Kv(e)}function pg(e,t){return dfe(e)||ufe(e,t)||u3(e,t)||cfe()}function cfe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
215
|
+
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 Kv(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 Kv(e,t)}}function Kv(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 ufe(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 dfe(e){if(Array.isArray(e))return e}function DO(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 ht(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?DO(Object(r),!0).forEach(function(n){Yv(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):DO(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Yv(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Kp(e,t){if(e==null)return{};var r=ffe(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 ffe(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 S1=f.forwardRef(function(e,t){var r=e.children,n=Kp(e,tfe),o=f3(n),a=o.open,i=Kp(o,rfe);return f.useImperativeHandle(t,function(){return{open:a}},[a]),s.createElement(f.Fragment,null,r(ht(ht({},i),{},{open:a})))});S1.displayName="Dropzone";var d3={disabled:!1,getFilesFromEvent:Sde,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};S1.defaultProps=d3;S1.propTypes={children:Pe.func,accept:Pe.objectOf(Pe.arrayOf(Pe.string)),multiple:Pe.bool,preventDropOnDocument:Pe.bool,noClick:Pe.bool,noKeyboard:Pe.bool,noDrag:Pe.bool,noDragEventsBubbling:Pe.bool,minSize:Pe.number,maxSize:Pe.number,maxFiles:Pe.number,disabled:Pe.bool,getFilesFromEvent:Pe.func,onFileDialogCancel:Pe.func,onFileDialogOpen:Pe.func,useFsAccessApi:Pe.bool,autoFocus:Pe.bool,onDragEnter:Pe.func,onDragLeave:Pe.func,onDragOver:Pe.func,onDrop:Pe.func,onDropAccepted:Pe.func,onDropRejected:Pe.func,onError:Pe.func,validator:Pe.func};var Xv={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=ht(ht({},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,g=t.onDropAccepted,v=t.onDropRejected,w=t.onFileDialogCancel,E=t.onFileDialogOpen,_=t.useFsAccessApi,y=t.autoFocus,x=t.preventDropOnDocument,b=t.noClick,S=t.noKeyboard,$=t.noDrag,O=t.noDragEventsBubbling,C=t.onError,T=t.validator,j=f.useMemo(function(){return Jde(r)},[r]),k=f.useMemo(function(){return Xde(r)},[r]),I=f.useMemo(function(){return typeof E=="function"?E:NO},[E]),z=f.useMemo(function(){return typeof w=="function"?w:NO},[w]),N=f.useRef(null),F=f.useRef(null),q=f.useReducer(pfe,Xv),ee=pg(q,2),R=ee[0],D=ee[1],V=R.isFocused,G=R.isFileDialogActive,ie=f.useRef(typeof window<"u"&&window.isSecureContext&&_&&Yde()),Oe=function(){!ie.current&&G&&setTimeout(function(){if(F.current){var pe=F.current.files;pe.length||(D({type:"closeDialog"}),z())}},300)};f.useEffect(function(){return window.addEventListener("focus",Oe,!1),function(){window.removeEventListener("focus",Oe,!1)}},[F,G,z,ie]);var ce=f.useRef([]),Ae=function(pe){N.current&&N.current.contains(pe.target)||(pe.preventDefault(),ce.current=[])};f.useEffect(function(){return x&&(document.addEventListener("dragover",IO,!1),document.addEventListener("drop",Ae,!1)),function(){x&&(document.removeEventListener("dragover",IO),document.removeEventListener("drop",Ae))}},[N,x]),f.useEffect(function(){return!n&&y&&N.current&&N.current.focus(),function(){}},[N,y,n]);var Ie=f.useCallback(function(J){C?C(J):console.error(J)},[C]),ft=f.useCallback(function(J){J.preventDefault(),J.persist(),bt(J),ce.current=[].concat(afe(ce.current),[J.target]),Cu(J)&&Promise.resolve(o(J)).then(function(pe){if(!(Qp(J)&&!O)){var qe=pe.length,pt=qe>0&&qde({files:pe,accept:j,minSize:i,maxSize:a,multiple:l,maxFiles:c,validator:T}),mt=qe>0&&!pt;D({isDragAccept:pt,isDragReject:mt,isDragActive:!0,type:"setDraggedFiles"}),u&&u(J)}}).catch(function(pe){return Ie(pe)})},[o,u,Ie,O,j,i,a,l,c,T]),Ge=f.useCallback(function(J){J.preventDefault(),J.persist(),bt(J);var pe=Cu(J);if(pe&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return pe&&p&&p(J),!1},[p,O]),tt=f.useCallback(function(J){J.preventDefault(),J.persist(),bt(J);var pe=ce.current.filter(function(pt){return N.current&&N.current.contains(pt)}),qe=pe.indexOf(J.target);qe!==-1&&pe.splice(qe,1),ce.current=pe,!(pe.length>0)&&(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Cu(J)&&d&&d(J))},[N,d,O]),jr=f.useCallback(function(J,pe){var qe=[],pt=[];J.forEach(function(mt){var ro=i3(mt,j),mn=pg(ro,2),Ir=mn[0],Io=mn[1],ya=l3(mt,i,a),A=pg(ya,2),L=A[0],B=A[1],K=T?T(mt):null;if(Ir&&L&&!K)qe.push(mt);else{var ge=[Io,B];K&&(ge=ge.concat(K)),pt.push({file:mt,errors:ge.filter(function(ve){return ve})})}}),(!l&&qe.length>1||l&&c>=1&&qe.length>c)&&(qe.forEach(function(mt){pt.push({file:mt,errors:[Hde]})}),qe.splice(0)),D({acceptedFiles:qe,fileRejections:pt,type:"setFiles"}),h&&h(qe,pt,pe),pt.length>0&&v&&v(pt,pe),qe.length>0&&g&&g(qe,pe)},[D,l,j,i,a,c,h,g,v,T]),Rr=f.useCallback(function(J){J.preventDefault(),J.persist(),bt(J),ce.current=[],Cu(J)&&Promise.resolve(o(J)).then(function(pe){Qp(J)&&!O||jr(pe,J)}).catch(function(pe){return Ie(pe)}),D({type:"reset"})},[o,jr,Ie,O]),rr=f.useCallback(function(){if(ie.current){D({type:"openDialog"}),I();var J={multiple:l,types:k};window.showOpenFilePicker(J).then(function(pe){return o(pe)}).then(function(pe){jr(pe,null),D({type:"closeDialog"})}).catch(function(pe){Zde(pe)?(z(pe),D({type:"closeDialog"})):efe(pe)?(ie.current=!1,F.current?(F.current.value=null,F.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(pe)});return}F.current&&(D({type:"openDialog"}),I(),F.current.value=null,F.current.click())},[D,I,z,_,jr,Ie,k,l]),pn=f.useCallback(function(J){!N.current||!N.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),rr())},[N,rr]),Tt=f.useCallback(function(){D({type:"focus"})},[]),Tr=f.useCallback(function(){D({type:"blur"})},[]),to=f.useCallback(function(){b||(Kde()?setTimeout(rr,0):rr())},[b,rr]),He=function(pe){return n?null:pe},Hr=function(pe){return S?null:He(pe)},qr=function(pe){return $?null:He(pe)},bt=function(pe){O&&pe.stopPropagation()},di=f.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=J.refKey,qe=pe===void 0?"ref":pe,pt=J.role,mt=J.onKeyDown,ro=J.onFocus,mn=J.onBlur,Ir=J.onClick,Io=J.onDragEnter,ya=J.onDragOver,A=J.onDragLeave,L=J.onDrop,B=Kp(J,nfe);return ht(ht(Yv({onKeyDown:Hr(Mn(mt,pn)),onFocus:Hr(Mn(ro,Tt)),onBlur:Hr(Mn(mn,Tr)),onClick:He(Mn(Ir,to)),onDragEnter:qr(Mn(Io,ft)),onDragOver:qr(Mn(ya,Ge)),onDragLeave:qr(Mn(A,tt)),onDrop:qr(Mn(L,Rr)),role:typeof pt=="string"&&pt!==""?pt:"presentation"},qe,N),!n&&!S?{tabIndex:0}:{}),B)}},[N,pn,Tt,Tr,to,ft,Ge,tt,Rr,S,$,n]),fi=f.useCallback(function(J){J.stopPropagation()},[]),pi=f.useMemo(function(){return function(){var J=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=J.refKey,qe=pe===void 0?"ref":pe,pt=J.onChange,mt=J.onClick,ro=Kp(J,ofe),mn=Yv({accept:j,multiple:l,type:"file",style:{display:"none"},onChange:He(Mn(pt,Rr)),onClick:He(Mn(mt,fi)),tabIndex:-1},qe,F);return ht(ht({},mn),ro)}},[F,r,l,Rr,n]);return ht(ht({},R),{},{isFocused:V&&!n,getRootProps:di,getInputProps:pi,rootRef:N,inputRef:F,open:He(rr)})}function pfe(e,t){switch(t.type){case"focus":return ht(ht({},e),{},{isFocused:!0});case"blur":return ht(ht({},e),{},{isFocused:!1});case"openDialog":return ht(ht({},Xv),{},{isFileDialogActive:!0});case"closeDialog":return ht(ht({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return ht(ht({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return ht(ht({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return ht({},Xv);default:return e}}function NO(){}const[mfe,hfe]=Po("Dropzone component was not found in tree");var AO=Object.getOwnPropertySymbols,gfe=Object.prototype.hasOwnProperty,vfe=Object.prototype.propertyIsEnumerable,yfe=(e,t)=>{var r={};for(var n in e)gfe.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&AO)for(var n of AO(e))t.indexOf(n)<0&&vfe.call(e,n)&&(r[n]=e[n]);return r};function P1(e){const t=r=>{const n=H(`Dropzone${dw(e)}`,{},r),{children:o}=n,a=yfe(n,["children"]),i=hfe(),l=yl(o)?o:s.createElement("span",null,o);return i[e]?f.cloneElement(l,a):null};return t.displayName=`@mantine/dropzone/${dw(e)}`,t}const wfe=P1("accept"),_fe=P1("reject"),bfe=P1("idle");var xfe=Object.defineProperty,Efe=Object.defineProperties,Sfe=Object.getOwnPropertyDescriptors,MO=Object.getOwnPropertySymbols,Pfe=Object.prototype.hasOwnProperty,Ofe=Object.prototype.propertyIsEnumerable,zO=(e,t,r)=>t in e?xfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,LO=(e,t)=>{for(var r in t||(t={}))Pfe.call(t,r)&&zO(e,r,t[r]);if(MO)for(var r of MO(t))Ofe.call(t,r)&&zO(e,r,t[r]);return e},$fe=(e,t)=>Efe(e,Sfe(t)),Cfe=U((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:$fe(LO(LO({},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:M({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 kfe=Cfe;var jfe=Object.defineProperty,Rfe=Object.defineProperties,Tfe=Object.getOwnPropertyDescriptors,Yp=Object.getOwnPropertySymbols,p3=Object.prototype.hasOwnProperty,m3=Object.prototype.propertyIsEnumerable,FO=(e,t,r)=>t in e?jfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rs=(e,t)=>{for(var r in t||(t={}))p3.call(t,r)&&FO(e,r,t[r]);if(Yp)for(var r of Yp(t))m3.call(t,r)&&FO(e,r,t[r]);return e},mg=(e,t)=>Rfe(e,Tfe(t)),Ife=(e,t)=>{var r={};for(var n in e)p3.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&&m3.call(e,n)&&(r[n]=e[n]);return r};const Dfe={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0};function kl(e){const t=H("Dropzone",Dfe,e),{className:r,padding:n,radius:o,disabled:a,classNames:i,styles:l,loading:c,multiple:u,maxSize:d,accept:p,children:h,onDropAny:g,onDrop:v,onReject:w,openRef:E,name:_,unstyled:y,maxFiles:x,autoFocus:b,activateOnClick:S,activateOnDrag:$,dragEventsBubbling:O,activateOnKeyboard:C,onDragEnter:T,onDragLeave:j,onDragOver:k,onFileDialogCancel:I,onFileDialogOpen:z,preventDropOnDocument:N,useFsAccessApi:F,getFilesFromEvent:q,validator:ee,variant:R}=t,D=Ife(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:V,cx:G}=kfe({radius:o,padding:n},{name:"Dropzone",classNames:i,styles:l,unstyled:y,variant:R}),{getRootProps:ie,getInputProps:Oe,isDragAccept:ce,isDragReject:Ae,open:Ie}=f3(rs({onDrop:g,onDropAccepted:v,onDropRejected:w,disabled:a||c,accept:Array.isArray(p)?p.reduce((Ge,tt)=>mg(rs({},Ge),{[tt]:[]}),{}):p,multiple:u,maxSize:d,maxFiles:x,autoFocus:b,noClick:!S,noDrag:!$,noDragEventsBubbling:!O,noKeyboard:!C,onDragEnter:T,onDragLeave:j,onDragOver:k,onFileDialogCancel:I,onFileDialogOpen:z,preventDropOnDocument:N,useFsAccessApi:F,validator:ee},q?{getFilesFromEvent:q}:null));Q$(E,Ie);const ft=!ce&&!Ae;return s.createElement(mfe,{value:{accept:ce,reject:Ae,idle:ft}},s.createElement(se,mg(rs(rs({},D),ie()),{"data-accept":ce||void 0,"data-reject":Ae||void 0,"data-idle":ft||void 0,"data-loading":c||void 0,className:G(V.root,r)}),s.createElement(ZT,{visible:c,radius:o,unstyled:y}),s.createElement("input",mg(rs({},Oe()),{name:_})),s.createElement("div",{className:V.inner},h)))}kl.displayName="@mantine/dropzone/Dropzone";kl.Accept=wfe;kl.Reject=_fe;kl.Idle=bfe;const h3=kl;var Nfe=Object.defineProperty,Afe=Object.defineProperties,Mfe=Object.getOwnPropertyDescriptors,VO=Object.getOwnPropertySymbols,zfe=Object.prototype.hasOwnProperty,Lfe=Object.prototype.propertyIsEnumerable,BO=(e,t,r)=>t in e?Nfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ffe=(e,t)=>{for(var r in t||(t={}))zfe.call(t,r)&&BO(e,r,t[r]);if(VO)for(var r of VO(t))Lfe.call(t,r)&&BO(e,r,t[r]);return e},Vfe=(e,t)=>Afe(e,Mfe(t)),Bfe=U(e=>({wrapper:Vfe(Ffe({},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 Ufe=Bfe;var Wfe=Object.defineProperty,Hfe=Object.defineProperties,qfe=Object.getOwnPropertyDescriptors,Xp=Object.getOwnPropertySymbols,g3=Object.prototype.hasOwnProperty,v3=Object.prototype.propertyIsEnumerable,UO=(e,t,r)=>t in e?Wfe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,hg=(e,t)=>{for(var r in t||(t={}))g3.call(t,r)&&UO(e,r,t[r]);if(Xp)for(var r of Xp(t))v3.call(t,r)&&UO(e,r,t[r]);return e},gg=(e,t)=>Hfe(e,qfe(t)),Gfe=(e,t)=>{var r={};for(var n in e)g3.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&&v3.call(e,n)&&(r[n]=e[n]);return r};const Qfe={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:jn("max"),withinPortal:!0};function y3(e){const t=H("DropzoneFullScreen",Qfe,e),{classNames:r,styles:n,sx:o,className:a,style:i,unstyled:l,active:c,onDrop:u,onReject:d,zIndex:p,withinPortal:h,portalProps:g}=t,v=Gfe(t,["classNames","styles","sx","className","style","unstyled","active","onDrop","onReject","zIndex","withinPortal","portalProps"]),[w,E]=s.useState(0),[_,{open:y,close:x}]=j6(!1),{classes:b,cx:S}=Ufe(null,{name:"DropzoneFullScreen",classNames:r,styles:n,unstyled:l}),$=C=>{C.dataTransfer.types.includes("Files")&&(E(T=>T+1),y())},O=()=>{E(C=>C-1)};return f.useEffect(()=>{w===0&&x()},[w]),f.useEffect(()=>{if(c)return document.addEventListener("dragenter",$,!1),document.addEventListener("dragleave",O,!1),()=>{document.removeEventListener("dragenter",$,!1),document.removeEventListener("dragleave",O,!1)}},[c]),s.createElement(El,gg(hg({},g),{withinPortal:h}),s.createElement(se,{className:S(b.wrapper,a),sx:o,style:gg(hg({},i),{opacity:_?1:0,pointerEvents:_?"all":"none",zIndex:p})},s.createElement(kl,gg(hg({},v),{classNames:r,styles:n,unstyled:l,className:b.dropzone,onDrop:C=>{u==null||u(C),x()},onReject:C=>{d==null||d(C),x()}}))))}y3.displayName="@mantine/dropzone/DropzoneFullScreen";h3.FullScreen=y3;const ku=h3,Kfe=`{
|
|
216
|
+
"resourceType": "Bundle",
|
|
217
|
+
"type": "transaction",
|
|
218
|
+
"entry": [
|
|
219
|
+
{
|
|
220
|
+
"resource": {
|
|
221
|
+
"resourceType": "Patient",
|
|
222
|
+
"name": [{
|
|
223
|
+
"given": ["Alice"],
|
|
224
|
+
"family": "Smith"
|
|
225
|
+
}]
|
|
226
|
+
},
|
|
227
|
+
"request": {
|
|
228
|
+
"method": "POST",
|
|
229
|
+
"url": "Patient"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}`;function vg({id:e,title:t,message:r,color:n,icon:o,withCloseButton:a=!1,method:i="show"}){mo[i]({id:e,loading:!0,title:t,message:r,color:n,icon:o,withCloseButton:a,autoClose:!1})}function Yfe(){const e=tr(),t=re(),[r,n]=f.useState({}),o=f.useCallback(async(l,c)=>{const u="batch-upload";vg({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=N5(d));const p=await t.executeBatch(d);n(h=>({...h,[c]:p})),vg({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:m.jsx(t3,{size:"1rem"}),withCloseButton:!0})}catch(d){vg({id:u,title:"Batch Upload Failed",color:"red",message:Ce(d),method:"update",icon:m.jsx(qv,{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 m.jsxs(_e,{children:[m.jsx(fe,{children:"Batch Create"}),m.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",m.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(r).length===0&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Input"}),m.jsxs(Ke,{defaultValue:"upload",children:[m.jsxs(Ke.List,{children:[m.jsx(Ke.Tab,{value:"upload",children:"File Upload"}),m.jsx(Ke.Tab,{value:"json",children:"JSON"})]}),m.jsx(Ke.Panel,{value:"upload",pt:"xs",children:m.jsx(ku,{onDrop:a,accept:["application/json"],children:m.jsxs(Z,{position:"center",spacing:"xl",style:{minHeight:220,pointerEvents:"none"},children:[m.jsx(ku.Accept,{children:m.jsx(PO,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),m.jsx(ku.Reject,{children:m.jsx(qv,{size:50,stroke:1.5,color:e.colors.red[5]})}),m.jsx(ku.Idle,{children:m.jsx(PO,{size:50,stroke:1.5})}),m.jsxs("div",{children:[m.jsx(ae,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),m.jsx(ae,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),m.jsx(Ke.Panel,{value:"json",pt:"xs",children:m.jsxs(Ne,{onSubmit:i,children:[m.jsx(dc,{"data-testid":"batch-input",name:"input",minRows:20,defaultValue:Kfe,deserialize:JSON.parse}),m.jsx(Z,{position:"right",mt:"xl",noWrap:!0,children:m.jsx(Y,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(r).length>0&&m.jsxs(m.Fragment,{children:[m.jsx("h3",{children:"Output"}),m.jsxs(Ke,{defaultValue:Object.keys(r)[0],children:[m.jsx(Ke.List,{children:Object.keys(r).map(l=>m.jsx(Ke.Tab,{value:l,children:l},l))}),Object.keys(r).map(l=>m.jsx(Ke.Panel,{value:l,children:m.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(r[l],void 0,2)})}))]}),m.jsx(Z,{position:"right",mt:"xl",noWrap:!0,children:m.jsx(Y,{onClick:()=>n({}),children:"Start over"})})]})]})}function Xfe(){const{resourceType:e}=et(),r=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(i=>!!i),n=re(),[o,a]=f.useState();return f.useEffect(()=>{n.searchResources("Questionnaire",`subject-type=${e}`).then(a).catch(console.log)},[n,e]),o?o.length===0?m.jsxs(_e,{children:[m.jsxs(fe,{children:["No apps for ",e]}),m.jsx(Re,{to:`/${e}`,children:"Return to search page"})]}):m.jsx(_e,{children:m.jsx("div",{children:o.map(i=>m.jsxs("div",{children:[m.jsx("h3",{children:m.jsx(Re,{to:`/forms/${i.id}?subject=`+r.map(l=>`${e}/${l}`).join(","),children:i.name})}),m.jsx("p",{children:i.description})]},i.id))})}):m.jsx(ca,{})}function Jfe(){const e=re(),[t,r]=f.useState(),[n,o]=f.useState(!1);return m.jsx(_e,{width:450,children:m.jsxs(Ne,{style:{maxWidth:400},onSubmit:a=>{r(void 0),e.post("auth/changepassword",a).then(()=>o(!0)).catch(i=>r(_t(i)))},children:[m.jsxs(Zt,{sx:{flexDirection:"column"},children:[m.jsx(Rn,{size:32}),m.jsx(fe,{children:"Change password"})]}),!n&&m.jsxs(je,{spacing:"xl",mt:"xl",children:[m.jsx(po,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:at(t,"oldPassword")}),m.jsx(po,{name:"newPassword",label:"New password",required:!0,error:at(t,"newPassword")}),m.jsx(po,{name:"confirmPassword",label:"Confirm new password",required:!0,error:at(t,"confirmPassword")}),m.jsx(Z,{position:"right",mt:"xl",noWrap:!0,children:m.jsx(Y,{type:"submit",children:"Change password"})})]}),n&&m.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}function Zfe(){const e=$t(),{resourceType:t}=et(),r=re(),[n,o]=f.useState();return m.jsxs(m.Fragment,{children:[m.jsx(Pn,{p:"xl",shadow:"xs",radius:0,children:m.jsxs(ae,{weight:500,children:["New ",t]})}),m.jsx(_e,{children:m.jsx(nN,{defaultValue:{resourceType:t},onSubmit:a=>{o(void 0),r.createResource(a).then(i=>e("/"+i.resourceType+"/"+i.id)).catch(i=>o(_t(i)))},outcome:n})})]})}function epe(){return m.jsx(_e,{children:m.jsxs(je,{children:[m.jsx(fe,{order:1,children:"Unexpected Error"}),m.jsx(ae,{children:"We're sorry, something went wrong."}),m.jsxs(ae,{children:["Please contact ",m.jsx(Be,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const ah=U(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 xe(e){const{classes:t}=ah();return m.jsx(Sl,{children:m.jsx("div",{className:t.root,children:e.children})})}xe.Entry=function(t){const{classes:r}=ah();return m.jsx("div",{className:r.entry,children:t.children})};xe.Key=function(t){const{classes:r}=ah();return m.jsx("div",{className:r.key,children:t.children})};xe.Value=function(t){const{classes:r}=ah();return m.jsx("div",{className:r.value,children:t.children})};function w3(e){var r,n;const t=Ze(e.patient);return t?m.jsxs(xe,{children:[m.jsx(ua,{value:t,size:"lg",color:tpe(t)}),m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Name"}),m.jsx(xe.Value,{children:m.jsx(Re,{to:t,children:t.name?m.jsx(r1,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&m.jsxs(m.Fragment,{children:[m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"DoB"}),m.jsx(xe.Value,{children:t.birthDate})]}),m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Age"}),m.jsx(xe.Value,{children:hne(t.birthDate)})]})]}),t.gender&&m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Gender"}),m.jsx(xe.Value,{children:t.gender})]}),t.address&&m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"State"}),m.jsx(xe.Value,{children:(r=t.address[0])==null?void 0:r.state})]}),(n=t.identifier)==null?void 0:n.map(o=>m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:o==null?void 0:o.system}),m.jsx(xe.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function tpe(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function _3(e){const t=Ze(e.resource);if(!t)return null;const r=[{key:"Type",value:m.jsx(Re,{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=xo(t);return i!==ct(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}),m.jsx(xe,{children:r.map(l=>m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:l.key}),m.jsx(xe.Value,{children:l.value})]},`${l.key}-${l.value}`))})}function O1(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function rpe(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 ed(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 va(e){var t;return w5((t=e.getActiveLogin())==null?void 0:t.project)}function npe(e,t){const r=new Blob([e],{type:Zr.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 ope(){const{id:e}=et(),t=ga(),n=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=re(),[a,i]=f.useState(!0),[l,c]=f.useState(),[u,d]=f.useState(),[p,h]=f.useState(),[g,v]=f.useState(),[w,E]=f.useState();if(f.useEffect(()=>{const x={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(n){const b=n.split(",").filter(S=>!!S);b.length===1&&x.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(x).then(b=>{var S,$,O,C,T,j,k;((O=($=(S=b.entry)==null?void 0:S[0])==null?void 0:$.response)==null?void 0:O.status)!=="200"?v((T=(C=b.entry)==null?void 0:C[0])==null?void 0:T.response):(c((j=b.entry[0])==null?void 0:j.resource),h((k=b.entry[1])==null?void 0:k.resource)),i(!1)}).catch(b=>{v(b),i(!1)})},[o,e,n]),g)return m.jsx(_e,{children:m.jsx("pre",{"data-testid":"error",children:JSON.stringify(g,void 0,2)})});if(w)return m.jsxs(_e,{children:[m.jsx(fe,{children:l==null?void 0:l.title}),m.jsx("p",{children:"Your response has been recorded."}),m.jsxs("ul",{children:[w.length===1&&m.jsx("li",{children:m.jsx(Re,{to:w[0],children:"Review your answers"})}),w.length>1&&m.jsxs("li",{children:["Review your answers:",m.jsx("ul",{children:w.map(x=>m.jsx("li",{children:m.jsx(Re,{to:x,children:ct(x)})},x.id))})]}),p&&m.jsx("li",{children:m.jsxs(Re,{to:p,children:["Back to ",xo(p)]})}),m.jsx("li",{children:m.jsx(Re,{to:"/",children:"Go back home"})})]})]});if(a||!l)return m.jsx(ca,{});const _=p&&O1(p);return m.jsxs(m.Fragment,{children:[_&&m.jsx(w3,{patient:_}),p&&p.resourceType!=="Patient"&&m.jsx(_3,{resource:p}),m.jsx(Pn,{p:"xl",shadow:"xs",radius:0,children:m.jsxs(ae,{children:[xo(l),u&&u.length>1&&m.jsxs(m.Fragment,{children:[" (for ",u.length," resources)"]})]})}),m.jsx(_e,{children:m.jsx(PN,{questionnaire:l,subject:p&&ut(p),onSubmit:y})})]});async function y(x){const b=[];if(!u||u.length===0)b.push(await o.createResource(x));else for(const S of u)b.push(await o.createResource({...x,subject:{reference:S}}));E(b)}}const ape=U(e=>({paper:{[`@media (max-width: ${e.breakpoints.sm})`]:{margin:2,padding:4}}}));function WO(){const{classes:e}=ape(),t=re(),r=$t(),n=ga(),[o,a]=f.useState();return f.useEffect(()=>{const i=Rne(n.pathname+n.search),l=b3(i,t.getUserConfiguration());n.pathname===`/${l.resourceType}`&&n.search===Vi(l)?(upe(l),a(l)):r(`/${l.resourceType}${Vi(l)}`)},[t,r,n]),!(o!=null&&o.resourceType)||!o.fields||o.fields.length===0?m.jsx(ca,{}):m.jsx(Pn,{shadow:"xs",m:"md",p:"xs",className:e.paper,children:m.jsx(Ec,{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}${Vi(i.definition)}`)},onNew:dpe(o.resourceType)?()=>{r(`/${o.resourceType}/new`)}:void 0,onExportCsv:()=>{const i=t.fhirUrl(o.resourceType,"$csv")+Vi(o);t.download(i).then(l=>{window.open(window.URL.createObjectURL(l),"_blank")}).catch(l=>de({color:"red",message:Ce(l)}))},onExportTransactionBundle:async()=>{fpe(o,t).then(i=>npe(JSON.stringify(i,void 0,2))).catch(i=>de({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=>de({color:"red",message:Ce(l)})))},onBulk:i=>{r(`/bulk/${o.resourceType}?ids=${i.join(",")}`)}})})}function b3(e,t){const r=e.resourceType||ipe(t),n=e.fields??lpe(r),o=e.filters??(e.resourceType?void 0:spe(r)),a=e.sortRules??cpe(r),i=e.offset??0,l=e.count??yc;return{...e,resourceType:r,fields:n,filters:o,sortRules:a,offset:i,count:l}}function ipe(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 lpe(e){const t=$1(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 spe(e){var t;return(t=$1(e))==null?void 0:t.filters}function cpe(e){const t=$1(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function $1(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function upe(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}function dpe(e){return e!=="Bot"&&e!=="ClientApplication"}async function fpe(e,t){const r={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},n=b3(r,t.getUserConfiguration()),o=await t.search(n.resourceType,Vi({...n,total:"accurate",fields:void 0}));return N5(o)}function ppe(){const e=re(),[t,r]=f.useState(void 0),[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=>de({color:"red",message:Ce(l)}))},[e]);const a=f.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),de({color:"green",message:"Success"})}).catch(c=>de({color:"red",message:Ce(c)}))},[e]),i=f.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return n===void 0?null:n?m.jsx(_e,{children:m.jsxs(Z,{children:[m.jsx(fe,{children:"MFA is enabled"}),m.jsx(Y,{onClick:i,children:"Disable MFA"})]})}):m.jsx(_e,{width:400,children:m.jsxs(Ne,{onSubmit:a,children:[m.jsx(fe,{children:"Multi Factor Auth Setup"}),m.jsx(Zt,{children:m.jsx("img",{src:t})}),m.jsx(oe,{name:"token",label:"Code"}),m.jsx(Z,{position:"right",mt:"xl",children:m.jsx(Y,{type:"submit",children:"Enroll"})})]})})}const mpe={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function $c(){return mpe}function hpe(){const e=$t(),[t]=E1(),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 m.jsxs(NN,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:$c().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:[m.jsx(Rn,{size:32}),m.jsx(fe,{children:"Sign in to Medplum"})]})}function gpe(){const e=re(),t=$t(),r=$c();return f.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),m.jsxs(Ice,{type:"project",onSuccess:()=>t("/"),googleClientId:r.googleClientId,recaptchaSiteKey:r.recaptchaSiteKey,children:[m.jsx(Rn,{size:32}),m.jsx(fe,{children:"Create a new account"})]})}function vpe(){const e=$t(),t=re(),[r,n]=f.useState(),[o,a]=f.useState(!1),i=$c().recaptchaSiteKey;return f.useEffect(()=>{IN(i)},[i]),m.jsx(_e,{width:450,children:m.jsxs(Ne,{style:{maxWidth:400},onSubmit:async l=>{let c="";c=await DN(i),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>a(!0)).catch(u=>n(_t(u)))},children:[m.jsxs(je,{spacing:"lg",mb:"xl",align:"center",children:[m.jsx(Rn,{size:32}),m.jsx(fe,{children:"Medplum Password Reset"})]}),m.jsxs(je,{spacing:"xl",children:[m.jsx(ui,{issues:s1(r,void 0)}),!o&&m.jsxs(m.Fragment,{children:[m.jsx(oe,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:at(r,"email")}),m.jsxs(Z,{position:"apart",mt:"xl",noWrap:!0,children:[m.jsx(Be,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),m.jsx(Y,{type:"submit",children:"Reset password"})]})]}),o&&m.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function ype(){var a;const e=$t(),t=re(),[r,n]=f.useState();f.useEffect(()=>{t.get("auth/me").then(n).catch(i=>de({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(()=>de({color:"green",message:"Login revoked"})).catch(l=>de({color:"red",message:Ce(l)}))}return r?m.jsxs(m.Fragment,{children:[m.jsxs(_e,{children:[m.jsx(fe,{children:"Security"}),m.jsxs(i1,{children:[m.jsx(Ji,{term:"ID",children:m.jsx(Be,{href:`/${ct(r.profile)}`,children:r.profile.id})}),m.jsx(Ji,{term:"Resource Type",children:r.profile.resourceType}),m.jsx(Ji,{term:"Name",children:gc((a=r.profile.name)==null?void 0:a[0])})]})]}),m.jsxs(_e,{children:[m.jsx(fe,{children:"Sessions"}),m.jsxs(si,{children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"OS"}),m.jsx("th",{children:"Browser"}),m.jsx("th",{children:"IP Address"}),m.jsx("th",{children:"Auth Method"}),m.jsx("th",{children:"Last Updated"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:r.security.sessions.map(i=>m.jsxs("tr",{children:[m.jsx("td",{children:i.os}),m.jsx("td",{children:i.browser}),m.jsx("td",{children:i.remoteAddress}),m.jsx("td",{children:i.authMethod}),m.jsx("td",{children:Pr(i.lastUpdated)}),m.jsx("td",{children:m.jsx(Be,{href:"#",onClick:()=>o(i.id),children:"Revoke"})})]},i.id))})]})]}),m.jsxs(_e,{children:[m.jsx(fe,{children:"Password"}),m.jsx(Y,{onClick:()=>e("/changepassword"),children:"Change password"})]}),m.jsxs(_e,{children:[m.jsx(fe,{children:"Multi Factor Auth"}),m.jsxs("p",{children:["Enrolled: ",r.security.mfaEnrolled.toString()]}),!r.security.mfaEnrolled&&m.jsx(Y,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function wpe(){const{id:e,secret:t}=et(),r=re(),[n,o]=f.useState(),[a,i]=f.useState(!1);return m.jsx(_e,{width:450,children:m.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(_t(u)))},children:[m.jsxs(Zt,{sx:{flexDirection:"column"},children:[m.jsx(Rn,{size:32}),m.jsx(fe,{children:"Set password"})]}),!a&&m.jsxs(je,{children:[m.jsx(po,{name:"password",label:"New password",required:!0,error:at(n,"password")}),m.jsx(po,{name:"confirmPassword",label:"Confirm new password",required:!0,error:at(n,"confirmPassword")}),m.jsx(Z,{position:"right",mt:"xl",children:m.jsx(Y,{type:"submit",children:"Set password"})})]}),a&&m.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",m.jsx(Re,{to:"/signin",children:"sign in"}),"."]})]})})}function _pe(){const e=$t(),[t]=E1(),r=$c();return m.jsxs(NN,{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:[m.jsx(Rn,{size:32}),m.jsx(fe,{children:"Sign in to Medplum"}),t.get("project")==="new"&&m.jsx("div",{children:"Sign in again to create a new project"})]})}function bpe(){const e=$t(),t=ga(),[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:m.jsx(yse,{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 ih(e){const t=re(),r=va(t),n=$t(),[o,a]=f.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:te.EQUALS,value:"Project/"+r},{code:"profile-type",operator:te.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return m.jsx(Ec,{search:o,onClick:i=>n(`/admin/members/${i.resource.id}`),onChange:i=>a(i.definition),hideFilters:!0,hideToolbar:!0})}function xpe(){return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Bots"}),m.jsx(ih,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),m.jsx(Z,{position:"right",children:m.jsx(Re,{to:"/admin/bots/new",children:"Create new bot"})})]})}function Epe(){return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Clients"}),m.jsx(ih,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),m.jsx(Z,{position:"right",children:m.jsx(Re,{to:"/admin/clients/new",children:"Create new client"})})]})}function lh(e){return m.jsx(Cl,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Ro(t)?e.onChange(ut(t)):e.onChange(void 0)}})}function Spe(){const e=re(),t=va(e),[r,n]=f.useState(""),[o,a]=f.useState(""),[i,l]=f.useState(),[c,u]=f.useState(),[d,p]=f.useState(void 0);return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Create new Bot"}),m.jsxs(Ne,{onSubmit:()=>{const h={name:r,description:o,accessPolicy:i};e.post("admin/projects/"+t+"/bot",h).then(g=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),p(g),de({color:"green",message:"Bot created"})}).catch(g=>{de({color:"red",message:Ce(g)}),u(_t(g))})},children:[!d&&m.jsxs(je,{children:[m.jsx(Xe,{title:"Name",htmlFor:"name",outcome:c,children:m.jsx(oe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>n(h.currentTarget.value),error:at(c,"name")})}),m.jsx(Xe,{title:"Description",htmlFor:"description",outcome:c,children:m.jsx(oe,{id:"description",name:"description",onChange:h=>a(h.currentTarget.value),error:at(c,"description")})}),m.jsx(Xe,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:m.jsx(lh,{name:"accessPolicy",onChange:l})}),m.jsx(Z,{position:"right",children:m.jsx(Y,{type:"submit",children:"Create Bot"})})]}),d&&m.jsxs("div",{"data-testid":"success",children:[m.jsx(ae,{children:"Bot created"}),m.jsxs(wr,{children:[m.jsx(wr.Item,{children:m.jsx(Re,{to:d,children:"Go to new bot"})}),m.jsx(wr.Item,{children:m.jsx(Re,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function Ppe(){const e=re(),t=va(e),[r,n]=f.useState(""),[o,a]=f.useState(""),[i,l]=f.useState(""),[c,u]=f.useState(),[d,p]=f.useState(),[h,g]=f.useState(void 0);return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Create new Client"}),m.jsxs(Ne,{onSubmit:()=>{const v={name:r,description:o,redirectUri:i,accessPolicy:c};e.post("admin/projects/"+t+"/client",v).then(w=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),g(w),de({color:"green",message:"Client created"})}).catch(w=>{de({color:"red",message:Ce(w)}),p(_t(w))})},children:[!h&&m.jsxs(je,{children:[m.jsx(Xe,{title:"Name",htmlFor:"name",outcome:d,children:m.jsx(oe,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:v=>n(v.currentTarget.value),error:at(d,"name")})}),m.jsx(Xe,{title:"Description",htmlFor:"description",outcome:d,children:m.jsx(oe,{id:"description",name:"description",onChange:v=>a(v.currentTarget.value),error:at(d,"description")})}),m.jsx(Xe,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:m.jsx(oe,{id:"redirectUri",name:"redirectUri",onChange:v=>l(v.currentTarget.value),error:at(d,"redirectUri")})}),m.jsx(Xe,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:m.jsx(lh,{name:"accessPolicy",onChange:u})}),m.jsx(Z,{position:"right",children:m.jsx(Y,{type:"submit",children:"Create Client"})})]}),h&&m.jsxs("div",{"data-testid":"success",children:[m.jsx(ae,{children:"Client created"}),m.jsxs(wr,{children:[m.jsx(wr.Item,{children:m.jsx(Re,{to:h,children:"Go to new client"})}),m.jsx(wr.Item,{children:m.jsx(Re,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function Ope(e){return m.jsx(Cl,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Ro(t)?e.onChange(ut(t)):e.onChange(void 0)}})}function $pe(){const{membershipId:e}=et(),t=re(),r=va(t),n=$t(),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(),[g,v]=f.useState(!1);function w(){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(E=>h(_t(E)))}return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Edit membership"}),m.jsx("h3",{children:m.jsx(Zi,{value:o.profile,link:!0})}),m.jsxs(Ne,{onSubmit:()=>{const E={...o,accessPolicy:a,userConfiguration:l,admin:u};t.post(`admin/projects/${r}/members/${e}`,E).then(()=>v(!0)).catch(_=>h(_t(_)))},children:[!g&&m.jsxs(je,{children:[m.jsx(Xe,{title:"Access Policy",htmlFor:"accessPolicy",outcome:p,children:m.jsx(lh,{name:"accessPolicy",defaultValue:a,onChange:i})}),m.jsx(Xe,{title:"User Configuration",htmlFor:"userConfiguration",outcome:p,children:m.jsx(Ope,{name:"userConfiguration",defaultValue:l,onChange:c})}),m.jsx(Xe,{title:"Admin",htmlFor:"admin",outcome:p,children:m.jsx(kn,{id:"admin",name:"admin",defaultChecked:u,onChange:E=>d(E.currentTarget.checked)})}),m.jsxs(Z,{position:"right",mt:"xl",children:[m.jsx(Y,{type:"submit",children:"Save"}),m.jsx(Y,{type:"button",color:"red",variant:"outline",onClick:w,children:"Remove user"})]})]}),g&&m.jsxs("div",{"data-testid":"success",children:[m.jsx("p",{children:"User updated"}),m.jsx("pre",{children:JSON.stringify(p,void 0,2)}),m.jsxs("p",{children:["Click ",m.jsx(Re,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Cpe(){const e=re(),[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 g={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,g).then(v=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Um(v)?i(v):d(v),c(g.sendEmail??!1),de({color:"green",message:"Invite success"})}).catch(v=>{de({color:"red",message:Ce(v)}),i(_t(v))})},[e,t,n]);return m.jsxs(Ne,{onSubmit:p,children:[!u&&!a&&m.jsxs(je,{children:[m.jsx(fe,{children:"Invite new member"}),e.isSuperAdmin()&&m.jsx(Xe,{title:"Project",htmlFor:"project",outcome:a,children:m.jsx(Cl,{resourceType:"Project",name:"project",defaultValue:t,onChange:r})}),m.jsx(dt,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:at(a,"resourceType")}),m.jsx(oe,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:at(a,"firstName")}),m.jsx(oe,{name:"lastName",label:"Last Name",required:!0,error:at(a,"lastName")}),m.jsx(oe,{name:"email",type:"email",label:"Email",required:!0,error:at(a,"email")}),m.jsx(Xe,{title:"Access Policy",htmlFor:"accessPolicy",outcome:a,children:m.jsx(lh,{name:"accessPolicy",onChange:o})}),m.jsx(kn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),m.jsx(kn,{name:"isAdmin",label:"Admin"}),m.jsx(Z,{position:"right",children:m.jsx(Y,{type:"submit",children:"Invite"})})]}),a&&m.jsxs("div",{"data-testid":"success",children:[m.jsx("p",{children:"User created, email couldn't be sent"}),m.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),m.jsxs("p",{children:["Click ",m.jsx(Re,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&m.jsxs("div",{"data-testid":"success",children:[m.jsx(ae,{children:"User created"}),l&&m.jsx(ae,{children:"Email sent"}),m.jsxs(wr,{children:[m.jsx(wr.Item,{children:m.jsx(Re,{to:u,children:"Go to new membership"})}),m.jsx(wr.Item,{children:m.jsx(Re,{to:u.profile,children:"Go to new profile"})}),m.jsx(wr.Item,{children:m.jsx(Re,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function kpe(){return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Patients"}),m.jsx(ih,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),m.jsx(Z,{position:"right",children:m.jsx(Re,{to:"/admin/invite",children:"Invite new patient"})})]})}function HO(){const e=re(),t=va(e),r=e.get(`admin/projects/${t}`).read();return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Details"}),m.jsxs(i1,{children:[m.jsx(Ji,{term:"ID",children:r.project.id}),m.jsx(Ji,{term:"Name",children:r.project.name})]})]})}const qO=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function jpe(){const e=$t(),r=ga().pathname.replace("/admin/","")||qO[0],n=re(),o=va(n),a=f.useMemo(()=>n.get("admin/projects/"+o).read(),[n,o]);function i(l){e(`/admin/${l}`)}return m.jsxs(m.Fragment,{children:[m.jsxs(Pn,{children:[m.jsx(xe,{children:m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Project"}),m.jsx(xe.Value,{children:a.project.name})]})}),m.jsx(Sl,{children:m.jsx(Ke,{value:r.toLowerCase(),onTabChange:i,children:m.jsx(Ke.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:qO.map(l=>m.jsx(Ke.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),m.jsx(_e,{children:m.jsx(JN,{})})]})}function Rpe(){const e=re(),t=va(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(),[a,i]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(o).catch(console.log)},[e]),f.useEffect(()=>{r&&i($l(r.project.secret||[]))},[e,r]),!n||!a?m.jsx("div",{children:"Loading..."}):m.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(()=>de({color:"green",message:"Saved"})).catch(console.log)},children:[m.jsx(fe,{children:"Project Secrets"}),m.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),m.jsx(ei,{property:n.types.Project.properties.secret,name:"secret",defaultValue:a,onChange:i}),m.jsx(Y,{type:"submit",children:"Save"})]})}function Tpe(){const e=re(),t=va(e),r=e.get(`admin/projects/${t}`).read(),[n,o]=f.useState(),[a,i]=f.useState();return f.useEffect(()=>{e.requestSchema("Project").then(o).catch(console.log)},[e]),f.useEffect(()=>{r&&i($l(r.project.site||[]))},[e,r]),!n||!a?m.jsx("div",{children:"Loading..."}):m.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(()=>de({color:"green",message:"Saved"})).catch(c=>{var d,p,h,g;const u=_t(c);de({color:"red",message:`Error ${(p=(d=u.issue)==null?void 0:d[0].details)==null?void 0:p.text} ${(g=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:g[0]}`})})},children:[m.jsx(fe,{children:"Project Sites"}),m.jsx("p",{children:"Use project sites configure your project on a separate domain."}),m.jsx(ei,{property:n.types.Project.properties.site,name:"site",defaultValue:a,onChange:i}),m.jsx(Y,{type:"submit",children:"Save"})]})}function Ipe(){const e=re();if(!e.isLoading()&&!e.isSuperAdmin())return m.jsx(ui,{outcome:Xre});function t(){ns(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function r(){ns(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function n(){ns(e,"Rebuilding Value Sets","admin/super/valuesets")}function o(u){ns(e,"Reindexing Resources","admin/super/reindex",u)}function a(u){ns(e,"Rebuilding Compartments","admin/super/compartments",u)}function i(u){e.post("admin/super/removebotidjobsfromqueue",u).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:Ce(d)}))}function l(u){e.post("admin/super/purge",{...u,before:aN(u.before)}).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:Ce(d)}))}function c(u){e.post("admin/super/setpassword",u).then(()=>de({color:"green",message:"Done"})).catch(d=>de({color:"red",message:Ce(d)}))}return m.jsxs(_e,{width:600,children:[m.jsx(fe,{order:1,children:"Super Admin"}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Structure Definitions"}),m.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."}),m.jsx(Ne,{children:m.jsx(Y,{onClick:t,children:"Rebuild StructureDefinitions"})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Search Parameters"}),m.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."}),m.jsx(Ne,{children:m.jsx(Y,{onClick:r,children:"Rebuild SearchParameters"})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Value Sets"}),m.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."}),m.jsx(Ne,{children:m.jsx(Y,{onClick:n,children:"Rebuild ValueSets"})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Reindex Resources"}),m.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),m.jsx(Ne,{onSubmit:o,children:m.jsxs(je,{children:[m.jsx(Xe,{title:"Resource Type",children:m.jsx(oe,{name:"resourceType",placeholder:"Reindex Resource Type"})}),m.jsx(Y,{type:"submit",children:"Reindex"})]})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Rebuild Compartments"}),m.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),m.jsx(Ne,{onSubmit:a,children:m.jsxs(je,{children:[m.jsx(Xe,{title:"Resource Type",children:m.jsx(oe,{name:"resourceType",placeholder:"Compartments Resource Type"})}),m.jsx(Y,{type:"submit",children:"Rebuild Compartments"})]})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Purge Resources"}),m.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),m.jsx(Ne,{onSubmit:l,children:m.jsxs(je,{children:[m.jsx(Xe,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:m.jsx(dt,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),m.jsx(Xe,{title:"Purge Before",htmlFor:"before",children:m.jsx(Ja,{name:"before",placeholder:"Before Date"})}),m.jsx(Y,{type:"submit",children:"Purge"})]})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Remove Bot ID Jobs from Queue"}),m.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),m.jsx(Ne,{onSubmit:i,children:m.jsxs(je,{children:[m.jsx(Xe,{title:"Bot ID",children:m.jsx(oe,{name:"botId",placeholder:"Bot Id"})}),m.jsx(Y,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),m.jsx(gr,{my:"lg"}),m.jsx(fe,{order:2,children:"Force Set Password"}),m.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.'}),m.jsx(Ne,{onSubmit:c,children:m.jsxs(je,{children:[m.jsx(oe,{name:"email",label:"Email",required:!0}),m.jsx(po,{name:"password",label:"Password",required:!0}),m.jsx(oe,{name:"projectId",label:"Project ID"}),m.jsx(Y,{type:"submit",children:"Force Set Password"})]})})]})}function ns(e,t,r,n){mo.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(()=>{mo.update({id:r,color:"green",title:t,message:"Done",icon:m.jsx(t3,{size:"1rem"}),autoClose:!1,withCloseButton:!0})}).catch(a=>{mo.update({id:r,color:"red",title:t,message:Ce(a),icon:m.jsx(qv,{size:"1rem"}),autoClose:!1,withCloseButton:!0})})}function Dpe(){return m.jsxs(m.Fragment,{children:[m.jsx(fe,{children:"Users"}),m.jsx(ih,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),m.jsx(Z,{position:"right",children:m.jsx(Re,{to:"/admin/invite",children:"Invite new user"})})]})}function Npe(){const t=re().searchResources("ObservationDefinition","_count=100").read();return m.jsxs(si,{withBorder:!0,withColumnBorders:!0,children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Category"}),m.jsx("th",{children:"Code"}),m.jsx("th",{children:"Method"}),m.jsx("th",{children:"Unit"}),m.jsx("th",{children:"Precision"}),m.jsx("th",{children:"Ranges"})]})}),m.jsx("tbody",{children:t.map(r=>{var n,o,a,i;return m.jsxs("tr",{children:[m.jsx("td",{children:m.jsx(Kn,{value:(n=r.category)==null?void 0:n[0]})}),m.jsx("td",{children:m.jsx(Kn,{value:r.code})}),m.jsx("td",{children:m.jsx(Kn,{value:r.method})}),m.jsx("td",{children:(a=(o=r.quantitativeDetails)==null?void 0:o.unit)==null?void 0:a.text}),m.jsx("td",{children:(i=r.quantitativeDetails)==null?void 0:i.decimalPrecision}),m.jsx("td",{children:m.jsx(Jv,{ranges:r.qualifiedInterval})})]},r.id)})})]})}function Jv(e){const{ranges:t}=e;if(!t)return null;const r=GO(t.map(o=>o.gender));if(r.length>1)return r.sort((o,a)=>o.localeCompare(a)),m.jsx(m.Fragment,{children:r.map(o=>{var a;return m.jsxs(f.Fragment,{children:[m.jsx("div",{children:m.jsx("strong",{children:cr(o)})}),m.jsx(Jv,{ranges:(a=e.ranges)==null?void 0:a.filter(i=>i.gender===o)})]},o)})});const n=GO(t.map(o=>o.age&&Gs(o.age)));return n.length>1?(n.sort((o,a)=>o.localeCompare(a)),m.jsx(m.Fragment,{children:n.map(o=>{var a;return m.jsxs(f.Fragment,{children:[m.jsx("div",{children:m.jsx("strong",{children:cr(o)})}),m.jsx(Jv,{ranges:(a=e.ranges)==null?void 0:a.filter(i=>Gs(i.age)===o)})]},o)})})):m.jsx(m.Fragment,{children:t.map(o=>m.jsx("table",{children:m.jsx("tbody",{children:m.jsxs("tr",{children:[m.jsx("td",{children:o.condition}),m.jsx("td",{children:m.jsx(l1,{value:o.range})})]})})},`range-${o.condition}`))})}function GO(e){return[...new Set(e.filter(t=>!!t))]}function Ape(){const e=re(),t=e.searchResources("ActivityDefinition","_count=100").read(),r=e.searchResources("ObservationDefinition","_count=100").read();return m.jsxs(si,{withBorder:!0,withColumnBorders:!0,children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Category"}),m.jsx("th",{children:"Assay"}),t.map(n=>m.jsx("th",{children:n.name},n.id))]})}),m.jsx("tbody",{children:r.map(n=>{var o;return m.jsxs("tr",{children:[m.jsx("td",{children:m.jsx(Kn,{value:(o=n.category)==null?void 0:o[0]})}),m.jsx("td",{children:m.jsx(Kn,{value:n.code})}),t.map(a=>{var i;return m.jsx("td",{children:(i=a.observationResultRequirement)!=null&&i.find(l=>{var c;return(c=l.reference)==null?void 0:c.includes(n.id)})?"✅":""},a.id)})]},n.id)})})]})}function Mpe(e){var i;const t=re(),[r,n]=f.useState(),[o,a]=f.useState();return o?m.jsxs(m.Fragment,{children:[m.jsx("p",{children:"Request group created successfully."}),m.jsxs("ul",{children:[m.jsxs("li",{children:["Go to the"," ",m.jsx(Re,{to:o,suffix:"checklist",children:"Request Group"})]}),m.jsxs("li",{children:["Back to the ",m.jsx(Re,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):m.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:m.jsxs(je,{children:[m.jsxs(fe,{children:['Start "',e.planDefinition.title,'"']}),m.jsxs(ae,{children:["Use the ",m.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),m.jsx(ae,{children:"The following tasks will be created:"}),m.jsx("ul",{children:(i=e.planDefinition.action)==null?void 0:i.map((l,c)=>{var u;return m.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&m.jsx(m.Fragment,{children:l.title}),l.code&&m.jsx(Kn,{value:l.code[0]})]},`action-${c}`)})}),m.jsx(Xe,{title:"Subject",children:m.jsx(Xm,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:r,onChange:n})}),m.jsx(Z,{position:"right",mt:"xl",children:m.jsx(Y,{type:"submit",children:"Go"})})]})})}function zpe(){const{resourceType:e,id:t}=et(),r=Ze({reference:e+"/"+t});return r?m.jsx(_e,{children:m.jsx(Mpe,{planDefinition:r})}):null}function Lpe(){const e=re(),{resourceType:t,id:r}=et(),n=Ze({reference:t+"/"+r}),[o,a]=f.useState(),[i,l]=f.useState();if(f.useEffect(()=>{e.searchResources("Questionnaire","subject-type="+t).then(a).catch(console.error),Fpe(t)&&e.searchResources("ClientApplication").then(l).catch(console.error)},[e,t]),!n||!o)return null;if(o.length===0&&(!i||i.length===0))return m.jsxs(_e,{children:[m.jsx(fe,{children:"Apps"}),m.jsxs("p",{children:["No apps found. Contact your administrator or ",m.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});function c(u){if(!n)return;const d={resourceType:"SmartAppLaunch"};switch(n.resourceType){case"Patient":d.patient=ut(n);break;case"Encounter":d.patient=n.subject,d.encounter=ut(n);break}e.createResource(d).then(p=>{const h=new URL(u.launchUri);h.searchParams.set("iss",e.getBaseUrl()+"fhir/R4"),h.searchParams.set("launch",p.id),window.location.assign(h.toString())}).catch(p=>de({color:"red",message:Ce(p)}))}return m.jsxs(_e,{children:[o.map(u=>m.jsxs("div",{children:[m.jsx(fe,{order:3,children:m.jsx(Re,{to:`/forms/${u.id}?subject=${ct(n)}`,children:u.title||u.name})}),m.jsx(ae,{children:u.description})]},u.id)),i==null?void 0:i.map(u=>m.jsxs("div",{children:[m.jsx(fe,{order:3,children:m.jsx(Be,{onClick:()=>c(u),children:u.name})}),m.jsx(ae,{children:u.description})]},u.id))]})}function Fpe(e){return e==="Patient"||e==="Encounter"}function Vpe(){const{resourceType:e,id:t}=et(),r=$t(),[n,o]=f.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return m.jsx(_e,{children:m.jsx(Ec,{search:n,onClick:a=>r(`/${a.resource.resourceType}/${a.resource.id}`),onChange:a=>o(a.definition),hideFilters:!0})})}function Bpe(){const e=re(),{resourceType:t,id:r}=et(),n=e.readHistory(t,r).read();return m.jsx(_e,{children:m.jsx(xce,{history:n})})}function Upe(e){const t="https://codeeditor.medplum.com/bot-runner.html";return m.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 Wpe(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),m.jsx("iframe",{frameBorder:"0",src:r.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:n=>{ed(n.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Hpe=`{
|
|
234
|
+
"resourceType": "Patient",
|
|
235
|
+
"name": [
|
|
236
|
+
{
|
|
237
|
+
"given": [
|
|
238
|
+
"Alice"
|
|
239
|
+
],
|
|
240
|
+
"family": "Smith"
|
|
241
|
+
}
|
|
242
|
+
]
|
|
243
|
+
}`,qpe="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-",Gpe=U(()=>({hl7Input:{fontFamily:"monospace",fontSize:"12px",lineHeight:1.55,padding:"10px 12px",whiteSpace:"nowrap",width:"100%"}}));function Qpe(){const e=re(),{id:t}=et(),[r,n]=f.useState(),[o,a]=f.useState(void 0),[i,l]=f.useState(Hpe),[c,u]=f.useState(qpe),[d,p]=f.useState(Zr.FHIR_JSON),{classes:h}=Gpe(),g=f.useRef(null),v=f.useRef(null),[w,E]=f.useState(!1);f.useEffect(()=>{e.readResource("Bot",t).then(async O=>{n(O),a(await Kpe(e,O))}).catch(O=>de({color:"red",message:Ce(O)}))},[e,t]);const _=f.useCallback(()=>ed(g.current,{command:"getValue"}),[g]),y=f.useCallback(()=>ed(g.current,{command:"getOutput"}),[g]),x=f.useCallback(async()=>d===Zr.FHIR_JSON?JSON.parse(i):c,[d,i,c]),b=f.useCallback(async O=>{O.preventDefault(),O.stopPropagation(),E(!0);try{const C=await _(),T=await e.createAttachment(C,"index.ts","text/typescript"),j=[];r!=null&&r.sourceCode?j.push({op:"replace",path:"/sourceCode",value:T}):j.push({op:"add",path:"/sourceCode",value:T}),await e.patchResource("Bot",t,j),de({color:"green",message:"Saved"})}catch(C){de({color:"red",message:Ce(C)})}finally{E(!1)}},[e,t,r,_]),S=f.useCallback(async O=>{O.preventDefault(),O.stopPropagation(),E(!0);try{const C=await y();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:C}),de({color:"green",message:"Deployed"})}catch(C){de({color:"red",message:Ce(C)})}finally{E(!1)}},[e,t,y]),$=f.useCallback(async O=>{O.preventDefault(),O.stopPropagation(),E(!0);try{const C=await x(),T=await e.post(e.fhirUrl("Bot",t,"$execute"),C,d);await ed(v.current,{command:"setValue",value:T}),de({color:"green",message:"Success"})}catch(C){de({color:"red",message:Ce(C)})}finally{E(!1)}},[e,t,x,d]);return!r||o===void 0?null:m.jsxs(tn,{m:0,gutter:0,style:{overflow:"hidden"},children:[m.jsx(tn.Col,{span:8,children:m.jsxs(Pn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[m.jsx(Wpe,{iframeRef:g,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),m.jsxs(Z,{position:"right",spacing:"xs",children:[m.jsx(Y,{type:"button",onClick:b,loading:w,leftIcon:m.jsx(cde,{size:"1rem"}),children:"Save"}),m.jsx(Y,{type:"button",onClick:S,loading:w,leftIcon:m.jsx(sde,{size:"1rem"}),children:"Deploy"}),m.jsx(Y,{type:"button",onClick:$,loading:w,leftIcon:m.jsx(gde,{size:"1rem"}),children:"Execute"})]})]})}),m.jsxs(tn.Col,{span:4,children:[m.jsxs(Pn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[m.jsx(dt,{data:[{label:"FHIR",value:Zr.FHIR_JSON},{label:"HL7",value:Zr.HL7_V2}],onChange:O=>p(O.currentTarget.value)}),d===Zr.FHIR_JSON?m.jsx(dc,{value:i,onChange:O=>l(O),minRows:15}):m.jsx("textarea",{className:h.hl7Input,value:c,onChange:O=>u(O.currentTarget.value),rows:15})]}),m.jsx(Pn,{m:2,p:"xs",shadow:"md",children:m.jsx(Upe,{iframeRef:v,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Kpe(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(b5);return(await e.download(e.fhirUrl("Binary",a))).text()}return t.code??""}function Cc(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Ype(){const e=re(),{resourceType:t,id:r}=et(),n={reference:t+"/"+r},o=f.useCallback(a=>{e.updateResource(Cc(a)).then(()=>{de({color:"green",message:"Success"})}).catch(i=>{de({color:"red",message:Ce(i)})})},[e]);switch(t){case"PlanDefinition":return m.jsx(_e,{children:m.jsx(_se,{value:n,onSubmit:o})});case"Questionnaire":return m.jsx(_e,{children:m.jsx(Fse,{questionnaire:n,onSubmit:o})});default:return null}}function Xpe(){const{resourceType:e,id:t}=et(),r=Ze({reference:e+"/"+t}),n=$t();return r?m.jsx(_e,{children:m.jsx(mce,{value:r,onStart:(o,a)=>n(`/forms/${w5(a)}`),onEdit:(o,a,i)=>n(`/${i.reference}}`)})}):null}function Jpe(){const e=re(),{resourceType:t,id:r}=et(),n=$t();return m.jsxs(_e,{children:[m.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),m.jsx(Y,{color:"red",onClick:()=>{e.deleteResource(t,r).then(()=>n(`/${t}`)).catch(o=>de({color:"red",message:Ce(o)}))},children:"Delete"})]})}function Zpe(){const{resourceType:e,id:t}=et(),r=Ze({reference:e+"/"+t});return r?m.jsx(_e,{children:m.jsx(f1,{value:r})}):null}function eme(){const e=re(),{resourceType:t,id:r}=et(),[n,o]=f.useState(),a=$t(),[i,l]=f.useState();f.useEffect(()=>{e.readResource(t,r).then(d=>o($l(d))).catch(d=>{l(_t(d)),de({color:"red",message:Ce(d)})})},[e,t,r]);const c=f.useCallback(d=>{l(void 0),e.updateResource(Cc(d)).then(()=>{a(`/${t}/${r}/details`),de({color:"green",message:"Success"})}).catch(p=>{l(_t(p)),de({color:"red",message:Ce(p)})})},[e,t,r,a]),u=f.useCallback(()=>a(`/${t}/${r}/delete`),[a,t,r]);return n?m.jsx(_e,{children:m.jsx(nN,{defaultValue:n,onSubmit:c,onDelete:u,outcome:i})}):null}function tme(){const e=re(),{resourceType:t,id:r}=et(),n=e.readHistory(t,r).read();return m.jsx(_e,{children:m.jsx(Cce,{history:n})})}function rme(){const e=re(),{resourceType:t,id:r}=et(),n=Ze({reference:t+"/"+r}),o=$t(),[a,i]=f.useState(),l=f.useCallback(c=>{e.updateResource(Cc(JSON.parse(c.resource))).then(()=>{i(void 0),o(`/${t}/${r}/details`),de({color:"green",message:"Success"})}).catch(u=>{de({color:"red",message:Ce(u)})})},[e,t,r,o]);return n?m.jsxs(_e,{children:[a&&m.jsx(ui,{outcome:a}),m.jsxs(Ne,{onSubmit:l,children:[m.jsx(dc,{name:"resource","data-testid":"resource-json",minRows:24,defaultValue:Or(n,!0),formatOnBlur:!0,deserialize:JSON.parse}),m.jsx(Z,{position:"right",mt:"xl",noWrap:!0,children:m.jsx(Y,{type:"submit",children:"OK"})})]})]}):null}function nme(){const{resourceType:e,id:t}=et();return Ze({reference:e+"/"+t})?m.jsxs(_e,{children:[m.jsxs(ic,{icon:m.jsx(ade,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",m.jsx("br",{}),m.jsx(Be,{href:`/forms/${t}`,children:`/forms/${t}`})]}),m.jsx(PN,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function ome(){const e=re(),{id:t}=et(),[r,n]=f.useState(),[o,a]=f.useState(0),i=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>ame(c,t));function l(){r&&e.createResource({resourceType:"Subscription",status:"active",reason:r.name,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:ct(r)}}).then(()=>{n(void 0),a(Date.now()),e.invalidateSearches("Subscription"),de({color:"green",message:"Success"})}).catch(c=>de({color:"red",message:Ce(c)}))}return m.jsxs(_e,{children:[m.jsx(fe,{children:"Bots"}),i.length===0&&m.jsx("p",{children:"No bots found."}),i.map(c=>{var u;return m.jsxs("div",{children:[m.jsx("h3",{children:m.jsx(xc,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),m.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),m.jsx("hr",{}),m.jsx(fe,{children:"Connect to bot"}),m.jsxs(Z,{children:[m.jsx(Cl,{name:"bot",resourceType:"Bot",onChange:n}),m.jsx(Y,{onClick:l,children:"Connect"})]}),m.jsx("div",{style:{display:"none"},children:o})]})}function ame(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 ime(){const{id:e}=et(),t=$t(),[r,n]=f.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:te.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return m.jsx(_e,{children:m.jsx(Ec,{search:r,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>n(o.definition),hideFilters:!0,hideToolbar:!0})})}function lme(){const e=re(),{resourceType:t,id:r}=et(),n=Ze({reference:t+"/"+r}),o=f.useCallback(a=>{e.updateResource(Cc(a)).then(()=>{de({color:"green",message:"Success"})}).catch(i=>{de({color:"red",message:Ce(i)})})},[e]);return n?m.jsx(_e,{children:m.jsx(ice,{onSubmit:o,definition:n})}):null}function sme(){const{resourceType:e,id:t}=et(),r=Ze({reference:e+"/"+t});return r?m.jsx(_e,{children:m.jsx(u1,{value:r})}):null}const cme=U(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 ume(e){const{classes:t,cx:r}=cme(),n=re(),o=Ze(e.value),[a,i]=f.useState();return f.useEffect(()=>{if(!o)return;const l=O1(o);if(!l)return;const c="reference"in l?l.reference:ct(l);n.search("ServiceRequest","subject="+c).then(u=>{const p=u.entry.map(h=>h.resource);dN(p),p.reverse(),i(p)}).catch(u=>de({color:"red",message:Ce(u)}))},[n,o]),a?m.jsx("div",{"data-testid":"quick-service-requests",className:t.container,children:a.map(l=>{var c,u,d,p,h,g,v;return m.jsxs("div",{className:r(t.entry,{[t.active]:l.id===(o==null?void 0:o.id)}),children:[m.jsx("p",{children:m.jsx(Re,{to:l,children:dme(l)})}),((u=(c=l.category)==null?void 0:c[0])==null?void 0:u.text)&&m.jsx("p",{children:(d=l.category[0])==null?void 0:d.text}),((g=(h=(p=l.code)==null?void 0:p.coding)==null?void 0:h[0])==null?void 0:g.code)&&m.jsx("p",{children:(v=l.code.coding[0])==null?void 0:v.code}),m.jsx("p",{children:fme(l)})]},l.id)})}):null}function dme(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function fme(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const pme=U(()=>({container:{position:"absolute",top:65,right:5,width:200,height:50,zIndex:15}}));function mme(e){var a,i,l,c;const{classes:t}=pme(),r=Ze(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),m.jsx("div",{className:t.container,children:m.jsx(dt,{defaultValue:e.defaultValue,onChange:u=>e.onChange(u.currentTarget.value),data:n})})}function hme(e){var r,n;const t=Ze(e.specimen);return t?m.jsxs(xe,{children:[m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Type"}),m.jsx(xe.Value,{children:"Specimen"})]}),m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Collected"}),m.jsx(xe.Value,{children:Pr((r=t.collection)==null?void 0:r.collectedDateTime)})]}),m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Specimen Age"}),m.jsx(xe.Value,{children:gme(t)})]}),(n=t.collection)!=null&&n.collectedDateTime&&t.receivedTime?m.jsxs(xe.Entry,{children:[m.jsx(xe.Key,{children:"Specimen Stability"}),m.jsx(xe.Value,{children:vme(t)})]}):m.jsx(m.Fragment,{})]}):null}function gme(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const r=new Date(t);return x3(E3(r,new Date))}function vme(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 x3(E3(t,r))}function x3(e){return e.toString().padStart(3,"0")+"D"}function E3(e,t){const r=t.getTime()-e.getTime();return Math.floor(r/(1e3*3600*24))}function yme(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"&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),t.push("Details","Edit","Event","History","Blame","JSON","Apps"),t}function wme(){var b,S,$,O,C,T,j;const e=re(),{resourceType:t,id:r}=et(),n={reference:t+"/"+r},o=$t(),[a,i]=f.useState(),l=Ze(n,i),c=yme(t),u=c[0].toLowerCase(),d=window.location.pathname.split("/").pop(),[p,h]=f.useState(d??u);async function g(){var z,N;const I=(N=(z=(await e.readHistory(t,r)).entry)==null?void 0:z.find(F=>!!F.resource))==null?void 0:N.resource;I?v(I):de({color:"red",message:"No history to restore"})}function v(k){e.updateResource(Cc(k)).then(()=>{i(void 0),de({color:"green",message:"Success"})}).catch(I=>{de({color:"red",message:Ce(I)})})}if(a)return Jre(a)?m.jsxs(_e,{children:[m.jsx(fe,{children:"Deleted"}),m.jsx("p",{children:"The resource was deleted."}),m.jsx(Y,{color:"red",onClick:g,children:"Restore"})]}):m.jsx(ui,{outcome:a});function w(k){h(k),o(`/${t}/${r}/${k}`)}function E(k){const I=l,z=I.orderDetail||[];z.length===0&&z.push({}),z[0].text!==k&&(z[0].text=k,v({...I,orderDetail:z}))}const _=l&&O1(l),y=l&&rpe(l),x=($=(S=(b=e.getUserConfiguration())==null?void 0:b.option)==null?void 0:S.find(k=>k.id==="statusValueSet"))==null?void 0:$.valueString;return m.jsxs(m.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&x&&m.jsx(mme,{valueSet:{reference:x},defaultValue:(C=(O=l.orderDetail)==null?void 0:O[0])==null?void 0:C.text,onChange:E},ct(l)+"-"+((j=(T=l.orderDetail)==null?void 0:T[0])==null?void 0:j.text)),l&&m.jsx(ume,{value:l}),l&&m.jsxs(Pn,{children:[_&&m.jsx(w3,{patient:_}),y&&m.jsx(hme,{specimen:y}),t!=="Patient"&&m.jsx(_3,{resource:n}),m.jsx(Sl,{children:m.jsx(Ke,{value:p.toLowerCase(),onTabChange:w,children:m.jsx(Ke.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(k=>m.jsx(Ke.Tab,{value:k.toLowerCase(),children:k},k))})})})]}),m.jsx(JN,{})]})}function QO(){var _,y,x,b;const e=$t(),{resourceType:t,id:r,versionId:n,tab:o}=et(),a=re(),[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(S=>u(S)).then(()=>l(!1)).catch(S=>{p(S),l(!1)})},[a,t,r]),i)return m.jsx(ca,{});if(!c)return m.jsxs(_e,{children:[m.jsx(fe,{children:"Resource not found"}),m.jsx(Re,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,g=h.findIndex(S=>{var $,O;return((O=($=S.resource)==null?void 0:$.meta)==null?void 0:O.versionId)===n});if(g===-1)return m.jsxs(_e,{children:[m.jsx(fe,{children:"Version not found"}),m.jsx(Re,{to:`/${t}/${r}`,children:"Return to resource"})]});const v=h[g].resource,w=g<h.length-1?h[g+1].resource:void 0,E="diff";return m.jsx(m.Fragment,{children:m.jsxs(Ke,{value:o||E,onTabChange:S=>e(`/${t}/${r}/_history/${n}/${S}`),children:[m.jsxs(Pn,{children:[m.jsx(bc,{fluid:!0,p:"md",children:m.jsx(ae,{children:`${t} ${r}`})}),m.jsxs(Ke.List,{children:[m.jsx(Ke.Tab,{value:"diff",children:"Diff"}),m.jsx(Ke.Tab,{value:"raw",children:"Raw"})]})]}),m.jsxs(_e,{children:[d&&m.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),m.jsx(Ke.Panel,{value:"diff",children:w?m.jsxs(m.Fragment,{children:[m.jsxs("ul",{children:[m.jsxs("li",{children:["Current: ",(_=v.meta)==null?void 0:_.versionId]}),m.jsxs("li",{children:["Previous:"," ",m.jsx(Re,{to:`/${t}/${r}/_history/${(y=w.meta)==null?void 0:y.versionId}`,children:(x=w.meta)==null?void 0:x.versionId})]})]}),m.jsx(Oce,{original:w,revised:v})]}):m.jsxs(m.Fragment,{children:[m.jsxs("ul",{children:[m.jsxs("li",{children:["Current: ",(b=v.meta)==null?void 0:b.versionId]}),m.jsx("li",{children:"Previous: (none)"})]}),m.jsx("pre",{children:JSON.stringify(v,void 0,2)})]})}),m.jsx(Ke.Panel,{value:"raw",children:m.jsx("pre",{children:JSON.stringify(v,void 0,2)})})]})]})})}function _me(){const{resourceType:e,id:t}=et(),r=$t(),[n,o]=f.useState({resourceType:"Subscription",filters:[{code:"url",operator:te.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return m.jsx(_e,{children:m.jsx(Ec,{search:n,onClick:a=>r(`/${a.resource.resourceType}/${a.resource.id}`),onChange:a=>o(a.definition),hideFilters:!0})})}function KO(){const{resourceType:e,id:t}=et(),r={reference:e+"/"+t};switch(e){case"Encounter":return m.jsx(Ole,{encounter:r});case"Patient":return m.jsx(wse,{patient:r});case"ServiceRequest":return m.jsx(Rce,{serviceRequest:r});default:return m.jsx(Ple,{resource:r})}}function bme(){return m.jsx(Gue,{children:m.jsxs(ue,{errorElement:m.jsx(epe,{}),children:[m.jsx(ue,{path:"/signin",element:m.jsx(_pe,{})}),m.jsx(ue,{path:"/oauth",element:m.jsx(hpe,{})}),m.jsx(ue,{path:"/resetpassword",element:m.jsx(vpe,{})}),m.jsx(ue,{path:"/setpassword/:id/:secret",element:m.jsx(wpe,{})}),m.jsx(ue,{path:"/register",element:m.jsx(gpe,{})}),m.jsx(ue,{path:"/changepassword",element:m.jsx(Jfe,{})}),m.jsx(ue,{path:"/security",element:m.jsx(ype,{})}),m.jsx(ue,{path:"/mfa",element:m.jsx(ppe,{})}),m.jsx(ue,{path:"/batch",element:m.jsx(Yfe,{})}),m.jsx(ue,{path:"/bulk/:resourceType",element:m.jsx(Xfe,{})}),m.jsx(ue,{path:"/smart",element:m.jsx(bpe,{})}),m.jsx(ue,{path:"/forms/:id",element:m.jsx(ope,{})}),m.jsx(ue,{path:"/admin/super",element:m.jsx(Ipe,{})}),m.jsxs(ue,{path:"/admin",element:m.jsx(jpe,{}),children:[m.jsx(ue,{path:"patients",element:m.jsx(kpe,{})}),m.jsx(ue,{path:"bots/new",element:m.jsx(Spe,{})}),m.jsx(ue,{path:"bots",element:m.jsx(xpe,{})}),m.jsx(ue,{path:"clients/new",element:m.jsx(Ppe,{})}),m.jsx(ue,{path:"clients",element:m.jsx(Epe,{})}),m.jsx(ue,{path:"details",element:m.jsx(HO,{})}),m.jsx(ue,{path:"invite",element:m.jsx(Cpe,{})}),m.jsx(ue,{path:"users",element:m.jsx(Dpe,{})}),m.jsx(ue,{path:"project",element:m.jsx(HO,{})}),m.jsx(ue,{path:"secrets",element:m.jsx(Rpe,{})}),m.jsx(ue,{path:"sites",element:m.jsx(Tpe,{})}),m.jsx(ue,{path:"members/:membershipId",element:m.jsx($pe,{})})]}),m.jsx(ue,{path:"/lab/assays",element:m.jsx(Npe,{})}),m.jsx(ue,{path:"/lab/panels",element:m.jsx(Ape,{})}),m.jsx(ue,{path:"/:resourceType/:id/_history/:versionId/:tab",element:m.jsx(QO,{})}),m.jsx(ue,{path:"/:resourceType/:id/_history/:versionId",element:m.jsx(QO,{})}),m.jsx(ue,{path:"/:resourceType/new",element:m.jsx(Zfe,{})}),m.jsxs(ue,{path:"/:resourceType/:id",element:m.jsx(wme,{}),children:[m.jsx(ue,{index:!0,element:m.jsx(KO,{})}),m.jsx(ue,{path:"apply",element:m.jsx(zpe,{})}),m.jsx(ue,{path:"apps",element:m.jsx(Lpe,{})}),m.jsx(ue,{path:"event",element:m.jsx(Vpe,{})}),m.jsx(ue,{path:"blame",element:m.jsx(Bpe,{})}),m.jsx(ue,{path:"bots",element:m.jsx(ome,{})}),m.jsx(ue,{path:"builder",element:m.jsx(Ype,{})}),m.jsx(ue,{path:"checklist",element:m.jsx(Xpe,{})}),m.jsx(ue,{path:"delete",element:m.jsx(Jpe,{})}),m.jsx(ue,{path:"details",element:m.jsx(Zpe,{})}),m.jsx(ue,{path:"edit",element:m.jsx(eme,{})}),m.jsx(ue,{path:"editor",element:m.jsx(Qpe,{})}),m.jsx(ue,{path:"history",element:m.jsx(tme,{})}),m.jsx(ue,{path:"json",element:m.jsx(rme,{})}),m.jsx(ue,{path:"preview",element:m.jsx(nme,{})}),m.jsx(ue,{path:"responses",element:m.jsx(ime,{})}),m.jsx(ue,{path:"report",element:m.jsx(sme,{})}),m.jsx(ue,{path:"ranges",element:m.jsx(lme,{})}),m.jsx(ue,{path:"subscriptions",element:m.jsx(_me,{})}),m.jsx(ue,{path:"timeline",element:m.jsx(KO,{})})]}),m.jsx(ue,{path:"/:resourceType",element:m.jsx(WO,{})}),m.jsx(ue,{path:"/",element:m.jsx(WO,{})})]})})}function xme(){const e=re(),t=e.getUserConfiguration(),r=ga(),[n]=E1();return e.isLoading()?m.jsx(ca,{}):m.jsx(gie,{logo:m.jsx(Rn,{size:24}),pathname:r.pathname,searchParams:n,version:Woe,menus:Eme(t),displayAddBookmark:!!(t!=null&&t.id),children:m.jsx(f.Suspense,{fallback:m.jsx(ca,{}),children:m.jsx(bme,{})})})}function Eme(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:Sme(a.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:m.jsx(pde,{})}]}),t}const YO={Patient:wde,Practitioner:dde,Organization:lde,ServiceRequest:vde,DiagnosticReport:yde,Questionnaire:ude,admin:ide,AccessPolicy:fde,Subscription:_de,batch:hde,Observation:mde};function Sme(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in YO){const r=YO[t];return m.jsx(r,{})}}catch{}return m.jsx(Bm,{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 Pme(){const e=$c(),t=new Xoe({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=Yue([{path:"*",element:m.jsx(xme,{})}]),o=i=>n.navigate(i);AN(document.getElementById("root")).render(m.jsx(s.StrictMode,{children:m.jsx(tae,{medplum:t,navigate:o,children:m.jsxs(F$,{theme:r,withGlobalStyles:!0,withNormalizeCSS:!0,children:[m.jsx(ci,{position:"bottom-right"}),m.jsx(Wue,{router:n})]})})}))}Pme().catch(console.error);
|
|
244
|
+
//# sourceMappingURL=index-e4ab9243.js.map
|